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

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --primary: #4580f7;
    --primary-hover: #3366e0;
    --text: #0a0a0a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --error: #ef4444;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

header nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

header nav a:hover {
    color: var(--primary);
}

main {
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

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

footer a:hover {
    color: var(--primary);
}

/* Legal pages (Privacy, Terms) */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
}

.legal-page h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.legal-updated {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.legal-page h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.legal-page p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.legal-page ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.legal-page a {
    color: var(--primary);
    text-decoration: none;
}

.legal-page a:hover {
    text-decoration: underline;
}

/* Login */
.login-container {
    max-width: 420px;
    margin: 4rem auto;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-container label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.login-container input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

.login-container button {
    width: 100%;
    padding: 0.625rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.login-container button:hover {
    background: var(--primary-hover);
}

.error {
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Hero section */
.hero {
    margin-bottom: 1.5rem;
}

.hero h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 700px;
}

.hero-sub {
    margin-top: 0.5rem;
}

.hero-sub a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.hero-sub a:hover {
    text-decoration: underline;
}

/* CTA card (propensity upsell) */
.cta-card {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.cta-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cta-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Result header with inline save button */
.result-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-counts-inline {
    display: inline;
}

.save-counts-btn {
    padding: 0.2rem 0.7rem;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    vertical-align: middle;
    transition: transform 0.15s, box-shadow 0.15s;
}

.save-counts-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

/* Saved districts list */
.saved-counts-list {
    margin-bottom: 1.5rem;
}

.saved-counts-list h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.saved-count-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.saved-count-item:hover {
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.saved-count-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Send an Email section */
.breakdown-sub {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.send-all-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.price-btn-lg {
    padding: 0.375rem 1.25rem;
    font-size: 0.85rem;
}

/* Price buttons in party table */
.price-btn {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}

.price-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

/* Saved button (replaces price-btn after click) */
.saved-btn {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-saved {
    background: #ede9fe;
    color: #5b21b6;
}

.status-awaiting-deposit {
    background: #fef3c7;
    color: #92400e;
    animation: pulse-deposit 2s ease-in-out infinite;
}

@keyframes pulse-deposit {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Payment column */
.payment-paid {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-link {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #78350f;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s;
}

.payment-link:hover {
    transform: scale(1.05);
}

/* Propensity rows */
.propensity-row td {
    border-bottom: none;
    padding-bottom: 0.125rem;
}

.propensity-party-row td {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
    border-bottom: none;
}

.propensity-party-row:last-child td,
.propensity-row + .propensity-party-row:has(+ .propensity-row) td,
tr.propensity-party-row:has(+ tr.propensity-row) td {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.375rem;
}

/* Add separator before each new tier group */
.propensity-row ~ .propensity-row td {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

/* Propensity teaser (blurred counts) */
.propensity-teaser {
    position: relative;
}

.propensity-explainer {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.propensity-explainer strong {
    color: var(--text);
}

.blurred-value {
    filter: blur(8px);
    user-select: none;
    opacity: 0.5;
}

.teaser-overlay {
    text-align: center;
    padding-top: 0.75rem;
}

/* Count Reports */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.search-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.search-field {
    flex: 1;
    position: relative;
}

.search-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field input.selected {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
    padding-right: 2.5rem;
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-btn:hover {
    background: #e2e8f0;
    color: var(--text);
}

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

.btn-primary {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    height: 40px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 12px rgba(69, 128, 247, 0.3);
    transform: translateY(-1px);
}

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

/* Autocomplete dropdown */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

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

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

.autocomplete-item .district-name {
    font-weight: 500;
}

.autocomplete-item .district-type {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.autocomplete-empty {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Results */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.result-header {
    margin-bottom: 1.5rem;
}

.result-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.result-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breakdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.breakdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.breakdown h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.breakdown table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown th, .breakdown td {
    padding: 0.375rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.breakdown th {
    font-weight: 600;
    color: var(--text-muted);
}

.breakdown td:last-child, .breakdown th:last-child {
    text-align: right;
}

.placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

.spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Email List Actions (on count results page) */
.email-actions {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.email-actions h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Filter controls */
.email-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 75px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.filter-group select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--surface);
    cursor: pointer;
}

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

/* Email count + generate button target */
.email-count-target {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ZeroBounce credit display */
.credit-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.credit-warning {
    color: var(--error);
    font-weight: 500;
}

/* Filters column in jobs table */
.filters-cell {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: normal !important;
    max-width: 150px;
}

/* Jobs Table */
.jobs-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
}

.jobs-table th, .jobs-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    white-space: nowrap;
}

.jobs-table th {
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
}

.jobs-table td:nth-child(n+4) {
    text-align: right;
}

.jobs-table th:nth-child(n+4) {
    text-align: right;
}

.error-row td {
    border-bottom: 1px solid var(--border);
}

.error-detail {
    color: var(--error);
    font-size: 0.8rem;
    white-space: normal !important;
    padding: 0.375rem 0.75rem 0.625rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-generating_csv,
.status-uploading_to_zerobounce,
.status-validating,
.status-downloading_results,
.status-uploading_to_sendgrid {
    background: #fef3c7;
    color: #92400e;
}

.status-complete {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fce4ec;
    color: #b71c1c;
}

/* Elapsed time display next to status badge */
.elapsed-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.375rem;
}

/* Status note below badge (e.g. Greylisted explanation) */
.status-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
    white-space: normal;
    line-height: 1.3;
}

/* ── AI Email Draft Modal ── */
.draft-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.draft-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.draft-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 0;
}

.draft-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.draft-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.draft-modal-close:hover {
    background: #f1f5f9;
    color: var(--text);
}

.draft-modal-body {
    padding: 1.25rem 2rem 2rem;
}

.draft-context {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.draft-context-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.84rem;
}

.draft-context-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.draft-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    margin-top: 1rem;
}

.draft-input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
}

.draft-input:focus,
.draft-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(69, 128, 247, 0.1);
}

.draft-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
}

.draft-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.draft-btn-secondary {
    padding: 0.5rem 1.25rem;
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.draft-btn-secondary:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.draft-error {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    color: #dc2626;
    border-radius: var(--radius);
    font-size: 0.84rem;
    margin-bottom: 1rem;
}

.draft-rules-hint {
    padding: 0.6rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 1rem;
}

.draft-rules-hint strong {
    color: #78350f;
}

.draft-placeholders-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.draft-placeholders-hint code {
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
}

/* Draft buttons in My Lists table */
.draft-btn-new {
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, var(--primary), #6ba0ff);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.draft-btn-new:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(69, 128, 247, 0.3);
}

.draft-btn-edit {
    padding: 0.2rem 0.6rem;
    background: #d1fae5;
    color: #065f46;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

.draft-btn-edit:hover {
    transform: scale(1.05);
}

/* ── Admin Console ── */
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.admin-tab {
    padding: 0.6rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
    color: var(--text);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-action-btn {
    padding: 0.2rem 0.6rem;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: transform 0.1s, box-shadow 0.1s;
}

.admin-action-btn:hover {
    transform: scale(1.05);
}

.admin-action-confirm {
    background: #d1fae5;
    color: #065f46;
}

.admin-action-approve {
    background: #dbeafe;
    color: #1e40af;
}

.admin-action-verify {
    background: #fef3c7;
    color: #92400e;
}

.ip-flag {
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

/* Nav links — already styled in header section */

/* Progress bar for count streaming */
.progress-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: 1rem;
}

.progress-status {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.progress-track {
    width: 100%;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.12);
}

.progress-bar {
    height: 100%;
    min-width: 2%;
    background: linear-gradient(90deg, #4580f7, #6ba0ff, #93bbff);
    border-radius: 11px;
    transition: width 0.4s ease;
    box-shadow: 0 1px 4px rgba(69,128,247,0.4);
}

.progress-pct {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.75rem;
}

/* Account checklist */
.account-intro {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.checklist {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checklist-step {
    display: flex;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

.checklist-step:hover {
    box-shadow: var(--shadow-md);
}

.checklist-step.complete {
    border-color: #86efac;
}

.checklist-step.locked {
    opacity: 0.6;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-icon.complete {
    background: #059669;
    color: white;
}

.step-icon.incomplete {
    background: #fca5a5;
    color: #991b1b;
}

.step-icon.locked {
    background: #e2e8f0;
    color: var(--text-muted);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.step-locked {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-style: italic;
}

.step-summary {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.step-summary p {
    margin-bottom: 0.125rem;
}

.step-waiting {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.step-form label {
    display: block;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    margin-top: 0.5rem;
}

.step-form input,
.step-form textarea {
    width: 100%;
    max-width: 400px;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

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

.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    height: auto;
    margin-top: 0.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.84rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* ── Deposit Gate UI ── */
.deposit-gate-box {
    display: flex;
    gap: 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.deposit-gate-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.deposit-gate-content {
    flex: 1;
}

.deposit-covers-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
}

.deposit-covers-list li {
    font-size: 0.84rem;
    color: var(--text-muted);
    padding: 0.15rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.deposit-covers-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: 700;
}

.deposit-required-notice {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
}

.deposit-required-notice p {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.deposit-required-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: #fecaca;
    color: #991b1b;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deposit-required-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #d1d5db, #e5e7eb);
    color: #6b7280;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.deposit-lock {
    font-size: 0.65rem;
}

.deposit-nudge {
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    background: #fffbeb;
    border: 1px dashed #fbbf24;
    border-radius: var(--radius);
    font-size: 0.84rem;
    color: #92400e;
    text-align: center;
}

.deposit-nudge a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.deposit-nudge a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 640px) {
    .search-row { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .breakdowns { grid-template-columns: 1fr; }
    header { padding: 1rem; }
    main { margin: 1rem auto; }
    .filter-row { flex-direction: column; align-items: flex-start; }
    .email-count-target { flex-direction: column; align-items: stretch; }
    .jobs-table { font-size: 0.8rem; }
    .collage-stat { font-size: 2.5rem; }
    .collage-label { font-size: 0.9rem; }
    .feature-cards-row { grid-template-columns: 1fr; }
    .feature-card { flex-direction: column; padding: 1.75rem; }
    .feature-section-header h3 { font-size: 1.5rem; }
}

/* ── Campaigns Collage Banner ── */
.campaigns-banner {
    margin: 1.5rem 0;
    text-align: center;
}

.campaigns-collage {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.campaigns-collage img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: top;
    display: block;
    filter: saturate(0.85);
}

.collage-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 2.5rem 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.collage-stat {
    font-size: 3.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.collage-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ── Instantly-style Feature Cards ── */
.feature-section {
    margin: 3rem 0;
}

.feature-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.feature-section-header h3 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.feature-section-header p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

.feature-section-header a.btn-primary {
    color: white;
}

.feature-section-header p a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.feature-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.feature-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.feature-card {
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.feature-card-blue {
    background: linear-gradient(135deg, #e8f0fe, #d4e4ff, #eef2ff);
}

.feature-card-green {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5, #f0fdf4);
}

.feature-card-purple {
    background: linear-gradient(135deg, #f3e8ff, #ede9fe, #faf5ff);
}

.feature-card-amber {
    background: linear-gradient(135deg, #fffbeb, #fef3c7, #fffbeb);
}

.feature-card-text {
    flex: 1;
}

.feature-card-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.feature-card-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.feature-card-green .feature-card-eyebrow { color: #059669; }
.feature-card-purple .feature-card-eyebrow { color: #7c3aed; }
.feature-card-amber .feature-card-eyebrow { color: #d97706; }

.feature-card h4 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Mini stat row inside cards */
.feature-stat-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.feature-mini-stat {
    display: flex;
    flex-direction: column;
}

.feature-mini-stat strong {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.feature-mini-stat span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.feature-card-green .feature-mini-stat strong { color: #059669; }
.feature-card-purple .feature-mini-stat strong { color: #7c3aed; }

/* Mock UI inside feature cards */
.feature-mock {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 320px;
}

.mock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
}

.mock-row:last-child {
    border-bottom: none;
}

.mock-highlight {
    background: #fffbeb;
    border-radius: 8px;
    border-bottom-color: transparent;
}

.mock-party {
    font-weight: 600;
    color: var(--text);
}

.mock-count {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.mock-btn {
    padding: 0.15rem 0.5rem;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}
