/* AEx Lead Desk — design system. Calm, fast cockpit. Light + first-class dark theme.
   Tokens on :root, redefined for dark. Lime #98ff03 is a FILL with near-black text,
   never lime text on white. 4px grid, 10px card radius, 8px input radius,
   shadows only on overlays, 150–200ms motion. */

:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #f0f2f3;
  --surface-3: #e7eaec;
  --border: #dfe3e6;
  --border-strong: #c9cfd3;
  --text: #0b0d0e;
  --muted: #56616a;
  --accent: #98ff03;
  --accent-ink: #0b0d0e;
  --accent-hover: #8af000;
  --accent-line: #4d8a00;      /* lime-family stroke that reads on light surfaces */
  --accent-soft: #eaffcc;
  --focus: #3f7300;
  --success: #17803d;
  --success-soft: #dcf5e4;
  --warning: #9a5b00;
  --warning-soft: #fff1d6;
  --danger: #c0262d;
  --danger-soft: #fde4e4;
  --info: #1f5fbf;
  --info-soft: #e1ecfb;
  --violet: #6a3fc0;
  --violet-soft: #ece4fb;
  --teal: #0b7a75;
  --teal-soft: #d8f3f1;
  --orange: #b04a00;
  --orange-soft: #ffe7d6;
  --neutral-soft: #eceef0;
  --shadow: 0 10px 30px rgba(11, 13, 14, .12), 0 2px 6px rgba(11, 13, 14, .06);
  --scrim: rgba(11, 13, 14, .45);
  --sk: #e9ecee;
  --sk-shine: #f5f6f7;
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar: 232px;
  --sidebar-collapsed: 64px;
  --topbar: 56px;
  --t: 160ms ease;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d0e; --surface: #121517; --surface-2: #181c1f; --surface-3: #20252a; --border: #262c31; --border-strong: #353d44;
    --text: #e9ecee; --muted: #9ba5ad; --accent: #98ff03; --accent-ink: #0b0d0e; --accent-hover: #adff3d; --accent-line: #98ff03;
    --accent-soft: #1d2a0a; --focus: #98ff03; --success: #4ad87f; --success-soft: #0f2a1a; --warning: #f5b544; --warning-soft: #2e2208;
    --danger: #ff6b6b; --danger-soft: #331314; --info: #7aaeff; --info-soft: #0f1d33; --violet: #b69bff; --violet-soft: #1f1736;
    --teal: #4fd6cf; --teal-soft: #0b2826; --orange: #ff9c57; --orange-soft: #2f1a0b; --neutral-soft: #1d2226;
    --shadow: 0 12px 32px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4); --scrim: rgba(0, 0, 0, .6); --sk: #1a1e21; --sk-shine: #22272b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d0e; --surface: #121517; --surface-2: #181c1f; --surface-3: #20252a; --border: #262c31; --border-strong: #353d44;
  --text: #e9ecee; --muted: #9ba5ad; --accent: #98ff03; --accent-ink: #0b0d0e; --accent-hover: #adff3d; --accent-line: #98ff03;
  --accent-soft: #1d2a0a; --focus: #98ff03; --success: #4ad87f; --success-soft: #0f2a1a; --warning: #f5b544; --warning-soft: #2e2208;
  --danger: #ff6b6b; --danger-soft: #331314; --info: #7aaeff; --info-soft: #0f1d33; --violet: #b69bff; --violet-soft: #1f1736;
  --teal: #4fd6cf; --teal-soft: #0b2826; --orange: #ff9c57; --orange-soft: #2f1a0b; --neutral-soft: #1d2226;
  --shadow: 0 12px 32px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4); --scrim: rgba(0, 0, 0, .6); --sk: #1a1e21; --sk-shine: #22272b;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 8px; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { max-width: 100%; }
svg.lucide { display: inline-block; vertical-align: -3px; }
.ring svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, .tabular, table, .kpi-value, time, .time { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pre-line { white-space: pre-line; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 8px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.h3 { font-size: 16px; margin: 20px 0 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
[data-lucide], svg.lucide { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 2; }
.ic-sm [data-lucide], .ic-sm svg.lucide { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.shell.collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px 8px; z-index: 30;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 12px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -.01em; text-decoration: none !important; white-space: nowrap; }
.wordmark-mark { background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 4px 8px; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.wordmark-lg { font-size: 20px; margin-bottom: 24px; }
.wordmark-lg .wordmark-mark { font-size: 16px; }
.nav-section { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 12px 4px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text);
  font-weight: 500; text-decoration: none !important; transition: background var(--t), color var(--t); position: relative; min-height: 40px;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--accent); color: var(--accent-ink); }
.nav-link [data-lucide], .nav-link svg { color: inherit; }
.nav-badge { margin-left: auto; background: var(--warning-soft); color: var(--warning); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 0 8px; line-height: 20px; }
.nav-link.active .nav-badge { background: rgba(11, 13, 14, .12); color: var(--accent-ink); }
.shell.collapsed .nav-label, .shell.collapsed .nav-badge { display: none; }
.shell.collapsed .sidebar-head { flex-direction: column; }
.shell.collapsed .nav-link { justify-content: center; padding: 8px; }
.shell.collapsed .nav-link:hover::after, .shell.collapsed .nav-link:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); background: var(--text); color: var(--bg);
  padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none;
}
.main-col { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-toggle { display: none; }
.search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 240px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color var(--t);
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-text { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.kbd { font: 500 12px/1 Inter, sans-serif; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.content { flex: 1; padding: 24px; outline: none; min-width: 0; }
.app-footer { padding: 16px 24px 24px; color: var(--muted); font-size: 12px; text-align: center; }
.banners:empty { display: none; }
.banners { padding: 12px 24px 0; display: grid; gap: 8px; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; gap: 6px; }
.btn-sm [data-lucide], .btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text); cursor: pointer; position: relative; transition: background var(--t);
}
.icon-btn:hover { background: var(--surface-2); }
.dot-badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.user-name { font-weight: 500; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 4px; }
.field label, .label { font-weight: 500; font-size: 12px; color: var(--muted); }
.input, .select, textarea.input {
  width: 100%; height: 36px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); transition: border-color var(--t), box-shadow var(--t);
}
textarea.input { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.input:focus, textarea.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
select.input { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.input-sm { height: 30px; font-size: 12px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check-label input { width: 16px; height: 16px; accent-color: var(--accent-line); }
.help { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; font-size: 12px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"], .seg button.active { background: var(--accent); color: var(--accent-ink); }
.seg button [data-lucide], .seg button svg { width: 14px; height: 14px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-grid; place-items: center; min-width: 40px; height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 12px; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days input:checked + span { color: var(--accent-ink); }
.days label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.days label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- chips & badges */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--muted); }
.chip [data-lucide], .chip svg { width: 12px; height: 12px; }
.st-pending_ai { background: var(--neutral-soft); color: var(--muted); }
.st-ai_queued { background: var(--violet-soft); color: var(--violet); }
.st-ready { background: var(--teal-soft); color: var(--teal); }
.st-review { background: var(--warning-soft); color: var(--warning); }
.st-rejected { background: var(--danger-soft); color: var(--danger); }
.st-assigned { background: var(--info-soft); color: var(--info); }
.st-working { background: var(--info-soft); color: var(--info); }
.st-callback { background: var(--orange-soft); color: var(--orange); }
.st-demo_booked { background: var(--accent); color: var(--accent-ink); }
.st-won { background: var(--success-soft); color: var(--success); }
.st-lost { background: var(--neutral-soft); color: var(--danger); }
.st-not_interested { background: var(--neutral-soft); color: var(--muted); }
.st-bad_number { background: var(--danger-soft); color: var(--danger); }
.st-dnc { background: var(--danger); color: #fff; }
.st-exhausted { background: var(--neutral-soft); color: var(--muted); }
.chip-carried { background: var(--orange-soft); color: var(--orange); }
.chip-sample { background: var(--violet-soft); color: var(--violet); }
.score { display: inline-grid; place-items: center; min-width: 32px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--neutral-soft); color: var(--muted); }
.score-high { background: var(--accent); color: var(--accent-ink); }
.score-mid { background: var(--info-soft); color: var(--info); }
.tz-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--border-strong); flex: 0 0 auto; }
.tz-dot.good { background: var(--success); }
.tz-dot.edge { background: var(--warning); }
.tz-dot.out { background: var(--border-strong); }
.table td .row { flex-wrap: nowrap; white-space: nowrap; }
.presence { width: 8px; height: 8px; border-radius: 999px; display: inline-block; background: var(--border-strong); }
.presence.online { background: var(--success); }
.presence.idle { background: var(--warning); }

/* ---------------------------------------------------------------- cards, callouts, kpis */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.card-title .grow + * { margin-left: auto; }
.callout { border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 8px; align-items: flex-start; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.callout-success { background: var(--success-soft); border-color: transparent; color: var(--text); }
.callout-warning { background: var(--warning-soft); border-color: transparent; color: var(--text); }
.callout-danger { background: var(--danger-soft); border-color: transparent; color: var(--text); }
.callout-info { background: var(--info-soft); border-color: transparent; color: var(--text); }
.callout [data-lucide], .callout svg { margin-top: 2px; }
.callout-warning [data-lucide], .callout-warning svg { color: var(--warning); }
.callout-danger [data-lucide], .callout-danger svg { color: var(--danger); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 2px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi.warn { border-color: var(--warning); background: var(--warning-soft); }
.funnel-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.funnel-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.badge-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.badge-item { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.badge-item [data-lucide], .badge-item svg { color: var(--accent-line); }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent-line); border-radius: 999px; transition: width 200ms ease; }
.bar.bar-accent > span { background: var(--accent); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 70vh; }
.card .table-wrap { border: 0; border-radius: 0; max-height: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable[aria-sort="ascending"]::after { content: " ↑"; }
.table th.sortable[aria-sort="descending"]::after { content: " ↓"; }
.table td.num, .table th.num { text-align: right; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.selected { background: var(--accent-soft); }
.table .cell-strong { font-weight: 600; }
.table .cell-check { width: 36px; }
.table a { color: var(--text); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; flex-wrap: wrap; }
.bulkbar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-top: 12px; border-radius: var(--radius); background: var(--text); color: var(--bg); box-shadow: var(--shadow); }
.bulkbar .btn-secondary { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.bulkbar .input { background: var(--bg); color: var(--text); width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters .field { min-width: 140px; }
.filters .field.wide { min-width: 220px; flex: 1; }

/* ---------------------------------------------------------------- menus, modals, drawers, toasts */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50; animation: pop 160ms ease;
}
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-foot { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text); text-decoration: none !important; font-weight: 500; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item .kbd { margin-left: auto; }
.menu-group { padding: 6px 10px 10px; display: grid; gap: 6px; }
.menu-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.notif-list li { padding: 8px 10px; border-radius: 6px; display: grid; gap: 2px; cursor: pointer; }
.notif-list li:hover { background: var(--surface-2); }
.notif-list li.unread { background: var(--accent-soft); }
.notif-list .n-title { font-weight: 600; }
.notif-list .n-body { color: var(--muted); font-size: 12px; }
.empty-mini { color: var(--muted); text-align: center; padding: 16px; cursor: default !important; }
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade 160ms ease; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); animation: pop 180ms ease;
}
.modal-lg { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; flex-wrap: wrap; }
.drawer-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 55; animation: fade 160ms ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: 56; display: flex; flex-direction: column; animation: slidein 200ms ease;
}
.drawer .modal-body { overflow: auto; flex: 1; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(480px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--text); color: var(--bg);
  box-shadow: var(--shadow); animation: up 180ms ease;
}
.toast .grow { min-width: 0; }
.toast .btn { height: 28px; }
.toast .btn-undo { background: var(--accent); color: var(--accent-ink); }
.toast-error { background: var(--danger); color: #fff; }
.toast-count { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.palette { width: min(620px, 100%); }
.palette-input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; height: 52px; font-size: 16px; padding: 0 20px; background: transparent; width: 100%; }
.palette-input:focus { outline: none; box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.palette-list li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.palette-list li[aria-selected="true"] .muted { color: var(--accent-ink); opacity: .8; }
.palette-group { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px 4px; }
.shortcut-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.tab { border: 0; background: transparent; padding: 10px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-line); }
.tab .count { background: var(--surface-2); border-radius: 999px; padding: 0 6px; font-size: 12px; }

/* ---------------------------------------------------------------- skeletons & empty states */
.sk { background: linear-gradient(90deg, var(--sk) 0%, var(--sk-shine) 50%, var(--sk) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--radius-sm); }
.sk-title { height: 28px; width: 40%; margin-bottom: 16px; }
.sk-row { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sk-card { height: 72px; flex: 1 1 140px; border-radius: var(--radius); }
.sk-ring { width: 72px; height: 72px; border-radius: 999px; }
.sk-block { height: 160px; margin-bottom: 12px; border-radius: var(--radius); }
.sk-line { height: 14px; margin-bottom: 10px; }
.sk-line.short { width: 60%; }
.sk-item { height: 52px; margin-bottom: 8px; }
.sk-phone { height: 48px; width: 60%; margin-bottom: 16px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty-icon { width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.empty h3 { color: var(--text); font-size: 16px; }

/* ---------------------------------------------------------------- Today: header strip */
.today-strip { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-bottom: 16px; }
.greet { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); flex: 1 1 280px; }
.greet h2 { font-size: 20px; }
.ring { position: relative; width: 72px; height: 72px; flex: 0 0 auto; }
.ring svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--surface-3); }
.ring .ring-fill { stroke: var(--accent-line); transition: stroke-dashoffset 200ms ease; }
.ring .ring-text { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ring .ring-text small { display: block; font-weight: 500; font-size: 10px; color: var(--muted); }
.stat-tiles { display: flex; gap: 12px; flex-wrap: wrap; flex: 2 1 420px; }
.stat-tile { flex: 1 1 100px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 2px; }
.stat-tile .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-tile .l { font-size: 12px; color: var(--muted); }
.streak .v { display: flex; align-items: center; gap: 6px; }
.streak [data-lucide], .streak svg { color: var(--orange); }

/* ---------------------------------------------------------------- Today: workspace */
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ws-queue, .ws-outcome { position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow: auto; }
.ws-queue { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.ws-card { min-width: 0; }
.q-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; gap: 8px; }
.q-head h3 { font-size: 14px; }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.q-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.q-item:hover { background: var(--surface-2); }
.q-item[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.q-item .q-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .q-sub { grid-column: 2 / 4; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.q-item.overdue { border-left: 3px solid var(--danger); }
.q-section { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 8px 4px; display: flex; justify-content: space-between; }
.q-section.danger { color: var(--danger); }
.due-time.overdue { color: var(--danger); font-weight: 600; }
.lead-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: nowrap; align-items: flex-start; }
.lead-name { font-size: 24px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.lead-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); margin-top: 4px; align-items: center; }
.lead-meta span { display: inline-flex; align-items: center; gap: 4px; }
.lead-meta [data-lucide], .lead-meta svg { width: 14px; height: 14px; }
.phone-block { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius); }
.phone-big { font-size: 32px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.phone-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.btn-call { height: 44px; padding: 0 20px; font-size: 16px; }
.hours-warn { margin-top: 8px; }
.ai-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.ai-summary { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.ai-opener { background: var(--accent-soft); border-left: 3px solid var(--accent-line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 12px; margin: 12px 0; font-size: 16px; }
.ai-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.ai-facts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sources { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; }
.sources a { color: var(--muted); text-decoration: underline; overflow-wrap: anywhere; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-top: 12px; }
.panel > summary, .panel-head { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 600; cursor: pointer; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--t); }
.panel[open] > summary::after { transform: rotate(-135deg); }
.panel-body { padding: 0 16px 16px; }
.tool-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 8px 0; border-bottom: 1px solid var(--border); }
.tool-tabs .tab { padding: 8px 10px; }
.tool-pane { padding: 16px; }
.script-stage { border-top: 1px solid var(--border); }
.script-stage:first-child { border-top: 0; }
.script-stage > summary { padding: 10px 0; font-weight: 600; cursor: pointer; }
.script-text { white-space: pre-line; font-size: 16px; line-height: 1.6; padding-bottom: 12px; }
.q-check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 6px 0; }
.q-check input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent-line); }
.q-check .input { grid-column: 2; }
.objection { border-bottom: 1px solid var(--border); padding: 10px 0; }
.objection h4 { font-size: 14px; margin-bottom: 4px; }
.ai-answer { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; margin-top: 8px; white-space: pre-line; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calc-result { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.calc-result .big { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.formula { font-size: 12px; color: var(--muted); margin-top: 8px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.history .h-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.history .h-top strong { color: var(--text); font-size: 14px; }
.history .h-notes { white-space: pre-line; }
.history li.manager { background: var(--info-soft); }

/* outcome panel */
.outcome-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 12px; }
.timer { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.timer .t { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.running .t { color: var(--accent-line); }
.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.outcome-btn {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; font-size: 12px; line-height: 1.25; transition: background var(--t), border-color var(--t);
}
.outcome-btn:hover { background: var(--surface-2); }
.outcome-btn .k { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); font-size: 12px; color: var(--muted); border: 1px solid var(--border); }
.outcome-btn[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.outcome-btn.o-good { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.outcome-btn.o-bad .k { color: var(--danger); }
.outcome-btn.o-demo { grid-column: 1 / -1; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.outcome-btn.o-demo .k { background: rgba(11, 13, 14, .1); color: var(--accent-ink); border-color: transparent; }
.outcome-form { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 10px; }
.notes-box textarea { min-height: 120px; }
.save-state { font-size: 12px; color: var(--muted); }
.saved-flash { color: var(--success); }
.wrap-actions { display: grid; gap: 8px; }
.closed-note { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }

/* ---------------------------------------------------------------- kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 8px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; border: 2px solid transparent; transition: border-color var(--t); }
.kcol.drop { border-color: var(--accent-line); }
.kcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; padding: 4px 4px 0; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: grab; display: grid; gap: 4px; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .5; }
.kcard .kname { font-weight: 600; }

/* ---------------------------------------------------------------- import wizard */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; list-style: none; padding: 0; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 12px; }
.steps li .n { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.steps li.active { color: var(--text); }
.steps li.active .n { background: var(--accent); color: var(--accent-ink); }
.steps li.done .n { background: var(--success-soft); color: var(--success); }
.steps li + li::before { content: ""; width: 24px; height: 1px; background: var(--border-strong); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 40px 16px; text-align: center; background: var(--surface); cursor: pointer; transition: border-color var(--t), background var(--t); display: grid; gap: 8px; justify-items: center; }
.dropzone.over { border-color: var(--accent-line); background: var(--accent-soft); }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 12px; align-items: center; }
.map-grid .map-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.map-sample { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.count-card { border-radius: var(--radius); padding: 12px 16px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 4px; }
.count-card .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-card.new { border-color: var(--accent-line); }
.count-card.dup .v { color: var(--info); }
.count-card.inv .v { color: var(--danger); }
.count-card.blk .v { color: var(--warning); }
.progress-line { display: grid; gap: 6px; margin: 12px 0; }
.ai-progress { display: grid; gap: 4px; min-width: 160px; }

/* ---------------------------------------------------------------- review cards */
.review-list { display: grid; gap: 12px; }
.review-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.review-card .rc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------------------------------------------------------- settings */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar) + 16px); display: grid; gap: 2px; }
.settings-nav button { text-align: left; border: 0; background: transparent; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; color: var(--text); }
.settings-nav button:hover { background: var(--surface-2); }
.settings-nav button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 24px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.setting-row:last-child { border-bottom: 0; }
.setting-row .field label { font-size: 14px; color: var(--text); }
.list-editor-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: var(--surface); }
.list-editor-item + .list-editor-item { margin-top: 12px; }
.code, pre.code { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.prompt-body { font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 320px; }
.model-table input { width: 90px; }

/* ---------------------------------------------------------------- auth & install */
.auth-body { min-height: 100vh; display: grid; place-items: center; }
.auth-wrap { width: 100%; padding: 24px 16px; display: grid; justify-items: center; gap: 8px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; }
.install-card { width: min(640px, 100%); }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth-card form { margin: 16px 0; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.check { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.check-dot { width: 10px; height: 10px; border-radius: 999px; }
.check.ok .check-dot { background: var(--success); }
.check.bad .check-dot { background: var(--danger); }
.install-steps { padding-left: 20px; display: grid; gap: 12px; }

/* ---------------------------------------------------------------- tour & celebration */
.tour-pop { position: fixed; z-index: 90; width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; animation: pop 180ms ease; }
.tour-pop h3 { font-size: 16px; margin-bottom: 6px; }
.tour-target { position: relative; z-index: 89; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px var(--scrim); border-radius: var(--radius); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
.celebrate { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 96; background: var(--accent); color: var(--accent-ink); padding: 12px 20px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); animation: pop 200ms ease; }

/* ---------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .banners, .page-actions, .toasts, #modal-root { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card, .kpi { break-inside: avoid; }
}

/* ---------------------------------------------------------------- motion */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
}

/* ---------------------------------------------------------------- responsive */
.queue-toggle { display: none !important; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-main-side-wide { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 1280px) {
  .workspace { grid-template-columns: 260px minmax(0, 1fr) 300px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .ws-queue { position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 90vw); z-index: 57; max-height: none; border-radius: 0; transform: translateX(-105%); transition: transform 200ms ease; box-shadow: var(--shadow); }
  .ws-queue.open { transform: none; }
  .queue-toggle { display: inline-flex !important; }
  .settings-layout { grid-template-columns: 1fr; }
  .grid-main-side, .grid-main-side-wide { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-105%); transition: transform 200ms ease; box-shadow: var(--shadow); z-index: 58; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.collapsed .nav-label, .shell.collapsed .nav-badge { display: initial; }
  .shell.collapsed .nav-link { justify-content: flex-start; padding: 8px 12px; }
  .sidebar-collapse { display: none; }
  .topbar .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-trigger .search-text, .search-trigger .kbd, .user-name { display: none; }
  .content { padding: 16px; }
  .banners { padding: 12px 16px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .count-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .ws-outcome { position: static; max-height: none; }
  .ai-grid, .calc-grid, .form-grid { grid-template-columns: 1fr; }
  .phone-big { font-size: 26px; }
  .phone-actions { margin-left: 0; width: 100%; }
  .phone-actions .btn { flex: 1; }
  .lead-name { font-size: 20px; }
  .setting-row { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: 1fr 1fr; }
  .map-grid .map-sample, .map-grid .map-head:nth-child(3) { display: none; }
  .review-card { grid-template-columns: auto minmax(0, 1fr); }
  .review-card .rc-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .kanban { grid-template-columns: repeat(5, minmax(240px, 85vw)); }
  .page-title { font-size: 20px; }
  .auth-card { padding: 24px 20px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .table th, .table td { padding: 8px; }
  .hide-sm { display: none !important; }
}
