/* ============================================================
   LeadForge AI — Design System & Component Styles
   2026 Premium SaaS Dashboard
   ============================================================ */

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

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-root: #080a0f;
  --bg-surface: #0d1117;
  --bg-card: #131720;
  --bg-card-hover: #171e2b;
  --bg-elevated: #1c2232;
  --bg-input: #0f1419;
  --bg-overlay: rgba(8, 10, 15, 0.85);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.045);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(108, 99, 255, 0.4);

  /* Accents */
  --accent: #6c63ff;
  --accent-light: #8b85ff;
  --accent-dim: rgba(108, 99, 255, 0.15);
  --accent-glow: rgba(108, 99, 255, 0.25);
  --teal: #00d4aa;
  --teal-dim: rgba(0, 212, 170, 0.12);
  --teal-glow: rgba(0, 212, 170, 0.25);
  --purple-pink: #c084fc;

  /* Qualification Colors */
  --hot: #ff5c5c;
  --hot-dim: rgba(255, 92, 92, 0.12);
  --hot-glow: rgba(255, 92, 92, 0.3);
  --warm: #f59e0b;
  --warm-dim: rgba(245, 158, 11, 0.12);
  --cold: #60a5fa;
  --cold-dim: rgba(96, 165, 250, 0.12);
  --disq: #4b5563;
  --disq-dim: rgba(75, 85, 99, 0.2);

  /* Score Colors */
  --score-high: #00d4aa;
  --score-med: #f59e0b;
  --score-low: #ff5c5c;

  /* Text */
  --text-primary: #eef0f7;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  --text-accent: #8b85ff;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 58px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 24px rgba(108, 99, 255, 0.2);
  --shadow-glow: 0 0 0 1px rgba(108, 99, 255, 0.3), 0 4px 24px rgba(108, 99, 255, 0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 150ms;
  --dur-med: 250ms;
  --dur-slow: 400ms;

  /* Glass */
  --glass-bg: rgba(13, 17, 23, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(16px);
}

/* Light Mode */
body.light-mode {
  --bg-root: #f0f2f8;
  --bg-surface: #f8f9fc;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f5fb;
  --bg-elevated: #eef0f8;
  --bg-input: #f0f2f8;
  --bg-overlay: rgba(240, 242, 248, 0.9);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-default: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text-primary: #0f1117;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent-dim: rgba(108, 99, 255, 0.08);
  --bg-overlay: rgba(240, 242, 248, 0.88);
  --glass-bg: rgba(248, 249, 252, 0.8);
  --glass-border: rgba(0, 0, 0, 0.07);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ─── 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-root);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow: hidden;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

a { color: var(--accent-light); text-decoration: none; }
button { cursor: pointer; border: none; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); outline: none; border: none; }

/* ─── App Shell Layout ───────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width var(--dur-slow) var(--ease-out), min-width var(--dur-slow) var(--ease-out);
  z-index: 100;
  overflow: hidden;
  position: relative;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: var(--topbar-height);
}

.logo-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 16px rgba(108, 99, 255, 0.4);
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--dur-med) var(--ease-out);
}

.logo-text span { color: var(--accent-light); }
.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 10px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--dur-med);
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
  position: relative;
  color: var(--text-secondary);
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-light);
}

.nav-item.active .nav-icon { color: var(--accent-light); }

.nav-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-label {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--dur-med);
}

.sidebar.collapsed .nav-label { opacity: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--hot);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  transition: opacity var(--dur-med);
}

.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast);
}

.sidebar-user:hover { background: var(--bg-card); }

.user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.user-info { overflow: hidden; transition: opacity var(--dur-med); }
.sidebar.collapsed .user-info { opacity: 0; }
.user-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.user-plan {
  font-size: 10px;
  color: var(--teal);
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-med);
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.sidebar-collapse-btn:hover { background: var(--accent); color: white; }
.sidebar.collapsed .sidebar-collapse-btn { transform: translateY(-50%) rotate(180deg); right: -12px; }

/* ─── Main Content Area ──────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── Top Bar ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 50;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 8px 16px 8px 38px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.topbar-btn {
  width: 34px;
  height: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.topbar-btn.active { background: var(--accent-dim); color: var(--accent-light); border-color: var(--border-accent); }

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--hot);
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
}

.btn-export-top {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
  box-shadow: var(--shadow-accent);
}

.btn-export-top:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108, 99, 255, 0.35);
}

/* ─── Page Container ─────────────────────────────────────── */
.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page { display: none; }
.page.active { display: flex; flex-direction: column; gap: 20px; }

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

.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.page-actions { display: flex; align-items: center; gap: 8px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--dur-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108,99,255,0.35);
}

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

.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

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

.btn-teal {
  background: linear-gradient(135deg, var(--teal), #00b894);
  color: #001a15;
  font-weight: 700;
}

.btn-teal:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-danger { background: var(--hot-dim); color: var(--hot); border: 1px solid rgba(255,92,92,0.2); }
.btn-danger:hover { background: rgba(255,92,92,0.2); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ─── KPI Cards ──────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}

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

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

.kpi-card.accent-hot::before { background: linear-gradient(90deg, var(--hot), var(--warm)); }
.kpi-card.accent-teal::before { background: linear-gradient(90deg, var(--teal), #00b3ff); }
.kpi-card.accent-warm::before { background: linear-gradient(90deg, var(--warm), #fb923c); }
.kpi-card.accent-cold::before { background: linear-gradient(90deg, var(--cold), var(--purple-pink)); }
.kpi-card.accent-purple::before { background: linear-gradient(90deg, var(--purple-pink), var(--accent)); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--accent-dim);
  color: var(--accent-light);
}

.kpi-card.accent-hot .kpi-icon { background: var(--hot-dim); color: var(--hot); }
.kpi-card.accent-teal .kpi-icon { background: var(--teal-dim); color: var(--teal); }
.kpi-card.accent-warm .kpi-icon { background: var(--warm-dim); color: var(--warm); }
.kpi-card.accent-cold .kpi-icon { background: rgba(96,165,250,0.12); color: var(--cold); }
.kpi-card.accent-purple .kpi-icon { background: rgba(192,132,252,0.12); color: var(--purple-pink); }

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  font-size: 11px;
}

.kpi-trend.up { color: var(--teal); }
.kpi-trend.down { color: var(--hot); }

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

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

/* ─── AI Insight Card ────────────────────────────────────── */
.insight-card {
  background: linear-gradient(135deg, rgba(108,99,255,0.08), rgba(0,212,170,0.06));
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(108,99,255,0.03), transparent);
  pointer-events: none;
}

.insight-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(108,99,255,0.3);
}

.insight-content { flex: 1; }
.insight-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-light);
  margin-bottom: 4px;
}

.insight-text { font-size: 13px; color: var(--text-primary); line-height: 1.6; }
.insight-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ─── Discovery Panel ────────────────────────────────────── */
.discovery-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

.discovery-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 0;
}

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

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

.discovery-form { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  width: 100%;
}

.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.08);
}

.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
  cursor: pointer;
  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='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus { border-color: var(--border-accent); outline: none; }

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

.form-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.filter-toggle:hover { color: var(--text-primary); }

.filter-toggle-icon {
  transition: transform var(--dur-med);
  font-size: 11px;
}

.filter-toggle.open .filter-toggle-icon { transform: rotate(180deg); }

.filter-content {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.filter-content.open { display: flex; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 34px;
  height: 18px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: 99px;
  cursor: pointer;
  border: 1px solid var(--border-default);
  transition: background var(--dur-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--dur-fast), background var(--dur-fast);
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: white;
}

/* AI Queries Display */
.ai-queries {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.ai-query-item {
  font-size: 11px;
  color: var(--teal);
  font-family: var(--font-mono);
  padding: 2px 0;
  opacity: 0;
  animation: fadeInUp 0.3s forwards;
}

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

.discover-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
  box-shadow: 0 4px 16px rgba(108,99,255,0.3);
  position: relative;
  overflow: hidden;
}

.discover-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.4);
}

.discover-btn:active { transform: translateY(0); }

.discover-btn.loading { pointer-events: none; }

.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* Progress Bar */
.progress-bar-wrap {
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  height: 4px;
  overflow: hidden;
  display: none;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: var(--radius-pill);
  transition: width 0.3s var(--ease-out);
  width: 0%;
}

.progress-bar-wrap.visible { display: block; }

/* ─── Leads Results Area ─────────────────────────────────── */
.results-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.results-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.results-count strong { color: var(--text-primary); }

.results-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Filter Chips ───────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  user-select: none;
}

.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent-light); }
.chip.chip-hot.active { background: var(--hot-dim); border-color: rgba(255,92,92,0.3); color: var(--hot); }
.chip.chip-warm.active { background: var(--warm-dim); border-color: rgba(245,158,11,0.3); color: var(--warm); }
.chip.chip-cold.active { background: var(--cold-dim); border-color: rgba(96,165,250,0.3); color: var(--cold); }

/* ─── Bulk Action Bar ────────────────────────────────────── */
.bulk-action-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  animation: slideInDown 0.25s var(--ease-out);
}

.bulk-action-bar.visible { display: flex; }

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

.bulk-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  margin-right: 4px;
}

.bulk-divider {
  width: 1px;
  height: 20px;
  background: var(--border-default);
  margin: 0 4px;
}

/* ─── Lead Table ─────────────────────────────────────────── */
.lead-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.lead-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-fast);
}

.lead-table th:hover { color: var(--text-secondary); }
.lead-table th.sorted { color: var(--accent-light); }
.sort-icon { margin-left: 4px; opacity: 0.5; font-size: 10px; }

.lead-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-table tr:last-child td { border-bottom: none; }

.lead-table tbody tr {
  transition: background var(--dur-fast);
  cursor: pointer;
}

.lead-table tbody tr:hover { background: var(--bg-card-hover); }
.lead-table tbody tr.selected { background: var(--accent-dim); }

.table-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
}

.table-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.business-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.biz-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.biz-name { font-weight: 600; color: var(--text-primary); }
.biz-category { font-size: 11px; color: var(--text-muted); }

/* Score Pill */
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.score-pill.high { background: rgba(0,212,170,0.15); color: var(--teal); }
.score-pill.med { background: rgba(245,158,11,0.15); color: var(--warm); }
.score-pill.low { background: rgba(255,92,92,0.15); color: var(--hot); }

/* Qualification Badge */
.qual-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.qual-badge.hot { background: var(--hot-dim); color: var(--hot); }
.qual-badge.warm { background: var(--warm-dim); color: var(--warm); }
.qual-badge.cold { background: var(--cold-dim); color: var(--cold); }
.qual-badge.disqualified { background: var(--disq-dim); color: var(--text-muted); }

/* Status dot */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Contact icons */
.contact-icons { display: flex; gap: 5px; }
.contact-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: opacity var(--dur-fast);
}

.contact-icon.has { background: var(--teal-dim); color: var(--teal); }
.contact-icon.missing { background: var(--bg-elevated); color: var(--text-muted); opacity: 0.4; }

/* Rating */
.rating-cell { display: flex; align-items: center; gap: 4px; color: var(--warm); font-weight: 700; }
.rating-cell small { color: var(--text-muted); font-weight: 400; }

/* Row actions */
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.lead-table tbody tr:hover .row-actions { opacity: 1; }

.row-action-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
}

.row-action-btn:hover { background: var(--accent-dim); color: var(--accent-light); border-color: var(--border-accent); }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.page-nums { display: flex; gap: 4px; }
.page-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
  color: var(--text-secondary);
}

.page-num:hover { background: var(--bg-elevated); color: var(--text-primary); }
.page-num.active { background: var(--accent-dim); color: var(--accent-light); }

/* ─── Detail Drawer ──────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med);
}

.drawer-overlay.open { opacity: 1; pointer-events: all; }

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.detail-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
  margin-left: auto;
}

.drawer-close:hover { background: var(--hot-dim); color: var(--hot); border-color: rgba(255,92,92,0.2); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-biz-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.drawer-biz-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.drawer-biz-name { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.drawer-biz-cat { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.drawer-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* Score Gauge */
.score-gauge-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.score-gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.score-gauge-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.score-gauge-value { font-size: 26px; font-weight: 800; font-family: var(--font-mono); }
.score-gauge-value.high { color: var(--teal); }
.score-gauge-value.med { color: var(--warm); }
.score-gauge-value.low { color: var(--hot); }

.score-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 0.8s var(--ease-out);
}

.score-reason {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

/* Detail Sections */
.drawer-section { display: flex; flex-direction: column; gap: 8px; }
.drawer-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
}

.detail-field-icon { font-size: 14px; margin-top: 1px; color: var(--text-muted); min-width: 18px; text-align: center; }
.detail-field-content { flex: 1; min-width: 0; }
.detail-field-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 1px; }
.detail-field-value { color: var(--text-primary); word-break: break-all; line-height: 1.4; }
.detail-field-value a { color: var(--accent-light); }

.copy-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}

.copy-btn:hover { background: var(--accent-dim); color: var(--accent-light); }

/* Tags */
.tags-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: default;
}

.tag.tag-service { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent-light); }
.tag.tag-keyword { background: var(--teal-dim); border-color: rgba(0,212,170,0.2); color: var(--teal); }

/* Outreach Card */
.outreach-card {
  background: linear-gradient(135deg, rgba(0,212,170,0.06), rgba(108,99,255,0.06));
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-md);
  padding: 14px;
}

.outreach-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--teal);
  margin-bottom: 6px;
}

.outreach-text { font-size: 12.5px; color: var(--text-primary); line-height: 1.6; }

/* Notes */
.notes-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-primary);
  width: 100%;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--dur-fast);
  font-family: var(--font-sans);
}

.notes-textarea:focus { border-color: var(--border-accent); }

/* Drawer Footer */
.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.empty-icon { font-size: 48px; opacity: 0.3; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.empty-subtitle { font-size: 13px; color: var(--text-muted); max-width: 280px; }

/* ─── Loading Skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Analytics Charts ───────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  font-size: 12px;
  color: var(--text-muted);
  flex-direction: column;
  gap: 8px;
}

/* Bar Chart */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; padding: 20px; height: 160px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; border-radius: 4px 4px 0 0; transition: opacity var(--dur-fast); position: relative; }
.bar:hover { opacity: 0.8; }
.bar-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-align: center; }
.bar-value { font-size: 11px; font-weight: 700; font-family: var(--font-mono); color: var(--text-secondary); }

/* Donut Chart (CSS) */
.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
}

.donut-svg { transform: rotate(-90deg); }

.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-label { color: var(--text-secondary); }
.legend-value { font-weight: 700; color: var(--text-primary); margin-left: auto; font-family: var(--font-mono); }

/* ─── Campaign Cards ─────────────────────────────────────── */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
  cursor: pointer;
}

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

.campaign-card-header { display: flex; align-items: flex-start; justify-content: space-between; }
.campaign-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.campaign-name { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; margin-top: 10px; }
.campaign-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.campaign-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.campaign-lead-count {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ─── Segment Chips Panel ────────────────────────────────── */
.segments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.segment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--dur-fast);
}

.segment-card:hover {
  border-color: var(--border-default);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.segment-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.segment-info { flex: 1; min-width: 0; }
.segment-name { font-size: 13px; font-weight: 700; }
.segment-count { font-size: 11px; color: var(--text-muted); }
.segment-arrow { font-size: 14px; color: var(--text-muted); }

/* ─── Export Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  padding: 0;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--dur-slow) var(--ease-out);
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title { font-size: 16px; font-weight: 800; }
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.modal-close:hover { background: var(--hot-dim); color: var(--hot); }

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

/* Format Selector */
.format-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.format-opt {
  padding: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--dur-fast);
}

.format-opt:hover { border-color: var(--border-strong); }
.format-opt.selected { border-color: var(--accent); background: var(--accent-dim); }
.format-opt-icon { font-size: 20px; margin-bottom: 4px; }
.format-opt-label { font-size: 12px; font-weight: 700; }
.format-opt-desc { font-size: 10px; color: var(--text-muted); }

/* Field Checkboxes */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
}

.field-check input[type=checkbox] {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--border-strong);
  appearance: none;
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.field-check input[type=checkbox]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

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

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease-out) forwards;
  max-width: 320px;
  backdrop-filter: var(--glass-blur);
}

.toast.removing { animation: toastOut 0.25s var(--ease-in) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px) scale(0.96); }
}

.toast-icon { font-size: 16px; }
.toast.success { border-color: rgba(0,212,170,0.3); }
.toast.success .toast-icon::before { content: '✅'; }
.toast.info { border-color: rgba(108,99,255,0.3); }
.toast.info .toast-icon::before { content: '🧠'; }
.toast.warning { border-color: rgba(245,158,11,0.3); }
.toast.warning .toast-icon::before { content: '⚠️'; }
.toast.error { border-color: rgba(255,92,92,0.3); }
.toast.error .toast-icon::before { content: '❌'; }

/* ─── Activity Feed ──────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--bg-elevated);
}

.activity-content { flex: 1; }
.activity-text { font-size: 12.5px; color: var(--text-primary); }
.activity-text strong { color: var(--text-primary); }
.activity-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Sparkline ──────────────────────────────────────────── */
.sparkline-wrap { padding: 0 20px 16px; }
.sparkline-svg { width: 100%; height: 50px; }

/* ─── Tooltip ────────────────────────────────────────────── */
.tooltip {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast);
  max-width: 240px;
  line-height: 1.4;
}

.tooltip.visible { opacity: 1; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .discovery-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  :root { --sidebar-width: 64px; }
  .sidebar .logo-text,
  .sidebar .nav-label,
  .sidebar .nav-badge,
  .sidebar .nav-section-label,
  .sidebar .user-info { opacity: 0; width: 0; overflow: hidden; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .detail-drawer { width: 100%; }
}

/* ─── Utility ────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.text-teal { color: var(--teal); }
.text-hot { color: var(--hot); }
.text-warm { color: var(--warm); }
.font-mono { font-family: var(--font-mono); }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-11 { font-size: 11px; }
.hidden { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   MARKET TRENDS PAGE
───────────────────────────────────────────────────────────── */

/* Layout */
.trending-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 16px;
  align-items: start;
}

/* Country Selector Panel */
.country-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 0;
}

.country-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.country-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.country-search {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-primary);
  width: 100%;
  transition: border-color var(--dur-fast);
}

.country-search:focus { border-color: var(--border-accent); }
.country-search::placeholder { color: var(--text-muted); }

.country-list {
  max-height: 520px;
  overflow-y: auto;
  padding: 6px;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast);
  user-select: none;
}

.country-item:hover { background: var(--bg-card-hover); }

.country-item.active {
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
}

.country-flag { font-size: 20px; min-width: 24px; }

.country-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-item.active .country-name { color: var(--accent-light); font-weight: 700; }

.country-trend-count {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Main Trending Area */
.trending-main { display: flex; flex-direction: column; gap: 16px; }

/* Trending Header Bar */
.trending-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trending-title-block { display: flex; flex-direction: column; gap: 3px; }

.trending-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-subtitle { font-size: 12px; color: var(--text-muted); }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--teal-dim);
  border: 1px solid rgba(0,212,170,0.25);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulseDot 1.8s ease-in-out infinite;
}

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

.last-updated {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hero Trend Cards - Top 3 */
.trend-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.trend-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}

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

.trend-hero-card.rank-1 {
  border-color: rgba(245,158,11,0.25);
  background: linear-gradient(135deg, var(--bg-card), rgba(245,158,11,0.04));
}

.trend-hero-card.rank-1::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--warm), #fb923c);
}

.trend-hero-card.rank-2::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--text-muted), var(--bg-elevated));
}

.trend-hero-card.rank-3::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #92400e, var(--warm));
}

.hero-rank {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 22px;
  opacity: 0.2;
  font-weight: 900;
  font-family: var(--font-mono);
}

.hero-card-top { display: flex; align-items: center; gap: 10px; }

.trend-niche-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.hero-niche-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.hero-niche-cat {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Trend Badge */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.trend-badge.rising {
  background: rgba(0,212,170,0.12);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,0.2);
}

.trend-badge.hot-trend {
  background: var(--hot-dim);
  color: var(--hot);
  border: 1px solid rgba(255,92,92,0.2);
}

.trend-badge.stable {
  background: var(--accent-dim);
  color: var(--accent-light);
  border: 1px solid var(--border-accent);
}

.trend-badge.declining {
  background: var(--disq-dim);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

.trend-badge.peaked {
  background: var(--warm-dim);
  color: var(--warm);
  border: 1px solid rgba(245,158,11,0.2);
}

/* Search Volume Bar */
.volume-wrap { display: flex; flex-direction: column; gap: 5px; }

.volume-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.volume-value { font-family: var(--font-mono); color: var(--text-secondary); }

.volume-bar-track {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.volume-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 0.9s var(--ease-out);
}

/* Opportunity Score */
.opp-score {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.opp-score-num {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.opp-score-num.high { color: var(--teal); }
.opp-score-num.med { color: var(--warm); }
.opp-score-num.low { color: var(--hot); }

.opp-score-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hero-change {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.hero-change.up { color: var(--teal); }
.hero-change.down { color: var(--hot); }

/* Full Trends Table */
.trends-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.trends-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
}

.trends-table th:hover { color: var(--text-secondary); }

.trends-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 12.5px;
}

.trends-table tbody tr:last-child td { border-bottom: none; }

.trends-table tbody tr {
  transition: background var(--dur-fast);
  cursor: pointer;
}

.trends-table tbody tr:hover { background: var(--bg-card-hover); }

.rank-num {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.rank-num.gold { background: rgba(245,158,11,0.15); color: var(--warm); }
.rank-num.silver { background: rgba(148,163,184,0.15); color: #94a3b8; }
.rank-num.bronze { background: rgba(146,64,14,0.15); color: #b45309; }

.niche-cell { display: flex; align-items: center; gap: 10px; }

.niche-icon-sm {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.niche-name-sm { font-weight: 700; color: var(--text-primary); font-size: 13px; }
.niche-sub-sm { font-size: 10.5px; color: var(--text-muted); }

/* Mini Sparkline */
.mini-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 24px; }

.spark-bar {
  width: 5px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.5;
  transition: opacity var(--dur-fast);
}

.spark-bar.peak { opacity: 1; background: var(--teal); }

.change-cell { font-weight: 800; font-family: var(--font-mono); font-size: 12px; }
.change-cell.up { color: var(--teal); }
.change-cell.down { color: var(--hot); }
.change-cell.neutral { color: var(--text-muted); }

.leads-avail {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-light);
  font-size: 12px;
}

.deal-size { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }

/* City Tags */
.city-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.city-tag {
  padding: 2px 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Seasonal Insight Card */
.seasonal-card {
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(108,99,255,0.06));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.seasonal-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: rgba(245,158,11,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.seasonal-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--warm);
  margin-bottom: 4px;
}

.seasonal-text { font-size: 13px; color: var(--text-primary); line-height: 1.6; }

/* Rising vs Declining Split */
.trend-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trend-split-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.trend-split-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-split-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; }

.trend-split-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast);
  cursor: pointer;
}

.trend-split-item:hover { background: var(--bg-card-hover); }

.split-icon { font-size: 16px; width: 22px; text-align: center; }

.split-name { flex: 1; font-size: 12.5px; font-weight: 600; }

.split-change {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.split-change.up { color: var(--teal); }
.split-change.down { color: var(--hot); }

/* Hot Opportunity Banner */
.hot-opp-banner {
  background: linear-gradient(135deg, rgba(255,92,92,0.08), rgba(245,158,11,0.06));
  border: 1px solid rgba(255,92,92,0.2);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hot-opp-icon {
  font-size: 28px;
  animation: pulse 2s ease-in-out infinite;
}

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

.hot-opp-text { flex: 1; }
.hot-opp-title { font-size: 14px; font-weight: 800; color: var(--hot); margin-bottom: 3px; }
.hot-opp-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Trend loading skeleton */
.trend-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Refresh Button */
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.refresh-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-strong); }

.refresh-icon { transition: transform 0.6s var(--ease-out); }
.refresh-btn:active .refresh-icon { transform: rotate(360deg); }

/* Responsive */
@media (max-width: 1100px) {
  .trending-layout { grid-template-columns: 1fr; }
  .country-panel { position: static; }
  .country-list { max-height: 180px; display: flex; flex-wrap: wrap; gap: 4px; overflow-y: auto; }
  .country-item { padding: 6px 10px; }
  .trend-hero-grid { grid-template-columns: 1fr; }
  .trend-split-grid { grid-template-columns: 1fr; }
}
