:root {
  --bg-light: #f4f6fb;
  --bg-dark: #020617;
  --card-light: #ffffff;
  --card-dark: #111827;
  --primary: #2563eb;
  --text-light: #0f172a;
  --text-dark: #f9fafb;
  --border-soft: #e5e7eb;
  --radius-lg: 18px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
}

body.theme-dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.container {
  max-width: 1120px;
  margin: 1.5rem auto 2rem;
  padding: 0 1.25rem 2rem;
}

.card {
  background: var(--card-light);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 18px 45px rgba(15,23,42,0.10);
}
body.theme-dark .card {
  background: var(--card-dark);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

/* Topbar */
.topbar {
  height: 56px;
  background: #020617;
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .75rem 0 1rem;
  box-shadow: 0 14px 40px rgba(15,23,42,0.65);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .9rem;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.user-name {
  font-size: .85rem;
  opacity: .85;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  padding: .55rem 1.3rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-ghost {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.55);
  background: transparent;
  color: inherit;
  padding: .35rem .9rem;
  font-size: .8rem;
  cursor: pointer;
}

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, rgba(37,99,235,0.20), transparent),
              radial-gradient(circle at bottom right, rgba(129,140,248,0.22), transparent),
              var(--bg-light);
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 22px;
  padding: 2rem;
  box-shadow: 0 26px 60px rgba(15,23,42,0.30);
}
.auth-card h1 { margin: 0 0 .3rem; }
.auth-card .subtitle {
  margin: 0 0 1rem;
  color: #6b7280;
  font-size: .88rem;
}
.auth-card label {
  display: block;
  margin-top: .8rem;
  font-size: .84rem;
  font-weight: 500;
}
.auth-card input {
  width: 100%;
  margin-top: .2rem;
  padding: .55rem .7rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: .9rem;
}
.auth-card .btn-primary {
  width: 100%;
  margin-top: 1.1rem;
}
.alert {
  padding: .6rem .8rem;
  border-radius: 12px;
  font-size: .82rem;
  margin-bottom: .5rem;
}
.alert-danger {
  background: #fee2e2;
  color: #b91c1c;
}

@media (max-width: 768px) {
  .container {
    padding: 0 .75rem 1.5rem;
  }
}
