/* Panel del asistente Visionix. Marca: azul #021A88, Montserrat para titulos, Inter para texto. */
@font-face { font-family: Montserrat; font-weight: 600; font-display: swap; src: url(fuentes/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url(fuentes/montserrat-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(fuentes/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(fuentes/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(fuentes/inter-latin-600-normal.woff2) format('woff2'); }

:root {
  --azul: #021A88; --azul-osc: #010F52; --fondo: #F5F6FA; --tinta: #1A1A2E;
  --gris-1: #374151; --gris-2: #4B5563; --gris-3: #6B7280; --borde: #DDE1EA; --borde-2: #E5E7EB;
  --ambar: #B45309; --ambar-osc: #92400E; --ambar-fondo: #FFFBEB; --ambar-borde: #FDE68A;
  --rojo: #B91C1C; --rojo-fondo: #FEF2F2; --blanco: #FFFFFF; --suave: #EEF0F5;
  --titulo: Montserrat, Inter, 'Helvetica Neue', Arial, sans-serif;
  --texto: Inter, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: var(--texto); font-size: 15px; line-height: 1.4; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--azul); }
:focus-visible { outline: 3px solid #7C93F5; outline-offset: 2px; }
[hidden] { display: none !important; }
.cargando { padding: 48px 20px; text-align: center; color: var(--gris-2); }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Botones ---------- */
.btn { height: 48px; padding: 0 18px; border: 0; border-radius: 2px; background: var(--azul); color: var(--blanco);
  font-family: var(--titulo); font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { background: var(--azul-osc); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.linea { background: var(--blanco); color: var(--azul); border: 2px solid var(--azul); }
.btn.linea:hover { background: var(--suave); }
.btn.rojo { background: var(--blanco); color: var(--rojo); border: 2px solid var(--rojo); }
.btn.rojo:hover { background: var(--rojo-fondo); }
.btn.chico { height: 44px; font-size: 13px; padding: 0 14px; }
.enlace { height: 44px; padding: 0; border: 0; background: none; color: var(--azul); font-size: 14px; font-weight: 600; text-decoration: underline; }
.enlace.rojo { color: var(--rojo); }

/* ---------- Ingreso ---------- */
.ingreso { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--azul); color: var(--blanco); }
.ingreso .cabeza { padding: 32px 24px 28px; }
.ingreso .logo { width: 150px; height: auto; display: block; }
.ingreso h1 { margin-top: 28px; font-family: var(--titulo); font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
.ingreso .bajada { margin-top: 6px; font-size: 15px; line-height: 22px; color: rgba(255,255,255,.84); }
.ingreso .caja { flex: 1; background: var(--blanco); color: var(--tinta); border-radius: 4px 4px 0 0; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--gris-1); }
.campo input, .campo select, .campo textarea { height: 48px; padding: 0 12px; border: 1px solid var(--gris-3); border-radius: 2px; background: var(--blanco); font-size: 16px; width: 100%; }
.campo textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.campo .ayuda { font-size: 13px; color: var(--gris-3); }
.codigo input { font-size: 26px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; height: 60px; }
.aviso { padding: 12px 14px; border: 1px solid var(--ambar-borde); border-radius: 4px; background: var(--ambar-fondo); color: var(--ambar-osc); font-size: 14px; line-height: 20px; }
.aviso.error { border-color: #FECACA; background: var(--rojo-fondo); color: var(--rojo); }
.aviso.info { border-color: var(--borde); background: var(--fondo); color: var(--gris-1); }
.qr { align-self: center; width: 200px; height: 200px; border: 1px solid var(--borde-2); border-radius: 4px; background: var(--blanco); }
.secreto { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; padding: 10px 12px; background: var(--fondo); border-radius: 4px; user-select: all; }

/* ---------- Estructura ---------- */
.panel { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.principal { flex: 1; display: flex; flex-direction: column; padding-bottom: 76px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--blanco); border-top: 1px solid var(--borde-2); }
.nav a { flex: 1; display: flex; align-items: center; justify-content: center; border-top: 3px solid var(--blanco); color: var(--gris-1); font-family: var(--titulo); font-size: 13px; font-weight: 600; text-decoration: none; position: relative; }
.nav a[aria-current="page"] { border-top-color: var(--azul); color: var(--azul); font-weight: 700; }
.nav .globo { margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ambar); color: var(--blanco); font-family: var(--texto); font-size: 12px; line-height: 20px; text-align: center; }

.franja { background: var(--azul); color: var(--blanco); padding: 24px 20px 0; }
.franja .logo { width: 134px; height: auto; display: block; }
.franja h1 { margin-top: 26px; font-family: var(--titulo); font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
.franja .bajada { margin-top: 4px; font-size: 15px; line-height: 22px; color: rgba(255,255,255,.84); }
.franja .pausa { margin-top: 14px; padding: 10px 12px; border-radius: 4px; background: var(--ambar-fondo); color: var(--ambar-osc); font-size: 14px; font-weight: 500; }
.franja .pie { display: none; }

/* Pila de acciones: la de arriba abierta, las demas asoman atras como pestañas. */
.pila { margin-top: 20px; display: flex; flex-direction: column; position: relative; z-index: 1; margin-bottom: -58px; }
.pila .asoma { height: 44px; padding: 0 14px 8px; border: 0; border-radius: 4px 4px 0 0; color: var(--blanco); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-size: 13px; width: auto; }
.pila .asoma:nth-child(1) { margin: 0 16px; background: rgba(255,255,255,.16); }
.pila .asoma:nth-child(2) { margin: -8px 8px 0; background: rgba(255,255,255,.3); }
.pila .asoma:first-child:nth-last-child(2) { margin: 0 8px; background: rgba(255,255,255,.3); }
.pila .asoma b { flex-shrink: 0; font-family: var(--titulo); font-weight: 600; }
.pila .asoma span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta-accion { margin-top: -8px; padding: 18px; border-radius: 4px; background: var(--blanco); color: var(--tinta); box-shadow: 0 12px 32px rgba(1,15,82,.28); display: flex; flex-direction: column; }
.pila > .tarjeta-accion:first-child { margin-top: 0; }
.tarjeta-accion .arriba { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sis { font-family: var(--titulo); font-size: 13px; font-weight: 700; color: var(--azul); }
.irreversible { font-size: 12px; font-weight: 500; color: var(--ambar); }
.tarjeta-accion h2 { margin-top: 8px; font-family: var(--titulo); font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tarjeta-accion .dato { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--gris-1); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tarjeta-accion .botones { margin-top: 16px; display: flex; gap: 10px; }
.tarjeta-accion .botones .btn { flex: 1 1 0; }
.tarjeta-accion .botones .btn:last-child { flex: 1.4 1 0; }
.vacio-franja { margin-top: 20px; padding: 16px 0 28px; font-size: 15px; color: rgba(255,255,255,.84); }
.con-pila { padding-top: 74px; }

.bloque { padding: 24px 20px 0; }
.bloque h2 { font-family: var(--titulo); font-size: 18px; line-height: 24px; font-weight: 700; }
.bloque h2 + .lista, .bloque h2 + p, .bloque h2 + .grilla { margin-top: 8px; }
.fila { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; column-gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--borde); }
.fila .sis { font-size: 12px; line-height: 20px; }
.fila .t { font-size: 15px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.fila .d { font-size: 13px; line-height: 18px; color: var(--gris-2); overflow-wrap: anywhere; }
.fila .cuando { font-size: 12px; line-height: 20px; font-weight: 600; color: var(--gris-2); white-space: nowrap; }
.fila .cuando.ya { color: var(--ambar); }
.fila.urgente { background: var(--ambar-fondo); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 4px; border-top-color: transparent; }
.fila .acciones-fila { grid-column: 2 / -1; display: flex; gap: 16px; }
.fila button.abrir { all: unset; cursor: pointer; display: flex; flex-direction: column; }
.fila button.abrir:focus-visible { outline: 3px solid #7C93F5; outline-offset: 2px; }
.sugerencia { margin-top: 14px; padding: 12px 16px; background: var(--blanco); border: 1px solid var(--borde-2); border-radius: 4px; }
.sugerencia .rot { font-family: var(--titulo); font-size: 12px; line-height: 16px; font-weight: 700; color: var(--azul); }
.sugerencia p { margin-top: 4px; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.nada { padding: 14px 0; font-size: 14px; color: var(--gris-2); border-top: 1px solid var(--borde); }

/* ---------- Detalle de una accion ---------- */
.barra { height: 56px; padding: 0 12px; display: flex; align-items: center; background: var(--azul); }
.barra a { height: 44px; padding: 0 8px; display: flex; align-items: center; gap: 6px; color: var(--blanco); font-size: 15px; font-weight: 500; text-decoration: none; }
.detalle { background: var(--blanco); flex: 1; display: flex; flex-direction: column; }
.detalle .cuerpo { flex: 1; padding: 24px 20px 0; }
.detalle h1 { margin-top: 6px; font-family: var(--titulo); font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.detalle .bajada { margin-top: 8px; font-size: 15px; line-height: 22px; color: var(--gris-1); }
.datos { margin-top: 20px; border-bottom: 1px solid var(--borde-2); }
.datos > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-top: 1px solid var(--borde-2); }
.datos dt { font-size: 13px; line-height: 20px; color: var(--gris-3); }
.datos dd { font-size: 15px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.datos dd.largo { font-weight: 400; max-height: 320px; overflow: auto; padding: 10px 12px; background: var(--fondo); border-radius: 4px; }
.nota-modelo { margin-top: 16px; font-size: 13px; line-height: 19px; color: var(--gris-2); overflow-wrap: anywhere; }
.nota-modelo b { color: var(--gris-1); }
.detalle .aviso { margin-top: 16px; }
.decidir { padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borde-2); display: flex; flex-direction: column; gap: 12px; background: var(--blanco); position: sticky; bottom: 0; }
.decidir .solo { font-size: 13px; line-height: 18px; color: var(--gris-3); }
.decidir .botones { display: flex; gap: 10px; }
.decidir .btn { height: 52px; flex: 1 1 0; }
.decidir .btn:last-child { flex: 1.6 1 0; }
.resultado { padding: 18px; border-radius: 4px; display: flex; flex-direction: column; gap: 6px; }
.resultado.ok { background: var(--azul); color: var(--blanco); }
.resultado.no { border: 1px solid var(--borde-2); background: var(--fondo); }
.resultado b { font-family: var(--titulo); font-size: 20px; line-height: 28px; font-weight: 700; }
.resultado p { font-size: 14px; line-height: 20px; }
.resultado.ok a { color: var(--blanco); font-weight: 600; }

/* ---------- Registro ---------- */
.blanca { background: var(--blanco); flex: 1; }
.titulo-pag { padding: 24px 20px 0; }
.titulo-pag .logo { width: 134px; height: auto; display: block; }
.titulo-pag h1 { margin-top: 26px; font-family: var(--titulo); font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
.titulo-pag .bajada { margin-top: 4px; font-size: 15px; line-height: 22px; color: var(--gris-1); }
.filtros { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.filtros button { height: 44px; padding: 0 18px; border: 1px solid var(--gris-3); border-radius: 999px; background: var(--blanco); color: var(--gris-1); font-size: 14px; font-weight: 600; }
.filtros button[aria-pressed="true"] { border-color: var(--azul); background: var(--azul); color: var(--blanco); }
.dia { margin: 20px 0 8px; font-family: var(--titulo); font-size: 15px; line-height: 22px; font-weight: 700; }
.reg { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-top: 1px solid var(--borde-2); }
.reg .hora { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--gris-3); font-variant-numeric: tabular-nums; }
.reg .que { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.reg .que .sis { font-size: 12px; line-height: 18px; }
.reg .que .t { font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.pildora { margin-top: 4px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; line-height: 22px; font-weight: 600; white-space: nowrap; background: var(--suave); color: var(--gris-1); }
.pildora.ok { background: var(--azul); color: var(--blanco); }
.pildora.espera { border: 1px solid var(--ambar-borde); background: var(--ambar-fondo); color: var(--ambar-osc); line-height: 20px; }
.pildora.error { background: var(--rojo-fondo); color: var(--rojo); }
.pildora.linea { border: 1px solid var(--gris-3); background: var(--blanco); line-height: 20px; }

/* ---------- Sistemas ---------- */
.grilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.sistema { padding: 14px; background: var(--blanco); border: 1px solid var(--borde-2); border-radius: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sistema .n { font-family: var(--titulo); font-size: 15px; line-height: 20px; font-weight: 700; }
.sistema .hace { font-size: 12px; line-height: 17px; color: var(--gris-2); }
.sistema select { height: 44px; width: 100%; padding: 0 8px; border: 1px solid var(--gris-3); border-radius: 2px; background: var(--blanco); font-size: 14px; }
.sistema .pildora { margin-top: 0; height: 24px; line-height: 24px; }
.seccion { margin: 24px 20px 0; padding: 16px; background: var(--blanco); border: 1px solid var(--borde-2); border-radius: 4px; display: flex; flex-direction: column; gap: 12px; }
.seccion h2 { font-family: var(--titulo); font-size: 16px; line-height: 22px; font-weight: 700; }
.seccion p { font-size: 14px; line-height: 20px; color: var(--gris-1); }
.renglon { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--borde-2); }
.renglon .t { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.renglon .d { font-size: 13px; color: var(--gris-2); overflow-wrap: anywhere; }
.formulario { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; align-items: end; }
.encabezado-sis { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.final { height: 32px; }

/* ---------- Ventana para pedir el codigo ---------- */
.velo { position: fixed; inset: 0; z-index: 20; background: rgba(1,15,82,.55); display: flex; align-items: flex-end; justify-content: center; }
.ventana { width: 100%; max-width: 440px; background: var(--blanco); border-radius: 4px 4px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.ventana h2 { font-family: var(--titulo); font-size: 20px; line-height: 26px; font-weight: 700; }
.ventana p { font-size: 14px; line-height: 20px; color: var(--gris-1); }
.ventana .botones { display: flex; gap: 10px; }
.ventana .botones .btn { flex: 1; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; padding: 12px 16px; border-radius: 4px; background: var(--tinta); color: var(--blanco); font-size: 14px; text-align: center; }

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  .ingreso { flex-direction: row; }
  .ingreso .cabeza { flex: 0 0 420px; padding: 48px 40px; }
  .ingreso .caja { border-radius: 0; padding: 48px clamp(24px, 6vw, 96px); justify-content: center; }
  .ingreso .caja > * { max-width: 420px; width: 100%; }
  .panel.hoy { flex-direction: row; align-items: stretch; }
  .panel.hoy .franja { flex: 0 0 clamp(380px, 30vw, 440px); padding: 40px 32px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; }
  .panel.hoy .franja .logo { width: 170px; }
  .panel.hoy .franja h1 { margin-top: 44px; font-size: 34px; line-height: 40px; }
  .panel.hoy .pila { margin-bottom: 0; margin-top: 28px; }
  .panel.hoy .franja .pie { display: block; margin-top: auto; padding-top: 32px; font-size: 13px; line-height: 18px; color: rgba(255,255,255,.84); }
  .panel.hoy .principal { padding: 32px clamp(20px, 4vw, 56px) 96px; }
  .panel.hoy .con-pila { padding-top: 0; }
  .panel.hoy .columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 8px 56px; align-items: start; }
  .bloque h2 { font-size: 22px; line-height: 30px; }
  .solo-escritorio { display: block; }
  .nav { left: auto; right: 24px; bottom: 24px; width: 360px; border: 1px solid var(--borde-2); border-radius: 4px; box-shadow: 0 8px 24px rgba(1,15,82,.14); height: 56px; padding-bottom: 0; }
  .panel:not(.hoy) .principal, .panel .detalle { max-width: 860px; width: 100%; margin: 0 auto; }
  .panel .barra { padding-left: max(12px, calc((100vw - 860px) / 2)); }
  .velo { align-items: center; }
  .ventana { border-radius: 4px; }
  .toast { left: auto; right: 24px; bottom: 96px; max-width: 360px; }
}
@media (max-width: 959px) { .solo-escritorio { display: none; } }
@media (prefers-reduced-motion: no-preference) { .tarjeta-accion, .ventana { animation: subir .28s cubic-bezier(.32,.72,0,1); } }
@keyframes subir { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
