/* Deltek Benchmark Network — benchmark tile
 *
 * Data-viz colour roles are validated; do not change iqr-fill, median-tick,
 * whisker, or you-mark without re-running the contrast validator.
 */

:root {
  color-scheme: light;

  --surface-1: #ffffff;
  --surface-2: #f7f8fa;
  --page:      #f0f2f5;
  --text-primary:   #0d0d0d;
  --text-secondary: #52514e;
  --text-muted:     #888785;
  --gridline: #e4e3dc;
  --baseline: #c8c7bc;
  --border:   rgba(0, 0, 0, 0.08);

  /* Distribution chart — validated, do not change */
  --iqr-fill:    #86b6ef;
  --median-tick: #184f95;
  --whisker:     #c3c2b7;
  --you-mark:    #0d0d0d;

  /* Status */
  --status-good:     #0ca30c;
  --status-critical: #d03b3b;
  --status-warning:  #e09000;
  --success-text:    #006300;

  /* Deltek brand */
  --accent:               #1a2f6e;   /* Deltek navy */
  --accent-subtle:        rgba(26, 47, 110, 0.07);
  --accent-orange:        #e8722b;   /* Deltek orange — brand highlights, CTAs */
  --accent-orange-subtle: rgba(232, 114, 43, 0.08);

  /* Depth */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.08);

  --radius: 12px;
  --radius-sm: 8px;
  --transition: 140ms ease;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1c1c1e;
    --surface-2: #242426;
    --page:      #111113;
    --text-primary:   #f2f2f7;
    --text-secondary: #aeaeb2;
    --text-muted:     #6e6e73;
    --gridline: #2c2c2e;
    --baseline: #3a3a3c;
    --border:   rgba(255,255,255,0.09);

    --iqr-fill:    #256abf;
    --median-tick: #9ec5f4;
    --whisker:     #3a3a3c;
    --you-mark:    #f2f2f7;
    --success-text: #30d158;
    --status-critical: #ff453a;
    --status-warning:  #ffd60a;

    --accent:               #7caef8;
    --accent-subtle:        rgba(124, 174, 248, 0.10);
    --accent-orange:        #ff8c42;
    --accent-orange-subtle: rgba(255, 140, 66, 0.10);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.15);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.25), 0 8px 20px rgba(0,0,0,0.20);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.30), 0 16px 32px rgba(0,0,0,0.25);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1c1c1e;
  --surface-2: #242426;
  --page:      #111113;
  --text-primary:   #f2f2f7;
  --text-secondary: #aeaeb2;
  --text-muted:     #6e6e73;
  --gridline: #2c2c2e;
  --baseline: #3a3a3c;
  --border:   rgba(255,255,255,0.09);

  --iqr-fill:    #256abf;
  --median-tick: #9ec5f4;
  --whisker:     #3a3a3c;
  --you-mark:    #f2f2f7;
  --success-text: #30d158;
  --status-critical: #ff453a;
  --status-warning:  #ffd60a;

  --accent:               #7caef8;
  --accent-subtle:        rgba(124, 174, 248, 0.10);
  --accent-orange:        #ff8c42;
  --accent-orange-subtle: rgba(255, 140, 66, 0.10);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.15);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.25), 0 8px 20px rgba(0,0,0,0.20);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.30), 0 16px 32px rgba(0,0,0,0.25);
}

:root[data-theme="light"] {
  color-scheme: light;
  --surface-1: #ffffff;
  --surface-2: #f7f8fa;
  --page:      #f0f2f5;
  --text-primary:   #0d0d0d;
  --text-secondary: #52514e;
  --text-muted:     #888785;
  --gridline: #e4e3dc;
  --baseline: #c8c7bc;
  --border:   rgba(0, 0, 0, 0.08);
  --iqr-fill:    #86b6ef;
  --median-tick: #184f95;
  --whisker:     #c3c2b7;
  --you-mark:    #0d0d0d;
  --success-text: #006300;
  --status-critical: #d03b3b;
  --status-warning:  #e09000;
  --accent:               #1a2f6e;
  --accent-subtle:        rgba(26, 47, 110, 0.07);
  --accent-orange:        #e8722b;
  --accent-orange-subtle: rgba(232, 114, 43, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  border-top: 4px solid var(--accent-orange);
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 22px 72px; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.masthead-left { flex: 1; min-width: 240px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-orange);
  font-weight: 700;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
}

.masthead h1 { margin: 6px 0 3px; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.masthead .sub { color: var(--text-secondary); font-size: 13.5px; }

.masthead-right {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.provenance {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  max-width: 310px;
  box-shadow: var(--shadow-sm);
}
.provenance strong { color: var(--text-primary); }

/* Theme toggle */
.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.theme-toggle:hover { border-color: var(--baseline); transform: scale(1.08); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----------------------------------------------------------------- controls */

.controls {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}
.field select {
  font: inherit;
  font-size: 14px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--baseline);
  background: var(--surface-2);
  color: var(--text-primary);
  min-width: 210px;
  transition: border-color var(--transition);
}
.field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.seg {
  display: flex;
  border: 1px solid var(--baseline);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg button {
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border: 0;
  border-right: 1px solid var(--baseline);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.seg button:last-child { border-right: 0; }
.seg button:hover:not([aria-pressed="true"]) { background: var(--gridline); color: var(--text-primary); }
.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* -------------------------------------------------------------- metric tabs */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.tabs button:hover:not([aria-pressed="true"]) { border-color: var(--baseline); color: var(--text-primary); }
.tabs button[aria-pressed="true"] {
  background: var(--text-primary);
  color: var(--surface-1);
  border-color: var(--text-primary);
  font-weight: 650;
  box-shadow: var(--shadow-md);
}
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- the tile */

.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px 28px;
  box-shadow: var(--shadow-md);
}

.tile-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 4px; }
.tile-head h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.015em; }
.metric-desc { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; max-width: 62ch; line-height: 1.55; }

.cohort-badge {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--accent-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  white-space: nowrap;
  font-weight: 500;
}
.cohort-badge strong { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Hero row */
.hero {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 22px 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.hero-block {
  flex: 1;
  min-width: 130px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.hero-block:last-child { border-right: 0; }
.hero-block .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-bottom: 6px; }
.hero-block .v { font-size: 38px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.hero-block .v.small { font-size: 26px; font-weight: 600; color: var(--text-secondary); }

.delta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  transition: opacity var(--transition);
}
.delta-chip .icon { font-size: 11px; }
.delta-chip.behind { color: var(--status-critical); background: rgba(208,59,59,0.07); }
.delta-chip.ahead { color: var(--success-text); background: rgba(12,163,12,0.07); }

/* ---------------------------------------------------- distribution box-plot */

.dist { margin: 22px 0 10px; }
.dist svg { display: block; width: 100%; height: 108px; overflow: visible; }
.dist .axis-label { font-size: 11px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.dist .you-label { font-size: 12px; font-weight: 700; fill: var(--text-primary); }
.dist .median-label { font-size: 11px; fill: var(--text-secondary); }

.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.iqr { background: var(--iqr-fill); }
.swatch.median { background: var(--median-tick); width: 3px; height: 14px; border-radius: 1px; }
.swatch.whisker { background: var(--whisker); height: 2px; width: 16px; }
.swatch.you { background: var(--you-mark); width: 10px; height: 10px; border-radius: 50%; }

/* ------------------------------------------------------------ dollarization */

.money {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  background: var(--accent-subtle);
}
.money .amount {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--accent-orange);
}
.money .basis { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.money details { margin-top: 12px; }
.money summary { cursor: pointer; font-size: 12.5px; color: var(--text-secondary); user-select: none; }
.money summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  margin: 9px 0;
  overflow-x: auto;
  color: var(--text-primary);
}
.inputs { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inputs td { padding: 4px 0; border-bottom: 1px solid var(--gridline); }
.inputs td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.inputs td:first-child { color: var(--text-secondary); }
.assumption { font-size: 12.5px; color: var(--text-secondary); margin-top: 10px; font-style: italic; line-height: 1.55; }

/* ------------------------------------------------------- suppression states */

.suppressed {
  margin: 22px 0 6px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-warning);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}
.suppressed .title { font-weight: 700; display: flex; align-items: center; gap: 9px; font-size: 15px; }
.suppressed .title .icon { color: var(--status-warning); }
.suppressed p { margin: 10px 0 0; color: var(--text-secondary); font-size: 13.5px; max-width: 68ch; line-height: 1.55; }
.suppressed .rule { font-size: 12px; color: var(--text-muted); margin-top: 12px; line-height: 1.6; }

.fallback-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-warning);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 18px;
}

/* ---------------------------------------------------------------- scorecard */

.scorecard { margin-top: 28px; }
.scorecard h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 12px;
}
.score-row {
  display: grid;
  grid-template-columns: 200px 96px 1fr 120px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.score-row:hover { border-color: var(--baseline); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.score-row[aria-current="true"] { border-left-color: var(--accent); border-color: var(--border); box-shadow: var(--shadow-md); }
.score-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.score-row .name { font-size: 13.5px; font-weight: 600; }
.score-row .val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-row .mini svg { display: block; width: 100%; height: 26px; overflow: visible; }
.score-row .verdict { font-size: 12px; font-weight: 650; text-align: right; line-height: 1.5; }
.score-row .verdict.behind { color: var(--status-critical); }
.score-row .verdict.ahead { color: var(--success-text); }
.score-row .verdict.none { color: var(--text-muted); font-weight: 500; }

@media (max-width: 720px) {
  .score-row { grid-template-columns: 1fr 80px; grid-template-areas: "name val" "mini mini" "verdict verdict"; }
  .score-row .name { grid-area: name; }
  .score-row .val { grid-area: val; text-align: right; }
  .score-row .mini { grid-area: mini; }
  .score-row .verdict { grid-area: verdict; text-align: left; }
  .hero { gap: 0; }
  .hero-block .v { font-size: 30px; }
  .hero-block { padding: 12px 14px; }
  .masthead-right { flex-direction: column-reverse; }
}

/* -------------------------------------------------------------- data table */

.table-view { margin-top: 18px; }
.table-view summary { font-size: 12.5px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.table-view table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; background: var(--surface-1); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.table-view th, .table-view td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--gridline); font-variant-numeric: tabular-nums; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view tbody tr:last-child td { border-bottom: 0; }
.table-view th { color: var(--text-muted); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface-2); }
.table-view tbody tr:hover { background: var(--surface-2); }

/* -------------------------------------------------------------------- misc */

.footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--gridline);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.footer a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.footer a:hover { color: var(--accent); }

.loading, .error { padding: 60px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.error { color: var(--status-critical); }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--text-primary);
  color: var(--surface-1);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-md);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ============================================================ sidebar layout */

.app-layout {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  padding: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.main-content {
  padding: 28px 32px 72px;
  min-width: 0;
}

.sidebar-brand {
  padding: 0 18px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.govcon-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 12px 10px;
  padding: 11px 16px;
  background: var(--accent-orange);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.govcon-btn:hover { background: #d4621e; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.sidebar-section { padding: 8px 18px; }

.sidebar-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.sidebar-select {
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--baseline);
  background: var(--surface-2);
  color: var(--text-primary);
  width: 100%;
  transition: border-color var(--transition);
}
.sidebar-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* Metric nav */
.metric-nav { display: flex; flex-direction: column; gap: 2px; }
.metric-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.metric-nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.metric-nav-item.active {
  background: var(--accent-subtle);
  border-color: var(--border);
  color: var(--accent);
  font-weight: 650;
}
.metric-nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.metric-nav-badge.ahead { background: rgba(12,163,12,0.10); color: var(--success-text); }
.metric-nav-badge.behind { background: rgba(208,59,59,0.10); color: var(--status-critical); }
.metric-nav-badge.suppressed { color: var(--text-muted); background: var(--surface-2); }

/* Cohort seg */
.sidebar-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg-btn {
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--baseline);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.seg-btn:hover { background: var(--gridline); color: var(--text-primary); }
.seg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 650; }
.cohort-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.provenance-mini { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* Main header */
.main-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--gridline); }
.main-header h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.main-header .sub { color: var(--text-secondary); font-size: 13px; }

/* ============================================================ overview panel */

.overview-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.overview-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.overview-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.overview-card.active { border-color: var(--accent); box-shadow: var(--shadow-md); }
.overview-card .ov-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: 700; margin-bottom: 4px;
}
.overview-card .ov-value {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px;
}
.perc-track {
  height: 5px; background: var(--surface-2); border-radius: 999px;
  overflow: hidden; border: 1px solid var(--gridline);
}
.perc-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.perc-fill.ahead { background: var(--success-text); }
.perc-fill.behind { background: var(--status-critical); }
.perc-fill.suppressed { background: var(--baseline); width: 30% !important; }
.overview-card .ov-rank { font-size: 10.5px; color: var(--text-muted); margin-top: 5px; }

/* ======================================================== data-source badges */

/* In metric title */
.data-src-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  vertical-align: middle; margin-left: 8px; line-height: 18px;
}
.data-src-badge.live { background: #d4f0d4; color: #1a6e1a; }
.data-src-badge.cal  { background: #fef3d0; color: #7a5200; }
[data-theme="dark"] .data-src-badge.live { background: rgba(26,110,26,0.25); color: #6fd16f; }
[data-theme="dark"] .data-src-badge.cal  { background: rgba(122,82,0,0.25);  color: #f5c94e; }

/* Tiny badge inside sidebar metric nav */
.src-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 999px;
  margin-left: 5px; vertical-align: middle; letter-spacing: 0.04em;
}
.src-badge.live { background: #d4f0d4; color: #1a6e1a; }
.src-badge.cal  { background: #fef3d0; color: #7a5200; }
[data-theme="dark"] .src-badge.live { background: rgba(26,110,26,0.25); color: #6fd16f; }
[data-theme="dark"] .src-badge.cal  { background: rgba(122,82,0,0.25);  color: #f5c94e; }

/* Sidebar metric-nav label flex */
.metric-nav-label {
  display: flex; align-items: center; gap: 0; flex: 1; flex-wrap: wrap;
}

/* Clarity reference line below metric description */
.clarity-ref {
  font-size: 11.5px; color: var(--text-muted); margin-top: 4px;
}
.clarity-label { font-weight: 600; }

/* ================================================================= mobile */

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; overflow: visible;
    flex-direction: column; border-right: none;
    border-bottom: 1px solid var(--border); padding-bottom: 12px;
  }
  .main-content { padding: 16px 16px 40px; }
}

/* ------------------------------------------------------------------- print */

@media print {
  body { border-top: none; background: white; color: black; }
  .controls, .tabs, .theme-toggle, .scorecard, .footer,
  .table-view, .dist .legend { display: none !important; }
  .wrap { max-width: 100%; padding: 0; }
  .masthead { margin-bottom: 16px; }
  .tile { box-shadow: none; border: 1px solid #ccc; }
  .money { background: #f9f9f9; border-left-color: #333; }
  .money .amount { color: #000; }
  .hero { background: #f5f5f5; }
  .suppressed { border-left-color: #999; }
  a { color: inherit; text-decoration: none; }
}

/* --------------------------------------------------------- top-right theme toggle */

.topbar-theme {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 50;
}
.theme-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-1);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.theme-icon-btn:hover { transform: scale(1.1); box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ AI advisor */

.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  width: min(400px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 64px));
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: var(--accent);
  color: #fff;
}
.chat-head strong { font-size: 15px; }
.chat-sub { font-size: 11px; opacity: 0.75; margin-top: 2px; line-height: 1.35; }
.chat-close {
  background: none; border: none; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; opacity: 0.8; padding: 0 2px;
}
.chat-close:hover { opacity: 1; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-2);
}

.chat-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-typing { color: var(--text-muted); font-style: italic; }
.chat-error {
  align-self: center;
  background: none;
  color: var(--status-critical);
  font-size: 12.5px;
}

.chat-starters { display: flex; flex-direction: column; gap: 8px; }
.chat-hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 2px; }
.chat-chip {
  text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.chat-chip:hover { border-color: var(--accent); background: var(--accent-subtle); }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}
.chat-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  background: var(--surface-2);
  color: var(--text-primary);
  outline: none;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input button {
  background: var(--accent-orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.chat-input button:disabled { opacity: 0.5; cursor: default; }

/* --------------------------------------------------------------- app nav */

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: var(--accent-subtle); color: var(--text-primary); }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }

/* --------------------------------------------------------- assistant page */

.assistant-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.assistant-page .chat-body { padding: 20px; gap: 12px; }
.assistant-page .chat-msg { max-width: 76%; font-size: 14px; }
.assistant-page .chat-input { padding: 14px 16px; }
.assistant-page .chat-starters { max-width: 560px; }
.assistant-page .chat-head .chat-sub { max-width: 640px; }

/* ------------------------------------------------------------ report view */

.report-frame {
  width: 100%;
  height: calc(100vh - 64px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------ theme switch */

.theme-switch {
  display: flex;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 10px;
}
.theme-opt {
  flex: 1;
  border: none;
  background: none;
  border-radius: 7px;
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.theme-opt:hover { color: var(--text-primary); }
.theme-opt.active {
  background: var(--surface-1);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------ cohort slider */

.cohort-slider { padding: 2px 2px 0; }

.cohort-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--iqr-fill), var(--accent-orange));
  outline: none;
  cursor: pointer;
  margin: 6px 0 8px;
}
.cohort-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--surface-1);
  box-shadow: var(--shadow-md);
  cursor: grab;
}
.cohort-slider input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--surface-1);
  box-shadow: var(--shadow-md);
  cursor: grab;
}
.cohort-slider input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cohort-ticks {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cohort-tick {
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
}
.cohort-tick:hover { color: var(--text-primary); }
.cohort-tick.active { color: var(--accent-orange); }

.cohort-current {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.cohort-ends {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* -------------------------------------------------------- opportunity panel */

.opportunity-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-orange);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.opp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.opp-note { font-size: 11.5px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.opp-clear { font-size: 13px; color: var(--success-text); }

.opp-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  background: none;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.opp-row:hover { background: var(--accent-subtle); }
.opp-rank {
  flex: none;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-orange-subtle);
  color: var(--accent-orange);
  font-weight: 700;
  font-size: 13px;
}
.opp-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opp-metric { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.opp-gap { font-size: 12px; color: var(--text-secondary); }
.opp-money {
  flex: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--status-critical);
  white-space: nowrap;
}
.opp-strengths {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--success-text);
}

/* ----------------------------------------------------------- exec brief */

.exec-brief { margin-bottom: 18px; }

.brief-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.brief-cta:hover:not(:disabled) { transform: translateY(-1px); }
.brief-cta:disabled { opacity: 0.7; cursor: default; }
.brief-error { margin-left: 12px; font-size: 12.5px; color: var(--status-critical); }

.exec-brief .brief-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.brief-tag {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent-orange);
  text-transform: uppercase;
}
.brief-regen {
  background: none; border: 1px solid var(--border); border-radius: 7px;
  padding: 3px 9px; font-size: 13px; cursor: pointer; color: var(--text-muted);
}
.brief-regen:hover { color: var(--text-primary); border-color: var(--baseline); }

.brief-text {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.brief-provenance { font-size: 11.5px; color: var(--text-muted); }

/* --------------------------------------------------------------- what-if */

.whatif {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--accent-orange-subtle);
  border: 1px dashed var(--accent-orange);
  border-radius: var(--radius);
}
.whatif-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: 8px;
}
.whatif input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--gridline);
  outline: none;
  cursor: pointer;
}
.whatif input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2.5px solid var(--surface-1);
  box-shadow: var(--shadow-md);
  cursor: grab;
}
.whatif input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2.5px solid var(--surface-1);
  cursor: grab;
}
.whatif-read { margin-top: 10px; font-size: 13.5px; color: var(--text-primary); }
.whatif-arrow { margin: 0 6px; color: var(--text-muted); }
.whatif-money { color: var(--success-text); font-size: 15px; }
.whatif-pct { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-muted); }

/* --------------------------------------------------------- privacy explorer */

.privacy-page { max-width: 980px; }

.privacy-cell {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.privacy-cell-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 9px;
}
.privacy-cell-label { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.privacy-cell-id { font-size: 11px; color: var(--text-muted); font-family: ui-monospace, monospace; }

.privacy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.p-chip em { font-style: normal; opacity: 0.75; font-size: 10.5px; }
.p-chip.ok {
  background: rgba(12, 163, 12, 0.09);
  color: var(--success-text);
  border-color: rgba(12, 163, 12, 0.25);
}
.p-chip.no {
  background: rgba(208, 59, 59, 0.08);
  color: var(--status-critical);
  border-color: rgba(208, 59, 59, 0.25);
}

.privacy-foot {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 700px;
}

/* ------------------------------------------------------------------ trend */

.trend { margin-top: 14px; }
.trend-title {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 5px;
}
.trend-note { font-weight: 400; color: var(--text-muted); margin-left: 8px; font-size: 11px; }
.trend-svg { width: 100%; max-width: 420px; height: 64px; display: block; }

/* ---------------------------------------------------- feature pages */

.opp-row.selected { background: var(--accent-subtle); outline: 1.5px solid var(--accent); }
.opp-row.static { cursor: default; }
.opp-row.static:hover { background: none; }
.opp-money.ahead { color: var(--success-text); font-size: 13px; }

.opp-detail {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.opp-detail h3 { margin: 0 0 10px; font-size: 15px; color: var(--text-primary); }

.trend-empty {
  background: var(--surface-1);
  border: 1px dashed var(--baseline);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 660px;
}
.trend-empty strong { color: var(--text-primary); }

.trend-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  max-width: 660px;
}
.trend-card .trend { margin-top: 0; }




/* ================================================================= LOGIN GATE */

/* Full-viewport two-column, no scroll */
.login-overlay {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}

/* ── Left: galactic hero ── */
.login-left {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 56px 64px;
  background: radial-gradient(ellipse at 20% 50%, #0a0f2e 0%, #02040f 60%, #000308 100%);
}

/* Canvas fills the entire left panel */
.login-starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

/* Nebula aura blobs */
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 2;
}
.login-blob-1 {
  width: 580px; height: 580px;
  background: radial-gradient(circle, rgba(139,92,246,0.45) 0%, transparent 70%);
  top: -180px; right: -60px;
  animation: blob1 22s ease-in-out infinite;
}
.login-blob-2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(236,72,153,0.28) 0%, transparent 70%);
  bottom: -130px; left: -80px;
  animation: blob2 26s ease-in-out infinite;
}
.login-blob-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(6,182,212,0.32) 0%, transparent 70%);
  top: 38%; left: 42%;
  animation: blob3 18s ease-in-out infinite;
}
@keyframes blob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  40%      { transform: translate(-45px,38px) scale(1.1); }
  70%      { transform: translate(28px,-22px) scale(0.92); }
}
@keyframes blob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  35%      { transform: translate(50px,-45px) scale(1.09); }
  65%      { transform: translate(-18px,28px) scale(0.94); }
}
@keyframes blob3 {
  0%,100% { transform: translate(0,0); }
  50%      { transform: translate(-45px,35px) scale(1.14); }
}

/* Hero text — above canvas & blobs */
.login-hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
}
.login-hero-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px; height: 68px;
  font-size: 28px;
  color: #c084fc;
  margin-bottom: 28px;
}
.login-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #c084fc;
  animation: ring-pulse 2.8s ease-in-out infinite;
  opacity: 0.65;
}
.login-ring-2 {
  inset: -14px;
  border-width: 1px;
  opacity: 0.22;
  animation-delay: 1s;
}
@keyframes ring-pulse {
  0%,100% { transform: scale(1);    opacity: 0.6; }
  50%      { transform: scale(1.22); opacity: 0.07; }
}
.login-hero-title {
  font-size: clamp(48px, 5.2vw, 82px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -2px;
  color: #ffffff;
  margin: 0 0 20px;
  animation: hero-enter 0.9s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-hero-tagline {
  font-size: 13.5px;
  color: rgba(192,132,252,0.8);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 36px;
  animation: hero-enter 0.9s 0.1s cubic-bezier(0.16,1,0.3,1) both;
}
.login-features {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: hero-enter 0.9s 0.2s cubic-bezier(0.16,1,0.3,1) both;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.6);
}
.lf-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c084fc;
  flex-shrink: 0;
  box-shadow: 0 0 7px rgba(192,132,252,0.9);
}
.login-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  animation: hero-enter 0.9s 0.3s cubic-bezier(0.16,1,0.3,1) both;
}
.login-stat { display: flex; flex-direction: column; gap: 3px; }
.ls-num { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.ls-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255,255,255,0.35); }
.login-stat-sep { width: 1px; height: 36px; background: rgba(255,255,255,0.1); }

/* ── Right: compact form panel ── */
.login-right {
  width: 380px;
  flex-shrink: 0;
  background: var(--page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  position: relative;
}
/* Glowing separator */
.login-right::before {
  content: '';
  position: absolute;
  left: 0; top: 5%; bottom: 5%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(139,92,246,0.6) 30%, rgba(99,102,241,0.5) 70%, transparent);
  box-shadow: 0 0 14px rgba(139,92,246,0.5);
}

.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: card-enter 0.7s 0.15s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes card-enter {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-9px); }
  40%      { transform: translateX(9px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.login-card--shake { animation: shake 0.45s ease; }

.login-form-header { margin-bottom: 2px; }
.login-form-title {
  font-size: 26px; font-weight: 700; color: var(--text-primary);
  margin: 0 0 5px; letter-spacing: -0.4px;
}
.login-form-sub { font-size: 13.5px; color: var(--text-secondary); margin: 0; }

.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-icon { position: absolute; left: 13px; font-size: 14px; pointer-events: none; z-index: 1; }
.login-field {
  width: 100%;
  padding: 13px 44px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  letter-spacing: 0.05em;
}
.login-field::placeholder { color: var(--text-muted); }
.login-field:focus { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139,92,246,0.13); }
.login-field--error { border-color: #d03b3b; }
.login-field--error:focus { box-shadow: 0 0 0 4px rgba(208,59,59,0.1); }
.login-eye {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text-muted); padding: 4px; line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.login-eye:hover { color: var(--text-primary); transform: scale(1.15); }

.login-error {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: #d03b3b;
  background: rgba(208,59,59,0.07);
  border: 1px solid rgba(208,59,59,0.22);
  border-radius: 9px; padding: 9px 13px;
  animation: slide-up 0.3s cubic-bezier(0.16,1,0.3,1) both;
}

.login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 40%, #4f46e5 100%);
  background-size: 200% 100%;
  color: #fff; border: none; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
  transition: background-position 0.4s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(109,40,217,0.45);
}
.login-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.16) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}
.login-btn:not(:disabled):hover { background-position: right center; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(109,40,217,0.55); }
.login-btn:not(:disabled):hover::after { transform: translateX(100%); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.75; cursor: not-allowed; }
.login-btn-arrow { transition: transform 0.2s; }
.login-btn:not(:disabled):hover .login-btn-arrow { transform: translateX(4px); }

.login-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.65s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-badges {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; flex-wrap: wrap;
  animation: slide-up 0.6s 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.login-badge {
  font-size: 11px; color: var(--text-secondary);
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 768px) {
  .login-overlay { flex-direction: column; }
  .login-left { flex: none; min-height: 45vh; padding: 36px 28px; }
  .login-hero-title { font-size: 40px; letter-spacing: -1px; }
  .login-features, .login-stats { display: none; }
  .login-right { width: 100%; padding: 32px 24px 40px; }
  .login-right::before { display: none; }
}
