:root {
  color-scheme: light;
  --ink: #0f172a;
  --navy: #112a4d;
  --blue: #1d4ed8;
  --blue-soft: #e8f0ff;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --page: #f4f7fb;
  --amber: #9a5600;
  --amber-soft: #fff5d9;
  --red: #a11d25;
  --red-soft: #fff0f1;
  --green: #166534;
  --green-soft: #ecfdf3;
  --shadow: 0 18px 50px rgba(15, 39, 71, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: "DM Sans", Arial, sans-serif; }
button, a { font: inherit; }
button { color: inherit; }
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; padding: 14px max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid rgba(226, 232, 240, .9); background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--navy); color: #fff; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .08em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.snapshot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.snapshot i, .status-dot, .source-status i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border-radius: 10px; text-decoration: none; font-size: 12px; font-weight: 600; }
.button.secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button.primary { background: var(--navy); color: #fff; }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 64px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 34px; border-radius: 24px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: inherit; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 5vw, 48px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; }
.lede { max-width: 680px; margin-bottom: 0; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.55; }
.hero-state { display: flex; align-items: center; gap: 11px; min-width: 245px; padding: 16px; border: 1px solid rgba(255,255,255,.14); border-radius: 15px; background: rgba(255,255,255,.07); }
.hero-state strong, .hero-state small { display: block; }
.hero-state strong { font-size: 13px; }
.hero-state small { margin-top: 3px; color: rgba(255,255,255,.66); font-size: 11px; }
.truth-banner { display: grid; grid-template-columns: 210px 1fr; gap: 18px; margin: 14px 0 28px; padding: 16px 20px; border: 1px solid #f2d595; border-radius: 14px; background: var(--amber-soft); color: var(--amber); font-size: 12px; line-height: 1.5; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #fff; width: fit-content; }
.tab { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.tab span { margin-left: 5px; padding: 2px 6px; border-radius: 99px; background: #eef2f7; }
.tab.active { background: var(--navy); color: #fff; }
.tab.active span { background: rgba(255,255,255,.14); }
.panel { display: none; }
.panel.active { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi, .card, .priority-section, #issues-panel, #evidence-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 32px rgba(15, 39, 71, .045); }
.kpi { padding: 20px; }
.kpi.critical { border-color: #f1c5c8; background: var(--red-soft); }
.kpi.warning { border-color: #eed7a6; background: var(--amber-soft); }
.kpi-label { min-height: 34px; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-value { margin: 8px 0 5px; font-size: 34px; font-weight: 700; letter-spacing: -.04em; }
.kpi-note { color: var(--muted); font-size: 11px; line-height: 1.4; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.card { padding: 22px; }
.card-head, .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.tag { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tag.neutral { background: #eef2f7; color: var(--muted); }
.tag.warning { background: var(--amber-soft); color: var(--amber); }
.run-facts { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin: 24px 0 18px; }
.run-facts div { padding: 13px; border-radius: 12px; background: #f8fafc; }
dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
dd { margin: 4px 0 0; font-size: 12px; font-weight: 600; }
.source-status { display: flex; flex-wrap: wrap; gap: 8px; }
.source-status span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; }
.source-status i.ok { background: #22c55e; }
.source-status i.muted { background: #94a3b8; }
.card-foot { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.currency-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.currency-grid div { padding: 15px; border-radius: 13px; background: var(--blue-soft); }
.currency-grid span, .currency-grid strong, .currency-grid small { display: block; }
.currency-grid span { color: var(--blue); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.currency-grid strong { margin-top: 8px; font-size: 20px; }
.currency-grid small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.inline-warning { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 11px; }
.invoice-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.invoice-stats div { padding: 16px 12px; border: 1px solid var(--line); border-radius: 13px; text-align: center; }
.invoice-stats strong, .invoice-stats span, .invoice-stats small { display: block; }
.invoice-stats strong { font-size: 25px; }
.invoice-stats span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.invoice-stats small { margin-top: 4px; color: var(--red); font-size: 9px; }
.empty-chart { display: grid; place-items: center; min-height: 185px; text-align: center; }
.empty-bars { display: flex; align-items: flex-end; gap: 7px; height: 64px; }
.empty-bars i { width: 16px; border-radius: 5px 5px 0 0; background: #e2e8f0; }
.empty-bars i:nth-child(1) { height: 25%; }.empty-bars i:nth-child(2) { height: 52%; }.empty-bars i:nth-child(3) { height: 38%; }.empty-bars i:nth-child(4) { height: 74%; }.empty-bars i:nth-child(5) { height: 56%; }
.empty-chart p { margin: 18px 0 0; color: var(--muted); font-size: 11px; }
.priority-section, #issues-panel, #evidence-panel { margin-top: 14px; padding: 22px; }
.section-head { margin-bottom: 16px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.priority-list, .issues-list { display: grid; gap: 9px; }
.issue-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
.issue-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.issue-dot.MOYENNE { background: #f59e0b; }.issue-dot.INFO { background: #64748b; }
.issue-copy strong, .issue-copy small { display: block; }
.issue-copy strong { font-size: 12px; }
.issue-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.issue-amount { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.filter { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.filter.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.evidence-card { box-shadow: none; }
.evidence-card span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.evidence-card strong { display: block; margin-top: 8px; font-size: 21px; }
.evidence-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.journal-link { margin-top: 16px; }

@media (max-width: 820px) {
  .topbar { min-height: 64px; padding: 12px 16px; }
  .snapshot { display: none; }
  main { width: min(100% - 28px, 680px); padding-top: 18px; }
  .hero { display: grid; padding: 24px; border-radius: 20px; }
  .hero-state { min-width: 0; }
  .truth-banner { grid-template-columns: 1fr; gap: 6px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand small, .top-actions .button { display: none; }
  main { width: calc(100% - 20px); }
  h1 { font-size: 30px; }
  .lede { font-size: 13px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 0 8px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 28px; }
  .kpi-label { min-height: 44px; }
  .card, .priority-section, #issues-panel, #evidence-panel { padding: 17px; border-radius: 15px; }
  .currency-grid, .invoice-stats, .run-facts { grid-template-columns: 1fr; }
  .issue-row { grid-template-columns: auto 1fr; }
  .issue-amount { grid-column: 2; }
  .section-head { align-items: flex-start; }
}
