/* ============================================================
   VoAIs Call — Design Tokens
   ============================================================ */

:root {
  /* base scale */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* shadow */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 24px 48px -24px rgba(0,0,0,0.6);
  --shadow-pop: 0 24px 60px -16px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);

  /* signature accent — cobalt blue */
  --accent: #3B7BFF;
  --accent-soft: rgba(59,123,255,0.16);
  --accent-strong: #5B8FFF;
  --accent-ink: #ffffff;

  /* data viz */
  --viz-orange: #FF8A3D;
  --viz-yellow: #F4C53D;
  --viz-green:  #00D49F;
  --viz-purple: #A78BFA;
  --viz-pink:   #FF6F91;
  --viz-blue:   #3B7BFF;
  --viz-cyan:   #4DD0E1;

  /* status */
  --ok:   #00D49F;
  --warn: #F4C53D;
  --err:  #FF5C6C;
  --info: #3B7BFF;

  /* densities */
  --pad-card: 22px;
  --gap-grid: 18px;
}

/* DARK (default) */
:root, [data-theme="dark"] {
  --bg:           #0A0A0C;
  --bg-elev:      #0F1014;
  --surface:      #131319;
  --surface-2:    #181820;
  --surface-3:    #1F1F29;
  --line:         rgba(255,255,255,0.06);
  --line-strong:  rgba(255,255,255,0.12);
  --ink:          #F4F4F6;
  --ink-2:        #B7B7C2;
  --ink-3:        #6E6E80;
  --ink-mute:     #4A4A57;
  --noise-op:     0.04;
  --card-bg:
    radial-gradient(120% 80% at 10% -10%, rgba(255,255,255,0.018), transparent 60%),
    linear-gradient(180deg, #15161D 0%, #101116 100%);
  --card-line: rgba(255,255,255,0.06);
}

[data-theme="light"] {
  --bg:           #F4F4F2;
  --bg-elev:      #ECECE8;
  --surface:      #FFFFFF;
  --surface-2:    #F8F8F6;
  --surface-3:    #EFEFEC;
  --line:         rgba(10,12,20,0.08);
  --line-strong:  rgba(10,12,20,0.14);
  --ink:          #0B0C12;
  --ink-2:        #43434C;
  --ink-3:        #6E6E7A;
  --ink-mute:     #9C9CA8;
  --noise-op:     0.025;
  --card-bg:
    radial-gradient(120% 80% at 10% -10%, rgba(10,12,20,0.02), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #FCFCFA 100%);
  --card-line: rgba(10,12,20,0.07);
}

/* density */
[data-density="compact"]     { --pad-card: 16px; --gap-grid: 12px; }
[data-density="comfortable"] { --pad-card: 22px; --gap-grid: 18px; }
[data-density="spacious"]    { --pad-card: 28px; --gap-grid: 24px; }

/* ============================================================
   reset + base
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', 'Söhne', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { background: transparent; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); background-clip: padding-box; border: 2px solid transparent; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg);
  position: relative;
}
.app.collapsed { grid-template-columns: 72px 1fr; }

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: var(--noise-op);
  mix-blend-mode: overlay;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: relative;
  z-index: 2;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.app.collapsed .sidebar { padding: 18px 8px; align-items: center; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6B6BFF);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 50%);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name small {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}
.app.collapsed .brand-name { display: none; }

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-label {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 10px 6px;
}
.app.collapsed .nav-label { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
  white-space: nowrap;
}
.nav-item > span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
}
.nav-item .badge-count {
  margin-left: auto;
  font-size: 10.5px;
  background: var(--surface-3);
  color: var(--ink-2);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-item.active .badge-count { background: var(--accent-soft); color: var(--accent-strong); }
.app.collapsed .nav-item { justify-content: center; padding: 10px; }
.app.collapsed .nav-item span, .app.collapsed .nav-item .badge-count { display: none; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.sidebar-foot {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.view-switch {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
  margin-bottom: 8px;
}
.view-switch button {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 7px;
  transition: all 0.15s;
}
.view-switch button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}
.app.collapsed .view-switch { display: none; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-title h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
}
.topbar-title small {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60ch;
}
.topbar-spacer { flex: 1; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 8px 14px;
  width: 280px;
  color: var(--ink-3);
  font-size: 13px;
}
.search-box input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 13.5px;
}
.search-box input::placeholder { color: var(--ink-3); }
.kbd {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--surface-2);
  color: var(--ink-3);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.topbar-icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.topbar-icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.topbar-icon-btn .dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--err);
  border-radius: 999px;
  border: 2px solid var(--surface);
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 4px 12px 4px 4px;
  cursor: pointer;
}
.profile-pill:hover { background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFB199, #C46AFF);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.profile-pill .name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.15;
}
.profile-pill .email {
  font-size: 11px;
  color: var(--ink-3);
}

/* ============================================================
   Page container & cards
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
  padding: 24px 28px 40px;
  min-height: calc(100vh - 70px);
}

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--r-xl);
  padding: var(--pad-card);
  overflow: hidden;
}
.card.flat { padding: 0; }
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'><rect width='4' height='4' fill='%23ffffff' opacity='0.018'/><circle cx='1' cy='1' r='0.3' fill='%23ffffff' opacity='0.12'/></svg>");
  background-size: 4px 4px;
  opacity: 0.5;
  border-radius: inherit;
}
[data-theme="light"] .card::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'><circle cx='1' cy='1' r='0.3' fill='%23000000' opacity='0.08'/></svg>");
}
.card > * { position: relative; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-head .head-spacer { flex: 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: all 0.12s;
  white-space: nowrap;
  cursor: pointer;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 18px -8px rgba(59,123,255,0.6);
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost {
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger {
  background: rgba(255,92,108,0.12);
  color: var(--err);
  border-color: rgba(255,92,108,0.2);
}
.btn-danger:hover { background: rgba(255,92,108,0.2); }

.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.lg { padding: 12px 18px; font-size: 14px; }
.btn.icon-only { padding: 8px; }

/* segmented */
.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 3px;
}
.segmented button {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 999px;
  transition: all 0.15s;
}
.segmented button.active {
  background: var(--surface-3);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
}
[data-theme="light"] .segmented button.active { background: var(--bg-elev); }

/* ============================================================
   Badges, chips, status
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge.green  { background: rgba(0,212,159,0.13); color: var(--ok); }
.badge.red    { background: rgba(255,92,108,0.13); color: var(--err); }
.badge.yellow { background: rgba(244,197,61,0.14); color: var(--warn); }
.badge.blue   { background: rgba(59,123,255,0.14); color: var(--accent); }
.badge.purple { background: rgba(167,139,250,0.14); color: var(--viz-purple); }
.badge.gray   { background: var(--surface-2); color: var(--ink-2); }

.badge .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--err);
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid var(--err);
  animation: live-pulse 1.6s ease-out infinite;
  opacity: 0.6;
}
@keyframes live-pulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* ============================================================
   KPI
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-grid);
  margin-bottom: var(--gap-grid);
}
.kpi-card { padding: 18px; }
.kpi-label {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kpi-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.kpi-value small {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 500;
}
.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.kpi-trend { color: var(--ok); font-weight: 600; }
.kpi-trend.down { color: var(--err); }

/* ============================================================
   Tables
   ============================================================ */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }

.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-mute); }

/* ============================================================
   Form fields
   ============================================================ */
.field-label {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 7px;
  letter-spacing: -0.005em;
}
.field-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 6px;
}
.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 80px; font-family: inherit; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E80' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* checkbox/radio */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* toggle */
.toggle {
  display: inline-block;
  width: 32px; height: 18px;
  background: var(--surface-3);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--line);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 14px; height: 14px;
  background: var(--ink-2);
  border-radius: 999px;
  transition: transform 0.18s;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { transform: translateX(14px); background: white; }

/* ============================================================
   utils
   ============================================================ */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.h { display: flex; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.bold { font-weight: 600; }
.semibold { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.t-xs { font-size: 11px; }
.t-sm { font-size: 12.5px; }
.t-md { font-size: 14px; }
.t-lg { font-size: 16px; }
.t-xl { font-size: 22px; }
.t-2xl { font-size: 28px; }

/* divider */
.hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* tab strip */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 12px 16px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tab:hover { color: var(--ink-2); }

/* waveform */
.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 36px;
}
.waveform .bar {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: wave 1.2s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

/* ============================================================
   Login
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  background: var(--bg);
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0a0a0c 0%, #161624 60%, #1B2050 100%);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  color: white;
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}

/* link */
.link {
  color: var(--accent);
  font-weight: 600;
}
.link:hover { text-decoration: underline; }

/* ============================================================
   Mobile-first helpers + breakpoints
   ============================================================ */
.mobile-only { display: none !important; }
.mobile-tabbar { display: none; }
.mobile-overlay { display: none; }

@media (max-width: 1024px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }

  /* App shell — single column, sidebar slides over */
  .app {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }
  .app.collapsed { grid-template-columns: 1fr !important; }

  /* Sidebar becomes a left drawer */
  .sidebar {
    position: fixed !important;
    left: 0; top: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
    z-index: 50;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    height: 100vh;
  }
  .app.mobile-nav-open .sidebar { transform: translateX(0) !important; }

  .mobile-overlay {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 49;
    backdrop-filter: blur(2px);
    animation: fade-in 0.18s ease-out;
  }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

  /* Topbar — compact */
  .topbar {
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  .topbar-title h1 { font-size: 17px !important; }
  .menu-btn { display: inline-flex !important; }
  .profile-pill {
    padding: 4px !important;
  }

  /* Page padding compact */
  .page {
    padding: 14px 14px 100px !important;
  }

  /* Bottom tab bar */
  .mobile-tabbar {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-elev);
    border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    backdrop-filter: blur(20px);
  }
  [data-theme="dark"] .mobile-tabbar { background: rgba(15,16,20,0.92); }
  [data-theme="light"] .mobile-tabbar { background: rgba(255,255,255,0.92); }

  .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    color: var(--ink-3);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: 0;
  }
  .tab-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
  }
  .tab-btn .live-dot {
    position: absolute;
    top: 4px; right: 16px;
    width: 6px; height: 6px;
  }
  .tab-btn span { font-size: 10px; }

  /* KPI grids → 2 cols */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .kpi-card { padding: 14px !important; }
  .kpi-value { font-size: 22px !important; }

  /* Layout grids that should stack on mobile — opt in with class */
  .mobile-stack {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }
  .mobile-stack > * { min-width: 0; }

  /* Flow builder: hide side panels, keep just the canvas */
  .flow-side, .flow-inspector { display: none !important; }
  .flow-mobile-toggle { display: inline-flex !important; }
  .flow-toolbar h2 { font-size: 15px !important; }
  .page > div[style*="calc(100vh - 130px)"] {
    height: calc(100vh - 200px) !important;
  }

  /* Monitor screen: stacked layout, scrollable transcript */
  .monitor-grid > * { max-height: none !important; }

  /* Cards: tighten */
  .card { padding: 16px !important; border-radius: 14px !important; }

  /* Tables → horizontal scroll on mobile so they still work */
  .card > .table,
  .card table.table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Auth shell: stack with mobile-friendly hero */
  .auth-shell {
    grid-template-columns: 1fr !important;
  }
  .auth-brand {
    padding: 24px 20px !important;
    min-height: 280px;
  }
  .auth-form-side { padding: 20px !important; }

  /* Tweaks panel: don't cover bottom tab bar */
  .tweaks-panel { bottom: 80px !important; right: 12px !important; left: 12px !important; max-width: none !important; }

  /* Search box / segmented: shrink */
  .search-box { width: 100% !important; }
  .segmented {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
  }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Tabs strip — horizontal scroll on mobile */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }

  /* Brand small in sidebar drawer */
  .sidebar .brand-name { display: flex !important; }
  .app.collapsed .sidebar { padding: 18px 14px !important; }

  /* Mobile tweaks: shrink topbar profile to just the avatar */
  .profile-pill {
    border-radius: 999px !important;
    gap: 0 !important;
  }
  .profile-pill .name, .profile-pill .email { display: none !important; }
}

/* very small phones */
@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  .tab-btn span { display: none; }
  .topbar { padding: 10px 10px !important; }
}

/* ============================================================
   Auth screen — extra primitives (banners, prefix/suffix inputs)
   ============================================================ */

/* Inline banner shown above auth forms — error / info / success */
.auth-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.auth-banner.err {
  border-color: rgba(255,92,108,0.35);
  background: rgba(255,92,108,0.08);
  color: #ffb1b8;
}
.auth-banner.info {
  border-color: rgba(59,123,255,0.35);
  background: rgba(59,123,255,0.08);
  color: #b9d0ff;
}
[data-theme="light"] .auth-banner.err  { color: #b00020; }
[data-theme="light"] .auth-banner.info { color: #1a4dad; }

/* Input with a left-side prefix label (e.g. voais.in/t/...) */
.input-with-prefix {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input-with-prefix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-with-prefix .input-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px 0 12px;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}
.input-with-prefix .input {
  border: 0;
  background: transparent;
  padding-left: 10px;
}
.input-with-prefix .input:focus { box-shadow: none; }

/* Input with a right-side icon button (e.g. show/hide password) */
.input-with-suffix {
  position: relative;
}
.input-with-suffix .input {
  padding-right: 38px;
}
.input-with-suffix .input-suffix-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  border-radius: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.input-with-suffix .input-suffix-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* Field hint can hold a colored slug-availability message */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

/* Auth boot screen — shown while we check session on load */
.auth-boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink-3);
  font-size: 13px;
}
.auth-boot-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: auth-boot-pulse 1.2s ease-in-out infinite;
  margin: 0 auto 14px;
}
@keyframes auth-boot-pulse {
  0%,100% { opacity: 0.3; transform: scale(0.7); }
  50%     { opacity: 1.0; transform: scale(1.0); }
}

/* ============================================================
   Phase 2 — Dashboard helpers (skeletons + empty banner)
   ============================================================ */

/* Loading skeleton — a soft shimmer for cards while data loads */
.skel-block {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.skel-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0,
    var(--surface-2) 50%,
    transparent 100%
  );
  animation: skel-shimmer 1.6s linear infinite;
  transform: translateX(-100%);
}
@keyframes skel-shimmer {
  to { transform: translateX(100%); }
}

/* Welcome banner shown on fresh tenants with zero data */
.empty-banner {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
}
@media (max-width: 720px) {
  .empty-banner > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

/* ============================================================
   Modal (used by Phase 3 — Agents, Contacts, Campaign wizard)
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  animation: modal-fade-in 0.14s ease-out;
}
[data-theme="light"] .modal-backdrop { background: rgba(0, 0, 0, 0.35); }
.modal-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modal-pop 0.16s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-head {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.modal-head h2 { flex: 1; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Hot lead row hover in dashboard */
.hot-lead { transition: background 0.12s; }
.hot-lead:hover { background: var(--surface-2); }
