/* =====================================================================
   Prototype application stylesheet
   Flat, structure-first styling per the SBA design-system reference:
   borders over shadows, navy for authority, gold for structure only.
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg-page); color: var(--text-body);
  font-family: var(--font-family); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; }
:where(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
[data-theme="dark"] :where(a, button, input, select, [tabindex]):focus-visible { outline-color: #9cc3e8; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.strong { color: var(--text-strong); font-weight: 700; }
.pos { color: var(--positive-text); } .neg { color: var(--negative-text); } .cau { color: var(--caution-text); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 160ms ease; }
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  color: var(--chrome-text); overflow: hidden; z-index: 30;
}
.sidebar-col { background: var(--chrome-bg); border-right: 1px solid var(--chrome-line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 11px; height: 68px; padding: 0 18px; border-bottom: 1px solid var(--chrome-line); flex: none; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-text { min-width: 0; }
.brand-name { font-size: 20px; font-weight: 700; color: var(--chrome-text-strong); letter-spacing: -0.6px; line-height: 1; white-space: nowrap; }
.brand-name b { font-weight: 700; color: var(--brand-gold); }
.brand-sub { margin-top: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: 1.6px; color: var(--chrome-muted); text-transform: uppercase; white-space: nowrap; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-label { padding: 6px 10px 6px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--chrome-accent); white-space: nowrap; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  height: 36px; padding: 0 10px; margin: 1px 0; border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--chrome-text); font-size: 13px; font-weight: 400; text-align: left; cursor: pointer; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--chrome-text-strong); text-decoration: none; }
.nav-item.active { background: var(--chrome-bg-raised); color: var(--chrome-text-strong); font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--chrome-accent); }
.nav-item .ico { opacity: .85; }
.nav-item.active .ico { opacity: 1; color: var(--chrome-accent); }
.nav-item .nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-count { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill); background: rgba(255,255,255,.1); color: var(--chrome-text-strong); }
.nav-item .chev { transition: transform 140ms ease; opacity: .6; }
.nav-item.open .chev { transform: rotate(90deg); }
.nav-sub { display: none; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--chrome-line); }
.nav-sub.open { display: block; }
.nav-sub .nav-item { height: 30px; font-size: 12.5px; padding: 0 10px; }
.nav-sub .nav-item.active::before { left: -13px; top: 6px; bottom: 6px; }
.sidebar-foot { flex: none; border-top: 1px solid var(--chrome-line); padding: 10px; display: flex; align-items: center; gap: 8px; }
.env-tag { flex: 1; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--chrome-muted); white-space: nowrap; overflow: hidden; padding-left: 8px; }
.icon-btn-chrome { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--chrome-line); border-radius: var(--radius-control); background: transparent; color: var(--chrome-text); cursor: pointer; flex: none; }
.icon-btn-chrome:hover { background: rgba(255,255,255,.06); color: #fff; }

.app.collapsed .brand { padding: 0 18px; }
.app.collapsed .brand-text, .app.collapsed .nav-label, .app.collapsed .nav-text, .app.collapsed .nav-count,
.app.collapsed .chev, .app.collapsed .nav-sub, .app.collapsed .env-tag { display: none !important; }
.app.collapsed .nav-item { justify-content: center; padding: 0; }
.app.collapsed .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--chrome-line); }
.app.collapsed .nav-group:first-child { border-top: 0; padding-top: 0; }
.app.collapsed .sidebar-foot { justify-content: center; }
.app.collapsed .collapse-btn .ico { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: var(--nav-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; min-width: 0; }
.crumbs b { color: var(--text-strong); font-weight: 700; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 36px; padding: 0 64px 0 36px; border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--bg-card); color: var(--text-body); font: inherit; font-size: 13px;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--brand-navy); }
[data-theme="dark"] .search input:focus { border-color: #9cc3e8; }
.search > .ico { position: absolute; left: 11px; top: 9px; color: var(--text-muted); }
.kbd { position: absolute; right: 8px; top: 8px; font-size: 10.5px; font-weight: 700; color: var(--text-muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; background: var(--bg-page); }
.search-results { position: absolute; left: 0; right: 0; top: 42px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--overlay-shadow); max-height: 420px; overflow: auto; display: none; z-index: 40; }
.search-results.open { display: block; }
.sr-group { padding: 8px 14px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; color: var(--text-body); }
.sr-item:hover, .sr-item.hl { background: var(--bg-panel); }
.sr-item .sr-meta { margin-left: auto; font-size: 11.5px; color: var(--text-muted); }
.sr-empty { padding: 16px 14px; color: var(--text-muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sample-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--caution-border); background: var(--caution-fill); color: var(--caution-text); font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.sample-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--caution-accent); }
.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-card); color: var(--text-strong); cursor: pointer; transition: border-color 120ms ease; }
.icon-btn:hover { border-color: var(--brand-navy); }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--negative-accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg-page); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-navy); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: .5px; border: 2px solid var(--brand-gold); cursor: pointer; }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 700; background: var(--bg-panel); color: var(--info-text); border: 1px solid var(--info-border); flex: none; }

.popover { position: absolute; top: 48px; right: 0; width: 380px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--overlay-shadow); display: none; z-index: 45; overflow: hidden; }
.popover.open { display: block; }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop-head h3 { font-size: 14px; color: var(--text-strong); }
.pop-list { max-height: 420px; overflow: auto; }
.pop-group { padding: 10px 16px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.notif { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.notif.unread { background: color-mix(in srgb, var(--bg-panel) 55%, transparent); }
.notif .n-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-panel); color: var(--info-text); }
.notif .n-ico.alert { background: var(--caution-fill); color: var(--caution-text); }
.notif .n-title { font-weight: 700; color: var(--text-strong); font-size: 12.5px; }
.notif .n-body { color: var(--text-body); font-size: 12.5px; }
.notif .n-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-navy); display: inline-block; margin-left: 6px; }
[data-theme="dark"] .unread-dot { background: #9cc3e8; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text-body); cursor: pointer; border: 0; background: none; width: 100%; font-size: 13px; text-align: left; }
.menu-item:hover { background: var(--bg-panel); }

.content { padding: 28px 32px 64px; max-width: 1600px; width: 100%; margin: 0 auto; }

/* ------------------------------------------------------------------ page header */
.page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 72px; height: 3px; background: var(--brand-gold); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.page-title { margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.4px; color: var(--text-strong); line-height: 1.15; }
.page-meta { margin-top: 6px; font-size: 13px; color: var(--text-muted); max-width: 760px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }

/* ------------------------------------------------------------------ primitives */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; font-size: 13px; font-weight: 700; border-radius: var(--radius-control); border: 1px solid; cursor: pointer; white-space: nowrap; transition: background 120ms ease, border-color 120ms ease; }
.btn-primary { color: #fff; background: var(--brand-navy); border-color: var(--brand-navy); }
.btn-primary:hover { background: var(--button-primary-hover); border-color: var(--button-primary-hover); }
.btn-secondary { color: var(--text-strong); background: var(--bg-card); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand-navy); }
[data-theme="dark"] .btn-secondary:hover { border-color: #9cc3e8; }
.btn-accent { color: var(--caution-text); background: var(--bg-card); border-color: var(--brand-gold); }
.btn-accent:hover { background: var(--caution-fill); }
.btn-ghost { color: var(--text-strong); background: transparent; border-color: transparent; padding: 0 8px; }
.btn-ghost:hover { background: var(--bg-panel); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
[data-theme="dark"] .btn-primary { background: #2f6fae; border-color: #2f6fae; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-card); padding: 2px; gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--text-strong); }
.seg button.on { background: var(--brand-navy); color: #fff; }
[data-theme="dark"] .seg button.on { background: #2f6fae; }
.seg .seg-count { font-size: 10.5px; padding: 0 6px; border-radius: 8px; background: rgba(127,127,127,.18); }

.select, .input { height: 34px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-card); color: var(--text-body); font: inherit; font-size: 12.5px; padding: 0 10px; }
.select { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.select:hover, .input:hover { border-color: var(--brand-navy); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 10px; top: 9px; color: var(--text-muted); }
.input-icon .input { padding-left: 32px; width: 240px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 2px 9px; line-height: 16px; border-radius: var(--radius-pill); border: 1px solid; white-space: nowrap; }
.b-pos { color: var(--positive-text); background: var(--positive-fill); border-color: var(--positive-border); }
.b-cau { color: var(--caution-text); background: var(--caution-fill); border-color: var(--caution-border); }
.b-neg { color: var(--negative-text); background: var(--negative-fill); border-color: var(--negative-border); }
.b-info { color: var(--info-text); background: var(--bg-panel); border-color: var(--info-border); }
.b-mute { color: var(--text-muted); background: var(--bg-page); border-color: var(--line); }
.tag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; padding: 1px 6px; border-radius: 3px; background: var(--bg-page); color: var(--text-muted); border: 1px solid var(--line); white-space: nowrap; }
.type-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--info-text); border: 1px solid var(--info-border); font-size: 12px; font-weight: 700; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.chip button:hover { background: rgba(0,58,112,.1); }

/* ------------------------------------------------------------------ cards & grids */
.grid { display: grid; gap: 16px; margin-top: 20px; }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: flex-start; gap: 8px 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-head > div:first-child { flex: 1 1 180px; min-width: 0; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-strong); }
.card-sub { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.card-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 20px 18px; flex: 1; min-width: 0; }
.card-body.flush { padding: 12px 0 0; }
.card-foot { padding: 10px 20px; border-top: 1px solid var(--line-soft); font-size: 11px; font-style: italic; color: var(--text-muted); display: flex; gap: 12px; }
.card-foot a { font-style: normal; font-weight: 700; margin-left: auto; }
.gics-disclosure { display: block; width: 100%; min-width: 0; overflow-wrap: anywhere; }
.gics-disclosure details { margin-top: 8px; }
.gics-disclosure a { margin-left: 0; }
.chart { width: 100%; height: 280px; }
.chart.h-200 { height: 200px; } .chart.h-240 { height: 240px; } .chart.h-320 { height: 320px; } .chart.h-360 { height: 360px; } .chart.h-400 { height: 400px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { position: relative; background: var(--bg-card); border: 1px solid var(--line); border-top: 3px solid var(--brand-navy); border-radius: var(--radius-control); padding: 14px 16px 14px; min-width: 0; overflow: hidden; }
[data-theme="dark"] .kpi { border-top-color: #6fa8dc; }
.kpi.gold { border-top-color: var(--brand-gold); }
.kpi-label { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { margin-top: 8px; font-size: 26px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.5px; line-height: 1.1; white-space: nowrap; }
.kpi-value small { font-size: 14px; font-weight: 700; color: var(--text-muted); letter-spacing: 0; margin-left: 2px; }
.kpi-delta { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-delta .pos, .kpi-delta .neg { font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.kpi-spark { display: block; width: 100%; height: 26px; margin-top: 10px; }

/* Callout / alert strip */
.callout { margin-top: 20px; background: var(--bg-panel); border-left: 5px solid var(--brand-gold); border-radius: 0 var(--radius-card) var(--radius-card) 0; padding: 12px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.callout-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-style: italic; color: var(--text-muted); white-space: nowrap; }
.callout-item { display: inline-flex; align-items: center; gap: 7px; color: var(--text-body); font-size: 12.5px; }
.callout-item b { color: var(--text-strong); }
.callout-sep { width: 1px; height: 18px; background: var(--line); }

/* Tables (dense application variant) */
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-page); color: var(--text-muted); text-align: left; padding: 9px 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--text-strong); }
.table thead th .sort-ind { opacity: .7; margin-left: 3px; }
.table th.r, .table td.r { text-align: right; }
.table th.c, .table td.c { text-align: center; }
.table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); color: var(--text-body); white-space: nowrap; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--bg-panel); }
.table td.v { font-weight: 700; color: var(--text-strong); text-align: right; }
.table td:first-child, .table th:first-child { padding-left: 20px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }
.cell-title { font-weight: 700; color: var(--text-strong); }
.cell-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-track { width: 70px; height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--chart-1); border-radius: 3px; }
.table-foot { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-muted); }
.pager { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pager button { min-width: 28px; height: 28px; border: 1px solid var(--line); background: var(--bg-card); color: var(--text-strong); border-radius: var(--radius-control); cursor: pointer; font-weight: 700; font-size: 12px; }
.pager button.on { background: var(--brand-navy); color: #fff; border-color: var(--brand-navy); }
.pager button:disabled { opacity: .4; cursor: default; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.list li:first-child { border-top: 0; padding-top: 2px; }
.date-block { width: 44px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-control); overflow: hidden; }
.date-block .m { background: var(--brand-navy); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 2px 0; }
[data-theme="dark"] .date-block .m { background: #2f6fae; }
.date-block .d { font-size: 16px; font-weight: 700; color: var(--text-strong); padding: 3px 0 2px; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 700; color: var(--text-strong); font-size: 12.5px; line-height: 1.4; }
.li-sub { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.act-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--bg-panel); color: var(--info-text); border: 1px solid var(--info-border); }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-body); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.legend-table td { padding: 5px 0; border-top: 1px solid var(--line-soft); }
.legend-table tr:first-child td { border-top: 0; }
.legend-table td.r { text-align: right; font-weight: 700; color: var(--text-strong); }
.legend-table td.m { text-align: right; color: var(--text-muted); width: 64px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-top: 20px; overflow-x: auto; }
.tab { height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; position: relative; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text-strong); }
.tab.on { color: var(--text-strong); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--brand-gold); border-radius: 2px 2px 0 0; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.toolbar .spacer { flex: 1; }
.chips-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; min-height: 26px; font-size: 12px; color: var(--text-muted); }

/* Empty state */
.empty { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty .ico { color: var(--text-muted); opacity: .6; }
.empty h4 { margin-top: 10px; font-size: 15px; color: var(--text-strong); }
.empty p { margin: 6px auto 14px; max-width: 360px; }

/* ------------------------------------------------------------------ properties */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.prop-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; cursor: pointer; transition: border-color 120ms ease; display: flex; flex-direction: column; }
.prop-card:hover { border-color: var(--brand-navy); }
[data-theme="dark"] .prop-card:hover { border-color: #9cc3e8; }
.prop-hero { height: 96px; position: relative; display: flex; align-items: flex-end; padding: 10px 14px; color: #fff; overflow: hidden; }
.prop-hero svg.skyline { position: absolute; inset: 0; width: 100%; height: 100%; }
.prop-hero .ph-type { position: relative; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; background: rgba(0,0,0,.25); padding: 3px 8px; border-radius: 3px; }
.prop-hero .ph-badge { position: absolute; top: 10px; right: 10px; }
.prop-body { padding: 12px 14px 14px; }
.prop-name { font-size: 14px; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-loc { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.prop-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.prop-stats div { min-width: 0; }
.ps-l { font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.ps-v { font-size: 14px; font-weight: 700; color: var(--text-strong); margin-top: 2px; }
.occ-bar { height: 4px; border-radius: 2px; background: var(--line-soft); margin-top: 10px; overflow: hidden; }
.occ-bar i { display: block; height: 100%; background: var(--chart-3); }

/* ------------------------------------------------------------------ drawer & modal */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 60; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 92vw); background: var(--bg-page); z-index: 61; box-shadow: var(--overlay-shadow); transform: translateX(105%); transition: transform 200ms ease; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { background: var(--brand-navy); color: #fff; padding: 18px 24px 16px; border-bottom: 4px solid var(--brand-gold); flex: none; }
[data-theme="dark"] .drawer-head { background: #0d2a45; }
.drawer-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-gold); }
.drawer-title { margin-top: 6px; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.drawer-meta { margin-top: 6px; font-size: 12.5px; color: var(--masthead-meta); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.drawer-close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border-radius: var(--radius-control); border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.drawer-close:hover { background: rgba(255,255,255,.1); }
.drawer-body { flex: 1; overflow: auto; padding: 4px 24px 32px; }
.drawer .tabs { margin-top: 0; position: sticky; top: 0; background: var(--bg-page); z-index: 2; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); margin-top: 16px; }
.metric-strip.m3 { grid-template-columns: repeat(3, 1fr); }
.metric-cell { padding: 12px 14px; border-right: 1px solid var(--line); min-width: 0; }
.metric-cell:last-child { border-right: 0; }
.metric-label { font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.metric-value { margin-top: 4px; font-size: 18px; font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.metric-note { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-top: 12px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.kv dt, .kv .k { color: var(--text-muted); }
.kv .vv { color: var(--text-strong); font-weight: 700; text-align: right; }
.section-label { margin: 22px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98); width: min(560px, 92vw); max-height: 88vh; background: var(--bg-card); border-radius: var(--radius-card); box-shadow: var(--overlay-shadow); z-index: 62; opacity: 0; pointer-events: none; transition: all 160ms ease; display: flex; flex-direction: column; overflow: hidden; }
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal.wide { width: min(1000px, 94vw); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 16px; color: var(--text-strong); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-page); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
.field .select, .field .input { width: 100%; }
.field textarea { min-height: 70px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-card); color: var(--text-body); font: inherit; padding: 8px 10px; }

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 300px; max-width: 420px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--line); border-left: 4px solid var(--positive-accent); border-radius: var(--radius-card); box-shadow: var(--overlay-shadow); animation: toastIn 180ms ease; }
.toast.info { border-left-color: var(--brand-navy); }
.toast .t-title { font-weight: 700; color: var(--text-strong); }
.toast .t-body { color: var(--text-body); font-size: 12.5px; margin-top: 2px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ pipeline */
.pipe-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); margin-top: 16px; }
.board-wrap { margin-top: 14px; overflow-x: auto; padding-bottom: 8px; }
.board { display: grid; grid-template-columns: repeat(7, minmax(232px, 1fr)); gap: 12px; min-width: 1680px; }
.col { background: color-mix(in srgb, var(--bg-panel) 45%, var(--bg-page)); border: 1px solid var(--line); border-radius: var(--radius-card); display: flex; flex-direction: column; min-height: 520px; }
.col.drop { border-color: var(--brand-navy); background: var(--bg-panel); }
.col-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); position: relative; }
.col-head::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--stage-color, var(--brand-navy)); }
.col-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-strong); font-size: 13px; }
.col-title .count { margin-left: auto; font-size: 11px; padding: 0 7px; line-height: 18px; border-radius: 9px; background: var(--bg-card); border: 1px solid var(--line); color: var(--text-muted); }
.col-sub { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.col-sub b { color: var(--text-strong); }
.col-efront { margin-top: 6px; font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.deal { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 10px 12px; cursor: grab; transition: border-color 120ms ease; position: relative; }
.deal:hover { border-color: var(--brand-navy); }
[data-theme="dark"] .deal:hover { border-color: #9cc3e8; }
.deal.dragging { opacity: .45; }
.deal.hold { background: repeating-linear-gradient(-45deg, var(--bg-card), var(--bg-card) 8px, color-mix(in srgb, var(--caution-fill) 70%, var(--bg-card)) 8px, color-mix(in srgb, var(--caution-fill) 70%, var(--bg-card)) 16px); }
.deal-top { display: flex; align-items: center; gap: 6px; }
.deal-name { font-weight: 700; color: var(--text-strong); font-size: 12.5px; line-height: 1.35; margin-top: 6px; }
.deal-loc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.deal-price { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.deal-price b { font-size: 15px; color: var(--text-strong); }
.deal-price span { font-size: 11px; color: var(--text-muted); }
.deal-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--text-muted); }
.deal-foot .age { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
.deal-foot .age.late { color: var(--negative-text); font-weight: 700; }
.prio { display: inline-flex; align-items: center; gap: 4px; }
.prio i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.wf-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .8px; padding: 1px 5px; border-radius: 3px; }
.wf-ACQ { background: var(--bg-panel); color: var(--info-text); border: 1px solid var(--info-border); }
.wf-DISPO { background: var(--caution-fill); color: var(--caution-text); border: 1px solid var(--caution-border); }
.stepper { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 16px; }
.step { text-align: center; font-size: 10.5px; color: var(--text-muted); }
.step i { display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.step.done i { background: var(--chart-2); }
.step.cur i { background: var(--brand-gold); }
.step.cur { color: var(--text-strong); font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.check .box { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.check.done .box { background: var(--positive-accent); border-color: var(--positive-accent); color: #fff; }
.check.done .ct { color: var(--text-muted); text-decoration: line-through; }
.check .req { margin-left: auto; }
.timeline { position: relative; margin-top: 8px; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 4px 0 12px; font-size: 12.5px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--chart-2); }
.tl-item.gold::before { border-color: var(--brand-gold); background: var(--brand-gold); }
.tl-when { font-size: 11px; color: var(--text-muted); }

/* ------------------------------------------------------------------ gantt */
.gantt { position: relative; margin-top: 4px; }
.g-row { display: grid; grid-template-columns: 230px 1fr; align-items: center; min-height: 46px; border-top: 1px solid var(--line-soft); }
.g-row.head { min-height: 30px; border-top: 0; }
.g-label { padding: 0 14px 0 20px; min-width: 0; }
.g-track { position: relative; height: 46px; }
.g-row.head .g-track { height: 30px; }
.g-year { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); font-size: 10.5px; font-weight: 700; color: var(--text-muted); padding: 8px 6px; letter-spacing: .5px; }
.g-q { position: absolute; top: 0; height: 100%; border-left: 1px dashed var(--line-soft); }
.g-bar { position: absolute; top: 15px; height: 16px; border-radius: 3px; background: var(--chart-5); }
.g-bar.ph-0 { background: var(--chart-8); } .g-bar.ph-1 { background: var(--chart-5); } .g-bar.ph-2 { background: var(--chart-2); }
.g-bar.ph-3 { background: var(--chart-1); } .g-bar.ph-4 { background: var(--chart-3); opacity: .75; }
.g-ms { position: absolute; top: 17px; width: 12px; height: 12px; transform: translateX(-6px) rotate(45deg); background: var(--bg-card); border: 2px solid var(--brand-gold); z-index: 2; }
.g-ms.done { background: var(--brand-gold); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--negative-accent); z-index: 3; pointer-events: none; }
.g-today span { position: absolute; top: -2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--negative-text); white-space: nowrap; background: var(--bg-card); padding: 0 4px; }

/* ------------------------------------------------------------------ reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.report-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; cursor: pointer; transition: border-color 120ms ease; display: flex; flex-direction: column; }
.report-card:hover { border-color: var(--brand-navy); }
[data-theme="dark"] .report-card:hover { border-color: #9cc3e8; }
.report-thumb { height: 168px; background: var(--bg-page); border-bottom: 1px solid var(--line); padding: 14px 18px 0; position: relative; overflow: hidden; }
.thumb-page { background: var(--bg-card); border: 1px solid var(--line); border-bottom: 0; border-radius: 3px 3px 0 0; height: 100%; overflow: hidden; }
.thumb-mast { height: 22px; background: var(--brand-navy); border-bottom: 3px solid var(--brand-gold); display: flex; align-items: center; padding: 0 8px; gap: 6px; }
.thumb-mast i { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.7); }
.thumb-chart { height: 112px; }
.report-body { padding: 12px 16px 14px; flex: 1; display: flex; flex-direction: column; }
.report-kicker { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--brand-gold-text); }
.report-title { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--text-strong); }
.report-desc { margin-top: 4px; font-size: 12px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.report-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.report-meta .tag { margin-left: 0; }
.report-meta .spacer { flex: 1; }

/* document-style report preview (mirrors the design-system document chrome) */
.doc { background: #fff; color: #26364b; border: 1px solid #d6dee8; }
.doc-mast { background: #003a70; color: #fff; border-bottom: 6px solid #d4a24c; padding: 26px 34px 22px; }
.doc-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: #d4a24c; text-transform: uppercase; }
.doc-title { margin-top: 10px; font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1.05; }
.doc-meta { margin-top: 10px; font-size: 12.5px; color: #afc4de; }
.doc-body { padding: 8px 34px 30px; }
.doc-sec { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid #d6dee8; padding-bottom: 10px; margin-top: 26px; }
.doc-sec-n { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #8a6520; }
.doc-sec-t { font-size: 18px; font-weight: 700; color: #003a70; }
.doc-rule { height: 3px; width: 72px; background: #d4a24c; margin-top: 12px; }
.doc-lead { font-size: 14px; font-weight: 700; line-height: 1.5; max-width: 720px; margin-top: 16px; color: #26364b; }
.doc .kpis .kpi { background: #fff; border-color: #d6dee8; border-top-color: #003a70; }
.doc .kpis .kpi.gold { border-top-color: #d4a24c; }
.doc .kpi-label { color: #5a6b80; } .doc .kpi-value { color: #003a70; } .doc .kpi-delta { color: #5a6b80; }
.doc table.dt { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 16px; border: 1px solid #d6dee8; }
.doc table.dt th { background: #003a70; color: #fff; text-align: left; padding: 8px 12px; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; }
.doc table.dt td { padding: 8px 12px; border-top: 1px solid #eaf0f6; }
.doc table.dt tr:nth-child(even) td { background: #f4f6fa; }
.doc table.dt td.r, .doc table.dt th.r { text-align: right; }
.doc .callout { background: #eaf2fb; }
.doc-foot { display: flex; justify-content: space-between; border-top: 1px solid #d6dee8; margin-top: 26px; padding-top: 12px; font-size: 10.5px; color: #5a6b80; }

/* ------------------------------------------------------------------ misc components */
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.mini-stat .l { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.mini-stat .v { font-size: 18px; font-weight: 700; color: var(--text-strong); margin-top: 2px; }
.progress { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; position: relative; }
.progress i { display: block; height: 100%; background: var(--chart-1); border-radius: 4px; }
.progress.gold i { background: var(--brand-gold); }
.progress.teal i { background: var(--chart-3); }
.integ { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.integ-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px 14px; background: var(--bg-card); }
.integ-card .ih { display: flex; align-items: center; gap: 8px; }
.integ-card .in { font-weight: 700; color: var(--text-strong); overflow-wrap: anywhere; }
.integ-card .ih > .doc-ico, .integ-card .ih > .badge { flex-shrink: 0; }
.integ-card .ik { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.integ-card .is { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; display: flex; justify-content: space-between; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sd-pos { background: var(--positive-accent); } .sd-cau { background: var(--caution-accent); } .sd-neg { background: var(--negative-accent); } .sd-mute { background: var(--text-muted); opacity: .5; }
.folder-list { list-style: none; margin: 0; padding: 6px 0; }
.folder-list li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; color: var(--text-body); font-size: 12.5px; border-left: 3px solid transparent; }
.folder-list li:hover { background: var(--bg-panel); }
.folder-list li.on { background: var(--bg-panel); color: var(--text-strong); font-weight: 700; border-left-color: var(--brand-gold); }
.folder-list li .c { margin-left: auto; font-size: 11px; color: var(--text-muted); font-weight: 400; }
.vote { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 3px; font-size: 10px; font-weight: 700; border: 1px solid; }
.vote.Approve { color: var(--positive-text); background: var(--positive-fill); border-color: var(--positive-border); }
.vote.Reject { color: var(--negative-text); background: var(--negative-fill); border-color: var(--negative-border); }
.vote.Abstain { color: var(--text-muted); background: var(--bg-page); border-color: var(--line); }
.agenda-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.agenda-item:first-child { border-top: 0; }
.agenda-n { width: 28px; height: 28px; border-radius: 4px; background: var(--brand-navy); color: #fff; font-weight: 700; display: grid; place-items: center; border-left: 3px solid var(--brand-gold); }
[data-theme="dark"] .agenda-n { background: #2f6fae; }
.market-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px; background: var(--bg-card); }
.market-card .mh { display: flex; align-items: center; justify-content: space-between; }
.market-card .mn { font-weight: 700; color: var(--text-strong); font-size: 14px; }
.market-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.compliance-meter { position: relative; height: 10px; background: var(--line-soft); border-radius: 5px; margin-top: 6px; }
.compliance-meter .range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--positive-accent) 22%, transparent); border-radius: 5px; }
.compliance-meter .mark { position: absolute; top: -3px; width: 3px; height: 16px; border-radius: 2px; background: var(--text-strong); transform: translateX(-1px); }
.policy-doc { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.policy-doc:first-child { border-top: 0; }
.doc-ico { width: 34px; height: 40px; border: 1px solid var(--line); border-radius: 3px; display: grid; place-items: center; color: var(--info-text); background: var(--bg-panel); flex: none; position: relative; }
.doc-ico::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 4px; background: var(--brand-gold); border-radius: 0 0 3px 3px; }
.foot-note { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--text-muted); }
.map-legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.map-legend .ramp { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--chart-8), var(--chart-1)); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1440px) {
  .content { padding: 24px 28px 56px; }
}
@media (max-width: 1365px) {
  .hide-md { display: none !important; }
  .table thead th { padding: 9px 8px; }
  .table tbody td { padding: 8px 8px; }
  .table td:first-child, .table th:first-child { padding-left: 16px; }
  .table td:last-child, .table th:last-child { padding-right: 16px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pipe-summary .metric-value { font-size: 17px; }
  .search { max-width: 360px; }
}
@media (max-width: 1180px) {
  .md-6 { grid-column: span 6 !important; }
  .md-12 { grid-column: span 12 !important; }
  .md-4 { grid-column: span 4 !important; }
  .md-8 { grid-column: span 8 !important; }
}
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .app .brand-text, .app .nav-label, .app .nav-text, .app .nav-count, .app .chev, .app .nav-sub, .app .env-tag { display: none !important; }
  .app .nav-item { justify-content: center; padding: 0; }
  .content { padding: 20px 16px 48px; }
  .kpis, .kpis.k4, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-12 > * { grid-column: span 12 !important; }
  .crumbs, .sample-badge { display: none; }
}

/* report thumbnails and previews are always "paper" (light), even in dark mode */
.thumb-page { background: #fff; border-color: #d6dee8; }
[data-theme="dark"] .report-thumb { background: #0f1b2b; }
.modal.wide .modal-body { background: var(--bg-page); padding: 20px; }
.modal-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.table.compact thead th, .table.compact tbody td { padding-left: 8px; padding-right: 8px; }
.table.compact td:first-child, .table.compact th:first-child { padding-left: 16px; }
.table.compact td:last-child, .table.compact th:last-child { padding-right: 16px; }
@media (max-width: 1365px) { .funnel-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) !important; gap: 10px !important; } }
@media (max-width: 1365px) { .tt-bar { width: 84px !important; } .tt-bar .bar-track { display: none; } }
.tt .li-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tt .li-sub { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }

/* ---------------------------------------------------------------- brand */
a.brand { text-decoration: none; }
.doc-mast { position: relative; }
.doc-brand { position: absolute; top: 22px; right: 30px; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.doc-brand img { width: 28px; height: 28px; }
.doc-brand b { color: #d4a24c; font-weight: 700; }
.brand-switch { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.bs-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.bs-label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.bs-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.bs-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-card); color: var(--text-body); font-size: 13px; font-weight: 700; cursor: pointer; position: relative; }
.bs-opt img { width: 22px; height: 22px; flex: none; }
.bs-opt:hover { border-color: var(--brand-navy); }
.bs-opt.on { border-color: var(--brand-navy); box-shadow: inset 0 0 0 1px var(--brand-navy); color: var(--text-strong); background: var(--bg-panel); }
.bs-def { position: absolute; top: -8px; right: 6px; font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; background: var(--brand-gold); color: #26364b; padding: 1px 5px; border-radius: 3px; }
/* sign-in screen */
.signin { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--bg-page); }
.signin-hero { background: var(--chrome-bg); color: #fff; padding: 72px 72px 40px; display: flex; flex-direction: column; border-right: 6px solid var(--brand-gold); }
.signin-wordmark { width: min(520px, 100%); display: block; margin-top: auto; }
.signin-lead { margin-top: 36px; font-size: 18px; line-height: 1.55; color: #e3ebf5; max-width: 520px; }
.signin-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: var(--masthead-meta, #afc4de); font-size: 14px; }
.signin-points li { display: flex; align-items: center; gap: 10px; }
.signin-points .ico, .signin-points svg { color: var(--brand-gold); }
.signin-foot { margin-top: auto; font-size: 12px; color: #8ea6c4; letter-spacing: .4px; }
.signin-panel { display: grid; place-items: center; padding: 40px; }
.signin-card { width: min(380px, 100%); background: var(--bg-card); border: 1px solid var(--line); border-top: 4px solid var(--brand-navy); border-radius: var(--radius-card); padding: 32px 30px; text-align: center; }
.signin-mark { width: 56px; height: 56px; }
.signin-card h2 { margin-top: 14px; font-size: 22px; color: var(--text-strong); letter-spacing: -.3px; }
.signin-card p { margin-top: 6px; font-size: 13px; }
.signin-btn { width: 100%; justify-content: center; margin-top: 22px; height: 42px; font-size: 14px; }
.signin-note { margin-top: 10px; font-size: 11.5px; color: var(--text-muted); }
.signin-help { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--text-muted); }

/* ---------------------------------------------------------------- REPIMAC + debt scope */
.scope-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.scope-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--bg-card); color: var(--text-body); text-decoration: none; }
a.scope-item:hover { border-color: var(--brand-navy); }
.scope-item.on { border-left: 5px solid var(--brand-gold); background: var(--bg-panel); }
.scope-item > svg:last-child { margin-left: auto; color: var(--text-muted); flex: none; }
.scope-ico { width: 36px; height: 36px; border-radius: var(--radius-control); background: var(--brand-navy); color: #fff; display: grid; place-items: center; flex: none; }
.scope-item:not(.on) .scope-ico { background: var(--bg-page); color: var(--info-text); border: 1px solid var(--line); }
.scope-k { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-strong); }
.scope-v { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.scope-v b { color: var(--text-strong); }
.lt-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.lt-tag i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.risk { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.risk.r1, .risk.r2 { color: var(--positive-text); background: var(--positive-fill); border-color: var(--positive-border); }
.risk.r3 { color: var(--info-text); background: var(--bg-panel); border-color: var(--info-border); }
.risk.r4 { color: var(--caution-text); background: var(--caution-fill); border-color: var(--caution-border); }
.risk.r5 { color: var(--negative-text); background: var(--negative-fill); border-color: var(--negative-border); }
.drawer-meta .risk, .drawer-meta .badge { border-color: rgba(255,255,255,.35); }
.table .cau, .cau { color: var(--caution-text); font-weight: 700; }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg-page); }
.filter-row .select { min-width: 170px; }
.filter-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.ev-link { cursor: pointer; }
.ev-link:hover .li-title { text-decoration: underline; }
.prop-link { color: var(--text-strong); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.prop-link:hover { text-decoration: underline; }
.link-card { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--bg-card); padding: 14px 16px; }
.lc-main { flex: 1; min-width: 0; }
.debt-scope { margin-top: 18px; }
@media (max-width: 1365px) { .scope-strip { grid-template-columns: 1fr; } }
.scope-note { display: flex; align-items: center; gap: 6px; margin: 8px 2px 0; font-size: 12px; color: var(--text-muted); }
.scope-note svg { flex: none; color: var(--info-text); }
.scope-strip + .scope-note + .kpis { margin-top: 14px; }
.repimac-sep { border-top: 4px solid var(--brand-gold); }
.rm-mini-k { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--bg-page); }
.rm-mini-k > div { padding: 10px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.rm-mini-k > div:last-child { border-right: 0; }
.rm-mini-k span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.rm-mini-k b { font-size: 18px; color: var(--text-strong); }
a.callout-item { text-decoration: none; } a.callout-item:hover span { text-decoration: underline; }

/* ---------------------------------------------------------------- total leverage bar (third-party + REPIMAC vs limit) */
.scope-wrap { margin-top: 18px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px 10px; }
.scope-wrap .scope-strip { margin-top: 0; }
.scope-wrap .scope-note { margin-top: 10px; }
.scope-wrap + .kpis { margin-top: 16px; }
.lev-bar { margin-top: 14px; }
.lev-bar-head { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--text-body); flex-wrap: wrap; }
.lev-bar-head b { color: var(--text-strong); }
.lev-track { position: relative; display: flex; height: 14px; margin-top: 8px; border-radius: 3px; background: var(--bg-panel); border: 1px solid var(--line); }
.lev-track i { display: block; height: 100%; }
.lt-tp { background: var(--chart-1); }
.lt-rm { background: var(--brand-gold); }
.lt-head { background: repeating-linear-gradient(135deg, var(--positive-fill) 0 5px, transparent 5px 9px); border-right: 0; }
.lt-limit { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--negative-accent); }
.lt-limit em { position: absolute; left: 6px; top: -1px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--negative-text); white-space: nowrap; }
.lev-legend { display: flex; gap: 16px; margin-top: 7px; font-size: 11.5px; color: var(--text-muted); }
.lev-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lev-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--line); }
.lev-table .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 7px; vertical-align: -1px; }
.lev-table tr.tot td { border-top: 2px solid var(--text-strong); background: var(--bg-panel); }
.lev-table tr.tot .cell-title, .lev-table tr.tot td.r { font-weight: 700; color: var(--text-strong); }
.lev-table tr.lim td { color: var(--text-muted); }
.lev-table tr.head td { background: var(--positive-fill); }
.table td.wrap { white-space: normal; } .table td.wrap .cell-sub { white-space: normal; }

/* Long presentation identity remains readable on the sign-in preview. */
.signin-btn { white-space: normal; height: auto; min-height: 34px; padding-top: 8px; padding-bottom: 8px; }
