/* ============================================================
   ZENYX DASHBOARD v3 — Professional Refined Design
   Typography: Geist Sans / Instrument Serif
   Base: Warm white #FBFAF7 · Deep ink · Warm slate dark
   Accent: oklch(0.55 0.18 295) violet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

/* ── Geist Sans CDN fallback ────────────────────────────── */
@font-face {
  font-family: 'Geist Sans';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Sans';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Sans';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Sans';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ════════════════════════════════════════════════════════════
   DESIGN TOKENS — Light (default)
   ════════════════════════════════════════════════════════════ */
:root {
  /* ── Accent (violet) ──────────────────────────────────── */
  --accent-h: 295;
  --accent-s: 0.18;
  --accent-l: 0.55;
  --accent: oklch(0.55 0.18 295);
  --accent-soft: oklch(0.65 0.12 295);
  --accent-mist: oklch(0.92 0.04 295);
  --accent-glow: oklch(0.55 0.18 295 / 0.15);

  /* ── Channel colors ───────────────────────────────────── */
  --wa: #25d366;
  --wa-bg: oklch(0.85 0.15 145 / 0.15);
  --reviews: #f59e0b;
  --reviews-bg: oklch(0.85 0.12 85 / 0.15);
  --instagram: #e4405f;
  --instagram-bg: oklch(0.82 0.14 10 / 0.12);

  /* ── Warm base palette (CLEAR MODE ONLY) ────────────────── */
  --base: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --elevated: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* ── Text ─────────────────────────────────────────────── */
  --text: #1a1a1a;
  --text-secondary: #6b6863;
  --text-muted: #9e9b95;

  /* ── Status ───────────────────────────────────────────── */
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;

  /* ── Shadows ──────────────────────────────────────────── */
  --shadow-xs: 0 1px 2px oklch(0 0 0 / 0.04);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.06), 0 1px 2px oklch(0 0 0 / 0.04);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.08);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.1);
  --shadow-xl: 0 24px 60px oklch(0 0 0 / 0.12);

  /* ── Radii ────────────────────────────────────────────── */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* ── Typography ───────────────────────────────────────── */
  --font-sans: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Instrument Serif', 'Georgia', serif;

  /* ── Sizing ───────────────────────────────────────────── */
  --sidebar-w: 240px;
  --topbar-h: 56px;

  /* ── Density ──────────────────────────────────────────── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --card-p: 20px;

  color-scheme: light;
}

/* ════════════════════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════════════════════ */
/* ── DARK MODE DISABLED (FORCED CLEAR) ── */
[data-theme="dark"] {
  color-scheme: light;
}

/* ════════════════════════════════════════════════════════════
   ACCENT COLORS
   ════════════════════════════════════════════════════════════ */
[data-accent="violet"] { --accent: oklch(0.55 0.18 295); --accent-soft: oklch(0.65 0.12 295); --accent-mist: oklch(0.92 0.04 295); --accent-glow: oklch(0.55 0.18 295 / 0.15); }
[data-theme="dark"][data-accent="violet"] { --accent-mist: oklch(0.35 0.12 295 / 0.2); }
[data-accent="blue"] { --accent: oklch(0.55 0.18 260); --accent-soft: oklch(0.65 0.12 260); --accent-mist: oklch(0.92 0.04 260); --accent-glow: oklch(0.55 0.18 260 / 0.15); }
[data-theme="dark"][data-accent="blue"] { --accent-mist: oklch(0.35 0.12 260 / 0.2); }
[data-accent="green"] { --accent: oklch(0.55 0.18 150); --accent-soft: oklch(0.65 0.12 150); --accent-mist: oklch(0.92 0.04 150); --accent-glow: oklch(0.55 0.18 150 / 0.15); }
[data-theme="dark"][data-accent="green"] { --accent-mist: oklch(0.35 0.12 150 / 0.2); }
[data-accent="coral"] { --accent: oklch(0.55 0.18 30); --accent-soft: oklch(0.65 0.12 30); --accent-mist: oklch(0.92 0.04 30); --accent-glow: oklch(0.55 0.18 30 / 0.15); }
[data-theme="dark"][data-accent="coral"] { --accent-mist: oklch(0.35 0.12 30 / 0.2); }
[data-accent="ink"] { --accent: oklch(0.25 0.02 295); --accent-soft: oklch(0.4 0.02 295); --accent-mist: oklch(0.88 0.01 295); --accent-glow: oklch(0.25 0.02 295 / 0.1); }
[data-theme="dark"][data-accent="ink"] { --accent: oklch(0.8 0.02 295); --accent-soft: oklch(0.7 0.02 295); --accent-mist: oklch(0.3 0.02 295 / 0.2); }

/* ════════════════════════════════════════════════════════════
   DENSITY
   ════════════════════════════════════════════════════════════ */
[data-density="compact"] {
  --space-xs: 2px; --space-sm: 6px; --space-md: 12px;
  --space-lg: 18px; --space-xl: 24px; --card-p: 14px;
}
[data-density="spacious"] {
  --space-xs: 6px; --space-sm: 12px; --space-md: 22px;
  --space-lg: 32px; --space-xl: 44px; --card-p: 28px;
}

/* ════════════════════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════════════════════ */
.dbase, .dbase * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.dbase {
  font-family: var(--font-sans);
  background: var(--base);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ════════════════════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════════════════════ */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform .25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  height: var(--topbar-h);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.sidebar-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  font-family: var(--font-sans);
}
.sidebar-logo-text {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.sidebar-workspace {
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-xs) var(--space-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background .15s;
  border: none;
  width: calc(100% - var(--space-sm) * 2);
  font-family: var(--font-sans);
}
.sidebar-workspace:hover { background: var(--border-light); color: var(--text); }
.sidebar-workspace svg { flex-shrink: 0; opacity: .5; margin-left: auto; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-section {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-md) var(--space-xs);
  margin-top: var(--space-xs);
}
.sidebar-section:first-child { margin-top: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all .12s;
  position: relative;
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-mist);
  font-weight: 600;
}
.sidebar-link svg {
  flex-shrink: 0;
  opacity: .7;
}
.sidebar-link.active svg { opacity: 1; }
.sidebar-link .badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-agents {
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-secondary);
}
.agent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-dot.on { background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.agent-dot.off { background: var(--text-muted); }

/* ── Plan card ──────────────────────────────────────────── */
.sidebar-plan {
  margin: var(--space-sm) var(--space-sm);
  padding: var(--space-md);
  background: var(--accent-mist);
  border-radius: var(--r-md);
  border: 1px solid var(--accent);
}
.sidebar-plan-name {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: 4px;
}
.sidebar-plan-usage {
  font-size: .72rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.sidebar-plan-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.sidebar-plan-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .6s ease;
}
.sidebar-plan-btn {
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 0;
}
.sidebar-plan-btn:hover { text-decoration: underline; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-plan {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ── MAIN ───────────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--base);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: oklch(from var(--base) l c h / 0.85);
}

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
}
.topbar-breadcrumbs span { color: var(--text-secondary); font-weight: 500; }
.topbar-breadcrumbs svg { opacity: .4; }

.topbar-search {
  flex: 1;
  max-width: 320px;
  position: relative;
  margin: 0 auto;
}
.topbar-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .82rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all .15s;
}
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: .8rem;
}
.topbar-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .6rem;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  font-size: .9rem;
  position: relative;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-mist); }
.topbar-btn-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--surface);
}

.topbar-ai-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--accent);
  background: var(--accent-mist);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font-sans);
}
.topbar-ai-btn:hover { background: var(--accent); color: white; }

/* ── CONTENT ────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  margin-bottom: var(--space-lg);
}
.page-header-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.page-header-sub {
  font-size: .88rem;
  color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════════════════════ */

/* ── KPI GRID ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}
.kpi-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.kpi-card-trend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.kpi-card-trend.up { color: var(--green); background: var(--green-soft); }
.kpi-card-trend.down { color: var(--red); background: var(--red-soft); }
.kpi-card-trend.neutral { color: var(--text-muted); background: var(--surface-hover); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 2px;
  color: var(--text);
}
.kpi-label {
  font-size: .78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── SPARKLINE (inline SVG mini-chart) ──────────────────── */
.sparkline {
  height: 32px;
  margin-top: var(--space-sm);
}
.sparkline svg { width: 100%; height: 100%; }

/* ── AGENT CARDS ────────────────────────────────────────── */
.agent-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
}
.agent-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }

.agent-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}
.agent-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.agent-card-icon.wa { background: var(--wa-bg); color: var(--wa); }
.agent-card-icon.reviews { background: var(--reviews-bg); color: var(--reviews); }
.agent-card-icon.ig { background: var(--instagram-bg); color: var(--instagram); }

.agent-card-name {
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 2px;
}
.agent-card-desc {
  font-size: .78rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}
.agent-card-stats {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.agent-card-stat {
  font-size: .72rem;
  color: var(--text-muted);
}
.agent-card-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
}

/* ── Toggle ─────────────────────────────────────────────── */
.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background .2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.15);
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(16px); }

/* ── TWO-COL / THREE-COL LAYOUT ─────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* ── CARD (generic) ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--card-p);
  border-bottom: 1px solid var(--border-light);
}
.card-title {
  font-size: .88rem;
  font-weight: 600;
}
.card-body { padding: var(--card-p); }

/* ── CHART BAR ──────────────────────────────────────────── */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
}
.chart-title {
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
}
.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height .6s ease;
}
.bar.primary { background: var(--accent); }
.bar.wa { background: var(--wa); }
.bar.reviews { background: var(--reviews); }
.bar.ig { background: var(--instagram); }
.bar-label {
  font-size: .58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* ── ACTIVITY FEED ──────────────────────────────────────── */
.activity-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: var(--space-sm) var(--card-p);
  transition: background .1s;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface-hover); }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text {
  font-size: .82rem;
  line-height: 1.4;
  margin-bottom: 2px;
  color: var(--text);
}
.activity-text strong { font-weight: 600; }
.activity-meta {
  font-size: .7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.activity-unread {
  background: var(--accent);
  color: white;
  font-size: .6rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── AGENT STATS ROW (WhatsApp/Reviews/IG pages) ─────────── */
.agent-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.agent-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  text-align: center;
}
.agent-stat-val {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 4px;
}
.agent-stat-lbl {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── CONVERSATION LIST ──────────────────────────────────── */
.conv-list {
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.conv-search-wrap {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}
.conv-search-wrap input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-size: .8rem;
  font-family: var(--font-sans);
  outline: none;
}
.conv-search-wrap input:focus { border-color: var(--accent); }
.conv-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .75rem;
  pointer-events: none;
}

.conv-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background .1s;
}
.conv-item:hover { background: var(--surface-hover); }
.conv-item.active { background: var(--accent-mist); }
.conv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.conv-item-name {
  font-weight: 600;
  font-size: .85rem;
}
.conv-item-time {
  font-size: .68rem;
  color: var(--text-muted);
}
.conv-item-preview {
  font-size: .78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item-tags {
  display: flex;
  gap: 4px;
}
.conv-tag {
  font-size: .6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.conv-tag.reserva { background: var(--accent-mist); color: var(--accent); }
.conv-tag.unread { background: var(--green-soft); color: var(--green); }

/* ── CHAT ───────────────────────────────────────────────── */
.chat-area {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.chat-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
}
.chat-header-name { font-weight: 600; font-size: .88rem; }
.chat-header-status {
  font-size: .7rem;
  color: var(--text-muted);
}
.chat-header-online { color: var(--green); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 300px;
  background: var(--base);
}
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.bubble-row.out { flex-direction: row-reverse; }
.bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .85rem;
  line-height: 1.5;
  position: relative;
}
.bubble.in {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 4px 16px 16px 16px;
  color: var(--text);
}
.bubble.out {
  background: var(--accent);
  color: white;
  border-radius: 16px 4px 16px 16px;
}
.bubble-time {
  font-size: .62rem;
  opacity: .6;
  display: block;
  margin-top: 4px;
  text-align: right;
}
.bubble-ai {
  font-size: .6rem;
  opacity: .65;
  margin-top: 2px;
}
.bubble-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-light);
  align-items: center;
}
.chat-input {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-size: .85rem;
  font-family: var(--font-sans);
  outline: none;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── CONTACT PANEL ──────────────────────────────────────── */
.contact-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  text-align: center;
}
.contact-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 auto var(--space-sm);
}
.contact-name {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 2px;
}
.contact-phone {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.contact-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .8rem;
}
.contact-row:last-child { border-bottom: none; }
.contact-row-label { color: var(--text-muted); }
.contact-row-value { font-weight: 500; }

/* ── QUICK CHIPS ────────────────────────────────────────── */
.quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-light);
}
.quick-chip {
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  background: var(--surface);
}
.quick-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-mist); }

/* ── CONNECTIONS GRID ───────────────────────────────────── */
.connections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.connect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
}
.connect-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.connect-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--space-md);
}
.connect-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.connect-card-info h4 {
  font-weight: 600;
  font-size: .92rem;
}
.connect-card-info p {
  font-size: .78rem;
  color: var(--text-muted);
}
.connect-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
  margin-bottom: var(--space-md);
}
.connect-status.connected {
  background: var(--green-soft);
  color: var(--green);
}
.connect-status.disconnected {
  background: var(--surface-hover);
  color: var(--text-muted);
}
.connect-status .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.connect-status.connected .dot { background: var(--green); }
.connect-status.disconnected .dot { background: var(--text-muted); }
.connect-card-desc { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--space-md); }

/* ── TYPING INDICATOR ───────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

/* ── SENTIMENT BARS ─────────────────────────────────────── */
.sentiment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sentiment-star {
  font-size: .72rem;
  width: 46px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.sentiment-bar-wrap {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.sentiment-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .8s ease;
}
.sentiment-fill.s5 { background: #22c55e; }
.sentiment-fill.s4 { background: #4ade80; }
.sentiment-fill.s3 { background: var(--reviews); }
.sentiment-fill.s2 { background: #f97316; }
.sentiment-fill.s1 { background: var(--red); }
.sentiment-count {
  font-size: .7rem;
  color: var(--text-muted);
  width: 24px;
  text-align: right;
}

/* ── REVIEW CARD ────────────────────────────────────────── */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
}
.review-card:hover { border-color: var(--border); }
.review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.review-card-author {
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 2px;
}
.review-card-stars {
  letter-spacing: 2px;
  font-size: .88rem;
}
.review-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .7rem;
  color: var(--text-muted);
}
.review-card-text {
  font-size: .84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

/* ── INSTAGRAM POST CARDS ───────────────────────────────── */
.creatives-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.creative-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: all .15s;
  cursor: pointer;
}
.creative-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.creative-preview {
  height: 140px;
  background: linear-gradient(135deg, var(--surface-hover), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}
.creative-info { padding: var(--space-sm) var(--space-md); }
.creative-name {
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.creative-stats {
  display: flex;
  gap: var(--space-md);
  font-size: .72rem;
  color: var(--text-muted);
}

/* ── CALENDAR ───────────────────────────────────────────── */
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}
.cal-nav h3 { font-weight: 600; font-size: .95rem; }
.cal-nav-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  font-size: .85rem;
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-header-day {
  text-align: center;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  min-height: 68px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-light);
  padding: 6px;
  background: var(--surface);
  cursor: pointer;
  transition: all .12s;
}
.cal-day:hover { border-color: var(--accent); background: var(--accent-mist); }
.cal-day.today { border-color: var(--accent); }
.cal-day-num {
  font-size: .7rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text-muted);
}
.cal-day.today .cal-day-num { color: var(--accent); }
.cal-event {
  font-size: .6rem;
  padding: 1px 5px;
  border-radius: 2px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.post { background: var(--instagram-bg); color: var(--instagram); }
.cal-event.reserva { background: var(--accent-mist); color: var(--accent); }
.cal-event.review { background: var(--reviews-bg); color: var(--reviews); }

/* ── TABLE ──────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--card-p);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.table-header h3 { font-weight: 600; font-size: .88rem; }
.table-scroll { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
}
table.data-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
table.data-table td {
  padding: 10px 14px;
  font-size: .84rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--surface-hover); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 600;
}
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; }
.status-pill.active { background: var(--green-soft); color: var(--green); }
.status-pill.active .dot { background: var(--green); }
.status-pill.paused { background: var(--reviews-bg); color: var(--reviews); }
.status-pill.paused .dot { background: var(--reviews); }
.status-pill.draft { background: var(--surface-hover); color: var(--text-muted); }
.status-pill.draft .dot { background: var(--text-muted); }

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--card-p);
  border-top: 1px solid var(--border-light);
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── FILTER TABS ────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 3px;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  padding: 2px;
}
.filter-tab {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-muted);
  border: none;
  background: none;
  font-family: var(--font-sans);
}
.filter-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ── TEMPLATE GRID ──────────────────────────────────────── */
.template-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s;
  gap: 10px;
}
.template-item:hover { border-color: var(--accent); background: var(--accent-mist); }
.template-name {
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
}
.template-text { font-size: .78rem; color: var(--text-secondary); line-height: 1.5; }

/* ── WEBHOOK BOX ────────────────────────────────────────── */
.webhook-box {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .8rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.webhook-copy-btn {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--accent-mist);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .12s;
}
.webhook-copy-btn:hover { background: var(--accent); color: white; }

/* ── TOGGLE SETTINGS ROW ────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row-label h4 { font-size: .85rem; font-weight: 600; margin-bottom: 1px; }
.toggle-row-label p { font-size: .72rem; color: var(--text-muted); }

/* ── SETTINGS CARD ──────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
}
.settings-section-title {
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: var(--space-md);
}

/* ── FORM ELEMENTS ──────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .88rem;
  transition: all .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { opacity: .9; box-shadow: var(--shadow-sm); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-mist); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-hover); }
.btn-sm { padding: 6px 14px; font-size: .78rem; }
.btn-xs { padding: 4px 10px; font-size: .7rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.96) translateY(8px);
  transition: transform .2s;
  box-shadow: var(--shadow-xl);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-weight: 600; font-size: 1rem; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  font-size: .9rem;
}
.modal-close:hover { border-color: var(--accent); color: var(--text); }
.modal-body { padding: var(--space-lg); }
.modal-footer {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── SEARCH OVERLAY ─────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  backdrop-filter: blur(4px);
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(.96) translateY(-8px);
  transition: transform .15s;
}
.search-overlay.open .search-box { transform: scale(1) translateY(0); }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}
.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font-sans);
}
.search-results { padding: 8px 0; max-height: 300px; overflow-y: auto; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  cursor: pointer;
  transition: background .1s;
}
.search-result-item:hover { background: var(--surface-hover); }
.search-result-icon { font-size: .9rem; width: 22px; text-align: center; flex-shrink: 0; }
.search-result-text { font-size: .85rem; }
.search-result-sub { font-size: .7rem; color: var(--text-muted); }
.search-kbd {
  font-size: .62rem;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .84rem;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
  min-width: 280px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast-remove { animation: toastOut .2s ease forwards; }
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(16px); }
}

/* ── NOTIFICATION DROPDOWN ──────────────────────────────── */
.notif-wrap { position: relative; }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}
.notif-header h4 { font-weight: 600; font-size: .85rem; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-hover); }
.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.notif-text { font-size: .8rem; line-height: 1.4; }
.notif-time { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon { font-size: 2rem; margin-bottom: 12px; opacity: .35; }
.empty-state h3 { font-weight: 600; font-size: .95rem; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: .8rem; color: var(--text-muted); margin-bottom: var(--space-md); }

/* ── SKELETON ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-card { height: 90px; border-radius: var(--r-md); }
.skeleton-text { height: 12px; margin-bottom: 8px; width: 60%; }

/* ── RECOMMENDATIONS ────────────────────────────────────── */
.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recommendation-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all .1s;
}
.recommendation-item:hover { border-color: var(--accent); }
.recommendation-icon { font-size: 1.1rem; flex-shrink: 0; }
.recommendation-title { font-size: .82rem; font-weight: 600; margin-bottom: 2px; }
.recommendation-text { font-size: .75rem; color: var(--text-muted); line-height: 1.5; }

/* ── ONBOARDING ─────────────────────────────────────────── */
.onboarding-card {
  background: var(--accent-mist);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  padding: var(--card-p);
}
.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}
.onboarding-header h3 { font-weight: 600; font-size: .9rem; }
.onboarding-progress { font-size: .75rem; color: var(--text-muted); }
.onboarding-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  padding: 4px 0;
}
.onboarding-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .5rem;
}
.onboarding-check.done { background: var(--green); border-color: var(--green); color: white; }

/* ── SYSTEM STATUS ──────────────────────────────────────── */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .82rem;
}
.status-row:last-child { border-bottom: none; }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-dot.up { background: var(--green); }
.status-dot.down { background: var(--red); }

/* ── TWEKS PANEL ────────────────────────────────────────── */
.tweaks-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  transition: all .15s;
}
.tweaks-toggle:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }

.tweaks-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 70;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
}
.tweaks-panel.open { transform: translateX(0); }

.tweaks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tweaks-header h3 { font-weight: 600; font-size: .95rem; }
.tweaks-close {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tweaks-group-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.tweak-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .1s;
  border: 1px solid transparent;
}
.tweak-option:hover { background: var(--surface-hover); }
.tweak-option.active { border-color: var(--accent); background: var(--accent-mist); }

.tweak-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.tweak-label {
  font-size: .82rem;
  font-weight: 500;
  flex: 1;
}

/* ── SIDEBAR OVERLAY (mobile) ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.4);
  z-index: 49;
}
.sidebar-overlay.show { display: block; }

/* ── HASHTAGS ───────────────────────────────────────────── */
.hashtag-groups { display: flex; flex-direction: column; gap: 8px; }
.hashtag-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.hashtag-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.hashtag-group-name { font-size: .82rem; font-weight: 600; }
.hashtag-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.hashtag-pill {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--accent-mist);
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* ── PHONE MOCKUP ───────────────────────────────────────── */
.phone-mockup {
  width: 200px;
  height: 400px;
  border-radius: 28px;
  border: 4px solid var(--border);
  background: var(--base);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-shrink: 0;
}
.phone-screen { height: 100%; display: flex; flex-direction: column; }
.phone-header {
  padding: 10px;
  background: var(--wa);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .agent-cards { grid-template-columns: repeat(2, 1fr); }
  .creatives-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .connections-grid { grid-template-columns: 1fr; }
  .creatives-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  /* Responsive Data Tables */
  .data-table thead { display: none; }
  .data-table tr { display: block; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 4px; }
  .data-table td { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-light); padding: 12px 16px !important; text-align: right; }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-align: left; margin-right: 12px; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 var(--space-md); }
  .topbar-search { max-width: 160px; }
  .topbar-search input { font-size: .78rem; }
  .content { padding: var(--space-md); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .agent-cards { grid-template-columns: 1fr; }
  .agent-stats { grid-template-columns: 1fr; }
  .creatives-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 48px; }
  .tweaks-panel { width: 100%; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .topbar-ai-btn span { display: none; }
}

/* ── SPARKLINE HELPERS ──────────────────────────────────── */
.sparkline-green { stroke: var(--green); fill: oklch(from var(--green) l c h / 0.1); }
.sparkline-accent { stroke: var(--accent); fill: oklch(from var(--accent) l c h / 0.1); }
.sparkline-amber { stroke: var(--reviews); fill: oklch(from var(--reviews) l c h / 0.1); }

/* ════════════════════════════════════════════════════════════
   ZENYX 4.0 — New Features
   ════════════════════════════════════════════════════════════ */

/* ── Voice AI ─────────────────────────────── */
.voice-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.voice-call-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.voice-call-log table {
  width: 100%;
  border-collapse: collapse;
}
.voice-call-log th {
  padding: 8px 14px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.voice-call-log td {
  padding: 10px 14px;
  font-size: .84rem;
  border-bottom: 1px solid var(--border-light);
}
.voice-call-log tr:last-child td { border-bottom: none; }
.voice-call-log tr:hover td { background: var(--surface-hover); }
.voice-settings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
}
.voice-minutes-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.voice-minutes-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width .6s ease;
}
.call-result {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 600;
}
.call-result.completed { background: var(--green-soft); color: var(--green); }
.call-result.missed { background: var(--red-soft); color: var(--red); }
.call-result.transferred { background: var(--amber-soft); color: var(--amber); }

/* ── Waitlist ─────────────────────────────── */
.waitlist-toggle {
  display: flex;
  gap: 3px;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  padding: 2px;
}
.waitlist-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.waitlist-table table {
  width: 100%;
  border-collapse: collapse;
}
.waitlist-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.waitlist-table td {
  padding: 10px 14px;
  font-size: .84rem;
  border-bottom: 1px solid var(--border-light);
}
.waitlist-table tr:last-child td { border-bottom: none; }
.waitlist-table tr:hover td { background: var(--surface-hover); }
.waitlist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
}
.waitlist-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 600;
}
.waitlist-status.waiting { background: var(--amber-soft); color: var(--amber); }
.waitlist-status.seated { background: var(--green-soft); color: var(--green); }
.waitlist-status.cancelled { background: var(--surface-hover); color: var(--text-muted); }
.waitlist-notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  background: var(--accent-mist);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .12s;
}
.waitlist-notify-btn:hover { background: var(--accent); color: white; }

/* ── Reminders ────────────────────────────── */
.reminder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
}
.reminder-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.reminder-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.reminder-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.reminder-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.reminder-toggle .toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background .2s;
}
.reminder-toggle .toggle-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.15);
}
.reminder-toggle input:checked + .toggle-track { background: var(--accent); }
.reminder-toggle input:checked + .toggle-track::before { transform: translateX(16px); }
.reminder-settings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
}

/* ── Campaigns ────────────────────────────── */
.campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.campaign-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.campaign-table table {
  width: 100%;
  border-collapse: collapse;
}
.campaign-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.campaign-table td {
  padding: 10px 14px;
  font-size: .84rem;
  border-bottom: 1px solid var(--border-light);
}
.campaign-table tr:last-child td { border-bottom: none; }
.campaign-table tr:hover td { background: var(--surface-hover); }
.campaign-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 600;
}
.campaign-status.active { background: var(--green-soft); color: var(--green); }
.campaign-status.paused { background: var(--amber-soft); color: var(--amber); }
.campaign-status.draft { background: var(--surface-hover); color: var(--text-muted); }
.campaign-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
}
.campaign-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}
.campaign-modal-header h3 { font-weight: 600; font-size: 1rem; }
.campaign-modal-body { padding: var(--space-lg); }
.campaign-modal-footer {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Deposits ─────────────────────────────── */
.deposit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
}
.deposit-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.stripe-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
}
.stripe-status.connected { background: var(--green-soft); color: var(--green); }
.stripe-status.disconnected { background: var(--surface-hover); color: var(--text-muted); }
.stripe-status .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.stripe-status.connected .dot { background: var(--green); }
.stripe-status.disconnected .dot { background: var(--text-muted); }
.deposit-amounts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.deposit-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  transition: all .15s;
}
.deposit-amount:hover { border-color: var(--accent); }
.deposit-amount.active { border-color: var(--accent); background: var(--accent-mist); color: var(--accent); font-weight: 600; }
.deposit-amount input[type="radio"] { accent-color: var(--accent); }
.deposit-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.deposit-history table {
  width: 100%;
  border-collapse: collapse;
}
.deposit-history th {
  padding: 8px 14px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.deposit-history td {
  padding: 10px 14px;
  font-size: .84rem;
  border-bottom: 1px solid var(--border-light);
}
.deposit-history tr:last-child td { border-bottom: none; }
.deposit-history tr:hover td { background: var(--surface-hover); }

/* ── QR Menu ──────────────────────────────── */
.qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
  transition: all .15s;
}
.qr-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.qr-display {
  width: 200px;
  height: 200px;
  background: var(--base);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}
.qr-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: .82rem;
  text-decoration: none;
  transition: all .15s;
}
.qr-preview:hover { border-color: var(--accent); color: var(--accent); }
.qr-customize {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
}

/* ── Benchmarks ───────────────────────────── */
.benchmark-section { margin-bottom: var(--space-lg); }
.benchmark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.benchmark-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-p);
}
.benchmark-bar {
  height: 8px;
  border-radius: var(--r-full);
  transition: width .6s ease;
  margin-bottom: 4px;
}
.benchmark-bar.you { background: var(--accent); }
.benchmark-bar.avg { background: var(--text-muted); opacity: .4; }
.benchmark-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.benchmark-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
}

/* ── Toggle Switch ────────────────────────── */
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch .toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background .25s;
}
.toggle-switch .toggle-knob {
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform .25s;
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.15);
}
.toggle-switch.active .toggle-track { background: var(--green); }
.toggle-switch.active .toggle-knob { transform: translateX(18px); }

/* ════════════════════════════════════════════════════════════
   ZENYX v3.1 — Staff · Upgrade · Usage · Stripe
   ════════════════════════════════════════════════════════════ */

/* ── Pulsing Dot ──────────────────────────── */
.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

/* ── Staff list items ─────────────────────── */
.staff-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-sm) var(--card-p);
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}
.staff-list-item:last-child { border-bottom: none; }
.staff-list-item:hover { background: var(--surface-hover); }
.staff-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  flex-shrink: 0;
  color: white;
}
.staff-name {
  font-weight: 600;
  font-size: .85rem;
}
.staff-meta {
  font-size: .72rem;
  color: var(--text-muted);
}

/* ── Pricing Grid (Upgrade modal) ─────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: var(--space-lg);
}
.pricing-card {
  background: var(--surface-hover);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
  transition: all .15s;
}
.pricing-card:hover { border-color: var(--accent); }
.pricing-card.featured {
  background: var(--accent-mist);
  border: 2px solid var(--accent);
  position: relative;
}
.pricing-card-tier {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pricing-card.featured .pricing-card-tier { color: var(--accent); }
.pricing-card-price {
  font-size: 1.5rem;
  font-weight: 700;
}
.pricing-card-desc {
  font-size: .72rem;
  color: var(--text-muted);
  margin: 8px 0;
}
.pricing-card-features {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .72rem;
  color: var(--text-muted);
}
.pricing-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-top: 8px;
}

/* ── Usage stat grid (AI usage modal) ─────── */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: var(--space-md);
}
.usage-stat {
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  padding: 12px;
  text-align: center;
}
.usage-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
}
.usage-stat-label {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ── Daily usage bar rows ─────────────────── */
.usage-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .78rem;
}
.usage-bar-row:last-child { border-bottom: none; }
.usage-bar-day {
  min-width: 80px;
  color: var(--text-muted);
}
.usage-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .6s ease;
}
.usage-bar-tokens {
  min-width: 60px;
  text-align: right;
  font-weight: 600;
}
.usage-bar-calls {
  min-width: 40px;
  text-align: right;
  color: var(--text-muted);
}

/* ── AI Forecast card ─────────────────────── */
.forecast-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.06) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--r-md);
}
.forecast-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

/* ── Empty fallback for list areas ─────────── */
.list-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .usage-grid { grid-template-columns: 1fr; }
}

/* ── Staff & Scheduling Styles (v3.1) ────────────────────── */
.staff-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.staff-day-col {
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.staff-day-col.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.staff-day-header {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.staff-day-header .day-name { font-size: .65rem; font-weight: 700; color: var(--text-muted); }
.staff-day-header .day-num { font-size: 1.1rem; font-weight: 700; }
.staff-day-header .day-ia { font-size: .68rem; color: var(--accent); font-weight: 600; margin-top: 2px; }

.staff-day-slots { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.staff-turno {
  padding: 8px;
  background: var(--base);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--border);
  font-size: .75rem;
}
.turno-time { font-weight: 700; font-size: .7rem; margin-bottom: 2px; }
.turno-staff { font-weight: 600; }
.turno-role { font-size: .65rem; color: var(--text-muted); }

/* ── Role Menu ─────────────────────────────────────────── */
.sidebar-user { position: relative; cursor: pointer; }
.role-menu {
  position: absolute;
  bottom: 100%;
  left: 10px;
  right: 10px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  margin-bottom: 8px;
  z-index: 100;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.role-menu-item {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .2s;
}
.role-menu-item:hover { background: var(--surface-hover); }

/* ── Responsive Tables (v3.1) ─────────────────────────── */
@media (max-width: 768px) {
  .staff-week-grid { grid-template-columns: 1fr; }
  .staff-day-col { min-height: auto; }
  
  .data-table thead { display: none; }
  .data-table tr { display: block; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 8px; }
  .data-table td { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border-light); text-align: right; }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: .75rem; text-align: left; }
}

