/* =============================================================================
   GROW50X SDR — ENTERPRISE DESIGN SYSTEM v3.0
   Dark-mode first. Palette: Deep Onyx + Platinum + Electric Indigo + Emerald
   Inspired by: Linear, Vercel, Stripe
============================================================================= */

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

:root {
  /* Core Backgrounds */
  --bg-base:       #09090b;
  --bg-primary:    #0d0d0f;
  --bg-surface:    #111115;
  --bg-elevated:   #18181c;
  --bg-overlay:    #1e1e24;
  --bg-glass:      rgba(17, 17, 21, 0.85);
  --bg-hover:      rgba(255, 255, 255, 0.04);
  --bg-active:     rgba(99, 102, 241, 0.08);

  /* Accent - Electric Indigo */
  --accent-primary: #6366f1;
  --accent-hover:   #5254cc;
  --accent-light:   rgba(99, 102, 241, 0.12);
  --accent-glow:    rgba(99, 102, 241, 0.3);

  /* Accent - Violet (Engine A / B2B) */
  --accent-noura:       #8b5cf6;
  --accent-noura-light: rgba(139, 92, 246, 0.12);

  /* Accent - Emerald (Engine B / Local) */
  --accent-hunter:       #10b981;
  --accent-hunter-light: rgba(16, 185, 129, 0.1);

  /* Typography */
  --text-primary:   #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a; /* carries real content (domains, dates) — keep readable */
  --text-faint:     #3f3f46;

  /* Type scale — dense B2B data ramp */
  --text-xs:   0.6875rem;  /* 11px   — table meta, micro-labels */
  --text-sm:   0.78125rem; /* 12.5px — table body, badges */
  --text-base: 0.84375rem; /* 13.5px — forms, prose */
  --text-lg:   1rem;       /* 16px   — panel titles */
  --text-xl:   1.25rem;    /* 20px   — page title */

  /* Borders */
  --border:        #27272a;
  --border-color:  #27272a;
  --border-soft:   #1f1f23;
  --border-strong: #3f3f46;
  --border-glass:  rgba(255, 255, 255, 0.05);
  --border-accent: rgba(99, 102, 241, 0.28);

  /* Semantic Colors */
  --danger:  #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --info:    #38bdf8;

  /* Semantic status triads — badges/dots/banners consume ONLY these */
  --success-bg: rgba(52, 211, 153, 0.10);
  --success-fg: #34d399;
  --success-bd: rgba(52, 211, 153, 0.25);
  --warning-bg: rgba(251, 191, 36, 0.10);
  --warning-fg: #fbbf24;
  --warning-bd: rgba(251, 191, 36, 0.25);
  --danger-bg:  rgba(248, 113, 113, 0.10);
  --danger-fg:  #f87171;
  --danger-bd:  rgba(248, 113, 113, 0.25);
  --info-bg:    rgba(56, 189, 248, 0.10);
  --info-fg:    #38bdf8;
  --info-bd:    rgba(56, 189, 248, 0.25);
  --neutral-bg: rgba(161, 161, 170, 0.08);
  --neutral-fg: #a1a1aa;
  --neutral-bd: rgba(161, 161, 170, 0.20);

  /* Engine identity — one hue per lead-gen engine, never reused for semantics */
  --engine-a:    #8b5cf6;                  /* A — B2B Prospector (violet) */
  --engine-a-bg: rgba(139, 92, 246, 0.12);
  --engine-b:    #10b981;                  /* B — Local Hunter (emerald) */
  --engine-b-bg: rgba(16, 185, 129, 0.12);
  --engine-c:    #38bdf8;                  /* C — Meta Ads Intel (sky) */
  --engine-c-bg: rgba(56, 189, 248, 0.12);
  --engine-d:    #6366f1;                  /* D — Grow50X Portal (flagship indigo) */
  --engine-d-bg: rgba(99, 102, 241, 0.12);
  --engine-e:    #14b8a6;                  /* E — Search & Enrich (teal) */
  --engine-e-bg: rgba(20, 184, 166, 0.12);

  /* Shadows — restrained; reserve for floating layers (menus, modals, drawer) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  --glow-accent: 0 0 20px rgba(99, 102, 241, 0.22);

  /* Transparency helpers */
  --bg-transparent-2:  rgba(255,255,255,0.02);
  --bg-transparent-5:  rgba(255,255,255,0.05);
  --bg-transparent-10: rgba(255,255,255,0.08);
  --bg-transparent-20: rgba(255,255,255,0.12);

  /* Aliases for backward compatibility */
  --surface-bg: var(--bg-elevated);
  --text-color:  var(--text-primary);
  --primary:     var(--accent-primary);

  /* Layout */
  --sidebar-w:  240px;
  --glass-blur: blur(16px);
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
}

/* Light theme as a data-attribute opt-in only */
[data-theme="light"] {
  --bg-base:       #f8f9fc;
  --bg-primary:    #f3f4f6;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f9fafb;
  --bg-overlay:    #ffffff;
  --bg-glass:      rgba(255,255,255,0.92);
  --bg-hover:      rgba(0,0,0,0.04);
  --accent-primary: #4f46e5;
  --accent-hover:   #4338ca;
  --text-primary:   #0f0f11;
  --text-secondary: #4b5563;
  --text-muted:     #6b7280;
  --text-faint:     #9ca3af;
  --border:        #e4e4e7;
  --border-color:  #e4e4e7;
  --border-soft:   #ececef;
  --border-strong: #d4d4d8;
  --border-glass:  rgba(0,0,0,0.07);
  --danger:  #dc2626;
  --success: #059669;
  --warning: #d97706;
  --info:    #0284c7;
  --success-bg: rgba(5, 150, 105, 0.08);
  --success-fg: #059669;
  --success-bd: rgba(5, 150, 105, 0.25);
  --warning-bg: rgba(217, 119, 6, 0.08);
  --warning-fg: #b45309;
  --warning-bd: rgba(217, 119, 6, 0.25);
  --danger-bg:  rgba(220, 38, 38, 0.07);
  --danger-fg:  #dc2626;
  --danger-bd:  rgba(220, 38, 38, 0.22);
  --info-bg:    rgba(2, 132, 199, 0.08);
  --info-fg:    #0284c7;
  --info-bd:    rgba(2, 132, 199, 0.25);
  --neutral-bg: rgba(82, 82, 91, 0.06);
  --neutral-fg: #52525b;
  --neutral-bd: rgba(82, 82, 91, 0.18);
  --engine-a:    #7c3aed;
  --engine-a-bg: rgba(124, 58, 237, 0.09);
  --engine-b:    #059669;
  --engine-b-bg: rgba(5, 150, 105, 0.09);
  --engine-c:    #0284c7;
  --engine-c-bg: rgba(2, 132, 199, 0.09);
  --engine-d:    #4f46e5;
  --engine-d-bg: rgba(79, 70, 229, 0.09);
  --engine-e:    #0d9488;
  --engine-e-bg: rgba(13, 148, 136, 0.09);
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.1);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.15);
  --bg-transparent-2:  rgba(0,0,0,0.02);
  --bg-transparent-5:  rgba(0,0,0,0.04);
  --bg-transparent-10: rgba(0,0,0,0.07);
  --bg-transparent-20: rgba(0,0,0,0.1);
  --glass-blur: blur(0px);
}

/* =============================================================================
   RESET & BASE
============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

.hidden { display: none !important; }
.text-center { text-align: center; }

h1, h2, h3, h4 { color: var(--text-primary); font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.025em; }
h1 { font-size: clamp(1.4rem, 4vw, 1.875rem); font-weight: 700; }
h2 { font-size: clamp(1.15rem, 3vw, 1.375rem); }
h3 { font-size: 0.9rem; }
p.subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1.5rem; }

/* =============================================================================
   GLASS PANEL
============================================================================= */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

/* =============================================================================
   BUTTONS
============================================================================= */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.full-width { width: 100%; }

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 1px var(--accent-hover), var(--glow-accent);
  transform: translateY(-1px);
}

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

.btn-danger {
  background: rgba(248,113,113,0.08);
  color: var(--danger);
  border-color: rgba(248,113,113,0.2);
}
.btn-danger:hover {
  background: rgba(248,113,113,0.14);
  border-color: rgba(248,113,113,0.38);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn:active { transform: scale(0.97); }

.btn-loader {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid transparent;
  border-bottom-color: currentColor;
  border-left-color: currentColor;
  opacity: 0.8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 4px;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =============================================================================
   FORMS
============================================================================= */
.input-group { margin-bottom: 1rem; }
.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.005em;
}

input, textarea, select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  letter-spacing: -0.005em;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
  background: var(--bg-overlay);
}

/* =============================================================================
   LOGIN
============================================================================= */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(99,102,241,0.16) 0%, transparent 60%),
    var(--bg-base);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}
.logo-large { text-align: center; margin-bottom: 2rem; }

/* =============================================================================
   APP SHELL — 3-zone workspace frame
   Grid: nav rail | content column (slim top bar + interior-scroll canvas).
   The canvas (#routerOutlet) scrolls, not the page — app feel, not website.
============================================================================= */
#appShell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}
/* Collapsed rail (user toggle, persisted) — desktop only; tablet/mobile
   breakpoints impose their own rail treatment regardless of the toggle */
@media (min-width: 1024px) {
  #appShell.nav-collapsed { --sidebar-w: 64px; }
}

.sidebar {
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.875rem;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-surface);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 2rem;
  padding: 0 0.25rem 0 0.5rem;
}
.logo-icon {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-noura));
  border-radius: 7px;
  box-shadow: 0 0 14px var(--accent-glow);
}
.logo span {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.125rem;
  transition: all 0.15s;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-secondary); }
.nav-link.active {
  background: var(--bg-active);
  color: var(--accent-primary);
  border-color: var(--border-accent);
}

.user-area, .user-badge {
  margin-top: auto;
  padding: 0.875rem 0.5rem 0;
  border-top: 1px solid var(--border-soft);
}
.email-chip {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout { width: 100%; font-size: 0.75rem; }

/* Nav section labels (Pipeline / Growth / System) */
.nav-section {
  font-size: 0.655rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 0.875rem;
  margin: 1.1rem 0 0.35rem;
  white-space: nowrap;
}
nav .nav-section:first-child { margin-top: 0; }

/* Rail collapse toggle (in the logo row) */
.sidebar-toggle {
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-secondary); }

/* Credits chip — account state lives in the rail footer, not the top bar */
.credits-chip {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.6rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.credits-chip #creditsCount { font-weight: 700; color: var(--accent-primary); }

/* Collapsed rail — icon-only (desktop-only; mirrors tablet treatment) */
@media (min-width: 1024px) {
  .nav-collapsed .sidebar { padding: 1rem 0.5rem; align-items: center; }
  .nav-collapsed .logo { flex-direction: column; gap: 0.5rem; justify-content: center; padding: 0; margin-bottom: 1.5rem; }
  .nav-collapsed .logo span,
  .nav-collapsed .nav-label,
  .nav-collapsed .nav-section,
  .nav-collapsed .email-chip,
  .nav-collapsed .credits-chip,
  .nav-collapsed .btn-logout { display: none !important; }
  .nav-collapsed .sidebar-toggle { margin-left: 0; }
  .nav-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  .nav-collapsed .nav-link { justify-content: center; width: 40px; height: 40px; padding: 0.75rem; gap: 0; border: none; }
  .nav-collapsed .nav-link.active { border: none; background: var(--bg-active); }
  .nav-collapsed .nav-link.active::before { display: none; }
  .nav-collapsed .user-area { padding: 0.75rem 0 0; display: flex; flex-direction: column; align-items: center; }
}

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 0.75rem; }
.alert.danger { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); color: var(--danger); }

/* Main Content — flex column: slim top bar + scrolling canvas */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
}
.top-bar {
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-primary);
}
.top-bar h1 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.top-bar-actions { display: flex; align-items: center; gap: 0.75rem; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }

#routerOutlet {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 2rem 2.5rem;
}

/* =============================================================================
   GRID & LAYOUT
============================================================================= */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
/* Grid items default to min-width:auto — one nowrap title (camp-card h4) would
   otherwise set the track's min-content and push every card past the viewport. */
.card-grid > * { min-width: 0; }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--text-faint); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.flex-1 { flex: 1; }
.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
}

/* =============================================================================
   ENGINE CARD UI
============================================================================= */
.engine-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; margin-bottom: 1.5rem; }
.engine-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.engine-card { cursor: pointer; position: relative; }
.engine-card input { position: absolute; opacity: 0; }
.engine-content {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  background: var(--bg-elevated);
}
.engine-content:hover { border-color: var(--text-faint); }
.engine-card input[value="B2B_LIST"]:checked + .engine-content {
  border-color: var(--accent-noura);
  background: var(--accent-noura-light);
  box-shadow: 0 0 0 1px rgba(139,92,246,0.12), inset 0 0 20px rgba(139,92,246,0.04);
}
.engine-card input[value="LOCAL_MAPS"]:checked + .engine-content {
  border-color: var(--accent-hunter);
  background: var(--accent-hunter-light);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.12), inset 0 0 20px rgba(16,185,129,0.04);
}
.engine-content p { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* =============================================================================
   INTEGRATION CARDS
============================================================================= */
.integration-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s;
}
.integration-card:hover { border-color: var(--text-faint); }
.integration-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.integration-title { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.integration-status {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.status-op   { background: rgba(52,211,153,0.1);  color: var(--success); border-color: rgba(52,211,153,0.25); }
.status-fail { background: rgba(248,113,113,0.1); color: var(--danger);  border-color: rgba(248,113,113,0.25); }
.status-none { background: rgba(161,161,170,0.1); color: var(--text-muted); border-color: var(--border); }
.integration-error {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(248,113,113,0.05);
  border-left: 2px solid var(--danger);
  border-radius: 0 4px 4px 0;
  font-size: 0.72rem;
  color: var(--danger);
  word-break: break-all;
}
.integration-actions { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; }
.security-health {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem;
  margin-bottom: 1.25rem; padding: 0.65rem 0.85rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.75rem; color: var(--text-muted);
}
.security-health strong { color: var(--text); }

/* =============================================================================
   CAMPAIGN CARDS
============================================================================= */
.camp-card {
  padding: 1.25rem;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.camp-card:hover { border-color: var(--text-faint); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.camp-card .status-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-pending   { border-color: rgba(251,191,36,0.35);  color: var(--warning); background: rgba(251,191,36,0.1); }
.badge-running   { border-color: rgba(99,102,241,0.35);  color: var(--accent-primary); background: var(--accent-light); }
.badge-completed { border-color: rgba(52,211,153,0.35);  color: var(--success); background: rgba(52,211,153,0.1); }
.badge-failed    { border-color: rgba(248,113,113,0.35); color: var(--danger);  background: rgba(248,113,113,0.1); }
.badge-cancelled { border-color: rgba(161,161,170,0.35); color: var(--text-secondary); background: rgba(161,161,170,0.1); }

.badge-engine { display: inline-block; font-size: 0.67rem; padding: 2px 7px; border-radius: 999px; margin-bottom: 0.5rem; font-weight: 600; }
.bg-noura  { background: rgba(139,92,246,0.14); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.22); }
.bg-hunter { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }

.camp-card h4 {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  width: 80%;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.75rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}
.card-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* =============================================================================
   DASHBOARD LAYOUT
============================================================================= */
.dashboard-layout { min-width: 0; max-width: 100%; display: flex; flex-direction: column; }
.dashboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-strip {
  display: flex;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  gap: 2px;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.tab-btn.active { background: var(--bg-overlay); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tab-btn:active { transform: scale(0.96); }

/* =============================================================================
   TABLE
============================================================================= */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem 0;
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 1.5rem 1.5rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-feature-settings: 'tnum' 1, 'cv03' 1, 'cv04' 1; /* tabular numerals for scores/dates/counts */
}
.data-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--bg-hover); color: var(--text-primary); transition: background 0.12s; }

.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot-pending  { background: var(--warning); }
.dot-verified { background: var(--success); box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.dot-failed   { background: var(--danger);  box-shadow: 0 0 5px rgba(248,113,113,0.4); }

.leads-table-panel {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.leads-table-panel .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 1.5rem 1.5rem; max-width: 100%; }
.leads-table-panel .data-table { min-width: 900px; }

/* =============================================================================
   LEADS WORKSPACE — filter panel + results canvas (Apollo-style two-pane)
============================================================================= */
.leads-workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Filter panel — sticky within the scrolling canvas */
.filter-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  max-height: calc(100vh - 52px - 3rem); /* top bar + outlet padding */
  overflow-y: auto;
}
.filter-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}
.filter-search:focus-within { border-color: var(--accent-primary); }
.filter-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
}
.filter-search input::placeholder { color: var(--text-muted); }

.filter-group { border-bottom: 1px solid var(--border-soft); }
.filter-group:last-of-type { border-bottom: none; }
.filter-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  user-select: none;
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::before {
  content: '';
  width: 0; height: 0;
  border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform 0.15s;
  flex: none;
}
.filter-group[open] summary::before { transform: rotate(90deg); }
.filter-active-count {
  margin-left: auto;
  font-size: 0.62rem;
  background: var(--accent-light);
  color: var(--accent-primary);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-weight: 700;
}
.filter-active-count:empty { display: none; }
.filter-options { padding: 0.1rem 0 0.6rem; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-option:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-option input { width: auto; accent-color: var(--accent-primary); margin: 0; flex: none; } /* beat global input{width:100%} */
.filter-option .opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-option .opt-count { font-size: 0.68rem; color: var(--text-muted); flex: none; }
.filter-clear { font-size: 0.72rem; margin-top: 0.4rem; width: 100%; justify-content: center; }

/* Results header — count · active-filter chips · actions */
.results-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  min-height: 30px;
}
.results-count { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.results-chips { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.3rem 0.18rem 0.6rem;
}
.filter-chip button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.filter-chip button:hover { background: var(--bg-hover); color: var(--text-primary); }
.results-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.btn-sm { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
.filter-toggle-btn { display: none; } /* desktop shows the persistent panel; <1024px media unhides */

/* Table scroller — sticky header, rows scroll inside the panel */
.leads-table-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 52px - 3rem - 44px); /* top bar + padding + results header */
}
.leads-table-scroll .data-table { min-width: 980px; }
.leads-table-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 2;
  box-shadow: 0 1px 0 var(--border);
  border-bottom: none;
}
.th-check, .td-check { width: 34px; padding-right: 0 !important; }
.td-check input, .th-check input { width: auto; accent-color: var(--accent-primary); cursor: pointer; }

/* Row meta line + hover-revealed actions */
.cell-meta { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { opacity: 0; transition: opacity 0.12s; }
tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }
.copy-email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  vertical-align: middle;
  padding: 0;
}
.copy-email-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.engine-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; flex: none; }

/* Bulk actions bar — floats at the bottom of the canvas while rows are selected */
.bulk-bar {
  position: sticky;
  bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  margin: 0.85rem auto 0;
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.45rem 0.6rem 0.45rem 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 5;
}
.bulk-count { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

@media (max-width: 1023px) {
  .leads-workspace { grid-template-columns: 1fr; }
  .filter-panel { position: static; max-height: none; }
  .leads-table-scroll { max-height: none; }
}

/* =============================================================================
   CREATE FLOW — full-page campaign creation (ex-modal; keeps .camp-* internals)
============================================================================= */
.create-flow {
  max-width: 1140px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
}
.create-flow .camp-modal-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

.engine-group-label {
  font-size: 0.655rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0.75rem 0 0.15rem;
  grid-column: 1 / -1;
}
.engine-group-label:first-child { margin-top: 0; }

/* Engine E import preview (paste/CSV parse feedback) */
.import-preview {
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
}
.import-preview-counts { display: flex; gap: 0.9rem; margin-bottom: 0.45rem; font-weight: 600; }
.import-count-valid   { color: var(--success-fg); }
.import-count-invalid { color: var(--warning-fg); }
.import-preview table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.import-preview th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid var(--border-soft);
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}
.import-preview td {
  padding: 0.28rem 0.4rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.import-preview tr:last-child td { border-bottom: none; }
.import-invalid-list { margin-top: 0.45rem; color: var(--warning-fg); font-size: 0.7rem; }

/* =============================================================================
   PROSPECT CONSOLE — Engine D search definition workspace
   (reuses .filter-panel / .filter-group / .filter-chip from the Leads workspace)
============================================================================= */
.prospect-workspace { grid-template-columns: 264px minmax(0, 1fr); }
.prospect-canvas { display: flex; flex-direction: column; gap: 1.25rem; max-width: 780px; }

.prospect-hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.prospect-summary-label {
  font-size: 0.655rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.prospect-summary-empty { font-size: 0.78rem; color: var(--text-muted); }

/* Mini search inside long option lists (industries, locations) */
.filter-mini-search {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-family: inherit;
  padding: 0.28rem 0.5rem;
  margin: 0.1rem 0 0.35rem;
}
.filter-mini-search:focus { border-color: var(--accent-primary); outline: none; }
.filter-options-scroll { max-height: 176px; overflow-y: auto; }

/* Text-filter inputs inside accordion groups */
.filter-text-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-family: inherit;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.55rem;
}
.filter-text-input:focus { border-color: var(--accent-primary); outline: none; }

.prospect-launch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.prospect-launch-grid .input-group:last-child { grid-column: 1 / -1; }
.prospect-toggles { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.6rem 0 1rem; }
.prospect-actions { display: flex; justify-content: flex-end; gap: 0.6rem; border-top: 1px solid var(--border-soft); padding-top: 1rem; }

/* Saved-search rows */
.saved-search-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.saved-search-row:hover { background: var(--bg-hover); color: var(--text-primary); }
.saved-search-row .opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-search-row .del-saved {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border: none; border-radius: 4px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; padding: 0; flex: none;
  opacity: 0;
}
.saved-search-row:hover .del-saved { opacity: 1; }
.saved-search-row .del-saved:hover { background: var(--bg-hover); color: var(--danger-fg); }

@media (max-width: 1023px) {
  /* minmax(0,1fr): a plain 1fr track sizes to the canvas's min-content, which
     wide inner grids/nowrap rows inflate past the viewport (clipped inputs). */
  .prospect-workspace { grid-template-columns: minmax(0, 1fr); }
  .prospect-workspace > * { min-width: 0; max-width: 100%; }
  .prospect-canvas { max-width: 100%; }
  .prospect-launch-grid { grid-template-columns: 1fr; }
}

/* Long checkbox labels in the setup card (e.g. "Verified email status only
   (narrows results…)") wrap instead of clipping — at every width. */
.prospect-canvas .filter-option { align-items: flex-start; }
.prospect-canvas .filter-option .opt-label { white-space: normal; overflow: visible; }

/* =============================================================================
   PROGRESS BAR
============================================================================= */
.progress-container {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: var(--bg-transparent-5, rgba(255,255,255,0.05));
  border: 1px solid var(--border-color);
}
.progress-phases {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.phase-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
}
.progress-bar-track {
  height: 8px;
  background: var(--bg-transparent-10, rgba(255,255,255,0.1));
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-noura, #00e5a0), var(--accent-primary, #6366f1));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =============================================================================
   PAGINATION
============================================================================= */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  flex-wrap: wrap;
}
.pagination-controls button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.pagination-controls button:hover {
  background: var(--bg-transparent-10);
}
.pagination-controls button.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}
.pagination-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =============================================================================
   LIVE RUN TERMINAL
============================================================================= */
.active-run-panel {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.run-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.terminal-feed {
  background: var(--bg-base);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  height: 200px;
  overflow-y: auto;
  padding: 0.875rem 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}
.terminal-feed::-webkit-scrollbar { width: 4px; }
.terminal-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.log-row   { margin-bottom: 0.2rem; color: var(--text-muted); }
.log-warn  { color: var(--warning); }
.log-error { color: var(--danger); }
.log-info  { color: var(--text-secondary); }

/* =============================================================================
   MODALS
============================================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
}
.modal-content {
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}
.modal-content.pitch-modal { max-width: 700px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.25rem; cursor: pointer; transition: color 0.15s; line-height: 1; }
.close-btn:hover { color: var(--text-primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-soft); }

.pitch-container { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; }
.pitch-subject { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-soft); }
.pitch-body { white-space: pre-wrap; font-family: inherit; font-size: 0.875rem; color: var(--text-secondary); line-height: 1.7; }

/* =============================================================================
   PULSE ANIMATION
============================================================================= */
.pulse-dot {
  width: 8px; height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(52,211,153,0.8);
  animation: pulse-green 1.5s ease-in-out infinite;
}
@keyframes pulse-green {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52,211,153,0.7); }
  60%  { transform: scale(1);    box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* =============================================================================
   TOASTS
============================================================================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-xl);
  min-width: 260px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
}
.toast.show { transform: translateX(0); }
.toast-icon { padding-top: 1px; flex-shrink: 0; }
.toast-success { color: var(--success); }
.toast-error   { color: var(--danger); }
.toast-warn    { color: var(--warning); }
.toast-title   { font-weight: 600; font-size: 0.8125rem; margin-bottom: 0.2rem; color: var(--text-primary); }
.toast-message { font-size: 0.75rem; color: var(--text-secondary); }

/* =============================================================================
   PILL BADGES
============================================================================= */
.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: capitalize;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.pill-verified { background: var(--success-bg); color: var(--success-fg); border: 1px solid var(--success-bd); }
.pill-pending  { background: var(--warning-bg); color: var(--warning-fg); border: 1px solid var(--warning-bd); }
.pill-failed   { background: var(--danger-bg);  color: var(--danger-fg);  border: 1px solid var(--danger-bd); }
.pill-neutral  { background: var(--neutral-bg); color: var(--neutral-fg); border: 1px solid var(--neutral-bd); }

.source-tag {
  font-size: 0.62rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* =============================================================================
   ENGINE IDENTITY — badge + icon tints per engine (see :root engine triads)
============================================================================= */
.bg-engine-a { background: var(--engine-a-bg); color: var(--engine-a); }
.bg-engine-b { background: var(--engine-b-bg); color: var(--engine-b); }
.bg-engine-c { background: var(--engine-c-bg); color: var(--engine-c); }
.bg-engine-d { background: var(--engine-d-bg); color: var(--engine-d); }
.bg-engine-e { background: var(--engine-e-bg); color: var(--engine-e); }

.engine-icon-a { background: var(--engine-a-bg); color: var(--engine-a); }
.engine-icon-b { background: var(--engine-b-bg); color: var(--engine-b); }
.engine-icon-c { background: var(--engine-c-bg); color: var(--engine-c); }
.engine-icon-d { background: var(--engine-d-bg); color: var(--engine-d); }
.engine-icon-e { background: var(--engine-e-bg); color: var(--engine-e); }

/* =============================================================================
   SKELETON LOADING
============================================================================= */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  border-radius: 4px;
  display: inline-block;
  height: 0.85em;
  width: 100%;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--bg-transparent-5), transparent);
  animation: skeleton-shimmer 1.6s infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-badge { border-radius: 999px; height: 1.35em; width: 4.5em; }
.skeleton-row td { padding: 0.875rem 1rem; }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* =============================================================================
   SLIDE-OVER DRAWER
============================================================================= */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 1000;
  transition: background 0.3s ease;
  pointer-events: none;
}
.drawer-overlay.active {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

/* Right-anchored slide-over (was a centered modal). Enables dock/push mode. */
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  transform: translateX(100%);
  width: 520px;
  max-width: 94vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 48px rgba(0,0,0,0.28);
  z-index: 1001;
  opacity: 1;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.open {
  transform: translateX(0);
  pointer-events: auto;
}

.drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-primary);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Prev/next lead navigation — review a filtered list without closing */
.drawer-nav {
  position: absolute;
  top: 1rem;
  right: 3.25rem;
  display: flex;
  gap: 0.35rem;
}
.drawer-nav button {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.drawer-nav button:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text-primary); }
.drawer-nav button:disabled { opacity: 0.35; cursor: default; }
.drawer-position { font-size: 0.7rem; color: var(--text-muted); align-self: center; margin-right: 0.15rem; white-space: nowrap; }

.drawer-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-noura));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.drawer-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: var(--text-primary);
  padding-right: 36px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.drawer-header p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.drawer-header .close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.drawer-header .close-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* Dock/push mode — on wide screens the drawer docks and the canvas reflows
   beside it instead of being covered by a dimming overlay. */
@media (min-width: 1600px) {
  #appShell.drawer-open { padding-right: 520px; transition: padding-right 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
  #appShell.drawer-open ~ .drawer-overlay.active { background: transparent; backdrop-filter: none; pointer-events: none; }
}

/* Cached-reveal / no-credit micro badge */
.credit-note {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--info-fg);
  background: var(--info-bg);
  border: 1px solid var(--info-bd);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  vertical-align: middle;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.drawer-body::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

.drawer-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(16px);
}
.drawer.open .drawer-card {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.drawer-card:nth-child(1) { animation-delay: 0.08s; }
.drawer-card:nth-child(2) { animation-delay: 0.12s; }
.drawer-card:nth-child(3) { animation-delay: 0.16s; }
.drawer-card:nth-child(4) { animation-delay: 0.20s; }
.drawer-card:nth-child(5) { animation-delay: 0.24s; }

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.drawer-section { display: contents; }

.drawer-card h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.intel-content {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-transparent-2);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}
.intel-content strong { color: var(--text-primary); }

.drawer-body textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.drawer-body textarea:focus {
  border-color: var(--accent-primary);
  background: var(--bg-overlay);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
}
.drawer-body input[type="text"] { width: 100%; }

/* =============================================================================
   COMPANY INTELLIGENCE — REPUTATION BANNER
============================================================================= */
.reputation-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, rgba(245,158,11,0.04) 100%);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 0.9rem;
}
.rep-stars   { font-size: 1rem; }
.rep-score   { font-size: 1.2rem; font-weight: 700; color: #fbbf24; letter-spacing: -0.03em; }
.rep-divider { color: var(--text-faint); font-size: 0.9rem; }
.rep-reviews { font-size: 0.78rem; color: var(--text-muted); }

/* Review Blockquote */
.review-blockquote {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.9rem;
  border-left: 2px solid var(--accent-primary);
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Social Link Badges */
.social-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.social-badge:hover { opacity: 0.85; transform: translateY(-1px); }
.social-linkedin  { background: rgba(10,102,194,0.12);  color: #5c9fcf; border-color: rgba(10,102,194,0.25); }
.social-facebook  { background: rgba(24,119,242,0.1);   color: #6daaff; border-color: rgba(24,119,242,0.25); }
.social-instagram { background: rgba(228,64,95,0.1);    color: #f47ba0; border-color: rgba(228,64,95,0.25);  }

/* Category Badges */
.category-badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
}

/* Score Badge */
.score-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.score-badge .score-val { font-size: 0.85rem; font-weight: 700; color: #fbbf24; }

/* =============================================================================
   DATA ENRICHMENT BADGE CARDS
============================================================================= */
.enrich-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.enrich-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  min-width: 90px;
  flex: 1;
  transition: border-color 0.15s;
}
.enrich-card:hover { border-color: var(--text-faint); }
.enrich-card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.enrich-card-value { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.enrich-card.phone-card { border-color: rgba(99,102,241,0.2); background: var(--accent-light); flex-basis: 100%; }
.enrich-card-value.status-verified { color: var(--success); }
.enrich-card-value.status-failed   { color: var(--danger);  }
.enrich-card-value.status-pending  { color: var(--warning); }

/* =============================================================================
   B2B INTELLIGENCE BLOCKS
============================================================================= */
.b2b-intel-brief { font-size: 0.85rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 1rem; display: none; }
.b2b-intent-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-noura-light);
  border: 1px solid rgba(139,92,246,0.25);
  color: #c4b5fd;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

/* =============================================================================
   CHOICES.JS THEME OVERRIDES
============================================================================= */
.choices { margin-bottom: 0; }
.choices__inner {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.25rem 0.5rem !important;
  min-height: 38px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
}
.choices__inner:focus-within {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px var(--accent-light) !important;
}
.choices[data-type*="select-one"] .choices__inner { padding-bottom: 0.25rem !important; }
.choices__list--single { color: var(--text-primary) !important; padding: 2px 16px 2px 4px !important; }
.choices__list--multiple .choices__item {
  background-color: var(--accent-light) !important;
  border: 1px solid var(--border-accent) !important;
  color: var(--accent-primary) !important;
  border-radius: 4px !important;
  font-size: 0.78rem !important;
}
.choices__list--multiple .choices__item.is-highlighted {
  background-color: rgba(99,102,241,0.3) !important;
  border-color: var(--accent-hover) !important;
}
.choices__list--dropdown, .choices__list[aria-expanded] {
  background: var(--bg-overlay) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-xl) !important;
  z-index: 9999 !important;
}
.choices__list--dropdown .choices__item, .choices__list[aria-expanded] .choices__item {
  color: var(--text-primary) !important;
  font-size: 0.875rem !important;
  font-family: 'Inter', sans-serif !important;
  padding: 0.5rem 0.75rem !important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background-color: var(--accent-primary) !important;
  color: #fff !important;
}
.choices__list--dropdown .choices__item.is-selected,
.choices__list[aria-expanded] .choices__item.is-selected {
  color: var(--accent-primary) !important;
  font-weight: 600;
}
.choices__input {
  background: transparent !important;
  color: var(--text-primary) !important;
  font-size: 0.875rem !important;
  font-family: 'Inter', sans-serif !important;
  border: none !important;
  padding: 2px 4px !important;
}
.choices__input::placeholder { color: var(--text-muted) !important; }
.choices__placeholder { color: var(--text-muted) !important; opacity: 1 !important; }
.choices[data-type*="select-one"]::after { border-color: var(--text-muted) transparent transparent !important; }
.choices[data-type*="select-one"].is-open::after { border-color: transparent transparent var(--text-muted) !important; }
.choices__button {
  border-left: 1px solid var(--border-glass) !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='%23a1a1aa' d='M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z'/></svg>") !important;
  opacity: 0.5 !important;
}
.choices__button:hover { opacity: 0.9 !important; }
.choices__list--dropdown .choices__input {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

/* =============================================================================
   RANGE SLIDER
============================================================================= */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  height: 3px;
  border-radius: 2px;
  outline: none;
  border: none;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-light), var(--glow-accent);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
}

/* =============================================================================
   TOGGLE SWITCH
============================================================================= */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 23px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.25s;
  border-radius: 999px;
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: var(--text-muted);
  transition: all 0.25s;
  border-radius: 50%;
}
input:checked + .toggle-slider { background: var(--accent-light); border-color: var(--accent-primary); }
input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--accent-primary); }

/* =============================================================================
   SYNC CARD
============================================================================= */
.sync-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}
.sync-card:hover { border-color: var(--text-faint); }
.sync-card-info h4 { margin: 0 0 0.2rem; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.sync-card-info p  { margin: 0; font-size: 0.78rem; color: var(--text-secondary); }

/* =============================================================================
   NEW CAMPAIGN MODAL (Large)
============================================================================= */
.camp-modal {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}
.camp-modal > form { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

.camp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.camp-modal-title { display: flex; align-items: center; gap: 0.875rem; }
.camp-modal-icon {
  width: 36px; height: 36px;
  background: var(--accent-light);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}
.camp-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.camp-close-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }

.camp-modal-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; overflow: hidden; flex: 1; min-height: 0; }
.camp-col { padding: 1.5rem 1.75rem; overflow-y: auto; }
.camp-col-right { border-left: 1px solid var(--border-soft); background: rgba(255,255,255,0.01); }

.camp-section { margin-bottom: 1.5rem; }
.camp-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.camp-section-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent-glow);
}

.camp-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }

.leads-volume-row { display: flex; align-items: center; gap: 1rem; }
.leads-volume-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}
.leads-volume-count span { font-size: 1.2rem; font-weight: 700; color: var(--accent-primary); line-height: 1; letter-spacing: -0.04em; }
.leads-volume-count small { font-size: 0.58rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.leads-volume-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.35rem; padding: 0 0.1rem; }

.camp-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.camp-footer-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.camp-footer-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  box-shadow: 0 1px 0 var(--border);
  min-width: 22px;
  text-align: center;
  font-weight: 500;
}
.camp-footer-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.camp-launch-btn {
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
  font-weight: 600 !important;
}

/* Step Indicators */
.camp-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.camp-step-accent {
  background: var(--bg-elevated);
  border-color: var(--border);
  font-size: 0.72rem;
}

/* Engine Card — Icon + Text Layout */
.engine-content {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  background: var(--bg-elevated);
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}
.engine-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.engine-icon-noura {
  background: var(--accent-noura-light);
  color: var(--accent-noura);
  border: 1px solid rgba(139,92,246,0.2);
}
.engine-icon-hunter {
  background: var(--accent-hunter-light);
  color: var(--accent-hunter);
  border: 1px solid rgba(16,185,129,0.2);
}
.engine-text { min-width: 0; }
.engine-text h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.15rem 0 0.2rem;
  letter-spacing: -0.02em;
}
.engine-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}
.engine-card input[value="B2B_LIST"]:checked + .engine-content {
  border-color: var(--accent-noura);
  background: var(--accent-noura-light);
  box-shadow: 0 0 0 1px rgba(139,92,246,0.12), 0 0 16px rgba(139,92,246,0.06);
}
.engine-card input[value="B2B_LIST"]:checked + .engine-content .engine-icon-noura {
  background: rgba(139,92,246,0.2);
  border-color: rgba(139,92,246,0.35);
}
.engine-card input[value="LOCAL_MAPS"]:checked + .engine-content {
  border-color: var(--accent-hunter);
  background: var(--accent-hunter-light);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.12), 0 0 16px rgba(16,185,129,0.06);
}
.engine-card input[value="LOCAL_MAPS"]:checked + .engine-content .engine-icon-hunter {
  background: rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.35);
}

/* Volume Control — Premium Treatment */
.volume-control {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}
.volume-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}
.volume-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
  letter-spacing: -0.06em;
}
.volume-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 0.15rem;
}
.volume-slider-wrap {
  flex: 1;
  min-width: 0;
}
.volume-slider-wrap input[type="range"] {
  width: 100%;
}

/* =============================================================================
   ADMIN TABS — Multi-Tenant Navigation
============================================================================= */

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.admin-tab {
  display: flex;
  align-items: center;
  padding: 0.7rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
}
.admin-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}
.admin-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}
.admin-tab svg { opacity: 0.6; }
.admin-tab.active svg { opacity: 1; }
.admin-tab-panel.hidden { display: none; }

/* =============================================================================
   META AD INTELLIGENCE — Drawer Ad Gallery
============================================================================= */

.ad-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.ad-media-grid img {
  width: 100%;
  max-width: 150px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-transparent-2);
}

.ad-media-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 2;
}

.ad-active-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-weight: 600;
}

.ad-inactive-badge {
  background: var(--bg-transparent-5);
  color: var(--text-muted);
}

/* ── Ad Media Grid — Video support ──────────────────────────────────────── */

.ad-media-grid video {
  width: 100%;
  max-width: 150px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-transparent-2);
}

.ad-media-grid video:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 2;
}

.media-tile {
  position: relative;
  display: inline-block;
}

.media-type-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}

/* ── Media Lightbox ─────────────────────────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  cursor: default;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* =============================================================================
   PREMIUM POLISH
   (Hairline + ink direction: in-app ambient glows, grain, and gradients
   removed — borders and typography carry the hierarchy. The login page
   keeps a single accent glow as a brand moment.)
============================================================================= */

/* Login page — enhanced ambient glow */
.login-wrapper::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.2) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.login-wrapper > * { position: relative; z-index: 1; }

.login-card {
  background: var(--bg-surface);
  box-shadow:
    0 0 60px rgba(99,102,241,0.08),
    var(--shadow-xl);
}

/* Table rows — subtle zebra with micro-animation on hover */
.data-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.01);
}
.clickable-row {
  transition: background 0.12s ease, transform 0.12s ease;
}
.clickable-row:hover {
  background: rgba(99,102,241,0.04);
}

/* Campaign card — accent line on hover (solid, single-accent discipline) */
.camp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.camp-card:hover::before {
  opacity: 1;
}

/* Active nav link — left border accent */
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}
.nav-link { position: relative; }

/* Pulse dot — override to use accent for running state */
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52,211,153,0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52,211,153,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* Glass panel — improved for dark mode */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* Button primary — glow on hover animation */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-primary:hover::after {
  opacity: 1;
}

/* Scrollbar — app-wide styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Focus ring — consistent across all interactive elements */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 3px;
}
/* Don't double-ring native fields that already show a focus border */
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* =============================================================================
   COMMAND PALETTE (⌘K)
============================================================================= */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.cmdk-panel {
  width: 560px;
  max-width: 92vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
}
.cmdk-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
}
.cmdk-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}
.cmdk-results { overflow-y: auto; padding: 0.4rem; }
.cmdk-group-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0.5rem 0.6rem 0.25rem;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.cmdk-item .cmdk-icon { color: var(--text-muted); display: flex; flex: none; }
.cmdk-item .cmdk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .cmdk-meta { font-size: 0.72rem; color: var(--text-muted); flex: none; }
.cmdk-item.active, .cmdk-item:hover { background: var(--bg-active); color: var(--text-primary); }
.cmdk-item.active .cmdk-icon, .cmdk-item.active .cmdk-meta { color: var(--accent-primary); }
.cmdk-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.cmdk-hint { font-size: 0.72rem; color: var(--text-muted); }
.cmdk-kbd {
  font-size: 0.7rem;
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  color: var(--text-secondary);
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.32rem 0.6rem;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  transition: border-color 0.15s;
}
.topbar-search:hover { border-color: var(--border-strong); }
.topbar-search .cmdk-kbd { margin-left: 0.5rem; }
@media (max-width: 640px) { .topbar-search .ts-label, .topbar-search .cmdk-kbd { display: none; } }

/* Selection highlight */
::selection {
  background: rgba(99,102,241,0.25);
  color: var(--text-primary);
}

/* =============================================================================
   RESPONSIVE — Large (1024px–1279px)
============================================================================= */
@media (max-width: 1279px) and (min-width: 1024px) {
  #routerOutlet { padding: 1.5rem 1.75rem 2rem; }
  .camp-modal   { max-width: 95vw; }
}

/* =============================================================================
   RESPONSIVE — Tablet (768px–1023px)
============================================================================= */
@media (max-width: 1023px) and (min-width: 768px) {
  :root { --sidebar-w: 64px; }
  #appShell { --sidebar-w: 64px; } /* wins over .nav-collapsed too */
  .sidebar { padding: 1rem 0.5rem; align-items: center; overflow: hidden; }
  .logo span, .email-chip, .btn-logout, .credits-chip, .nav-section, .sidebar-toggle { display: none !important; }
  .logo { justify-content: center; padding-left: 0; margin-bottom: 1.5rem; }
  .nav-link { justify-content: center; padding: 0.75rem; width: 40px; height: 40px; gap: 0; border: none; }
  .nav-link.active { border: none; background: var(--bg-active); }
  .nav-link.active::before { display: none; } /* left-edge accent bar has no home on the icon rail */
  .nav-link svg { flex-shrink: 0; }
  .nav-label { display: none; }
  .user-area { padding: 0.75rem 0 0; display: flex; flex-direction: column; align-items: center; }
  #routerOutlet { padding: 1.25rem 1.5rem 2rem; }
  .grid-2, .camp-row-2 { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .camp-modal { max-width: 98vw; }
  .camp-modal-body { grid-template-columns: 1fr; }
  .camp-col-right { border-left: none; border-top: 1px solid var(--border); }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 680px; }
  .drawer { width: 600px; max-width: 92vw; }
}

/* =============================================================================
   RESPONSIVE — Mobile (<=767px)
============================================================================= */
@media (max-width: 767px) {
  :root { --sidebar-w: 0px; }
  #appShell { grid-template-columns: minmax(0, 1fr); } /* rail is a fixed bottom bar, out of grid flow */

  .sidebar {
    width: 100%;
    height: 60px;
    position: fixed;
    bottom: 0; top: auto; left: 0; right: 0;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--border-soft);
    background: var(--bg-surface);
    z-index: 200;
    overflow: hidden;
  }
  .logo, .nav-section, .sidebar-toggle { display: none; }
  nav { display: flex; flex-direction: row; width: 100%; align-items: stretch; }
  .nav-link {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.25rem;
    margin-bottom: 0;
    border-radius: 0;
    font-size: 0.6rem;
    flex: 1;
    height: 60px;
    white-space: nowrap;
    border: none;
  }
  .nav-link.active { background: var(--bg-active); border: none; }
  .nav-link.active::before { display: none; } /* desktop's left accent bar renders as a stray sliver in the tab bar */
  .nav-link .nav-label { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-link svg { flex-shrink: 0; }
  .nav-label { display: block; font-size: 0.57rem; line-height: 1.2; margin-top: 2px; }
  .user-area { display: none; }

  #routerOutlet { padding: 1rem 0.875rem 84px; } /* clear the 60px bottom tab bar */
  .top-bar { height: 48px; padding: 0 1rem; }
  .top-bar h1 { font-size: 0.9rem; }

  .grid-2, .camp-row-2, .engine-selector { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }

  .dashboard-controls { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .tab-strip { width: 100%; }
  .tab-btn   { flex: 1; font-size: 0.78rem; }

  .card { padding: 1rem; }
  .camp-card h4 { width: 72%; font-size: 0.9rem; }
  .card-actions { flex-wrap: wrap; }
  .card-actions .btn { font-size: 0.78rem; }

  .active-run-panel { padding: 1rem; }
  .terminal-feed    { height: 140px; font-size: 0.72rem; }
  .run-header       { flex-wrap: wrap; gap: 0.5rem; }

  .table-responsive { padding: 0 0.75rem 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-header     { padding: 1rem 0.75rem 0; flex-wrap: wrap; gap: 0.5rem; }
  .data-table       { min-width: 700px; }
  .data-table td    { padding: 0.7rem 0.75rem; }
  .data-table th    { padding: 0.6rem 0.75rem; }

  #resultsSectionView .table-header h3 { font-size: 0.9rem; }

  .modal { align-items: flex-end; padding: 0; }
  .modal-content { max-width: 100%; width: 100%; border-radius: 16px 16px 0 0; padding: 1.5rem 1.25rem; max-height: 92vh; overflow-y: auto; }
  .modal-actions { flex-direction: column-reverse; gap: 0.5rem; }
  .modal-actions .btn { width: 100%; }

  .camp-modal { max-width: 100%; max-height: 95vh; border-radius: 16px 16px 0 0; overflow: hidden; }
  .camp-modal-header { padding: 1rem 1.25rem; }
  .camp-modal-body  { grid-template-columns: 1fr !important; overflow-y: auto; }
  .camp-col         { padding: 1.25rem 1rem; }
  .camp-col-right   { border-left: none; border-top: 1px solid var(--border); }
  .camp-modal-footer { padding: 0.875rem 1.25rem; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .camp-modal-footer .btn { flex: 1; }
  .camp-footer-hint { flex-basis: 100%; } /* hint gets its own row; buttons share the next */

  .engine-selector { gap: 0.75rem; }
  .engine-content  { padding: 0.85rem; }

  .drawer { width: 96vw; max-width: 96vw; max-height: 85vh; border-radius: 16px 16px 0 0; top: auto; bottom: 0; left: 50%; transform: translate(-50%, 100%) scale(1); }
  .drawer.open { transform: translate(-50%, 0) scale(1); }
  .drawer-header { padding: 1rem 3.2rem 1rem 1.25rem; gap: 0.6rem; } /* right pad clears the absolute close btn */
  .drawer-header h2 { font-size: 1rem; }
  .drawer-avatar { width: 40px; height: 40px; font-size: 0.85rem; }
  /* Prev/next + "n/N" join the flex flow — absolute placement overlapped the name */
  .drawer-nav { position: static; flex: none; }
  .drawer-body { padding: 1rem 1.25rem; }

  .enrich-grid { gap: 0.4rem; }
  .enrich-card { min-width: 0; padding: 0.5rem 0.7rem; flex: 1 1 calc(50% - 0.4rem); }
  .enrich-grid .enrich-card:first-child { flex-basis: 100%; } /* email card needs the full row */

  /* Marketing header: connect buttons fill rows instead of ragged right-align */
  #mktPageHeader { flex-wrap: wrap; }
  #mktPageHeader > div:last-child { justify-content: flex-start; width: 100%; }
  #mktPageHeader > div:last-child .btn { flex: 1 1 auto; }

  #drawer-social-links { gap: 0.4rem; flex-wrap: wrap; }

  .toast-container { bottom: 68px; left: 0.75rem; right: 0.75rem; width: auto; }
  .toast { min-width: auto; width: 100%; }

  .btn { min-height: 40px; }
  #integrationCardsContainer { grid-template-columns: 1fr !important; }
  #adminUsersTable { min-width: 560px; }

  .login-card { padding: 2rem 1.25rem; max-width: 100%; border-radius: 0; min-height: 100vh; }

  .leads-table-panel { overflow: hidden; border-radius: 8px; }
  .leads-table-panel .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.5rem 1rem;
    background:
      linear-gradient(to right, var(--bg-glass) 30%, rgba(0,0,0,0)),
      linear-gradient(to left, var(--bg-glass) 30%, rgba(0,0,0,0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%;
    background-attachment: local, local;
  }
  .leads-table-panel .data-table { min-width: 900px; }

  #leadsFilterCampaign, #leadsFilterStatus, #leadsFilterFit { width: 100% !important; max-width: none !important; flex: none !important; }
}

/* =============================================================================
   RESPONSIVE — Very Small (<=380px)
============================================================================= */
@media (max-width: 380px) {
  .main-content { padding: 0.75rem 0.6rem; padding-bottom: 72px; }
  .top-bar h1   { font-size: 1rem; }
  .nav-link     { font-size: 0.55rem; }
  .data-table   { min-width: 600px; }
  .camp-card h4 { font-size: 0.85rem; }
}

/* =============================================================================
   ADVANCED FILTERS TOGGLE
============================================================================= */
.btn-toggle-advanced {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  text-align: center;
  transition: all 0.2s;
}
.btn-toggle-advanced:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.form-section-divider {
  margin: 1rem 0;
}

/* ── Marketing Suite (Growth Studio) ─────────────────────────────────────── */
.mkt-panel { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 1.25rem; overflow: hidden; }
.mkt-panel-head { width: 100%; display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; background: none; border: none; cursor: pointer; color: var(--text-primary); text-align: left; }
.mkt-panel-title { font-weight: 600; font-size: .95rem; }
.mkt-panel-sub { flex: 1; font-size: .8rem; }
.mkt-chevron { transition: transform .2s; color: var(--text-muted); }
.mkt-panel-head[aria-expanded="true"] .mkt-chevron { transform: rotate(180deg); }
.mkt-panel-body { padding: 0 1.25rem 1.25rem; }
.mkt-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: 1rem; }
.mkt-form-grid .mkt-span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .mkt-form-grid { grid-template-columns: 1fr; } }
.mkt-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.mkt-section-title { margin: .5rem 0 .9rem; }
.mkt-section-title h2 { font-size: 1.05rem; margin: 0; }

.mkt-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.mkt-campaign-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; transition: border-color .15s, transform .15s; }
.mkt-campaign-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.mkt-campaign-card h3 { font-size: .95rem; margin: 0; }
.mkt-campaign-meta { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .72rem; color: var(--text-muted); }
.mkt-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 600; background: var(--bg-elevated); border: 1px solid var(--border-color); color: var(--text-muted); }
.mkt-pill.draft { color: #b08900; border-color: #b0890055; }
.mkt-pill.live { color: #1a9d5a; border-color: #1a9d5a55; }
.mkt-campaign-card .btn { margin-top: .3rem; }

.mkt-checks { display: flex; gap: 1rem; flex-wrap: wrap; padding: .35rem 0; }
.mkt-checks label { display: flex; align-items: center; gap: .35rem; font-size: .85rem; cursor: pointer; }
.mkt-check { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: .85rem; margin-top: .35rem; cursor: pointer; }
.mkt-hint { font-size: .76rem; line-height: 1.5; margin: .2rem 0 .9rem; }

/* Creative Studio modal */
.mkt-studio { max-width: 920px; width: 92vw; }
.mkt-studio-body { display: grid; grid-template-columns: 360px 1fr; gap: 0; max-height: 78vh; }
@media (max-width: 800px) { .mkt-studio-body { grid-template-columns: 1fr; } }
.mkt-studio-controls { padding: 1.25rem; border-right: 1px solid var(--border-color); overflow-y: auto; }
.mkt-studio-results { padding: 1.25rem; overflow-y: auto; background: var(--bg-base); }
.mkt-empty { color: var(--text-muted); font-size: .85rem; text-align: center; padding: 2rem 1rem; border: 1px dashed var(--border-color); border-radius: var(--radius-lg); }
.mkt-variation { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; padding: .9rem; margin-bottom: .8rem; }
.mkt-variation .angle { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-primary); margin-bottom: .4rem; }
.mkt-variation p { margin: .25rem 0; font-size: .85rem; line-height: 1.5; }
.mkt-variation .label { color: var(--text-muted); font-size: .72rem; }
.mkt-asset-img { width: 100%; border-radius: 10px; border: 1px solid var(--border-color); margin-bottom: .6rem; }
.mkt-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-color); border-top-color: var(--accent-primary); border-radius: 50%; animation: mkt-spin .7s linear infinite; vertical-align: middle; }
@keyframes mkt-spin { to { transform: rotate(360deg); } }

/* Dashboard KPIs */
.mkt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.mkt-kpi { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; }
.mkt-kpi-val { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.mkt-kpi-label { font-size: .75rem; color: var(--text-muted); margin-top: .4rem; }

/* Workspace */
.mkt-ws-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.mkt-ws-head-text h2 { margin: 0; font-size: 1.2rem; }
.mkt-ws-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .mkt-ws-grid { grid-template-columns: 1fr; } }
.mkt-ws-controls { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.1rem; position: sticky; top: 1rem; }
.mkt-ws-output { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.mkt-subhead { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: .25rem 0 .6rem; }
.mkt-ws-controls .mkt-subhead:not(:first-child) { margin-top: 1rem; }

/* Tabs */
.mkt-tabs { display: flex; gap: .25rem; padding: .5rem .5rem 0; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.mkt-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: .6rem .8rem; font-size: .82rem; color: var(--text-muted); cursor: pointer; border-radius: 6px 6px 0 0; }
.mkt-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.mkt-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); font-weight: 600; }
.mkt-tab-panel { padding: 1.1rem; }
.mkt-panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; font-size: .82rem; color: var(--text-muted); }
.mkt-out { min-height: 120px; }

/* Rich results */
.mkt-var-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.mkt-score { background: var(--accent-primary); color: #fff; font-weight: 700; font-size: .72rem; border-radius: 999px; padding: .15rem .55rem; }
.mkt-strat-block { margin-bottom: 1.1rem; }
.mkt-strat-block h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-primary); margin: 0 0 .5rem; }
.mkt-strat-block ul { margin: 0; padding-left: 1.1rem; font-size: .85rem; line-height: 1.6; }
.mkt-mix-row { display: grid; grid-template-columns: 90px 60px 1fr; gap: .6rem; align-items: center; padding: .4rem 0; border-bottom: 1px dashed var(--border-color); font-size: .82rem; }
.mkt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.mkt-verdict { display: inline-block; font-weight: 700; font-size: .8rem; padding: .35rem .8rem; border-radius: 8px; margin-bottom: .9rem; }
.mkt-verdict-pass { background: #1a9d5a22; color: #1a9d5a; }
.mkt-verdict-warn { background: #b0890022; color: #b08900; }
.mkt-verdict-fail { background: #d33a3a22; color: #d33a3a; }
.mkt-autopilot-summary { background: var(--bg-surface); border: 1px solid var(--accent-primary); border-radius: var(--radius-lg); padding: .9rem 1.1rem; margin-bottom: 1.25rem; font-size: .88rem; line-height: 1.5; }

/* Guided step rail — turns the tabs into one connected, self-explaining flow */
.mkt-steprail-wrap { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .75rem 1rem; margin-bottom: 1.1rem; }
.mkt-steprail { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem; }
.mkt-step { display: inline-flex; align-items: center; gap: .45rem; background: none; border: none; cursor: pointer; padding: .3rem .55rem; border-radius: 8px; font-size: .82rem; color: var(--text-muted); transition: background .15s, color .15s; }
.mkt-step:hover { background: var(--bg-hover); color: var(--text-primary); }
.mkt-step-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: .74rem; font-weight: 700; border: 1.5px solid var(--border); background: var(--bg-elevated, var(--bg-surface)); color: var(--text-muted); flex: 0 0 auto; }
.mkt-step.done .mkt-step-dot { background: #1a8a4a; border-color: #1a8a4a; color: #fff; }
.mkt-step.done .mkt-step-label { color: var(--text-primary); }
.mkt-step.next .mkt-step-dot { background: var(--accent-primary, #5e6ad2); border-color: var(--accent-primary, #5e6ad2); color: #fff; box-shadow: 0 0 0 3px rgba(94,106,210,.18); }
.mkt-step.next .mkt-step-label { color: var(--text-primary); font-weight: 600; }
.mkt-step-sep { flex: 1 1 12px; min-width: 12px; max-width: 40px; height: 1.5px; background: var(--border); border-radius: 2px; }
.mkt-step-hint { margin-top: .55rem; font-size: .78rem; line-height: 1.45; }

/* --- Content & SEO Studio --- */
.mkt-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.mkt-ctab-panel { margin-top: .5rem; }
.mkt-chip { display: inline-block; background: var(--bg-surface); border: 1px solid var(--border-subtle, #ffffff22); border-radius: 999px; padding: .12rem .55rem; font-size: .72rem; margin: .1rem .15rem; }
.mkt-article { white-space: pre-wrap; max-height: 520px; overflow: auto; background: var(--bg-surface); border: 1px solid var(--border-subtle, #ffffff1a); border-radius: var(--radius-md, 8px); padding: .9rem 1rem; font-size: .84rem; line-height: 1.55; }
.mkt-lib-row { display: flex; align-items: center; gap: .55rem; padding: .5rem 0; border-bottom: 1px solid var(--border-subtle, #ffffff12); flex-wrap: wrap; }
.mkt-lib-row:last-child { border-bottom: 0; }
.mkt-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.mkt-table th, .mkt-table td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--border-subtle, #ffffff12); vertical-align: top; }
.mkt-table th { color: var(--text-muted); font-weight: 600; }

/* --- BrandKit auto-fill --- */
.mkt-autofill { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; padding: .75rem; background: var(--bg-surface); border: 1px dashed var(--border-subtle, #ffffff2a); border-radius: var(--radius-md, 8px); }
.mkt-autofill input { flex: 1 1 260px; }

/* --- Creative batch figures --- */
.mkt-asset-fig { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.mkt-asset-fig figcaption { text-transform: capitalize; }

/* --- CMO channel checkboxes --- */
.mkt-checks { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.mkt-checks label { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; }

/* --- Marketing sub-navigation --- */
.mkt-subnav { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1.25rem; border-bottom: 1px solid var(--border-subtle, #ffffff14); padding-bottom: .6rem; }
.mkt-subnav-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); border-radius: var(--radius-md, 8px); padding: .45rem .85rem; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.mkt-subnav-btn:hover { color: var(--text-primary, #fff); background: var(--bg-surface); }
.mkt-subnav-btn.active { color: var(--text-primary, #fff); background: var(--bg-surface); border-color: var(--accent-primary, #6c5ce7); }

/* ============================================================================
   MARKETING SUITE — PREMIUM REVAMP (2026-07-01)
   Scoped to .mkt-* + marketing containers. Refined to feel like Linear/Stripe/
   Vercel: one accent, crisp borders, tabular numerals, subtle depth, calm motion.
   ============================================================================ */
:root {
  --mkt-accent: var(--accent-primary);
  --mkt-accent-2: #8b5cf6;
  --mkt-grad: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
  --mkt-card: linear-gradient(180deg, rgba(255,255,255,0.024), rgba(255,255,255,0)) , var(--bg-surface);
  --mkt-radius: 14px;
  --mkt-radius-sm: 10px;
}

/* Page header / hero */
#mktPageHeader { align-items: flex-start; margin-bottom: 1.1rem; }
#mktPageHeader h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(90deg, var(--text-primary), #c9c6ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
#mktPageHeader p { color: var(--text-secondary); }

/* Sub-navigation → segmented control */
.mkt-subnav { display: inline-flex; gap: 2px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 0 0 1.4rem; overflow-x: auto; }
.mkt-subnav-btn { border: 0; background: transparent; color: var(--text-secondary); border-radius: 8px; padding: .5rem .9rem; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .16s, color .16s; }
.mkt-subnav-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.mkt-subnav-btn.active { color: #fff; background: var(--mkt-grad); box-shadow: 0 2px 10px rgba(99,102,241,.35); }

/* Panels / cards */
.mkt-panel { background: var(--mkt-card); border: 1px solid var(--border); border-radius: var(--mkt-radius); box-shadow: var(--shadow-sm); margin-bottom: 1.1rem; overflow: hidden; transition: border-color .18s; }
.mkt-panel:hover { border-color: var(--border-accent); }
.mkt-panel-head { width: 100%; display: flex; align-items: center; gap: .6rem; padding: 1rem 1.15rem; background: transparent; border: 0; cursor: pointer; text-align: left; }
.mkt-panel-title { font-weight: 650; font-size: .98rem; color: var(--text-primary); }
.mkt-panel-sub { color: var(--text-muted); font-size: .8rem; }
.mkt-panel-body { padding: 0 1.15rem 1.15rem; }
.mkt-chevron { margin-left: auto; color: var(--text-muted); transition: transform .2s; }
.mkt-panel-head[aria-expanded="true"] .mkt-chevron { transform: rotate(180deg); }
.mkt-panel-bar { display: flex; align-items: center; gap: .75rem; justify-content: space-between; flex-wrap: wrap; padding: .7rem 0 .9rem; color: var(--text-secondary); font-size: .85rem; }

/* KPI stat cards */
.mkt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.mkt-kpi { position: relative; background: var(--mkt-card); border: 1px solid var(--border); border-radius: var(--mkt-radius); padding: 1.05rem 1.1rem; overflow: hidden; transition: transform .16s, border-color .16s; }
.mkt-kpi::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 34px; height: 3px; background: var(--mkt-grad); border-radius: 0 0 4px 0; opacity: .9; }
.mkt-kpi:hover { transform: translateY(-2px); border-color: var(--border-accent); }
.mkt-kpi-val { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.mkt-kpi-label { margin-top: .2rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }

/* Section titles */
.mkt-section-title { display: flex; align-items: center; gap: .5rem; margin: 1.4rem 0 .8rem; }
.mkt-section-title h2 { font-size: 1.1rem; font-weight: 680; letter-spacing: -0.01em; }
.mkt-section-title h3 { font-weight: 650; color: var(--text-secondary); }

/* Buttons (scoped to marketing) */
#mktPageHeader .btn, .mkt-panel .btn, .mkt-ws-header .btn, .mkt-ws-grid .btn, #mktCampaignModal .btn, #mktMetaModal .btn, #mktConnectModal .btn, .mkt-autofill .btn {
  border-radius: 10px; font-weight: 600; transition: transform .14s, box-shadow .16s, background .16s, border-color .16s;
}
#mktPageHeader .btn-primary, .mkt-panel .btn-primary, .mkt-ws-header .btn-primary, .mkt-ws-grid .btn-primary, #mktCampaignModal .btn-primary, #mktMetaModal .btn-primary, #mktConnectModal .btn-primary, .mkt-autofill .btn-primary {
  background: var(--mkt-grad); border: 0; color: #fff; box-shadow: 0 2px 12px rgba(99,102,241,.28);
}
#mktPageHeader .btn-primary:hover, .mkt-panel .btn-primary:hover, .mkt-ws-header .btn-primary:hover, .mkt-autofill .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
#mktPageHeader .btn-secondary, .mkt-panel .btn-secondary, .mkt-ws-header .btn-secondary, .mkt-ws-grid .btn-secondary, #mktConnectModal .btn-secondary, .mkt-autofill .btn-secondary {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary);
}
#mktPageHeader .btn-secondary:hover, .mkt-panel .btn-secondary:hover, .mkt-ws-header .btn-secondary:hover, .mkt-autofill .btn-secondary:hover { color: var(--text-primary); border-color: var(--border-accent); background: var(--bg-hover); }

/* Inputs / selects / textareas (scoped) */
.mkt-panel input[type=text], .mkt-panel input[type=password], .mkt-panel input[type=date], .mkt-panel select, .mkt-panel textarea,
.mkt-autofill input, .mkt-autofill select, #mktCampaignModal input, #mktCampaignModal select, #mktMetaModal input, #mktConnectModal input, .mkt-ws-grid input, .mkt-ws-grid select, .mkt-ws-grid textarea {
  background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--mkt-radius-sm); color: var(--text-primary); padding: .58rem .7rem; font-size: .85rem; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.mkt-panel input:focus, .mkt-panel select:focus, .mkt-panel textarea:focus, .mkt-autofill input:focus, .mkt-ws-grid input:focus, .mkt-ws-grid textarea:focus, .mkt-ws-grid select:focus {
  outline: 0; border-color: var(--mkt-accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.mkt-panel label, .mkt-ws-grid label { font-size: .76rem; color: var(--text-secondary); font-weight: 600; }

/* Tabs (content studio + workspace) */
.mkt-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.mkt-tab { border: 0; background: transparent; color: var(--text-muted); padding: .6rem .85rem; font-size: .84rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.mkt-tab:hover { color: var(--text-secondary); }
.mkt-tab.active { color: var(--text-primary); border-bottom-color: var(--mkt-accent); }

/* Output panes / variation cards */
.mkt-out { font-size: .88rem; color: var(--text-secondary); line-height: 1.55; }
.mkt-variation { background: var(--mkt-card); border: 1px solid var(--border); border-radius: var(--mkt-radius); padding: 1rem 1.1rem; margin-bottom: .8rem; }
.mkt-variation .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mkt-accent); font-weight: 700; }
.mkt-variation ul { margin: .3rem 0 .3rem 1.1rem; }
.mkt-variation li { margin: .2rem 0; }

/* Empty / loading states */
.mkt-empty { border: 1px dashed var(--border); border-radius: var(--mkt-radius); padding: 1.6rem 1.2rem; text-align: center; color: var(--text-muted); font-size: .85rem; background: rgba(255,255,255,0.012); }

/* Chips + pills */
.mkt-chip { display: inline-flex; align-items: center; background: var(--accent-light); border: 1px solid var(--border-accent); color: #c9c6ff; border-radius: 999px; padding: .16rem .6rem; font-size: .72rem; font-weight: 600; margin: .12rem .12rem; }
.mkt-pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .22rem .65rem; font-size: .74rem; font-weight: 600; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); }
.mkt-pill.live { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); color: #6ee7b7; }
.mkt-pill.draft { background: var(--bg-elevated); color: var(--text-muted); }

/* Campaign cards */
.mkt-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.mkt-campaign-card { background: var(--mkt-card); border: 1px solid var(--border); border-radius: var(--mkt-radius); padding: 1.1rem; transition: transform .16s, border-color .16s, box-shadow .16s; }
.mkt-campaign-card:hover { transform: translateY(-2px); border-color: var(--border-accent); box-shadow: var(--shadow-md); }
.mkt-campaign-card h3 { font-size: 1rem; font-weight: 650; margin-bottom: .5rem; letter-spacing: -0.01em; }
.mkt-campaign-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--text-muted); font-size: .78rem; margin-bottom: .5rem; }

/* Tables */
.mkt-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.mkt-table th { text-align: left; padding: .5rem .7rem; color: var(--text-muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.mkt-table td { padding: .55rem .7rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; font-variant-numeric: tabular-nums; }
.mkt-table tbody tr:hover { background: var(--bg-hover); }

/* Article / long text */
.mkt-article { white-space: pre-wrap; max-height: 520px; overflow: auto; background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--mkt-radius-sm); padding: 1rem 1.1rem; font-size: .84rem; line-height: 1.6; color: var(--text-secondary); }

/* Library / list rows */
.mkt-lib-row { display: flex; align-items: center; gap: .55rem; padding: .6rem .2rem; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.mkt-lib-row:last-child { border-bottom: 0; }

/* Autofill / inline action rows */
.mkt-autofill { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .85rem; background: rgba(255,255,255,.018); border: 1px solid var(--border); border-radius: var(--mkt-radius); }
.mkt-autofill input { flex: 1 1 260px; }

/* Controls grids */
.mkt-controls, .mkt-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.mkt-span-2 { grid-column: 1 / -1; }
.mkt-checks { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; }
.mkt-checks label { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--text-secondary); }

/* Gallery / assets */
.mkt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .7rem; }
.mkt-asset-img { width: 100%; border-radius: var(--mkt-radius); border: 1px solid var(--border); display: block; }
.mkt-asset-fig { margin: 0; display: flex; flex-direction: column; gap: .3rem; }

/* Workspace */
.mkt-ws-header { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.mkt-ws-head-text h2 { font-size: 1.2rem; font-weight: 680; letter-spacing: -0.01em; }
.mkt-ws-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 860px) { .mkt-ws-grid { grid-template-columns: 1fr; } }
.mkt-autopilot-summary { background: var(--mkt-card); border: 1px solid var(--border-accent); border-radius: var(--mkt-radius); padding: 1rem 1.1rem; margin-bottom: 1.25rem; font-size: .88rem; line-height: 1.55; }

/* Verdict badges */
.mkt-verdict { display: inline-block; padding: .3rem .7rem; border-radius: 8px; font-weight: 700; font-size: .78rem; }
.mkt-verdict-pass { background: rgba(52,211,153,.14); color: #6ee7b7; }
.mkt-verdict-warn { background: rgba(251,191,36,.14); color: #fcd34d; }
.mkt-verdict-fail { background: rgba(248,113,113,.14); color: #fca5a5; }

/* Trends */
.mkt-trend svg rect { transition: opacity .15s; }
.mkt-trend svg rect:hover { opacity: .8; }

/* Spinner */
.mkt-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-accent); border-top-color: var(--mkt-accent); border-radius: 50%; animation: mkt-spin .7s linear infinite; vertical-align: -2px; }
@keyframes mkt-spin { to { transform: rotate(360deg); } }

/* ============================================================================
   MARKETING SUITE — LUX REBUILD (2026-07-01) — Linear/Vercel recipe
   Sidebar app-shell · flat near-black surfaces · hairline borders · soft depth ·
   lavender #5e6ad2 used sparingly · tight tracking · SVG icons (no emoji).
   Appended last so it wins the cascade.
   ============================================================================ */
:root {
  --mkt-accent: #5e6ad2;
  --mkt-accent-soft: rgba(94,106,210,.14);
  --mkt-accent-line: rgba(94,106,210,.32);
  --mkt-grad: linear-gradient(135deg, #5e6ad2, #7c6cf0);
  --mkt-card: var(--bg-surface);
  --mkt-hair: rgba(255,255,255,.07);
  --mkt-hair-soft: rgba(255,255,255,.045);
  --mkt-ink: #ededf2;
  --mkt-sub: #9a9aa6;
  --mkt-faint: #6a6a76;
  --mkt-shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}

/* App shell */
.mkt-shell { display: grid; grid-template-columns: 216px minmax(0,1fr); gap: 1.75rem; align-items: start; font-feature-settings: "cv11","ss01"; }
@media (max-width: 820px) { .mkt-shell { grid-template-columns: 1fr; gap: 1rem; } .mkt-sidebar { position: static !important; } }

.mkt-sidebar { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1.25rem; padding: .4rem .2rem; }
.mkt-brand { display: flex; align-items: center; gap: .6rem; font-weight: 640; font-size: .95rem; letter-spacing: -.01em; color: var(--mkt-ink); padding: .2rem .55rem; }
.mkt-brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--mkt-grad); box-shadow: 0 2px 10px rgba(94,106,210,.5); flex: none; }

.mkt-nav { display: flex; flex-direction: column; gap: 1px; }
.mkt-nav .mkt-subnav-btn { display: flex; align-items: center; gap: .65rem; width: 100%; justify-content: flex-start; background: transparent; border: 0; border-radius: 9px; padding: .55rem .6rem; font-size: .855rem; font-weight: 520; color: var(--mkt-sub); cursor: pointer; letter-spacing: -.005em; transition: background .14s, color .14s; }
.mkt-nav .mkt-subnav-btn svg { color: var(--mkt-faint); transition: color .14s; flex: none; }
.mkt-nav .mkt-subnav-btn:hover { background: var(--bg-hover); color: var(--mkt-ink); }
.mkt-nav .mkt-subnav-btn:hover svg { color: var(--mkt-sub); }
.mkt-nav .mkt-subnav-btn.active { background: var(--mkt-accent-soft); color: #c7ccff; box-shadow: none; }
.mkt-nav .mkt-subnav-btn.active svg { color: #a5adf5; }

/* Typography scope */
.mkt-main { min-width: 0; }
.mkt-main, .mkt-sidebar { font-family: 'Inter', -apple-system, system-ui, sans-serif; }
.mkt-main h1 { font-size: 1.5rem; font-weight: 620; letter-spacing: -.025em; color: var(--mkt-ink); -webkit-text-fill-color: currentColor; background: none; }
.mkt-main h2 { letter-spacing: -.02em; font-weight: 600; }
.mkt-main h3 { letter-spacing: -.015em; }
#mktPageHeader p { color: var(--mkt-sub); font-size: .9rem; }

/* Flatten surfaces — hairline + soft shadow, no gradient fills */
.mkt-panel, .mkt-kpi, .mkt-variation, .mkt-campaign-card, .mkt-autopilot-summary, .mkt-autofill {
  background: var(--bg-surface); border: 1px solid var(--mkt-hair); box-shadow: var(--mkt-shadow);
}
.mkt-panel { border-radius: 14px; }
.mkt-panel:hover { border-color: var(--mkt-hair); }
.mkt-empty { border: 1px dashed var(--mkt-hair); background: transparent; color: var(--mkt-faint); }

/* KPI cards — remove the corner bar, cleaner */
.mkt-kpi { border-radius: 13px; padding: 1.1rem 1.15rem; }
.mkt-kpi::before { display: none; }
.mkt-kpi-val { font-size: 1.7rem; font-weight: 640; letter-spacing: -.03em; color: var(--mkt-ink); }
.mkt-kpi-label { color: var(--mkt-faint); font-weight: 550; letter-spacing: .04em; }
.mkt-kpi:hover { transform: none; border-color: var(--mkt-accent-line); box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(94,106,210,.5); }

/* Campaign cards */
.mkt-campaign-card { border-radius: 13px; }
.mkt-campaign-card:hover { transform: translateY(-1px); border-color: var(--mkt-accent-line); box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(94,106,210,.45); }

/* Buttons — lavender primary, quiet ghost secondary */
#mktPageHeader .btn-primary, .mkt-panel .btn-primary, .mkt-ws-header .btn-primary, .mkt-autofill .btn-primary {
  background: var(--mkt-grad); box-shadow: 0 1px 2px rgba(0,0,0,.3); font-weight: 560;
}
#mktPageHeader .btn-primary:hover, .mkt-panel .btn-primary:hover, .mkt-ws-header .btn-primary:hover, .mkt-autofill .btn-primary:hover { box-shadow: 0 4px 16px -4px rgba(94,106,210,.6); }
#mktPageHeader .btn-secondary, .mkt-panel .btn-secondary, .mkt-ws-header .btn-secondary, .mkt-autofill .btn-secondary {
  background: var(--bg-surface); border: 1px solid var(--mkt-hair); color: var(--mkt-sub); font-weight: 520;
}
#mktPageHeader .btn-secondary:hover, .mkt-panel .btn-secondary:hover, .mkt-ws-header .btn-secondary:hover, .mkt-autofill .btn-secondary:hover { color: var(--mkt-ink); border-color: var(--mkt-accent-line); background: var(--bg-elevated); }

/* Sub-nav segmented (workspace tabs untouched); chips + tabs accent = lavender */
.mkt-variation .label { color: #a5adf5; }
.mkt-chip { background: var(--mkt-accent-soft); border-color: var(--mkt-accent-line); color: #c7ccff; }
.mkt-tab.active { border-bottom-color: var(--mkt-accent); color: var(--mkt-ink); }
.mkt-spinner { border-color: var(--mkt-accent-line); border-top-color: var(--mkt-accent); }

/* Inputs focus ring lavender */
.mkt-panel input:focus, .mkt-panel select:focus, .mkt-panel textarea:focus, .mkt-autofill input:focus, .mkt-ws-grid input:focus, .mkt-ws-grid textarea:focus, .mkt-ws-grid select:focus {
  border-color: var(--mkt-accent); box-shadow: 0 0 0 3px var(--mkt-accent-soft);
}

/* Page header sits inside main; give it breathing room + a hairline divider */
#mktPageHeader { padding-bottom: 1.1rem; border-bottom: 1px solid var(--mkt-hair-soft); }

/* --- Marketing lux: THEME-AWARE token fix (works in light + dark) --- */
:root {
  --mkt-ink:   var(--text-primary);
  --mkt-sub:   var(--text-secondary);
  --mkt-faint: var(--text-muted);
  --mkt-hair:      var(--border);
  --mkt-hair-soft: var(--border-soft, var(--border));
}
/* Accent-tinted text must read on BOTH themes → use the mid-tone lavender itself */
.mkt-variation .label, .mkt-chip, .mkt-nav .mkt-subnav-btn.active,
.mkt-nav .mkt-subnav-btn.active svg { color: var(--mkt-accent); }
.mkt-main h1, .mkt-brand { color: var(--text-primary); -webkit-text-fill-color: currentColor; }
/* Softer, theme-correct card depth (dark shadows look heavy on light) */
.mkt-panel, .mkt-kpi, .mkt-variation, .mkt-campaign-card, .mkt-autopilot-summary, .mkt-autofill { box-shadow: var(--shadow-sm); }

.mkt-dot { width:7px; height:7px; border-radius:50%; background:#34d399; box-shadow:0 0 6px rgba(52,211,153,.7); display:inline-block; margin-right:.4rem; }

/* --- Studio polish: advanced disclosure + variation copy --- */
.mkt-advanced { margin-top: .6rem; border-top: 1px solid var(--mkt-hair-soft); padding-top: .6rem; }
.mkt-advanced > summary { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--text-secondary); letter-spacing: .02em; list-style: none; padding: .3rem 0; }
.mkt-advanced > summary::-webkit-details-marker { display: none; }
.mkt-advanced > summary::before { content: "▸ "; color: var(--text-muted); }
.mkt-advanced[open] > summary::before { content: "▾ "; }
.mkt-var-copy { margin-top: .5rem; }
.mkt-var-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.mkt-var-head .angle { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--mkt-accent); }
.mkt-score { background: var(--mkt-accent-soft); color: var(--mkt-accent); border: 1px solid var(--mkt-accent-line); border-radius: 999px; padding: .1rem .5rem; font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mkt-strat-block { margin-bottom: 1rem; } .mkt-strat-block h4 { font-size: .82rem; color: var(--text-secondary); margin-bottom: .4rem; letter-spacing: -.01em; }
.mkt-mix-row { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--mkt-hair-soft); font-size: .82rem; }
.mkt-subhead { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin: 1rem 0 .5rem; }

.mkt-nav-badge { margin-left:auto; background:var(--mkt-accent); color:#fff; font-size:.66rem; font-weight:700; border-radius:999px; padding:.05rem .4rem; min-width:16px; text-align:center; }

/* --- AI CMO Observability Dashboard UI --- */
.mkt-obs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}
.mkt-obs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 8px);
  padding: .9rem 1.1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.mkt-obs-card-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: .4rem;
}
.mkt-obs-card-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.mkt-obs-card-sub {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

/* Decision Cards */
.mkt-decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
  margin-top: .8rem;
}
.mkt-decision-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--text-muted);
  border-radius: 6px;
  padding: .8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.mkt-decision-card.increase {
  border-left-color: #10b981; /* Green */
}
.mkt-decision-card.decrease {
  border-left-color: #f59e0b; /* Yellow */
}
.mkt-decision-card.pause {
  border-left-color: #ef4444; /* Red */
}
.mkt-decision-card.hold {
  border-left-color: #6b7280; /* Gray */
}
.mkt-decision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 600;
}
.mkt-decision-channel-badge {
  font-size: .64rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.mkt-decision-channel-badge.meta { background: rgba(24, 119, 242, 0.1); color: #1877f2; }
.mkt-decision-channel-badge.google { background: rgba(219, 68, 85, 0.1); color: #db4437; }
.mkt-decision-channel-badge.tiktok { background: rgba(0, 0, 0, 0.1); color: var(--text-primary); }
.mkt-decision-channel-badge.linkedin { background: rgba(0, 119, 181, 0.1); color: #0077b5; }
.mkt-decision-channel-badge.x { background: rgba(0, 0, 0, 0.1); color: var(--text-primary); }

.mkt-decision-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.mkt-decision-action {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
}
.mkt-decision-action.increase { color: #10b981; }
.mkt-decision-action.decrease { color: #f59e0b; }
.mkt-decision-action.pause { color: #ef4444; }
.mkt-decision-action.hold { color: #6b7280; }

.mkt-decision-reason {
  font-size: .78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Snapshot Section */
.mkt-section-header {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 1.2rem 0 .5rem;
}

/* =============================================================================
   MOBILE & TABLET RESPONSIVENESS ADJUSTMENTS (Gemini Responsive Revamp)
   ============================================================================= */

/* 1. Header Profile Dropdown (visible only on tablet & mobile) */
.header-profile {
  position: relative;
  display: inline-block;
}

.header-profile-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

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

.header-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-profile-menu.hidden {
  display: none;
}

.profile-menu-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-credits {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.profile-menu-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 0.15rem 0;
}

@media (min-width: 1024px) {
  .header-profile {
    display: none !important;
  }
}

/* 2. Responsive Filters & Collapsible Panel (width < 1024px) */
@media (max-width: 1023px) {
  .leads-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  /* Without min-width:0 the canvas inherits the table's 900px+ min-content,
     stretching the results header and pushing Filters/Export off-screen. */
  .leads-workspace > * { min-width: 0; max-width: 100%; }
  .filter-panel {
    display: none;
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    box-sizing: border-box;
    animation: filterSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .filter-panel.active {
    display: flex !important;
  }
  .filter-toggle-btn {
    display: inline-flex !important;
  }
  .filter-toggle-btn.active {
    background: var(--bg-active) !important;
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
  }
}

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

/* 3. Mobile Table Column Hiding & Edge Scroll Indicator */
.table-responsive, .leads-table-scroll, .leads-table-panel .table-responsive {
  position: relative;
  background: 
    linear-gradient(to right, var(--bg-surface) 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to left, var(--bg-surface) 30%, rgba(255, 255, 255, 0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 24px 100%, 24px 100%;
  background-attachment: local, local;
}

@media (max-width: 640px) {
  /* Hide non-critical columns on mobile leads table to keep it legible */
  .data-table th:nth-child(6), .data-table td:nth-child(6), /* Score */
  .data-table th:nth-child(8), .data-table td:nth-child(8), /* Outreach */
  .data-table th:nth-child(9), .data-table td:nth-child(9)  /* CRM */ {
    display: none !important;
  }
}

/* 4. Touch Targets & Safe Area Ergonomics */
@media (max-width: 767px) {
  input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea, button.btn {
    min-height: 42px;
  }
  .sidebar {
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom)) !important;
  }
  #routerOutlet {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }
  .modal-content, .camp-modal, .drawer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
  }
  
  /* Horizontal scroll for Step Rail instead of awkward wrapping */
  .mkt-steprail-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mkt-steprail {
    flex-wrap: nowrap !important;
    width: max-content;
    padding-bottom: 0.4rem;
  }
  
  /* Grid layouts columns */
  .mkt-kpis {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 480px) {
  .mkt-kpis {
    grid-template-columns: 1fr !important;
  }
  .mkt-subnav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .mkt-subnav-btn {
    flex: 0 0 auto;
  }
}


/* Search widenings shown above a campaign's results (WP-0.17, D20) */
.results-relaxations {
  background: var(--warning-bg);
  border: 1px solid var(--warning-bd);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
}
.results-relaxations ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.results-relaxations.hidden { display: none; }
