/* DSS-IA · CONRED Quetzaltenango
   Interfaz de alto contraste, pensada para operar bajo estrés y en exteriores. */
:root {
  --fondo: #0d1217; --panel: #161e26; --panel-2: #1e2933; --borde: #2c3a47;
  --texto: #f3f6f8; --tenue: #9fb0bf; --acento: #ffb020; --acento-texto: #1a1200;
  --peligro: #ff5a47; --exito: #3ecf8e; --info: #57a8ff; --aviso: #ffd24a;
  --sev1: #3ecf8e; --sev2: #ffd24a; --sev3: #ff8a2b; --sev4: #ff3b30;
  --radio: 10px; --sombra: 0 6px 24px rgba(0, 0, 0, .45);
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-tema="sol"] {            /* tema claro de alto contraste para luz solar directa */
  --fondo: #f4f6f8; --panel: #ffffff; --panel-2: #eef1f4; --borde: #b9c3cd;
  --texto: #0b1015; --tenue: #45535f; --acento: #c25e00; --acento-texto: #ffffff;
  --peligro: #c81e0e; --exito: #0b7a4b; --info: #0a5fc2; --aviso: #8a6400;
  --sev1: #0b7a4b; --sev2: #a37800; --sev3: #d2580a; --sev4: #c81e0e;
  --sombra: 0 4px 18px rgba(0, 0, 0, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fondo); color: var(--texto); font: 15px/1.45 var(--fuente); -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 1.15rem; } h3 { font-size: 1rem; } h4 { font-size: .8rem; text-transform: uppercase; color: var(--tenue); letter-spacing: .08em; }
p { margin: 0; }
a { color: var(--info); }
[hidden] { display: none !important; }

/* ---------- controles ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .45rem .9rem;
  border: 1px solid var(--borde); border-radius: 8px; background: var(--panel-2); color: var(--texto); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--tenue); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--info); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primario { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.btn.peligro { background: var(--peligro); border-color: var(--peligro); color: #fff; }
.btn.exito { background: var(--exito); border-color: var(--exito); color: #04140c; }
:root[data-tema="sol"] .btn.exito { color: #fff; }
.btn.chico { min-height: 32px; padding: .2rem .6rem; font-size: .85rem; }
.btn.grande { min-height: 64px; font-size: 1.15rem; width: 100%; border-radius: 12px; }
.btn.fantasma { background: transparent; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-height: 40px; padding: .45rem .6rem; background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--acento); vertical-align: -3px; }
.leaflet-control-layers label { color: var(--texto); font-size: .85rem; font-weight: 600; margin: .15rem 0; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: .82rem; color: var(--tenue); font-weight: 600; margin-bottom: .2rem; }
.campo { margin-bottom: .7rem; }
.fila { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.fila > .campo { flex: 1 1 140px; }
.rejilla { display: grid; gap: .8rem; }
.empuja { margin-left: auto; }
.tenue { color: var(--tenue); } .chico-txt { font-size: .82rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- acceso ---------- */
#acceso { min-height: 100%; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(900px 500px at 50% -10%, rgba(255, 176, 32, .16), transparent 70%), var(--fondo); }
.tarjeta-acceso { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--borde); border-radius: 14px; padding: 1.6rem; box-shadow: var(--sombra); }
.marca { display: flex; align-items: center; gap: .7rem; }
.marca .logo { width: 42px; height: 42px; flex: none; }
.marca b { font-size: 1.15rem; letter-spacing: .04em; }
.marca small { display: block; color: var(--tenue); font-size: .76rem; line-height: 1.25; }
.demo { margin-top: 1rem; padding: .7rem; border: 1px dashed var(--borde); border-radius: 8px; font-size: .82rem; color: var(--tenue); }
.demo button { background: none; border: 0; color: var(--info); cursor: pointer; padding: .1rem 0; text-decoration: underline; }

/* ---------- estructura ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
header.barra { display: flex; align-items: center; gap: .8rem; padding: .45rem .8rem; background: var(--panel); border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
nav.modulos { display: flex; gap: .25rem; flex-wrap: wrap; }
nav.modulos button { background: none; border: 0; border-bottom: 3px solid transparent; padding: .55rem .7rem; color: var(--tenue); font-weight: 700; cursor: pointer; min-height: 44px; }
nav.modulos button[aria-current="page"] { color: var(--texto); border-bottom-color: var(--acento); }
.estado-red { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1px solid var(--borde); }
.estado-red::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--exito); }
.estado-red.sin-red { border-color: var(--peligro); color: var(--peligro); } .estado-red.sin-red::before { background: var(--peligro); }
.pendientes { background: var(--aviso); color: #1a1200; border-radius: 999px; padding: .2rem .6rem; font-size: .8rem; font-weight: 800; border: 0; cursor: pointer; }
main { flex: 1; min-height: 0; overflow: auto; }
.vista { height: 100%; }
.contenido { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem; }
.panel > h3, .panel > h4 { margin-bottom: .6rem; }
.pestanas { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--borde); }
.pestanas button { background: none; border: 0; padding: .6rem .9rem; color: var(--tenue); font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; }
.pestanas button[aria-selected="true"] { color: var(--texto); border-bottom-color: var(--acento); }

/* ---------- indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.kpi { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: .6rem .8rem; }
.kpi b { display: block; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .76rem; color: var(--tenue); font-weight: 600; }
.kpi.alerta b { color: var(--peligro); } .kpi.aviso b { color: var(--aviso); } .kpi.bien b { color: var(--exito); }

/* ---------- etiquetas ---------- */
.etq { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 800; border: 1px solid currentColor; white-space: nowrap; }
.sev-1 { color: var(--sev1); } .sev-2 { color: var(--sev2); } .sev-3 { color: var(--sev3); } .sev-4 { color: var(--sev4); }
.est-activo, .est-rechazada, .est-fuera_servicio { color: var(--peligro); }
.est-controlado, .est-propuesta, .est-pendiente, .est-asignado, .est-borrador, .est-en_ruta { color: var(--aviso); }
.est-liquidado, .est-disponible, .est-aprobada, .est-entregado, .est-finalizada { color: var(--exito); }
.est-en_sitio { color: var(--info); }
.demo-marca { color: var(--tenue); border: 1px dashed var(--tenue); border-radius: 4px; padding: 0 .3rem; font-size: .68rem; font-weight: 700; }

/* ---------- tablas ---------- */
.tabla-envoltura { overflow: auto; border: 1px solid var(--borde); border-radius: var(--radio); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { position: sticky; top: 0; background: var(--panel-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clic { cursor: pointer; } tbody tr.clic:hover { background: var(--panel-2); }
td.der, th.der { text-align: right; }

/* ---------- tablero táctico ---------- */
.tactico { display: grid; grid-template-columns: 330px 1fr; height: 100%; }
.tactico aside { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--borde); background: var(--panel); }
.tactico aside .desliza { overflow: auto; padding: .7rem; flex: 1; }
.tactico .t-vistas { margin: 0; padding: 0 .4rem; flex-wrap: nowrap; }
.tactico .t-vistas button { flex: 1; padding: .55rem .4rem; font-size: .88rem; }
.tactico .h-rango { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: .5rem; }
.tactico .h-rango .campo { margin: 0; min-width: 0; } .tactico .h-rango input { width: 100%; min-width: 0; padding-inline: .4rem; }
.tactico .h-rango button { grid-column: 1 / -1; }
.tactico .rangos-rapidos { flex-wrap: wrap; gap: .3rem; }
.tactico .rangos-rapidos .btn { padding: .2rem .5rem; font-size: .8rem; }
.tactico .kpis { grid-template-columns: repeat(3, 1fr); padding: .7rem; gap: .4rem; border-bottom: 1px solid var(--borde); }
.tactico .kpi { padding: .4rem .5rem; } .tactico .kpi b { font-size: 1.35rem; }
.zona-mapa { position: relative; min-height: 0; }
#mapa { position: absolute; inset: 0; background: #20303d; }
.item { display: block; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--borde); border-left: 5px solid var(--tenue);
  border-radius: 8px; padding: .5rem .6rem; margin-bottom: .45rem; cursor: pointer; color: inherit; }
.item:hover, .item.activo { border-color: var(--acento); }
.item.s1 { border-left-color: var(--sev1); } .item.s2 { border-left-color: var(--sev2); } .item.s3 { border-left-color: var(--sev3); } .item.s4 { border-left-color: var(--sev4); }
.item b { display: block; } .item small { color: var(--tenue); }
.ficha { position: absolute; top: .7rem; right: .7rem; bottom: .7rem; width: min(400px, calc(100% - 1.4rem)); z-index: 1100; overflow: auto;
  background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: .9rem; }
.ficha section { border-top: 1px solid var(--borde); padding-top: .7rem; margin-top: .7rem; }
.ficha dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: .4rem 0 0; font-size: .88rem; }
.ficha dt { color: var(--tenue); } .ficha dd { margin: 0; }
.aviso-mapa { position: absolute; top: .7rem; left: 50%; transform: translateX(-50%); z-index: 1200; background: var(--acento); color: var(--acento-texto);
  padding: .5rem 1rem; border-radius: 999px; font-weight: 800; box-shadow: var(--sombra); display: flex; gap: .8rem; align-items: center; }
.barra-prob { height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin: .3rem 0; }
.barra-prob i { display: block; height: 100%; background: linear-gradient(90deg, var(--sev1), var(--sev2), var(--sev3), var(--sev4)); background-size: 400px 100%; }
.novedad { border-left: 3px solid var(--info); padding: .15rem 0 .15rem .6rem; margin-bottom: .5rem; font-size: .88rem; }
.novedad small { color: var(--tenue); display: block; }
.leyenda { background: var(--panel); color: var(--texto); padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--borde); font-size: .76rem; line-height: 1.6; }
.leyenda i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.leyenda i.cuadro { border-radius: 2px; }
.leaflet-container { font: inherit; }
.leaflet-control-layers, .leaflet-bar a { background: var(--panel); color: var(--texto); border-color: var(--borde); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--texto); }
.marca-peloton { width: 16px; height: 16px; border: 2px solid #fff; border-radius: 3px; box-shadow: 0 0 0 1px #000; }
.marca-yo { width: 18px; height: 18px; border-radius: 50%; background: var(--info); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--info); }

/* ---------- disposición en columnas y gráficas (Predicción IA, Administración) ---------- */
.dos-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start; }
.graficas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.grafica { position: relative; height: 280px; }

/* ---------- campo ---------- */
.campo-vista { max-width: 620px; margin: 0 auto; padding: .8rem; display: grid; gap: .8rem; }
.campo-vista .panel { padding: 1rem; }
.campo-vista h2 { font-size: 1.35rem; }
#mapa-campo { height: 300px; border-radius: var(--radio); border: 1px solid var(--borde); background: #20303d; }
.tipos-novedad { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tipos-novedad .btn { min-height: 56px; }
.tipos-novedad .btn[aria-pressed="true"] { border-color: var(--acento); box-shadow: inset 0 0 0 2px var(--acento); }
.cola { font-size: .86rem; } .cola li { margin-bottom: .2rem; }

/* ---------- IA ---------- */
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.rec { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--borde); }
.rec:last-child { border-bottom: 0; }
.rec .p { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #111; }
.rec .p1 { background: var(--sev4); color: #fff; } .rec .p2 { background: var(--sev3); } .rec .p3 { background: var(--sev2); }
.nota { border: 1px solid var(--aviso); border-left-width: 5px; border-radius: 8px; padding: .6rem .8rem; font-size: .88rem; background: color-mix(in srgb, var(--aviso) 10%, transparent); }

/* ---------- diálogo y avisos ---------- */
dialog { background: var(--panel); color: var(--texto); border: 1px solid var(--borde); border-radius: 14px; padding: 0; width: min(560px, calc(100% - 1.5rem)); box-shadow: var(--sombra); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog form { padding: 1.1rem; }
dialog h2 { margin-bottom: .9rem; }
dialog .acciones { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .9rem; }
.error-form { color: var(--peligro); font-weight: 600; font-size: .88rem; min-height: 1.2em; }
#avisos { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 3000; display: grid; gap: .4rem; width: min(520px, calc(100% - 1.5rem)); pointer-events: none; }
.aviso { background: var(--panel-2); border: 1px solid var(--borde); border-left: 5px solid var(--info); border-radius: 8px; padding: .6rem .8rem; box-shadow: var(--sombra); font-weight: 600; pointer-events: auto; }
.aviso.error { border-left-color: var(--peligro); } .aviso.exito { border-left-color: var(--exito); } .aviso.alerta { border-left-color: var(--aviso); }
.vacio { color: var(--tenue); text-align: center; padding: 1.2rem; }

/* ---------- adaptación a pantallas pequeñas ---------- */
@media (max-width: 900px) {
  /* En el teléfono la página completa se desliza: arriba el mapa, debajo los indicadores y la lista entera
     (antes la lista quedaba en una franja pequeña con su propia barra). Las pestañas quedan fijas arriba. */
  .tactico { display: flex; flex-direction: column; height: auto; min-height: 100%; }
  .tactico .zona-mapa { order: 1; flex: none; height: 46vh; height: 46svh; }
  .tactico aside { order: 2; flex: none; min-height: auto; border-right: 0; border-top: 1px solid var(--borde); }
  .tactico aside .desliza { overflow: visible; flex: none; padding-bottom: 2rem; }
  .tactico .t-vistas { position: sticky; top: 0; z-index: 5; background: var(--panel); }
  .tactico .kpis { gap: .35rem; padding: .55rem; }
  .tactico .kpi { padding: .35rem .45rem; } .tactico .kpi b { font-size: 1.1rem; } .tactico .kpi span { font-size: .7rem; }
  /* Ficha del incendio: hoja que sube desde abajo, sobre la página, con espacio suficiente para leerla. */
  .tactico .ficha { position: fixed; top: auto; bottom: .5rem; left: .5rem; right: .5rem; width: auto; max-height: 78vh; max-height: 78svh; }
  .dos-col { grid-template-columns: 1fr; }
  .ficha { top: auto; left: .5rem; right: .5rem; width: auto; max-height: 70%; }
  header.barra { gap: .4rem; }
  .oculta-movil { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .aviso { animation: sube .18s ease-out; }
  @keyframes sube { from { transform: translateY(8px); opacity: 0; } }
}

/* ---------- marca, leyenda plegable y asistencia ---------- */
.marca .logo.grande { width: 64px; height: 64px; }
.pie-acceso { margin-top: .9rem; text-align: center; font-size: .76rem; color: var(--tenue); }
details.leyenda > summary { cursor: pointer; font-weight: 700; font-size: .8rem; list-style: none; padding: .1rem .15rem; }
details.leyenda > summary::-webkit-details-marker { display: none; }
details.leyenda > summary::after { content: " ▸"; }
details.leyenda[open] > summary::after { content: " ▾"; }
details.leyenda[open] > summary { margin-bottom: .25rem; border-bottom: 1px solid var(--borde); }
.est-presente { color: var(--exito); } .est-salio { color: var(--info); } .est-ausente { color: var(--peligro); }
.reloj { max-width: 460px; margin: 0 auto; text-align: center; }
.reloj .hora { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.reloj input { font-size: 1.5rem; text-align: center; min-height: 58px; letter-spacing: .12em; }
.reloj .resultado { margin-top: 1rem; padding: 1rem; border-radius: var(--radio); border: 2px solid var(--exito); font-size: 1.1rem; }
.reloj .resultado.salida { border-color: var(--info); }
.reloj .resultado b { display: block; font-size: 1.4rem; }

/* ---------- reloj de asistencia para empleados y buscadores ---------- */
#reloj-publico { min-height: 100%; padding: 1.5rem 1rem; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(900px 500px at 50% -10%, rgba(255, 176, 32, .16), transparent 70%), var(--fondo); }
.reloj form { text-align: left; }
.reloj #r-buscar { font-size: 1.15rem; text-align: left; letter-spacing: 0; }
.resultados { display: grid; gap: .3rem; margin-top: .4rem; }
.resultados button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%; padding: .55rem .7rem; min-height: 52px;
  background: var(--panel-2); border: 1px solid var(--borde); border-radius: 8px; color: inherit; cursor: pointer; }
.resultados button:hover, .resultados button:focus-visible { border-color: var(--acento); }
.elegido { display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: left; margin-bottom: .7rem;
  padding: .6rem .8rem; border: 2px solid var(--acento); border-radius: var(--radio); }
.elegido b { font-size: 1.15rem; }
tr[hidden] { display: none; }

/* En pantallas de laptop el nombre del usuario se oculta para que la barra no se parta en dos líneas. */
@media (max-width: 1400px) { #quien { display: none; } }

/* ---- lector de huellas (reloj y registro) ---- */
.huella-zona { display: flex; align-items: center; gap: .9rem; text-align: left; margin: 0 0 1rem; padding: .9rem 1rem;
  border: 2px dashed var(--borde); border-radius: var(--radio); background: var(--panel-2); }
.huella-zona .huella-icono { flex: 0 0 auto; color: var(--tenue); display: grid; place-items: center; }
.huella-zona b { font-size: 1.15rem; }
.huella-zona.listo { border-style: solid; border-color: var(--exito); }
.huella-zona.listo .huella-icono { color: var(--exito); animation: latido 1.8s ease-in-out infinite; }
.huella-zona.leyendo { border-style: solid; border-color: var(--info); }
.huella-zona.leyendo .huella-icono { color: var(--info); }
.huella-zona.aviso { border-color: var(--aviso); } .huella-zona.aviso .huella-icono { color: var(--aviso); }
.huella-zona.apagado { opacity: .75; }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .huella-zona.listo .huella-icono { animation: none; } }
.separador { display: flex; align-items: center; gap: .6rem; color: var(--tenue); font-size: .85rem; margin: 0 0 .8rem; }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--borde); }
.reloj .resultado.repetido { border-color: var(--aviso); }
.capturas-huella { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .8rem 0; }
.capturas-huella div { aspect-ratio: 4 / 5; border: 2px dashed var(--borde); border-radius: 8px; display: grid; place-items: center;
  color: var(--tenue); font-size: .8rem; font-weight: 700; background: var(--fondo); overflow: hidden; }
.capturas-huella div.ok { border-style: solid; border-color: var(--exito); background: #fff; }
.capturas-huella img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Versión 1.5: cobertura nacional, boleta de registro y fotografías ---------- */
.tactico .h-ancho { grid-column: 1 / -1; }
dialog.dialogo-ancho { width: min(900px, calc(100% - 1rem)); }
dialog.dialogo-ancho form { max-height: calc(100vh - 2rem); overflow: auto; }
.seccion-boleta { border: 1px solid var(--borde); border-radius: 10px; padding: .2rem .8rem; margin-bottom: .6rem; background: var(--panel-2); }
.seccion-boleta[open] { padding-bottom: .7rem; }
.seccion-boleta > summary { cursor: pointer; font-weight: 700; padding: .55rem 0; }
.seccion-boleta h5 { margin: .7rem 0 .3rem; font-size: .9rem; }
.rejilla-num { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 .6rem; }
.rejilla-num .campo label { font-size: .8rem; }
.tabla-boleta { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .4rem; }
.tabla-boleta th, .tabla-boleta td { border-bottom: 1px solid var(--borde); padding: .25rem .3rem; text-align: left; vertical-align: middle; }
.tabla-boleta th { text-transform: none; letter-spacing: 0; }
.tabla-boleta input { width: 100%; min-width: 0; padding: .3rem .4rem; }
.tabla-boleta td:first-child { width: 46%; }
.caja-dato { background: var(--panel); border: 1px dashed var(--borde); border-radius: 8px; padding: .5rem .7rem; margin: .2rem 0 .7rem; font-size: .85rem; }
.suma-pct { font-weight: 400; font-size: .8rem; margin-left: .4rem; }
.suma-pct.mal, .mal { color: var(--peligro, #ff3b30); }
.suma-pct.ok { color: var(--tenue); }
.ubicacion { font-size: .85rem; padding: .45rem .6rem; border-radius: 8px; background: var(--panel-2); margin: -.2rem 0 .7rem; }
.ubicacion.ok { border-left: 4px solid var(--sev1); }
.ubicacion.mal { border-left: 4px solid var(--sev4); color: var(--peligro, #ff3b30); }
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .4rem; }
.fotos figure { margin: 0; cursor: zoom-in; }
.fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--panel-2); display: block; }
.fotos figcaption { font-size: .72rem; color: var(--tenue); margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-grande { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: #000; margin-bottom: .5rem; }
@media (max-width: 600px) { .tabla-boleta td:first-child { width: 40%; } .rejilla-num { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Portada con dos accesos (versión 1.6) ---------- */
#portada { min-height: 100%; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(900px 500px at 50% -10%, rgba(255, 176, 32, .16), transparent 70%), var(--fondo); }
.opcion-acceso { display: block; width: 100%; text-align: left; background: var(--panel-2); color: var(--texto); border: 1px solid var(--borde);
  border-left: 5px solid var(--acento); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .7rem; cursor: pointer; font: inherit; }
.opcion-acceso:hover, .opcion-acceso:focus-visible { border-color: var(--acento); }
.opcion-acceso b { display: block; font-size: 1.1rem; margin-bottom: .2rem; }
.opcion-acceso span { color: var(--tenue); font-size: .9rem; }
#ir-usuarios { border-left-color: var(--info); }
.solo-tablero { font-size: .8rem; padding: .2rem .55rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--borde); color: var(--tenue); }

/* ---------- Unidades de área, focos de calor y ubicación (versión 1.7) ---------- */
.con-unidad { display: flex; gap: .4rem; } .con-unidad input { flex: 1; min-width: 0; }
.unidad-area { display: inline-flex; align-items: center; gap: .35rem; }
.unidad-area select { width: auto; padding: .25rem .4rem; font-size: .85rem; }
.popup-foco dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; margin: .4rem 0; font-size: .82rem; }
.popup-foco dt { color: var(--tenue); } .popup-foco dd { margin: 0; }
.boton-ubicacion { width: 34px; height: 34px; display: grid; place-items: center; background: #fff; color: #1b2530; border: 2px solid rgba(0,0,0,.2);
  border-radius: 4px; cursor: pointer; background-clip: padding-box; }
.boton-ubicacion:hover { background: #f4f4f4; }

/* ---------- Sede del reloj de asistencia (versión 1.7.2) ---------- */
.sede-reloj { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-bottom: .6rem; }
.periodo-recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .4rem .6rem; align-items: end; margin: .5rem 0; }
.periodo-recs .campo { margin: 0; } .periodo-recs .rangos-rapidos { flex-wrap: wrap; gap: .3rem; }
.periodo-recs .rangos-rapidos .btn { padding: .2rem .5rem; font-size: .8rem; }

/* Campana de avisos (Director y Administrador) */
.campana-caja { position: relative; }
.campana { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  background: transparent; color: var(--texto); border: 1px solid var(--borde); cursor: pointer; }
.campana:hover, .campana[aria-expanded="true"] { background: var(--panel-2); }
.campana.sonando svg { animation: campanea .9s ease-in-out 3; transform-origin: 50% 10%; }
@keyframes campanea { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }
.campana .globo { position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--peligro); color: #fff; font-size: .72rem; font-weight: 800; line-height: 19px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel-avisos { position: absolute; right: 0; top: calc(100% + 8px); z-index: 2500; width: min(420px, calc(100vw - 1.5rem));
  max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--borde);
  border-radius: 10px; box-shadow: var(--sombra); }
.panel-avisos header { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-bottom: 1px solid var(--borde); }
.panel-avisos header h3 { margin: 0; font-size: 1rem; flex: 1; }
.panel-avisos .lista-avisos { overflow-y: auto; }
.panel-avisos .item-aviso { display: block; width: 100%; text-align: left; padding: .65rem .8rem; border: 0; border-bottom: 1px solid var(--borde);
  background: transparent; color: var(--texto); cursor: pointer; font: inherit; }
.panel-avisos .item-aviso:hover { background: var(--panel-2); }
.panel-avisos .item-aviso.nuevo { border-left: 4px solid var(--aviso); background: color-mix(in srgb, var(--aviso) 8%, transparent); }
.panel-avisos .item-aviso b { display: block; margin-bottom: .15rem; }
.panel-avisos .item-aviso small { color: var(--tenue); }
.panel-avisos .pie-avisos { padding: .6rem .8rem; border-top: 1px solid var(--borde); }
.aviso.clic { cursor: pointer; }
@media (max-width: 700px) { .panel-avisos { position: fixed; right: .75rem; left: .75rem; top: 64px; width: auto; } }

/* Portada: dirección segura para teléfonos */
.telefono-portada { display: flex; gap: .9rem; align-items: center; margin-top: 1rem; padding: .8rem; border: 1px dashed var(--borde); border-radius: 10px; background: var(--panel-2); }
.telefono-portada img { flex: none; background: #fff; border-radius: 6px; padding: 4px; }
.telefono-portada b { display: block; margin-bottom: .2rem; }
.telefono-portada span { display: block; color: var(--tenue); font-size: .88rem; }
.telefono-portada a { display: block; margin-top: .35rem; font-size: .85rem; word-break: break-all; color: var(--acento); }
.telefono-portada.alerta { border-style: solid; border-color: #e3a008; }
.telefono-portada.alerta img { display: none; }
@media (max-width: 520px) { .telefono-portada img { width: 104px; height: 104px; } }
.pie-avisos .fila-push { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; }

/* ---------- Ayuda: guía corta de cada pantalla ---------- */
.boton-ayuda { display: inline-flex; align-items: center; gap: .35rem; }
.ayuda-enlace { text-align: center; margin-top: .9rem; }
dialog.ayuda { width: min(940px, calc(100% - 1rem)); max-height: calc(100vh - 2rem); overflow: hidden; }
dialog.ayuda[open] { display: flex; flex-direction: column; }
.ayuda-cabeza { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--borde); }
.ayuda-cabeza h2 { margin: 0; font-size: 1.15rem; }
.ayuda-cuerpo { display: grid; grid-template-columns: 250px 1fr; min-height: 0; flex: 1; }
.ayuda-indice { display: flex; flex-direction: column; gap: .15rem; padding: .7rem; border-right: 1px solid var(--borde); background: var(--panel-2); overflow: auto; }
.ayuda-indice button { text-align: left; background: none; border: 0; border-left: 3px solid transparent; border-radius: 6px; padding: .55rem .7rem; color: var(--tenue); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.ayuda-indice button:hover { color: var(--texto); background: var(--panel); }
.ayuda-indice button[aria-current] { color: var(--texto); background: var(--panel); border-left-color: var(--acento); }
.ayuda-selector { display: none; }
.ayuda-texto { padding: 1rem 1.3rem 1.4rem; overflow: auto; line-height: 1.55; max-height: calc(100vh - 7rem); outline: none; }
.ayuda-texto h3 { margin: 0 0 .7rem; font-size: 1.2rem; }
.ayuda-texto h4 { margin: 1.1rem 0 .4rem; color: var(--acento); font-size: .95rem; }
.ayuda-texto p { margin: .4rem 0; }
.ayuda-texto ol, .ayuda-texto ul { margin: .4rem 0 .4rem 1.3rem; padding: 0; }
.ayuda-texto li { margin: .35rem 0; }
.ayuda-texto li::marker { color: var(--acento); font-weight: 700; }
@media (max-width: 700px) {
  .ayuda-cuerpo { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ayuda-indice { display: none; }
  .ayuda-selector { display: block; padding: .7rem 1rem 0; }
  .ayuda-texto { padding: .8rem 1rem 1.2rem; max-height: calc(100vh - 10rem); }
  .boton-ayuda span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
