/* Crestline OS — navy & gold, matched to the Crestline Acquisitions & Holdings logo */
:root {
  --navy: #12264A;
  --navy-deep: #0B1A35;
  --navy-soft: #1B3462;
  --gold: #C9A24A;
  --gold-hi: #E7C873;
  --gold-lo: #A67C2E;
  --gold-grad: linear-gradient(135deg, #EBCB76 0%, #C9A24A 45%, #9E7428 100%);

  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface-2: #FAF8F4;
  --border: #E4DED2;
  --text: #17223A;
  --muted: #6A7286;
  --faint: #9AA1B2;

  --hot: #C4452F;
  --warm: #C98A1E;
  --cold: #5B7DB1;
  --ok: #2F8A5B;
  --bad: #B8402E;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 26, 53, .06), 0 6px 20px rgba(11, 26, 53, .06);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1630; --surface: #10203F; --surface-2: #0D1C38; --border: #22365E;
    --text: #EEF0F5; --muted: #A3ADC2; --faint: #6F7A93;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #0A1630; --surface: #10203F; --surface-2: #0D1C38; --border: #22365E;
  --text: #EEF0F5; --muted: #A3ADC2; --faint: #6F7A93;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.boot { height: 100vh; display: grid; place-items: center; background: var(--navy); }
.boot img { animation: pulse 1.4s ease-in-out infinite; border-radius: 16px; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.96); } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); background: var(--navy-deep); }
.auth-visual { position: relative; overflow: hidden; }
.auth-visual .art { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; transform: rotate(-6deg); animation: drift 60s ease-in-out infinite alternate; }
@keyframes drift { from { transform: rotate(-6deg) scale(1.02); } to { transform: rotate(-6deg) translate(-3%, -2%) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .auth-visual .art { animation: none; } }
.auth-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11,26,53,.92) 0%, rgba(11,26,53,.25) 55%, rgba(11,26,53,.6) 100%); }
.auth-visual .tagline { position: absolute; left: 48px; bottom: 48px; z-index: 1; color: #fff; max-width: 440px; }
.auth-visual .tagline h2 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: .04em; }
.auth-visual .tagline p { color: #C9D1E3; margin: 10px 0 0; }
.auth-panel { background: var(--navy); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px 44px; }
.auth-panel img.logo { width: 220px; height: auto; margin: 0 auto 8px; display: block; }
.auth-panel h1 { font-size: 18px; font-weight: 600; text-align: center; margin: 8px 0 24px; color: #DCE2EE; }
.auth-panel label { color: #C9D1E3; }
.auth-panel input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fff; }
.auth-panel input:focus { border-color: var(--gold); }
.auth-panel .check { color: #C9D1E3; }
.auth-panel .err { color: #FFB4A6; min-height: 20px; margin-top: 8px; font-size: 13px; }
.auth-panel .fine { color: #8E9AB5; font-size: 12px; text-align: center; margin-top: 24px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #DCE2EE; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 18px 18px 10px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.side .brand img { width: 40px; height: 40px; border-radius: 8px; }
.side .brand .wm { font-family: var(--display); font-size: 18px; letter-spacing: .12em; color: #fff; line-height: 1; }
.side .brand .sub { font-size: 9px; letter-spacing: .16em; color: var(--gold-hi); margin-top: 4px; text-transform: uppercase; }
.side nav { padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.side .grp { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7F8DAA; padding: 14px 10px 6px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #C9D1E3; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(201,162,74,.16); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.side nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side nav a .badge { margin-left: auto; }
.side .foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: #7F8DAA; border-top: 1px solid rgba(255,255,255,.08); }
.side .foot .ai { display: flex; align-items: center; gap: 8px; color: #C9D1E3; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: #4CC38A; box-shadow: 0 0 0 3px rgba(76,195,138,.2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--border); }
.top .menu { display: none; }
.top .search { flex: 1; max-width: 420px; position: relative; }
.top .search input { padding-left: 34px; }
.top .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }
.top .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip.gold { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold-lo); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
:root[data-theme="dark"] .chip.gold, :root:not([data-theme="light"]) .chip.gold { color: var(--gold-hi); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .chip.gold { color: var(--gold-lo); } }

.page { padding: 24px 28px 64px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 500; font-size: 26px; letter-spacing: .03em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.gold { background: var(--gold-grad); border-color: transparent; color: #1C1504; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 2px 8px rgba(166,124,46,.3); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.ok { color: var(--ok); }
.btn.bad { color: var(--bad); }
.btn.block { width: 100%; padding: 11px; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
textarea { resize: vertical; min-height: 80px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold-lo); padding: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); font-weight: 500; cursor: pointer; margin: 0; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type="search"] { min-width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- Cards & KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 14.5px; font-weight: 700; }
.card-h .more { margin-left: auto; font-size: 12.5px; color: var(--muted); text-decoration: none; font-weight: 600; }
.card-h .more:hover { color: var(--text); }
.card-b { padding: 16px 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.accent::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold-grad); }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.empty > svg { width: 44px; height: 44px; color: var(--gold); }

/* ---------- Badges, meters ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.hot { background: color-mix(in srgb, var(--hot) 12%, var(--surface)); color: var(--hot); border-color: color-mix(in srgb, var(--hot) 30%, transparent); }
.badge.warm { background: color-mix(in srgb, var(--warm) 12%, var(--surface)); color: var(--warm); border-color: color-mix(in srgb, var(--warm) 30%, transparent); }
.badge.cold { background: color-mix(in srgb, var(--cold) 12%, var(--surface)); color: var(--cold); border-color: color-mix(in srgb, var(--cold) 30%, transparent); }
.badge.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.badge.gold { background: var(--gold-grad); color: #1C1504; border-color: transparent; }
.side .badge.gold { min-width: 22px; justify-content: center; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--navy) 8%, var(--surface)); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.score { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score .bar { width: 54px; height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; }
.score .bar i { display: block; height: 100%; border-radius: 6px; }
.ring { --p: 50; --c: var(--gold); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--border) 0); }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 17px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); text-decoration: none; }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; }
.li.click:hover { background: var(--surface-2); }
.li .grow { flex: 1; min-width: 0; }
.li .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 11.5px; letter-spacing: .03em; flex: none; color: #0B1A35; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.col-h { padding: 12px 14px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); }
.col-h .sum { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12px; }
.col-b { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.col.drop { outline: 2px dashed var(--gold); outline-offset: -4px; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; box-shadow: 0 1px 2px rgba(11,26,53,.05); }
.dcard:hover { border-color: var(--gold); }
.dcard .addr { font-weight: 700; font-size: 13.5px; }
.dcard .meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.dcard .fee { font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.dcard .fee.neg { color: var(--bad); }

/* ---------- Drawer & modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 16, 33, .45); z-index: 50; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--bg); z-index: 51; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.2); animation: slide .2s ease-out; }
.drawer.wide { width: min(860px, 100vw); }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.drawer-h h2 { font-size: 17px; font-weight: 700; }
.drawer-h .x { margin-left: auto; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-f { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 8px; justify-content: flex-end; }
.modal { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: fade .15s; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.section { margin-bottom: 22px; }
.section > h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; font-weight: 700; }
.flaggrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.flaggrid .check { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 13px; }
.flaggrid .check:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.flaggrid .w { margin-left: auto; color: var(--faint); font-size: 11.5px; font-weight: 700; }
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.numbers .n { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.numbers .n .k { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.numbers .n .v { font-size: 19px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.numbers .n.hl { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.verdict { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 13.5px; }
.verdict.good { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.verdict.warn { background: color-mix(in srgb, var(--warm) 14%, var(--surface)); color: var(--warm); }
.verdict.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.note { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--text); max-height: 220px; overflow-y: auto; }
.callout { border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border)); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.callout b { color: var(--text); }

/* ---------- Executives ---------- */
.execs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.exec { padding: 16px; cursor: pointer; transition: border-color .15s, transform .1s; text-align: left; }
.exec:hover { border-color: var(--gold); transform: translateY(-1px); }
.exec.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent), var(--shadow); }
.exec .row { display: flex; align-items: center; gap: 10px; }
.exec .nm { font-weight: 700; }
.exec .ti { font-size: 12px; color: var(--muted); }
.exec p { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; min-height: 54px; }
.exec .stat { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.chat { display: flex; flex-direction: column; height: min(640px, calc(100vh - 220px)); min-height: 420px; }
.chat .msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.assistant p { margin: 0 0 6px; } .msg.assistant p:last-child { margin: 0; }
.msg.assistant ul, .msg.assistant ol { margin: 4px 0 8px; padding-left: 20px; }
.msg .props { margin-top: 8px; font-size: 12px; }
.chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat form textarea { min-height: 42px; height: 42px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.suggest button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.suggest button:hover { border-color: var(--gold); color: var(--text); }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Approvals ---------- */
.ap { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.ap:last-child { border-bottom: 0; }
.ap .grow { flex: 1; min-width: 0; }
.ap .t { font-weight: 700; }
.ap .r { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ap .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ap .btns { display: flex; gap: 6px; flex: none; }
.ap pre { white-space: pre-wrap; font: inherit; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 10px 0 0; max-height: 180px; overflow-y: auto; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .pair { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: 40%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b.in { background: var(--gold); } .bars .b.out { background: color-mix(in srgb, var(--navy) 55%, var(--faint)); }
.bars .lbl { font-size: 10.5px; color: var(--faint); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 34px; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 8px; }
.hbar .track { height: 8px; background: var(--border); border-radius: 8px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--gold-grad); border-radius: 8px; }
.hbar .n { text-align: right; font-weight: 700; color: var(--muted); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 600; font-size: 13.5px; animation: fade .2s; max-width: 90vw; }
.toast.err { background: var(--bad); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.mt { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.hide { display: none !important; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; width: 260px; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  .top { padding: 10px 16px; }
  .top .menu { display: inline-flex; }
  .top .hide-sm { display: none; }
  .page { padding: 18px 16px 48px; }
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 40px 24px; min-height: 100vh; }
  .numbers { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .flaggrid { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 30px; }
  .ap { flex-direction: column; }
  .filters input[type="search"] { min-width: 0; flex: 1 1 100%; }
}
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } .kpi { padding: 12px 14px; } .page-head .actions { margin-left: 0; } }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } .kpi .v { font-size: 22px; } .kpi .k { font-size: 11px; } }

/* ---------- Heat Index & qualification ---------- */
.heat-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.ring.big { width: 78px; height: 78px; } .ring.big span { width: 62px; height: 62px; font-size: 22px; }
.heat-parts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 4px 0; }
.heat-parts b { color: var(--text); }
.qual .qq { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.qq-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; font-size: 13px; }
.qq-h .muted { font-style: italic; font-size: 12.5px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { margin: 0; cursor: pointer; font-weight: 500; color: var(--text); font-size: 12.5px; position: relative; }
.opt input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); transition: all .12s; }
.opt span i { font-style: normal; color: var(--faint); font-size: 11px; font-weight: 700; }
.opt:hover span { border-color: var(--faint); }
.opt input:checked + span { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); font-weight: 700; }
.opt input:checked + span i { color: var(--gold-lo); }
.opt input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.triage { background: color-mix(in srgb, var(--navy) 6%, var(--surface)); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.triage summary { cursor: pointer; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.triage summary svg { width: 16px; height: 16px; }
.triage textarea { margin-top: 10px; }

/* ---------- Signal Hub ---------- */
.hub { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 240px); min-height: 480px; overflow: hidden; }
.hub-list { border-right: 1px solid var(--border); overflow-y: auto; }
.hub-t { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; align-items: center; }
.hub-t:hover { background: var(--surface-2); }
.hub-t.on { background: color-mix(in srgb, var(--gold) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--gold); }
.hub-t .grow { min-width: 0; flex: 1; }
.hub-t .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-t .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-main { display: flex; flex-direction: column; min-width: 0; }
.hub-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.hub-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.bub { max-width: 72%; display: flex; flex-direction: column; gap: 3px; }
.bub > div { padding: 9px 13px; border-radius: 16px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bub span { font-size: 11px; color: var(--faint); padding: 0 6px; }
.bub.in { align-self: flex-start; } .bub.in > div { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bub.out { align-self: flex-end; align-items: flex-end; } .bub.out > div { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.hub-comp { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.hub-comp textarea { min-height: 44px; }
@media (max-width: 860px) { .hub { grid-template-columns: 1fr; height: auto; } .hub-list { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--border); } .hub-main { min-height: 460px; } }

.sync { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.sync-c { display: flex; gap: 14px; padding: 16px 18px; }
.sync-c h3 { font-size: 15px; margin-bottom: 2px; }
.sync-c p { margin: 0 0 10px; }
.sync-c select { width: auto; }
.sync-n { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-grad); color: #1C1504; font-weight: 800; display: grid; place-items: center; flex: none; }
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--border); border-radius: 10px; padding: 14px; cursor: pointer; color: var(--muted); font-weight: 600; margin: 0; }
.drop:hover, .drop.over { border-color: var(--gold); color: var(--text); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.drop svg { width: 18px; height: 18px; }
.hub { height: calc(100vh - 150px); }
@media (max-width: 1100px) { .sync { grid-template-columns: 1fr; } }
