/* Quply Admin. Same family as the apps and the merchant portal (gold → flame → red ring, berry/plum
   tail, warm cream), tuned for long working sessions: denser type, quiet surfaces, colour only where
   it carries meaning (status, money up/down, the one highlighted number). */

:root {
  --gold: #e8a200; --flame: #ff6a28; --red: #e5313f; --berry: #c2276c; --plum: #5b1a4e; --violet: #8b62e0;
  --positive: #1f9d5c; --info: #4c6fd8;

  --bg: #f6f2ee; --surface: #fff; --surface-2: #f2ece7; --surface-3: #ebe3dc;
  --ink: #1c1412; --ink-2: #4a3e39; --mute: #877870; --line: rgba(28, 20, 18, .08); --line-2: rgba(28, 20, 18, .14);
  --shadow: 0 1px 2px rgba(28, 20, 18, .04), 0 6px 20px rgba(28, 20, 18, .05);
  --side: #1d0f1a; --side-2: #2a1626; --side-ink: #f4e9ef; --side-mute: #b39aab;
  --radius: 18px; --radius-sm: 11px;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  --bg: #110b0d; --surface: #1a1215; --surface-2: #241a1d; --surface-3: #2e2226;
  --ink: #f6eef0; --ink-2: #d4c6ca; --mute: #9d8b91; --line: rgba(246, 238, 240, .08); --line-2: rgba(246, 238, 240, .15);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --side: #0c0709; --side-2: #1a0f14;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110b0d; --surface: #1a1215; --surface-2: #241a1d; --surface-3: #2e2226;
    --ink: #f6eef0; --ink-2: #d4c6ca; --mute: #9d8b91; --line: rgba(246, 238, 240, .08); --line-2: rgba(246, 238, 240, .15);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    --side: #0c0709; --side-2: #1a0f14;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.i { width: 18px; height: 18px; flex: none; }
.num, .tbl td.num { font-variant-numeric: tabular-nums; }
.mono { font: 500 12px/1.4 var(--mono); letter-spacing: -.01em; }
.mute { color: var(--mute); }
.sm { font-size: 12.5px; }
.pad { padding: 14px 18px; margin: 0; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; border-radius: 6px; }

/* ── Layout ───────────────────────────────────── */
.layout { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 12px; overflow-y: auto; }
.side::before { content: ""; position: absolute; inset: auto -80px -120px auto; width: 300px; height: 300px; background: radial-gradient(circle, rgba(194, 39, 108, .32), transparent 65%); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; position: relative; }
.brand .logo { width: 34px; height: 34px; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.brand em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--side-mute); letter-spacing: .02em; }
.side nav { display: flex; flex-direction: column; gap: 1px; position: relative; }
.nav-g { font-size: 11px; font-weight: 600; color: var(--side-mute); padding: 14px 12px 6px; opacity: .8; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: rgba(244, 233, 239, .82); font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s; }
.side nav a .i { width: 17px; height: 17px; opacity: .8; }
.side nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side nav a.on { background: linear-gradient(90deg, rgba(255, 106, 40, .2), rgba(194, 39, 108, .14)); color: #fff; box-shadow: inset 2px 0 0 var(--flame); }
.side nav a.on .i { opacity: 1; color: #ffb07a; }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.demo-flag { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(232, 162, 0, .12); color: #ffd685; font-size: 12px; }
.demo-flag span { display: flex; flex-direction: column; line-height: 1.3; }
.demo-flag b { color: #ffe3a6; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08); background: var(--side-2); cursor: pointer; text-align: left; color: var(--side-ink); }
.me-t { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.me-t b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-t em { font-style: normal; font-size: 11.5px; color: var(--side-mute); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--mute); cursor: text; text-align: left; }
.search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 600 11px var(--body); padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--mute); border: 1px solid var(--line); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.env { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(31, 157, 92, .1); color: var(--positive); }
.env.demo { background: rgba(232, 162, 0, .14); color: #a67300; }
:root[data-theme="dark"] .env.demo { color: #ffc84a; }
.viewas { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--mute); }
.viewas select { border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink); padding: 4px; cursor: pointer; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.bell .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface); }
.mob { display: none; }
main { padding: 26px 28px 60px; max-width: 1520px; width: 100%; outline: none; }

/* ── Page head ─────────────────────────────────── */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.page-h p { margin: 6px 0 0; color: var(--mute); max-width: 760px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-h.hello h1 { font-size: 30px; }
.page-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Buttons, inputs ───────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.dark { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.dark:hover { opacity: .9; }
.btn.cta { background: linear-gradient(90deg, #ff8a1e, #ff5a2e 50%, #d92c62); color: #fff; border: 0; height: 46px; font-size: 15px; }
.btn.danger { color: var(--red); border-color: rgba(229, 49, 63, .35); }
.btn.danger:hover { background: rgba(229, 49, 63, .07); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn .i { width: 16px; height: 16px; }
.link { border: 0; background: none; cursor: pointer; color: var(--flame); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; padding: 0; }
.link .i { width: 14px; height: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .select { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 11px; padding: 10px 12px; outline: none; }
.field input:focus, .field textarea:focus, .select:focus { border-color: var(--flame); box-shadow: 0 0 0 3px rgba(255, 106, 40, .15); }
.invalid { border-color: var(--red) !important; }
.select { appearance: none; padding-right: 32px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23877870' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
.select.sm { width: auto; height: 34px; padding: 0 30px 0 10px; font-size: 13px; border-radius: 10px; }
.input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 0 10px; color: var(--mute); }
.input.sm { height: 34px; }
.input input { border: 0; outline: none; background: transparent; width: 230px; color: var(--ink); font-size: 13px; }
.input .i { width: 15px; height: 15px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--mute); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.switch { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch:checked { background: var(--positive); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: default; }

/* ── Cards, KPIs ───────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-h { padding: 16px 20px 10px; margin: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-h h3 .i { color: var(--flame); width: 17px; height: 17px; }
.card-sub { font-size: 12px; color: var(--mute); }
.card-a { margin-left: auto; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-ov { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.kpis { display: grid; gap: 12px; margin-bottom: 16px; }
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; position: relative; overflow: hidden; }
.kpi-l { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kpi-l .i { width: 16px; height: 16px; color: var(--mute); }
.kpi-v { font-size: 26px; font-weight: 750; letter-spacing: -.03em; margin: 8px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-d { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.kpi.hl { background: linear-gradient(150deg, #3a1532, #6b1f4f 55%, #b3324b); color: #fff; border-color: transparent; }
.kpi.hl .kpi-l, .kpi.hl .kpi-l .i, .kpi.hl .delta-note { color: rgba(255, 255, 255, .78); }
.kpi.hl .delta.up { background: rgba(255, 255, 255, .16); color: #fff; }
.kpi.pos .kpi-v { color: var(--positive); }
.kpi.neg .kpi-v { color: var(--red); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.delta.up { background: rgba(31, 157, 92, .11); color: var(--positive); }
.delta.down { background: rgba(229, 49, 63, .1); color: var(--red); }
.delta.flat { background: var(--surface-2); color: var(--mute); }
.delta-note { font-size: 11.5px; color: var(--mute); }

/* ── Pills, tags, meters ───────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; text-transform: capitalize; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: rgba(31, 157, 92, .11); color: var(--positive); }
.pill.warn { background: rgba(232, 162, 0, .14); color: #a06e00; }
.pill.bad { background: rgba(229, 49, 63, .1); color: var(--red); }
.pill.info { background: rgba(76, 111, 216, .1); color: var(--info); }
:root[data-theme="dark"] .pill.warn { color: #ffc84a; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.flame { background: rgba(255, 106, 40, .12); color: #d4501a; }
.tag.berry, .tag.red { background: rgba(194, 39, 108, .1); color: var(--berry); }
.tag.info, .tag.violet { background: rgba(139, 98, 224, .12); color: var(--violet); }
.tag.bad { background: rgba(229, 49, 63, .1); color: var(--red); }
.tag.gold { background: rgba(232, 162, 0, .14); color: #a06e00; }
.tag.plum { background: rgba(91, 26, 78, .12); color: var(--plum); }
:root[data-theme="dark"] .tag.plum { color: #e39bd3; }
.meter { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--positive); }
.meter.warn i { background: var(--gold); }
.meter.bad i { background: var(--red); }
.risk { display: inline-block; min-width: 30px; text-align: center; font-weight: 700; font-size: 12px; padding: 2px 6px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); }
.risk.mid { background: rgba(232, 162, 0, .15); color: #a06e00; }
.risk.hi { background: rgba(229, 49, 63, .12); color: var(--red); }
.late { color: var(--red); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.warn-t { color: #b07a00; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.late .i, .warn-t .i, .mute .i { width: 14px; height: 14px; }
td .mute { display: inline-flex; gap: 4px; align-items: center; }

/* ── Rows, feeds, kv ───────────────────────────── */
.rows { display: flex; flex-direction: column; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.row-link:last-child { border-bottom: 0; }
a.row-link:hover { background: var(--surface-2); margin: 0 -10px; padding: 10px 12px; border-radius: 10px; }
.row-link > .i { width: 15px; height: 15px; color: var(--mute); }
.rows.tight .row-link { padding: 7px 2px; }
.rl-i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.rl-i .i { width: 16px; height: 16px; }
.rl-i.warn { background: rgba(232, 162, 0, .13); color: #a06e00; }
.rl-i.bad { background: rgba(229, 49, 63, .1); color: var(--red); }
.rl-i.info { background: rgba(139, 98, 224, .12); color: var(--violet); }
.rl-i.ok { background: rgba(31, 157, 92, .11); color: var(--positive); }
.rl-l { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rl-l em { font-style: normal; }
.rl-r { color: var(--mute); }
.sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.count { min-width: 26px; text-align: center; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.count.warn { background: rgba(232, 162, 0, .14); color: #a06e00; }
.count.bad { background: rgba(229, 49, 63, .1); color: var(--red); }
.count.info { background: rgba(139, 98, 224, .12); color: var(--violet); }
.count.ok { background: rgba(31, 157, 92, .11); color: var(--positive); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; text-align: right; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.kv.tight { gap: 7px 12px; }
.foot { margin: 14px -20px -18px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; gap: 10px; font-size: 13px; border-radius: 0 0 var(--radius) var(--radius); }
.foot b { margin-left: auto; font-size: 15px; }
.foot span { color: var(--mute); font-size: 12px; }
.foot.pos b { color: var(--positive); }
.foot.neg b { color: var(--red); }
.foot-line { color: var(--mute); font-size: 13px; display: flex; gap: 8px; align-items: center; margin: 4px 0 18px; }
.foot-line .i { width: 15px; height: 15px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; margin-bottom: 12px; font-size: 13.5px; }
.bar-row .meter { grid-column: 1 / -1; }
.feed { display: flex; flex-direction: column; }
.feed-i { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-i:last-child { border-bottom: 0; }
.feed-i > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed-i b { font-size: 13.5px; font-weight: 600; }
.feed-i em { font-style: normal; color: var(--mute); font-size: 12.5px; }
.feed-i small { color: var(--mute); font-size: 12px; white-space: nowrap; }
.fi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.fi .i { width: 15px; height: 15px; }
.fi.ok { background: rgba(31, 157, 92, .11); color: var(--positive); }
.fi.warn { background: rgba(232, 162, 0, .14); color: #a06e00; }
.fi.bad { background: rgba(229, 49, 63, .1); color: var(--red); }
.fi.info { background: rgba(139, 98, 224, .12); color: var(--violet); }
.health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.h-i { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.h-i > .i { color: var(--ink-2); }
.h-i span { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13px; }
.gr-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; font-size: 12.5px; }
.note { display: flex; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); margin: 10px 0 16px; align-items: flex-start; }
.note .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.note.warn { background: rgba(232, 162, 0, .12); color: #7a5500; }
:root[data-theme="dark"] .note.warn { color: #ffd685; }

/* ── Charts ────────────────────────────────────── */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; }
.gridline { stroke: var(--line); stroke-width: 1; }
.axis { fill: var(--mute); font-size: 11px; }
.hover-line { stroke: var(--line-2); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 6px; min-width: 160px; padding: 9px 11px; border-radius: 11px; background: var(--ink); color: var(--bg); font-size: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.chart-tip[hidden] { display: none; }
.chart-tip span { display: flex; align-items: center; gap: 6px; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip em { margin-left: auto; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--mute); margin-top: 10px; }
.legend.top { margin: -6px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend b { color: var(--ink); font-weight: 600; }
.share { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; }
.share i { display: block; height: 100%; }
.cols { display: flex; align-items: flex-end; gap: 10px; padding-top: 10px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.col i { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; min-height: 4px; opacity: .9; }
.col:last-child i { opacity: 1; }
.col span { font-size: 11.5px; color: var(--mute); }
.donut { position: relative; width: fit-content; margin: 0 auto 14px; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-c b { font-size: 18px; font-weight: 750; }
.donut-c span { font-size: 11px; color: var(--mute); }
.spark { overflow: visible; }

/* ── Tables ────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--mute); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tr[data-row] { cursor: pointer; }
.tbl tr[data-row]:hover td { background: var(--surface-2); }
.tbl.dense td { padding: 8px 16px; }
.card:not(.flush) .tbl th:first-child, .card:not(.flush) .tbl td:first-child { padding-left: 0; }
.card:not(.flush) .tbl th:last-child, .card:not(.flush) .tbl td:last-child { padding-right: 0; }
.card:not(.flush) .tbl th { background: transparent; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.who-cell em { font-style: normal; font-size: 12px; color: var(--mute); }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.av.sm { width: 30px; height: 30px; font-size: 11px; }
.av.big { width: 52px; height: 52px; font-size: 17px; }
.av.sq { border-radius: 10px; }
.av.plum { background: linear-gradient(140deg, #8d2c72, #c2276c); color: #fff; }
.av.gold { background: rgba(232, 162, 0, .2); color: #8a5e00; }
.av.red { background: rgba(229, 49, 63, .15); color: var(--red); }
.av.flame { background: rgba(255, 106, 40, .16); color: #c34a17; }
.av.berry { background: rgba(194, 39, 108, .14); color: var(--berry); }
.av.violet { background: rgba(139, 98, 224, .15); color: var(--violet); }
.empty { padding: 36px; text-align: center; color: var(--mute); }
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 13px; padding: 6px 12px 12px; }
.heat th { font-size: 12px; color: var(--mute); font-weight: 600; text-align: center; padding: 6px; }
.heat th:first-child { text-align: left; }
.heat td { text-align: center; padding: 9px 6px; border-radius: 8px; background: color-mix(in srgb, var(--berry) calc(var(--a, 0) * 85%), var(--surface-2)); color: var(--ink); }
.heat td[style*="--a:1"], .heat td[style*="--a:0.7"], .heat td[style*="--a:0.6"] { color: #fff; }
.heat td:first-child, .heat td:nth-child(2) { background: transparent; text-align: left; }
.heat .r { text-align: right !important; }
.pl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pl td { padding: 6px 0; }
.pl tr.h td { font-weight: 700; padding-top: 12px; }
.pl tr:not(.h):not(.total) td:first-child { padding-left: 14px; color: var(--ink-2); }
.pl .r { text-align: right; }
.pl tr.total td { border-top: 1px solid var(--line-2); padding-top: 12px; font-weight: 800; font-size: 15px; }
.pl tr.total.pos td:last-child { color: var(--positive); }
.pl tr.total.neg td:last-child { color: var(--red); }

/* ── Toolbars, tabs ────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tool-r { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.toolbar .tabs { margin-bottom: 0; border: 0; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 13.5px; color: var(--mute); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--flame); }
.tabs button b { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.stat-inline { display: flex; gap: 18px; font-size: 13px; color: var(--mute); }
.stat-inline b { color: var(--ink); }

/* ── Kanban ────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.kanban.five { grid-template-columns: repeat(5, minmax(210px, 1fr)); }
.lane { background: var(--surface-2); border-radius: 16px; padding: 12px; min-height: 180px; }
.lane h4 { margin: 2px 4px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.lane h4 b { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface); }
.lane h4 span { margin-left: auto; font-weight: 600; font-size: 12px; }
.lane-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.lane-card b { font-size: 13.5px; }
.lane-card em { font-style: normal; font-size: 12px; color: var(--mute); }
.lane-card > span { font-size: 12px; display: flex; gap: 5px; align-items: center; margin-top: 4px; }
.lane-card .i { width: 13px; height: 13px; }
.lane-f { justify-content: space-between; }

/* ── Plans ─────────────────────────────────────── */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 12px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border-top: 4px solid var(--c); display: flex; flex-direction: column; }
.plan-h { display: flex; justify-content: space-between; align-items: baseline; }
.plan-h b { font-size: 16px; }
.plan-h span { font-weight: 700; font-size: 18px; }
.plan-h em { font-style: normal; font-size: 12px; color: var(--mute); font-weight: 500; }
.plan-n { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin: 10px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.plan-n em { font-style: normal; font-size: 13px; color: var(--mute); font-weight: 500; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; align-items: center; }
.plan li .i { width: 14px; height: 14px; color: var(--positive); }
.plan-f { margin-top: auto; display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.plan-f b { color: var(--ink); }
.sec { font-size: 14px; margin: 6px 0 10px; color: var(--ink-2); }
.plans.two { grid-template-columns: repeat(2, 1fr); max-width: 50%; }
.card h4.first { margin-top: 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--ink-2); }

/* ── Banking ───────────────────────────────────── */
.partner { background: linear-gradient(135deg, #22101e, #3b1534 60%, #5a1d3e); color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.partner-h { display: flex; gap: 16px; align-items: center; }
.partner-h h2 { margin: 0; font-size: 22px; }
.partner-h h2 .mute { color: rgba(255, 255, 255, .6); font-size: 13px; font-weight: 500; margin-left: 6px; }
.partner-h p { margin: 6px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.partner-h .mute { color: rgba(255, 255, 255, .65); }
.partner-logo { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; }
.partner-logo .i { width: 26px; height: 26px; }
.partner-k { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 18px; }
.partner-k div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.partner-k span { font-size: 11.5px; color: rgba(255, 255, 255, .65); }
.partner-k b { font-size: 18px; }
.partner-k b.neg { color: #ff8a92; }
.recon { display: grid; grid-template-columns: 1fr auto 1fr 1fr; gap: 14px; align-items: stretch; margin-bottom: 8px; }
.rc { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rc span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.rc b { font-size: 24px; letter-spacing: -.02em; }
.rc em, .rc-res em { font-style: normal; font-size: 12px; color: var(--mute); }
.rc-op { align-self: center; font-size: 26px; font-weight: 300; color: var(--mute); }
.rc-res { border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-weight: 700; font-size: 16px; }
.rc-res .i { width: 22px; height: 22px; }
.rc-res.ok { background: rgba(31, 157, 92, .1); color: var(--positive); }
.rc-res.bad { background: rgba(229, 49, 63, .1); color: var(--red); }
.whose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.whose div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.whose span { font-size: 12.5px; color: var(--mute); }
.whose b { font-size: 17px; }
.card h4, .drawer h4 { font-size: 13px; margin: 18px 0 10px; color: var(--ink-2); }

/* ── Risk ──────────────────────────────────────── */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert-i { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.alert-i:hover { background: var(--surface-2); }
.score { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--surface-2); flex: none; }
.score.mid { background: rgba(232, 162, 0, .15); color: #a06e00; }
.score.hi { background: rgba(229, 49, 63, .12); color: var(--red); }
.al-b { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.al-b em { font-style: normal; font-size: 13px; color: var(--ink-2); }
.al-b small { font-size: 12px; color: var(--mute); }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fn { display: grid; grid-template-columns: 130px 1fr 70px 40px; gap: 12px; align-items: center; font-size: 13px; }
.fn-bar { height: 22px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--flame), var(--berry)); border-radius: 7px; }
.fn b { text-align: right; }
.fn em { font-style: normal; font-size: 12px; color: var(--mute); text-align: right; }

/* ── Team ──────────────────────────────────────── */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.role-c { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.role-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.role-h div { display: flex; flex-direction: column; }
.role-h em { font-style: normal; font-size: 12.5px; color: var(--mute); }
.role-m { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.role-m span { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); }
.role-m .i { width: 13px; height: 13px; }
.role-p { display: flex; flex-wrap: wrap; gap: 6px; color: var(--mute); }
.flags { display: flex; flex-direction: column; }
.flag { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.flag:last-child { border: 0; }
.flag span { flex: 1; display: flex; flex-direction: column; }
.flag em { font-style: normal; color: var(--mute); font-size: 12.5px; }

/* ── Drawer, toast, command bar ────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(15, 8, 12, .38); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); z-index: 41; padding: 26px 26px 40px; overflow-y: auto; box-shadow: -10px 0 40px rgba(0, 0, 0, .15); animation: slide .2s ease-out; }
.drawer.wide { width: min(640px, 100vw); }
.drawer h2 { margin: 0 40px 6px 0; font-size: 20px; letter-spacing: -.02em; }
.drawer .sub { color: var(--mute); margin: 0 0 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer .close { position: absolute; top: 18px; right: 18px; }
.actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.who { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.who h2 { margin: 0; }
.who .sub { margin: 2px 0 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tl { list-style: none; padding: 0 0 0 16px; margin: 0; border-left: 2px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.tl li { display: flex; flex-direction: column; position: relative; font-size: 13.5px; }
.tl li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--flame); box-shadow: 0 0 0 3px var(--surface); }
.tl em { font-style: normal; color: var(--mute); font-size: 12.5px; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { background: var(--surface-2); padding: 10px 14px; border-radius: 14px 14px 14px 4px; font-size: 13.5px; }
.msg p { margin: 4px 0; }
.msg small { color: var(--mute); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 13.5px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .2s; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--red); color: #fff; }
.cmd-drawer { top: 12vh; bottom: auto; right: 50%; transform: translateX(50%); border-radius: 18px; padding: 0; max-height: 72vh; animation: fade .15s; }
.cmd-drawer .close { display: none; }
.cmd-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmd-in input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; }
.cmd-res { max-height: 56vh; overflow-y: auto; padding: 6px; }
.cmd-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 11px; }
.cmd-item.on, .cmd-item:hover { background: var(--surface-2); }
.cmd-item span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cmd-item em { font-style: normal; font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item small { font-size: 11.5px; color: var(--mute); font-weight: 600; }
.cmd-jump { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 8px 10px; }
.cmd-jump a { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.cmd-jump a:hover { background: var(--surface-2); }
.cmd-jump .i { width: 15px; height: 15px; color: var(--mute); }
.loading { display: grid; place-items: center; height: 50vh; }
.loading span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--flame); animation: spin .8s linear infinite; }
.failed { text-align: center; padding: 80px 20px; color: var(--mute); }
.failed .i { width: 32px; height: 32px; margin: 0 auto 10px; color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 10px); opacity: 0; } }

/* ── Sign in ───────────────────────────────────── */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-art { background: radial-gradient(120% 90% at 100% 0%, #b3324b 0%, transparent 55%), radial-gradient(90% 80% at 0% 100%, #5b1a4e 0%, transparent 60%), #1d0f1a; color: #fff; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .brand em { color: rgba(255, 255, 255, .7); }
.auth-copy h2 { font-size: 44px; line-height: 1.05; letter-spacing: -.035em; margin: 0 0 16px; max-width: 520px; }
.auth-copy p { color: rgba(255, 255, 255, .78); max-width: 500px; font-size: 15.5px; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-points .i { width: 20px; height: 20px; color: #ffb07a; }
.auth-foot { color: rgba(255, 255, 255, .5); font-size: 12.5px; margin: 0; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; letter-spacing: -.025em; margin: 0 0 6px; }
.lead { color: var(--mute); margin: 0 0 24px; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 0 0 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.server { color: var(--mute); font-size: 12px; text-align: center; margin-top: 18px; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1360px) {
  .kpis.six { grid-template-columns: repeat(3, 1fr); }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .partner-k { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 30; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .mob { display: grid; }
  .g-ov, .g-3 { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
  .kpis.five, .kpis.four { grid-template-columns: repeat(2, 1fr); }
  .plans, .roles { grid-template-columns: 1fr 1fr; }
  .recon { grid-template-columns: 1fr 1fr; }
  .rc-op { display: none; }
  .health { grid-template-columns: 1fr 1fr; }
  .viewas, .env { display: none; }
}
@media (max-width: 720px) {
  main { padding: 18px 14px 50px; }
  .top { padding: 10px 14px; }
  .search span { display: none; }
  .g-2, .g-3, .g-4, .g-ov, .kpis.six, .kpis.five, .kpis.four, .plans, .roles, .whose, .recon { grid-template-columns: 1fr; }
  .plans.two { max-width: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .fn { grid-template-columns: 100px 1fr 60px; }
  .fn em { display: none; }
  .input input { width: 140px; }
}
