:root {
    --primary: #27ae60;
    --danger: #e63946;
    --warning: #f39c12;
    --bg-dark: #0b0f14;
    --bg-panel: rgba(15, 20, 28, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(39, 174, 96, 0.3);
    --font-main: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: #e0e0e0;
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0; /* Base total */
}

/* --- UI OVERLAY --- */
.ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10; /* Suficiente para estar sobre el mapa, pero no sobre controles externos forzados */
}

/* Forzar que los controles de Leaflet sean visibles y clicables */
.leaflet-control-container {
    z-index: 10000 !important;
    position: relative;
}

.leaflet-control {
    pointer-events: auto !important;
}

/* Evita controles/plugin no deseados en la esquina superior izquierda */
.leaflet-top.leaflet-left .leaflet-control {
    display: none !important;
}

.ui-overlay > * {
    pointer-events: auto; /* Elementos internos sí capturan clics */
}

/* --- HEADER / LOGO --- */
.header-mini {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    z-index: 1010;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.header-mini h1 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
}

.header-mini h1 span {
    color: var(--primary);
}

.btn-help-top {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(46, 204, 113, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(46, 204, 113, 0.3);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.btn-help-top:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
    transform: translateY(-1px);
}

/* --- TOP CARDS (KPIs) --- */
.top-stats {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px; /* Reducido de 15px */
    z-index: 1010;
}

.kpi-card {
    background: var(--bg-panel);
    padding: 8px 15px; /* Reducido de 12px 20px */
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    min-width: 115px; /* Reducido de 140px */
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
}

.kpi-card small {
    font-size: 0.55rem; /* Reducido de 0.65rem */
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-card .val {
    font-size: 0.95rem; /* Reducido de 1.2rem */
    font-weight: 800;
    color: white;
}

.kpi-card.risk-high .val { color: var(--danger); text-shadow: 0 0 10px rgba(230, 57, 70, 0.4); }
.kpi-card.focus .val { color: var(--warning); }

/* --- SIDE PANEL (COLLAPSIBLE) --- */
.side-panel {
    position: absolute;
    left: 20px;
    top: 74px;
    bottom: 120px; /* Espacio para el timeline NASA */
    width: 360px;
    background: rgba(15, 23, 42, 0.94);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    z-index: 2050;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.side-panel.collapsed {
    transform: translateX(-400px);
}

.toggle-panel {
    position: absolute;
    left: 20px;
    top: 74px;
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    color: white;
    transition: 0.3s;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.toggle-panel:hover {
    background: var(--primary);
    transform: scale(1.05);
}

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

.section-title {
    font-size: 0.85rem; /* Aumentado */
    text-transform: uppercase;
    color: #ffffff; /* Color más claro (blanco) */
    margin-bottom: 20px;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    font-weight: 800; /* Más grueso */
}

/* --- REGLA / TIMELINE --- */
/* --- TABS --- */
.panel-tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: rgba(255,255,255,0.02);
}

.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; }

/* --- REPORTS --- */
.report-card {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.report-card h5 {
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: #ccc;
    text-transform: uppercase;
}

.report-list {
    list-style: none;
    padding: 0;
}

.report-list li {
    font-size: 0.75rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    display: flex;
    justify-content: space-between;
}

.btn-download-report {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: var(--danger);
    border: none;
    color: white;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

/* --- TIMELINE NASA STYLE --- */
/* (Block removed to avoid duplicates) */

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

/* --- TIMELINE NASA FIRMS REPLICA --- */
.map-legend {
    position: absolute;
    bottom: 40px; /* Bajado de 120px para aprovechar espacio */
    right: 90px;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
    z-index: 6000;
    backdrop-filter: blur(10px);
    font-size: 0.7rem;
    color: white;
    width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: auto; /* Cambiado a auto para permitir interacción si fuera necesario */
    transition: 0.3s ease;
}
.timeline-nasa {
    position: absolute;
    bottom: 20px;
    left: 390px;
    right: 330px;
    width: auto;
    background: rgba(11, 15, 20, 0.95);
    border: 1px solid rgba(46, 204, 113, 0.4);
    border-radius: 4px;
    padding: 10px 15px 15px 15px;
    backdrop-filter: blur(15px);
    z-index: 4500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,1);
    border-left: 4px solid #2ecc71;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-nasa.collapsed {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.timeline-controls-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 250px;
}

.timeline-controls button {
    background: #2ecc71;
    color: #0b0f14;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.timeline-controls button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.6);
}

#current-date-display {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.timeline-interval-selector {
    display: flex;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,0.1);
}

.interval-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}

.interval-btn.active {
    background: #2ecc71;
    color: #0b0f14;
}

.timeline-source {
    font-size: 0.65rem;
    color: #2ecc71;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.timeline-body {
    padding: 5px 0 15px 0;
    position: relative;
}

/* Custom Range Styling (Verde NASA) */
input[type=range]#timeline-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]#timeline-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

input[type=range]#timeline-range::-webkit-slider-thumb {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #2ecc71;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -9px;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.8), inset 0 0 5px rgba(255,255,255,0.5);
    border: 2px solid #fff;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    position: relative;
}

.tick {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0.4;
    transition: all 0.3s;
}

.tick.active {
    opacity: 1;
    color: #2ecc71;
}

.tick-mark {
    width: 2px;
    height: 10px;
    background: #888;
    margin-bottom: 5px;
}

.tick.active .tick-mark {
    background: #2ecc71;
    height: 15px;
    box-shadow: 0 0 10px #2ecc71;
}

.tick-label {
    font-size: 0.6rem;
    font-weight: 800;
    white-space: nowrap;
}
/* Catálogo de Capas Expandido */
.layer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.layer-item:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.2);
}

.layer-subcategory {
    margin-bottom: 12px;
}

.layer-subcategory-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9fd8b1;
    margin: 6px 0 8px;
}

.panel-action-item {
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.panel-action-item div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.panel-action-item strong {
    font-size: 0.78rem;
    color: #fff;
}

.panel-action-item span {
    font-size: 0.68rem;
    color: #95a5a6;
    line-height: 1.4;
}

.mini-action-btn {
    border: 1px solid rgba(46, 204, 113, 0.25);
    background: rgba(46, 204, 113, 0.14);
    color: #dff7e7;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: 0.25s ease;
}

.mini-action-btn:hover {
    background: var(--primary);
    color: #0b0f14;
}

.reference-card {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
}

.reference-card-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #fff;
    margin-bottom: 6px;
}

.reference-card p {
    font-size: 0.68rem;
    color: #9aa3ad;
    line-height: 1.5;
    margin-bottom: 10px;
}

.reference-card-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.reference-card-link:hover {
    color: #6ef0a0;
}

#timeline-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.05);
    height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#timeline-range::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #1a3c26, var(--primary));
    height: 6px;
    border-radius: 3px;
}

#timeline-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    margin-top: -5px;
    box-shadow: 0 0 10px var(--primary);
}

.timeline-labels {
    position: absolute;
    width: 100%;
    left: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

/* --- HOTSPOT & CLUSTER ANIMATIONS --- */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.2);
}

.marker-cluster-small div {
    background-color: rgba(230, 57, 70, 0.85); /* Rojo peligro */
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.6);
}

/* IFrame Modal Container */
.iframe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(10px);
}

.iframe-modal-wrapper {
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlide 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.iframe-body {
    flex: 1;
    position: relative;
    background: #000;
}

#external-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#external-iframe.loaded {
    opacity: 1;
}

.iframe-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

.iframe-loader i { font-size: 2.5rem; }

@keyframes modalSlide {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.marker-cluster-medium div {
    background-color: rgba(230, 57, 70, 0.9);
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.8);
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.marker-cluster-large div {
    background-color: rgba(230, 57, 70, 1);
    box-shadow: 0 0 30px rgba(230, 57, 70, 0.9);
    width: 44px;
    height: 44px;
    font-size: 16px;
    animation: cluster-pulse 2s infinite;
}

.foco-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    z-index: 5000;
}

.foco-recent { 
    background: #f39c12; 
    animation: none; 
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.foco-old { 
    background: #f39c12; 
    border-color: rgba(255,255,255,0.7);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    opacity: 0.9;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.8); }
    70% { transform: scale(1.8); box-shadow: 0 0 0 15px rgba(230, 57, 70, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); }
}

@keyframes cluster-pulse {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(230, 57, 70, 0.8); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(230, 57, 70, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(230, 57, 70, 0.8); }
}

/* --- TOOLBAR --- */
.toolbar-apps {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1050; /* Al mismo nivel que el panel lateral */
}

.app-btn {
    width: 55px;
    height: 55px;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    color: #888;
}

.app-btn.active {
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.app-btn i { font-size: 1.2rem; }
.app-btn small { font-size: 0.55rem; margin-top: 4px; font-weight: 800; }

/* --- UTILS --- */
.custom-select {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

/* --- SWITCH / TOGGLES --- */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(14px); }

.layer-item {
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}


.btn-prediction:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.coords-display {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.6);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #aaa;
    z-index: 6000;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.05);
}

.timeline-fab {
    position: absolute;
    right: 20px;
    top: calc(50% + 120px);
    bottom: auto;
    z-index: 6200;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid rgba(46, 204, 113, 0.4);
    background: var(--bg-panel);
    color: #dff7e7;
    border-radius: 12px;
    width: 56px;
    height: 56px;
    padding: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: 0.25s ease;
    backdrop-filter: blur(8px);
}

.timeline-fab span {
    font-size: 0.5rem;
    line-height: 1;
}

.timeline-fab:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.7);
}

.timeline-fab.is-open {
    border-color: rgba(231, 76, 60, 0.55);
    color: #ffd8d8;
}

.print-fab {
    top: calc(50% + 186px);
    border-color: rgba(52, 152, 219, 0.45);
    color: #d6ebff;
}

.print-fab:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.7);
}

.layer-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

/* --- LEGEND (ESTILOS ELIMINADOS POR DUPLICIDAD Y MEJORADOS ARRIBA) --- */

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px; /* Reducido de 8px */
    margin-bottom: 3px; /* Reducido de 5px */
    color: #ccc;
}

.legend-color {
    width: 10px; /* Reducido de 12px */
    height: 10px;
    border-radius: 2px;
}

.btn-prediction {
    width: 100%;
    background: linear-gradient(45deg, var(--primary), #27ae60);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* --- MAPOTECA / PDF GALLERY --- */
.pdf-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.pdf-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: white;
    pointer-events: auto;
}

.pdf-card:hover {
    background: rgba(46, 204, 113, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.pdf-icon {
    font-size: 1.4rem;
    color: var(--danger);
    background: rgba(230, 57, 70, 0.1);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.pdf-info {
    flex: 1;
    overflow: hidden;
}

.pdf-info h5 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-info small {
    display: block;
    font-size: 0.65rem;
    color: #666;
    margin-top: 2px;
}

.pdf-action {
    color: var(--primary);
    font-size: 0.8rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.pdf-card:hover .pdf-action {
    opacity: 1;
}

.loading-pdf {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Leyendas y Reportes */
.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin: 0 8px;
    border: 1px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 50000; /* Forzar sobre todo */
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.report-modal-content {
    background: #14181f !important;
    width: 95%;
    max-width: 850px;
    max-height: 90vh;
    border-radius: 20px;
    border: 1px solid rgba(39, 174, 96, 0.5);
    overflow-y: auto;
    box-shadow: 0 40px 100px rgba(0,0,0,1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.report-header {
    background: #0b0f14;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.report-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: white;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.report-header small {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.7rem;
    display: block;
    margin-top: 5px;
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255,255,255,0.05);
    border: none;
    color: #888;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover {
    background: var(--danger);
    color: white;
}

.report-body {
    padding: 40px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin-bottom: 40px;
}

.info-item {
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 10px;
}

.info-item strong {
    color: #888;
    font-weight: 400;
}

.danger-text { color: #e63946; font-weight: 800; }
.risk-text { font-weight: 800; }

.report-assessment {
    background: rgba(39, 174, 96, 0.05);
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid var(--primary);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

.report-assessment h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: white;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-assessment h4::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.report-footer {
    padding: 0 40px 40px 40px;
    text-align: center;
}

.btn-print {
    background: linear-gradient(135deg, var(--primary) 0%, #1e8449 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(39, 174, 96, 0.2);
}

.btn-print:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(39, 174, 96, 0.4);
}

@media print {
    /* Ocultar todo por defecto para evitar que se imprima el mapa base detrás del reporte */
    body * {
        visibility: hidden !important;
    }

    .report-modal,
    .report-modal * {
        visibility: visible !important;
    }
    
    /* Ocultar elementos no imprimibles */
    .sidebar, 
    .dashboard-header, 
    .toolbar-apps, 
    .ui-overlay, 
    .timeline-nasa, 
    .map-legend, 
    .close-modal, 
    .iframe-header, 
    .iframe-loader, 
    .report-footer, 
    .btn-print, 
    .btn-report-export { 
        display: none !important; 
        visibility: hidden !important;
    }
    
    /* Asegurar que el modal activo (ya sea el de reporte o el de iframe) ocupe toda la página */
    .report-modal, 
    .iframe-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: white !important;
        display: flex !important;
        z-index: 999999 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-modal-content, 
    .iframe-modal-wrapper { 
        border: none !important; 
        box-shadow: none !important; 
        width: 100% !important; 
        height: 100% !important;
        max-width: none !important; 
        background: white !important; 
        border-radius: 0 !important;
    }

    /* Ajustes de color para legibilidad en impresión */
    .report-header { background: #f8f9fa !important; border-bottom: 2px solid #000; padding: 20px; }
    .report-header h2, .report-header small, .info-item, .info-item strong, .report-body, .report-assessment p { 
        color: black !important; 
    }
    .report-assessment { 
        background: #f0f0f0 !important; border-color: #000 !important; color: black !important; 
    }
}

.btn-report-export {
    width: 100%;
    background: linear-gradient(45deg, #161b22, #0d1117);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.2);
    padding: 14px;
    border-radius: 10px;
    font-weight: 800;
    margin-top: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-report-export:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.3);
}

@media (max-width: 1024px) {
    .header-mini {
        top: 12px;
        left: 12px;
        padding: 8px 12px;
    }

    .top-stats {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .kpi-card {
        min-width: 98px;
        padding: 7px 10px;
    }

    .side-panel {
        left: 12px;
        top: 74px;
        bottom: 170px;
        width: 320px;
    }

    .side-panel.collapsed {
        transform: translateX(-340px);
    }

    .toggle-panel {
        left: 12px;
        top: 74px;
        width: 42px;
        height: 42px;
    }

    .panel-inner {
        padding: 14px;
    }

    .section-title {
        margin-bottom: 12px;
        letter-spacing: 1.4px;
        font-size: 0.78rem;
    }

    .timeline-nasa {
        left: 12px;
        right: 12px;
        bottom: 86px;
        padding: 10px 12px 12px;
    }

    .toolbar-apps {
        right: 12px;
        top: auto;
        bottom: 18px;
        transform: none;
        flex-direction: row;
        gap: 10px;
    }

    .app-btn {
        width: 50px;
        height: 50px;
    }

    .map-legend {
        right: 12px;
        bottom: 90px;
    }

    .coords-display {
        right: 12px;
        bottom: 86px;
    }

    .timeline-fab {
        left: 12px;
        right: auto;
        top: auto;
        bottom: 78px;
        width: 122px;
        height: 40px;
        border-radius: 999px;
        padding: 6px 10px;
        flex-direction: row;
        gap: 8px;
    }

    .timeline-fab span {
        font-size: 0.6rem;
    }

    .print-fab {
        top: auto;
        bottom: 78px;
        left: 142px;
    }
}

@media (max-width: 768px) {
    .top-stats {
        left: 12px;
        right: 12px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .kpi-card {
        min-width: 0;
        width: 100%;
    }

    .header-mini {
        top: 110px;
        left: 12px;
        right: 12px;
        width: auto;
        justify-content: space-between;
    }

    .side-panel {
        left: 12px;
        right: 12px;
        width: auto;
        top: 160px;
        bottom: 188px;
        border-radius: 12px;
    }

    .side-panel.collapsed {
        transform: translateX(calc(-100% - 20px));
    }

    .toggle-panel {
        top: 160px;
        left: 12px;
        z-index: 2100;
    }

    .tab-btn {
        font-size: 0.66rem;
        padding: 10px 6px;
        gap: 5px;
    }

    .panel-action-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .mini-action-btn {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
    }

    .timeline-nasa {
        left: 12px;
        right: 12px;
        bottom: 84px;
        border-radius: 10px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .timeline-controls-inner {
        min-width: 0;
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    #current-date-display {
        font-size: 1rem;
        letter-spacing: 0.8px;
    }

    .interval-btn {
        padding: 6px 10px;
        font-size: 0.62rem;
    }

    .toolbar-apps {
        left: 12px;
        right: 12px;
        justify-content: space-between;
    }

    .app-btn {
        flex: 1;
        max-width: 120px;
        border-radius: 10px;
    }

    .map-legend {
        display: none;
    }

    .coords-display {
        left: 10px;
        right: auto;
        bottom: 8px;
        font-size: 0.65rem;
        padding: 4px 8px;
        z-index: 1200;
    }

    .map-toolbar {
        top: 140px;
        right: 8px;
        gap: 4px;
    }

    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }
}

/* ==========================================================================
   ACTUALIZACIÓN ESTILO MODERNO (CICOL / MAGDALENA GLASSMORPHISM)
   ========================================================================== */

/* Header Superior */
.top-header {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.brand-badge {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 7px 16px 7px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

.brand-badge:hover {
    border-color: rgba(46, 204, 113, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(46, 204, 113, 0.2);
}

.bandera-badge-strip {
    display: flex;
    flex-direction: column;
    width: 6px;
    height: 38px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.bandera-strip-green { flex: 1; background-color: #27ae60; }
.bandera-strip-white { flex: 1; background-color: #ffffff; }

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-jaguar {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 2px;
    border: 2px solid #2ecc71;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    line-height: 1.2;
}

.brand-text h1 span {
    color: #2ecc71;
}

.brand-text p {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
    text-transform: uppercase;
}

.header-center-info {
    pointer-events: auto;
}

.header-status-badge {
    background: rgba(5, 10, 18, 0.94) !important;
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(46, 204, 113, 0.5) !important;
    color: #2ecc71 !important;
    padding: 6px 16px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 14px rgba(46, 204, 113, 0.25);
}

.pulse-icon {
    color: #2ecc71;
    animation: pulseIconAnim 2s infinite;
}

@keyframes pulseIconAnim {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.header-actions {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tech-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.btn-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.25s ease;
}

.btn-header:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: #2ecc71;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.btn-header-report {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    color: white;
}

.btn-header-report:hover {
    background: linear-gradient(135deg, #ff5252, #e74c3c);
    box-shadow: 0 0 16px rgba(231, 76, 60, 0.5);
    color: white;
}

.tech-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 250px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    z-index: 1050;
    animation: fadeInDropdown 0.2s ease-out forwards;
}

.tech-dropdown-menu.active {
    display: block;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tech-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.tech-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(3px);
}

.tech-dropdown-item i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* --- BARRA FLOTANTE DE KPIS (COLLAPSIBLE) --- */
.top-kpi-bar {
    position: absolute;
    top: 74px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.kpi-collapse-btn {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.kpi-collapse-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(30, 41, 59, 0.95);
}

.top-kpi-cards {
    display: flex;
    gap: 8px;
    transition: all 0.3s ease;
}

.top-kpi-bar.collapsed .top-kpi-cards {
    display: none;
}

.kpi-badge-card {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.kpi-badge-card:hover {
    transform: translateY(-2px);
    border-color: rgba(46, 204, 113, 0.35);
}

.kpi-badge-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 2px;
}

.kpi-badge-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.kpi-badge-sub {
    font-size: 0.6rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 3px;
}

/* --- TOOLBAR RETIRADA Y FUSIONADA EN MAP-TOOLBAR --- */
.toolbar-apps,
.timeline-fab {
    display: none !important;
}

/* --- BARRA LATERAL DE HERRAMIENTAS (DERECHA - COMPACTA) --- */
.map-toolbar {
    position: absolute;
    top: 135px;
    right: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: auto;
}

.tool-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.90);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.82rem;
}

.tool-btn:hover {
    background: #27ae60;
    color: #ffffff;
    transform: translateX(-2px);
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.45);
    border-color: #2ecc71;
}

.tool-btn.active {
    background: #27ae60;
    color: #ffffff;
    border-color: #2ecc71;
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.45);
}

.tool-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    font-size: 0.70rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.14);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    z-index: 10000;
}

.tool-btn:hover::after {
    opacity: 1;
}

/* --- ESTILOS PESTAÑAS: FOCOS, CLIMA, FORESIGHT, BENI --- */
.hotspots-scope-pills,
.hotspots-period-pills {
    display: flex;
    gap: 5px;
    width: 100%;
}

.scope-pill,
.period-pill,
.days-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    border-radius: 7px;
    padding: 6px 4px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.scope-pill:hover,
.period-pill:hover,
.days-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.scope-pill.active {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.5) !important;
}

.period-pill.active,
.days-pill.active {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.45) !important;
}

.btn-batch {
    flex: 1;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-size: 0.70rem;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-batch:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-batch.active-action {
    background: rgba(21, 128, 61, 0.35);
    color: #4ade80;
    border-color: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

/* Forest Foresight Cards */
.foresight-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin: 10px 0;
}

.foresight-stat-card {
    background: rgba(15, 28, 46, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 9px;
    padding: 9px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foresight-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(25, 42, 68, 0.9);
}

.foresight-stat-num {
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: block;
    margin-bottom: 2px;
}

.foresight-stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
}

.badge-tag {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.70rem;
    font-weight: 700;
}

/* Barra de pestañas con flechas de desplazamiento y scroll suave */
.tabs-nav-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    flex-shrink: 0;
    overflow: hidden;
}

.tabs-scroll-arrow {
    width: 24px;
    height: 38px;
    background: rgba(15, 23, 42, 0.92);
    border: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.2s ease;
    z-index: 5;
    flex-shrink: 0;
    padding: 0;
}

.tabs-scroll-arrow:hover {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
}

.panel-tabs {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    gap: 4px;
    padding: 5px 6px;
    background: transparent;
    border-bottom: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 204, 113, 0.6) rgba(15, 23, 42, 0.6);
}

.panel-tabs::-webkit-scrollbar {
    height: 4px;
}

.panel-tabs::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
}

.panel-tabs::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.55);
    border-radius: 4px;
}

.panel-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.9);
}

.panel-tabs .tab-btn {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 7px 11px;
    border-radius: 7px;
    white-space: nowrap;
}

/* Scrollbar estilizado en panel interior y pestañas (elimina scrollbar blanco) */
.panel-inner,
.tab-content,
.side-panel {
    min-height: 0 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 204, 113, 0.6) rgba(15, 23, 42, 0.6);
}

.panel-inner::-webkit-scrollbar,
.tab-content::-webkit-scrollbar,
.side-panel::-webkit-scrollbar {
    width: 6px;
}

.panel-inner::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track,
.side-panel::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 6px;
}

.panel-inner::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb,
.side-panel::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-inner::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover,
.side-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.9);
}

/* --- SELECTOR MODAL DE MAPAS BASE --- */
.basemap-picker-modal {
    position: absolute;
    top: 142px;
    right: 70px;
    z-index: 1001;
    background: rgba(15, 28, 46, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 14px;
    width: 290px;
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    display: none;
    pointer-events: auto;
    animation: fadeInDropdown 0.2s ease-out forwards;
}

.basemap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.basemap-option {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
}

.basemap-option:hover {
    border-color: #2ecc71;
    transform: translateY(-2px);
}

.basemap-option.active {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.15);
}

.basemap-option span {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-top: 6px;
}

/* --- BUSCADOR PREDICTIVO DE MUNICIPIOS --- */
.search-container {
    position: absolute;
    top: 74px;
    left: 74px;
    z-index: 1000;
    width: 270px;
    pointer-events: auto;
}

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

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-size: 0.8rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: rgba(15, 28, 46, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    max-height: 240px;
    overflow-y: auto;
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    display: none;
}

.search-item {
    padding: 9px 14px;
    font-size: 0.78rem;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s ease;
}

.search-item:hover {
    background: rgba(46, 204, 113, 0.2);
    color: #fff;
}

/* --- BANNERS INTERACTIVOS DE MEDICIÓN --- */
.map-interactive-banner {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(56, 189, 248, 0.7);
    border-radius: 30px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.8rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(14px);
    animation: slideDown 0.3s ease;
}

.map-interactive-banner.banner-measure-area {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.25);
}

.btn-banner-action {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-banner-action:hover {
    background: rgba(239, 68, 68, 0.6);
    color: #fff;
}

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- LEYENDA FLOTANTE COLAPSABLE --- */
.floating-legend-box {
    position: absolute;
    bottom: 24px;
    left: 20px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 14px;
    min-width: 210px;
    max-width: 320px;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease;
    pointer-events: auto;
}

.floating-legend-box.collapsed {
    padding: 7px 12px;
    min-width: auto;
}

.floating-legend-box.collapsed .floating-legend-body {
    display: none;
}

.floating-legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
}

.legend-active-badge {
    background: #2ecc71;
    color: #0b0f14;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    margin-left: 6px;
}

.floating-legend-body {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 240px;
    overflow-y: auto;
}

.legend-empty-state {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

/* --- CLUSTERS DE FUEGO ANIMADOS (ESTILO CICOL) --- */
.fire-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    border: 2px solid #ffffff;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
    animation: pulse-fire 2s infinite ease-in-out;
}
.cluster-fire-sm {
    width: 30px;
    height: 30px;
    background: rgba(234, 179, 8, 0.9);
}
.cluster-fire-md {
    width: 36px;
    height: 36px;
    background: rgba(249, 115, 22, 0.9);
}
.cluster-fire-lg {
    width: 44px;
    height: 44px;
    background: rgba(239, 68, 68, 0.95);
}
@keyframes pulse-fire {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.08); box-shadow: 0 0 20px rgba(239, 68, 68, 0.85); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
}

/* --- REFINAMIENTOS PARA LA PESTAÑA DATOS --- */
.report-card {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
}

.coords-display span {
    color: #fff;
    font-family: monospace, sans-serif;
    font-weight: 800;
}

/* ========================================================
   REFINAMIENTOS VISUALES CICOL / SAN IGNACIO (DRAG & OPACITY)
   ======================================================== */

/* Botón de Cierre del Menú Lateral */
.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    transform: scale(1.05);
}

/* Encabezado Arrastrable de la Leyenda Flotante */
.floating-legend-header {
    cursor: grab !important;
    user-select: none;
}
.floating-legend-header:active {
    cursor: grabbing !important;
}

/* Ícono de Arrastre para Capas (Drag Handle) */
.drag-handle {
    color: #64748b;
    cursor: grab;
    font-size: 0.8rem;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    user-select: none;
    transition: color 0.2s;
    flex-shrink: 0;
}
.drag-handle:hover {
    color: #e2e8f0;
}
.drag-handle:active {
    cursor: grabbing;
}

/* Punto indicador de color de la capa */
.layer-color-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

/* Nombre de la Capa en el Acordeón */
.layer-name-label {
    font-size: 0.77rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: default;
    line-height: 1.2;
}

/* Contenedor flexible de Capas */
.layer-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}
.layer-item-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
}
.layer-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Slider de Opacidad Amarillo Estilo CICOL */
.layer-opacity-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 55px;
    height: 3px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    margin: 0;
}
.layer-opacity-slider:hover {
    background: rgba(234, 179, 8, 0.45);
}
.layer-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.95);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.layer-opacity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}
.layer-opacity-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.95);
    cursor: pointer;
    border: none;
}

/* ========================================================
   POPUP MULTI-CAPA INTERACTIVO ESTILO CICOL (IDENTIFY)
   ======================================================== */
.leaflet-popup.cicol-multi-popup .leaflet-popup-content-wrapper {
    background: rgba(18, 25, 40, 0.96) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.75), 0 0 15px rgba(16, 185, 129, 0.12) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup.cicol-multi-popup .leaflet-popup-content {
    margin: 14px !important;
    line-height: 1.4 !important;
    min-width: 260px !important;
    max-width: 320px !important;
    color: #f8fafc !important;
}

.leaflet-popup.cicol-multi-popup .leaflet-popup-tip {
    background: rgba(18, 25, 40, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup.cicol-multi-popup a.leaflet-popup-close-button {
    color: #94a3b8 !important;
    top: 8px !important;
    right: 10px !important;
    font-size: 16px !important;
    padding: 0 !important;
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.leaflet-popup.cicol-multi-popup a.leaflet-popup-close-button:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.2) !important;
    transform: scale(1.08);
}

/* Tarjeta y Barra de Navegación */
.cicol-popup-card {
    display: flex;
    flex-direction: column;
}

.cicol-popup-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(46, 204, 113, 0.28);
    border-radius: 20px;
    padding: 4px 8px;
    margin-bottom: 12px;
}

.cicol-nav-btn {
    background: rgba(46, 204, 113, 0.14);
    border: 1px solid rgba(46, 204, 113, 0.45);
    border-radius: 8px;
    color: #2ecc71;
    width: 28px;
    height: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    transition: all 0.2s ease;
    outline: none;
}

.cicol-nav-btn:hover:not(:disabled) {
    background: rgba(46, 204, 113, 0.35);
    border-color: #2ecc71;
    color: #ffffff;
    transform: scale(1.05);
}

.cicol-nav-btn.disabled,
.cicol-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    color: #64748b;
    background: rgba(255, 255, 255, 0.04);
}

.cicol-nav-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cicol-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
    flex-shrink: 0;
}

.cicol-nav-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.cicol-popup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #2ecc71;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.3;
}

.cicol-popup-title i {
    font-size: 1rem;
    color: #2ecc71;
    flex-shrink: 0;
}

.cicol-popup-props {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 204, 113, 0.5) rgba(15, 23, 42, 0.6);
}

.cicol-popup-props::-webkit-scrollbar {
    width: 4px;
}
.cicol-popup-props::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.5);
    border-radius: 4px;
}

.cicol-popup-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    gap: 12px;
}
.cicol-popup-row:last-child {
    border-bottom: none;
}

.cicol-prop-key {
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.cicol-prop-val {
    color: #f8fafc;
    font-weight: 700;
    text-align: right;
    word-break: break-all;
}


