/* AgileAtlas CRM — design system derived from the AgileAtlas UI kit:
   deep olive-charcoal surfaces, electric lime accent, Plus Jakarta Sans, soft 16px cards. */
:root {
  --bg: #0e100b; --bg-2: #12140e; --surface: #171a12; --surface-2: #1d2117; --surface-3: #252a1e;
  --border: rgba(236, 245, 210, .07); --border-strong: rgba(236, 245, 210, .14);
  --text: #f3f5ec; --text-2: #b9bdaf; --muted: #80857a; --faint: #5a5f54;
  --accent: #d1ef59; --accent-2: #b8d93c; --accent-ink: #16190c; --accent-soft: rgba(209, 239, 89, .12);
  --blue: #8db4ff; --purple: #b69cff; --coral: #ff8a65; --green: #5fd4a8; --amber: #f5c25b; --red: #ff6b6b; --pink: #f58fc8;
  --hot: #ff7a59; --warm: #f5c25b; --cold: #7fb2ff;
  --radius: 16px; --radius-sm: 10px; --radius-xs: 7px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -12px rgba(0,0,0,.55);
  --shadow-pop: 0 24px 60px -12px rgba(0,0,0,.7), 0 0 0 1px var(--border-strong);
  --sidebar: 248px; --topbar: 64px;
  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #f3f4ef; --bg-2: #eceee6; --surface: #ffffff; --surface-2: #f6f7f2; --surface-3: #eceee5;
  --border: rgba(22, 25, 12, .08); --border-strong: rgba(22, 25, 12, .16);
  --text: #16190c; --text-2: #3d4234; --muted: #6d7264; --faint: #a3a79a;
  --accent: #16190c; --accent-2: #2b301f; --accent-ink: #d1ef59; --accent-soft: rgba(150, 190, 20, .16);
  --shadow: 0 1px 2px rgba(22,25,12,.04), 0 8px 24px -12px rgba(22,25,12,.12);
  --shadow-pop: 0 24px 60px -16px rgba(22,25,12,.25), 0 0 0 1px var(--border-strong);
  color-scheme: light;
}
[data-theme='light'] .lime { --accent: #c3e33f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.num, .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); background: var(--bg-2); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 0 0 4px var(--accent-soft); }
[data-theme='light'] .brand-mark { background: #16190c; color: #d1ef59; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
[data-theme='light'] .nav a.active::before { background: #9cc21c; }
.nav a .icon { opacity: .85; }
.nav a.active .icon { color: var(--accent); opacity: 1; }
[data-theme='light'] .nav a.active .icon { color: #16190c; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.nav .count.alert { background: rgba(255,107,107,.15); color: var(--red); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.promo { padding: 14px; border-radius: 14px; background: linear-gradient(140deg, var(--accent-soft), transparent 70%), var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.promo b { color: var(--text); display: block; font-size: 13px; margin-bottom: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.me:hover { background: var(--surface); }
.me .meta { min-width: 0; flex: 1; } .me .meta b { display: block; font-size: 13px; } .me .meta span { font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 25; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.topbar .crumb { color: var(--muted); font-weight: 500; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(380px, 40vw); height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: text; transition: border-color .15s; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd, kbd { margin-left: auto; font-family: inherit; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.content { padding: 24px 28px 64px; max-width: 1600px; width: 100%; margin: 0 auto; animation: page-in .35s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.menu-btn { display: none; }

/* ---------- Primitives ---------- */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; } .icon.xs { width: 13px; height: 13px; } .icon.lg { width: 22px; height: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; user-select: none; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: rgba(255,107,107,.12); color: var(--red); border-color: rgba(255,107,107,.25); }
.btn.sm { height: 31px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.icon-only { width: 38px; padding: 0; } .btn.sm.icon-only { width: 31px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 20px 18px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; } .muted { color: var(--muted); } .faint { color: var(--faint); } .text-2 { color: var(--text-2); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.bold { font-weight: 700; } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mt-0 { margin-top: 0; } .mb-16 { margin-bottom: 16px; } .mb-8 { margin-bottom: 8px; } .mt-16 { margin-top: 16px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* Badges & pills */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.hot { background: rgba(255,122,89,.14); color: var(--hot); } .badge.warm { background: rgba(245,194,91,.14); color: var(--warm); }
.badge.cold { background: rgba(127,178,255,.14); color: var(--cold); } .badge.unqualified { background: var(--surface-3); color: var(--muted); }
.badge.lime { background: var(--accent-soft); color: var(--accent); } [data-theme='light'] .badge.lime { color: #4d6400; }
.badge.green { background: rgba(95,212,168,.14); color: var(--green); } .badge.red { background: rgba(255,107,107,.14); color: var(--red); }
.badge.blue { background: rgba(141,180,255,.14); color: var(--blue); } .badge.purple { background: rgba(182,156,255,.14); color: var(--purple); }
.badge.amber { background: rgba(245,194,91,.14); color: var(--amber); } .badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.badge.ai { background: linear-gradient(90deg, rgba(182,156,255,.18), rgba(141,180,255,.18)); color: var(--purple); }
.score { --v: 50; position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: conic-gradient(var(--c, var(--accent)) calc(var(--v) * 1%), var(--surface-3) 0); flex: none; }
.score::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; } .score.sm { width: 30px; height: 30px; font-size: 10.5px; }
.score.hot { --c: var(--hot); } .score.warm { --c: var(--warm); } .score.cold { --c: var(--cold); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; color: #16190c; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; } .avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; transition: transform .2s var(--ease), border-color .2s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi .label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .label .icon { width: 15px; height: 15px; }
.kpi .value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 99px; }
.delta.up { color: var(--green); background: rgba(95,212,168,.12); } .delta.down { color: var(--red); background: rgba(255,107,107,.12); } .delta.flat { color: var(--muted); background: var(--surface-3); }
.kpi.hero { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.kpi.hero .label, .kpi.hero .foot { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
[data-theme='light'] .kpi.hero { background: #16190c; color: #f3f5ec; } [data-theme='light'] .kpi.hero .label, [data-theme='light'] .kpi.hero .foot { color: #b9bdaf; }
[data-theme='light'] .kpi.hero .value { color: #d1ef59; }
.kpi .spark { position: absolute; right: 10px; bottom: 10px; width: 78px; height: 30px; opacity: .9; }
.kpi.link { cursor: pointer; }

/* Command center (3 questions) */
.command { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 16px; }
.q-card .q { display: flex; align-items: center; gap: 10px; }
.q-card .q .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12px; }
[data-theme='light'] .q-card .q .n { color: #4d6400; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .main-col { min-width: 0; flex: 1; } .list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .list-item .meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
a.list-item:hover .title { color: var(--accent); } [data-theme='light'] a.list-item:hover .title { text-decoration: underline; color: inherit; }
.quick { display: flex; gap: 4px; }
.quick .btn { opacity: .8; } .list-item:hover .quick .btn { opacity: 1; }
.money-big { font-size: 32px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--accent); transition: width .8s var(--ease); }
[data-theme='light'] .bar-fill { background: #9cc21c; }
.progress { display: flex; align-items: center; gap: 8px; } .progress .bar-track { flex: 1; min-width: 60px; height: 6px; } .progress span { font-size: 12px; font-weight: 700; width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Segmented, tabs, inputs ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 11px; border: 0; background: transparent; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.seg button.on.lime { background: var(--accent); color: var(--accent-ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; position: relative; white-space: nowrap; }
.tabs button.on { color: var(--text); } .tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
[data-theme='light'] .tabs button.on::after { background: #16190c; }
.tabs .count { margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--surface-3); }
.input, .select, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 13.5px; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 30px; background-image: 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='%2380857a' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input.sm, .select.sm { height: 32px; font-size: 12.5px; border-radius: 9px; }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; } .form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; grid-column: 1 / -1; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); user-select: none; transition: border-color .15s, background .15s; font-size: 13px; }
.check:hover { border-color: var(--border-strong); }
.check input { appearance: none; width: 17px; height: 17px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; margin: 0; flex: none; transition: background .15s; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px); }
.check.on { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.check .ts { margin-left: auto; font-size: 11px; color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all .15s; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
[data-theme='light'] .chip.on { color: #3d5000; }
.chip .x { opacity: .6; } .chip .x:hover { opacity: 1; }

/* ---------- Tables ---------- */
.filters { position: sticky; top: var(--topbar); z-index: 15; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 0; background: var(--bg); }
.filters .input { width: 260px; }
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); max-height: calc(100vh - 220px); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.t th.sortable { cursor: pointer; } .t th.sortable:hover { color: var(--text); } .t th.sorted { color: var(--text); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.t tbody tr { transition: background .12s; cursor: pointer; }
.t tbody tr:hover { background: var(--surface-2); }
.t tbody tr.selected { background: var(--accent-soft); }
.t td.sticky, .t th.sticky { position: sticky; left: 0; background: inherit; z-index: 1; }
.t th.sticky { z-index: 3; background: var(--surface-2); }
.t tbody tr td.sticky { background: var(--surface); } .t tbody tr:hover td.sticky { background: var(--surface-2); }
.t .biz { display: flex; align-items: center; gap: 10px; min-width: 220px; } .t .biz b { font-weight: 600; display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; } .t .biz span { font-size: 11.5px; color: var(--muted); }
.t input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 4px; color: var(--muted); font-size: 12.5px; }
.contact-icons { display: inline-flex; gap: 4px; }
.ci { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); transition: background .15s, color .15s; }
.ci:hover { background: var(--accent); color: var(--accent-ink); } .ci.off { opacity: .25; pointer-events: none; }
.ci.wa:hover { background: #25d366; color: #fff; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: calc(100vh - 230px); scroll-snap-type: x proximity; }
.column { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 230px); scroll-snap-align: start; transition: background .15s, border-color .15s; }
.column.drop { border-color: var(--accent); background: var(--accent-soft); }
.column-head { padding: 12px 14px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.column-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.column-head b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.column-head .n { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 1px 7px; background: var(--surface-3); border-radius: 99px; }
.column-head .v { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.column-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.deal { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 12px; cursor: grab; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; position: relative; }
.deal:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.deal.dragging { opacity: .45; transform: rotate(2deg) scale(.98); }
.deal .top { display: flex; gap: 10px; align-items: flex-start; }
.deal .name { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.deal .loc { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.deal .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.deal .bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
.deal .val { margin-left: auto; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.deal .task { font-size: 12px; color: var(--text-2); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.deal .fu.overdue { color: var(--red); font-weight: 600; } .deal .fu.today { color: var(--amber); font-weight: 600; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .12s; white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); }
.chart .tip b { display: block; font-size: 13px; } .chart .tip .r { display: flex; align-items: center; gap: 6px; color: var(--text-2); } .chart .tip .sw { width: 8px; height: 8px; border-radius: 3px; }
.chart .bar { transition: opacity .15s; } .chart:hover .bar { opacity: .55; } .chart .bar:hover { opacity: 1; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .grow { transform-origin: bottom; animation: grow .7s var(--ease) both; transform-box: fill-box; }
@keyframes grow { from { transform: scaleY(0); } }
.chart .fade { animation: fade .8s ease both; } @keyframes fade { from { opacity: 0; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 5px; } .hbar .top b { font-variant-numeric: tabular-nums; }
.hbar .bar-track { height: 7px; } .hbar .bar-fill { animation: widen .9s var(--ease) both; } @keyframes widen { from { width: 0 !important; } }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 74px; align-items: center; gap: 12px; font-size: 12.5px; }
.funnel-row .track { height: 30px; border-radius: 9px; background: var(--surface-2); position: relative; overflow: hidden; }
.funnel-row .fill { position: absolute; inset: 0 auto 0 0; border-radius: 9px; display: flex; align-items: center; padding-left: 10px; font-weight: 800; color: var(--accent-ink); animation: widen 1s var(--ease) both; min-width: 34px; }
.funnel-row .pct { text-align: right; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 18px; } .donut-wrap .legend { flex-direction: column; gap: 8px; flex: 1; } .donut-wrap .legend span { justify-content: space-between; display: flex; } .donut-wrap .legend b { font-variant-numeric: tabular-nums; }
.rates { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.rate { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.rate .v { font-size: 22px; font-weight: 800; letter-spacing: -.03em; } .rate .l { font-size: 11.5px; color: var(--muted); }
.rate .bar-track { height: 4px; margin-top: 8px; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(5,6,4,.55); backdrop-filter: blur(3px); animation: fade .18s ease; display: flex; }
.modal { margin: auto; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop); animation: pop .22s var(--ease); }
.modal.wide { width: min(920px, calc(100vw - 32px)); } .modal.narrow { width: min(440px, calc(100vw - 32px)); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; } .modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 22px; } .modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.drawer { margin-left: auto; width: min(720px, 100vw); height: 100%; background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide .28s var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: flex-start; }
.drawer-body { padding: 18px 22px 40px; overflow-y: auto; flex: 1; }
.palette { margin: 10vh auto auto; width: min(640px, calc(100vw - 24px)); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .18s var(--ease); }
.palette .in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette input { flex: 1; height: 56px; border: 0; background: transparent; outline: none; font-size: 16px; }
.palette .res { max-height: 56vh; overflow: auto; padding: 8px; }
.palette .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 10px 10px 4px; font-weight: 700; }
.palette a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.palette a.on, .palette a:hover { background: var(--surface-2); }
.palette a .t { font-weight: 600; } .palette a .s { font-size: 12px; color: var(--muted); }
.palette .ty { margin-left: auto; }
.popover { position: fixed; z-index: 90; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; min-width: 200px; animation: pop .15s var(--ease); max-height: 70vh; overflow: auto; }
.popover .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 13px; }
.popover .mi:hover { background: var(--surface-2); }
.notif-panel { width: 380px; padding: 0; }
.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif:hover { background: var(--surface-2); } .notif.unread { background: linear-gradient(90deg, var(--accent-soft), transparent 50%); }
.notif .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; flex: none; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); animation: toast-in .3s var(--ease); font-weight: 500; }
.toast.out { animation: toast-out .25s ease forwards; } .toast .ic { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast.ok .ic { background: var(--accent); color: var(--accent-ink); } .toast.err .ic { background: rgba(255,107,107,.18); color: var(--red); }
.toast .act { margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } } @keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* Skeleton & empty */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%); background-size: 300% 100%; animation: shimmer 1.3s infinite linear; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .art { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
[data-theme='light'] .empty .art { color: #4d6400; }
.empty h4 { color: var(--text); margin: 0 0 4px; font-size: 15px; } .empty p { margin: 0 0 14px; font-size: 13px; }
.empty.compact { padding: 18px 10px; } .empty.compact .art { width: 40px; height: 40px; border-radius: 12px; }

/* Timeline (client journey) */
.journey { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0; position: relative; padding-top: 6px; }
.journey .step { position: relative; text-align: center; padding: 0 2px; }
.journey .step::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--surface-3); }
.journey .step:first-child::before { display: none; }
.journey .step.done::before { background: var(--accent); } [data-theme='light'] .journey .step.done::before { background: #9cc21c; }
.journey .node { position: relative; z-index: 1; width: 28px; height: 28px; margin: 0 auto 8px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); border: 3px solid var(--surface); transition: transform .2s; }
.journey .step.done .node { background: var(--accent); color: var(--accent-ink); } [data-theme='light'] .journey .step.done .node { background: #16190c; color: #d1ef59; }
.journey .step.current .node { box-shadow: 0 0 0 5px var(--accent-soft); transform: scale(1.1); }
.journey .lbl { font-size: 11.5px; font-weight: 600; line-height: 1.25; } .journey .at { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; position: relative; padding-bottom: 16px; }
.feed-item::before { content: ''; position: absolute; left: 16px; top: 32px; bottom: 0; width: 1px; background: var(--border-strong); }
.feed-item:last-child::before { display: none; }
.feed-item .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }
.feed-item .body { padding-top: 5px; min-width: 0; } .feed-item .body .h { font-weight: 600; font-size: 13px; } .feed-item .body .m { font-size: 12px; color: var(--muted); }
.feed-item .body .txt { margin-top: 6px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.note-card { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.note-card.pinned { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.note-card .meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.note-card .txt { white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); transition: background .12s; }
.task-row:hover { background: var(--surface-2); } .task-row:last-child { border-bottom: 0; }
.task-row .tick { width: 20px; height: 20px; border-radius: 7px; border: 1.8px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; flex: none; background: none; padding: 0; transition: all .15s; color: transparent; }
.task-row .tick:hover { border-color: var(--accent); color: var(--accent); }
.task-row.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.task-row.done .ttl { text-decoration: line-through; color: var(--muted); }
.task-row .ttl { font-weight: 600; } .task-row .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.prio { width: 8px; height: 8px; border-radius: 3px; flex: none; } .prio.urgent { background: var(--red); } .prio.high { background: var(--coral); } .prio.medium { background: var(--amber); } .prio.low { background: var(--faint); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(800px 500px at 20% 10%, rgba(209,239,89,.16), transparent 60%), #0b0d08; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #f3f5ec; }
.login-art h1 { font-size: 46px; line-height: 1.05; letter-spacing: -.04em; margin: 0; max-width: 520px; } .login-art h1 em { font-style: normal; color: #d1ef59; }
.login-art .pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.login-art .pills span { padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(209,239,89,.35); color: #e5f3b0; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-form h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; max-width: 520px; }
.mini-stats div { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); } .mini-stats b { display: block; font-size: 22px; color: #d1ef59; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 28px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; word-break: break-all; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; }
.fab { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .command { grid-template-columns: 1fr 1fr; } .command > :first-child { grid-column: span 2; } .rates { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .cols-3, .cols-2 { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; }
  .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; } .content { padding: 16px 14px 90px; }
  .search-trigger { width: auto; flex: 1; } .search-trigger kbd, .search-trigger .lbl { display: none; }
  .command { grid-template-columns: 1fr; } .command > :first-child { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .kpi .value { font-size: 20px; } .kpi .spark { display: none; }
  .form-grid { grid-template-columns: 1fr; } .rates { grid-template-columns: repeat(2, 1fr); } .cols-4 { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr; gap: 10px; } .journey .step { display: flex; align-items: center; gap: 10px; text-align: left; } .journey .step::before { display: none; } .journey .node { margin: 0; }
  .filters .input { width: 100%; } .page-head h2 { font-size: 22px; } .topbar h1 .crumb { display: none; }
  .drawer { width: 100vw; } .notif-panel { width: calc(100vw - 20px); }
  .fab { display: grid; position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); place-items: center; z-index: 40; box-shadow: 0 12px 30px -8px rgba(0,0,0,.6); border: 0; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
