/* =========================================================
   MAPA DE NOTICIAS - SYSTEMOSINT
   Archivo CSS independiente del frontend principal.

   IMPORTANTE:
   - Este archivo solo afecta la vista /mapa/.
   - No modifica la pantalla principal del mapa de noticias.
   - El mapa se mantiene a pantalla completa.
   - El panel de noticias ahora flota SOBRE el mapa,
     manteniendo la misma posición visual del lado derecho.
   - El fondo del panel usa efecto glass / blur tipo iOS.
   - Las tarjetas de noticias NO se vuelven transparentes;
     se mantienen sólidas para conservar legibilidad.
   - Los modales aparecen sobre el mapa, sin cubrirlo totalmente.
========================================================= */

/* =========================================================
   RESETEO GENERAL
========================================================= */

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

/* =========================================================
   VARIABLES DE COLOR
   Cambia aquí la paleta si deseas ajustar el estilo visual.
========================================================= */

:root {
    --guinda: #691c32;
    --guinda-oscuro: #4b1022;
    --dorado: #bc955c;
    --dorado-oscuro: #d6b36d;
    --verde: #235b4e;
    --verde-claro: #2f8f46;
    --hueso: #f4f1ea;
    --blanco: #ffffff;
    --gris-fondo: #f8fafc;
    --gris-panel: #f7f7f7;
    --gris-borde: #e5e7eb;
    --texto: #1f2937;
    --texto-suave: #4b5563;

    /*
       Variables nuevas para el efecto iOS / glass.
       Puedes subir o bajar la transparencia modificando el último número:
       0.72 = más sólido
       0.45 = más transparente
    */
    --glass-panel: rgba(248, 250, 252, 0.32);
    --glass-panel-light: rgba(255, 255, 255, 0.24);
    --glass-panel-strong: rgba(255, 255, 255, 0.48);
    --glass-border: rgba(255, 255, 255, 0.34);
    --news-panel-width: 380px;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--gris-fondo);
    color: var(--texto);
    overflow: hidden;
}

/* =========================================================
   CONTENEDOR GENERAL
========================================================= */

.map-shell {
    width: 100vw;
    height: 100vh;
    margin: 0;
    position: relative;
    background: var(--blanco);
    overflow: hidden;
}

/* =========================================================
   BARRA SUPERIOR
========================================================= */

.map-topbar {
    position: absolute;
    z-index: 900;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--texto);
    border: none;
    border-bottom: solid 1px rgba(255, 255, 255, 0.24);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.map-menu-button {
    width: 38px;
    height: 34px;
    border: none;
    border-radius: 6px;
    background: var(--blanco);
    color: #1f2937;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

.map-menu-button:hover {
    background: var(--hueso);
}

.map-brand {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 160px;
}

.map-brand img {
    max-width: 180px;
    height: 46px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0.3px 0 0 #e7e5e5);
}

/* =========================================================
   MENÚ HAMBURGUESA
========================================================= */

.map-menu-panel {
    position: absolute;
    z-index: 1100;
    top: 74px;
    left: 18px;
    width: 250px;
    background: var(--blanco);
    border: 1px solid rgba(31, 41, 55, 0.18);
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.24);
    padding: 14px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.map-menu-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.map-menu-title {
    color: #1f2937;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
}

.map-menu-panel a {
    display: block;
    /* Botones del menú hamburguesa con el tono solicitado. */
    background: #1f2937;
    color: var(--blanco);
    text-decoration: none;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: bold;
}

.map-menu-panel a:hover {
    background: #111827;
}

.map-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    border: 0;
    background: transparent;
    cursor: default;
}

.map-menu-overlay.open {
    display: block;
}

/* =========================================================
   ESTRUCTURA PRINCIPAL
   CAMBIO IMPORTANTE:
   Antes esta zona usaba columnas:
   mapa a la izquierda + panel a la derecha.

   Ahora el mapa ocupa TODO el ancho disponible y el panel derecho
   se coloca encima del mapa con position:absolute, conservando la
   misma posición visual del lado derecho.
========================================================= */

.map-main {
    position: absolute;
    inset: 64px 0 0 0;
    display: block;
    min-height: 0;
    overflow: hidden;
}

/* =========================================================
   ÁREA DEL MAPA
   El mapa ahora queda por debajo del panel y ocupa todo el espacio.
========================================================= */

.map-area {
    position: absolute;
    inset: 0;
    min-width: 0;
    min-height: 0;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    overflow: hidden;
    z-index: 1;
}

#mapaMexico {
    width: 100%;
    height: 100%;
    z-index: 1;
    border: none;
    outline: none;
    box-shadow: none;
}

.leaflet-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* =========================================================
   LEYENDA DEL MAPA
========================================================= */

.map-legend {
    position: absolute;
    left: 18px;
    bottom: 20px;
    z-index: 700;
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    padding: 14px 24px;
    border: 1px solid rgba(105, 28, 50, 0.14);
    border-radius: 8px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
    display: flex;
    gap: 18px;
    align-items: center;
    font-size: 12px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid currentColor;
    background: var(--blanco);
}

.legend-dot.nueva { color: #2f8f46; }
.legend-dot.monitoreada { color: #174ea6; }
.legend-dot.anterior { color: #e26d2f; }



/* =========================================================
   CONTROL DE CAPAS DEL MAPA
   - Panel flotante semitransparente tipo glass.
   - Permite mostrar/ocultar la lista de capas.
   - Permite cambiar el mapa base a opciones tipo Google.
========================================================= */

.map-layer-control {
    position: absolute;
    /* Bajado para no tapar los controles de zoom de Leaflet. */
    top: 86px;
    left: 12px;
    z-index: 760;
    /* Un poco más ancho para que las opciones respiren mejor sin invadir el mapa. */
    width: 204px;
    max-width: calc(100vw - 420px);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
    background: rgba(230, 248, 251, 0.22);
    /* Se retira el borde blanco exterior; la separación queda solo con sombra suave. */
    border: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
}

.map-layer-header {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 7px 4px 10px;
    background: var(--texto);
    color: var(--blanco);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
}

.map-layer-toggle {
    width: 18px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--guinda);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.map-layer-toggle:hover {
    background: var(--hueso);
}

.map-layer-body {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 9px;
    background: rgba(235, 250, 253, 0.14);
    /* Línea superior sutil, sin borde blanco marcado. */
    border-top: 1px solid rgba(31, 41, 55, 0.08);
    transform: translateY(-6px);
    transition:
        max-height 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.34s ease,
        padding 0.38s ease,
        transform 0.38s ease;
}

.map-layer-control.open .map-layer-body {
    max-height: 430px;
    opacity: 1;
    padding: 9px 9px 12px;
    transform: translateY(0);
}

.map-layer-section-title {
    margin-bottom: 6px;
    color: var(--guinda);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.map-layer-section-title-spaced {
    margin-top: 10px;
}

.map-layer-option {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    margin-bottom: 6px;
    padding: 5px 6px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.30);
    border: 1px solid rgba(105, 28, 50, 0.08);
    color: #1f2937;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.map-layer-option:hover {
    background: rgba(255, 255, 255, 0.44);
}

.map-layer-option input {
    width: 12px;
    height: 12px;
    accent-color: var(--guinda);
    cursor: pointer;
}

.map-layer-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32);
}

.map-layer-icon-osm {
    background: linear-gradient(135deg, #b7e4c7, #74c69d 52%, #d8f3dc);
}

.map-layer-icon-google {
    background: linear-gradient(135deg, #facc15 0 28%, #22c55e 28% 55%, #3b82f6 55% 78%, #ef4444 78%);
}

.map-layer-icon-satellite {
    background: linear-gradient(135deg, #1f2937, #14532d 45%, #60a5fa);
}

.map-layer-icon-state {
    background: rgba(47, 143, 70, 0.72);
    border-color: rgba(21, 71, 52, 0.72);
}

.map-layer-icon-usa {
    background: linear-gradient(135deg, rgba(254, 202, 202, 0.90), rgba(220, 38, 38, 0.72));
    border-color: rgba(127, 29, 29, 0.72);
}

.map-layer-icon-region {
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.90), rgba(14, 165, 233, 0.70));
    border-color: rgba(3, 105, 161, 0.70);
}

.map-layer-icon-heat {
    /*
       Icono de la capa especial de riesgo. Se usan los mismos colores
       operativos del panel: verde, naranja y rojo.
    */
    background: linear-gradient(135deg, #22c55e 0 34%, #f97316 34% 67%, #dc2626 67% 100%);
    border-color: rgba(15, 23, 42, 0.35);
}

.map-layer-icon-marker {
    position: relative;
    background: #f43f5e;
    border-radius: 50%;
    border-color: rgba(255, 255, 255, 0.9);
}

.map-layer-icon-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.56);
}


/* =========================================================
   CONTROL DE RIESGO DEL MAPA DE CALOR
   - Filtra únicamente la capa especial de México.
   - No modifica búsquedas, extracción ni clasificación.
   - Diseño tipo dona, con colores suaves y etiquetas legibles.
========================================================= */

.risk-thermometer-control {
    position: absolute;
    left: 22px;
    top: 600px;
    z-index: 755;
    width: 172px;
    height: 172px;
    pointer-events: auto;
    transition: opacity 0.20s ease, filter 0.20s ease;
}

/* Se conserva por compatibilidad, pero el rótulo no se muestra. */
.risk-thermometer-title {
    display: none;
}

/*
   Estado general del control:
   - Apagado: más transparente, para que no compita con el mapa.
   - Encendido: colores con más presencia y botón central celeste tenue.
*/
.risk-thermometer-control.is-heat-off {
    opacity: 0.68;
}

.risk-thermometer-control.is-heat-off .risk-wheel {
    filter: saturate(82%);
    box-shadow:
        0 10px 18px rgba(15, 23, 42, 0.10),
        0 3px 8px rgba(15, 23, 42, 0.08);
}

.risk-thermometer-control.is-heat-on {
    opacity: 1;
}

.risk-thermometer-control.is-heat-on .risk-wheel-segment {
    opacity: 0.98;
}

.risk-thermometer-control.is-heat-on .risk-wheel-segment.is-active {
    opacity: 1;
}

.risk-thermometer-control.is-heat-on .risk-wheel-segment.is-muted {
    opacity: 0.22;
}

.risk-thermometer-control.is-heat-on .risk-wheel-center {
    background:
        radial-gradient(circle at 35% 25%, rgb(194, 197, 198), rgba(107, 171, 214, 0.96));
    box-shadow:
        0 9px 20px rgba(14, 165, 233, 0.22),
        inset 0 1px 4px rgba(255, 255, 255, 0.95);
}

.risk-thermometer-control.is-heat-off .risk-wheel-center {
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.88));
}

.risk-wheel {
    position: relative;
    width: 172px;
    height: 172px;
    border-radius: 50%;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(248, 250, 252, 0.98) 0 31%, transparent 32%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(15, 23, 42, 0.06));
    box-shadow:
        0 18px 30px rgba(15, 23, 42, 0.18),
        0 5px 12px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(4px) saturate(130%);
    -webkit-backdrop-filter: blur(4px) saturate(130%);
    transition: box-shadow 0.20s ease, filter 0.20s ease;
}

/* Aro interior tenue para dar profundidad sin cargar el control. */
.risk-wheel::before {
    content: "";
    position: absolute;
    inset: 13px;
    z-index: 3;
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.08),
        inset 0 10px 18px rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.risk-wheel::after {
    content: "";
    position: absolute;
    inset: 52px;
    z-index: 4;
    border-radius: 50%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(241, 245, 249, 0.93));
    box-shadow:
        0 7px 16px rgba(15, 23, 42, 0.15),
        inset 0 1px 4px rgba(255, 255, 255, 0.92);
    pointer-events: none;
}

.risk-wheel-segment {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    /* Solo se refuerza el aro exterior; no se modifica el botón central ni la lógica. */
    opacity: 0.50;
    transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.risk-wheel-segment::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.18s ease;
}

.risk-wheel-segment:hover::after,
.risk-wheel-segment.is-active::after {
    background: rgba(255, 255, 255, 0.10);
}

.risk-wheel-segment.is-muted {
    opacity: 0.22;
    filter: grayscale(45%) saturate(70%);
}

.risk-wheel-segment span {
    position: absolute;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 46px;
    justify-content: center;
    padding: 4px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.70);
    color: #1f2937;
    font-size: 10.8px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    transform: translate(-50%, -50%);
}

.risk-wheel-segment span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.risk-wheel-critico {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.52), rgba(159, 18, 57, 0.42));
    clip-path: polygon(50% 50%, 0 50%, 0 0, 50% 0);
}

.risk-wheel-critico span {
    left: 31%;
    top: 30%;
    color: #7f1d1d;
}

.risk-wheel-critico span::before {
    background: #7f1d1d;
}

.risk-wheel-alto {
    background: linear-gradient(225deg, rgba(220, 38, 38, 0.50), rgba(244, 63, 94, 0.40));
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 50%);
}

.risk-wheel-alto span {
    left: 69%;
    top: 30%;
    color: #991b1b;
}

.risk-wheel-alto span::before {
    background: #dc2626;
}

.risk-wheel-medio {
    background: linear-gradient(315deg, rgba(249, 115, 22, 0.50), rgba(251, 146, 60, 0.40));
    clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%);
}

.risk-wheel-medio span {
    left: 69%;
    top: 70%;
    color: #9a3412;
}

.risk-wheel-medio span::before {
    background: #f97316;
}

.risk-wheel-bajo {
    background: linear-gradient(45deg, rgba(22, 163, 74, 0.48), rgba(74, 124, 43, 0.38));
    clip-path: polygon(50% 50%, 50% 100%, 0 100%, 0 50%);
}

.risk-wheel-bajo span {
    left: 31%;
    top: 70%;
    color: #166534;
}

.risk-wheel-bajo span::before {
    background: #16a34a;
}

.risk-wheel-center {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 7;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 0;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.88));
    color: #1f2937;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 12.5px;
    font-weight: 900;
    line-height: 1.05;
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.14),
        inset 0 1px 4px rgba(255, 255, 255, 0.90);
}

.risk-wheel-center:hover,
.risk-wheel-center.is-active {
    color: #111827;
    transform: translate(-50%, -50%) scale(1.03);
    
}

.risk-wheel-center.is-off {
    opacity: 0.90;
    filter: grayscale(18%);
}


/*
   Intensidad solo para el aro exterior del control de riesgo.
   La parte interna, las etiquetas y el botón central quedan igual.
   Se usa un segundo dibujo encima del segmento, recortado con máscara radial.
*/
.risk-wheel-segment::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.90;
    -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 63%, #000 64% 100%);
    mask: radial-gradient(circle at 50% 50%, transparent 0 63%, #000 64% 100%);
}

.risk-wheel-critico::before {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.96), rgba(159, 18, 57, 0.88));
    clip-path: polygon(50% 50%, 0 50%, 0 0, 50% 0);
}

.risk-wheel-alto::before {
    background: linear-gradient(225deg, rgba(220, 38, 38, 0.94), rgba(244, 63, 94, 0.86));
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 50%);
}

.risk-wheel-medio::before {
    background: linear-gradient(315deg, rgba(249, 115, 22, 0.94), rgba(251, 146, 60, 0.86));
    clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%);
}

.risk-wheel-bajo::before {
    background: linear-gradient(45deg, rgba(22, 163, 74, 0.92), rgba(74, 124, 43, 0.84));
    clip-path: polygon(50% 50%, 50% 100%, 0 100%, 0 50%);
}

/* El aro exterior se refuerza todavía más cuando se selecciona un nivel. */
.risk-wheel-segment.is-active::before {
    opacity: 1;
    filter: saturate(118%) brightness(1.04);
}

@media (max-width: 900px) {
    .risk-thermometer-control {
        top: 520px;
        transform: scale(0.82);
        transform-origin: left top;
    }
}

/* =========================================================
   PANEL DERECHO DE NOTICIAS
   CAMBIO IMPORTANTE:
   - Ahora está sobre el mapa.
   - Se conserva del lado derecho, en la misma posición.
   - Tiene blur real porque detrás ahora sí existe el mapa.
========================================================= */

.news-map-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 650;

    width: var(--news-panel-width);
    min-width: var(--news-panel-width);
    min-height: 0;

    /*
       Fondo translúcido tipo iOS.
       Transparencia alta configurada:
       - 0.35 = más transparente.
       - 0.18 = permite ver más mapa debajo.
       Si lo quieres más sólido, sube estos valores a 0.50 / 0.35.
    */
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 0.26),
            rgba(248, 250, 252, 0.12)
        );

    backdrop-filter: blur(30px) saturate(185%);
    -webkit-backdrop-filter: blur(30px) saturate(185%);

    border: none;
    outline: none;

    /*
       Sombra lateral suave para separar el panel sin crear marco.
    */
    box-shadow:
        -10px 0 34px rgba(15, 23, 42, 0.12),
        inset 1px 0 0 rgba(255, 255, 255, 0.22);

    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.16s ease, min-width 0.16s ease;
}

/* Pestaña vertical para ampliar/reducir el panel sin alterar el mapa. */
.news-panel-resize-handle {
    position: absolute;
    top: 50%;
    right: calc(var(--news-panel-width) - 9px);
    z-index: 790;
    width: 18px;
    height: 92px;
    transform: translateY(-50%);
    border: 1px solid rgba(105, 28, 50, 0.28);
    border-radius: 8px 0 0 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--guinda);
    box-shadow: -3px 3px 12px rgba(15, 23, 42, 0.18);
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: right 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.news-panel-resize-handle span {
    display: block;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    transform: scaleX(0.72);
}

.news-panel-resize-handle:hover,
.news-panel-resize-handle:focus-visible,
.news-panel-resize-handle.is-dragging {
    background: var(--hueso);
    box-shadow: -4px 4px 16px rgba(105, 28, 50, 0.24);
    outline: none;
}

.news-map-panel.is-resizing,
.news-panel-resize-handle.is-dragging {
    transition: none !important;
}

/* =========================================================
   ENCABEZADO DEL PANEL DERECHO
   Se deja sólido para conservar legibilidad institucional.
========================================================= */

.panel-header {
    flex: 0 0 auto;
    min-height: 82px;
    background: var(--texto);
    color: var(--blanco);
    border: none;
    border-left: solid 1px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    box-shadow: none;
}

.panel-title-block {
    flex: 1;
    min-width: 0;
}

.panel-header h1 {
    font-size: 13px;
    margin-bottom: 4px;
}

.panel-header p {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 2px;
}

.panel-header small {
    font-size: 10px;
    color: #f4e7ca;
}

.filter-button,
.refresh-button {
    width: 38px;
    height: 34px;
    border: none;
    border-radius: 7px;
    background: var(--blanco);
    color: var(--guinda);
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
    flex: 0 0 auto;
}

.refresh-button {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.filter-button:hover,
.refresh-button:hover {
    background: var(--hueso);
}

/* =========================================================
   CRITERIOS ACTIVOS
   También recibe un poco de transparencia.
========================================================= */

.criteria-box {
    flex: 0 0 auto;
    padding: 12px;

    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);

    border: none;
    border-bottom: 1px solid rgba(229, 231, 235, 0.65);
    font-size: 12px;
}

.criteria-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.criteria-box-header strong {
    line-height: 1.25;
}

.criteria-toggle-button {
    border: 1px solid rgba(105, 28, 50, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--guinda);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.criteria-toggle-button:hover {
    background: var(--hueso);
}

.criteria-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    overflow: hidden;
    max-height: 170px;
    opacity: 1;
    transition: max-height 0.22s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.criteria-box.criteria-collapsed .criteria-tags {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.criteria-tags span {
    border: 1px solid rgba(105, 28, 50, 0.16);
    background: rgba(255, 255, 255, 0.42);
    color: var(--guinda);
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
}

/* =========================================================
   LISTADO DE NOTICIAS CON SCROLL INTERNO
   CAMBIO IMPORTANTE:
   Este es el rectángulo que pediste con efecto blur tipo iOS.

   Nota:
   - El fondo se vuelve translúcido.
   - Las tarjetas NO cambian; conservan fondo blanco.
========================================================= */

.panel-news-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 18px;

    /*
       Fondo glass / iOS. Ahora sí se nota porque el panel está sobre el mapa.
    */
    background:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.26),
            rgba(255, 255, 255, 0.12) 45%,
            rgba(248, 250, 252, 0.06)
        );

    backdrop-filter: blur(32px) saturate(190%);
    -webkit-backdrop-filter: blur(32px) saturate(190%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 0 42px rgba(255, 255, 255, 0.12);

    scrollbar-width: thin;
    scrollbar-color: rgba(75, 85, 99, 0.75) rgba(255, 255, 255, 0.18);
}

.panel-news-list::-webkit-scrollbar {
    width: 10px;
}

.panel-news-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.18);
}

.panel-news-list::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.70);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.18);
}

/* =========================================================
   TARJETAS DE NOTICIAS
   IMPORTANTE:
   Estas se conservan con fondo sólido para no perder legibilidad.
========================================================= */

.news-map-card {
    position: relative;
    background: var(--blanco);
    border-radius: 12px;
    border: 1px solid rgba(105, 28, 50, 0.12);
    border-left: 5px solid var(--verde-claro);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.12);
    padding: 14px 8px 14px 16px;
    margin-bottom: 10px;

    /*
       ANIMACIÓN DE APARICIÓN:
       Cada tarjeta entra suavemente desde la derecha del panel.
       No modifica el backend ni el flujo de búsqueda; solo afecta la
       presentación visual cuando el JavaScript inserta las tarjetas.
    */
    animation: cardSlideInFromRight 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform, opacity;
}

/*
   Aparición escalonada de tarjetas.
   Esto crea una sensación más natural: no aparecen todas al mismo tiempo.
   Puedes aumentar o reducir los segundos para hacer el efecto más rápido
   o más lento.
*/
.news-map-card:nth-child(1) { animation-delay: 0.03s; }
.news-map-card:nth-child(2) { animation-delay: 0.07s; }
.news-map-card:nth-child(3) { animation-delay: 0.11s; }
.news-map-card:nth-child(4) { animation-delay: 0.15s; }
.news-map-card:nth-child(5) { animation-delay: 0.19s; }
.news-map-card:nth-child(6) { animation-delay: 0.23s; }
.news-map-card:nth-child(7) { animation-delay: 0.27s; }
.news-map-card:nth-child(8) { animation-delay: 0.31s; }
.news-map-card:nth-child(9) { animation-delay: 0.35s; }
.news-map-card:nth-child(10) { animation-delay: 0.39s; }

/*
   Keyframes del efecto.
   from: tarjeta ligeramente a la derecha, más pequeña y transparente.
   to: tarjeta en su posición normal.
*/
@keyframes cardSlideInFromRight {
    from {
        opacity: 0;
        transform: translateX(48px) scale(0.985);
        filter: blur(2px);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/*
   Respeta usuarios que tienen configurado reducir movimiento.
   En esos casos se desactiva la animación para evitar incomodidad visual.
*/
@media (prefers-reduced-motion: reduce) {
    .news-map-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

.news-map-card::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blanco);
    border: 2px solid var(--verde-claro);
}

.news-map-card.riesgo-medio {
    border-left-color: #f97316;
}

.news-map-card.riesgo-medio::before {
    border-color: #f97316;
}

.news-map-card.riesgo-alto,
.news-map-card.riesgo-crítico,
.news-map-card.riesgo-critico {
    border-left-color: #dc2626;
}

.news-map-card.riesgo-alto::before,
.news-map-card.riesgo-crítico::before,
.news-map-card.riesgo-critico::before {
    border-color: #dc2626;
}

.news-map-card h2 {
    font-size: 12px;
    color: var(--guinda);
    margin-bottom: 8px;
    line-height: 1.35;
}

.news-map-card p {
    font-size: 11px;
    line-height: 1.45;
    color: #374151;
}

.news-map-actions {
    display: grid;
    grid-template-columns: 42px 48px;
    justify-content: flex-end;
    align-items: end;
    column-gap: 6px;
    min-height: 47px;
    margin-top: 10px;
}

.news-map-actions a,
.news-map-actions button {
    box-sizing: border-box;
    border: none;
    background: var(--guinda);
    color: var(--blanco);
    text-decoration: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}

.news-map-actions .view-news-button {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 29px;
    min-height: 29px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
}

.news-map-actions a:hover,
.news-map-actions button:hover {
    background: var(--guinda-oscuro);
}

.empty-state,
.loading-state {
    background: rgba(255, 255, 255, 0.56);
    border-radius: 12px;
    border: 1px dashed rgba(105, 28, 50, 0.28);
    padding: 18px;
}

.empty-state h2,
.loading-state h2 {
    color: var(--guinda);
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state p,
.loading-state p {
    color: var(--texto-suave);
    font-size: 13px;
    line-height: 1.5;
}

/* =========================================================
   MODALES SOBRE EL MAPA
   El fondo queda visible con una opacidad ligera.

   Nota:
   Como el panel ahora flota sobre el mapa, el modal mantiene su área
   libre a la izquierda del panel para no cubrir completamente la vista.
========================================================= */

/* =========================================================
   MODAL DE INFORME MÁS CERCA DE LA NAVBAR
   - Antes estaba centrado verticalmente.
   - Ahora aparece un poco más arriba, cerca de la barra superior.
========================================================= */

.map-modal-backdrop {
    position: fixed;
    inset: 64px var(--news-panel-width) 0 0;
    z-index: 1200;
    display: none;

    /* Antes estaba en center; ahora inicia más arriba. */
    align-items: flex-start;
    justify-content: center;

    background: rgba(15, 23, 42, 0.14);

    /*
       Primer valor = separación desde la navbar.
       Si lo quieres más arriba, baja 14px a 8px.
       Si lo quieres más abajo, sube 14px a 24px.
    */
    padding: 14px 24px 24px;
}

.map-modal-backdrop.open {
    display: flex;
}

.report-modal-card,
.filter-modal-card {
    background: rgba(255, 255, 255, 0.44);
    backdrop-filter: blur(28px) saturate(185%);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
    border-radius: 10px;
    border: 1px solid rgba(31, 41, 55, 0.18);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.report-modal-card {
    width: min(760px, 96%);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
}

.filter-modal-card {
    width: min(420px, 96%);
}

.modal-header {
    background: var(--texto);
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.modal-header h2 {
    font-size: 15px;
    color: var(--dorado-oscuro);
}

.modal-header.compact h2 {
    color: var(--blanco);
}

/*
   Encabezado del modal de informe.
   El logo y el botón de cierre quedan en los extremos; el título queda
   centrado para mantener lectura clara sin alterar el resto del modal.
*/
.modal-header.report-title-bar {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
    column-gap: 12px;
    align-items: center;
}

.report-title-bar .report-modal-logo {
    justify-self: start;
    display: flex;
    align-items: center;
    min-width: 0;
}

.report-title-bar .report-modal-logo img {
    width: 122px;
    max-width: 100%;
    height: auto;
    display: block;
}

.report-title-bar h2 {
    justify-self: center;
    margin: 0;
    text-align: center;
    color: var(--dorado-oscuro);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.report-title-bar .modal-close {
    justify-self: end;
}

.modal-close {
    width: 30px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #dc2626;
    color: var(--blanco);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.32);
}

.modal-close:hover {
    background: #991b1b;
}

.report-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.report-title,
.report-date {
    text-align: center;
    color: var(--guinda);
    margin-bottom: 14px;
}

.report-title {
    font-size: 16px;
}

.report-date {
    font-size: 14px;
    font-weight: bold;
}

.report-image-box {
    width: 75%;
    min-height: 180px;
    margin: 0 auto 16px;
    border: 1px solid rgba(31, 41, 55, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    background: rgba(250, 250, 250, 0.42);
    font-size: 13px;
    text-align: center;
}

.report-image-box img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.report-label {
    display: block;
    color: var(--guinda);
    font-weight: bold;
    margin-bottom: 6px;
}

.report-summary {
    width: 100%;
    min-height: 145px;
    resize: vertical;
    padding: 10px;
    border: 1px solid rgba(31, 41, 55, 0.28);
    background: rgba(255, 255, 255, 0.58);
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.45;
}

.report-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
    font-size: 12px;
    color: #374151;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(249, 250, 251, 0.42);
    border-top: 1px solid rgba(31, 41, 55, 0.12);
}

.modal-actions button,
.modal-actions a {
    border: none;
    background: var(--guinda);
    color: var(--blanco);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.modal-actions button:hover,
.modal-actions a:hover {
    background: var(--guinda-oscuro);
}

.modal-actions .secondary {
    background: #6b7280;
}

.modal-actions .secondary:hover {
    background: #4b5563;
}

.source-link.disabled {
    pointer-events: none;
    opacity: 0.55;
}

.filter-form {
    padding: 16px;
}

.filter-form label {
    display: block;
    color: var(--guinda);
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}

.filter-form input,
.filter-form textarea {
    width: 100%;
    border: 1px solid rgba(31, 41, 55, 0.2);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

.filter-note {
    background: #fff7ed;
    border-left: 4px solid var(--dorado);
    padding: 10px;
    color: #374151;
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 4px;
}

/* =========================================================
   PERIODO DE MONITOREO
   Control visible en la barra superior.
   Conserva la lógica existente; este bloque solo mejora ubicación y lectura.
========================================================= */

.monitoring-period-control {
    min-width: 430px;
    max-width: 470px;
    min-height: 48px;
    margin: 0 14px;
    padding: 5px 9px 4px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 9px;
    background: rgba(4, 31, 65, 0.74);
    color: #ffffff;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 9px;
    row-gap: 2px;
    align-items: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.monitoring-period-title-row {
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 9px;
    border-right: 1px solid rgba(255, 255, 255, 0.20);
    white-space: nowrap;
}

.monitoring-period-title-row strong {
    font-size: 8.5px;
    line-height: 1.1;
    letter-spacing: 0.065em;
    max-width: 72px;
    white-space: normal;
}

.monitoring-period-icon {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    border-radius: 3px;
    position: relative;
    flex: 0 0 16px;
}

.monitoring-period-icon::before {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    top: 4px;
    border-top: 1.5px solid rgba(255, 255, 255, 0.92);
}

.monitoring-period-icon::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #d6b36d;
    left: 3px;
    top: 8px;
    box-shadow: 4px 0 #d6b36d, 8px 0 #d6b36d, 0 4px #d6b36d, 4px 4px #d6b36d, 8px 4px #d6b36d;
}

.monitoring-period-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    min-width: 0;
}

.monitoring-period-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: #e5eef8;
    font-size: 8.5px;
    font-weight: 800;
}

.monitoring-period-field input[type="date"] {
    width: 100%;
    min-width: 0;
    height: 25px;
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.96);
    color: #1f2937;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
    font-weight: 700;
    outline: none;
    color-scheme: light;
}

.monitoring-period-field input[type="date"]:focus {
    border-color: #d6b36d;
    box-shadow: 0 0 0 2px rgba(214, 179, 109, 0.18);
}

.monitoring-period-status {
    grid-column: 2;
    min-height: 11px;
    color: #cbd5e1;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitoring-period-status.is-enabled {
    color: #86efac;
}

.monitoring-period-status.is-waiting {
    color: #fde68a;
}

.monitoring-period-status.is-error {
    color: #fecaca;
}

@media (max-width: 1220px) {
    .monitoring-period-control {
        min-width: 330px;
        max-width: 360px;
        margin: 0 8px;
    }

    .monitoring-period-title-row strong {
        display: none;
    }

    .monitoring-period-title-row {
        padding-right: 7px;
    }
}

@media (max-width: 980px) {
    .monitoring-period-control {
        min-width: 270px;
        max-width: 300px;
        padding-left: 7px;
        padding-right: 7px;
    }

    .monitoring-period-status {
        display: none;
    }

    .monitoring-period-control {
        grid-template-rows: auto;
    }

    .monitoring-period-title-row {
        grid-row: 1;
    }

    .monitoring-period-field span {
        display: none;
    }

    .monitoring-period-field {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .monitoring-period-control {
        min-width: 204px;
        max-width: 230px;
        margin: 0 5px;
        column-gap: 5px;
    }

    .monitoring-period-title-row {
        display: none;
    }

    .monitoring-period-dates {
        grid-column: 1 / 3;
        gap: 4px;
    }
}

/* =========================================================
   AJUSTES LEAFLET
========================================================= */

.leaflet-control-zoom,
.leaflet-control-attribution {
    border: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}

.estado-marker {
    font-size: 30px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

/* =========================================================
   RESPONSIVE
   En pantallas pequeñas:
   - El mapa sigue ocupando la pantalla.
   - El panel se coloca sobre la parte inferior del mapa.
========================================================= */

@media (max-width: 980px) {
    .map-topbar {
        height: 58px;
        padding: 0 14px;
    }

    .map-brand img {
        max-width: 142px;
        height: 40px;
    }

    .map-main {
        inset: 58px 0 0 0;
        display: block;
    }

    .map-area {
        position: absolute;
        inset: 0;
    }

    .news-panel-resize-handle {
        display: none;
    }

    .news-map-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        min-width: 0;
        height: 45vh;

        border-radius: 18px 18px 0 0;

        box-shadow:
            0 -10px 34px rgba(15, 23, 42, 0.20),
            inset 0 1px 0 rgba(255, 255, 255, 0.38);
    }

    .map-menu-panel {
        top: 66px;
        left: 12px;
    }

    .map-legend {
        left: 12px;
        bottom: calc(45vh + 12px);
        padding: 10px 14px;
        gap: 10px;
        font-size: 11px;
    }

    .map-modal-backdrop {
        inset: 58px 0 45vh 0;
        padding: 12px;
    }

    .report-modal-card {
        width: 100%;
        max-height: 92vh;
    }

    .report-image-box {
        width: 100%;
    }

    .report-meta {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   INDICADOR DE PROGRESO PARA BÚSQUEDA MULTIFUENTE
   - Aparece mientras se consultan Google Noticias, GDELT y RSS públicos.
   - Solo afecta el estado de carga dentro del panel derecho.
========================================================= */

.loading-state-progress {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loading-state-progress small {
    color: var(--texto-suave);
    font-size: 11px;
    line-height: 1.4;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid rgba(105, 28, 50, 0.16);
    border-top-color: var(--guinda);
    border-right-color: rgba(35, 91, 78, 0.75);
    animation: systemosintSpin 0.85s linear infinite;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.45);
}

@keyframes systemosintSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================================
   BOTÓN DE ACTUALIZACIÓN EN ESTADO DE CARGA
   CORRECCIÓN:
   - Antes el botón de actualizar giraba usando systemosintSpin.
   - Se elimina el giro para que solo se vea deshabilitado/opaco.
   - El círculo de progreso principal SÍ conserva su animación.
========================================================= */

.refresh-button.is-loading {
    opacity: 0.75;
    pointer-events: none;
    cursor: wait;

    /* Evita que el botón de actualizar rote. */
    animation: none !important;
    transform: none !important;
}


/* =========================================================
    NUEVA
   ETIQUETA "NUEVA" EN TARJETAS DEL PANEL
   AJUSTE VISUAL:
   - La etiqueta queda dentro del flujo de la tarjeta, debajo del riesgo.
   - No se posiciona encima de imágenes, botones ni casillas de selección.
   - Solo cambia la ubicación de la etiqueta; no altera la lógica de búsqueda.
========================================================= */

.news-map-card.is-new {
    border-left-color: #1aff00;
    box-shadow:
        0 6px 18px rgba(26, 255, 0, 0.18),
        0 0 0 1px rgba(26, 255, 0, 0.10);
}

.news-map-card.is-new::before {
    border-color: #1aff00;
}

.new-news-row {
    display: flex;
    justify-content: flex-start;
    margin: 7px 0 4px 0;
}

.new-news-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(92, 255, 43, 0.72);
    color: #103b14;
    border: 1px solid rgba(26, 255, 0, 0.96);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.2px;
    box-shadow:
        0 0 12px rgba(92, 255, 43, 0.55),
        0 4px 12px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(5px) saturate(165%);
    -webkit-backdrop-filter: blur(5px) saturate(165%);
}

.new-news-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: #1aff00;
    box-shadow: 0 0 8px rgba(26, 255, 0, 0.85);
}

.news-map-card.is-new .news-map-actions {
    padding-right: 0;
}

@media (max-width: 980px) {
    .new-news-badge {
        min-width: 64px;
        padding: 5px 11px;
        font-size: 10px;
    }
}

/* =========================================================
   ETIQUETA DE ORIGEN DE LA NOTICIA
   - Muestra de qué plataforma se tomó cada resultado.
   - Ejemplos: Google Noticias RSS, GDELT DOC API, El Universal RSS.
========================================================= */

.source-origin-pill {
    display: inline-block;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(97, 18, 50, 0.08);
    color: var(--guinda);
    border: 1px solid rgba(97, 18, 50, 0.14);
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none !important;
    }

    .refresh-button.is-loading {
        animation: none !important;
        transform: none !important;
    }
}


/* =========================================================
   BARRA DE ESTADO DEL MODAL DE INFORME
   Muestra avance visual mientras se carga la imagen y se genera resumen.
   No modifica el backend ni el diseño general del mapa.
========================================================= */

.detail-progress-box {
    width: 75%;
    margin: 0 auto 8px;
    padding: 8px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(105, 28, 50, 0.14);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    max-height: 80px;
    transition:
        opacity 0.28s ease,
        transform 0.28s ease,
        max-height 0.28s ease,
        margin 0.28s ease,
        padding 0.28s ease,
        border-width 0.28s ease;
}

.detail-progress-box.hidden {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
}

.detail-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--guinda);
    font-size: 12px;
    font-weight: bold;
}

.detail-progress-row strong {
    color: var(--verde);
    white-space: nowrap;
}

.detail-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(105, 28, 50, 0.12);
}

.detail-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--guinda), var(--dorado), var(--verde));
    transition: width 0.45s ease;
}

.detail-progress-box.complete .detail-progress-fill {
    background: linear-gradient(90deg, var(--verde-claro), var(--verde));
}

.image-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    color: var(--guinda);
    font-weight: bold;
}

.mini-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(105, 28, 50, 0.15);
    border-top-color: var(--guinda);
    border-right-color: var(--verde);
    animation: systemosintSpin 0.85s linear infinite;
}

@media (max-width: 980px) {
    .detail-progress-box {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-spinner {
        animation: none !important;
    }

    .detail-progress-box,
    .detail-progress-fill {
        transition: none !important;
    }
}


/* =========================================================
   PANEL INFERIOR DE REPORTES
   - Se abre/cierra sin afectar la búsqueda ni el modal.
   - Guarda temporalmente las noticias seleccionadas desde el panel derecho.
========================================================= */


.report-panel-button {
    /*
       Botón + del encabezado retirado visualmente.
       El panel de reportes se controla únicamente con la pestaña inferior
       tipo hamburguesa para evitar dos botones con la misma función.
    */
    display: none !important;
}

/* =========================================================
   BARRA MÓVIL DEL PANEL DE REPORTES
   - La barra oscura queda pegada al panel inferior.
   - Al abrir el panel, la barra sube junto con él.
   - Al cerrar el panel, la barra baja y queda visible al fondo.
   - El icono de hamburguesa se conserva al centro como jaladera.
========================================================= */

.report-drawer-handle {
    position: absolute;
    left: 0;
    right: var(--news-panel-width);
    bottom: 0;
    z-index: 780;

    width: auto;
    height: 34px;
    transform: none;

    border: none;
    border-radius: 0;
    background: var(--texto);
    color: transparent;
    cursor: pointer;
    font-size: 0;
    font-weight: 800;

    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.24);
    transition: bottom 0.22s ease, box-shadow 0.22s ease;
}

.report-drawer-handle::after {
    content: "☰";
    position: absolute;
    left: 50%;
    top: -25px;
    transform: translateX(-50%);

    width: 140px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(31, 41, 55, 0.24);
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.56);
    color: var(--texto);

    font-size: 18px;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.20);
}

.report-drawer-handle:hover::after {
    background: var(--hueso);
}

.report-drawer-handle.is-open {
    bottom: 170px;
}

.report-drawer {
    position: absolute;
    left: 0;
    right: var(--news-panel-width);
    bottom: 0;
    z-index: 740;
    height: 170px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    border-top: 1px solid rgba(31, 41, 55, 0.18);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.22);
    transform: translateY(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
}

.report-drawer.open {
    transform: translateY(0);
}

.report-drawer-header {
    flex: 0 0 auto;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 4px 14px;
    background: rgba(249, 250, 251, 0.76);
    border-bottom: 1px solid rgba(31, 41, 55, 0.14);
}

/* Se ocultan visualmente para mantener el diseño compacto de la imagen.
   El contador se sigue actualizando internamente en JavaScript. */
.report-drawer-header strong,
.report-drawer-header span {
    display: none;
}

.report-generate-all-button,
.report-clear-button {
    min-width: 160px;
    height: 24px;
    border: 1px solid rgba(31, 41, 55, 0.20);
    border-radius: 7px;
    background: linear-gradient(180deg, #f9fafb, #d1d5db);
    color: #111827;
    padding: 3px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.report-clear-button {
    min-width: 92px;
    color: #6f1834;
}

.report-generate-all-button:hover:not(:disabled),
.report-clear-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffffff, #cbd5e1);
}

.report-generate-all-button:disabled,
.report-clear-button:disabled {
    cursor: not-allowed;
    opacity: 0.60;
}

.report-drawer-body {
    flex: 1 1 auto;
    overflow: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid rgba(31, 41, 55, 0.14);
    padding: 6px 8px;
    vertical-align: middle;
}

.report-table th {
    background: rgba(244, 241, 234, 0.58);
    color: var(--guinda);
    font-size: 11px;
    text-align: left;
}

.report-col-number {
    width: 36px;
    text-align: center !important;
}

.report-col-timeline {
    width: 104px;
    text-align: center !important;
}

.report-col-risk {
    width: 74px;
    text-align: center !important;
}

.report-col-view {
    width: 82px;
    text-align: center !important;
}

.report-col-select {
    width: 70px;
    text-align: center !important;
}

.report-title-cell {
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-empty-row td {
    color: var(--texto-suave);
    text-align: center;
    padding: 18px;
}

.report-risk-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    border-radius: 999px;
    padding: 3px 8px;
    color: var(--blanco);
    font-size: 11px;
    line-height: 1.05;
    font-weight: 800;
    background: var(--verde-claro);
}

.report-risk-pill.riesgo-medio {
    background: #f97316;
}

.report-risk-pill.riesgo-alto,
.report-risk-pill.riesgo-crítico,
.report-risk-pill.riesgo-critico {
    background: #dc2626;
}

.report-row-view-button {
    border: none;
    border-radius: 999px;
    background: var(--guinda);
    color: var(--blanco);
    padding: 5px 13px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.report-row-view-button:hover {
    background: var(--guinda-oscuro);
}

.report-row-timeline-button {
    min-width: 56px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(105, 28, 50, 0.20);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--guinda);
    padding: 2px 9px;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.report-row-timeline-button img {
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.report-row-timeline-button:hover:not(:disabled),
.report-row-timeline-button.is-open {
    background: var(--hueso);
    border-color: rgba(105, 28, 50, 0.38);
}

.report-row-timeline-button:disabled {
    cursor: default;
    opacity: 0.46;
}

.report-row-timeline-button.is-loading {
    opacity: 0.72;
}

.report-timeline-loading {
    font-size: 17px;
    line-height: 1;
    animation: reportTimelinePulse 1s ease-in-out infinite;
}

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

.report-timeline-expanded-row td {
    padding: 0 8px 9px !important;
    background: rgba(244, 241, 234, 0.30);
}

.report-timeline-expanded-panel {
    border: 1px solid rgba(105, 28, 50, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
    overflow: hidden;
}

.report-timeline-expanded-panel > header {
    min-height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px 5px 10px;
    background: rgba(105, 28, 50, 0.07);
    border-bottom: 1px solid rgba(105, 28, 50, 0.12);
}

.report-timeline-expanded-panel > header > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.report-timeline-expanded-panel > header img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.report-timeline-expanded-panel > header strong {
    color: var(--guinda);
    font-size: 11px;
}

.report-timeline-expanded-panel > header span {
    color: var(--texto-suave);
    font-size: 10px;
}

.report-timeline-close-button {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--guinda);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

.report-timeline-close-button:hover {
    background: rgba(105, 28, 50, 0.10);
}

.report-timeline-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 5px 8px 7px;
}

.report-timeline-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 5px 2px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.10);
}

.report-timeline-item:last-child {
    border-bottom: none;
}

.report-timeline-number {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(105, 28, 50, 0.10);
    color: var(--guinda);
    font-size: 10px;
    font-weight: 900;
}

.report-timeline-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-timeline-item-body strong {
    overflow: hidden;
    color: #111827;
    font-size: 10.5px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-timeline-item-body small {
    overflow: hidden;
    color: var(--texto-suave);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-timeline-view-button {
    min-width: 42px;
    border: none;
    border-radius: 999px;
    background: var(--guinda);
    color: var(--blanco);
    padding: 4px 9px;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.report-timeline-view-button:hover {
    background: var(--guinda-oscuro);
}

.report-row-checkbox-label,
.report-select-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.report-row-checkbox,
.report-select-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--guinda);
    cursor: pointer;
}

/* Checkbox pequeño dentro de cada tarjeta para agregarla al panel inferior. */
.report-select-card {
    position: absolute;
    right: 10px;
    bottom: 42px;
    z-index: 4;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(105, 28, 50, 0.22);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.16);
}

.report-select-card:hover {
    background: var(--hueso);
}

.report-select-card .report-select-checkbox {
    width: 14px;
    height: 14px;
}

.news-map-card:has(.report-select-checkbox:checked) {
    box-shadow: 0 6px 18px rgba(105, 28, 50, 0.18);
}

@media (max-width: 980px) {
    .report-drawer {
        right: 0;
        height: 180px;
    }

    .report-drawer-handle {
        right: 0;
        bottom: 0;
    }

    .report-drawer-handle.is-open {
        bottom: 180px;
    }

    .report-title-cell {
        white-space: normal;
    }

    .report-col-timeline {
        width: 82px;
    }

    .report-timeline-item-body strong,
    .report-timeline-item-body small {
        white-space: normal;
    }
}


/* =========================================================
   AJUSTES SOLICITADOS - PANEL DE REPORTES DISCRETO
   - Oculta la tarjeta/leyenda inferior del mapa.
   - Hace más discreto el botón Ver del panel de reportes.
   - Hace más discreta la pestaña hamburguesa del panel de reportes.
   Solo afecta la vista /mapa/ y el panel inferior de reportes.
========================================================= */

/* Quita la tarjeta de leyenda: Nueva / Monitoreada / Día anterior. */
.map-legend {
    display: none !important;
}

/* Botón Ver del panel inferior: mismo lenguaje visual del panel de noticias,
   pero más compacto y discreto. */
.report-row-view-button {
    min-width: 46px !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
    background: var(--guinda) !important;
    color: var(--blanco) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    box-shadow: none !important;
}

.report-row-view-button:hover {
    background: var(--guinda-oscuro) !important;
}

/* Se ajusta el ancho de la columna Ver para acompañar el botón más pequeño. */
.report-col-view {
    width: 64px !important;
}

/* Pestaña hamburguesa del panel inferior: más pequeña, más transparente
   y menos invasiva visualmente. */
.report-drawer-handle {
    height: 24px !important;
    background: rgba(31, 41, 55, 0.94) !important;
    box-shadow: 0 -3px 10px rgba(15, 23, 42, 0.16) !important;
}

.report-drawer-handle::after {
    top: -19px !important;
    width: 84px !important;
    height: 20px !important;
    border-radius: 7px 7px 0 0 !important;
    background: rgba(255, 255, 255, 0.80) !important;
    color: rgba(31, 41, 55, 0.82) !important;
    font-size: 13px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12) !important;
}

.report-drawer-handle:hover::after {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--guinda) !important;
}

/* Reduce un poco la altura del encabezado del panel de reportes para que
   el diseño se vea más fino. */
.report-drawer-header {
    height: 30px !important;
    padding: 3px 12px !important;
}

.report-generate-all-button,
.report-clear-button {
    height: 22px !important;
    min-width: 142px !important;
    padding: 2px 12px !important;
    font-size: 11px !important;
}

.report-clear-button {
    min-width: 80px !important;
}

@media (max-width: 980px) {
    .map-legend {
        display: none !important;
    }

    .report-drawer-handle::after {
        width: 78px !important;
        height: 20px !important;
        top: -19px !important;
    }
}


/* =========================================================
   PANEL DE REPORTES ARRASTRABLE
   - La pestaña inferior ahora funciona como manija.
   - Al arrastrarla hacia arriba, el panel crece.
   - Al arrastrarla hacia abajo, el panel reduce su altura mínima.
   - No modifica el mapa, la búsqueda ni el modal de noticias.
========================================================= */

:root {
    --report-drawer-height: 170px;
}

.report-drawer {
    height: var(--report-drawer-height) !important;
}

.report-drawer-handle.is-open {
    bottom: var(--report-drawer-height) !important;
}

.report-drawer-handle {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: ns-resize;
}

.report-drawer-handle::after {
    cursor: ns-resize;
}

.report-drawer-handle.is-dragging,
.report-drawer.is-resizing {
    transition: none !important;
}

.report-drawer-handle.is-dragging::after {
    background: rgba(255, 255, 255, 0.96) !important;
    color: var(--guinda) !important;
    box-shadow: 0 3px 10px rgba(105, 28, 50, 0.20) !important;
}

@media (max-width: 980px) {
    .report-drawer {
        height: var(--report-drawer-height) !important;
    }

    .report-drawer-handle.is-open {
        bottom: var(--report-drawer-height) !important;
    }
}


/* =========================================================
   AJUSTES SOLICITADOS - MODAL CON ANÁLISIS EDITABLE
   - Agrega estilo para encabezados de campo con botón Editar.
   - Mantiene los cuadros bloqueados hasta que el usuario presiona Editar.
   - Mueve la casilla de selección de la tarjeta al área inferior izquierda.
========================================================= */

.report-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 6px;
}

.report-field-header .report-label {
    margin-bottom: 0;
}

.report-analysis-header {
    margin-top: 12px;
}

.report-edit-button {
    border: none;
    border-radius: 999px;
    background: var(--guinda);
    color: var(--blanco);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(105, 28, 50, 0.20);
}

.report-edit-button:hover {
    background: var(--guinda-oscuro);
}

.report-summary[readonly] {
    cursor: default;
}

.report-summary.is-editing {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(105, 28, 50, 0.45);
    box-shadow: 0 0 0 3px rgba(105, 28, 50, 0.08);
}

.report-analysis-box {
    min-height: 120px;
}

/* Casilla de selección de noticias: ahora queda abajo a la izquierda,
   en la zona indicada, sin competir con el botón Ver. */
.report-select-card {
    left: 18px !important;
    right: auto !important;
    bottom: 14px !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 5px !important;
}

.report-select-card .report-select-checkbox {
    width: 13px !important;
    height: 13px !important;
}

.news-map-card {
    padding-bottom: 36px;
}

.news-map-actions {
    margin-top: 8px;
}

@media (max-width: 640px) {
    .modal-header.report-title-bar {
        grid-template-columns: 96px 1fr 34px;
        column-gap: 8px;
    }

    .report-title-bar .report-modal-logo img {
        width: 92px;
    }

    .report-title-bar h2 {
        font-size: 14px;
        line-height: 1.2;
    }
}

/* =========================================================
   ACCESO AL SISTEMA
   El login se pinta encima del mapa para conservar la vista operativa de
   fondo, pero bloquea la interacción hasta que exista una sesión activa.
========================================================= */

.map-shell.auth-locked .map-topbar,
.map-shell.auth-locked .map-main,
.map-shell.auth-locked .map-menu-panel,
.map-shell.auth-locked .map-menu-overlay {
    filter: blur(4px);
    transform: scale(1.01);
    pointer-events: none;
    user-select: none;
}

.system-login-overlay {
    position: absolute;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(248, 250, 252, 0.50);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.system-login-card {
    width: min(390px, calc(100vw - 42px));
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.28);
    border-radius: 6px;
    background: rgba(225, 246, 250, 0.68);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(12px) saturate(118%);
    -webkit-backdrop-filter: blur(12px) saturate(118%);
}

.system-login-card-bar {
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #1f2937;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.system-login-card-bar img {
    width: 94px;
    height: auto;
    display: block;
    object-fit: contain;
}

.system-login-card-body {
    padding: 18px 54px 22px;
    text-align: center;
}

.system-login-emblem {
    width: 142px;
    height: 142px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}

.system-login-card h1 {
    margin: 0;
    color: #10213b;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.05;
}

.system-login-card p {
    margin: 0 0 12px;
    color: #10213b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.15;
}

.system-login-form {
    text-align: left;
}

.system-login-form label {
    display: block;
    margin: 8px 0 4px;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.system-login-form input {
    width: 100%;
    height: 32px;
    border: 1px solid rgba(17, 24, 39, 0.55);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.86);
    color: #111827;
    font-size: 14px;
    padding: 4px 9px;
    outline: none;
}

.system-login-form input:focus {
    border-color: var(--guinda);
    box-shadow: 0 0 0 2px rgba(105, 28, 50, 0.18);
}

.system-login-error {
    margin: 8px 0 0 !important;
    color: #b91c1c !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-align: center;
}

.system-login-form button {
    width: 210px;
    height: 31px;
    display: block;
    margin: 16px auto 0;
    border: none;
    border-radius: 4px;
    background: var(--guinda);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(105, 28, 50, 0.16);
}

.system-login-form button:hover {
    background: var(--guinda-oscuro);
}

.map-menu-logout-form {
    margin: 8px 0 0;
}

.map-menu-logout-form button {
    width: 100%;
    border: none;
    border-radius: 9px;
    background: #1f2937;
    color: var(--blanco);
    cursor: pointer;
    display: block;
    font-size: 13px;
    font-weight: bold;
    padding: 11px 13px;
    text-align: left;
}

.map-menu-logout-form button:hover {
    background: #111827;
}

@media (max-width: 640px) {
    .system-login-card-body {
        padding: 16px 28px 20px;
    }

    .system-login-emblem {
        width: 126px;
        height: 126px;
    }
}

/* =========================================================
   FORMULARIO CONGLOMERADO
   Ajustes aislados: solo afectan al modal de conglomerado y al botón dorado
   del menú. No modifican el mapa ni el panel de noticias.
========================================================= */

.map-menu-gold-button {
    width: calc(100% - 26px);
    margin: 8px 13px 2px;
    padding: 10px 12px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #d6b36d, #bc955c);
    color: #1f2937;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(75, 16, 34, 0.20);
}

.map-menu-gold-button:hover {
    background: linear-gradient(135deg, #e0c07a, #c89f63);
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.conglomerado-modal-card {
    width: min(1140px, 94vw);
    max-height: 92vh;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 239, 0.96));
    border: solid 1px rgba(188, 149, 92, 0.30);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.34);
    display: flex;
    flex-direction: column;
}

.conglomerado-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: solid 1px rgba(188, 149, 92, 0.26);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 238, 229, 0.96));
}

.conglomerado-inputs {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.conglomerado-inputs label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 900;
    color: var(--guinda, #691c32);
    letter-spacing: 0.01em;
}

.conglomerado-inputs input {
    width: 224px;
    padding: 10px 12px;
    border: solid 1px rgba(105, 28, 50, 0.20);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--texto, #1f2937);
    font-weight: 800;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.conglomerado-inputs input:focus {
    outline: none;
    border-color: rgba(105, 28, 50, 0.62);
    box-shadow: 0 0 0 3px rgba(105, 28, 50, 0.12);
    background: #fff;
}

.conglomerado-load-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.conglomerado-load-button-secondary {
    background: linear-gradient(135deg, #8a6f45, #5f4a2b);
}

.conglomerado-load-button,
.conglomerado-actions button {
    border: none;
    border-radius: 999px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--guinda, #691c32), var(--guinda-oscuro, #4b1022));
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(105, 28, 50, 0.23);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.conglomerado-load-button:hover,
.conglomerado-actions button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 14px 28px rgba(105, 28, 50, 0.28);
}

.conglomerado-load-button:disabled,
.conglomerado-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.conglomerado-workspace {
    display: grid;
    grid-template-columns: minmax(450px, 1.12fr) minmax(320px, 0.88fr);
    gap: 16px;
    min-height: 520px;
    overflow: hidden;
    padding: 16px;
    background:
        radial-gradient(circle at top right, rgba(188, 149, 92, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
}

.conglomerado-fields-panel {
    border: solid 1px rgba(148, 163, 184, 0.34);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.80);
    overflow: auto;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.90), 0 8px 22px rgba(15, 23, 42, 0.06);
}

.conglomerado-ambito-section {
    margin-bottom: 16px;
    border: solid 1px rgba(105, 28, 50, 0.16);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.conglomerado-ambito-section:last-child {
    margin-bottom: 0;
}

.conglomerado-ambito-section h2 {
    position: sticky;
    top: -14px;
    z-index: 2;
    margin: 0;
    padding: 11px 15px;
    background: linear-gradient(135deg, rgba(105, 28, 50, 0.98), rgba(126, 39, 62, 0.94));
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.04em;
    border-bottom: solid 1px rgba(255, 255, 255, 0.12);
}

.conglomerado-field-group {
    margin: 10px;
    border: solid 1px rgba(148, 163, 184, 0.30);
    border-radius: 13px;
    min-height: 52px;
    padding: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.conglomerado-field-group.is-disabled {
    opacity: 0.82;
}

.conglomerado-field-group.is-active {
    min-height: 118px;
    border-color: rgba(105, 28, 50, 0.40);
    background: #fff;
    box-shadow: 0 8px 20px rgba(105, 28, 50, 0.08);
}

.conglomerado-field-header {
    display: grid;
    grid-template-columns: 1fr 54px;
    align-items: center;
    min-height: 52px;
    border-bottom: solid 1px rgba(148, 163, 184, 0.20);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 244, 246, 0.96));
}

.conglomerado-field-group.is-active .conglomerado-field-header {
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.98), rgba(255, 255, 255, 0.98));
}

.conglomerado-field-group h3 {
    margin: 0;
    padding: 0 15px;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
}

.conglomerado-field-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 100%;
    cursor: pointer;
    border-left: solid 1px rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.58);
}

.conglomerado-field-checkbox {
    appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: solid 2px rgba(105, 28, 50, 0.38);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.conglomerado-field-checkbox::after {
    content: "✓";
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: scale(0.65);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.conglomerado-field-checkbox:checked {
    background: var(--guinda, #691c32);
    border-color: var(--guinda, #691c32);
    box-shadow: 0 0 0 3px rgba(105, 28, 50, 0.12);
}

.conglomerado-field-checkbox:checked::after {
    opacity: 1;
    transform: scale(1);
}

.conglomerado-drop-zone {
    min-height: 74px;
    margin: 10px;
    padding: 10px;
    border: dashed 1.5px rgba(105, 28, 50, 0.26);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.88);
    transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.conglomerado-field-group.is-disabled .conglomerado-drop-zone {
    display: none;
}

.conglomerado-drop-zone.drag-over {
    border-color: rgba(188, 149, 92, 0.95);
    background: rgba(188, 149, 92, 0.18);
    box-shadow: inset 0 0 0 2px rgba(188, 149, 92, 0.45);
}

.conglomerado-empty {
    margin: 0;
    padding: 12px 10px;
    color: #64748b;
    font-size: 12.5px;
    font-style: italic;
    text-align: center;
}

.conglomerado-field-item {
    display: grid;
    grid-template-columns: 38px 1fr 28px;
    align-items: start;
    gap: 6px;
    margin-bottom: 8px;
    padding: 9px 8px;
    border: solid 1px rgba(188, 149, 92, 0.28);
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 12.5px;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.conglomerado-field-item:last-child {
    margin-bottom: 0;
}

.conglomerado-field-number {
    color: var(--guinda, #691c32);
    font-weight: 900;
}

.conglomerado-field-title {
    line-height: 1.28;
}

.conglomerado-remove-note {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(105, 28, 50, 0.10);
    color: var(--guinda, #691c32);
    font-weight: 900;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.conglomerado-remove-note:hover {
    background: var(--guinda, #691c32);
    color: #fff;
}

.conglomerado-titles-panel {
    border: solid 1px rgba(148, 163, 184, 0.34);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.48);
    padding: 16px;
    overflow: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.90), 0 8px 22px rgba(15, 23, 42, 0.06);
}

.conglomerado-status {
    min-height: 34px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: solid 1px rgba(105, 28, 50, 0.14);
    border-radius: 12px;
    background: rgba(105, 28, 50, 0.06);
    color: var(--guinda, #691c32);
    font-size: 13px;
    font-weight: 900;
}

.conglomerado-titles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.conglomerado-title-button {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 11px 12px;
    border: solid 1px rgba(30, 64, 175, 0.18);
    border-radius: 13px;
    background: linear-gradient(135deg, #7897d4, #5578bd);
    color: #fff;
    font-weight: 900;
    text-align: left;
    cursor: grab;
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.conglomerado-title-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 12px 22px rgba(30, 64, 175, 0.24);
}

.conglomerado-drag-handle {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--guinda, #691c32);
    font-weight: 900;
}

.conglomerado-title-empty {
    padding: 22px 16px;
    border: dashed 1.5px rgba(148, 163, 184, 0.55);
    border-radius: 14px;
    color: #64748b;
    text-align: center;
    background: rgba(248, 250, 252, 0.86);
}

.conglomerado-actions {
    justify-content: flex-end;
    padding: 14px 20px 16px;
    border-top: solid 1px rgba(188, 149, 92, 0.24);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 238, 229, 0.94));
}

@media (max-width: 900px) {
    .conglomerado-modal-card {
        width: min(96vw, 760px);
    }

    .conglomerado-workspace {
        grid-template-columns: 1fr;
        min-height: 420px;
        padding: 12px;
    }

    .conglomerado-fields-panel,
    .conglomerado-titles-panel {
        border-left: solid 1px rgba(148, 163, 184, 0.34);
        border-right: solid 1px rgba(148, 163, 184, 0.34);
    }

    .conglomerado-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .conglomerado-inputs input {
        width: 100%;
    }

    .conglomerado-load-button,
    .conglomerado-actions button {
        width: 100%;
    }
}

/* =========================================================
   CONGLOMERADO COMPACTO
   Ajuste visual aislado: reduce espacios y grosor de controles del modal
   sin cambiar la lógica de búsqueda, extracción ni generación de reportes.
========================================================= */

.conglomerado-modal-card {
    max-height: 90vh;
    border-radius: 15px;
}

.conglomerado-toolbar {
    gap: 12px;
    padding: 10px 16px;
}

.conglomerado-inputs {
    gap: 10px;
}

.conglomerado-inputs label {
    gap: 4px;
    font-size: 11px;
}

.conglomerado-inputs input {
    width: 190px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.conglomerado-load-actions {
    gap: 7px;
}

.conglomerado-load-button,
.conglomerado-actions button {
    padding: 8px 16px;
    font-size: 12px;
    box-shadow: 0 7px 16px rgba(105, 28, 50, 0.20);
}

.conglomerado-workspace {
    gap: 10px;
    min-height: 470px;
    padding: 10px;
}

.conglomerado-fields-panel,
.conglomerado-titles-panel {
    border-radius: 12px;
    padding: 9px;
}

.conglomerado-ambito-section {
    margin-bottom: 10px;
    border-radius: 11px;
}

.conglomerado-ambito-section h2 {
    top: -9px;
    padding: 8px 12px;
    font-size: 13px;
    letter-spacing: 0.035em;
}

.conglomerado-field-group {
    margin: 6px;
    min-height: 40px;
    border-radius: 9px;
}

.conglomerado-field-group.is-active {
    min-height: 88px;
    box-shadow: 0 5px 14px rgba(105, 28, 50, 0.07);
}

.conglomerado-field-header {
    grid-template-columns: 1fr 42px;
    min-height: 40px;
}

.conglomerado-field-group h3 {
    padding: 0 12px;
    font-size: 13px;
}

.conglomerado-field-toggle {
    width: 42px;
}

.conglomerado-field-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
}

.conglomerado-field-checkbox::after {
    font-size: 13px;
}

.conglomerado-drop-zone {
    min-height: 48px;
    margin: 6px;
    padding: 7px;
    border-radius: 8px;
}

.conglomerado-empty {
    padding: 8px 7px;
    font-size: 11.5px;
}

.conglomerado-field-item {
    grid-template-columns: 30px 1fr 24px;
    gap: 5px;
    margin-bottom: 6px;
    padding: 7px;
    border-radius: 8px;
    font-size: 11.5px;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.05);
}

.conglomerado-field-title {
    line-height: 1.22;
}

.conglomerado-remove-note {
    width: 21px;
    height: 21px;
    font-size: 12px;
}

.conglomerado-status {
    min-height: 28px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.conglomerado-titles-list {
    gap: 8px;
}

.conglomerado-title-button {
    grid-template-columns: 26px 1fr;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.16);
}

.conglomerado-title-button:hover {
    box-shadow: 0 8px 17px rgba(30, 64, 175, 0.22);
}

.conglomerado-drag-handle {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

.conglomerado-title-empty {
    padding: 14px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.conglomerado-actions {
    padding: 9px 16px 10px;
}

@media (max-width: 900px) {
    .conglomerado-workspace {
        min-height: 400px;
        padding: 9px;
    }

    .conglomerado-toolbar {
        gap: 9px;
        padding: 9px 12px;
    }

    .conglomerado-fields-panel,
    .conglomerado-titles-panel {
        padding: 8px;
    }
}

/* Botón aislado para desintegrar conglomerados; no afecta otros controles. */
.conglomerado-desintegrar-button {
    background: linear-gradient(135deg, #4f5d75, #2d3748);
}

.conglomerado-desintegrar-button:hover {
    filter: brightness(1.05);
}

/* =========================================================
   MODO ACTIVO
   Estilos aislados para el control táctico de monitoreo automático.
   No modifican el motor de búsqueda ni el panel de conglomerado.
========================================================= */

.active-mode-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    margin-right: auto;
}

.active-mode-button {
    height: 38px;
    min-width: 218px;
    border: 1px solid rgba(252, 211, 77, 0.42);
    border-radius: 9px;
    background:
        linear-gradient(135deg, rgba(88, 28, 45, 0.92), rgba(30, 41, 59, 0.98)),
        radial-gradient(circle at 20% 20%, rgba(252, 211, 77, 0.28), transparent 34%);
    color: #fde68a;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 7px 18px rgba(0, 0, 0, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.active-mode-button:hover {
    transform: translateY(-1px);
    border-color: rgba(252, 211, 77, 0.75);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 9px 22px rgba(0, 0, 0, 0.30);
}

.active-mode-button.is-active {
    background:
        linear-gradient(135deg, rgba(127, 29, 29, 0.98), rgba(76, 5, 25, 0.98)),
        radial-gradient(circle at 18% 20%, rgba(248, 113, 113, 0.36), transparent 36%);
    color: #fff7ed;
    border-color: rgba(248, 113, 113, 0.88);
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.20),
        0 0 20px rgba(248, 113, 113, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.35);
}

.active-mode-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.20);
}

.active-mode-button.is-active .active-mode-led {
    background: #22c55e;
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.20),
        0 0 13px rgba(34, 197, 94, 0.90);
    animation: activeModePulse 1.2s ease-in-out infinite;
}

.active-mode-status {
    max-width: 260px;
    color: #dbeafe;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.92;
}

.active-mode-panel-alert {
    border: 1px solid rgba(248, 113, 113, 0.38);
    border-left: 5px solid #b91c1c;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(127, 29, 29, 0.92), rgba(30, 41, 59, 0.96));
    color: #fff7ed;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.20);
}

.active-mode-panel-alert strong {
    display: block;
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.active-mode-panel-alert span {
    font-size: 11px;
    line-height: 1.35;
    color: #fde68a;
}

.active-mode-map-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(185, 28, 28, 0.94);
    border: 3px solid #fde68a;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    line-height: 24px;
    text-align: center;
    box-shadow: 0 0 0 7px rgba(185, 28, 28, 0.22), 0 8px 18px rgba(0, 0, 0, 0.35);
    animation: activeModePulse 1.1s ease-in-out infinite;
}

@keyframes activeModePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.82;
    }
}

@media (max-width: 980px) {
    .active-mode-control {
        margin-left: 10px;
        gap: 6px;
    }

    .active-mode-button {
        min-width: 118px;
        height: 34px;
        font-size: 10px;
        letter-spacing: 0.05em;
    }

    .active-mode-status {
        display: none;
    }
}


/* Ajuste suave de transparencia solicitado: solo elementos glass/blur. */
.map-layer-control,
.map-legend,
.news-map-panel,
.panel-controls,
.panel-news-list,
.report-modal-card,
.filter-modal-card {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.panel-news-card,
.search-input-group input,
.search-input-group select,
.report-field textarea,
.report-field input,
.modal-actions,
.layer-list,
.layer-item {
    background-color: rgba(255, 255, 255, 0.46);
}

/* =========================================================
   Confirmación de Modo Activo y ocultamiento de capas
   Ajuste aislado: solo afecta la activación/desactivación del
   Modo Activo y la presentación del panel de capas.
========================================================= */

.map-layer-control {
    will-change: opacity, transform, filter;
    transition:
        opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.44s ease,
        visibility 0s linear 0.52s;
}

.map-layer-control.active-mode-minimizing {
    opacity: 0.78;
    transform: translateX(-6px) scale(0.982);
    filter: saturate(92%);
}

.map-layer-control.active-mode-hidden {
    opacity: 0;
    transform: translateX(-34px) scale(0.94);
    filter: blur(2px) saturate(85%);
    pointer-events: none;
    visibility: hidden;
}

.map-layer-control.active-mode-restoring {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: saturate(100%);
}

.map-layer-control:not(.active-mode-hidden) {
    visibility: visible;
    transition-delay: 0s;
}

.active-mode-confirm-backdrop {
    position: fixed;
    inset: 64px 0 0 0;
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(9px) saturate(145%);
    -webkit-backdrop-filter: blur(9px) saturate(145%);
}

.active-mode-confirm-backdrop.open {
    display: flex;
}

.active-mode-confirm-card {
    width: min(430px, 94vw);
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(240, 250, 253, 0.42);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
    color: var(--texto);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
}

.active-mode-confirm-header {
    padding: 16px 20px;
    background: rgba(31, 41, 55, 0.92);
    color: var(--dorado-oscuro);
    text-align: center;
}

.active-mode-confirm-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: var(--dorado-oscuro);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.active-mode-confirm-body {
    padding: 18px 22px 8px;
    font-size: 14px;
    line-height: 1.55;
}

.active-mode-confirm-body p + p {
    margin-top: 10px;
}

.active-mode-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px 20px;
}

.active-mode-confirm-actions button {
    min-width: 104px;
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.active-mode-confirm-cancel {
    background: rgba(255, 255, 255, 0.62);
    color: var(--guinda);
}

.active-mode-confirm-accept {
    background: var(--guinda);
    color: var(--blanco);
}

.active-mode-confirm-actions button:hover {
    transform: translateY(-1px);
}

/* =========================================================
   Modales nuevos de Modo Activo
   - Aviso compacto de nota detectada.
   - Aviso de bloqueo de controles durante monitoreo.
   No alteran el modal manual de detalle ni el extractor.
========================================================= */

.active-mode-detected-card {
    width: min(540px, 94vw);
}

.active-mode-detected-body {
    text-align: center;
    padding: 20px 24px 22px;
}

.active-mode-detected-label {
    margin: 0 0 12px;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.active-mode-detected-title {
    margin: 0 auto 12px;
    max-width: 94%;
    color: var(--guinda);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.32;
    text-align: center;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.34);
}

.active-mode-detected-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    margin: 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(88, 28, 45, 0.10);
    color: var(--guinda-oscuro);
    font-size: 11px;
    font-weight: 900;
}

.active-mode-locked-card {
    width: min(470px, 94vw);
}

.active-mode-locked-body {
    padding-bottom: 4px;
}

.active-mode-locked-body p {
    margin: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.active-mode-locked-body p + p {
    margin-top: 10px;
}

/* =========================================================
   LÍNEA DE TIEMPO DE APARICIONES PREVIAS
   - Se despliega dentro de la tarjeta y empuja las notas inferiores.
   - Solo afecta la vista /mapa/ y no modifica el extractor de imágenes.
========================================================= */

.timeline-button-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    min-height: 47px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.12s ease;
}

.timeline-button-wrap.timeline-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.timeline-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 16px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(105, 28, 50, 0.18);
    color: var(--guinda);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}

.news-map-actions .timeline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    padding: 4px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(105, 28, 50, 0.18);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
    cursor: pointer;
}

.news-map-actions .timeline-button img {
    width: 19px;
    height: 19px;
    object-fit: contain;
    display: block;
}

.news-map-actions .timeline-button.is-loading {
    opacity: 0.62;
    cursor: wait;
}

.news-map-actions .timeline-button:disabled {
    opacity: 0.42;
    cursor: default;
    filter: grayscale(80%);
}

.news-map-actions .timeline-button.has-timeline:not(:disabled) {
    background: #fff7ed;
    border-color: rgba(239, 68, 68, 0.42);
    box-shadow:
        0 0 0 1px rgba(239, 68, 68, 0.12),
        0 3px 8px rgba(127, 29, 29, 0.16);
}

.news-map-actions .timeline-button.has-timeline:not(:disabled):hover {
    background: #fee2e2;
    transform: translateY(-1px);
}

.news-map-card.timeline-open {
    border-left-color: #ef4444;
    box-shadow:
        0 7px 18px rgba(127, 29, 29, 0.15),
        0 0 0 1px rgba(239, 68, 68, 0.10);
}

.timeline-panel {
    position: relative;
    margin: 12px 0 2px 4px;
    padding: 9px 0 0 18px;
    border-left: 2px dashed rgba(239, 68, 68, 0.58);
    animation: timelineDrop 0.24s ease both;
}

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

.timeline-panel::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.timeline-panel-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px 0;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(254, 242, 242, 0.94);
    border: 1px solid rgba(239, 68, 68, 0.16);
}

.timeline-panel-header img {
    width: 19px;
    height: 19px;
    object-fit: contain;
    flex: 0 0 auto;
}

.timeline-panel-header strong {
    display: block;
    color: var(--guinda);
    font-size: 11px;
    line-height: 1.2;
}

.timeline-panel-header span {
    display: block;
    color: #4b5563;
    font-size: 10px;
    line-height: 1.25;
}

.timeline-mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-mini-card {
    position: relative;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    margin-left: -4px;
    padding: 8px 8px 8px 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(105, 28, 50, 0.10);
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.10);
}

.timeline-mini-number {
    width: 25px;
    height: 25px;
    margin-left: -14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.26);
    color: #1f2937;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.timeline-mini-body {
    min-width: 0;
}

.timeline-mini-body h3 {
    margin: 0 0 4px 0;
    color: var(--guinda);
    font-size: 10.5px;
    line-height: 1.25;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.timeline-mini-body p {
    margin: 0;
    color: #4b5563;
    font-size: 10px;
    line-height: 1.25;
}

.timeline-mini-actions {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.timeline-mini-actions a,
.timeline-mini-actions button {
    min-width: 40px;
    border: none;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--guinda);
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 9.5px;
    font-weight: 900;
    cursor: pointer;
}

.timeline-mini-actions a:hover,
.timeline-mini-actions button:hover {
    background: var(--guinda-oscuro);
}

.timeline-empty {
    padding: 9px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px dashed rgba(105, 28, 50, 0.18);
    color: #4b5563;
    font-size: 10.5px;
}

@media (max-width: 980px) {
    .timeline-mini-card {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .timeline-mini-actions {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }
}

/* =========================================================
   AJUSTE PROGRESIVO — PESTAÑAS MÁS PEQUEÑAS Y DISCRETAS
   - No modifica la lógica de apertura, cierre o arrastre.
   - Mantiene intactos el mapa, panel lateral y panel inferior.
========================================================= */

/* Pestaña vertical del panel derecho. */
.news-panel-resize-handle {
    right: calc(var(--news-panel-width) - 6px) !important;
    width: 12px !important;
    height: 56px !important;
    border-color: rgba(105, 28, 50, 0.16) !important;
    border-radius: 6px 0 0 6px !important;
    background: rgba(255, 255, 255, 0.58) !important;
    color: rgba(105, 28, 50, 0.58) !important;
    box-shadow: -1px 2px 5px rgba(15, 23, 42, 0.10) !important;
    opacity: 0.82;
    transition:
        right 0.16s ease,
        background 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        opacity 0.16s ease !important;
}

.news-panel-resize-handle span {
    font-size: 14px !important;
    font-weight: 800 !important;
    transform: scaleX(0.62) !important;
    opacity: 0.82;
}

.news-panel-resize-handle:hover,
.news-panel-resize-handle:focus-visible,
.news-panel-resize-handle.is-dragging {
    background: rgba(255, 255, 255, 0.90) !important;
    color: var(--guinda) !important;
    box-shadow: -2px 2px 7px rgba(105, 28, 50, 0.16) !important;
    opacity: 1;
}

/* Barra y pestaña central del panel inferior. La barra conserva todo su
   ancho para que el arrastre continúe siendo cómodo, pero visualmente se
   presenta como una línea fina. */
.report-drawer-handle {
    height: 7px !important;
    background: rgba(31, 41, 55, 0.74) !important;
    box-shadow: 0 -1px 4px rgba(15, 23, 42, 0.12) !important;
}

.report-drawer-handle::after {
    top: -11px !important;
    width: 54px !important;
    height: 14px !important;
    border-color: rgba(31, 41, 55, 0.15) !important;
    border-radius: 5px 5px 0 0 !important;
    background: rgba(255, 255, 255, 0.64) !important;
    color: rgba(31, 41, 55, 0.66) !important;
    font-size: 9px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.09) !important;
    opacity: 0.88;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        opacity 0.16s ease !important;
}

.report-drawer-handle:hover::after,
.report-drawer-handle:focus-visible::after,
.report-drawer-handle.is-dragging::after {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--guinda) !important;
    box-shadow: 0 2px 6px rgba(105, 28, 50, 0.14) !important;
    opacity: 1;
}

@media (max-width: 980px) {
    .news-panel-resize-handle {
        width: 11px !important;
        height: 50px !important;
        right: calc(var(--news-panel-width) - 5px) !important;
    }

    .report-drawer-handle::after {
        top: -10px !important;
        width: 48px !important;
        height: 13px !important;
        font-size: 8px !important;
    }
}


/* =========================================================
   TARJETAS COMPACTAS - 28/07/2026
   Ajuste exclusivamente visual y progresivo. Conserva selección, línea de
   tiempo, botón Ver, colores de riesgo, animaciones y comportamiento PWA.
========================================================= */
.news-map-card {
    border-radius: 10px;
    border-left-width: 4px;
    padding: 10px 8px 30px 13px;
    margin-bottom: 7px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.10);
}

.news-map-card::before {
    left: -8px;
    width: 8px;
    height: 8px;
}

.news-map-card h2 {
    font-size: 11.5px;
    line-height: 1.28;
    margin: 0 0 5px;
}

.news-map-card p {
    font-size: 10.25px;
    line-height: 1.28;
    margin: 1px 0;
}

.source-origin-pill {
    padding: 2px 6px;
    font-size: 9px;
}

.news-map-actions {
    grid-template-columns: 34px 44px;
    column-gap: 4px;
    min-height: 34px;
    margin-top: 5px;
}

.news-map-actions .view-news-button {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 26px;
    min-height: 26px;
    padding: 0 8px;
    font-size: 9.5px;
}

.report-select-card {
    left: 12px !important;
    bottom: 9px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 4px !important;
}

.report-select-card .report-select-checkbox {
    width: 12px !important;
    height: 12px !important;
}

.timeline-button-wrap {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    min-height: 34px;
    gap: 1px;
}

.timeline-count-badge {
    min-width: 26px;
    min-height: 13px;
    padding: 1px 4px;
    font-size: 8.5px;
}

.news-map-actions .timeline-button {
    width: 25px;
    height: 25px;
    padding: 3px;
    border-radius: 6px;
}

.news-map-actions .timeline-button img {
    width: 16px;
    height: 16px;
}

@media (max-width: 640px) {
    .news-map-card {
        padding: 9px 7px 29px 12px;
        margin-bottom: 6px;
    }

    .news-map-card h2 {
        font-size: 11px;
    }

    .news-map-card p {
        font-size: 10px;
    }
}

/* =========================================================
   VISIBILIDAD DE FUENTES Y TARJETAS MÁS COMPACTAS - 28/07/2026
   Ajuste progresivo: no modifica lógica de selección, riesgo, reportes,
   línea de tiempo, paneles ni comportamiento PWA.
========================================================= */
.search-source-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px 7px;
    background: rgba(255, 255, 255, 0.64);
    border-bottom: 1px solid rgba(105, 28, 50, 0.10);
}

.search-source-summary[hidden] {
    display: none !important;
}

.search-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 2px 6px;
    border: 1px solid rgba(75, 85, 99, 0.16);
    border-radius: 999px;
    background: rgba(243, 244, 246, 0.82);
    color: #4b5563;
    font-size: 8.75px;
    line-height: 1.1;
    white-space: nowrap;
}

.search-source-chip strong {
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.search-source-chip b {
    color: var(--guinda);
    font-size: 9px;
}

.search-source-chip.is-ok {
    border-color: rgba(22, 101, 52, 0.20);
    background: rgba(220, 252, 231, 0.72);
}

.search-source-chip.is-disabled,
.search-source-chip.is-empty {
    opacity: 0.72;
}

.search-source-chip.is-loading {
    border-style: dashed;
}

.news-map-card {
    padding: 8px 7px 27px 12px;
    margin-bottom: 5px;
    border-radius: 9px;
}

.news-map-card h2 {
    font-size: 10.8px;
    line-height: 1.20;
    margin-bottom: 4px;
}

.news-map-card p {
    font-size: 9.6px;
    line-height: 1.18;
    margin: 0;
}

.source-origin-pill {
    padding: 1px 5px;
    font-size: 8.4px;
    line-height: 1.15;
}

.news-map-actions {
    grid-template-columns: 31px 41px;
    min-height: 29px;
    margin-top: 3px;
    column-gap: 3px;
}

.news-map-actions .view-news-button {
    width: 41px;
    min-width: 41px;
    max-width: 41px;
    height: 24px;
    min-height: 24px;
    padding: 0 7px;
    font-size: 9px;
}

.report-select-card {
    left: 10px !important;
    bottom: 7px !important;
    width: 16px !important;
    height: 16px !important;
}

.report-select-card .report-select-checkbox {
    width: 11px !important;
    height: 11px !important;
}

.timeline-button-wrap {
    width: 31px;
    min-width: 31px;
    max-width: 31px;
    min-height: 29px;
}

.timeline-count-badge {
    min-width: 23px;
    min-height: 11px;
    padding: 0 3px;
    font-size: 7.8px;
}

.news-map-actions .timeline-button {
    width: 23px;
    height: 23px;
    padding: 3px;
}

.news-map-actions .timeline-button img {
    width: 14px;
    height: 14px;
}

@media (max-width: 640px) {
    .search-source-summary {
        gap: 3px;
        padding: 4px 6px;
    }

    .search-source-chip {
        padding: 2px 5px;
        font-size: 8.25px;
    }

    .news-map-card {
        padding: 7px 6px 26px 11px;
        margin-bottom: 5px;
    }

    .news-map-card h2 {
        font-size: 10.5px;
    }

    .news-map-card p {
        font-size: 9.35px;
    }
}

.search-source-chip em {
    font-size: 8px;
    font-style: normal;
    font-weight: 600;
    color: #6b7280;
}

/* =========================================================
   AJUSTE VISUAL 13/09/2026
   - Separación superior/inferior del panel derecho.
   - Línea del panel de reportes ligeramente más gruesa.
   - Textura navbarBlue1.png en barras institucionales y
     encabezados de tabla que usan el azul oscuro del sistema.
   Ajuste exclusivamente visual: no modifica lógica ni JavaScript.
========================================================= */

:root {
    --systemosint-blue-texture: url("../img/navbarBlue1.png");
    --systemosint-blue-base: #062f63;
}

/* En escritorio el panel conserva el borde derecho pegado a la ventana,
   pero respira respecto de la navbar y del borde inferior. */
@media (min-width: 981px) {
    .news-map-panel {
        top: 10px;
        bottom: 10px;
    }
}

/* Barras institucionales que antes utilizaban #1f2937 / var(--texto). */
.map-topbar,
.map-layer-header,
.panel-header,
.modal-header,
.active-mode-confirm-header,
.system-login-card-bar {
    background-color: var(--systemosint-blue-base) !important;
    background-image: var(--systemosint-blue-texture) !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
}

/* Encabezado de la tabla del panel de reportes. */
.report-table th {
    background-color: var(--systemosint-blue-base) !important;
    background-image: var(--systemosint-blue-texture) !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
    color: #ffffff !important;
}

/* La barra/jaladera inferior pasa de 7px a 10px: un incremento sutil,
   manteniendo intacto el comportamiento de arrastre. */
.report-drawer-handle {
    height: 10px !important;
    background-color: var(--systemosint-blue-base) !important;
    background-image: var(--systemosint-blue-texture) !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
}


/* =========================================================
   AJUSTE VISUAL 13/09/2026 B
   - El panel derecho vuelve a quedar pegado al borde inferior.
   - Se redondean las esquinas izquierdas del panel de noticias.
   - Se suavizan las puntas del encabezado/control de capas.
   Ajuste solo visual.
========================================================= */

@media (min-width: 981px) {
    .news-map-panel {
        top: 10px !important;
        bottom: 0 !important;
        border-top-left-radius: 12px;
        border-bottom-left-radius: 12px;
    }

    .panel-header {
        border-top-left-radius: 12px;
    }

    .panel-news-list {
        border-bottom-left-radius: 12px;
    }
}

.map-layer-control {
    border-radius: 10px;
}

.map-layer-header {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.map-layer-control:not(.open) .map-layer-header {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}


/* =========================================================
   EXPEDIENTE AUTOMÁTICO POR EVENTO
   Capa visual discreta; no modifica geometría general del panel.
========================================================= */
.event-card-meta {
    display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 1px;
}
.event-card-meta span {
    display: inline-flex; align-items: center; min-height: 18px; padding: 2px 6px;
    border: 1px solid rgba(47,88,129,.16); border-radius: 999px;
    background: rgba(255,255,255,.56); color: #35516c; font-size: 8.5px; font-weight: 700;
}
.event-dossier {
    margin-top: 10px; padding: 10px 11px; border: 1px solid rgba(47,88,129,.14);
    border-radius: 10px; background: rgba(246,249,252,.72);
}
.event-dossier[hidden] { display: none !important; }
.event-dossier-head { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; margin-bottom:8px; }
.event-dossier-head > div:first-child { display:flex; flex-direction:column; gap:2px; }
.event-dossier-head strong { font-size:11px; color:#1f2937; }
.event-dossier-head #modalEventoCodigo { font-size:9px; color:#64748b; }
.event-dossier-badges { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; }
.event-dossier-badges span, .event-official-badge { padding:2px 6px; border-radius:999px; background:rgba(47,88,129,.10); color:#2f5881; font-size:8.5px; font-weight:700; }
.event-dossier-timeline { display:flex; flex-direction:column; gap:5px; margin:6px 0 9px; }
.event-timeline-row { display:grid; grid-template-columns:12px 1fr; gap:5px; }
.event-timeline-dot { width:7px; height:7px; margin-top:4px; border-radius:50%; background:#2f5881; box-shadow:0 0 0 3px rgba(47,88,129,.08); }
.event-timeline-row div { min-width:0; }
.event-timeline-row strong { display:inline; font-size:9px; color:#27384a; }
.event-timeline-row small { margin-left:6px; color:#7a8795; font-size:8px; }
.event-timeline-row p { margin:1px 0 0; font-size:9px; line-height:1.3; color:#596575; }
.event-dossier-sources { border-top:1px solid rgba(31,41,55,.08); padding-top:7px; }
.event-dossier-sources summary { cursor:pointer; color:#2f5881; font-size:9px; font-weight:800; }
.event-source-row { display:flex; justify-content:space-between; gap:8px; align-items:center; padding:5px 0; border-bottom:1px solid rgba(31,41,55,.06); }
.event-source-row > div { min-width:0; display:flex; gap:5px; align-items:center; flex-wrap:wrap; }
.event-source-row strong { font-size:9px; }
.event-source-row small { font-size:8px; color:#7a8795; }
.event-source-row a { color:#2f5881; font-size:8.5px; font-weight:700; text-decoration:none; }


/* =========================================================
   AJUSTE VISUAL MODAL EVENTO 15/09/2026
   - El encabezado dice “Evento”.
   - El título entra directo, sin la etiqueta “Título:”.
   - Se reduce ligeramente la tipografía general del formulario.
   - Se redondean y estilizan los cuadros de texto.
   - El botón "Ver fuente" queda oculto del formulario.
========================================================= */
.report-modal-card {
    width: min(740px, 96%);
    border-radius: 18px;
    overflow: hidden;
}

.report-modal-body {
    padding: 16px 18px 14px;
}

.report-event-title {
    margin: 0 0 8px;
    text-align: left;
    color: var(--guinda);
    font-size: 20px;
    line-height: 1.22;
    font-weight: 800;
}

.report-date {
    text-align: left;
    font-size: 12px;
    margin-bottom: 12px;
    color: #6b7280;
}

.report-image-box {
    width: 72%;
    min-height: 168px;
    margin: 0 auto 14px;
    border-radius: 14px;
    overflow: hidden;
    font-size: 12px;
}

.report-image-box img {
    height: 205px;
}

.report-label {
    font-size: 14px;
    margin-bottom: 5px;
}

.report-edit-button {
    padding: 5px 13px;
    font-size: 11px;
}

.report-summary {
    min-height: 132px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.42;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.report-analysis-box {
    min-height: 108px;
}

.report-meta {
    margin-top: 10px;
    font-size: 11px;
    gap: 8px;
}

.event-dossier {
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 14px;
}

.event-dossier-head strong {
    font-size: 10.5px;
}

.event-dossier-head #modalEventoCodigo {
    font-size: 8.5px;
}

.event-dossier-badges span,
.event-official-badge {
    font-size: 8px;
}

.event-timeline-row strong {
    font-size: 8.5px;
}

.event-timeline-row small {
    font-size: 7.6px;
}

.event-timeline-row p,
.event-dossier-sources summary,
.event-source-row strong,
.event-source-row a {
    font-size: 8.5px;
}

.event-source-row small {
    font-size: 7.5px;
}

.detail-source-link {
    display: none !important;
}

@media (max-width: 640px) {
    .report-modal-body {
        padding: 14px 14px 12px;
    }

    .report-event-title {
        font-size: 17px;
    }

    .report-image-box {
        width: 100%;
    }

    .report-meta {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   BÚSQUEDA MANUAL POR ESTADO + MINIATURA
   La barra reutiliza el lenguaje visual de NOTAS IDENTIFICADAS.
   Solo cambia presentación: se conservan IDs y eventos existentes.
========================================================= */
.keyword-search-control {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 7px 8px;
    padding: 8px 10px 7px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.68);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.keyword-search-title {
    flex: 0 1 96px;
    align-self: center;
    color: var(--guinda);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.035em;
}

.keyword-search-field {
    display: grid;
    flex: 1 1 260px;
    gap: 3px;
    min-width: 0;
}

.keyword-search-field > span {
    color: var(--texto-suave);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.keyword-search-field input {
    width: 100%;
    min-width: 0;
    height: 30px;
    border: 1px solid rgba(105, 28, 50, 0.22);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--texto);
    font-family: inherit;
    font-size: 11px;
    padding: 5px 7px;
    outline: none;
}

.keyword-search-field input:focus {
    border-color: var(--dorado);
    box-shadow: 0 0 0 2px rgba(188, 149, 92, 0.17);
}

.keyword-search-field input::placeholder {
    color: #8a9099;
}

.keyword-search-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.keyword-search-actions button {
    min-height: 30px;
    border: 1px solid rgba(105, 28, 50, 0.24);
    border-radius: 999px;
    background: var(--guinda);
    color: var(--blanco);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
    box-shadow: 0 2px 7px rgba(75, 16, 34, 0.14);
}

.keyword-search-actions button:hover {
    background: var(--guinda-oscuro);
}

.keyword-search-actions .keyword-search-clear {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(105, 28, 50, 0.34);
    color: var(--guinda);
    box-shadow: none;
}

.keyword-search-actions .keyword-search-clear:hover {
    background: rgba(105, 28, 50, 0.08);
}

.keyword-search-actions button:disabled,
.keyword-search-field input:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.keyword-search-control small {
    flex: 1 0 100%;
    min-width: 0;
    min-height: 12px;
    color: var(--texto-suave);
    font-size: 9px;
    line-height: 1.2;
}

#keywordMapStatus:not(:empty) {
    color: var(--dorado);
    font-weight: 800;
}

.news-map-card .news-thumbnail {
    float: left; width: 76px; height: 76px; margin: 0 9px 6px 0;
    border-radius: 7px; object-fit: cover; background: #e7eaef;
}
.news-map-card .news-map-actions { clear: both; }

@media (max-width: 520px) {
    .keyword-search-title {
        flex-basis: 100%;
    }
    .keyword-search-actions {
        flex-wrap: wrap;
    }
    .news-map-card .news-thumbnail { width: 65px; height: 65px; }
}

/* =========================================================
   NOTAS IDENTIFICADAS POR MODO ACTIVO
   Consulta local de registros ya almacenados. Estos controles NO comparten
   IDs, fechas ni eventos con el calendario/buscador del monitoreo principal.
   Se mantiene exclusivamente la paleta visual de SystemOsint.
========================================================= */
.identified-notes-control {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 7px 8px;
    padding: 8px 10px 7px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.68);
    background: rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.identified-notes-title {
    flex: 0 1 84px;
    align-self: center;
    color: var(--guinda);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.035em;
}

.identified-notes-field {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.identified-notes-date {
    flex: 1 1 112px;
}

.identified-notes-keyword {
    flex: 2 1 160px;
}

.identified-notes-field > span {
    color: var(--texto-suave);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.identified-notes-field input {
    width: 100%;
    min-width: 0;
    height: 30px;
    border: 1px solid rgba(105, 28, 50, 0.22);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--texto);
    font-family: inherit;
    font-size: 11px;
    padding: 5px 7px;
    outline: none;
}

.identified-notes-field input:focus {
    border-color: var(--dorado);
    box-shadow: 0 0 0 2px rgba(188, 149, 92, 0.17);
}

.identified-notes-keyword input::placeholder {
    color: #8a9099;
}

.identified-notes-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.identified-notes-actions button {
    min-height: 30px;
    border: 1px solid rgba(105, 28, 50, 0.24);
    border-radius: 999px;
    background: var(--guinda);
    color: var(--blanco);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
    box-shadow: 0 2px 7px rgba(75, 16, 34, 0.14);
}

.identified-notes-actions button:hover {
    background: var(--guinda-oscuro);
}

.identified-notes-actions .identified-notes-clear {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(105, 28, 50, 0.34);
    color: var(--guinda);
    box-shadow: none;
}

.identified-notes-actions .identified-notes-clear:hover {
    background: rgba(105, 28, 50, 0.08);
}

.identified-notes-actions button:disabled {
    opacity: 0.62;
    cursor: wait;
}

.identified-notes-control small {
    flex: 1 0 100%;
    min-width: 0;
    min-height: 12px;
    color: var(--texto-suave);
    font-size: 9px;
    line-height: 1.2;
}

@media (max-width: 520px) {
    .identified-notes-title {
        flex-basis: 100%;
    }

    .identified-notes-actions {
        flex-wrap: wrap;
    }
}

/* =========================================================
   CONTROLES DE BÚSQUEDA PLEGABLES
   Envuelve Búsqueda Manual + Notas Identificadas sin cambiar
   IDs, eventos ni lógica. <details> inicia cerrado por defecto.
========================================================= */
.news-controls-collapsible {
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.68);
    background: transparent;
}

.news-controls-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    background: rgba(255, 255, 255, 0.48);
    color: var(--guinda);
    outline: none;
}

.news-controls-summary::-webkit-details-marker {
    display: none;
}

.news-controls-summary::marker {
    content: "";
}

.news-controls-summary:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(188, 149, 92, 0.48);
}

.news-controls-summary-title {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.035em;
    line-height: 1;
}

.news-controls-summary-help {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--texto-suave);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.15;
}

.news-controls-summary-arrow {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--guinda);
    border-bottom: 2px solid var(--guinda);
    transform: rotate(45deg);
    transition: transform 0.16s ease;
    margin-right: 3px;
}

.news-controls-collapsible[open] .news-controls-summary-arrow {
    transform: rotate(225deg);
}

.news-controls-collapsible-body {
    border-top: 1px solid rgba(229, 231, 235, 0.45);
}

/* Evita doble línea inferior: el contenedor plegable ya delimita el bloque. */
.news-controls-collapsible-body .identified-notes-control {
    border-bottom: 0;
}

@media (max-width: 520px) {
    .news-controls-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .news-controls-summary-help {
        flex-basis: calc(100% - 24px);
    }
}


/* =========================================================
   PLEGADO INDEPENDIENTE DE CADA BARRA
   Cada sección usa <details> nativo y comienza cerrada.
   No agrega JavaScript ni modifica los eventos existentes.
========================================================= */
.news-control-section {
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.60);
    background: rgba(255, 255, 255, 0.24);
}

.news-control-section-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    color: var(--guinda);
    background: rgba(255, 255, 255, 0.34);
    outline: none;
}

.news-control-section-summary::-webkit-details-marker {
    display: none;
}

.news-control-section-summary::marker {
    content: "";
}

.news-control-section-summary:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(188, 149, 92, 0.42);
}

.news-control-section-title {
    flex: 0 0 auto;
    font-size: 9.5px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.035em;
}

.news-control-section-help {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--texto-suave);
    font-size: 8.5px;
    font-weight: 700;
    line-height: 1.15;
}

.news-control-section-arrow {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-right: 3px;
    border-right: 2px solid var(--guinda);
    border-bottom: 2px solid var(--guinda);
    transform: rotate(45deg);
    transition: transform 0.16s ease;
}

.news-control-section[open] > .news-control-section-summary .news-control-section-arrow {
    transform: rotate(225deg);
}

.news-control-section-body {
    border-top: 1px solid rgba(229, 231, 235, 0.42);
}

/* El título pasa al encabezado plegable; se conserva el nodo original para no
   alterar referencias futuras del frontend. */
.news-control-section-body .keyword-search-title,
.news-control-section-body .identified-notes-title {
    display: none;
}

.news-control-section-body .keyword-search-control,
.news-control-section-body .identified-notes-control {
    border-bottom: 0;
}

@media (max-width: 520px) {
    .news-control-section-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .news-control-section-help {
        flex-basis: calc(100% - 22px);
    }
}

/* =========================================================
   ADMINISTRACIÓN DE USUARIOS
   Extensión aislada del menú. Mantiene la paleta de SystemOsint y no
   modifica búsquedas, Modo Activo, tarjetas ni reportes.
========================================================= */

.map-menu-user-summary {
    margin: 10px 0 4px;
    padding: 9px 11px;
    border: 1px solid rgba(105, 28, 50, 0.16);
    border-radius: 9px;
    background: rgba(105, 28, 50, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.map-menu-user-summary span {
    color: var(--guinda);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-menu-user-summary small {
    color: var(--texto-suave);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.map-menu-admin-button {
    width: 100%;
    margin: 5px 0 0;
    padding: 11px 13px;
    border: 1px solid rgba(188, 149, 92, 0.65);
    border-radius: 9px;
    background: var(--guinda);
    color: var(--blanco);
    cursor: pointer;
    display: block;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.map-menu-admin-button:hover {
    background: var(--guinda-oscuro);
}

.users-modal-card {
    width: min(780px, 96%);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(28px) saturate(170%);
    -webkit-backdrop-filter: blur(28px) saturate(170%);
    border: 1px solid rgba(31, 41, 55, 0.18);
    border-radius: 10px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.users-modal-body {
    overflow-y: auto;
    padding: 16px;
}

.users-role-note {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-left: 4px solid var(--dorado);
    border-radius: 6px;
    background: rgba(188, 149, 92, 0.10);
    color: var(--texto-suave);
    font-size: 12px;
    line-height: 1.4;
}

.users-role-note strong {
    color: var(--guinda);
}

.users-panel-message {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
}

.users-panel-message.is-ok {
    border: 1px solid rgba(35, 91, 78, 0.35);
    background: rgba(35, 91, 78, 0.09);
    color: var(--verde);
}

.users-panel-message.is-error {
    border: 1px solid rgba(185, 28, 28, 0.30);
    background: rgba(185, 28, 28, 0.08);
    color: #991b1b;
}

.users-create-section,
.users-list-section {
    border: 1px solid rgba(31, 41, 55, 0.13);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    padding: 13px;
}

.users-list-section {
    margin-top: 14px;
}

.users-create-section h3,
.users-list-section h3 {
    margin: 0;
    color: var(--guinda);
    font-size: 13px;
    font-weight: 900;
}

.users-create-form {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 100px minmax(140px, 1fr) 115px minmax(150px, 1fr);
    gap: 8px 10px;
    align-items: center;
}

.users-create-form label {
    color: var(--texto);
    font-size: 11px;
    font-weight: 800;
}

.users-create-form input,
.users-create-form select {
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 1px solid rgba(31, 41, 55, 0.25);
    border-radius: 6px;
    background: #fff;
    color: var(--texto);
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
}

.users-create-form input:focus,
.users-create-form select:focus {
    border-color: var(--guinda);
    box-shadow: 0 0 0 2px rgba(105, 28, 50, 0.12);
}

.users-create-form button {
    grid-column: 4;
    justify-self: end;
    min-width: 145px;
    height: 34px;
    border: none;
    border-radius: 18px;
    background: var(--guinda);
    color: var(--blanco);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    padding: 0 16px;
}

.users-create-form button:hover {
    background: var(--guinda-oscuro);
}

.users-list-heading {
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.users-list-heading span {
    color: var(--texto-suave);
    font-size: 11px;
    font-weight: 700;
}

.users-table-wrap {
    max-height: 270px;
    overflow: auto;
    border: 1px solid rgba(31, 41, 55, 0.10);
    border-radius: 7px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.84);
    font-size: 12px;
}

.users-table th,
.users-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.09);
    text-align: left;
    vertical-align: middle;
}

.users-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef2f4;
    color: var(--guinda);
    font-size: 11px;
    font-weight: 900;
}

.users-table td strong {
    display: block;
    color: var(--texto);
}

.users-table td small {
    display: block;
    margin-top: 2px;
    color: var(--texto-suave);
}

.users-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(35, 91, 78, 0.10);
    color: var(--verde);
    font-size: 10px;
    font-weight: 900;
}

.users-status-badge.is-inactive {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

@media (max-width: 760px) {
    .users-create-form {
        grid-template-columns: 1fr;
    }

    .users-create-form button {
        grid-column: 1;
        justify-self: stretch;
    }
}

/* =========================================================
   MENÚ Y ADMINISTRACIÓN DE USUARIOS / GRUPOS - V2
   Solo presentación y organización. No altera procesos del mapa.
========================================================= */

.map-menu-section {
    display: block;
}

.map-menu-section + .map-menu-section {
    margin-top: 10px;
}

.map-menu-section-label {
    margin: 0 2px 6px;
    color: var(--texto-suave);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-menu-links {
    display: grid;
    gap: 7px;
}

.map-menu-divider {
    height: 1px;
    margin: 11px 0;
    background: linear-gradient(90deg, transparent, rgba(105, 28, 50, 0.18), transparent);
}

.map-menu-user-summary {
    margin: 0;
}

.map-menu-admin-section {
    margin-top: 10px;
}

.map-menu-admin-button {
    margin-top: 0;
    box-shadow: 0 5px 12px rgba(105, 28, 50, 0.14);
}

.map-menu-logout-form {
    margin: 0;
}

.map-menu-logout-form button {
    border: 1px solid rgba(31, 41, 55, 0.12);
}

.users-modal-card {
    width: min(980px, 97%);
}

.users-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 14px;
    align-items: start;
}

.users-admin-grid .users-create-section {
    height: 100%;
}

.users-create-form-stacked {
    grid-template-columns: 120px minmax(0, 1fr);
}

.users-create-form-stacked button {
    grid-column: 2;
}

.users-group-create-form {
    margin-top: 10px;
}

.users-group-create-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--texto);
    font-size: 11px;
    font-weight: 800;
}

.users-group-create-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.users-group-create-row input {
    min-width: 0;
    height: 34px;
    border: 1px solid rgba(31, 41, 55, 0.25);
    border-radius: 6px;
    background: #fff;
    color: var(--texto);
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
}

.users-group-create-row input:focus {
    border-color: var(--guinda);
    box-shadow: 0 0 0 2px rgba(105, 28, 50, 0.12);
}

.users-group-create-row button {
    min-width: 105px;
    height: 34px;
    border: none;
    border-radius: 17px;
    background: var(--guinda);
    color: var(--blanco);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    padding: 0 14px;
}

.users-group-create-row button:hover {
    background: var(--guinda-oscuro);
}

.users-groups-summary {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.users-group-chip {
    min-width: 118px;
    max-width: 100%;
    padding: 7px 9px;
    border: 1px solid rgba(188, 149, 92, 0.34);
    border-radius: 8px;
    background: rgba(188, 149, 92, 0.09);
}

.users-group-chip span,
.users-group-chip small {
    display: block;
}

.users-group-chip span {
    overflow: hidden;
    color: var(--guinda);
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-group-chip small,
.users-empty-groups {
    margin-top: 2px;
    color: var(--texto-suave);
    font-size: 10px;
    font-weight: 700;
}

.users-list-heading > div {
    min-width: 0;
}

.users-list-heading small {
    display: block;
    margin-top: 2px;
    color: var(--texto-suave);
    font-size: 10px;
    font-weight: 600;
}

.users-table-wrap {
    max-height: 330px;
}

.users-table-editable th:first-child {
    width: 190px;
}

.users-edit-form {
    display: grid;
    grid-template-columns: minmax(145px, 0.9fr) minmax(170px, 1.1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.users-edit-field {
    min-width: 0;
}

.users-edit-field select {
    width: 100%;
    min-width: 0;
    height: 32px;
    border: 1px solid rgba(31, 41, 55, 0.22);
    border-radius: 6px;
    background: #fff;
    color: var(--texto);
    font-size: 11px;
    padding: 4px 7px;
    outline: none;
}

.users-edit-field select:focus {
    border-color: var(--guinda);
    box-shadow: 0 0 0 2px rgba(105, 28, 50, 0.10);
}

.users-edit-field select:disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.users-save-button {
    height: 30px;
    border: 1px solid rgba(105, 28, 50, 0.22);
    border-radius: 15px;
    background: var(--guinda);
    color: #fff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
    padding: 0 12px;
    white-space: nowrap;
}

.users-save-button:hover {
    background: var(--guinda-oscuro);
}

.users-superuser-note {
    color: var(--guinda) !important;
    font-weight: 800 !important;
}

@media (max-width: 820px) {
    .users-admin-grid {
        grid-template-columns: 1fr;
    }

    .users-edit-form {
        grid-template-columns: 1fr 1fr;
    }

    .users-save-button,
    .users-status-badge {
        justify-self: start;
    }
}

@media (max-width: 560px) {
    .users-create-form-stacked,
    .users-group-create-row,
    .users-edit-form {
        grid-template-columns: 1fr;
    }

    .users-create-form-stacked button {
        grid-column: 1;
        justify-self: stretch;
    }

    .users-table-editable th:nth-child(n+2) {
        display: none;
    }

    .users-table-editable td:first-child {
        width: 120px;
    }
}

/* =========================================================
   AJUSTE VISUAL V3 — MENÚ + ADMINISTRACIÓN DE USUARIOS
   Solo presentación. No altera rutas, permisos, formularios ni procesos.
========================================================= */

/* ---------- MENÚ LATERAL ---------- */
.map-menu-panel {
    width: 278px;
    padding: 12px;
    border: 1px solid rgba(105, 28, 50, 0.14);
    border-radius: 16px;
    background: rgba(249, 251, 252, 0.96);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.map-menu-title {
    margin: 0 0 12px;
    padding: 2px 4px 10px;
    border-bottom: 1px solid rgba(105, 28, 50, 0.12);
    color: #172033;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.map-menu-section + .map-menu-section {
    margin-top: 12px;
}

.map-menu-section-label {
    margin: 0 5px 7px;
    color: #7a8595;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.map-menu-links {
    gap: 6px;
}

.map-menu-panel .map-menu-links a {
    position: relative;
    padding: 10px 12px 10px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #273244;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.map-menu-panel .map-menu-links a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 3px;
    background: rgba(105, 28, 50, 0.22);
}

.map-menu-panel .map-menu-links a:hover {
    background: rgba(105, 28, 50, 0.06);
    border-color: rgba(105, 28, 50, 0.10);
    color: var(--guinda);
    transform: translateX(2px);
}

.map-menu-panel .map-menu-links a:hover::before {
    background: var(--guinda);
}

.map-menu-divider {
    height: 1px;
    margin: 12px 3px;
    background: rgba(31, 41, 55, 0.09);
}

.map-menu-user-summary {
    min-height: 46px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid rgba(105, 28, 50, 0.13);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(105, 28, 50, 0.055), rgba(255,255,255,0.78));
    box-shadow: none;
}

.map-menu-user-summary span {
    color: var(--guinda);
    font-size: 12px;
    font-weight: 900;
}

.map-menu-user-summary small {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(105, 28, 50, 0.08);
    color: #667085;
    font-size: 9px;
    font-weight: 800;
}

.map-menu-admin-section {
    margin-top: 12px;
}

.map-menu-admin-button {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid rgba(105, 28, 50, 0.20);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--guinda), var(--guinda-oscuro));
    box-shadow: 0 6px 16px rgba(105, 28, 50, 0.16);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
    text-align: left;
}

.map-menu-admin-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(105, 28, 50, 0.22);
}

.map-menu-logout-form button {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(31, 41, 55, 0.12);
    border-radius: 10px;
    background: #fff;
    color: #364152;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    box-shadow: none;
}

.map-menu-logout-form button:hover {
    border-color: rgba(105, 28, 50, 0.18);
    background: rgba(105, 28, 50, 0.05);
    color: var(--guinda);
}

/* ---------- MODAL DE ADMINISTRACIÓN ---------- */
.users-modal-card {
    width: min(1040px, calc(100% - 34px));
    max-height: calc(100vh - 44px);
    border: 1px solid rgba(17, 43, 70, 0.16);
    border-radius: 16px;
    background: rgba(246, 250, 252, 0.97);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.30);
    overflow: hidden;
}

.users-modal-card > .modal-header {
    min-height: 58px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(90deg, rgba(3, 40, 76, 0.98), rgba(4, 68, 116, 0.96));
}

.users-modal-card > .modal-header h2 {
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.users-modal-card > .modal-header .modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.10);
    color: #fff;
}

.users-modal-card > .modal-header .modal-close:hover {
    background: rgba(185, 28, 28, 0.92);
}

.users-modal-body {
    padding: 16px;
    background: linear-gradient(180deg, #f8fafb 0%, #eef5f7 100%);
}

.users-role-note {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(188, 149, 92, 0.22);
    border-left: 4px solid var(--dorado);
    border-radius: 9px;
    background: rgba(255,255,255,0.76);
    color: #5f6b7a;
    font-size: 11px;
    line-height: 1.45;
}

.users-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 14px;
    align-items: stretch;
}

.users-create-section,
.users-list-section {
    border: 1px solid rgba(17, 43, 70, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055);
}

.users-create-section {
    padding: 15px;
}

.users-create-section h3,
.users-list-section h3 {
    color: var(--guinda);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.users-create-form-stacked {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 9px 12px;
    align-items: center;
}

.users-create-form-stacked label,
.users-group-create-form label {
    color: #344054;
    font-size: 10px;
    font-weight: 900;
}

.users-create-form-stacked input,
.users-create-form-stacked select,
.users-group-create-row input,
.users-edit-field select {
    height: 36px;
    border: 1px solid #ccd5df;
    border-radius: 8px;
    background: #fff;
    color: #263244;
    font-size: 11px;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.users-create-form-stacked input:focus,
.users-create-form-stacked select:focus,
.users-group-create-row input:focus,
.users-edit-field select:focus {
    border-color: rgba(105, 28, 50, 0.55);
    box-shadow: 0 0 0 3px rgba(105, 28, 50, 0.08);
}

.users-create-form-stacked button {
    grid-column: 2;
    justify-self: end;
    min-width: 142px;
    height: 36px;
    border-radius: 18px;
    box-shadow: 0 5px 12px rgba(105, 28, 50, 0.14);
}

.users-group-create-form {
    margin-top: 12px;
}

.users-group-create-row {
    gap: 8px;
}

.users-group-create-row button {
    min-width: 100px;
    height: 36px;
    border-radius: 18px;
    box-shadow: 0 5px 12px rgba(105, 28, 50, 0.12);
}

.users-groups-summary {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.users-group-chip {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(188, 149, 92, 0.26);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(188,149,92,0.09), rgba(255,255,255,0.72));
}

.users-group-chip span {
    display: block;
    overflow: hidden;
    color: #4f3b24;
    font-size: 10px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-group-chip small {
    display: block;
    margin-top: 2px;
    color: #7a6d5e;
    font-size: 9px;
}

.users-empty-groups {
    grid-column: 1 / -1;
    padding: 14px 10px;
    border: 1px dashed rgba(31, 41, 55, 0.15);
    border-radius: 9px;
    color: #7a8595;
    font-size: 10px;
    text-align: center;
}

/* ---------- LISTADO DE USUARIOS COMO TARJETAS ---------- */
.users-list-section {
    margin-top: 14px;
    padding: 14px;
}

.users-list-heading {
    margin-bottom: 10px;
    padding: 0 2px;
}

.users-list-heading small {
    display: block;
    margin-top: 3px;
    color: #7b8797;
    font-size: 10px;
}

.users-list-heading > span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(3, 40, 76, 0.07);
    color: #43556b;
    font-size: 9px;
    font-weight: 900;
}

.users-table-wrap {
    max-height: 350px;
    padding: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.users-table,
.users-table tbody {
    display: block;
    width: 100%;
    background: transparent;
}

.users-table thead {
    display: none;
}

.users-table tbody {
    display: grid;
    gap: 8px;
}

.users-table tbody tr {
    display: grid;
    grid-template-columns: minmax(130px, 0.55fr) minmax(0, 2.45fr);
    gap: 12px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid rgba(17, 43, 70, 0.10);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.users-table tbody tr:hover {
    border-color: rgba(105, 28, 50, 0.17);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.055);
}

.users-table tbody td {
    display: block;
    padding: 0;
    border: 0;
}

.users-table tbody td:first-child {
    min-width: 0;
}

.users-table tbody td:first-child strong {
    overflow: hidden;
    color: #263244;
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-table tbody td:first-child small {
    margin-top: 3px;
    color: #7b8797;
    font-size: 9px;
}

.users-edit-form {
    display: grid;
    grid-template-columns: minmax(130px, .9fr) minmax(145px, 1.1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.users-edit-field {
    position: relative;
    min-width: 0;
    padding-top: 14px;
}

.users-edit-field::before {
    position: absolute;
    top: 0;
    left: 2px;
    color: #7b8797;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.users-edit-field:nth-of-type(1)::before {
    content: "Nivel";
}

.users-edit-field:nth-of-type(2)::before {
    content: "Grupo de trabajo";
}

.users-edit-field select {
    width: 100%;
    min-width: 0;
    height: 33px;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 10px;
}

.users-status-badge {
    min-height: 25px;
    margin-bottom: 4px;
    padding: 4px 9px;
    border: 1px solid rgba(35, 91, 78, 0.13);
    background: rgba(35, 91, 78, 0.08);
    font-size: 9px;
}

.users-save-button {
    min-width: 74px;
    height: 31px;
    margin-bottom: 1px;
    border-radius: 16px;
    box-shadow: none;
    font-size: 9px;
}

.users-table-wrap::-webkit-scrollbar,
.users-modal-body::-webkit-scrollbar {
    width: 8px;
}

.users-table-wrap::-webkit-scrollbar-thumb,
.users-modal-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(71, 85, 105, 0.34);
    background-clip: padding-box;
}

@media (max-width: 860px) {
    .users-modal-card {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }

    .users-admin-grid {
        grid-template-columns: 1fr;
    }

    .users-table tbody tr {
        grid-template-columns: 1fr;
    }

    .users-edit-form {
        grid-template-columns: 1fr 1fr auto auto;
    }
}

@media (max-width: 620px) {
    .map-menu-panel {
        width: min(286px, calc(100vw - 24px));
        left: 12px;
    }

    .users-modal-body {
        padding: 10px;
    }

    .users-create-form-stacked,
    .users-group-create-row,
    .users-edit-form {
        grid-template-columns: 1fr;
    }

    .users-create-form-stacked label {
        margin-top: 2px;
    }

    .users-create-form-stacked button {
        grid-column: 1;
        justify-self: stretch;
    }

    .users-groups-summary {
        grid-template-columns: 1fr;
    }

    .users-status-badge,
    .users-save-button {
        justify-self: start;
        margin-bottom: 0;
    }
}

/* ==========================================================
   ADMINISTRACIÓN DE USUARIOS — REDISEÑO V4
   Roles y grupos separados, grupos con divulgación progresiva.
   ========================================================== */
.users-management-grid {
    display: grid;
    grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.18fr);
    gap: 14px;
    align-items: start;
}

.users-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.users-section-heading h3 {
    margin: 0 0 3px;
}

.users-section-heading small {
    display: block;
    color: #687386;
    font-size: 11px;
    line-height: 1.35;
}

.users-section-heading-with-action {
    align-items: center;
}

.users-create-form-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.users-form-field {
    min-width: 0;
}

.users-form-field-wide,
.users-form-actions {
    grid-column: 1 / -1;
}

.users-create-form-compact label {
    display: block;
    margin: 0 0 5px;
    color: #26364b;
    font-size: 11px;
    font-weight: 800;
}

.users-create-form-compact input,
.users-create-form-compact select,
.users-group-create-inline input,
.workgroup-add-member-form select,
.users-compact-role select {
    width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    border: 1px solid #c9d4df;
    border-radius: 9px;
    background: #fff;
    color: #223044;
    padding: 7px 10px;
    font: inherit;
    outline: none;
}

.users-create-form-compact input:focus,
.users-create-form-compact select:focus,
.users-group-create-inline input:focus,
.workgroup-add-member-form select:focus,
.users-compact-role select:focus {
    border-color: var(--guinda);
    box-shadow: 0 0 0 2px rgba(105, 28, 50, .10);
}

.users-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

.users-form-actions button,
.users-group-create-inline button,
.workgroup-add-member-form button,
.users-save-button {
    min-height: 34px;
    border: 0;
    border-radius: 18px;
    background: var(--guinda);
    color: #fff;
    padding: 7px 16px;
    font-weight: 800;
    cursor: pointer;
}

.users-form-actions button:hover,
.users-group-create-inline button:hover,
.workgroup-add-member-form button:hover,
.users-save-button:hover {
    background: var(--guinda-oscuro);
}

.users-group-create-inline {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 8px;
    width: min(320px, 100%);
}

.workgroups-list {
    display: grid;
    gap: 8px;
}

.workgroup-card {
    border: 1px solid #d9e1e8;
    border-radius: 11px;
    background: #fff;
    overflow: hidden;
}

.workgroup-card > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}

.workgroup-card > summary::-webkit-details-marker,
.workgroup-add-member > summary::-webkit-details-marker {
    display: none;
}

.workgroup-card > summary:hover {
    background: #f7f9fb;
}

.workgroup-card[open] > summary {
    border-bottom: 1px solid #e4e9ee;
    background: #f8fafb;
}

.workgroup-summary-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.workgroup-summary-main > span:last-child {
    min-width: 0;
}

.workgroup-summary-main strong,
.workgroup-summary-main small {
    display: block;
}

.workgroup-summary-main strong {
    color: #26364b;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workgroup-summary-main small {
    margin-top: 2px;
    color: #748094;
    font-size: 10px;
}

.workgroup-avatar,
.users-compact-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(105, 28, 50, .09);
    color: var(--guinda);
    font-weight: 900;
    font-size: 12px;
}

.workgroup-summary-action {
    position: relative;
    flex: 0 0 auto;
    padding-right: 18px;
    color: var(--guinda);
    font-size: 10px;
    font-weight: 800;
}

.workgroup-summary-action::after {
    content: "⌄";
    position: absolute;
    right: 0;
    top: -2px;
    font-size: 15px;
    line-height: 1;
    transition: transform .18s ease;
}

.workgroup-card[open] .workgroup-summary-action::after {
    transform: rotate(180deg);
}

.workgroup-panel {
    padding: 10px 12px 12px;
}

.workgroup-members {
    display: grid;
    gap: 6px;
}

.workgroup-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f7f9fb;
}

.workgroup-member-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.workgroup-member-identity strong,
.workgroup-member-identity small {
    display: block;
}

.workgroup-member-identity strong {
    color: #26364b;
    font-size: 11px;
}

.workgroup-member-identity small {
    color: #778396;
    font-size: 9px;
}

.workgroup-member-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e8b68;
    box-shadow: 0 0 0 3px rgba(46, 139, 104, .11);
}

.workgroup-member-dot.is-inactive {
    background: #9aa4b0;
    box-shadow: none;
}

.workgroup-remove-button {
    border: 1px solid rgba(105, 28, 50, .22);
    border-radius: 14px;
    background: #fff;
    color: var(--guinda);
    padding: 4px 10px;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.workgroup-remove-button:hover {
    background: #fff5f7;
}

.workgroup-empty-members {
    padding: 10px;
    border: 1px dashed #d5dde6;
    border-radius: 8px;
    color: #7a8595;
    text-align: center;
    font-size: 10px;
}

.workgroup-add-member {
    margin-top: 9px;
    border-top: 1px solid #edf0f3;
    padding-top: 8px;
}

.workgroup-add-member > summary {
    list-style: none;
    width: fit-content;
    cursor: pointer;
    color: var(--guinda);
    font-size: 10px;
    font-weight: 900;
}

.workgroup-add-member-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.workgroup-add-member-form p {
    grid-column: 1 / -1;
    margin: 0;
    color: #778396;
    font-size: 10px;
}

.users-empty-groups-redesigned {
    display: grid;
    gap: 2px;
    padding: 18px 12px;
}

.users-empty-groups-redesigned strong {
    color: #3a4658;
}

.users-empty-groups-redesigned span {
    color: #8290a0;
    font-size: 10px;
}

.users-list-section-compact {
    margin-top: 14px;
}

.users-compact-list {
    display: grid;
    gap: 6px;
}

.users-compact-row {
    display: grid;
    grid-template-columns: minmax(140px, .9fr) minmax(150px, .9fr) minmax(130px, .8fr) auto auto;
    gap: 10px;
    align-items: center;
    min-height: 52px;
    padding: 7px 10px;
    border: 1px solid #dfe5eb;
    border-radius: 10px;
    background: #fff;
}

.users-compact-row:hover {
    border-color: #cfd7df;
    background: #fbfcfd;
}

.users-compact-identity {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.users-compact-identity > span:last-child {
    min-width: 0;
}

.users-compact-identity strong,
.users-compact-identity small {
    display: block;
}

.users-compact-identity strong {
    color: #26364b;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-compact-identity small {
    margin-top: 2px;
    color: #7a8595;
    font-size: 9px;
}

.users-compact-role label,
.users-compact-group > span {
    display: block;
    margin-bottom: 3px;
    color: #7b8797;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.users-compact-role select {
    min-height: 32px;
    padding-block: 5px;
    font-size: 10px;
}

.users-compact-group {
    min-width: 0;
}

.users-compact-group strong {
    display: block;
    color: #3f4b5c;
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-compact-row .users-status-badge {
    margin: 0;
    white-space: nowrap;
}

.users-compact-row .users-save-button {
    margin: 0;
    min-height: 30px;
    padding: 6px 12px;
    white-space: nowrap;
    font-size: 9px;
}

@media (max-width: 1050px) {
    .users-management-grid {
        grid-template-columns: 1fr;
    }

    .users-compact-row {
        grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) auto;
    }

    .users-compact-row .users-save-button {
        grid-column: 4;
    }
}

@media (max-width: 720px) {
    .users-section-heading-with-action,
    .users-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .users-group-create-inline,
    .users-create-form-compact,
    .workgroup-add-member-form,
    .users-compact-row {
        grid-template-columns: 1fr;
    }

    .users-form-field-wide,
    .users-form-actions {
        grid-column: auto;
    }

    .users-form-actions button,
    .users-group-create-inline button,
    .workgroup-add-member-form button,
    .users-compact-row .users-save-button {
        width: 100%;
        grid-column: auto;
    }

    .workgroup-summary-action {
        font-size: 0;
    }

    .workgroup-summary-action::after {
        font-size: 16px;
    }
}

/* =========================================================
   AJUSTE VISUAL V4 — MENÚ MÁS MINIMALISTA
   Solo presentación del menú lateral.
========================================================= */
.map-menu-panel {
    width: 272px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(252, 253, 255, 0.98);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
}

.map-menu-title {
    margin: 0 0 10px;
    padding: 0 2px 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    color: #162133;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.map-menu-divider {
    height: 1px;
    margin: 10px 2px;
    background: rgba(15, 23, 42, 0.07);
}

.map-menu-section + .map-menu-section,
.map-menu-admin-section {
    margin-top: 10px;
}

.map-menu-section-label {
    margin: 0 2px 6px;
    color: #8b95a7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.map-menu-links {
    display: grid;
    gap: 8px;
}

.map-menu-panel .map-menu-links a {
    padding: 11px 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #ffffff;
    color: #233044;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none;
    transform: none;
}

.map-menu-panel .map-menu-links a::before {
    display: none;
}

.map-menu-panel .map-menu-links a:hover {
    background: #f8fafc;
    border-color: rgba(105, 28, 50, 0.18);
    color: var(--guinda);
    transform: none;
}

.map-menu-user-summary {
    min-height: 0;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
}

.map-menu-user-summary span {
    color: #243041;
    font-size: 13px;
    font-weight: 800;
}

.map-menu-user-summary small {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(105, 28, 50, 0.08);
    color: var(--guinda);
    font-size: 10px;
    font-weight: 700;
}

.map-menu-admin-button,
.map-menu-logout-form button {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none;
    text-align: left;
}

.map-menu-admin-button {
    border: 1px solid rgba(105, 28, 50, 0.18);
    background: #ffffff;
    color: var(--guinda);
}

.map-menu-admin-button:hover {
    background: rgba(105, 28, 50, 0.05);
    border-color: rgba(105, 28, 50, 0.24);
    transform: none;
    box-shadow: none;
}

.map-menu-logout-form button {
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #ffffff;
    color: #223045;
}

.map-menu-logout-form button:hover {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.18);
    color: #111827;
}

/* =========================================================
   AJUSTE VISUAL V5 — MENÚ ULTRA MINIMALISTA
   Lista de navegación sin apariencia de botones/tarjetas.
========================================================= */
.map-menu-panel {
    width: 258px;
    padding: 12px 14px 14px;
    border: 0;
    border-radius: 14px;
    background: rgba(252, 253, 255, 0.985);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.map-menu-title {
    margin: 0 0 8px;
    padding: 0 0 9px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    color: #182233;
    font-size: 14px;
    font-weight: 800;
}

.map-menu-section + .map-menu-section,
.map-menu-admin-section {
    margin-top: 9px;
}

.map-menu-section-label {
    margin: 0 0 3px;
    color: #98a1b1;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.map-menu-links {
    display: block;
}

.map-menu-panel .map-menu-links a {
    display: block;
    margin: 0;
    padding: 8px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #273347;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    box-shadow: none;
    transform: none;
}

.map-menu-panel .map-menu-links a::before {
    display: none;
}

.map-menu-panel .map-menu-links a:hover,
.map-menu-panel .map-menu-links a:focus-visible {
    background: rgba(15, 23, 42, 0.035);
    color: var(--guinda);
    transform: none;
}

.map-menu-divider {
    height: 1px;
    margin: 8px 0;
    background: rgba(15, 23, 42, 0.07);
}

.map-menu-user-summary {
    min-height: 0;
    margin: 0;
    padding: 7px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.map-menu-user-summary span {
    color: #263246;
    font-size: 13px;
    font-weight: 750;
}

.map-menu-user-summary small {
    padding: 2px 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(105, 28, 50, 0.065);
    color: var(--guinda);
    font-size: 9px;
    font-weight: 700;
}

.map-menu-admin-section {
    margin-top: 8px;
}

.map-menu-admin-button,
.map-menu-logout-form button {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 8px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    text-align: left;
    transform: none;
}

.map-menu-admin-button {
    color: var(--guinda);
    font-weight: 750;
}

.map-menu-admin-button:hover,
.map-menu-admin-button:focus-visible {
    background: rgba(105, 28, 50, 0.045);
    box-shadow: none;
    transform: none;
}

.map-menu-logout-form button {
    color: #5f6877;
}

.map-menu-logout-form button:hover,
.map-menu-logout-form button:focus-visible {
    background: rgba(15, 23, 42, 0.035);
    color: #1f2937;
}


/* =========================================================
   AJUSTE 07/10/2026 — PERIODO DE BÚSQUEDA Y ESPACIADOS
   Solo presentación; la lógica de rango está en mapa_noticias.js.
========================================================= */
.monitoring-period-control {
    min-height: 44px;
    padding-top: 5px;
    padding-bottom: 5px;
    grid-template-rows: auto;
}

.monitoring-period-title-row {
    grid-row: 1;
}

/* El texto de estado/programación ya no forma parte del selector. */
.monitoring-period-status {
    display: none !important;
}

/* Mantiene el control centrado y con un poco más de aire bajo él. */
.monitoring-period-topbar {
    transform: translateY(-1px);
}

/* Reduce la brecha entre navbar y panel de notas sin pegarlos. */
@media (min-width: 981px) {
    .news-map-panel {
        top: 4px !important;
    }

    /* El modal de usuarios conserva margen visible respecto al borde inferior. */
    .users-modal-card {
        max-height: calc(100vh - 106px);
        margin-bottom: 14px;
    }
}


/* =========================================================
   AJUSTE 07/10/2026 — HOMOLOGACIÓN DE CONTROLES
   Solo presentación. No modifica lógica, eventos ni endpoints.
========================================================= */

/* Administración: tipografía uniforme en controles nativos. */
.users-modal-card input,
.users-modal-card select,
.users-modal-card select option,
.users-modal-card button {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 12px !important;
}

/* Conserva una altura compacta aunque la fuente se normalice a 12 px. */
.users-create-form-compact input,
.users-create-form-compact select,
.users-group-create-inline input,
.workgroup-add-member-form select,
.users-compact-role select {
    line-height: 1.2;
}

/* El icono se retiró de la plantilla; se compacta su antigua separación. */
.monitoring-period-title-row {
    gap: 0 !important;
    padding-left: 0 !important;
}

/* Barra/jaladera inferior ligeramente más gruesa para mejorar visibilidad. */
.report-drawer-handle {
    height: 14px !important;
}

/* =========================================================
   AJUSTE VISUAL V6 — MENÚ COMPACTO Y CROMÁTICAMENTE UNIFORME
   Mantiene la jerarquía funcional sin apariencia de botones.
========================================================= */
.map-menu-panel {
    width: 250px;
    padding: 11px 13px 12px;
}

.map-menu-title {
    margin-bottom: 6px;
    padding-bottom: 7px;
    color: #273347;
    font-size: 14px;
    font-weight: 800;
}

.map-menu-section + .map-menu-section,
.map-menu-admin-section {
    margin-top: 5px;
}

.map-menu-section-label {
    margin: 0 0 1px;
    color: #273347;
    opacity: .52;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .09em;
}

.map-menu-panel .map-menu-links a,
.map-menu-admin-button,
.map-menu-logout-form button {
    padding: 5px 4px;
    color: #273347;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.22;
}

.map-menu-panel .map-menu-links a:hover,
.map-menu-panel .map-menu-links a:focus-visible,
.map-menu-admin-button:hover,
.map-menu-admin-button:focus-visible,
.map-menu-logout-form button:hover,
.map-menu-logout-form button:focus-visible {
    background: rgba(39, 51, 71, 0.045);
    color: #273347;
}

.map-menu-divider {
    margin: 5px 0;
    background: rgba(39, 51, 71, 0.08);
}

.map-menu-user-summary {
    padding: 5px 4px;
}

.map-menu-user-summary span {
    color: #273347;
    font-size: 12px;
    font-weight: 700;
}

.map-menu-user-summary small {
    padding: 1px 5px;
    background: rgba(39, 51, 71, 0.06);
    color: #273347;
    font-size: 8.5px;
    font-weight: 650;
}

.map-menu-admin-section {
    margin-top: 4px;
}

.map-menu-admin-button {
    color: #273347;
    font-weight: 650;
}

.map-menu-logout-form button {
    color: #273347;
}

/* =========================================================
   AJUSTE VISUAL V7 — PALETA TIPOGRÁFICA GLOBAL + CONTROLES AZULES
   Objetivo: interfaz más sobria, técnica y consistente.
   Solo presentación. No modifica lógica, eventos ni endpoints.
========================================================= */
:root {
    --osint-text-primary: #203247;
    --osint-text-secondary: #53677b;
    --osint-text-muted: #7a8b9c;
    --osint-blue-900: #173a55;
    --osint-blue-700: #2e6388;
    --osint-blue-500: #5f96b5;
    --osint-blue-layer-1: rgba(194, 225, 240, 0.58);
    --osint-blue-layer-2: rgba(211, 235, 247, 0.46);
    --osint-blue-layer-3: rgba(228, 244, 251, 0.34);
    --osint-blue-border: rgba(54, 103, 134, 0.18);
    --osint-blue-border-strong: rgba(54, 103, 134, 0.28);

    /* Sustituye únicamente los tonos generales de texto. */
    --texto: var(--osint-text-primary);
    --texto-suave: var(--osint-text-secondary);
}

body,
input,
select,
textarea,
button {
    font-family: Arial, Helvetica, sans-serif;
}

body {
    color: var(--osint-text-primary);
}

/* Textos auxiliares globales: mismo matiz gris-azulado. */
small,
.help-text,
.form-help,
.form-hint {
    color: var(--osint-text-secondary);
}

/* -------- Controles plegables del panel de noticias -------- */
.news-controls-collapsible {
    border-bottom-color: var(--osint-blue-border);
    background: rgba(230, 244, 251, 0.18);
}

.news-controls-summary {
    min-height: 32px;
    background: var(--osint-blue-layer-1);
    color: var(--osint-blue-900);
    border-bottom: 1px solid var(--osint-blue-border);
}

.news-controls-summary-title {
    color: var(--osint-blue-900);
    font-weight: 800;
    letter-spacing: 0.025em;
}

.news-controls-summary-help {
    color: var(--osint-text-secondary);
    font-weight: 600;
}

.news-controls-summary-arrow {
    border-right-color: var(--osint-blue-700);
    border-bottom-color: var(--osint-blue-700);
}

.news-controls-summary:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(46, 99, 136, 0.28);
}

.news-controls-collapsible-body {
    border-top-color: var(--osint-blue-border);
    background: rgba(239, 248, 252, 0.18);
}

.news-control-section {
    border-bottom-color: var(--osint-blue-border);
    background: transparent;
}

.news-control-section-summary {
    min-height: 30px;
    background: var(--osint-blue-layer-2);
    color: var(--osint-blue-900);
}

.news-control-section:nth-of-type(even) > .news-control-section-summary {
    background: var(--osint-blue-layer-3);
}

.news-control-section-title {
    color: var(--osint-blue-900);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.news-control-section-help {
    color: var(--osint-text-secondary);
    font-weight: 600;
}

.news-control-section-arrow {
    border-right-color: var(--osint-blue-700);
    border-bottom-color: var(--osint-blue-700);
}

.news-control-section-summary:hover {
    background: rgba(193, 224, 239, 0.64);
}

.news-control-section-summary:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(46, 99, 136, 0.24);
}

.news-control-section-body {
    border-top-color: var(--osint-blue-border);
    background: rgba(239, 248, 252, 0.24);
}

/* Barras desplegadas: azul muy suave, sin competir con las tarjetas. */
.keyword-search-control,
.identified-notes-control {
    background: rgba(229, 243, 250, 0.48);
    border-bottom-color: var(--osint-blue-border);
}

.keyword-search-title,
.identified-notes-title,
.keyword-search-field > span,
.identified-notes-field > span {
    color: var(--osint-blue-900);
}

.keyword-search-field input,
.identified-notes-field input {
    border-color: var(--osint-blue-border-strong);
    color: var(--osint-text-primary);
    background: rgba(255, 255, 255, 0.90);
}

.keyword-search-field input:focus,
.identified-notes-field input:focus {
    border-color: var(--osint-blue-700);
    box-shadow: 0 0 0 2px rgba(46, 99, 136, 0.13);
}

.keyword-search-field input::placeholder,
.identified-notes-keyword input::placeholder {
    color: var(--osint-text-muted);
}

/* Texto general del panel derecho y administración: coherencia tipográfica. */
.news-map-panel,
.users-modal-card,
.map-menu-panel {
    color: var(--osint-text-primary);
}

.users-modal-card label,
.users-modal-card .users-form-label,
.users-modal-card .users-compact-label,
.map-menu-title,
.map-menu-panel .map-menu-links a,
.map-menu-user-summary span,
.map-menu-admin-button,
.map-menu-logout-form button {
    color: var(--osint-text-primary);
}

.users-modal-card small,
.users-modal-card .users-form-help,
.users-modal-card .users-compact-meta,
.map-menu-section-label,
.map-menu-user-summary small {
    color: var(--osint-text-secondary);
}

/* Mantiene los colores semánticos existentes de riesgo/estado y los botones
   primarios; el cambio afecta la paleta textual, no su significado. */

/* =========================================================
   HERRAMIENTAS DE BÚSQUEDA — DRAWER LATERAL IZQUIERDO
   Mueve los formularios fuera del panel derecho sin cambiar su lógica.
========================================================= */
.news-panel-search-tools {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    padding: 6px 10px 5px;
    background: rgba(236, 246, 251, 0.62);
    border-bottom: 1px solid rgba(118, 158, 185, 0.18);
}

.news-search-drawer-button {
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid rgba(72, 110, 138, 0.20);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--osint-blue-900, #173a57);
    font: 700 12px Arial, Helvetica, sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.07);
}

.news-search-drawer-button:hover,
.news-search-drawer-button:focus-visible {
    background: rgba(225, 241, 249, 0.96);
    border-color: rgba(46, 99, 136, 0.34);
    outline: none;
}

.search-tools-drawer {
    position: absolute;
    z-index: 1060;
    top: 64px;
    bottom: 0;
    left: 0;
    width: min(390px, calc(100vw - 56px));
    background: rgba(247, 251, 253, 0.97);
    border-right: 1px solid rgba(72, 110, 138, 0.18);
    box-shadow: 16px 0 38px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
    transform: translateX(-102%);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .18s ease;
    display: flex;
    flex-direction: column;
}

.search-tools-drawer.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.search-tools-drawer-header {
    flex: 0 0 auto;
    min-height: 64px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(72, 110, 138, 0.15);
    background: rgba(229, 243, 250, 0.76);
}

.search-tools-drawer-header > div {
    min-width: 0;
}

.search-tools-drawer-header strong {
    display: block;
    color: var(--osint-blue-900, #173a57);
    font: 800 15px Arial, Helvetica, sans-serif;
    margin-bottom: 2px;
}

.search-tools-drawer-header small {
    display: block;
    color: var(--osint-text-secondary, #5f7181);
    font: 400 11px Arial, Helvetica, sans-serif;
    line-height: 1.3;
}

.search-tools-drawer-close {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 1px solid rgba(72, 110, 138, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.84);
    color: var(--osint-blue-900, #173a57);
    font: 400 22px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
}

.search-tools-drawer-close:hover,
.search-tools-drawer-close:focus-visible {
    background: #fff;
    outline: none;
}

.search-tools-drawer-body {
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
}

.search-tools-section {
    padding: 14px;
    border: 1px solid rgba(72, 110, 138, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
}

.search-tools-section + .search-tools-section {
    margin-top: 12px;
}

.search-tools-section-heading {
    margin-bottom: 12px;
}

.search-tools-section-heading strong {
    display: block;
    color: var(--osint-blue-900, #173a57);
    font: 800 12px Arial, Helvetica, sans-serif;
    margin-bottom: 3px;
}

.search-tools-section-heading small {
    display: block;
    color: var(--osint-text-secondary, #5f7181);
    font: 400 11px Arial, Helvetica, sans-serif;
    line-height: 1.35;
}

.search-tools-drawer .keyword-search-control,
.search-tools-drawer .identified-notes-control {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
}

.search-tools-drawer .keyword-search-title,
.search-tools-drawer .identified-notes-title {
    display: none;
}

.search-tools-drawer .keyword-search-field,
.search-tools-drawer .identified-notes-field {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.search-tools-drawer .keyword-search-field > span,
.search-tools-drawer .identified-notes-field > span {
    color: var(--osint-blue-900, #173a57);
    font: 700 11px Arial, Helvetica, sans-serif;
}

.search-tools-drawer .keyword-search-field input,
.search-tools-drawer .identified-notes-field input {
    width: 100%;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid rgba(72, 110, 138, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--osint-text-primary, #203142);
    font: 400 12px Arial, Helvetica, sans-serif;
    padding: 7px 10px;
}

.identified-notes-dates-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.search-tools-drawer .keyword-search-actions,
.search-tools-drawer .identified-notes-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.search-tools-drawer .keyword-search-actions button,
.search-tools-drawer .identified-notes-actions button {
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font: 700 12px Arial, Helvetica, sans-serif;
}

.search-tools-drawer #keywordSearchHelp,
.search-tools-drawer #keywordMapStatus,
.search-tools-drawer #identifiedNotesStatus {
    color: var(--osint-text-secondary, #5f7181);
    font: 400 10.5px Arial, Helvetica, sans-serif;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .search-tools-drawer {
        width: calc(100vw - 24px);
    }

    .identified-notes-dates-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   AJUSTE FINAL — PANEL CONTEXTUAL DE BÚSQUEDA
   Se posiciona junto al panel de noticias, no desde el borde izquierdo.
   Solo presentación; conserva IDs, eventos y lógica existentes.
========================================================= */
.search-tools-drawer {
    top: 74px;
    bottom: auto;
    left: auto;
    right: calc(var(--news-panel-width) + 10px);
    width: 320px;
    max-height: calc(100vh - 88px);
    border: 1px solid rgba(72, 110, 138, 0.16);
    border-radius: 14px;
    background: rgba(247, 251, 253, 0.94);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    transform: translateX(12px) scale(0.985);
    transform-origin: right top;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: transform .18s ease, opacity .16s ease;
}

.search-tools-drawer.open {
    transform: translateX(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.search-tools-drawer-header {
    min-height: 54px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(72, 110, 138, 0.12);
    background: rgba(229, 243, 250, 0.68);
}

.search-tools-drawer-header strong {
    font-size: 14px;
}

.search-tools-drawer-header small {
    font-size: 10.5px;
}

.search-tools-drawer-close {
    width: 30px;
    height: 30px;
    font-size: 20px;
}

.search-tools-drawer-body {
    padding: 10px;
    max-height: calc(100vh - 144px);
    overflow-y: auto;
}

.search-tools-section {
    padding: 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
}

.search-tools-section + .search-tools-section {
    margin-top: 9px;
}

.search-tools-section-heading {
    margin-bottom: 9px;
}

.search-tools-section-heading strong {
    font-size: 12px;
}

.search-tools-section-heading small {
    font-size: 10px;
}

.search-tools-drawer .keyword-search-control,
.search-tools-drawer .identified-notes-control {
    gap: 8px;
}

.search-tools-drawer .keyword-search-field input,
.search-tools-drawer .identified-notes-field input {
    min-height: 34px;
}

.search-tools-drawer .keyword-search-actions button,
.search-tools-drawer .identified-notes-actions button {
    min-height: 30px;
    padding: 5px 11px;
}

/* Cuando el ancho disponible entre mapa y panel derecho se vuelve reducido,
   el formulario se adapta sin invadir el panel de notas. */
@media (max-width: 860px) {
    .search-tools-drawer {
        left: 12px;
        right: calc(var(--news-panel-width) + 8px);
        width: auto;
        min-width: 280px;
    }
}

@media (max-width: 700px) {
    .search-tools-drawer {
        left: 12px;
        right: 12px;
        width: auto;
        min-width: 0;
        max-height: calc(100vh - 88px);
    }
}


/* =========================================================
   AJUSTE VISUAL V10 — PERIODO LIMPIO + BOTONES SOBRIOS
   Solo presentación. No modifica lógica ni eventos.
========================================================= */
.monitoring-period-control,
.monitoring-period-topbar {
    background: linear-gradient(135deg, rgba(25, 63, 76, 0.86), rgba(31, 74, 86, 0.72));
    border-color: rgba(176, 210, 217, 0.30);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 3px 10px rgba(5, 24, 39, 0.10);
}

.monitoring-period-title-row {
    gap: 0;
    padding-right: 10px;
    border-right-color: rgba(210, 229, 234, 0.18);
}

.monitoring-period-title-row strong {
    max-width: 78px;
    color: rgba(248, 251, 252, 0.95);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.035em;
}

/* El icono fue retirado de la plantilla; esta regla protege ante caché vieja. */
.monitoring-period-icon {
    display: none !important;
}

.monitoring-period-field {
    color: rgba(241, 247, 249, 0.92);
    font-size: 9px;
    font-weight: 400;
}

.monitoring-period-field input[type="date"] {
    border-color: rgba(189, 214, 221, 0.52);
    background: rgba(250, 252, 252, 0.96);
    color: #263943;
    font-size: 10px;
    font-weight: 400;
}

.monitoring-period-field input[type="date"]:focus {
    border-color: rgba(115, 165, 177, 0.90);
    box-shadow: 0 0 0 2px rgba(115, 165, 177, 0.18);
}

/* Botones de texto: tamaño uniforme y sin negritas. */
button:not(.map-menu-button):not(.map-menu-overlay):not(.modal-close):not(.search-tools-drawer-close):not(.risk-wheel-segment):not(.risk-wheel-center):not(.report-drawer-handle):not(.refresh-button):not(.filter-button) {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
}

/* Controles de formulario: tipografía limpia y consistente. */
input,
select,
textarea,
option {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 400;
}

/* Acciones del drawer: sin apariencia pesada. */
.search-tools-drawer .keyword-search-actions button,
.search-tools-drawer .identified-notes-actions button {
    font: 400 12px Arial, Helvetica, sans-serif !important;
}

/* Administración: botones y selects sobrios. */
.users-modal-card button:not(.modal-close),
.users-modal-card select,
.users-modal-card input {
    font-weight: 400 !important;
}

/* =========================================================
   AJUSTE 19/10/2026 — COMPACTACIÓN GENERAL DE INTERFAZ
   Objetivo:
   - Apariencia aproximada al zoom 90–92 % con navegador al 100 %.
   - Mantener legibilidad.
   - No modificar Leaflet, JavaScript ni lógica del sistema.
   - Aplicar únicamente en escritorio.
========================================================= */

@media (min-width: 1200px) {

    /* IMPORTANTE: no redefinir --news-panel-width dentro de .map-shell.
       El ancho del panel derecho se controla dinámicamente desde JavaScript. */

    /* =====================================================
       BARRA SUPERIOR
    ====================================================== */
    .map-topbar {
        min-height: 58px;
        padding: 5px 12px;
        gap: 10px;
    }

    .map-menu-button {
        width: 34px;
        height: 34px;
        font-size: 19px;
    }

    .map-brand img {
        max-height: 38px;
        width: auto;
    }


    /* =====================================================
       PERIODO DE BÚSQUEDA
    ====================================================== */
    .monitoring-period-control,
    .monitoring-period-topbar {
        min-height: 42px;
        padding: 5px 8px;
        gap: 8px;
        border-radius: 9px;
    }

    .monitoring-period-title-row {
        padding-right: 8px;
    }

    .monitoring-period-title-row strong {
        max-width: 70px;
        font-size: 8.5px;
        line-height: 1.15;
    }

    .monitoring-period-dates {
        gap: 7px;
    }

    .monitoring-period-field {
        gap: 2px;
        font-size: 8.5px;
    }

    .monitoring-period-field input[type="date"] {
        min-height: 27px;
        height: 27px;
        padding: 2px 6px;
        font-size: 9.5px;
        border-radius: 6px;
    }


    /* =====================================================
       MODO ACTIVO
    ====================================================== */
    .active-mode-control {
        gap: 5px;
    }

    .active-mode-button {
        min-height: 31px;
        padding: 5px 10px !important;
        font-size: 11px !important;
        border-radius: 8px;
    }

    .active-mode-led {
        width: 8px;
        height: 8px;
    }

    .active-mode-status {
        font-size: 9.5px;
    }


    /* =====================================================
       PANEL DE CAPAS
    ====================================================== */
    .map-layer-control {
        width: 168px;
        border-radius: 10px;
    }

    .map-layer-header {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .map-layer-toggle {
        width: 25px;
        height: 25px;
        min-height: 25px;
        padding: 0 !important;
        font-size: 15px !important;
    }

    .map-layer-body {
        padding: 7px 9px 9px;
    }

    .map-layer-section-title {
        font-size: 9.5px;
        line-height: 1.2;
    }

    .map-layer-section-title-spaced {
        margin-top: 8px;
        margin-bottom: 5px;
    }

    .map-layer-option {
        min-height: 24px;
        gap: 6px;
        font-size: 10.5px;
        line-height: 1.2;
    }

    .map-layer-option input {
        transform: scale(.88);
        transform-origin: center;
    }

    .map-layer-icon {
        transform: scale(.9);
        transform-origin: center;
    }



    /* =====================================================
       LEYENDA DEL MAPA
    ====================================================== */
    .map-legend {
        padding: 5px 8px;
        gap: 8px;
        font-size: 9.5px;
        border-radius: 8px;
    }

    .legend-dot {
        width: 8px;
        height: 8px;
    }


    /* =====================================================
       PANEL DERECHO DE NOTICIAS
    ====================================================== */
    .news-map-panel {
        font-size: 12px;
    }

    .panel-header {
        min-height: 58px;
        padding: 8px 10px;
        gap: 8px;
    }

    .panel-title-block h1 {
        margin: 0 0 2px;
        font-size: 14px;
        line-height: 1.2;
    }

    .panel-title-block p {
        margin: 1px 0;
        font-size: 10.5px;
    }

    .panel-title-block small {
        font-size: 9.5px;
    }

    .filter-button,
    .refresh-button {
        width: 29px;
        height: 29px;
        min-height: 29px;
        padding: 0;
    }


    /* =====================================================
       BOTÓN BÚSQUEDA DEL PANEL DERECHO
    ====================================================== */
    .news-panel-search-tools {
        padding: 6px 9px;
    }

    .news-search-drawer-button {
        min-height: 29px;
        padding: 4px 10px !important;
        font-size: 10.5px !important;
        border-radius: 7px;
    }


    /* =====================================================
       CRITERIOS ACTIVOS
    ====================================================== */
    .criteria-box {
        margin: 6px 8px;
        padding: 7px 8px;
        border-radius: 8px;
    }

    .criteria-box-header {
        gap: 6px;
    }

    .criteria-box-header strong {
        font-size: 10.5px;
        line-height: 1.25;
    }

    .criteria-toggle-button {
        min-height: 26px;
        padding: 3px 8px !important;
        font-size: 10px !important;
    }

    .criteria-tags {
        gap: 4px;
        margin-top: 6px;
    }

    .criteria-tags span {
        padding: 3px 7px;
        font-size: 9.5px;
        line-height: 1.2;
    }


    /* =====================================================
       LISTADO Y TARJETAS DE NOTICIAS
    ====================================================== */
    .panel-news-list {
        padding: 7px;
        gap: 7px;
    }

    .panel-news-list > article {
        padding: 9px 10px;
        margin-bottom: 7px;
        border-radius: 9px;
    }

    .panel-news-list article h2,
    .panel-news-list article h3 {
        margin-top: 0;
        margin-bottom: 5px;
        font-size: 12px;
        line-height: 1.28;
    }

    .panel-news-list article p {
        margin: 4px 0;
        font-size: 10.5px;
        line-height: 1.35;
    }

    .panel-news-list article small {
        font-size: 9.5px;
        line-height: 1.3;
    }

    .empty-state {
        padding: 14px !important;
    }

    .empty-state h2 {
        font-size: 14px !important;
    }


    /* =====================================================
       DRAWER DE BÚSQUEDA
    ====================================================== */
    .search-tools-drawer {
        top: 64px;
        right: calc(var(--news-panel-width) + 8px);
        width: 292px;
        max-height: calc(100vh - 76px);
        border-radius: 12px;
    }

    .search-tools-drawer-header {
        min-height: 47px;
        padding: 8px 10px;
    }

    .search-tools-drawer-header strong {
        font-size: 12.5px;
    }

    .search-tools-drawer-header small {
        font-size: 9.5px;
    }

    .search-tools-drawer-close {
        width: 27px;
        height: 27px;
        font-size: 18px;
    }

    .search-tools-drawer-body {
        padding: 8px;
        max-height: calc(100vh - 126px);
    }

    .search-tools-section {
        padding: 9px;
        border-radius: 8px;
    }

    .search-tools-section + .search-tools-section {
        margin-top: 7px;
    }

    .search-tools-section-heading {
        margin-bottom: 7px;
    }

    .search-tools-section-heading strong {
        font-size: 11px;
    }

    .search-tools-section-heading small {
        font-size: 9.5px;
    }

    .search-tools-drawer .keyword-search-control,
    .search-tools-drawer .identified-notes-control {
        gap: 6px;
    }

    .search-tools-drawer .keyword-search-field input,
    .search-tools-drawer .identified-notes-field input {
        min-height: 30px;
        height: 30px;
        font-size: 10.5px;
    }

    .search-tools-drawer .keyword-search-actions button,
    .search-tools-drawer .identified-notes-actions button {
        min-height: 27px;
        padding: 4px 9px !important;
        font-size: 10.5px !important;
    }


    /* =====================================================
       CONTROLES DE TEXTO GENERALES DE ESTA PANTALLA
    ====================================================== */
    .news-map-panel button:not(.refresh-button):not(.filter-button),
    .map-layer-control button:not(.risk-wheel-segment):not(.risk-wheel-center) {
        font-size: 10.5px !important;
    }
    
    /* Posición estable del control de nivel de riesgo */
    .risk-thermometer-control {
        top: auto;
        bottom: 48px;
    }
}