/* BK Nexus CRM — interface styles */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --ink: #0f1b2b;
  --ink-2: #4a5568;
  --muted: #7c8696;
  --line: #e3e7ee;
  --line-2: #d3d9e2;
  --brand: #0e2238;
  --brand-2: #16324f;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: #e8f1fc;
  --good: #0a7d0a;
  --good-wash: #e6f4e6;
  --warn: #9a6400;
  --warn-wash: #fdf3dc;
  --bad: #c03030;
  --bad-wash: #fbe9e9;
  --violet: #6250d6;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #2a78d6; --seq-6: #1c5cab; --seq-7: #104281;
  --shadow: 0 1px 2px rgba(15, 27, 43, .06), 0 1px 1px rgba(15, 27, 43, .04);
  --shadow-lg: 0 18px 50px rgba(15, 27, 43, .18);
  --radius: 10px;
  --font: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1117; --surface: #151b23; --surface-2: #19202a; --surface-3: #212a36;
    --ink: #e8edf3; --ink-2: #b4bfcc; --muted: #8692a2; --line: #26303d; --line-2: #33404f;
    --brand: #0a1828; --brand-2: #12263d; --accent: #4b97ec; --accent-ink: #8cbcf3; --accent-wash: #16304d;
    --good: #3fbf3f; --good-wash: #12301a; --warn: #f0b429; --warn-wash: #3a2e10; --bad: #f07070; --bad-wash: #3d1a1a; --violet: #9085e9;
    --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #256abf; --seq-4: #2a78d6; --seq-5: #3987e5; --seq-6: #6da7ec; --seq-7: #9ec5f4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117; --surface: #151b23; --surface-2: #19202a; --surface-3: #212a36;
  --ink: #e8edf3; --ink-2: #b4bfcc; --muted: #8692a2; --line: #26303d; --line-2: #33404f;
  --brand: #0a1828; --brand-2: #12263d; --accent: #4b97ec; --accent-ink: #8cbcf3; --accent-wash: #16304d;
  --good: #3fbf3f; --good-wash: #12301a; --warn: #f0b429; --warn-wash: #3a2e10; --bad: #f07070; --bad-wash: #3d1a1a; --violet: #9085e9;
  --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #256abf; --seq-4: #2a78d6; --seq-5: #3987e5; --seq-6: #6da7ec; --seq-7: #9ec5f4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* boot */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.boot-mark { width: 52px; height: 52px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 20px; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #c9d5e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.brand b { font-size: 15px; letter-spacing: .2px; display: block; }
.brand span { font-size: 11px; color: #8fa3ba; letter-spacing: .4px; text-transform: uppercase; }
.nav { padding: 6px 10px; display: grid; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #6f86a0; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c9d5e3; font-weight: 700; font-size: 13.5px; }
.nav a:hover { background: var(--brand-2); color: #fff; text-decoration: none; }
.nav a.on { background: #fff; color: var(--brand); }
.nav a .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2a78d6; color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 12px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 11.5px; color: #8fa3ba; }
.side-foot button { background: none; border: 0; color: #8fa3ba; cursor: pointer; padding: 6px; border-radius: 6px; }
.side-foot button:hover { color: #fff; background: var(--brand-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 19px; margin: 0; font-weight: 900; letter-spacing: -.2px; }
.top .sub { color: var(--muted); font-size: 12.5px; }
.top .spacer { flex: 1; }
.menu-btn { display: none; }
.search-box { position: relative; width: min(360px, 40vw); }
.search-box input[type=search] { width: 100%; padding: 8px 12px 8px 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); }
.search-box svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search-box kbd { position: absolute; right: 8px; top: 7px; font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; background: var(--surface); font-family: inherit; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; z-index: 50; }
.search-results .sr { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.search-results .sr:hover, .search-results .sr.on { background: var(--accent-wash); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 7px; padding: 5px; cursor: pointer; color: var(--ink-2); display: inline-flex; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); min-height: 36px;
}
textarea { min-height: 84px; resize: vertical; }
select { padding-right: 28px; }
label.f { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
label.f > span em { font-style: normal; color: var(--bad); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 900; }
.card-h .sub { color: var(--muted); font-size: 12px; }
.card-h .r { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 14px 18px 18px; }
.cards { display: grid; gap: 16px; }
.cards > * { min-width: 0; }
.c-2 { grid-template-columns: 1fr 1fr; }
.c-3 { grid-template-columns: repeat(3, 1fr); }
.c-21 { grid-template-columns: 1.6fr 1fr; }
.c-12 { grid-template-columns: 1fr 1.6fr; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; cursor: pointer; transition: border-color .15s; }
.kpi:hover { border-color: var(--accent); }
.kpi .l { font-size: 12px; color: var(--ink-2); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 900; letter-spacing: -.5px; margin: 6px 0 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi .s b { color: var(--ink-2); }
.kpi.alert .v { color: var(--bad); }

/* pills & badges */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 900; display: inline-grid; place-items: center; }
.badge.soft { background: rgba(255, 255, 255, .14); color: #fff; }
.st-New { background: var(--surface-3); color: var(--ink-2); }
.st-Researching { background: #eef0ff; color: #4636b0; }
.st-Contacted { background: var(--accent-wash); color: var(--accent-ink); }
.st-Replied { background: #e3f6f1; color: #0b7a55; }
.st-Meeting { background: #fff2e6; color: #a34a00; }
.st-Sampling { background: #fdeef5; color: #a3285a; }
.st-Quotation { background: #fff7db; color: #8a5a00; }
.st-Won { background: var(--good-wash); color: var(--good); }
.st-Nurture { background: var(--surface-3); color: var(--muted); }
.st-Lost { background: var(--bad-wash); color: var(--bad); }
:root[data-theme="dark"] [class*="st-"]:not(.st-New):not(.st-Nurture) { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [class*="st-"]:not(.st-New):not(.st-Nurture) { background: var(--surface-3); } }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tier { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 900; color: #fff; }
.tier-A { background: #104281; } .tier-B { background: #2a78d6; } .tier-C { background: #6da7ec; color: #0d2a4f; } .tier-D { background: var(--surface-3); color: var(--muted); }
.flag { font-size: 11px; font-weight: 700; color: var(--muted); }
.status-bad { color: var(--bad); font-weight: 700; }
.status-warn { color: var(--warn); font-weight: 700; }
.status-good { color: var(--good); font-weight: 700; }

/* charts */
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 64px; gap: 10px; align-items: center; font-size: 12.5px; cursor: default; }
.bar-row.click { cursor: pointer; }
.bar-row.click:hover .bar-l { color: var(--accent-ink); }
.bar-l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.bar-t { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; position: relative; }
.bar-f { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; transition: width .4s ease; }
.bar-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.funnel .bar-t { height: 22px; }
.vchart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; border-bottom: 1px solid var(--line-2); position: relative; }
.vchart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.vchart .col .f { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.vchart .col:hover .f { filter: brightness(1.1); }
.vchart-x { display: flex; gap: 4px; font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.vchart-x span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.tip { position: fixed; z-index: 200; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 9px; border-radius: 6px; font-size: 12px; box-shadow: var(--shadow-lg); max-width: 260px; }
.stack { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; }
.stack > div { height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.empty-chart { color: var(--muted); font-size: 13px; padding: 26px 0; text-align: center; }

/* lists */
.list { display: grid; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.li:last-child { border-bottom: 0; }
.li:hover .li-t { color: var(--accent-ink); }
.li-main { min-width: 0; flex: 1; }
.li-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.t th.sort { cursor: pointer; user-select: none; }
table.t th.sort:hover { color: var(--ink); }
table.t th.on { color: var(--accent-ink); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr.sel td { background: var(--accent-wash); }
table.t td.r, table.t th.r { text-align: right; }
.co-name { font-weight: 700; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.ic-row { display: flex; gap: 6px; color: var(--muted); }
.ic-row .on { color: var(--accent-ink); }
.mini-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.mini-bar > div { height: 100%; background: var(--accent); border-radius: 3px; }

/* filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar select, .toolbar input { width: auto; min-width: 130px; min-height: 34px; padding: 6px 10px; font-size: 13px; }
.toolbar input[type=search] { min-width: 240px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.result-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.result-bar .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bulk { background: var(--accent-wash); }
.bulk select { width: auto; min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }

/* drawer */
.overlay { position: fixed; inset: 0; background: rgba(9, 18, 30, .42); z-index: 80; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 90; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.dr-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 18px 22px 0; }
.dr-title { display: flex; gap: 12px; align-items: flex-start; }
.dr-title h2 { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.25; }
.dr-title .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.dr-title .x { margin-left: auto; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; align-items: center; }
.dr-actions select { width: auto; min-height: 32px; padding: 4px 28px 4px 10px; font-size: 13px; font-weight: 700; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-size: 13px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab .n { font-size: 11px; background: var(--surface-3); border-radius: 8px; padding: 1px 6px; margin-left: 4px; color: var(--ink-2); }
.dr-body { flex: 1; overflow: auto; padding: 18px 22px 40px; }
.section { margin-bottom: 18px; }
.section h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; word-break: break-word; }
.reason { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.reason .p { font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.reason .p.neg { color: var(--bad); }
.timeline { position: relative; }
.tl { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl::before { content: ''; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .ch-ico { width: 34px; height: 34px; }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.tl-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tl-h b { color: var(--ink); }
.tl-note { white-space: pre-wrap; margin-top: 6px; font-size: 13.5px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .chip { padding: 3px 10px; font-size: 12px; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; align-items: center; }
.form-foot .l { margin-right: auto; }
.contact-card { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; align-items: flex-start; }
.contact-card .avatar { background: var(--violet); }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(9, 18, 30, .45); animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(880px, 100%); }
.modal-h { display: flex; align-items: center; padding: 18px 22px 6px; }
.modal-h h3 { margin: 0; font-size: 17px; font-weight: 900; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 12px 22px 22px; }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.lane { background: var(--surface-3); border-radius: 12px; padding: 10px; min-height: 300px; }
.lane.drop { outline: 2px dashed var(--accent); background: var(--accent-wash); }
.lane-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.lane-h b { font-size: 13px; }
.lane-h .n { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 700; }
.lane-cards { display: grid; gap: 8px; max-height: calc(100vh - 260px); overflow-y: auto; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); }
.pcard:hover { border-color: var(--accent); }
.pcard.dragging { opacity: .5; }
.pcard .t { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.pcard .m { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }

/* tasks */
.task { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.done .task-t { text-decoration: line-through; color: var(--muted); }
.task-t { font-weight: 700; }
.task-s { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.circle { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: none; cursor: pointer; display: grid; place-items: center; color: transparent; padding: 0; }
.circle:hover { border-color: var(--good); color: var(--good); }
.circle.on { background: var(--good); border-color: var(--good); color: #fff; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(59, 142, 232, .18); }
.auth-art h1 { font-size: 38px; line-height: 1.15; margin: 0 0 14px; font-weight: 900; letter-spacing: -.6px; max-width: 520px; }
.auth-art p { color: #a9bbd0; max-width: 460px; font-size: 15px; }
.auth-stats { display: flex; gap: 34px; position: relative; z-index: 1; }
.auth-stats b { display: block; font-size: 26px; font-weight: 900; }
.auth-stats span { color: #8fa3ba; font-size: 12.5px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form form { width: min(380px, 100%); display: grid; gap: 14px; }
.auth-form h2 { margin: 0; font-size: 24px; font-weight: 900; }
.err { background: var(--bad-wash); color: var(--bad); padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.note { background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); }
.note.info { background: var(--accent-wash); border-color: transparent; color: var(--accent-ink); }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 9px; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-lg); animation: fade .2s; display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--bad); color: #fff; }

/* import */
.drop-zone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 34px; text-align: center; color: var(--ink-2); cursor: pointer; background: var(--surface-2); }
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-wash); }
.map-grid { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 8px 10px; align-items: center; font-size: 13px; }
.progress { height: 10px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.steps { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 5px 12px; border-radius: 999px; background: var(--surface-3); }
.steps span.on { background: var(--accent); color: #fff; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
pre { background: var(--surface-3); padding: 12px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }

/* responsive */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .c-2, .c-3, .c-21, .c-12 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 100; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .search-box { order: 5; width: 100%; }
  .content { padding: 16px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 22px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; min-height: 260px; }
  .auth-art h1 { font-size: 28px; }
  .bar-row { grid-template-columns: 96px 1fr 52px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .dr-head, .dr-body { padding-left: 16px; padding-right: 16px; }
  .toolbar input[type=search] { min-width: 0; width: 100%; }
  .toolbar select { flex: 1 1 140px; }
  .hide-m { display: none; }
}

/* brand & people */
.brand-plate { display: flex; flex-direction: column; gap: 6px; margin: 14px 12px 8px; padding: 12px 14px 10px; background: #fff; border-radius: 12px; text-decoration: none; }
.brand-plate:hover { text-decoration: none; }
.brand-plate span { font-size: 10.5px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; color: #5b6b80; }
.auth-art .brand-plate { margin: 0; padding: 16px 20px 12px; }
img.avatar { display: block; border-radius: 50%; background: #dfe5ee; }
.side-foot a { color: inherit; text-decoration: none; }
.side-foot .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.side-foot .who b { letter-spacing: .3px; }
.quick-add { display: grid; grid-template-columns: 1.3fr 1.1fr 1.2fr 1.1fr .9fr .9fr 1.2fr auto; gap: 6px; align-items: center; }
.quick-add input, .quick-add select { min-height: 34px; padding: 6px 9px; font-size: 13px; }
@media (max-width: 1100px) { .quick-add { grid-template-columns: 1fr 1fr; } .quick-add .btn { grid-column: span 2; } }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--good); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync.saving { color: var(--warn); }
.sync.error { color: var(--bad); }
.sync.local { color: var(--muted); }
