/* ═══════════════════════════════════════════════════════════
   GeoNex GPS Portal — Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── DARK THEME (default) ────────────────────────────────── */
:root, [data-theme="dark"] {
    --sidebar-w: 220px;
    --sidebar-w-collapsed: 62px;
    --topbar-h: 54px;
    --bg-dark: #0f1923;
    --bg-sidebar: #0c1520;
    --bg-main: #111b27;
    --bg-card: #162231;
    --bg-card-hover: #1a2a3d;
    --accent: #00b894;
    --accent-hover: #00a383;
    --danger: #e74c3c;
    --warning: #f39c12;
    --online: #00b894;
    --offline: #636e72;
    --text: #e0e6ed;
    --text-muted: #7f8c9b;
    --border: rgba(255,255,255,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --input-bg: #111b27;
    --input-text: #fff;
    --table-stripe: rgba(255,255,255,0.02);
    --scrollbar-thumb: rgba(255,255,255,0.1);
    --scrollbar-hover: rgba(255,255,255,0.2);
    --overlay-bg: rgba(0,0,0,0.5);
    --brand-text: #fff;
    --nav-hover-bg: rgba(255,255,255,0.04);
    --nav-active-bg: rgba(0,184,148,0.12);
    --marker-shadow: rgba(0,0,0,0.4);
    --leaflet-ctrl-bg: #162231;
    --leaflet-ctrl-text: #e0e6ed;
}

/* ─── LIGHT THEME ─────────────────────────────────────────── */
[data-theme="light"] {
    --bg-dark: #e8edf2;
    --bg-sidebar: #f0f3f7;
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f3f7;
    --accent: #00a383;
    --accent-hover: #008f72;
    --danger: #e74c3c;
    --warning: #e67e22;
    --online: #00a383;
    --offline: #95a5a6;
    --text: #1a2332;
    --text-muted: #5f6d7e;
    --border: rgba(0,0,0,0.08);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --input-bg: #fff;
    --input-text: #1a2332;
    --table-stripe: rgba(0,0,0,0.02);
    --scrollbar-thumb: rgba(0,0,0,0.12);
    --scrollbar-hover: rgba(0,0,0,0.2);
    --overlay-bg: rgba(0,0,0,0.25);
    --brand-text: #1a2332;
    --nav-hover-bg: rgba(0,0,0,0.04);
    --nav-active-bg: rgba(0,163,131,0.1);
    --marker-shadow: rgba(0,0,0,0.2);
    --leaflet-ctrl-bg: #ffffff;
    --leaflet-ctrl-text: #1a2332;
}

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

/* Indicadores de frescura */
.time-fresh { color: #00b894; font-weight: 600; }
.time-recent { color: #fdcb6e; }
.time-delayed { color: #e17055; }
.time-stale { color: #d63031; font-weight: 600; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    z-index: 1000;
}
.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
    min-width: var(--sidebar-w-collapsed);
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-name,
.sidebar.collapsed .nav-divider { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 14px 0; }
.sidebar.collapsed .sidebar-brand { justify-content: center; }
.sidebar.collapsed .sidebar-footer { justify-content: center; gap: 0; }
.sidebar.collapsed .user-info { display: none; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 26px; }
.brand-text { font-size: 20px; font-weight: 700; color: var(--brand-text); }
.text-accent { color: var(--accent); }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.nav-link:hover { color: var(--text); background: var(--nav-hover-bg); }
.nav-link.active {
    color: var(--text);
    background: var(--nav-active-bg);
}
.nav-link.active i { color: var(--accent); }
.nav-link i { width: 20px; text-align: center; font-size: 15px; }
.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 16px;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}
.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    overflow: hidden;
}
.user-info i { font-size: 18px; }
.user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s;
}
.logout-btn:hover { color: var(--danger); background: rgba(231,76,60,0.1); }

/* ─── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ─── TOPBAR ──────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
}
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
}
.topbar-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}
.topbar-stats {
    flex: 1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
}
.stat-badge.online { color: var(--online); }
.stat-badge.offline { color: var(--offline); }
.stat-badge.total { color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.connection-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--offline);
    display: inline-block;
}
.connection-dot.connected { background: var(--online); }

/* ─── PAGES ───────────────────────────────────────────────── */
.page { display: none; flex: 1; overflow: hidden; }
.page.active { display: flex; flex-direction: column; }
.page-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-header-bar h3 { font-size: 18px; font-weight: 600; }

/* ─── MAP ─────────────────────────────────────────────────── */
.map-wrapper { flex: 1; position: relative; display: flex; }
#map { flex: 1; z-index: 1; }

.vehicle-panel {
    width: 320px;
    min-width: 320px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 2;
    transition: all 0.25s;
}
.vehicle-panel.hidden { width: 0; min-width: 0; overflow: hidden; border: none; }
.vp-header {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}
.vp-search {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.vp-search:focus { border-color: var(--accent); }
.vp-toggle-btn, .vp-expand-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    padding: 8px 10px;
    transition: all 0.15s;
}
.vp-toggle-btn:hover, .vp-expand-btn:hover { color: #fff; }
.vp-expand-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 3;
}
.vp-stats {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.vp-list { flex: 1; overflow-y: auto; padding: 6px; }

/* Vehicle Cards */
.v-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.v-card:hover { background: rgba(255,255,255,0.04); }
.v-card.selected { background: rgba(0,184,148,0.1); border: 1px solid rgba(0,184,148,0.2); }
.v-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.v-icon.online { background: rgba(0,184,148,0.15); }
.v-icon.offline { background: rgba(99,110,114,0.15); }
.v-icon-bus {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.v-icon-bus.online { background: linear-gradient(135deg, rgba(46,204,113,0.15), rgba(0,184,148,0.2)); color: #27ae60; }
.v-icon-bus.offline { background: rgba(99,110,114,0.12); color: #636e72; }
.v-info { flex: 1; min-width: 0; }
.v-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v-detail {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    margin-top: 2px;
}
.v-status {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.v-status.online { background: var(--online); box-shadow: 0 0 6px var(--online); }
.v-status.offline { background: var(--offline); }

/* Detail Overlay */
.detail-overlay {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 5;
    display: none;
}
.detail-overlay.show { display: block; }
.detail-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    min-width: 380px;
    box-shadow: var(--shadow);
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.detail-item { text-align: center; }
.detail-item .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item .value { font-size: 18px; font-weight: 700; margin-top: 2px; }
.detail-item .value.on { color: var(--online); }
.detail-item .value.off { color: var(--danger); }
.detail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
}
.close-detail {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}
.close-detail:hover { color: #fff; }

/* ─── HISTORY ─────────────────────────────────────────────── */
.history-wrapper { flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.history-topbar {
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}
.history-map { flex: 1; min-height: 0; }
.history-table-panel {
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-card);
    border-top: 2px solid var(--accent);
    transition: max-height 0.3s ease;
}
.history-table-panel:empty { max-height: 0; border-top: none; }
.history-table-panel table { margin-bottom: 0; }
.history-table-panel thead { position: sticky; top: 0; z-index: 1; background: var(--bg-dark); }

/* Neon glow route effect */
.leaflet-overlay-pane svg path.neon-trail {
    filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 12px var(--accent));
}

/* ─── CARDS ───────────────────────────────────────────────── */
.card-dark {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

/* ─── REPORTS ─────────────────────────────────────────────── */
.report-controls { margin-bottom: 16px; }
.form-label-sm { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; display: block; }
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.report-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.report-stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}
.report-stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ─── TABLES ──────────────────────────────────────────────── */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: rgba(255,255,255,0.03);
    font-size: 13px;
}
.table-dark thead th {
    background: var(--bg-card);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom-width: 1px;
    white-space: nowrap;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* ─── BADGES ──────────────────────────────────────────────── */
.badge-online { background: rgba(0,184,148,0.15); color: var(--online); }
.badge-offline { background: rgba(99,110,114,0.15); color: var(--offline); }
.badge-role {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.badge-superadmin { background: rgba(155,89,182,0.15); color: #9b59b6; }
.badge-admin { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-operator { background: rgba(241,196,15,0.15); color: #f1c40f; }
.badge-viewer { background: rgba(149,165,166,0.15); color: #95a5a6; }

/* ─── VEHICLE ICONS (Map markers) ─────────────────────────── */
.marker-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    color: #fff;
    font-weight: 700;
}

/* ─── BUS MARKER ──────────────────────────────────────────── */
/* Lateral view (sidebar / detail) */
.custom-bus-marker {
    background: none !important;
    border: none !important;
}
.bus-marker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s ease;
}
.bus-marker-body {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
    transition: filter 0.3s;
}
.bus-marker:hover .bus-marker-body {
    filter: drop-shadow(0 3px 10px rgba(0,184,148,0.5));
}
.bus-marker-label {
    margin-top: -2px;
    padding: 1px 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    line-height: 1.3;
}
[data-theme="light"] .bus-marker-label {
    background: rgba(255,255,255,0.9);
    color: #1a2332;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 32px;
    margin-left: -25px;
    margin-top: -18px;
    border-radius: 8px;
    background: rgba(46,204,113,0.2);
    animation: busPulse 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Top-down / aerial view (map markers) */
.custom-bus-marker-top {
    background: none !important;
    border: none !important;
}
.bus-marker-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.6s ease;
}
.bus-marker-top-body {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    transition: filter 0.3s, transform 0.3s;
}
.bus-marker-top:hover .bus-marker-top-body {
    filter: drop-shadow(0 4px 14px rgba(0,184,148,0.45));
    transform: scale(1.08);
}
.bus-marker-label-top {
    margin-top: -4px;
    padding: 1px 5px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 8.5px;
    font-weight: 700;
    border-radius: 3px;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.4px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    pointer-events: none;
}
[data-theme="light"] .bus-marker-label-top {
    background: rgba(255,255,255,0.92);
    color: #1a2332;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.marker-pulse-top {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 58px;
    margin-left: -17px;
    margin-top: -29px;
    border-radius: 10px;
    background: rgba(46,204,113,0.18);
    animation: busPulse 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes busPulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Movement trail behind markers */
.marker-trail {
    filter: drop-shadow(0 0 4px rgba(46,204,113,0.3));
}
[data-theme="light"] .marker-trail {
    filter: drop-shadow(0 0 3px rgba(39,174,96,0.25));
}

/* Smooth Leaflet marker transition for divIcons */
.leaflet-marker-icon.custom-bus-marker-top {
    transition: none !important; /* we handle animation via rAF */
    will-change: transform;
}

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 9999;
        box-shadow: 5px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.mobile-open { left: 0; }
    .topbar-toggle { display: block; }
    .vehicle-panel { width: 100%; min-width: 100%; position: absolute; right: 0; top: 0; bottom: 0; z-index: 3; }
    .vehicle-panel.hidden { width: 0; }
    .detail-card { min-width: 300px; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .page-content { padding: 12px; }
    .report-controls .row { flex-direction: column; }
    .topbar-stats { display: none; }
    .history-table-panel { max-height: 150px; }
}

/* ─── MOBILE OVERLAY ──────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.sidebar-overlay.show { display: block; }

/* ─── FORMS ───────────────────────────────────────────────── */
.form-control.bg-dark, .form-select.bg-dark {
    border-color: var(--border);
    background: var(--input-bg) !important;
    color: var(--input-text) !important;
}
.form-control.bg-dark:focus, .form-select.bg-dark:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0,184,148,0.15);
}

/* ─── LIGHT THEME OVERRIDES ───────────────────────────────── */
[data-theme="light"] .table-dark {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: rgba(0,0,0,0.03);
    background: transparent !important;
    color: var(--text) !important;
}
[data-theme="light"] .table-dark thead th {
    background: var(--bg-card) !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
}
[data-theme="light"] .table-dark td {
    border-color: var(--border) !important;
    color: var(--text) !important;
}
[data-theme="light"] .table-dark tbody tr:hover {
    background: rgba(0,163,131,0.04) !important;
}
[data-theme="light"] .sidebar-overlay { background: var(--overlay-bg); }
[data-theme="light"] .marker-icon { box-shadow: 0 2px 8px var(--marker-shadow); }
[data-theme="light"] .sidebar {
    box-shadow: 1px 0 8px rgba(0,0,0,0.06);
}
[data-theme="light"] .card-dark {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
[data-theme="light"] .v-card:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .v-card.selected { background: rgba(0,163,131,0.08); border: 1px solid rgba(0,163,131,0.15); }
[data-theme="light"] .detail-card { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
[data-theme="light"] .history-table-panel thead { background: var(--bg-card); }
[data-theme="light"] .btn-outline-light {
    color: var(--text-muted);
    border-color: var(--border);
}
[data-theme="light"] .btn-outline-light:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}
[data-theme="light"] .text-white { color: var(--text) !important; }
[data-theme="light"] .text-muted { color: var(--text-muted) !important; }

/* ─── THEME TOGGLE BUTTON ─────────────────────────────────── */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="light"] .theme-toggle { background: #fff; }

/* ─── SPINNER ─────────────────────────────────────────────── */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}
.loading-spinner i { font-size: 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ─── MODAL ────────────────────────────────────────────────── */
.geonex-modal {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.geonex-modal .modal-header,
.geonex-modal .modal-footer {
    border-color: var(--border);
}
.geonex-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
[data-theme="light"] .geonex-modal .btn-close { filter: none; }
/* ─── LEAFLET OVERRIDES ───────────────────────────────────── */
.leaflet-control-layers {
    background: var(--leaflet-ctrl-bg) !important;
    border: 1px solid var(--border) !important;
    color: var(--leaflet-ctrl-text) !important;
    border-radius: 10px !important;
}
.leaflet-control-layers label { color: var(--leaflet-ctrl-text) !important; }
.leaflet-bar a {
    background: var(--leaflet-ctrl-bg) !important;
    color: var(--leaflet-ctrl-text) !important;
    border-color: var(--border) !important;
}
.leaflet-bar a:hover { background: var(--bg-card-hover) !important; }
