/* Aprobaciones (móvil primero). Sin fuentes ni recursos externos. Azul oficial Weston #14B1E7. */
:root {
  --azul: #14B1E7; --azul-osc: #0A7FA8; --texto: #1f2937; --suave: #64748b; --borde: #d8e0e8;
  --fondo: #eef3f7; --panel: #ffffff; --ok: #1a8a4a; --ok-osc: #136b39; --mal: #c0392b; --aviso: #b26a00;
  --aviso-fondo: #fff4dc; --radio: 14px; --sombra: 0 1px 3px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }

.cab {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--borde);
  position: sticky; top: 0; z-index: 10;
}
.cab-der { display: flex; align-items: center; gap: 12px; min-width: 0; }
.quien { font-size: .85rem; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.logo { display: block; }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; }
.pantalla h1 { font-size: 1.5rem; margin: 8px 0 2px; }
.pantalla h2 { font-size: 1.1rem; margin: 0 0 8px; }
.sub { color: var(--suave); margin: 0 0 16px; }
.tarjeta { background: var(--panel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; margin-bottom: 12px; }
.nota { color: var(--suave); font-size: .85rem; margin: 10px 0 0; }
.enviado { background: #e8f6fc; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: .92rem; }
.lista { padding-left: 20px; margin: 8px 0 16px; }
.lista li { margin-bottom: 6px; }

label { display: block; font-weight: 600; margin: 4px 0 6px; }
input[type=text], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 10px;
  font: inherit; background: #fff; color: var(--texto);
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .tab:focus-visible, .enlace:focus-visible {
  outline: 3px solid rgba(20, 177, 231, .5); outline-offset: 1px;
}
.codigo { font-size: 1.8rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 16px; border-radius: 12px; border: 2px solid transparent; font: inherit; font-weight: 700;
  cursor: pointer; width: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn.grande { width: 100%; min-height: 54px; margin-top: 12px; font-size: 1.05rem; }
.btn.primario { background: var(--azul-osc); color: #fff; }
.btn.secundario { background: #fff; color: var(--azul-osc); border-color: var(--borde); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.mal { background: #fff; color: var(--mal); border-color: var(--mal); }
.btn.peligro { background: var(--mal); color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; }
.enlace { background: none; border: 0; color: var(--azul-osc); font: inherit; font-weight: 600; min-height: 44px; padding: 0 6px; cursor: pointer; }
.enlace[disabled] { color: var(--suave); cursor: default; }
.fila-enlaces { display: flex; justify-content: space-between; margin-top: 6px; }

.error { color: var(--mal); background: #fdecea; border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-weight: 600; }
.aviso { background: var(--aviso-fondo); color: #5d3b00; border-radius: 10px; padding: 12px; margin-top: 12px; }
.aviso ol { margin: 6px 0 6px 18px; padding: 0; }

/* — prueba de vida — */
.visor { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; background: #0b1220; border-radius: var(--radio); overflow: hidden; }
.visor video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.ovalo { position: absolute; inset: 8% 14%; border: 4px solid rgba(255, 255, 255, .9); border-radius: 50%; box-shadow: 0 0 0 999px rgba(11, 18, 32, .45); pointer-events: none; }
.visor.bien .ovalo { border-color: #4ade80; }
.visor.mal .ovalo { border-color: #f87171; }
.instruccion {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 12px; text-align: center;
  color: #fff; font-size: 1.5rem; font-weight: 800; background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}
.ayuda { text-align: center; min-height: 1.5em; color: var(--aviso); font-weight: 600; margin: 8px 0; }
.barra { height: 10px; background: #dbe4ec; border-radius: 6px; overflow: hidden; }
.barra-lleno { height: 100%; width: 0; background: var(--azul); transition: width .25s; }
.pasos { display: flex; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; justify-content: center; }
.pasos li { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; }
.pasos li.hecho { background: var(--ok); }
.pasos li.actual { background: var(--azul); transform: scale(1.25); }

/* — bandeja — */
.pantalla.ancha { padding: 0; }
.tabs { display: flex; align-items: stretch; gap: 4px; position: sticky; top: 51px; z-index: 5; background: var(--fondo); padding: 6px 0; }
.tab { flex: 1; min-height: 48px; border: 0; background: #e2e9f0; color: var(--texto); font: inherit; font-weight: 700; border-radius: 12px; cursor: pointer; }
.tab.activa { background: var(--azul-osc); color: #fff; }
.insignia { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px; background: #fff; color: var(--azul-osc); font-size: .85rem; line-height: 22px; }
.icono-btn { width: 48px; min-height: 48px; border: 0; border-radius: 12px; background: #e2e9f0; font-size: 1.4rem; cursor: pointer; }

.sol { background: var(--panel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px; margin: 10px 0; border-left: 6px solid var(--azul); }
.sol.traslado { border-left-color: #7c5cd6; }
.sol-cab { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sol-nombre { font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.sol-rad { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; color: var(--suave); white-space: nowrap; }
.etiqueta { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e2e9f0; margin: 4px 6px 0 0; }
.etiqueta.alerta { background: var(--aviso-fondo); color: #8a4f00; }
.etiqueta.ok { background: #dff3e7; color: var(--ok-osc); }
.etiqueta.mal { background: #fdecea; color: var(--mal); }
.datos { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 10px 0; font-size: .92rem; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.motivo { max-height: 3.1em; overflow: hidden; }
.motivo.abierto { max-height: none; }
.mas { font-size: .85rem; }
.cadena { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { font-size: .78rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.chip.hecha { background: #dff3e7; color: var(--ok-osc); }
.chip.falta { background: #eef1f5; color: var(--suave); border: 1px dashed #aab6c3; }
.chip.tuya { background: #e1f4fc; color: var(--azul-osc); border: 1px solid var(--azul); }
.como { font-size: .85rem; color: var(--azul-osc); font-weight: 700; margin-top: 4px; }
.acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.acciones .btn { min-height: 56px; font-size: 1.05rem; }
.vacio { text-align: center; color: var(--suave); padding: 36px 12px; }

.hist { background: var(--panel); border-radius: 12px; box-shadow: var(--sombra); padding: 10px 12px; margin: 8px 0; }
.hist-fila { display: flex; justify-content: space-between; gap: 8px; }
.hist small { color: var(--suave); }

.banda { border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: .92rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banda.aviso { background: var(--aviso-fondo); color: #5d3b00; margin-top: 0; }
.banda.mal { background: #fdecea; color: var(--mal); }
.banda .btn { min-height: 44px; padding: 6px 12px; white-space: nowrap; }
.pie-ubic { text-align: center; color: var(--suave); font-size: .82rem; margin-top: 12px; }

/* — hoja inferior — */
.velo { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 30; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: #fff; border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .25); max-height: 92vh; overflow-y: auto;
}
.hoja h2 { margin: 0 0 6px; }
.resumen { color: var(--suave); margin: 0 0 10px; }
.casilla { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; margin: 12px 0; min-height: 48px; padding: 8px; background: #f3f8fb; border-radius: 10px; }
.casilla input { width: 26px; height: 26px; flex: none; margin-top: 2px; }
.hoja-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tostada { position: fixed; left: 16px; right: 16px; top: 64px; z-index: 40; max-width: 520px; margin: 0 auto;
  background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; text-align: center; }
.pie { text-align: center; color: var(--suave); font-size: .75rem; padding: 12px 16px 24px; }

@media (min-width: 700px) { .visor { max-height: 520px; } }
@media (prefers-reduced-motion: reduce) { .barra-lleno { transition: none; } }

/* Historial: filtro «Mis firmas / Mi equipo» y chip de quién firmó (23-oct-2026). */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.chip-filtro { min-height: 44px; padding: 0 14px; border: 1px solid var(--borde); background: var(--panel); color: var(--texto);
  font: inherit; font-size: .88rem; font-weight: 700; border-radius: 999px; cursor: pointer; }
.chip-filtro.activo { background: var(--azul-osc); border-color: var(--azul-osc); color: #fff; }
.etiqueta.mia { background: #e1f4fc; color: var(--azul-osc); }
.etiqueta.equipo { background: #efe9fb; color: #5b3aa8; }
.hist-quien { color: var(--suave); font-size: .85rem; }
