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

/* ═══════ THEME: OLED DARK ═══════ */
[data-theme="oled"], :root {
    --bg-deep: #000000;
    --bg-sidebar: #0a0a0a;
    --bg-card: #111111;
    --bg-elevated: #181818;
    --bg-hover: #1f1f1f;
    --bg-input: #0e0e0e;
    --border: #222222;
    --border-subtle: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #5a5a5a;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.4);
    --scrollbar-thumb: #2a2a2a;
}

/* ═══════ THEME: SOFT BRIGHT ═══════ */
[data-theme="bright"] {
    --bg-deep: #f0f2f5;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f8f9fa;
    --bg-hover: #e9ecef;
    --bg-input: #f5f6f8;
    --border: #dee2e6;
    --border-subtle: #e9ecef;
    --text-primary: #1a1d23;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --shadow-card: 0 1px 4px rgba(0,0,0,0.06);
    --scrollbar-thumb: #ccc;
}

/* ═══════ ACCENTS (shared) ═══════ */
:root {
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59,130,246,0.08);
    --accent-blue-border: rgba(59,130,246,0.25);
    --accent-teal: #2dd4bf;
    --accent-teal-dim: rgba(45,212,191,0.08);
    --accent-teal-border: rgba(45,212,191,0.25);
    --success: #22c55e;
    --success-dim: rgba(34,197,94,0.10);
    --success-border: rgba(34,197,94,0.30);
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 72px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="bright"] {
    --accent-blue-dim: rgba(59,130,246,0.06);
    --accent-blue-border: rgba(59,130,246,0.20);
    --accent-teal-dim: rgba(45,212,191,0.06);
    --accent-teal-border: rgba(45,212,191,0.20);
    --success-dim: rgba(34,197,94,0.08);
    --success-border: rgba(34,197,94,0.22);
}

html { font-size: 14px; }

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-secondary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background 0.25s, color 0.25s;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

a { color: inherit; text-decoration: none; }

/* ═══════ SIDEBAR ═══════ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transition: background 0.25s, border-color 0.25s;
}

.sidebar-logo {
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-align: center;
    line-height: 1.3;
}

.sidebar-brand {
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 32px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-link {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link:hover { background: var(--bg-hover); color: var(--text-secondary); }

.sidebar-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -16px;
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.sidebar-link svg { width: 20px; height: 20px; }

.sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.sidebar-profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s;
    position: relative;
}

.sidebar-profile:hover { border-color: var(--accent-blue); }

/* Profile Floating Menu */
.profile-menu {
    display: none;
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 100;
}

.profile-menu.open { display: block; }

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font);
    text-align: left;
}

.profile-menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.profile-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; }

.profile-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

/* ═══════ MAIN ═══════ */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ═══════ HEADER ═══════ */
.header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-sidebar);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: background 0.25s;
}

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

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

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

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    height: 40px;
    min-width: 280px;
    transition: border-color 0.15s, background 0.25s;
}

.search-box:focus-within { border-color: var(--accent-blue); }
.search-box svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    padding: 0 10px;
    width: 100%;
}

.search-box input::placeholder { color: var(--text-muted); }

/* ═══════ BUTTONS ═══════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 40px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-primary svg { width: 16px; height: 16px; }

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

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

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* ═══════ CONTENT ═══════ */
.content { padding: 24px 32px; flex: 1; }

/* ═══════ KPI STRIP ═══════ */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-card);
    transition: background 0.25s, border-color 0.25s;
}

.kpi-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1;
}

.kpi-sub {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 500;
}

.kpi-sub-item { display: flex; align-items: center; gap: 5px; }

.kpi-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kpi-dot.blue { background: var(--accent-blue); }
.kpi-dot.teal { background: var(--accent-teal); }
.kpi-change { font-size: 11px; font-weight: 500; color: var(--success); }

/* ═══════ TABLE CONTAINER ═══════ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: background 0.25s;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 10px;
}

.table-toolbar-left { display: flex; align-items: center; gap: 12px; }

.table-toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 4px;
}

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

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 32px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.filter-btn svg { width: 14px; height: 14px; }

/* ═══════ LEADS TABLE ═══════ */
.leads-table { width: 100%; border-collapse: collapse; }

.leads-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    user-select: none;
    transition: background 0.25s;
}

.leads-table thead th:first-child { padding-left: 20px; }
.leads-table thead th:last-child { padding-right: 20px; }

.leads-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s;
}

.leads-table tbody tr:last-child { border-bottom: none; }
.leads-table tbody tr:hover { background: var(--bg-hover); }

.leads-table tbody td {
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.leads-table tbody td:first-child { padding-left: 20px; }
.leads-table tbody td:last-child { padding-right: 20px; }

.row-locked-teal {
    background: var(--accent-teal-dim);
    box-shadow: inset 3px 0 0 var(--accent-teal);
}
.row-locked-teal:hover { background: rgba(45,212,191,0.12) !important; }

.row-locked-blue {
    background: var(--accent-blue-dim);
    box-shadow: inset 3px 0 0 var(--accent-blue);
}
.row-locked-blue:hover { background: rgba(59,130,246,0.12) !important; }

.row-converted {
    background: var(--success-dim);
    box-shadow: inset 3px 0 0 var(--success);
}
.row-converted:hover { background: rgba(34,197,94,0.14) !important; }

/* ═══════ CELL COMPONENTS ═══════ */
.cell-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background: var(--bg-elevated);
    position: relative;
    transition: all 0.15s;
}

.cell-checkbox:checked { background: var(--accent-blue); border-color: var(--accent-blue); }
.cell-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px; left: 5px;
    width: 5px; height: 8px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.cell-company { font-weight: 600; color: var(--text-primary); }
.cell-contact { color: var(--text-primary); font-weight: 500; }
.cell-title { color: var(--text-muted); font-size: 12px; }
.cell-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.email-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.email-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.email-badge.deliverable .dot { background: var(--success); }
.email-badge.catch-all .dot { background: var(--warning); }
.email-badge.invalid .dot { background: var(--danger); }

.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.state-badge.unclaimed {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.state-badge.locked-teal {
    background: var(--accent-teal-dim);
    color: var(--accent-teal);
    border: 1px solid var(--accent-teal-border);
}

.state-badge.locked-blue {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-border);
}

.state-badge.converted {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.state-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

.state-dot.white { background: #ccc; animation: none; }
.state-dot.teal { background: var(--accent-teal); }
.state-dot.blue { background: var(--accent-blue); }
.state-dot.green { background: var(--success); animation: none; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

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

.state-locker, .state-closer {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ═══════ ACTION BUTTONS ═══════ */
.btn-claim {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 32px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--accent-blue-border);
    color: var(--accent-blue);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-claim:hover { background: var(--accent-blue-dim); border-color: var(--accent-blue); }

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 32px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-view:hover { background: var(--bg-hover); border-color: var(--text-muted); color: var(--text-primary); }

.btn-deal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 32px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    background: var(--success-dim);
    border: 1px solid var(--success-border);
    color: var(--success);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-deal:hover { background: rgba(34,197,94,0.18); }

/* ═══════ PAGINATION ═══════ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.pagination-info select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    outline: none;
}

.pagination-info select:focus { border-color: var(--accent-blue); }

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--text-muted); }
.page-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }

/* ═══════ LIVE PULSE ═══════ */
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ═══════ TIMELINE FILTER ═══════ */
.timeline-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.timeline-chip {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}

.timeline-chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.timeline-chip.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

.timeline-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.timeline-custom input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-secondary);
    outline: none;
}

.timeline-custom input:focus { border-color: var(--accent-blue); }

/* ═══════ MODAL / OVERLAY ═══════ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    min-width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 12px;
}

.modal-input:focus { border-color: var(--accent-blue); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ═══════ SETTINGS ═══════ */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.settings-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--border-subtle);
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent-blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ═══════ ANALYTICS CARDS ═══════ */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.analytics-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.chart-placeholder {
    height: 180px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}

.mini-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
    padding-top: 10px;
}

.mini-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 8px;
    transition: height 0.3s ease;
}

.mini-bar.blue { background: var(--accent-blue); }
.mini-bar.teal { background: var(--accent-teal); }
.mini-bar.green { background: var(--success); }

/* ═══════ MOBILE CARDS ═══════ */
.mobile-cards { display: none; }

.card-lead {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.card-lead.card-teal { border-left: 3px solid var(--accent-teal); background: var(--accent-teal-dim); }
.card-lead.card-blue { border-left: 3px solid var(--accent-blue); background: var(--accent-blue-dim); }
.card-lead.card-converted { border-left: 3px solid var(--success); background: var(--success-dim); }

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-company { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-contact { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.card-title-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.card-date { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

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

.card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 1024px) {
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .search-box { min-width: 200px; }
}

@media (max-width: 768px) {
    .sidebar { width: 0; overflow: hidden; }
    .main { margin-left: 0; }
    .header { padding: 16px; flex-wrap: wrap; }
    .header-right { width: 100%; }
    .search-box { min-width: 0; flex: 1; }
    .content { padding: 16px; }
    .kpi-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-card { padding: 14px 16px; }
    .kpi-value { font-size: 22px; }
    .desktop-table { display: none; }
    .mobile-cards { display: block; }
    .table-toolbar { flex-wrap: wrap; gap: 8px; }
    .pagination-bar { flex-direction: column; align-items: stretch; }
    .pagination-controls { justify-content: center; }
    .timeline-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .kpi-strip { grid-template-columns: 1fr; }
    .header-title { font-size: 16px; }
    .btn-primary span { display: none; }
}

/* ═══════ LEAD DETAIL MODAL ═══════ */
.lead-modal { min-width: 520px; max-width: 580px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 85vh; }

.lead-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
}

.lead-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; min-height: 0; }

.lead-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.lead-detail-field {}

.lead-detail-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.lead-detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.lead-modal-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 16px 0;
}

.lead-status-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
    width: 100%;
    text-align: left;
}

.status-btn:hover { border-color: var(--text-muted); background: var(--bg-hover); }
.status-btn.selected { border-color: var(--accent-blue); background: var(--accent-blue-dim); }

.status-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-btn-icon.talking { background: rgba(245,158,11,0.12); color: var(--warning); }
.status-btn-icon.email { background: var(--accent-blue-dim); color: var(--accent-blue); }
.status-btn-icon.converted { background: var(--success-dim); color: var(--success); }

.status-btn-text { flex: 1; }

.status-btn-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-btn-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.converted-fields {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    margin-top: 10px;
}

.converted-fields.show { display: flex; }

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.service-chip {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.service-chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.service-chip.selected { border-color: var(--success); background: var(--success-dim); color: var(--success); }

.lead-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ═══════ VIEW BUTTON (per row) ═══════ */
.btn-view-lead {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 30px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-view-lead:hover { border-color: var(--text-muted); color: var(--text-primary); background: var(--bg-hover); }

/* ═══════ COLOR PICKER GRID ═══════ */
.color-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.15s;
    position: relative;
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--bg-card); }
.color-swatch.taken { opacity: 0.25; cursor: not-allowed; }

.color-swatch.taken::after {
    content: '';
    position: absolute;
    top: 50%; left: 25%; right: 25%;
    height: 2px;
    background: var(--danger);
    transform: rotate(-45deg);
}

/* ═══════ CLOSE MODAL X ═══════ */
.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    flex-shrink: 0;
}

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

/* ═══════ REVENUE TAG ═══════ */
.revenue-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-dim);
    padding: 2px 7px;
    border-radius: 4px;
}

/* ═══════ LEADS PAGE — no KPI ═══════ */
.leads-only .content { padding-top: 20px; }

/* ═══════ FILTER DROPDOWN ═══════ */
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 60;
}

.filter-dropdown.open { display: block; }

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font);
    text-align: left;
}

.filter-option:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-option.active { background: var(--accent-blue-dim); color: var(--accent-blue); }
.filter-option svg { width: 14px; height: 14px; flex-shrink: 0; }

.filter-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 8px 12px 4px;
}

.filter-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

/* ═══════ BOOKING FIELDS ═══════ */
.booking-fields {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--accent-teal-border);
    border-radius: 8px;
    margin-top: 10px;
}

.booking-fields.show { display: flex; }

.booking-fields input[type="date"],
.booking-fields input[type="time"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.booking-fields input:focus { border-color: var(--accent-teal); }

/* ═══════ MODAL ACTIONS (sticky footer) ═══════ */
.lead-modal-actions {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    background: var(--bg-card);
}

/* ═══════ SIDEBAR TEXT LOGO ═══════ */
.sidebar-brand { margin-bottom: 28px; }

/* ═══════ LEADS TABS ═══════ */
.leads-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.leads-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.leads-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.leads-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
}

.tab-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    display: inline-block;
    animation: pulse-dot 1.5s infinite;
}