/* Cubit CRM — Cubit navy (#173583, from the logo) on cool paper. One family (Schibsted Grotesk), tabular figures for money.
   Theme: light / dark / system. theme.js sets <html data-theme="light|dark"> before the page paints. */
:root {
  --paper: #F4F6FA;
  --surface: #FFFFFF;
  --sunk: #EAEEF5;
  --ink: #131A2E;
  --ink-2: #343D57;
  --muted: #5C6680;
  --line: #DCE1EB;
  --line-2: #C5CCDA;
  --primary: #173583;
  --primary-2: #10276A;
  --primary-soft: #E6ECF8;
  --on-primary: #FFFFFF;
  --accent: #D9822B;
  --accent-soft: #FCEFDF;
  --danger: #B23A48;
  --danger-soft: #F8E6E8;
  --wa: #157A4B;
  --brand-panel: #173583;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 0 rgba(19, 26, 46, .04), 0 1px 3px rgba(19, 26, 46, .07);
  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1120; --surface: #151B2E; --sunk: #0A0E1A; --ink: #E7EAF3; --ink-2: #C2C8DA; --muted: #8E97B0;
    --line: #232B42; --line-2: #313A55; --primary: #8EA8F2; --primary-2: #AFC2F7; --primary-soft: #1C2747; --on-primary: #0D1120;
    --accent: #F0B060; --accent-soft: #3A2C17; --danger: #EA8290; --danger-soft: #3A1E25; --wa: #4CC38A; --brand-panel: #10276A;
    --shadow: 0 1px 0 rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1120; --surface: #151B2E; --sunk: #0A0E1A; --ink: #E7EAF3; --ink-2: #C2C8DA; --muted: #8E97B0;
  --line: #232B42; --line-2: #313A55; --primary: #8EA8F2; --primary-2: #AFC2F7; --primary-soft: #1C2747; --on-primary: #0D1120;
  --accent: #F0B060; --accent-soft: #3A2C17; --danger: #EA8290; --danger-soft: #3A1E25; --wa: #4CC38A; --brand-panel: #10276A;
  --shadow: 0 1px 0 rgba(0,0,0,.35);
  color-scheme: dark;
}

/* Logo: navy on light, white on dark */
.logo { display: block; height: 34px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); font-feature-settings: 'tnum' 0; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.num, .money, .stat strong, .lane-total, .bar-n { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-wa { color: var(--wa); border-color: color-mix(in srgb, var(--wa) 40%, var(--line-2)); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font: 600 15px var(--font); text-decoration: none;
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 15px var(--font);
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 28px; }
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.input:disabled { background: var(--sunk); color: var(--muted); }
.input-sm { height: 30px; font-size: 13px; padding: 0 8px; }
input[type="color"].input { width: 44px; padding: 3px; }
.field { display: grid; gap: 5px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.stack { display: grid; gap: 14px; }
.narrow { max-width: 440px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid > .form-error, .form-grid-end { grid-column: 1 / -1; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.notice { background: var(--accent-soft); color: var(--ink); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.brand-tag { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--on-primary); background: var(--primary); border-radius: 4px; padding: 2px 5px; }
.brand-lg { padding: 0; margin-bottom: 28px; }
.brand-lg .logo { height: 54px; }
.ws { position: relative; }
.ws-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); cursor: pointer; font: inherit;
}
.ws-btn:hover { border-color: var(--line-2); }
.ws-mark { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--primary); color: var(--on-primary); font-weight: 800; }
.ws-label { flex: 1; min-width: 0; display: grid; }
.ws-label strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-label small { font-size: 12px; color: var(--muted); }
.ws-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.ws-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: 14px var(--font); cursor: pointer; text-align: left; }
.ws-item:hover, .ws-item.on { background: var(--sunk); }
.ws-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-role { font-size: 12px; color: var(--muted); }
.ws-new { justify-content: flex-start; color: var(--primary); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; }
.nav { display: grid; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav-link:hover { background: var(--sunk); color: var(--ink); }
.nav-link.on { background: var(--primary-soft); color: var(--primary); }
.side-theme { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; font-size: 13px; color: var(--muted); }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.me { flex: 1; min-width: 0; display: grid; }
.me strong { font-size: 14px; }
.me small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; }
.page { max-width: 1200px; padding: 28px 32px 64px; display: grid; gap: 20px; }
.page-wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-person { display: flex; align-items: center; gap: 14px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; align-content: start; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.empty { text-align: center; padding: 48px 20px; display: grid; gap: 8px; justify-items: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 16px; }
.empty p { max-width: 42ch; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 600; vertical-align: 2px; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat { padding: 18px 20px; display: grid; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 13.5px; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 170px; }
.bar { height: 100%; display: grid; grid-template-rows: 18px 1fr 18px; align-items: end; text-align: center; }
.bar i { display: block; min-height: 2px; background: var(--primary); border-radius: 4px 4px 0 0; align-self: end; }
.bar-n { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.bar-d { font-size: 11.5px; color: var(--muted); }
.split { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.split-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.split-track { height: 6px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.split-track i { display: block; height: 100%; border-radius: 99px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; }
.people li + li { border-top: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.people .person { padding: 9px 0; }
.people .person:hover strong { color: var(--primary); }
.person-main { flex: 1; min-width: 0; display: grid; }
.person-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-main small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.chip-x { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: -4px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.chip-x:hover { background: color-mix(in srgb, var(--c) 25%, transparent); }
.chips-lg .chip { height: 26px; font-size: 13px; }
.svc { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); color: color-mix(in srgb, var(--c) 80%, var(--ink)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; }

/* ---------- Filters & table ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .input { width: auto; min-width: 150px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { position: absolute; left: 11px; top: 12px; color: var(--muted); }
.search .input { width: 100%; padding-left: 34px; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius); background: var(--primary-soft); }
.bulkbar .input { width: auto; height: 34px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[tabindex] { cursor: pointer; }
.table tbody tr[tabindex]:hover td { background: var(--paper); }
.col-check { width: 40px; }
.col-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.table-compact td { padding: 8px 10px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }

/* ---------- Contact detail ---------- */
.detail { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 20px; align-items: start; }
.detail-side, .detail-main { display: grid; gap: 20px; }
.kv { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.kv dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); text-transform: capitalize; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-add .input { flex: 1; min-width: 160px; }
.deals { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.deal-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 8px; }
.deal-top { display: flex; justify-content: space-between; gap: 8px; }
.deal-meta { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 13px; }
.deal-meta .input { width: auto; height: 32px; font-size: 13px; }
.money { font-weight: 700; }
.composer { display: grid; gap: 8px; justify-items: end; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 18px 26px; }
.tl-dot { position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.tl-note .tl-dot { border-color: var(--accent); background: var(--accent); }
.tl-form_submitted .tl-dot, .tl-contact_created .tl-dot { border-color: var(--primary); background: var(--primary); }
.tl-stage_changed .tl-dot, .tl-deal_created .tl-dot { border-color: var(--primary); }
.tl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.tl-head time { font-size: 12.5px; color: var(--muted); }
.tl-head .muted { font-size: 12.5px; }
.tl-body p { font-size: 14px; margin-top: 2px; }
.tl-text { white-space: pre-wrap; background: var(--paper); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 6px !important; }

/* ---------- Pipeline board (the signature view) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.lane { background: var(--sunk); border-radius: var(--radius); border-top: 4px solid var(--c); display: grid; grid-template-rows: auto 1fr; min-height: 60vh; scroll-snap-align: start; transition: background .15s; }
.lane.drop { background: color-mix(in srgb, var(--c) 10%, var(--sunk)); }
.lane-won, .lane-lost { opacity: .92; }
.lane-head { padding: 12px 12px 10px; display: grid; gap: 2px; }
.lane-title { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.lane-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface); font-size: 12px; display: grid; place-items: center; color: var(--muted); }
.lane-total { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.lane-list { padding: 4px 8px 10px; display: grid; gap: 8px; align-content: start; }
.lane-empty { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 18px 10px; text-align: center; font-size: 13px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; display: grid; gap: 6px; cursor: grab; box-shadow: var(--shadow); }
.card:hover { border-color: var(--line-2); }
.card.dragging { opacity: .45; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-title { font-size: 14px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.card-sub { font-size: 12.5px; color: var(--muted); }
.card-foot { display: flex; justify-content: flex-end; }
.card-foot .input { width: auto; max-width: 100%; color: var(--muted); }
.card .money { font-size: 13px; color: var(--accent); filter: brightness(.8); }

/* ---------- Settings ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.settings-body { display: grid; gap: 20px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row-main { flex: 1; min-width: 180px; display: grid; }
.row-main small { color: var(--muted); font-size: 13px; }
.row > .muted { font-size: 13px; }
.row .input-sm { width: auto; }
.stage-edit { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.stage-edit li { display: grid; grid-template-columns: 44px 1fr 110px 32px 32px 32px; gap: 6px; align-items: center; }
.stage-edit .icon-btn { width: 32px; height: 32px; }
.secret { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 8px; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row code { background: var(--surface); padding: 6px 10px; border-radius: 6px; overflow-wrap: anywhere; flex: 1; }
.snippet { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.snippet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.snippet pre { margin: 0; padding: 12px 14px; background: var(--sunk); border-radius: var(--radius-sm); overflow-x: auto; line-height: 1.55; }

/* ---------- Modal & toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(15, 22, 21, .45); display: grid; place-items: start center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); outline: none; }
.modal-wide { max-width: 680px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px 20px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 10px 20px 18px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: toast-in .18s ease-out; }
.toast-err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 480px) 1fr; }
.auth-card { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 10px; background: var(--surface); }
.auth-card h1 { font-size: 30px; }
.auth-card form { margin-top: 18px; }
.auth-foot { margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-side { background: var(--brand-panel); display: grid; place-items: center; padding: 48px; overflow: hidden; }
.auth-lanes { display: grid; grid-template-columns: repeat(4, 150px); gap: 12px; transform: rotate(-4deg); }
.auth-lane { border-top: 4px solid var(--accent); background: rgba(255,255,255,.08); border-radius: 10px; padding: 12px; display: grid; gap: 8px; align-content: start; min-height: 320px; }
.auth-lane span { color: rgba(255,255,255,.85); font-weight: 700; font-size: 13px; }
.auth-lane i { display: block; height: 54px; border-radius: 7px; background: rgba(255,255,255,.14); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { display: none; }
  .ws { flex: 1; min-width: 0; }
  .nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .nav-link { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 4px; justify-content: center; }
  .side-foot { margin: 0; padding: 0; border: 0; }
  .me { display: none; }
  .page { padding: 20px 16px 96px; gap: 16px; }
  h1 { font-size: 22px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card { padding: 40px 20px; }
  .filters .input, .search { min-width: 0; max-width: none; flex: 1 1 140px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 10px 12px; border-bottom: 1px solid var(--line); position: relative; }
  .table td { padding: 2px 0; border: 0; }
  .table td.col-check { position: absolute; right: 8px; top: 10px; width: auto; }
  .table td[data-label="Added"], .table td[data-label="Source"] { display: inline-block; margin-right: 10px; font-size: 13px; color: var(--muted); }
  .board { grid-auto-columns: 82vw; }
  .stage-edit li { grid-template-columns: 40px 1fr 90px 30px 30px 30px; }
  .toasts { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Theme switch */
.theme-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); }
.theme-switch button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.auth-theme { position: absolute; top: 16px; right: 16px; }
.auth-card { position: relative; }
@media (max-width: 820px) { .side-theme { margin: 0; padding: 0; } .side-theme > span { display: none; } .side-theme .theme-switch button { width: 26px; } }
