/* ═══════════════════════════════════════════
   DESIGN TOKENS — shadcn-compatible light theme
   Palette: White/cream + indigo accent
   ═══════════════════════════════════════════ */
:root {
  /* shadcn semantic tokens */
  --background: #FAFAF7;
  --foreground: #0F1115;
  --card: #FFFFFF;
  --card-foreground: #0F1115;
  --primary: #4F46E5;
  --primary-foreground: #FFFFFF;
  --secondary: #F5F4F0;
  --secondary-foreground: #3F3F46;
  --muted: #F5F4F0;
  --muted-foreground: #71717A;
  --accent: #F5F4F0;
  --accent-foreground: #18181B;
  --border: #E6E3DC;
  --input: #E6E3DC;
  --ring: rgba(79, 70, 229, 0.3);
  --destructive: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;

  /* ApexDial aliases (backward compat) */
  --bg-page: var(--background);
  --bg-sidebar: var(--card);
  --bg-sidebar-hover: var(--secondary);
  --bg-sidebar-active: rgba(79, 70, 229, 0.08);
  --bg-card: var(--card);
  --bg-input: var(--secondary);
  --bg-surface-alt: #F0EFEA;
  --border-strong: #D6D2C9;
  --border-subtle: #F0EFEA;
  --border-table: #F0EFEA;
  --text-main: var(--foreground);
  --text-sub: #3F3F46;
  --text-muted: var(--muted-foreground);
  --text-sidebar: #71717A;
  --text-sidebar-active: var(--foreground);

  /* Functional colors */
  --accent-emerald: #10B981;
  --accent-emerald-dark: #059669;
  --accent-emerald-light: rgba(16, 185, 129, 0.08);
  --accent-red: #EF4444;
  --accent-red-light: rgba(239, 68, 68, 0.08);
  --accent-amber: #F59E0B;
  --accent-amber-light: rgba(245, 158, 11, 0.08);
  --accent-blue: #4F46E5;
  --accent-blue-hover: #4338CA;
  --accent-blue-light: rgba(79, 70, 229, 0.08);
  --accent-primary: #4F46E5;
  --accent-primary-hover: #4338CA;
  --accent-cyan: #3B82F6;
  --accent-cyan-light: rgba(59, 130, 246, 0.08);
  --accent-indigo: #4F46E5;
  --accent-indigo-light: rgba(79, 70, 229, 0.06);
  --accent-violet: #60A5FA;
  --accent-violet-light: rgba(96, 165, 250, 0.08);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;

  /* Spacing — 4px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Radius — smooth modern */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Shadows — subtle warm */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-dropdown: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 0 3px rgba(79, 70, 229, 0.12);

  /* Layout */
  --header-height: 56px;
  --table-row-height: 40px;
}

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

body {
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tabular numbers for all numeric data */
.stat-num, .call-timer, [data-count], .badge {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════
   APP CONTAINER — the big rounded card
   ═══════════════════════════════════════════ */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}



/* ═══════════════════════════════════════════
   AUTH LANDING SCREEN
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 20, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 420px;
  max-width: 90vw;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 70, 229, 0.07);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.close-modal {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   WORKSPACE — flat instrument panel layout
   ═══════════════════════════════════════════ */
.workspace {
  display: flex;
  flex: 1;
  margin: 8px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════════
   SIDEBAR — clean shadcn-style
   ═══════════════════════════════════════════ */
.sidebar {
  width: 260px;
  min-width: 260px;
  min-height: 0;
  background: rgba(255,255,255,0.5);
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(0,0,0,0.06);
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar > .nav-btn:first-child {
  margin-bottom: 0;
}

/* Sidebar Top — Workspace Switcher */
.sidebar-top {
  padding: 0;
  margin-bottom: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-brand:hover {
  background: rgba(0,0,0,0.04);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.brand-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  letter-spacing: -0.1px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-foreground);
  letter-spacing: 0;
  text-transform: none;
}


/* ═══════════════════════════════════════════
   DEVICE CARD (Sidebar Phone View)
   ═══════════════════════════════════════════ */
.device-card {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.device-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.device-card-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: rgba(79, 70, 229, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--accent-violet);
  flex-shrink: 0;
}
.device-card-icon.connected {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

.device-card-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
  background: var(--accent-red);
  transition: background 0.3s;
}
.device-card-dot.green {
  background: var(--accent-emerald);
}
.device-card-dot.amber {
  background: var(--accent-amber);
}

.device-card-info {
  flex: 1;
  min-width: 0;
}

.device-card-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.device-card-status {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}
.device-card-status.online {
  color: var(--accent-emerald);
}
.device-card-status.offline {
  color: var(--accent-red);
}

.device-card-actions {
  display: flex;
  gap: 5px;
}

.device-card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: rgba(79, 70, 229, 0.04);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font);
}
.device-card-btn:hover {
  background: rgba(79, 70, 229, 0.08);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.device-card-btn:active {
  transform: scale(0.97);
}
.device-card-btn.syncing {
  color: var(--accent-violet);
  border-color: rgba(167, 139, 250, 0.3);
  pointer-events: none;
}
.device-card-btn.success {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}
.device-card-btn.error {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.device-card-btn-download {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}
.device-card-btn-download:hover {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.sidebar-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 4px 8px 8px;
}

.nav-section-label {
  padding: 2px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--muted-foreground);
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  position: relative;
  border-radius: 6px;
}

.nav-btn i, .nav-btn span { pointer-events: none; }

.nav-btn i {
  font-size: 15px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--foreground);
}

.nav-btn:hover i { opacity: 0.9; }

.nav-btn.active {
  background: rgba(0,0,0,0.05);
  color: var(--foreground);
  font-weight: 500;
}

.nav-btn.active::before {
  display: none;
}

.nav-btn.active i {
  color: var(--foreground);
  opacity: 1;
}

.nav-btn-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.10);
  color: var(--primary);
  pointer-events: none;
}

.nav-btn-shortcut {
  display: none;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  opacity: 0.6;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 4px;
  pointer-events: none;
  line-height: 1;
}

.nav-btn:hover .nav-btn-shortcut {
  display: flex;
}

/* ═══════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════ */
.content-area {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-page);
}

.tab-content { display: none !important; }
.tab-content.active {
  display: block !important;
}

/* ═══════════════════════════════════════════
   PAGE TITLE — compact, instrument-like
   ═══════════════════════════════════════════ */
.page-title {
  margin-bottom: 12px;
}

.page-title h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-title h2 i {
  color: var(--text-muted);
  font-size: 12px;
}

.page-title p {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   PANELS & GRID — borders, no shadows
   ═══════════════════════════════════════════ */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-header h3 i {
  color: var(--accent-violet);
  font-size: 11px;
}

.link-btn {
  color: var(--accent-violet);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
}

.link-btn:hover { text-decoration: underline; color: var(--accent-blue); }

/* ═══════════════════════════════════════════
   DROP ZONE
   ═══════════════════════════════════════════ */
.drop-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(79, 70, 229, 0.03);
  margin-bottom: 10px;
}

.drop-zone:hover {
  border-color: var(--accent-violet);
  background: rgba(79, 70, 229, 0.05);
}

.drop-icon {
  font-size: 24px;
  color: var(--accent-violet);
  margin-bottom: 6px;
}

.drop-zone h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.drop-zone p {
  font-size: 11px;
  color: var(--text-muted);
}

.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.15);
  color: var(--accent-violet);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.accent-badge {
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-violet);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   CONFIG / RANGE SLIDER
   ═══════════════════════════════════════════ */
.config-group { margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }

.config-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.config-item label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.config-item label span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.config-item label span i {
  color: var(--accent-violet);
  font-size: 12px;
}

.config-item input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(79, 70, 229, 0.10);
  border-radius: 2px;
  outline: none;
  margin-bottom: 4px;
}

.config-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.18);
  cursor: pointer;
}

.config-item small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.campaign-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
  font-family: var(--font);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.20);
}

.btn-success { background: var(--accent-emerald); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--accent-emerald-dark); }
.btn-warning { background: var(--accent-amber); color: #fff; }
.btn-danger { background: var(--accent-red); color: #fff; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--border-strong);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(79, 70, 229, 0.05);
  border-color: var(--border-strong);
}

.btn-sm { padding: 4px 8px; font-size: 10px; }

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

/* ═══════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
}

.stat-card.blue::before { background: var(--accent-blue); }
.stat-card.yellow::before { background: var(--accent-amber); }
.stat-card.green::before { background: var(--accent-emerald); }
.stat-card.red::before { background: var(--accent-red); }

.stat-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-card.blue .stat-num { color: var(--accent-violet); }
.stat-card.yellow .stat-num { color: var(--accent-amber); }
.stat-card.green .stat-num { color: var(--accent-emerald); }
.stat-card.red .stat-num { color: var(--accent-red); }

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 3px;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════ */
.progress-container { margin-bottom: 12px; }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-sub);
}

.progress-bar-bg {
  height: 6px;
  background: rgba(79, 70, 229, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════
   ACTIVE LEAD CARD
   ═══════════════════════════════════════════ */
.active-lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.lead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lead-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.lead-badge.pulse { animation: pulse 1.5s infinite; }

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

.lead-index {
  font-size: 11px;
  color: var(--text-muted);
}

.lead-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.lead-number {
  color: var(--accent-violet);
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.lead-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ═══════════════════════════════════════════
   QUICK CONTACTS
   ═══════════════════════════════════════════ */
.quick-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-contact-card:hover { border-color: var(--accent-blue); }

.quick-contact-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-violet);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.quick-contact-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.quick-contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.quick-contact-phone {
  font-size: 11px;
  color: var(--accent-violet);
}

.quick-call-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-emerald);
  border: none;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.quick-call-btn:hover { transform: scale(1.08); }

.quick-remove-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-remove-btn:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

/* ═══════════════════════════════════════════
   CONTACTS GRID
   ═══════════════════════════════════════════ */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

.contact-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-indigo-light);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-details { flex: 1; min-width: 0; }

.contact-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-phone {
  font-size: 11px;
  color: var(--accent-violet);
  margin-bottom: 2px;
}

.company-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 3px;
}

.contact-card-actions {
  display: flex;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.contact-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.15s;
}

.contact-select-checkbox::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: transparent;
}

.contact-card.select-mode .contact-select-checkbox {
  display: flex;
}

.contact-card.select-mode .contact-select-checkbox.checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.contact-card.select-mode .contact-select-checkbox.checked::after {
  background: #fff;
}

.contact-card.select-mode {
  cursor: pointer;
}

.contact-card.selected {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
}

.contact-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  margin-bottom: 4px;
  font-size: 12px;
}

.contact-history-item .history-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.contact-history-item .history-icon.outgoing {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.contact-history-item .history-icon.incoming {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.contact-history-item .history-info {
  flex: 1;
  min-width: 0;
}

.contact-history-item .history-status {
  font-weight: 600;
  color: var(--text-main);
}

.contact-history-item .history-time {
  font-size: 10px;
  color: var(--text-muted);
}

.contact-history-empty {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px;
}

.contact-btn {
  flex: 1;
  padding: 5px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.contact-btn.call-action { background: var(--accent-emerald); color: #fff; }
.contact-btn.call-action:hover { background: var(--accent-emerald-dark); }
.contact-btn.delete-action {
  width: 28px;
  flex: none;
  background: var(--accent-red-light);
  color: var(--accent-red);
}
.contact-btn.delete-action:hover { background: var(--accent-red); color: #fff; }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table-responsive {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--bg-card);
}

.data-table th,
.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  vertical-align: middle;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  background: rgba(79, 70, 229, 0.03);
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
  transition: background 0.08s;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-alt);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.highlight-row {
  background: var(--accent-emerald-light) !important;
  border-left: 2px solid var(--accent-emerald);
}

.notes-text {
  color: var(--text-sub);
  font-weight: 500;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 20px !important;
  font-weight: 500;
}

/* ═══ STATUS BADGES (table cells) ═══ */
.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge.pending { background: rgba(110, 92, 153, 0.15); color: var(--text-muted); }
.badge.dialing { background: rgba(79, 70, 229, 0.08); color: var(--accent-violet); }
.badge.answered { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.badge.no_answer { background: rgba(239, 68, 68, 0.10); color: var(--accent-red); }
.badge.busy { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }

/* ═══ OUTCOME BADGES ═══ */
.badge.outcome {
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.badge.interested { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.badge.confirmed { background: rgba(79, 70, 229, 0.08); color: var(--accent-violet); }
.badge.considering { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }
.badge.declined { background: rgba(239, 68, 68, 0.10); color: var(--accent-red); }

/* ═══ STATUS DOTS ═══ */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.green { background: var(--accent-emerald); }
.status-dot.red { background: var(--accent-red); }
.status-dot.yellow { background: var(--accent-amber); }

/* ═══ PAGINATION BAR ═══ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.pagination-bar .page-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-bar .page-info select {
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: var(--font);
  color: var(--text-main);
  background: var(--bg-card);
}

.pagination-bar .page-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pagination-bar .page-nav button {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-bar .page-nav button:hover {
  background: var(--bg-input);
}

/* ═══════════════════════════════════════════
   MANUAL DIALER
   ═══════════════════════════════════════════ */
.dialer-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
}

.dialer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.dialer-screen { position: relative; margin-bottom: 10px; }

.dialer-screen input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px;
  padding-right: 32px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  outline: none;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.dialer-screen input:focus { border-color: var(--accent-violet); }

.backspace-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.numpad-btn {
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.numpad-btn span {
  font-size: 7px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.4px;
}

.numpad-btn:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: var(--accent-violet);
}

.numpad-btn:active { transform: scale(0.97); }

.call-btn {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-xs);
  background: var(--accent-emerald);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
}

.call-btn:hover { background: var(--accent-emerald-dark); }

/* ═══════════════════════════════════════════
   ACTIVE CALL HUD
   ═══════════════════════════════════════════ */
.call-hud-dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  max-width: calc(100vw - 440px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(79, 70, 229, 0.07);
  border-radius: var(--radius);
  padding: 12px 16px;
  z-index: 99;
  border-left: 3px solid var(--accent-emerald);
}

.hud-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.hud-details h4 { font-size: 12px; font-weight: 600; color: var(--text-main); }
.hud-details p { font-size: 10px; color: var(--text-muted); }

.hud-status-badge {
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  font-weight: 700;
  text-transform: uppercase;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-timer {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.sound-wave { display: flex; gap: 2px; margin-bottom: 2px; }

.sound-wave span {
  width: 2px;
  height: 10px;
  background: var(--accent-emerald);
  border-radius: 1px;
  animation: wave 1s infinite ease-in-out;
}

.sound-wave span:nth-child(2) { animation-delay: 0.2s; }
.sound-wave span:nth-child(3) { animation-delay: 0.4s; }
.sound-wave span:nth-child(4) { animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

.hud-sim-controls { display: flex; gap: 4px; }

.sim-btn {
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.sim-btn.green { background: var(--accent-emerald); color: #fff; }
.sim-btn.orange { background: var(--accent-amber); color: #fff; }

.btn-hud-action.danger {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════ */
.search-box {
  position: relative;
  width: 240px;
}

.search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 11px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 8px 5px 28px;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 11px;
  outline: none;
}

.search-box input:focus { border-color: var(--accent-violet); box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.10); }

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

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.form-group { margin-bottom: 8px; }

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 500;
  margin-bottom: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.10);
}

.section-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════
   MESSAGES LAYOUT
   ═══════════════════════════════════════════ */
.messages-layout {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 0;
  height: calc(100vh - 120px);
  margin: -14px;
  margin-top: 0;
}

.messages-sidebar-panel {
  border-radius: 0;
  border-right: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  border-left: none;
  overflow-y: auto;
}

.messages-chat-panel {
  border-radius: 0;
  display: flex;
  flex-direction: column;
  border-top: none;
  border-bottom: none;
  border-right: none;
}

.messages-compose-panel {
  border-radius: 0;
  border-left: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  border-right: none;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 4px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.1s;
}

.conversation-item:hover { background: var(--bg-input); }
.conversation-item.active { background: rgba(79, 70, 229, 0.08); }

.conversation-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-indigo-light);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-preview {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.conversation-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.conversation-time {
  font-size: 9px;
  color: var(--text-muted);
}

/* Chat Header */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.chat-header-info {
  display: flex;
  flex-direction: column;
}

.chat-contact-name { font-size: 12px; font-weight: 600; color: var(--text-main); }
.chat-contact-number { font-size: 10px; color: var(--accent-blue); font-variant-numeric: tabular-nums; }

.chat-header-actions {
  display: flex;
  gap: 4px;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.messages-empty-state {
  min-height: 260px;
  margin: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
}

.messages-empty-state i {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-indigo-light);
  color: var(--accent-indigo);
}

.messages-empty-state h3 {
  margin: 0 0 6px;
  color: var(--text-main);
  font-size: 14px;
}

.messages-empty-state p {
  max-width: 280px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.chat-bubble {
  max-width: 70%;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.45;
  word-wrap: break-word;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.chat-bubble-time {
  font-size: 9px;
  opacity: 0.5;
  margin-top: 2px;
  display: block;
}

.chat-date-separator {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 0;
}

/* Chat Composer */
.chat-composer {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.chat-composer input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  font-family: var(--font);
}

.chat-composer input:focus { border-color: var(--accent-violet); }

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */
.wrapup-modal { width: 480px; max-width: 90vw; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.wrapup-modal .modal-body { overflow-y: auto; flex: 1; min-height: 0; }
.wrapup-modal .modal-footer { flex-shrink: 0; }

.wrapup-call-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
}

.wrapup-call-info h4 { font-size: 13px; font-weight: 700; }
.wrapup-call-info p { font-size: 11px; color: var(--accent-blue); }

.wrapup-duration-badge {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.disp-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 4px;
}

@media (max-width: 520px) {
  .disp-selector-grid { grid-template-columns: repeat(2, 1fr); }
  .wrapup-modal .modal-footer { flex-wrap: wrap; }
}

.disp-opt-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.disp-opt-btn:hover { border-color: var(--accent-blue); }

.disp-opt-btn.selected {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tag-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
}

.tag-chip:hover { border-color: var(--accent-blue); }

.tag-chip.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 24px rgba(79, 70, 229, 0.05);
  border: 1px solid var(--border);
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════ */
.content-area::-webkit-scrollbar { width: 4px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ═══════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ═══════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar-top { display: none; }
  .sidebar { width: 52px; min-width: 52px; padding: 12px 0; }
  .nav-btn span { display: none; }
  .nav-btn { justify-content: center; padding: 8px; }
  .nav-btn i { width: auto; }
  .device-card-info, .device-card-actions { display: none !important; }
  .device-card { padding: 6px; margin: 0 5px 8px; display: flex; justify-content: center; }
  .device-card-header { margin-bottom: 0; }
  .grid-2col { grid-template-columns: 1fr; }
  .dialer-wrapper { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .messages-layout { grid-template-columns: 1fr; }
  .messages-sidebar-panel { display: none; }
  .messages-compose-panel { display: none; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    padding: 4px 2px env(safe-area-inset-bottom, 0px);
    justify-content: space-around;
    align-items: center;
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
    font-family: var(--font);
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: color 0.15s;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-btn i {
    font-size: 15px;
  }
  .mobile-nav-btn.active {
    color: var(--primary);
  }
  .mobile-nav-btn.active i {
    color: var(--primary);
  }

  .workspace {
    margin: 0;
    border-radius: 0;
    border: none;
    height: calc(100vh - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - env(safe-area-inset-bottom, 0px));
  }

  .content-area {
    padding: 12px 10px 70px;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-title {
    padding: 0 0 8px;
  }
  .page-title h2 {
    font-size: 14px;
  }
  .page-title p {
    font-size: 10px;
  }

  .panel {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
  }
  .panel-header h3 {
    font-size: 12px;
  }

  .grid-2col { grid-template-columns: 1fr !important; }
  .dialer-wrapper { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .messages-layout { grid-template-columns: 1fr !important; }
  .messages-sidebar-panel { display: none !important; }
  .messages-compose-panel { display: none !important; }

  .contact-toolbar {
    display: block;
  }
  .contact-toolbar .search-box {
    width: 100% !important;
    margin-bottom: 10px;
  }
  .contact-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 44px 1fr;
    gap: 6px;
    width: 100%;
  }
  .contact-toolbar-actions .btn {
    justify-content: center;
  }

  .panel table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .panel table thead,
  .panel table tbody,
  .panel table tr {
    display: table;
    min-width: 100%;
  }

  /* Forms — full width inputs */
  .form-group {
    margin-bottom: 14px;
  }
  .form-group label {
    font-size: 0.85em;
    margin-bottom: 5px;
    display: block;
  }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  input[type="url"],
  select,
  textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    box-sizing: border-box;
  }
  /* Prevent iOS zoom on input focus */
  select { font-size: 16px !important; }

  /* Buttons — bigger touch targets */
  .btn {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
    min-height: 44px;
  }
  .btn-sm {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 40px;
  }

  /* Call HUD — full width at bottom */
  .call-hud-dock {
    width: calc(100vw - 28px) !important;
    max-width: none !important;
    bottom: 70px;
    left: 14px;
    right: 14px;
  }

  /* Auth modal on mobile */
  .modal {
    width: calc(100vw - 32px);
    max-width: none;
    padding: 24px 20px;
    margin: 16px;
  }

  /* Landing screen */
  .modal-overlay .modal {
    width: calc(100vw - 32px);
    max-width: none;
  }

  /* Device card (sidebar hidden, but if rendered elsewhere) */
  .device-card { margin-bottom: 12px; }

  /* Stats cards */
  .stat-card {
    padding: 14px;
  }

  /* Status badge */
  .system-status { display: none !important; }

  /* Fix overflow on all panels */
  .panel { overflow: hidden; }
  .panel > * { max-width: 100%; }

  /* Chat/SMS messages */
  .chat-messages {
    max-height: 50vh;
  }

  /* Disposition modal */
  .wrapup-modal {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: 85vh;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤420px)
   ═══════════════════════════════════════════ */
@media (max-width: 420px) {
  .content-area {
    padding: 12px 10px 80px;
  }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mobile-nav-btn span {
    font-size: 8px;
  }
  .mobile-nav-btn i {
    font-size: 15px;
  }
}

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Campaign History Cards */
.camp-history-row:hover {
  background: rgba(255,255,255,0.03);
}
.camp-history-detail {
  transition: max-height 0.2s ease;
}

/* ═══════════════════════════════════════════
   DASHBOARD — Call Center Agent Dashboard
   ═══════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Hero Stats Row */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.hero-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.hero-stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.hero-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 0 0 0 60px;
  opacity: 0.06;
}

.hero-stat-card.purple::after { background: var(--accent-blue); }
.hero-stat-card.cyan::after { background: var(--accent-cyan); }
.hero-stat-card.green::after { background: var(--accent-emerald); }
.hero-stat-card.amber::after { background: var(--accent-amber); }

.hero-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.hero-stat-icon.purple { background: rgba(79, 70, 229, 0.08); color: var(--accent-blue); }
.hero-stat-icon.cyan { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.hero-stat-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.hero-stat-icon.amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }

.hero-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-stat-card.purple .hero-stat-value { color: var(--accent-blue); }
.hero-stat-card.cyan .hero-stat-value { color: var(--accent-cyan); }
.hero-stat-card.green .hero-stat-value { color: var(--accent-emerald); }
.hero-stat-card.amber .hero-stat-value { color: var(--accent-amber); }

.hero-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.hero-stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 6px;
  border-radius: 4px;
}

.hero-stat-change.up {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.10);
}

.hero-stat-change.down {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.10);
}

/* Live Call Status Widget */
.live-call-widget {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-call-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.live-call-info { flex: 1; }

.live-call-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.live-call-number {
  font-size: 12px;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.live-call-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-top: 4px;
}

.live-call-timer {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-emerald);
  font-variant-numeric: tabular-nums;
}

/* Bar Chart (CSS-based) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 0 4px;
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-bar {
  width: 100%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  position: relative;
  cursor: pointer;
}

.bar-chart-bar:hover {
  opacity: 0.85;
}

.bar-chart-bar.purple { background: linear-gradient(180deg, var(--accent-violet), var(--accent-blue)); }
.bar-chart-bar.cyan { background: linear-gradient(180deg, var(--accent-cyan), #0891B2); }
.bar-chart-bar.green { background: linear-gradient(180deg, var(--accent-emerald), var(--accent-emerald-dark)); }

.bar-chart-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.bar-chart-value {
  font-size: 9px;
  color: var(--text-sub);
  font-weight: 600;
}

/* Donut Chart (CSS-based) */
.donut-chart-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.donut-chart-center {
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-chart-center .donut-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.donut-chart-center .donut-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-sub);
}

.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-value {
  font-weight: 600;
  color: var(--text-main);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: rgba(79, 70, 229, 0.03);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.leaderboard-item:hover {
  border-color: var(--border);
  background: rgba(79, 70, 229, 0.05);
}

.leaderboard-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard-rank.gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.leaderboard-rank.silver { background: rgba(167, 139, 250, 0.15); color: var(--accent-violet); }
.leaderboard-rank.bronze { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.leaderboard-rank.default { background: rgba(110, 92, 153, 0.12); color: var(--text-muted); }

.leaderboard-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-violet);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard-info { flex: 1; min-width: 0; }

.leaderboard-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.leaderboard-stat {
  font-size: 10px;
  color: var(--text-muted);
}

.leaderboard-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-violet);
  font-variant-numeric: tabular-nums;
}

.leaderboard-score-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  transition: background 0.1s;
}

.activity-item:hover {
  background: rgba(79, 70, 229, 0.03);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.activity-dot.call { background: var(--accent-emerald); }
.activity-dot.sms { background: var(--accent-cyan); }
.activity-dot.lead { background: var(--accent-violet); }
.activity-dot.alert { background: var(--accent-amber); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.4;
}

.activity-text strong {
  color: var(--text-main);
  font-weight: 600;
}

.activity-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Pipeline */
.pipeline-stages {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.pipeline-stage {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius-xs);
  position: relative;
}

.pipeline-stage::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid var(--border);
}

.pipeline-stage:last-child::after { display: none; }

.pipeline-stage-count {
  font-size: 18px;
  font-weight: 700;
}

.pipeline-stage-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.pipeline-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
  background: rgba(79, 70, 229, 0.08);
  overflow: hidden;
}

.pipeline-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* Quality Metrics */
.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quality-metric {
  background: rgba(79, 70, 229, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px;
  text-align: center;
}

.quality-metric-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quality-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.quality-metric-bar {
  height: 3px;
  background: rgba(79, 70, 229, 0.08);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.quality-metric-bar-fill {
  height: 100%;
  border-radius: 2px;
}

/* CSAT Score */
.csat-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  position: relative;
}

.csat-ring-bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid rgba(79, 70, 229, 0.07);
}

.csat-ring-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid transparent;
  /* JS sets conic-gradient via inline style */
}

.csat-ring-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-emerald);
  z-index: 1;
}

.csat-breakdown {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.csat-item {
  text-align: center;
}

.csat-item-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.csat-item-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Dashboard Responsive */
@media (max-width: 1024px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid-3 { grid-template-columns: 1fr; }
  .donut-chart-wrapper { flex-direction: column; align-items: center; }
}

@media (max-width: 768px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero-stat-card { padding: 14px 16px; }
  .hero-stat-value { font-size: 22px; }
  .bar-chart { height: 100px; }
  .quality-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   SEARCH MODAL RESULTS
   ═══════════════════════════════════════════ */
.search-results-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
}
.search-results-container::-webkit-scrollbar { width: 4px; }
.search-results-container::-webkit-scrollbar-track { background: transparent; }
.search-results-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.search-empty {
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.search-category {
  padding: 6px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover,
.search-result-item.search-highlighted {
  background: rgba(0, 0, 0, 0.04);
}

.search-result-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.search-result-icon.contact { background: rgba(79, 70, 229, 0.1); color: #4F46E5; }
.search-result-icon.call { background: rgba(16, 163, 127, 0.1); color: #10A37F; }
.search-result-icon.message { background: rgba(245, 158, 11, 0.1); color: #D97706; }
.search-result-icon.nav { background: rgba(113, 113, 122, 0.1); color: #71717A; }

.search-result-text {
  flex: 1;
  min-width: 0;
}
.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-subtitle {
  font-size: 11px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-no-results {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* ═══════════════════════════════════════════
   TEMPLATE CHIPS & MANAGER
   ═══════════════════════════════════════════ */
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.template-chip:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.template-manager-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  margin-bottom: 6px;
}

.template-manager-item .template-info {
  flex: 1;
  min-width: 0;
}

.template-manager-item .template-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.template-manager-item .template-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-manager-item .template-actions {
  display: flex;
  gap: 4px;
}

.template-manager-item .template-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.template-manager-item .template-action-btn:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

/* SMS Contact Dropdown */
.sms-contact-option {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.sms-contact-option:hover {
  background: var(--accent-blue-light);
}

.sms-contact-option:last-child {
  border-bottom: none;
}

.sms-contact-option .contact-option-name {
  font-weight: 600;
}

.sms-contact-option .contact-option-number {
  color: var(--text-muted);
  font-size: 11px;
}
