/* ==========================================================================
   LeadPilot design system
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-glow: radial-gradient(1100px 520px at 70% -12%, rgba(124, 108, 255, 0.13), transparent 60%),
    radial-gradient(800px 420px at -10% 10%, rgba(79, 140, 255, 0.07), transparent 60%);
  --surface: #0d0f14;
  --surface-2: #12151c;
  --surface-3: #191d26;
  --surface-hover: #161a22;
  --glass: rgba(18, 21, 28, 0.72);
  --line: rgba(255, 255, 255, 0.065);
  --line-strong: rgba(255, 255, 255, 0.11);
  --text: #f3f4f8;
  --text-2: #b3b9c8;
  --muted: #737b8f;
  --faint: #4b5163;
  --brand: #8b7cff;
  --brand-2: #4f8cff;
  --brand-ink: #b8afff;
  --brand-grad: linear-gradient(135deg, #8b7cff 0%, #5b8cff 100%);
  --brand-soft: rgba(139, 124, 255, 0.13);
  --brand-line: rgba(139, 124, 255, 0.35);
  --series-1: #3987e5;
  --series-2: #d95926;
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 80px -16px rgba(0, 0, 0, 0.7);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 252px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-glow: radial-gradient(1100px 520px at 70% -12%, rgba(124, 108, 255, 0.1), transparent 60%),
    radial-gradient(800px 420px at -10% 10%, rgba(79, 140, 255, 0.06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eff1f6;
  --surface-hover: #f4f5f9;
  --glass: rgba(255, 255, 255, 0.78);
  --line: rgba(15, 23, 42, 0.07);
  --line-strong: rgba(15, 23, 42, 0.12);
  --text: #0c1020;
  --text-2: #424a5e;
  --muted: #6b7286;
  --faint: #a3a9b8;
  --brand: #6d5dfc;
  --brand-ink: #5b4be8;
  --brand-soft: rgba(109, 93, 252, 0.09);
  --brand-line: rgba(109, 93, 252, 0.3);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --good: #059669;
  --good-soft: rgba(5, 150, 105, 0.09);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.1);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, 0.08);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 64px -16px rgba(15, 23, 42, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 "Geist", Inter, system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
code, kbd, .mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
::selection { background: var(--brand-soft); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.error { color: var(--bad); min-height: 1em; margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; font-weight: 600; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); font-size: 11px; }

/* Icons ------------------------------------------------------------------- */
.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 14px; height: 14px; }
.i.lg { width: 20px; height: 20px; }

/* Brand ------------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -0.02em; }
.brand.big { font-size: 20px; }
.brand-mark { position: relative; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-grad); box-shadow: 0 6px 20px -4px rgba(124, 108, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25); flex: none; }
.brand-mark::after { content: ""; position: absolute; left: 8px; top: 9px; width: 12px; height: 12px; border: 2.5px solid #fff; border-right: 0; border-bottom: 0; transform: rotate(45deg) translate(2px, 2px); border-radius: 2px 0 0 0; }

/* Login ------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 500px at 50% -10%, rgba(124, 108, 255, 0.28), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 34px; background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow-lg); display: grid; gap: 20px; animation: rise 0.5s var(--ease); }
.login-title { font-size: 24px; letter-spacing: -0.03em; margin-bottom: 4px; }
.login-card p { margin: 0; }

/* Shell ------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(16px); z-index: 30; }
.sidebar .brand { padding: 2px 8px; }
.search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-2); }
.search-trigger kbd { margin-left: auto; }
.nav { display: grid; gap: 1px; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav a .i { color: var(--muted); transition: color 0.15s; }
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--text); }
.nav a.active .i { color: var(--brand-ink); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-grad); }
.nav-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-count:empty { display: none; }
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.autopilot { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.ap-top { display: flex; align-items: center; gap: 10px; }
.ap-orb { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); color: var(--muted); flex: none; }
.ap-orb.on { background: var(--brand-grad); color: #fff; box-shadow: 0 0 0 0 rgba(139, 124, 255, 0.5); animation: halo 2.4s infinite; }
.ap-text { display: grid; min-width: 0; line-height: 1.3; }
.ap-text strong { font-size: 13px; }
.ap-text span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-row { display: flex; gap: 6px; padding: 0 2px; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.crumbs h1 { font-size: 17px; white-space: nowrap; }
.crumbs span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu { display: none; }
.view > * { min-width: 0; }
.view { padding: 28px 32px 80px; display: grid; gap: 22px; width: 100%; max-width: 1440px; margin: 0 auto; animation: fade 0.25s var(--ease); }

/* Controls ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s; }
.btn:hover { background: var(--surface-3); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px rgba(124, 108, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.success { color: var(--good); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn.lg { height: 42px; font-size: 14.5px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--line); }
.switch { position: relative; width: 36px; height: 21px; flex: none; margin-left: auto; border-radius: 999px; border: 0; background: var(--surface-3); cursor: pointer; transition: background 0.2s; box-shadow: inset 0 0 0 1px var(--line-strong); }
.switch span { position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.switch[aria-checked="true"] { background: var(--brand-grad); box-shadow: none; }
.switch[aria-checked="true"] span { transform: translateX(15px); }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--surface); }
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; 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='%23737b8f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--brand); cursor: pointer; }
input[type="color"] { height: 38px; padding: 4px; cursor: pointer; }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap > .i { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.select-wrap select { padding-left: 34px; min-width: 210px; height: 34px; padding-top: 0; padding-bottom: 0; }
label.field { display: grid; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 550; min-width: 0; }
label.field .hint { color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; line-height: 1.45; }
.check input { margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { display: grid; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > header h3 { font-size: 14px; }
.form-section > header p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

/* Cards ------------------------------------------------------------------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-width: 0; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card.flush .card-head { padding: 18px 20px 0; }
.grid { display: grid; gap: 22px; }
.grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; letter-spacing: -0.035em; font-weight: 650; }
.page-head p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; max-width: 720px; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--brand-ink); letter-spacing: 0.02em; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }

/* KPI tiles --------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 14px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.kpi .label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi .label .i { color: var(--faint); }
.kpi .value { font-size: 30px; font-weight: 650; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-height: 20px; }
.kpi .spark { position: absolute; right: 14px; top: 46px; width: 96px; height: 34px; opacity: 0.95; }
.kpi.hero { background: linear-gradient(160deg, rgba(139, 124, 255, 0.16), rgba(79, 140, 255, 0.04) 60%), var(--surface); border-color: var(--brand-line); }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 5px; border-radius: 999px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); background: var(--good-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--surface-3); }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.mini-stats > div { background: var(--surface); padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.mini-stats .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); flex: none; }
.mini-stats b { display: block; font-size: 18px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12px; color: var(--muted); }

/* Funnel ------------------------------------------------------------------ */
.funnel { display: grid; gap: 6px; }
.stage { display: grid; grid-template-columns: 112px minmax(0, 1fr) 56px; align-items: center; gap: 12px; font-size: 13px; }
.stage .bar { height: 30px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.stage .bar span { display: block; height: 100%; min-width: 4px; border-radius: 8px; background: var(--brand-grad); opacity: var(--o, 1); transition: width 0.8s var(--ease); }
.stage .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-conv { margin-left: 124px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* Charts ------------------------------------------------------------------ */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: "Geist", sans-serif; }
.chart .s1 { stroke: var(--series-1); fill: none; stroke-width: 2; }
.chart .s2 { stroke: var(--series-2); fill: none; stroke-width: 2; }
.chart .crosshair { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .d1 { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .d2 { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.chart .direct { font-size: 11.5px; font-weight: 600; fill: var(--text-2); font-family: "Geist", sans-serif; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.hbar { display: grid; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 80px; gap: 12px; align-items: center; font-size: 13px; }
.hbar-row .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--surface-3); }
.hbar-track span { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar-row .n { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; box-shadow: var(--shadow-lg); min-width: 140px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.tooltip .t-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

/* Lists & tables ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; z-index: 1; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; transition: background 0.12s; }
tr.click:hover td { background: var(--surface-hover); }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who > div { min-width: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; font-weight: 650; font-size: 12.5px; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 70% 60%), hsl(calc(var(--h) + 40) 70% 48%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); letter-spacing: 0.02em; }
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.avatar.xl { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; border-radius: 10px; margin: 0 -10px; padding: 11px 10px; border-bottom-color: transparent; }
.list-item.click:hover { background: var(--surface-hover); }
.list-item .right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }

/* Pills, badges, score ---------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; text-transform: capitalize; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill.plain::before { display: none; }
.pill.good, .pill.delivered, .pill.won, .pill.accepted { background: var(--good-soft); color: var(--good); }
.pill.warn, .pill.warm, .pill.paused { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.hot, .pill.disqualified, .pill.opted_out, .pill.rejected { background: var(--bad-soft); color: var(--bad); }
.pill.info, .pill.nurturing, .pill.engaged { background: var(--info-soft); color: var(--info); }
.pill.brand, .pill.qualified, .pill.signal, .pill.active { background: var(--brand-soft); color: var(--brand-ink); }
.pill.cold, .pill.unresponsive, .pill.new, .pill.done { background: var(--surface-3); color: var(--muted); }
.source { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.source .i { color: var(--muted); }
.score { --c: var(--brand); position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; background: conic-gradient(var(--c) calc(var(--p) * 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.lg { width: 64px; height: 64px; font-size: 19px; }
.score.lg::before { inset: 5px; }
.temp { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.temp.hot { color: var(--bad); }
.temp.warm { color: var(--warn); }
.temp.cold { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 550; cursor: pointer; color: var(--text-2); transition: all 0.15s; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--text); }
.chip .c { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }

/* Attention panel --------------------------------------------------------- */
.attn { display: grid; gap: 8px; }
.attn a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color 0.15s, transform 0.15s; }
.attn a:hover { border-color: var(--line-strong); transform: translateX(2px); }
.attn .ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none; }
.attn .bad .ic, .attn a.bad .ic { background: var(--bad-soft); color: var(--bad); }
.attn a.warn .ic { background: var(--warn-soft); color: var(--warn); }
.attn a.info .ic { background: var(--info-soft); color: var(--info); }
.attn a.good .ic { background: var(--good-soft); color: var(--good); }
.attn b { display: block; font-size: 13px; font-weight: 600; }
.attn span.d { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.attn .chev { margin-left: auto; color: var(--faint); }
.all-clear { display: grid; place-items: center; gap: 8px; text-align: center; padding: 26px 10px; color: var(--muted); }
.all-clear .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--good-soft); color: var(--good); }

/* Feed -------------------------------------------------------------------- */
.feed { display: grid; max-height: 460px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.feed-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; font-size: 13px; }
.feed-item::before { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: -6px; width: 1px; background: var(--line); }
.feed-item:last-child::before { display: none; }
.feed-item .ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); color: var(--muted); }
.feed-item .ic.good { background: var(--good-soft); color: var(--good); }
.feed-item .ic.brand { background: var(--brand-soft); color: var(--brand-ink); }
.feed-item .ic.bad { background: var(--bad-soft); color: var(--bad); }
.feed-item .ic.warn { background: var(--warn-soft); color: var(--warn); }
.feed-item .txt { padding-top: 4px; line-height: 1.45; }
.feed-item .txt a:hover { color: var(--brand-ink); }
.feed-item .sub { color: var(--muted); font-size: 12px; }
.feed-item time { color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 5px; }

/* Leads: toolbar, kanban -------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 360px; }
.toolbar .search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 34px; height: 34px; }
.toolbar select { width: auto; height: 34px; padding-top: 0; padding-bottom: 0; }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: grid; gap: 8px; min-height: 120px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; font-weight: 600; font-size: 13px; }
.column-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.column-head .count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lead-card { display: grid; gap: 9px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.lead-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.lead-card .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lead-card .need { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.lead-card .bottom { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.lead-card .bottom .right { margin-left: auto; }
.column .empty-col { text-align: center; color: var(--faint); font-size: 12.5px; padding: 18px 0; }

/* Drawer ------------------------------------------------------------------ */
.drawer { position: fixed; inset: 0; z-index: 50; }
.backdrop { position: absolute; inset: 0; background: rgba(4, 5, 9, 0.55); backdrop-filter: blur(3px); animation: fade 0.2s; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(820px, 100%); background: var(--bg); border-left: 1px solid var(--line-strong); overflow-y: auto; box-shadow: var(--shadow-lg); animation: slide 0.28s var(--ease); }
.d-head { position: sticky; top: 0; z-index: 3; padding: 22px 28px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: grid; gap: 16px; }
.d-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.d-title h2 { font-size: 20px; letter-spacing: -0.025em; }
.d-title .meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.d-title .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: none; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 11px 12px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text-2); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.tab .c { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.d-body { padding: 24px 28px 40px; display: grid; gap: 20px; }
.summary { padding: 16px 18px; border-radius: 14px; background: linear-gradient(160deg, var(--brand-soft), transparent 70%), var(--surface); border: 1px solid var(--brand-line); font-size: 14.5px; line-height: 1.55; }
.summary .eyebrow { margin-bottom: 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.check-item { display: flex; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.check-item .ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--warn-soft); color: var(--warn); }
.check-item.ok .ic { background: var(--good-soft); color: var(--good); }
.check-item b { display: block; font-size: 12.5px; }
.check-item span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kv > div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.kv dt { font-size: 11.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kv dd { margin: 3px 0 0; font-size: 13.5px; word-break: break-word; }
.kv dd a { color: var(--brand-ink); }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 30px; gap: 12px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.bar-row .track { height: 6px; background: var(--surface-3); border-radius: 3px; }
.bar-row .track span { display: block; height: 100%; border-radius: 3px; background: var(--brand-grad); }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.convo { display: grid; gap: 10px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.bubble.in { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; justify-self: start; }
.bubble.out { background: linear-gradient(160deg, rgba(139, 124, 255, 0.2), rgba(79, 140, 255, 0.12)); border: 1px solid var(--brand-line); border-bottom-right-radius: 5px; justify-self: end; }
.bubble .meta { display: flex; gap: 6px; align-items: center; margin-top: 5px; font-size: 11px; color: var(--muted); }
.bubble.failed { border-color: var(--bad); }
.bubble a { color: var(--brand-ink); }
.composer { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.composer textarea { min-height: 42px; max-height: 160px; border: 0; background: transparent; box-shadow: none; padding: 8px; }
.composer textarea:focus { box-shadow: none; }
.menu-pop { position: absolute; z-index: 60; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); display: grid; animation: pop 0.14s var(--ease); }
.menu-pop button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.menu-pop button:hover { background: var(--surface-3); color: var(--text); }
.menu-pop button.danger { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Modal ------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xl); padding: 26px; box-shadow: var(--shadow-lg); display: grid; gap: 18px; animation: pop 0.22s var(--ease); }
.modal-card.wide { width: min(780px, 100%); }
.modal-card h2 { font-size: 19px; letter-spacing: -0.025em; }
.modal-card .lead-in { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.modal-actions .left { margin-right: auto; }
.steps { display: flex; gap: 8px; align-items: center; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.step .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 11.5px; }
.step.on { color: var(--text); }
.step.on .n { background: var(--brand-grad); border-color: transparent; color: #fff; }
.step.done .n { background: var(--good-soft); color: var(--good); border-color: transparent; }
.step-line { flex: 1; height: 1px; background: var(--line-strong); min-width: 12px; }
.dropzone { display: grid; place-items: center; gap: 6px; padding: 26px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: var(--surface-2); text-align: center; color: var(--muted); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--text-2); }
.dropzone .ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); color: var(--text-2); }

/* Command palette --------------------------------------------------------- */
.palette { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; padding: 12vh 16px 16px; }
.palette-card { position: relative; width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s var(--ease); align-self: flex-start; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; background: transparent; padding: 4px 0; font-size: 15.5px; box-shadow: none; }
.palette-input input:focus { box-shadow: none; background: transparent; }
.palette-results { overflow-y: auto; padding: 8px; }
.p-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.p-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.p-item .ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); color: var(--muted); flex: none; }
.p-item .sub { margin-left: auto; font-size: 12px; color: var(--muted); }
.p-item.sel { background: var(--brand-soft); color: var(--text); }
.p-item.sel .ic { color: var(--brand-ink); }
.p-empty { padding: 28px; text-align: center; color: var(--muted); }

/* Clients ----------------------------------------------------------------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.client-card { display: grid; gap: 16px; cursor: pointer; transition: border-color 0.15s, transform 0.2s var(--ease), box-shadow 0.2s; }
.client-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.client-card .top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client-card .top > div { min-width: 0; }
.client-card h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card .top .right { margin-left: auto; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row > div { padding: 10px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.stat-row b { display: block; font-size: 18px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 11.5px; color: var(--muted); }
.client-card .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.client-card .foot .right { margin-left: auto; }
.health { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); flex: none; }
.health.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.health.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.health.off { background: var(--faint); box-shadow: none; }
.hero-card { position: relative; overflow: hidden; padding: 0; }
.hero-banner { height: 84px; background: radial-gradient(500px 120px at 15% 0%, rgba(139, 124, 255, 0.45), transparent), radial-gradient(400px 140px at 85% 10%, rgba(79, 140, 255, 0.3), transparent), var(--surface-2); border-bottom: 1px solid var(--line); }
.hero-body { padding: 0 24px 0; display: grid; gap: 16px; }
.hero-id { display: flex; align-items: flex-end; gap: 16px; margin-top: -28px; flex-wrap: wrap; }
.hero-id .avatar { box-shadow: 0 0 0 4px var(--surface), var(--shadow); }
.hero-id h2 { font-size: 22px; letter-spacing: -0.03em; }
.hero-id .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-id .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 2px; }
.setup { display: grid; gap: 12px; }
.setup-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--brand-grad); border-radius: 3px; transition: width 0.6s var(--ease); }
.setup-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.setup-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; cursor: pointer; }
.setup-item .ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--faint); color: transparent; flex: none; }
.setup-item.done { color: var(--muted); }
.setup-item.done .ic { border: 0; background: var(--good-soft); color: var(--good); }
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.integration { display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color 0.15s; }
.integration:hover { border-color: var(--line-strong); }
.integration.on { border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.integration .top { display: flex; align-items: center; gap: 12px; }
.integration .logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: 13px; flex: none; }
.integration .top .right { margin-left: auto; }
.integration p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.snippet { display: grid; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.snippet .top { display: flex; align-items: center; gap: 10px; }
.snippet .top .ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.snippet p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.copy { display: flex; gap: 8px; align-items: center; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; }
.copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: var(--text-2); scrollbar-width: thin; }
.seq { display: grid; gap: 0; }
.seq-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding-bottom: 14px; }
.seq-step::before { content: ""; position: absolute; left: 16.5px; top: 34px; bottom: 0; width: 1px; background: var(--line-strong); }
.seq-step:last-child::before { display: none; }
.seq-step .num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); font-weight: 650; font-size: 13px; }
.seq-step .body { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.seq-step .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.seq-step .row input[type="number"] { width: 80px; height: 30px; padding: 4px 8px; }
.seq-step .row input.ch { width: 220px; height: 30px; padding: 4px 8px; }

/* Empty, skeleton, toasts ------------------------------------------------- */
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 46px 16px; color: var(--muted); }
.empty .ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--surface-3); color: var(--text-2); }
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { margin: 0; max-width: 380px; font-size: 13px; line-height: 1.5; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 90; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow-lg); font-size: 13px; animation: rise 0.25s var(--ease); max-width: 380px; }
.toast .i { color: var(--good); }
.toast.error .i { color: var(--bad); }
.shortcuts { display: grid; gap: 4px; }
.shortcuts div { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.shortcuts div span:last-child { display: flex; gap: 4px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); font-size: 13px; }
.banner .i { color: var(--warn); }

/* Motion ------------------------------------------------------------------ */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { opacity: 0.4; transform: translateX(40px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(4px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes halo { 0% { box-shadow: 0 0 0 0 rgba(139, 124, 255, 0.45); } 70% { box-shadow: 0 0 0 9px rgba(139, 124, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(139, 124, 255, 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform 0.25s var(--ease); background: var(--surface); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(4, 5, 9, 0.5); }
  .sidebar.open + .scrim { display: block; }
  .menu { display: inline-grid; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .crumbs span { display: none; }
  .topbar-right { width: 100%; }
  .select-wrap { flex: 1; min-width: 0; }
  .select-wrap select { min-width: 0; }
  .hide-sm { display: none; }
  .view { padding: 18px 16px 70px; gap: 16px; }
  .g-2, .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 24px; }
  .kpi .spark { display: none; }
  .mini-stats { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 22px; }
  .kv { grid-template-columns: 1fr; }
  .d-head, .d-body { padding-left: 16px; padding-right: 16px; }
  .hbar-row { grid-template-columns: 96px minmax(0, 1fr) 60px; }
  .stage { grid-template-columns: 86px minmax(0, 1fr) 44px; }
  .stage-conv { margin-left: 98px; }
  .hero-body { padding: 0 16px; }
  .toolbar .search { max-width: none; }
  .modal-card { padding: 20px; }
  .seq-step .row input.ch { width: 100%; }
}

/* Polish */
#modal-body { display: grid; gap: 18px; min-width: 0; }
.palette-input input:focus-visible, .composer textarea:focus-visible { outline: none; }
.hero-id > div:nth-child(2) { padding-top: 34px; min-width: 0; }
.hero-id .right { padding-bottom: 4px; }
.icon-btn.menu { display: none; }
@media (max-width: 860px) { .icon-btn.menu { display: inline-grid; } }
