/* ─── CSS VARIABLES ─── */
:root {
    --ink: #0a0a0f;
    --ink-soft: #1a1a2e;
    --surface: #f5f4f0;
    --surface-2: #eeecea;
    --surface-3: #e4e2dd;
    --accent: #1a472a;
    --accent-2: #2d6a4f;
    --gold: #c9a84c;
    --gold-light: #e8c96a;
    --inec-danger: #c0392b;
    --inec-success: #27ae60;
    --text: #1c1c28;
    --text-muted: #6b6b7a;
    --text-light: #9a9aaa;
    --border: rgba(10, 10, 15, 0.08);
    --border-strong: rgba(10, 10, 15, 0.15);
    --sidebar-w: 260px;
}

/* ─── BASE ─── */
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.35;
}

/* ─── TYPOGRAPHY ─── */
.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-mono {
    font-family: 'DM Mono', monospace;
}

/* ─── SIDEBAR ─── */
#sidebar {
    width: var(--sidebar-w);
    background: var(--ink);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

#sidebar.sidebar-hidden {
    transform: translateX(-100%);
}

.sidebar-logo {
    padding: 28px 24px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.logo-emblem {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 900;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.logo-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.32);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

.nav-section-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    padding: 0 10px;
    margin: 18px 0 7px;
}

.nav-section-label:first-child {
    margin-top: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 13.5px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.14s ease;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-link.active {
    background: rgba(201, 168, 76, 0.11);
    color: var(--gold-light);
}

.sidebar-link .bi {
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active .bi {
    opacity: 1;
    color: var(--gold);
}

.sidebar-link .nav-badge {
    margin-left: auto;
    background: var(--gold);
    color: var(--ink);
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    font-family: 'DM Mono', monospace;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.14s;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.3);
}

/* ─── SIDEBAR OVERLAY (mobile) ─── */
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.55);
    z-index: 1039;
    backdrop-filter: blur(2px);
}

#sidebarOverlay.show {
    display: block;
}

/* ─── MAIN WRAPPER ─── */
#mainContent {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── TOPBAR ─── */
.topbar {
    height: 64px;
    background: rgba(245, 244, 240, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.3px;
}

.search-wrap {
    position: relative;
    width: 100%;
    max-width: 240px;
}

.search-wrap .bi {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 13px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 36px;
    border: 1.5px solid var(--border-strong);
    border-radius: 9px;
    padding: 0 12px 0 32px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    background: white;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

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

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.09);
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1.5px solid var(--border-strong);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.14s;
    font-size: 15px;
    flex-shrink: 0;
}

.topbar-icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.notif-btn {
    position: relative;
}

.notif-btn::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--inec-danger);
    border: 1.5px solid white;
}

.hamburger-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1.5px solid var(--border-strong);
    background: white;
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

/* ─── PAGE CONTENT ─── */
.page-content {
    padding: 32px;
    flex: 1;
}

/* ─── BREADCRUMB ─── */
.inec-breadcrumb {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 24px;
    animation: fadeUp 0.4s ease both;
}

.inec-breadcrumb .sep {
    color: var(--text-light);
}

.inec-breadcrumb .current {
    color: var(--ink);
    font-weight: 500;
}

/* ─── SECTION HEADER ─── */
.section-header {
    animation: fadeUp 0.4s ease both;
    margin-bottom: 24px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.section-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--inec-success);
    animation: pulse 2s infinite;
    display: inline-block;
}

/* ─── STAT CARDS ─── */
.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.18s, box-shadow 0.18s;
    animation: fadeUp 0.5s ease both;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 18px 18px;
}

.stat-card.c-green::after {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.stat-card.c-gold::after {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.stat-card.c-ink::after {
    background: linear-gradient(90deg, var(--ink), #2a2a4a);
}

.stat-card.c-red::after {
    background: linear-gradient(90deg, var(--inec-danger), #e74c3c);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.stat-icon.bg-green {
    background: rgba(26, 71, 42, 0.08);
}

.stat-icon.bg-gold {
    background: rgba(201, 168, 76, 0.10);
}

.stat-icon.bg-ink {
    background: rgba(10, 10, 15, 0.06);
}

.stat-icon.bg-red {
    background: rgba(192, 57, 43, 0.08);
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
}

.stat-delta {
    position: absolute;
    top: 22px;
    right: 22px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    padding: 2px 8px;
    border-radius: 20px;
}

.stat-delta.up {
    background: rgba(39, 174, 96, 0.09);
    color: var(--inec-success);
}

.stat-delta.neutral {
    background: rgba(10, 10, 15, 0.06);
    color: var(--text-muted);
}

/* ─── INEC CARD ─── */
.inec-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.inec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.card-title-main {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.3px;
    margin: 0;
}

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

/* ─── CUSTOM TABS ─── */
.inec-tabs {
    display: flex;
    gap: 2px;
    padding: 18px 24px 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.inec-tabs::-webkit-scrollbar {
    height: 0;
}

.inec-tab {
    padding: 7px 14px 11px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.14s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    outline: none;
}

.inec-tab:hover {
    color: var(--ink);
}

.inec-tab.active {
    color: var(--ink);
    border-bottom-color: var(--ink);
    font-weight: 600;
}

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

.inec-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
}

.inec-table thead th {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 12px 24px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.inec-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    cursor: pointer;
}

.inec-table tbody tr:last-child {
    border-bottom: none;
}

.inec-table tbody tr:hover {
    background: var(--surface);
}

.inec-table tbody td {
    padding: 13px 24px;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
}

.td-state {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
    color: var(--ink);
}

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

.state-dot.active {
    background: var(--inec-success);
}

.state-dot.pending {
    background: var(--gold);
}

.state-dot.inactive {
    background: var(--text-light);
}

/* ─── PILLS ─── */
.inec-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.inec-pill::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.pill-success {
    background: rgba(39, 174, 96, 0.1);
    color: #1a8a40;
    font-weight: bold !important;
    font-size: 14px;
}

.pill-warning {
    background: rgba(201, 168, 76, 0.12);
    color: #8a6a0a;
}

.pill-neutral {
    background: rgba(10, 10, 15, 0.06);
    color: var(--text-muted);
}

.pill-danger {
    background: rgba(192, 57, 43, 0.08);
    color: var(--inec-danger);
}

/* ─── ELECTION TAG ─── */
.election-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tag-presidential {
    background: rgba(10, 10, 15, 0.07);
    color: var(--ink);
}

.tag-gubernatorial {
    background: rgba(26, 71, 42, 0.10);
    color: var(--accent);
}

.tag-local {
    background: rgba(201, 168, 76, 0.12);
    color: #8a6a0a;
}

/* ─── PROGRESS ─── */
.inec-progress-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
}

.inec-progress {
    flex: 1;
    height: 5px;
    background: var(--surface-3);
    border-radius: 99px;
    overflow: hidden;
    min-width: 60px;
}

.inec-progress-bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-pct {
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* ─── QUICK IMPORT CARD ─── */
.import-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.import-type-btn {
    padding: 11px 6px;
    border-radius: 10px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    transition: all 0.14s;
    outline: none;
}

.import-type-btn:hover {
    border-color: var(--accent-2);
    background: white;
}

.import-type-btn.selected {
    border-color: var(--accent);
    background: rgba(26, 71, 42, 0.06);
}

.import-type-icon {
    font-size: 18px;
    display: block;
    margin-bottom: 3px;
}

.import-type-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
}

.import-type-btn.selected .import-type-label {
    color: var(--accent);
}

.form-label-inec {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}

.inec-input, .inec-select {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--border-strong);
    border-radius: 9px;
    padding: 0 12px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: all 0.18s;
    appearance: none;
}

.inec-input:focus, .inec-select:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.08);
}

.inec-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b6b7a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

/* ─── IMPORT PROGRESS SECTION ─── */
.import-progress-section {
    padding: 18px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.import-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}

.import-progress-bar-wrap {
    height: 6px;
    background: var(--surface-3);
    border-radius: 99px;
    overflow: hidden;
}

.import-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.5s ease;
}

.import-stat-value {
    font-family: 'DM Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
}

.import-stat-label {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── ACTIVITY FEED ─── */
.activity-item {
    display: flex;
    gap: 13px;
    padding: 13px 22px;
    transition: background 0.1s;
}

.activity-item:hover {
    background: var(--surface);
}

.activity-dot-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4px;
}

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

.activity-line {
    width: 1px;
    flex: 1;
    background: var(--border);
    margin-top: 4px;
    min-height: 14px;
}

.activity-item:last-child .activity-line {
    display: none;
}

.activity-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
}

.activity-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    gap: 8px;
    margin-top: 1px;
}

.activity-meta span + span::before {
    content: '·';
    margin-right: 8px;
}

/* ─── STATE GRID MAP ─── */
.state-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 24px;
}

.map-state {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.14s;
    border: 1px solid transparent;
    position: relative;
}

.map-state:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.map-state.imported {
    background: rgba(26, 71, 42, 0.13);
    border-color: rgba(26, 71, 42, 0.22);
}

.map-state.in-progress {
    background: rgba(201, 168, 76, 0.16);
    border-color: rgba(201, 168, 76, 0.3);
}

.map-state.pending {
    background: var(--surface-2);
    border-color: var(--border);
}

.map-state-code {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    font-family: 'DM Mono', monospace;
}

.map-state.imported .map-state-code {
    color: var(--accent);
}

.map-state.in-progress .map-state-code {
    color: #8a6a0a;
}

.map-state.pending .map-state-code {
    color: var(--text-light);
}

/* ─── BUTTONS ─── */
.btn-inec-primary {
    background: var(--ink);
    color: white;
    border: none;
    border-radius: 9px;
    padding: 0 16px;
    height: 36px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.14s;
    white-space: nowrap;
}

.btn-inec-primary:hover {
    background: #1a1a2e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-inec-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--ink);
    border: none;
    border-radius: 9px;
    padding: 0 18px;
    height: 36px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.14s;
    white-space: nowrap;
}

.btn-inec-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.35);
}

.btn-inec-outline {
    background: white;
    color: var(--text);
    border: 1.5px solid var(--border-strong);
    border-radius: 9px;
    padding: 0 14px;
    height: 36px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.14s;
    white-space: nowrap;
}

.btn-inec-outline:hover {
    background: var(--surface-2);
}

/* ─── MAP LEGEND ─── */
.map-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ─── TOOLTIP ─── */
[data-bs-toggle="tooltip"] {
    cursor: pointer;
}

/* ─── MONO UTIL ─── */
.text-mono {
    font-family: 'DM Mono', monospace;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}

.animate-1 {
    animation: fadeUp 0.5s 0.00s ease both;
}

.animate-2 {
    animation: fadeUp 0.5s 0.06s ease both;
}

.animate-3 {
    animation: fadeUp 0.5s 0.12s ease both;
}

.animate-4 {
    animation: fadeUp 0.5s 0.18s ease both;
}

.animate-5 {
    animation: fadeUp 0.5s 0.24s ease both;
}

.animate-6 {
    animation: fadeUp 0.5s 0.30s ease both;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 991.98px) {
    :root {
        --sidebar-w: 0px;
    }

    #sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #mainContent {
        margin-left: 0 !important;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .topbar-brand {
        display: block !important;
    }

    .search-wrap {
        max-width: 180px;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 20px 16px;
    }

    .section-title {
        font-size: 20px;
    }

    .state-grid {
        grid-template-columns: repeat(5, 1fr);
        padding: 16px;
    }

    .search-wrap {
        display: none !important;
    }

    .inec-card-header {
        padding: 16px 18px 14px;
    }

    .inec-table thead th,
    .inec-table tbody td {
        padding: 11px 16px;
    }

    .map-legend {
        gap: 10px;
    }

    .import-type-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 575.98px) {
    .state-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stat-value {
        font-size: 24px;
    }

    .topbar {
        height: 58px;
    }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}


/* ─── ENHANCED DASHBOARD OVERRIDES ─── */

/* Stat cards — richer depth & glow accent */
.stat-card {
    border-radius: 20px;
    padding: 24px 22px 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    background: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -32px;
    right: -32px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    opacity: 0.07;
}

.stat-card.c-green::before {
    background: var(--accent);
}

.stat-card.c-gold::before {
    background: var(--gold);
}

.stat-card.c-ink::before {
    background: var(--ink);
}

.stat-card.c-red::before {
    background: var(--inec-danger);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.012);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 32px;
    letter-spacing: -1.5px;
    margin-bottom: 2px;
}

.stat-delta {
    top: 18px;
    right: 18px;
    font-size: 10.5px;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.2px;
}

/* ─── TOPBAR UPGRADE ─── */
.topbar {
    height: 66px;
    background: rgba(245, 244, 240, 0.82);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    font-size: 17px;
    letter-spacing: -0.5px;
}

/* ─── SEARCH UPGRADE ─── */
.search-wrap {
    max-width: 260px;
}

.search-input {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(10, 10, 15, 0.12);
    height: 38px;
    border-radius: 10px;
    font-size: 13px;
}

/* ─── TABLE UPGRADE ─── */
.inec-table thead th {
    font-size: 10px;
    letter-spacing: 1.2px;
    padding: 14px 22px;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 2;
}

.inec-table tbody tr {
    transition: background 0.13s, box-shadow 0.13s;
}

.inec-table tbody tr:hover {
    background: rgba(26, 71, 42, 0.028);
    box-shadow: inset 3px 0 0 var(--accent-2);
}

.inec-table tbody td {
    padding: 15px 22px;
    font-size: 13.5px;
}

/* State name cell */
.td-state {
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

/* Animated pulse for active dot */
.state-dot.active {
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.18);
    animation: dotPulse 2.4s infinite;
}

@keyframes dotPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.18);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(39, 174, 96, 0.06);
    }
}

/* Number cells */
.cell-number {
    font-family: 'DM Mono', monospace;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* Pill upgrade */
.inec-pill.pill-success {
    background: rgba(26, 71, 42, 0.07);
    color: var(--accent);
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
    letter-spacing: -0.2px;
}

.inec-pill.pill-success::before {
    display: none;
}

/* ─── CARD HEADER UPGRADE ─── */
.inec-card-header {
    padding: 22px 26px 20px;
    background: linear-gradient(to bottom, #fff, var(--surface));
}

.card-title-main {
    font-size: 17px;
}

/* Row count badge */
.row-count-badge {
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
}

/* ─── SECTION HEADER UPGRADE ─── */
.section-title {
    font-size: 26px;
    background: linear-gradient(135deg, var(--ink) 0%, #3a3a5c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── PAGE HEADER ACTIONS ─── */
.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── SIDEBAR LINK BADGE ─── */
.nav-section-label {
    margin-top: 8px;
}

/* ─── MOBILE TABLE IMPROVEMENTS ─── */
@media (max-width: 767.98px) {
    .stat-value {
        font-size: 26px;
    }

    .stat-card {
        padding: 18px 16px 16px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .inec-table thead th {
        padding: 12px 14px;
        font-size: 9.5px;
    }

    .inec-table tbody td {
        padding: 12px 14px;
        font-size: 12.5px;
    }

    .td-state {
        font-size: 14px;
    }

    .cell-number {
        font-size: 12.5px;
    }

    .inec-pill.pill-success {
        font-size: 11.5px;
        padding: 3px 9px;
    }

    .inec-card-header {
        padding: 16px 16px 14px;
    }

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

    .section-title {
        font-size: 22px;
    }

    .page-actions .btn-inec-outline span {
        display: none;
    }
}

@media (max-width: 400px) {
    .stat-value {
        font-size: 22px;
    }

    .inec-table {
        min-width: 420px;
    }
}

/* ─── EMPTY STATE / LOADER ─── */
.table-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* ─── SCROLLABLE TABLE CONTAINER ─── */
.inec-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── BOTTOM SAFE AREA FOR MOBILE ─── */
.page-content {
    padding-bottom: env(safe-area-inset-bottom, 24px);
}

/* ─── TABLE ROW RANK ─── */
.row-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text-light);
    flex-shrink: 0;
}

.row-rank.top {
    background: rgba(201, 168, 76, 0.12);
    color: #8a6a0a;
}

/* ─── STAT CARD LABEL ─── */
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ─── TOPBAR NOTIFICATION DOT ─── */
.notif-btn::after {
    top: 7px;
    right: 7px;
}

/* ─── CARD FOOTER ─── */
.inec-card-footer {
    padding: 14px 26px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-note {
    font-size: 11.5px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-note .live-dot {
    width: 6px;
    height: 6px;
}

.data-search-input {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 13px;
    pointer-events: none
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0
}

.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 0.85em;
    background: var(--ink);
    margin-left: 4px;
    border-radius: 2px;
    vertical-align: middle;
    animation: twBlink 1s step-end infinite;
}

@keyframes twBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}


/* ── Overlay ── */
.dl-overlay {
    position: fixed; inset: 0;
    background: rgba(10,10,15,0.52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.dl-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal box ── */
.dl-modal {
    background: #fff;
    border-radius: 24px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.16), 0 0 0 1px rgba(255,255,255,0.6) inset;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

.dl-overlay.open .dl-modal {
    transform: translateY(0) scale(1);
}

/* ── Close button ── */
.dl-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px;
    border: 1.5px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px;
    transition: all 0.14s;
}

.dl-close:hover { background: var(--surface-2); color: var(--ink); }

/* ── Icon ── */
.dl-icon-wrap { text-align: center; margin-bottom: 20px; }

.dl-icon-ring {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(232,201,106,0.18));
    border: 1.5px solid rgba(201,168,76,0.25);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: var(--gold);
}

/* ── Header ── */
.dl-header { text-align: center; margin-bottom: 20px; }

.dl-title {
    font-size: 20px; font-weight: 700;
    color: var(--ink); letter-spacing: -0.4px;
    margin-bottom: 5px;
}

.dl-subtitle {
    font-size: 12.5px; color: var(--text-muted);
    margin: 0;
}

/* ── Info strip ── */
.dl-info-strip {
    display: flex; align-items: center; justify-content: center;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.dl-info-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500;
    color: var(--text-muted);
    flex: 1; justify-content: center;
}

.dl-info-item .bi { font-size: 14px; color: var(--accent); }

.dl-info-sep {
    width: 1px; height: 24px;
    background: var(--border-strong);
    flex-shrink: 0;
}

/* ── Field ── */
.dl-field-wrap { margin-bottom: 16px; }

.dl-label {
    display: block;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.dl-input-wrap { position: relative; }

.dl-input-icon {
    position: absolute; left: 13px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-light); font-size: 14px;
    pointer-events: none;
}

.dl-input {
    width: 100%; height: 46px;
    border: 1.5px solid var(--border-strong);
    border-radius: 11px;
    padding: 0 14px 0 38px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: all 0.18s;
}

.dl-input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,71,42,0.08);
}

.dl-input.error { border-color: var(--inec-danger); box-shadow: 0 0 0 3px rgba(192,57,43,0.08); }

.dl-field-hint {
    font-size: 11.5px; color: var(--text-light);
    margin: 6px 0 0;
}

/* ── Terms ── */
.dl-terms-wrap { margin-bottom: 20px; }

.dl-check-label {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer; font-size: 12.5px;
    color: var(--text-muted); line-height: 1.5;
}

.dl-check { display: none; }

.dl-check-box {
    width: 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    flex-shrink: 0; margin-top: 1px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.14s;
}

.dl-check:checked + .dl-check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.dl-check:checked + .dl-check-box::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ── Error msg ── */
.dl-error-msg {
    display: flex; align-items: center; gap: 8px;
    background: rgba(192,57,43,0.06);
    border: 1px solid rgba(192,57,43,0.15);
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 12.5px; color: var(--inec-danger);
    margin-bottom: 16px;
}

/* ── Submit button ── */
.dl-submit-btn {
    width: 100%; height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--ink);
    border: none; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 16px;
}

.dl-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.35);
}

.dl-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

/* ── Spinner ── */
.dl-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(10,10,15,0.2);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: dlSpin 0.7s linear infinite;
    display: inline-block;
}

@keyframes dlSpin { to { transform: rotate(360deg); } }

/* ── Footer note ── */
.dl-footer-note {
    text-align: center;
    font-size: 11px; color: var(--text-light);
    display: flex; align-items: center; justify-content: center; gap: 5px;
    margin: 0;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .dl-modal { padding: 28px 20px 22px; border-radius: 20px; }
    .dl-title { font-size: 17px; }
    .dl-info-item span { display: none; }
    .dl-info-sep { display: none; }
}
