/* ==========================================================================
   Flowprise Leads — Complete Workspace Design System & Stylesheet
   Architecture: Compact Top Header, Collapsible Sidebar, Spacious Workspace
   Colors: Soft Off-White & Lavender, Electric Violet & Indigo Primary Actions
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-app: #f8fafc;
  --bg-gradient: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
                 radial-gradient(at 100% 0%, rgba(124, 58, 237, 0.04) 0px, transparent 50%),
                 radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);

  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-subtle: #f1f5f9;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --surface-glass-header: rgba(255, 255, 255, 0.92);

  --border: #e2e8f0;
  --border-subtle: rgba(226, 232, 240, 0.8);
  --border-focus: rgba(99, 102, 241, 0.4);
  --border-glass: rgba(255, 255, 255, 0.9);

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-light: #94a3b8;

  /* Primary Accent: Electric Violet / Indigo */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --primary-gradient-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  --primary-glow: rgba(79, 70, 229, 0.25);
  --primary-subtle: rgba(79, 70, 229, 0.08);

  /* Functional Status Colors */
  --emerald: #10b981;
  --emerald-hover: #059669;
  --emerald-subtle: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-text: #047857;

  --amber: #f59e0b;
  --amber-hover: #d97706;
  --amber-subtle: #fffbeb;
  --amber-border: #fde68a;
  --amber-text: #b45309;

  --rose: #ef4444;
  --rose-hover: #dc2626;
  --rose-subtle: #fef2f2;
  --rose-border: #fecaca;
  --rose-text: #b91c1c;

  --cyan: #0284c7;
  --cyan-subtle: #f0f9ff;
  --cyan-border: #bae6fd;
  --cyan-text: #0369a1;

  --violet: #7c3aed;
  --violet-subtle: #f5f3ff;
  --violet-border: #ddd6fe;
  --violet-text: #6d28d9;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px -4px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 16px 32px -8px rgba(79, 70, 229, 0.1), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px -2px rgba(15, 23, 42, 0.03);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Dimensions */
  --header-height: 58px;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 68px;

  /* Transitions */
  --transition-fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body.workspace-body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* ==========================================================================
   A. TOP HEADER
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background: var(--surface-glass-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

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

.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-sidebar-toggle:hover {
  background: var(--surface-subtle);
  color: var(--primary);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1rem;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.brand-text-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-name strong {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary-subtle);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  margin-left: 4px;
}

.sidebar-collapse-btn:hover {
  background: var(--surface-subtle);
  color: var(--primary);
}

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

/* Status Pill: Dynamic Supabase Connection */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

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

.status-pill.status-healthy {
  background: var(--emerald-subtle);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-text);
}
.status-pill.status-healthy .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-pill.status-connecting {
  background: var(--amber-subtle);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
}
.status-pill.status-connecting .status-dot {
  background: var(--amber);
  animation: pulse-amber 1.5s infinite;
}

.status-pill.status-failed {
  background: var(--rose-subtle);
  border: 1px solid var(--rose-border);
  color: var(--rose-text);
}
.status-pill.status-failed .status-dot {
  background: var(--rose);
}

@keyframes pulse-amber {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Header Controls */
.btn-header {
  height: 32px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-header:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow-xs);
}

.btn-header-home {
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-header-home:hover {
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--primary-subtle);
}

.workspace-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  outline: none;
}

.workspace-user-chip:hover {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
  transform: translateY(-1px);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   B. THREE-PART APPLICATION SHELL & COLLAPSIBLE SIDEBAR
   ========================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  position: relative;
  min-height: calc(100vh - var(--header-height));
}

.workspace-sidebar {
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition-smooth);
  flex-shrink: 0;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 213, 225, 0.7) transparent;
}

.workspace-sidebar::-webkit-scrollbar {
  width: 5px;
}
.workspace-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.workspace-sidebar::-webkit-scrollbar-thumb {
  background: rgba(203, 213, 225, 0.6);
  border-radius: 4px;
}
.workspace-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.8);
}

/* Collapsed Icon Rail State */
.workspace-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.workspace-sidebar.collapsed .nav-section-title,
.workspace-sidebar.collapsed .tab-text {
  display: none;
}

.workspace-sidebar.collapsed .nav-tab {
  justify-content: center;
  padding: 9px 0;
  margin: 4px auto;
  width: 44px;
  border-radius: var(--radius-md);
  border-left: none !important;
}

.workspace-sidebar.collapsed .nav-tab.active {
  background: var(--primary-subtle);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.sidebar-inner {
  padding: 14px 10px 48px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f172a;
  padding: 6px 10px;
  margin: 4px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(241, 245, 249, 0.95);
  border-radius: 6px;
  border-left: 3px solid #6366f1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all var(--transition-fast);
}

.nav-section-title .section-badge-icon {
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

/* Category-specific rich color highlighting */
.nav-section[data-section="overview"] .nav-section-title {
  color: #3730a3;
  background: linear-gradient(90deg, rgba(238, 242, 255, 0.95) 0%, rgba(245, 243, 255, 0.6) 100%);
  border-left-color: #6366f1;
}
.nav-section[data-section="overview"] .section-badge-icon {
  color: #4f46e5;
}

.nav-section[data-section="discover"] .nav-section-title {
  color: #0369a1;
  background: linear-gradient(90deg, rgba(240, 249, 255, 0.95) 0%, rgba(240, 253, 250, 0.6) 100%);
  border-left-color: #0ea5e9;
}
.nav-section[data-section="discover"] .section-badge-icon {
  color: #0284c7;
}

.nav-section[data-section="social"] .nav-section-title {
  color: #1d4ed8;
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.95) 0%, rgba(245, 243, 255, 0.6) 100%);
  border-left-color: #2563eb;
}
.nav-section[data-section="social"] .section-badge-icon {
  color: #1d4ed8;
}

.nav-section[data-section="intel"] .nav-section-title {
  color: #047857;
  background: linear-gradient(90deg, rgba(236, 253, 245, 0.95) 0%, rgba(240, 253, 250, 0.6) 100%);
  border-left-color: #10b981;
}
.nav-section[data-section="intel"] .section-badge-icon {
  color: #059669;
}

.nav-section[data-section="workspace"] .nav-section-title {
  color: #b45309;
  background: linear-gradient(90deg, rgba(254, 243, 199, 0.9) 0%, rgba(255, 251, 235, 0.5) 100%);
  border-left-color: #f59e0b;
}
.nav-section[data-section="workspace"] .section-badge-icon {
  color: #d97706;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
  font-family: inherit;
}

.nav-tab:hover {
  background: rgba(241, 245, 249, 0.8);
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
  padding-left: 7px;
}

.nav-tab.active .tab-icon-wrap {
  color: var(--primary);
}

.tab-icon-wrap {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  color: var(--text-subtle);
}

.tab-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-label {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-sub {
  font-size: 0.68rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar action tabs */
.nav-tab-action {
  color: var(--text-muted);
}
.nav-tab-action:hover {
  background: var(--surface-subtle);
  color: var(--primary);
}

/* Specific icon brand colors */
.text-emerald { color: var(--emerald) !important; }
.text-amber { color: var(--amber) !important; }
.text-google { color: #ea4335 !important; }
.text-linkedin { color: #0a66c2 !important; }
.text-facebook { color: #1877f2 !important; }
.text-instagram { color: #c13584 !important; }
.text-cyan { color: var(--cyan) !important; }
.text-violet { color: var(--violet) !important; }

/* Mobile Drawer Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   C. MAIN WORKSPACE CONTENT AREA
   ========================================================================== */
.main-workspace {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* 3. Workspace Header & Breadcrumbs */
.workspace-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.header-title-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 2px;
}

.bc-sep {
  font-size: 0.6rem;
  color: var(--text-light);
  opacity: 0.7;
}

.bc-active {
  color: var(--primary);
  font-weight: 700;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.page-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 720px;
}

.header-engine-status {
  display: flex;
  align-items: center;
}

.engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: pulse-emerald 2s infinite;
}

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

/* ==========================================================================
   WORKSPACE HOME DASHBOARD STYLES
   ========================================================================== */
.workspace-home-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

.workspace-tools-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

/* 1. Welcome Hero Section */
.home-hero-card {
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 243, 255, 0.85) 100%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.home-hero-content {
  flex: 1;
  min-width: 0;
}

.home-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: var(--primary-subtle);
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.home-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 8px;
}

.home-hero-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 640px;
  margin-bottom: 20px;
}

.home-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  height: 42px;
  padding: 0 22px;
  font-size: 0.88rem;
}

.btn-hero-secondary {
  height: 42px;
  padding: 0 18px;
  font-size: 0.88rem;
}

.home-hero-badge-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 270px;
}

.hero-metric-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.hero-metric-chip:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(2px);
}

.hero-metric-chip i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.hero-metric-chip strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 700;
}

.hero-metric-chip span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-light);
}

/* 2. Real Metrics Grid */
.home-metrics-section {
  width: 100%;
}

.home-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.home-metric-card {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.home-metric-card:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.metric-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.metric-num-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.metric-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.pill-emerald {
  background: var(--emerald-subtle);
  color: var(--emerald-text);
  border: 1px solid var(--emerald-border);
}

.pill-violet {
  background: var(--violet-subtle);
  color: var(--primary);
  border: 1px solid var(--violet-border);
}

.pill-cyan {
  background: var(--cyan-subtle);
  color: var(--cyan-text);
  border: 1px solid var(--cyan-border);
}

.pill-amber {
  background: var(--amber-subtle);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-hint {
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. Four Core Action Cards */
.home-action-cards-section {
  width: 100%;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.home-action-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.action-card {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-smooth);
  cursor: pointer;
}

.action-card:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.action-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.bg-maps {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.bg-serp {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.bg-db {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.bg-crm {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.action-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-popular {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.25);
}

.action-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 12px 0 6px;
}

.action-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.48;
  flex: 1;
  margin-bottom: 14px;
}

.btn-action-card {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-card:hover .btn-action-card {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* 4. Getting Started Section & Recent Activity */
.home-bottom-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: stretch;
}

.getting-started-card,
.recent-activity-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-wrap i {
  font-size: 1.15rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-clean-refresh {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.72rem;
}

.btn-clean-refresh:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.checklist-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checklist-item:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(3px);
  box-shadow: var(--shadow-xs);
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.step-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 1px;
}

.btn-step-action {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.checklist-item:hover .btn-step-action {
  color: var(--primary);
}

.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.activity-loading-placeholder,
.activity-empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.activity-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  transition: all var(--transition-fast);
}

.activity-feed-item:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.3);
}

.activity-lead-name {
  font-weight: 700;
  color: var(--text-main);
}

.activity-lead-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.activity-badge-source {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Responsive Home Dashboard */
@media (max-width: 1024px) {
  .home-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-hero-badge-box {
    width: 100%;
    flex-direction: row;
  }
  .home-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-action-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-hero-title {
    font-size: 1.45rem;
  }
  .home-hero-badge-box {
    flex-direction: column;
  }
  .home-metrics-grid {
    grid-template-columns: 1fr;
  }
  .home-action-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   4. REDESIGNED LEAD DISCOVERY FORM PANEL
   ========================================================================== */
.card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.search-card {
  padding: 20px 24px;
}

.panel-tab {
  display: none;
}

.panel-tab.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

.form-responsive-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1.5fr auto;
  gap: 14px;
  align-items: flex-end;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  font-size: 0.85rem;
  pointer-events: none;
}

.input-with-icon input,
.form-field input,
.form-field textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.form-field input:not(.input-with-icon input) {
  padding: 0 12px;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-field-narrow {
  min-width: 90px;
}

/* Custom Toggle Switch */
.form-field-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}

.toggle-control {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: var(--radius-full);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-control input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-control input:checked + .toggle-slider::before {
  transform: translateX(14px);
}

.toggle-label-wrap {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.toggle-sub {
  font-size: 0.64rem;
  color: var(--text-light);
}

/* Primary Action Buttons */
.btn-primary-action {
  height: 40px;
  padding: 0 20px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 12px rgba(79, 70, 229, 0.35);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary-action:hover {
  background: var(--primary-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(79, 70, 229, 0.45);
}

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

.btn-primary-action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  height: 38px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   5. COMPACT LEAD SUMMARY METRIC CARDS
   ========================================================================== */
.summary-cards-section {
  width: 100%;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.summary-card {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.summary-card:hover {
  background: var(--surface);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.summary-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.icon-violet { background: var(--violet-subtle); color: var(--primary); }
.icon-emerald { background: var(--emerald-subtle); color: var(--emerald-hover); }
.icon-indigo { background: #e0e7ff; color: #4338ca; }
.icon-cyan { background: var(--cyan-subtle); color: var(--cyan-text); }
.icon-amber { background: var(--amber-subtle); color: var(--amber-text); }

.summary-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.summary-val {
  font-family: var(--font-mono);
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.summary-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   LIVE LOADER BOX
   ========================================================================== */
.loader-box {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { border-color: rgba(99, 102, 241, 0.3); }
  50% { border-color: rgba(99, 102, 241, 0.7); }
  100% { border-color: rgba(99, 102, 241, 0.3); }
}

.loader-radar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.radar-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.6;
  animation: radar-wave 1.6s ease-out infinite;
}

@keyframes radar-wave {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.loader-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loader-content strong {
  font-size: 0.92rem;
  color: var(--text-main);
  font-weight: 700;
}

.loader-content span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   6. REBUILT RESULTS PANEL & TABLE
   ========================================================================== */
.results-card {
  padding: 0;
  overflow: hidden;
}

.results-toolbar {
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.results-heading-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.results-count-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-full);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.table-search-wrap i {
  position: absolute;
  left: 10px;
  font-size: 0.8rem;
  color: var(--text-light);
  pointer-events: none;
}

.table-search-wrap input {
  height: 32px;
  width: 180px;
  padding: 0 10px 0 30px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.table-search-wrap input:focus {
  width: 220px;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.toolbar-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-tool {
  height: 32px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-tool:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.btn-tool:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-tool-flowprise {
  background: rgba(79, 70, 229, 0.04);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--primary);
}

.btn-tool-flowprise:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
}

/* Filter Chips Row */
.filter-chips-row {
  padding: 10px 22px;
  background: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.chips-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.filter-chip {
  height: 28px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.chip-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  background: var(--surface-subtle);
  border-radius: var(--radius-full);
  color: var(--text-subtle);
}

/* Table Container & Layout */
.table-container {
  overflow-x: auto;
  min-height: 280px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leads-table thead {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.leads-table th {
  padding: 10px 14px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  white-space: nowrap;
}

.leads-table td {
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  vertical-align: middle;
}

.leads-table tbody tr {
  transition: background var(--transition-fast);
}

.leads-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.8);
}

/* Table Cell Badges & Components */
.lead-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-name-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.88rem;
}

.lead-category-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.badge-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  width: fit-content;
  margin-top: 2px;
}

.badge-rank-pill.strike {
  background: var(--amber-subtle);
  color: var(--amber-text);
}

.badge-rank-pill.ad {
  background: var(--rose-subtle);
  color: var(--rose-text);
}

.contact-cell {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-main);
}

.contact-phone-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-phone-link:hover {
  color: var(--emerald-hover);
}

.contact-email-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.contact-email-link:hover {
  text-decoration: underline;
}

.tech-audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.pixel-badge-active {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--emerald-text);
  background: var(--emerald-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.pixel-badge-missing {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--rose-text);
  background: var(--rose-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.action-buttons-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.btn-mini-action {
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  border: none;
  transition: all var(--transition-fast);
}

.btn-mini-wa {
  background: #25d366;
  color: #ffffff;
}
.btn-mini-wa:hover {
  background: #1da851;
}

.btn-mini-email {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}
.btn-mini-email:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-mini-crm {
  background: var(--amber-subtle);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}
.btn-mini-crm:hover {
  background: var(--amber);
  color: #ffffff;
}

/* Dynamic Lead Table Rows & Badges */
.lead-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.86rem;
  line-height: 1.3;
}

.lead-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-top: 3px;
}

/* Contact Badges (Phone, Email, WhatsApp) */
.badge-contact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.badge-phone {
  background: var(--emerald-subtle);
  color: var(--emerald-text);
  border: 1px solid var(--emerald-border);
}
.badge-phone:hover {
  background: #d1fae5;
  color: var(--emerald-hover);
}

.badge-whatsapp {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.badge-whatsapp:hover {
  background: #bbf7d0;
}

.badge-email {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}
.badge-email:hover {
  background: rgba(79, 70, 229, 0.15);
}

/* Tech & Audit Badges */
.badge-audit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-audit-noweb {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-weight: 700;
}

.badge-audit-cms {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-audit-pixel {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-company {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.badge-role {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
}

.badge-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #0a66c2;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.badge-linkedin:hover {
  background: #dbeafe;
}

/* Table Quick Action Buttons */
.btn-pitch {
  height: 28px;
  width: 28px;
  border-radius: var(--radius-sm);
  background: #25d366;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(37, 211, 102, 0.3);
}
.btn-pitch:hover {
  background: #1da851;
  transform: translateY(-1px);
}

.btn-email {
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}
.btn-email:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-flowprise-single {
  height: 28px;
  width: 28px;
  border-radius: var(--radius-sm);
  background: var(--amber-subtle);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  transition: all var(--transition-fast);
}
.btn-flowprise-single:hover {
  background: var(--amber);
  color: #ffffff;
}

.btn-verify-mini {
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}
.btn-verify-mini:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Empty State */
.empty-state-cell {
  padding: 36px 16px !important;
  text-align: center;
}

.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
}

.empty-state-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.empty-state-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 0.78rem;
}

/* ==========================================================================
   SEO OPTIMIZER SNIPPETS & RESULT CARDS
   ========================================================================== */
.seo-results-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.seo-score-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.seo-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--emerald-subtle);
  border: 3px solid var(--emerald);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--emerald-text);
  line-height: 1;
}

.score-label {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--emerald-text);
}

.seo-score-meta h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.seo-score-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.seo-audit-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.seo-issues-card {
  background: var(--rose-subtle);
  border: 1px solid var(--rose-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.seo-issues-card h4 {
  color: var(--rose-text);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-passes-card {
  background: var(--emerald-subtle);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.seo-passes-card h4 {
  color: var(--emerald-text);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-checks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

.seo-snippets-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.snippet-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-mini-copy {
  padding: 2px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-mini-copy:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-mini-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.snippet-code {
  display: block;
  background: #0f172a;
  color: #38bdf8;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  word-break: break-all;
}

.snippet-code-pre {
  background: #0f172a;
  color: #facc15;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.competitors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-main);
}

.pitch-type-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pitch-type-btn {
  padding: 6px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pitch-type-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.pitch-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  resize: vertical;
  margin-top: 4px;
  margin-bottom: 14px;
}

.pitch-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

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

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Desktop, Tablet, Mobile)
   ========================================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-responsive-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-field-action {
    grid-column: span 2;
  }

  .btn-primary-action {
    width: 100%;
  }

  .btn-header {
    padding: 0 10px;
  }
}

/* Mobile & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: flex;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .workspace-sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    transition: left var(--transition-smooth);
    background: #ffffff;
  }

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

  .main-workspace {
    padding: 16px 14px;
    gap: 16px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-responsive-grid {
    grid-template-columns: 1fr;
  }

  .form-field-action {
    grid-column: span 1;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .table-search-wrap {
    width: 100%;
  }

  .table-search-wrap input {
    width: 100% !important;
  }

  .toolbar-actions-group {
    width: 100%;
    justify-content: flex-start;
  }

  .header-right .workspace-user-chip {
    display: inline-flex;
    padding: 3px 8px 3px 4px;
    gap: 6px;
  }

  .modal-profile-card {
    max-width: 600px;
    width: 95%;
  }

  .seo-audit-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .brand-badge {
    display: none;
  }

  .header-right .status-pill span:not(.status-dot) {
    display: none;
  }
}

/* ==========================================================================
   GLOBAL TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: 100%;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateX(30px) scale(0.96);
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.toast-show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.toast-item.toast-hide {
  opacity: 0;
  transform: translateX(20px) scale(0.96);
}

.toast-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-top: -2px;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-main);
}

/* Toast Color Variants */
.toast-success {
  border-left: 4px solid var(--emerald);
}
.toast-error {
  border-left: 4px solid var(--rose);
}
.toast-warning {
  border-left: 4px solid var(--amber);
}
.toast-info {
  border-left: 4px solid var(--primary);
}
.toast-loading {
  border-left: 4px solid var(--primary);
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: rgba(226, 232, 240, 0.6);
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--primary);
  animation: toastProgress linear forwards;
}

.toast-success .toast-progress-bar { background: var(--emerald); }
.toast-error .toast-progress-bar { background: var(--rose); }
.toast-warning .toast-progress-bar { background: var(--amber); }

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .toast-item {
    transition: opacity 0.1s linear;
    transform: none !important;
  }
  .toast-progress-bar {
    animation: none;
    display: none;
  }
}

/* Mobile Toast adjustments */
@media (max-width: 640px) {
  .toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* ==========================================================================
   REUSABLE ACCESSIBLE CONFIRMATION MODAL
   ========================================================================== */
.modal-confirm-card {
  max-width: 440px;
  text-align: center;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.confirm-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.confirm-icon-wrap.icon-danger {
  background: var(--rose-subtle);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.confirm-icon-wrap.icon-info {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.confirm-content h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.confirm-content p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.confirm-actions button {
  flex: 1;
  height: 40px;
}

.btn-danger-action {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-danger-action:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
}

/* ==========================================================================
   SMART LEAD INTELLIGENCE, PIPELINE & BULK ACTIONS
   ========================================================================== */

/* Filter Row & Pipeline Select */
.filter-chips-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.chips-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pipeline-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-select-control {
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-select-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Floating Bulk Action Bar */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
  animation: slideDownBulk 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.bulk-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.bulk-count-badge {
  background: #4f46e5;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.bulk-status-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bulk-select {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.bulk-select option {
  background: #1e1b4b;
  color: #ffffff;
}

.btn-bulk-action {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-bulk-action:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-bulk-crm {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-bulk-crm:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.btn-bulk-clear {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.btn-bulk-clear:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Qualification Tier Badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tier-badge:hover {
  transform: translateY(-1px);
}

.tier-badge-a {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.tier-badge-b {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.tier-badge-c {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Pipeline Status Badges */
.pipeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: 1px solid transparent;
}

.pipeline-badge-new {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.pipeline-badge-qualified {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.pipeline-badge-contacted {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.pipeline-badge-interested {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.pipeline-badge-won {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.pipeline-badge-lost {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Table Checkbox & Intel Action Buttons */
.lead-select-cell {
  text-align: center;
  vertical-align: middle;
}

.lead-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn-intel-view {
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-intel-view:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

/* Modal Lead Intelligence Styling */
.modal-intel-card {
  max-width: 680px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.modal-header-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 20px 24px;
}

.modal-header-gradient .modal-close {
  color: #ffffff;
  opacity: 0.85;
}

.intel-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.intel-tier-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.intel-source-tag, .intel-date-tag {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.74rem;
  font-weight: 500;
}

.intel-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.intel-sub {
  color: #e0e7ff;
  font-size: 0.82rem;
  margin: 4px 0 0 0;
}

.intel-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.intel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intel-section-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.intel-factors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.factor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
}

.factor-positive {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.factor-opportunity {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.factor-neutral {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.factor-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.intel-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .intel-details-grid {
    grid-template-columns: 1fr;
  }
}

.intel-detail-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intel-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.intel-detail-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.intel-section-pipeline {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-md);
  padding: 16px;
}

.intel-input, .intel-textarea {
  width: 100%;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}

.intel-input:focus, .intel-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.intel-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

/* Duplicate Review Modal Styling */
.modal-duplicate-card {
  max-width: 760px;
  border-radius: var(--radius-lg);
}

.dup-summary-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.dup-groups-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.dup-group-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dup-group-header {
  background: #f8fafc;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dup-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  gap: 10px;
}

.dup-item-row:last-child {
  border-bottom: none;
}

.dup-item-main {
  flex: 1;
  min-width: 0;
}

.dup-item-name {
  font-weight: 700;
  color: var(--text-main);
}

.dup-item-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* =============================================================
   FOLLOW-UP CENTER STYLES
   ============================================================= */

.followup-center-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

/* 1. Metrics Stat Cards Grid */
.followup-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

@media (max-width: 1100px) {
  .followup-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .followup-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.followup-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.followup-metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  transition: width 0.2s ease;
}

.followup-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.followup-metric-card.active-filter {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
}

.metric-overdue::before { background: #ef4444; }
.metric-overdue .metric-icon-box { background: #fee2e2; color: #dc2626; }
.metric-today::before { background: #f59e0b; }
.metric-today .metric-icon-box { background: #fef3c7; color: #d97706; }
.metric-upcoming::before { background: #6366f1; }
.metric-upcoming .metric-icon-box { background: #e0e7ff; color: #4f46e5; }
.metric-completed::before { background: #10b981; }
.metric-completed .metric-icon-box { background: #d1fae5; color: #059669; }
.metric-unscheduled::before { background: #94a3b8; }
.metric-unscheduled .metric-icon-box { background: #f1f5f9; color: #64748b; }

.followup-metric-card .metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.followup-metric-card .metric-details {
  display: flex;
  flex-direction: column;
}

.followup-metric-card .metric-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.followup-metric-card .metric-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.followup-metric-card .metric-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 2. Follow-up Main Card & Toolbar */
.followup-main-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.followup-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.followup-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.followup-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.followup-chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.followup-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.followup-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.followup-chip .chip-count {
  background: #e2e8f0;
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.followup-chip.chip-rose.active { background: #dc2626; border-color: #dc2626; }
.followup-chip.chip-amber.active { background: #d97706; border-color: #d97706; }
.followup-chip.chip-indigo.active { background: #4f46e5; border-color: #4f46e5; }
.followup-chip.chip-emerald.active { background: #059669; border-color: #059669; }
.followup-chip.chip-slate.active { background: #475569; border-color: #475569; }

.followup-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.followup-search-wrap {
  width: 240px;
}

/* 3. Follow-up List Items */
.followup-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.followup-card-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.followup-card-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.followup-card-item.is-overdue {
  border-left: 4px solid #ef4444;
}

.followup-card-item.is-today {
  border-left: 4px solid #f59e0b;
}

.followup-card-item.is-upcoming {
  border-left: 4px solid #6366f1;
}

.followup-card-item.is-completed {
  border-left: 4px solid #10b981;
  background: #fbfdfc;
  opacity: 0.88;
}

.followup-card-item.is-unscheduled {
  border-left: 4px solid #94a3b8;
}

.followup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.followup-lead-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.followup-lead-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.followup-lead-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
}

.followup-lead-name:hover {
  color: var(--primary);
  text-decoration: underline;
}

.followup-lead-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.followup-card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status Badges in Follow-up */
.followup-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.followup-badge-overdue {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.followup-badge-today {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.followup-badge-upcoming {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.followup-badge-completed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.followup-badge-unscheduled {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Follow-up Notes Box */
.followup-notes-box {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.4;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.followup-notes-box i {
  color: var(--text-muted);
  margin-top: 2px;
  flex-shrink: 0;
}

.followup-notes-text {
  flex: 1;
}

.followup-notes-empty {
  color: var(--text-muted);
  font-style: italic;
  cursor: pointer;
}

.followup-notes-empty:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Follow-up Card Bottom Controls Bar */
.followup-card-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(241, 245, 249, 0.9);
}

.followup-controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.followup-date-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.followup-date-picker {
  padding: 4px 8px;
  font-size: 0.76rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.followup-date-picker:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.followup-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-followup-toggle {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-followup-toggle:hover {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.btn-followup-toggle.completed {
  background: #f1f5f9;
  color: #475569;
}

.btn-followup-toggle.completed:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

