:root {
  /* Brand */
  --brand: #2563EB;
  --brand-light: #3B82F6;
  --brand-soft: #EFF3FF;
  --brand-ghost: #F5F7FF;

  /* Neutrals */
  --ink: #1E293B;
  --ink-light: #334155;
  --muted: #94A3B8;
  --line: #E8ECF1;
  --line-light: #F1F4F8;

  /* Surfaces */
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --bg: #F7F9FC;
  --bg-alt: #F1F4F9;

  /* Semantic */
  --success: #10B981;
  --success-soft: #ECFDF5;
  --warning: #F59E0B;
  --warning-soft: #FFFBEB;
  --danger: #EF4444;
  --danger-soft: #FEF2F2;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.10), 0 6px 16px rgba(15, 23, 42, 0.04);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;

  /* Sidebar */
  --sidebar-w: 264px;
  --sidebar-collapsed-w: 72px;
  --topbar-h: 72px;

  /* Typography */
  --font: 'Be Vietnam Pro', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
}

/* Dark theme */
html[data-theme="dark"] {
  --ink: #E2E8F0;
  --ink-light: #CBD5E1;
  --muted: #64748B;
  --line: #1E293B;
  --line-light: #263348;
  --surface: #0F172A;
  --surface-2: #1E293B;
  --bg: #0B1120;
  --bg-alt: #131C32;
  --brand-soft: #1E3A6E;
  --brand-ghost: #172554;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
  --success-soft: #052E16;
  --warning-soft: #422006;
  --danger-soft: #450A0A;
}

/* ─── Reset ──────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

body.menu-open {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img,
svg {
  display: block;
}

svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.25;
}

p {
  margin: 0;
}

/* ─── App Shell ─────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-area {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  transition: margin var(--duration-normal) var(--ease-out);
}

.app-shell.sidebar-collapsed .main-area {
  margin-left: var(--sidebar-collapsed-w);
}

/* ─── Page Content ──────────────────── */
.page-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 36px 48px;
  flex: 1;
}

/* ─── Footer ────────────────────────── */
.app-footer {
  padding: 0 36px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ─── Section Kicker ────────────────── */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-kicker::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

/* ─── Section Heading ───────────────── */
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading-row h3,
.card-heading h3 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.card-heading h3 {
  margin: 6px 0 0;
}

/* ─── Updated Label ─────────────────── */
.updated-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.updated-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
  display: inline-block;
}

/* ─── Icon Button ───────────────────── */
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-light);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.icon-button:hover {
  background: var(--bg-alt);
  border-color: var(--muted);
  color: var(--ink);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

/* ─── Sidebar Overlay ───────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 40;
}

.sidebar-overlay.show {
  display: block;
}

/* ─── Responsive ────────────────────── */
@media (max-width: 1024px) {
  .main-area {
    margin-left: 0 !important;
  }

  .page-content {
    padding: 20px 24px 36px;
  }

  .app-footer {
    padding: 0 24px 24px;
  }
}

@media (max-width: 640px) {
  .page-content {
    padding: 16px 16px 28px;
  }

  .app-footer {
    padding: 0 16px 20px;
  }

  .section-heading-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .section-heading-row h3,
  .card-heading h3 {
    font-size: 17px;
  }
}