/* ═══════════════════════════════════════════════════════════════════
   LEAD ENGINE — LIGHT-THEME COMMAND CENTER
   1920×1080 optimized, compact, high-density
   ═══════════════════════════════════════════════════════════════════ */

/* Google Sheets live-master status strip */
.sheets-strip {
    display: flex; align-items: center; gap: 10px;
    margin: 8px 16px 0; padding: 6px 12px;
    background: var(--card); border: 1px solid var(--border-light);
    border-radius: 8px; font-size: 11px;
}
.sheets-strip.hidden { display: none; }
.sheets-label {
    font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-secondary); font-size: 10px;
}
.sheets-chip {
    font-size: 10px; font-weight: 700; letter-spacing: .4px;
    padding: 2px 8px; border-radius: 4px;
}
.sheets-chip.connected { background: #dcfce7; color: #15803d; }
.sheets-chip.syncing, .sheets-chip.pending { background: #dbeafe; color: #1d4ed8; }
.sheets-chip.retrying { background: #fef3c7; color: #b45309; }
.sheets-chip.error { background: #fee2e2; color: #b91c1c; }
.sheets-chip.disabled, .sheets-chip.offline { background: #f1f5f9; color: #94a3b8; }
.sheets-detail { color: var(--text-secondary); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }

:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --border: #e2e5ea;
    --border-light: #eef0f3;
    --text: #1a1d29;
    --text-secondary: #5f6577;
    --text-muted: #8b90a0;
    --blue: #3b5bdb;
    --blue-light: #e8edfb;
    --blue-hover: #2f4fc7;
    --green: #12b886;
    --green-light: #e6f9f1;
    --amber: #f59f00;
    --amber-light: #fef5e0;
    --red: #e03131;
    --red-light: #fde8e8;
    --teal: #1098ad;
    --teal-light: #e0f4f8;
    --gray: #868e96;
    --gray-light: #f1f3f5;
    --radius: 8px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,.08);
    --gap: 10px;
    --pad: 14px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

.main-scroll {
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════ */
.hdr {
    flex-shrink: 0;
    height: 60px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow);
    z-index: 100;
}

.hdr-left { display: flex; align-items: center; gap: 20px; }

.hdr-logo { display: flex; align-items: center; gap: 10px; }
.hdr-logo-icon {
    width: 28px; height: 28px; color: var(--blue);
    background: var(--blue-light);
    border-radius: 6px;
    padding: 4px;
}
.hdr-title { font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.hdr-subtitle { font-size: 11px; color: var(--text-muted); }

.hdr-status { display: flex; align-items: center; gap: 8px; }
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gray);
    flex-shrink: 0;
}
.status-dot.running { background: var(--green); animation: pulse-dot 1.5s infinite; }
.status-dot.stopping { background: var(--amber); animation: pulse-dot .8s infinite; }
.status-dot.stopped { background: var(--red); }
.status-label { font-weight: 600; font-size: 12px; }
.status-meta { font-size: 11px; color: var(--text-muted); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.3); }
}

.hdr-center { display: flex; align-items: center; }
.hdr-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.hdr-meta strong { color: var(--text); font-weight: 600; }
.meta-sep { width: 1px; height: 12px; background: var(--border); }

.hdr-right { display: flex; align-items: center; gap: 8px; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: none; border-radius: 6px;
    font-family: inherit; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all .15s;
}
.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--gray-light); color: var(--text); }
.btn-stop {
    background: var(--red); color: #fff;
    font-weight: 600; padding: 6px 16px;
}
.btn-stop:hover { background: #c92a2a; }
.btn-start {
    background: var(--green); color: #fff;
    font-weight: 600; padding: 6px 16px;
}
.btn-start:hover { background: #0ca678; }
.btn-start:disabled {
    background: var(--gray-light); color: var(--text-secondary);
    cursor: not-allowed; opacity: 0.6;
}
.btn-lg {
    padding: 10px 24px; font-size: 14px;
}
.loc-actions {
    margin-top: 12px;
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.checkpoint-notice {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    background: var(--amber-light); color: #e67700;
    font-size: 12px; font-weight: 500;
}
.checkpoint-notice svg { flex-shrink: 0; }
.btn-sm {
    padding: 4px 10px; font-size: 11px;
}
.status-badge {
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: var(--gray-light); color: var(--text-secondary);
}
.status-badge.running { background: var(--green-light); color: #0ca678; }
.status-badge.stopping { background: var(--amber-light); color: #e67700; }
.status-badge.stopped { background: var(--red-light); color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════
   CARDS (shared)
   ═══════════════════════════════════════════════════════════════════ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px var(--pad);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600; font-size: 12px; color: var(--text);
}
.card-head svg { color: var(--text-muted); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   HERO ROW — 28% / 44% / 28%
   ═══════════════════════════════════════════════════════════════════ */
.hero {
    display: grid;
    grid-template-columns: 28fr 44fr 28fr;
    gap: var(--gap);
    padding: var(--gap) 20px;
    flex-shrink: 0;
}

/* --- 5A: Target Location --- */
.hero-location { display: flex; flex-direction: column; }
.loc-fields { padding: 10px var(--pad); display: flex; flex-direction: column; gap: 6px; }
.loc-field label {
    display: block; font-size: 10px; font-weight: 500;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px;
    margin-bottom: 2px;
}
.loc-field select {
    width: 100%; padding: 5px 8px; border: 1px solid var(--border);
    border-radius: 5px; font-family: inherit; font-size: 12px;
    background: var(--card); color: var(--text); cursor: pointer;
}
.loc-field select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.loc-niches { padding: 8px var(--pad); }
.loc-niches > label {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.niches-badge {
    background: var(--blue-light); color: var(--blue);
    font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 600;
    text-transform: none; letter-spacing: 0;
}
.niches-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
    max-height: 72px; overflow-y: auto;
}
.niche-chip {
    padding: 3px 8px; border-radius: 4px;
    font-size: 11px; background: var(--gray-light);
    color: var(--text-secondary); cursor: pointer; transition: all .1s;
    white-space: nowrap; border: 1px solid transparent;
}
.niche-chip.active { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.niche-chip:hover { background: var(--blue-light); }

.loc-mode { padding: 6px var(--pad); border-top: 1px solid var(--border-light); }
.loc-limit { padding: 6px var(--pad); border-top: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; }
.loc-limit label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.loc-limit select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 11px; }

.loc-filename { padding: 6px var(--pad); border-top: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; }
.loc-filename label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.loc-filename input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    background: var(--bg);
    color: var(--text);
    min-width: 0;
}
.loc-filename input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
.loc-filename input::placeholder { color: var(--text-muted); font-style: italic; }
.filename-hint { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.toggle-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; cursor: pointer; user-select: none;
}
.toggle-label input { display: none; }
.toggle {
    width: 32px; height: 18px; border-radius: 9px;
    background: var(--gray); position: relative; transition: background .2s;
}
.toggle::after {
    content: ''; position: absolute;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; top: 2px; left: 2px;
    transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle-label input:checked + .toggle { background: var(--blue); }
.toggle-label input:checked + .toggle::after { transform: translateX(14px); }

/* --- 5B: City Progress --- */
.hero-progress { display: flex; flex-direction: column; }
.progress-subtitle { font-weight: 400; color: var(--text-muted); font-size: 11px; margin-left: auto; }

.progress-body {
    display: flex; align-items: center; gap: 20px;
    padding: 14px 20px; flex: 1;
}

.progress-ring-wrap {
    position: relative; width: 110px; height: 110px; flex-shrink: 0;
}
.progress-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border-light); stroke-width: 8; }
.ring-fill {
    fill: none; stroke: var(--blue); stroke-width: 8;
    stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
    stroke-linecap: round; transition: stroke-dashoffset .6s ease;
}
.ring-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.ring-pct { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.ring-label { font-size: 10px; color: var(--text-muted); }

.progress-bars { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.progress-stat-head {
    display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px;
}
.progress-stat-label { font-size: 11px; color: var(--text-secondary); }
.progress-stat-value { font-size: 14px; font-weight: 700; color: var(--text); }
.progress-total {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 8px; border-top: 1px solid var(--border-light);
    font-size: 11px; color: var(--text-secondary);
}
.progress-total strong { color: var(--text); font-weight: 600; }

/* --- 5C: Live Browser Activity (hero row) --- */
.hero > .browser-card { display: flex; flex-direction: column; min-height: 0; }
.hero > .browser-card .browser-viewport {
    flex: 1;
    min-height: 120px;
    margin: 0 var(--pad) 4px;
}
.hero > .browser-card .browser-meta {
    padding: 0 var(--pad) 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px 8px;
    margin-top: auto;
}
.browser-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 0;
    font-size: 10px;
}
.browser-meta-label {
    color: var(--text-muted);
    white-space: nowrap;
}
.browser-meta-value {
    color: var(--text);
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    font-size: 10px;
}
.browser-url {
    color: var(--blue);
    text-decoration: none;
}
.browser-url:hover { text-decoration: underline; }
.browser-query-text {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}
.browser-stage {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background: #f1f5f9;
    color: #64748b;
}
.browser-stage.active {
    background: #dcfce7;
    color: #15803d;
}
.browser-meta-divider {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   BARS (shared)
   ═══════════════════════════════════════════════════════════════════ */
.bar {
    height: 6px; border-radius: 3px; background: var(--border-light);
    overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 3px; transition: width .4s ease;
    width: 0;
}
.bar-blue { background: var(--blue); }
.bar-green { background: var(--green); }
.bar-amber { background: var(--amber); }

/* ═══════════════════════════════════════════════════════════════════
   METRICS STRIP (10 compact cards)
   ═══════════════════════════════════════════════════════════════════ */
.metrics {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: var(--gap);
    padding: 0 20px;
    flex-shrink: 0;
}
.metric {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow);
    min-height: 54px;
}
.metric-icon {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.metric-icon svg { width: 16px; height: 16px; }
.mi-blue   { background: var(--blue-light); color: var(--blue); }
.mi-indigo { background: #e8edfb; color: var(--blue); }
.mi-green  { background: var(--green-light); color: var(--green); }
.mi-amber  { background: var(--amber-light); color: var(--amber); }
.mi-teal   { background: var(--teal-light); color: var(--teal); }
.mi-cyan   { background: #e0f4f8; color: var(--teal); }
.mi-red    { background: var(--red-light); color: var(--red); }
.mi-gray   { background: var(--gray-light); color: var(--gray); }
.metric-body { min-width: 0; }
.metric-val { font-size: 18px; font-weight: 700; line-height: 1; }
.metric-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════
   PROCESSING ROW — Pipeline | Qualification (2 columns)
   ═══════════════════════════════════════════════════════════════════ */
.proc-row {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: var(--gap);
    padding: var(--gap) 20px;
    flex-shrink: 0;
}

/* --- 7A: Currently Processing --- */
.proc-now { display: flex; flex-direction: column; }

/* --- Browser Activity viewport (shared) --- */
.browser-viewport {
    position: relative;
    margin: 0 var(--pad) 6px;
    height: 200px;
    background: #0d1117;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.browser-screenshot {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.browser-screenshot.active { display: block; }
.browser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #555;
    font-size: 12px;
}
.browser-placeholder.hidden { display: none; }
.browser-placeholder span:first-child { font-size: 28px; }
.browser-live-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}
.browser-live-label.live {
    background: #dcfce7;
    color: #15803d;
}
.browser-live-label.offline {
    background: #f1f5f9;
    color: #94a3b8;
}
/* Authoritative backend lifecycle states for the Browser Activity panel */
.browser-live-label.starting,
.browser-live-label.connecting,
.browser-live-label.stopping {
    background: var(--amber-light, #fef3c7);
    color: #b45309;
}
.browser-live-label.active,
.browser-live-label.navigating,
.browser-live-label.extracting,
.browser-live-label.crawling {
    background: var(--green-light, #dcfce7);
    color: #15803d;
}
.browser-live-label.idle,
.browser-live-label.stopped {
    background: var(--blue-light, #dbeafe);
    color: #1d4ed8;
}
.browser-live-label.error {
    background: #fee2e2;
    color: #b91c1c;
}
.now-business {
    padding: 10px var(--pad) 2px;
    font-size: 14px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-location {
    padding: 0 var(--pad);
    font-size: 11px; color: var(--text-muted);
}
.now-field {
    padding: 6px var(--pad);
    display: flex; align-items: baseline; gap: 8px;
}
.now-field-label {
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0;
    width: 64px;
}
.now-field-value {
    font-size: 11px; color: var(--blue);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now-stage {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; color: var(--blue);
    padding: 2px 8px; border-radius: 4px; background: var(--blue-light);
}
.now-activity {
    font-size: 11px; color: var(--text-secondary);
    line-height: 1.3; padding: 4px 0;
}

.live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--green);
    margin-left: auto; animation: pulse-dot 1.5s infinite;
}
.live-dot-sm {
    width: 6px; height: 6px; border-radius: 50%; background: var(--green);
    animation: pulse-dot 1.5s infinite;
}

/* --- 7B: Processing Pipeline --- */
.proc-pipeline { display: flex; flex-direction: column; }
.pipeline {
    display: flex; align-items: center; justify-content: center;
    padding: 14px 16px; gap: 4px; flex-wrap: nowrap;
}
.pipe-node {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: 6px;
    transition: all .2s; min-width: 64px;
}
.pipe-icon {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    background: var(--gray-light); color: var(--text-muted);
    transition: all .2s;
}
.pipe-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

.pipe-node.done .pipe-icon { background: var(--green-light); color: var(--green); }
.pipe-node.done .pipe-label { color: var(--green); font-weight: 500; }
.pipe-node.active .pipe-icon {
    background: var(--blue); color: #fff;
    box-shadow: 0 0 0 4px var(--blue-light);
    animation: pipe-pulse 1.5s infinite;
}
.pipe-node.active .pipe-label { color: var(--blue); font-weight: 600; }
.pipe-arrow { color: var(--text-muted); font-size: 14px; padding: 0 2px; }

@keyframes pipe-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--blue-light); }
    50% { box-shadow: 0 0 0 8px rgba(59,91,219,.12); }
}

.pipe-context {
    padding: 10px 16px; border-top: 1px solid var(--border-light);
    background: var(--gray-light);
}
.pipe-context-text { font-size: 12px; font-weight: 500; color: var(--text); }
.pipe-context-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* --- 7C: Qualification Breakdown --- */
.proc-qual { display: flex; flex-direction: column; }
.qual-body {
    display: flex; align-items: center; gap: 16px;
    padding: 12px var(--pad); flex: 1;
}
.qual-donut {
    position: relative; width: 100px; height: 100px; flex-shrink: 0;
}
.qual-donut svg { width: 100px; height: 100px; transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: var(--border-light); stroke-width: 10; }
.donut-fill {
    fill: none; stroke: var(--green); stroke-width: 10;
    stroke-dasharray: 314.16; stroke-dashoffset: 314.16;
    stroke-linecap: round; transition: stroke-dashoffset .5s ease;
}
.donut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.donut-pct { font-size: 20px; font-weight: 700; line-height: 1; }
.donut-label { font-size: 9px; color: var(--text-muted); }

.qual-legend { flex: 1; min-width: 0; }
.qual-row {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 0; font-size: 11px;
}
.qual-row strong { margin-left: auto; font-weight: 600; }
.qual-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.q-green  { background: var(--green); }
.q-red    { background: var(--red); }
.q-amber  { background: var(--amber); }
.q-gray   { background: var(--gray); }
.q-teal   { background: var(--teal); }

/* ═══════════════════════════════════════════════════════════════════
   BOTTOM ROW — 70% / 30%
   ═══════════════════════════════════════════════════════════════════ */
.bottom {
    display: grid;
    grid-template-columns: 70fr 30fr;
    gap: var(--gap);
    padding: 0 20px var(--gap);
    flex: 1;
    min-height: 0;
}

/* --- 8A: Live Leads --- */
.bottom-leads { display: flex; flex-direction: column; min-height: 0; }

.leads-search {
    display: flex; gap: 8px; padding: 8px var(--pad);
    border-bottom: 1px solid var(--border-light);
}
.leads-search input, .leads-search select {
    padding: 4px 8px; border: 1px solid var(--border);
    border-radius: 4px; font-family: inherit; font-size: 11px;
}
.leads-search input { flex: 1; }
.leads-search input:focus, .leads-search select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.leads-table-wrap { flex: 1; overflow-y: auto; min-height: 0; }
.leads-table {
    width: 100%; border-collapse: collapse; font-size: 11px;
}
.leads-table th {
    position: sticky; top: 0; z-index: 1;
    background: var(--gray-light); padding: 6px 8px;
    text-align: left; font-weight: 600; font-size: 10px;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .3px; border-bottom: 1px solid var(--border);
}
.leads-table td {
    padding: 5px 8px; border-bottom: 1px solid var(--border-light);
    max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: middle;
}
.leads-table tr:hover td { background: #fafbfc; }
.leads-table .lead-new { animation: lead-flash .6s ease; }
@keyframes lead-flash {
    0% { background: var(--blue-light); }
    100% { background: transparent; }
}
.lead-status {
    padding: 2px 6px; border-radius: 3px;
    font-size: 10px; font-weight: 500; white-space: nowrap;
}
.lead-status.qualified { background: var(--green-light); color: #0ca678; }
.lead-status.rejected { background: var(--red-light); color: var(--red); }
.lead-status.pending { background: var(--amber-light); color: #e67700; }
.lead-status.no_website { background: var(--teal-light); color: var(--teal); }
.lead-status.generic { background: var(--gray-light); color: var(--gray); }
.lead-status.duplicate { background: var(--blue-light); color: var(--blue); }
.lead-ai, .lead-chat {
    width: 18px; height: 18px; border-radius: 3px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px;
}
.lead-ai.yes { background: var(--green-light); color: var(--green); }
.lead-ai.no  { background: var(--gray-light); color: var(--text-muted); }
.lead-chat.yes { background: var(--blue-light); color: var(--blue); }
.lead-chat.no  { background: var(--gray-light); color: var(--text-muted); }
.lead-ai.unknown, .lead-chat.unknown { background: var(--amber-light); color: #b45309; }

.leads-pagination {
    display: flex; justify-content: center; gap: 4px;
    padding: 8px var(--pad);
    border-top: 1px solid var(--border-light);
}
.page-btn {
    padding: 3px 8px; border: 1px solid var(--border);
    border-radius: 4px; background: var(--card);
    font-family: inherit; font-size: 11px; cursor: pointer;
    color: var(--text-secondary);
}
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:hover:not(.active) { background: var(--gray-light); }

/* --- 8B: Live Activity --- */
.bottom-activity { display: flex; flex-direction: column; min-height: 0; }
.activity-filter {
    margin-left: auto; padding: 2px 6px;
    border: 1px solid var(--border); border-radius: 4px;
    font-family: inherit; font-size: 10px;
}
.activity-feed {
    flex: 1; overflow-y: auto; padding: 8px var(--pad); min-height: 0;
    font-size: 11px;
}
.activity-empty { color: var(--text-muted); text-align: center; padding: 20px 0; }
.activity-item {
    display: flex; gap: 6px; padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
    animation: activity-in .2s ease;
}
@keyframes activity-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.activity-time { color: var(--text-muted); font-size: 10px; flex-shrink: 0; width: 60px; font-variant-numeric: tabular-nums; }
.activity-icon { width: 16px; text-align: center; flex-shrink: 0; }
.activity-msg { color: var(--text-secondary); }
.activity-msg strong { color: var(--text); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.ftr {
    height: 32px; background: var(--card);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; font-size: 11px; color: var(--text-secondary);
    flex-shrink: 0;
}
.ftr-left { display: flex; align-items: center; gap: 12px; }
.ftr-left strong { color: var(--text); }
.ftr-right { display: flex; align-items: center; gap: 16px; }
.ftr-status { display: flex; align-items: center; gap: 4px; }
.ftr-status strong { color: var(--text); }
.status-dot-sm {
    width: 6px; height: 6px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}
.status-dot-sm.green { background: var(--green); }

/* ═══════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════ */
.toasts {
    position: fixed; top: 70px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 9999; pointer-events: none;
}
.toast {
    padding: 8px 14px; border-radius: 6px;
    font-size: 12px; font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: toast-in .2s ease;
    pointer-events: auto;
}
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
.toast-info { background: var(--blue); color: #fff; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   HIDDEN UTILITY
   ═══════════════════════════════════════════════════════════════════ */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d3da; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b4bf; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Below 1440px
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1440px) {
    .hero { grid-template-columns: 24fr 50fr 26fr; }
    .metrics { grid-template-columns: repeat(5, 1fr); }
    .proc-row { grid-template-columns: 55fr 45fr; }
    .bottom { grid-template-columns: 65fr 35fr; }
}
@media (max-width: 1280px) {
    .hero { grid-template-columns: 1fr; }
    .hero-progress { order: -1; }
    .proc-row { grid-template-columns: 1fr 1fr; }
    .proc-qual { grid-column: 1 / -1; }
    .metrics { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1024px) {
    .metrics { grid-template-columns: repeat(3, 1fr); }
    .proc-row { grid-template-columns: 1fr; }
    .bottom { grid-template-columns: 1fr; }
    .hdr-center { display: none; }
}
