/* ============================================
   Cyber Defence Lead Management System
   Main Stylesheet — Dark Cybersecurity Theme
   ============================================ */

:root {
  --bg-primary:    #060c1a;
  --bg-secondary:  #0a1628;
  --bg-card:       #0d1f3c;
  --bg-card-hover: #0f2447;
  --bg-input:      #0a1628;
  --border:        #1e3a5f;
  --border-light:  #243a5e;

  --accent:        #00c6ff;
  --accent-hover:  #00a8e8;
  --accent-glow:   rgba(0,198,255,0.2);
  --accent-2:      #0066ff;
  --accent-2-glow: rgba(0,102,255,0.15);

  --text-primary:  #e2e8f0;
  --text-secondary:#8899b4;
  --text-muted:    #4a6080;

  --success:       #00e676;
  --success-bg:    rgba(0,230,118,0.1);
  --warning:       #ffa726;
  --warning-bg:    rgba(255,167,38,0.1);
  --danger:        #ff4757;
  --danger-bg:     rgba(255,71,87,0.1);
  --info:          #29b6f6;
  --info-bg:       rgba(41,182,246,0.1);
  --purple:        #ab47bc;
  --purple-bg:     rgba(171,71,188,0.1);

  --sidebar-width:       260px;
  --sidebar-width-mini:  70px;
  --topbar-height:       64px;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;

  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-card:   0 2px 16px rgba(0,0,0,0.3);
  --shadow-glow:   0 0 20px rgba(0,198,255,0.15);

  --transition:    all 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle grid pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,198,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,198,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── Layout ────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: linear-gradient(180deg, #0a1628 0%, #060c1a 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar.mini { width: var(--sidebar-width-mini); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-height);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.logo-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(0,198,255,0.15), rgba(0,102,255,0.15));
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,198,255,0.2);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0,198,255,0.1);
}

.logo-text { overflow: hidden; }
.logo-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-toggle {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--accent); background: var(--accent-glow); }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section { margin-bottom: 8px; }

.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  border-radius: 0;
  position: relative;
  transition: var(--transition);
  margin: 2px 0;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(0,198,255,0.06);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(0,198,255,0.1);
}

.nav-item.active .nav-indicator {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 3px 0 0 3px;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.nav-item:hover .nav-icon { color: var(--accent); }
.nav-item.active .nav-icon { color: var(--accent); }

.nav-label {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.nav-badge {
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  display: none;
}

.sidebar.mini .nav-section-label,
.sidebar.mini .nav-label,
.sidebar.mini .logo-text,
.sidebar.mini .nav-badge { display: none; }

.sidebar.mini .nav-item { justify-content: center; padding: 12px; }
.sidebar.mini .sidebar-header { justify-content: center; }

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-details { flex: 1; overflow: hidden; }
.user-name {
  display: block;
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  display: block;
  font-size: 11px; color: var(--text-muted);
  text-transform: capitalize;
}

.logout-btn {
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--danger); background: var(--danger-bg); }

.sidebar.mini .user-name,
.sidebar.mini .user-details,
.sidebar.mini .logout-btn { display: none; }
.sidebar.mini .user-info { justify-content: center; }

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1);
}

.main-content.mini { margin-left: var(--sidebar-width-mini); }

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: rgba(10,22,40,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}

.topbar-left, .topbar-right {
  display: flex; align-items: center; gap: 12px;
}

.topbar-toggle {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: none;
}
.topbar-toggle:hover { color: var(--accent); background: var(--accent-glow); }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }
.breadcrumb-sep { font-size: 10px; color: var(--text-muted); }

.topbar-btn {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 15px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}
.topbar-btn:hover { color: var(--accent); background: var(--accent-glow); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.topbar-notification { position: relative; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown.show { display: block; animation: fadeSlideDown 0.2s ease; }

.notif-header {
  padding: 14px 16px;
  font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

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

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: var(--bg-secondary); }
.notif-item-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-item-sub { font-size: 11px; color: var(--text-muted); }
.notif-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  cursor: pointer;
}
.topbar-username {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
}

/* ── Page Content ──────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
  animation: fadeIn 0.4s ease;
}

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

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

/* ── Page Header ───────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-size: 24px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 13px; color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

/* ── Stats Grid ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)), transparent);
  opacity: 0.8;
}

.stat-card:hover {
  border-color: var(--card-accent, var(--accent));
  box-shadow: 0 0 24px rgba(0,198,255,0.08);
  transform: translateY(-2px);
}

.stat-card.accent-cyan  { --card-accent: var(--accent); }
.stat-card.accent-blue  { --card-accent: var(--accent-2); }
.stat-card.accent-green { --card-accent: var(--success); }
.stat-card.accent-orange{ --card-accent: var(--warning); }
.stat-card.accent-red   { --card-accent: var(--danger); }
.stat-card.accent-purple{ --card-accent: var(--purple); }

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

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.stat-icon.cyan   { background: rgba(0,198,255,0.12);  color: var(--accent); }
.stat-icon.blue   { background: rgba(0,102,255,0.12);  color: var(--accent-2); }
.stat-icon.green  { background: rgba(0,230,118,0.12);  color: var(--success); }
.stat-icon.orange { background: rgba(255,167,38,0.12); color: var(--warning); }
.stat-icon.red    { background: rgba(255,71,87,0.12);  color: var(--danger); }
.stat-icon.purple { background: rgba(171,71,188,0.12); color: var(--purple); }

.stat-change {
  font-size: 11px; font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
}
.stat-change.up   { color: var(--success); background: var(--success-bg); }
.stat-change.down { color: var(--danger);  background: var(--danger-bg); }
.stat-change.neutral { color: var(--text-muted); background: rgba(255,255,255,0.05); }

.stat-value {
  font-size: 32px; font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 500;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.card-title i { color: var(--accent); font-size: 14px; }

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

.card-body { padding: 20px; }

/* ── Charts Grid ───────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-container {
  position: relative;
  height: 280px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,198,255,0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0,198,255,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-success {
  background: rgba(0,230,118,0.12);
  color: var(--success);
  border: 1px solid rgba(0,230,118,0.2);
}
.btn-success:hover { background: rgba(0,230,118,0.2); }

.btn-danger {
  background: rgba(255,71,87,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,0.2);
}
.btn-danger:hover { background: rgba(255,71,87,0.2); }

.btn-icon {
  padding: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.4px;
}

.badge-new          { background: rgba(0,198,255,0.15);  color: var(--accent);   border: 1px solid rgba(0,198,255,0.3); }
.badge-called       { background: rgba(0,102,255,0.15);  color: #5b9dff;         border: 1px solid rgba(0,102,255,0.3); }
.badge-not-picked   { background: rgba(255,167,38,0.12); color: var(--warning);  border: 1px solid rgba(255,167,38,0.3); }
.badge-follow-up    { background: rgba(41,182,246,0.12); color: var(--info);     border: 1px solid rgba(41,182,246,0.3); }
.badge-50-ready     { background: rgba(171,71,188,0.12); color: var(--purple);   border: 1px solid rgba(171,71,188,0.3); }
.badge-high-quality { background: rgba(0,230,118,0.12);  color: var(--success);  border: 1px solid rgba(0,230,118,0.3); }
.badge-converted    { background: rgba(0,230,118,0.2);   color: var(--success);  border: 1px solid rgba(0,230,118,0.4); }
.badge-rejected     { background: rgba(255,71,87,0.12);  color: var(--danger);   border: 1px solid rgba(255,71,87,0.3); }

/* Source badges */
.source-facebook  { color: #1877f2; }
.source-instagram { color: #e4405f; }
.source-manual    { color: var(--text-muted); }
.source-website   { color: var(--success); }

/* Tags */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-right: 4px;
}
.tag-hot     { background: rgba(255,71,87,0.15);   color: var(--danger); }
.tag-urgent  { background: rgba(255,167,38,0.15);  color: var(--warning); }
.tag-vip     { background: rgba(171,71,188,0.15);  color: var(--purple); }
.tag-default { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Score Bar ─────────────────────────────────────────── */
.score-bar {
  display: flex; align-items: center; gap: 8px;
}
.score-bar-track {
  flex: 1; height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.score-value { font-size: 12px; font-weight: 600; min-width: 28px; }

.score-fill-high   { background: linear-gradient(90deg, var(--success), #00c853); }
.score-fill-medium { background: linear-gradient(90deg, var(--warning), #ff9800); }
.score-fill-low    { background: linear-gradient(90deg, var(--danger), #ff1744); }

/* ── Table ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody tr {
  border-bottom: 1px solid rgba(30,58,95,0.5);
  transition: var(--transition);
}
.data-table tbody tr:hover { background: rgba(0,198,255,0.04); }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table .td-name {
  font-weight: 600;
  cursor: pointer;
}
.data-table .td-name:hover { color: var(--accent); }

.data-table .td-phone a,
.data-table .td-email { color: var(--text-secondary); font-size: 12px; }
.data-table .td-phone a:hover { color: var(--success); }

.data-table .col-actions {
  display: flex; align-items: center; gap: 6px;
}

/* Status select in table */
.status-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.status-select:focus { outline: none; border-color: var(--accent); }

/* ── Search & Filter Bar ───────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1; min-width: 200px;
}
.search-input-wrap i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 9px 12px 9px 36px;
  transition: var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,198,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,198,255,0.1);
}
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 9px 12px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 130px;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
.filter-select option { background: var(--bg-card); }

/* Filter tabs */
.filter-tabs {
  display: flex; gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text-primary); border-color: var(--accent); }
.filter-tab.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}
.filter-tab .tab-count {
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  margin-left: 4px;
}

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 14px;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,198,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,198,255,0.1);
}
.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-card); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.modal-overlay.show .modal { transform: scale(1); }

.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 18px;
  padding: 4px; cursor: pointer;
  border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: var(--danger-bg); }

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

/* ── Timeline ──────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute; left: 9px; top: 4px; bottom: 4px;
  width: 1px; background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding-left: 16px;
}

.timeline-dot {
  position: absolute;
  left: -19px; top: 3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-dot.green  { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.orange { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-dot.red    { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.timeline-dot.blue   { background: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-2); }

.timeline-content { }
.timeline-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.timeline-meta  { font-size: 11px; color: var(--text-muted); }
.timeline-body  { font-size: 13px; color: var(--text-secondary); margin-top: 6px; padding: 10px 12px; background: var(--bg-secondary); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ── Lead Detail ───────────────────────────────────────── */
.lead-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.lead-profile {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0,198,255,0.06), rgba(0,102,255,0.04));
  border-bottom: 1px solid var(--border);
}

.lead-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.lead-profile-info .lead-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.lead-profile-info .lead-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }

.info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.info-item {
  background: var(--bg-card);
  padding: 14px 18px;
}
.info-item-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.info-item-value { font-size: 14px; font-weight: 500; }

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover, .page-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Login Page ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: var(--bg-primary);
}

.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0,198,255,0.08) 0%, transparent 70%),
              radial-gradient(ellipse 40% 40% at 80% 80%, rgba(0,102,255,0.06) 0%, transparent 60%);
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative; z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--shadow-glow);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, rgba(0,198,255,0.15), rgba(0,102,255,0.15));
  border: 1px solid rgba(0,198,255,0.25);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(0,198,255,0.15);
}
.login-company { font-size: 22px; font-weight: 800; }
.login-company span { background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-desc  { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
  pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 38px; }

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,198,255,0.3);
  margin-top: 8px;
}
.login-btn:hover {
  box-shadow: 0 6px 28px rgba(0,198,255,0.5);
  transform: translateY(-1px);
}
.login-btn:active { transform: translateY(0); }

.login-footer {
  text-align: center; margin-top: 24px;
  font-size: 12px; color: var(--text-muted);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(255,71,87,0.2); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(0,230,118,0.2); }

/* ── Toast ─────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 360px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  font-size: 13px;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast i { font-size: 16px; }
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-success i { color: var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-error i { color: var(--danger); }
.toast.toast-info { border-left: 3px solid var(--accent); }
.toast.toast-info i { color: var(--accent); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-warning i { color: var(--warning); }

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

/* ── Analytics ─────────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.mini-chart { height: 60px; }

/* ── Settings ──────────────────────────────────────────── */
.settings-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.settings-tab {
  padding: 12px 20px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text-primary); }
.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.settings-section { display: none; }
.settings-section.active { display: block; }

/* Users table */
.users-table .user-row {
  display: flex; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.users-table .user-row:last-child { border-bottom: none; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .responsive-grid-single { grid-template-columns: 1fr !important; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.5); }
  .main-content { margin-left: 0 !important; }
  .topbar-toggle { display: flex; }
  .sidebar-toggle { display: none; }
  .lead-detail-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .page-header { flex-direction: column; }
  .analytics-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .breadcrumb { display: none; }
  .topbar-username { display: none; }
  .stat-value { font-size: 24px; }
  .login-card { padding: 28px 20px; }
}

/* ── Sidebar overlay (mobile) ──────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── Loading skeleton ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Misc utilities ────────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }

.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.w-full   { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* WhatsApp button */
.btn-whatsapp {
  background: rgba(37,211,102,0.12);
  color: #25d366;
  border: 1px solid rgba(37,211,102,0.25);
}
.btn-whatsapp:hover { background: rgba(37,211,102,0.2); }

/* Call button */
.btn-call {
  background: rgba(0,230,118,0.12);
  color: var(--success);
  border: 1px solid rgba(0,230,118,0.25);
}
.btn-call:hover { background: rgba(0,230,118,0.2); }
