/* ==========================================================================
   Infinity Lead Finder — UI
   Dark, glassmorphism, blue/cyan accents. No build step required.
   ========================================================================== */

:root {
    --bg: #060a16;
    --bg-2: #0a1022;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-solid: #0d1428;
    --border: rgba(148, 170, 255, 0.12);
    --border-strong: rgba(148, 170, 255, 0.22);
    --text: #e7ecfb;
    --text-2: #b7c2e0;
    --muted: #8391b5;
    --primary: #155dfd;
    --primary-2: #0da2e7;
    --primary-soft: rgba(21, 93, 253, 0.16);
    --cyan-soft: rgba(13, 162, 231, 0.15);
    --hot: #ff5a5f;
    --high: #f6a623;
    --medium: #0da2e7;
    --low: #6b7a99;
    --pass: #22c55e;
    --warn: #f5b041;
    --fail: #ef4444;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --sidebar: 252px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 14px/1.5 var(--font);
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 85% -10%, rgba(21, 93, 253, 0.16), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(13, 162, 231, 0.10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: #5cc8ff; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; }
.icon.sm { width: 14px; height: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); }
a.strong:hover { color: var(--primary-2); }
.text-danger { color: var(--fail) !important; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; }
.link { color: var(--primary-2); font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Layout ---------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 18px;
    padding: 18px 14px;
    background: linear-gradient(180deg, rgba(13, 20, 40, 0.92), rgba(8, 12, 26, 0.92));
    border-right: 1px solid var(--border);
    backdrop-filter: blur(14px);
    overflow-y: auto;
    z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; color: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-mark { flex: none; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 9px 12px; border-radius: 10px;
    color: var(--text-2); font: inherit; font-weight: 500;
    background: none; border: 0; cursor: pointer; text-align: left;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(21, 93, 253, 0.32), rgba(13, 162, 231, 0.12));
    box-shadow: inset 2px 0 0 var(--primary-2);
}
.nav-link .icon { opacity: .9; }
.nav-badge { margin-left: auto; background: var(--fail); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; }
.nav-dot.hot { background: var(--hot); box-shadow: 0 0 10px var(--hot); }
.nav-logout { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.sidebar-foot { margin-top: auto; }
.osm-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--border); border-radius: 99px; }
.osm-pill .icon { width: 14px; height: 14px; }
.sidebar-backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 28px;
    background: rgba(6, 10, 22, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; white-space: nowrap; }
.topbar-app { font-weight: 650; }
.topbar-sep { color: var(--muted); }
.topbar-page { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.topbar-search {
    flex: 1; max-width: 420px; margin-left: auto;
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px; height: 38px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar-search .icon { color: var(--muted); }
.topbar-search input[type=search] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; outline: 0; box-shadow: none; color: var(--text); font: inherit; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.only-mobile { display: none !important; }

.content { padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1560px; width: 100%; }

/* ---------- Buttons --------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: 10px;
    font: inherit; font-weight: 600; white-space: nowrap;
    color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
    cursor: pointer; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(21, 93, 253, 0.35); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(21, 93, 253, 0.5); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: #ff8a8a; border-color: rgba(239, 68, 68, .4); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 22px; }
.btn.block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.icon-btn {
    position: relative; display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: #fff; border-color: var(--border); }
.icon-btn .icon { width: 17px; height: 17px; }
.dot-count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--fail); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

/* ---------- Dropdowns ------------------------------------------------------ */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
    display: none; flex-direction: column; padding: 6px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow);
    z-index: 50;
}
.dropdown-menu.wide { width: 320px; }
.dropdown.open .dropdown-menu { display: flex; }
.dropdown-head { padding: 8px 10px; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.dropdown-item:hover { background: var(--surface-2); color: #fff; }
.dropdown-foot { padding: 9px 10px; border-top: 1px solid var(--border); margin-top: 4px; font-weight: 500; }
.pad { padding: 8px 10px; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; background: none; border: 1px solid transparent; color: var(--text); cursor: pointer; font: inherit; }
.user-btn:hover { background: var(--surface-2); border-color: var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user-meta small { color: var(--muted); font-size: 11px; }

/* ---------- Cards & page head --------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    backdrop-filter: blur(10px);
    min-width: 0;
}
.card.no-pad { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .icon { color: var(--primary-2); }
.narrow-card { max-width: 520px; }
h3.sub { margin: 18px 0 10px; color: var(--text-2); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-2.wide-right { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

.callout {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 16px; border-radius: 12px;
    background: var(--cyan-soft); border: 1px solid rgba(13, 162, 231, 0.3); color: var(--text-2);
}
.callout .icon { color: var(--primary-2); margin-top: 1px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; border: 1px solid; }
.alert.error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: #fecaca; }
.alert.success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); color: #bbf7d0; }
.alert.warn { background: rgba(245, 176, 65, .1); border-color: rgba(245, 176, 65, .35); color: #fde68a; margin-bottom: 14px; }

/* ---------- Stats ------------------------------------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    transition: border-color .15s, transform .15s;
}
a.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); color: var(--text); }
.stat-card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; background: var(--tone, var(--primary)); opacity: .10; filter: blur(10px); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--primary)) 18%, transparent); color: var(--tone, var(--primary)); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tone-blue { --tone: #3b7bff; }
.tone-hot, .tone-red { --tone: var(--hot); }
.tone-red { --tone: var(--fail); }
.tone-high { --tone: var(--high); }
.tone-cyan { --tone: var(--primary-2); }
.tone-green { --tone: var(--pass); }

/* ---------- Badges, tags, scores ------------------------------------------ */
.badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.badge.pass { background: rgba(34, 197, 94, .14); color: #4ade80; border-color: rgba(34, 197, 94, .3); }
.badge.warn { background: rgba(245, 176, 65, .14); color: #fbbf24; border-color: rgba(245, 176, 65, .3); }
.badge.fail { background: rgba(239, 68, 68, .14); color: #f87171; border-color: rgba(239, 68, 68, .3); }
.badge.missing { background: rgba(131, 145, 181, .12); color: #a5b1d1; border-color: rgba(131, 145, 181, .25); }
.badge.grade-hot { background: rgba(255, 90, 95, .16); color: #ff7b7f; border-color: rgba(255, 90, 95, .4); }
.badge.grade-high { background: rgba(246, 166, 35, .15); color: #fbbf3c; border-color: rgba(246, 166, 35, .4); }
.badge.grade-medium { background: rgba(13, 162, 231, .15); color: #38bdf8; border-color: rgba(13, 162, 231, .4); }
.badge.grade-low { background: rgba(107, 122, 153, .16); color: #9fb0d0; border-color: rgba(107, 122, 153, .35); }

.score { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 7px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-hot { background: rgba(255, 90, 95, .16); color: #ff7b7f; }
.score-high { background: rgba(246, 166, 35, .15); color: #fbbf3c; }
.score-medium { background: rgba(13, 162, 231, .15); color: #38bdf8; }
.score-low { background: rgba(107, 122, 153, .16); color: #9fb0d0; }
.score-web { background: var(--surface-2); color: var(--text-2); }

.tag { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: var(--primary-soft); color: #9cc0ff; border: 1px solid rgba(21, 93, 253, .25); white-space: nowrap; }
.tag.more { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.tag.lg { font-size: 13px; padding: 5px 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }

.status-pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.st-new { --st: #8ea2c9; }
.st-qualified { --st: #38bdf8; }
.st-contacted { --st: #818cf8; }
.st-follow_up { --st: #fbbf24; }
.st-interested { --st: #34d399; }
.st-proposal { --st: #c084fc; }
.st-won { --st: #22c55e; }
.st-lost { --st: #f87171; }
.st-not_interested { --st: #94a3b8; }
.status-pill[class*="st-"] { color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent); }

/* ---------- Forms ------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=date], input:not([type]), select, textarea {
    width: 100%; min-width: 0;
    height: 40px; padding: 0 12px;
    font: inherit; color: var(--text);
    background: rgba(5, 9, 20, 0.6);
    border: 1px solid var(--border-strong); border-radius: 10px;
    outline: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238391b5' stroke-width='3' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center; }
select option { background: #0d1428; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled, select:disabled { opacity: .6; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; color: var(--text-2); user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-actions .muted { margin-right: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Search page -------------------------------------------------------- */
.search-card { padding: 20px; }
.search-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.search-form .field { flex: 1 1 140px; }
.search-form .field.grow-2 { flex: 2 1 220px; }
.search-form .check { height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.chip { padding: 4px 11px; border-radius: 99px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--primary); color: #fff; background: var(--primary-soft); }

.steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 11px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); color: var(--muted); }
.steps li strong { display: block; font-size: 13px; }
.steps li small { display: block; font-size: 12px; margin-top: 2px; word-break: break-word; }
.step-dot { flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border-strong); }
.steps li.active { color: var(--text); border-color: rgba(21, 93, 253, .5); background: var(--primary-soft); }
.steps li.active .step-dot { border-color: var(--primary-2); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--text-2); }
.steps li.done .step-dot { background: var(--pass); border-color: var(--pass); }
.steps li.skipped .step-dot { border-style: dashed; }
.steps li.error { border-color: rgba(239, 68, 68, .5); }
.steps li.error .step-dot { background: var(--fail); border-color: var(--fail); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .35s ease; }
#progress-text { margin-top: 8px; }
#search-error { margin-top: 12px; }

.results-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-chip { display: flex; flex-direction: column; align-items: center; min-width: 70px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.summary-chip strong { font-size: 18px; }
.summary-chip span { font-size: 11px; color: var(--muted); }
.results-grid { display: flex; flex-direction: column; gap: 20px; }
.results-map { height: 420px; }

/* ---------- Tables ------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255, 255, 255, .02); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 9px 12px; }
.sort-link { color: inherit; }
.sort-link.active, .sort-link:hover { color: var(--text); }
.cell-business { min-width: 190px; }
.cell-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-website { min-width: 120px; }
.cell-opps { min-width: 170px; }
.cell-message { max-width: 380px; }
.action-row { display: flex; gap: 2px; align-items: center; }
.status-select { height: 32px; font-size: 12.5px; font-weight: 600; padding: 0 28px 0 10px; color: var(--st, var(--text)); min-width: 128px; }
.status-select.lg { height: 38px; }
.page-actions .status-select { width: auto; }
.mini-select { height: 30px; font-size: 12px; padding: 0 26px 0 8px; width: auto; }
.leads-table tr.is-busy { opacity: .55; }
.leads-table { font-size: 13px; }
.leads-table th, .leads-table td { padding: 10px 9px; }
.leads-table th:first-child, .leads-table td:first-child { padding-left: 16px; }
.leads-table .cell-business { min-width: 170px; max-width: 240px; }
.leads-table .cell-location { max-width: 130px; }
.leads-table .cell-email { max-width: 130px; }
.leads-table .cell-website { min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.leads-table .cell-opps { min-width: 130px; max-width: 170px; }
.leads-table .tag { white-space: normal; }
.leads-table .status-select { min-width: 104px; }
.leads-table .cell-actions .action-row { display: grid; grid-template-columns: repeat(3, 30px); gap: 2px; }
.leads-table .cell-actions .icon-btn { width: 30px; height: 30px; }

.pagination { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.page-link { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; }

/* ---------- Filters ------------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { flex: 1 1 140px; }
.filters .field.grow-2 { flex: 2 1 220px; }
.filters .field.narrow { flex: 0 1 96px; }
.filter-actions { display: flex; gap: 8px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.segmented a { display: inline-flex; gap: 6px; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.segmented a.active { background: var(--primary-soft); color: #fff; }
.segmented .icon { width: 15px; height: 15px; }
.inline-search { display: flex; gap: 8px; }

/* ---------- Lists, tabs, bars ------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-main { display: flex; flex-direction: column; min-width: 0; }
.list-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-side { display: flex; gap: 8px; align-items: center; flex: none; }
.empty { padding: 18px 0; text-align: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 8px; overflow-x: auto; }
.tab { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--primary-2); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); }
.tab .count.danger { background: rgba(239, 68, 68, .2); color: #fca5a5; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tabs.links { margin-bottom: 0; }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bars a { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; color: var(--text-2); font-size: 12.5px; }
.bars a:hover { color: var(--text); }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 2px; border-radius: 99px; background: var(--st, var(--primary)); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.grade-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.grade-chip { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 11px; border: 1px solid var(--border); color: var(--text); }
.grade-chip strong { font-size: 20px; }
.grade-chip span { font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.grade-chip.grade-hot span { color: var(--hot); }
.grade-chip.grade-high span { color: var(--high); }
.grade-chip.grade-medium span { color: var(--medium); }
.grade-chip.grade-low span { color: var(--low); }

.empty-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; }

/* ---------- Lead detail ------------------------------------------------------------ */
.lead-grid { align-items: start; }
.score-card { display: flex; gap: 22px; align-items: flex-start; }
.score-card.grade-bg-hot { background: linear-gradient(135deg, rgba(255, 90, 95, .12), var(--surface) 60%); border-color: rgba(255, 90, 95, .3); }
.score-card.grade-bg-high { background: linear-gradient(135deg, rgba(246, 166, 35, .10), var(--surface) 60%); border-color: rgba(246, 166, 35, .28); }
.score-ring {
    --c: var(--low);
    flex: none; width: 104px; height: 104px; border-radius: 50%;
    display: grid; place-items: center; align-content: center;
    background: conic-gradient(var(--c) calc(var(--val) * 1%), rgba(255, 255, 255, .07) 0);
    position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface-solid); }
.score-ring span, .score-ring small { position: relative; }
.score-ring span { font-size: 30px; font-weight: 750; line-height: 1; }
.score-ring small { color: var(--muted); font-size: 11px; }
.score-ring.score-hot { --c: var(--hot); background-color: transparent; }
.score-ring.score-high { --c: var(--high); }
.score-ring.score-medium { --c: var(--medium); }
.score-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.score-body h3 { margin-bottom: 6px; color: var(--text-2); }
.reasons { margin: 0; padding-left: 18px; color: var(--text); }
.reasons li { margin: 3px 0; }
.reasons li::marker { color: var(--primary-2); }

.details { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.details dt { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.details dd { margin: 0; word-break: break-word; }

.audit-score { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); margin-bottom: 14px; }
.audit-score .big { font-size: 30px; display: block; }
.audit-score .big small { font-size: 13px; color: var(--muted); font-weight: 500; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; }
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table th { text-align: left; width: 150px; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 9px 0; vertical-align: top; }
.audit-table td { padding: 9px 0; border-bottom: 1px solid var(--border); word-break: break-word; }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-value { color: var(--text-2); font-size: 12.5px; }
.findings { margin: 0; padding-left: 18px; color: var(--text-2); }
.findings li { margin: 4px 0; }
.empty-inline { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px dashed var(--border-strong); }
.empty-inline .icon { color: var(--warn); margin-top: 2px; }
.empty-inline .btn { margin-top: 10px; }

.timeline { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); }
.timeline li p { margin-bottom: 4px; word-break: break-word; }
.timeline details summary { cursor: pointer; color: var(--muted); margin: 4px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.note-inline { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ---------- Maps ---------------------------------------------------------------- */
.map { width: 100%; height: 560px; background: #0b1224; }
.map-card.tall .map { height: calc(100vh - 290px); min-height: 460px; }
.small-map { height: 260px; }
.map-caption { display: flex; gap: 6px; align-items: center; padding: 8px 12px; }
.map-caption .icon { width: 14px; height: 14px; }
.leaflet-container { font: inherit; background: #0b1224; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.5; }
.leaflet-popup-content a { color: var(--primary-2); }
.leaflet-control-attribution { background: rgba(6, 10, 22, .75) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: var(--surface-solid) !important; color: var(--text) !important; border-color: var(--border) !important; }
.lead-marker { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, .25); background: var(--low); }
.lead-marker.HOT { background: var(--hot); }
.lead-marker.HIGH { background: var(--high); }
.lead-marker.MEDIUM { background: var(--medium); }
.center-marker { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(21, 93, 253, .25) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: rgba(21, 93, 253, .85) !important; color: #fff !important; font-weight: 700; }
.popup-title { font-weight: 700; margin-bottom: 4px; }

/* ---------- Settings ---------------------------------------------------------------- */
.settings-form { display: flex; flex-direction: column; gap: 20px; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rules-grid .field span { font-weight: 500; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(13, 20, 40, .85); border: 1px solid var(--border-strong); backdrop-filter: blur(12px); }

/* ---------- Modals & toasts --------------------------------------------------------- */
.modal { padding: 0; border: 0; background: transparent; color: var(--text); max-width: 480px; width: calc(100% - 32px); }
.modal::backdrop { background: rgba(2, 5, 14, .7); backdrop-filter: blur(4px); }
.modal-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-sub { margin-top: -8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { min-width: 240px; max-width: 360px; padding: 11px 14px; border-radius: 11px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-weight: 500; animation: toast-in .2s ease; }
.toast.success { border-left: 3px solid var(--pass); }
.toast.error { border-left: 3px solid var(--fail); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Footer ---------------------------------------------------------------- */
.page-foot { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.data-notice { display: flex; gap: 8px; color: var(--text-2); }
.data-notice .icon { width: 15px; height: 15px; color: var(--primary-2); margin-top: 1px; }

/* ---------- Login ---------------------------------------------------------------- */
.auth-page { display: grid; place-items: center; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 430px; }
.auth-card { display: flex; flex-direction: column; gap: 18px; padding: 30px; border-radius: 20px; background: rgba(13, 20, 40, .75); border: 1px solid var(--border-strong); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.auth-brand { display: flex; gap: 14px; align-items: center; }
.auth-brand h1 { font-size: 21px; }
.auth-note { display: flex; gap: 8px; font-size: 12px; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--border); }
.auth-note .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* ---------- Responsive ----------------------------------------------------------- */
@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .grid-2, .grid-2.wide-left, .grid-2.wide-right { grid-template-columns: minmax(0, 1fr); }
    .form-grid.three, .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-3, .span-4 { grid-column: span 2; }
    .topbar-page { display: none; }
    .topbar-sep { display: none; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .22s ease; }
    body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 35; }
    .only-mobile { display: inline-grid !important; }
    .topbar { padding: 10px 16px; gap: 10px; }
    .topbar-search { margin-left: 0; }
    .user-meta { display: none; }
    .content { padding: 18px 16px 32px; }
    .stat-grid, .stat-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .map { height: 380px; }

    /* Tables become cards */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
    .table td { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px; padding: 5px 0; border: 0; text-align: right; max-width: none; white-space: normal; }
    .table td::before { content: attr(data-label); margin-right: auto; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: none; }
    .table td:first-child, .table td.cell-business { display: block; text-align: left; padding-bottom: 8px; }
    .table td:first-child::before, .table td.cell-business::before { display: none; }
    .table td.cell-opps { display: block; text-align: left; }
    .table td.cell-opps::before { display: block; margin-bottom: 4px; }
    .leads-table td.cell-location, .leads-table td.cell-email, .leads-table td.cell-website, .leads-table td.cell-opps, .leads-table td.cell-business { max-width: none; }
    .leads-table .cell-actions .action-row { display: flex; }
    .topbar-title { display: flex; }
    .topbar-sep, .topbar-page { display: none; }
    .cell-opps { flex-wrap: wrap; justify-content: flex-end; }
    .cell-email { overflow: visible; }
    .table-wrap { overflow: visible; }
}
@media (max-width: 600px) {
    h1 { font-size: 20px; }
    .stat-grid, .stat-grid.three, .stat-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 13px 14px; }
    .stat-value { font-size: 23px; }
    .steps { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid.three, .form-grid.four, .form-row { grid-template-columns: minmax(0, 1fr); }
    .span-2, .span-3, .span-4 { grid-column: auto; }
    .page-actions { width: 100%; }
    .page-actions .btn, .page-actions .segmented { flex: 1 1 auto; }
    .score-card { flex-direction: column; align-items: center; text-align: center; }
    .reasons { text-align: left; }
    .details { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .details dd { margin-bottom: 10px; }
    .audit-table th { width: 110px; }
    .topbar-search { display: none; }
    .bars a { grid-template-columns: 92px 1fr 30px; }
    .filters .field, .filters .field.narrow { flex: 1 1 calc(50% - 6px); }
    .search-form .field, .search-form .field.grow-2 { flex: 1 1 100%; }
    .search-form .btn { width: 100%; }
    .dropdown-menu.wide { width: min(320px, calc(100vw - 32px)); }
    .toast-stack { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Google listing ------------------------------------------------------- */
.google-rating { color: #fbbf24; letter-spacing: 1px; }
.google-attrib { margin-top: 12px; }
.provider-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; }
.provider-note .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* ---------- CSV import ------------------------------------------------------------ */
.modal.modal-wide { max-width: 600px; }
.import-intro ul { margin: 4px 0 8px; padding-left: 18px; }
.import-intro li { margin: 2px 0; }
.import-progress { display: flex; flex-direction: column; gap: 8px; }
.import-errors { margin: 0; padding-left: 18px; max-height: 120px; overflow: auto; }
input[type=file] { height: auto; padding: 9px 12px; }

/* ---------- Outreach drafts ----------------------------------------------------- */
.outreach-basis { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 12px; }
