/* ==========================================================================
   LeadPulse CRM Stylesheet
   Modern, Responsive, Aesthetic CRM Design
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --bg-accent: #EEF2F6;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #3B82F6;

  /* Brand Accents */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-glow: rgba(37, 99, 235, 0.15);

  /* Pipeline Category Colors */
  --color-new: #3B82F6;
  --color-new-bg: #EFF6FF;
  --color-new-border: #BFDBFE;

  --color-called: #10B981;
  --color-called-bg: #ECFDF5;
  --color-called-border: #A7F3D0;

  --color-scheduled: #8B5CF6;
  --color-scheduled-bg: #F5F3FF;
  --color-scheduled-border: #DDD6FE;

  --color-not-answering: #F59E0B;
  --color-not-answering-bg: #FFFBEB;
  --color-not-answering-border: #FDE68A;

  --color-not-interested: #EF4444;
  --color-not-interested-bg: #FEF2F2;
  --color-not-interested-border: #FECACA;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
body.dark-theme {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  --bg-accent: #1E293B;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --text-inverse: #0F172A;

  --border-light: #334155;
  --border-medium: #475569;
  --border-focus: #60A5FA;

  --primary-light: rgba(37, 99, 235, 0.2);

  --color-new-bg: rgba(59, 130, 246, 0.12);
  --color-called-bg: rgba(16, 185, 129, 0.12);
  --color-scheduled-bg: rgba(139, 92, 246, 0.12);
  --color-not-answering-bg: rgba(245, 158, 11, 0.12);
  --color-not-interested-bg: rgba(239, 68, 68, 0.12);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ==========================================================================
   Top Header
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-info h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-info h1 span {
  color: var(--primary);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sheet-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #E6F4EA;
  border: 1px solid #CEEAD6;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: #137333;
  text-decoration: none;
  transition: var(--transition);
}

.sheet-badge:hover {
  background: #CEEAD6;
  transform: translateY(-1px);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #0F9D58;
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-action:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.btn-export {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.btn-export:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #FFFFFF;
}

.btn-sync-status {
  background: var(--bg-tertiary);
}

.sync-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
}

.sync-indicator.pending {
  background: #F59E0B;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==========================================================================
   KPI / Metrics Banner
   ========================================================================== */
.metrics-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card.active-card {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light), var(--shadow-sm);
}

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

.metric-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon {
  font-size: 1.1rem;
}

.metric-number {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.new-card .metric-number { color: var(--color-new); }
.called-card .metric-number { color: var(--color-called); }
.scheduled-card .metric-number { color: var(--color-scheduled); }
.not-answering-card .metric-number { color: var(--color-not-answering); }
.not-interested-card .metric-number { color: var(--color-not-interested); }

/* ==========================================================================
   5 Pipeline Tabs
   ========================================================================== */
.pipeline-tabs-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pipeline-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.pipeline-tabs {
  display: flex;
  gap: 6px;
  min-width: max-content;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: var(--transition);
}

.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.tab-all-btn {
  margin-left: auto;
  border-left: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Controls Bar (Search & Filter)
   ========================================================================== */
.controls-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==========================================================================
   Tab Info Header
   ========================================================================== */
.tab-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-info-left h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.tab-description {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tab-info-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.showing-count {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2px;
}

.btn-view {
  width: 32px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-view.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==========================================================================
   Leads Cards Grid & Card Styling
   ========================================================================== */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

/* List view mode */
.leads-grid.list-mode {
  grid-template-columns: 1fr;
}

.lead-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.lead-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.lead-card.card-expanded {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-lg);
}

/* Card Header */
.card-top {
  padding: 16px 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFFFFF;
  flex-shrink: 0;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  text-transform: uppercase;
}

.user-names {
  min-width: 0;
}

.lead-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.lead-created {
  font-size: 0.73rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.platform-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.platform-pill.ig {
  background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF);
  color: #FFFFFF;
}

.platform-pill.fb {
  background: #1877F2;
  color: #FFFFFF;
}

.join-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.join-pill.immediate {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.join-pill.within_7_days {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* Card Body */
.card-mid {
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.contact-row svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.contact-phone {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

/* Status Pill */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pill.status-new {
  background: var(--color-new-bg);
  color: var(--color-new);
  border: 1px solid var(--color-new-border);
}

.status-pill.status-called {
  background: var(--color-called-bg);
  color: var(--color-called);
  border: 1px solid var(--color-called-border);
}

.status-pill.status-scheduled {
  background: var(--color-scheduled-bg);
  color: var(--color-scheduled);
  border: 1px solid var(--color-scheduled-border);
}

.status-pill.status-not_answering {
  background: var(--color-not-answering-bg);
  color: var(--color-not-answering);
  border: 1px solid var(--color-not-answering-border);
}

.status-pill.status-not_interested {
  background: var(--color-not-interested-bg);
  color: var(--color-not-interested);
  border: 1px solid var(--color-not-interested-border);
}

.card-expand-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Scheduled Alert Banner on Card */
.card-scheduled-banner {
  background: var(--color-scheduled-bg);
  border-left: 3px solid var(--color-scheduled);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #6D28D9;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-top: 4px;
}

/* Feedback Note Banner on Card */
.card-feedback-preview {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
  border-left: 3px solid var(--primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-feedback-preview strong {
  font-style: normal;
  color: var(--text-primary);
}

/* ==========================================================================
   Lead Action Drawer (Revealed when card is clicked!)
   User requirement: "when i click a lead below the lead should show call symbol"
   ========================================================================== */
.card-action-drawer {
  background: var(--bg-accent);
  border-top: 1px solid var(--border-light);
  padding: 14px 18px;
  display: none;
  animation: slideDown 0.25s ease-out;
}

.lead-card.card-expanded .card-action-drawer {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.action-buttons-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* The BIG Prominent Call Button */
.btn-primary-call {
  flex: 2;
  min-width: 170px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
}

.btn-primary-call:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.pulsing-phone-icon {
  width: 22px;
  height: 22px;
  animation: phoneRing 1.8s infinite ease-in-out;
}

@keyframes phoneRing {
  0% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(-15deg) scale(1.1); }
  20% { transform: rotate(15deg) scale(1.1); }
  30% { transform: rotate(-15deg) scale(1.1); }
  40% { transform: rotate(15deg) scale(1.1); }
  50% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}

.btn-secondary-action {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-secondary-action:hover {
  background: var(--bg-tertiary);
}

.btn-whatsapp {
  color: #128C7E;
  border-color: #25D366;
}

.btn-whatsapp:hover {
  background: #E8F8F5;
}

.lead-meta-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modals (Dialpad & Post-Call Feedback)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hidden {
  display: none !important;
}

/* Call / Dialpad Modal */
.dialpad-modal-content {
  background: #111827;
  color: #FFFFFF;
  border-radius: 28px;
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  box-shadow: var(--shadow-xl), 0 0 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.call-screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.call-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: #10B981;
}

.pulsing-call-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  animation: pulse-dot 1.2s infinite;
}

.call-duration-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #94A3B8;
}

.calling-contact-hero {
  margin-bottom: 24px;
}

.contact-big-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.calling-contact-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.calling-contact-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: #94A3B8;
  margin-bottom: 8px;
}

.contact-campaign-pill {
  display: inline-block;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  color: #CBD5E1;
}

.device-dial-notice {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  color: #94A3B8;
}

.re-dial-link {
  display: block;
  color: #60A5FA;
  font-weight: 600;
  margin-top: 4px;
  text-decoration: underline;
}

/* Keypad Grid */
.virtual-keypad-panel {
  margin-bottom: 20px;
  animation: fadeIn 0.2s;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}

.key-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FFFFFF;
  margin: 0 auto;
  transition: var(--transition);
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.key-btn:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0.95);
}

.k-num {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.k-sub {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: #94A3B8;
}

/* Mid-Call Tools */
.call-controls-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
}

.call-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #CBD5E1;
  cursor: pointer;
  transition: var(--transition);
}

.call-tool-btn span {
  font-size: 0.65rem;
  font-weight: 500;
}

.call-tool-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.call-tool-btn.active {
  background: #FFFFFF;
  color: #0F172A;
}

/* End Call Action */
.call-bottom-action {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-end-call {
  background: #EF4444;
  color: #FFFFFF;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transition: var(--transition);
}

.btn-end-call:hover {
  background: #DC2626;
  transform: translateY(-1px);
}

.btn-text-secondary {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition);
}

.btn-text-secondary:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* ==========================================================================
   Feedback Modal ("Feedback Option")
   ========================================================================== */
.feedback-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-badge-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.modal-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-lead-details {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-close-modal:hover {
  background: var(--border-medium);
  color: var(--text-primary);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.required-star {
  color: #EF4444;
}

.sheet-sync-pill {
  font-size: 0.7rem;
  font-weight: 600;
  background: #E8F0FE;
  color: #1A73E8;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Disposition Options Radio Cards */
.disposition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.disp-radio-card {
  position: relative;
  cursor: pointer;
}

.disp-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.disp-card-inner {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  background: var(--bg-secondary);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.disp-radio-card:hover .disp-card-inner {
  border-color: var(--border-medium);
  background: var(--bg-tertiary);
}

.disp-radio-card input:checked + .disp-card-inner {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

.disp-radio-card[data-outcome="called"] input:checked + .disp-card-inner {
  border-color: var(--color-called);
  background: var(--color-called-bg);
  box-shadow: 0 0 0 1px var(--color-called);
}

.disp-radio-card[data-outcome="not_answering"] input:checked + .disp-card-inner {
  border-color: var(--color-not-answering);
  background: var(--color-not-answering-bg);
  box-shadow: 0 0 0 1px var(--color-not-answering);
}

.disp-radio-card[data-outcome="scheduled"] input:checked + .disp-card-inner {
  border-color: var(--color-scheduled);
  background: var(--color-scheduled-bg);
  box-shadow: 0 0 0 1px var(--color-scheduled);
}

.disp-radio-card[data-outcome="not_interested"] input:checked + .disp-card-inner {
  border-color: var(--color-not-interested);
  background: var(--color-not-interested-bg);
  box-shadow: 0 0 0 1px var(--color-not-interested);
}

.disp-icon {
  font-size: 1.3rem;
}

.disp-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.disp-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Schedule Picker Section */
.schedule-box {
  background: var(--color-scheduled-bg);
  border: 1px solid var(--color-scheduled-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.schedule-box-header {
  font-size: 0.85rem;
  color: #6D28D9;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.schedule-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  padding: 8px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.quick-schedule-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sched-chip {
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--color-scheduled-border);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: #6D28D9;
  cursor: pointer;
  transition: var(--transition);
}

.sched-chip:hover {
  background: rgba(139, 92, 246, 0.28);
}

/* Feedback Chips */
.feedback-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-chip {
  padding: 5px 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.fb-chip:hover {
  background: var(--border-medium);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Feedback Textarea */
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: vertical;
  transition: var(--transition);
  line-height: 1.5;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.call-meta-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* Modal Footer */
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-secondary);
  position: sticky;
  bottom: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  padding: 10px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--border-medium);
}

/* ==========================================================================
   Google Sheets Sync Modal
   ========================================================================== */
.sync-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.sheet-info-banner {
  background: #E6F4EA;
  border: 1px solid #CEEAD6;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-info-col {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #137333;
}

.sheet-link {
  color: #137333;
  font-weight: 700;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.input-with-button input {
  flex: 1;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.setup-accordion {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-header {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-body {
  padding: 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
}

.setup-steps {
  padding-left: 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.7;
}

.script-copy-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.script-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-copy {
  padding: 4px 10px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.script-code-area {
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px;
  resize: vertical;
}

.sync-log-panel {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
}

.sync-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.sync-log-list {
  max-height: 100px;
  overflow-y: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  display: flex;
  gap: 8px;
}

.log-time {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Pagination & Empty State
   ========================================================================== */
.pagination-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: 10px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 400px;
  margin: 0 auto 18px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: #1E293B;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
  border-left: 4px solid var(--primary);
}

.toast.toast-success {
  border-left-color: #10B981;
}

.toast.toast-warning {
  border-left-color: #F59E0B;
}

.toast.toast-error {
  border-left-color: #EF4444;
}

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

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px 40px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .header-left {
    justify-content: space-between;
  }

  .header-actions {
    justify-content: space-between;
    width: 100%;
  }

  .btn-label {
    display: none;
  }

  .metrics-banner {
    grid-template-columns: repeat(2, 1fr);
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .leads-grid {
    grid-template-columns: 1fr;
  }

  .schedule-inputs-row {
    grid-template-columns: 1fr;
  }
}
