:root {
    --primary: #1e3a8a;
    --primary-light: #2563eb;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --bg: #f1f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 250px;
    --nav-height: 60px;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* When dashboard is active, prevent body scrolling */
body.dashboard-active {
    height: 100vh;
    overflow: hidden;
}

/* ── Top Navigation ────────────────────────────────────── */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 2000;
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    /* When inside nav-dashboard-layout, this sits in the first grid column */
}

.nav-brand span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text);
}

/* Dashboard nav layout modifiers */
.nav-dashboard-layout {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-center-tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: flex-end;
}

.btn-nav-text {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color var(--transition);
}

.btn-nav-text:hover,
.btn-nav-text.active {
    color: var(--primary);
}

.nav-user-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-nav-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    flex: none;
}

.btn-nav-secondary:hover {
    background: var(--bg);
    border-color: var(--primary-light);
}

.btn-accent {
    background: var(--accent);
    color: white;
    flex: none;
}

.btn-accent:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* ── Auth Modal ────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color var(--transition);
}

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

.modal-brand {
    text-align: center;
    margin-bottom: 20px;
}

.modal-brand h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.modal-brand h2 span {
    color: var(--accent);
}

/* ── Landing Page ──────────────────────────────────────── */

#landing-page {
    padding-top: var(--nav-height);
}

/* Hero */

.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    padding: 80px 32px 72px;
    text-align: center;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero-sub {
    font-size: clamp(15px, 2vw, 18px);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    flex: none;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Credibility Bar */

.credibility-bar {
    display: flex;
    justify-content: center;
    gap: 0;
    background: white;
    border-bottom: 1px solid var(--border);
}

.cred-card {
    flex: 1;
    max-width: 240px;
    padding: 28px 24px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.cred-card:last-child {
    border-right: none;
}

.cred-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.cred-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
    font-weight: 600;
}

/* Features Section */

.features-section {
    padding: 64px 32px;
    text-align: center;
    max-width: 960px;
    margin: 0 auto;
}

.features-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    text-align: left;
}

.feature-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.feature-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.section-sub {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 32px;
}

/* Recent Feed Section */

.recent-feed-section {
    padding: 64px 32px;
    text-align: center;
    max-width: 960px;
    margin: 0 auto;
}

.recent-feed-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.recent-feed {
    margin-top: 24px;
    text-align: left;
}

.feed-loading {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    padding: 24px;
}

.feed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.feed-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
}

.feed-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.feed-table tr:hover td {
    background: rgba(37, 99, 235, 0.03);
}

.feed-table .feed-type {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg);
    color: var(--primary);
    white-space: nowrap;
}

.feed-table .feed-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.feed-table .feed-status-active {
    color: #16a34a;
}

.feed-table .feed-status-closed {
    color: var(--muted);
}

.feed-cta {
    margin-top: 32px;
    padding: 24px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.feed-cta p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 14px;
}

.feed-cta .btn {
    flex: none;
}

/* Pricing Section */

.pricing-section {
    padding: 64px 32px;
    text-align: center;
    background: white;
}

.pricing-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 40px;
}

.pricing-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 720px;
    margin: 0 auto;
}

.price-card {
    flex: 1;
    min-width: 260px;
    max-width: 340px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: left;
    position: relative;
}

.price-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.price-amount {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.price-amount span {
    font-size: 16px;
    font-weight: 400;
    color: var(--muted);
}

.price-card ul {
    list-style: none;
    margin-bottom: 24px;
}

.price-card ul li {
    font-size: 14px;
    color: var(--text);
    padding: 6px 0;
    padding-left: 22px;
    position: relative;
}

.price-card ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: 700;
}

.price-card-pro {
    background: white;
    border: 2px solid var(--accent);
    box-shadow: var(--shadow-md);
}

.pro-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Footer */

.landing-footer {
    padding: 40px 32px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.landing-footer p {
    font-size: 13px;
    color: var(--muted);
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--text);
}

/* ── Dashboard Layout ──────────────────────────────────── */

/* Legacy: only used if any view still references it */
.app-container {
    display: flex;
    height: calc(100vh - var(--nav-height));
    margin-top: var(--nav-height);
}

/* ── Leads View (new layout) ───────────────────────────── */

.leads-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height));
    margin-top: var(--nav-height);
    overflow: hidden;
}

/* Filter Bar */
/* ── Action Bar (between nav and workspace) ──────────────── */

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    min-height: 64px;
    flex-shrink: 0;
}

.action-bar-context {
    display: flex;
    flex-direction: column;
}

.action-bar-context h1 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.action-bar-context p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.action-bar-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.action-search-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    min-width: 250px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.action-search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* ── Command Center (Unified action bar replacing filter-bar + action-bar) ── */

.command-center {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    height: 64px;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    z-index: 100;
}

/* Group 1: Title + subtitle */
.cc-context {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 1px;
}

.cc-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.cc-sub {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* Divider between context and tools */
.cc-context::after {
    display: none;
}

/* Group 2: Filter tools */
.cc-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.cc-tools .action-search-input {
    min-width: 200px;
    flex: 1;
    max-width: 280px;
}

/* Group 3: Export + stats */
.cc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cc-stats {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

.cc-stats strong {
    color: #334155;
    font-weight: 600;
}

/* Advanced drawer: detached from bar, sits below it */
.adv-filters-drawer {
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.adv-filters-drawer.open {
    display: flex;
}

.adv-filters-drawer .slider-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ── Filter Bar (legacy, hidden in new layout) ── */
.filter-bar {
    display: none;
}

/* Old filter-bar buttons/pills (still used in cc-tools) */

.filter-select,
.filter-input {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.filter-bar .date-pills {
    display: flex;
    gap: 3px;
}

.filter-bar-spacer {
    flex: 1;
}

/* Filter bar buttons override (dark-on-light context) */
.filter-bar .btn-outline {
    background: white;
    color: var(--muted);
    border: 1px solid var(--border);
}

.filter-bar .btn-outline:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary-light);
}

.filter-bar .btn-outline.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Advanced Filters Drawer */
.adv-filters-drawer {
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.adv-filters-drawer.open {
    display: flex;
}

.adv-filters-drawer .slider-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ── Master/Detail Grid Workspace ──────────────────────── */
.leads-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 65% 35%;
    min-height: 0;
    overflow: hidden;
}

/* Left: full-height scrollable data table */
.leads-table-pane {
    grid-column: 1 / 2;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #ffffff;
    border-right: 1px solid var(--border);
}

/* Legacy sidebar column — detail now lives in context-sidebar */
.sidebar {
    display: none;
}

/* Right-rail wrapper (lead detail, full height) */
.context-sidebar {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
    border-left: 1px solid var(--border);
}

.details-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
}

.details-wrapper::-webkit-scrollbar {
    width: 4px;
}

.details-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.details-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Table header bar inside table pane */
.leads-table-header {
    flex: none;
    background: white;
    border-bottom: 2px solid var(--border);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leads-table-count {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.data-freshness {
    font-size: 11px;
    color: var(--muted);
}

.data-freshness::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 5px;
    vertical-align: middle;
    margin-bottom: 1px;
}

.map-toggle-btn {
    margin-left: auto;
    font-size: 11px;
    padding: 3px 10px;
    background: white;
    color: var(--muted);
    border: 1px solid var(--border);
    flex: none;
    display: none;
    /* Toggle button no longer needed in new layout */
}

#leads-table-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    /* horizontal scroll stays inside the table pane */
    background: #ffffff;
}

#leads-table-panel::-webkit-scrollbar {
    width: 5px;
}

#leads-table-panel::-webkit-scrollbar-track {
    background: transparent;
}

#leads-table-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Sticky table header inside scrollable panel */
.leads-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

/* Column resize handle */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 11;
}

.col-resize-handle::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 1px;
    width: 2px;
    height: 60%;
    background: var(--border);
    border-radius: 1px;
    transition: background 0.15s;
}

.col-resize-handle:hover::after,
.col-resize-handle.resizing::after {
    background: var(--primary-light);
}

/* Legacy (unused) */
.leads-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ── Score Badge Semantic Colors ──────────────────────── */
.badge-hot {
    background-color: #16a34a;
    color: #fff;
    font-weight: 600;
}

.badge-warm {
    background-color: #f59e0b;
    color: #fff;
    font-weight: 600;
}

.badge-cold {
    background-color: #e2e8f0;
    color: #475569;
}

/* Alias to keep existing score-pill classes aligned */
.score-pill.score-high {
    background: #16a34a;
    color: #fff;
}

.score-pill.score-med {
    background: #f59e0b;
    color: #fff;
}

.score-pill.score-low {
    background: #e2e8f0;
    color: #475569;
}

.leads-table tr.row-selected td {
    background: rgba(37, 99, 235, 0.08) !important;
}

/* ── Auth (inside modal) ───────────────────────────────── */

.auth-section {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: white;
}

.auth-tab {
    flex: 1;
    padding: 9px 0;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    background: white;
    color: var(--muted);
    transition: background var(--transition), color var(--transition);
}

.auth-tab:hover:not(.active) {
    background: #f8fafc;
    color: var(--text);
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-fields input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-fields input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--border);
}

.auth-divider span {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-google {
    width: 100%;
    padding: 10px 16px;
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.auth-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 8px;
    min-height: 16px;
    line-height: 1.4;
}

.auth-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.4;
}

/* Tier Badge (used in nav and elsewhere) */

.tier-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-free {
    background: #e2e8f0;
    color: var(--muted);
}

.tier-pro {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    flex: none;
}

/* ── Search ─────────────────────────────────────────────── */

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

.search-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 1px;
    font-weight: 700;
}

.search-section input,
.search-section select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--text);
}

.search-section input::placeholder {
    color: #94a3b8;
}

.search-section input:focus,
.search-section select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Stats ──────────────────────────────────────────────── */

.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    gap: 10px;
}

.stat-card {
    background: var(--bg);
    padding: 14px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

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

.stat-sm {
    flex: 1;
}

.stat-card h3 {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-card span {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-sm span {
    font-size: 20px;
}

/* ── Lead Detail Panel ──────────────────────────────────── */

.lead-detail {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* ── Sidebar Empty State ──────────────────────────────── */

.lead-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 16px;
    text-align: center;
}

.lead-detail-empty p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

/* ── Redesigned Detail Panel ────────────────────────── */

/* Address anchor — large, dark charcoal, not blue */
.detail-address {
    margin-bottom: 10px;
    line-height: 1.3;
}

.detail-address-link {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    line-height: 1.35;
    transition: color 0.15s;
}

.detail-address-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Score + Status badge row below address */
.detail-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

/* Compact metadata grid: 2-col label/value pairs */
.lead-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 8px;
    column-gap: 10px;
    align-items: baseline;
}

.lead-meta-item {
    display: contents;
}

.lead-meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 1px;
}

.lead-meta-value {
    font-size: 13px;
    font-weight: 400;
    color: #334155;
    word-break: break-word;
}

.lead-meta-value a {
    color: var(--primary-light);
    text-decoration: none;
}

.lead-meta-value a:hover {
    text-decoration: underline;
}

/* ── Pro Gate Block ───────────────────────────────── */

.pro-gate-block {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.pro-gate-blur {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
    padding: 4px 0;
}

.pro-gate-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}

.pro-gate-btn:hover {
    opacity: 0.88;
}

.lead-detail h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 700;
}

.lead-address {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.lead-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.lead-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-closed {
    background: #f1f5f9;
    color: var(--muted);
}

.lead-type {
    font-size: 12px;
    color: var(--muted);
}

.lead-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 12px;
    margin-bottom: 6px;
    letter-spacing: 0.8px;
}

.lead-field {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 5px;
    line-height: 1.5;
}

.lead-field label {
    display: inline-block;
    font-weight: 600;
    color: var(--muted);
    width: 60px;
    font-size: 12px;
}

.lead-field a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

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

.lead-detail hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.lead-source-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid var(--primary-light);
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}

.lead-source-link:hover {
    background: var(--primary-light);
    color: white;
    text-decoration: none;
}

/* ── Leads Loading Indicator ────────────────────────────── */

.leads-loading {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* Locked contact cell (free tier) in the leads table */
.cell-locked {
    color: var(--muted);
    opacity: 0.65;
    font-size: 12px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
    .top-nav {
        padding: 0 16px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        display: none;
    }

    .hero {
        padding: 48px 20px 40px;
    }

    .credibility-bar {
        flex-direction: column;
    }

    .cred-card {
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .cred-card:last-child {
        border-bottom: none;
    }

    .features-section,
    .recent-feed-section {
        padding: 40px 20px;
    }

    .pricing-section {
        padding: 40px 20px;
    }

    .pricing-grid {
        flex-direction: column;
        align-items: center;
    }

    .price-card {
        max-width: 100%;
    }

    .app-container {
        flex-direction: column;
    }

    .leads-workspace {
        flex-direction: column;
    }
}

/* ── Dashboard Tabs (in nav) ────────────────────────────────── */

.dash-tab-group {
    display: flex;
    gap: 2px;
    background: var(--bg);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.dash-tab {
    padding: 5px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: background var(--transition), color var(--transition);
}

.dash-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.dash-tab:hover:not(.active) {
    color: var(--text);
}

/* ── Analytics View ─────────────────────────────────────────── */

.analytics-view {
    margin-top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    padding: 24px 32px 40px;
    background: var(--bg);
}

.analytics-view::-webkit-scrollbar {
    width: 5px;
}

.analytics-view::-webkit-scrollbar-track {
    background: transparent;
}

.analytics-view::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.analytics-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.analytics-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.analytics-county-filter {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition);
}

.analytics-county-filter:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Permit Pulse Banner */

.pulse-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.pulse-indicator {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.pulse-indicator.up {
    background: #dcfce7;
    color: #166534;
}

.pulse-indicator.down {
    background: #fee2e2;
    color: #991b1b;
}

.pulse-indicator.flat {
    background: var(--bg);
    color: var(--muted);
}

.pulse-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

/* KPI Cards */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 6px;
}

.kpi-value-sm {
    font-size: 20px;
    line-height: 1.35;
}

.kpi-delta {
    font-size: 12px;
    color: var(--muted);
}

/* Property Class Breakdown Row */

.prop-class-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.prop-class-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    white-space: nowrap;
}

.prop-class-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.prop-class-stat {
    font-size: 13px;
    color: var(--text);
}

.prop-class-stat strong {
    font-weight: 700;
}

.prop-class-res {
    color: #059669;
}

.prop-class-com {
    color: #2563eb;
}

.prop-class-ind {
    color: #d97706;
}

.prop-class-mix {
    color: #7c3aed;
}

.prop-class-unk {
    color: var(--muted);
    font-style: italic;
}

/* Charts Row */

.charts-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.chart-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 6px;
}

.chart-wrap {
    height: 220px;
    position: relative;
}

/* Leaderboards */

.leaderboards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.leaderboard-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.leaderboard-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.leaderboard-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 6px;
}

.leaderboard-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    width: 18px;
    text-align: right;
    flex: none;
}

.lb-info {
    flex: 1;
    min-width: 0;
}

.lb-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.lb-bar-wrap {
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
}

.lb-bar {
    height: 100%;
    background: var(--primary-light);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.lb-bar-amber {
    background: var(--accent);
}

.lb-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    flex: none;
    min-width: 28px;
    text-align: right;
}

/* Cross-Sell Gaps Card */

.gaps-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}

.gaps-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.gaps-card-header .leaderboard-title {
    margin-bottom: 0;
}

.gaps-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-hover);
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    flex: none;
}

.gaps-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gaps-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gaps-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 260px;
    max-width: 260px;
}

.gaps-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.gaps-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.gaps-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-hover);
    flex: none;
    min-width: 28px;
    text-align: right;
}

.leaderboard-empty {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    padding: 20px 0;
}

/* ── Lead Score Bar ─────────────────────────────────────────── */

.score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.score-fill-high {
    background: #16a34a;
}

.score-fill-med {
    background: #d97706;
}

.score-fill-low {
    background: #94a3b8;
}

.score-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    min-width: 30px;
    text-align: right;
}

/* ── Opportunity Badge ───────────────────────────────────────── */

.opportunity-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 8px;
}

/* ── Leaderboard Share + Market Meta ────────────────────────── */

.lb-share {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 2px;
}

.market-share-meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.market-share-stat {
    font-size: 12px;
    color: var(--muted);
}

.market-share-stat strong {
    color: var(--text);
}

.new-entrant-label {
    color: #059669;
}

.new-entrants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.new-entrant-tag {
    font-size: 11px;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    padding: 2px 8px;
}

/* ── View Toggle Buttons ────────────────────────────────────── */

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

.view-toggle-group {
    display: flex;
    gap: 4px;
}

.view-toggle-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    background: white;
    color: var(--muted);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex: none;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.view-toggle-btn:hover:not(.active) {
    background: var(--bg);
    color: var(--text);
}

/* ── Status Pills ───────────────────────────────────────────── */

.status-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.status-pill {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    background: white;
    color: var(--muted);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex: none;
}

.status-pill:hover:not(.active) {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* Per-bucket active colors */
.status-pill[data-bucket="pipeline"].active    { background: #3b82f6; border-color: #3b82f6; color: white; }
.status-pill[data-bucket="active"].active      { background: #16a34a; border-color: #16a34a; color: white; }
.status-pill[data-bucket="completed"].active   { background: #7c3aed; border-color: #7c3aed; color: white; }
.status-pill[data-bucket="stalled"].active     { background: #f59e0b; border-color: #f59e0b; color: white; }
.status-pill[data-bucket="cancelled"].active   { background: #ef4444; border-color: #ef4444; color: white; }

/* ── Date Pills ─────────────────────────────────────────────── */

.date-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.date-pill {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    background: white;
    color: var(--muted);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex: none;
}

.date-pill.active {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.date-pill:hover:not(.active) {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* ── Min Score Slider ───────────────────────────────────────── */

.slider-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.slider-row input[type="range"] {
    width: 100%;
    accent-color: var(--primary-light);
}

/* ── Stat Cap Note ──────────────────────────────────────────── */

.stat-cap-note {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    padding: 4px 0;
    font-style: italic;
    min-height: 16px;
}

/* ── List View / Leads Table ────────────────────────────────── */

.leads-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.leads-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--muted);
    font-weight: 700;
    padding: 7px 10px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: white;
    cursor: pointer;
    user-select: none;
    z-index: 1;
}

.leads-table th:hover {
    color: var(--text);
    background: #f8fafc;
}

.leads-table th.sort-active {
    color: var(--primary);
}

/* Compact rows */
.leads-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    line-height: 1.3;
    /* Single-line lockdown: no cell may wrap to a second line */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* No max-width:0 here — column widths are set per-column below */
}

/* ── Fixed-length columns (never truncate) ── */
.leads-table td.col-score {
    width: 80px;
    min-width: 80px;
    overflow: visible;
}

.leads-table td.col-status {
    width: 100px;
    min-width: 100px;
}

.leads-table td.col-date {
    width: 100px;
    min-width: 100px;
    font-variant-numeric: tabular-nums;
}

.leads-table td.col-phone {
    width: 130px;
    min-width: 130px;
}

/* ── Fluid columns (min-width, can grow, truncate with ellipsis) ── */
.leads-table td.col-type {
    min-width: 180px;
    max-width: 240px;
}

.leads-table td.col-address {
    min-width: 250px;
    max-width: 350px;
}

.leads-table td.col-contractor {
    min-width: 200px;
    max-width: 280px;
    color: var(--muted);
}

.leads-table td.col-email {
    min-width: 200px;
    max-width: 260px;
}

/* Zebra striping */
.leads-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.leads-table tr:hover td {
    background: rgba(37, 99, 235, 0.06) !important;
    cursor: pointer;
}

/* Score pills (replace bar) */
.score-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Semantic score pill colors with clear tiers */
.score-pill.score-high {
    background: #15803d;
}

/* ≥0.80  deep green  */
.score-pill.score-med {
    background: #b45309;
}

/* ≥0.65  dark amber  */
.score-pill.score-low {
    background: #e2e8f0;
    color: #475569;
}

/* <0.65  gray        */

/* ── Signal Icons (Binary Category Grid) ───────────────── */
.signal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 13px;
    background: #f8fafc;
    border: 1px solid transparent;
    cursor: inherit;
    transition: all 0.2s ease;
}

.tag-inactive {
    opacity: 0.35;
    filter: grayscale(100%);
    background: transparent;
    border-color: #e2e8f0;
}

.tag-hot {
    background: #fff7ed;
    border-color: #fed7aa;
}

.tag-fresh {
    background: #dcfce7;
    border-color: #bbf7d0;
}

.tag-recent {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.tag-gap {
    background: #fef3c7;
    border-color: #fde68a;
}

.tag-highval {
    background: #ede9fe;
    border-color: #ddd6fe;
}

.tag-commercial {
    background: #f3e8ff;
    border-color: #e9d5ff;
}

.tag-waterfront {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.tag-contact {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* List view signals cell */
.leads-table td.col-score {
    min-width: 120px;
    width: auto;
}

.col-score .signal-icons-row {
    margin: 1px 0;
}


/* Legacy bar (used in lead detail panel only) */
.list-score-bar {
    width: 50px;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

.list-score-fill {
    height: 100%;
    border-radius: 3px;
    display: block;
}

/* ── Copy Button ────────────────────────────────────────────── */

.copy-btn {
    padding: 1px 5px;
    font-size: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    margin-left: 4px;
    transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
    vertical-align: middle;
    font-family: inherit;
    opacity: 0;
}

.leads-table tr:hover .copy-btn {
    opacity: 1;
}

/* ── Filter Bar Inline Stats ────────────────────────────────── */

.filter-bar-stats {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    margin-left: 4px;
    flex-shrink: 0;
}

.filter-bar-stats strong {
    color: var(--text);
    font-weight: 700;
}

.copy-btn:hover {
    background: var(--bg);
}

.copy-btn.copied {
    color: #16a34a;
    border-color: #16a34a;
    opacity: 1;
}

/* ── Field Gate (Pro-only lock) ─────────────────────────────── */

.field-gate {
    font-size: 12px;
    color: var(--muted);
}

.upgrade-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.upgrade-link:hover {
    text-decoration: underline;
}

/* ── Export Toast ───────────────────────────────────────────── */

.export-toast {
    font-size: 11px;
    color: #dc2626;
    margin-top: 2px;
    min-height: 16px;
}

/* ── Full-Width Chart Card ──────────────────────────────────── */

.chart-card-full {
    grid-column: 1 / -1;
    display: block;
}

/* Analytics responsive */

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

    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .analytics-view {
        padding: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .leaderboards-row {
        grid-template-columns: 1fr;
    }

    .dash-tab-group {
        display: none;
    }
}

/* ── Profile Views (Properties + Companies) ─────────────────── */

.profile-view {
    margin-top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    background: var(--bg);
}

.profile-view::-webkit-scrollbar {
    width: 5px;
}

.profile-view::-webkit-scrollbar-track {
    background: transparent;
}

.profile-view::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.profile-view-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* Search header */

.profile-search-header {
    text-align: center;
    padding: 40px 0 32px;
}

.profile-search-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.profile-search-sub {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
}

.profile-search-wrap {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.profile-search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-sm);
}

.profile-search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 500;
    overflow: hidden;
}

.suggestion-item {
    padding: 11px 18px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    text-align: left;
}

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

.suggestion-item:hover {
    background: #f1f5f9;
}

.suggestion-empty {
    color: var(--muted);
    cursor: default;
    font-style: italic;
}

/* Profile Hero */

.profile-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: #fff;
}

.profile-hero-main {
    margin-bottom: 20px;
}

.profile-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.3;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #bfdbfe;
}

.profile-hero-meta span::before {
    content: '·';
    margin-right: 12px;
    opacity: 0.5;
}

.profile-hero-meta span:first-child::before {
    display: none;
}

/* Stats bar inside hero */

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

.profile-stat {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 11px;
    color: #bfdbfe;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Profile Body Layout */

.profile-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

.profile-main-col {
    min-width: 0;
}

.profile-timeline-col {
    min-width: 0;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section titles inside profile */

.profile-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 12px;
}

/* Profile contacts card */

.profile-contacts-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* Mini map inside property profile */

.profile-mini-map {
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Profile timeline */

.profile-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-timeline-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.profile-timeline-item:last-child {
    border-bottom: none;
}

.profile-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}

.profile-timeline-content {
    flex: 1;
    min-width: 0;
}

.profile-timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.profile-timeline-type {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.profile-timeline-date {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}

.profile-timeline-val {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    padding: 1px 7px;
    border-radius: 20px;
}

.profile-timeline-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 6px;
}

.profile-timeline-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-timeline-contractor {
    margin-bottom: 4px;
}

/* Clickable links within profiles */

.profile-contractor-link,
.profile-address-link,
.profile-nav-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-light);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 12px;
}

.profile-contractor-link:hover,
.profile-address-link:hover,
.profile-nav-link:hover {
    color: var(--primary);
}

.lead-address .profile-nav-link {
    font-size: inherit;
    font-weight: inherit;
    color: var(--primary);
    text-decoration: none;
}

.lead-address .profile-nav-link:hover {
    text-decoration: underline;
}

/* Company Activity Chart */

.company-activity-chart {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    height: 180px;
    margin-bottom: 4px;
    box-shadow: var(--shadow-sm);
}

/* County chips */

.county-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.county-chip {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
}

.county-chip strong {
    font-weight: 700;
}

/* Top zip list */

.top-zip-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.top-zip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}

.top-zip-code {
    font-weight: 600;
    color: var(--text);
}

.top-zip-count {
    color: var(--muted);
}

/* Loading / empty states */

.profile-loading,
.profile-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 14px;
}

.profile-loading::before {
    content: '⏳ ';
}

.profile-empty::before {
    content: '🔍 ';
}

/* Profile responsive */

@media (max-width: 900px) {
    .profile-body {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        order: -1;
    }

    .profile-mini-map {
        height: 160px;
    }

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

/* ── My Alerts Settings ─────────────────────────────────────── */

.alerts-field-group {
    margin-bottom: 24px;
}

.alerts-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.alerts-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color var(--transition);
}

.alerts-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.alerts-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.alerts-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #f8fafc;
    transition: background var(--transition), border-color var(--transition);
    user-select: none;
}

.alerts-check:hover {
    background: #eff6ff;
    border-color: var(--primary-light);
}

.alerts-check input[type="checkbox"] {
    accent-color: var(--primary-light);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .profile-hero {
        padding: 20px;
    }

    .profile-view-inner {
        padding: 16px 16px 40px;
    }

    .profile-search-header {
        padding: 24px 0 20px;
    }
}

/* ── Market Intelligence View ───────────────────────── */

.market-view {
    max-width: 1200px;
    margin: 0 auto;
    overflow-y: auto;
    height: calc(100vh - var(--nav-height));
    padding-bottom: 120px;
}

.market-header {
    margin-bottom: 32px;
}

.market-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.market-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding-bottom: 40px;
}

.market-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.market-section-full {
    grid-column: 1 / -1;
}

.market-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.market-section-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.market-section-header span {
    font-size: 12px;
    color: var(--muted);
}

.market-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.market-list-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    transition: transform var(--transition), border-color var(--transition);
}

.market-item:hover {
    transform: translateX(4px);
    background: #fff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary-light);
}

.market-clickable {
    cursor: pointer;
}

.market-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.market-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.market-item-sub {
    font-size: 11px;
    color: var(--muted);
}

.market-item-stat {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.market-nexus-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow var(--transition);
}

.market-nexus-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.nexus-entities {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nexus-entity {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nexus-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.nexus-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-arrow {
    color: var(--primary-light);
    font-size: 16px;
    opacity: 0.5;
}

.nexus-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.nexus-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.nexus-tag {
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 600;
}