/* ═══════════════════════════════════════════════════════════════════════════
   EKATVA LEADS ADMIN DASHBOARD — Professional Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Base Reset & Variables ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light dark;
  --bg-deep:       #070b14;
  --bg-surface:    #0d1320;
  --bg-card:       #111827;
  --bg-card-hover: #151f30;
  --bg-input:      #0d1320;

  --border-color:  rgba(255,255,255,0.1);
  --border-subtle: rgba(255,255,255,0.06);
  --border-glow:   rgba(99,102,241,0.35);

  --text-primary:   #f1f5f9;
  --text-secondary: #64748b;
  --text-muted:     #374151;

  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-cyan:   #22d3ee;
  --accent-green:  #10b981;
  --accent-amber:  #f59e0b;
  --accent-orange: #f97316;
  --accent-rose:   #f43f5e;

  --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);

  --sidebar-w: 240px;
  --topbar-h:  72px;
  --radius:    14px;
  --radius-sm: 8px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.03) inset;
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow-indigo: 0 0 30px rgba(99,102,241,0.2);

  --font-head: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --glass-border: rgba(255,255,255,0.08);

  /* Theme variables for topbar & alerts */
  --topbar-bg: rgba(7,11,20,0.85);
  --alert-title-color: #fca5a5;
  --alert-meta-color: #f87171;
  --alert-row-bg: rgba(244,63,94,0.07);
}

/* Glass card utility used in modals */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-lead-name {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.modal-lead-company {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}


html[data-theme="light"] {
  --bg-deep:       #f8fafc;
  --bg-surface:    #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input:      #ffffff;

  --border-color:  rgba(0,0,0,0.12);
  --border-subtle: rgba(0,0,0,0.08);
  --border-glow:   rgba(99,102,241,0.15);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;

  --shadow-card: 0 4px 15px rgba(0,0,0,0.04), 0 1px 0 rgba(0,0,0,0.01) inset;
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.06);

  /* Theme variables for light mode */
  --topbar-bg: rgba(255,255,255,0.95);
  --alert-title-color: #991b1b;
  --alert-meta-color: #b91c1c;
  --alert-row-bg: rgba(244,63,94,0.05);
  --glass-border: rgba(0,0,0,0.08);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1; }
html[data-theme="light"] .kpi-card:hover, html[data-theme="light"] .chart-card:hover { border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .data-table tbody tr:hover { background: rgba(0,0,0,0.02); }
html[data-theme="light"] .data-table thead tr { background: rgba(0,0,0,0.02); }

html[data-theme="light"] .page-title {
  background: linear-gradient(90deg, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .badge-follow_up, html[data-theme="light"] .badge-follow_ups {
  color: #c2410c !important;
}
html { scroll-behavior: smooth; }

html, body {
  font-size: 105%;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #1e2d47; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-indigo); }

/* ── SIDEBAR ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 14px 10px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.sidebar-link svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sidebar-link.active {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-indigo);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}
.db-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--accent-green);
  font-weight: 600;
}
.db-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.db-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── MAIN CONTENT ───────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-right: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 32px 40px;
  width: calc(100% - calc(var(--sidebar-w) * 2));
}

/* ── RIGHT SIDEBAR ──────────────────────────────────────────────────────── */
.right-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}


/* ── TOPBAR ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  margin: 0 -32px;
  padding: 0 32px;
  margin-bottom: 28px;
  transition: background var(--transition);
}
.page-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #f1f5f9, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
}
.refresh-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border-radius: 30px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #818cf8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}
.refresh-btn svg { width: 15px; height: 15px; fill: currentColor; }
.refresh-btn:hover { background: rgba(99,102,241,0.28); border-color: var(--accent-indigo); }
/* ── SLA ALERT BANNER ──────────────────────────────────────────────────── */
.alerts-section {
  margin-bottom: 24px;
  width: 100%;
}
.sidebar-alerts-section {
  display: block;
  border-top: 1px solid var(--border-subtle);
  padding: 16px 14px;
  overflow-y: auto;
  max-height: calc(100vh - 360px);
}
.sidebar-alerts-section::-webkit-scrollbar { width: 4px; }
.sidebar-alerts-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-alerts-section .alert-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  background: var(--alert-row-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid #f43f5e;
}
.sidebar-alerts-section .alert-row-name {
  font-size: 0.82rem;
  font-weight: 700;
}
.sidebar-alerts-section .alert-row-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sidebar-alerts-section .alert-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 4px;
}
.sidebar-alerts-section .alert-btn {
  padding: 3px 10px;
  font-size: 0.7rem;
  border-radius: 12px;
}

.mobile-alerts-section {
  display: none !important;
}

@media (max-width: 768px) {
  .sidebar-alerts-section { display: none !important; }
  .mobile-alerts-section { display: block !important; }
  
  .mobile-only-brand {
    display: flex !important;
  }
  
  /* Make topbar fit better on mobile */
  .topbar {
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .page-title {
    font-size: 1.15rem;
  }
  .breadcrumb {
    font-size: 0.7rem;
    white-space: normal;
  }
  .header-nav-btns {
    flex-wrap: wrap;
  }
}
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(244,63,94,0.08), rgba(239,68,68,0.04));
  border: 1px solid rgba(244,63,94,0.3);
  box-shadow: 0 0 30px rgba(244,63,94,0.08);
  animation: slideDown 0.4s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.alert-banner-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.alert-banner-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--alert-title-color); margin-bottom: 10px; }
.alerts-list-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--alert-row-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid #f43f5e;
  gap: 12px;
}



.alert-row-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.alert-row-meta { font-size: 0.78rem; color: var(--alert-meta-color); }
.alert-actions { display: flex; gap: 8px; flex-shrink: 0; }
.alert-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.alert-btn-email { background: rgba(244,63,94,0.2); color: #f87171; border: 1px solid rgba(244,63,94,0.4); }
.alert-btn-call  { background: rgba(168,85,247,0.2); color: #c084fc; border: 1px solid rgba(168,85,247,0.4); }
.alert-btn:hover { opacity: 0.75; }

/* ── KPI ROW ────────────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  cursor: default;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(255,255,255,0.1); }
.kpi-card-inner { padding: 20px 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi-card-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.kpi-card-value {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
  margin-top: 4px;
}
.kpi-card-icon { font-size: 1.1rem; margin-top: 2px; }
.kpi-card-bar { height: 3px; }

[data-gradient="indigo"] .kpi-card-bar { background: linear-gradient(90deg, #6366f1, #818cf8); }
[data-gradient="cyan"]   .kpi-card-bar { background: linear-gradient(90deg, #0891b2, #22d3ee); }
[data-gradient="purple"] .kpi-card-bar { background: linear-gradient(90deg, #7e22ce, #a855f7); }
[data-gradient="amber"]  .kpi-card-bar { background: linear-gradient(90deg, #b45309, #f59e0b); }
[data-gradient="green"]  .kpi-card-bar { background: linear-gradient(90deg, #065f46, #10b981); }
[data-gradient="rose"]   .kpi-card-bar { background: linear-gradient(90deg, #9f1239, #f43f5e); }

/* ── CHART LAYOUTS ──────────────────────────────────────────────────────── */
.charts-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.charts-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── CHART CARD ─────────────────────────────────────────────────────────── */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.chart-card:hover { border-color: rgba(255,255,255,0.09); box-shadow: var(--shadow-hover); }

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.chart-card-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.chart-card-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 3px; }

.chart-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.badge-indigo { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.25); }
.badge-purple { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.badge-cyan   { background: rgba(34,211,238,0.12); color: #67e8f9; border: 1px solid rgba(34,211,238,0.25); }
.badge-green  { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-amber  { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.badge-rose   { background: rgba(244,63,94,0.12);  color: #fb7185; border: 1px solid rgba(244,63,94,0.25); }

.chart-wrap { position: relative; height: 350px; flex-grow: 1; }
.chart-wrap-tall { height: 400px; }

/* ── DATA TABLE CARD ────────────────────────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-bottom: 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
html[data-theme="light"] .table-card {
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.table-card-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
}
html[data-theme="light"] .table-card-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(180deg, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0) 100%);
}

.table-card-title-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  position: relative;
}

.filter-input, .filter-select {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 10px;
  outline: none;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
html[data-theme="light"] .filter-input, html[data-theme="light"] .filter-select {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
  background: rgba(15, 23, 42, 0.7);
}
html[data-theme="light"] .filter-input:focus, html[data-theme="light"] .filter-select:focus {
  background: #ffffff;
}

.clear-filters-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.clear-filters-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  transform: translateY(-1px);
}
html[data-theme="light"] .clear-filters-btn {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}
html[data-theme="light"] .clear-filters-btn:hover {
  background: #ffe4e6;
}

.date-filter-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding-left: 12px;
  transition: all 0.3s ease;
}
html[data-theme="light"] .date-filter-wrapper {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
}
.date-filter-wrapper:focus-within {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.date-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  user-select: none;
}
.date-filter-wrapper .filter-select {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 12px 10px 4px;
}

.table-scroll { 
  overflow-x: auto !important; 
  overflow-y: auto !important; 
  width: 100%; 
  max-height: 70vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.5) rgba(15, 23, 42, 0.2);
}
.table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}
.timeline-history-container {
  max-height: 600px !important;
  overflow-y: auto !important;
  padding-right: 8px;
  scrollbar-width: thin;
}
.data-table { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; text-align: left; }
.data-table thead th {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 16px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
html[data-theme="light"] .data-table thead th {
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.9rem;
  vertical-align: middle;
  color: var(--text-primary);
  transition: all 0.2s ease;
}
html[data-theme="light"] .data-table td {
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.data-table tbody tr {
  transition: all 0.2s ease;
  position: relative;
}
.data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.01);
}
html[data-theme="light"] .data-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.01);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(0,0,0,0.02);
}

.data-table tbody tr.tr-new-lead {
  background: rgba(37, 99, 235, 0.15) !important;
  box-shadow: inset 4px 0 0 #2563eb !important;
}
html[data-theme="light"] .data-table tbody tr.tr-new-lead {
  background: #eff6ff !important;
  box-shadow: inset 5px 0 0 #2563eb !important;
}
html[data-theme="light"] .data-table tbody tr.tr-new-lead td {
  background: #eff6ff !important;
}

.data-table tbody tr:hover td:first-child {
  position: relative;
}
.data-table tbody tr:hover td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-indigo);
  border-radius: 0 4px 4px 0;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.lead-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}
.lead-name-text {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s;
}
.lead-name-text:hover {
  color: var(--accent-indigo);
}

.lead-company-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-email { color: #3b82f6; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.lead-email:hover { color: #60a5fa; text-decoration: underline; }
html[data-theme="light"] .lead-email { color: #2563eb; }
html[data-theme="light"] .lead-email:hover { color: #1d4ed8; }

.lead-location-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.table-loading { text-align: center; padding: 60px; color: var(--text-secondary); font-size: 1rem; }

/* ── STATUS BADGES ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
}
.badge-new         { background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.1));  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.badge-follow_up, .badge-follow_ups { background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(249,115,22,0.1));  color: #fdba74; border: 1px solid rgba(249,115,22,0.3); }
.badge-contacted   { background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(34,211,238,0.1));  color: #67e8f9; border: 1px solid rgba(34,211,238,0.3); }
.badge-qualified   { background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(168,85,247,0.1));  color: #d8b4fe; border: 1px solid rgba(168,85,247,0.3); }
.badge-proposal    { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.1));  color: #fde047; border: 1px solid rgba(245,158,11,0.3); }
.badge-closed_won  { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.1));  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.badge-closed_lost { background: linear-gradient(135deg, rgba(244,63,94,0.2), rgba(244,63,94,0.1));   color: #fda4af; border: 1px solid rgba(244,63,94,0.3); }

html[data-theme="light"] .badge-new { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; box-shadow: none; }
html[data-theme="light"] .badge-follow_up, html[data-theme="light"] .badge-follow_ups { background: #ffedd5; color: #c2410c; border-color: #fed7aa; box-shadow: none; }
html[data-theme="light"] .badge-contacted { background: #cffafe; color: #0e7490; border-color: #a5f3fc; box-shadow: none; }
html[data-theme="light"] .badge-qualified { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; box-shadow: none; }
html[data-theme="light"] .badge-proposal { background: #fef3c7; color: #b45309; border-color: #fde68a; box-shadow: none; }
html[data-theme="light"] .badge-closed_won { background: #d1fae5; color: #047857; border-color: #a7f3d0; box-shadow: none; }
html[data-theme="light"] .badge-closed_lost { background: #ffe4e6; color: #be123c; border-color: #fecdd3; box-shadow: none; }

/* ── TABLE SELECT DROPDOWNS ────────────────────────────────────────────── */
.table-select {
  display: inline-flex;
  align-items: center;
  padding: 6px 30px 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}
.table-select:focus {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}
.table-select option {
  background: #1e293b;
  color: #f8fafc;
  font-weight: 600;
  padding: 8px;
}
html[data-theme="light"] .table-select {
  background-color: #ffffff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
html[data-theme="light"] .table-select option {
  background: #ffffff;
  color: #0f172a;
}

.priority-high   { background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(244, 63, 94, 0.1)); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.priority-medium { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1)); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-low    { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }

html[data-theme="light"] .priority-high   { background-color: #ffe4e6; background-image: none; color: #be123c; border-color: #fecdd3; }
html[data-theme="light"] .priority-medium { background-color: #fef3c7; background-image: none; color: #b45309; border-color: #fde68a; }
html[data-theme="light"] .priority-low    { background-color: #d1fae5; background-image: none; color: #047857; border-color: #a7f3d0; }

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
}
.btn-view { color: #818cf8; }
.btn-view:hover { background: rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.25); transform: translateY(-2px); }
.btn-edit { color: #34d399; }
.btn-edit:hover { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.25); transform: translateY(-2px); }
.btn-delete { color: #fb7185; }
.btn-delete:hover { background: rgba(244, 63, 94, 0.15); border-color: rgba(244, 63, 94, 0.25); transform: translateY(-2px); }

/* ── MOBILE BOTTOM NAV ─────────────────────────────────────────────────── */
.mobile-bottom-nav { display: none; }

/* ── RESPONSIVE MEDIA QUERIES ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1400px) {
  .data-table th, .data-table td { padding: 8px 10px; }
  .data-table th { font-size: 0.68rem; }
  .data-table td { font-size: 0.8rem; }
  .lead-name { font-size: 0.85rem; }
}

@media (max-width: 1024px) {
  .charts-grid-2 { grid-template-columns: 1fr; }
  .main-content { padding: 0 20px 40px; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .right-sidebar {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: right 0.3s ease;
    background: var(--bg-surface);
    box-shadow: -4px 0 15px rgba(0,0,0,0.15);
  }
  .right-sidebar.mobile-open {
    right: 0;
  }
  .main-content { margin-left: 0; margin-right: 0; width: 100%; padding: 0 16px 90px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  
  .topbar { 
    margin: 0 -16px 20px; 
    padding: 12px 16px; 
    height: auto; 
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .topbar-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  .topbar-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 4px;
  }
  .topbar-date { display: none; }
  .breadcrumb { display: none; }
  .page-title { font-size: 1.15rem; margin: 0; }
  .refresh-btn { padding: 6px 12px; font-size: 0.78rem; }
  
  .filter-input, .filter-select { min-width: unset; width: 100%; }
  .date-filter-wrapper { width: 100%; justify-content: space-between; }
  .date-filter-wrapper .filter-select { width: auto; flex-grow: 1; text-align: right; }
  .table-filters { width: 100%; flex-direction: column; align-items: stretch; }
  
  .alert-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .alert-actions { width: 100%; justify-content: flex-end; }

  /* Canvas height for phone screens */
  .chart-wrap { height: 300px; }
  .chart-wrap-tall { height: 400px; }

  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%; height: 62px;
    z-index: 1000;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-primary);
    opacity: 0.65;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    transition: var(--transition);
  }
  .mobile-nav-icon { font-size: 1.2rem; line-height: 1; }
  .mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--accent-indigo);
    opacity: 1;
  }

  /* Mobile Input Text Styling Fixes */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea,
  .modal-form-input,
  .form-input,
  .filter-input,
  .filter-select,
  .location-select {
    font-size: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 14px !important;
    line-height: 1.4 !important;
    min-height: 44px !important;
    border-radius: 8px !important;
  }

  .form-group {
    width: 100% !important;
    margin-bottom: 16px !important;
  }
}

@media (max-width: 640px) {
  .modal-overlay { padding: 10px; }
  .modal-content { 
    padding: 20px 16px !important; 
    max-height: 92vh !important; 
    width: 95% !important;
    border-radius: 12px !important;
  }
  .modal-grid { 
    grid-template-columns: 1fr !important; 
    gap: 12px !important; 
  }
  .modal-actions { 
    flex-direction: column !important; 
    gap: 8px !important; 
  }
  .modal-btn { 
    width: 100% !important; 
  }
  #audit-search-input { 
    width: 100% !important; 
  }
}

@media (max-width: 480px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card-inner { padding: 14px 12px 10px; }
  .kpi-card-value { font-size: 1.6rem; }
  .kpi-card-label { font-size: 0.65rem; }
  .chart-card { padding: 16px 14px; }
  .table-card { padding: 14px; }
}

/* ── MODAL COMPONENT ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(11, 15, 25, 0.6);
  backdrop-filter: blur(15px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-content {
  width: 100%; max-width: 1100px;
  max-height: 90vh; overflow-y: auto;
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}
.modal-overlay.show .modal-content { transform: scale(1); }
.close-modal-btn {
  position: absolute; top: 16px; right: 16px;
  background: transparent; border: none;
  color: var(--text-primary); font-size: 1.8rem;
  cursor: pointer; line-height: 1;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}
.close-modal-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* Modal details layout */
.modal-lead-title { margin-bottom: 20px; }
.modal-lead-title h3 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.modal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.modal-section { grid-column: 1 / -1; }
.modal-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 4px; font-weight: 700; }
.modal-value { font-size: 0.95rem; color: var(--text-primary); font-weight: 500; }
.modal-value-text { font-size: 0.9rem; color: var(--text-primary); line-height: 1.5; background: rgba(255, 255, 255, 0.02); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }

/* Inline Edit Form in Modal */
.modal-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.modal-form-group label { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.modal-form-input, .modal-form-select, .modal-form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: border-color 0.2s;
}
.modal-form-input:focus, .modal-form-select:focus, .modal-form-textarea:focus { border-color: var(--accent-indigo); }
.modal-form-textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; border-top: 1px solid var(--border-subtle); padding-top: 18px; }
.modal-btn {
  flex: 1; padding: 10px 16px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; border: none; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.modal-btn-primary { background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; }
.modal-btn-primary:hover { opacity: 0.9; }
.modal-btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.modal-btn-secondary:hover { background: rgba(255,255,255,0.1); }
.modal-btn-danger { background: rgba(244, 63, 94, 0.12); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.2); }
.modal-btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

/* ── ULTIMATE LIGHT MODE CONTRAST OVERRIDES ── */
html[data-theme="light"], 
html[data-theme="light"] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .filter-input,
html[data-theme="light"] .filter-select,
html[data-theme="light"] .modal-form-input,
html[data-theme="light"] .modal-form-select,
html[data-theme="light"] .modal-form-textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
}

html[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] label,
html[data-theme="light"] .modal-label,
html[data-theme="light"] .alert-row-meta,
html[data-theme="light"] .kpi-title,
html[data-theme="light"] .chart-sub {
  color: #475569 !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] .kpi-val,
html[data-theme="light"] .chart-title,
html[data-theme="light"] .table-card-title,
html[data-theme="light"] .modal-lead-name,
html[data-theme="light"] .alert-row-name {
  color: #0f172a !important;
}

html[data-theme="light"] .sidebar {
  background-color: #ffffff !important;
  border-right: 1px solid rgba(0,0,0,0.08) !important;
}

html[data-theme="light"] .sidebar-link {
  color: #475569 !important;
}

html[data-theme="light"] .sidebar-link.active {
  background-color: rgba(99,102,241,0.08) !important;
  color: #4f46e5 !important;
}

html[data-theme="light"] .topbar {
  background-color: rgba(255,255,255,0.95) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

html[data-theme="light"] .kpi-card,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .table-card,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .glass-card {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
}

html[data-theme="light"] .data-table {
  color: #0f172a !important;
}

html[data-theme="light"] .data-table thead tr,
html[data-theme="light"] .data-table th {
  background-color: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

html[data-theme="light"] .data-table td {
  color: #0f172a !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

html[data-theme="light"] .data-table tbody tr:hover {
  background-color: #f1f5f9 !important;
}

html[data-theme="light"] .mobile-bottom-nav {
  background-color: #ffffff !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
}

html[data-theme="light"] .mobile-nav-label {
  color: #475569 !important;
}

html[data-theme="light"] .modal-btn-secondary:hover {
  background: #e2e8f0 !important;
}

html[data-theme="light"] .auth-card {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08) !important;
}

html[data-theme="light"] .form-input {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
}

html[data-theme="light"] .form-label {
  color: #475569 !important;
}

html[data-theme="light"] .control-btn {
  color: #475569 !important;
}

html[data-theme="light"] .control-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}

/* 🔔 Notifications Styling */
.notif-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  font-size: 1.15rem !important;
  position: relative !important;
}

#notif-badge-count {
  position: absolute !important;
  top: -2px !important;
  right: -2px !important;
  background: #f43f5e !important;
  color: white !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
  padding: 2px 5px !important;
  line-height: 1 !important;
  display: inline-block;
}

#notification-dropdown {
  position: absolute;
  right: 0;
  top: 45px;
  width: 320px;
  z-index: 9999;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  #notification-dropdown {
    position: fixed !important;
    top: 72px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4) !important;
  }
}




/* Fix table select dropdown arrow in light mode */
html[data-theme="light"] .table-select {
  border-color: rgba(0, 0, 0, 0.15) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 12px 12px !important;
}

html[data-theme="light"] .badge-new         { background-color: #e0e7ff !important; color: #4338ca !important; border-color: #c7d2fe !important; }
html[data-theme="light"] .badge-follow_up, 
html[data-theme="light"] .badge-follow_ups { background-color: #ffedd5 !important; color: #c2410c !important; border-color: #fed7aa !important; }
html[data-theme="light"] .badge-contacted   { background-color: #cffafe !important; color: #0e7490 !important; border-color: #a5f3fc !important; }
html[data-theme="light"] .badge-qualified   { background-color: #f3e8ff !important; color: #7e22ce !important; border-color: #e9d5ff !important; }
html[data-theme="light"] .badge-proposal    { background-color: #fef3c7 !important; color: #b45309 !important; border-color: #fde68a !important; }
html[data-theme="light"] .badge-closed_won  { background-color: #d1fae5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }
html[data-theme="light"] .badge-closed_lost { background-color: #ffe4e6 !important; color: #be123c !important; border-color: #fecdd3 !important; }

html[data-theme="light"] .priority-high   { background-color: #ffe4e6 !important; color: #be123c !important; border-color: #fecdd3 !important; }
html[data-theme="light"] .priority-medium { background-color: #fef3c7 !important; color: #b45309 !important; border-color: #fde68a !important; }
html[data-theme="light"] .priority-low    { background-color: #d1fae5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }

/* Mobile Table Filters Layout */
@media (max-width: 768px) {
  .table-card-header { padding: 16px !important; }
  .table-card-title-block { flex-direction: column; align-items: flex-start; gap: 12px; }
  .table-filters { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; width: 100%; margin-top: 12px !important; padding-top: 12px !important; }
  .filter-input, .filter-select, .date-filter-wrapper { width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
  .table-filters > div:first-child { grid-column: 1 / -1; }
  .date-filter-wrapper { grid-column: 1 / -1; }
  
  /* Mobile Chart Adjustments */
  .chart-wrap { height: 300px !important; }
  .chart-wrap-tall { height: 320px !important; }
  .chart-card { padding: 16px 12px !important; }
  .charts-grid-2, .charts-grid-1 { gap: 14px !important; margin-bottom: 14px !important; }
}


/* ── AUDIT & HISTORY TIMELINE TEXT SIZE ENHANCEMENT ── */
#audit-log-table td, #audit-log-table th {
  font-size: 0.95rem !important;
  padding: 14px 18px !important;
}

#audit-log-table tr:hover td {
  font-size: 1.02rem !important;
  color: var(--text-primary) !important;
  background: rgba(99, 102, 241, 0.08) !important;
}

.timeline-item {
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  transition: all 0.2s ease !important;
  padding: 12px 16px !important;
  border-radius: 8px !important;
}

.timeline-item:hover, .timeline-item.active, .timeline-item.marked {
  font-size: 1.05rem !important;
  background: rgba(99, 102, 241, 0.12) !important;
  border-left: 4px solid var(--accent-indigo) !important;
  transform: translateX(4px);
}

.timeline-details, .timeline-content {
  font-size: 0.92rem !important;
  color: var(--text-primary) !important;
}

.timeline-item:hover .timeline-details, 
.timeline-item.marked .timeline-details {
  font-size: 1.02rem !important;
  font-weight: 600 !important;
}


/* ── CHATBOT CONVERSATION UI STYLES ── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
}
.chat-header {
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-input, rgba(15, 23, 42, 0.4));
  scrollbar-width: thin;
}
.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  word-break: break-word;
}
.chat-bubble-external {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  border-top-left-radius: 2px;
}
.chat-bubble-internal {
  align-self: center;
  width: 92%;
  max-width: 92%;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-primary);
  border-radius: 10px;
}
.chat-bubble-staff {
  align-self: flex-end;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border-top-right-radius: 2px;
}
.chat-meta {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-input-bar {
  padding: 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-scope-toggle {
  display: flex;
  gap: 8px;
}
.chat-scope-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.chat-scope-btn.active-internal {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}
.chat-scope-btn.active-external {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.4);
}
