/* MF Distributor Portal - shared styles */
:root {
  --navy: #0F2D5C;
  --navy-2: #1B3D72;
  --navy-line: #24477F;
  --blue: #1C4F9C;
  --blue-dark: #133A76;
  --blue-soft: #E7EEF8;
  --blue-ink: #163C78;
  --gold: #B8913A;
  --gold-light: #E2C273;
  --leaf: #2E8B3A;
  --ink: #0F1B2D;
  --ink-2: #26324A;
  --muted: #5A6577;
  --line: #E3E8F0;
  --line-soft: #EEF1F6;
  --field: #C9D2DF;
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --gain: #0A6640;
  --gain-bg: #E3F4EC;
  --loss: #B42318;
  --loss-bg: #FDE8E6;
  --warn: #B54708;
  --warn-bg: #FEF4E6;
  --orange: #E07B39;
  --sky: #7FA6F0;
  --grey: #B8C4DA;
  --radius: 12px;
  --font: 'InfinityMoney360', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'InfinityMoney360 Display', 'InfinityMoney360', system-ui, sans-serif;
  --brand: 'InfinityMoney360 Brand', Georgia, serif;
  --mono: 'InfinityMoney360 Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.gain { color: var(--gain); font-weight: 600; }
.loss { color: var(--loss); font-weight: 600; }

/* ---------- Buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #F8FAFC; color: var(--ink); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); color: #fff; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 48px; font-size: 16px; }
.btn-icon { width: 44px; padding: 0; border: 0; background: transparent; }
.input, .select { height: 44px; border: 1px solid var(--field); border-radius: 8px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; }
.input:focus, .select:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

/* ---------- App layout (sidebar + content) ---------- */
.layout { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 240px; max-width: 100%; background: var(--navy); padding: 20px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-name { font-weight: 700; font-size: 15px; }
.sidebar .brand-name { color: #fff; }
.brand-sub { color: #9FB0CE; font-size: 11.5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #C9D3E6; text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-link:hover { background: var(--navy-2); color: #fff; }
.nav-link.active { background: var(--blue); color: #fff; }
.sidebar-user { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--navy-line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2A4880; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.sidebar-user .name { color: #fff; font-size: 13.5px; font-weight: 600; }
.sidebar-user a { color: #9FB0CE; font-size: 12.5px; }

.content { flex: 999 1 560px; min-width: 0; padding: 24px clamp(16px, 3vw, 32px) 48px; display: flex; flex-direction: column; gap: 20px; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-header h1 { font-size: 26px; font-weight: 700; }
.page-header .sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }


/* ---------- Cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.card-flush .card-head { padding: 18px 20px; margin: 0; align-items: center; }
.card h2 { font-size: 16px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 28px; font-weight: 700; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 13px; color: var(--muted); }
@media (min-width: 1180px) { .wide { grid-column: span 2; } }
@media (max-width: 400px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sync status ---------- */
.sync-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--ink-2); }
.sync-bar span { display: flex; align-items: center; gap: 8px; }
.sync-bar .next { margin-left: auto; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gain); }
.dot.stale { background: var(--warn); }
.dot.failed { background: var(--loss); }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; background: #C7D7F6; border-radius: 4px 4px 0 0; }
.bars div.current { background: var(--blue); }
.bar-labels { display: flex; gap: 10px; padding: 8px 4px 0; font-size: 11.5px; color: var(--muted); text-align: center; }
.bar-labels span { flex: 1; min-width: 0; }
@media (max-width: 480px) { .bars, .bar-labels { gap: 4px; } .bar-labels { font-size: 10px; } }
.bar-labels .current { color: var(--ink); font-weight: 600; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.donut-hole { width: 88px; height: 88px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.legend { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; flex: 1; min-width: 140px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend .val { margin-left: auto; font-weight: 600; }
.legend .amt { margin-left: auto; color: var(--muted); }
.legend .amt + .val { margin-left: 0; width: 44px; text-align: right; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.c-equity { background: var(--blue); } .c-hybrid { background: var(--orange); } .c-debt { background: var(--sky); } .c-other { background: var(--grey); }
.stack-bar { height: 14px; border-radius: 7px; overflow: hidden; display: flex; }
.progress { height: 8px; background: var(--line-soft); border-radius: 4px; }
.progress div { height: 8px; background: var(--blue); border-radius: 4px; }
.split-row { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; }
.split-row.first { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* ---------- Lists ---------- */
.attention { display: flex; flex-direction: column; gap: 10px; }
.attention a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.attention .danger { background: #FDF0EE; } .attention .warn { background: var(--warn-bg); } .attention .neutral { background: var(--line-soft); }
.rank { display: flex; flex-direction: column; gap: 14px; }
.rank .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row .t { font-size: 14px; font-weight: 600; }
.list-row .s { font-size: 12.5px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #F8FAFC; white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFD; }
.table .sub { font-size: 12px; color: var(--muted); }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.pager { display: flex; gap: 6px; }
.pager .btn[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Pills ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-success { background: var(--gain-bg); color: var(--gain); }
.pill-info { background: var(--blue-soft); color: var(--blue-ink); }
.pill-warn { background: var(--warn-bg); color: #93370D; }
.pill-danger { background: var(--loss-bg); color: #9A1C12; }
.pill-neutral { background: var(--line-soft); color: var(--ink-2); }
.count { color: #fff; }
.count.danger { background: var(--loss); } .count.warn { background: var(--warn); } .count.neutral { background: var(--ink-2); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.filters .input { flex: 1 1 260px; }
@media (max-width: 560px) { .filters .select { flex: 1 1 100%; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14,34,68,0.45); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 480px; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 20px 48px rgba(14,34,68,0.25); }
.modal h2 { font-size: 20px; font-weight: 700; }
.secret { margin-top: 20px; padding: 16px; background: var(--bg); border: 1px dashed var(--grey); border-radius: 10px; }
.secret .k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.secret .pw { font-family: var(--mono); font-size: 20px; letter-spacing: .06em; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; }
.check input { width: 18px; height: 18px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-hero { flex: 1 1 480px; background: var(--navy); color: #fff; padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.login-hero .brand { padding: 0; }
.login-hero .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
.login-hero .brand-name { font-size: 18px; }
.login-hero .brand-sub { font-size: 12.5px; color: var(--grey); }
.login-hero h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; margin-bottom: 16px; max-width: 520px; }
.login-hero .lead { font-size: 16px; line-height: 1.6; color: #C9D3E6; margin-bottom: 32px; max-width: 520px; }
.points { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.points div { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: #E3E9F5; }
.points svg { flex: none; }
.login-hero .disclaimer { font-size: 12px; line-height: 1.5; color: #9FB0CE; }
.login-main { flex: 1 1 440px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px 32px; box-shadow: 0 1px 2px rgba(15,27,45,0.04); }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--line-soft); border-radius: 10px; margin: 24px 0; }
.segmented button { height: 40px; border: 0; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--muted); }
.segmented button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,45,0.12); }
.form { display: flex; flex-direction: column; gap: 18px; }
.form .input { width: 100%; height: 48px; font-size: 15px; }
#pan { text-transform: uppercase; letter-spacing: .08em; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.error { font-size: 12.5px; color: var(--loss); margin-top: 6px; }
.form-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--blue-soft); border-radius: 8px; font-size: 13px; line-height: 1.5; color: var(--blue-ink); }
.help { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) {
  .login-hero { padding: 28px 20px; gap: 24px; }
  .login-hero .points, .login-hero .lead { display: none; }
  .login-main { padding: 24px 16px; align-items: flex-start; }
  .login-card { padding: 28px 20px; }
}

/* ---------- Investor pages ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 12px clamp(16px, 3vw, 32px); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 400px; }
.topnav a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.topnav a:hover { background: var(--line-soft); color: var(--ink); }
.topnav a.active { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.topbar .avatar { background: var(--navy); width: 36px; height: 36px; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 48px; display: flex; flex-direction: column; gap: 20px; }
.hero { background: var(--navy); color: #fff; border-radius: 16px; padding: 24px clamp(20px, 3vw, 32px); display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; }
.hero .k { font-size: 12.5px; color: var(--grey); }
.hero .big { font-size: clamp(32px, 4vw, 42px); font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero .up { font-size: 14px; color: #7FE0B0; margin-top: 6px; font-weight: 600; }
.hero-stats { flex: 2 1 420px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.hero-stats .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.hero-stats .v.up { color: #7FE0B0; margin: 4px 0 0; }
.holding-cards { display: none; flex-direction: column; gap: 10px; }
.holding-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.holding-card .row { display: flex; justify-content: space-between; gap: 10px; }
.holding-card .row + .row { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.bottom-nav { display: none; }
.footnote { font-size: 12px; line-height: 1.6; color: var(--muted); }

@media (max-width: 640px) {
  .topnav { display: none; }
  .topbar .user .meta { display: none; }
  .topbar-inner { justify-content: space-between; }
  .container { padding-bottom: 96px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: 100%; }
  .holdings-table { display: none; }
  .holding-cards { display: flex; }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px 10px; z-index: 40; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; font-size: 11.5px; color: var(--muted); text-decoration: none; }
  .bottom-nav a.active { color: var(--blue); font-weight: 600; }
}

/* =====================================================================
   v2 additions: data-driven pages (RTA mailbacks)
   ===================================================================== */
.nav-link span:first-of-type { flex: 1; }
.nav-badge { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--loss); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.pager .gap { padding: 0 4px; color: var(--muted); align-self: center; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--line-soft); color: var(--ink-2); white-space: nowrap; margin: 2px 4px 2px 0; }
.tag-blue { background: var(--blue-soft); color: var(--blue-ink); }
.tag-warn { background: var(--warn-bg); color: #93370D; }
.tag-danger { background: var(--loss-bg); color: #9A1C12; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 600; cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--blue); text-decoration: underline; }
.table tbody tr.clickable { cursor: pointer; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-ink); font-size: 13px; }
.banner.warn { background: var(--warn-bg); color: #7A2E0B; }
.banner .select { height: 36px; font-size: 13px; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { font-weight: 500; opacity: .75; }

/* Summary strip */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary div { background: #fff; padding: 14px 16px; }
.summary .k { font-size: 12.5px; color: var(--muted); }
.summary .v { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Source cards */
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.report-list { display: flex; flex-direction: column; margin-top: 12px; }
.report-list div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.report-list div:last-child { border-bottom: 0; }
.report-list code { font-family: var(--mono); font-size: 12.5px; background: var(--line-soft); padding: 1px 6px; border-radius: 4px; margin-right: 8px; }
.dropzone { border: 2px dashed var(--grey); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); background: #fff; }
.dropzone b { color: var(--ink); }

/* Flows chart (two series per month) */
.flows { display: flex; align-items: flex-end; gap: 6px; height: 200px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.flows .m { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; min-width: 0; }
.flows .in, .flows .out { width: 45%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 1px; }
.flows .in { background: var(--blue); } .flows .out { background: var(--orange); }
.flows-labels { display: flex; gap: 6px; padding: 6px 2px 0; font-size: 11px; color: var(--muted); }
.flows-labels span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; padding: 6px 0; }
.hbar .track { height: 10px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.hbar .track div { height: 10px; background: var(--blue); border-radius: 5px; }
@media (max-width: 480px) { .flows, .flows-labels { gap: 2px; } .flows-labels span:nth-child(even) { visibility: hidden; } }

/* Side panel (Client 360) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(14,34,68,0.45); z-index: 45; display: flex; justify-content: flex-end; }
.drawer-backdrop[hidden] { display: none; }
.drawer { width: min(760px, 100%); height: 100%; background: var(--bg); overflow-y: auto; box-shadow: -12px 0 32px rgba(14,34,68,0.18); display: flex; flex-direction: column; }
.drawer-head { background: #fff; border-bottom: 1px solid var(--line); padding: 20px 24px 0; position: sticky; top: 0; z-index: 2; }
.drawer-head h2 { font-size: 22px; }
.drawer-body { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-top: 14px; }
.tabs button { height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.kv { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 560px) { .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; } .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }

/* Investor extras */
.member-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.lock-note { font-size: 12px; color: #93370D; margin-top: 4px; }
.gain-fy { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.gain-fy > div { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
details.more summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 13.5px; padding: 8px 0; }
.test-pans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.test-pans button { height: 32px; padding: 0 10px; border: 1px dashed var(--grey); background: #fff; border-radius: 6px; font-family: var(--mono); font-size: 12.5px; cursor: pointer; color: var(--ink-2); }

/* ---------- InfinityMoney360 brand ---------- */
.brand-mark { background: #14124f; overflow: hidden; padding: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-family: var(--brand); letter-spacing: .04em; }
.brand-name .brand-accent { color: var(--gold); }
.sidebar .brand-name .brand-accent, .login-hero .brand-name .brand-accent { color: var(--gold-light); }
.nav-link.active { box-shadow: inset 3px 0 0 var(--gold-light); }
.login-logo { display: block; width: 170px; height: auto; margin: 0 auto 20px; border-radius: 16px; }
.hero { background: linear-gradient(0deg, var(--navy), var(--navy)); border-bottom: 3px solid var(--gold); }
.c-equity { background: #1C4F9C; }
.c-hybrid { background: #D4A84B; }
.c-debt { background: #5FA86A; }
.flows .out { background: #D4A84B; }
.brand-name { white-space: nowrap; }
@media (min-width: 641px) and (max-width: 1000px) { .topnav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .topbar .user { margin-left: auto; } }

/* Growth projection */
.proj th[scope="row"] { font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; background: #fff; }
.proj-chart { margin-top: 18px; }
.proj-bars { display: flex; gap: 24px; height: 200px; align-items: stretch; }
.proj-bars .grp { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.proj-bars .bars3 { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 6px; border-bottom: 1px solid var(--line); }
.proj-bars .b { width: 26%; max-width: 34px; border-radius: 4px 4px 0 0; }
.proj-bars .lbl { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0 0; }
.r0 { background: #5FA86A; } .r1 { background: #D4A84B; } .r2 { background: #1C4F9C; }
.nw { white-space: nowrap; }
#growth .toolbar, #dr-growth .toolbar { min-width: 0; }
#growth .toolbar .select, #dr-growth .toolbar .select { flex: 1 1 220px; }

/* ---------- Reports ---------- */
.report-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.report-catalog { flex: 1 1 260px; max-width: 100%; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.report-catalog .grp { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 10px 4px; }
.report-catalog button { text-align: left; border: 0; background: none; border-radius: 8px; padding: 10px; font: inherit; cursor: pointer; color: var(--ink); min-height: 44px; }
.report-catalog button:hover { background: var(--line-soft); }
.report-catalog button[aria-current="true"] { background: var(--blue-soft); color: var(--blue-ink); box-shadow: inset 3px 0 0 var(--gold); }
.report-catalog button b { display: block; font-size: 14px; }
.report-catalog button span { font-size: 12px; color: var(--muted); }
.report-panel { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.report-panel .filters .select, .report-panel .filters .input { height: 40px; }
.report-panel .filters label.fl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.report-section h3 { font-size: 15px; padding: 16px 20px 0; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #F8FAFC; }
.print-head { display: none; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .no-print, .table-foot, .bottom-nav { display: none !important; }
  .layout, .content, .report-layout, .report-panel { display: block; padding: 0; }
  .card, .summary { border: 1px solid #ccd; box-shadow: none; break-inside: avoid; margin-bottom: 10px; }
  .table-wrap { overflow: visible; }
  .table { min-width: 0 !important; font-size: 10.5px; }
  .table th, .table td { padding: 5px 6px; }
  .table tr { break-inside: avoid; }
  .print-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--gold); padding-bottom: 10px; margin-bottom: 12px; }
  .print-head img { width: 56px; height: 56px; }
  .pill { border: 1px solid currentColor; }
}
.summary[hidden] { display: none; }
.report-pick { display: none; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 1100px) { .report-catalog { display: none; } .report-pick { display: flex; } }

/* ---------- Auth ---------- */
/* Protected pages stay hidden until assets/auth.js has confirmed the session and role. */
html.fk-auth-pending body { visibility: hidden; }
.login-card [data-step] h2 { margin-top: 4px; }
.login-card #login-alert { margin-bottom: 16px; }
/* .banner sets display:flex, which would otherwise override the hidden attribute. */
.banner[hidden] { display: none; }
