/* =========================================================
   ESTILOS — Mobile First
   Primero se escribe para celular. Después, con @media,
   se adapta a tablet (≥ 720px) y computadora (≥ 1024px).
   ========================================================= */

/* ---------- 1. Colores (variables) ---------- */
:root {
  /* Foto de portada: versión chica para celular (30 KB) y grande desde tablet (ver más abajo) */
  --foto-hero: linear-gradient(rgba(11,31,58,.65), rgba(11,31,58,.65)), url("../img/hero-900.jpg");
  --azul-oscuro: #086464;
  --azul: #657e80;
  --azul-suave: #e8f0fd;
  --fondo: #f3f6fa;
  --superficie: #ffffff;
  --texto: #14202e;
  --texto-suave: #4f5d6e;
  --borde: #d8e0ea;
  --rojo: #d42020;         /* SOLO emergencias */
  --rojo-oscuro: #a51515;
  --rojo-suave: #fdeaea;
  --verde: #14874d;        /* estados seguros */
  --verde-suave: #e3f5ea;
  --amarillo: #a86b00;
  --amarillo-suave: #fff4d6;
  --sombra: 0 2px 10px rgba(11, 31, 58, .08);
  --radio: 14px;
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-base: 17px;
  --alto-nav: 68px;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

.titulo { text-shadow:1px 1px 3px #08ad1e;}
/* Modo oscuro automático (según el teléfono) salvo que el usuario elija claro */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #0a1424; --superficie: #12203a; --texto: #eef3fa; --texto-suave: #a9b7c9;
    --borde: #24385a; --azul-suave: #17305a; --rojo-suave: #3a1416; --verde-suave: #0f3424;
    --amarillo-suave: #3a2c0a; --azul: #5b93f0; --verde: #3fc37f; --amarillo: #f0b84a;
    --sombra: 0 2px 10px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fondo: #0a1424; --superficie: #12203a; --texto: #eef3fa; --texto-suave: #a9b7c9;
  --borde: #24385a; --azul-suave: #17305a; --rojo-suave: #3a1416; --verde-suave: #0f3424;
  --amarillo-suave: #3a2c0a; --azul: #5b93f0; --verde: #3fc37f; --amarillo: #f0b84a;
  --sombra: 0 2px 10px rgba(0, 0, 0, .35); color-scheme: dark;
}
:root[data-letra="grande"] { --fs-base: 20px; }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 400 var(--fs-base)/1.5 var(--fuente);
  padding-bottom: calc(var(--alto-nav) + var(--seguro-abajo) + 12px);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; max-width: 100%; min-width: 0; }
.grid > *, .layout-2 > * { min-width: 0; }
input[type=file] { width: 100%; }
a { color: var(--azul); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
.saltar { position: absolute; left: -999px; top: 0; background: var(--azul); color: #fff; padding: 8px 12px; z-index: 999; }
.saltar:focus { left: 8px; }
[hidden] { display: none !important; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 3. Encabezado ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--azul-oscuro); color: #fff;
}
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.marca img { border-radius: 9px; }
.marca strong { display: block; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; }
.marca small { display: block; font-size: .78rem; opacity: .85; white-space: nowrap; }
.topbar-acciones { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 12px; font-size: 1.2rem; cursor: pointer; }
.chip-red { background: var(--amarillo); color: #fff; font-size: .75rem; padding: 4px 10px; border-radius: 99px; font-weight: 600; }

/* ---------- 4. Contenido ---------- */
main { padding: 16px; max-width: 1100px; margin: 0 auto; outline: none; }
.seccion-titulo { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.seccion-titulo .ico { font-size: 1.6rem; }
.bajada { color: var(--texto-suave); margin-bottom: 16px; }

.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 14px; }
.tarjeta h3 { margin-bottom: .3em; }
.grid { display: grid; gap: 12px; }

/* ---------- 5. Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  border-radius: 12px; border: 2px solid transparent; font: 600 1rem/1.2 var(--fuente); cursor: pointer; text-decoration: none;
  background: var(--azul); color: #fff; text-align: center;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sec { background: var(--azul-suave); color: var(--azul); }
.btn-borde { background: transparent; border-color: var(--borde); color: var(--texto); }
.btn-rojo { background: var(--rojo); color: #fff; }
.btn-verde { background: var(--verde); color: #fff; }
.btn-bloque { width: 100%; }
.btn-chico { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.fila-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.fila-btns .btn { flex: 1 1 140px; }

/* ---------- 6. Inicio ---------- */
.hero {
  position: relative; border-radius: 20px; overflow: hidden; color: #fff; padding: 22px 18px 20px;
  background:
    var(--foto-hero, none) center/cover,
    linear-gradient(160deg, #07575a 0%, #15777e 55%, #1fa88a 100%);
  margin-bottom: 16px;
}
.hero::after { /* silueta de montañas y lago, dibujada en CSS/SVG */
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 80 L50 40 L85 65 L130 20 L175 60 L215 35 L260 70 L300 30 L345 62 L400 38 V120 H0Z' fill='%230b1f3a' opacity='.55'/%3E%3Cpath d='M0 95 L60 70 L110 88 L170 62 L230 90 L290 66 L350 86 L400 72 V120 H0Z' fill='%230b1f3a' opacity='.8'/%3E%3Crect y='104' width='400' height='16' fill='%23ffffff' opacity='.12'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
}
.hero > * { position: relative; z-index: 1; }
.hero .kicker { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; opacity: .9; margin: 0; }
.hero h1 { font-size: 1.7rem; letter-spacing: .02em; text-transform: uppercase; margin: 2px 0 8px; }
.hero p { opacity: .95; max-width: 40ch; }

.sos-grande {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;
  min-height: 112px; margin: 12px 0 4px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--rojo); color: #fff; font: 800 1.6rem/1.1 var(--fuente); letter-spacing: .04em;
  box-shadow: 0 8px 22px rgba(212, 32, 32, .45), inset 0 -4px 0 rgba(0,0,0,.18);
}
.sos-grande small { font-size: .85rem; font-weight: 500; opacity: .95; margin-top: 6px; letter-spacing: 0; }
.sos-grande:active { transform: scale(.98); }

.que-hago { margin: 18px 0 8px; font-size: 1.05rem; color: var(--texto-suave); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.accesos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.acceso {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 96px; padding: 14px;
  border-radius: var(--radio); background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra);
  color: var(--texto); text-decoration: none; font-weight: 700; line-height: 1.2; text-align: left; font-size: 1rem; cursor: pointer;
}
.acceso .ico { font-size: 1.7rem; }
.acceso small { font-weight: 400; color: var(--texto-suave); font-size: .82rem; }

.lema { text-align: center; padding: 22px 12px; margin-top: 18px; border-top: 1px solid var(--borde); }
.lema blockquote { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; color: var(--texto); }
.lema p { color: var(--texto-suave); margin: 0; }

/* Aviso de alerta en tu zona */
.aviso { border-radius: var(--radio); padding: 14px 16px; margin-bottom: 14px; border-left: 6px solid; }
.aviso-rojo { background: var(--rojo-suave); border-color: var(--rojo); }
.aviso-amarillo { background: var(--amarillo-suave); border-color: var(--amarillo); }
.aviso-azul { background: var(--azul-suave); border-color: var(--azul); }
.aviso-verde { background: var(--verde-suave); border-color: var(--verde); }
.aviso strong { display: block; margin-bottom: 2px; }

/* ---------- 7. Directorio ---------- */
.filtros { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--borde);
  background: var(--superficie); color: var(--texto); font: 600 .9rem var(--fuente); cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); color: #fff; }
.buscador { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); font: inherit; margin-bottom: 10px; }

.inst-cab { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.etiqueta { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--azul-suave); color: var(--azul); white-space: nowrap; }
.etiqueta-amarilla { background: var(--amarillo-suave); color: var(--amarillo); }
.etiqueta-verde { background: var(--verde-suave); color: var(--verde); }
.etiqueta-roja { background: var(--rojo-suave); color: var(--rojo); }
.datos { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 4px; font-size: .95rem; }
.datos li { display: flex; gap: 8px; }
.datos li span:first-child { flex: 0 0 22px; }
.fuente { font-size: .78rem; color: var(--texto-suave); margin-top: 8px; }
.vacio { text-align: center; padding: 28px 16px; color: var(--texto-suave); border: 2px dashed var(--borde); border-radius: var(--radio); }

/* ---------- 8. Formularios ---------- */
.campo { margin-bottom: 14px; }
.campo label, .campo .etq { display: block; font-weight: 700; margin-bottom: 6px; }
.campo .ayuda { display: block; font-size: .85rem; color: var(--texto-suave); margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time], input[type=number], input[type=password], input[type=url], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--borde);
  background: var(--superficie); color: var(--texto); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.opciones-si-no { display: flex; gap: 8px; }
.opciones-si-no label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border: 1px solid var(--borde); border-radius: 12px; background: var(--superficie); cursor: pointer; font-weight: 600; }
.opciones-si-no input { width: 20px; height: 20px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--superficie); cursor: pointer; margin-bottom: 10px; }
.switch input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--azul); }
.check-lista { display: grid; gap: 8px; }
.trampa { position: absolute; left: -9999px; } /* anti-spam (honeypot) */

/* ---------- 9. Mapas ---------- */
.mapa { height: 340px; border-radius: var(--radio); overflow: hidden; border: 1px solid var(--borde); margin-bottom: 14px; background: var(--azul-suave); z-index: 0; }
.mapa-alto { height: 58vh; min-height: 340px; }
.leaflet-container { font: inherit; }
.pin { font-size: 22px; line-height: 1; text-align: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.pin-zona { background: var(--superficie); color: var(--texto); border: 2px solid var(--verde); border-radius: 99px; padding: 2px 8px; font: 700 12px/1.4 system-ui, sans-serif; white-space: nowrap; box-shadow: var(--sombra); }
.mapa-offline { display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--texto-suave); height: 100%; }

/* ---------- 10. Red comunitaria ---------- */
.estado-punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.est-disponible { background: #19a35b; } .est-ocupado { background: #e2a400; } .est-emergencia { background: var(--rojo); }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: 10px 0; border-bottom: 1px solid var(--borde); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lista-simple li:last-child { border-bottom: 0; }
.contador { font-size: 2rem; font-weight: 800; color: var(--verde); line-height: 1; }
.chat { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msj { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--azul-suave); }
.msj.yo { align-self: flex-end; background: var(--azul); color: #fff; }
.msj small { display: block; opacity: .7; font-size: .72rem; }

/* ---------- 11. SOS ---------- */
.sos-pantalla { text-align: center; }
.sos-circulo {
  width: min(70vw, 260px); aspect-ratio: 1; border-radius: 50%; border: 0; margin: 10px auto 16px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; background: var(--rojo); color: #fff;
  font: 900 2.6rem/1 var(--fuente); cursor: pointer; box-shadow: 0 0 0 14px var(--rojo-suave), 0 12px 30px rgba(212,32,32,.45);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.sos-circulo.sos-chico { width: 120px; font-size: 1.6rem; box-shadow: 0 0 0 8px var(--rojo-suave); margin: 4px auto 10px; }
.sos-circulo small { font-size: .9rem; font-weight: 600; margin-top: 8px; }
.sos-activo .sos-circulo { animation: latido 1.4s infinite; }
@keyframes latido { 0%,100% { box-shadow: 0 0 0 10px var(--rojo-suave), 0 0 0 0 rgba(212,32,32,.5); } 50% { box-shadow: 0 0 0 10px var(--rojo-suave), 0 0 0 26px rgba(212,32,32,0); } }
@media (prefers-reduced-motion: reduce) { .sos-activo .sos-circulo { animation: none; } }
.estado-tabla { display: grid; gap: 8px; text-align: left; }
.estado-fila { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--fondo); border-radius: 10px; }
.estado-fila span:first-child { font-weight: 700; }
.cuenta { font-size: 5rem; font-weight: 900; color: var(--rojo); line-height: 1; margin: 10px 0; }
.mantener { position: relative; overflow: hidden; }
.mantener .progreso { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.3); transition: width .1s linear; }
.barra-sos { position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: var(--rojo); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: calc(8px + env(safe-area-inset-top,0px)) 16px 8px; font-weight: 800; }
.barra-sos a { color: #fff; font-weight: 700; }

/* ---------- 12. Botón flotante y navegación inferior ---------- */
.fab-emergencia {
  position: fixed; right: 14px; bottom: calc(var(--alto-nav) + var(--seguro-abajo) + 14px); z-index: 60;
  min-height: 52px; padding: 0 18px; border: 0; border-radius: 99px; background: var(--rojo); color: #fff;
  font: 800 .95rem var(--fuente); letter-spacing: .04em; box-shadow: 0 6px 18px rgba(212,32,32,.5); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--alto-nav) + var(--seguro-abajo)); padding-bottom: var(--seguro-abajo);
  background: var(--superficie); border-top: 1px solid var(--borde); box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--texto-suave); text-decoration: none; font-size: .75rem; font-weight: 600; }
.bottomnav a span { font-size: 1.35rem; }
.bottomnav a.activo { color: var(--azul); }
.bottomnav .nav-sos span { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--rojo); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(212,32,32,.5); border: 4px solid var(--superficie); }
.bottomnav .nav-sos { color: var(--rojo); }
.sidenav { display: none; }

/* Botón SOS de la barra inferior (el ícono es <iconify-icon>, no <span>) */
.bottomnav .nav-sos iconify-icon {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--rojo);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  box-shadow: 0 4px 14px rgba(212,32,32,.5); border: 4px solid var(--superficie); color: #fff; filter: none;
}
/* Íconos legibles sobre fondo claro (en modo oscuro quedan los colores originales) */
.sidenav iconify-icon, .bottomnav a:not(.nav-sos) iconify-icon { color: #0f7f7f; }
.sidenav iconify-icon.icon-salmon, .bottomnav iconify-icon.icon-salmon { color: #d4534f; }
.sidenav .sidenav-sos iconify-icon { color: var(--rojo); filter: none; }
.sidenav a.activo iconify-icon { color: #fff !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidenav a:not(.sidenav-sos) iconify-icon:not(.icon-salmon),
  :root:not([data-theme="light"]) .bottomnav a:not(.nav-sos) iconify-icon:not(.icon-salmon) { color: #7bd5d5; }
  :root:not([data-theme="light"]) .sidenav iconify-icon.icon-salmon,
  :root:not([data-theme="light"]) .bottomnav iconify-icon.icon-salmon { color: #ff9b9b; }
}
:root[data-theme="dark"] .sidenav a:not(.sidenav-sos) iconify-icon:not(.icon-salmon),
:root[data-theme="dark"] .bottomnav a:not(.nav-sos) iconify-icon:not(.icon-salmon) { color: #7bd5d5; }
:root[data-theme="dark"] .sidenav iconify-icon.icon-salmon,
:root[data-theme="dark"] .bottomnav iconify-icon.icon-salmon { color: #ff9b9b; }
/* Mientras carga el script de íconos, reservar su lugar (evita saltos) */
iconify-icon:not(:defined) { display: inline-block; width: 1em; height: 1em; }

/* ---------- 13. Modal y avisos ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-fondo { position: absolute; inset: 0; background: rgba(5, 12, 24, .6); }
.modal-caja {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--superficie);
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + var(--seguro-abajo)); animation: subir .2s ease-out;
}
@keyframes subir { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-cab h2 { margin: 0; }
.cerrar { background: var(--fondo); border: 0; width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; cursor: pointer; color: var(--texto); }
.emerg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.emerg-op { border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px; background: var(--fondo); }
.emerg-op h3 { font-size: 1rem; margin-bottom: 8px; }
.emerg-op .btn { width: 100%; margin-top: 6px; min-height: 52px; font-size: 1.15rem; }
.emerg-op .btn small { font-size: .7rem; font-weight: 500; display: block; }
.toast { position: fixed; left: 50%; bottom: calc(var(--alto-nav) + var(--seguro-abajo) + 80px); transform: translateX(-50%); z-index: 120; background: var(--azul-oscuro); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 90vw; box-shadow: var(--sombra); font-weight: 600; }

/* ---------- 14. Prevención (acordeón) ---------- */
details.acordeon { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); margin-bottom: 10px; box-shadow: var(--sombra); }
details.acordeon summary { cursor: pointer; padding: 16px; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; }
details.acordeon summary::-webkit-details-marker { display: none; }
details.acordeon summary::after { content: "＋"; margin-left: auto; color: var(--texto-suave); }
details.acordeon[open] summary::after { content: "－"; }
details.acordeon .cuerpo { padding: 0 16px 16px; }
details.acordeon ul { padding-left: 1.2em; margin: 0; } details.acordeon li { margin-bottom: 6px; }

/* ---------- 15. Menú y admin ---------- */
.menu-lista a, .menu-lista button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--borde); background: none; color: var(--texto); text-decoration: none; font: 600 1rem var(--fuente); text-align: left; cursor: pointer; }
.menu-lista a:last-child { border-bottom: 0; }
.menu-lista .ico { font-size: 1.4rem; width: 30px; text-align: center; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.tabla-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { color: var(--texto-suave); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--texto-suave); font-size: .85rem; }
.permiso-si { color: var(--verde); font-weight: 800; } .permiso-no { color: var(--texto-suave); }

.app-footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px;
    margin-top: 20px;
    font-size: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: transparent;
  }

  .app-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #049b7a; 
    text-decoration: none;
    transition: opacity 0.2s ease;

  }

  .app-footer a:hover {
    opacity: 0.8;
  }

  .app-footer img {
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(123, 213, 213, 0.4));
    border-radius: 40%;
  }

/* ---------- Donaciones (Inicio) ----------
   Celular: ícono + texto arriba, botón verde a lo ancho abajo.
   Tablet/PC: todo en una fila. */
.donar {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center;
  margin-top: 18px; padding: 16px; border-radius: var(--radio); text-decoration: none; color: var(--texto);
  background: var(--verde-suave); border: 1px solid var(--verde); box-shadow: var(--sombra);
}
.donar .ico { font-size: 2rem; line-height: 1; }
.donar-texto b { display: block; font-size: 1.05rem; }
.donar-texto small { display: block; color: var(--texto-suave); font-size: .88rem; line-height: 1.35; }
.donar-btn { grid-column: 1 / -1; width: 100%; margin-top: 6px; pointer-events: none; }
.donar:hover .donar-btn { filter: brightness(1.08); }
.menu-nota { margin-left: auto; color: var(--texto-suave); font-weight: 400; font-size: .8rem; }

/* Celulares chicos (≤ 360 px) */
@media (max-width: 360px) {
  main { padding: 12px; }
  .marca small { display: none; }
  .accesos { gap: 8px; }
  .acceso { padding: 12px; min-height: 88px; }
  .emerg-grid { grid-template-columns: 1fr; }
  .sos-grande { font-size: 1.35rem; }
  .estado-fila { flex-direction: column; gap: 2px; }
}
.estado-fila span:last-child { overflow-wrap: anywhere; }

/* =========================================================
   TABLET (≥ 720px)
   ========================================================= */
@media (min-width: 720px) {
  :root { --foto-hero: linear-gradient(rgba(11,31,58,.65), rgba(11,31,58,.65)), url("../img/hero-1600.jpg"); }
  main { padding: 22px; }
  .hero { padding: 34px 32px 30px; }
  .hero h1 { font-size: 2.2rem; }
  .accesos { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .donar { grid-template-columns: auto 1fr auto; }
  .donar-btn { grid-column: auto; width: auto; margin-top: 0; min-width: 140px; }
  .emerg-grid { grid-template-columns: repeat(4, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .modal { align-items: center; }
  .modal-caja { border-radius: 20px; max-width: 720px; padding: 24px; }
  .mapa { height: 420px; }
}

/* =========================================================
   COMPUTADORA (≥ 1024px): menú lateral en lugar del inferior
   ========================================================= */
@media (min-width: 1024px) {
  body { padding-bottom: 24px; padding-left: 250px; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px; position: fixed; top: 60px; left: 0; bottom: 0; width: 250px;
    padding: 16px 12px; background: var(--superficie); border-right: 1px solid var(--borde); overflow-y: auto; z-index: 40;
  }
  .sidenav a { padding: 12px 14px; border-radius: 10px; color: var(--texto); text-decoration: none; font-weight: 600; }
  .sidenav a:hover { background: var(--azul-suave); }
  .sidenav a.activo { background: var(--azul); color: #fff; }
  .sidenav .sidenav-sos { color: var(--rojo); }
  .sidenav .sidenav-sos.activo { background: var(--rojo); color: #fff; }
  .topbar { padding-left: 24px; margin-left: -250px; }
  .fab-emergencia { bottom: 24px; right: 24px; }
  .toast { bottom: 100px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .layout-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
  .mapa-alto { height: 70vh; }
}
