:root {
  --ink: #1d2a44; --ink-2: #4a5672; --muted: #8590a6;
  --line: #dfe7f1; --line-2: #edf2f8; --head: #eef4fb;
  --bg: #f7f9fc; --card: #ffffff;
  --accent: #df5a2e; --accent-soft: #fdece6;
  --pos: #18865b; --pos-soft: #e3f4ec; --neg: #d23c3c; --neg-soft: #fbe7e7;
  --navy: #1b2a6b; --ind: #2c86d6; --pru: #df5a2e; --third: #4b3fb8;
  --large: #1e4fa8; --mid: #1f9a80; --small: #d07a22; --teal: #20b8cf;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
a { color: inherit; }
.wrap { max-width: 1220px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; }
.logo { height: 34px; }
.logo-text { font-weight: 700; font-style: italic; color: var(--neg); font-size: 22px; }
.brand-txt { border-left: 1px solid var(--line); padding-left: 16px; }
.brand-title { font-weight: 600; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--ink-2); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav button { border: 0; background: none; font: inherit; font-size: 14.5px; color: var(--ink); padding: 8px 13px; border-radius: 8px; cursor: pointer; }
.nav button:hover { background: var(--line-2); }
.nav button.active { background: var(--accent-soft); color: var(--accent); }

/* page header */
.page-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 26px 0 14px; }
.page-h h1 { font-size: 20px; margin: 0; font-weight: 600; }
.page-h .asof { font-size: 13px; color: var(--ink-2); }
.page-h .asof b { color: var(--ink); font-weight: 500; }
.warn { background: #fff7e6; border: 1px solid #f3d9a4; color: #7a5410; border-radius: 10px; padding: 9px 14px; font-size: 13px; margin-bottom: 14px; }

/* cards */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; min-width: 0; }
.card.full { grid-column: 1 / -1; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-t { font-weight: 500; font-size: 15px; }
.card-t small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.src { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 10px; }
.note { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.defs { font-size: 12px; color: var(--ink-2); margin-top: 10px; line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 8px; }
.defs b { color: var(--ink); font-weight: 500; }

/* segmented controls */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; font: inherit; font-size: 12.5px; padding: 5px 11px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--accent); color: #fff; }
select.sel { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { background: var(--head); font-weight: 500; color: var(--ink); padding: 9px 12px; text-align: right; white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t th.grp { text-align: center; border-top: 3px solid var(--ind); }
table.t th.grp.p { border-top-color: var(--pru); }
table.t th.grp.s { border-top-color: var(--third); }
table.t th.sub { font-size: 12px; color: var(--ink-2); background: var(--head); }
table.t td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t tr:nth-child(even) td { background: #fbfcfe; }
table.t td.l { border-left: 1px solid var(--line); }
table.t td.name { font-weight: 500; }
.up { color: var(--pos); } .dn { color: var(--neg); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.pill.up { background: var(--pos-soft); } .pill.dn { background: var(--neg-soft); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k-l { font-size: 12.5px; color: var(--ink-2); }
.kpi .k-v { font-size: 22px; font-weight: 600; margin: 4px 0 2px; }
.kpi .k-s { font-size: 12px; color: var(--muted); }

/* charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: inherit; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; pointer-events: none; background: #1d2a44; color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; opacity: 0; transition: opacity .08s; z-index: 50; line-height: 1.5; white-space: nowrap; }
.tip b { font-weight: 600; }

/* spread bars (category flows) */
.hbars .row { display: grid; grid-template-columns: 210px 1fr 90px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.hbars .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .track { position: relative; height: 22px; }
.hbars .mid { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.hbars .bar { position: absolute; top: 0; height: 22px; border-radius: 4px; }
.hbars .val { text-align: right; font-weight: 500; }
.grp-h { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 2px; }

/* top/bottom lists */
.tb { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tb h4 { margin: 0 0 8px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.tb .it { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
.tb .it .n { font-weight: 500; font-size: 13.5px; }
.tb .it .s { font-size: 12px; color: var(--muted); }

/* donut */
.donut { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
.dl .r { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.dl .r i { width: 12px; height: 12px; border-radius: 3px; }
.dl .r b { font-weight: 600; }

.dl-list a { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; text-decoration: none; background: #fff; }
.dl-list a:hover { border-color: var(--accent); }
.btn { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12.5px; }

.footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 18px 0 26px; font-size: 12px; color: var(--ink-2); line-height: 1.7; background: #fff; }
.loading { padding: 60px 0; color: var(--muted); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .donut { grid-template-columns: 1fr; }
  .hbars .row { grid-template-columns: 130px 1fr 74px; }
  .tb { grid-template-columns: 1fr; }
}

/* side by side */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.pair .who { display: block; font-size: 11.5px; font-weight: 500; }
.pair b { font-size: 16.5px; font-weight: 600; }
.bf-head, .bf-row { display: grid; grid-template-columns: 1fr 190px 1fr; align-items: center; gap: 10px; }
.bf-head { font-size: 12.5px; font-weight: 500; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.bf-head span:first-child { text-align: right; }
.bf-row { padding: 4px 0; font-size: 13px; cursor: default; }
.bf-row:hover { background: var(--line-2); border-radius: 6px; }
.bf-lab { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-track { display: flex; align-items: center; gap: 6px; height: 20px; }
.bf-track.l { flex-direction: row-reverse; }
.bf-bar { height: 18px; border-radius: 4px; max-width: calc(100% - 52px); }
.bf-v { font-size: 12px; min-width: 44px; color: var(--ink-2); }
.bf-track.l .bf-v { text-align: right; }
@media (max-width: 900px) { .bf-head, .bf-row { grid-template-columns: 1fr 110px 1fr; } .bf-lab { font-size: 11.5px; } }
.aum2 { display: grid; grid-template-columns: 220px 220px 1fr; gap: 20px; align-items: center; }
.aum2 .who-h { font-weight: 500; font-size: 13px; text-align: center; margin-bottom: 6px; }
.aum2 svg { display: block; margin: 0 auto; }
@media (max-width: 900px) { .aum2 { grid-template-columns: 1fr 1fr; } .aum2 .tbl-wrap { grid-column: 1 / -1; } }
