:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --surface: #12171e;
  --surface-2: #181f28;
  --line: #27313d;
  --text: #edf2f7;
  --muted: #8d99a8;
  --accent: #45d19a;
  --accent-soft: rgba(69, 209, 154, .14);
  --loss: #f26b6b;
  --warning: #e9b949;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; letter-spacing: -.02em; }
h2 { margin-bottom: 5px; font-size: 19px; }
h3 { margin-bottom: 14px; font-size: 15px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; margin-bottom: 4px; }
.muted, .section-heading p, .source { color: var(--muted); }
.topbar { min-height: 76px; padding: 17px clamp(18px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: 14px; }
.freshness { color: var(--muted); font-size: 12px; }
.tabs { padding: 0 clamp(18px, 4vw, 52px); border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 14px 15px 12px; white-space: nowrap; }
.tab.active { border-color: var(--accent); color: var(--text); }
main { padding: 28px clamp(18px, 4vw, 52px) 60px; max-width: 1500px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.hero-grid { display: grid; grid-template-columns: minmax(280px, 1.15fr) 2fr; gap: 18px; margin-bottom: 18px; }
.hero, .review-gate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; }
.hero-value { font-size: clamp(32px, 5vw, 48px); font-weight: 720; letter-spacing: -.04em; margin: 12px 0 18px; }
.label { text-transform: uppercase; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.progress-track { height: 7px; background: var(--surface-2); border-radius: 10px; overflow: hidden; margin: 11px 0; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi-grid.wide { grid-template-columns: repeat(6, 1fr); margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; min-width: 0; }
.kpi strong { display: block; font-size: 20px; margin: 7px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--muted); }
.positive { color: var(--accent) !important; }
.negative { color: var(--loss) !important; }
.warning { color: var(--warning) !important; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; margin-bottom: 18px; }
.chart-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.chart-wrap { position: relative; height: 300px; }
.chart-wrap.short { height: 240px; }
.chart-panel { min-width: 0; }
.source { font-size: 11px; margin: 12px 0 0; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading p { margin-bottom: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid rgba(39, 49, 61, .7); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.filters { display: flex; gap: 9px; margin-bottom: 18px; flex-wrap: wrap; }
select, input { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 10px 12px; }
button { border: 0; border-radius: 8px; background: var(--accent); color: #07120e; font-weight: 700; padding: 10px 16px; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 7px 12px; }
.badge { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 6px 10px; font-size: 11px; white-space: nowrap; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.flow-step { background: var(--surface); border: 1px solid var(--line); padding: 17px; border-radius: var(--radius); }
.flow-step span { display: block; color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.timeline-item { border-left: 2px solid var(--line); padding: 0 0 18px 14px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item p { margin-bottom: 4px; }
.timeline-item small { color: var(--muted); }
.metric-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subheading { margin-top: 24px; }
.review-gate { margin-bottom: 18px; }
.notice { border-left: 3px solid var(--warning); padding: 12px 14px; color: var(--muted); background: rgba(233,185,73,.07); }
.reason-cell { max-width: 360px; color: var(--muted); }
.error-banner { position: fixed; right: 20px; bottom: 20px; background: #3a1717; border: 1px solid var(--loss); padding: 13px 17px; border-radius: 8px; max-width: 420px; }
.hidden { display: none; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-shell { width: min(92vw, 430px); padding: 0; }
.login-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px; }
.login-panel h1 { font-size: 26px; margin-bottom: 9px; }
.login-form { display: grid; gap: 16px; margin-top: 25px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.login-form input { width: 100%; }
.login-error { color: var(--loss); background: rgba(242,107,107,.08); padding: 10px; border-radius: 7px; }
@media (max-width: 980px) {
  .hero-grid, .chart-grid, .two-column { grid-template-columns: 1fr; }
  .kpi-grid.wide { grid-template-columns: repeat(3, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; }
  .freshness { display: none; }
  main { padding-top: 20px; }
  .kpi-grid, .kpi-grid.wide { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr; }
  .chart-wrap { height: 245px; }
  .hero { padding: 20px; }
}
