:root {
    --color-ce: #a16207;
    --color-ca: #15803d;
    --color-cd: #1d4ed8;
    --color-xq: #7e22ce;
    --color-other: #64748b;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.leaflet-container {
    font-family: 'Inter', sans-serif !important;
    background: #cbd5e1;
}

.dark .leaflet-container {
    background: #0f172a;
}

/* ============ LOADING SCREEN ============ */
.loading-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(59, 130, 246, 0.15);
    border-top-color: #3b82f6;
    animation: spin 0.9s linear infinite;
}

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

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ============ TOASTS ============ */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(17, 24, 39, 0.92);
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    font-weight: 600;
    animation: toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);
    pointer-events: auto;
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.toast.success { background: rgba(5, 150, 105, 0.95); }
.toast.error { background: rgba(220, 38, 38, 0.95); }
.toast.info { background: rgba(37, 99, 235, 0.95); }
.toast.warning { background: rgba(217, 119, 6, 0.95); }

.toast.fade-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ============ SEARCH ============ */
#search-dropdown .search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

#search-dropdown .search-item:hover,
#search-dropdown .search-item.active {
    background: #eff6ff;
}

.dark #search-dropdown .search-item:hover,
.dark #search-dropdown .search-item.active {
    background: #1e293b;
}

#search-dropdown .search-item .search-cat {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

#search-dropdown .search-item .search-meta {
    font-size: 11px;
    color: #6b7280;
    margin-left: auto;
    white-space: nowrap;
}

.dark #search-dropdown .search-item .search-meta {
    color: #9ca3af;
}

#search-dropdown .search-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

mark.search-highlight {
    background: #fef08a;
    color: #1e293b;
    border-radius: 2px;
    padding: 0 1px;
}

.dark mark.search-highlight {
    background: #facc15;
}

/* ============ CATEGORY CHIPS ============ */
.cat-chip {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: #4b5563;
    opacity: 0.6;
}

.cat-chip[data-cat="CE"] { --chip-color: var(--color-ce); }
.cat-chip[data-cat="CA"] { --chip-color: var(--color-ca); }
.cat-chip[data-cat="CD"] { --chip-color: var(--color-cd); }
.cat-chip[data-cat="XQ"] { --chip-color: var(--color-xq); }

.cat-chip.active {
    opacity: 1;
    background: color-mix(in srgb, var(--chip-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--chip-color) 40%, transparent);
    color: var(--chip-color);
}

.dark .cat-chip {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
}

.dark .cat-chip.active {
    background: color-mix(in srgb, var(--chip-color) 18%, transparent);
    border-color: color-mix(in srgb, var(--chip-color) 50%, transparent);
}

/* Estado APAGADO bien visible: atenuado + punto gris + tachado */
.cat-chip:not(.active) {
    opacity: 0.45;
}

.cat-chip:not(.active) > span:first-child {
    filter: grayscale(1);
    opacity: 0.5;
}

.cat-chip:not(.active) .cat-label {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

/* ============ ACTIVE FILTER BADGES ============ */
.active-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    animation: badge-in 0.25s ease;
}

.dark .active-filter-badge {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #3b82f6;
}

@keyframes badge-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.active-filter-badge button {
    opacity: 0.6;
    transition: opacity 0.15s;
}

.active-filter-badge button:hover { opacity: 1; }

/* ============ RIGHT MENU ============ */
.right-menu-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    transition: transform 0.25s ease;
}

.right-menu-btn:hover {
    transform: translateX(-4px);
}

.menu-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
}

.dark .menu-icon {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(255, 255, 255, 0.1);
}

.menu-label {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.25s;
    pointer-events: none;
    white-space: nowrap;
}

.dark .menu-label {
    background: rgba(30, 41, 59, 0.92);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.1);
}

.right-menu-btn:hover .menu-label {
    opacity: 1;
    transform: translateX(0);
}

.right-menu-btn:hover .menu-icon {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
}

.dark .right-menu-btn:hover .menu-icon {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #e2e8f0;
}

/* ============ SLIDING PANELS ============ */
.sliding-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(380px, 92vw);
    height: 100vh;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 60;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.dark .sliding-panel {
    background: rgba(17, 24, 39, 0.97);
}

.sliding-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.95));
}

.dark .panel-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(to bottom, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.95));
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}

.dark .panel-content .dark\:bg-gray-750:hover,
.dark .dark\:hover\:bg-gray-750:hover { background-color: #1f2937; }

/* Visualization + tool buttons: sobrios, fondo claro, borde sutil */
.viz-btn,
.tool-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #ffffff !important;
    background-image: none !important;
    color: #1e293b !important;
    font-weight: 600;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    cursor: pointer;
    text-align: left;
}

.dark .viz-btn,
.dark .tool-btn {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.viz-btn:hover,
.tool-btn:hover {
    border-color: #94a3b8 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.viz-btn:active,
.tool-btn:active { transform: scale(0.99); }

.viz-btn i,
.tool-btn i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px !important;
}

.dark .viz-btn i,
.dark .tool-btn i { background: #374151; color: #cbd5e1; }

/* ============ PANEL OVERLAY ============ */
.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ============ MOBILE BOTTOM BAR ============ */
.bottom-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background 0.2s, transform 0.2s;
    background: none;
    border: none;
    color: #4b5563;
    cursor: pointer;
}

.dark .bottom-bar-btn { color: #d1d5db; }

.bottom-bar-btn:active { transform: scale(0.9); background: rgba(0, 0, 0, 0.05); }

.safe-bottom { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }

/* ============ PAGINATION ============ */
.pagination-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
}

.dark .pagination-btn {
    background: #1f2937;
    color: #d1d5db;
}

.pagination-btn:hover { background: #e5e7eb; }
.dark .pagination-btn:hover { background: #374151; }
.pagination-btn:disabled { opacity: 0.3; cursor: default; }

.pagination-page {
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: #4b5563;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.dark .pagination-page { color: #d1d5db; }

.pagination-page.active {
    background: #1e293b;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ============ SCROLLBARS ============ */
.custom-scrollbar::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 20px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.25);
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
}
.custom-scrollbar::-webkit-scrollbar-corner { background: transparent; }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.2) transparent; }
.dark * { scrollbar-color: rgba(255,255,255,0.2) transparent; }

/* ============ LEAFLET CUSTOMIZATION ============ */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(6px);
    color: #374151 !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.dark .leaflet-control-zoom a {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: #e5e7eb !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Dark mode: usamos tiles oscuros reales (sin filtro, sin key) */
.leaflet-layer, .leaflet-tile {
    transition: none;
}

/* ============ SOBER MARKERS (crecen con el zoom) ============ */
.marker-pin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--pin, #1d4ed8);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.marker-pin span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
}

/* Tamano segun nivel de zoom (lo pone el JS en #map[data-z]) */
#map[data-z="mid"] .marker-pin { transform: scale(1.35); }
#map[data-z="high"] .marker-pin { transform: scale(1.7); }

.custom-marker:hover .marker-pin { transform: scale(1.2); }
#map[data-z="mid"] .custom-marker:hover .marker-pin { transform: scale(1.55); }
#map[data-z="high"] .custom-marker:hover .marker-pin { transform: scale(1.9); }

/* ============ SOBER CLUSTERS ============ */
.cluster-wrapper { background: transparent; border: none; }

.cluster-bubble {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: white;
    background: #334155;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cluster-bubble span { font-size: 12px; }
.cluster-sm { font-size: 11px; }
.cluster-md span { font-size: 13px; }
.cluster-lg span { font-size: 14px; }

/* Popups */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    color: #1f2937;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.dark .leaflet-popup-content-wrapper {
    background: rgba(30, 41, 59, 0.97);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.1);
}

.leaflet-popup-content {
    margin: 16px !important;
    width: 250px !important;
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.97);
}

.dark .leaflet-popup-tip {
    background: rgba(30, 41, 59, 0.97);
}

/* ============ POPUP CARD PREMIUM ============ */
.leaflet-popup-content { margin: 0 !important; width: 250px !important; }
.leaflet-popup-content-wrapper { padding: 0 !important; overflow: hidden; }

.popup-card { font-family: 'Inter', sans-serif; overflow: hidden; }

.popup-top {
    padding: 11px 16px 9px;
    color: white;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dark .popup-top { background: #0f172a; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }

.popup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid white;
    flex-shrink: 0;
}

.popup-callsign { font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; }

.popup-cat {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2px 9px;
    border-radius: 999px;
}

.popup-body { padding: 12px 16px 14px; }

.popup-actions { display: flex; gap: 6px; margin-top: 10px; }

.popup-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 4px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.dark .popup-action { background: #1e293b; color: #cbd5e1; }

.popup-action:hover { background: #e2e8f0; transform: translateY(-1px); }
.dark .popup-action:hover { background: #334155; }

.popup-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.dark .popup-content h3 { color: #f9fafb; }

.popup-content .popup-row {
    margin: 6px 0;
    font-size: 0.82rem;
    color: #4b5563;
}

.dark .popup-content .popup-row { color: #9ca3af; }

.popup-content .popup-label {
    font-weight: 600;
    color: #6b7280;
}

.dark .popup-content .popup-label { color: #6b7280; }

.popup-fav-btn {
    margin-top: 10px;
    width: 100%;
    padding: 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.popup-fav-btn.fav {
    background: #fef3c7;
    color: #b45309;
}

.popup-fav-btn.fav:hover { background: #fde68a; }

.popup-fav-btn:not(.fav) {
    background: #eff6ff;
    color: #2563eb;
}

.popup-fav-btn:not(.fav):hover { background: #dbeafe; }

/* Cluster legacy (por si acaso) */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: transparent;
    border: none;
}

.marker-cluster div { background: transparent; }

/* Measure markers */
.leaflet-interactive { transition: all 0.2s; }
.leaflet-interactive:hover { stroke-width: 3; }

/* ============ ANIMATIONS ============ */
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in { animation: fade-in 0.25s ease; }

@keyframes pulse-ring {
    0% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.pulse-animation { animation: pulse-ring 2s infinite; }

@keyframes marker-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.marker-pin.pop-in { animation: marker-pop 0.3s ease; }

/* Stats bars */
.stats-bar {
    width: 0;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ TABLE ============ */
table { border-collapse: separate; border-spacing: 0; }
table thead th { position: sticky; top: 0; z-index: 10; }

@media (max-width: 768px) {
    table { font-size: 12px; }
    table th, table td { padding: 8px 6px !important; }
}

/* ============ FAVORITES LIST ============ */
.fav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.dark .fav-item {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.08);
}

.fav-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.fav-action {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.dark .fav-action { background: rgba(255, 255, 255, 0.06); }

.fav-action:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

.dark .fav-action:hover { background: rgba(255, 255, 255, 0.12); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    /* Right menu stacked, smaller */
    .right-menu-btn { gap: 8px; }
    .menu-icon { width: 44px; height: 44px; }
    .menu-label { display: none; }
    .right-menu-btn:hover { transform: none; }

    /* Left panel fullscreen drawer */
    #left-panel {
        width: min(85vw, 340px);
        border-radius: 0 24px 24px 0;
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.25);
    }

    /* Table panel fullscreen on mobile */
    #table-panel, #favorites-panel {
        border-radius: 0;
    }

    /* Control zoom de Leaflet sobre la barra inferior (no quedan botones flotantes en movil) */
    .leaflet-bottom.leaflet-right {
        bottom: 70px;
    }
}

@media (min-width: 768px) {
    #map { display: block; }
}

/* Columna de botones flotantes (desktop): apilados sobre el control zoom, sin traslapes */
#share-btn { bottom: 96px; }
#fullscreen-btn { bottom: 156px; }
#locate-btn { bottom: 216px; }

/* ============ SHARE MODAL ============ */
.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s;
}

.dark .share-option { background: #1f2937; color: #cbd5e1; border-color: rgba(255, 255, 255, 0.08); }

.share-option:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.share-option:active { transform: scale(0.96); }

.share-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 17px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Floating legend */
#floating-legend {
    transition: opacity 0.3s, transform 0.3s;
}

#floating-legend.hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

/* Table row hover */
#table-body tr {
    transition: background-color 0.15s;
    cursor: pointer;
}

#table-body tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

.abbr-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed #9ca3af;
}

/* ============ BASEMAP SELECTOR (sin key) ============ */
.basemap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.basemap-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    color: #4b5563;
    background: #f8fafc;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.dark .basemap-option { background: #1f2937; color: #d1d5db; }

.basemap-option:hover { transform: translateY(-2px); border-color: #cbd5e1; }
.dark .basemap-option:hover { border-color: #4b5563; }

.basemap-option.selected {
    border-color: #334155;
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark .basemap-option.selected { background: #334155; color: #f1f5f9; border-color: #64748b; }

.basemap-swatch {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sw-osm { background: linear-gradient(135deg, #fefce8 55%, #86efac 55%, #86efac 70%, #fde68a 70%); }
.sw-gris { background: linear-gradient(135deg, #f1f5f9 60%, #cbd5e1 60%, #cbd5e1 75%, #94a3b8 75%); }
.sw-oscuro { background: linear-gradient(135deg, #0f172a 60%, #1e293b 60%, #1e293b 75%, #334155 75%); }
.sw-topo { background: linear-gradient(135deg, #d6b48a 40%, #a8c69f 40%, #a8c69f 65%, #7a9e7e 65%); }
.sw-satelite { background: linear-gradient(135deg, #365314 45%, #4d7c0f 45%, #4d7c0f 70%, #1a2e05 70%); }

/* ============ LOGO + LOADING ============ */
.loading-logo { animation: logo-float 2s ease-in-out infinite; }

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============ SCALE CONTROL ============ */
.leaflet-control-scale-line {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
}

.dark .leaflet-control-scale-line {
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
}