/* Dashboard. Data marks use the validated chart palette (dataviz reference
   palette, checked against these surfaces); SADC blue stays in chrome only. */
.dash-root, body {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-1-wash: rgba(42, 120, 214, .10);
  --ink-2: #52514e; --ink-muted: #898781; --grid: #e7e8ea; --axis: #c3c2b7;
  --seq-0: #eef4fc; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #5598e7; --seq-4: #256abf; --seq-5: #0d366b;
  --st-good: #0ca30c; --st-warn: #c98500; --st-off: #898781;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-1-wash: rgba(57, 135, 229, .16);
    --ink-2: #c3c2b7; --ink-muted: #898781; --grid: #2a3644; --axis: #3a4655;
    --seq-0: #1d2733; --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #2a78d6; --seq-4: #5598e7; --seq-5: #9ec5f4;
  }
}

.dash-hero { background: linear-gradient(180deg, #0f3f85 0%, #134b99 100%); color: #fff; }
.dash-hero .in { max-width: 1160px; margin: 0 auto; padding: 28px 16px 64px; display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.dash-hero h1 { margin: 2px 0 6px; font-size: 30px; line-height: 1.15; letter-spacing: -.2px; }
.dash-hero .lede { margin: 0; max-width: 640px; opacity: .88; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 1.4px; font-size: 12px; font-weight: 700; color: #f2cf5b; }
.filters { display: flex; gap: 6px; align-items: center; background: rgba(255,255,255,.1); padding: 4px; border-radius: 10px; }
.filters .muted { color: rgba(255,255,255,.75); padding: 0 6px; }
.filters button { background: transparent; color: #fff; border: 0; padding: 7px 12px; border-radius: 7px; font-size: 14px; }
.filters button.on { background: #fff; color: #134b99; font-weight: 600; }

main.dash { max-width: 1160px; margin: -44px auto 0; padding: 0 16px 32px; }
.stage { transition: opacity .2s; }
.stage.loading { opacity: .55; }
.card { box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04); }
.card h2 { margin: 0; font-size: 17px; }
.card .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.card > header.plain { display: block; }
.tbl-toggle { background: transparent; color: var(--brand); border: 1px solid var(--line); padding: 5px 10px; font-size: 12.5px; border-radius: 7px; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid2 > .card { margin: 0; } .grid2 { margin: 12px 0; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.headline { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 16px; align-items: stretch; padding: 20px; }
@media (max-width: 860px) { .headline { grid-template-columns: 1fr; } }
.hero-fig { display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); padding-right: 16px; }
@media (max-width: 860px) { .hero-fig { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; } }
.hero-fig .label { color: var(--muted); font-size: 14px; }
.hero-fig .value { font-size: 56px; font-weight: 700; line-height: 1.05; letter-spacing: -1px; }
.delta { font-size: 13px; color: var(--ink-2); }
.delta.up { color: #006300; } .delta.down { color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .delta.up { color: #0ca30c; } }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 4px 4px 4px 12px; border-left: 3px solid var(--line); }
.stat .l { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .d { font-size: 12.5px; color: var(--ink-2); }
.stat svg { display: block; margin-top: 4px; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink-muted); font-size: 11px; font-family: inherit; }
.chart text.val { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart text.cat { fill: var(--ink-2); font-size: 12px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:focus-visible { stroke: var(--brand); stroke-width: 2; }
.chart .bar { fill: var(--series-1); transition: opacity .15s; }
.chart .hover .bar, .chart .bar.dim { opacity: .45; }
.chart .hover .bar.on { opacity: 1; }
.chart .cell { stroke: var(--surface); stroke-width: 2; }
.chart .cell.on { stroke: var(--ink); }
.chart .xhair { stroke: var(--ink-muted); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.scale { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.scale .ramp { display: flex; } .scale .ramp i { width: 22px; height: 10px; display: block; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.12); min-width: 140px; }
.tip .t { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .r b { font-weight: 700; } .tip .k { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; }

.table-view { margin-top: 8px; max-height: 340px; overflow: auto; }
.table-view table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.table-view td.n, .table-view th.n { text-align: right; }

.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.explain { margin: 16px 0 0; font-size: 13px; color: var(--ink-2); display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; }
.explain dt { font-weight: 600; color: var(--ink); } .explain dd { margin: 0; }
@media (max-width: 520px) { .explain { grid-template-columns: 1fr; } .explain dd { margin-bottom: 6px; } }
.ms { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.ms .nm { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.ms .cc { font-family: var(--mono); color: var(--muted); font-size: 12px; font-weight: 400; }
.ms .stt { font-size: 12.5px; margin-top: 2px; color: var(--ink-2); }
.ms .io { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.st { font-size: 13px; } .st-good { color: var(--st-good); } .st-warn { color: var(--st-warn); } .st-off { color: var(--st-off); }
.legend-note { margin: 10px 0 0; }
.method { margin: 16px 2px; }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* Gender in trade */
.g-WO { background: #0b6e4f; color: #fff; } .g-WL { background: #6cbf94; color: #10261b; } .g-OT { background: #2c5aa0; color: #fff; } .g-ND { background: #b9c1cc; color: #1d2733; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.g-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.g-row { display: grid; grid-template-columns: 70px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.g-row > span:last-child { text-align: right; }
.g-bar { display: flex; height: 24px; border-radius: 5px; overflow: hidden; background: var(--line); }
.g-bar span { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.g-bar em { font-size: 12px; color: var(--muted); padding: 4px 8px; }
.g-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.g-kpis div { display: flex; flex-direction: column; gap: 2px; }
.g-kpis b { font-size: 22px; } .g-kpis span { font-size: 13px; color: var(--muted); }
.g-ill { background: var(--warn-bg, #fff4d6); border-left: 4px solid var(--warn, #b7791f); padding: 6px 10px; border-radius: 6px; font-size: 13px; margin: 0 0 10px; }
