/* Pendientero · estilos. Tablero de urgencias: los colores de estado (rojo, ámbar, verde)
   son lo único saturado; todo lo demás es pizarra y papel. Números de ubicación en una
   fuente condensada del sistema (como la rotulación de un hospital). */


:root {
  color-scheme: light dark;
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-num: "Roboto Condensed", sans-serif-condensed, "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;

  --fondo: #edf1f4;
  --superficie: #ffffff;
  --superficie-2: #f3f6f8;
  --tinta: #15232e;
  --tinta-2: #4b5b69;
  --linea: #d3dbe2;
  --linea-fuerte: #9fb0be;
  --foco: #1a5fb4;

  --marino: #1b3447;
  --sobre-marino: #ffffff;
  --sobre-marino-2: #b9c9d6;
  --sel-fondo: #1b3447;
  --sel-tinta: #ffffff;

  --rojo: #c8232c;   --sobre-rojo: #ffffff;  --rojo-suave: #fdecec;  --rojo-texto: #a51d25;
  --ambar: #f0b323;  --sobre-ambar: #3a2a00; --ambar-suave: #fff4d1; --ambar-texto: #6b4a00;
  --verde: #167a46;  --sobre-verde: #ffffff; --verde-suave: #e3f4ea; --verde-texto: #12683b;

  --aviso-fondo: #1b2a38;
  --aviso-tinta: #ffffff;
  --velo: rgb(8 16 24 / 0.6);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0d1620;
    --superficie: #16212c;
    --superficie-2: #1d2a37;
    --tinta: #e7eef4;
    --tinta-2: #9db0c0;
    --linea: #2b3a49;
    --linea-fuerte: #4a5d6f;
    --foco: #7db4ff;

    --marino: #101c28;
    --sobre-marino: #e7eef4;
    --sobre-marino-2: #8fa4b5;
    --sel-fondo: #e7eef4;
    --sel-tinta: #0d1620;

    --rojo: #ff7a80;   --sobre-rojo: #1a0508;  --rojo-suave: #3a1a1e;  --rojo-texto: #ff9ca1;
    --ambar: #f4bb2e;  --sobre-ambar: #2b1e00; --ambar-suave: #392d10; --ambar-texto: #f7cf6b;
    --verde: #3fc383;  --sobre-verde: #04140b; --verde-suave: #142f23; --verde-texto: #7fe0ae;

    --aviso-fondo: #e7eef4;
    --aviso-tinta: #0d1620;
    --velo: rgb(0 0 0 / 0.66);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 400 16px/1.35 var(--fuente);
  -webkit-tap-highlight-color: transparent;
}
body.bloqueado { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }
button:disabled { cursor: not-allowed; }
input, select { font: inherit; color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
[hidden] { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico .relleno { fill: currentColor; stroke: none; }

/* ───────────── Cabecera y pestañas ───────────── */
.cabecera-fija { position: sticky; top: 0; z-index: 30; background: var(--fondo); }
.barra {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: var(--marino); color: var(--sobre-marino);
  border-bottom: 1px solid var(--linea);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.marca h1 { font: 700 25px/1 var(--fuente-num); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { flex: none; }
.barra-der { display: flex; align-items: center; gap: 8px; flex: none; }
.red {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 10px;
  border-radius: 999px; background: rgb(255 255 255 / 0.1); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.red .punto { width: 10px; height: 10px; border-radius: 50%; background: var(--sobre-marino-2); }
.red[data-estado="vivo"] .punto { background: #3fc383; box-shadow: 0 0 0 3px rgb(63 195 131 / 0.25); }
.red[data-estado="reconectando"] .punto { background: #f4bb2e; }
.red[data-estado="sin-red"] .punto { background: #ff7a80; }
.red .red-n { display: inline-flex; align-items: center; gap: 3px; color: var(--sobre-marino-2); }
.btn-barra {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0;
  background: rgb(255 255 255 / 0.1); color: var(--sobre-marino);
}
.btn-barra[aria-pressed="true"] { background: var(--ambar); color: var(--sobre-ambar); }

.pestanas {
  display: flex; gap: 6px; padding: 8px 12px 10px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--linea); background: var(--fondo);
}
.pestanas::-webkit-scrollbar { display: none; }
.pestana {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie); color: var(--tinta);
  font-weight: 700; font-size: 16px;
}
.pestana[aria-selected="true"] { background: var(--sel-fondo); color: var(--sel-tinta); border-color: var(--sel-fondo); }
.insignia {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; text-align: center;
  font: 700 17px/24px var(--fuente-num); background: var(--rojo); color: var(--sobre-rojo);
}
.insignia[data-peor="amarillo"] { background: var(--ambar); color: var(--sobre-ambar); }
.insignia[data-peor="neutro"] { background: var(--linea); color: var(--tinta-2); }

/* ───────────── Contenido ───────────── */
main { max-width: 1500px; margin: 0 auto; padding: 12px 0 132px; outline: none; }
.cargando, .vacio { padding: 36px 20px; text-align: center; color: var(--tinta-2); }
.vacio { display: grid; justify-items: center; gap: 10px; }
.vacio .ico { color: var(--verde-texto); }
.vacio strong { font-size: 18px; color: var(--tinta); }
.herramientas { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 14px 10px; }
.sub { padding: 16px 14px 8px; font-weight: 700; font-size: 15px; color: var(--tinta-2); }

.interruptor { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 15px; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor .pista { width: 46px; height: 28px; border-radius: 14px; background: var(--linea-fuerte); position: relative; transition: background 0.15s; }
.interruptor .pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--superficie); transition: transform 0.15s; }
.interruptor input:checked + .pista { background: var(--sel-fondo); }
.interruptor input:checked + .pista::after { transform: translateX(18px); background: var(--sel-tinta); }
.interruptor input:focus-visible + .pista { outline: 3px solid var(--foco); outline-offset: 2px; }

.rejilla-tarjetas { display: grid; gap: 10px; grid-template-columns: 1fr; padding: 0 12px; }
.rejilla-libres { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); padding: 0 12px; }

/* Tarjeta de ubicación con pendientes */
.tarjeta {
  --riel: var(--linea-fuerte);
  display: flex; flex-direction: column; cursor: pointer;
  background: var(--superficie); border: 1px solid var(--linea); border-left: 8px solid var(--riel); border-radius: 10px;
}
.tarjeta[data-peor="rojo"] { --riel: var(--rojo); }
.tarjeta[data-peor="amarillo"] { --riel: var(--ambar); }
.tarjeta-cab { display: flex; align-items: center; gap: 10px; padding: 8px 8px 4px 12px; }
.ubic { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.ubic-num { font: 700 42px/0.95 var(--fuente-num); letter-spacing: -0.01em; }
.ubic-nom { font-weight: 700; font-size: 17px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resumen { display: flex; gap: 4px; }
.cuenta { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; text-align: center; font: 700 17px/26px var(--fuente-num); }
.cuenta[data-estado="rojo"] { background: var(--rojo); color: var(--sobre-rojo); }
.cuenta[data-estado="amarillo"] { background: var(--ambar); color: var(--sobre-ambar); }
.btn-mas {
  width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 12px;
  border: 1.5px solid var(--linea-fuerte); background: var(--superficie-2); color: var(--tinta);
}
.filas { display: flex; flex-direction: column; padding: 0 10px 8px 12px; }
.fila { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 54px; padding: 5px 0; border-top: 1px solid var(--linea); }
.fila:first-child { border-top: 0; }
.mas-filas { padding: 6px 0 2px; font-weight: 700; font-size: 14px; color: var(--tinta-2); }

.hora {
  display: grid; place-items: center; min-width: 64px; min-height: 34px; padding: 0 6px; border-radius: 7px;
  border: 1px solid var(--linea-fuerte); background: var(--superficie-2);
  font: 600 20px/1 var(--fuente-num); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hora.dia { border-style: dashed; background: transparent; color: var(--tinta-2); font: 700 13px/1.1 var(--fuente); }
.hora.vencida { background: var(--rojo); border-color: var(--rojo); color: var(--sobre-rojo); }
.tipo { display: flex; flex-direction: column; min-width: 0; }
.tipo-nombre { display: flex; align-items: flex-start; gap: 7px; font-weight: 700; font-size: 16px; line-height: 1.2; min-width: 0; }
.tipo-nombre .ico { margin-top: 1px; }
.tipo-nombre span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tipo-notas { font-size: 14px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tipo-donde { font: 700 17px/1.1 var(--fuente); }
.retraso { font-size: 13.5px; font-weight: 700; color: var(--rojo-texto); }

.pildora {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 106px; min-height: 44px; padding: 0 12px 0 10px;
  border-radius: 999px; border: 0; font-weight: 700; font-size: 15px; white-space: nowrap;
}
.pildora[data-estado="rojo"] { background: var(--rojo); color: var(--sobre-rojo); }
.pildora[data-estado="amarillo"] { background: var(--ambar); color: var(--sobre-ambar); }
.pildora[data-estado="verde"] { background: var(--verde); color: var(--sobre-verde); }
.pildora[data-guardando="1"] { opacity: 0.6; }

/* Ubicación libre */
.libre {
  display: grid; place-items: center; min-height: 58px; border-radius: 9px; border: 1.5px dashed var(--linea-fuerte);
  background: transparent; color: var(--tinta-2); font: 600 26px/1 var(--fuente-num);
}
.libre:hover { background: var(--superficie); border-style: solid; color: var(--tinta); }

.destello { animation: destello 1.6s ease-out; }
@keyframes destello { 0% { box-shadow: 0 0 0 5px var(--foco); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ───────────── Panel general ───────────── */
.contadores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 12px 10px; }
.contador {
  --c: var(--linea-fuerte);
  display: grid; justify-items: start; gap: 2px; min-height: 76px; padding: 8px 10px; text-align: left;
  background: var(--superficie); border: 1px solid var(--linea); border-top: 5px solid var(--c); border-radius: 10px;
}
.contador[data-estado="rojo"] { --c: var(--rojo); }
.contador[data-estado="amarillo"] { --c: var(--ambar); }
.contador[data-estado="verde"] { --c: var(--verde); }
.contador[aria-pressed="true"] { outline: 3px solid var(--foco); outline-offset: 1px; }
.contador b { font: 700 34px/1 var(--fuente-num); }
.contador span { font-size: 13px; font-weight: 700; color: var(--tinta-2); line-height: 1.15; }

.busqueda { display: flex; gap: 8px; padding: 0 12px 10px; }
.campo-buscar { position: relative; flex: 1; min-width: 0; }
.campo-buscar .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tinta-2); pointer-events: none; }
.campo-buscar input[type="search"] { padding-left: 42px; }
.btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px;
  border-radius: 12px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie); font-weight: 700; font-size: 15.5px; white-space: nowrap;
}
.btn-sec[aria-expanded="true"] { background: var(--superficie-2); }
.btn-sec .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--sel-fondo); color: var(--sel-tinta); font: 700 15px/22px var(--fuente-num); text-align: center; }
.filtros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 12px 12px; padding: 12px; background: var(--superficie); border: 1px solid var(--linea); border-radius: 12px; }
.filtros label { display: grid; gap: 4px; min-width: 0; font-weight: 700; font-size: 14px; color: var(--tinta-2); }
.filtros .ancho { grid-column: 1 / -1; }

input[type="text"], input[type="search"], input[type="time"], input[type="password"], input[type="number"], input[type="date"], select {
  width: 100%; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--linea-fuerte);
  background: var(--superficie); font-size: 17px; font-weight: 400;
}
select { padding-right: 8px; }
input::placeholder { color: var(--tinta-2); opacity: 0.85; }
input[aria-invalid="true"] { border-color: var(--rojo); }

.lista-todos { margin: 0 12px; background: var(--superficie); border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; }
.fila-todos {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 64px; padding: 8px 10px 8px 12px;
  border-top: 1px solid var(--linea); border-left: 6px solid var(--c, var(--linea-fuerte)); cursor: pointer;
}
.fila-todos:first-child { border-top: 0; }
.fila-todos[data-estado="rojo"] { --c: var(--rojo); }
.fila-todos[data-estado="amarillo"] { --c: var(--ambar); }
.fila-todos[data-estado="verde"] { --c: var(--verde); }
.divisor { padding: 10px 14px 6px; font-weight: 700; font-size: 14px; color: var(--tinta-2); background: var(--superficie-2); border-top: 1px solid var(--linea); }
.divisor:first-child { border-top: 0; }

/* ───────────── Botón flotante, pie, avisos ───────────── */
.fab {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25;
  display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 22px 0 16px;
  border: 0; border-radius: 18px; background: var(--sel-fondo); color: var(--sel-tinta); font-weight: 700; font-size: 18px;
  box-shadow: 0 6px 0 rgb(0 0 0 / 0.14);
}
.fab:active { transform: translateY(2px); box-shadow: 0 4px 0 rgb(0 0 0 / 0.14); }
.pie { max-width: 1500px; margin: 0 auto; padding: 0 16px calc(86px + env(safe-area-inset-bottom)); font-size: 13.5px; color: var(--tinta-2); text-align: center; }

.avisos {
  position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.aviso {
  pointer-events: none; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px; min-height: 52px; padding: 8px 8px 8px 16px;
  border-radius: 12px; background: var(--aviso-fondo); color: var(--aviso-tinta); font-weight: 700; font-size: 15.5px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.3); animation: entra 0.18s ease-out;
}
.aviso[data-tipo="error"] { border-left: 6px solid var(--rojo); }
.aviso[data-tipo="ok"] { border-left: 6px solid var(--verde); }
.aviso span { flex: 1; }
.aviso button { pointer-events: auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: rgb(127 127 127 / 0.28); font-weight: 700; color: inherit; }
.hoja .avisos { bottom: calc(16px + env(safe-area-inset-bottom)); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ───────────── Hojas (diálogos) ───────────── */
.hoja {
  border: 0; padding: 0; width: 100%; max-width: 640px; max-height: 94vh; max-height: 94dvh; margin: auto auto 0;
  background: var(--superficie); color: var(--tinta); border-radius: 18px 18px 0 0; overflow: hidden;
}
.hoja[open] { display: flex; flex-direction: column; animation: sube 0.2s ease-out; }
.hoja::backdrop { background: var(--velo); }
.hoja.ancha { max-width: 760px; }
@keyframes sube { from { opacity: 0.6; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (min-width: 720px) {
  .hoja { margin: auto; border-radius: 16px; max-height: 90vh; max-height: 90dvh; }
}
.hoja-cab { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--linea); flex: none; }
.hoja-titulo { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font: 700 20px/1.1 var(--fuente); }
.hoja-titulo .ubic-num { font-size: 44px; }
.btn-icono {
  width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 12px; border: 0;
  background: transparent; color: var(--tinta);
}
.btn-icono:hover { background: var(--superficie-2); }
.btn-icono.peligro { color: var(--rojo-texto); }
.hoja-cuerpo { overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px; align-content: start; }
.hoja-cuerpo > * { min-width: 0; }

.lista-hoja { display: grid; gap: 10px; }
.item {
  --c: var(--linea-fuerte);
  display: grid; gap: 10px; padding: 10px 10px 10px 12px;
  border: 1px solid var(--linea); border-left: 8px solid var(--c); border-radius: 10px; background: var(--superficie);
}
.item[data-estado="rojo"] { --c: var(--rojo); }
.item[data-estado="amarillo"] { --c: var(--ambar); }
.item[data-estado="verde"] { --c: var(--verde); }
.item-cab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.item-acciones { display: flex; gap: 2px; }
.segmentos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmento {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 4px 2px;
  border-radius: 10px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie-2); font-weight: 700; font-size: 14px; line-height: 1.1; text-align: center;
}
.segmento[aria-pressed="true"][data-estado="rojo"] { background: var(--rojo); border-color: var(--rojo); color: var(--sobre-rojo); }
.segmento[aria-pressed="true"][data-estado="amarillo"] { background: var(--ambar); border-color: var(--ambar); color: var(--sobre-ambar); }
.segmento[aria-pressed="true"][data-estado="verde"] { background: var(--verde); border-color: var(--verde); color: var(--sobre-verde); }
.vacio-hoja { padding: 14px; text-align: center; color: var(--tinta-2); border: 1.5px dashed var(--linea-fuerte); border-radius: 10px; }

.hechos { border: 1px solid var(--linea); border-radius: 10px; background: var(--superficie-2); }
.hechos summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; font-weight: 700; cursor: pointer; list-style: none; }
.hechos summary::-webkit-details-marker { display: none; }
.hechos summary .ico { transition: transform 0.15s; }
.hechos[open] summary .ico { transform: rotate(90deg); }
.hechos .lista-hoja { padding: 0 10px 10px; }

/* Formulario */
.formulario { display: grid; gap: 16px; }
.formulario fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.formulario legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 16px; }
.chips-area { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie);
  font-weight: 700; font-size: 15.5px;
}
.chip[aria-pressed="true"] { background: var(--sel-fondo); border-color: var(--sel-fondo); color: var(--sel-tinta); }
.numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.numero { min-height: 50px; border-radius: 10px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie); font: 600 24px/1 var(--fuente-num); }
.numero[aria-pressed="true"] { background: var(--sel-fondo); border-color: var(--sel-fondo); color: var(--sel-tinta); }
.numero[data-ocupado="1"]::after { content: ""; display: block; width: 6px; height: 6px; margin: 2px auto -4px; border-radius: 50%; background: var(--rojo); }
/* minmax(0, 1fr): una palabra larga no ensancha la columna ni saca la cuadrícula de la pantalla */
.tipos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tipo-btn {
  display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 0 8px 0 10px; text-align: left; min-width: 0;
  border-radius: 12px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie); font-weight: 700; font-size: clamp(14px, 3.9vw, 15.5px); line-height: 1.15;
  overflow-wrap: anywhere; hyphens: auto;
}
.tipo-btn[aria-pressed="true"] { background: var(--sel-fondo); border-color: var(--sel-fondo); color: var(--sel-tinta); }
.dos-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.atajos { display: flex; flex-wrap: wrap; gap: 6px; }
.atajos .chip { min-height: 40px; padding: 0 12px; font-size: 14.5px; }
.fila-hora { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; }
.ayuda { font-size: 14px; color: var(--tinta-2); }
.error-campo { font-size: 14.5px; font-weight: 700; color: var(--rojo-texto); }
.primario {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 18px; width: 100%;
  border: 0; border-radius: 14px; background: var(--sel-fondo); color: var(--sel-tinta); font-weight: 700; font-size: 18px;
}
.primario:disabled { opacity: 0.4; }
.primario.peligro { background: var(--rojo); color: var(--sobre-rojo); }
.secundario {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 16px; width: 100%;
  border-radius: 14px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie); font-weight: 700; font-size: 16.5px;
}
.botones { display: grid; gap: 8px; }
.botones.dos { grid-template-columns: 1fr 1fr; }
.hoja.chica { max-width: 460px; }
.chica .hoja-cuerpo { gap: 14px; }
.privacidad { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--superficie-2); font-size: 14px; color: var(--tinta-2); }
.privacidad .ico { margin-top: 1px; }

/* ───────────── Administración ───────────── */
.admin-nav { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--linea); flex: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav .chip { flex: none; }
.admin-cuerpo { padding-top: 12px; }
.tarjeta-admin { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--linea); border-left: 8px solid var(--c, var(--linea-fuerte)); border-radius: 10px; background: var(--superficie); }
.tarjeta-admin[data-estado="rojo"] { --c: var(--rojo); }
.tarjeta-admin[data-estado="amarillo"] { --c: var(--ambar); }
.tarjeta-admin[data-estado="verde"] { --c: var(--verde); }
.tarjeta-admin[data-eliminado="1"] { opacity: 0.8; border-style: dashed; }
.ta-cab { display: flex; align-items: center; gap: 10px; }
.ta-cab strong { font: 700 20px/1.1 var(--fuente); flex: 1; min-width: 0; }
.etiqueta { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 13px; font-weight: 700; font-size: 13.5px; background: var(--superficie-2); border: 1px solid var(--linea); white-space: nowrap; }
.etiqueta[data-estado="rojo"] { background: var(--rojo-suave); color: var(--rojo-texto); border-color: transparent; }
.etiqueta[data-estado="amarillo"] { background: var(--ambar-suave); color: var(--ambar-texto); border-color: transparent; }
.etiqueta[data-estado="verde"] { background: var(--verde-suave); color: var(--verde-texto); border-color: transparent; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14.5px; margin: 0; }
.datos dt { color: var(--tinta-2); font-weight: 700; }
.datos dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cambios { display: grid; gap: 4px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--linea-fuerte); font-size: 14.5px; }
.cambios li { display: grid; gap: 1px; }
.cambios small { color: var(--tinta-2); }
.filtros-admin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.filtros-admin .ancho { grid-column: 1 / -1; }
.acciones-fila { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-chico { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--linea-fuerte); background: var(--superficie); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.btn-chico.peligro { color: var(--rojo-texto); border-color: var(--rojo-texto); }
.panel-info { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--linea); border-radius: 12px; background: var(--superficie-2); }
.bloque { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--linea); border-radius: 12px; }
.bloque h3 { font-size: 17px; }
.fila-campo { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.fila-campo input { max-width: 110px; }
.mas-resultados { display: grid; place-items: center; padding: 6px 0; }

@media (min-width: 640px) {
  .rejilla-tarjetas { grid-template-columns: repeat(2, 1fr); }
  .rejilla-libres { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .filtros { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .contador b { font-size: 40px; }
}
@media (min-width: 1000px) {
  .rejilla-tarjetas { grid-template-columns: repeat(3, 1fr); }
  .fab { right: 24px; bottom: 24px; }
}
@media (min-width: 1400px) {
  .rejilla-tarjetas { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 440px) {
  .red .red-txt { display: none; }
  .red { padding: 0 10px; }
}
@media (max-width: 380px) {
  .marca h1 { font-size: 22px; }
  .pildora { min-width: 98px; font-size: 14px; padding: 0 8px; }
  .hora { min-width: 56px; }
  .tipos { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
input[type="date"], input[type="time"] { min-width: 0; }

/* Administración (extras) */
.item .tipo-notas { white-space: normal; }
.admin-seccion { display: grid; gap: 12px; }
.campo { min-width: 0; display: grid; gap: 4px; font-weight: 700; font-size: 14px; color: var(--tinta-2); }
.campo.ancho { grid-column: 1 / -1; }
.bitacora { margin-top: 0; padding-top: 0; border-top: 0; gap: 8px; }
.bitacora li { padding: 8px 10px; border: 1px solid var(--linea); border-radius: 10px; background: var(--superficie); }
.cambios span { overflow-wrap: anywhere; }
