/* MANTTO · estilos. Software de mantenimiento · creado YM-2026-10-01
   Misma familia que PMM Detal (barra blanca, tarjetas, Segoe UI); la marca es
   propia: marino de taller y ámbar de seguridad. El color de un estado siempre
   va con su nombre escrito: nunca es la única señal. */

:root {
  --fondo: #eef1f4;
  --papel: #ffffff;
  --tinta: #1b2733;
  --tenue: #5b6875;
  --linea: #d6dde4;
  --marca: #14324A;
  --marca-2: #0d2233;
  --acento: #E8A317;
  --bien: #1a7f37;
  --mal: #c62828;
  --medio: #a15c00;
  --sombra: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 14px rgba(20, 30, 50, .06);
  --radio: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px; color: var(--tinta); background: var(--fondo);
}
a { color: var(--marca); }
button, select, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

/* ---------- barra superior ---------- */
.barra {
  display: flex; align-items: center; gap: 14px; padding: 6px 16px;
  background: #fff; border-bottom: 3px solid var(--acento);
  position: sticky; top: 0; z-index: 30;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--marca); }
.logo img { width: 34px; height: 34px; display: block; }
.logo b { font-size: 20px; font-weight: 800; letter-spacing: .6px; line-height: 1; }
.logo small { display: block; font-size: 10.5px; font-weight: 600; color: var(--tenue); letter-spacing: 0; }
.nav { display: flex; gap: 2px; }
.nav a {
  text-decoration: none; color: var(--tenue); padding: 7px 12px; border-radius: 8px; font-weight: 600; white-space: nowrap;
}
.nav a:hover { background: #f1f4f7; color: var(--marca); }
.nav a.activo { background: #e7edf3; color: var(--marca); }
.barra .espacio { flex: 1; }
.quien { text-align: right; line-height: 1.15; font-size: 12px; }
.quien small { color: var(--tenue); }
.boton-barra {
  color: var(--marca); text-decoration: none; padding: 5px 10px; border-radius: 6px; font-size: 13px;
  border: 1px solid var(--linea); background: #fff; white-space: nowrap;
}
.boton-barra:hover { background: #f1f4f7; }
.cinta-prueba {
  background: repeating-linear-gradient(135deg, #fff4d6, #fff4d6 10px, #ffeab0 10px, #ffeab0 20px);
  color: #6b4500; text-align: center; font-size: 12px; font-weight: 600; padding: 4px 8px; border-bottom: 1px solid #f0d58a;
}

.contenido { padding: 16px; max-width: 1400px; margin: 0 auto; }
.encab { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.encab h1 { font-size: 22px; color: var(--marca); }
.encab p { margin: 2px 0 0; color: var(--tenue); }

/* ---------- botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--marca); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.boton:hover { background: var(--marca-2); }
.boton:disabled { opacity: .55; cursor: default; }
.boton.acento { background: var(--acento); color: #2b1d00; }
.boton.acento:hover { background: #d39410; }
.boton.claro { background: #fff; color: var(--marca); border: 1px solid var(--linea); }
.boton.claro:hover { background: #f1f4f7; }
.boton.peligro { background: #fff; color: var(--mal); border: 1px solid #f0c4c4; }
.boton.peligro:hover { background: #fdf1f1; }
.boton.grande { padding: 12px 20px; font-size: 15px; }

/* ---------- tarjetas y números ---------- */
.tarjeta { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; }
.cifras { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.cifra {
  background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 12px 14px;
  text-decoration: none; color: inherit; border-top: 3px solid transparent; display: block;
}
a.cifra:hover { border-top-color: var(--acento); }
.cifra .n { font-size: 26px; font-weight: 700; color: var(--marca); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cifra .t { font-size: 12px; color: var(--tenue); font-weight: 600; }
.cifra.alerta .n { color: var(--mal); }

.rejilla { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }

/* ---------- filtros ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 10px; }
.vistas { display: flex; gap: 4px; flex-wrap: wrap; }
.vistas a {
  text-decoration: none; padding: 5px 11px; border-radius: 16px; border: 1px solid var(--linea);
  color: var(--tenue); font-weight: 600; font-size: 13px; background: #fff;
}
.vistas a.activo { background: var(--marca); color: #fff; border-color: var(--marca); }
.filtros select, .filtros input[type=search] {
  padding: 6px 8px; border: 1px solid var(--linea); border-radius: 6px; background: #fff; min-width: 0;
}
.filtros input[type=search] { flex: 1; min-width: 160px; }
.filtros label.casilla { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--tenue); }
/* Usuarios · alcance: compañías y tipos de sede en una fila que se parte. */
.opciones-alcance { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; font-weight: 400; }
.opciones-alcance .casilla { display: flex; align-items: center; gap: 5px; }

/* ---------- la bandeja ---------- */
.lista { display: flex; flex-direction: column; gap: 8px; }
.caso {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 10px 14px;
  text-decoration: none; color: inherit; border-left: 4px solid transparent;
}
.caso:hover { box-shadow: 0 2px 4px rgba(20,30,50,.08), 0 8px 22px rgba(20,30,50,.10); }
.caso.urgente { border-left-color: var(--mal); }
.caso .ico { width: 48px; height: 48px; }
.caso .titulo { font-weight: 700; font-size: 15px; }
.caso .titulo .cod { color: var(--tenue); font-weight: 600; font-size: 12px; margin-right: 6px; }
.caso .sub { color: var(--tenue); font-size: 13px; margin-top: 2px; }
.caso .desc { margin-top: 4px; font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.caso .lado { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 12px; color: var(--tenue); }
.vacio { text-align: center; color: var(--tenue); padding: 40px 16px; }

.ico { border-radius: 10px; object-fit: contain; flex: none; }
.ico-letras {
  display: inline-grid; place-items: center; background: linear-gradient(135deg, #2c5677, #14324A);
  color: #fff; font-weight: 700; font-size: 16px; width: 48px; height: 48px;
}

/* Estados: texto + color. */
.estado { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.e-pendiente   { background: #fdecc8; color: #7a4b00; }
.e-en_revision { background: #e5e1f7; color: #4b3a99; }
.e-asignada    { background: #dbe9f9; color: #1d4f8c; }
.e-en_proceso  { background: #d6f0f2; color: #0f5f66; }
.e-resuelta    { background: #dcf1e1; color: #1a6b33; }
.e-cerrada     { background: #e9ecef; color: #3e4a56; }
.e-cancelada   { background: #f3e1e1; color: #8a2d2d; text-decoration: line-through; }
.urg { display: inline-block; background: #fde3e3; color: var(--mal); font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.tipo { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; border: 1px solid currentColor; }
.t-punto_venta { color: #8a4f12; }
.t-bodega      { color: #1d4f8c; }
.t-planta      { color: #6b3a8c; }
.t-oficina     { color: #3e4a56; }
.prueba { display: inline-block; font-size: 10.5px; font-weight: 700; color: #6b4500; background: #fff1c7; padding: 1px 6px; border-radius: 8px; }

/* ---------- lateral ---------- */
.lateral h3 { font-size: 13px; color: var(--tenue); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.top-sedes { list-style: none; margin: 0; padding: 0; }
.top-sedes li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #eef1f4; }
.top-sedes li:last-child { border-bottom: 0; }
.top-sedes a { text-decoration: none; color: var(--tinta); font-weight: 600; font-size: 13px; }
.top-sedes .n { font-weight: 700; color: var(--marca); font-variant-numeric: tabular-nums; }
.barrita { height: 4px; background: #eef1f4; border-radius: 2px; margin-top: 4px; }
.barrita i { display: block; height: 100%; background: var(--marca); border-radius: 2px; }

/* ---------- formulario de reporte ---------- */
.pasos { display: flex; flex-direction: column; gap: 14px; max-width: 860px; margin: 0 auto; }
.paso h2 { font-size: 15px; color: var(--marca); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.paso h2 .num {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--marca); color: #fff; font-size: 13px;
}
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.cats label, .ubics label {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px solid var(--linea); border-radius: 10px; padding: 10px 6px; font-size: 12.5px; font-weight: 600; background: #fff;
}
.cats label:hover, .ubics label:hover { border-color: #9fb3c6; }
.cats input, .ubics input { position: absolute; opacity: 0; pointer-events: none; }
.cats label:has(input:checked), .ubics label:has(input:checked) { border-color: var(--marca); background: #eaf0f6; }
.cats label:has(input:focus-visible), .ubics label:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 2px; }
.cats .ico { width: 52px; height: 52px; }
.ubics { display: flex; flex-wrap: wrap; gap: 8px; }
.ubics label { flex-direction: row; padding: 8px 14px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.campo input, .campo select, .campo textarea {
  padding: 9px 10px; border: 1px solid var(--linea); border-radius: 8px; background: #fff; font-weight: 400; font-size: 14px;
}
.campo textarea { min-height: 90px; resize: vertical; }
.campo small { color: var(--tenue); font-weight: 400; }
.fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.interruptor { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--linea); border-radius: 10px; cursor: pointer; background: #fff; }
.interruptor:has(input:checked) { border-color: var(--mal); background: #fdf1f1; }
.interruptor b { color: var(--mal); }
.fotos-elegir { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fotos-elegir .mini { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; border: 1px solid var(--linea); }
.subir {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 2px dashed #9fb3c6; border-radius: 10px;
  cursor: pointer; color: var(--marca); font-weight: 600; background: #f7f9fb;
}
.subir input { display: none; }
.error-form { color: var(--mal); font-weight: 600; min-height: 1em; }
.acciones-form { display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- detalle ---------- */
.detalle { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.cabeza-caso { display: flex; gap: 14px; align-items: flex-start; }
.cabeza-caso .ico { width: 64px; height: 64px; }
.cabeza-caso h1 { font-size: 20px; color: var(--marca); }
.cabeza-caso .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.datos-caso { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 16px; margin-top: 14px; }
.datos-caso div small { display: block; color: var(--tenue); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.datos-caso div span { font-weight: 600; }
.descripcion { margin-top: 14px; padding: 12px; background: #f7f9fb; border-radius: 8px; white-space: pre-wrap; line-height: 1.45; }
.galeria { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.galeria a { position: relative; display: block; }
.galeria img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linea); display: block; }
.galeria .mom { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; background: rgba(13,34,51,.8); color: #fff; padding: 1px 6px; border-radius: 6px; }
.seccion { margin-top: 18px; }
.seccion > h3 { font-size: 13px; color: var(--tenue); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }

/* Línea de tiempo: cada salto con cuánto tardó. */
.tiempo { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--linea); }
.tiempo li { position: relative; padding: 0 0 14px 10px; }
.tiempo li::before {
  content: ""; position: absolute; left: -25px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--marca);
}
.tiempo .cuando { font-size: 12px; color: var(--tenue); }
.tiempo .que { font-weight: 600; }
.tiempo .nota { margin-top: 3px; white-space: pre-wrap; font-size: 13px; }
.tiempo .lapso { font-size: 11.5px; color: var(--medio); font-weight: 600; }

.panel-acciones h3 { font-size: 15px; color: var(--marca); margin-bottom: 4px; }
.panel-acciones p.ayuda { margin: 0 0 12px; color: var(--tenue); font-size: 13px; }
.panel-acciones .botones { display: flex; flex-direction: column; gap: 6px; }
.panel-acciones .boton { width: 100%; }
.panel-acciones form { display: flex; flex-direction: column; gap: 10px; }
.ficha dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.ficha dt { color: var(--tenue); }
.ficha dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---------- tablas (sedes, usuarios) ---------- */
table.datos { width: 100%; border-collapse: collapse; background: var(--papel); }
table.datos th, table.datos td { padding: 8px 10px; border-bottom: 1px solid #eef1f4; text-align: left; vertical-align: middle; }
table.datos th { font-size: 12px; color: var(--tenue); text-transform: uppercase; letter-spacing: .3px; background: #f7f9fb; position: sticky; top: 0; }
table.datos td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.datos tr:hover td { background: #fafbfc; }
.envoltura-tabla { overflow: auto; border-radius: var(--radio); box-shadow: var(--sombra); max-height: 70vh; }
.clave { font-family: Consolas, monospace; font-size: 15px; letter-spacing: 1px; background: #f1f4f7; padding: 2px 8px; border-radius: 6px; }

/* ---------- avisos y ventanas ---------- */
.aviso { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.aviso.error { background: #fdecec; color: #8a1f1f; }
.aviso.ok { background: #e3f4e8; color: #17602f; }
dialog { border: 0; border-radius: 14px; padding: 22px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 25, 45, .45); }
dialog h2 { color: var(--marca); font-size: 18px; margin-bottom: 12px; }
dialog form { display: flex; flex-direction: column; gap: 12px; }
.visor { width: min(1100px, calc(100vw - 32px)); padding: 8px; background: #111; }
.visor img { max-width: 100%; max-height: 82vh; display: block; margin: 0 auto; }

/* ---------- ingreso ---------- */
.ingreso { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, #24506f 0, #14324A 45%, #0b1d2b 100%); }
.ingreso .tarjeta { width: 100%; max-width: 440px; padding: 28px; }
.ingreso .logo { justify-content: center; margin-bottom: 4px; }
.ingreso .logo img { width: 52px; height: 52px; }
.ingreso .logo b { font-size: 30px; }
.lema { text-align: center; color: var(--tenue); margin: 0 0 20px; }
.pregunta { font-weight: 700; margin: 0 0 8px; }
.tipos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.tipos button {
  border: 2px solid var(--linea); background: #fff; border-radius: 10px; padding: 10px 6px; cursor: pointer;
  font-weight: 600; font-size: 13px; line-height: 1.2;
}
.tipos button small { display: block; font-weight: 400; color: var(--tenue); font-size: 11px; margin-top: 3px; }
.tipos button.activo { border-color: var(--marca); background: #eaf0f6; }
.google {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; border-radius: 8px;
  border: 1px solid var(--linea); text-decoration: none; color: var(--tinta); font-weight: 600; background: #fff;
}
.google:hover { background: #f7f9fb; }
.nota { color: var(--tenue); font-size: 12.5px; margin: 8px 0 0; }
.paso-ingreso { display: flex; flex-direction: column; gap: 12px; }
.pruebas { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--linea); }
.pruebas h2 { font-size: 13px; color: var(--medio); margin-bottom: 8px; }
.pruebas form { display: flex; gap: 8px; }
.pruebas select { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--linea); border-radius: 8px; }

/* ---------- pantallas medianas y teléfonos ---------- */
@media (max-width: 1100px) {
  .cifras { grid-template-columns: repeat(3, 1fr); }
  .rejilla, .detalle { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .barra { flex-wrap: wrap; gap: 6px 10px; padding: 6px 12px; }
  .logo small { display: none; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .quien { display: none; }
  .contenido { padding: 12px; }
  .cifras { grid-template-columns: repeat(2, 1fr); }
  .caso { grid-template-columns: 40px 1fr; }
  .caso .ico { width: 40px; height: 40px; }
  .caso .lado { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .tipos { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .encab h1 { font-size: 19px; }
}

/* ---------- ajustes del 2026-10-02 ---------- */
.sede-elegida { display: flex; align-items: center; gap: 12px; }
.sede-elegida img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linea); }
.sede-elegida p { margin: 0; }
.ubic-auto { margin: 0 0 4px; padding: 10px 12px; background: #eaf0f6; border-radius: 8px; }
.enlace { background: none; border: 0; color: var(--marca); text-decoration: underline; cursor: pointer; padding: 0 4px; font-weight: 600; }
.con-dictado { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dictar { padding: 6px 12px; font-size: 13px; }
.dictar.grabando { background: #fdecec; color: var(--mal); border-color: #f0c4c4; animation: latido 1.2s infinite; }
@keyframes latido { 50% { opacity: .55; } }
.oyendo { color: var(--mal); font-weight: 600; }
.ok-txt { color: var(--bien); font-weight: 600; }
.mal-txt { color: var(--mal); font-weight: 600; }
.foto-sede { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linea); display: block; }
.sin-foto { width: 64px; height: 44px; border-radius: 6px; border: 1px dashed var(--linea); display: grid; place-items: center; color: var(--tenue); font-size: 18px; }
.foto-ficha { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; display: block; }
.foto-editar { display: flex; align-items: center; gap: 12px; }
.foto-editar img { width: 120px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linea); }
.b-instalar { display: inline-flex; align-items: center; gap: 8px; }
.b-instalar img { width: 22px; height: 22px; border-radius: 5px; }
.instalar-ingreso { width: 100%; justify-content: center; margin-top: 14px; }
.barra .corto { display: none; }
@media (max-width: 720px) {
  .barra .largo { display: none; }
  .barra .corto { display: inline; }
  .barra .boton-barra { padding: 5px 8px; }
  .barra .b-instalar img { width: 18px; height: 18px; }
}
html.en-app .cinta-prueba { font-size: 11px; }

/* ---------- celular, App y teléfono acostado (Yeison, 2026-10-02: «en la versión
   app se sale de la pantalla y me pone scroll, se ve raro… y lo mismo al voltear la
   pantalla») ---------- */
/* Nada se sale a lo ancho. clip (y no hidden) para no romper la barra pegada arriba. */
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
/* El ingreso: la tarjeta ya no crece con la opción más larga de una lista. */
.ingreso { grid-template-columns: minmax(0, 440px); justify-content: center; }
.ingreso .tarjeta { min-width: 0; }
.pruebas select, .filtros select { max-width: 100%; text-overflow: ellipsis; }
/* Bordes del teléfono (la muesca, y los lados con el teléfono acostado). */
.barra { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.contenido { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
html.en-app .barra { padding-top: max(6px, env(safe-area-inset-top)); }
dialog { max-height: calc(100dvh - 24px); overflow: auto; }

/* Tableta y teléfono acostado: la barra en una sola fila; el menú se desliza
   dentro de su espacio en vez de empujar la página. */
@media (max-width: 1000px) {
  .quien, .logo small, .barra .espacio { display: none; }
  .nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .barra .largo { display: none; }
  .barra .corto { display: inline; }
  .barra .boton-barra { padding: 5px 8px; }
  /* En iPhone, un campo con letra menor de 16 px agranda la pantalla al tocarlo. */
  input, select, textarea, .campo input, .campo select, .campo textarea { font-size: 16px; }
}
/* Teléfono parado: el menú baja a su propia fila, a todo lo ancho, repartido. */
@media (max-width: 720px) {
  .nav { flex: 1 0 100%; order: 3; justify-content: space-around; }
  .nav a { padding: 7px 8px; }
  .caso .lado { flex-wrap: wrap; gap: 4px 10px; }
}

/* Tablas (Sedes, Usuarios) en tarjetas: una fila = una tarjeta con sus etiquetas,
   sin desplazar de lado. */
@media (max-width: 900px) {
  .envoltura-tabla { max-height: none !important; overflow: visible; box-shadow: none !important; border-radius: 0; }
  table.datos, table.datos tbody, table.datos tr, table.datos td { display: block; width: 100%; }
  table.datos { background: none; }
  table.datos thead { display: none; }
  table.datos tr { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); margin-bottom: 10px; padding: 10px 14px; }
  table.datos td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
  table.datos td:empty { display: none; }
  table.datos td[data-e]::before { content: attr(data-e); color: var(--tenue); font-size: 12px; font-weight: 600; text-align: left; flex: none; }
  table.datos td.principal { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid #eef1f4; margin-bottom: 4px; }
  table.datos td.acciones-fila { justify-content: flex-end; flex-wrap: wrap; padding-top: 8px; }
  table.datos tr:hover td { background: none; }
  .foto-sede { width: 100%; height: 130px; }
  table.datos td.foto { display: block; padding: 0 0 6px; }
  table.datos td.foto.sin { display: none; }
}

/* Teléfono acostado (poca altura): la barra no se queda pegada arriba, para no
   comerse media pantalla. */
@media (max-height: 500px) and (orientation: landscape) {
  .barra { position: static; }
  .contenido > .filtros { position: static; }
  .tut-tarjeta { max-height: calc(100dvh - 24px); overflow: auto; }
  /* Los seis números en una sola fila, más bajitos. */
  /* Acostado, aunque sea angosto, la barra va en una sola fila. */
  .barra { flex-wrap: nowrap; }
  .nav { order: 0; flex: 1 1 auto; width: auto; justify-content: flex-start; }
  .cifras { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .cifra { padding: 8px 10px; }
  .cifra .n { font-size: 20px; }
  .cifra .t { font-size: 11px; }
  .encab { margin-bottom: 8px; }
  .encab h1 { font-size: 18px; }
}

/* ---------- pantalla de carga: el logo latiendo (includes/plantilla.php, assets/app.js) ---------- */
/* Escondida mientras la página carga rápido: aparece solo si tarda más de 0,35 s
   (la demora la pone el animation-delay). El logo no baja a cero al latir: un
   apagón completo parece una falla, no una marca respirando (lo mismo que en SORE). */
.cargando {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, #24506f 0, #14324A 50%, #0b1d2b 100%);
  visibility: hidden; opacity: 0;
}
.cargando > div { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; }
.cargando img { width: 96px; height: 96px; animation: logo-late 1.4s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(0,0,0,.35)); }
.cargando b { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.cargando small { color: #c9d6e2; font-size: 13px; }
html:not(.listo) .cargando, html.saliendo .cargando { animation: cortina-entra .25s ease .35s both; }
@keyframes cortina-entra { from { visibility: visible; opacity: 0; } to { visibility: visible; opacity: 1; } }
@keyframes logo-late { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { .cargando img { animation: none; } }

/* ---------- tutorial guiado (assets/tutorial.js) ---------- */
/* La capa transparente impide tocar la página; la sombra enorme del foco es la que
   oscurece todo menos el elemento. */
.tut-capa { position: fixed; inset: 0; z-index: 900; }
.tut-foco {
  position: fixed; z-index: 901; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--acento), 0 0 0 9999px rgba(10, 22, 34, .62);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
.tut-tarjeta {
  position: fixed; z-index: 902; width: min(380px, calc(100vw - 24px)); background: #fff; border-radius: 12px;
  padding: 16px 18px 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .35); border-top: 4px solid var(--acento);
}
.tut-cabeza { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--tenue); text-transform: uppercase; letter-spacing: .3px; }
.tut-tarjeta h3 { font-size: 17px; color: var(--marca); margin: 6px 0 6px; }
.tut-tarjeta p { margin: 0; line-height: 1.5; font-size: 14px; }
.tut-barra { height: 4px; background: #eef1f4; border-radius: 2px; margin: 14px 0 12px; }
.tut-barra i { display: block; height: 100%; background: var(--acento); border-radius: 2px; transition: width .25s; }
.tut-botones { display: flex; align-items: center; gap: 8px; }
.tut-botones span { flex: 1; }
.tut-botones .boton { padding: 7px 14px; }
.tut-salir { background: none; border: 0; color: var(--tenue); cursor: pointer; text-decoration: underline; padding: 4px; }
@media (max-width: 640px) { .tut-tarjeta { width: auto; } }

/* ---------- ¿Cómo funciona? (ayuda.php) ---------- */
.ayuda-hero { background: linear-gradient(135deg, #14324A, #24506f); color: #fff; border-radius: var(--radio); padding: 24px; margin-bottom: 16px; }
.ayuda-hero h1 { color: #fff; font-size: 24px; }
.ayuda-hero p { margin: 6px 0 0; opacity: .9; max-width: 760px; line-height: 1.5; }
.ciclo { display: grid; grid-template-columns: repeat(6, 1fr); margin: 4px 0 6px; }
.ciclo > div { position: relative; text-align: center; padding: 0 8px; }
.ciclo > div:not(:last-child)::after { content: "→"; position: absolute; right: -7px; top: 3px; color: var(--tenue); font-weight: 700; }
.ciclo .estado { margin-bottom: 8px; }
.ciclo small { display: block; color: var(--tenue); font-size: 12px; line-height: 1.35; }
.ciclo b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.roles-ayuda { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.rol-ayuda h2 { font-size: 18px; color: var(--marca); }
.rol-ayuda .quienes { color: var(--tenue); margin: 4px 0 12px; font-size: 13px; }
.rol-ayuda ol { margin: 0 0 14px; padding-left: 20px; line-height: 1.5; }
.rol-ayuda li { margin-bottom: 6px; }
.rol-ayuda .boton { width: 100%; }
.preguntas details { border-bottom: 1px solid #eef1f4; padding: 10px 0; }
.preguntas summary { cursor: pointer; font-weight: 600; }
.preguntas details p { margin: 8px 0 0; line-height: 1.5; }
@media (max-width: 1000px) {
  .roles-ayuda { grid-template-columns: 1fr; }
  .ciclo { grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .ciclo > div:nth-child(3)::after { content: none; }
}
