/* ── PulseCRM — Scandinavian Light ────────────────────────────────── */
:root {
    --bg: #f7f6f3;
    --bg-raised: #ffffff;
    --bg-surface: #f0efec;
    --bg-hover: #eae9e5;
    --border: #e2e0db;
    --border-light: #eae9e5;
    --text: #1a1a1a;
    --text-muted: #6b6b6f;
    --text-dim: #a5a5aa;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-glow: rgba(0, 113, 227, 0.08);
    --accent-light: #eaf3fd;
    --green: #2fa052;
    --green-dim: rgba(47, 160, 82, 0.1);
    --red: #e5383b;
    --red-dim: rgba(229, 56, 59, 0.08);
    --yellow: #c88b17;
    --yellow-bg: rgba(200, 139, 23, 0.1);
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.btn-primary {
    background: var(--text);
    color: #fff;
}
.btn-primary:hover { background: #333; transform: translateY(-0.5px); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.btn-secondary {
    background: var(--bg-raised);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--bg-surface); }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-surface); }
.btn-danger {
    background: var(--red-dim);
    color: var(--red);
}
.btn-danger:hover { background: rgba(229, 56, 59, 0.14); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 12px 20px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group input, .select-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    transition: all 0.2s;
}
.form-group input:focus, .select-control:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
    background: var(--bg-raised);
}
.form-group input::placeholder { color: var(--text-dim); }

.select-control {
    width: auto;
    padding: 9px 36px 9px 14px;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b6f' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

/* ── Status Messages ─────────────────────────────────────────────── */
.status-msg {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-top: 14px;
    text-align: center;
}
.status-msg.error { background: var(--red-dim); color: var(--red); }
.status-msg.success { background: var(--green-dim); color: var(--green); }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 920px;
    width: 100%;
    margin: 40px 24px;
    gap: 72px;
    align-items: center;
}
.auth-left { padding: 20px 0; }
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 48px;
}
.brand-icon { color: var(--text); }
.brand-icon svg circle { fill: var(--accent); }
.auth-brand h1 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.auth-hero h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -1.5px;
    margin-bottom: 18px;
}
.accent-text { color: var(--accent); }
.auth-hero p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.65;
    max-width: 380px;
}
.auth-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
}
.feature-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 13px;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.auth-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-header { margin-bottom: 28px; }
.form-header h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.6px; }
.form-header p { color: var(--text-muted); font-size: 15px; margin-top: 5px; }
.form-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

@media (max-width: 700px) {
    .auth-wrapper { grid-template-columns: 1fr; gap: 30px; }
    .auth-hero h2 { font-size: 28px; }
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════ */

/* ── Top Nav ─────────────────────────────────────────────────────── */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 52px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 12px; }
.nav-title { font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.brand-icon.small { display: flex; }
.brand-icon.small svg circle { fill: var(--accent); }
.gmail-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: var(--bg-surface);
    border-radius: 24px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-dim);
}
.status-dot.connected { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.nav-user { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ── Main Area ───────────────────────────────────────────────────── */
.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 28px;
}

/* ── Connect Banner ──────────────────────────────────────────────── */
.connect-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}
.banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}
.banner-icon { flex-shrink: 0; }
.banner-content strong { font-size: 15px; }
.banner-content p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Stats ────────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1.5px;
    color: var(--text);
}
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 6px;
    font-weight: 600;
}

/* ── Scan Panel ──────────────────────────────────────────────────── */
.scan-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.scan-left h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.scan-left p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.scan-controls { display: flex; align-items: center; gap: 10px; }

.scan-progress {
    padding: 18px 28px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}
.progress-bar-track {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Tab Section ─────────────────────────────────────────────────── */
.tab-section {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.tab-bar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    gap: 0;
}
.tab-btn {
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-dim);
    transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); }
.tab-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.search-box:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }
.search-box svg { color: var(--text-dim); flex-shrink: 0; }
.search-box input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    width: 160px;
    outline: none;
}
.search-box input::placeholder { color: var(--text-dim); }

/* ── Emails Tab ─────────────────────────────────────────────────── */
.date-group { }
.date-label {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}
.email-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.1s;
}
.email-row:hover { background: var(--bg-hover); }
.email-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #bbb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.email-content { flex: 1; min-width: 0; }
.email-top { display: flex; justify-content: space-between; align-items: center; }
.email-sender { font-size: 14px; font-weight: 600; color: var(--text); }
.email-topic {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-bills { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.email-actions { flex-shrink: 0; padding-top: 2px; }

/* ── Contacts Tab ───────────────────────────────────────────────── */
#contactsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
    background: var(--border-light);
}
.contact-card {
    background: var(--bg-raised);
    padding: 18px 20px;
    cursor: pointer;
    transition: background 0.1s;
    border-left: 3px solid transparent;
}
.contact-card:hover { background: var(--bg-hover); }
.card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #bbb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.card-identity { flex: 1; min-width: 0; }
.card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-email-addr {
    font-size: 12px;
    color: var(--accent);
    font-family: var(--mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.card-count {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    flex-shrink: 0;
}
.card-count span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    display: block;
}
.card-info { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.card-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.card-detail svg { flex-shrink: 0; color: var(--text-dim); }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.topic-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-surface);
    color: var(--text-muted);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
}

/* ── Constituent Indicators ──────────────────────────────────────── */
.email-row.constituent { border-left: 3px solid #22c55e; }
.email-avatar.constituent { background: var(--text); }
.contact-card.constituent { border-left: 3px solid #22c55e; }
.card-avatar.constituent { background: var(--text); }

.district-badge {
    display: inline-block;
    padding: 1px 7px;
    background: #dcfce7;
    color: #166534;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.district-badge-sm {
    display: inline-block;
    padding: 1px 6px;
    background: #dcfce7;
    color: #166534;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 4px;
}

.stat-card-accent {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.stat-card-accent .stat-value { color: #166534; }
.stat-card-accent .stat-label { color: #15803d; }

/* ── Common ─────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-dim);
    font-size: 15px;
}

.bill-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--yellow-bg);
    color: var(--yellow);
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
}

.del-btn {
    padding: 5px 8px;
    background: transparent;
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.del-btn:hover { color: var(--red); background: var(--red-dim); }

/* ── Profile Modal ──────────────────────────────────────────────── */
.modal-profile {
    position: relative;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 18px;
    max-width: 560px;
    width: 94%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 0;
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 28px 0;
}
.profile-avatar { width: 52px !important; height: 52px !important; font-size: 20px !important; }
.profile-identity { flex: 1; }
.profile-identity h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin: 0; }
.profile-email { font-size: 13px; color: var(--accent); font-family: var(--mono); margin-top: 2px; }

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-light);
    margin: 20px 28px 0;
    border-radius: var(--radius);
    overflow: hidden;
}
.profile-field {
    padding: 14px;
    background: var(--bg-raised);
}
.profile-field label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.profile-field span { font-size: 13px; color: var(--text); }

.profile-emails-header {
    padding: 16px 28px 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
}
.profile-emails-list { padding: 0 28px 20px; }
.profile-email-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: opacity 0.1s;
}
.profile-email-row:hover { opacity: 0.7; }
.profile-email-date {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--mono);
    white-space: nowrap;
    min-width: 60px;
}
.profile-email-topic {
    font-size: 13px;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-email-bills { flex-shrink: 0; }

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 18px;
}
.page-btn {
    padding: 7px 14px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.page-btn:hover { border-color: var(--text); color: var(--text); }
.page-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.page-info { font-size: 12px; color: var(--text-dim); padding: 0 10px; }

/* ── Modal — Sidebar Split ─────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.modal-content.modal-split {
    position: relative;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 18px;
    max-width: 860px;
    width: 94%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 280px 1fr;
}
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: var(--bg-surface);
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

/* Left sidebar */
.modal-sidebar {
    background: var(--bg-surface);
    padding: 32px 24px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--text);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.modal-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0 0 4px 0;
}
.modal-email {
    font-size: 12px;
    color: var(--accent);
    font-family: var(--mono);
    word-break: break-all;
    line-height: 1.4;
}
.modal-fields {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.modal-field label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 3px;
}
.modal-field span {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    display: block;
}
.modal-field .bills-display { display: flex; flex-wrap: wrap; gap: 4px; }

/* Right email panel */
.modal-email-panel {
    padding: 28px 32px;
    overflow-y: auto;
    max-height: 85vh;
}
.email-panel-header {
    margin-bottom: 20px;
}
.email-panel-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-dim);
    font-weight: 600;
}
.email-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.email-meta strong { color: var(--text-muted); font-weight: 600; }
.email-subject {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.2px;
    line-height: 1.3;
}
.email-body {
    font-size: 14px;
    color: var(--text);
    line-height: 1.85;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font);
}

@media (max-width: 700px) {
    .modal-content.modal-split {
        grid-template-columns: 1fr;
        max-height: 90vh;
    }
    .modal-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 24px 20px;
    }
    .modal-email-panel { padding: 20px; }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .scan-panel { flex-direction: column; gap: 16px; align-items: flex-start; }
    .scan-controls { width: 100%; flex-wrap: wrap; }
    .tab-bar { flex-wrap: wrap; padding: 0 12px; }
    .tab-actions { width: 100%; padding: 8px 0; }
    #contactsGrid { grid-template-columns: 1fr; }
    .crm-actions { width: 100%; flex-wrap: wrap; }
    .connect-banner { flex-direction: column; gap: 16px; }
    .topnav { padding: 0 16px; }
    .nav-right { gap: 6px; }
    .gmail-status { display: none; }
    .detail-grid { grid-template-columns: 1fr; }
    .dashboard-main { padding: 20px 16px; }
}
