/* AI CFO dashboard design system. Shared across all seven report views. */
:root {
 --bg:#f4f6fa; --surface:#fff; --surface-2:#f5f7fb; --border:#e3e8f0; --border-strong:#cdd6e4;
 --heading:#172643; --text:#53617a; --muted:#697890;
 --accent:#3469ed; --accent-light:#79a0ff; --accent-soft:#edf2ff; --accent-text:#285bcc;
 --good:#168367; --good-soft:#eaf7f1; --bad:#c4544f; --bad-soft:#fff0ee; --warn:#a87522; --warn-soft:#fff6e6;
 --chart-actual:#4275ed; --chart-budget:#9aa9c0; --chart-area:rgba(66,117,237,.07);
 --sidebar-bg:#111e36; --sidebar-text:#a2afc5; --sidebar-heading:#fff; --sidebar-active:#263f6c; --sidebar-border:#28354b;
 --radius:8px; --radius-lg:13px; --shadow:0 2px 4px rgba(23,38,67,.015); --shadow-lg:0 12px 30px rgba(15,30,56,.1);
 --nav-w:234px; --mono:'JetBrains Mono',monospace; --font:'Inter',system-ui,sans-serif; --font-display:'DM Sans',system-ui,sans-serif;
}
:root[data-theme="dark"] {
 --bg:#101a2b; --surface:#18253b; --surface-2:#1f2e46; --border:#2e3c53; --border-strong:#43536d;
 --heading:#edf3ff; --text:#b9c7dc; --muted:#97a8c2; --accent:#7ba2ff; --accent-soft:#23395f; --accent-text:#a2bdff;
 --good:#67d2ad; --good-soft:#163f38; --bad:#ffaba3; --bad-soft:#472c33; --chart-actual:#7ba2ff; --chart-budget:#8292ad; --chart-area:rgba(123,162,255,.09);
}
@media (prefers-color-scheme:dark) {
 :root:not([data-theme]) { --bg:#101a2b; --surface:#18253b; --surface-2:#1f2e46; --border:#2e3c53; --border-strong:#43536d; --heading:#edf3ff; --text:#b9c7dc; --muted:#97a8c2; --accent:#7ba2ff; --accent-soft:#23395f; --accent-text:#a2bdff; --good:#67d2ad; --good-soft:#163f38; --bad:#ffaba3; --bad-soft:#472c33; --chart-actual:#7ba2ff; --chart-budget:#8292ad; --chart-area:rgba(123,162,255,.09); }
}
/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5 { color: var(--heading); font-family: var(--font-display); margin: 0; line-height: 1.2; }
h1 { font-size: 1.375rem; font-weight: 700; }
h2 { font-size: 1.0625rem; font-weight: 600; }
h3 { font-size: .9375rem; font-weight: 600; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ── Shell ── */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--sidebar-border);
  z-index: 10;
}
.sidebar__brand {
  padding: 24px 22px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar__logo { display: flex; align-items: center; gap: 10px; }
.sidebar__icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #1A8A7D 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.sidebar__name {
  color: var(--sidebar-heading); font-family: var(--font-display);
  font-size: .9375rem; font-weight: 600; letter-spacing: -.01em;
}
.sidebar__tag {
  font-size: .6875rem; color: var(--sidebar-text); margin-top: 6px;
  letter-spacing: .04em; text-transform: uppercase; font-weight: 500;
}

.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; }
.nav__section {
  font-size: .625rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sidebar-text); padding: 16px 12px 6px; font-weight: 600;
  opacity: .7;
}
.nav__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; color: var(--sidebar-text);
  font-size: .8125rem; font-weight: 500;
  text-decoration: none; border-radius: 6px;
  transition: background .12s, color .12s;
}
.nav__link:hover { color: var(--sidebar-heading); background: rgba(255,255,255,.04); }
.nav__link.active { color: var(--sidebar-heading); background: var(--sidebar-active); }
.nav__icon { flex: none; width: 18px; text-align: center; font-size: .875rem; opacity: .6; }
.nav__link.active .nav__icon { opacity: 1; color: var(--accent-light); }
.nav__label { white-space: nowrap; }

.sidebar__foot {
  padding: 14px 22px; border-top: 1px solid var(--sidebar-border);
  font-size: .6875rem; color: var(--sidebar-text); line-height: 1.6;
}
.sidebar__foot a { color: var(--accent-light); text-decoration: none; }

/* ── Content area ── */
.content { display: flex; flex-direction: column; min-width: 0; }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 8;
}
.topbar .view-title { flex: none; }
.topbar .toolbar {
  flex: 1; display: flex; gap: 8px; align-items: center;
  justify-content: flex-end; margin-bottom: 0;
}
.topbar .theme-toggle { margin-left: 4px; }

/* ── Buttons ── */
.btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--heading);
  padding: 5px 12px; font: 500 .875rem var(--font); cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--border-strong); }
.btn:disabled { opacity: .35; cursor: default; }
.btn--icon { padding: 5px 9px; font-size: 1rem; line-height: 1; }

/* ── Month selector ── */
.month-label {
  font: 600 .875rem var(--font-display); color: var(--heading);
  white-space: nowrap;
}
.month-select {
  font: 500 .8125rem var(--font); color: var(--heading);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 8px; cursor: pointer;
}
.month-select option { background: var(--surface); color: var(--heading); }

/* ── Main ── */
.main { padding: 28px 32px 64px; max-width: 1380px; min-width: 0; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-head h1 { letter-spacing: -.02em; }
.page-subtitle { color: var(--muted); font-size: .8125rem; margin-top: 4px; }

/* ── Period selector ── */
.period-selector {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 6px 4px 14px;
  box-shadow: var(--shadow);
}
.period-selector select {
  font: 500 .875rem var(--font-display); color: var(--heading);
  background: transparent; border: 0; cursor: pointer; padding: 5px 4px;
  border-radius: 4px;
}
.period-selector select:focus-visible { outline: 2px solid var(--accent); }
.period-selector select option { background: var(--surface); color: var(--heading); }
.period-selector__label { font-size: .6875rem; color: var(--muted); }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.card__head p { margin: 3px 0 0; font-size: .75rem; color: var(--muted); }

/* ── Grids ── */
.grid { display: grid; gap: 14px; }
.grid--kpi { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }

/* ── KPI Tiles ── */
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px 14px;
  box-shadow: var(--shadow);
}
.kpi__label {
  font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; font-weight: 500;
}
.kpi__value {
  font: 700 1.5rem var(--font-display); color: var(--heading);
  letter-spacing: -.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi__row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; margin-top: 10px;
}
.kpi__delta {
  font-size: .75rem; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi__note { font-size: .6875rem; color: var(--muted); margin-top: 2px; }
.kpi__spark { display: block; width: 72px; height: 24px; }
.kpi__spark path { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.kpi__spark .actual { stroke: var(--chart-actual); }
.kpi__spark .budget { stroke: var(--chart-budget); stroke-dasharray: 3 2; stroke-width: 1; }

.up { color: var(--good); }
.down { color: var(--bad); }
.flat { color: var(--muted); }

/* ── Charts ── */
.chart-container { width: 100%; overflow: visible; }
.chart-container svg { width: 100%; display: block; overflow: visible; }
.chart-container svg text { font-family: var(--font); fill: var(--muted); font-size: 10px; }
.chart-container .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-container .zero-line { stroke: var(--border-strong); stroke-width: 1; }
.chart-container .ser-actual { fill: none; stroke: var(--chart-actual); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-container .ser-budget { fill: none; stroke: var(--chart-budget); stroke-width: 1.5; stroke-dasharray: 4 3; stroke-linejoin: round; }
.chart-container .area-actual { fill: var(--chart-area); }
.chart-container .dot { fill: var(--chart-actual); }
.chart-container .cutoff-line { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-container .cutoff-label { fill: var(--muted); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }

/* Waterfall */
.wf-bar-pos { fill: var(--chart-actual); opacity: .85; }
.wf-bar-neg { fill: var(--bad); opacity: .7; }
.wf-bar-total { fill: var(--accent); }
.wf-connector { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 2; }
.wf-value { font-family: var(--mono); font-size: 9px; fill: var(--heading); font-weight: 500; }

/* Bar rows */
.bar-row {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 10px;
  align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.bar-row:last-child { border-bottom: 0; }
.bar-row__label { font-size: .8125rem; color: var(--heading); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row__track { display: flex; gap: 0; align-items: center; height: 22px; position: relative; }
.bar-row__bar { height: 8px; border-radius: 4px; position: relative; transition: width .3s ease; }
.bar-row__bar--actual { background: var(--chart-actual); z-index: 1; }
.bar-row__bar--budget {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 8px; border-radius: 4px;
  background: var(--chart-budget); opacity: .25;
}
.bar-row__val {
  font: 500 .8125rem var(--mono); color: var(--heading);
  text-align: right; min-width: 80px;
  font-variant-numeric: tabular-nums;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
th {
  text-align: right; font-weight: 600; font-size: .6875rem;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 0 12px 10px; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
th:first-child { text-align: left; padding-left: 0; }
td {
  text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap;
}
td:first-child { text-align: left; padding-left: 0; color: var(--heading); font-weight: 500; }
tbody tr:hover td { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
tr.is-total td { border-top: 2px solid var(--border-strong); font-weight: 700; color: var(--heading); }
tr.is-total:hover td { background: transparent; }
tr.section-row td {
  padding-top: 20px; font-size: .6875rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  border-bottom: 0; padding-bottom: 4px;
}
td.indent { padding-left: 16px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .625rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 4px;
  white-space: nowrap;
}
.badge--good { background: var(--good-soft); color: var(--good); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--neutral { background: var(--surface-2); color: var(--muted); }

/* ── Search & Chips ── */
.search-input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--heading);
  padding: 7px 12px; font: 400 .8125rem var(--font); min-width: 200px;
}
.search-input::placeholder { color: var(--muted); }

.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: 500 .75rem var(--font); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 99px; padding: 4px 13px;
  transition: all .12s;
}
.chip:hover { color: var(--heading); border-color: var(--border-strong); }
.chip.active {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-text); font-weight: 600;
}

/* ── Toolbar ── */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  justify-content: space-between; margin-bottom: 14px;
}

/* ── Legend ── */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .75rem; color: var(--muted); padding: 6px 0; }
.legend__item { display: flex; align-items: center; gap: 6px; }
.legend__swatch { width: 14px; height: 3px; border-radius: 2px; }
.legend__swatch--actual { background: var(--chart-actual); }
.legend__swatch--budget { background: var(--chart-budget); height: 0; border-top: 2px dashed var(--chart-budget); }

/* ── Commentary ── */
.commentary-lead { font-size: .875rem; color: var(--text); line-height: 1.6; margin: 0 0 16px; }
.commentary-lead strong { color: var(--heading); }
.driver-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.driver-item { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; }
.driver-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.driver-dot.up { background: var(--good); }
.driver-dot.down { background: var(--bad); }
.driver-head { font-size: .875rem; }
.driver-head strong { color: var(--heading); }
.driver-detail { font-size: .8125rem; color: var(--muted); margin-top: 2px; }

/* ── Callout ── */
.callout {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px; font-size: .8125rem; color: var(--text); line-height: 1.6;
}
.callout strong { color: var(--heading); }

/* ── Forecast scenarios ── */
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scenario-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  transition: border-color .15s;
}
.scenario-card:hover { border-color: var(--accent); }
.scenario-card h3 { margin-bottom: 4px; }
.scenario-label { font-size: .6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.scenario-metric { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.scenario-metric:last-child { border-bottom: 0; }
.scenario-metric span:first-child { color: var(--muted); }
.scenario-metric span:last-child { color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ── Tooltip ── */
.tip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0;
  transition: opacity .1s; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 13px; font-size: .75rem; color: var(--text);
  box-shadow: var(--shadow-lg); white-space: nowrap;
}
.tip strong { display: block; color: var(--heading); font-size: .8125rem; margin-bottom: 4px; }
.tip dl { display: grid; grid-template-columns: auto auto; gap: 2px 16px; margin: 0; }
.tip dt { color: var(--muted); }
.tip dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-weight: 500; }

/* ── Demo banner ── */
.demo-banner {
  background: linear-gradient(90deg, var(--accent) 0%, #1A8A7D 100%);
  color: #fff; text-align: center; padding: 8px 16px; font-size: .75rem; font-weight: 500;
  letter-spacing: .02em;
}
.demo-banner strong { font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .grid--kpi { grid-template-columns: repeat(2, 1fr); }
  .grid--3, .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--sidebar-border);
  }
  .sidebar__brand { padding: 12px 16px; border-bottom: 0; border-right: 1px solid var(--sidebar-border); }
  .sidebar__tag { display: none; }
  .nav { flex-direction: row; padding: 4px 8px; gap: 2px; }
  .nav__section { display: none; }
  .nav__link { white-space: nowrap; padding: 8px 10px; font-size: .75rem; }
  .nav__icon { width: 16px; font-size: .75rem; }
  .sidebar__foot { display: none; }
  .main { padding: 18px 16px 44px; }
  .grid--2, .grid--3, .grid--kpi, .scenario-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr auto; }
}
@media print {
  .sidebar, .toolbar, .chips, .demo-banner { display: none; }
  .app { display: block; }
  body { background: #fff; color: #222; }
  .card { break-inside: avoid; border-color: #ddd; background: #fff; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Shell and report hierarchy */
.skip-link { position:fixed; top:-80px; left:16px; z-index:200; padding:12px; background:var(--surface); color:var(--accent); }
.skip-link:focus { top:8px; }
.demo-banner { background:#eaf0ff; color:#445777; display:flex; justify-content:center; align-items:center; gap:12px; min-height:38px; padding:8px 24px; font-size:11px; letter-spacing:0; }
.demo-pill { font-size:9px; font-weight:700; letter-spacing:.08em; color:#315fc7; background:#dce6ff; border:1px solid #cedbfd; border-radius:4px; padding:3px 7px; }
.demo-banner a { color:#315fc7; text-decoration:none; margin-left:12px; font-weight:600; }
.sidebar { padding:30px 16px 20px; }
.platform-brand { padding:0 15px; margin-bottom:34px; font:700 27px var(--font-display); color:#fff; text-decoration:none; letter-spacing:-1px; }
.platform-brand span { color:#709aff; }
.workspace { display:flex; align-items:center; gap:10px; padding:14px 10px; margin:0 0 28px; border:1px solid var(--sidebar-border); border-radius:9px; background:#192740; }
.workspace__avatar { display:grid; place-content:center; flex:none; width:33px; height:35px; color:#fff; background:#31496e; border-radius:7px; font-size:24px; font-weight:700; position:relative; }
.workspace__avatar span { position:absolute; right:4px; bottom:3px; color:#8baafa; }
.workspace strong { display:block; color:#e8eef9; font-size:11px; font-weight:600; }
.workspace span:not(.workspace__avatar span) { display:block; font-size:10px; color:#b0bed4; margin-top:3px; }
.nav__section { padding:0 13px 12px; font-size:9px; letter-spacing:.13em; color:#91a3c2; opacity:1; }
.nav { padding:0; gap:6px; }
.nav__link { min-height:43px; padding:10px 14px; gap:13px; font-size:12px; border:1px solid transparent; border-radius:7px; }
.nav__link.active { color:#fff; background:#243c66; border-color:#38517d; box-shadow:0 3px 8px #08142622; }
.nav__link.active:after { content:''; width:5px; height:5px; border-radius:50%; background:#8aafff; margin-left:auto; }
.nav__icon { width:18px; height:18px; opacity:1; }
.nav__icon svg { display:block; width:18px; height:18px; }
.sidebar__foot { padding:22px 12px 0; font-size:10px; }
.workspace-note { display:flex; align-items:center; gap:7px; font-size:9px; }
.status-dot { display:inline-block; width:6px; height:6px; background:#41b594; border-radius:50%; flex:none; }
.sidebar__foot p { color:#e0e8f7; font:500 19px/1.4 var(--font-display); letter-spacing:-.3px; margin:18px 0; }
.sidebar__foot a { color:#a9bfe9; }
.topbar { min-height:73px; padding:16px 36px; gap:10px; }
.breadcrumb { display:flex; align-items:center; gap:12px; font-size:11px; color:var(--muted); white-space:nowrap; }
.breadcrumb > span:first-child { color:var(--border-strong); }
.breadcrumb .view-title { color:var(--heading); font-weight:600; }
.period-caption { font-size:10px; color:var(--muted); margin-right:6px; }
.btn { background:var(--surface); border-radius:7px; min-height:32px; }
.btn--icon { min-width:32px; }
.month-select { background:var(--surface); min-height:34px; padding:6px 9px; font-size:11px; }
.main { width:100%; max-width:1580px; margin:0 auto; padding:34px 36px 42px; }
.page-head { margin-bottom:26px; align-items:center; }
.eyebrow { color:var(--accent-text); font-size:9px; font-weight:700; letter-spacing:.13em; margin-bottom:8px; }
.page-head h1 { font-size:clamp(25px,2.5vw,36px); letter-spacing:-1.2px; font-weight:600; line-height:1.15; }
.page-subtitle { color:var(--muted); font-size:12px; margin:9px 0 0; }
.report-context { font-size:10px; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:7px; color:var(--text); }
.report-context > span:last-child { flex-basis:100%; text-align:right; font-size:9px; color:var(--muted); }
.grid { gap:18px; }
.grid--kpi { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid--kpi:has(> :nth-child(6)) { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stack > * + * { margin-top:22px; }
.kpi { padding:21px 20px 18px; box-shadow:var(--shadow); position:relative; min-width:0; }
.kpi__label { font-size:10px; letter-spacing:.01em; text-transform:none; color:var(--text); margin-bottom:13px; font-weight:500; }
.kpi__value { font-size:clamp(23px,2.35vw,33px); font-weight:600; letter-spacing:-1px; }
.kpi__row { margin-top:15px; gap:5px; }
.kpi__delta { font-size:10px; font-weight:500; }
.kpi__delta.up,.kpi__delta.down { display:inline-block; padding:3px 6px; border-radius:4px; background:var(--bad-soft); }
.kpi__delta.up { background:var(--good-soft); }
.kpi__note { font-size:9px; margin-top:6px; }
.kpi__spark { width:65px; height:30px; flex-shrink:0; }
.primary-kpis > :last-child { background:#1c3156; border-color:#1c3156; --heading:#fff; --text:#c1d0eb; --muted:#b5c6e2; --chart-actual:#8eb0ff; --chart-budget:#59749c; }
.secondary-kpis .kpi__value { font-size:26px; }
.secondary-kpis .kpi { padding:18px 20px; }
.financial-brief { display:flex; justify-content:space-between; gap:28px; padding:25px 28px; border:1px solid var(--border); border-left:3px solid var(--accent); border-radius:10px; background:var(--surface); }
.brief-copy { max-width:720px; }
.brief-copy h2 { font-size:20px; font-weight:600; letter-spacing:-.45px; }
.brief-copy p { font-size:11px; line-height:1.8; margin:9px 0 10px; color:var(--text); max-width:650px; }
.brief-link { font-size:11px; color:var(--accent-text); font-weight:600; text-decoration:none; }
.brief-link:hover { text-decoration:underline; }
.brief-stat { display:flex; flex-direction:column; justify-content:center; text-align:right; min-width:140px; padding-left:28px; border-left:1px solid var(--border); gap:5px; }
.brief-stat span { font-size:10px; color:var(--muted); }
.brief-stat strong { font:500 36px var(--font-display); letter-spacing:-1px; color:var(--heading); }
.overview-charts { grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); }
.card { padding:24px; box-shadow:var(--shadow); min-width:0; }
.card__head { margin-bottom:16px; }
h2 { font-size:15px; font-weight:600; letter-spacing:-.25px; }
.card__head p { margin-top:6px; font-size:10px; }
.legend { font-size:10px; padding:0; margin-bottom:20px; color:var(--text); }
.chart-container svg text { font-size:11px; }
.chart-container .grid-line { stroke-dasharray:3 5; opacity:.85; }
.chart-container .ser-actual { stroke-width:2.8; }
.chart-container .ser-budget { stroke-width:1.8; stroke-dasharray:5 5; }
.chart-container .dot { stroke:var(--surface); stroke-width:2; r:4.5; }
.chart-container .cutoff-label { font-size:8px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; padding-top:8px; }
.section-heading h2 { font-size:17px; }
.section-heading span { font-size:10px; color:var(--muted); }
th { background:var(--surface-2); padding:12px; border-bottom:1px solid var(--border); text-transform:none; letter-spacing:0; font-size:10px; }
th:first-child { padding-left:12px; border-radius:5px 0 0 5px; }
td { padding:13px 12px; font-size:11px; }
td:first-child { padding-left:12px; }
tr.is-total td { background:var(--surface-2); border-top:1px solid var(--border-strong); }
.badge { font-size:9px; text-transform:none; letter-spacing:0; padding:4px 8px; border-radius:5px; }
.search-input { font-size:11px; min-height:35px; background:var(--surface); }
.chip { font-size:10px; padding:7px 12px; border-radius:6px; background:var(--surface); }
.bar-row { padding:13px 0; grid-template-columns:140px 1fr auto; }
.bar-row__label { font-size:11px; }
.bar-row__val { font-size:11px; }
.bar-row__bar,.bar-row__bar--budget { height:9px; border-radius:3px; }
.commentary-lead { font-size:13px; }
.driver-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px 30px; }
.driver-head { font-size:11px; }
.driver-detail { font-size:10px; margin-top:4px; }
.callout { padding:18px 22px; border-radius:9px; border:1px solid var(--border); border-left:3px solid var(--accent); font-size:11px; }
.scenario-grid { gap:18px; }
.scenario-card { background:var(--surface); padding:26px 22px; }
.scenario-card--base { border:1px solid var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.scenario-kicker { color:var(--accent-text); font-size:8px; font-weight:700; letter-spacing:.09em; margin-bottom:17px; }
.scenario-card h3 { font-size:23px; letter-spacing:-.5px; }
.scenario-label { text-transform:none; letter-spacing:0; font-size:10px; margin:8px 0 22px; }
.scenario-metric { padding:13px 0; font-size:10px; }
.scenario-metric span:last-child { font-family:var(--font); }
.report-footer { font-size:9px; color:var(--muted); border-top:1px solid var(--border); padding-top:22px; margin-top:34px; }
.empty-state { text-align:center!important; padding:30px!important; color:var(--muted)!important; }
@media(min-width:1500px) { .kpi__value { font-size:36px; } }
@media(max-width:1150px) {
 :root { --nav-w:210px; } .main { padding:28px 24px; } .topbar { padding:16px 24px; }
 .report-context { display:none; } .grid--kpi,.grid--kpi:has(> :nth-child(6)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .overview-charts { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .kpi__value { font-size:30px; } .kpi__spark { width:80px; }
 .scenario-grid { grid-template-columns:1fr; }
}
@media(max-width:860px) {
 .app { grid-template-columns:1fr; } .sidebar { display:block; padding:14px 16px 10px; overflow:visible; }
 .platform-brand { display:inline-block; padding:0; font-size:23px; margin:0 0 14px; }
 .workspace { display:none; } .sidebar > .nav__section { display:none; }
 .nav { display:flex; flex-direction:row; overflow-x:auto; padding:0 0 3px; gap:5px; }
 .nav__link { min-height:37px; padding:8px 11px; font-size:11px; flex:none; gap:7px; }
 .nav__link.active:after { display:none; } .sidebar__foot { display:none; }
 .topbar { min-height:62px; padding:12px 20px; } .period-caption { display:none; }
 .main { padding:26px 20px; } .grid--2,.overview-charts { grid-template-columns:1fr; }
 .grid--kpi,.grid--kpi:has(> :nth-child(6)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .grid--3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .financial-brief { padding:22px; } .brief-copy h2 { font-size:18px; }
 .demo-banner { font-size:10px; gap:8px; } .demo-banner a { white-space:nowrap; margin:0; }
}
@media(max-width:520px) {
 .demo-banner { flex-wrap:wrap; padding:8px 12px; gap:6px; } .demo-pill { font-size:8px; }
 .breadcrumb { font-size:10px; gap:7px; flex-basis:100%; } .topbar { padding:10px 14px; gap:8px; flex-wrap:wrap; }
 .topbar .toolbar { justify-content:flex-start; }
 .topbar .toolbar { gap:4px; } .btn--icon { min-width:28px; padding:5px 6px; }
 .month-select { font-size:10px; padding:5px; max-width:111px; }
 .main { padding:24px 14px; } .page-head h1 { font-size:28px; letter-spacing:-.7px; }
 .page-subtitle { font-size:11px; line-height:1.7; } .grid { gap:10px; }
 .kpi { padding:17px 14px; } .kpi__value { font-size:25px; } .kpi__row { flex-wrap:wrap; }
 .kpi__spark { width:55px; height:22px; } .kpi__delta { font-size:9px; }
 .financial-brief { flex-direction:column; gap:18px; padding:20px; }
 .brief-stat { border-left:0; border-top:1px solid var(--border); padding:15px 0 0; text-align:left; }
 .brief-stat strong { font-size:30px; } .card { padding:20px 16px; }
 .grid--3 { grid-template-columns:1fr; } .driver-list { grid-template-columns:1fr; }
 .bar-row { grid-template-columns:95px 1fr auto; gap:6px; } .bar-row__val { min-width:70px; font-size:10px; }
 .bar-row__val span { display:block; } .search-input { width:100%; min-width:0; }
}
@media print { .platform-brand,.topbar,.report-footer { display:none; } .main { max-width:none; } }
