/* ==========================================================================
   GEOVISOR MAGDALENA - GOBIERNO AUTÓNOMO MUNICIPAL DE MAGDALENA
   Estilos Principales - UI Moderna, Responsive y Liviana
   Paleta: Verde Amazonía / Iténez (#15803d, #22c55e), Azul Ríos Itonamas (#0ea5e9), Oro (#f59e0b), Dark Glassmorphism
   ========================================================================== */

:root {
    --primary: #15803d;         /* Verde Amazonía / Iténez */
    --primary-dark: #166534;
    --primary-light: #22c55e;
    --primary-glow: rgba(34, 197, 94, 0.4);
    --accent: #0ea5e9;          /* Azul Ríos Itonamas / Río Blanco */
    --accent-hover: #0284c7;
    --accent-gold: #f59e0b;     /* Dorado patrimonial */
    --accent-red: #ef4444;      /* Alertas / Incendios */
    --accent-orange: #f97316;
    --bg-dark: #06111d;         /* Fondo base oscuro noche */
    --bg-card: rgba(15, 28, 46, 0.88);
    --bg-card-hover: rgba(22, 38, 62, 0.95);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-active: rgba(34, 197, 94, 0.45);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --sidebar-width: 380px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* ================== MAPA CONTENEDOR ================== */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: #090d13;
}

/* Leaflet Overrides */
.leaflet-bar {
    border: none !important;
    box-shadow: var(--shadow-premium) !important;
    border-radius: 12px !important;
    overflow: hidden;
}
.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-glass) !important;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}
.leaflet-bar a:hover {
    background-color: var(--primary) !important;
    color: #fff !important;
}
.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95) !important;
    color: var(--text-main) !important;
    border-radius: 16px !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-premium) !important;
    backdrop-filter: blur(16px);
    padding: 2px !important;
}
.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95) !important;
}

/* ================== HEADER PRINCIPAL ================== */
.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: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 8px 18px 8px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.brand-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #15803d 33.3%, #ffffff 33.3%, #ffffff 66.6%, #eab308 66.6%);
}

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-jaguar {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 1px;
    border: 2px solid var(--accent);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.brand-text h1 {
    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: var(--accent);
}

.brand-text p {
    font-size: 0.72rem;
    color: var(--text-muted);
    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(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    text-transform: uppercase;
}

/* ================== KPI STATS BAR ================== */
.kpi-container {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-chip {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-premium);
    transition: all 0.25s ease;
}

.kpi-chip:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.kpi-icon.fire {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.kpi-icon.weather {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.kpi-icon.patrol {
    background: rgba(16, 185, 129, 0.15);
    color: #22c55e;
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.kpi-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

/* ================== ACTIONS BUTTONS ================== */
.header-actions {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badge Central de Estado Territorial (Sólido y Elegante) */
.header-status-badge {
    background: rgba(10, 15, 26, 0.90) !important;
    border: 1.5px solid rgba(34, 197, 94, 0.45) !important;
    color: #4ade80 !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    padding: 6px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    letter-spacing: 0.02em;
}

.header-status-badge i {
    color: #22c55e;
}

.btn-header {
    background: rgba(10, 15, 26, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 8px 15px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-header:hover {
    background: rgba(20, 30, 48, 0.98);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.btn-header.btn-patrol {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    border: 1.5px solid #22c55e;
    color: #fff;
}

.btn-header.btn-patrol:hover {
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.5);
}

/* Botón Gestión Técnica - Alto Contraste y Relieve */
.btn-header-tech {
    background: rgba(10, 15, 26, 0.92) !important;
    border: 1.5px solid #22c55e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.25) !important;
}

.btn-header-tech i.fa-bars-staggered {
    color: #4ade80 !important;
}

.btn-header-tech:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    border-color: #4ade80 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

/* Botón Reporte Situacional Oficial - Dorado y Destacado */
.btn-header.btn-report,
.btn-header-report {
    background: rgba(10, 15, 26, 0.92) !important;
    border: 1.5px solid #eab308 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(234, 179, 8, 0.25) !important;
}

.btn-header.btn-report i,
.btn-header-report i {
    color: #facc15 !important;
}

.btn-header.btn-report:hover,
.btn-header-report:hover {
    background: rgba(234, 179, 8, 0.22) !important;
    border-color: #fde047 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.4) !important;
}

/* ================== SIDEBAR (PANEL DE CAPAS) ================== */
.sidebar {
    position: absolute;
    top: 80px;
    left: 14px;
    bottom: 20px;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    width: var(--sidebar-width);
    max-width: calc(100vw - 28px);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    z-index: 1000;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.sidebar.collapsed {
    transform: translateX(-410px);
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    flex-shrink: 0;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h2 i {
    color: var(--accent);
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Pestañas de navegación en Sidebar */
.sidebar-tabs {
    flex-shrink: 0;
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 15, 26, 0.65);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 6px;
    font-size: 0.80rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
    color: #facc15;
    border-bottom-color: #eab308;
    background: rgba(234, 179, 8, 0.12);
}

/* Iconos temáticos coloridos en pestañas para evitar monotonía */
.tab-btn[data-tab="layers"] i { color: #38bdf8; }
.tab-btn[data-tab="fires"] i { color: #f87171; }
.tab-btn[data-tab="weather"] i { color: #06b6d4; }
.tab-btn[data-tab="about"] i { color: #4ade80; }
.tab-btn.active i { color: #facc15 !important; }

.tab-content {
    flex: 1 1 0%;
    min-height: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    display: none;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.5) rgba(15, 23, 42, 0.4);
}

.tab-content.active {
    display: block;
}

/* Personalización del Scrollbar */
.tab-content::-webkit-scrollbar {
    width: 7px;
}
.tab-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
}
.tab-content::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.5);
    border-radius: 8px;
}
.tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 197, 94, 0.85);
}

/* Acordeón de Categorías de Capas */
.layer-group {
    margin-bottom: 14px;
    background: rgba(15, 23, 42, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.layer-group-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    user-select: none;
    transition: background 0.2s;
}

.layer-group-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.layer-group-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.84rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.layer-group-title i {
    color: var(--primary-light);
    font-size: 0.9rem;
}

.layer-group-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.layer-group.open .layer-group-arrow {
    transform: rotate(180deg);
}

.layer-group-body {
    display: none;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--border-glass);
}

.layer-group.open .layer-group-body {
    display: block;
}

/* Items individuales de Capas */
.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    overflow: hidden;
}

.layer-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.layer-name {
    font-size: 0.81rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

/* Switch Toggle iOS Style */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.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.15);
    transition: 0.25s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Filtro Temporal de Focos de Calor */
.hotspot-filter-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

.filter-box-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.filter-pills,
.hotspots-scope-pills,
.hotspots-period-pills {
    display: flex;
    gap: 6px;
    width: 100%;
}

.filter-pill,
.period-pill,
.days-pill,
.scope-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 7px 5px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    outline: none;
    user-select: none;
    box-sizing: border-box;
}

.filter-pill:hover,
.period-pill:hover,
.days-pill:hover,
.scope-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-pill.active,
.period-pill.active,
.days-pill.active {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.55) !important;
}

.scope-pill.active {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 14px rgba(2, 132, 199, 0.55) !important;
}

/* ================== BOTÓN FLOTANTE PARA ABRIR SIDEBAR ================== */
.sidebar-toggle-floating {
    position: absolute;
    top: 86px;
    left: 14px;
    z-index: 999;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-premium);
    transition: all 0.25s;
}

.sidebar-toggle-floating:hover {
    background: var(--primary);
    transform: scale(1.05);
}

/* ================== BARRA FLOTANTE DE HERRAMIENTAS (DERECHA) ================== */
.map-toolbar {
    position: absolute;
    top: 86px;
    right: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-premium);
    transition: all 0.2s ease;
    position: relative;
}

.tool-btn:hover {
    background: var(--bg-card-hover);
    color: #fff;
    border-color: var(--border-active);
    transform: translateX(-2px);
}

.tool-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: #22c55e;
}

/* Tooltip nativo */
.tool-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-premium);
}

.tool-btn:hover::after {
    opacity: 1;
}

/* ================== BUSCADOR DE COMUNIDADES ================== */
.search-container {
    position: absolute;
    top: 86px;
    left: 70px;
    z-index: 999;
    width: 280px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: #fff;
    border-radius: 14px;
    padding: 10px 14px 10px 38px;
    font-size: 0.82rem;
    outline: none;
    box-shadow: var(--shadow-premium);
    transition: all 0.25s;
}

.search-input:focus {
    border-color: var(--accent);
    background: rgba(18, 24, 38, 0.95);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-premium);
    display: none;
}

.search-item {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.search-item:hover {
    background: rgba(234, 179, 8, 0.15);
    color: #fff;
}

/* ================== SELECTOR DE MAPA BASE ================== */
.basemap-picker-modal {
    position: absolute;
    top: 86px;
    right: 66px;
    z-index: 1001;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow-premium);
    display: none;
    width: 240px;
}

.basemap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.basemap-option {
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 4px;
    transition: all 0.2s;
}

.basemap-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.basemap-option.active {
    border-color: var(--accent);
    background: rgba(234, 179, 8, 0.15);
}

.basemap-option img {
    width: 100%;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 4px;
}

.basemap-option span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-light);
    display: block;
}

/* ================== MODALES (PATRULLAJE, REPORTES, LOGIN) ================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-card form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.65) rgba(15, 23, 42, 0.7);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 8px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.65);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.95);
}

/* Formularios estilizados */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-control, select, input, textarea {
    color-scheme: dark;
}

.form-control {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #f8fafc;
    outline: none;
    transition: all 0.2s;
    color-scheme: dark;
}

.form-control:focus {
    border-color: var(--accent);
    background: #1e293b;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

select.form-control,
select {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    color-scheme: dark !important;
    cursor: pointer;
}

select option,
select optgroup {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    padding: 10px 14px;
}

select option:checked,
select option:hover {
    background-color: #1e293b !important;
    color: #eab308 !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gps-capture-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gps-status {
    font-size: 0.75rem;
    color: #4ade80;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-gps {
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-gps:hover {
    background: #15803d;
}

.photo-preview-box {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 200px;
    display: none;
    background: #0b1120;
    border: 1px solid var(--border-glass);
    text-align: center;
    position: relative;
}

.photo-preview-box img {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.btn-remove-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-remove-photo:hover {
    background: #dc2626;
    transform: scale(1.04);
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(15, 23, 42, 0.95);
    flex-shrink: 0;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    border: none;
    color: #fff;
    padding: 9px 20px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* ================== REPORTE IMPRIMIBLE ================== */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-report-area, #printable-report-area * {
        visibility: visible;
    }
    #printable-report-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #fff !important;
        color: #000 !important;
    }
}

/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 992px) {
    .kpi-container {
        display: none; /* Se ocultan los chips grandes para dar paso a la vista móvil limpia */
    }
    .search-container {
        display: none;
    }
    .brand-text h1 {
        font-size: 0.92rem;
    }
    .brand-text p {
        font-size: 0.65rem;
    }
    .sidebar {
        width: calc(100vw - 28px);
        top: 76px;
    }
}

@media (max-width: 600px) {
    .brand-text p {
        display: none;
    }
    .btn-header span {
        display: none;
    }
    .btn-header {
        padding: 8px 10px;
    }
}

/* ==========================================================================
   WIDGETS Y CONTROLES AVANZADOS (INSPIRADOS EN EL DISEÑO SOLICITADO)
   ========================================================================== */

/* Sliders Dorados de Opacidad por Capa */
.layer-opacity-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 6px;
}
.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 6px rgba(234, 179, 8, 0.85);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.layer-opacity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* Handle para Arrastre y Reordenamiento de Capas */
.drag-handle {
    color: #64748b;
    cursor: grab;
    font-size: 0.82rem;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    user-select: none;
    transition: color 0.2s;
}
.drag-handle:hover {
    color: #cbd5e1;
}
.drag-handle:active {
    cursor: grabbing;
}

/* Botones de Acción Rápida por Lote (Seleccionar / Borrar / Restablecer) */
.layer-batch-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-batch {
    flex: 1;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.btn-batch:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    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);
}

/* ==========================================================================
   PRIORIDAD 2: PANEL DE 172 CAPAS - CABECERA FIJA Y SCROLL INDEPENDIENTE
   ========================================================================== */
#tab-layers {
    display: none;
    flex-direction: column;
    flex: 1 1 0%;
    height: auto;
    max-height: 100%;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#tab-layers.active {
    display: flex !important;
}

.tab-layers-fixed-controls {
    flex-shrink: 0;
    padding: 12px 14px 10px;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.layer-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 6px 12px;
    margin: 8px 0;
    transition: all 0.2s ease;
}

.layer-search-box:focus-within {
    border-color: #22c55e;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.layer-search-box i.fa-search {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 8px;
}

.layer-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.78rem;
    outline: none;
    font-family: inherit;
}

.layer-search-box input::placeholder {
    color: #64748b;
}

.layer-search-clear {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-search-clear:hover {
    color: #ef4444;
}

.layers-scroll-container,
.tab-layers-scroll-body {
    flex: 1 1 0%;
    min-height: 0 !important;
    max-height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px 14px 28px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.6) rgba(15, 23, 42, 0.6);
}

.layers-scroll-container::-webkit-scrollbar,
.tab-layers-scroll-body::-webkit-scrollbar {
    width: 8px;
}

.layers-scroll-container::-webkit-scrollbar-track,
.tab-layers-scroll-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
}

.layers-scroll-container::-webkit-scrollbar-thumb,
.tab-layers-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.55);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.layers-scroll-container::-webkit-scrollbar-thumb:hover,
.tab-layers-scroll-body::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 197, 94, 0.9);
}

/* ==========================================================================
   PRIORIDAD 1: ETIQUETAS Y DESTACADO DE COMUNIDADES
   ========================================================================== */
.community-label {
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    padding: 2px 7px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    transition: all 0.2s ease;
}

.community-label-highlighted {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 2px solid #eab308 !important;
    color: #fef08a !important;
    font-weight: 800 !important;
    font-size: 12.5px !important;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.75), 0 4px 16px rgba(0,0,0,0.7) !important;
    transform: scale(1.05);
    z-index: 1000 !important;
}

@keyframes pulse-halo {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.6);
        opacity: 0.45;
    }
    100% {
        transform: scale(2.3);
        opacity: 0;
    }
}

.community-pulse-ring {
    animation: pulse-halo 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center;
    pointer-events: none;
}

/* ==========================================================================
   PRIORIDAD 3: LEYENDA DINÁMICA REACTIVA Y PLEGABLE
   ========================================================================== */
.floating-legend-box {
    position: absolute;
    bottom: 24px;
    left: 410px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    z-index: 999;
    min-width: 220px;
    max-width: 290px;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-legend-box.collapsed {
    padding: 7px 12px;
    min-width: auto;
    width: auto;
}

.floating-legend-box.collapsed .floating-legend-body {
    display: none;
}

.floating-legend-box.collapsed .floating-legend-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.floating-legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #eab308;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    cursor: pointer;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legend-active-badge {
    background: rgba(34, 197, 94, 0.22);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.45);
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.floating-legend-body {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.floating-legend-body::-webkit-scrollbar {
    width: 4px;
}

.floating-legend-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.floating-legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
    font-size: 0.72rem;
    color: #cbd5e1;
    line-height: 1.25;
}

.legend-chip {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-chip.circle {
    border-radius: 50%;
}

.legend-chip.line {
    height: 3px;
    border-radius: 1px;
}

.legend-empty-state {
    font-size: 0.72rem;
    color: #64748b;
    font-style: italic;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Subcategoría de Capas y Encabezados */
.layer-subgroup-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: #eab308;
    text-transform: uppercase;
    margin: 10px 0 6px 0;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layer-subgroup-title span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-center-info {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   PRIORIDAD 4: INDICADORES SUPERIORES (KPI BAR) AJUSTADOS Y COLAPSABLES
   ========================================================================== */
.top-kpi-bar {
    position: absolute;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    user-select: none;
    transition: top 0.3s ease, transform 0.3s ease;
    max-width: 95vw;
}

.kpi-collapse-btn {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #94a3b8;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.kpi-collapse-btn:hover {
    color: #fff;
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(21, 128, 61, 0.3);
}

.top-kpi-cards {
    display: flex;
    gap: 10px;
    transition: all 0.3s ease;
}

.top-kpi-bar.collapsed .top-kpi-cards {
    display: none;
}

.top-kpi-bar.collapsed {
    top: 72px;
}

.kpi-badge-card {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.kpi-badge-card:hover {
    transform: translateY(-2px);
    border-color: rgba(234, 179, 8, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
}

.kpi-badge-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.kpi-badge-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
    color: #22c55e;
}

.kpi-badge-sub {
    font-size: 0.58rem;
    color: #64748b;
    margin-top: 2px;
}

/* ==========================================================================
   MODAL DE REPORTE SITUACIONAL OFICIAL - MEMBRETE, ALTO CONTRASTE Y CALIDAD
   ========================================================================== */
.report-modal-card {
    max-width: 820px !important;
    width: 94% !important;
    background: #0d1522 !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(21, 128, 61, 0.2) !important;
}

.report-modal-body {
    padding: 20px 24px !important;
    max-height: 80vh;
    overflow-y: auto;
}

/* Membrete Oficial Institucional */
.report-header-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.28) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    padding: 14px 18px;
    margin: 8px 0 16px 0;
}

.report-logo-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #eab308;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.report-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
}

.report-header-text {
    flex: 1;
    min-width: 0;
}

.report-institution-kicker {
    font-size: 0.62rem;
    font-weight: 800;
    color: #4ade80;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.report-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
}

.report-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 2px;
}

.report-badge-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.report-code-badge {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #facc15;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.report-jurisdiction-badge {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #4ade80;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.report-flag-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.report-flag-img {
    width: 64px;
    height: 42px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: block;
}

.report-flag-label {
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Banner Semafórico de Alerta */
.report-alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #f8fafc;
    transition: all 0.3s ease;
}

.report-alert-banner.banner-warning {
    background: rgba(234, 179, 8, 0.18);
    border-color: rgba(234, 179, 8, 0.5);
}

.report-alert-banner.banner-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
}

.report-alert-banner.banner-success {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.5);
}

.report-alert-icon-wrap {
    font-size: 1.5rem;
    color: #facc15;
    flex-shrink: 0;
}

.report-alert-banner.banner-danger .report-alert-icon-wrap { color: #f87171; }
.report-alert-banner.banner-success .report-alert-icon-wrap { color: #4ade80; }

.report-alert-level {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.report-alert-desc {
    font-size: 0.74rem;
    color: #cbd5e1;
    margin-top: 2px;
    line-height: 1.4;
}

/* Ficha Técnica de Emisión (Grid 4 metadatos) */
.report-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.report-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-meta-item .meta-icon {
    font-size: 1.1rem;
    color: #22c55e;
    flex-shrink: 0;
}

.report-meta-label {
    display: block;
    font-size: 0.62rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.report-meta-val {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #f8fafc;
}

/* Tarjetas KPI de Métricas Clave */
.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.report-kpi-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.report-kpi-box:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 197, 94, 0.4);
}

.report-kpi-header {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.report-kpi-box.box-focos .report-kpi-header { color: #f87171; }
.report-kpi-box.box-viento .report-kpi-header { color: #38bdf8; }
.report-kpi-box.box-clima .report-kpi-header { color: #facc15; }
.report-kpi-box.box-patrullaje .report-kpi-header { color: #4ade80; }

.report-kpi-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
}

.report-kpi-sub {
    font-size: 0.64rem;
    color: #64748b;
    margin-top: 3px;
}

/* Secciones y Tablas */
.report-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #eab308;
    letter-spacing: 0.05em;
    margin: 16px 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rep-crop-estimation {
    background: #1e293b;
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-left: 4px solid #eab308;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    color: #f1f5f9;
}

.rep-crop-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 0.72rem;
    color: #cbd5e1;
}

.report-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    color: #f1f5f9;
}

.report-table thead th {
    background: rgba(21, 128, 61, 0.4);
    color: #86efac;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(34, 197, 94, 0.35);
}

.report-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.55);
}

.report-table tbody tr:hover td {
    background: rgba(30, 41, 59, 0.75);
}

.report-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pill-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.45);
}

.pill-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.45);
}

.pill-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.pill-info {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
}

.report-diagnosis-box {
    background: rgba(15, 23, 42, 0.65);
    border-left: 3px solid #22c55e;
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.report-recommendations-list {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
}

.report-rec-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.76rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    line-height: 1.45;
}

.report-rec-item:last-child {
    margin-bottom: 0;
}

.report-rec-item i {
    color: #22c55e;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Bloque de Validación y Firmas */
.report-signatures-area {
    display: grid;
    grid-template-columns: 1fr 110px 1fr;
    gap: 16px;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    text-align: center;
    align-items: center;
}

.signature-line {
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    margin: 28px auto 6px;
    width: 80%;
}

.signature-name {
    font-weight: 700;
    font-size: 0.74rem;
    color: #f8fafc;
}

.signature-role {
    font-size: 0.66rem;
    color: #94a3b8;
}

.report-seal-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.report-seal-img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    opacity: 0.9;
}

.seal-caption {
    font-size: 0.58rem;
    font-weight: 800;
    color: #eab308;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.report-footer-note {
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.4;
}

/* Fallback print styles for Ctrl+P */
@media print {
    #map, .top-header, .top-kpi-bar, .sidebar, .map-toolbar, .search-container, .floating-legend-box, .basemap-picker-modal {
        display: none !important;
    }
}

/* ==========================================================================
   RESPONSIVIDAD MÓVIL Y TABLETS
   ========================================================================== */
@media (max-width: 1024px) {
    .top-kpi-bar {
        max-width: calc(100vw - 32px);
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .kpi-badge-card {
        min-width: 105px;
        padding: 5px 10px;
    }

    .kpi-badge-value {
        font-size: 1.15rem;
    }
}

@media (max-width: 992px) {
    .header-center-info {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .top-kpi-bar {
        top: 66px;
    }

    .floating-legend-box {
        left: 14px;
        bottom: 80px;
    }

    .report-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .report-ancestral-card {
        grid-template-columns: 1fr !important;
    }

    .report-meta-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .report-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .tech-dropdown-menu {
        width: min(290px, calc(100vw - 28px)) !important;
    }
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 0.78rem !important;
    }

    .brand-jaguar {
        width: 28px !important;
        height: 28px !important;
    }

    .brand-badge {
        padding: 4px 8px !important;
    }

    .mouse-coordinates-badge {
        display: none !important;
    }

    .report-meta-grid {
        grid-template-columns: 1fr !important;
    }

    .report-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-card {
        max-height: 94vh !important;
        border-radius: 16px !important;
    }

    .map-toolbar {
        bottom: 14px !important;
        right: 10px !important;
    }
}

/* ==========================================================================
   ESTILO BENI: BOTÓN DESPLEGABLE DE GESTIÓN TÉCNICA
   ========================================================================== */
.tech-dropdown-wrapper {
    position: relative;
    display: inline-block;
    z-index: 1010;
    pointer-events: auto;
}

.btn-beni-menu {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-beni-menu:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.2);
}

.tech-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(34, 197, 94, 0.25);
    z-index: 9999 !important;
    pointer-events: auto;
    animation: fadeInDropdown 0.2s ease-out forwards;
}

.tech-dropdown-menu.active, .tech-dropdown-menu.show {
    display: block !important;
}

@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 12px;
    border-radius: 8px;
    color: #f1f5f9;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.84rem;
    font-weight: 500;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

button.tech-dropdown-item {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

.tech-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(3px);
}

.tech-dropdown-item i {
    font-size: 1.1rem;
    color: #22c55e;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.tech-dropdown-item strong {
    display: block;
    font-weight: 700;
    line-height: 1.2;
}

.tech-dropdown-item small {
    display: block;
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 2px;
}

.tech-dropdown-item.text-danger i {
    color: #f87171;
}

.tech-dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.tech-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

/* ==========================================================================
   POPUP DE VERIFICACIÓN EN CAMPO EN EL MAPA (ESTILO BENI / CONCEPCIÓN)
   ========================================================================== */
.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 14px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
}

.patrol-map-card {
    font-family: 'Inter', sans-serif;
    min-width: 260px;
    max-width: 300px;
    color: #f8fafc;
}

.patrol-map-photo {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #0f172a;
    border-bottom: 2px solid rgba(16, 185, 129, 0.4);
    cursor: pointer;
}

.patrol-map-body {
    padding: 12px 14px;
}

.patrol-map-badges {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.patrol-tag-category {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.patrol-tag-date {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
}

.patrol-map-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.patrol-meta-row {
    font-size: 0.72rem;
    color: #cbd5e1;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.patrol-meta-row i {
    width: 14px;
    color: #22c55e;
    text-align: center;
}

.patrol-notes-box {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.72rem;
    color: #e2e8f0;
    font-style: italic;
    line-height: 1.4;
}

/* ==========================================================================
   POPUP MULTI-CAPA CON NAVEGACIÓN POR FLECHAS (IDENTIFY GIS)
   ========================================================================== */
.multi-layer-leaflet-popup .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(14px) !important;
}

.multi-layer-leaflet-popup .leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
}

.multi-popup-card {
    font-family: 'Inter', sans-serif;
    min-width: 250px;
    max-width: 330px;
    color: #f8fafc;
    padding: 12px 14px;
}

.multi-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px 8px;
    margin-bottom: 10px;
}

.multi-popup-header.single {
    justify-content: center;
}

.btn-popup-nav {
    background: rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #4ade80;
    border-radius: 7px;
    width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    outline: none;
}

.btn-popup-nav:hover {
    background: #22c55e;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    transform: scale(1.08);
}

.multi-popup-counter {
    font-size: 0.74rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.multi-popup-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.multi-popup-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 7px;
}

.multi-popup-content {
    max-height: 190px;
    overflow-y: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    padding-right: 4px;
}

.multi-popup-content::-webkit-scrollbar {
    width: 5px;
}
.multi-popup-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}
.multi-popup-content::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 4px;
}

.multi-popup-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 8px;
}

.multi-popup-row:last-child {
    border-bottom: none;
}

.multi-popup-key {
    font-weight: 700;
    color: #94a3b8;
    word-break: break-word;
    font-size: 0.72rem;
}

.multi-popup-val {
    color: #f1f5f9;
    text-align: right;
    word-break: break-word;
    font-size: 0.74rem;
}

/* ==========================================================================
   REPORTE SITUACIONAL: MAPA Y ANCESTRAL
   ========================================================================== */
.report-map-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 18px;
}

.report-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    color: #f8fafc;
}

.report-map-sub {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
}

.report-map-preview-container {
    width: 100%;
    height: 180px;
    background: #0f172a;
}

.ancestral-weather-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.ancestral-weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.ancestral-weather-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lunar-phase-pill {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.35);
    color: #facc15;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ancestral-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.ancestral-day-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}

.ancestral-day-name {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
}

.ancestral-day-icon {
    font-size: 1.1rem;
    color: #38bdf8;
    margin: 4px 0;
}

.ancestral-day-temp {
    font-size: 0.74rem;
    font-weight: 800;
    color: #f8fafc;
}

.ancestral-day-wind {
    font-size: 0.62rem;
    color: #cbd5e1;
}

.ancestral-lore-box {
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid #22c55e;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    font-size: 0.72rem;
    color: #cbd5e1;
    line-height: 1.45;
}

/* ==========================================================================
   BANNER DE SABIDURÍA ANCESTRAL Y RECOMENDACIONES (IMAGEN 2 - REPORTE)
   ========================================================================== */
.report-ancestral-card {
    display: grid;
    grid-template-columns: 1.15fr 1.6fr 0.75fr;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0 4px 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ancestral-col {
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Columna 1: Mostaza / Dorado Ancestral */
.ancestral-col-left {
    background: #c69214;
    color: #ffffff;
}

.ancestral-badge-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ancestral-text {
    font-size: 0.70rem;
    line-height: 1.35;
    color: #fffbeb;
    font-weight: 500;
}

.ancestral-tribal-pattern {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 0.52rem;
    color: #fef08a;
    opacity: 0.85;
    letter-spacing: 2px;
}

/* Columna 2: Recomendaciones (Gris azulado suave / Blanco) */
.ancestral-col-center {
    background: #e6edf5;
    color: #1e293b;
    padding-left: 14px;
    padding-right: 14px;
}

.ancestral-rec-title {
    font-size: 0.80rem;
    font-weight: 800;
    color: #1d4ed8;
    margin-bottom: 3px;
}

.ancestral-rec-list {
    margin: 0;
    padding-left: 14px;
    font-size: 0.68rem;
    line-height: 1.32;
    color: #334155;
}

.ancestral-rec-list li {
    margin-bottom: 2px;
}

.ancestral-rec-list li:last-child {
    margin-bottom: 0;
}

/* Columna 3: Fase Lunar (Azul Océano) */
.ancestral-col-right {
    background: #1e5f9e;
    color: #ffffff;
    align-items: center;
    text-align: center;
    padding: 8px 6px;
}

.ancestral-moon-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-svg {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.ancestral-moon-label {
    font-size: 0.70rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

/* Pie del banner ancestral */
.ancestral-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px 6px 6px;
    font-size: 0.63rem;
    color: #94a3b8;
    line-height: 1.3;
}

.ancestral-footer-text strong {
    color: #cbd5e1;
}

.footer-cicol-mini-logo {
    height: 26px;
    width: 26px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 1px;
}

/* ==========================================================================
   MODOS INTERACTIVOS EN MAPA: CAPTURA DE COORDENADAS Y MEDICIÓN DE DISTANCIA
   Garantiza que ninguna capa vectorial, polígono, marcador o popup bloquee los clics
   ========================================================================== */
.map-picker-active,
.map-measuring-active {
    cursor: crosshair !important;
}

.map-picker-active .leaflet-overlay-pane,
.map-picker-active .leaflet-marker-pane,
.map-picker-active .leaflet-shadow-pane,
.map-picker-active .leaflet-popup-pane,
.map-picker-active .leaflet-tooltip-pane,
.map-picker-active .leaflet-interactive,
.map-measuring-active .leaflet-overlay-pane,
.map-measuring-active .leaflet-marker-pane,
.map-measuring-active .leaflet-shadow-pane,
.map-measuring-active .leaflet-popup-pane,
.map-measuring-active .leaflet-tooltip-pane,
.map-measuring-active .leaflet-interactive {
    pointer-events: none !important;
}

/* Banner flotante de ayuda durante la selección de coordenadas o medición */
.map-interactive-banner {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(234, 179, 8, 0.7);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(12px);
    animation: fadeInDown 0.25s ease-out;
    pointer-events: auto;
}

.map-interactive-banner.banner-measure {
    border-color: rgba(56, 189, 248, 0.7);
}

.map-interactive-banner .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: 14px;
    font-size: 0.74rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.map-interactive-banner .btn-banner-action:hover {
    background: rgba(239, 68, 68, 0.6);
    color: #ffffff;
}

/* Pin visual temporal cuando se selecciona un punto en el mapa */
.temp-picker-pin {
    width: 32px;
    height: 32px;
    background: #eab308;
    color: #0f172a;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.7);
    border: 2px solid #ffffff;
    animation: bouncePin 0.9s infinite alternate ease-in-out;
}

.temp-picker-pin i {
    transform: rotate(45deg);
    font-size: 14px;
    color: #0f172a;
}

@keyframes bouncePin {
    0% { transform: translateY(0) rotate(-45deg); }
    100% { transform: translateY(-8px) rotate(-45deg); }
}

.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);
}

/* Tabla del Archivo Histórico de Reportes */
.reportes-history-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.18s ease;
}

.reportes-history-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.07);
}

.reportes-history-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

.report-code-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Outfit', monospace;
    font-size: 0.78rem;
}

.report-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.report-status-badge.status-normal {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.report-status-badge.status-moderado {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.report-status-badge.status-alto {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.report-status-badge.status-critico {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-history-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.8);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.btn-history-action:hover {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.btn-history-action.btn-del:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}




/* Widget Flotante de Coordenadas en Vivo (Lat, Lon, UTM) */
.mouse-coordinates-badge,
.coords-display {
    position: absolute;
    bottom: 14px;
    right: 70px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    z-index: 6000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    user-select: none;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mouse-coordinates-badge div,
.coords-display .coords-row,
.coords-display div {
    white-space: nowrap;
}

.mouse-coordinates-badge span,
.coords-display span {
    color: #ffffff;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Inter', monospace;
}/* Ajuste de escala para textos de riesgo y alerta */
#badge-riesgo-level,
#badge-alerta-status {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    line-height: 1.2 !important;
}


/* Form Fields y Tablas de Reporte Operativo Oficial (Listado y Campos a Mano) */
.rep-muni-summary-card {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rep-muni-kicker {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rep-muni-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ef4444;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.rep-muni-num small {
    font-size: 0.72rem;
    color: #cbd5e1;
    font-weight: 400;
}

.rep-muni-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.rep-muni-col {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    overflow: hidden;
}

.rep-muni-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.rep-muni-table th {
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.64rem;
    font-weight: 700;
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rep-muni-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rep-muni-table tr:last-child td {
    border-bottom: none;
}

.rep-muni-name {
    color: #e2e8f0;
    font-weight: 500;
}

.rep-muni-count {
    color: #ef4444;
    font-weight: 800;
    text-align: right;
    font-family: 'JetBrains Mono', monospace, sans-serif;
}

.report-operational-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.rep-input-field {
    width: 100%;
    background: #0b1320;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f8fafc;
    padding: 6px 10px;
    font-size: 0.74rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.rep-input-field:focus {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.rep-textarea-field {
    width: 100%;
    background: #0b1320;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f8fafc;
    padding: 6px 10px;
    font-size: 0.74rem;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    line-height: 1.45;
    resize: vertical;
    transition: all 0.2s ease;
}

.rep-textarea-field:focus {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.rep-diagnosis-textarea {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    border-left: 3px solid #10b981 !important;
    color: #d1fae5 !important;
}


/* ==========================================================================
   WIDGET DE FOCOS EN PERIODO (TARJETA EJECUTIVA SEGÚN DISEÑO SAT)
   ========================================================================== */
.rep-focos-widget-card {
    background: #0d1527;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.rep-focos-widget-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rep-focos-widget-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
}

.rep-focos-widget-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.rep-focos-widget-number {
    font-size: 26px;
    font-weight: 800;
    color: #ef4444;
    line-height: 1.1;
    font-family: 'Outfit', sans-serif;
}

.rep-focos-widget-label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

.rep-focos-widget-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 10px 0 8px 0;
}

.rep-focos-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rep-muni-table {
    width: 100%;
    border-collapse: collapse;
}

.rep-muni-table th {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 4px 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.rep-muni-table td {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12.5px;
}

.rep-muni-table tr:last-child td {
    border-bottom: none;
}

.rep-muni-name {
    color: #f8fafc;
    font-weight: 500;
    text-align: left;
}

.rep-muni-count {
    color: #ef4444;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rep-top-count {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 800;
}


/* ==========================================================================
   TACÓMETRO OFICIAL DE NIVEL DE RIESGO Y SELECTOR OPERATIVO (MULTI-VISOR)
   ========================================================================== */
.report-alert-banner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
    transition: all 0.3s ease;
}
.report-alert-left-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.report-alert-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.report-alert-level {
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
}
.report-alert-level .kicker-label {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.report-alert-level .risk-badge-text {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    font-family: 'Outfit', -apple-system, sans-serif;
}
.report-alert-desc {
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.92;
}

/* Selector Manual de Riesgo para el Técnico */
.report-risk-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255,255,255,0.2);
    flex-wrap: wrap;
}
.report-alert-banner.banner-warning .report-risk-selector,
.report-alert-banner.banner-success .report-risk-selector {
    border-top-color: rgba(0,0,0,0.12);
}
.risk-sel-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
}
.risk-pills-wrap {
    display: inline-flex;
    gap: 5px;
    background: rgba(15, 23, 42, 0.45);
    padding: 3px 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.report-alert-banner.banner-success .risk-pills-wrap,
.report-alert-banner.banner-warning .risk-pills-wrap {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.12);
}
.risk-pill-btn {
    border: none;
    background: transparent;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.70rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
    opacity: 0.75;
}
.risk-pill-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}
.risk-pill-btn.active {
    opacity: 1;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transform: scale(1.05);
}
.risk-pill-btn.pill-bajo.active { background: #1e5927 !important; }
.risk-pill-btn.pill-medio.active { background: #558b2f !important; }
.risk-pill-btn.pill-alto.active { background: #f9a825 !important; color: #1e293b !important; }
.risk-pill-btn.pill-muy-alto.active { background: #e65100 !important; }
.risk-pill-btn.pill-extremo.active { background: #b71c1c !important; }

/* Contenedor del Tacómetro SVG */
.report-gauge-box {
    width: 175px;
    height: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}
.report-gauge-box svg {
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
}
.gauge-slice:hover {
    opacity: 1 !important;
    filter: brightness(1.15);
}

/* Input Manual para Incendios Activos */
.box-incendios {
    border-color: rgba(239, 68, 68, 0.45) !important;
    background: rgba(239, 68, 68, 0.04) !important;
}
.report-kpi-input-num {
    width: 80px;
    max-width: 100%;
    margin: 0 auto;
    display: block;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #ef4444;
    background: rgba(15, 23, 42, 0.06);
    border: 1.5px dashed #ef4444;
    border-radius: 8px;
    padding: 2px 6px;
    outline: none;
    transition: all 0.2s ease;
}
.report-kpi-input-num:focus {
    background: #ffffff;
    border-style: solid;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

@media print {
    .hide-on-print {
        display: none !important;
    }
}

/* ==========================================================================
   GRILLA DE 5 KPIS EN REPORTE SITUACIONAL (FOCOS, VIENTO, CLIMA, PRECIP, INCENDIOS)
   ========================================================================== */
.report-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
}

.report-kpi-box {
    padding: 8px 6px !important;
    min-width: 0 !important;
}

.report-kpi-box .report-kpi-header {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: 0.02em !important;
}

.report-kpi-box .report-kpi-num {
    font-size: 1.20rem !important;
    margin: 3px 0 2px 0 !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
}

.report-kpi-box .report-kpi-sub {
    font-size: 0.60rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.report-kpi-box.box-precip {
    border: 1px solid rgba(14, 165, 233, 0.40) !important;
    background: rgba(14, 165, 233, 0.08) !important;
}

.report-kpi-box.box-precip .report-kpi-header {
    color: #38bdf8 !important;
}

.report-kpi-box.box-precip .report-kpi-num {
    color: #38bdf8 !important;
}

.report-kpi-box.box-precip .report-kpi-sub {
    color: #94a3b8 !important;
}

@media print {
    .report-kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 6px !important;
    }
    .report-kpi-box {
        padding: 6px 4px !important;
    }
    .report-kpi-box.box-precip {
        background: #f0f9ff !important;
        border: 1px solid #7dd3fc !important;
    }
    .report-kpi-box.box-precip .report-kpi-header {
        color: #0284c7 !important;
    }
    .report-kpi-box.box-precip .report-kpi-num {
        color: #0369a1 !important;
    }
    .report-kpi-box.box-precip .report-kpi-sub {
        color: #64748b !important;
    }
}

/* ==========================================================================
   BOTÓN GUÍA DE USO OFICIAL EN HEADER
   ========================================================================== */
.btn-header.btn-header-guia {
    background: rgba(14, 165, 233, 0.16) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #38bdf8 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: 0.3px !important;
    border-radius: 12px;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-header.btn-header-guia i {
    color: #38bdf8 !important;
    font-size: 0.88rem !important;
}

.btn-header.btn-header-guia:hover {
    background: rgba(14, 165, 233, 0.32) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5) !important;
    transform: translateY(-1px) !important;
}

.btn-header.btn-header-guia:hover i {
    color: #ffffff !important;
}

/* ==========================================================================
   CAJAS DE ADVERTENCIA METODOLÓGICA (SAT-GAMM / FOREST FORESIGHT)
   ========================================================================== */
.sat-warning-box {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    border-left: 4px solid #f59e0b !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    margin: 12px 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.sat-warning-box .sat-warning-title {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    color: #f59e0b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.sat-warning-box p {
    font-size: 0.68rem !important;
    color: #cbd5e1 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.sat-warning-box b {
    color: #ffffff !important;
}
