:root {
  --bg: #090b14;
  --panel: #111827;
  --card: #151f32;
  --primary: #8b5cf6;
  --primary-dark: #6d43d8;
  --text: #ffffff;
  --muted: #9ca3af;
  --line: rgba(255,255,255,0.08);
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #1f1140 0%, var(--bg) 45%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

/* LOGIN */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 36px;
  box-shadow: var(--shadow);
  text-align: center;
}

.logo {
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #22d3ee);
  border-radius: 22px;
  font-size: 34px;
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 32px;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0b1020;
  color: var(--text);
  outline: none;
  font-size: 16px;
  margin-bottom: 14px;
}

.login-card button,
.open-btn {
  width: 100%;
  display: inline-block;
  padding: 15px 18px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.login-card button:hover,
.open-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

#errorMsg {
  display: block;
  margin-top: 12px;
  color: #fb7185;
}

/* PANEL */

.panel {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(9, 11, 20, 0.85);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 36px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.brand h2 {
  margin: 0;
  font-size: 20px;
}

.brand span {
  color: var(--muted);
  font-size: 14px;
}

.sidebar nav {
  display: grid;
  gap: 10px;
}

.filter-btn,
.logout {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 15px;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: white;
}

.logout {
  margin-top: 30px;
  color: #fb7185;
}

.content {
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 36px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.topbar input {
  width: 320px;
  max-width: 100%;
  padding: 15px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0b1020;
  color: white;
  outline: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stats div {
  background: rgba(21, 31, 50, 0.88);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
}

.stats strong {
  display: block;
  font-size: 24px;
}

.stats span {
  color: var(--muted);
  font-size: 14px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.tool-card {
  background: rgba(21, 31, 50, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.65);
}

.tool-icon {
  width: 54px;
  height: 54px;
  background: #0b1020;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 12px;
}

.tool-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.6;
  min-height: 78px;
}

/* MÓVIL */

@media (max-width: 1000px) {
  .panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar input {
    width: 100%;
  }
}

@media (max-width: 650px) {
  .content {
    padding: 20px;
  }

  .tools-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .login-card {
    padding: 26px;
  }
}
