/* ==========================================================================
   SUPER CRM — Executive SaaS Design System (v9.0)
   Cohesive Dual-Theme Palette:
     • Light (Default): Executive Alabaster Canvas + Midnight Indigo Sidebar
     • Dark (body.dark-mode): Obsidian Midnight Glass + Luminous Indigo/Cyan
   Zero duplicate rules, zero !important overrides, 100% tokenized surfaces.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* ── Signature Indigo → Violet & Cyan Accents ── */
  --primary:          #4f46e5;
  --primary-hover:    #4338ca;
  --primary-light:    #6366f1;
  --primary-soft:     rgba(79, 70, 229, 0.10);
  --primary-glow:     rgba(79, 70, 229, 0.28);

  --accent:           #4f46e5;
  --accent2:          #0284c7;
  --cyan:             #0ea5e9;
  --emerald:          #10b981;
  --green:            #10b981;
  --orange:           #f59e0b;
  --red:              #f43f5e;
  --violet:           #8b5cf6;

  /* ── Gradients ── */
  --grad-primary:     linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #0ea5e9 100%);
  --grad-sidebar:     linear-gradient(180deg, #0b1120 0%, #0f172a 65%, #111b33 100%);
  --grad-emerald:     linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-amber:       linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --grad-rose:        linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);

  /* ── Executive Daylight Surfaces ── */
  --bg-app:           #f3f6fb;
  --bg-canvas:        #eef2f8;
  --bg-card:          #ffffff;
  --bg-subtle:        #f8fafc;
  --bg-hover:         #f1f5f9;
  --bg-glass:         rgba(255, 255, 255, 0.84);
  --card-bg:          #ffffff;

  /* ── Borders & Hairlines ── */
  --border:           rgba(15, 23, 42, 0.08);
  --border-strong:    rgba(15, 23, 42, 0.15);
  --border-glow:      rgba(79, 70, 229, 0.35);

  /* ── Typography ── */
  --txt:              #0f172a;
  --txt-main:         #0f172a;
  --txt-subtle:       #334155;
  --txt-muted:        #64748b;
  --txt-dim:          #94a3b8;

  /* ── Midnight Sidebar Tokens ── */
  --sidebar-bg:       #0b1120;
  --sidebar-border:   rgba(148, 163, 184, 0.12);
  --sidebar-text:     #94a3b8;
  --sidebar-text-hi:  #ffffff;
  --sidebar-w:        262px;

  /* ── Elevation & Depth ── */
  --shadow-xs:        0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card:      0 1px 3px rgba(15, 23, 42, 0.05), 0 6px 18px -6px rgba(15, 23, 42, 0.06);
  --shadow-card-hv:   0 14px 30px -10px rgba(79, 70, 229, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.08);
  --shadow-modal:     0 24px 60px -12px rgba(2, 6, 23, 0.32);
  --shadow-btn:       0 6px 16px -4px rgba(79, 70, 229, 0.42);

  /* ── Sizing & Type ── */
  --header-h:         66px;
  --radius-card:      16px;
  --radius-btn:       10px;
  --radius-pill:      9999px;
  --font-sans:        'Inter', system-ui, -apple-system, sans-serif;
  --font-display:     'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-mono:        'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ── Obsidian Midnight Dark Mode ── */
body.dark-mode {
  --bg-app:           #060913;
  --bg-canvas:        #0a0f1e;
  --bg-card:          #0f172a;
  --bg-subtle:        #162033;
  --bg-hover:         #1c2841;
  --bg-glass:         rgba(15, 23, 42, 0.82);
  --card-bg:          #0f172a;

  --border:           rgba(148, 163, 184, 0.13);
  --border-strong:    rgba(148, 163, 184, 0.24);
  --border-glow:      rgba(99, 102, 241, 0.45);

  --txt:              #f1f5f9;
  --txt-main:         #f8fafc;
  --txt-subtle:       #cbd5e1;
  --txt-muted:        #94a3b8;
  --txt-dim:          #64748b;

  --accent2:          #38bdf8;
  --primary-soft:     rgba(99, 102, 241, 0.18);

  --shadow-card:      0 4px 20px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-card-hv:   0 16px 34px -8px rgba(79, 70, 229, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-modal:     0 28px 70px -12px rgba(0, 0, 0, 0.72);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(79, 70, 229, 0.07), transparent),
    radial-gradient(ellipse 70% 45% at 95% 0%, rgba(14, 165, 233, 0.06), transparent);
  background-attachment: fixed;
  color: var(--txt-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}
body.dark-mode {
  background-image:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(79, 70, 229, 0.18), transparent),
    radial-gradient(ellipse 70% 45% at 95% 0%, rgba(6, 182, 212, 0.12), transparent);
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.55); }

.hidden { display: none !important; }
.screen { display: flex; min-height: 100vh; width: 100%; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--grad-sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  color: var(--sidebar-text);
}
.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--grad-primary);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.55);
  flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-top: 2px;
}

.sidebar-nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #64748b;
  padding: 16px 20px 6px;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 11px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.18s ease;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}
.nav-item.active {
  background: var(--grad-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 8px 18px -6px rgba(79, 70, 229, 0.65);
}
.nav-item.active svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}
.nav-item.active .badge {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.sidebar-footer {
  padding: 14px 14px 16px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(2, 6, 23, 0.35);
}
.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.profile-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: #ffffff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.profile-info { min-width: 0; flex: 1; }
.profile-name {
  font-weight: 700; font-size: 0.88rem; color: #f8fafc;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-meta { font-size: 0.74rem; color: #94a3b8; }
.profile-role {
  color: #38bdf8;
  font-weight: 600;
  text-transform: capitalize;
}
.btn-sidebar-logout {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.10);
  color: #fda4af;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-sidebar-logout:hover {
  background: rgba(244, 63, 94, 0.22);
  color: #ffffff;
}

/* ── Main Wrapper & Sticky Frosted Header ── */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.top-header {
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--txt-main);
}
.header-subtitle { font-size: 0.8rem; color: var(--txt-muted); margin-top: 1px; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.header-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
}
.header-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.btn-badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* ── Employee Active Toggle Pill ── */
.employee-active-toggle { cursor: pointer; user-select: none; }
.workflow-active-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 600;
  color: var(--txt-subtle);
  transition: all 0.2s ease;
}
.workflow-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--txt-dim);
}
.workflow-toggle-track {
  width: 30px; height: 17px; border-radius: 99px;
  background: rgba(148, 163, 184, 0.35);
  position: relative; transition: background 0.2s;
}
.workflow-toggle-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #ffffff;
  position: absolute; top: 2px; left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.workflow-active-pill.active-on {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.10);
  color: var(--emerald);
}
.workflow-active-pill.active-on .workflow-dot {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}
.workflow-active-pill.active-on .workflow-toggle-track { background: var(--emerald); }
.workflow-active-pill.active-on .workflow-toggle-thumb { transform: translateX(13px); }

/* ── Content & Views ── */
.content-body { padding: 26px 28px 60px; flex: 1; }
.view { display: none; animation: viewFade 0.22s ease; }
.view.active { display: block; }
@keyframes viewFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-subheader {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  margin-bottom: 22px;
}
.subheader-left h2 {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--txt-main);
}
.subheader-left p { font-size: 0.86rem; color: var(--txt-muted); margin-top: 3px; }
.subheader-actions, .subheader-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Buttons & Inputs ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -4px rgba(79, 70, 229, 0.52);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--txt-main);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--primary-light);
  background: var(--bg-hover);
}
.btn-secondary.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--txt-subtle);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--txt-main);
  border-color: var(--border-strong);
}

.btn-success {
  background: var(--grad-emerald);
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.4);
}
.btn-danger {
  background: var(--grad-rose);
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(244, 63, 94, 0.4);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-action {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--txt-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-action:hover { border-color: var(--primary); color: var(--primary); }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--txt-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--txt-subtle);
  margin-bottom: 6px;
}
.tag-required { font-size: 0.72rem; color: var(--red); font-weight: 700; margin-left: 4px; }
.field-error { color: var(--red); font-size: 0.78rem; margin-top: 4px; }

/* ── View Mode Toggle ── */
.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
  gap: 3px;
}
.btn-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--txt-muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.16s ease;
}
.btn-toggle svg { width: 14px; height: 14px; }
.btn-toggle.active {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.45);
}

/* ── Executive Dashboard KPI Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hv); }
.stat-card:nth-child(2) { border-top-color: var(--cyan); }
.stat-card:nth-child(3) { border-top-color: var(--orange); }
.stat-card:nth-child(4) { border-top-color: var(--violet); }
.stat-card:nth-child(5) { border-top-color: #3b82f6; }
.stat-card:nth-child(6) { border-top-color: var(--emerald); }
.stat-card:nth-child(7) { border-top-color: var(--red); }
.stat-card:nth-child(8) { border-top-color: #059669; }

.stat-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--txt-muted);
  margin-bottom: 8px;
}
.stat-card-value, .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--txt-main);
  line-height: 1.1;
}
.stat-label { font-size: 0.78rem; color: var(--txt-muted); margin-top: 4px; font-weight: 600; }
.stat-card-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--bg-hover);
  margin-top: 14px;
  overflow: hidden;
}
.stat-card-progress {
  height: 100%;
  width: 65%;
  border-radius: 99px;
  background: var(--grad-primary);
}
.stat-card:nth-child(2) .stat-card-progress { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.stat-card:nth-child(3) .stat-card-progress { background: var(--grad-amber); }
.stat-card:nth-child(6) .stat-card-progress { background: var(--grad-emerald); }
.stat-card:nth-child(7) .stat-card-progress { background: var(--grad-rose); }

/* ── Search & Filter Bars ── */
.filter-search-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.search-input-group, .filter-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.search-input-wrapper, .search-box {
  position: relative; flex: 1; min-width: 220px;
}
.search-input-wrapper input, .search-box input { padding-left: 38px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--txt-dim); pointer-events: none;
}
.search-btn { flex-shrink: 0; }

.filter-input-wrapper {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 10px;
  flex: 1; min-width: 180px;
}
.filter-input-wrapper .control-icon { width: 15px; height: 15px; color: var(--txt-muted); flex-shrink: 0; }
.filter-input-wrapper .filter-control {
  border: none; background: transparent; padding: 7px 4px; box-shadow: none;
}
.filter-input-wrapper .filter-control:focus { box-shadow: none; background: transparent; }

/* ── Tables ── */
.leads-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 22px;
}
.table-wrap { width: 100%; overflow-x: auto; }
table, .leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table thead th, .leads-table thead th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-subtle);
  color: var(--txt-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table tbody td, .leads-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--txt-main);
  vertical-align: middle;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover td { background: var(--bg-hover); }
.student-phone-cell { font-family: var(--font-mono); font-size: 0.84rem; color: var(--accent2); font-weight: 600; }
.sub { font-size: 0.75rem; color: var(--txt-muted); margin-top: 2px; }

/* ── Semantic Status Pills (High Contrast Light + Dark) ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  color: var(--txt-subtle);
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}
.status-badge.pending        { background: rgba(245, 158, 11, 0.13); color: #d97706; border-color: rgba(245, 158, 11, 0.30); }
.status-badge.called         { background: rgba(14, 165, 233, 0.13); color: #0284c7; border-color: rgba(14, 165, 233, 0.30); }
.status-badge.interested     { background: rgba(16, 185, 129, 0.14); color: #059669; border-color: rgba(16, 185, 129, 0.32); }
.status-badge.resolved,
.status-badge.enrolled       { background: rgba(5, 150, 105, 0.16); color: #047857; border-color: rgba(16, 185, 129, 0.38); }
.status-badge.call-back      { background: rgba(79, 70, 229, 0.13); color: #4f46e5; border-color: rgba(79, 70, 229, 0.30); }
.status-badge.not-interested { background: rgba(244, 63, 94, 0.13); color: #e11d48; border-color: rgba(244, 63, 94, 0.30); }
.status-badge.not-reachable  { background: rgba(100, 116, 139, 0.14); color: #475569; border-color: rgba(100, 116, 139, 0.28); }

body.dark-mode .status-badge.pending        { color: #fbbf24; }
body.dark-mode .status-badge.called         { color: #38bdf8; }
body.dark-mode .status-badge.interested     { color: #34d399; }
body.dark-mode .status-badge.resolved,
body.dark-mode .status-badge.enrolled       { color: #6ee7b7; }
body.dark-mode .status-badge.call-back      { color: #a5b4fc; }
body.dark-mode .status-badge.not-interested { color: #fda4af; }
body.dark-mode .status-badge.not-reachable  { color: #cbd5e1; }

/* ── Cards Grid (Student / Employee / Admin / Resolved / Team) ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
  gap: 18px;
}

.student-card, .resolved-card, .called-card, .admin-emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.student-card:hover, .resolved-card:hover, .called-card:hover, .admin-emp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hv);
  border-color: var(--border-glow);
}

.card-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.card-category-badge {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary);
}
body.dark-mode .card-category-badge { color: #a5b4fc; }
.card-time-badge { font-size: 0.75rem; color: var(--txt-muted); font-family: var(--font-mono); }

.card-actions-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.btn-card-skip, .btn-card-trash, .btn-card-callback, .btn-card-duplicate,
.btn-card-wa, .btn-card-call {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--txt-subtle);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
}
.btn-card-skip:hover      { border-color: var(--orange); color: #d97706; background: rgba(245, 158, 11, 0.10); }
.btn-card-trash:hover     { border-color: var(--red); color: var(--red); background: rgba(244, 63, 94, 0.10); }
.btn-card-callback:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-card-duplicate:hover { border-color: var(--cyan); color: var(--accent2); background: rgba(14, 165, 233, 0.10); }
.btn-card-wa {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: #059669;
}
body.dark-mode .btn-card-wa { color: #34d399; }
.btn-card-wa:hover { background: #10b981; color: #ffffff; }
.btn-card-call {
  background: var(--grad-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px -3px rgba(79, 70, 229, 0.45);
}
.btn-card-call:hover { transform: translateY(-1px); filter: brightness(1.06); }

.card-top-icons { margin-left: auto; display: flex; gap: 5px; }
.card-icon-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle); color: var(--txt-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.card-icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.card-status-select {
  width: auto; min-width: 112px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.call-count-tag {
  font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono);
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary);
}
body.dark-mode .call-count-tag { color: #a5b4fc; }

.card-sno { font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono); color: var(--accent2); }
.card-student-name {
  font-family: var(--font-display); font-size: 1.04rem; font-weight: 800; color: var(--txt-main);
}
.card-student-phone {
  font-family: var(--font-mono); font-size: 0.84rem; color: var(--txt-subtle); margin-top: 3px;
}
.card-pill-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.card-pill {
  font-size: 0.74rem; font-weight: 600;
  padding: 3px 9px; border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--txt-subtle);
}
.card-call-stats-row {
  display: flex; align-items: center; gap: 8px;
  padding-top: 8px; border-top: 1px dashed var(--border);
}
.pill-failed {
  font-size: 0.73rem; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(244, 63, 94, 0.12); color: #e11d48;
}
.pill-success {
  font-size: 0.73rem; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.13); color: #059669;
}
body.dark-mode .pill-failed { color: #fda4af; }
body.dark-mode .pill-success { color: #34d399; }

.card-history-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
}
.card-history-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px;
}
.history-label { font-size: 0.73rem; font-weight: 700; color: var(--txt-muted); }
.btn-toggle-card-history {
  border: none; background: transparent; color: var(--primary);
  font-size: 0.74rem; font-weight: 700; cursor: pointer;
}
.card-history-latest, .card-history-item {
  font-size: 0.79rem; color: var(--txt-subtle); line-height: 1.4;
}
.history-item-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.history-status-badge {
  font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  background: var(--primary-soft); color: var(--primary);
}
.history-date, .history-duration { font-size: 0.7rem; color: var(--txt-muted); font-family: var(--font-mono); }
.card-history-dropdown { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.card-history-empty { font-size: 0.76rem; color: var(--txt-dim); font-style: italic; }

/* ── Resolved View ── */
.resolved-kpi-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.resolved-kpi-label { font-size: 0.84rem; font-weight: 700; color: var(--emerald); text-transform: uppercase; letter-spacing: 0.06em; }
.resolved-kpi-number { font-family: var(--font-display); font-size: 2.3rem; font-weight: 800; color: var(--txt-main); }
.resolved-card-top { display: flex; justify-content: space-between; align-items: center; }
.resolved-badges-group { display: flex; gap: 6px; }
.badge-lead { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); }
.badge-resolved-tag { font-size: 0.72rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: rgba(16, 185, 129, 0.14); color: var(--emerald); }
.resolved-timestamp { font-size: 0.74rem; color: var(--txt-muted); }
.resolved-student-row { display: flex; align-items: center; gap: 12px; }
.resolved-avatar {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--grad-emerald); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.resolved-student-info h4 { font-size: 0.98rem; font-weight: 700; color: var(--txt-main); }
.resolved-student-info p { font-family: var(--font-mono); font-size: 0.8rem; color: var(--txt-muted); }
.resolved-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* ── Admin Employee Cards & KPI Row ── */
.admin-emp-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-emp-profile { display: flex; align-items: center; gap: 11px; }
.admin-emp-avatar {
  width: 42px; height: 42px; border-radius: 12px; position: relative;
  background: var(--grad-primary); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.admin-emp-name { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--txt-main); }
.admin-emp-meta { font-size: 0.76rem; color: var(--txt-muted); margin-top: 2px; }
.admin-emp-kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px; border-radius: 12px;
  background: var(--bg-subtle); border: 1px solid var(--border); text-align: center;
}
.admin-emp-kpi-val { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.admin-emp-kpi-lbl { font-size: 0.7rem; font-weight: 600; color: var(--txt-muted); text-transform: uppercase; }

/* ── Performance Reports ── */
.perf-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-bottom: 18px;
}
.perf-period-group { display: flex; gap: 6px; flex-wrap: wrap; }
.perf-period-chip {
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--txt-muted); font-weight: 600; font-size: 0.82rem; cursor: pointer;
}
.perf-period-chip.active {
  background: var(--grad-primary); color: #fff; border-color: transparent;
}
.perf-overview-banner {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.perf-metric-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-card);
}
.perf-metric-val { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--txt-main); }
.perf-metric-lbl { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; color: var(--txt-muted); margin-top: 3px; }
.perf-grid-v2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 22px; }
.perf-card-v2 {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 18px; box-shadow: var(--shadow-card);
}
.perf-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.perf-avatar-v2 {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--grad-primary); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.perf-header-info { flex: 1; min-width: 0; }
.perf-name { font-weight: 800; font-size: 1rem; color: var(--txt-main); }
.perf-completion-badge {
  font-family: var(--font-mono); font-weight: 800; font-size: 0.84rem;
  padding: 4px 10px; border-radius: 99px;
  background: var(--primary-soft); color: var(--primary);
}
.perf-bar-wrap { height: 7px; border-radius: 99px; background: var(--bg-hover); overflow: hidden; margin-bottom: 14px; }
.perf-bar { height: 100%; border-radius: 99px; background: var(--grad-primary); }
.perf-kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.perf-kpi { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; }
.perf-kpi-val { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; }
.perf-kpi-lbl { font-size: 0.72rem; color: var(--txt-muted); font-weight: 600; }

/* ── Live Monitor Hangups ── */
.live-hangup-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
}
.live-hangup-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.live-hangup-dur-pill {
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700;
  padding: 2px 9px; border-radius: 99px;
  background: rgba(14, 165, 233, 0.14); color: var(--accent2);
}

/* ── Settings Feedback Banner & Dropzone ── */
.excel-upload-dropzone {
  background: var(--bg-subtle);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.excel-upload-dropzone:hover {
  border-color: var(--primary) !important;
  background: var(--primary-soft);
}
.settings-msg { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 0.84rem; font-weight: 600; }
.settings-msg.success { background: rgba(16, 185, 129, 0.13); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
.settings-msg.error { background: rgba(244, 63, 94, 0.13); color: var(--red); border: 1px solid rgba(244, 63, 94, 0.3); }

/* ── Modals & Overlays ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(6px);
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.18s ease;
}
.modal-box {
  width: 100%; max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalScaleUp 0.2s ease;
}
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 800; color: var(--txt-main); }
.modal-close-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--txt-muted);
  cursor: pointer; font-size: 0.9rem;
}
.modal-close-btn:hover { color: var(--red); border-color: var(--red); }
.modal-body { padding: 20px 22px; max-height: 75vh; overflow-y: auto; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex; justify-content: flex-end; gap: 10px;
}
.btn-quick-preset {
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg-subtle);
  color: var(--txt-main); font-weight: 700; font-size: 0.8rem; cursor: pointer;
}
.btn-quick-preset:hover { border-color: var(--primary); color: var(--primary); }

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalScaleUp { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.65; } }

/* ── Active Floating Call Bar ── */
.caller-call-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 950;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.55);
  border-radius: 99px;
  padding: 10px 18px;
  display: flex; align-items: center; gap: 18px;
  cursor: pointer;
}
.presence-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: pulseDot 1.3s infinite; }

/* ── Toast Notifications ── */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 9px;
}
.toast {
  background: #0f172a; color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.86rem; font-weight: 600;
  box-shadow: 0 14px 35px rgba(2, 6, 23, 0.4);
  animation: toastIn 0.22s ease;
  max-width: 360px;
}
.toast.success { border-left-color: var(--emerald); }
.toast.error   { border-left-color: var(--red); }
.toast.info    { border-left-color: var(--cyan); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--txt-muted);
  background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: var(--radius-card);
}
.empty-icon { font-size: 2.2rem; margin-bottom: 10px; }

/* ── Responsive Breakpoints ── */
@media (max-width: 900px) {
  .screen { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 8px 12px; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .sidebar-profile { margin-bottom: 0; }
  .btn-sidebar-logout { width: auto; }
  .top-header { padding: 0 16px; }
  .content-body { padding: 18px 16px 48px; }
}
@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
