/* X12 Capital PMS — Extracted from monolith v5.9.3 */
* { margin:0; padding:0; box-sizing:border-box; }
body { background:#0a0e1a; color:#e0e6f0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-size:13px; line-height:1.5; min-height:100vh; }

/* ── LAYOUT ── */
.shell { display:flex; height:100vh; overflow:hidden; }
.sidebar { width:200px; background:#0f1320; border-right:1px solid #1e2538; display:flex; flex-direction:column; flex-shrink:0; overflow-y:auto; }
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.topbar { background:#0f1320; border-bottom:1px solid #1e2538; padding:10px 18px; display:flex; justify-content:space-between; align-items:center; flex-shrink:0; }
.content { flex:1; overflow-y:auto; padding:16px 18px; }

/* ── SIDEBAR ── */
.logo { padding:14px 16px 10px; border-bottom:1px solid #1e2538; }
.logo-title { font-size:13px; font-weight:800; color:#f0a500; letter-spacing:0.5px; }
.logo-sub { font-size:9px; color:#5a6a80; text-transform:uppercase; letter-spacing:1px; margin-top:1px; }

.fund-switcher { padding:8px; border-bottom:1px solid #1e2538; }
.fund-btn { display:block; width:100%; padding:6px 10px; border-radius:5px; border:none; background:transparent; color:#7a8aa0; font-size:11px; font-weight:600; cursor:pointer; text-align:left; margin-bottom:2px; transition:all 0.15s; }
.fund-btn.active { background:rgba(240,165,0,0.12); color:#f0a500; }
.fund-btn:hover:not(.active) { background:#1e2538; color:#c8d4e0; }
.fund-tag { display:inline-block; font-size:9px; padding:1px 5px; border-radius:3px; margin-left:4px; }
.tag-daa { background:rgba(99,179,237,0.15); color:#63b3ed; }
.tag-sl { background:rgba(167,139,250,0.15); color:#a78bfa; }

.nav-section { padding:8px 8px 4px; }
.nav-section + .nav-section { border-top:1px solid #131929; margin-top:4px; padding-top:10px; }
.nav-label { font-size:9px; text-transform:uppercase; letter-spacing:1px; color:#4a5568; padding:0 8px 4px; font-weight:700; }
.nav-restricted { color:#7a5a20 !important; }
.nav-restricted:hover:not(.active) { background:#1a1510 !important; }
.nav-restricted.active { background:#1e1a0e !important; color:#f0a500 !important; }
.nav-item { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:5px; cursor:pointer; color:#7a8aa0; font-size:11px; font-weight:500; margin-bottom:1px; transition:all 0.15s; }
.nav-item.active { background:#1e2538; color:#e0e6f0; }
.nav-item:hover:not(.active) { background:#151b28; color:#c8d4e0; }
.nav-section { font-size:9px; text-transform:uppercase; letter-spacing:1.5px; color:#2a3448; font-weight:700; padding:10px 10px 4px; margin-top:4px; border-top:1px solid #141928; }
.nav-section:first-child { border-top:none; margin-top:0; }
.nav-restricted { color:#7a5a20 !important; }
.nav-restricted:hover:not(.active) { background:#1a1610 !important; }
.nav-restricted.active { background:#1e1a0e; color:#f0a500 !important; }
.nav-icon { font-size:12px; width:16px; text-align:center; }

.sidebar-footer { margin-top:auto; padding:10px 12px; border-top:1px solid #1e2538; font-size:10px; color:#4a5568; }

/* ── TOPBAR ── */
.page-title { font-size:15px; font-weight:700; color:#e0e6f0; }
.page-sub { font-size:11px; color:#5a6a80; margin-top:1px; }
.topbar-right { display:flex; align-items:center; gap:10px; }
.fund-indicator { padding:4px 10px; border-radius:12px; font-size:11px; font-weight:700; }
.fi-daa { background:rgba(99,179,237,0.12); color:#63b3ed; border:1px solid rgba(99,179,237,0.2); }
.fi-sl { background:rgba(167,139,250,0.12); color:#a78bfa; border:1px solid rgba(167,139,250,0.2); }
.fi-all { background:rgba(240,165,0,0.12); color:#f0a500; border:1px solid rgba(240,165,0,0.2); }
.topbar-date { font-size:11px; color:#5a6a80; }
.btn { padding:5px 12px; border-radius:5px; border:none; font-size:11px; font-weight:600; cursor:pointer; transition:all 0.15s; }
.btn-primary { background:#f0a500; color:#0a0e1a; }
.btn-primary:hover { background:#d4920a; }
.btn-ghost { background:#1e2538; color:#7a8aa0; }
.btn-ghost:hover { background:#252d3d; color:#c8d4e0; }

/* ── CARDS ── */
.card { background:#1a1f2e; border:1px solid #1e2538; border-radius:8px; padding:14px 16px; }
.card-header { display:flex; align-items:center; gap:8px; margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid #1e2538; }
.card-icon { font-size:13px; }
.card-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:#f0a500; flex:1; }
.card-badge { background:#252d3d; color:#7a8aa0; font-size:10px; padding:2px 7px; border-radius:8px; }

/* ── GRIDS ── */
.g2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.g3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.g4 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:12px; }
.g5 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr 1fr; gap:12px; }
.gf { grid-column:1/-1; }
.gap { margin-bottom:12px; }

/* ── KPI BOXES ── */
.kpi { background:#1a1f2e; border:1px solid #1e2538; border-radius:8px; padding:12px 14px; }
.kpi-val { font-size:19px; font-weight:800; color:#f0a500; font-variant-numeric:tabular-nums; }
.kpi-label { font-size:10px; color:#5a6a80; text-transform:uppercase; letter-spacing:0.5px; margin-top:3px; }
.kpi-sub { font-size:11px; color:#7a8aa0; margin-top:4px; }
.kpi-chg { font-size:11px; font-weight:600; margin-top:2px; }
.pos { color:#22c55e; } .neg { color:#ef4444; } .neu { color:#7a8aa0; }

/* ── STATUS BADGES ── */
.s { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:700; padding:2px 7px; border-radius:8px; white-space:nowrap; }
.sg { background:rgba(34,197,94,0.12); color:#22c55e; }
.sa { background:rgba(245,158,11,0.12); color:#f59e0b; }
.sr { background:rgba(239,68,68,0.12); color:#ef4444; }
.sb { background:rgba(99,179,237,0.12); color:#63b3ed; }
.sp { background:rgba(167,139,250,0.12); color:#a78bfa; }

/* ── TABLES ── */
.tbl { width:100%; border-collapse:collapse; }
.tbl th { font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:#5a6a80; text-align:left; padding:5px 8px; border-bottom:1px solid #1e2538; white-space:nowrap; }
.tbl th.r { text-align:right; }
.tbl td { padding:6px 8px; border-bottom:1px solid #141928; font-size:12px; vertical-align:middle; }
.tbl td.r { text-align:right; font-variant-numeric:tabular-nums; }
.tbl tr:last-child td { border-bottom:none; }
.tbl tr:hover td { background:rgba(255,255,255,0.02); }
.tbl-name { font-weight:600; color:#c8d4e0; }
.tbl-sub { font-size:10px; color:#5a6a80; margin-top:1px; }
.tbl tfoot td { border-top:1px solid #252d3d; font-weight:700; color:#c8d4e0; background:#141928; }

/* ── RISK BARS ── */
.risk-bar-wrap { background:#141928; border-radius:4px; height:6px; overflow:hidden; }
.risk-bar { height:100%; border-radius:4px; transition:width 0.3s; }
.rb-g { background:#22c55e; }
.rb-a { background:#f59e0b; }
.rb-r { background:#ef4444; }
.risk-label { display:flex; justify-content:space-between; margin-bottom:3px; }
.risk-name { font-size:11px; color:#7a8aa0; }
.risk-pct { font-size:11px; font-weight:700; }

/* ── FORMS ── */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.fg3 { grid-template-columns:1fr 1fr 1fr; }
.fg4 { grid-template-columns:1fr 1fr 1fr 1fr; }
.form-group { display:flex; flex-direction:column; gap:4px; }
.form-group label { font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:#5a6a80; font-weight:700; }
.form-group input, .form-group select, .form-group textarea {
  background:#141928; border:1px solid #252d3d; border-radius:5px;
  color:#e0e6f0; font-size:12px; padding:7px 10px; outline:none;
  transition:border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { border-color:#f0a500; }
.form-group select option { background:#1a1f2e; }
.fld { background:#141928; border:1px solid #252d3d; border-radius:4px; color:#e0e6f0; font-size:11px; padding:4px 8px; outline:none; }
.fld:focus { border-color:#f0a500; }
.form-actions { display:flex; gap:8px; margin-top:12px; }

/* ── MIS INPUTS ── */
.mis-input {
  background:#141928; border:1px solid #252d3d; border-radius:4px;
  color:#e0e6f0; font-size:12px; padding:4px 7px; outline:none;
  width:110px; text-align:right; font-variant-numeric:tabular-nums;
  transition:border-color 0.15s;
}
.mis-input:focus { border-color:#f0a500; }
.mis-input::placeholder { color:#3a4a5a; }

/* ── SECTION PAGES ── */
.page { display:none; }
.page.active { overflow-y:auto; }
.page.active { display:block; }

/* ── MISC ── */
.divider { border:none; border-top:1px solid #1e2538; margin:12px 0; }
.note { font-size:10px; color:#4a5568; font-style:italic; margin-top:6px; }
.alert { border-radius:6px; padding:9px 12px; margin-bottom:10px; display:flex; align-items:flex-start; gap:8px; }
.alert-r { background:rgba(239,68,68,0.08); border:1px solid rgba(239,68,68,0.2); }
.alert-a { background:rgba(245,158,11,0.08); border:1px solid rgba(245,158,11,0.2); }
.alert-g { background:rgba(34,197,94,0.08); border:1px solid rgba(34,197,94,0.2); }
.alert-icon { font-size:13px; flex-shrink:0; margin-top:1px; }
.alert-text { font-size:12px; color:#c8d4e0; }
.alert-label { font-weight:700; margin-bottom:2px; }
.section-gap { margin-bottom:14px; }
.tag { display:inline-block; font-size:9px; padding:1px 6px; border-radius:4px; font-weight:700; }
.tag-daa2 { background:rgba(99,179,237,0.12); color:#63b3ed; }
.tag-sl2 { background:rgba(167,139,250,0.12); color:#a78bfa; }

.period-btn { font-size:10px; padding:3px 10px; border-radius:4px; border:1px solid #252d3d; background:#141928; color:#7a8aa0; cursor:pointer; transition:all .15s; }
.period-btn.active { background:#1e2538; color:#f0a500; border-color:#f0a500; font-weight:700; }
.period-btn:hover:not(.active) { color:#c8d4e0; border-color:#3a4a5a; }
.hist-tbl th { font-size:10px; padding:6px 8px; }
.hist-tbl td { font-size:11px; padding:5px 8px; }
.pos { color:#22c55e; }
.neg-c { color:#ef4444; }
.zero { color:#4a5568; }
.snap-dot { width:6px; height:6px; border-radius:50%; display:inline-block; margin-right:4px; }
.snap-dot-live { background:#22c55e; }
.snap-dot-hist { background:#3a5a7a; }
.ff-stat { background:#141928; border:1px solid #1e2538; border-radius:6px; padding:8px 12px; }
.ff-stat-val { font-size:18px; font-weight:800; }
.ff-stat-label { font-size:10px; color:#5a6a80; text-transform:uppercase; letter-spacing:.5px; margin-top:2px; }
.ff-stat-sub { font-size:10px; color:#3a4a5a; margin-top:1px; }

.live-price-card { background:#0e1826; border:1px solid #1e2a3a; border-radius:8px; padding:12px; transition:border-color .2s; }
.live-price-card:hover { border-color:#3a4a5a; }
.live-price-card.stale { opacity:.5; }
.lp-sym { font-size:11px; font-weight:700; color:#7a8aa0; text-transform:uppercase; letter-spacing:.5px; margin-bottom:4px; }
.lp-price { font-size:16px; font-weight:800; color:#e0e6f0; font-family:monospace; line-height:1.2; }
.lp-chg { font-size:11px; margin-top:2px; }
.lp-chg.chg-up { color:#22c55e; }
.lp-chg.chg-dn { color:#ef4444; }
.lp-chg.chg-flat { color:#4a5568; }
.lp-src { font-size:9px; color:#2a3848; text-transform:uppercase; letter-spacing:.5px; margin-top:4px; }
.lvl { display:inline-block; font-size:10px; font-weight:800; padding:1px 7px; border-radius:3px; }
.lvl1 { background:rgba(34,197,94,0.15); color:#22c55e; }
.lvl2 { background:rgba(245,158,11,0.15); color:#f59e0b; }
.lvl3 { background:rgba(239,68,68,0.15); color:#ef4444; }
.fg4 { display:grid; grid-template-columns: repeat(4,1fr); }
.fg3 { display:grid; grid-template-columns: repeat(3,1fr); }

/* ── Waterfall table ─────────────────────────────── */
.wf-tbl { width:100%; border-collapse:collapse; font-size:11px; }
.wf-tbl th.wf-month { text-align:center; padding:6px 10px; background:#0e1826; color:#7a8aa0; font-weight:700; font-size:10px; white-space:nowrap; border-bottom:2px solid #1e2538; border-right:1px solid #141928; min-width:100px; }
.wf-tbl th.wf-month.wf-month-curr { color:#f0a500; border-bottom-color:#f0a500; }
.wf-tbl th.wf-label { text-align:left; padding:6px 14px; background:#0e1826; color:#5a6a80; font-weight:600; font-size:10px; border-bottom:2px solid #1e2538; width:200px; min-width:180px; white-space:nowrap; }
.wf-tbl td.wf-label { font-size:11px; padding:6px 14px; border-right:1px solid #141928; color:#c8d4e0; white-space:nowrap; }
.wf-tbl td.wf-label.wf-input-row { color:#7a8aa0; }
.wf-tbl td.wf-label.wf-calc-row  { color:#e0e6f0; font-weight:600; }
.wf-tbl td.wf-label.wf-subtotal  { color:#f0a500; font-weight:700; font-size:11px; border-top:1px solid #252d3d; }
.wf-tbl td.wf-label.wf-nav-row   { color:#22c55e; font-weight:800; font-size:12px; border-top:2px solid #1e4a2a; }
.wf-tbl td.wf-val  { text-align:right; padding:5px 10px; font-family:monospace; font-size:11px; border-right:1px solid #141928; color:#c8d4e0; cursor:default; }
.wf-tbl td.wf-val.wf-input-val  { cursor:pointer; }
.wf-tbl td.wf-val.wf-input-val:hover { background:rgba(240,165,0,0.06); }
.wf-tbl td.wf-val.wf-subtotal-val { color:#f0a500; font-weight:700; border-top:1px solid #252d3d; }
.wf-tbl td.wf-val.wf-nav-val     { color:#22c55e; font-weight:800; font-size:12px; border-top:2px solid #1e4a2a; background:rgba(34,197,94,0.04); }
.wf-tbl td.wf-val.neg-val { color:#ef4444; }
.wf-tbl td.wf-val.pos-val { color:#22c55e; }
.wf-tbl td.wf-val.zero-val { color:#2a3848; }
.wf-tbl tr.wf-section-header td { background:#0a0e18; border-top:1px solid #252d3d; padding:4px 14px; font-size:10px; text-transform:uppercase; letter-spacing:.5px; font-weight:700; color:#3a4a5a; }
.wf-tbl tr:hover td { background:rgba(255,255,255,0.015); }
.wf-tbl tr.wf-nav-tr:hover td { background:rgba(34,197,94,0.04); }
.wf-edit-icon { display:none; font-size:9px; color:#f0a500; margin-left:3px; }
.wf-tbl td.wf-input-val:hover .wf-edit-icon { display:inline; }
/* Sticky first column */
.wf-tbl td.wf-label, .wf-tbl th.wf-label { position:sticky; left:0; z-index:2; background:#0a0e18; }
.wf-tbl th.wf-label { z-index:3; }

/* ── Fee Checker ──────────────────────────────────── */
.fc-section td { background:#0a0e18; color:#3a4a5a; font-size:10px; text-transform:uppercase; letter-spacing:.5px; font-weight:700; padding:5px 14px; border-top:1px solid #252d3d; }
.fc-ok  { color:#22c55e !important; font-weight:700; }
.fc-warn{ color:#f59e0b !important; font-weight:700; }
.fc-err { color:#ef4444 !important; font-weight:700; }
.fc-na  { color:#2a3848 !important; }
.wf-tbl th.wf-month-act { background:#0a1e0a; cursor:pointer; }
.wf-tbl th.wf-month-act:hover { background:#0e2a0e; }
.act-dot { display:inline-block; width:6px; height:6px; border-radius:50%; margin-left:5px; vertical-align:middle; }
.act-dot-y { background:#22c55e; }
.act-dot-n { background:#2a3848; }

/* ── WorkTable Component ── */
.wt-toolbar { display:flex; gap:6px; align-items:center; padding:8px 10px; border-bottom:1px solid #1e2538; flex-wrap:wrap; }
.wt-toolbar .fld { font-size:10px; padding:3px 8px; }
.wt-toolbar .wt-search { width:140px; }
.wt-toolbar .wt-date { width:118px; }
.wt-toolbar .wt-select { min-width:70px; max-width:180px; }
.wt-toolbar .wt-spacer { flex:1; }
.wt-toolbar .wt-count { font-size:10px; color:#5a6a80; white-space:nowrap; }
.wt-sort { cursor:pointer; user-select:none; }
.wt-sort:hover { color:#f0a500; }
.wt-sort::after { content:''; margin-left:3px; font-size:8px; }
.wt-sort.wt-asc::after { content:' ▲'; }
.wt-sort.wt-desc::after { content:' ▼'; }
.wt-chip { display:inline-flex; align-items:center; gap:2px; font-size:9px; font-weight:700; padding:1px 6px; border-radius:6px; white-space:nowrap; }
.wt-chip-green { background:rgba(34,197,94,0.12); color:#22c55e; }
.wt-chip-amber { background:rgba(245,158,11,0.12); color:#f59e0b; }
.wt-chip-red { background:rgba(239,68,68,0.12); color:#ef4444; }
.wt-chip-blue { background:rgba(99,179,237,0.12); color:#63b3ed; }
.wt-chip-purple { background:rgba(167,139,250,0.12); color:#a78bfa; }
.wt-chip-teal { background:rgba(45,212,191,0.12); color:#2dd4bf; }
.wt-chip-grey { background:rgba(107,114,128,0.12); color:#6b7280; }
.wt-empty { text-align:center; color:#5a6a80; padding:24px 8px; }
.wt-actions { display:flex; gap:4px; justify-content:flex-end; }
.wt-actions button { background:none; border:none; cursor:pointer; font-size:11px; padding:1px 4px; border-radius:4px; }
.wt-actions button:hover { background:rgba(255,255,255,0.06); }
.wt-actions button.wt-disabled { opacity:0.3; cursor:not-allowed; }
.wt-footer-bar { display:flex; justify-content:space-between; align-items:center; padding:6px 10px; font-size:10px; color:#5a6a80; border-top:1px solid #1e2538; }
.wt-footer-bar .wt-export { cursor:pointer; color:#63b3ed; }
.wt-footer-bar .wt-export:hover { text-decoration:underline; }
/* ── DetailPanel (Phase 8) ── */
.dp-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:900;display:none}
.dp-overlay.dp-active{display:block}
.dp-side{position:fixed;top:0;right:0;width:420px;height:100vh;background:#0d1117;border-left:1px solid #1e2538;z-index:950;transform:translateX(100%);transition:transform 0.2s ease;overflow-y:auto}
.dp-side.dp-active{transform:translateX(0)}
.dp-header{padding:16px;border-bottom:1px solid #1e2538;display:flex;align-items:flex-start;gap:12px}
.dp-header .dp-close{background:none;border:none;color:#5a6a80;font-size:18px;cursor:pointer;padding:2px 6px;border-radius:4px}
.dp-header .dp-close:hover{color:#e0e6f0;background:rgba(255,255,255,0.06)}
.dp-title{font-size:14px;font-weight:700;color:#e0e6f0}
.dp-subtitle{font-size:11px;color:#5a6a80;margin-top:2px}
.dp-status{margin-top:4px}
.dp-nav{display:flex;gap:0;border-bottom:1px solid #1e2538}
.dp-nav button{flex:1;padding:8px;background:none;border:none;border-bottom:2px solid transparent;color:#5a6a80;font-size:11px;cursor:pointer;font-weight:600}
.dp-nav button.dp-active{color:#f0a500;border-bottom-color:#f0a500}
.dp-nav button:hover{color:#c8d4e0}
.dp-tab{display:none;padding:12px 16px}
.dp-tab.dp-active{display:block}
.dp-summary{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px}
.dp-summary .dp-field.dp-full{grid-column:1/-1}
.dp-summary .dp-field-label{font-size:9px;text-transform:uppercase;letter-spacing:.5px;color:#5a6a80;font-weight:700}
.dp-summary .dp-field-value{font-size:12px;color:#c8d4e0;margin-top:1px}
.dp-actions{display:flex;gap:6px;padding:12px 16px;border-top:1px solid #1e2538;flex-wrap:wrap}
.dp-actions button{font-size:11px}
.dp-history{padding:0}
.dp-history-item{display:flex;gap:8px;padding:8px 0;border-bottom:1px solid #0d1117;font-size:11px}
.dp-history-time{color:#5a6a80;min-width:60px}
.dp-history-action{font-weight:600;min-width:60px}
.dp-history-detail{color:#7a8aa0;flex:1}
.dp-notes textarea{width:100%;min-height:80px;background:#141928;border:1px solid #252d3d;border-radius:4px;color:#c8d4e0;padding:8px;font-size:11px;resize:vertical}
.dp-related-item{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid #0d1117;cursor:pointer;font-size:11px;color:#63b3ed}
.dp-related-item:hover{color:#f0a500}
.dp-mono{font-family:Consolas,'Courier New',monospace;font-size:10px;word-break:break-all}
.dp-age-bar{height:3px;border-radius:2px;margin-top:4px}
/* ── Status Chips (Phase 8) ── */
.chip{display:inline-block;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;letter-spacing:0.3px}
.chip-pending{background:rgba(245,158,11,0.15);color:#f59e0b}
.chip-active,.chip-open{background:rgba(59,130,246,0.15);color:#63b3ed}
.chip-completed,.chip-matched{background:rgba(16,185,129,0.15);color:#10b981}
.chip-cancelled{background:rgba(100,116,139,0.15);color:#94a3b8}
.chip-warning{background:rgba(245,158,11,0.15);color:#f59e0b}
.chip-breach,.chip-break{background:rgba(239,68,68,0.12);color:#ef4444}
.chip-investigating{background:rgba(167,139,250,0.12);color:#a78bfa}
.chip-acknowledged{background:rgba(20,184,166,0.12);color:#14b8a6}
.chip-settled{background:rgba(16,185,129,0.15);color:#10b981}
.chip-late,.chip-overdue{background:rgba(239,68,68,0.12);color:#ef4444}
.chip-grace{background:rgba(245,158,11,0.15);color:#f59e0b}
/* ── Nav Badges (Phase 8) ── */
.nav-badge{font-size:9px;margin-left:auto;padding:1px 6px;border-radius:8px;background:rgba(239,68,68,0.15);color:#ef4444;font-weight:700}
.nav-badge:empty{display:none}

/* ── Toast Notification System (Phase 9A) ── */
.toast-container { position:fixed; top:16px; right:16px; z-index:99999; display:flex; flex-direction:column; gap:8px; pointer-events:none; max-height:90vh; overflow-y:auto; }
.toast { pointer-events:auto; display:flex; align-items:flex-start; gap:8px; padding:10px 16px; border-radius:8px; font-size:12px; line-height:1.5; color:#e2e8f0; max-width:420px; min-width:280px; box-shadow:0 4px 20px rgba(0,0,0,0.4); animation: toastIn 0.25s ease-out; word-break:break-word; white-space:pre-line; }
.toast.toast-out { animation: toastOut 0.2s ease-in forwards; }
.toast-success { background:#0d3320; border:1px solid #166534; }
.toast-error { background:#3b1018; border:1px solid #991b1b; }
.toast-warning { background:#3b2508; border:1px solid #92400e; }
.toast-info { background:#0c2340; border:1px solid #1e3a5f; }
.toast-icon { font-size:14px; flex-shrink:0; margin-top:1px; }
.toast-body { flex:1; }
.toast-close { cursor:pointer; color:#5a6a80; font-size:14px; flex-shrink:0; margin-top:-2px; padding:0 0 0 8px; background:none; border:none; }
.toast-close:hover { color:#e2e8f0; }
@keyframes toastIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(40px); } }

/* ═══════════════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ═══════════════════════════════════════════════════════════════════════ */
body.light-theme { background:#f5f7fa !important; color:#1a202c !important; }

/* Layout */
body.light-theme .sidebar { background:#ffffff !important; border-right-color:#e2e8f0 !important; }
body.light-theme .topbar { background:#ffffff !important; border-bottom-color:#e2e8f0 !important; }
body.light-theme .content { background:#f5f7fa !important; }

/* Sidebar */
body.light-theme .logo-sub { color:#718096 !important; }
body.light-theme .fund-switcher { border-bottom-color:#e2e8f0 !important; }
body.light-theme .fund-btn { color:#4a5568 !important; }
body.light-theme .fund-btn.active { background:rgba(212,146,10,0.1) !important; color:#b8860b !important; }
body.light-theme .fund-btn:hover:not(.active) { background:#f0f2f5 !important; color:#2d3748 !important; }
body.light-theme .nav-section { color:#a0aec0 !important; border-top-color:#e2e8f0 !important; }
body.light-theme .nav-item { color:#4a5568 !important; }
body.light-theme .nav-item.active { background:#edf2f7 !important; color:#1a202c !important; }
body.light-theme .nav-item:hover:not(.active) { background:#f7fafc !important; color:#2d3748 !important; }
body.light-theme .nav-restricted { color:#92640a !important; }
body.light-theme .nav-restricted:hover:not(.active) { background:#fefcf3 !important; }
body.light-theme .nav-restricted.active { background:#fef9e7 !important; color:#b8860b !important; }
body.light-theme .sidebar-footer { border-top-color:#e2e8f0 !important; color:#a0aec0 !important; }
body.light-theme .sidebar-footer span { color:#cbd5e0 !important; }

/* Topbar */
body.light-theme .page-title { color:#1a202c !important; }
body.light-theme .page-sub { color:#718096 !important; }
body.light-theme .topbar-date { color:#718096 !important; }
body.light-theme .btn-ghost { background:#edf2f7 !important; color:#4a5568 !important; }
body.light-theme .btn-ghost:hover { background:#e2e8f0 !important; color:#2d3748 !important; }
body.light-theme .btn-primary { background:#d4920a !important; color:#ffffff !important; }
body.light-theme .btn-primary:hover { background:#b8860b !important; }

/* Cards */
body.light-theme .card { background:#ffffff !important; border-color:#e2e8f0 !important; }
body.light-theme .card-header { border-bottom-color:#e2e8f0 !important; }
body.light-theme .card-title { color:#b8860b !important; }
body.light-theme .card-badge { background:#edf2f7 !important; color:#4a5568 !important; }

/* KPI boxes */
body.light-theme .kpi { background:#ffffff !important; border-color:#e2e8f0 !important; }
body.light-theme .kpi-val { color:#b8860b !important; }
body.light-theme .kpi-label { color:#718096 !important; }
body.light-theme .kpi-sub { color:#4a5568 !important; }

/* Tables */
body.light-theme .tbl th { color:#718096 !important; border-bottom-color:#e2e8f0 !important; }
body.light-theme .tbl td { border-bottom-color:#f0f2f5 !important; color:#2d3748 !important; }
body.light-theme .tbl tr:hover td { background:rgba(0,0,0,0.02) !important; }
body.light-theme .tbl-name { color:#1a202c !important; }
body.light-theme .tbl-sub { color:#718096 !important; }
body.light-theme .tbl tfoot td { border-top-color:#e2e8f0 !important; color:#1a202c !important; background:#f7fafc !important; }

/* Forms */
body.light-theme .form-group label { color:#718096 !important; }
body.light-theme .form-group input,
body.light-theme .form-group select,
body.light-theme .form-group textarea { background:#ffffff !important; border-color:#d1d5db !important; color:#1a202c !important; }
body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus { border-color:#d4920a !important; }
body.light-theme .form-group select option { background:#ffffff !important; color:#1a202c !important; }
body.light-theme .fld { background:#ffffff !important; border-color:#d1d5db !important; color:#1a202c !important; }
body.light-theme .fld:focus { border-color:#d4920a !important; }
body.light-theme .mis-input { background:#ffffff !important; border-color:#d1d5db !important; color:#1a202c !important; }
body.light-theme .mis-input:focus { border-color:#d4920a !important; }
body.light-theme .mis-input::placeholder { color:#cbd5e0 !important; }

/* Status badges — keep colored but slightly more saturated */
body.light-theme .sg { background:rgba(34,197,94,0.1) !important; }
body.light-theme .sa { background:rgba(245,158,11,0.1) !important; }
body.light-theme .sr { background:rgba(239,68,68,0.1) !important; }
body.light-theme .sb { background:rgba(59,130,246,0.1) !important; color:#3182ce !important; }
body.light-theme .sp { background:rgba(124,58,237,0.1) !important; color:#7c3aed !important; }

/* WorkTable */
body.light-theme .wt-toolbar { border-bottom-color:#e2e8f0 !important; }
body.light-theme .wt-count { color:#718096 !important; }
body.light-theme .wt-sort:hover { color:#d4920a !important; }
body.light-theme .wt-empty { color:#a0aec0 !important; }
body.light-theme .wt-footer-bar { border-top-color:#e2e8f0 !important; color:#718096 !important; }
body.light-theme .wt-footer-bar .wt-export { color:#3182ce !important; }

/* Chips */
body.light-theme .wt-chip-blue { color:#3182ce !important; }
body.light-theme .wt-chip-purple { color:#7c3aed !important; }

/* Period buttons */
body.light-theme .period-btn { background:#ffffff !important; border-color:#d1d5db !important; color:#4a5568 !important; }
body.light-theme .period-btn.active { background:#fef9e7 !important; color:#b8860b !important; border-color:#d4920a !important; }
body.light-theme .period-btn:hover:not(.active) { color:#2d3748 !important; border-color:#a0aec0 !important; }

/* Waterfall table */
body.light-theme .wf-tbl th.wf-month { background:#f7fafc !important; color:#4a5568 !important; border-bottom-color:#e2e8f0 !important; border-right-color:#f0f2f5 !important; }
body.light-theme .wf-tbl th.wf-month.wf-month-curr { color:#b8860b !important; border-bottom-color:#d4920a !important; }
body.light-theme .wf-tbl th.wf-label { background:#f7fafc !important; color:#718096 !important; border-bottom-color:#e2e8f0 !important; }
body.light-theme .wf-tbl td.wf-label { border-right-color:#f0f2f5 !important; color:#2d3748 !important; }
body.light-theme .wf-tbl td.wf-label.wf-subtotal { color:#b8860b !important; border-top-color:#e2e8f0 !important; }
body.light-theme .wf-tbl td.wf-label.wf-nav-row { color:#16a34a !important; border-top-color:#bbf7d0 !important; }
body.light-theme .wf-tbl td.wf-val { border-right-color:#f0f2f5 !important; color:#2d3748 !important; }
body.light-theme .wf-tbl td.wf-val.wf-subtotal-val { color:#b8860b !important; border-top-color:#e2e8f0 !important; }
body.light-theme .wf-tbl td.wf-val.wf-nav-val { color:#16a34a !important; border-top-color:#bbf7d0 !important; background:rgba(34,197,94,0.04) !important; }
body.light-theme .wf-tbl td.wf-val.wf-input-val:hover { background:rgba(212,146,10,0.06) !important; }
body.light-theme .wf-tbl tr.wf-section-header td { background:#f7fafc !important; border-top-color:#e2e8f0 !important; color:#a0aec0 !important; }
body.light-theme .wf-tbl tr:hover td { background:rgba(0,0,0,0.015) !important; }
body.light-theme .wf-tbl td.wf-label, body.light-theme .wf-tbl th.wf-label { background:#f7fafc !important; }

/* Fee checker */
body.light-theme .fc-section td { background:#f7fafc !important; color:#a0aec0 !important; border-top-color:#e2e8f0 !important; }

/* Risk bars */
body.light-theme .risk-bar-wrap { background:#edf2f7 !important; }
body.light-theme .risk-name { color:#4a5568 !important; }

/* Live price cards */
body.light-theme .live-price-card { background:#ffffff !important; border-color:#e2e8f0 !important; }
body.light-theme .live-price-card:hover { border-color:#d1d5db !important; }
body.light-theme .lp-sym { color:#4a5568 !important; }
body.light-theme .lp-price { color:#1a202c !important; }
body.light-theme .lp-src { color:#cbd5e0 !important; }

/* Fund financials stats */
body.light-theme .ff-stat { background:#ffffff !important; border-color:#e2e8f0 !important; }
body.light-theme .ff-stat-label { color:#718096 !important; }
body.light-theme .ff-stat-sub { color:#a0aec0 !important; }

/* Detail panel */
body.light-theme .dp-overlay { background:rgba(0,0,0,0.25) !important; }
body.light-theme .dp-side { background:#ffffff !important; border-left-color:#e2e8f0 !important; }
body.light-theme .dp-header { border-bottom-color:#e2e8f0 !important; }
body.light-theme .dp-header .dp-close { color:#a0aec0 !important; }
body.light-theme .dp-header .dp-close:hover { color:#1a202c !important; background:rgba(0,0,0,0.04) !important; }
body.light-theme .dp-title { color:#1a202c !important; }
body.light-theme .dp-subtitle { color:#718096 !important; }
body.light-theme .dp-nav { border-bottom-color:#e2e8f0 !important; }
body.light-theme .dp-nav button { color:#718096 !important; }
body.light-theme .dp-nav button.dp-active { color:#d4920a !important; border-bottom-color:#d4920a !important; }
body.light-theme .dp-nav button:hover { color:#2d3748 !important; }
body.light-theme .dp-summary .dp-field-label { color:#718096 !important; }
body.light-theme .dp-summary .dp-field-value { color:#2d3748 !important; }
body.light-theme .dp-actions { border-top-color:#e2e8f0 !important; }
body.light-theme .dp-history-item { border-bottom-color:#f0f2f5 !important; }
body.light-theme .dp-history-time { color:#718096 !important; }
body.light-theme .dp-history-detail { color:#4a5568 !important; }
body.light-theme .dp-notes textarea { background:#f7fafc !important; border-color:#d1d5db !important; color:#2d3748 !important; }
body.light-theme .dp-related-item { border-bottom-color:#f0f2f5 !important; color:#3182ce !important; }
body.light-theme .dp-related-item:hover { color:#d4920a !important; }

/* Alerts */
body.light-theme .alert-text { color:#2d3748 !important; }

/* Dividers */
body.light-theme .divider { border-top-color:#e2e8f0 !important; }
body.light-theme .note { color:#a0aec0 !important; }

/* Toast — keep as-is (dark toasts on light bg are fine) */

/* Misc overrides for inline-styled elements */
body.light-theme [style*="background:#141928"] { background:#f0f2f5 !important; }
body.light-theme [style*="background:#0a0e1"] { background:#f5f7fa !important; }
body.light-theme [style*="background:#1a1f2e"] { background:#ffffff !important; }
body.light-theme [style*="background:#0f1320"] { background:#ffffff !important; }
body.light-theme [style*="background:#0e1826"] { background:#f7fafc !important; }
body.light-theme [style*="background:#0d1117"] { background:#ffffff !important; }
body.light-theme [style*="background:#0a0e18"] { background:#f7fafc !important; }
body.light-theme [style*="border-color:#1e2538"] { border-color:#e2e8f0 !important; }
body.light-theme [style*="border:1px solid #1e2538"] { border-color:#e2e8f0 !important; }
body.light-theme [style*="border:1px solid #252d3d"] { border-color:#d1d5db !important; }
body.light-theme [style*="border-bottom:1px solid #1e2538"] { border-bottom-color:#e2e8f0 !important; }
body.light-theme [style*="border-top:1px solid #1e2538"] { border-top-color:#e2e8f0 !important; }
body.light-theme [style*="color:#e0e6f0"] { color:#1a202c !important; }
body.light-theme [style*="color:#c8d4e0"] { color:#2d3748 !important; }
body.light-theme [style*="color:#7a8aa0"] { color:#4a5568 !important; }
body.light-theme [style*="color:#5a6a80"] { color:#718096 !important; }
body.light-theme [style*="color:#4a5568"] { color:#a0aec0 !important; }
body.light-theme [style*="color:#3a4a5a"] { color:#cbd5e0 !important; }
body.light-theme [style*="color:#2a3848"] { color:#e2e8f0 !important; }
body.light-theme [style*="color:#2a3448"] { color:#a0aec0 !important; }

/* Sandbox banner */
body.light-theme #sandbox-banner { background:repeating-linear-gradient(-45deg,#fef9e7,#fef9e7 10px,#fdf2d0 10px,#fdf2d0 20px) !important; border-bottom-color:#d4920a !important; }

/* ══════════════════════════════════════════════════════════════════
   PRINT STYLESHEET — M8 Board Pack Support
   Forces light theme, hides chrome, optimises tables for A4/Letter
   ══════════════════════════════════════════════════════════════════ */
@media print {
  /* ── Force light background ── */
  body, body.light-theme { background:#fff !important; color:#000 !important; }

  /* ── Hide navigation chrome ── */
  .sidebar, .topbar, .toast-container, #sandbox-banner,
  .fund-switcher, #active-users,
  .nav-item, .nav-section { display:none !important; }

  /* ── Hide interactive elements ── */
  button, .btn, .btn-primary, .btn-ghost, .btn-danger,
  input, select, textarea, datalist,
  .form-group, .form-actions, .wt-toolbar,
  .wt-actions, .dp-actions { display:none !important; }

  /* ── Restore table cells/rows that may contain buttons ── */
  .tbl td, .tbl th { display:table-cell !important; }
  .tbl tr { display:table-row !important; }
  .tbl thead, .tbl tbody, .tbl tfoot { display:table-row-group !important; }

  /* ── Newsletter body: restore all interactive elements ── */
  #newsletter-body button, #newsletter-body input,
  #newsletter-body select, #newsletter-body [onclick],
  #newsletter-body .form-group { display:revert !important; }

  /* ── Hide overlays, panels, modals ── */
  .dp-overlay, .dp-side, .toast-container { display:none !important; }

  /* ── Layout: full width, no shell grid ── */
  .shell { display:block !important; grid-template-columns:none !important; }
  .main { display:block !important; overflow:visible !important; }
  .content { margin:0 !important; padding:10px !important; max-width:100% !important;
    overflow:visible !important; height:auto !important; }
  .page { padding:0 !important; }
  .page.active { display:block !important; }

  /* ── Print header: show page title and date ── */
  .print-header { display:block !important; }

  /* ── Cards: light borders, no shadows ── */
  .card { border:1px solid #d1d5db !important; box-shadow:none !important;
    background:#fff !important; margin-bottom:12px !important;
    break-inside:avoid; page-break-inside:avoid; }
  .card-header { border-bottom:1px solid #e5e7eb !important; background:#f9fafb !important; }
  .card-title { color:#1a202c !important; font-size:12px !important; }
  .card-badge { display:none !important; }
  .card-icon { display:none !important; }

  /* ── Tables: clean borders, readable text ── */
  .tbl { width:100% !important; border-collapse:collapse !important; font-size:9px !important; }
  .tbl th { background:#f3f4f6 !important; color:#1a202c !important; border:1px solid #d1d5db !important;
    padding:4px 6px !important; font-weight:700 !important; font-size:8px !important;
    text-transform:uppercase !important; letter-spacing:0.3px !important; }
  .tbl td { border:1px solid #e5e7eb !important; padding:3px 6px !important;
    color:#1a202c !important; font-size:9px !important; }
  .tbl tr:nth-child(even) td { background:#f9fafb !important; }
  .tbl .r { text-align:right !important; }

  /* ── KPI tiles ── */
  [style*="display:grid"] { gap:8px !important; }
  .kpi-tile, [class*="kpi"] { border:1px solid #d1d5db !important; background:#f9fafb !important;
    break-inside:avoid; page-break-inside:avoid; }

  /* ── Typography: dark text ── */
  * { color:#1a202c !important; }
  [style*="color:#f0a500"] { color:#b8860b !important; }
  [style*="color:#22c55e"] { color:#15803d !important; }
  [style*="color:#ef4444"] { color:#b91c1c !important; }
  [style*="color:#f59e0b"] { color:#b45309 !important; }
  [style*="color:#7a8aa0"], [style*="color:#5a6a80"], [style*="color:#4a5568"] { color:#4a5568 !important; }
  [style*="color:#e0e6f0"], [style*="color:#c8d4e0"] { color:#1a202c !important; }

  /* ── Backgrounds: white ── */
  [style*="background:#0a0f1a"], [style*="background:#0e1726"],
  [style*="background:#111827"], [style*="background:#131b2e"],
  [style*="background:#1a2332"], [style*="background:#1e2538"],
  [style*="background:rgba"] { background:#fff !important; }

  /* ── Borders: light grey ── */
  [style*="border:1px solid #1e2538"], [style*="border:1px solid #252d3d"],
  [style*="border-bottom:1px solid #1e2538"] { border-color:#d1d5db !important; }

  /* ── Hide action columns in tables ── */
  .tbl th:last-child, .tbl td:last-child { /* keep — may contain data */ }

  /* ── Page breaks ── */
  h1, h2, h3, .card-header { page-break-after:avoid !important; }
  .card { page-break-inside:avoid !important; }
  table { page-break-inside:auto !important; }
  tr { page-break-inside:avoid !important; }

  /* ── Monospace values stay monospace ── */
  [style*="font-family:monospace"] { font-family:monospace !important; }

  /* ── Grid layouts: preserve on print ── */
  .g2 { display:grid !important; grid-template-columns:1fr 1fr !important; gap:8px !important; }
  .g3 { display:grid !important; grid-template-columns:1fr 1fr 1fr !important; gap:8px !important; }
  .g4 { display:grid !important; grid-template-columns:1fr 1fr 1fr 1fr !important; gap:8px !important; }
  .g5 { display:grid !important; grid-template-columns:1fr 1fr 1fr 1fr 1fr !important; gap:8px !important; }

  /* ── KPI boxes: preserve layout ── */
  .kpi { border:1px solid #d1d5db !important; background:#f9fafb !important;
    break-inside:avoid !important; page-break-inside:avoid !important; }
  .kpi-val { color:#1a202c !important; font-size:16px !important; }
  .kpi-label { color:#4a5568 !important; }

  /* ── Status badges: preserve colours for readability ── */
  .sg, .chip-completed, .chip-matched, .chip-settled { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  .sa, .chip-pending, .chip-warning, .chip-grace { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  .sr, .chip-breach, .chip-break { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  .sb, .chip-active, .chip-open { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  .sp { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }

  /* ── Waterfall table: remove sticky positioning ── */
  .wf-tbl td.wf-label, .wf-tbl th.wf-label { position:static !important; }
  .wf-tbl th.wf-month { background:#f3f4f6 !important; color:#1a202c !important;
    border:1px solid #d1d5db !important; }
  .wf-tbl td.wf-val { color:#1a202c !important; border:1px solid #e5e7eb !important; }
  .wf-tbl td.wf-label { color:#1a202c !important; background:#fff !important;
    border:1px solid #e5e7eb !important; }
  .wf-tbl td.wf-label.wf-subtotal { color:#b8860b !important; }
  .wf-tbl td.wf-label.wf-nav-row { color:#15803d !important; }
  .wf-tbl td.wf-val.wf-subtotal-val { color:#b8860b !important; }
  .wf-tbl td.wf-val.wf-nav-val { color:#15803d !important; }
  .wf-tbl tr.wf-section-header td { background:#f3f4f6 !important; color:#4a5568 !important; }

  /* ── WorkTable: clean print output ── */
  .wt-footer-bar { display:none !important; }

  /* ── Risk bars: preserve background colours ── */
  .risk-bar-wrap, .risk-bar { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }

  /* ── Live price cards ── */
  .live-price-card { border:1px solid #d1d5db !important; background:#fff !important;
    break-inside:avoid !important; }
  .lp-price { color:#1a202c !important; }

  /* ── Fund financial stat boxes ── */
  .ff-stat { border:1px solid #d1d5db !important; background:#f9fafb !important;
    break-inside:avoid !important; }
  .ff-stat-val { color:#1a202c !important; }

  /* ── Print page metadata ── */
  @page {
    size:A4 landscape;
    margin:12mm 10mm;
  }

  @page:first {
    margin-top:15mm;
  }

  /* ── Footer with page numbers ── */
  @page {
    @bottom-center {
      content: "X12 Capital — Confidential";
      font-size:8px;
      color:#718096;
    }
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font-size:8px;
      color:#718096;
    }
  }

  /* ── Ensure tabs content visible (for Fund Financials sub-tabs) ── */
  .ff-section { display:block !important; }

  /* ── Hide tab buttons but show tab content ── */
  [id^="ff-tab-"], [id^="sd-tab-"] { display:none !important; }

  /* ── Scrollable containers: show all content ── */
  [style*="overflow:auto"], [style*="overflow-x:auto"], [style*="overflow:scroll"],
  [style*="max-height"] { overflow:visible !important; max-height:none !important; }
}

/* ── Print-only header (hidden on screen) ── */
.print-header { display:none; }
@media print {
  .print-header {
    display:block !important;
    text-align:center;
    padding:10px 0 15px;
    border-bottom:2px solid #1a202c;
    margin-bottom:15px;
  }
  .print-header h1 { font-size:16px; color:#1a202c; margin:0 0 4px; }
  .print-header p { font-size:10px; color:#4a5568; margin:0; }
}

/* ── no-print class: use on elements that should never print ── */
@media print { .no-print { display:none !important; } }

/* ── print-only class: use on elements that should only show in print ── */
.print-only { display:none; }
@media print { .print-only { display:block !important; } }

/* ── Newsletter print overrides ── */
@media print {
  /* Override global hide rules inside newsletter-body */
  #newsletter-body {
    display:block !important; visibility:visible !important;
    overflow:visible !important; max-height:none !important;
  }
  #newsletter-body div {
    display:block !important; visibility:visible !important;
    overflow:visible !important; max-height:none !important;
    color:#1a202c !important;
  }
  #newsletter-body span { display:inline !important; color:#1a202c !important; }

  /* Newsletter tables */
  #newsletter-body table { display:table !important; width:100% !important;
    border-collapse:collapse !important; font-size:9px !important; page-break-inside:auto !important; }
  #newsletter-body table thead { display:table-header-group !important; }
  #newsletter-body table tbody { display:table-row-group !important; }
  #newsletter-body table tr { display:table-row !important; page-break-inside:avoid !important; }
  #newsletter-body table th,
  #newsletter-body table td { display:table-cell !important; }
  #newsletter-body table th {
    background:#f3f4f6 !important; color:#1a202c !important;
    border:1px solid #d1d5db !important; padding:4px 6px !important;
    font-weight:700 !important; font-size:8px !important;
  }
  #newsletter-body table td {
    border:1px solid #e5e7eb !important; padding:3px 6px !important;
    color:#1a202c !important; font-size:9px !important;
  }

  /* Newsletter KPI strip */
  #newsletter-body > div[style*="grid-template-columns"] {
    display:grid !important;
    grid-template-columns:repeat(4,1fr) !important;
  }
  #newsletter-body > div[style*="grid-template-columns"] > div {
    display:block !important;
    border:1px solid #d1d5db !important;
    background:#f9fafb !important;
  }

  /* Newsletter section titles */
  #newsletter-body div[style*="font-size:13px"][style*="font-weight:700"] {
    display:block !important; color:#1a202c !important;
    font-weight:700 !important; border-bottom:1px solid #d1d5db !important;
  }

  /* Newsletter allocation bars */
  #newsletter-body div[style*="height:14px"] {
    display:block !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }

  /* Risk stats grid */
  #nl-risk-stats > div[style*="grid-template-columns"] {
    display:grid !important; grid-template-columns:1fr 1fr !important;
  }

  /* Contenteditable fields */
  #nl-commentary, #nl-disclaimer {
    display:block !important; visibility:visible !important; color:#1a202c !important;
  }

  /* White background on bordered containers */
  #newsletter-body div[style*="border:1px solid"],
  #newsletter-body div[style*="border-radius"] {
    background:#fff !important;
  }

  /* Page: portrait for newsletter */
  #page-newsletter { page:newsletter; }
  @page newsletter { size:A4 portrait; margin:15mm 12mm; }
}

/* ── Portfolio Dashboard (Bloomberg-style) ── */
#page-portfolio { background: #1a1a2e; padding: 12px; min-height: 100vh; }

.pf-header {
  display: flex; align-items: center; gap: 16px; padding: 8px 12px;
  background: #16213e; border: 1px solid #0f3460; border-radius: 4px; margin-bottom: 10px;
}
.pf-fund-select {
  background: #0f3460; color: #e0e0e0; border: 1px solid #1a3a6e; padding: 6px 10px;
  border-radius: 4px; font-size: 12px; font-weight: 600;
}
.pf-header-metrics {
  display: grid; grid-template-columns: repeat(6, auto); gap: 0; margin-left: auto;
}
.pf-metric {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px; border-left: 1px solid #0f3460; min-width: 90px;
}
.pf-metric:first-child { border-left: none; }
.pf-metric-label { font-size: 9px; color: #636e72; text-transform: uppercase; letter-spacing: 0.5px; }
.pf-metric-val { font-size: 14px; color: #e0e0e0; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-weight: 600; white-space: nowrap; }

.pf-panel {
  background: #16213e; border: 1px solid #0f3460; border-radius: 4px; padding: 10px;
}
.pf-panel-full { margin-bottom: 10px; }
.pf-panel-title {
  font-size: 10px; color: #636e72; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #0f3460;
}

.pf-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 1400px) { .pf-grid { grid-template-columns: 1fr 1fr; } }

.pf-tbl { width: 100%; border-collapse: collapse; font-size: 11px; font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.pf-tbl th {
  background: #0f3460; color: #636e72; font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 6px 8px; text-align: right; cursor: pointer;
  border-bottom: 1px solid #1a3a6e; position: sticky; top: 0; user-select: none;
}
.pf-tbl th:first-child, .pf-tbl td:first-child { text-align: left; }
.pf-tbl td { padding: 5px 8px; text-align: right; color: #e0e0e0; border-bottom: 1px solid #0a1628; white-space: nowrap; }
.pf-tbl tr:hover { background: rgba(15,52,96,0.4); }
.pf-tbl .pf-total { background: #0f3460; font-weight: 700; border-top: 2px solid #1a3a6e; }

.pf-pos { color: #00b894; }
.pf-neg { color: #d63031; }
.pf-zero { color: #636e72; }

.pf-sleeve-tag { font-size: 9px; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.pf-sleeve-a { background: rgba(99,179,237,0.15); color: #63b3ed; }
.pf-sleeve-b { background: rgba(72,187,120,0.15); color: #48bb78; }
.pf-sleeve-c { background: rgba(237,137,54,0.15); color: #ed8936; }
.pf-sleeve-u { background: rgba(160,174,192,0.15); color: #a0aec0; }

.pf-rag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.pf-rag-green { background: #00b894; }
.pf-rag-amber { background: #fdcb6e; }
.pf-rag-red { background: #d63031; }
.pf-rag-grey { background: #636e72; }

.pf-rag-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.pf-rag-tbl td { padding: 3px 6px; color: #a0a0a0; border-bottom: 1px solid #0a1628; }
.pf-rag-tbl .pf-rag-breach { color: #d63031; font-weight: 700; }

.pf-stress-tbl { width: 100%; border-collapse: collapse; font-size: 10px; }
.pf-stress-tbl th { background: #0f3460; color: #636e72; font-size: 9px; padding: 4px 6px; text-align: left; }
.pf-stress-tbl td { padding: 4px 6px; color: #a0a0a0; border-bottom: 1px solid #0a1628; }
.pf-sev-low { color: #00b894; }
.pf-sev-medium { color: #fdcb6e; }
.pf-sev-high { color: #ed8936; }
.pf-sev-extreme { color: #d63031; font-weight: 700; }

.pf-credit-tbl { width: 100%; border-collapse: collapse; font-size: 10px; }
.pf-credit-tbl th { background: #0f3460; color: #636e72; font-size: 9px; padding: 4px 6px; text-align: left; }
.pf-credit-tbl td { padding: 4px 6px; color: #a0a0a0; border-bottom: 1px solid #0a1628; }
.pf-fail { color: #d63031; font-weight: 700; }

.pf-ops-row { display: flex; align-items: center; padding: 4px 0; border-bottom: 1px solid #0a1628; font-size: 11px; }
.pf-ops-name { flex: 1; color: #a0a0a0; }
.pf-ops-val { color: #e0e0e0; font-family: 'JetBrains Mono', monospace; font-weight: 600; margin-right: 8px; }
.pf-ops-limit { color: #636e72; font-size: 10px; }

/* BTC chart period buttons */
.pf-period-btn {
  background: #0a1628; color: #636e72; border: 1px solid #0f3460; padding: 2px 8px;
  font-size: 9px; cursor: pointer; border-radius: 3px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.pf-period-btn:hover { color: #e0e0e0; border-color: #1a3a6e; }
.pf-period-active { background: #0f3460; color: #63b3ed; border-color: #63b3ed; }

/* News items */
.pf-news-item {
  padding: 6px 0; border-bottom: 1px solid #0a1628; font-size: 11px;
}
.pf-news-item a { color: #63b3ed; text-decoration: none; }
.pf-news-item a:hover { text-decoration: underline; }
.pf-news-time { color: #636e72; font-size: 9px; }
.pf-asset-active { background: #0f3460; color: #f59e0b; border-color: #f59e0b; }

/* ═══════════════════════════════════════════════════════
   SCENARIO BUILDER — Bloomberg Terminal × Chat UI
   ═══════════════════════════════════════════════════════ */

#page-simulator {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  padding: 0;
  background: #060b14;
}

.sim-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: #080e1c;
  border-bottom: 1px solid #182038;
  flex-shrink: 0;
  gap: 0;
}
.sim-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #c8d8ec;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.sim-fund-badge {
  background: #0e2a50;
  color: #63b3ed;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  margin-left: 10px;
  letter-spacing: 2px;
  border: 1px solid #1a3a6a;
}
.sim-nav-display {
  margin-left: auto;
  display: flex;
  gap: 24px;
  align-items: center;
}
.sim-nav-item { text-align: right; }
.sim-nav-label {
  font-size: 8px;
  color: #3a5070;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'JetBrains Mono', monospace;
}
.sim-nav-value {
  font-size: 13px;
  color: #e8c84a;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Quick pills */
.sim-pills {
  display: flex;
  gap: 6px;
  padding: 8px 20px;
  background: #060a14;
  border-bottom: 1px solid #0f1828;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
}
.sim-pill-label {
  font-size: 8px;
  color: #2a3c58;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 4px;
  white-space: nowrap;
}
.sim-quick-btn {
  background: #090e1c;
  color: #6a8aaa;
  border: 1px solid #182840;
  padding: 4px 11px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  letter-spacing: 0.2px;
}
.sim-quick-btn:hover { background: #0f1e38; color: #63b3ed; border-color: #2a4870; }
.sim-pill-shock { color: #f28b8b; border-color: #3a1522; background: #0d080f; }
.sim-pill-shock:hover { background: #1c0a10; color: #fca5a5; border-color: #6b2030; }
.sim-pill-up    { color: #6ee7a0; border-color: #183824; background: #07100a; }
.sim-pill-up:hover    { background: #0c1c10; color: #a7f3c8; border-color: #286040; }

/* Chat history */
.sim-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #060b14;
}
.sim-chat-history::-webkit-scrollbar { width: 3px; }
.sim-chat-history::-webkit-scrollbar-track { background: transparent; }
.sim-chat-history::-webkit-scrollbar-thumb { background: #182038; border-radius: 2px; }

/* Messages */
.sim-msg { display: flex; animation: sim-msg-in 0.18s ease-out; }
@keyframes sim-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sim-msg-user { justify-content: flex-end; }
.sim-msg-bot  { justify-content: flex-start; }
.sim-msg-inner { max-width: 84%; }

.sim-bubble-user {
  background: #14305e;
  color: #d8e8f8;
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px 6px 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid #1e4080;
}
.sim-bubble-bot {
  background: #0a1422;
  color: #b8cce0;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.65;
  border-radius: 6px 6px 6px 2px;
  border: 1px solid #182840;
  border-left: 3px solid #2060a0;
}
.sim-narrative {
  font-size: 12px;
  color: #a8c0da;
  line-height: 1.65;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Thinking dots */
.sim-msg-thinking .sim-bubble-bot { padding: 12px 18px; }
.sim-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #2a5080;
  border-radius: 50%;
  margin: 0 2px;
  animation: sim-pulse 1.3s infinite ease-in-out;
}
.sim-dot:nth-child(2) { animation-delay: 0.22s; }
.sim-dot:nth-child(3) { animation-delay: 0.44s; }
@keyframes sim-pulse {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40%           { transform: scale(1);    opacity: 1; }
}

/* Before/After table */
.sim-before-after-tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  margin-top: 10px;
  border-top: 1px solid #182840;
  padding-top: 6px;
}
.sim-before-after-tbl thead tr { border-bottom: 1px solid #182840; }
.sim-before-after-tbl th {
  color: #2a5070;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 5px 8px;
  text-align: right;
  font-weight: 700;
}
.sim-before-after-tbl th:first-child { text-align: left; }
.sim-before-after-tbl td {
  padding: 4px 8px;
  text-align: right;
  color: #6a8aaa;
  border-bottom: 1px solid #0c1828;
}
.sim-before-after-tbl td:first-child { text-align: left; }
.sim-metric-name {
  color: #4a6a88;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.sim-delta-pos { color: #68d391; font-weight: 700; }
.sim-delta-neg { color: #fc8181; font-weight: 700; }
.sim-breach-row td { border-bottom: none; padding-top: 6px; }
.sim-breach-yes { color: #fc8181; font-weight: 700; }
.sim-breach-no  { color: #68d391; }

/* Status bar */
.sim-status-bar {
  display: flex;
  align-items: center;
  padding: 3px 20px;
  background: #040810;
  border-top: 1px solid #0c1420;
  gap: 16px;
  flex-shrink: 0;
}
.sim-status-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: #253848;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sim-status-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #253848;
  margin-right: 4px;
  vertical-align: middle;
}
.sim-status-dot.online { background: #38a169; }
#sim-status-msg { color: #3a5878; margin-left: auto; }

/* Input bar */
.sim-input-bar {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background: #060b18;
  border-top: 1px solid #101c30;
  gap: 8px;
  flex-shrink: 0;
}
.sim-input {
  flex: 1;
  background: #090e1e;
  border: 1px solid #182840;
  color: #c8daf0;
  padding: 9px 14px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.sim-input:focus { border-color: #2a5888; background: #0b1428; }
.sim-input::placeholder { color: #1e3050; }
.sim-send-btn {
  background: #122850;
  color: #63b3ed;
  border: 1px solid #1e4070;
  padding: 9px 18px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.sim-send-btn:hover { background: #1a3870; color: #90c8f8; border-color: #2a5898; }
.sim-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   M27 — ASCENT NAV PACK RECONCILIATION  (17-navrecon.js)
   ══════════════════════════════════════════════════════════ */

/* Dropzone */
.nr-dropzone {
  border: 2px dashed #2a3a5a;
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #0d1520;
  margin: 4px 0;
}
.nr-dropzone:hover, .nr-dropzone.nr-dz-hover {
  border-color: #3b82f6;
  background: #0f1e30;
}
.nr-dz-icon { font-size: 28px; margin-bottom: 8px; }
.nr-dz-label { font-size: 13px; font-weight: 600; color: #c0cce0; margin-bottom: 4px; }
.nr-dz-sub   { font-size: 11px; color: #556070; }

/* Status bar */
.nr-parse-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 4px; }
.nr-status-ready   { background: #1a2840; color: #7a9cc0; }
.nr-status-loading { background: #1a2840; color: #f0a500; }
.nr-status-pass    { background: #0d2a1a; color: #4ade80; }
.nr-status-amber   { background: #2a1e08; color: #f59e0b; }
.nr-status-fail    { background: #2a0e0e; color: #f87171; }
.nr-status-error   { background: #2a0e0e; color: #f87171; }

/* KPI overrides for recon status */
.nr-kpi-green { color: #4ade80 !important; }
.nr-kpi-amber { color: #f59e0b !important; }
.nr-kpi-red   { color: #f87171 !important; }

/* Recon table */
.nr-recon-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.nr-recon-tbl th {
  background: #0f1a2e;
  color: #7a9cc0;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-bottom: 1px solid #1e2e48;
  text-align: right;
}
.nr-recon-tbl th:first-child { text-align: left; }
.nr-recon-tbl td {
  padding: 6px 10px;
  border-bottom: 1px solid #141e30;
  color: #c0cce0;
}
.nr-recon-tbl tr:hover td { background: #0f1a2e; }
.nr-row-green td { border-left: 2px solid #22c55e; }
.nr-row-amber td { border-left: 2px solid #f59e0b; }
.nr-row-red   td { border-left: 2px solid #ef4444; }
.nr-line-label { font-weight: 600; text-align: left !important; color: #dde6f0; }
.nr-num  { text-align: right; font-variant-numeric: tabular-nums; }
.nr-ticker { font-family: monospace; font-size: 11px; color: #7a9cc0; text-align: center; }
.nr-delta-pos { color: #4ade80; }
.nr-delta-neg { color: #f87171; }
.nr-total-row td { border-top: 1px solid #2a3a5a; background: #0d1520; }

/* Status badges */
.nr-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.nr-badge-green { background: #0d2a1a; color: #4ade80; }
.nr-badge-amber { background: #2a1e08; color: #f59e0b; }
.nr-badge-red   { background: #2a0e0e; color: #f87171; }

/* Pack summary pre-recon */
.nr-pack-summary {
  background: #0d1520;
  border: 1px solid #1e2e48;
  border-radius: 6px;
  padding: 16px 20px;
}
.nr-pack-title { font-size: 13px; font-weight: 700; color: #60a5fa; margin-bottom: 12px; }
.nr-pack-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.nr-pack-line  { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #141e30; }
.nr-pack-lbl   { color: #7a9cc0; }
.nr-pack-val   { color: #dde6f0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Section header */
.nr-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #7a9cc0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 0 6px 2px;
}

/* Pack metadata row */
.nr-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #556070;
  padding: 8px 2px 4px;
  border-top: 1px solid #141e30;
  margin-top: 4px;
}
.nr-meta strong { color: #8a9ab0; }

/* Error display */
.nr-error {
  background: #2a0e0e;
  border: 1px solid #4a1a1a;
  color: #f87171;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 12px;
}

/* Sign-off button disabled state */
#nr-signoff-btn:disabled {
  opacity: 0.5;
  cursor: default;
  background: #1a2840;
  color: #4ade80;
  border-color: #22c55e;
}
