/* ═══════════════════════════════════════════════════
   AI WhatsApp Bot — Complete Design System
   Dark Mode · Glassmorphism · Premium UI
═══════════════════════════════════════════════════ */

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #10b981;
  --accent: #f43f5e;
  
  --bg-app: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --bg-panel-solid: #1e293b;
  --bg-hover: rgba(255, 255, 255, 0.05);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --border: rgba(255, 255, 255, 0.1);
  --border-focus: #6366f1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.3);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', var(--font-main);
  
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ─── SETUP WIZARD ─── */
.setup-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: linear-gradient(135deg, #0a0d14 0%, #111827 50%, #0d1a2e 100%);
  display: flex; align-items: center; justify-content: center;
}
.setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease;
}
.setup-logo { text-align: center; margin-bottom: 32px; }
.bot-avatar-lg { font-size: 56px; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }
.setup-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.setup-logo p { color: var(--text-muted); margin-top: 4px; }
.setup-form { display: flex; flex-direction: column; gap: 16px; }

/* ─── LAYOUT ─── */
.app-container { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 280px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 100;
}
.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.bot-icon { font-size: 28px; animation: float 4s ease-in-out infinite; }
.sidebar-logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800; font-size: 13px;
  color: var(--gold); letter-spacing: 0.5px;
  line-height: 1.2;
}
.sidebar-logo-sub { font-size: 10px; color: var(--text-muted); }

.live-status {
  margin: 10px 16px;
  padding: 7px 12px;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--green);
}
.live-dot {
  width: 7px; height: 7px;
  background: var(--green); border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.nav-section-label {
  font-size: 9px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 1.5px; padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary);
  transition: all 0.2s; font-size: 13px; font-weight: 500;
  position: relative; text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(168,85,247,0.1) 100%);
  color: var(--blue-light);
  border-left: 2px solid var(--blue);
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 10px; min-width: 18px; text-align: center;
}
.nav-badge-gold { background: var(--gold); color: #000; }
.nav-badge-green { background: var(--green); color: #000; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-muted); }
.btn-logout {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; padding: 6px 8px;
  transition: all 0.2s; font-size: 14px;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  overflow-y: auto;
}
.main-content.expanded { margin-left: 0; }

/* ─── TOPBAR ─── */
.topbar {
  height: 70px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; padding: 6px 10px; font-size: 16px;
  transition: all 0.2s;
}
.sidebar-toggle:hover { color: var(--text-primary); border-color: var(--border-light); }
.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px; font-weight: 700; color: var(--text-primary); flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: 12px; color: var(--text-muted); }
.mode-switch-control {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; border: 1px solid var(--border);
  border-radius: 18px; background: var(--bg-card);
  font-size: 11px; font-weight: 700; color: var(--text-muted);
}
.mode-switch-control > span.active { color: var(--green); }
.mode-switch-control > span:last-child.active { color: #a855f7; }
.mode-switch-control .mode-toggle { width: 38px; height: 20px; }
.mode-switch-control .mode-toggle .toggle-slider:before { width: 14px; height: 14px; }
.mode-switch-control .mode-toggle input:checked + .toggle-slider { background: #7c3aed; border-color: #7c3aed; }
.mode-switch-control .mode-toggle input:checked + .toggle-slider:before { transform: translateX(18px); }
.notif-bell {
  position: relative; font-size: 18px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.notif-bell:hover { background: var(--bg-hover); }
.notif-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 4px; border-radius: 8px; min-width: 16px; text-align: center;
}

/* ─── NOTIFICATION PANEL ─── */
.notif-panel {
  position: absolute; top: var(--topbar-h); right: 16px;
  width: 320px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 300;
  animation: fadeInDown 0.2s ease;
}
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.notif-panel-header button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 12px;
}
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
  transition: background 0.2s; cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item-icon { font-size: 18px; flex-shrink: 0; }
.notif-item-text { font-size: 12px; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── PAGE CONTENT ─── */
.page-content { flex: 1; padding: 24px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 800; color: var(--text-primary);
  background: linear-gradient(135deg, #e8eaf6, var(--blue-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 6px 32px rgba(0,0,0,0.5); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-weight: 700; font-size: 14px; color: var(--text-primary); letter-spacing: 0.3px; }

/* ─── KPI GRID ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  cursor: default;
  transition: all 0.3s;
}
.kpi-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.kpi-card.green::before  { background: linear-gradient(90deg, var(--green), #2dd4bf); }
.kpi-card.blue::before   { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.kpi-card.gold::before   { background: linear-gradient(90deg, var(--gold), #fb923c); }
.kpi-card.red::before    { background: linear-gradient(90deg, var(--red), var(--pink)); }
.kpi-card.purple::before { background: linear-gradient(90deg, var(--purple), var(--cyan)); }
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.kpi-icon { font-size: 28px; margin-bottom: 8px; }
.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.kpi-value { font-family: 'Outfit', sans-serif; font-size: 32px; font-weight: 800; color: var(--text-primary); margin: 4px 0; line-height: 1; }
.kpi-sub { font-size: 11px; color: var(--text-muted); }
.kpi-change { font-size: 11px; font-weight: 600; margin-top: 6px; }
.kpi-change.up { color: var(--green); }
.kpi-change.down { color: var(--red); }
.kpi-glow {
  position: absolute; bottom: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.06;
}
.kpi-card.green .kpi-glow { background: var(--green); }
.kpi-card.blue .kpi-glow  { background: var(--blue); }
.kpi-card.gold .kpi-glow  { background: var(--gold); }
.kpi-card.red .kpi-glow   { background: var(--red); }
.kpi-card.purple .kpi-glow{ background: var(--purple); }

/* ─── CHARTS ─── */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px; margin-bottom: 16px;
}
.chart-card { padding: 20px; }
.chart-card-sm { padding: 20px; }
.chart-legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.live-chip {
  font-size: 10px; font-weight: 700; color: var(--green);
  background: rgba(37,211,102,0.1); border: 1px solid rgba(37,211,102,0.2);
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.5px;
}

/* ─── ACTIVITY FEED ─── */
.activity-feed { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; background: var(--bg-surface);
  border-radius: var(--radius-sm); border-left: 3px solid transparent;
  animation: slideIn 0.3s ease;
}
.activity-item.msg { border-color: var(--green); }
.activity-item.lead { border-color: var(--gold); }
.activity-item.payment { border-color: var(--blue); }
.activity-item.admission { border-color: var(--purple); }
.activity-icon { font-size: 16px; flex-shrink: 0; }
.activity-text { flex: 1; font-size: 12px; }
.activity-name { font-weight: 600; color: var(--text-primary); }
.activity-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ─── CONVERSATIONS ─── */
.conv-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
}
.conv-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.conv-search-bar { padding: 12px; border-bottom: 1px solid var(--border); }
.conv-search-bar input { width: 100%; }
.conv-filters {
  display: flex; gap: 4px; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.conv-filter-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 4px 10px; border-radius: 20px;
  font-size: 11px; cursor: pointer; transition: all 0.2s;
}
.conv-filter-btn.active, .conv-filter-btn:hover {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
.conv-list { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s; position: relative;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: rgba(99,102,241,0.1); border-left: 2px solid var(--blue); }
.conv-item.unread .conv-preview { font-weight: 600; color: var(--text-primary); }
.conv-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #2dd4bf);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0;
}
.conv-meta { flex: 1; min-width: 0; }
.conv-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.conv-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-time { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.conv-badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.conv-badge-chip {
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}
.chip-voice { background: rgba(168,85,247,0.2); color: var(--purple); }
.chip-lead  { background: rgba(245,166,35,0.2); color: var(--gold); }
.chip-admitted { background: rgba(37,211,102,0.2); color: var(--green); }
.unread-dot {
  width: 8px; height: 8px; background: var(--blue); border-radius: 50%;
  position: absolute; top: 14px; right: 14px;
}

/* Chat View */
.conv-view-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}
.conv-view-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); gap: 12px;
}
.empty-icon { font-size: 48px; opacity: 0.3; }
.conv-view-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
}
.conv-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.01'%3E%3Ccircle cx='3' cy='3' r='1'/%3E%3C/g%3E%3C/svg%3E");
}
.msg-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 16px;
  font-size: 13px; line-height: 1.5; animation: fadeInUp 0.2s ease;
}
.msg-bubble.user {
  background: rgba(37,211,102,0.15); border: 1px solid rgba(37,211,102,0.2);
  color: var(--text-primary); align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-bubble.bot {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(99,102,241,0.2);
  color: var(--text-primary); align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-bubble.voice-note {
  background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2);
}
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-align: right; }
.msg-label { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.voice-note-btn {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 0;
}
.voice-note-btn .play-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--purple); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 10px;
}
.voice-waveform-mini {
  height: 24px; display: flex; align-items: center; gap: 2px;
}
.waveform-bar {
  width: 3px; background: var(--purple); border-radius: 2px;
  animation: waveAnim 1.2s ease-in-out infinite;
}
.emotion-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; margin-top: 4px;
}
.emotion-happy { background: rgba(37,211,102,0.1); color: var(--green); }
.emotion-sad { background: rgba(99,102,241,0.1); color: var(--blue-light); }
.emotion-angry { background: rgba(239,68,68,0.1); color: var(--red); }
.emotion-neutral { background: rgba(90,106,138,0.1); color: var(--text-muted); }
.emotion-excited { background: rgba(245,166,35,0.1); color: var(--gold); }
.emotion-confused { background: rgba(168,85,247,0.1); color: var(--purple); }

.conv-view-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--bg-card2);
}
.conv-user-info { display: flex; gap: 16px; flex-wrap: wrap; }
.conv-info-chip {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}

/* ─── KANBAN BOARD ─── */
.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.pipeline-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  text-align: center;
}
.pipeline-stat-num { font-family: 'Outfit',sans-serif; font-size: 24px; font-weight: 800; }
.pipeline-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  min-height: 400px;
}
.kanban-col {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
}
.kanban-col-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-col-title { font-size: 12px; font-weight: 700; }
.kanban-col-count {
  font-size: 11px; background: var(--bg-surface);
  padding: 1px 8px; border-radius: 10px; color: var(--text-muted);
}
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  cursor: pointer; transition: all 0.2s;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.4); border-color: var(--border-light); }
.kanban-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.kanban-phone { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.kanban-program { font-size: 10px; background: rgba(99,102,241,0.1); color: var(--blue-light); padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 6px; }
.kanban-score { font-size: 10px; color: var(--gold); font-weight: 700; margin-top: 4px; }
.kanban-date { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.kanban-chat-btn { width: 100%; margin-top: 10px; }

/* ─── ENTRY TEST CALENDAR ─── */
.test-layout {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 16px; margin-bottom: 20px;
}
.test-calendar-card, .test-slots-card { min-height: 340px; }
.cal-nav {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600;
}
.cal-nav button {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); cursor: pointer; padding: 4px 10px; font-size: 16px;
  transition: all 0.2s;
}
.cal-nav button:hover { color: var(--text-primary); border-color: var(--border-light); }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; padding: 8px 0;
}
.cal-day-label {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-muted); padding: 4px 0; letter-spacing: 0.5px;
}
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; border-radius: 8px;
  cursor: pointer; transition: all 0.2s; font-size: 12px;
  position: relative;
}
.cal-day:hover { background: var(--bg-hover); }
.cal-day.today { background: rgba(99,102,241,0.15); color: var(--blue-light); font-weight: 700; }
.cal-day.has-test { background: rgba(37,211,102,0.1); }
.cal-day.selected { background: var(--blue); color: #fff !important; }
.cal-day-num { font-size: 12px; }
.cal-test-dot { width: 5px; height: 5px; background: var(--green); border-radius: 50%; margin-top: 2px; }
.cal-day.other-month { opacity: 0.3; }

.test-slots-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.test-slot {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.slot-time { font-weight: 600; font-size: 13px; }
.slot-capacity { font-size: 11px; color: var(--text-muted); }
.slot-bar { height: 4px; background: var(--bg-card); border-radius: 2px; margin-top: 6px; }
.slot-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width 0.5s; }

/* ─── TABLES ─── */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg-surface); color: var(--text-muted);
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-primary);
}
.data-table tr:hover td { background: var(--bg-hover); }
.data-table tr:last-child td { border-bottom: none; }
.table-count { font-size: 12px; color: var(--text-muted); padding: 8px 0; text-align: right; }

/* Status Badges */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.status-active    { background: rgba(37,211,102,0.1); color: var(--green); }
.status-pending   { background: rgba(245,166,35,0.1); color: var(--gold); }
.status-scheduled { background: rgba(99,102,241,0.1); color: var(--blue-light); }
.status-sent      { background: rgba(34,211,238,0.1); color: var(--cyan); }
.status-enrolled  { background: rgba(37,211,102,0.15); color: var(--green); }
.status-rejected  { background: rgba(239,68,68,0.1); color: var(--red); }
.status-verified  { background: rgba(37,211,102,0.1); color: var(--green); }
.status-unverified{ background: rgba(245,166,35,0.1); color: var(--gold); }
.status-demo      { background: rgba(168,85,247,0.1); color: var(--purple); }

/* ─── FORMS ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-primary); font-size: 13px; outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select option { background: var(--bg-card); }

/* ─── BUTTONS ─── */
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-outline:hover { border-color: var(--border-light); color: var(--text-primary); }
.btn-green {
  background: linear-gradient(135deg, var(--green), #2dd4bf);
  color: #000; border: none; border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-green:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-red {
  background: var(--red); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 6px 10px; }

/* ─── AI SETTINGS ─── */
.ai-settings-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.ai-card { padding: 20px; }
.ai-card-wide { grid-column: span 2; }
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toggle-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-input); border-radius: 24px;
  transition: 0.3s; border: 1px solid var(--border);
}
.toggle-slider:before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 2px; bottom: 2px;
  background: var(--text-muted); border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); border-color: var(--green); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: #fff; }

.personality-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.personality-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
  cursor: pointer; transition: all 0.2s; font-size: 11px; color: var(--text-muted);
}
.personality-card div:first-child { font-size: 22px; margin-bottom: 4px; }
.personality-card:hover { border-color: var(--blue-light); color: var(--text-primary); }
.personality-card.active { border-color: var(--blue); background: rgba(99,102,241,0.1); color: var(--blue-light); }

.lang-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip-check {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; cursor: pointer;
  font-size: 12px; transition: all 0.2s;
}
.chip-check:has(input:checked) { border-color: var(--green); background: rgba(37,211,102,0.08); color: var(--green); }
.chip-check input { accent-color: var(--green); }

.pass-field { display: flex; gap: 8px; }
.pass-field input { flex: 1; }
.pass-field button {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px;
  cursor: pointer; font-size: 16px;
}

.api-status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; background: var(--bg-surface); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; margin-top: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.error { background: var(--red); }
.status-dot.demo { background: var(--purple); box-shadow: 0 0 6px var(--purple); }

.range-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
input[type=range] { width: 100%; accent-color: var(--blue); }

/* Templates */
.templates-list { display: flex; flex-direction: column; gap: 8px; }
.template-item {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.template-icon { font-size: 20px; }
.template-content { flex: 1; }
.template-name { font-size: 13px; font-weight: 600; }
.template-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.template-actions { display: flex; gap: 6px; }
.template-edit-btn, .template-del-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; font-size: 11px; transition: all 0.2s;
}
.template-del-btn:hover { color: var(--red); border-color: var(--red); }
.template-edit-btn:hover { color: var(--blue-light); border-color: var(--blue); }

/* ─── SETTINGS ─── */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.info-box { display: flex; flex-direction: column; gap: 8px; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.info-row strong { color: var(--text-primary); font-size: 12px; font-family: 'Courier New', monospace; }
.programs-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; margin-bottom: 4px; }
.program-tag {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 12px;
}
.program-tag button {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0;
}
.program-tag button:hover { color: var(--red); }

/* ─── ANALYTICS ─── */
.analytics-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.top-inquiries { display: flex; flex-direction: column; gap: 8px; }
.inquiry-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg-surface); border-radius: var(--radius-sm); }
.inquiry-rank { font-family: 'Outfit',sans-serif; font-size: 18px; font-weight: 800; color: var(--gold); width: 28px; }
.inquiry-label { flex: 1; font-size: 13px; }
.inquiry-bar-wrap { width: 120px; height: 6px; background: var(--bg-card); border-radius: 3px; }
.inquiry-bar { height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple)); border-radius: 3px; }
.inquiry-count { font-size: 12px; color: var(--text-muted); min-width: 32px; text-align: right; }

/* ─── PAYMENTS / VISITS / ADMISSION KPI ─── */
.payment-kpi, .visit-kpi, .admission-kpi {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: fadeInUp 0.3s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: all 0.2s;
}
.modal-close:hover { color: var(--red); background: rgba(239,68,68,0.1); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ─── VOICE OVERLAY ─── */
.voice-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px); z-index: 600;
  display: flex; align-items: center; justify-content: center;
}
.voice-player-card {
  background: var(--bg-card); border: 1px solid rgba(168,85,247,0.3);
  border-radius: var(--radius-lg); padding: 32px;
  width: 100%; max-width: 440px; text-align: center;
  box-shadow: 0 0 60px rgba(168,85,247,0.2);
  animation: fadeInUp 0.3s ease;
}
.voice-player-name { font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.voice-waveform {
  display: flex; align-items: center; justify-content: center;
  gap: 3px; height: 60px; margin-bottom: 16px;
}
.voice-transcript { font-size: 14px; color: var(--text-secondary); font-style: italic; margin-bottom: 10px; line-height: 1.5; }
.voice-emotion { font-size: 12px; color: var(--text-muted); }

/* ─── TOASTS ─── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow); min-width: 240px; max-width: 340px;
  animation: slideInRight 0.3s ease;
  border-left: 3px solid var(--blue);
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--gold); }
.toast.info    { border-left-color: var(--blue); }
.toast-msg { font-size: 13px; flex: 1; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }

/* ─── SEARCH INPUTS ─── */
.search-input-sm {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  color: var(--text-primary); font-size: 12px; outline: none;
  transition: border-color 0.2s; min-width: 160px;
}
.search-input-sm:focus { border-color: var(--blue); }
.select-sm {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  color: var(--text-primary); font-size: 12px; outline: none;
  cursor: pointer;
}
.filter-search-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 14px;
  color: var(--text-primary); outline: none; width: 100%;
  font-size: 13px; transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
.filter-search-input:focus { border-color: var(--blue); }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; color: var(--text-muted); padding: 32px; font-size: 13px; }

/* ─── RECENT CONVERSATIONS (dashboard) ─── */
.recent-conv-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-bottom: 1px solid var(--border); transition: background 0.2s; cursor: pointer;
}
.recent-conv-item:hover { background: var(--bg-hover); }
.recent-conv-item:last-child { border-bottom: none; }
.rcv-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--green), #22d3ee); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; }
.rcv-name { font-size: 13px; font-weight: 600; }
.rcv-preview { font-size: 11px; color: var(--text-muted); }
.rcv-time { font-size: 10px; color: var(--text-muted); margin-left: auto; }

/* ─── MISCELLANEOUS ─── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-8 { gap: 8px; }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
@keyframes fadeInUp { from { opacity:0; transform: translateY(20px) } to { opacity:1; transform: translateY(0) } }
@keyframes fadeInDown { from { opacity:0; transform: translateY(-10px) } to { opacity:1; transform: translateY(0) } }
@keyframes slideIn { from { opacity:0; transform: translateX(-10px) } to { opacity:1; transform: translateX(0) } }
@keyframes slideInRight { from { opacity:0; transform: translateX(40px) } to { opacity:1; transform: translateX(0) } }
@keyframes float { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-6px) } }
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1) } 50% { opacity:0.6; transform:scale(0.9) } }
@keyframes waveAnim {
  0%,100% { transform: scaleY(0.3) }
  50% { transform: scaleY(1) }
}
@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }
@keyframes shimmer {
  0% { background-position: -200% 0 }
  100% { background-position: 200% 0 }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card2) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .kanban-board { grid-template-columns: repeat(3, 1fr); }
  .pipeline-stats { grid-template-columns: repeat(3, 1fr); }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .ai-card-wide { grid-column: span 1; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .charts-row { grid-template-columns: 1fr; }
  .conv-layout { grid-template-columns: 1fr; height: auto; }
  .test-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .pipeline-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .pipeline-stats { grid-template-columns: 1fr 1fr; }
  .personality-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── SETTINGS SECTION TITLES ─── */
.settings-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  margin: 28px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.settings-section-title::after {
  content: ''; flex: 1;
  height: 1px; background: linear-gradient(90deg, var(--border), transparent);
}

/* ─── FORM ROW 2-COL ─── */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }

/* ─── ADMIN PROFILE CARD ─── */
.admin-profile-card { grid-column: span 1; }

.admin-profile-header {
  display: flex; align-items: center; gap: 20px;
  padding: 20px; margin: -20px -20px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(168,85,247,0.08) 100%);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.admin-avatar-wrap { position: relative; flex-shrink: 0; }
.admin-avatar-big {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 30px; font-weight: 800; color: #fff;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
  border: 3px solid rgba(99,102,241,0.3);
}
.admin-avatar-edit {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--bg-card);
  cursor: pointer; font-size: 11px; display: flex;
  align-items: center; justify-content: center;
  transition: all 0.2s;
}
.admin-avatar-edit:hover { transform: scale(1.1); background: var(--green); }
.admin-profile-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 800; color: var(--text-primary);
}
.admin-profile-role {
  font-size: 12px; font-weight: 600;
  color: var(--blue-light); margin-top: 2px;
}
.admin-profile-since {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.admin-profile-form { padding-top: 4px; }

/* ─── PASSWORD STRENGTH ─── */
.pwd-strength-bar {
  height: 4px; background: var(--bg-surface);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.pwd-strength-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s, background 0.4s;
}
.pwd-strength-label {
  font-size: 11px; font-weight: 600; margin-top: 4px;
}

/* ─── QUICK NAME CHANGE ─── */
.name-change-card { padding: 20px; }
.name-change-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) { .name-change-grid { grid-template-columns: 1fr; } }
.name-change-item {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  transition: border-color 0.2s;
}
.name-change-item:hover { border-color: var(--border-light); }
.name-change-icon {
  font-size: 24px; margin-top: 18px; flex-shrink: 0;
}
.name-change-item .form-group { margin-bottom: 0; }
.name-change-item input {
  flex: 1; min-width: 0;
}

/* ─── WHATSAPP NUMBERS LIST ─── */
.wa-numbers-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 4px;
}
.wa-number-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  transition: all 0.2s;
  animation: fadeInUp 0.25s ease;
}
.wa-number-card:hover { border-color: var(--border-light); }
.wa-number-card.inactive { opacity: 0.55; }

.wa-num-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(37,211,102,0.1); border: 1px solid rgba(37,211,102,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.wa-num-icon.inactive {
  background: rgba(90,106,138,0.1); border-color: var(--border);
}
.wa-num-info { flex: 1; min-width: 0; }
.wa-num-name {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.wa-num-phone {
  font-size: 12px; color: var(--text-muted); margin-top: 1px;
  font-family: 'Courier New', monospace;
}
.wa-num-meta {
  display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap;
}
.wa-num-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px;
}
.wa-num-badge.primary { background: rgba(37,211,102,0.15); color: var(--green); }
.wa-num-badge.secondary { background: rgba(99,102,241,0.12); color: var(--blue-light); }
.wa-num-badge.inactive-badge { background: rgba(90,106,138,0.15); color: var(--text-muted); }

.wa-num-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.wa-num-actions .toggle-switch { transform: scale(0.85); }

.wa-empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 13px;
}
.wa-empty-state .wa-empty-icon { font-size: 40px; opacity: 0.3; margin-bottom: 10px; }

/* ─── WHATSAPP CONNECT SIDEBAR PILL ─── */
.wa-connect-pill {
  margin: 4px 10px 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all 0.2s;
}
.wa-connect-pill:hover { border-color: var(--wa-green); background: rgba(37,211,102,0.05); }
.wa-pill-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
  transition: background 0.3s;
}
.wa-pill-dot.connected { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.wa-pill-dot.qr_ready  { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: pulse 1s infinite; }
.wa-pill-dot.connecting{ background: var(--blue); animation: pulse 0.8s infinite; }
.wa-pill-info { flex: 1; }
.wa-pill-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.wa-pill-status { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.wa-pill-action { font-size: 10px; color: var(--green); font-weight: 600; flex-shrink: 0; }

/* ─── WHATSAPP CONNECT PAGE ─── */
.wa-connect-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 20px;
  align-items: start;
}

/* QR Card */
.wa-qr-card { padding: 28px; }
.wa-qr-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.wa-logo-circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(37,211,102,0.1); border: 2px solid rgba(37,211,102,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wa-qr-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.wa-qr-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* QR Display */
.wa-qr-area {
  width: 300px; height: 300px; margin: 0 auto 24px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.wa-qr-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  color: var(--text-muted); text-align: center; padding: 20px;
}
.wa-qr-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.wa-qr-hint { font-size: 13px; line-height: 1.6; }
.wa-qr-img {
  width: 280px; height: 280px;
  object-fit: contain;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

/* Connected overlay */
.wa-connected-overlay {
  position: absolute; inset: 0;
  background: rgba(10,13,20,0.92);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  animation: fadeIn 0.4s ease;
}
.wa-connected-check { font-size: 56px; animation: bounceIn 0.5s ease; }
.wa-connected-text { font-size: 22px; font-weight: 800; color: var(--green); }
.wa-connected-sub { font-size: 13px; color: var(--text-muted); }

/* Steps */
.wa-qr-steps {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wa-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
  padding: 8px; background: var(--bg-surface);
  border-radius: var(--radius-sm);
}
.wa-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #2dd4bf);
  color: #000; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Status Card */
.wa-status-card { padding: 20px; }
.wa-status-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.wa-status-icon { font-size: 32px; }
.wa-status-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.wa-status-msg { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.wa-status-details { border-top: 1px solid var(--border); padding-top: 12px; }

/* Feature Rows */
.wa-feature-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px; border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.wa-feature-row:hover { background: var(--bg-surface); }
.wa-feat-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounceIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- MULTI-NUMBER WA ACCOUNTS --- */
.wa-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.wa-account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.wa-account-card.connected  { border-color: #25d366; }
.wa-account-card.qr_ready   { border-color: var(--accent); }
.wa-account-card.connecting { border-color: #f59e0b; }

.wa-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.wa-card-info { display: flex; align-items: center; gap: 12px; }
.wa-card-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-muted);
}
.wa-card-dot.connected   { background: #25d366; box-shadow: 0 0 6px #25d36680; }
.wa-card-dot.qr_ready    { background: var(--accent); animation: pulse 1.5s infinite; }
.wa-card-dot.connecting  { background: #f59e0b; }
.wa-card-dot.disconnected{ background: #6b7280; }

.wa-card-label { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.wa-card-phone { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wa-card-btns  { display: flex; gap: 8px; flex-shrink: 0; }

.wa-card-qr-wrap {
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.wa-qr-img { width: 200px; height: 200px; border-radius: 8px; }
.wa-qr-steps { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.wa-qr-steps p { margin: 0; font-size: 12px; color: var(--text-muted); padding: 3px 0; border-bottom: 1px solid var(--border); }

.wa-card-ok {
  padding: 16px; text-align: center; font-size: 13px;
  color: #25d366; background: #25d36610;
}
.wa-card-loading {
  padding: 20px; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--text-muted); font-size: 13px;
}
.wa-card-disc {
  padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px;
}

.wa-add-number-card {
  background: var(--bg-card); border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 32px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.wa-add-number-card:hover { border-color: var(--accent); background: var(--accent)10; }
.wa-add-icon  { font-size: 28px; }
.wa-add-label { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.wa-add-sub   { font-size: 12px; color: var(--text-muted); }

.wa-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.wa-features-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.wa-howit-card    { }
.wa-test-card     { }

/* Demo Mode */
.demo-topbar {
  background: linear-gradient(90deg, #7c3aed, #9333ea);
  color: white; font-size: 13px; font-weight: 500;
  padding: 10px 20px; margin-bottom: 16px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px;
}
.demo-badge {
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700;
}
.demo-badge.demo { background: #7c3aed20; color: #a78bfa; border: 1px solid #7c3aed; }
.demo-badge.live { background: #25d36620; color: #25d366; border: 1px solid #25d366; }

.lead-chat-backdrop {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(0, 0, 0, 0.45);
}
.lead-chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 999;
  width: min(440px, 94vw); background: var(--bg-card);
  border-left: 1px solid var(--border); box-shadow: -14px 0 40px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
}
.lead-chat-panel.hidden, .lead-chat-backdrop.hidden { display: none; }
.lead-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px; border-bottom: 1px solid var(--border);
}
.lead-chat-name { color: var(--text-primary); font-size: 15px; font-weight: 700; }
.lead-chat-phone { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.lead-chat-messages {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.lead-chat-messages .msg-bubble.user { align-self: flex-start; }
.lead-chat-messages .msg-bubble.bot { align-self: flex-end; }

/* WA Spinner */
.wa-spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}

/* Button sizes */
.btn-sm {
  padding: 5px 10px; font-size: 12px; border-radius: 6px;
  cursor: pointer; font-weight: 500; transition: all 0.15s;
  border: 1px solid transparent;
}
.btn-sm.btn-primary { background: var(--accent); color: white; }
.btn-sm.btn-primary:hover { opacity: 0.85; }
.btn-sm.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-sm.btn-danger:hover { background: var(--red); color: white; }
.btn-sm.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-sm.btn-ghost:hover { border-color: var(--text-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (max-width: 768px) {
  .wa-accounts-grid { grid-template-columns: 1fr; }
  .wa-info-row      { grid-template-columns: 1fr; }
}

/* ─── LOGIN OVERLAY ─── */
.login-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: radial-gradient(circle at center, rgba(30,27,75,0.8), rgba(15,23,42,0.95));
  backdrop-filter: var(--glass-blur);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-overlay.hidden { display: none; }
.login-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 40px; border-radius: var(--radius-lg);
  width: 100%; max-width: 400px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-card h2 { margin: 10px 0 5px 0; font-family: var(--font-heading); }
.login-card p { color: var(--text-muted); margin-bottom: 20px; }
