@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060608;
  --bg-elevated: #0c0c10;
  --surface: rgba(18, 18, 24, 0.92);
  --surface-hover: rgba(28, 28, 36, 0.95);
  --surface-solid: #121218;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --text-muted: rgba(161, 161, 170, 0.92);
  --text-soft: rgba(113, 113, 122, 0.95);
  --accent: #f59e0b;
  --accent-2: #fb923c;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-glow: rgba(245, 158, 11, 0.35);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --sidebar-w: 272px;
  --topbar-h: 64px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(245, 158, 11, 0.08), 0 20px 60px rgba(245, 158, 11, 0.08);
  --stat-hover-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --body-gradient:
    radial-gradient(circle at 15% 10%, rgba(245, 158, 11, 0.08), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(251, 146, 60, 0.06), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.03), transparent 40%);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  --chip-bg: rgba(255, 255, 255, 0.03);
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-hover: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-focus-bg: rgba(255, 255, 255, 0.05);
  --select-bg: #121218;
  --select-option-bg: #121218;
  --select-option-color: #f4f4f5;
  --header-bg: rgba(6, 6, 8, 0.72);
  --sidebar-bg: rgba(8, 8, 12, 0.92);
  --topbar-bg: rgba(6, 6, 8, 0.55);
  --toast-bg: rgba(18, 18, 24, 0.96);
  --toast-error-bg: rgba(40, 16, 16, 0.96);
  --table-head-bg: rgba(255, 255, 255, 0.02);
  --table-row-hover: rgba(255, 255, 255, 0.02);
  --nav-hover-bg: rgba(255, 255, 255, 0.05);
  --nav-active-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  --nav-active-border: rgba(245, 158, 11, 0.18);
  --backdrop: rgba(0, 0, 0, 0.55);
  --preview-bar-bg: rgba(255, 255, 255, 0.02);
  --preview-dot: rgba(255, 255, 255, 0.12);
  --preview-step-bg: rgba(255, 255, 255, 0.02);
  --features-bg: rgba(255, 255, 255, 0.015);
  --cta-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.02));
  --auth-showcase-bg:
    radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  --error-text: #fecaca;
  --demo-link: #fde68a;
  --meta-theme: #060608;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ef;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(255, 255, 255, 0.98);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #18181b;
  --text-muted: #52525b;
  --text-soft: #71717a;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 40px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 0 1px rgba(245, 158, 11, 0.12), 0 20px 60px rgba(245, 158, 11, 0.08);
  --stat-hover-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --body-gradient:
    radial-gradient(circle at 15% 10%, rgba(245, 158, 11, 0.14), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(251, 146, 60, 0.1), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(15, 23, 42, 0.04), transparent 40%);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  --chip-bg: rgba(15, 23, 42, 0.03);
  --ghost-bg: rgba(15, 23, 42, 0.04);
  --ghost-hover: rgba(15, 23, 42, 0.08);
  --input-bg: rgba(255, 255, 255, 0.95);
  --input-focus-bg: #ffffff;
  --select-bg: #ffffff;
  --select-option-bg: #ffffff;
  --select-option-color: #18181b;
  --header-bg: rgba(245, 243, 239, 0.88);
  --sidebar-bg: rgba(255, 255, 255, 0.94);
  --topbar-bg: rgba(255, 255, 255, 0.78);
  --toast-bg: rgba(255, 255, 255, 0.98);
  --toast-error-bg: rgba(254, 242, 242, 0.98);
  --table-head-bg: rgba(15, 23, 42, 0.03);
  --table-row-hover: rgba(15, 23, 42, 0.02);
  --nav-hover-bg: rgba(15, 23, 42, 0.05);
  --nav-active-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.08));
  --nav-active-border: rgba(245, 158, 11, 0.22);
  --backdrop: rgba(15, 23, 42, 0.35);
  --preview-bar-bg: rgba(15, 23, 42, 0.03);
  --preview-dot: rgba(15, 23, 42, 0.15);
  --preview-step-bg: rgba(15, 23, 42, 0.03);
  --features-bg: rgba(255, 255, 255, 0.72);
  --cta-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(255, 255, 255, 0.8));
  --auth-showcase-bg:
    radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.1), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent);
  --error-text: #991b1b;
  --demo-link: #b45309;
  --meta-theme: #f5f3ef;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--body-gradient);
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

.serif, .display { font-family: var(--font-display); font-weight: 400; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px rgba(245, 158, 11, 0.32);
}

.btn-ghost {
  background: var(--ghost-bg);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--ghost-hover);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

/* Forms */
.input, .select, .textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
  background: var(--input-focus-bg);
}

.select {
  appearance: none;
  background-color: var(--select-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
  cursor: pointer;
}

[data-theme="dark"] .select {
  color-scheme: dark;
}

[data-theme="light"] .select {
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.select option,
.select optgroup,
select option,
select optgroup {
  background-color: var(--select-option-bg);
  color: var(--select-option-color);
}

.select option:checked,
select option:checked {
  background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft));
  color: var(--text);
}

.select option:hover,
select option:hover {
  background-color: var(--accent-soft);
  color: var(--text);
}

.textarea { resize: vertical; min-height: 120px; }

.field { display: block; margin-bottom: 16px; }

.field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cards */
.card {
  border: 1px solid var(--border);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-flat {
  background: var(--surface-solid);
}

.card-glow {
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  background: var(--chip-bg);
}

.badge-ok {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.25);
  background: var(--success-soft);
}

.badge-warn {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.1);
}

.badge-accent {
  color: var(--accent);
  border-color: rgba(245, 158, 11, 0.25);
  background: var(--accent-soft);
}

/* Alerts */
.error {
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: var(--error-text);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--toast-bg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 500;
  animation: toast-in 0.25s ease;
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: var(--toast-error-bg);
  color: var(--error-text);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tables */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--table-head-bg);
}

.table tbody tr:hover {
  background: var(--table-row-hover);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* Grids */
.grid-2 {
  display: grid;
  gap: 16px;
}

.grid-3 {
  display: grid;
  gap: 16px;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Landing */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  background: var(--header-bg);
}

.site-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
}

.brand-tag {
  font-size: 12px;
  color: var(--text-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 48px;
  padding: 72px 24px 96px;
  max-width: 1120px;
  margin: 0 auto;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    padding-top: 96px;
  }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
  margin: 16px 0 0;
  letter-spacing: -0.02em;
}

.hero-copy p.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 560px;
  margin: 20px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-app {
  position: relative;
}

.hero-app::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 65%);
  filter: blur(24px);
  z-index: -1;
}

.app-preview {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
}

.app-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--preview-bar-bg);
}

.app-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--preview-dot);
}

.app-preview-body {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.preview-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--preview-step-bg);
  font-size: 14px;
  font-weight: 500;
}

.preview-step-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.features {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 88px 24px;
  background: var(--features-bg);
}

.features h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  margin: 0 0 28px;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.cta-band {
  position: relative;
  z-index: 1;
  padding: 0 24px 96px;
}

.cta-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: var(--cta-bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Login */
.auth-page {
  min-height: 100vh;
  display: grid;
  position: relative;
  z-index: 1;
}

@media (min-width: 960px) {
  .auth-page {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: min(420px, 100%);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 42px;
  margin: 18px 0 8px;
}

.auth-showcase {
  display: none;
  padding: 48px;
  border-left: 1px solid var(--border);
  background: var(--auth-showcase-bg);
}

@media (min-width: 960px) {
  .auth-showcase { display: flex; flex-direction: column; justify-content: center; }
}

.auth-showcase h2 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.05;
  margin: 16px 0;
}

.auth-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.auth-stat {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
}

.auth-stat strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

/* App shell */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
}

.app-brand-text strong {
  display: block;
  font-size: 15px;
}

.app-brand-text span {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.app-nav {
  padding: 8px 12px;
  display: grid;
  gap: 4px;
  flex: 1;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.app-nav a svg {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  flex-shrink: 0;
}

.app-nav a:hover {
  background: var(--nav-hover-bg);
  color: var(--text);
}

.app-nav a.active {
  background: var(--nav-active-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--nav-active-border);
}

.app-nav a.active svg {
  opacity: 1;
  color: var(--accent);
}

.app-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 146, 60, 0.15));
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.user-meta strong {
  display: block;
  font-size: 13px;
}

.user-meta span {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
}

.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-topbar-title {
  font-size: 14px;
  font-weight: 700;
}

.app-topbar-sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.app-main {
  flex: 1;
  padding: 28px 24px 40px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1.05;
  margin: 10px 0 0;
}

.page-header p {
  margin: 10px 0 0;
  color: var(--text-muted);
  max-width: 640px;
}

.stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.18);
  box-shadow: var(--stat-hover-shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: -0.03em;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.split-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 960px) {
  .split-grid { grid-template-columns: 1.2fr 0.8fr; }
}

.list-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.list-stack li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.list-stack li:last-child { border-bottom: 0; }

.article-card h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.article-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.article-card-footer {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.demo-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(251, 146, 60, 0.08));
  border-bottom: 1px solid rgba(245, 158, 11, 0.18);
  color: var(--accent);
  text-align: center;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
}

.demo-banner a {
  color: var(--demo-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-disabled input,
.demo-disabled textarea,
.demo-disabled select,
.demo-disabled button {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.82;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

.mobile-nav-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1023px) {
  .app { flex-direction: column; }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-md);
  }

  .app-sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-toggle { display: inline-flex; }

  .app-main { padding-top: 20px; }
}

/* Theme toggle */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle .theme-icon-sun { display: block; }
.theme-toggle .theme-icon-moon { display: none; }

[data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
[data-theme="light"] .theme-toggle .theme-icon-moon { display: block; }

.auth-toolbar {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}
