/* ==========================================================================
   LeadsGenius — Shared Global Stylesheet
   Tokens, navbar, forms, buttons, tables, modals, toasts, leads & map.
   Page-specific styles live in dashboard.css and scraper.css.
   ========================================================================== */

/* --- Design Tokens (Dark default) --- */
:root {
    /* The chevron every <select> draws, as one token.
       ---------------------------------------------------------------
       A native select arrow is drawn by the browser in its own colour and
       its own place: on this dark theme it came out as a dark triangle
       jammed against the right edge, and in a few places it sat on top of
       the text. Switching appearance off and painting the arrow ourselves
       is the only way to put it in the same spot on every control.
       Defined here so the page stylesheets (users, admin, seats) can use
       the same one instead of each inventing a chevron. The colour is
       baked into the SVG -- a CSS variable cannot be read inside url() --
       so there is a light-theme copy below. */
    --select-arrow: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --primary-color: #00d4ff;
    --secondary-color: #0096c7;
    /* The fill of every button, badge and active tab that carries text on the
       brand blue, in both themes. --primary-color is too bright to carry
       white (#00d4ff is 1.8:1 against it), so these used to put near-black
       text on it instead, or white text nobody could read. This gradient
       keeps white at 4.9:1 or better along its whole length (WCAG AA), and
       its hover at 5.9:1. Text on it is always --on-fill. */
    --fill-primary: linear-gradient(135deg, #0077b6 0%, #0369a1 100%);
    --fill-primary-hover: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    --on-fill: #ffffff;
    --accent-color: #4cc9f0;
    --success-color: #06d6a0;
    --error-color: #ff6b6b;
    --warning-color: #ffd93d;
    --info-color: #4cc9f0;
    --bg-main: #060b15;
    --bg-gradient: linear-gradient(135deg, #060b15 0%, #0b1120 50%, #0d1527 100%);
    --text-main: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;
    --nav-height: 72px;
    /* Side padding of every full-width page: 16px on a phone, growing with
       the screen, 48px at most. Pages use the whole width -- no max-width. */
    --page-gutter: clamp(16px, 2.2vw, 48px);
    /* Height of the site footer below the page content. leads.js measures
       the real element and overwrites this; the default keeps the
       viewport-locked Leads layout correct on first paint. */
    --page-footer-h: 59px;
    --nav-bg: rgba(13, 20, 36, 0.85);
    --nav-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 25, 45, 0.85);
    --glass-bg-card: rgba(13, 20, 36, 0.88);
    --glass-bg-hover: rgba(255, 255, 255, 0.05);
    --glass-input: rgba(255, 255, 255, 0.04);
    --glass-header: rgba(10, 25, 47, 0.88);
    --glass-table-th: rgba(8, 18, 36, 0.96);
    /* Same colour at full opacity. The header is sticky now, and at 96%
       the rows sliding underneath ghosted through it. */
    --table-head-solid: rgb(8, 18, 36);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(0, 212, 255, 0.4);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Inter was named here but never loaded -- only Plus Jakarta Sans and
       JetBrains Mono are fetched -- so every page has always rendered in the
       platform UI font. Naming that font keeps the rendering identical and
       stops the token promising a typeface the browser cannot see. */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                   'Helvetica Neue', Arial, sans-serif;
    --cyan-glow: #00e5ff;
    --cyan-glow-dim: rgba(0, 229, 255, 0.15);
    --accent-blue: #3b82f6;
}

/* --- Light Theme Token Overrides --- */
[data-theme="light"],
body.light-theme {
    --primary-color: #0284c7;
    --secondary-color: #0369a1;
    --accent-color: #0ea5e9;
    --success-color: #059669;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --bg-main: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    --text-main: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --nav-border: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-bg-card: rgba(255, 255, 255, 0.95);
    --glass-bg-hover: rgba(241, 245, 249, 0.9);
    --glass-input: #ffffff;
    --glass-header: rgba(255, 255, 255, 0.95);
    --glass-table-th: #f1f5f9;
    --table-head-solid: #f1f5f9;
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(2, 132, 199, 0.35);
    --glass-shadow: rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   🚀 LEADSGENIUS UNIFIED NAVBAR & GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

[data-theme="light"] {
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: rgba(0, 0, 0, 0.08);
}

/* Navbar Container */
.main-navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nav-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: none;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--page-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Brand Logo */
.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main, #ffffff);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-icon-box {
    width: 38px;
    height: 38px;
    flex: none;
    object-fit: contain;
    /* The logo carries its own shape and colour, so the gradient tile and the
       square glow that used to sit behind the FontAwesome bolt are gone.
       drop-shadow follows the mark's alpha; box-shadow would halo a rectangle. */
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.35));
}

.text-cyan {
    color: #00e5ff;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00e5ff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Helper utility */
.hidden {
    display: none !important;
}

.nav-pulse-dot.hidden {
    display: none !important;
}

/* Nav Links Menu */
.nav-links-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nav-border);
    padding: 4px;
    border-radius: 14px;
}

.nav-tab-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-tab-item i {
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.nav-tab-item:hover {
    color: var(--text-main, #ffffff);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab-item:hover i {
    transform: translateY(-1px);
}

/* Active Tab Highlight */
.nav-tab-item.active {
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.1);
    box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.15);
}

.nav-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00e5ff;
    box-shadow: 0 0 8px #00e5ff;
    animation: navPulse 1.5s infinite;
}

@keyframes navPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Right Nav Controls */
.nav-actions-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Live Status Pill */
.nav-status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--nav-border);
    transition: all 0.2s ease;
}

.nav-status-pill.idle {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted, #94a3b8);
}

.nav-status-pill.idle .status-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
}

.nav-status-pill.running {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
    color: #00e5ff;
}

.nav-status-pill.running .status-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00e5ff;
    box-shadow: 0 0 8px #00e5ff;
    animation: navPulse 1s infinite;
}

/* Nav Icon Buttons */
.btn-nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--nav-border);
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav-icon:hover {
    color: var(--text-main, #ffffff);
    background: rgba(255, 255, 255, 0.08);
}

/* User Profile Dropdown */
.nav-user-dropdown {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--nav-border);
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
    cursor: pointer;
    color: var(--text-main, #ffffff);
    transition: all 0.2s ease;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.user-role-tag {
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
    text-transform: capitalize;
}

.user-chevron {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
    transition: transform 0.2s ease;
}

.nav-user-dropdown.open .user-chevron {
    transform: rotate(180deg);
}

/* User Menu Dropdown */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: rgba(13, 20, 36, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--nav-border);
    border-radius: 14px;
    padding: 0.5rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 1010;
}

.nav-user-dropdown.open .user-dropdown-menu {
    display: flex;
    animation: fadeInSlide 0.2s ease;
}

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

.user-dropdown-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
}

.signed-in-label {
    color: var(--text-muted, #94a3b8);
}

.user-email-label {
    color: #ffffff;
    font-size: 0.85rem;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--nav-border);
    margin: 0.25rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.dropdown-item.text-danger:hover {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.1);
}

/* Light Theme Brand Logo & Nav Tabs Fix */
body.light-theme .nav-brand-logo,
[data-theme="light"] .nav-brand-logo {
    color: #0f172a !important;
}

body.light-theme .nav-tab-item,
[data-theme="light"] .nav-tab-item {
    color: #475569;
}

body.light-theme .nav-tab-item:hover,
[data-theme="light"] .nav-tab-item:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .nav-tab-item.active,
[data-theme="light"] .nav-tab-item.active {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.1);
    box-shadow: none;
}

body.light-theme .user-avatar-btn,
[data-theme="light"] .user-avatar-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

body.light-theme .user-dropdown-menu,
[data-theme="light"] .user-dropdown-menu {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

body.light-theme .user-email-label,
[data-theme="light"] .user-email-label {
    color: #0f172a;
}

body.light-theme .dropdown-item,
[data-theme="light"] .dropdown-item {
    color: #475569;
}

body.light-theme .dropdown-item:hover,
[data-theme="light"] .dropdown-item:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Light Theme Dashboard & Leads Cards */
body.light-theme .kpi-card,
body.light-theme .dash-card,
body.light-theme .filter-sidebar,
body.light-theme .table-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .dash-card,
[data-theme="light"] .filter-sidebar,
[data-theme="light"] .table-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .dash-table td,
body.light-theme .leads-data-table td,
[data-theme="light"] .dash-table td,
[data-theme="light"] .leads-data-table td {
    color: #334155;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .leads-data-table th,
[data-theme="light"] .leads-data-table th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .leads-data-table tbody tr:hover,
[data-theme="light"] .leads-data-table tbody tr:hover {
    background: rgba(2, 132, 199, 0.04);
}

body.light-theme .lead-dossier-drawer,
[data-theme="light"] .lead-dossier-drawer {
    background: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.15);
}

body.light-theme .dossier-biz-name,
body.light-theme .ai-owner-name,
body.light-theme .contact-item-left,
[data-theme="light"] .dossier-biz-name,
[data-theme="light"] .ai-owner-name,
[data-theme="light"] .contact-item-left {
    color: #0f172a;
}

body.light-theme .ai-summary-text,
[data-theme="light"] .ai-summary-text {
    color: #475569;
}

body.light-theme .dossier-contact-item,
[data-theme="light"] .dossier-contact-item {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .dossier-social-btn,
[data-theme="light"] .dossier-social-btn {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.08);
    color: #334155;
}

body.light-theme .dossier-social-btn:hover,
[data-theme="light"] .dossier-social-btn:hover {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border-color: #0284c7;
}

/* ==========================================================================
   ✨ EXECUTIVE ANALYTICS DASHBOARD - LIGHT THEME VIBE ENHANCEMENT
   ========================================================================== */

/* Luminous Ambient Background */
body.light-theme,
[data-theme="light"] {
    background: 
        radial-gradient(circle at 12% 18%, rgba(0, 180, 216, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 88% 75%, rgba(99, 102, 241, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 10%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        #f4f7fb !important;
}

/* 1. Frosted Porcelain Glass Cards */
body.light-theme .kpi-card,
body.light-theme .dash-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .dash-card {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 18px !important;
    box-shadow: 
        0 4px 6px -1px rgba(15, 23, 42, 0.04),
        0 12px 24px -4px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.light-theme .kpi-card:hover,
body.light-theme .dash-card:hover,
[data-theme="light"] .kpi-card:hover,
[data-theme="light"] .dash-card:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(2, 132, 199, 0.4) !important;
    box-shadow: 
        0 20px 32px -4px rgba(2, 132, 199, 0.12),
        0 4px 12px rgba(15, 23, 42, 0.04) !important;
}

/* 2. Top Header Polish */
body.light-theme .header-icon-box,
[data-theme="light"] .header-icon-box {
    background: rgba(2, 132, 199, 0.08) !important;
    border: 1px solid rgba(2, 132, 199, 0.2) !important;
    color: #0284c7 !important;
    box-shadow: 0 0 16px rgba(2, 132, 199, 0.15) !important;
}

body.light-theme .header-main-title,
[data-theme="light"] .header-main-title {
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.light-theme .header-subtitle,
[data-theme="light"] .header-subtitle {
    color: #64748b !important;
}

body.light-theme .btn-dash-action,
[data-theme="light"] .btn-dash-action {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .btn-dash-action:hover,
[data-theme="light"] .btn-dash-action:hover {
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    background: #f0f9ff !important;
}

body.light-theme .btn-dash-primary,
[data-theme="light"] .btn-dash-primary {
    background: var(--fill-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

body.light-theme .btn-dash-primary:hover,
[data-theme="light"] .btn-dash-primary:hover {
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5) !important;
}

/* 3. KPI Cards Detail & Icons */
body.light-theme .kpi-label,
[data-theme="light"] .kpi-label {
    color: #64748b !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
}

body.light-theme .kpi-main-value,
[data-theme="light"] .kpi-main-value {
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.light-theme .kpi-footer-note,
[data-theme="light"] .kpi-footer-note {
    color: #64748b !important;
}

/* KPI Badges */
body.light-theme .kpi-pill.success,
[data-theme="light"] .kpi-pill.success {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
}

body.light-theme .kpi-pill.info,
[data-theme="light"] .kpi-pill.info {
    background: #f5f3ff !important;
    color: #7c3aed !important;
    border: 1px solid #ddd6fe !important;
}

body.light-theme .kpi-pill.primary,
[data-theme="light"] .kpi-pill.primary {
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme .kpi-icon-badge.text-cyan { background: #e0f2fe !important; color: #0284c7 !important; }
body.light-theme .kpi-icon-badge.text-green { background: #dcfce7 !important; color: #16a34a !important; }
body.light-theme .kpi-icon-badge.text-purple { background: #f3e8ff !important; color: #9333ea !important; }
body.light-theme .kpi-icon-badge.text-blue { background: #eff6ff !important; color: #2563eb !important; }

/* 4. Pipeline Conversion Funnel in Light Mode */
body.light-theme .dash-card-title,
[data-theme="light"] .dash-card-title {
    color: #0f172a !important;
}

body.light-theme .dash-card-badge,
[data-theme="light"] .dash-card-badge {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

body.light-theme .funnel-step-header,
[data-theme="light"] .funnel-step-header {
    color: #475569 !important;
}

body.light-theme .funnel-step-header strong,
[data-theme="light"] .funnel-step-header strong {
    color: #0f172a !important;
    font-weight: 700 !important;
}

body.light-theme .funnel-bar-track,
[data-theme="light"] .funnel-bar-track {
    background: #e2e8f0 !important;
}

body.light-theme .funnel-bar-fill.stage-1 { background: linear-gradient(90deg, #0284c7, #38bdf8) !important; }
body.light-theme .funnel-bar-fill.stage-2 { background: linear-gradient(90deg, #4f46e5, #818cf8) !important; }
body.light-theme .funnel-bar-fill.stage-3 { background: linear-gradient(90deg, #7c3aed, #a78bfa) !important; }
body.light-theme .funnel-bar-fill.stage-4 { background: linear-gradient(90deg, #db2777, #f472b6) !important; }
body.light-theme .funnel-bar-fill.stage-5 { background: linear-gradient(90deg, #059669, #34d399) !important; box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important; }

/* 5. Top Cities Table in Light Mode (Fixed Missing #2 Miami Badge) */
body.light-theme .dash-table th,
[data-theme="light"] .dash-table th {
    color: #64748b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .dash-table td,
[data-theme="light"] .dash-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-weight: 500 !important;
}

body.light-theme .dash-table tr:hover td,
[data-theme="light"] .dash-table tr:hover td {
    background: #f8fafc !important;
}

body.light-theme .rank-badge,
[data-theme="light"] .rank-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

body.light-theme .rank-badge.top-1,
[data-theme="light"] .rank-badge.top-1 {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

body.light-theme .rank-badge.top-2,
[data-theme="light"] .rank-badge.top-2 {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme .rank-badge.top-3,
[data-theme="light"] .rank-badge.top-3 {
    background: #ffedd5 !important;
    color: #c2410c !important;
    border: 1px solid #fed7aa !important;
}

body.light-theme .btn-table-action,
[data-theme="light"] .btn-table-action {
    background: #f0f9ff !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
    font-weight: 600 !important;
}

body.light-theme .btn-table-action:hover,
[data-theme="light"] .btn-table-action:hover {
    background: var(--fill-primary) !important;
    color: #ffffff !important;
}

/* Mobile Hamburger */
.btn-hamburger {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--nav-border);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.btn-hamburger:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-hamburger.active {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.28);
}

.btn-hamburger i {
    font-size: 1.1rem;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.btn-hamburger.active i {
    transform: rotate(90deg) scale(1.05);
}

/* Light Theme Hamburger button */
body.light-theme .btn-hamburger,
[data-theme="light"] .btn-hamburger,
html[data-theme="light"] .btn-hamburger {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .btn-hamburger:hover,
body.light-theme .btn-hamburger.active,
[data-theme="light"] .btn-hamburger:hover,
[data-theme="light"] .btn-hamburger.active,
html[data-theme="light"] .btn-hamburger:hover,
html[data-theme="light"] .btn-hamburger.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.25);
}

@keyframes navMenuSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navItemSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-6px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 30%, rgba(0, 212, 255, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(0, 150, 199, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 50% 10%, rgba(76, 201, 240, 0.12) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

body.light-theme::before {
    opacity: 0.35;
}

.glass-effect {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 25, 41, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }

/* Top Navbar */
.navbar {
    background: var(--glass-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 66px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: none;
    margin: 0 auto;
    padding: 0 var(--page-gutter);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left { display: flex; align-items: center; gap: 36px; }

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--fill-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-fill);
    font-size: 1.05rem;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.6);
}

.nav-menu { display: flex; align-items: center; gap: 8px; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.08);
}

.nav-link.active {
    background: var(--fill-primary);
    color: var(--on-fill);
    font-weight: 700;
    box-shadow: 0 2px 14px rgba(0, 212, 255, 0.45);
}

.nav-right { display: flex; align-items: center; gap: 14px; }

.btn-icon-nav {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.btn-icon-nav:hover {
    color: var(--on-fill);
    background: var(--fill-primary);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.5);
}

/* User Badge Pill (Dynamic First Letter Logo) */
.user-pill-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    background: var(--glass-bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    user-select: none;
    transition: var(--transition);
}

.user-pill-simple:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: var(--fill-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--on-fill);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
    text-transform: uppercase;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border: 1px solid rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.08);
    border-radius: var(--radius-md);
    color: var(--error-color);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 107, 107, 0.22);
    border-color: var(--error-color);
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
}

/* Layout & Sidebar */
.leads-dashboard-container {
    max-width: none;
    margin: 0 auto;
    padding: var(--page-gutter);
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.filter-sidebar {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 90px;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

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

.sidebar-title { display: flex; align-items: center; gap: 10px; }
.filter-icon-glow {
    color: var(--primary-color);
    font-size: 1.15rem;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}
.sidebar-title h2 { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }

.btn-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}
.btn-clear-all:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.sidebar-form { display: flex; flex-direction: column; gap: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-color);
}
.filter-label i { color: var(--primary-color); font-size: 0.85rem; width: 14px; }

.custom-select-wrapper { position: relative; width: 100%; }

.custom-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 9px 32px 9px 12px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.custom-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

.custom-select option {
    background-color: #0b172a;
    color: #ffffff;
    padding: 8px;
}

.select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Social Media Filter Checkboxes */
.social-media-group { margin-top: 4px; gap: 8px; }
.filter-section-heading { font-size: 0.82rem; font-weight: 600; color: var(--accent-color); margin-bottom: 2px; }

.social-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
    transition: var(--transition);
}
.social-checkbox-item:hover { color: var(--text-primary); }
.social-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.social-icon-brand { font-size: 1rem; }
.brand-facebook { color: var(--brand-fb); }
.brand-linkedin { color: var(--brand-li); }
.brand-twitter { color: var(--brand-tw); }
.brand-instagram { color: var(--brand-ig); }

.btn-apply-filters {
    margin-top: 8px;
    width: 100%;
    padding: 11px 16px;
    background: var(--fill-primary);
    border-radius: var(--radius-md);
    color: var(--on-fill);
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(0, 212, 255, 0.45);
    transition: var(--transition);
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.65);
}

.advanced-filters-link-wrap { text-align: center; margin-top: 6px; }

.link-advanced-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: var(--transition);
}
.link-advanced-filters:hover { color: var(--primary-color); }

/* Main Dashboard Area */
.main-dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

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

.header-title-block { display: flex; align-items: center; gap: 14px; }

.title-accent-bar {
    width: 4px;
    height: 38px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: var(--radius-full);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.7);
}

.page-main-title { font-size: 1.45rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.page-subtitle { font-size: 0.88rem; color: var(--text-secondary); }

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

/* Clean Search Input Pill */
.search-input-pill {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--glass-bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    height: 40px;
    width: 290px;
    transition: var(--transition);
    cursor: text;
}

.search-input-pill:hover {
    border-color: var(--glass-border-hover);
}

.search-input-pill:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
    width: 320px;
}

.search-icon { color: var(--accent-color); font-size: 0.9rem; margin-right: 8px; flex-shrink: 0; }

.search-input-pill input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    width: 100%;
}
.search-input-pill input::placeholder { color: var(--text-secondary); }

/* Typing hint over the idle search box (leads.js initSearchTypingHint).
   Same size and colour as the placeholder it stands in for; only the caret
   carries the accent. pointer-events: none so a click still lands on the input. */
.search-typing-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    max-width: calc(100% - 44px);
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.88rem;
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.18s ease;
}
.search-typing-hint.is-hidden { opacity: 0; }
.search-typing-caret {
    flex-shrink: 0;
    width: 1.5px;
    height: 1.05em;
    margin-left: 2px;
    border-radius: 1px;
    background: var(--accent-color);
    animation: search-caret-blink 1s steps(1) infinite;
}
@keyframes search-caret-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .search-typing-caret { animation: none; }
}

/* What a plain-English search was read as, under the page title. */
.smart-search-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--accent-color);
}
.smart-search-summary[hidden] { display: none; }
.smart-search-summary .smart-search-missed { color: var(--text-secondary); }
.smart-search-summary span + .smart-search-missed::before { content: "\00b7"; margin-right: 6px; }

.btn-clear-search {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    margin-left: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-clear-search:hover { color: var(--error-color); }

.btn-action-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 40px;
    background: var(--glass-bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-action-outline:hover {
    background: var(--glass-bg-hover);
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
}

.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 40px;
    background: var(--fill-primary);
    border-radius: var(--radius-md);
    color: var(--on-fill);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.4);
    transition: var(--transition);
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 212, 255, 0.6);
}

/* ==========================================================================
   ✨ Leads Tab: Perfectly Aligned & Responsive Stat Cards
   ========================================================================== */
.stats-overview-grid {
    display: grid;
    /* auto-fit, not a fixed count: the cards divide the row evenly at any width
       and reflow on their own instead of relying on three breakpoints to catch
       up. Empty repeated tracks collapse to 0 along with their gap, so the row
       is always filled edge to edge whatever the card count. */
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    /* Grid stretches items within a row but sizes each row to its own content,
       so once the cards wrap the second row could sit taller than the first --
       "Your Allowance" carries a subtext the others do not. This keeps every
       row the same height, so the cards stay a set at any width. */
    grid-auto-rows: 1fr;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.stat-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 8px 24px var(--glass-shadow);
    transition: var(--transition);
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.stat-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 212, 255, 0.15);
}

.stat-info { 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
    min-width: 0;
    flex: 1;
}

.stat-label { 
    font-size: 0.74rem; 
    color: var(--text-secondary); 
    font-weight: 600; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-metric-row { 
    display: flex; 
    align-items: baseline; 
    gap: 5px; 
    flex-wrap: nowrap;
    min-width: 0;
}

.stat-value {
    font-size: 1.38rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.stat-trend-badge { 
    font-size: 0.7rem; 
    font-weight: 700; 
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-positive { color: var(--success-color); }
.stat-subtext { font-size: 0.74rem; color: var(--accent-color); font-weight: 600; }

.stat-icon-wrapper {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.icon-blue { background: rgba(0, 212, 255, 0.15); color: var(--primary-color); box-shadow: 0 0 8px rgba(0, 212, 255, 0.2); }
.icon-cyan { background: rgba(76, 201, 240, 0.15); color: var(--accent-color); box-shadow: 0 0 8px rgba(76, 201, 240, 0.2); }
.icon-amber { background: rgba(255, 217, 61, 0.15); color: var(--warning-color); box-shadow: 0 0 8px rgba(255, 217, 61, 0.2); }
.icon-teal { background: rgba(6, 214, 160, 0.15); color: var(--success-color); box-shadow: 0 0 8px rgba(6, 214, 160, 0.2); }
.icon-purple { background: rgba(0, 150, 199, 0.15); color: var(--secondary-color); box-shadow: 0 0 8px rgba(0, 150, 199, 0.2); }
/* Active Filters */
.active-filters-panel {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 4px 18px var(--glass-shadow);
}

.active-filters-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.active-filter-title { display: flex; align-items: center; gap: 6px; color: var(--primary-color); font-size: 0.84rem; font-weight: 700; }
.active-chips-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.filter-chip strong { color: var(--primary-color); font-weight: 700; }

.chip-remove {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.chip-remove:hover { color: var(--error-color); transform: scale(1.2); }

.btn-clear-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}
.btn-clear-inline:hover { color: var(--error-color); }

/* Leads Data Table (Natural vertical height, horizontal scroll only) */
.table-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.leads-table-responsive {
    width: 100%;
    overflow-x: auto;        /* Smooth horizontal scroll only */
    -webkit-overflow-scrolling: touch;
}

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

.leads-data-table th {
    background: var(--glass-table-th);
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 13px 14px;
    border-bottom: 2px solid var(--glass-border);
    user-select: none;
}

.leads-data-table th[data-sort] { cursor: pointer; }
.leads-data-table th[data-sort]:hover { color: var(--text-primary); }

.sort-icon { font-size: 0.65rem; margin-left: 4px; color: var(--primary-color); }

.leads-data-table td {
    padding: 13px 14px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    vertical-align: middle;
}

.leads-data-table tbody tr { transition: var(--transition); }
.leads-data-table tbody tr:hover { background: var(--glass-bg-hover); }

.cell-email { color: var(--text-primary); max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 0.82rem; }
.cell-business { color: var(--text-primary); font-weight: 600; }

.cell-phone { color: var(--text-secondary); }

.cell-rating { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--text-primary); }
.star-gold { color: var(--warning-color); font-size: 0.85rem; filter: drop-shadow(0 0 4px rgba(255, 217, 61, 0.4)); }
.star-dim { color: var(--text-dim); font-size: 0.85rem; }

.social-icons-cell { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.social-icons-cell a { color: var(--text-secondary); transition: var(--transition); }
.social-icons-cell a:hover { transform: scale(1.25); }
.social-icons-cell a.fb:hover { color: var(--brand-fb); }
.social-icons-cell a.li:hover { color: var(--brand-li); }
.social-icons-cell a.tw:hover { color: var(--brand-tw); }
.social-icons-cell a.ig:hover { color: var(--brand-ig); }

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
}

/* Same badge, positioned between the address and the Copy button in the
   dossier's contact rows. */
.contact-status-badge {
    margin-left: auto;
    margin-right: 8px;
    flex: none;
}

.status-verified,
.status-valid,
.status-deliverable {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.18);
}

.status-safe {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.45);
    color: #00d4ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.18);
}

.status-invalid,
.status-undeliverable {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.45);
    color: var(--error-color, #ff6b6b);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.18);
}

.status-catch_all,
.status-catch-all {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.18);
}

.status-role_account,
.status-role-account {
    background: rgba(255, 217, 61, 0.15);
    border: 1px solid rgba(255, 217, 61, 0.45);
    color: var(--warning-color, #ffd93d);
    box-shadow: 0 0 8px rgba(255, 217, 61, 0.18);
}

.status-web {
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.45);
    color: #14b8a6;
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.18);
}

.status-risky,
.status-disposable {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #c084fc;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.18);
}

.status-unknown,
.status-pending {
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: var(--text-secondary, #94a3b8);
}

.status-disabled {
    background: rgba(168, 162, 158, 0.16);
    border: 1px solid rgba(168, 162, 158, 0.45);
    color: #d6d3d1;
    box-shadow: 0 0 8px rgba(168, 162, 158, 0.16);
}

.status-inbox_full,
.status-inbox-full {
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.45);
    color: #a5b4fc;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.18);
}

.status-spamtrap,
.status-spam_trap {
    background: rgba(244, 63, 94, 0.16);
    border: 1px solid rgba(244, 63, 94, 0.5);
    color: #fb7185;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.22);
}

/* Light Mode Status Badges */
body.light-theme .status-verified,
body.light-theme .status-valid,
body.light-theme .status-deliverable,
[data-theme="light"] .status-verified,
[data-theme="light"] .status-valid,
[data-theme="light"] .status-deliverable {
    background: #ecfdf5 !important;
    border: 1px solid #6ee7b7 !important;
    color: #047857 !important;
    box-shadow: none !important;
}

body.light-theme .status-safe,
[data-theme="light"] .status-safe {
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
    color: #0369a1 !important;
    box-shadow: none !important;
}

body.light-theme .status-invalid,
body.light-theme .status-undeliverable,
[data-theme="light"] .status-invalid,
[data-theme="light"] .status-undeliverable {
    background: #fef2f2 !important;
    border: 1px solid #fca5a5 !important;
    color: #b91c1c !important;
    box-shadow: none !important;
}

body.light-theme .status-catch_all,
body.light-theme .status-catch-all,
[data-theme="light"] .status-catch_all,
[data-theme="light"] .status-catch-all {
    background: #fff7ed !important;
    border: 1px solid #fdba74 !important;
    color: #c2410c !important;
    box-shadow: none !important;
}

body.light-theme .status-role_account,
body.light-theme .status-role-account,
[data-theme="light"] .status-role_account,
[data-theme="light"] .status-role-account {
    background: #fefce8 !important;
    border: 1px solid #fde047 !important;
    color: #a16207 !important;
    box-shadow: none !important;
}

body.light-theme .status-web,
[data-theme="light"] .status-web {
    background: #f0fdfa !important;
    border: 1px solid #99f6e4 !important;
    color: #0f766e !important;
    box-shadow: none !important;
}

body.light-theme .status-risky,
body.light-theme .status-disposable,
[data-theme="light"] .status-risky,
[data-theme="light"] .status-disposable {
    background: #faf5ff !important;
    border: 1px solid #d8b4fe !important;
    color: #7e22ce !important;
    box-shadow: none !important;
}

body.light-theme .status-unknown,
body.light-theme .status-pending,
[data-theme="light"] .status-unknown,
[data-theme="light"] .status-pending {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: none !important;
}

body.light-theme .status-disabled,
[data-theme="light"] .status-disabled {
    background: #f5f5f4 !important;
    border: 1px solid #d6d3d1 !important;
    color: #57534e !important;
    box-shadow: none !important;
}

body.light-theme .status-inbox_full,
body.light-theme .status-inbox-full,
[data-theme="light"] .status-inbox_full,
[data-theme="light"] .status-inbox-full {
    background: #eef2ff !important;
    border: 1px solid #c7d2fe !important;
    color: #4338ca !important;
    box-shadow: none !important;
}

body.light-theme .status-spamtrap,
body.light-theme .status-spam_trap,
[data-theme="light"] .status-spamtrap,
[data-theme="light"] .status-spam_trap {
    background: #fff1f2 !important;
    border: 1px solid #fda4af !important;
    color: #be123c !important;
    box-shadow: none !important;
}

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: rgba(6, 214, 160, 0.18);
    border: 1px solid rgba(6, 214, 160, 0.45);
    border-radius: var(--radius-full);
    color: var(--success-color);
    font-size: 0.74rem;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(6, 214, 160, 0.25);
}

/* Pagination & Redesigned Rows Per Page Bar */
.table-footer-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 4px 4px;
    flex-wrap: wrap;
}

.pagination-summary { font-size: 0.85rem; color: var(--text-secondary); }
.pagination-controls { display: flex; align-items: center; gap: 6px; }

.btn-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    /* background: var(--glass-bg-card);
    border: 1px solid var(--glass-border); */
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition);
}

.btn-pagination:hover:not(:disabled) {
    /* background: var(--glass-bg-hover); */
    color: var(--primary-color);
    /* border-color: var(--primary-color); */
    /* box-shadow: 0 0 8px rgba(0, 212, 255, 0.25); */
    font-size: 1rem;
    font-weight: 800;
}

.btn-pagination:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination-page-numbers { display: flex; align-items: center; gap: 5px; }

.page-num-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--glass-bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-num-btn:hover:not(.active) {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.page-num-btn.active {
    background: var(--fill-primary);
    color: var(--on-fill);
    border: none;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.5);
}

/* Redesigned Rows Per Page Unified Bar */
.rows-per-page-container {
    display: flex;
    align-items: center;
}

.rows-select-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--glass-bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0 12px;
    height: 38px;
    transition: var(--transition);
}

.rows-select-box:hover {
    border-color: var(--glass-border-hover);
}

.rows-select-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

.rows-icon {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-right: 8px;
    pointer-events: none;
}

.rows-select-input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    padding-right: 20px;
    cursor: pointer;
}

.rows-select-input option {
    background-color: #0b172a;
    color: #ffffff;
    padding: 8px;
}

.rows-chevron {
    position: absolute;
    right: 10px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Modals */
.custom-modal, .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.custom-modal.active, .modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 12, 24, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-dialog, .modal-content {
    position: relative;
    width: 90%;
    max-width: 520px;
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2, .modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.modal-header i { color: var(--primary-color); }

.modal-close-btn, .close-modal {
    font-size: 1.3rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.modal-close-btn:hover, .close-modal:hover { color: var(--text-primary); transform: scale(1.1); }

.modal-body { padding: 20px; }
.modal-desc, .modal-description { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 16px; }

.columns-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.column-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.column-toggle-label:hover { color: var(--text-primary); }
.column-toggle-label input { accent-color: var(--primary-color); cursor: pointer; }

.btn-modal-secondary, .btn-secondary {
    padding: 8px 16px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-modal-secondary:hover, .btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-modal-primary, .btn-add {
    padding: 8px 20px;
    background: var(--fill-primary);
    border-radius: var(--radius-md);
    color: var(--on-fill);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
    transition: var(--transition);
}
.btn-modal-primary:hover, .btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.6);
}

/* Invalid Emails */
.page-container-single {
    max-width: none;
    margin: 0 auto;
    padding: 24px var(--page-gutter);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.header-title h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.header-title h1 i { color: var(--primary-color); }
.header-title p { color: var(--text-secondary); font-size: 0.88rem; }
.header-title #emailCount { color: var(--primary-color); font-weight: 700; }

.emails-container {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    transition: var(--transition);
}
.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
}
.search-box i { color: var(--accent-color); font-size: 1rem; }
.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }
/* ==========================================================================
   Invalid Emails List (Dark & Light Theme Adaptive)
   ========================================================================== */
.emails-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 6px;
}

.emails-list::-webkit-scrollbar { width: 6px; }
.emails-list::-webkit-scrollbar-track { background: transparent; }
.emails-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.25);
    border-radius: 4px;
}
.emails-list::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

body.light-theme .emails-list::-webkit-scrollbar-thumb {
    background: rgba(2, 132, 199, 0.25);
}

.email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    background: var(--glass-input);       /* Pure white in light mode, sleek dark glass in dark mode */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px var(--glass-shadow);
    transition: var(--transition);
}

.email-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.15);
}

body.light-theme .email-item:hover {
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
}

.email-text {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 500;
}

.email-text i {
    color: var(--primary-color);
    font-size: 1rem;
    filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.3));
}

body.light-theme .email-text i {
    filter: none;
}

.btn-delete {
    padding: 7px 12px;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: var(--error-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.5);
    transform: scale(1.08);
}

body.light-theme .btn-delete {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.25);
}

body.light-theme .btn-delete:hover {
    background: var(--error-color);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

.modal-body textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}
.modal-body textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
}

/* ==========================================================================
   Modal Forms (Add User Modal & High-Contrast Inputs)
   ========================================================================== */
.modal-body { 
    padding: 24px; 
}

.modal-desc, .modal-description { 
    font-size: 0.88rem; 
    color: var(--text-secondary); 
    margin-bottom: 18px; 
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body select {
    width: 100%;
    padding: 11px 14px;
    background: var(--glass-input);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

/* Bright Mode Crisp Form Inputs */
body.light-theme .form-group input,
body.light-theme .form-group select,
body.light-theme .modal-body input[type="text"],
body.light-theme .modal-body input[type="password"],
body.light-theme .modal-body select {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-group input:focus,
.form-group select:focus,
.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus,
body.light-theme .modal-body input[type="text"]:focus,
body.light-theme .modal-body input[type="password"]:focus,
body.light-theme .modal-body select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.badge-role-admin,
.role-badge.super-admin,
.badge-role-super_admin,
.role-super_admin,
.badge-super-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    border-radius: var(--radius-full, 999px);
    font-size: 0.76rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    border: none;
    letter-spacing: 0.02em;
}
.badge-role-user,
.role-badge.user,
.badge-user,
.role-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    border-radius: var(--radius-full, 999px);
    font-size: 0.76rem;
    font-weight: 700;
    background: var(--fill-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    border: none;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   Seamless Modal Footer & Action Buttons
   ========================================================================== */
.modal-footer,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    padding-bottom: 4px;
    border-top: 1px solid var(--glass-border);
    background: transparent !important; /* Seamlessly blends with the modal card */
}

/* The footer had no horizontal padding, so the primary button -- Download CSV,
   Send to ERPNext, Create -- sat 1px from the dialog's right edge while the
   body above it was inset 24px. Applied to .modal-footer only: .form-actions
   is used inside forms that already provide their own padding. */
.modal-footer {
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 20px;
}

body.light-theme .modal-footer,
body.light-theme .form-actions {
    border-top: 1px solid #e2e8f0;
    background: transparent !important;
}

/* Polished Cancel / Secondary Button */
.btn-modal-secondary,
.btn-secondary,
.btn-cancel,
.modal-footer button:not(.btn-modal-primary):not(.btn-add):not([type="submit"]),
.modal-body button:not(.btn-modal-primary):not(.btn-add):not([type="submit"]) {
    padding: 9px 20px;
    background: var(--glass-input);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .btn-modal-secondary,
body.light-theme .btn-secondary,
body.light-theme .btn-cancel,
body.light-theme .modal-footer button:not(.btn-modal-primary):not(.btn-add):not([type="submit"]),
body.light-theme .modal-body button:not(.btn-modal-primary):not(.btn-add):not([type="submit"]) {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}

body.light-theme .btn-modal-secondary:hover,
body.light-theme .btn-secondary:hover,
body.light-theme .btn-cancel:hover,
body.light-theme .modal-footer button:not(.btn-modal-primary):not(.btn-add):not([type="submit"]):hover,
body.light-theme .modal-body button:not(.btn-modal-primary):not(.btn-add):not([type="submit"]):hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

/* Polished Primary Submit Button */
.btn-modal-primary,
.btn-add,
.modal-footer button[type="submit"],
.modal-body button[type="submit"] {
    padding: 9px 22px;
    background: var(--fill-primary);
    border-radius: var(--radius-md);
    color: var(--on-fill);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
    transition: var(--transition);
}

body.light-theme .btn-modal-primary:hover,
body.light-theme .btn-add:hover,
body.light-theme .modal-footer button[type="submit"]:hover,
body.light-theme .modal-body button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(2, 132, 199, 0.55);
}

.btn-modal-secondary, .btn-secondary {
    padding: 9px 18px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .btn-modal-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.btn-modal-secondary:hover, .btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

body.light-theme .btn-modal-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.btn-modal-primary, .btn-add {
    padding: 9px 22px;
    background: var(--fill-primary);
    border-radius: var(--radius-md);
    color: var(--on-fill);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
    transition: var(--transition);
}

body.light-theme .btn-modal-primary {
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

body.light-theme .btn-modal-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.55);
}

/* ==========================================================================
   Users Management Table & Container (Dark & Bright Theme)
   ========================================================================== */
.users-table-container,
.users-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: 0 8px 32px var(--glass-shadow);
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.users-table thead th {
    padding: 14px 16px;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--glass-border);
    white-space: nowrap;
}

body.light-theme .users-table thead th {
    color: var(--primary-color);
    border-bottom: 2px solid rgba(2, 132, 199, 0.25);
}

.users-table tbody td {
    padding: 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    vertical-align: middle;
}

body.light-theme .users-table tbody td {
    border-bottom: 1px solid rgba(2, 132, 199, 0.12);
    color: #475569;
}

.users-table tbody tr {
    transition: background 0.2s ease;
}

.users-table tbody tr:hover {
    background: var(--glass-bg-hover);
}

body.light-theme .users-table tbody tr:hover {
    background: rgba(2, 132, 199, 0.04);
}

.users-table .user-name {
    font-weight: 700;
    color: var(--text-primary);
}

/* Action Button */
.btn-deactivate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full, 999px);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-deactivate:hover {
    background: var(--fill-primary);
    color: var(--on-fill);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.35);
}

.no-data, .table-empty-state {
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.no-data i, .empty-icon-circle {
    font-size: 2.6rem;
    color: var(--accent-color);
    opacity: 0.5;
}
.no-data p, .table-empty-state p { color: var(--text-secondary); font-size: 0.95rem; }

/* ==========================================================================
   ✨ Flash & Toast Notifications (Dark & Light Mode with Accent Edges)
   ========================================================================== */
@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(130%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}

.flash-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 48px);
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(13, 20, 36, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    
    /* Entry Animation */
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Transition for Smooth Exit */
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

/* 🚀 Unlocks animation and smoothly glides to the right */
.flash-message.dismissing {
    animation: none !important;
    transform: translateX(130%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.flash-message i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* 🟢 Success Alert (Dark Mode) */
.flash-message.flash-success {
    border-left: 5px solid #10b981 !important;
}
.flash-message.flash-success i {
    color: #10b981;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

/* 🔴 Error Alert (Dark Mode) */
.flash-message.flash-error,
.flash-message.flash-danger {
    border-left: 5px solid #ef4444 !important;
}
.flash-message.flash-error i,
.flash-message.flash-danger i {
    color: #ef4444;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

/* 🟠 Warning Alert (Dark Mode) */
.flash-message.flash-warning {
    border-left: 5px solid #f59e0b !important;
}
.flash-message.flash-warning i {
    color: #f59e0b;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

/* 🔵 Info Alert (Dark Mode) */
.flash-message.flash-info {
    border-left: 5px solid #00e5ff !important;
}
.flash-message.flash-info i {
    color: #00e5ff;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}

.flash-text {
    flex: 1;
    word-break: break-word;
}

/* Close Button with Click Area */
.close-flash {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer !important;
    pointer-events: auto !important;
    padding: 4px 8px;
    margin-left: auto;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100;
}

.close-flash:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   ☀️ Light / Bright Theme: Crisp Cards with Vibrant Edge Color Bars
   ========================================================================== */
body.light-theme .flash-message,
[data-theme="light"] .flash-message,
html[data-theme="light"] .flash-message {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

/* 🟢 Light Mode Success with Green Edge */
body.light-theme .flash-message.flash-success,
[data-theme="light"] .flash-message.flash-success {
    border-left: 5px solid #10b981 !important;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 25%) !important;
}
body.light-theme .flash-message.flash-success i,
[data-theme="light"] .flash-message.flash-success i {
    color: #059669 !important;
}

/* 🔴 Light Mode Error with Red Edge */
body.light-theme .flash-message.flash-error,
body.light-theme .flash-message.flash-danger,
[data-theme="light"] .flash-message.flash-error,
[data-theme="light"] .flash-message.flash-danger {
    border-left: 5px solid #ef4444 !important;
    background: linear-gradient(90deg, #fef2f2 0%, #ffffff 25%) !important;
}
body.light-theme .flash-message.flash-error i,
[data-theme="light"] .flash-message.flash-error i {
    color: #dc2626 !important;
}

/* 🟠 Light Mode Warning with Amber Edge */
body.light-theme .flash-message.flash-warning,
[data-theme="light"] .flash-message.flash-warning {
    border-left: 5px solid #f59e0b !important;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 25%) !important;
}
body.light-theme .flash-message.flash-warning i,
[data-theme="light"] .flash-message.flash-warning i {
    color: #d97706 !important;
}

/* 🔵 Light Mode Info with Cyan/Blue Edge */
body.light-theme .flash-message.flash-info,
[data-theme="light"] .flash-message.flash-info {
    border-left: 5px solid #0284c7 !important;
    background: linear-gradient(90deg, #f0f9ff 0%, #ffffff 25%) !important;
}
body.light-theme .flash-message.flash-info i,
[data-theme="light"] .flash-message.flash-info i {
    color: #0284c7 !important;
}

body.light-theme .close-flash,
[data-theme="light"] .close-flash {
    color: #64748b !important;
}
body.light-theme .close-flash:hover,
[data-theme="light"] .close-flash:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

/* ==========================================================================
   Send to ERPNext Modal (Dark & Bright Theme)
   ========================================================================== */
.erp-state { margin-bottom: 18px; }
.erp-state-loading { display: flex; align-items: center; gap: 10px; padding: 14px 4px; color: var(--text-secondary); font-size: 0.9rem; }
.erp-state-card {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px 18px; border-radius: var(--radius-md);
    background: var(--glass-input); border: 1px solid var(--glass-border);
}
.erp-state-card > i { font-size: 1.35rem; color: var(--primary-color); margin-top: 2px; flex-shrink: 0; }
.erp-state-card strong { display: block; color: var(--text-primary); font-size: 0.98rem; margin-bottom: 4px; }
.erp-state-card p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; margin: 0; }
.erp-state-card.is-ok { border-color: rgba(6, 214, 160, 0.35); background: rgba(6, 214, 160, 0.08); }
.erp-state-card.is-ok > i { color: var(--success-color); }
.erp-state-card.is-warn { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.erp-state-card.is-warn > i { color: var(--warning-color); }
.erp-state-card.is-bad > i { color: var(--error-color); }
.erp-admin-note { margin-top: 8px !important; font-size: 0.78rem !important; color: var(--text-muted) !important; word-break: break-word; }
#erpModal .erp-link-btn { background: none; border: none; box-shadow: none; padding: 0; min-height: 0; color: var(--primary-color); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
#erpModal .erp-link-btn:hover { filter: brightness(1.15); background: none; }
#erpModal .erp-link-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; border-radius: 2px; }
.erp-cost-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--glass-border); }
.erp-cost-row:last-child { border-bottom: none; }
.erp-cost-label { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.erp-cost-value { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); text-align: right; }
.erp-cost-value small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.erp-cost-empty { padding: 12px 0; font-size: 0.83rem; color: var(--text-secondary); }
.erp-cost-empty i { color: var(--primary-color); margin-right: 6px; }
.erp-cost-head { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 12px 0 2px; }
/* The standing of these leads reads as the same kind of box as the cost. */
.erp-standing { margin-top: 14px; padding: 4px 14px; border-radius: var(--radius-md); background: var(--glass-input); border: 1px solid var(--glass-border); }
.erp-failures { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--glass-input); border: 1px solid var(--glass-border); }
.erp-failures strong { display: block; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 6px; }
.erp-failures ul { margin: 0; padding-left: 18px; max-height: 160px; overflow-y: auto; }
.erp-failures li { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; word-break: break-word; }
#erpProgressBox .elb-track { margin-top: 4px; }
.erp-soon { margin: 14px 0 0; font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
#erpPrimaryBtn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ==========================================================================
   Export / Download Leads Modal Styles (Dark & Bright Theme)
   ========================================================================== */
/* Both big popups -- Download CSV and Send to ERPNext -- used to be as tall
   as whatever they held. On a large screen that was fine; on a smaller laptop
   screen the bottom of the dialog, footer action button included, fell off
   the window with no way to reach it. They now share one fixed frame: the
   header and footer stay put and the body between them scrolls, so the popup
   is the same size and behaves the same way on any screen. */
.export-modal-dialog {
    width: 560px;
    max-width: 92vw;
    height: 640px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.export-modal-dialog .modal-header,
.export-modal-dialog .modal-footer {
    flex: 0 0 auto;
}

/* min-height:0 is what actually lets this shrink inside the flex column --
   without it the body keeps its content height and overflows instead. */
.export-modal-dialog .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* The margin belonged to a footer that followed the body in normal flow. */
.export-modal-dialog .modal-footer {
    margin-top: 0;
}

.export-summary-banner {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 18px;
}

body.light-theme .export-summary-banner {
    background: rgba(2, 132, 199, 0.06);
    border-color: rgba(2, 132, 199, 0.2);
}

.export-badge-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.export-subtitle {
    font-size: 0.83rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

.export-section {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Export modal — per-user download allowance banner */ 
.export-limit-banner { margin: 0.9rem 0 0.4rem; padding: 0.9rem 1rem; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-input); } 
.elb-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.55rem; } 
.elb-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; } 
.elb-label i { color: var(--primary-color); } .elb-value { font-size: 0.85rem; color: var(--text-primary); } 
.elb-value strong { color: var(--primary-color); font-size: 1rem; } 
.elb-track { height: 7px; border-radius: var(--radius-full); background: var(--glass-bg-hover); overflow: hidden; } 
.elb-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); border-radius: inherit; transition: width 0.4s ease; } 
.elb-fill.warn { background: linear-gradient(90deg, var(--warning-color), #f59e0b); } 
.elb-fill.danger { background: linear-gradient(90deg, var(--error-color), #dc2626); } 
.elb-note { margin-top: 0.5rem; font-size: 0.78rem; color: var(--error-color); }

/* ==========================================================================
   Export Scope Toggle Buttons (High Contrast in Both Dark & Light Themes)
   ========================================================================== */
.export-toggle-pill {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--glass-input);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 5px;
}

body.light-theme .export-toggle-pill {
    background: #e2e8f0 !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* Inactive Button */
.export-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent !important;
    color: var(--text-secondary) !important;
}

body.light-theme .export-mode-btn {
    color: #475569 !important;
}

.export-mode-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

body.light-theme .export-mode-btn:hover {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.6) !important;
}

/* Active Button (Dark Theme): Vibrant Electric Blue with White Text */
.export-mode-btn.active {
    background: var(--fill-primary) !important;
    color: var(--on-fill) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4) !important;
}

/* Active Button (Light Theme): Deep Saturated Blue with Pure White Text */
body.light-theme .export-mode-btn.active {
    background: var(--fill-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35) !important;
}

/* Guarantee that icons, text, and numbers inside <strong> are pure white when active */
.export-mode-btn.active i,
.export-mode-btn.active span,
.export-mode-btn.active strong {
    color: #ffffff !important;
}

body.light-theme .export-mode-btn.active {
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

.limit-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.limit-number-input {
    width: 110px !important;
    padding: 9px 12px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

.limit-preset-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-chip {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--glass-border);
    background: var(--glass-input);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .preset-chip {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

.preset-chip:hover,
.preset-chip.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

body.light-theme .preset-chip.active {
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.export-checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.export-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

body.light-theme .export-check-item {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
}

.export-check-item:hover {
    border-color: var(--primary-color);
    background: var(--glass-bg-hover);
}

body.light-theme .export-check-item:hover {
    background: rgba(2, 132, 199, 0.04);
}

.export-check-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.check-label-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.text-cyan { color: var(--primary-color); }
.text-amber { color: var(--warning-color); }
.text-blue { color: var(--accent-color); }

.export-active-criteria {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

body.light-theme .export-active-criteria {
    background: rgba(2, 132, 199, 0.06);
    border-color: rgba(2, 132, 199, 0.2);
}

.export-active-criteria i {
    color: var(--primary-color);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.export-active-criteria {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 16px 0;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

body.light-theme .export-active-criteria {
    background: rgba(2, 132, 199, 0.06);
    border-color: rgba(2, 132, 199, 0.2);
}

.criteria-text-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.criteria-text-wrap i {
    color: var(--primary-color);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.btn-clear-modal-filters {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: var(--error-color);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-clear-modal-filters:hover {
    background: var(--error-color);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.35);
}

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

/* ==========================================================================
   Modern Glassmorphic Table Loader Spinner (Dark & Light Theme)
   ========================================================================== */
.table-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px var(--glass-shadow);
    min-height: 400px; /* Provides ample breathing room for centered spinner */
}

.table-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.25s ease;
}

body.light-theme .table-loading-overlay {
    background: rgba(255, 255, 255, 0.88);
}

/* Premium Dual-Ring Glowing Spinner */
.spinner-pulse {
    width: 48px;
    height: 48px;
    position: relative;
    border: 3.5px solid rgba(0, 212, 255, 0.15);
    border-top: 3.5px solid var(--primary-color);
    border-right: 3.5px solid var(--accent-color);
    border-radius: 50%;
    animation: tableSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

body.light-theme .spinner-pulse {
    border: 3.5px solid rgba(2, 132, 199, 0.15);
    border-top: 3.5px solid #0284c7;
    border-right: 3.5px solid #38bdf8;
    box-shadow: 0 0 16px rgba(2, 132, 199, 0.25);
}

.loading-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.loading-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

body.light-theme .loading-title {
    color: #0f172a;
}

.loading-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

body.light-theme .loading-subtitle {
    color: #64748b;
}

/* ==========================================================================
   LEADS FILTER SIDEBAR — COMPLETE (multi-select, rating range, review range,
   social toggles). Replaces ALL previous filter-sidebar CSS. Dark + light.
   ========================================================================== */

.sidebar-form { display: flex; flex-direction: column; gap: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; position: relative; }
.filter-label-row { display: flex; justify-content: space-between; align-items: center; }
.filter-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.82rem; font-weight: 600; color: var(--primary-color);
}
.filter-label i { font-size: 0.85rem; color: var(--primary-color); width: 14px; text-align: center; }
.filter-section-heading { font-size: 0.82rem; font-weight: 600; color: var(--primary-color); }

/* Clear-all button in header */
.btn-clear-all {
    width: 34px; height: 34px; border-radius: var(--radius-md); cursor: pointer;
    background: var(--glass-input); border: 1px solid var(--glass-border);
    color: var(--text-muted); transition: var(--transition);
}
.btn-clear-all:hover { color: var(--primary-color); border-color: var(--glass-border-hover); }

/* ---------- Multi-select dropdown ---------- */
.ms-dropdown { position: relative; width: 100%; }
.ms-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; padding: 0.7rem 0.9rem; cursor: pointer;
    background: var(--glass-input); color: var(--text-primary);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    font-size: 0.9rem; font-family: inherit; transition: var(--transition); text-align: left;
}
.ms-trigger:hover { border-color: var(--glass-border-hover); }
.ms-dropdown.open .ms-trigger { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--cyan-glow-dim, rgba(0,212,255,0.15)); }
.ms-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ms-trigger-label.is-placeholder { color: var(--text-muted); }
.ms-chevron { color: var(--text-muted); font-size: 0.75rem; transition: transform 0.25s ease; }
.ms-dropdown.open .ms-chevron { transform: rotate(180deg); color: var(--primary-color); }

.ms-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1050;
    background: var(--glass-bg-card); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: 0 12px 32px var(--glass-shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease; overflow: hidden;
}
.ms-dropdown.open .ms-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.ms-search { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--glass-border); }
.ms-search i { color: var(--text-muted); font-size: 0.8rem; }
.ms-search-input { flex: 1; border: none; background: transparent; outline: none; color: var(--text-primary); font-size: 0.85rem; }
.ms-search-input::placeholder { color: var(--text-muted); }
.ms-search-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.ms-search-clear:hover { color: var(--text-primary); }
.ms-options { max-height: 220px; overflow-y: auto; padding: 0.35rem; }
.ms-option {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.86rem;
    color: var(--text-secondary); transition: background 0.15s ease;
}
.ms-option:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.ms-option.selected { color: var(--text-primary); background: var(--glass-bg-hover); }
.ms-check {
    width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px;
    border: 1.5px solid var(--glass-border); display: grid; place-items: center;
    color: #fff; font-size: 0.62rem; transition: var(--transition);
}
.ms-option.selected .ms-check { background: var(--primary-color); border-color: var(--primary-color); }
.ms-check i { opacity: 0; }
.ms-option.selected .ms-check i { opacity: 1; }
.ms-option-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-no-results { padding: 0.9rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Selected chips ---------- */
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.ms-chips:empty { display: none; }
.ms-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    padding: 4px 6px 4px 10px; border-radius: var(--radius-full);
    background: var(--cyan-glow-dim, rgba(0,212,255,0.12));
    border: 1px solid var(--glass-border-hover);
    color: var(--primary-color); font-size: 0.78rem; font-weight: 600;
}
.ms-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.ms-chip-x {
    width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,0.12); color: inherit; display: grid; place-items: center;
    font-size: 0.7rem; line-height: 1; transition: var(--transition);
}
.ms-chip-x:hover { background: var(--error-color); color: #fff; }

/* ---------- Rating range (min-max number inputs, 0-5) ---------- */
.rating-selected-val { font-size: 0.74rem; font-weight: 700; color: var(--primary-color); }
.rating-range-row { display: flex; align-items: center; gap: 0.6rem; }
.rating-field {
    flex: 1; position: relative; display: flex; align-items: center;
    background: var(--glass-input); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: 0.5rem 0.7rem; transition: var(--transition);
}
.rating-field:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--cyan-glow-dim, rgba(0,212,255,0.15)); }
.rating-field-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 0.4rem; }
.rating-num-input {
    flex: 1; min-width: 0; border: none; background: transparent; outline: none;
    color: var(--text-primary); font-size: 0.95rem; font-weight: 700; text-align: right; -moz-appearance: textfield;
}
.rating-num-input::-webkit-outer-spin-button,
.rating-num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rating-field-star { color: #fbbf24; font-size: 0.8rem; margin-left: 0.4rem; }
.rating-range-dash { color: var(--text-muted); font-weight: 700; }
.rating-field.invalid { border-color: var(--error-color); box-shadow: 0 0 0 3px rgba(255,107,107,0.15); }
.rating-hint { margin-top: 0.5rem; font-size: 0.76rem; color: var(--error-color); }

/* ---------- Review count: dropdown badge ---------- */
.slider-val-badge {
    font-size: 0.74rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full);
    background: var(--cyan-glow-dim, rgba(0,212,255,0.15)); color: var(--primary-color);
    border: 1px solid var(--glass-border-hover); transition: var(--transition);
}
.rev-dropdown { position: relative; }
.rev-badge { cursor: pointer; font: 0.74rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.rev-badge::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 0.6rem; opacity: 0.7; }
.rev-pop {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 1060; width: 230px;
    background: var(--glass-bg-card); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: 0 12px 32px var(--glass-shadow);
    padding: 0.85rem; opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.rev-dropdown.open .rev-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.rev-pop-row { display: flex; align-items: flex-end; gap: 0.5rem; }
.rev-pop-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rev-pop-field span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.rev-pop-field input {
    width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--glass-border);
    background: var(--glass-input); color: var(--text-primary); border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 700; outline: none; -moz-appearance: textfield;
}
.rev-pop-field input::-webkit-outer-spin-button,
.rev-pop-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rev-pop-field input:focus { border-color: var(--primary-color); }
.rev-pop-dash { color: var(--text-muted); padding-bottom: 0.5rem; }
.rev-pop-actions { display: flex; justify-content: space-between; margin-top: 0.75rem; }
.rev-pop-clear { background: none; border: none; color: var(--text-muted); font-size: 0.82rem; cursor: pointer; }
.rev-pop-clear:hover { color: var(--text-primary); }
.rev-pop-apply {
    padding: 0.4rem 0.9rem; border: none; border-radius: var(--radius-sm);
    background: var(--fill-primary); color: var(--on-fill); font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: var(--transition);
}
.rev-pop-apply:hover { background: var(--fill-primary-hover); }

/* ---------- Dual-range slider (FIXED: both thumbs above track, clickable) ---------- */
.range-dual { padding: 0.7rem 0 0.2rem; }
.range-track { position: relative; height: 24px; display: flex; align-items: center; }
.range-track::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    height: 5px; background: var(--glass-bg-hover); border-radius: var(--radius-full);
}
.range-track-fill {
    position: absolute; top: 50%; transform: translateY(-50%); height: 5px;
    border-radius: var(--radius-full); background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin-top: -7px;
}
/* Both range inputs stacked, transparent, only thumbs catch pointer events */
.range-dual .range-input {
    position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 24px; margin: 0;
    background: transparent !important; border: none !important; outline: none !important;
    pointer-events: none; -webkit-appearance: none; appearance: none;
}
/* transparent native track so our ::before shows through */
.range-dual .range-input::-webkit-slider-runnable-track { background: transparent !important; border: none !important; box-shadow: none !important; height: 24px !important; }
.range-dual .range-input::-moz-range-track { background: transparent !important; border: none !important; box-shadow: none !important; height: 24px !important; }
/* WebKit thumb */
.range-dual .range-input::-webkit-slider-thumb {
    -webkit-appearance: none !important; appearance: none !important; pointer-events: auto;
    width: 16px !important; height: 16px !important; border-radius: 50% !important;
    background: #fff !important; border: 3px solid var(--primary-color) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important; cursor: grab !important;
    margin-top: 4px !important; /* centers 16px thumb on 24px input */
    transition: transform 0.12s ease !important;
}
.range-dual .range-input::-webkit-slider-thumb:hover { transform: scale(1.12) !important; }
.range-dual .range-input::-webkit-slider-thumb:active { cursor: grabbing !important; }
/* Firefox thumb */
.range-dual .range-input::-moz-range-thumb {
    pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 3px solid var(--primary-color); cursor: grab;
}

/* ---------- Social toggles — ROUND, brand fill animation, both themes ---------- */
.social-toggles { display: flex; gap: 0.6rem; margin-top: 0.3rem; }
.social-toggle {
    flex: 1; aspect-ratio: 1 / 1; max-width: 56px; display: grid; place-items: center; cursor: pointer;
    background: var(--glass-input); border: 1px solid var(--glass-border);
    border-radius: 50%; color: var(--text-muted); font-size: 1.1rem;
    position: relative; overflow: hidden;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}
.social-toggle:hover { transform: translateY(-2px); }
.social-toggle i { position: relative; z-index: 1; transition: color 0.25s ease, transform 0.25s ease; }
.social-toggle::before {
    content: ''; position: absolute; inset: 0; z-index: 0; border-radius: 50%;
    background: currentColor; transform: scale(0); opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), opacity 0.28s ease;
}
/* hover glow in brand color */
.social-toggle[data-net="facebook"]:hover  { color: #1877f2; border-color: #1877f2; box-shadow: 0 0 0 3px rgba(24,119,242,0.18); }
.social-toggle[data-net="linkedin"]:hover  { color: #0a66c2; border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10,102,194,0.18); }
.social-toggle[data-net="twitter"]:hover   { color: var(--text-primary); border-color: var(--text-primary); box-shadow: 0 0 0 3px rgba(120,120,120,0.18); }
.social-toggle[data-net="instagram"]:hover { color: #e1306c; border-color: #e1306c; box-shadow: 0 0 0 3px rgba(225,48,108,0.18); }
/* active = brand fill + white icon */
.social-toggle.active::before { transform: scale(1); opacity: 1; }
.social-toggle.active i { color: #fff; transform: scale(1.08); }
.social-toggle.active { border-color: transparent; }
.social-toggle[data-net="facebook"].active  { color: #1877f2; }
.social-toggle[data-net="linkedin"].active  { color: #0a66c2; }
.social-toggle[data-net="twitter"].active   { color: #000000; }
.social-toggle[data-net="instagram"].active { color: #e1306c; }
.social-toggle[data-net="instagram"].active::before { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
/* light theme: X (twitter) fills black, icon white — keep readable */
body.light-theme .social-toggle[data-net="twitter"]:hover { color: #0f172a; border-color: #0f172a; }
body.light-theme .social-toggle[data-net="twitter"].active { color: #0f172a; }

/* ==========================================================================
   FILTER SIDEBAR CORRECTIONS — square social buttons + original-style slider
   Append this AFTER filter_sidebar.css. It overrides the round/animated bits.
   ========================================================================== */

/* ---------- Social: round pills with a brand fill that grows from the centre ----------
   These were squared here on purpose once, killing the ::before fill layer the
   block above defines. They are round again, and the fill is the animation:
   a brand-coloured disc scaling up under the icon instead of a colour swap. */
.social-toggles {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.social-toggle {
    flex: 1;
    aspect-ratio: 1 / 1;
    max-width: 56px;
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    /* The overshoot is what makes the press feel physical. */
    transition: color 0.22s ease, border-color 0.22s ease,
                box-shadow 0.22s ease,
                transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-toggle:hover { transform: translateY(-2px) scale(1.06); }
.social-toggle:active { transform: translateY(0) scale(0.94); }

.social-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.social-toggle i {
    position: relative;
    z-index: 1;
    transition: color 0.22s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* The fill layer, restored. currentColor means each network's own brand colour
   drives it without a rule per network. */
.social-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 50%;
    background: currentColor;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
}

/* Hover: brand-coloured icon and a soft ring in the same hue. */
.social-toggle[data-net="facebook"]:hover {
    color: #1877f2; border-color: #1877f2; box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.18);
}
.social-toggle[data-net="linkedin"]:hover {
    color: #0a66c2; border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.18);
}
.social-toggle[data-net="twitter"]:hover {
    color: var(--text-primary); border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(120, 120, 120, 0.18);
}
.social-toggle[data-net="instagram"]:hover {
    color: #e1306c; border-color: #e1306c; box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.18);
}

/* Active: the disc fills, the icon turns white and pops. */
.social-toggle.active::before { transform: scale(1); opacity: 1; }
.social-toggle.active i { color: #fff; transform: scale(1.12); }
.social-toggle.active { border-color: transparent; }

.social-toggle[data-net="facebook"].active  { color: #1877f2; }
.social-toggle[data-net="linkedin"].active  { color: #0a66c2; }
.social-toggle[data-net="twitter"].active   { color: #000000; }
.social-toggle[data-net="instagram"].active { color: #e1306c; }
.social-toggle[data-net="instagram"].active::before {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* Light theme: X fills near-black rather than pure black. */
body.light-theme .social-toggle[data-net="twitter"]:hover,
[data-theme="light"] .social-toggle[data-net="twitter"]:hover {
    color: #0f172a; border-color: #0f172a;
}
body.light-theme .social-toggle[data-net="twitter"].active,
[data-theme="light"] .social-toggle[data-net="twitter"].active {
    color: #0f172a;
}

@media (prefers-reduced-motion: reduce) {
    .social-toggle,
    .social-toggle i,
    .social-toggle::before { transition-duration: 0.01ms; }
    .social-toggle:hover,
    .social-toggle:active { transform: none; }
}

/* ---------- Slider: restore your ORIGINAL vertical-capsule thumb ---------- */
/* Track baseline */
.range-dual { padding: 0.7rem 0 0.2rem; }
.range-track { position: relative; height: 22px; display: flex; align-items: center; }
.range-track::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    height: 6px; border-radius: 99px;
    background: rgba(255,255,255,0.1);
}
body.light-theme .range-track::before { background: rgba(0,0,0,0.1); }
.range-track-fill {
    position: absolute; top: 50%; transform: translateY(-50%); height: 6px; border-radius: 99px;
    background: var(--primary-color);
}
body.light-theme .range-track-fill { background: #0284c7; }

.range-dual .range-input {
    position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 22px; margin: 0;
    background: transparent !important; border: none !important; outline: none !important;
    pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range-dual .range-input::-webkit-slider-runnable-track { background: transparent !important; border: none !important; box-shadow: none !important; height: 22px !important; }
.range-dual .range-input::-moz-range-track { background: transparent !important; border: none !important; box-shadow: none !important; height: 22px !important; }

/* Original look: 8x20 vertical capsule, cyan, white border, glow */
.range-dual .range-input::-webkit-slider-thumb {
    -webkit-appearance: none !important; appearance: none !important; pointer-events: auto;
    width: 8px !important; height: 20px !important; border-radius: 4px !important;
    background: #00d4ff !important; border: 1.5px solid #ffffff !important;
    box-shadow: 0 0 10px rgba(0,212,255,0.7) !important;
    margin-top: -1px !important;            /* centers 20px capsule on 22px input */
    cursor: pointer !important; transition: transform 0.15s ease !important;
}
.range-dual .range-input::-webkit-slider-thumb:hover { transform: scaleY(1.12) scaleX(1.1) !important; }
.range-dual .range-input::-moz-range-thumb {
    pointer-events: auto; width: 8px; height: 20px; border-radius: 4px;
    background: #00d4ff; border: 1.5px solid #ffffff; box-shadow: 0 0 10px rgba(0,212,255,0.7); cursor: pointer;
}
/* Light theme thumb */
body.light-theme .range-dual .range-input::-webkit-slider-thumb {
    background: #0284c7 !important; box-shadow: 0 0 10px rgba(2,132,199,0.5) !important;
}
body.light-theme .range-dual .range-input::-moz-range-thumb {
    background: #0284c7; box-shadow: 0 0 10px rgba(2,132,199,0.5);
}

@media (max-width: 1200px) {
    .charts-middle-grid {
        grid-template-columns: 1fr;
    }
}

/* Funnel Styling */

.funnel-step {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Bottom Grid */

@media (max-width: 1024px) {
    .charts-bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Table */

/* ==========================================================================
   🗺️ GEOSPATIAL MAP EXPLORER & 360° DOSSIER STYLES
   ========================================================================== */

.map-page-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--nav-height, 72px));
    display: flex;
    overflow: hidden;
}

/* 1. Floating Left Filter Sidebar */
.map-floating-sidebar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    bottom: auto;
    width: 320px;
    height: auto;
    max-height: calc(100% - 2rem);
    background: rgba(13, 20, 36, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.map-floating-sidebar.collapsed {
    transform: translateX(-340px);
}

.sidebar-head {
    padding: 1.2rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-title h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #ffffff);
    margin: 0px;
}
/* Sidebar Title (Bright / Light Mode: Deep Charcoal) */
body.light-theme .sidebar-title h2,
html[data-theme="light"] .sidebar-title h2,
[data-theme="light"] .sidebar-title h2 {
    color: #0f172a !important;
}

.btn-sidebar-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.sidebar-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow: visible;
}

.filter-reset-box {
    padding-top: 0.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-box {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.filter-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.map-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
}

.map-input:focus {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.05);
}

/* Custom Searchable Dropdown */
.custom-search-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-trigger-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.dropdown-trigger-btn:hover {
    border-color: rgba(0, 229, 255, 0.4);
    background: rgba(255, 255, 255, 0.07);
}

.dropdown-popover-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #0d1424;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 9999;
}

.custom-search-dropdown.open .dropdown-popover-menu {
    display: flex;
}

.dropdown-inner-search {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.8rem;
    outline: none;
}

.dropdown-inner-search:focus {
    border-color: #00e5ff;
}

.dropdown-options-scroll {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-opt-row {
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.dropdown-opt-row:hover {
    background: rgba(0, 229, 255, 0.12);
    color: #ffffff;
}

.dropdown-opt-row.selected {
    background: rgba(0, 229, 255, 0.2);
    color: #00e5ff;
    font-weight: 700;
}

/* Quick Chips */
.chip-toggles-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.map-chip-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-chip-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.map-chip-btn.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: #00e5ff;
    color: #ffffff;
}

.btn-reset-map-filters {
    width: 100%;
    padding: 0.6rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-loading-state {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 650;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg-card);
    color: var(--text-primary);
    box-shadow: 0 12px 32px var(--glass-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 0.86rem;
    font-weight: 700;
    pointer-events: none;
}

.map-loading-state i { color: var(--primary-color); }

.btn-reset-map-filters:hover {
    color: #ffffff;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 2. Map Canvas */
.map-canvas-container {
    flex: 1;
    position: relative;
    height: 100%;
}

.lead-map-canvas {
    width: 100%;
    height: 100%;
    background: #090e1a;
}

/* Top Control Bar */
.map-top-control-bar {
    position: absolute;
    top: 1rem;
    left: 350px;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 450;
    pointer-events: none;
}

.map-top-control-bar > * {
    pointer-events: auto;
}

.map-counter-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(13, 20, 36, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.counter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00e5ff;
    box-shadow: 0 0 8px #00e5ff;
}

.map-top-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-map-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(13, 20, 36, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.btn-map-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
}

.btn-map-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #00e5ff 0%, #3b82f6 100%);
    color: #0d1424;
    padding: 0.55rem 1.15rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.35);
    transition: all 0.2s ease;
}

.btn-map-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.5);
}

/* ==========================================================================
   🎯 PERFECTLY CENTERED MARKER CLUSTERS & HOVER TOOLTIPS
   ========================================================================== */

.marker-cluster {
    background: transparent !important;
}

.marker-cluster div {
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: rgba(13, 20, 36, 0.95) !important;
    border: 2px solid #00e5ff !important;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.7), inset 0 0 8px rgba(0, 229, 255, 0.3) !important;
    color: #ffffff !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marker-cluster:hover div {
    transform: scale(1.1);
    box-shadow: 0 0 24px rgba(0, 229, 255, 1);
}

/* Dark Glass Hover Tooltip */
.leaflet-tooltip.custom-map-tooltip {
    background: rgba(13, 20, 36, 0.95) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(0, 229, 255, 0.4) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    padding: 0.6rem 0.85rem !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(13, 20, 36, 0.95) !important;
}

.map-hover-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    line-height: 1.3;
}

.hover-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.hover-card-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

.hover-card-status {
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.2rem;
}

/* 3. 360° Lead Dossier Drawer */
.lead-dossier-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lead-dossier-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.lead-dossier-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 440px;
    max-width: 90vw;
    background: rgba(13, 20, 36, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 700;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.7);
}

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

.dossier-header-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dossier-score-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.dossier-status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

/* ==========================================================================
   🎯 Sleek 360° Dossier Close Button (Dark & Light Themes)
   ========================================================================== */
.btn-close-dossier {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.btn-close-dossier:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: scale(1.08);
}

/* Light Theme Close Button: Clean Slate-Glass Pill */
body.light-theme .btn-close-dossier,
[data-theme="light"] .btn-close-dossier,
html[data-theme="light"] .btn-close-dossier {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06) !important;
}

body.light-theme .btn-close-dossier:hover,
[data-theme="light"] .btn-close-dossier:hover,
html[data-theme="light"] .btn-close-dossier:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #ef4444 !important;
    transform: scale(1.08);
}

.dossier-body {
    padding: 1.75rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.dossier-biz-hero {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dossier-biz-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
    flex: 1;
}

.dossier-top-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.dossier-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dossier-biz-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #94a3b8;
}

.dossier-status-pill.status-verified {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.dossier-status-pill.status-unverified {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.dossier-ai-box {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 14px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ai-box-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #c084fc;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-owner-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.ai-summary-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #e2e8f0;
    margin: 0;
}

.dossier-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dossier-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 10px;
}

.contact-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: #ffffff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-contact {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #00e5ff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-contact:hover {
    background: rgba(0, 229, 255, 0.2);
}

.dossier-socials-row {
    display: flex;
    gap: 0.6rem;
}

.dossier-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dossier-social-btn:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: #00e5ff;
}

/* --- Dossier: shared section shell (Business Hours, Competitors) --------- */
.dossier-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.dossier-section-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.dossier-section-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
}
.dossier-empty-note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #64748b;
}
.dossier-footnote {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0.15rem 0 0;
    font-size: 0.74rem;
    line-height: 1.4;
    color: #64748b;
}

/* --- Business Hours: one card, a row per day, Monday first --------------- */
.dossier-hours {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}
.dossier-hours-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.84rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dossier-hours-row:last-child { border-bottom: none; }
.dossier-hours-row .hours-day {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #94a3b8;
    font-weight: 600;
    min-width: 3rem;
}
.dossier-hours-row .hours-day em {
    font-style: normal;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #00e5ff;
    padding: 0.05rem 0.4rem;
    border-radius: 20px;
    background: rgba(0, 229, 255, 0.12);
}
.dossier-hours-row .hours-time {
    color: #e2e8f0;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.dossier-hours-row .hours-time.is-closed {
    color: #64748b;
    font-weight: 500;
}
.dossier-hours-row.is-today { background: rgba(0, 229, 255, 0.06); }
.dossier-hours-row.is-today .hours-day { color: #ffffff; }
.dossier-hours-row.is-today .hours-time:not(.is-closed) { color: #ffffff; }
.dossier-hours-raw {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.84rem;
    line-height: 1.5;
    color: #e2e8f0;
}

/* --- Competitors: the same rows as Contact Information ------------------- */
.dossier-competitors {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dossier-competitor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.65rem 1rem;
    border-radius: 10px;
    transition: border-color 0.2s ease;
}
.dossier-competitor:hover { border-color: rgba(0, 229, 255, 0.35); }
.competitor-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.competitor-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.competitor-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.76rem;
    color: #94a3b8;
}
.competitor-meta .muted { color: #64748b; }
.competitor-meta .dot { color: #475569; margin: 0 0.15rem; }
.competitor-map-link {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #00e5ff;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.competitor-map-link:hover { background: rgba(0, 229, 255, 0.2); }
.competitor-map-link:focus-visible,
.dossier-social-btn:focus-visible {
    outline: 2px solid #00e5ff;
    outline-offset: 2px;
}

/* --- Light theme ---------------------------------------------------------- */
body.light-theme .dossier-hours,
body.light-theme .dossier-hours-raw,
body.light-theme .dossier-competitor,
[data-theme="light"] .dossier-hours,
[data-theme="light"] .dossier-hours-raw,
[data-theme="light"] .dossier-competitor {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .dossier-empty-note,
[data-theme="light"] .dossier-empty-note { border-color: rgba(0, 0, 0, 0.12); }
body.light-theme .dossier-hours-row,
[data-theme="light"] .dossier-hours-row { border-bottom-color: rgba(0, 0, 0, 0.05); }
body.light-theme .dossier-hours-row .hours-time,
body.light-theme .dossier-hours-raw,
[data-theme="light"] .dossier-hours-row .hours-time,
[data-theme="light"] .dossier-hours-raw { color: #334155; }
body.light-theme .dossier-hours-row .hours-time.is-closed,
[data-theme="light"] .dossier-hours-row .hours-time.is-closed { color: #94a3b8; }
/* The dark theme's #94a3b8 is too faint on #f8fafc for text people read. */
body.light-theme .dossier-hours-row .hours-day,
body.light-theme .competitor-meta,
[data-theme="light"] .dossier-hours-row .hours-day,
[data-theme="light"] .competitor-meta { color: #64748b; }
body.light-theme .dossier-hours-row.is-today,
[data-theme="light"] .dossier-hours-row.is-today { background: rgba(2, 132, 199, 0.07); }
body.light-theme .dossier-hours-row.is-today .hours-day,
body.light-theme .dossier-hours-row.is-today .hours-time:not(.is-closed),
body.light-theme .competitor-name,
[data-theme="light"] .dossier-hours-row.is-today .hours-day,
[data-theme="light"] .dossier-hours-row.is-today .hours-time:not(.is-closed),
[data-theme="light"] .competitor-name { color: #0f172a; }
body.light-theme .dossier-hours-row .hours-day em,
[data-theme="light"] .dossier-hours-row .hours-day em {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.1);
}
body.light-theme .competitor-map-link,
[data-theme="light"] .competitor-map-link {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.08);
    color: #0284c7;
}
body.light-theme .dossier-competitor:hover,
[data-theme="light"] .dossier-competitor:hover { border-color: rgba(2, 132, 199, 0.35); }

/* ==========================================================================
   🗺️ GEOSPATIAL MAP EXPLORER - LIGHT THEME OVERRIDES
   ========================================================================== */

/* 1. Canvas Background in Light Mode */
body.light-theme .lead-map-canvas,
[data-theme="light"] .lead-map-canvas,
html[data-theme="light"] .lead-map-canvas {
    background: #e2e8f0;
}

/* 2. Floating Filter Sidebar in Light Mode */
body.light-theme .map-floating-sidebar,
[data-theme="light"] .map-floating-sidebar,
html[data-theme="light"] .map-floating-sidebar {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12) !important;
}

body.light-theme .sidebar-head,
[data-theme="light"] .sidebar-head,
html[data-theme="light"] .sidebar-head {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .sidebar-title h2,
[data-theme="light"] .sidebar-title h2,
html[data-theme="light"] .sidebar-title h2 {
    color: #0f172a !important;
}

body.light-theme .filter-lbl,
[data-theme="light"] .filter-lbl,
html[data-theme="light"] .filter-lbl {
    color: #475569 !important;
}

body.light-theme .btn-sidebar-toggle,
[data-theme="light"] .btn-sidebar-toggle,
html[data-theme="light"] .btn-sidebar-toggle {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

/* 3. Inputs & Dropdowns in Light Mode */
body.light-theme .dropdown-trigger-btn,
body.light-theme .map-input,
[data-theme="light"] .dropdown-trigger-btn,
[data-theme="light"] .map-input,
html[data-theme="light"] .dropdown-trigger-btn,
html[data-theme="light"] .map-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .dropdown-trigger-btn:hover,
[data-theme="light"] .dropdown-trigger-btn:hover,
html[data-theme="light"] .dropdown-trigger-btn:hover {
    border-color: #0284c7 !important;
    background: #f8fafc !important;
}

body.light-theme .dropdown-popover-menu,
[data-theme="light"] .dropdown-popover-menu,
html[data-theme="light"] .dropdown-popover-menu {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.15) !important;
}

body.light-theme .dropdown-inner-search,
[data-theme="light"] .dropdown-inner-search,
html[data-theme="light"] .dropdown-inner-search {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .dropdown-opt-row,
[data-theme="light"] .dropdown-opt-row,
html[data-theme="light"] .dropdown-opt-row {
    color: #334155 !important;
}

body.light-theme .dropdown-opt-row:hover,
[data-theme="light"] .dropdown-opt-row:hover,
html[data-theme="light"] .dropdown-opt-row:hover {
    background: #e0f2fe !important;
    color: #0284c7 !important;
}

body.light-theme .dropdown-opt-row.selected,
[data-theme="light"] .dropdown-opt-row.selected,
html[data-theme="light"] .dropdown-opt-row.selected {
    background: #bae6fd !important;
    color: #0369a1 !important;
    font-weight: 700 !important;
}

body.light-theme .btn-reset-map-filters,
[data-theme="light"] .btn-reset-map-filters,
html[data-theme="light"] .btn-reset-map-filters {
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    background: #ffffff !important;
}

body.light-theme .btn-reset-map-filters:hover,
[data-theme="light"] .btn-reset-map-filters:hover,
html[data-theme="light"] .btn-reset-map-filters:hover {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

/* 4. Top Control Bar (Pills & Action Buttons) */
body.light-theme .map-counter-pill,
[data-theme="light"] .map-counter-pill,
html[data-theme="light"] .map-counter-pill {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    color: #0f172a !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .btn-map-action,
[data-theme="light"] .btn-map-action,
html[data-theme="light"] .btn-map-action {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    color: #0f172a !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .btn-map-action:hover,
[data-theme="light"] .btn-map-action:hover,
html[data-theme="light"] .btn-map-action:hover {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

body.light-theme .btn-map-primary,
[data-theme="light"] .btn-map-primary,
html[data-theme="light"] .btn-map-primary {
    background: var(--fill-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

/* 5. Marker Clusters & Tooltips in Light Mode */
body.light-theme .marker-cluster div,
[data-theme="light"] .marker-cluster div,
html[data-theme="light"] .marker-cluster div {
    background: #ffffff !important;
    border: 3px solid #0284c7 !important;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35) !important;
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.light-theme .marker-cluster:hover div,
[data-theme="light"] .marker-cluster:hover div,
html[data-theme="light"] .marker-cluster:hover div {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 22px rgba(2, 132, 199, 0.5) !important;
}

body.light-theme .leaflet-tooltip.custom-map-tooltip,
[data-theme="light"] .leaflet-tooltip.custom-map-tooltip,
html[data-theme="light"] .leaflet-tooltip.custom-map-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12) !important;
}

body.light-theme .leaflet-tooltip.custom-map-tooltip .hover-card-title,
[data-theme="light"] .leaflet-tooltip.custom-map-tooltip .hover-card-title,
html[data-theme="light"] .leaflet-tooltip.custom-map-tooltip .hover-card-title {
    color: #0f172a !important;
}

body.light-theme .leaflet-tooltip-top:before,
[data-theme="light"] .leaflet-tooltip-top:before,
html[data-theme="light"] .leaflet-tooltip-top:before {
    border-top-color: rgba(255, 255, 255, 0.95) !important;
}

/* 6. 360° Lead Dossier Drawer in Light Mode */
body.light-theme .lead-dossier-drawer,
[data-theme="light"] .lead-dossier-drawer,
html[data-theme="light"] .lead-dossier-drawer {
    background: rgba(255, 255, 255, 0.96) !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.15) !important;
}

body.light-theme .dossier-biz-name,
[data-theme="light"] .dossier-biz-name,
html[data-theme="light"] .dossier-biz-name {
    color: #0f172a !important;
}

body.light-theme .ai-owner-name,
[data-theme="light"] .ai-owner-name,
html[data-theme="light"] .ai-owner-name {
    color: #0f172a !important;
}

body.light-theme .ai-summary-text,
[data-theme="light"] .ai-summary-text,
html[data-theme="light"] .ai-summary-text {
    color: #334155 !important;
}

body.light-theme .dossier-ai-box,
[data-theme="light"] .dossier-ai-box,
html[data-theme="light"] .dossier-ai-box {
    background: #faf5ff !important;
    border: 1px solid #e9d5ff !important;
}

body.light-theme .dossier-contact-item,
[data-theme="light"] .dossier-contact-item,
html[data-theme="light"] .dossier-contact-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .contact-item-left,
[data-theme="light"] .contact-item-left,
html[data-theme="light"] .contact-item-left {
    color: #0f172a !important;
}

body.light-theme .btn-copy-contact,
[data-theme="light"] .btn-copy-contact,
html[data-theme="light"] .btn-copy-contact {
    background: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    color: #0284c7 !important;
}

body.light-theme .dossier-social-btn,
[data-theme="light"] .dossier-social-btn,
html[data-theme="light"] .dossier-social-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .dossier-social-btn:hover,
[data-theme="light"] .dossier-social-btn:hover,
html[data-theme="light"] .dossier-social-btn:hover {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

@keyframes tableSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Clickable Table Rows */
.lead-table-row {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.lead-table-row:hover {
    background: rgba(0, 229, 255, 0.06) !important;
}

.biz-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
}

.biz-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inspect-icon-hint {
    flex: none;
    font-size: 0.72rem;
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lead-table-row:hover .inspect-icon-hint,
.lead-table-row.active-row .inspect-icon-hint {
    opacity: 0.85;
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .inspect-icon-hint { transition: none; transform: none; }
}

.email-cell-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-quick-copy {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.btn-quick-copy:hover {
    color: #00e5ff;
}

/* ==========================================================================
   LEADS FILTER SIDEBAR — multi-select, dual range, icon social
   Append to style.css. Uses global tokens (dark + light both work).
   ========================================================================== */

/* ---- Multi-select dropdown ---- */
.ms-dropdown { position: relative; width: 100%; }
.ms-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; padding: 0.7rem 0.9rem; cursor: pointer;
    background: var(--glass-input); color: var(--text-primary);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    font-size: 0.9rem; font-family: inherit; transition: var(--transition);
}
.ms-trigger:hover { border-color: var(--glass-border-hover); }
.ms-dropdown.open .ms-trigger { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--cyan-glow-dim, rgba(0,212,255,0.15)); }
.ms-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; flex: 1; }
.ms-trigger-label.is-placeholder { color: var(--text-muted); }
.ms-chevron { color: var(--text-muted); font-size: 0.75rem; transition: transform 0.25s ease; }
.ms-dropdown.open .ms-chevron { transform: rotate(180deg); color: var(--primary-color); }

.ms-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 100;
    background: var(--glass-bg-card); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); box-shadow: 0 12px 32px var(--glass-shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    overflow: hidden;
}
.ms-dropdown.open .ms-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.ms-search { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--glass-border); }
.ms-search i { color: var(--text-muted); font-size: 0.8rem; }
.ms-search-input { flex: 1; border: none; background: transparent; outline: none; color: var(--text-primary); font-size: 0.85rem; }
.ms-search-input::placeholder { color: var(--text-muted); }
.ms-search-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.ms-search-clear:hover { color: var(--text-primary); }

.ms-options { max-height: 240px; overflow-y: auto; padding: 0.35rem; }
.ms-option {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.88rem;
    color: var(--text-secondary); transition: background 0.15s ease;
}
.ms-option:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.ms-option.selected { color: var(--text-primary); background: var(--glass-bg-hover); }
.ms-check {
    width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px;
    border: 1.5px solid var(--glass-border); display: grid; place-items: center;
    color: #fff; font-size: 0.62rem; transition: var(--transition);
}
.ms-option.selected .ms-check { background: var(--primary-color); border-color: var(--primary-color); }
.ms-check i { opacity: 0; }
.ms-option.selected .ms-check i { opacity: 1; }
.ms-option-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-no-results { padding: 0.9rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ---- Selected chips ---- */
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.ms-chips:empty { display: none; }
.ms-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    padding: 4px 6px 4px 10px; border-radius: var(--radius-full);
    background: var(--cyan-glow-dim, rgba(0,212,255,0.12));
    border: 1px solid var(--glass-border-hover);
    color: var(--primary-color); font-size: 0.78rem; font-weight: 600;
}
.ms-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.ms-chip-x {
    width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,0.12); color: inherit; display: grid; place-items: center;
    font-size: 0.7rem; line-height: 1; transition: var(--transition);
}
.ms-chip-x:hover { background: var(--error-color); color: #fff; }

/* ---- Dual range (review count) ---- */
.range-dual { padding: 0.35rem 0 0; }
.range-track { position: relative; height: 34px; display: flex; align-items: center; }
.range-track::before {
    content: ''; position: absolute; left: 0; right: 0; height: 6px;
    background: var(--glass-bg-hover); border-radius: var(--radius-full);
    margin-top: -7px;
}
.range-track-fill {
    position: absolute; height: 6px; border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}
.range-input {
    position: absolute; left: 0; right: 0; width: 100%; margin: 0;
    background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range-input::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px;
    border-radius: 50%; background: var(--primary-color); border: 3px solid var(--bg-main);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4); cursor: pointer; transition: transform 0.15s ease;
}
.range-input::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-input::-moz-range-thumb {
    pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
    background: var(--primary-color); border: 3px solid var(--bg-main); cursor: pointer;
}
.range-values { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-top: 0.4rem; }
.range-pill {
    min-width: 54px; text-align: center; padding: 4px 10px; border-radius: var(--radius-md);
    background: var(--glass-input); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-size: 0.85rem; font-weight: 700;
}
.range-dash { color: var(--text-muted); }
.range-input.range-error::-webkit-slider-thumb { background: var(--error-color); }

/* ---- Social icon-only toggles ----
   A third copy of these rules lived here and won on source order, squaring the
   buttons and swapping the fill animation for a border glow. The live
   definition is the round one further up (search: "Social: round pills"). */

/* Clear-all button in header */
.btn-clear-all {
    width: 34px; height: 34px; border-radius: var(--radius-md); cursor: pointer;
    background: var(--glass-input); border: 1px solid var(--glass-border);
    color: var(--text-muted); transition: var(--transition);
}
.btn-clear-all:hover { color: var(--primary-color); border-color: var(--glass-border-hover); }

/* Responsive */
@media (max-width: 1024px) {
    .leads-dashboard-container { grid-template-columns: 1fr; }
    .filter-sidebar { position: relative; top: 0; }
}

/* Between 993px and 1200px: tighten navbar spacing so desktop tabs fit gracefully */
@media (max-width: 1200px) and (min-width: 993px) {
    .nav-container { gap: 0.75rem; padding: 0 1rem; }
    .nav-menu { gap: 4px; }
    .nav-link { padding: 8px 11px; font-size: 0.86rem; gap: 6px; }
    .nav-status-pill { display: none; }
    .user-info-text { display: none; }
}

/* The mobile navbar lives here, AFTER the base `.nav-menu { display: flex }`
   rule above. Media queries add no specificity, so while this block sat
   higher up in the file the base rule won and the menu never collapsed —
   the hamburger toggled a class that changed nothing on screen. */
@media (max-width: 992px) {
    .btn-hamburger {
        display: flex;
    }

    .user-info-text {
        display: none;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-height, 72px);
        left: 0;
        right: 0;
        background: #0a1222;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--nav-border);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
        flex-direction: column;
        padding: 1rem 1.25rem;
        gap: 0.45rem;
        z-index: 1001;
    }

    .nav-menu.mobile-open {
        display: flex !important;
        animation: navMenuSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .nav-menu .nav-link {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.94rem;
        font-weight: 600;
        border-radius: var(--radius-md, 10px);
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--text-secondary);
        transition: all 0.2s ease;
    }

    .nav-menu .nav-link span {
        display: inline !important;
    }

    .nav-menu .nav-link i {
        font-size: 1.05rem;
        width: 22px;
        text-align: center;
    }

    .nav-menu .nav-link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-primary);
        transform: translateX(3px);
    }

    .nav-menu .nav-link.active {
        background: var(--fill-primary);
        color: var(--on-fill);
        font-weight: 700;
        box-shadow: 0 4px 16px rgba(0, 212, 255, 0.4);
    }

    .nav-menu.mobile-open .nav-link {
        animation: navItemSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    .nav-menu.mobile-open .nav-link:nth-child(1) { animation-delay: 0.02s; }
    .nav-menu.mobile-open .nav-link:nth-child(2) { animation-delay: 0.05s; }
    .nav-menu.mobile-open .nav-link:nth-child(3) { animation-delay: 0.08s; }
    .nav-menu.mobile-open .nav-link:nth-child(4) { animation-delay: 0.11s; }
    .nav-menu.mobile-open .nav-link:nth-child(5) { animation-delay: 0.14s; }
    .nav-menu.mobile-open .nav-link:nth-child(6) { animation-delay: 0.17s; }

    /* Light Mode for Mobile Nav Menu */
    body.light-theme .nav-menu,
    [data-theme="light"] .nav-menu,
    html[data-theme="light"] .nav-menu {
        background: #ffffff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    }

    body.light-theme .nav-menu .nav-link,
    [data-theme="light"] .nav-menu .nav-link,
    html[data-theme="light"] .nav-menu .nav-link {
        color: #475569;
    }

    body.light-theme .nav-menu .nav-link:hover,
    [data-theme="light"] .nav-menu .nav-link:hover,
    html[data-theme="light"] .nav-menu .nav-link:hover {
        background: #f1f5f9;
        color: #0f172a;
    }

    body.light-theme .nav-menu .nav-link.active,
    [data-theme="light"] .nav-menu .nav-link.active,
    html[data-theme="light"] .nav-menu .nav-link.active {
        background: var(--fill-primary);
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    }
}

/* Phones: the navbar itself was wider than the screen (460px of content on a
   390px device), which pushed the hamburger past the right edge where it could
   not be tapped at all. Drop the scraper pill and the avatar chevron and pull
   the container padding in. */
@media (max-width: 600px) {
    .nav-container { padding: 0 0.85rem; gap: 0.6rem; }
    .nav-actions-group { gap: 0.5rem; }
    .nav-status-pill { display: none; }
    .user-chevron { display: none; }
    .user-avatar-btn { padding: 4px; }
}

/* 320px-class devices need a few more pixels back. */
@media (max-width: 360px) {
    .nav-container { padding: 0 0.6rem; gap: 0.4rem; }
    .brand-name { font-size: 1.05rem; }
}

/* Geo map on phones: the filter panel spans the width, folded to its title
   bar, and the counter bar sits under it instead of 350px from the left. */
.btn-toggle-map-filters { display: none; }
@media (max-width: 768px) {
    .map-floating-sidebar {
        top: 0.75rem; left: 0.75rem; right: 0.75rem; bottom: auto;
        width: auto; height: auto; max-height: calc(100% - 1.5rem);
    }
    .map-floating-sidebar .sidebar-head { padding: 0.75rem 1rem; }
    .map-floating-sidebar:not(.is-open) .sidebar-body { display: none; }
    .map-floating-sidebar:not(.is-open) .sidebar-head { border-bottom: none; }
    .map-floating-sidebar.is-open .sidebar-body { overflow-y: auto; }
    .btn-toggle-map-filters {
        display: inline-flex; align-items: center; gap: 8px;
        height: 32px; padding: 0 12px; cursor: pointer;
        border-radius: var(--radius-md); border: 1px solid var(--glass-border);
        background: var(--glass-input); color: var(--text-primary);
        font-family: inherit; font-size: 0.8rem; font-weight: 600;
    }
    .btn-toggle-map-filters:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
    .btn-toggle-map-filters i { font-size: 0.72rem; color: var(--primary-color); transition: transform 0.2s ease; }
    .map-floating-sidebar.is-open .btn-toggle-map-filters i { transform: rotate(180deg); }
    .map-top-control-bar {
        top: calc(0.75rem + 58px); left: 0.75rem; right: 0.75rem;
        flex-wrap: wrap; gap: 0.5rem;
    }
    .map-top-actions .btn-map-action span { display: none; }
}

/* Leads filters on phones and tablets: folded to their header until opened, so
   the page opens on the leads rather than a screen of dropdowns. */
.sidebar-header-actions { display: flex; align-items: center; gap: 8px; }
.btn-toggle-filters { display: none; }
@media (max-width: 1024px) {
    .btn-toggle-filters {
        display: inline-flex; align-items: center; gap: 8px;
        height: 34px; padding: 0 12px; cursor: pointer;
        border-radius: var(--radius-md); border: 1px solid var(--glass-border);
        background: var(--glass-input); color: var(--text-primary);
        font-family: inherit; font-size: 0.82rem; font-weight: 600;
        transition: var(--transition);
    }
    .btn-toggle-filters:hover { border-color: var(--glass-border-hover); }
    .btn-toggle-filters:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
    .btn-toggle-filters i { font-size: 0.75rem; color: var(--primary-color); transition: transform 0.2s ease; }
    .filter-sidebar.is-open .btn-toggle-filters i { transform: rotate(180deg); }
    .filter-sidebar:not(.is-open) .sidebar-form { display: none; }
    .filter-sidebar:not(.is-open) .sidebar-header { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
}

/* Leads summary cards on phones: two a row instead of one, so the table is not
   pushed a whole screen down. Below 400px the decorative icons give their
   space to the label and the number. */
@media (max-width: 600px) {
    .stats-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats-overview-grid .stat-card { padding: 10px 12px; }
}
@media (max-width: 400px) {
    .stats-overview-grid .stat-icon-wrapper { display: none; }
}

/* Narrow phones: the Leads search takes its own row; the two buttons share
   the next one instead of running past the edge. */
@media (max-width: 480px) {
    .header-actions-group .search-input-pill { flex: 1 1 100%; }
    .header-actions-group .btn-action-outline,
    .header-actions-group .btn-action-primary { flex: 1 1 0; justify-content: center; }
}

@media (max-width: 768px) {
    .nav-left { gap: 16px; }
    .header-actions-group { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .search-input-pill { width: 100%; }
    .content-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .btn-add { width: 100%; justify-content: center; }
    .table-footer-pagination { flex-direction: column; gap: 14px; align-items: center; }
}

/* ==========================================================================
   Global Footer — transparent, single-line, theme-aware
   ========================================================================== */
.lg-global-footer {
    width: 100%;
    padding: 1.25rem 1rem;
    text-align: center;
    background: transparent;
    animation: footerFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

.lg-footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin: 0;
}

/* DataQuartz bold branding — shared by login + app footer */
.dq-bold {
    font-weight: 800;
    color: var(--text-secondary);
}

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

/* ==========================================================================
   Leads Page 360° Lead Dossier Drawer & Interactive Table Responsiveness
   ========================================================================== */

/* Fixed Positioning for Leads Page Dossier Drawer */
#leadsDossierOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#leadsDossierOverlay.open {
    opacity: 1;
    pointer-events: auto;
}

#leadsDossierDrawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(13, 20, 36, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

#leadsDossierDrawer.open {
    transform: translateX(0);
}

#leadsDossierDrawer .dossier-body {
    padding: 1.75rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    height: 100%;
}

/* Light Theme overrides for Leads Dossier */
body.light-theme #leadsDossierOverlay,
[data-theme="light"] #leadsDossierOverlay,
html[data-theme="light"] #leadsDossierOverlay {
    background: rgba(15, 23, 42, 0.35);
}

body.light-theme #leadsDossierDrawer,
[data-theme="light"] #leadsDossierDrawer,
html[data-theme="light"] #leadsDossierDrawer {
    background: rgba(255, 255, 255, 0.98) !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: -20px 0 50px rgba(15, 23, 42, 0.15) !important;
}

/* Interactive Clickable Table Row */
.lead-table-row {
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    user-select: text;
}

.lead-table-row:hover {
    background: var(--glass-bg-hover, rgba(0, 212, 255, 0.05)) !important;
}

.lead-table-row.active-row {
    background: rgba(0, 212, 255, 0.12) !important;
    box-shadow: inset 3px 0 0 var(--primary-color) !important;
}

body.light-theme .lead-table-row:hover,
[data-theme="light"] .lead-table-row:hover,
html[data-theme="light"] .lead-table-row:hover {
    background: rgba(2, 132, 199, 0.05) !important;
}

body.light-theme .lead-table-row.active-row,
[data-theme="light"] .lead-table-row.active-row,
html[data-theme="light"] .lead-table-row.active-row {
    background: rgba(2, 132, 199, 0.09) !important;
    box-shadow: inset 3px 0 0 var(--primary-color) !important;
}

/* Table Responsive Scrolling & Mobile Improvements */
.leads-table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.leads-table-responsive::-webkit-scrollbar {
    height: 6px;
}

.leads-table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.leads-table-responsive::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.leads-table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

@media (max-width: 768px) {
    #leadsDossierDrawer {
        width: 100% !important;
        max-width: 100vw !important;
    }
}

/* ==========================================================================
   My Downloads filter + duplicate-export warning
   Both sit on theme variables, so light and dark follow automatically.
   ========================================================================== */

/* Sidebar: All / Not yet downloaded / Already downloaded */
.dl-status-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-input);
}

.dl-status-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    padding: 0.42rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.dl-status-btn:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

.dl-status-btn.active {
    color: var(--primary-color);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}

.dl-status-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Export modal: what this export would cost before committing to it */
.export-dupe-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.9rem 0 0.4rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--warning-color);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--warning-color) 10%, transparent);
}

/* Once duplicates are excluded this is reassurance, not a warning. */
.export-dupe-warning.is-clean {
    border-color: var(--success-color);
    background: color-mix(in srgb, var(--success-color) 10%, transparent);
}

.edw-icon {
    color: var(--warning-color);
    font-size: 0.95rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.export-dupe-warning.is-clean .edw-icon::before {
    content: "\f058";              /* circle-check */
}

.export-dupe-warning.is-clean .edw-icon {
    color: var(--success-color);
}

/* The quantity or the filters have just changed, so the figures in the box
   describe the export that WAS asked for. Greyed, and with the text replaced
   rather than left to be read as current, until the new answer lands.
   AFTER the is-clean rules on purpose: the two have the same specificity, so
   whichever comes last wins when an element carries both. markExportPreviewStale()
   drops is-clean as well, and this makes the outcome independent of that. */
.export-dupe-warning.is-stale {
    border-color: var(--text-muted);
    background: transparent;
}

.export-dupe-warning.is-stale .edw-icon,
.export-dupe-warning.is-stale .edw-body strong {
    color: var(--text-muted);
}

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

.edw-body strong {
    display: block;
    font-size: 0.84rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.edw-body p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.edw-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.edw-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.edw-action:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .export-dupe-warning { flex-wrap: wrap; }
    .edw-action { width: 100%; justify-content: center; }
}


/* ==========================================================================
   Leads stat cards: loading state and the low-allowance warning
   ========================================================================== */

/* The figures come from a second request, so they arrive a beat after the
   table. Dimming the value is enough of a cue; moving the card is not. */
.stat-card.is-loading .stat-value,
.stat-card.is-loading .stat-trend-badge,
.stat-card.is-loading .stat-subtext {
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.stat-card .stat-value,
.stat-card .stat-trend-badge,
.stat-card .stat-subtext {
    transition: opacity 0.2s ease;
}

/* Only the allowance card uses this, and only when it is nearly spent. */
.stat-card.stat-card-danger {
    border-color: var(--error-color);
}

.stat-card.stat-card-danger .stat-value {
    color: var(--error-color);
}

.stat-card.stat-card-danger .stat-icon-wrapper {
    background: color-mix(in srgb, var(--error-color) 14%, transparent);
    color: var(--error-color);
}

@media (prefers-reduced-motion: reduce) {
    .stat-card .stat-value,
    .stat-card .stat-trend-badge,
    .stat-card .stat-subtext { transition-duration: 0.01ms; }
}


/* ==========================================================================
   Leads page: viewport-locked layout
   --------------------------------------------------------------------------
   The page used to grow with the result set: 50 rows rendered at full height,
   so the pagination footer sat below the fold and the sidebar stopped wherever
   its own content ended. The container is pinned to the viewport instead, and
   the two panes scroll inside themselves.
   ========================================================================== */

.leads-dashboard-container {
    box-sizing: border-box;
    /* The navbar sits above and the site footer below, so both come off the
       viewport -- otherwise the page still scrolled by the footer's 59px. */
    height: calc(100vh - var(--nav-height) - var(--page-footer-h));
    height: calc(100dvh - var(--nav-height) - var(--page-footer-h));
    /* Was `start`, which sized the sidebar to its content and left a short
       column on tall screens. */
    align-items: stretch;
    overflow: hidden;
}

/* --- Filter sidebar: full height, scrolls internally --- */
.filter-sidebar {
    /* sticky was doing the job a real height should: the column now simply
       fills its grid row. */
    position: static;
    top: auto;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    /* Reaching the end of the filters must not start scrolling the page. */
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.filter-sidebar::-webkit-scrollbar { width: 6px; }
.filter-sidebar::-webkit-scrollbar-track { background: transparent; }
.filter-sidebar::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
.filter-sidebar::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* --- Main column: header and cells keep their size, the table absorbs the rest --- */
.main-dashboard-content {
    height: 100%;
    min-height: 0;
}

.content-header-row,
.stats-overview-grid,
.active-filters-panel,
.table-footer-pagination {
    flex: 0 0 auto;
}

.table-card {
    flex: 1 1 auto;
    /* min-height was 400px to give the loading spinner room; as a flex item
       that floor is what pushed the footer off screen on short viewports. */
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* --- The two scrollers --- */

/* Outer: sideways only, and its bar stays visible. */
.leads-table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

/* Inner: up and down, with the bar hidden.
   width:max-content + min-width:100% is what lets the OUTER box do the
   horizontal scrolling -- the inner grows to the table's natural width. */
.leads-table-vscroll {
    height: 100%;
    width: max-content;
    min-width: 100%;
    overflow-y: auto;
    /* This is a scroll container on the x axis too -- one that can never
       scroll, since it is already as wide as the table. Sideways wheel and
       trackpad input therefore lands here first and has to CHAIN OUT to the
       outer box, which is what actually does the horizontal scrolling.
       (overflow-x: clip would avoid the container entirely, but browsers
       compute it back to hidden whenever the other axis scrolls.) */
    overflow-x: hidden;
    scroll-behavior: smooth;
    /* Vertical only, and this is load-bearing: plain
       `overscroll-behavior: contain` also blocked the horizontal chaining
       above, so the table scrolled up and down but never sideways. */
    overscroll-behavior-y: contain;
    overscroll-behavior-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;              /* Firefox */
    -ms-overflow-style: none;           /* old Edge */
}

.leads-table-vscroll::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* The header has to stay put now that the rows scroll under it -- and be
   opaque, or they show through it. */
.leads-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--table-head-solid);
}

/* --------------------------------------------------------------------------
   Stacked layout: the sidebar sits above the table, so pinning the page to the
   viewport would leave the table a few rows tall. The page scrolls again, and
   each pane is capped instead so the footer stays within reach of the table.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .leads-dashboard-container {
        height: auto;
        overflow: visible;
    }

    .filter-sidebar {
        height: auto;
        max-height: 55vh;
        max-height: 55dvh;
    }

    .main-dashboard-content { height: auto; }

    .table-card { flex: none; }

    .leads-table-responsive { height: auto; }

    .leads-table-vscroll {
        height: auto;
        max-height: min(58vh, 560px);
        max-height: min(58dvh, 560px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .filter-sidebar,
    .leads-table-responsive,
    .leads-table-vscroll { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Dossier: People & Revenue (from the Google AI campaign)

   Each row is a label and a value rather than a bare value, because "Rita"
   on its own tells the reader nothing about which person they are looking at.
   -------------------------------------------------------------------------- */
.people-label {
    flex: none;
    min-width: 8.5rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.people-value {
    color: #e2e8f0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Says what the number is before anyone quotes it at a client. */
.dossier-note {
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    color: #64748b;
    font-style: italic;
}

body.light-theme .people-label,
[data-theme="light"] .people-label { color: #64748b; }
body.light-theme .people-value,
[data-theme="light"] .people-value { color: #0f172a; }
body.light-theme .dossier-note,
[data-theme="light"] .dossier-note { color: #64748b; }

@media (max-width: 520px) {
    /* The label and value stack rather than the value being squeezed to
       nothing on a phone. */
    .people-label { min-width: 0; }
    .contact-item-left:has(.people-label) { flex-wrap: wrap; row-gap: 2px; }
}

/* GeoNames requires visible credit wherever its worldwide place data appears. */
.geonames-attribution {
    margin: 0.75rem 1rem;
    color: var(--text-muted, #64748b);
    font-size: 0.7rem;
    line-height: 1.4;
    text-align: right;
}
.geonames-attribution a { color: inherit; text-decoration: underline; }
.geonames-attribution a:hover { color: var(--accent-cyan, #22d3ee); }
.map-page-wrapper > .geonames-attribution {
    position: absolute;
    right: 0.5rem;
    bottom: 0.25rem;
    z-index: 500;
    margin: 0;
    padding: 0.25rem 0.45rem;
    border-radius: 5px;
    background: rgba(6, 11, 21, 0.78);
}


/* ==========================================================================
   <select> controls: one arrow, one position, everywhere
   ========================================================================== */
select.form-input,
select.gai-input,
.modal-body select,
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    /* `right 14px center` rather than a fixed offset: it stays put whatever
       the control's height or padding is. The 36px of right padding is what
       keeps a long option from running under the arrow. */
    background-position: right 14px center;
    padding-right: 36px;
}

/* The light chevron, for every select that draws the shared one -- set on the
   theme rather than on a list of selects, so a page's own select rule (users,
   admin integrations, Google AI) changes colour with the theme too. */
[data-theme="light"],
body.light-theme {
    --select-arrow: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
