:root {
  --bg: #eef2f6;
  --canvas: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #f2f6fb;
  --ink: #182231;
  --muted: #657386;
  --line: #d5dde8;
  --blue: #1565a9;
  --blue-2: #0d4778;
  --teal: #14866d;
  --amber: #d08a00;
  --red: #c84e3a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
}
a { color: var(--blue-2); font-weight: 650; text-decoration: none; }
.app-shell { width: 100vw; min-height: 100vh; display: grid; grid-template-rows: 48px minmax(0, 1fr); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 7px 14px;
  background: #fbfdff;
  border-bottom: 1px solid var(--line);
}
.brandline { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.app-kicker, .eyebrow { margin: 0; color: var(--blue-2); font-size: 10px; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 18px; line-height: 1.1; letter-spacing: -.015em; white-space: nowrap; }
h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.18; }
h3 { margin: 0; font-size: 14px; line-height: 1.2; }
p { color: var(--muted); font-size: 12px; line-height: 1.35; }
.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { padding: 7px 9px; border-radius: 6px; color: #526075; font-size: 12px; }
.topnav a.active, .topnav a:hover { color: var(--blue-2); background: #e8f1fb; }
.dashboard-layout { min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; padding: 10px; }
.sidebar { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 8px; }
.content { min-width: 0; min-height: 0; overflow: auto; display: grid; align-content: start; gap: 10px; }
.panel, .side-card, .kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.side-card { padding: 10px; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.clear-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--blue-2); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.scenario-tabs { display: grid; gap: 6px; }
.scenario-tab { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 7px; padding: 8px 9px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 750; text-align: left; }
.scenario-tab::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b8c5d2; }
.scenario-tab.active { color: white; background: var(--blue-2); border-color: var(--blue-2); }
.scenario-tab.active::after { background: #89e0bf; }
.filter-grid { display: grid; gap: 8px; }
.filter-field { display: grid; gap: 4px; }
.filter-field label { color: #2f4056; font-size: 11px; font-weight: 800; }
.filter-field select, .filter-field input { width: 100%; height: 31px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); padding: 0 8px; font: inherit; font-size: 12px; }
.check-row { display: flex; gap: 7px; align-items: center; color: #34465c; font-size: 12px; }
.check-row input { width: 14px; height: 14px; }
.active-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 7px; border-radius: 999px; background: #e8f1fb; color: var(--blue-2); font-size: 11px; font-weight: 750; }
.summary-list { display: grid; gap: 6px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.summary-row strong { color: var(--ink); text-align: right; }
.hero-strip { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 10px; align-items: stretch; padding: 10px; min-height: 74px; }
.status-pill { padding: 9px; border-radius: 7px; background: #eef7ff; border: 1px solid #c7dff6; color: var(--blue-2); font-size: 11px; font-weight: 750; }
.status-pill strong { display: block; margin-top: 3px; color: var(--ink); font-size: 17px; }
.kpi-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.kpi-card { min-height: 78px; padding: 10px; }
.kpi-value { display: block; color: var(--ink); font-size: 22px; font-weight: 800; line-height: 1.05; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { display: block; margin-top: 6px; color: var(--blue-2); font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.kpi-card p { margin: 4px 0 0; font-size: 10.5px; }
.visual-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(420px, .7fr); gap: 10px; }
.table-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.chart-tile, .table-tile, .glossary-panel { min-width: 0; padding: 10px; }
.chart-tile { min-height: calc((100vh - 238px) * .54); }
.table-tile { min-height: calc((100vh - 238px) * .46); }
.tile-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.micro-note, .small-link { color: var(--muted); font-size: 11px; white-space: nowrap; }
.bar-chart { display: grid; gap: 6px; margin-top: 5px; }
.bar-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 58px; gap: 8px; align-items: center; }
.bar-label { color: var(--ink); font-size: 11.5px; font-weight: 750; line-height: 1.1; }
.bar-track { height: 12px; background: #edf2f7; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #37a0cf); }
.bar-value { color: var(--muted); text-align: right; font-size: 10.5px; font-weight: 700; }
.bar-axis { display: grid; grid-template-columns: 40px 1fr 58px; gap: 8px; align-items: center; color: var(--muted); font-size: 10px; margin-left: 228px; }
.bar-axis strong { text-align: center; color: #526075; font-weight: 750; }
.line-chart { width: 100%; height: min(34vh, 300px); min-height: 210px; display: block; }
.table-wrap { overflow: auto; max-height: min(36vh, 360px); border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 11.5px; table-layout: fixed; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; background: #eaf1f9; color: var(--blue-2); font-size: 9.8px; letter-spacing: .04em; text-transform: uppercase; }
td { color: #354257; line-height: 1.25; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-pill { display: inline-block; padding: 2px 6px; border-radius: 999px; background: #fff3d2; color: #784800; font-size: 10.5px; font-weight: 800; }
.docs-layout { width: 100vw; min-height: calc(100vh - 48px); padding: 14px; overflow: auto; }
.docs-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; max-width: 1600px; margin: 0 auto; }
.docs-nav { position: sticky; top: 62px; align-self: start; display: grid; gap: 8px; padding: 10px; }
.docs-card { padding: 14px; margin-bottom: 12px; }
.docs-card h2 { font-size: 20px; }
.docs-table { table-layout: auto; }
.formula { display: block; padding: 10px; border-radius: 7px; background: #111827; color: #e5f2ff; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; overflow-x: auto; }
.glossary-grid, .metric-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.glossary-card, .metric-card { padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.glossary-card strong, .metric-card strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 12px; }
.glossary-card span, .metric-card span { color: var(--muted); font-size: 11px; line-height: 1.35; }
@media (max-width: 1180px) {
  .dashboard-layout, .docs-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-grid, .table-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .docs-nav { position: static; }
}
@media (max-width: 760px) {
  .bar-axis { margin-left: 0; grid-template-columns: 40px 1fr 58px; }
  .app-shell { grid-template-rows: auto minmax(0, 1fr); }
  .topbar, .brandline, .hero-strip { display: grid; grid-template-columns: 1fr; align-items: start; }
  .sidebar { grid-template-columns: 1fr; }
  .kpi-grid, .glossary-grid, .metric-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr 60px; }
  .bar-track { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .kpi-grid, .glossary-grid, .metric-card-grid { grid-template-columns: 1fr; }
}
