/* =====================================
   🎨 Colores institucionales
   ===================================== */
:root {
  --rojo-msi: #d33f35;
  --rojo-hover: #b32d26;
  --gris-fondo: #f4f5f7;
  --gris-borde: #ddd;
  --gris-texto: #444;
  --blanco: #ffffff;
}

/* =====================================
   🔧 Reset global
   ===================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, sans-serif;
}

html, body {
  height: 100%;
  overflow: auto; /* 🚫 sin scroll global */
}

body {
  background: var(--gris-fondo);
  color: var(--gris-texto);
  display: flex;
  flex-direction: column;
}

/* =====================================
   🧭 Navbar
   ===================================== */
.navbar {
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-borde);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  height: 60px;
}

.navbar h1 {
  font-size: 1.5rem;
  font-weight: 650;
  font-style: italic;
  color: rgb(100, 100, 100);
  text-align: center;
  flex: 1;
}

/* =====================================
   🎛️ Botones
   ===================================== */
.btn {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  padding: 0.45rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #f0f0f0;
}

.btn.active {
  background: var(--rojo-msi);
  border-color: var(--rojo-msi);
  color: var(--blanco);
}

.btn.full {
  width: 100%;
  margin-top: 0.8rem;
  background: var(--rojo-msi);
  color: var(--blanco);
  border: none;
}

.btn.full:hover {
  background: var(--rojo-hover);
}

/* =====================================
   📦 Contenedor principal y sidebar
   ===================================== */
.container {
  flex: 1;
  display: flex;
  height: calc(100vh - 60px); /* altura total menos navbar */
  overflow: hidden; /* 🚫 nada de scroll aquí */
}

.sidebar {
  width: 280px;
  background: var(--gris-fondo);
  padding: 1rem;
  border-right: 1px solid var(--gris-borde);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  justify-content: space-between; /* reparte verticalmente */
}

/* =====================================
   🗂️ Paneles
   ===================================== */
.panel {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  flex-shrink: 0; /* evita que se deformen */
}

.panel h2 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gris-texto);
}

.panel input[type="date"],
.panel input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  margin: 0.6rem 0;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.panel input:focus {
  border-color: var(--rojo-msi);
  outline: none;
}

.check {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Mini botones turnos */
.turno-buttons {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.mini-btn {
  border: 1px solid var(--gris-borde);
  background: var(--blanco);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.mini-btn:hover {
  background: #f2f2f2;
}

.mini-btn.active {
  background: var(--rojo-msi);
  color: var(--blanco);
  border-color: var(--rojo-msi);
}

/* Botones de Reportes */
.report-btn {
  display: block;
  width: 100%;
  margin: 0.4rem 0;
  background: var(--blanco);
  border: 1px solid var(--rojo-msi);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.report-btn:hover {
  background: #fff5f5;
}

/* =====================================
   🗺️ Área principal y mapa
   ===================================== */
.main-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#map {
  flex: 1;
  min-height: 0; /* ⚡ asegura que no empuje */
  background: #efefef;
  border: 1px solid var(--gris-borde);
  border-radius: 12px;
}

/* =====================================
   📊 Leyenda SERENOS POR SECTOR
   ===================================== */
.sector-legend {
  position: absolute;
  z-index: 500;
  top: 78px;
  left: 62%;
  transform: translateX(-50%);
  font-family: inherit;
}

.sector-legend .card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  min-width: 320px; 
}

.sector-legend .title {
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 0.4rem;
  color: #374151;
  letter-spacing: 0.03em;
}

.sector-legend .chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.5rem 0.8rem; 
}

.sector-legend .chip {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f9fafb;
  color: #374151;
}

.sector-legend .dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}

.sector-legend .val {
  font-weight: 700;
  color: #111827;
}

/* =====================================
   🧩 Animaciones de paneles
   ===================================== */
.fade-panel {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.fade-panel.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.fade-panel.hide {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* =====================================
   🏢 Panel de LOCALES
   ===================================== */
#panel-locales {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#panel-locales h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  margin-bottom: 0.6rem;
  color: var(--gris-texto);
}

#panel-locales .count-locales {
  font-weight: bold;
  color: var(--rojo-msi);
}

/* Filtros */
#panel-locales label {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.2rem;
  display: block;
}

#panel-locales select,
#panel-locales input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#panel-locales select:focus,
#panel-locales input[type="text"]:focus {
  border-color: var(--rojo-msi);
  outline: none;
  box-shadow: 0 0 0 2px rgba(211, 63, 53, 0.2);
}

/* Lista de locales */
.lista-locales {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: calc(100vh - 320px); /* Ajuste dinámico según sidebar */
  overflow-y: auto;
  padding-right: 4px;
}

/* Scroll fino */
.lista-locales::-webkit-scrollbar {
  width: 6px;
}
.lista-locales::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.lista-locales::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.local-item {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.local-item:hover {
  background: #fdf2f2;
  border-color: var(--rojo-msi);
  transform: translateX(2px);
}

/* Estado visual con pseudo-elementos */
.local-item::after {
  content: "●";
  font-size: 0.8rem;
  margin-left: 0.5rem;
  color: #bbb; /* se actualizará por JS si quieres */
}

/* =====================================
   💬 NOTIFICACIONES
   ===================================== */
/* Ventana flotante */
#panel-notificaciones.noti-float {
  position: absolute;
  top: 205px;         /* justo debajo de la navbar */
  right: 20px;
  width: 320px;
  height: 420px;
  background: var(--blanco);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 2000;     /* sobre el mapa */
  animation: fadeInUp 0.3s ease;
}

/* Header */
#panel-notificaciones .noti-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--rojo-msi);
  color: var(--blanco);
  padding: 10px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
#panel-notificaciones .noti-header h2 {
  font-size: 1rem;
  margin: 0;
}
#panel-notificaciones .close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--blanco);
}
#panel-notificaciones .close-btn:hover {
  color: #ffd2d2;
}

/* Feed (mensajes) */
#panel-notificaciones .noti-feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#panel-notificaciones .noti-item {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.3;
}
#panel-notificaciones .noti-item.system {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111;
}
#panel-notificaciones .noti-item.user {
  align-self: flex-end;
  background: var(--rojo-msi);
  color: var(--blanco);
}
#panel-notificaciones .noti-item small {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Input y botón enviar */
#panel-notificaciones .grp {
  display: flex;
  padding: 8px;
  border-top: 1px solid var(--gris-borde);
  background: var(--blanco);
}
#panel-notificaciones .grp input {
  flex: 1;
  border: 1px solid var(--gris-borde);
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 0.9rem;
  outline: none;
}
#panel-notificaciones .grp input:focus {
  border-color: var(--rojo-msi);
}
#panel-notificaciones .grp button {
  margin-left: 6px;
  border-radius: 14px;
  background: var(--rojo-msi);
  color: var(--blanco);
  padding: 6px 12px;
  cursor: pointer;
  border: none;
}
#panel-notificaciones .grp button:hover {
  background: var(--rojo-hover);
}

/* Chips de predeterminados */
#panel-notificaciones #notiPredeterminados {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #fafafa;
  border-bottom: 1px solid var(--gris-borde);
}
#panel-notificaciones #notiPredeterminados .mini-btn {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 12px;
  background: #eee;
  cursor: pointer;
  border: none;
}
#panel-notificaciones #notiPredeterminados .mini-btn:hover {
  background: #ddd;
}

/* =====================================
   📑 MODALES / REPORTES
   ===================================== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  padding: 1rem 1.2rem;
  width: 95%;
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
}
.modal.hidden {
  display: none;
}

/* Header del modal */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #374151;
}
.modal-header .close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #ef4444;
  transition: transform 0.2s;
}
.modal-header .close:hover {
  transform: scale(1.1);
}

/* Filtros de arriba */
.modal-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.modal-filtros input[type="date"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}
.modal-filtros .turno-buttons {
  display: flex;
  gap: 0.3rem;
}
.modal-filtros .turno-buttons .mini-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.modal-filtros .turno-buttons .mini-btn.active {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.modal-filtros .export {
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-filtros .export:hover {
  background: #b91c1c;
}

/* Tablas dentro del modal */
.modal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.modal table thead {
  background: #f9fafb;
}
.modal table th, 
.modal table td {
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.6rem;
  text-align: left;
}
.modal table th {
  font-weight: 600;
  font-size: 0.8rem;
  color: #374151;
}
.modal table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Overlay detrás */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
}
.modal-overlay.hidden {
  display: none;
}

/* ============== Reporte SERENOS ============== */
.rep-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.rep-modal {
  width: 90vw; /* 👈 ocupa el 90% del ancho */
  max-width: 1600px; /* límite máximo para pantallas grandes */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.3s ease;
}

/* ====== CABECERA ====== */
.rep-header {
  display: flex;
  align-items: center;
  justify-content: center; /* 👈 centra el título */
  padding: 12px 16px;
  background: var(--rojo-msi);
  color: #fff;
  position: relative; /* necesario para ubicar el botón a la derecha */
}

.rep-header h3 {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.3px;
}

.rep-close {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s;
}
.rep-close:hover {
  color: #ffdede;
}

/* ====== FILTROS ====== */
.rep-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.rep-group label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
  display: block;
}

.rep-turnos .t-btn,
.rep-actions .btn,
.pill-btn {
  border: 1px solid var(--gris-borde);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  margin-right: 6px;
  transition: 0.2s;
  font-weight: 500;
}

.pill-btn.active,
.t-btn.active {
  background: var(--rojo-msi);
  color: #fff;
  border-color: var(--rojo-msi);
}

/* ====== TABLA ====== */
.rep-table-wrap {
  max-height: 60vh; /* un poco más alto para aprovechar el 90% */
  overflow: auto;
  padding-bottom: 6px;
}

.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.rep-table th,
.rep-table td {
  border-bottom: 1px solid #eee;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.rep-table thead th {
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
}

.rep-empty {
  padding: 16px;
  color: #666;
  text-align: center;
}

/* =====================================
   🔐 LOGIN (tema claro MSI)
   ===================================== */
body.login-page {
  background: var(--gris-fondo);
  font-family: "Segoe UI", sans-serif;
  color: var(--gris-texto);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
}

/* Contenedor principal del login */
.login-container {
  background: var(--blanco);
  padding: 40px;
  border-radius: 12px;
  width: 350px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 1px solid var(--gris-borde);
}

/* Título */
.login-container h2 {
  margin-bottom: 25px;
  color: var(--rojo-msi);
  font-weight: 700;
}

/* Campos de texto */
.login-container input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  font-size: 15px;
  background-color: #fafafa;
  color: #222;
  transition: border-color 0.2s ease;
}
.login-container input:focus {
  border-color: var(--rojo-msi);
  outline: none;
}

/* Botón */
.login-container button {
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  background-color: var(--rojo-msi);
  border: none;
  color: var(--blanco);
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}
.login-container button:hover {
  background-color: var(--rojo-hover);
}

/* Mensaje de error */
.error {
  color: var(--rojo-hover);
  margin-top: 10px;
  font-size: 14px;
}

/* =====================================
   🚪 Botón de CERRAR SESIÓN
   ===================================== */
.logout-btn {
  background: var(--rojo-msi);
  color: var(--blanco);
  border: none;
  padding: 0.45rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(211, 63, 53, 0.2);
}

.logout-btn:hover {
  background: var(--rojo-hover);
  box-shadow: 0 3px 8px rgba(211, 63, 53, 0.3);
  transform: translateY(-1px);
}


/* =====================================
   📡 Panel de TRANSMISIÓN
   ===================================== */

/* =====================================
   📡 Panel de TRANSMISIÓN — SIMPLE & BONITO
   ===================================== */
.tx-card {
  background: white;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 2px 5px #0002;
  margin-bottom: 12px;
}

.tx-info {
  font-size: 14px;
  line-height: 18px;
  margin-bottom: 8px;
}

.badge-live {
  background: red;
  color: white;
  padding: 4px 6px;
  border-radius: 6px;
}

.badge-done {
  background: green;
  color: white;
  padding: 4px 6px;
  border-radius: 6px;
}

.btn-finalizar {
  width: 100%;
  background: #e11d48;
  color: white;
  padding: 6px;
  border: none;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
}
#lista-transmisiones {
  max-height: 75vh;     /* Alto del panel */
  overflow-y: auto;     /* Scroll vertical */
  padding-right: 8px;
}

.tx-card {
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
#panel-transmision h2 {
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 15px;
  color: #000000;
  border-bottom: 2px solid #313435;
}




/* =====================================
   📱 Responsive
   ===================================== */
/* ============================
   📱 MENÚ RESPONSIVO (MÓVIL)
   ============================ */

/* Botón de menú hamburguesa */
.menu-toggle {
  display: none;
  background: var(--rojo-msi);
  color: var(--blanco);
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.menu-toggle:hover {
  background: var(--rojo-hover);
}

/* Sidebar animado */
.sidebar {
  transition: transform 0.35s ease;
}

/* Estado oculto (solo móviles) */
.sidebar.hidden {
  transform: translateX(-100%);
  position: fixed;
  top: 60px;
  left: 0;
  height: calc(100vh - 60px);
  background: var(--blanco);
  z-index: 2000;
  width: 260px;
  box-shadow: 4px 0 12px rgba(0,0,0,0.15);
}

/* Overlay oscuro al abrir menú */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1500;
}
.menu-overlay.active {
  display: block;
}

/* 📱 Modo móvil */
@media (max-width: 900px) {
  .menu-toggle {
    display: inline-block;
    margin-right: 0.8rem;
  }

  .navbar h1 {
    font-size: 1.2rem;
  }

  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    background: var(--gris-fondo);
    z-index: 2000;
    width: 260px;
    box-shadow: 4px 0 12px rgba(0,0,0,0.15);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .container {
    flex-direction: column;
  }
}

/* =====================================
   ✨ Animaciones globales
   ===================================== */
@keyframes fadeInUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
/* ============================================================
   📱 Ajuste de leyenda en pantallas pequeñas
   ============================================================ */
@media (max-width: 900px) {
  .sector-legend {
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
  }

  .sector-legend .card {
    min-width: 250px;
    padding: 0.6rem 0.8rem;
  }

  .sector-legend .chip {
    font-size: 0.75rem;
  }
}
/* ===============================
   📱 Ocultar/mostrar elementos según tamaño
   =============================== */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

/* En pantallas pequeñas (móvil) */
@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
}
/* ============================================================
   📱 CORRECCIÓN: SCROLL EN PANTALLAS PEQUEÑAS
   ============================================================ */
@media (max-width: 900px) {
  html, body {
    height: 100%;
    overflow: auto !important; /* ✅ Permitir scroll global */
  }

  .container {
    flex-direction: column;
    height: auto; /* ✅ No forzar altura fija */
    min-height: 100vh;
    overflow: visible;
  }

  /* Sidebar (panel lateral) */
  .sidebar {
    max-height: calc(100vh - 60px);
    overflow-y: auto; /* ✅ Scroll vertical dentro del panel */
    padding-bottom: 1rem;
  }

  /* Paneles internos con scroll si son largos */
  .panel {
    max-height: none;
    overflow-y: visible;
  }

  /* Ajuste para la leyenda */
  .sector-legend {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 10px auto;
    z-index: 10;
  }

  /* Mapa se ajusta dinámicamente */
  #map {
    height: 60vh; /* ✅ Altura adaptable */
    min-height: 350px;
  }
}
