:root {
    --bg: #0d0f14;
    --surface: #151821;
    --surface2: #1c2030;
    --border: #252a3a;
    --border-light: #2e3548;
    --accent: #4f8ef7;
    --accent-dim: #1e3a6e;
    --accent-glow: rgba(79,142,247,0.15);
    --green: #2dd4a0;
    --green-dim: #0d3b2e;
    --red: #f75959;
    --red-dim: #3b1a1a;
    --yellow: #f7c84f;
    --yellow-dim: #3b2e0d;
    --text: #e2e6f0;
    --text-dim: #8892a4;
    --text-muted: #4a5568;
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --sidebar-w: 220px;
    --topbar-h: 60px;
}

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    font-size: 24px;
    color: var(--accent);
    line-height: 1;
}

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    letter-spacing: -0.3px;
}

.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-section {
    padding: 14px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-family: var(--mono);
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
}

.nav-links li a:hover { background: var(--surface2); color: var(--text); }
.nav-links li a.active { background: var(--accent-glow); color: var(--accent); border-right: 2px solid var(--accent); }

.nav-icon { font-size: 15px; opacity: 0.7; min-width: 18px; text-align: center; }
.nav-links li a.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ── MAIN LAYOUT ── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.topbar-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
}

.content-body {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
}

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── STAT GRID ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--mono);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

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

thead th {
    text-align: left;
    padding: 10px 14px;
    background: var(--surface2);
    color: var(--text-dim);
    font-weight: 500;
    font-family: var(--mono);
    font-size: 11px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--mono);
}

.badge-ready { background: var(--green-dim); color: var(--green); }
.badge-processing { background: var(--accent-dim); color: var(--accent); }
.badge-pending { background: var(--yellow-dim); color: var(--yellow); }
.badge-error { background: var(--red-dim); color: var(--red); }
.badge-done { background: var(--green-dim); color: var(--green); }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font);
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-green { background: var(--green); color: #0d0f14; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 10px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }

input[type="text"], input[type="number"], input[type="email"],
select, textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 9px 12px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea { resize: vertical; min-height: 100px; font-family: var(--mono); font-size: 12px; }

/* ── UPLOAD ZONE ── */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--surface2);
    position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon { font-size: 40px; margin-bottom: 12px; color: var(--text-muted); }
.upload-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.upload-sub { font-size: 12px; color: var(--text-muted); }

/* ── PROGRESS ── */
.progress-bar {
    background: var(--surface2);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-fill.green { background: var(--green); }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 3px solid;
}

.alert-info { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.alert-success { background: var(--green-dim); border-color: var(--green); color: var(--text); }
.alert-error { background: var(--red-dim); border-color: var(--red); color: var(--text); }
.alert-warning { background: var(--yellow-dim); border-color: var(--yellow); color: var(--text); }

/* ── GRID LAYOUTS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── MISC ── */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.mono { font-family: var(--mono); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }

.chip {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text-dim);
    margin: 2px;
}

/* ── PHONE FINDER SPECIFIC ── */
.phone-textarea {
    font-family: var(--mono);
    font-size: 12px;
    min-height: 180px;
}

.results-table th { font-size: 10px; }
.results-table td { font-size: 12px; font-family: var(--mono); }

/* ── MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 520px;
    position: relative;
}

.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .brand-text, .nav-section, .sidebar-footer, .nav-links li a span:not(.nav-icon) { display: none; }
    .main-content { margin-left: 60px; }
    .nav-links li a { justify-content: center; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
