/* Trinity Turnos — apertura y cierre de lados.
   Sin variables CSS ni grid: tiene que verse igual en el WebView de un Sunmi
   con Android 5 que en un teléfono de este año. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #F1F5F9;
  color: #0F172A;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
.oculto { display: none !important; }

/* ── Arranque ── */
.arranque { text-align: center; padding-top: 30vh; color: #64748B; }

/* ── Barra superior ── */
.barra {
  background: #1286C3;
  background: linear-gradient(180deg, #1A93D1, #1286C3);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
}
.barra .logo { width: 26px; height: 29px; margin-right: 10px; flex: none; }
.barra .titulo { flex: 1; min-width: 0; }
.barra h1 { font-size: 18px; margin: 0; font-weight: 700; }
.barra .sub { font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra .acciones { display: flex; flex: none; }
.icono-btn {
  background: rgba(255, 255, 255, .16);
  border: 0;
  color: #fff;
  border-radius: 10px;
  min-width: 42px;
  height: 42px;
  margin-left: 6px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.icono-btn:active { background: rgba(255, 255, 255, .3); }

/* ── Contenido ── */
.contenido { padding: 14px; max-width: 980px; margin: 0 auto; }
.estado-lista { color: #64748B; font-size: 13px; margin: 0 0 10px 2px; }
.estado-lista.error { color: #B91C1C; }

.tarjetas { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.tarjeta {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .04);
  padding: 14px;
  margin: 0 6px 12px;
  width: calc(50% - 12px);
  border: 1px solid #E2E8F0;
}
@media (max-width: 420px) { .tarjeta { width: calc(100% - 12px); } }
@media (min-width: 760px) { .tarjeta { width: calc(33.333% - 12px); } }

.tarjeta .cabeza { display: flex; align-items: center; margin-bottom: 10px; }
.tarjeta .numero {
  width: 44px; height: 44px; border-radius: 12px;
  background: #E0F2FE; color: #0369A1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; margin-right: 10px; flex: none;
}
.tarjeta .nombre { flex: 1; font-weight: 700; font-size: 16px; }
.fila { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; border-top: 1px solid #F1F5F9; }
.fila .k { color: #64748B; }
.fila .v { font-weight: 600; text-align: right; margin-left: 8px; }
.v.disponible { color: #047857; }
.v.vendiendo { color: #B45309; }

.boton-lado {
  display: block; width: 100%; margin-top: 12px;
  border-radius: 12px; border: 1.5px solid; padding: 12px;
  font-weight: 700; font-size: 15px;
}
.boton-lado.abrir { background: #ECFDF5; border-color: #6EE7B7; color: #065F46; }
.boton-lado.cerrar { background: #FFF1F2; border-color: #FDA4AF; color: #9F1239; }
.boton-lado:disabled { opacity: .5; }
.boton-lado.espera { background: #FFFBEB; border-color: #FCD34D; color: #92400E; opacity: 1; }
.tarjeta.vende { border-color: #FCD34D; box-shadow: 0 0 0 2px #FEF3C7, 0 4px 12px rgba(15, 23, 42, .04); }
.estado-chip {
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
}
.estado-chip.abierto { background: #D1FAE5; color: #065F46; }
.estado-chip.cerrado { background: #FFE4E6; color: #9F1239; }

.vacio { text-align: center; color: #64748B; padding: 40px 10px; }

/* ── Formularios ── */
.panel {
  background: #fff; border-radius: 16px; padding: 20px; margin: 20px auto;
  max-width: 440px; box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
}
.panel .marca { text-align: center; margin-bottom: 14px; }
.panel .marca img { width: 64px; height: 64px; }
.panel h2 { margin: 6px 0 4px; font-size: 20px; text-align: center; }
.panel p.ayuda { color: #64748B; font-size: 14px; text-align: center; margin: 0 0 16px; }
label { display: block; font-size: 13px; color: #475569; margin: 12px 0 5px; font-weight: 600; }
input[type=text], input[type=password], input[type=url], input[type=tel] {
  width: 100%; padding: 13px 12px; border: 1.5px solid #CBD5E1; border-radius: 10px;
  background: #fff; font-size: 16px; color: #0F172A;
}
input:focus { outline: none; border-color: #1286C3; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px;
  font-weight: 700; font-size: 16px; margin-top: 16px;
  background: #1286C3; color: #fff;
}
.btn:active { background: #0E6FA3; }
.btn:disabled { opacity: .55; }
.btn.secundario { background: #E2E8F0; color: #0F172A; }
.btn.peligro { background: #DC2626; }
.btn.exito { background: #059669; }
.enlace { background: none; border: 0; color: #1286C3; font-weight: 600; padding: 12px; display: block; margin: 8px auto 0; }
.mensaje { margin-top: 12px; font-size: 14px; text-align: center; min-height: 20px; }
.mensaje.error { color: #B91C1C; }
.mensaje.ok { color: #047857; }

.datos { font-size: 14px; }
.datos .fila .v { word-break: break-all; }

/* ── Modales ── */
.fondo-modal {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 20;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 420px;
  max-height: 92vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.modal .cab { padding: 20px; text-align: center; color: #fff; background: #1286C3; border-radius: 18px 18px 0 0; }
.modal .cab.rojo { background: #DC2626; }
.modal .cab.ambar { background: #D97706; }
.modal .cab h3 { margin: 0; font-size: 19px; }
.modal .cab .sub { font-size: 13.5px; opacity: .9; margin-top: 4px; }
.modal .cuerpo { padding: 18px 20px 6px; font-size: 15px; line-height: 1.45; }
.modal .pie { display: flex; padding: 10px 20px 20px; }
.modal .pie .btn { margin-top: 8px; }
.modal .pie .btn + .btn { margin-left: 10px; }

.opcion-lado {
  display: flex; align-items: center; padding: 12px; border: 1.5px solid #E2E8F0;
  border-radius: 12px; margin-bottom: 8px; font-size: 15px;
}
.opcion-lado.marcado { border-color: #1286C3; background: #F0F9FF; }
.opcion-lado .caja {
  width: 24px; height: 24px; border: 2px solid #94A3B8; border-radius: 6px; margin-right: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; flex: none;
}
.opcion-lado.marcado .caja { background: #1286C3; border-color: #1286C3; }
.opcion-lado .det { color: #64748B; font-size: 13px; margin-left: auto; }

.linea-espera { text-align: center; margin: 4px 0; color: #475569; }
.espaciador { height: 8px; }

.pin {
  text-align: center; letter-spacing: 8px; font-size: 26px !important; font-weight: 700;
}

.girando {
  width: 44px; height: 44px; border: 4px solid #BAE6FD; border-top-color: #1286C3;
  border-radius: 50%; margin: 6px auto 14px;
  -webkit-animation: girar .8s linear infinite; animation: girar .8s linear infinite;
}
@-webkit-keyframes girar { to { -webkit-transform: rotate(360deg); } }
@keyframes girar { to { transform: rotate(360deg); } }

.progreso { height: 8px; background: #E2E8F0; border-radius: 6px; overflow: hidden; margin: 12px 0 6px; }
.progreso div { height: 100%; background: #1286C3; width: 0; -webkit-transition: width .3s; transition: width .3s; }
.lista-cierre { margin: 10px 0 0; padding: 0; list-style: none; }
.lista-cierre li { padding: 6px 0; font-size: 14.5px; display: flex; }
.lista-cierre .ic { width: 22px; flex: none; font-weight: 800; }
.lista-cierre .ok .ic { color: #059669; }
.lista-cierre .mal { color: #B91C1C; }
.lista-cierre .espera .ic { color: #94A3B8; }
.nota { font-size: 13px; color: #92400E; background: #FEF3C7; border-radius: 10px; padding: 9px 11px; margin-top: 12px; }

/* ── Avisos ── */
.aviso {
  position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 30;
  padding: 13px 14px; border-radius: 12px; color: #fff; font-size: 14.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); white-space: pre-line;
  max-width: 640px; margin: 0 auto;
}
.aviso.ok { background: #047857; }
.aviso.error { background: #B91C1C; }
.aviso.info { background: #1E293B; }

.banda {
  background: #FEF3C7; color: #78350F; padding: 10px 14px; font-size: 14px;
  display: flex; align-items: center;
}
.banda span { flex: 1; }
.banda button { background: #D97706; color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 700; margin-left: 10px; }

/* ── Página de descarga (/apk) ── */
a.btn { text-align: center; text-decoration: none; }
.pasos { color: #475569; font-size: 14px; line-height: 1.5; padding-left: 20px; margin: 18px 0 0; }
.pasos li { margin-bottom: 6px; }

/* ── Registro (Ajustes) ── */
.registro { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.registro li { padding: 7px 0; border-bottom: 1px solid #F1F5F9; }
.registro .reg-t { font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.registro .reg-d { color: #64748B; word-break: break-all; margin-top: 2px; }
