/* ==========================================================================
   Edunexsys CRM - Premium Modern Styling
   High-Conversion Online Degree Admissions CRM UI
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --slate: #334155;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  overflow-x: hidden;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: #b45309; }
.text-danger { color: var(--danger); }
.font-weight-bold { font-weight: 700; }
.font-weight-medium { font-weight: 600; }
.small { font-size: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 20px; padding-bottom: 20px; }
.py-5 { padding-top: 36px; padding-bottom: 36px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
}

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

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--slate);
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 4px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-sm { padding: 2px 6px; font-size: 10px; }
.badge-xs { padding: 1px 4px; font-size: 9px; }
.badge-pill { border-radius: 999px; }
.badge-success { background: var(--success-bg); color: #065f46; }
.badge-danger { background: var(--danger-bg); color: #991b1b; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-info { background: var(--info-bg); color: #1e40af; }

.badge-source {
  background: #f1f5f9;
  color: var(--slate);
}
.badge-meta {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}
.meta-tag-pill {
  margin-top: 3px;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.badge-pool {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-role {
  background: #ede9fe;
  color: #6d28d9;
}
.badge-admin { background: #fee2e2; color: #991b1b; }
.badge-manager { background: #fef3c7; color: #92400e; }
.badge-team_lead { background: #dbeafe; color: #1e40af; }
.badge-counsellor { background: #d1fae5; color: #065f46; }

/* ==========================================================================
   Layout & App Shell
   ========================================================================== */

#appContainer {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.brand-section {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-sub {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.2px;
}

.sidebar-nav {
  padding: 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}

/* Header */
.top-header {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 520px;
}

.search-container {
  display: flex;
  width: 100%;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease;
  background: #f8fafc;
}
.search-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.btn-search {
  padding: 9px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.btn-search:hover {
  background: var(--primary-hover);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.talk-time-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Notification Bell Dropdown */
.notif-bell-container {
  position: relative;
}

.btn-icon-bell {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  position: relative;
  padding: 6px;
  color: var(--slate);
  border-radius: 50%;
  transition: background 0.2s;
}
.btn-icon-bell:hover {
  background: #f1f5f9;
}
.btn-icon-bell.has-alert {
  animation: gentleShake 3s infinite;
}

@keyframes gentleShake {
  0%, 100% { transform: rotate(0); }
  5%, 15% { transform: rotate(12deg); }
  10%, 20% { transform: rotate(-12deg); }
  25% { transform: rotate(0); }
}

.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  border: 2px solid #fff;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  width: 340px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.notif-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
}

.notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.notif-item:hover {
  background: #f8fafc;
}
.notif-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.notif-item-time {
  font-size: 11px;
  color: #b45309;
  font-weight: 700;
}
.notif-item-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
}
.notif-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.notif-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.notif-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.notif-empty-icon {
  font-size: 28px;
  color: var(--success);
  margin-bottom: 6px;
}

/* User Profile Header Chip */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.user-info-text {
  line-height: 1.2;
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Page Content View */
.content-body {
  padding: 24px;
  flex: 1;
}

/* ==========================================================================
   Dashboard View
   ========================================================================== */

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Missed Callbacks Banner */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 5px solid var(--warning);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.alert-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert-icon { font-size: 20px; }
.alert-title { font-weight: 700; color: #92400e; font-size: 14px; }
.alert-desc { font-size: 12px; color: #b45309; }

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.18);
  border-color: var(--primary);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s ease;
}
.kpi-card:hover .kpi-icon {
  transform: scale(1.1);
}

.kpi-icon-blue { background: #dbeafe; color: #1d4ed8; }
.kpi-icon-purple { background: #ede9fe; color: #6d28d9; }
.kpi-icon-amber { background: #fef3c7; color: #b45309; }
.kpi-icon-red { background: #fee2e2; color: #b91c1c; }
.kpi-icon-green { background: #d1fae5; color: #065f46; }
.kpi-icon-indigo { background: #e0e7ff; color: #4338ca; }

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-subtext {
  font-size: 11px;
  color: var(--text-muted);
}
.kpi-footer-hint {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-light);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.kpi-card:hover .kpi-footer-hint {
  opacity: 1;
}

/* Calls Multi-Period Card & Period Pills */
.kpi-card-multicall {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-period-pills {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  margin-top: 4px;
  border: 1px solid var(--border);
}

.btn-period-pill {
  border: none;
  background: transparent;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-period-pill.active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-period-pill:hover:not(.active) {
  color: var(--dark);
}

.calls-period-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.period-stat-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 5px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.period-stat-box:hover {
  background: #ecfdf5;
  border-color: #10b981;
  transform: translateY(-1px);
}

.period-stat-box.active {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 0 0 1px #059669;
}

.period-stat-title {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.period-stat-count {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #059669;
  line-height: 1.2;
  margin-top: 1px;
}

/* Talk Time multi-period summary chips */
.talk-period-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.talk-period-chip {
  flex: 1;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 3px;
  font-size: 10px;
  color: var(--slate);
  white-space: nowrap;
}

.talk-period-chip strong {
  color: var(--dark);
  font-weight: 700;
}

/* Dashboard 2-Column Section */
.dashboard-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

.card-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.panel-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
}

/* Disposition Header & View Toggle */
.chart-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-view-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
}

.btn-chart-toggle {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-chart-toggle.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-chart-toggle:hover:not(.active) {
  color: var(--dark);
}

/* ==========================================================================
   10 Lead Disposition Bar Graph Visualization
   ========================================================================== */
.disposition-chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Summary Ribbon above the Graph */
.chart-meta-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.chart-ribbon-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--slate);
}

.chart-ribbon-item strong {
  color: var(--dark);
  font-weight: 700;
}

.chart-ribbon-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* Graph Canvas & Layout */
.disposition-bar-graph-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 14px 10px 14px;
  overflow-x: auto;
}

.disposition-graph-inner {
  display: flex;
  min-width: 620px;
  height: 220px;
  position: relative;
}

/* Y-Axis scale numbers on left */
.chart-y-axis-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 12px;
  width: 38px;
  height: 180px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  user-select: none;
}

.chart-y-tick {
  line-height: 1;
  font-family: inherit;
}

/* Plot Area containing gridlines and bars */
.chart-plot-area {
  flex: 1;
  position: relative;
  height: 180px;
}

/* Horizontal Gridlines */
.chart-gridlines-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chart-gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px dashed #e2e8f0;
}

/* 10 Bar Columns Flex Container */
.chart-bars-flex {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  z-index: 2;
}

/* Single Bar Column */
.chart-bar-column {
  flex: 1;
  min-width: 46px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
  outline: none;
  padding: 0 2px;
}

.chart-bar-column:hover,
.chart-bar-column:focus-visible {
  transform: translateY(-4px);
}

/* Count value badge floating above bar */
.chart-bar-badge {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  user-select: none;
  line-height: 1;
}

.chart-bar-badge.has-count {
  transform: scale(1.05);
}

.chart-bar-badge.zero-count {
  color: #94a3b8;
  font-weight: 500;
  font-size: 11px;
}

/* Vertical Pillar & Fill */
.chart-bar-pillar {
  width: 72%;
  max-width: 36px;
  min-width: 18px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.chart-bar-body {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, filter 0.2s ease;
  min-height: 4px; /* subtle baseline anchor */
  position: relative;
}

.chart-bar-column:hover .chart-bar-body {
  filter: brightness(1.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2) !important;
}

/* Floating Tooltip Bubble on Hover */
.chart-tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.chart-tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.chart-bar-column:hover .chart-tooltip-bubble,
.chart-bar-column:focus-visible .chart-tooltip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip-tag-name {
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.tooltip-tag-metrics {
  color: #cbd5e1;
  font-size: 11px;
}

.tooltip-tag-metrics strong {
  color: #38bdf8;
  font-weight: 700;
}

.tooltip-click-hint {
  color: #6ee7b7;
  font-size: 10px;
  margin-top: 4px;
  font-weight: 600;
}

/* X-Axis labels row below the bars */
.chart-x-axis-row {
  display: flex;
  min-width: 620px;
  margin-left: 38px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #e2e8f0;
}

.chart-x-col-label {
  flex: 1;
  min-width: 46px;
  text-align: center;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chart-x-col-label:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.chart-x-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.chart-x-text {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--slate);
  line-height: 1.2;
  word-break: break-word;
  max-width: 60px;
}

/* 10 Summary Chips Grid */
.chart-summary-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.disp-summary-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.disp-summary-chip:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

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

.chip-label {
  flex: 1;
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.chip-count {
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
}

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

/* Disposition Breakdown Progress Bars (List View) */
.disposition-bars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.disposition-bar-row, .meta-bar-row {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.disposition-bar-row:hover, .meta-bar-row:hover {
  background: #f1f5f9;
}

.bar-label-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.bar-title {
  flex: 1;
  font-weight: 600;
  color: var(--slate);
}
.bar-numbers {
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease-in-out;
}

/* Today's Queue */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.queue-info { flex: 1; }
.queue-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.queue-details { font-size: 11px; margin-top: 2px; }
.queue-time { font-size: 11px; margin-top: 4px; color: #2563eb; }
.queue-actions { display: flex; gap: 6px; }

/* ==========================================================================
   Leads Table View
   ========================================================================== */

.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-select {
  padding: 8px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  cursor: pointer;
}
.filter-select:focus {
  border-color: var(--primary);
}

/* Quick Filter Tab Pills */
.tab-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.tab-filter-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-filter-btn:hover {
  background: #f1f5f9;
}
.tab-filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

/* Bulk Action Bar */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Table Design */
.table-responsive {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.crm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 12.5px;
}

.crm-table th {
  background: #f8fafc;
  color: var(--slate);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 6px;
  border-bottom: 2px solid var(--border);
  white-space: normal;
  line-height: 1.25;
  vertical-align: middle;
}

.crm-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.crm-table th.sortable-th:hover {
  background-color: #e2e8f0;
  color: var(--primary);
}
.sort-indicator {
  display: inline-block;
  font-size: 11px;
  margin-left: 2px;
  vertical-align: middle;
}
.sortable-th.active-sort {
  background-color: #ede9fe !important;
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

.attempt-cell, .created-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.attempt-date, .created-date {
  font-weight: 600;
  color: var(--dark);
  font-size: 11.5px;
  white-space: nowrap;
}
.attempt-time, .created-time {
  font-size: 10.5px;
  color: var(--slate);
  white-space: nowrap;
}
.attempt-outcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 1px 5px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 1px;
  white-space: nowrap;
}
.badge-never-attempted {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px dashed #cbd5e1;
  white-space: nowrap;
}

.crm-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 12px;
}

.crm-table tr.lead-table-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.crm-table tr.lead-table-row:hover td {
  background-color: #f1f5f9;
}

/* Upfront Details button next to Student Name */
.name-cell-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.lead-name-text {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--primary);
}
.btn-lead-quick-details {
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-lead-quick-details:hover {
  background: var(--primary-hover);
  transform: scale(1.04);
}

/* Pinned Sticky Actions Column on Right - Zero Horizontal Scroll */
.crm-table th.col-actions,
.crm-table td.col-actions {
  position: sticky;
  right: 0;
  background: #ffffff;
  z-index: 5;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  padding: 6px 4px;
  width: 65px;
}
.crm-table th.col-actions {
  background: #f8fafc;
  z-index: 6;
}
.crm-table tr.lead-table-row:hover td.col-actions {
  background: #f1f5f9;
}

.phone-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}
.phone-text {
  font-weight: 600;
  font-family: monospace;
  font-size: 11.5px;
}
.direct-actions {
  display: inline-flex;
  gap: 3px;
}
.btn-action-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-action-icon:hover {
  transform: scale(1.1);
}
.btn-call:hover { background: #d1fae5; border-color: #10b981; }
.btn-wa:hover { background: #dcfce7; border-color: #22c55e; }

.callback-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  color: var(--slate);
  white-space: nowrap;
}
.callback-chip.overdue {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  border: 1px solid #fca5a5;
}

.univ-truncate {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Leads View Controls & Mobile Card View (Zero Horizontal Scrolling)
   ========================================================================== */

.leads-view-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.view-mode-toggle-group {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.btn-view-toggle {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-view-toggle:hover {
  color: #0f172a;
}

.btn-view-toggle.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.view-mode-hint {
  font-size: 11.5px;
  color: #64748b;
}

/* Mobile Select All Row (active in Cards View) */
.mobile-select-all-row {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.mobile-select-all-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  user-select: none;
}
.mobile-select-all-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Mobile Cards Container */
.leads-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.lead-mobile-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  cursor: pointer;
}

.lead-mobile-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.lead-mobile-card.selected {
  border-color: var(--primary);
  background: #fdfcff;
}

.mobile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mobile-card-top-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mobile-card-check {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  word-break: break-word;
}
.mobile-card-name:hover {
  text-decoration: underline;
}

.mobile-card-meta-line {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mobile-card-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-card-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mobile-card-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #f1f5f9;
}

.mobile-field-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #64748b;
}

.mobile-field-value {
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  word-break: break-word;
}

.mobile-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.btn-mobile-act {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-mobile-act-call {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.btn-mobile-act-call:hover {
  background: #bbf7d0;
}

.btn-mobile-act-wa {
  background: #25d366;
  color: #ffffff;
}
.btn-mobile-act-wa:hover {
  background: #1ebc59;
}

.btn-mobile-act-details {
  background: var(--primary);
  color: #ffffff;
}
.btn-mobile-act-details:hover {
  background: var(--primary-hover);
}

/* ==========================================================================
   Lead Details Drawer (Slide-Over)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 998;
}

.lead-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 540px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow-xl);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lead-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #f8fafc;
}
.drawer-title-group h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.lead-profile-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.profile-field-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 12px;
}
.field-label { color: var(--text-muted); font-weight: 500; }
.field-value { font-weight: 700; color: var(--dark); text-align: right; }

.locked-phone-pill {
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #fecaca;
}

/* Drawer Tabs */
.drawer-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.drawer-tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.drawer-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Remarks Form */
.add-remark-box {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
}
.form-group {
  margin-bottom: 12px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 4px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fff;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
}
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
}
.timeline-content {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.timeline-author { font-weight: 700; color: var(--dark); }
.timeline-time { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.timeline-tag-info { font-size: 11px; color: var(--primary); margin-bottom: 4px; }
.timeline-body { font-size: 12px; color: var(--slate); line-height: 1.4; }

/* Call History Card */
.call-log-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.call-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.call-outcome-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
}
.call-talk-time {
  font-size: 12px;
  color: #065f46;
  font-weight: 700;
}

/* ==========================================================================
   Floating Live Call Tracker Stopwatch
   ========================================================================== */

.floating-call-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 2px solid rgba(255, 255, 255, 0.15);
  z-index: 1000;
  padding: 16px 20px;
  min-width: 320px;
  animation: bounceIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bounceIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.call-widget-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.call-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.call-pulse {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulseDot 1s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.call-phone {
  margin-left: auto;
  font-family: monospace;
  font-size: 11px;
  color: #94a3b8;
}

.call-timer-display {
  font-size: 32px;
  font-weight: 800;
  font-family: monospace;
  text-align: center;
  color: #34d399;
  letter-spacing: 2px;
}

.call-widget-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-dialog-lg { max-width: 750px; }

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 16px; font-weight: 800; color: var(--dark); }
.btn-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Sample Excel Template Card in Import Modal */
.sample-template-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sample-template-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sample-template-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.sample-template-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 2px;
}

.sample-template-subtext {
  font-size: 12px;
  color: #15803d;
  line-height: 1.4;
  margin-bottom: 8px;
}

.template-col-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.template-pill {
  font-size: 10.5px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #86efac;
  color: #166534;
  padding: 2px 7px;
  border-radius: 999px;
}

.template-pill.req {
  background: #dcfce7;
  border-color: #22c55e;
  font-weight: 700;
}

.sample-template-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #bbf7d0;
}

/* Reminder Pop-up Specific Styling */
.reminder-popup-card {
  text-align: center;
}
.reminder-bell-icon {
  width: 56px;
  height: 56px;
  background: #fef3c7;
  color: #d97706;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  animation: ringBell 1.5s infinite;
}
@keyframes ringBell {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(15deg); }
  20%, 40% { transform: rotate(-15deg); }
}

/* Toast */
.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.app-toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast-success { background: #065f46; color: #fff; }

/* ==========================================================================
   Login Screen
   ========================================================================== */

#loginContainer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 36px;
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.quick-login-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.quick-login-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.quick-login-pill {
  font-size: 11px;
  padding: 4px 8px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-login-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   Meta Ads & Conversions API (CAPI) Command Center Styling
   ========================================================================== */

.meta-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.meta-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.meta-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.meta-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

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

.meta-stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
}

.meta-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.badge-capi-synced {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #bbf7d0;
}

.badge-capi-pending {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef9c3;
  color: #854d0e;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-capi-failed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.meta-control-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

@media (max-width: 960px) {
  .meta-control-grid {
    grid-template-columns: 1fr;
  }
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
}

.capi-flow-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flow-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--slate);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 8px 10px;
}

.step-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text code {
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
  font-family: monospace;
}

.drawer-capi-control-box {
  transition: all 0.2s ease;
}
.drawer-capi-control-box:hover {
  border-color: #cbd5e1;
}

.btn-xs {
  padding: 3px 6px;
  font-size: 10.5px;
  line-height: 1.2;
  border-radius: 4px;
}

/* ==========================================================================
   Mobile & Tablet Responsiveness (Zero Horizontal Scroll & Off-Canvas Menu)
   ========================================================================== */

/* Hamburger Button & Off-Canvas Backdrop */
.btn-hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--dark);
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.btn-hamburger:hover {
  background: #f1f5f9;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 998;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.hidden {
  display: none;
}

/* Tablet & Mobile Layout (<= 992px) */
@media (max-width: 992px) {
  .btn-hamburger {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-wrapper {
    width: 100%;
    min-width: 0;
  }

  .top-header {
    padding: 0 14px;
    gap: 10px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Quick filter tabs swipeable horizontally */
  .tab-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    gap: 6px;
  }
  .tab-filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .filter-bar {
    padding: 12px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .filter-row select,
  .filter-row button {
    width: 100%;
  }
  #btnClearFilters {
    grid-column: 1 / -1;
  }
  #tableCountDisplay {
    grid-column: 1 / -1;
    margin-left: 0 !important;
    text-align: right;
  }

  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* Phone Layout (<= 768px) */
@media (max-width: 768px) {
  .top-header {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left {
    width: 100%;
    max-width: 100%;
    order: 1;
    gap: 8px;
  }

  .search-input {
    font-size: 12px;
    padding: 8px 10px;
  }
  .btn-search {
    padding: 8px 12px;
    font-size: 12px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    order: 2;
    padding-top: 4px;
    border-top: 1px solid var(--border-light);
  }

  .talk-time-pill {
    font-size: 11px;
    padding: 4px 10px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .content-body {
    padding: 12px 10px;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .leads-view-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .view-mode-toggle-group {
    width: 100%;
  }
  .btn-view-toggle {
    flex: 1;
    justify-content: center;
  }

  .mobile-card-body-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* Full Screen Slide-Over Drawer on Phone */
  .lead-drawer {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }
  .lead-drawer.active {
    right: 0;
  }
  .drawer-header {
    padding: 14px 16px;
  }
  .drawer-body {
    padding: 14px 16px;
  }

  /* Responsive Modals on Phone */
  .modal-backdrop {
    padding: 8px;
  }
  .modal-dialog {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-md);
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 12px 16px;
  }

  /* Bulk Action Bar on Phone */
  .bulk-action-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Floating Call Widget on Phone */
  .floating-call-widget {
    bottom: 12px;
    right: 12px;
    left: 12px;
    min-width: unset;
    width: auto;
    padding: 12px 14px;
  }
}

/* ==========================================================================
   Android Companion Bridge UI Styles
   ========================================================================== */
.bridge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.bridge-status-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.bridge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #94a3b8;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.bridge-dot.dot-online {
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulseGreen 2s infinite;
}

.bridge-dot.dot-ringing {
  background-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  animation: pulseAmber 1s infinite;
}

.bridge-dot.dot-offline {
  background-color: #94a3b8;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Bridge Modal Tabs */
.bridge-tabs-nav {
  display: flex;
  gap: 8px;
  padding: 0 20px 10px 20px;
  border-bottom: 1px solid var(--border);
}

.bridge-tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bridge-tab-btn:hover {
  background: var(--bg-page);
  color: var(--dark);
}

.bridge-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

.bridge-tab-content {
  display: block;
}

.bridge-tab-content.hidden {
  display: none !important;
}

/* PIN Display Card */
.pin-display-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin: 8px 0;
}

.pin-code-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--primary);
}

/* Calling Mode Cards */
.calling-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  transition: all 0.2s ease;
}

.calling-mode-card:hover {
  border-color: #cbd5e1;
}

.calling-mode-card input[type="radio"]:checked + div {
  color: var(--primary);
}

.calling-mode-card:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: #f5f3ff;
}

/* In-CRM Virtual Phone Mockup */
.sim-phone-screen {
  background: #0f172a;
  border: 4px solid #334155;
  border-radius: 24px;
  padding: 8px;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

.sim-phone-notch {
  width: 60px;
  height: 5px;
  background: #1e293b;
  border-radius: 3px;
  margin: 2px auto 6px auto;
}

.sim-phone-status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  padding: 0 8px 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-phone-body {
  padding: 16px 10px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sim-standby-view {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sim-incoming-view {
  background: #1e293b;
  border-radius: 12px;
  padding: 12px;
  width: 100%;
  text-align: center;
  animation: pulseAmber 1s infinite;
}

.sim-incall-view {
  background: #064e3b;
  border: 1px solid #059669;
  border-radius: 12px;
  padding: 12px;
  width: 100%;
  text-align: center;
}

.sim-audit-log-box {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 11px;
  max-height: 100px;
  overflow-y: auto;
  color: #a7f3d0;
}

.sim-log-line {
  margin-bottom: 3px;
}

/* Mini Tags & Badges */
.bridge-tag-mini {
  background: #10b981;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.call-widget-remote {
  border-left: 4px solid #10b981 !important;
}

.call-live-badge {
  display: inline-block;
  font-size: 11px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.badge-online-pulse {
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-verified-telemetry {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.badge-manual-telemetry {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

