:root {
  color-scheme: light;
  /* Tema base SIAB: fondo blanco con capas violeta translúcidas (glassmorphism claro). */
  --bg: #ffffff;
  --bg-soft: #f6f1ff;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-2: #f6f1ff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(109, 40, 217, 0.14);
  --line-strong: rgba(109, 40, 217, 0.3);
  --text: #2a1745;
  --muted: #6b5a8a;
  --muted-2: #7a689c;
  --accent: #6d28d9;
  --accent-2: #a855f7;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --on-accent: #ffffff;
  --field-bg: rgba(255, 255, 255, 0.82);
  --field-border: rgba(109, 40, 217, 0.2);
  --list-bg: rgba(255, 255, 255, 0.55);
  --table-head: rgba(243, 238, 255, 0.88);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.7));
  --card-flat-bg: rgba(255, 255, 255, 0.6);
  --modal-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 255, 0.98));
  --topbar-bg: rgba(255, 255, 255, 0.72);
  --footer-bg: rgba(255, 255, 255, 0.62);
  --toast-bg: rgba(255, 255, 255, 0.95);
  --tabs-bg: rgba(255, 255, 255, 0.55);
  --btn-bg: rgba(255, 255, 255, 0.7);
  --hover-bg: rgba(109, 40, 217, 0.08);
  --row-hover: rgba(109, 40, 217, 0.05);
  --pill-bg: rgba(109, 40, 217, 0.08);
  --brand-mark-bg: rgba(124, 58, 237, 0.1);
  --track: rgba(109, 40, 217, 0.16);
  --backdrop: rgba(42, 23, 69, 0.42);
  --surface: var(--panel);
  /* Convención de superficies flotantes: fondo casi opaco + blur. Se aplica a
     listas, calendarios y modales para que el contenido de atrás no se lea. */
  /* Se conserva la transparencia original de la lista; el blur evita que el
     contenido de atrás se lea, sin volver opaco el fondo. */
  --overlay-bg: var(--panel);
  --overlay-bg-strong: var(--panel);
  --overlay-blur: blur(18px) saturate(1.3);
  --overlay-shadow: 0 18px 45px rgba(76, 29, 149, 0.22);
  --border: var(--line);
  --ok: #047857;
  --warn: #b45309;
  --danger: #be123c;
  --ok-text: #065f46;
  --ok-bg: rgba(4, 120, 87, 0.1);
  --ok-border: rgba(4, 120, 87, 0.3);
  --warn-text: #92400e;
  --warn-bg: rgba(180, 83, 9, 0.1);
  --warn-border: rgba(180, 83, 9, 0.3);
  --danger-text: #9f1239;
  --danger-bg: rgba(190, 18, 60, 0.08);
  --danger-border: rgba(190, 18, 60, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(76, 29, 149, 0.16);
  --font: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

/* Shell de página: la app mide exactamente el viewport, el main scrollea por
   dentro y el pie queda siempre visible. No hay scroll de página. */
body {
  font-family: var(--font);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 620px at 10% -12%, rgba(124, 58, 237, 0.18), transparent 62%),
    radial-gradient(980px 540px at 100% -4%, rgba(168, 85, 247, 0.14), transparent 58%),
    radial-gradient(1100px 720px at 50% 112%, rgba(196, 181, 253, 0.32), transparent 62%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--brand-mark-bg);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  overflow: hidden;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 18px;
  letter-spacing: 0.14em;
}

.brand-text small {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  padding: 9px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: 0.15s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.main-nav a.active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 650;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.user-chip strong {
  font-size: 13.5px;
}

.user-chip span {
  color: var(--muted-2);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Layout ---------- */
.view {
  padding: clamp(18px, 3vw, 34px);
  max-width: 1500px;
  margin: 0 auto;
}

/* El main es el único contenedor que scrollea: el documento nunca lo hace. */
#view {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-footer {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 18px clamp(16px, 3vw, 32px);
  margin-top: 0;
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  color: var(--muted-2);
  font-size: 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-footer p {
  flex: 1;
  min-width: 260px;
  margin: 0;
  line-height: 1.5;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.footer-brand img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.footer-brand strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Institución: mismo tratamiento discreto que la marca, con su sello en blanco. */
.footer-inst {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.footer-inst img {
  width: 24px;
  height: 24px;
  padding: 1px;
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 560px) {
  .footer-inst {
    padding-left: 0;
    border-left: 0;
  }
}

.footer-link {
  font-size: 12px;
}

.footer-version {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.kiosk-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  align-items: start;
}

@media (max-width: 1080px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.kiosk-layout,
  .grid.cols-3,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand-text small {
    display: none;
  }
}

/* ---------- Cards & panels ---------- */
/* Una tarjeta con un campo enfocado se eleva para que su lista nativa no
   quede debajo de la tarjeta siguiente. */
.card:focus-within {
  position: relative;
  z-index: 30;
}

.field:focus-within {
  position: relative;
  z-index: 31;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.2vw, 24px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}

.card.flat {
  box-shadow: none;
  background: var(--card-flat-bg);
}

/* Aviso operativo dentro de una tarjeta. */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.notice-mark {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 13px/1 var(--font);
}

.notice > div > strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 7px;
  color: var(--muted);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.card h2 {
  font-size: 20px;
}

.card h3 {
  font-size: 16px;
}

.card p.help,
.help {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat .label {
  color: var(--muted-2);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat .value {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat .value small {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  border-color: transparent;
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
}

.btn.danger {
  border-color: var(--danger-border);
  color: var(--danger-text);
  background: var(--danger-bg);
}

.btn.small {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn.block {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.field input,
.field select {
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  border-color: var(--field-border);
  outline: none;
  transition: 0.15s ease;
  width: 100%;
}

.field input:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.notify-form .notify-message,
.notify-form .form-actions {
  grid-column: 1 / -1;
}

.notify-form .form-actions {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Kiosk camera ---------- */
.kiosk-stage {
  position: relative;
  background: #05090f;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kiosk-stage.aligned {
  border-color: rgba(61, 220, 151, 0.8);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.2), 0 0 46px rgba(61, 220, 151, 0.28);
}

.kiosk-stage.close {
  border-color: rgba(255, 191, 95, 0.55);
}

.kiosk-stage video[data-source="network"] {
  transform: none;
}

.kiosk-stage video[data-facing="environment"] {
  transform: none;
}

.kiosk-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Velo blanco que oculta el fondo; el hueco tiene forma de cabeza con orejas. */
.face-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.face-overlay .face-mask-rect {
  fill: #ffffff;
  fill-opacity: 0.88;
  transition: fill-opacity 0.25s ease;
}

.face-overlay .face-guide-group path,
.face-overlay .face-guide-group use {
  fill: none;
  stroke: rgba(52, 211, 200, 0.72);
  stroke-width: 2.4;
  stroke-dasharray: 9 6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.2s ease;
}

.face-overlay .face-guide-neck {
  stroke-opacity: 0.45;
}

.face-overlay.close .face-guide-group path,
.face-overlay.close .face-guide-group use {
  stroke: rgba(255, 191, 95, 0.98);
}

.face-overlay.aligned .face-guide-group path,
.face-overlay.aligned .face-guide-group use {
  stroke: rgba(61, 220, 151, 1);
  stroke-dasharray: none;
  stroke-width: 3;
  filter: drop-shadow(0 0 7px rgba(61, 220, 151, 0.75));
}

.kiosk-stage.aligned .face-mask-rect {
  fill-opacity: 0.74;
}

.kiosk-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: linear-gradient(180deg, rgba(4, 8, 15, 0.35), transparent 30%, transparent 65%, rgba(4, 8, 15, 0.55));
  pointer-events: none;
}

.kiosk-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
}

.badge.ok {
  color: var(--ok-text);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

.badge.warn {
  color: var(--warn-text);
  border-color: var(--warn-border);
  background: var(--warn-bg);
}

.badge.danger {
  color: var(--danger-text);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.badge.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.16);
}

.kiosk-prompt {
  position: relative;
  align-self: center;
  text-align: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: clamp(13px, 1.5vw, 16px);
  backdrop-filter: blur(8px);
  max-width: 90%;
}

.kiosk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 12px;
}

.kiosk-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-shape {
  display: inline-block;
  width: 16px;
  height: 18px;
  flex: 0 0 auto;
}

.legend-shape.silhouette {
  position: relative;
  width: 14px;
  height: 17px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 50% 50% 44% 44%;
}

.legend-shape.silhouette::before,
.legend-shape.silhouette::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 4px;
  height: 7px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 50%;
}

.legend-shape.silhouette::before {
  left: -4px;
}

.legend-shape.silhouette::after {
  right: -4px;
}

.legend-tone {
  color: var(--muted);
}

@keyframes guidePulse {
  from {
    filter: drop-shadow(0 0 4px rgba(61, 220, 151, 0.45));
  }
  to {
    filter: drop-shadow(0 0 12px rgba(61, 220, 151, 0.9));
  }
}

.face-overlay.aligned .face-guide-group {
  animation: guidePulse 1.15s ease-in-out infinite alternate;
}

/* Guía simple del kiosco: óvalo limpio, sin silueta ni máscara de orejas. */
.face-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(38%, 310px);
  height: min(54%, 365px);
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(52, 211, 200, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(8, 20, 28, 0.12) inset;
  pointer-events: none;
  z-index: 2;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kiosk-stage.close .face-frame {
  border-color: rgba(255, 191, 95, 0.98);
  box-shadow: 0 0 18px rgba(255, 191, 95, 0.16);
}

.kiosk-stage.aligned .face-frame {
  border-color: rgba(61, 220, 151, 1);
  border-style: solid;
  box-shadow: 0 0 24px rgba(61, 220, 151, 0.28);
}

.legend-frame {
  display: inline-block;
  width: 13px;
  height: 17px;
  flex: 0 0 auto;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 75%, transparent);
  border-radius: 50%;
}

.kiosk-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.result-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 74px;
  border-radius: 16px;
  padding: 16px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  background: var(--glass-strong);
  display: flex;
  gap: 14px;
  align-items: center;
  animation: pop 0.25s ease;
}

.result-card.ok {
  border-color: var(--ok-border);
}

.result-card.warn {
  border-color: var(--warn-border);
}

.result-card.danger {
  border-color: var(--danger-border);
}

.result-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.result-copy strong {
  display: block;
  font-size: 18px;
}

.result-copy span {
  color: var(--muted);
  font-size: 13.5px;
}

.result-copy .result-greeting {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.35;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}

thead th {
  text-align: left;
  padding: 11px 14px;
  color: var(--muted-2);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-bottom: 1px solid var(--line);
  background: var(--table-head);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--row-hover);
}

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--pill-bg);
}

.pill.present {
  color: var(--ok-text);
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

.pill.late {
  color: var(--warn-text);
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.pill.absent {
  color: var(--danger-text);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.pill.pending {
  color: var(--muted);
}

/* ---------- Sessions / lists ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-group-title {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.faq-group-title:first-child {
  margin-top: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--list-bg);
}

.list-item .meta {
  min-width: 0;
}

.list-item .meta strong {
  display: block;
  font-size: 14px;
}

.list-item .meta small {
  color: var(--muted-2);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.camera-box {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05090f;
  aspect-ratio: 4 / 3;
}

.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.capture-strip {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.capture-dot {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 11px;
  border: 1px dashed var(--line-strong);
  color: var(--muted-2);
  font-size: 12.5px;
}

.capture-dot.done {
  border-style: solid;
  border-color: var(--ok-border);
  color: var(--ok-text);
  background: var(--ok-bg);
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.4vh, 22px) clamp(10px, 2.2vw, 20px);
}

.login-stack {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Sello de la institución: arriba de la tarjeta, alineado a su borde derecho,
   lejos del logo de MindStorms.Lab que va centrado dentro de la tarjeta. */
.login-inst {
  align-self: center;
  margin: 0 auto 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-inst-logo {
  display: block;
  width: 44px;
  height: 44px;
  padding: 2px;
  border-radius: 11px;
  background: #fff;
  object-fit: contain;
}

.login-inst-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.login-inst-text small {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.login-inst-text strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
}

@media (max-width: 820px) {
  .login-inst {
    align-self: center;
  }
}

.login-card {
  width: min(460px, 100%);
  padding: 30px;
}

.login-card .brand {
  margin-bottom: 22px;
}

.login-company {
  display: block;
  width: 128px;
  height: auto;
  margin: 0 auto 16px;
}

.login-card h1 {
  font-size: 24px;
  margin: 0 0 6px;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 14px;
}

.login-copyright {
  margin-top: 18px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-2);
}

.demo-accounts {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.demo-accounts p {
  font-size: 12px;
  margin-bottom: 10px;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Toast & misc ---------- */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--toast-bg);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: pop 0.2s ease;
}

.toast.ok {
  border-color: var(--ok-border);
}

.toast.error {
  border-color: var(--danger-border);
}

.toast.warn {
  border-color: var(--warn-border);
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.loading-line {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: slide 1.1s linear infinite;
}

@keyframes slide {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 12.5px;
}

.kbd {
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--hover-bg);
  font-size: 11.5px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.secondary-link {
  color: var(--accent);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.small-note {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.scroll-y {
  max-height: 340px;
  overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Enrolamiento estilo Face ID ---------- */
.enroll-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--tabs-bg);
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.tab-btn.active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.tab-btn .tab-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(7, 13, 26, 0.3);
  color: inherit;
}

.faceid-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.faceid-stage {
  position: relative;
  width: min(330px, 82vw);
  aspect-ratio: 1;
  margin: 4px auto;
}

.faceid-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.faceid-ring-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 5;
}

.faceid-ring-progress {
  fill: none;
  stroke: url(#faceidGradient);
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 578;
  stroke-dashoffset: 578;
  transition: stroke-dashoffset 0.45s ease;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 50%, transparent));
}

.faceid-video-mask {
  position: absolute;
  inset: 6.5%;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(76, 141, 255, 0.16), transparent 62%),
    #05090f;
  border: 1px solid rgba(148, 178, 219, 0.18);
  display: grid;
  place-items: center;
}

.faceid-video-mask video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.faceid-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #a9b8d4;
  font-size: 12.5px;
  text-align: center;
  padding: 22px;
}

.faceid-placeholder svg {
  width: 46px;
  height: 46px;
  color: var(--accent);
  opacity: 0.85;
}

.faceid-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12% 12% 10%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 8, 15, 0.55), transparent 26%, transparent 70%, rgba(4, 8, 15, 0.62));
}

.faceid-step-count {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #dbe6ff;
  background: rgba(10, 16, 30, 0.66);
  border: 1px solid rgba(148, 178, 219, 0.22);
  padding: 5px 12px;
  border-radius: 999px;
}

.faceid-pose-hint {
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 650;
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.faceid-pose-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 46px;
  color: rgba(52, 211, 200, 0.9);
  text-shadow: 0 0 24px rgba(52, 211, 200, 0.45);
  pointer-events: none;
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.faceid-success {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 20, 16, 0.72);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  text-align: center;
  padding: 26px;
  animation: pop 0.3s ease;
}

.faceid-success strong {
  display: block;
  font-size: 18px;
  color: #baffdf;
}

.faceid-success span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 6px;
}

.faceid-headline {
  text-align: center;
}

.faceid-headline strong {
  display: block;
  font-size: clamp(17px, 2.4vw, 21px);
  letter-spacing: -0.01em;
}

.faceid-headline span {
  color: var(--muted);
  font-size: 13px;
}

.faceid-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.faceid-dots {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.faceid-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--track);
  transition: 0.2s ease;
}

.faceid-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.faceid-dot.done {
  background: var(--ok);
}

.pose-direction {
  position: absolute;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: 0.2s ease;
}

.pose-direction.active {
  color: var(--accent);
  font-weight: 700;
}

.pose-direction.left { left: -6px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.pose-direction.right { right: -6px; top: 50%; transform: translateY(-50%) rotate(90deg); }
.pose-direction.up { top: -4px; left: 50%; transform: translateX(-50%); }
.pose-direction.down { bottom: -4px; left: 50%; transform: translateX(-50%); }

/* ---------- Huella dactilar ---------- */
.fp-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fp-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--list-bg);
}

.fp-icon {
  width: 66px;
  height: 66px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
}

.fp-icon svg {
  width: 38px;
  height: 38px;
}

.fp-icon.scanning svg {
  animation: fpPulse 1.4s ease-in-out infinite;
}

@keyframes fpPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

.fp-copy strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.fp-copy span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  display: block;
}

.fp-warning {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 12.5px;
  line-height: 1.55;
}

.fp-warning strong {
  display: block;
  margin-bottom: 3px;
}

.fp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fp-list .list-item {
  padding: 10px 12px;
}

.fp-privacy {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--list-bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.fp-privacy svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: none;
  margin-top: 1px;
}


/* El atributo hidden debe ganar sobre los display de los componentes. */
[hidden] {
  display: none !important;
}

/* ---------- Datos previos: CURP, CSV y escáner QR ---------- */
.curp-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--list-bg);
}

.curp-status.ok {
  border-color: var(--ok-border);
  color: var(--ok-text);
  background: var(--ok-bg);
}

.curp-status.error {
  border-color: var(--danger-border);
  color: var(--danger-text);
  background: var(--danger-bg);
}

.curp-status strong {
  display: block;
  margin-bottom: 2px;
}

.inline-input {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-input input {
  flex: 1;
  min-width: 0;
}

.field .help {
  margin: 0;
}

.csv-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .csv-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.csv-result-box {
  margin-top: 14px;
}

.csv-errors {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 10px;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--list-bg);
}

.file-drop input[type="file"] {
  color: var(--muted);
  font-size: 13px;
  max-width: 100%;
}

/* ---------- Modal QR ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  width: min(560px, 100%);
  background: var(--modal-bg);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-card h3 {
  margin: 0;
  font-size: 18px;
}

.qr-video-wrap {
  position: relative;
  margin: 14px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05090f;
  aspect-ratio: 4 / 3;
}

.qr-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-frame {
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(52, 211, 200, 0.7);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(3, 7, 14, 0.28);
  pointer-events: none;
}


/* ---------- Feedback visual y sonoro del kiosco ---------- */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  border-radius: 0;
}

.flash-overlay.active {
  animation: kioskFlash 1.05s ease-out;
}

.flash-overlay.success {
  background:
    radial-gradient(circle at 50% 50%, rgba(61, 220, 151, 0.72), rgba(61, 220, 151, 0.26) 58%, rgba(61, 220, 151, 0.12)),
    rgba(61, 220, 151, 0.14);
  box-shadow: inset 0 0 0 12px rgba(61, 220, 151, 0.95), inset 0 0 150px rgba(61, 220, 151, 0.65);
}

.flash-overlay.error {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 107, 129, 0.72), rgba(255, 107, 129, 0.26) 58%, rgba(255, 107, 129, 0.12)),
    rgba(255, 107, 129, 0.14);
  box-shadow: inset 0 0 0 12px rgba(255, 107, 129, 0.95), inset 0 0 150px rgba(255, 107, 129, 0.65);
}

@keyframes kioskFlash {
  0% { opacity: 0; }
  10% { opacity: 1; }
  45% { opacity: 0.85; }
  100% { opacity: 0; }
}

.result-card {
  z-index: 20;
}

.sound-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.sound-hint svg {
  width: 14px;
  height: 14px;
}


/* ---------- Estacionamiento ---------- */
.metric {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.parking-stage {
  position: relative;
  margin-top: 12px;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #05090f;
}

.parking-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plate-guide {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 64%;
  height: 22%;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 191, 95, 0.95);
  border-radius: 12px;
  background: rgba(255, 191, 95, 0.06);
  box-shadow: 0 0 0 9999px rgba(4, 8, 15, 0.28) inset;
  pointer-events: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.plate-guide span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffe3b0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(7, 13, 26, 0.7);
  padding: 5px 10px;
  border-radius: 999px;
}

.parking-stage.detected .plate-guide {
  border-color: rgba(61, 220, 151, 0.95);
  background: rgba(61, 220, 151, 0.07);
}

.parking-stage.detected .plate-guide span {
  color: #b8ffe3;
}

.parking-zoom-preview {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(34%, 360px);
  padding: 6px;
  border-radius: 12px;
  background: rgba(7, 13, 26, 0.92);
  border: 1px solid rgba(61, 220, 151, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.parking-zoom-preview[hidden] {
  display: none;
}

.parking-zoom-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 8px;
  background: #020617;
}

.parking-zoom-preview span {
  font-size: 11px;
  color: #6ee7b7;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.parking-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.plate-capture {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(61, 220, 151, 0.45);
  background: rgba(8, 20, 28, 0.8);
}

.plate-capture[hidden] {
  display: none;
}

.plate-capture-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.plate-capture-copy span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fb0c9;
}

.plate-capture-copy strong {
  font-size: 16px;
  color: #6ee7b7;
  letter-spacing: 0.06em;
}

.plate-capture img {
  width: min(260px, 55%);
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #020617;
}

.parking-stage-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 200, 0.12);
}

.parking-stage-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(7, 13, 26, 0.82);
  border: 1px solid rgba(148, 178, 219, 0.32);
  color: #eaf2ff;
  font-size: 12px;
  font-weight: 700;
}

.parking-result {
  position: static;
  margin-top: 12px;
}

.repuve-alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #334155);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.repuve-alert strong {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.repuve-alert span {
  opacity: 0.8;
  font-size: 11px;
}

.repuve-alert.ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-text);
}

.repuve-alert.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
}

.repuve-alert.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.admin-parking-tabs {
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .plate-guide {
    width: 82%;
    height: 26%;
  }
}

/* ---------- Manuales ---------- */
.manual-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.manual-cover {
  width: 156px;
  max-width: 38%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  flex: none;
}

.manual-copy {
  min-width: 0;
}

.manual-copy h2 {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .manual-card {
    flex-direction: column;
  }
  .manual-cover {
    width: 180px;
    max-width: 100%;
  }
}

/* ---------- Laboratorio de voces ---------- */
.voice-sample {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel-2);
}

.voice-sample h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.voice-sample audio {
  width: 100%;
  margin: 4px 0 6px;
}

.voice-sample p {
  margin: 0;
}

/* ---------- Etiquetas de grupo (ojo de águila) ---------- */
.identity-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.kiosk-stage #result-slot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.kiosk-stage .result-card {
  pointer-events: auto;
  z-index: 10;
}

/* Modo pruebas del registro: autollenado de datos aleatorios */
.test-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 12px;
  background: var(--accent-soft);
}

.test-toolbar .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
}

.test-toolbar .checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #34d3c8);
}

/* ---------- Responsivo: kiosco en teléfonos (iPhone/Android) ---------- */
.grid.kiosk-layout,
.grid.kiosk-layout > *,
.kiosk-page .card,
.kiosk-page .inline {
  min-width: 0;
  max-width: 100%;
}

.kiosk-stage {
  min-height: 0;
}

@media (max-width: 1080px) {
  .kiosk-stage {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 720px) {
  .kiosk-page {
    padding: 10px;
    gap: 12px;
  }
  .kiosk-page h1 {
    font-size: clamp(20px, 6vw, 26px);
  }
  .kiosk-page .inline {
    justify-content: flex-start !important;
    gap: 8px;
  }
  .kiosk-page .btn {
    flex: 0 1 auto;
  }
  .kiosk-stage {
    aspect-ratio: 4 / 3;
    max-height: 58vh;
  }
  .kiosk-prompt {
    font-size: 16px;
    padding: 10px 14px;
    max-width: 94%;
  }
  .kiosk-overlay {
    padding: 10px;
  }
  .kiosk-bottom .small-note:last-child {
    display: none;
  }
  #session-select {
    min-width: 0 !important;
    width: 100%;
  }
  .kiosk-legend {
    font-size: 11px;
  }
  .topbar {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .main-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding: 2px 0 4px;
    -webkit-overflow-scrolling: touch;
  }
  .user-box {
    margin-left: auto;
  }
}

@media (max-width: 430px) {
  .kiosk-stage {
    aspect-ratio: 1 / 1;
    max-height: 52vh;
  }
}

/* CURP: campo principal a ancho completo (siempre visible y legible). */
.curp-input {
  width: 100%;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Kiosco simple: solo los números, con contorno verde difuminado y centro de cristal transparente. */
.simple-clock {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 9;
  transform: translateX(-50%);
  width: auto;
  padding: 0;
  margin: 0;
  text-align: center;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  isolation: auto;
  overflow: visible;
  pointer-events: none;
}

.simple-clock::before,
.simple-clock::after {
  content: none;
  display: none;
}

.simple-time {
  display: block;
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px rgba(94, 255, 190, 0.94);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 0 3px rgba(90, 255, 190, 0.95))
    drop-shadow(0 0 14px rgba(52, 255, 175, 0.62))
    drop-shadow(0 0 34px rgba(30, 255, 150, 0.32));
  text-shadow: 0 0 18px rgba(52, 255, 175, 0.30);
}

@supports not (-webkit-text-stroke: 1px #000) {
  .simple-time {
    color: rgba(205, 255, 235, 0.88);
    -webkit-text-fill-color: currentColor;
    text-shadow:
      0 0 4px rgba(90, 255, 190, 0.95),
      0 0 18px rgba(52, 255, 175, 0.58),
      0 0 38px rgba(30, 255, 150, 0.28);
  }
}

@media (max-width: 600px) {
  .simple-clock {
    top: 10px;
    width: 96vw;
  }

  .simple-time {
    font-size: clamp(2.4rem, 15vw, 3.8rem);
    letter-spacing: 0.045em;
    -webkit-text-stroke-width: 1.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .simple-time {
    filter: none;
  }
}


/* Login: sin marcas de MindStorms; solo la institución centrada. */
body[data-route="login"] .topbar .brand-mark {
  display: none !important;
}


/* Convención de color: todos los campos y listas usan las mismas variables. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea {
  background: var(--field-bg);
  border-color: var(--field-border);
  color: var(--text);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out;
}
.field input:disabled,
.field select:disabled,
input:disabled,
select:disabled {
  opacity: 0.65;
  color: var(--muted);
}
thead th {
  background: var(--table-head);
}

/* ---------- Responsivo integral (320–1440+) ---------- */
#enroll-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
}

#enroll-grid > * {
  min-width: 0;
}

@media (max-width: 1080px) {
  #enroll-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* El stage de estacionamiento no debe imponer un ancho por aspect-ratio/min-height. */
.parking-stage {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
}

@media (max-width: 720px) {
  .parking-stage {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .parking-stage {
    aspect-ratio: 1 / 1;
  }
}

/* Topbar: evitar que el último enlace quede cortado en escritorio. */
@media (max-width: 1600px) {
  .topbar {
    gap: 14px;
  }
  .main-nav a {
    padding: 8px 9px;
    font-size: 12.5px;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding: 8px 10px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .brand-text strong {
    font-size: 16px;
  }
  .user-chip span {
    display: none;
  }
}

/* Los formularios y acciones nunca deben empujar el documento. */
.field,
.inline-input,
.actions-row,
.actions,
.chip-row {
  min-width: 0;
  max-width: 100%;
}

.field input,
.field select,
.field textarea,
.inline-input input {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 560px) {
  .inline-input {
    flex-wrap: wrap;
  }
  .inline-input input {
    flex: 1 1 100%;
  }
  .inline-input .btn {
    width: 100%;
  }
  .modal-card {
    padding: 16px;
  }
}

/* Menú móvil: el topbar deja de ocultar enlaces en una tira horizontal. */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--hover-bg);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

@media (min-width: 1201px) {
  .main-nav {
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (max-width: 1200px) {
  .topbar {
    align-items: center;
  }
  .brand {
    order: 1;
  }
  .nav-toggle {
    display: inline-flex;
    order: 3;
    margin-left: 4px;
  }
  .user-box {
    order: 2;
    margin-left: auto;
    gap: 6px;
  }
  .user-chip {
    display: none;
  }
  .main-nav {
    display: none;
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow: visible;
    padding: 8px 0 2px;
    border-top: 1px solid var(--line);
  }
  .main-nav.open {
    display: flex;
    max-height: calc(100vh - 82px);
    overflow-y: auto;
  }
  .main-nav a {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
  }
  .main-nav a.active {
    color: var(--on-accent);
  }
}

@media (max-width: 430px) {
  .user-box a[href="#/cuenta"] {
    display: none;
  }
  .user-box .btn {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Áreas seguras de iOS/Android y cadenas largas sin romper el ancho. */
@supports (padding: max(0px)) {
  .topbar {
    padding-left: max(clamp(16px, 3vw, 32px), env(safe-area-inset-left));
    padding-right: max(clamp(16px, 3vw, 32px), env(safe-area-inset-right));
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .view {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
  .app-footer {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

.list-item,
.list-item .meta,
.user-chip,
.page-head,
.card {
  min-width: 0;
}

.list-item .meta strong,
.list-item .meta small,
.user-chip strong,
.user-chip span,
.page-head h1,
.page-head p {
  overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
  .topbar {
    flex-wrap: wrap;
  }
}

/* Marca oficial SIAB */
.brand-mark img[src*="siab"] {
  padding: 0;
  border-radius: 12px;
}

/* Selector de Diseño: contraste sobre el pie claro del tema base. */
.theme-picker select {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  border-color: var(--line-strong);
}

/* Login: lockup oficial SIAB (variante oscura para tarjetas claras; NEXO la cambia). */
.login-brand-logo {
  height: 44px;
  width: auto;
  max-width: 240px;
  display: block;
  content: url("/assets/brand/siab-logo.svg");
}

/* ============================================================
   Shell de página responsivo
   ------------------------------------------------------------
   - El documento no scrollea: #view scrollea por dentro.
   - El login se centra y se compacta según la altura disponible.
   - El pie se compacta en móvil y nunca desborda la página.
   ============================================================ */
#view {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 35%, transparent) transparent;
}

#view .login-wrap {
  flex: 1 1 auto;
  min-height: 0;
  align-items: safe center;
  justify-items: center;
}

#view .login-stack {
  min-width: 0;
  max-width: 100%;
}

/* Alturas bajas: la tarjeta de login cabe completa sin scroll.
   El aviso de privacidad y el copyright siguen disponibles en el pie. */
@media (max-height: 1150px) {
  #view .login-card .demo-accounts {
    display: none;
  }
}

@media (max-height: 980px) {
  #view .login-wrap {
    padding: clamp(8px, 1.6vh, 16px) clamp(10px, 2.2vw, 20px);
  }
  #view .login-card {
    padding: 1.15rem 1.35rem;
  }
  #view .login-card .brand {
    margin-bottom: 0.6rem;
  }
  #view .login-card h1 {
    font-size: 1.55rem;
    margin-bottom: 0.2rem;
  }
  #view .login-card p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
  }
  #view .login-card .field {
    margin-bottom: 0.6rem;
  }
  #view .login-card .field input {
    min-height: 2.35em;
    padding: 0.45em 0.65em;
  }
  #view .login-card .btn.primary.block {
    min-height: 2.4em;
    padding: 0.58em 1em;
  }
  #view .login-inst {
    margin-bottom: 0.15rem;
    padding: 0.3rem 0.85rem 0.3rem 0.3rem;
  }
  #view .login-inst-logo {
    width: 2.2rem;
    height: 2.2rem;
  }
  #view .login-inst-text strong {
    font-size: 0.84rem;
  }
  body > .app-footer {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    gap: 6px 16px;
  }
}

@media (max-height: 820px) {
  #view .login-card > p {
    display: none;
  }
  #view .login-card {
    padding: 0.95rem 1.15rem;
  }
  #view .login-card h1 {
    font-size: 1.4rem;
  }
  #view .login-card .brand {
    margin-bottom: 0.45rem;
  }
  body > .topbar {
    min-height: 0;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }
}

/* Móvil: login y pie compactos, sin desbordar el ancho. */
@media (max-width: 640px) {
  body > .app-footer {
    padding: 0.5rem 0.7rem;
    gap: 3px 9px;
    font-size: 0.66rem;
  }
  body > .app-footer p {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 0.62rem;
    line-height: 1.3;
  }
  body > .app-footer .footer-brand img {
    width: 1.15rem;
    height: 1.15rem;
  }
  body > .app-footer .footer-inst {
    padding-left: 0;
    border-left: 0;
  }
  body > .app-footer .footer-link {
    font-size: 0.66rem;
  }
  body > .app-footer .theme-picker,
  body > .app-footer .theme-picker select {
    font-size: 0.64rem;
  }
  #view .login-wrap {
    padding: 0.55rem;
  }
  #view .login-stack {
    gap: 0.5rem;
  }
  #view .login-card {
    padding: 0.95rem;
  }
  #view .login-card > p,
  #view .login-card .demo-accounts {
    display: none;
  }
  #view .login-card .brand {
    margin-bottom: 0.5rem;
  }
  #view .login-card h1 {
    font-size: 1.45rem;
  }
  #view .login-card .field {
    margin-bottom: 0.55rem;
  }
  #view .login-inst {
    margin-bottom: 0.1rem;
  }
}

@media (max-width: 480px) {
  body > .app-footer .footer-inst {
    display: none;
  }
  body > .app-footer .jam-footer-mascot {
    display: none;
  }
}

/* Aviso global de actualización (admin, dirección y RH) */
.update-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 20px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.update-banner[hidden] { display: none; }
.update-banner.available { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.update-banner.applying { border-color: color-mix(in srgb, var(--warn, #d97706) 55%, var(--line)); }
.update-banner.failed { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.update-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.update-banner-text strong { font-size: 14px; }
.update-banner-text span { font-size: 12.5px; opacity: 0.8; }
.update-banner-actions { display: flex; gap: 8px; flex: 0 0 auto; }
@media (max-width: 720px) {
  .update-banner { flex-wrap: wrap; margin: 8px 12px 0; }
  .update-banner-actions { width: 100%; justify-content: flex-end; }
}

/* Impresión: el shell fijo no debe recortar reportes a una sola pantalla. */
@media print {
  html,
  body {
    height: auto;
    min-height: 0;
  }
  body {
    display: block;
  }
  #view {
    display: block;
    overflow: visible;
  }
  body > .topbar,
  body > .app-footer {
    position: static;
  }
}

/* ==========================================================================
   Registro de personal · layout de tres columnas y secciones con iconos
   ========================================================================== */
.enroll-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.45fr) minmax(330px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.enroll-layout > .card { min-width: 0; }
.enroll-people { position: sticky; top: 12px; }
.enroll-person-list { min-height: 300px; max-height: calc(100vh - 330px); }
.enroll-hint { margin: 12px 0 0; }

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head > div { min-width: 0; flex: 1; }
.section-head h2 {
  margin: 0 0 2px;
  font-size: 19px;
  line-height: 1.2;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.section-head > .badge { flex: 0 0 auto; margin-left: auto; }
.section-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line);
}
.section-icon svg { width: 21px; height: 21px; }
.section-icon.sm {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  border-radius: 9px;
}
.section-icon.sm svg { width: 17px; height: 17px; }

.form-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px 4px;
  margin: 0 0 13px;
  background: rgba(255, 255, 255, 0.44);
}
.form-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
}
.form-group-head h3 { margin: 0 0 1px; font-size: 14px; }
.form-group-head p { margin: 0; color: var(--muted); font-size: 12px; }
.form-group .form-row:last-child { margin-bottom: 10px; }
.form-group > .field:last-child { margin-bottom: 10px; }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.form-actions .small-note { flex: 1; min-width: 220px; }
.search-field { margin-bottom: 12px; }

.enroll-csv { grid-column: 1 / -1; }
.enroll-csv .section-head { margin-bottom: 6px; }
.enroll-csv .file-drop { margin-top: 8px; }
.csv-help {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.csv-help summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: 12.5px;
}

@media (max-width: 1280px) {
  .enroll-layout {
    grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.6fr);
  }
  .enroll-biometric { grid-column: 1 / -1; }
  .enroll-person-list { max-height: 420px; }
}
@media (max-width: 820px) {
  .enroll-layout { grid-template-columns: 1fr; }
  .enroll-people { position: static; }
  .enroll-biometric, .enroll-csv { grid-column: auto; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 17px; }
}
.enroll-biometric .faceid-stage { width: min(330px, 100%); }
.enroll-biometric .faceid-actions { justify-content: flex-start; }

/* Dashboard de cobertura biométrica del registro */
.enroll-stats-card {
  margin-bottom: 18px;
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.58);
}
.stat-card > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stat-label { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { color: var(--text); font-size: 25px; line-height: 1.1; }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-card-pending .section-icon { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stats-chart {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 12px 6px;
  background: rgba(255, 255, 255, 0.42);
}
.stats-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 2px;
}
.stats-chart-head h3 { margin: 0; font-size: 13.5px; }
.stats-chart-head span { color: var(--accent); font-weight: 700; font-size: 13px; }
.echart { width: 100%; height: 225px; }
@media (max-width: 1180px) {
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .stats-kpis, .stats-charts { grid-template-columns: 1fr; }
  .echart { height: 210px; }
}

/* Lista de personas compacta: solo las filas necesarias y scroll interno */
.enroll-person-list {
  min-height: 0;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.enroll-person-list .list-item {
  padding: 9px 11px;
  gap: 9px;
  border-radius: 10px;
}
.enroll-person-list .list-item .meta strong { font-size: 13px; }
.enroll-person-list .list-item .meta small { font-size: 11px; }
.enroll-person-list .list-item .pill { font-size: 10.5px; padding: 3px 7px; }
.enroll-list-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 7px 2px 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.92) 35%);
  color: var(--muted);
  font-size: 11.5px;
}
.enroll-list-footer .btn { padding: 3px 8px; font-size: 11px; }
@media (max-width: 1280px) {
  .enroll-person-list { max-height: 360px; }
}

/* Captura facial en modal centrada y 100% responsiva */
body.face-modal-open { overflow: hidden; }
.face-panel-home.is-empty::after {
  content: "La captura de rostro se abre en una ventana centrada para aprovechar toda la pantalla.";
  display: block;
  padding: 22px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: var(--list-bg);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.face-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 32px);
  background: rgba(42, 23, 69, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.face-modal-backdrop[hidden] { display: none !important; }
.face-modal-card {
  width: min(980px, 100%);
  max-height: min(94dvh, 960px);
  overflow-y: auto;
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--modal-bg);
  box-shadow: 0 32px 90px rgba(42, 23, 69, 0.35);
}
.face-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.face-modal-head h2 { margin: 2px 0 4px; font-size: 22px; }
.face-modal-head p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 620px; line-height: 1.45; }
.face-modal-head .btn { flex: 0 0 auto; }
.face-modal-slot { display: flex; justify-content: center; width: 100%; }
.face-modal-slot #face-panel { width: 100%; }
.face-modal-slot .faceid-panel { width: 100%; }
.face-modal-slot .faceid-stage { width: min(430px, 86vw); margin: 10px auto; }
.face-modal-slot .faceid-headline { text-align: center; }
.face-modal-slot .faceid-actions { justify-content: center; }
@media (max-width: 640px) {
  .face-modal-backdrop { padding: 8px; }
  .face-modal-card { max-height: 96dvh; padding: 14px 12px; border-radius: 16px; }
  .face-modal-head h2 { font-size: 18px; }
  .face-modal-head p { font-size: 11.5px; }
  .face-modal-slot .faceid-stage { width: min(340px, 88vw); }
  .face-modal-slot .faceid-actions { gap: 8px; }
}

/* Contornos violeta con resplandor difuminado en campos y controles */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea,
.inline-input input,
.curp-input {
  border: 1.5px solid color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent),
    0 0 11px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover,
select:hover,
textarea:hover,
.inline-input input:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent),
    0 0 15px color-mix(in srgb, var(--accent) 28%, transparent);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
select:focus,
textarea:focus,
.inline-input input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent),
    0 0 20px color-mix(in srgb, var(--accent) 42%, transparent);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent),
    0 0 20px color-mix(in srgb, var(--accent) 42%, transparent);
}
.curp-status[hidden] {
  display: none !important;
}

.curp-status.warn {
  border-color: var(--warn-border);
  color: var(--warn-text);
  background: var(--warn-bg);
}

/* Jefatura del área: tarjeta compacta, sin estirar el checkbox */
.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.check-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 16%, transparent);
}
.check-card input[type="checkbox"],
.check-card .ui-check {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 20px;
}
.check-card-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.check-card-copy strong { font-size: 13px; color: var(--text); }
.check-card-copy small { font-size: 11.5px; color: var(--muted); }
.check-card-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .check-card { align-items: flex-start; flex-wrap: wrap; }
  .check-card-tag { margin-left: 32px; }
}

/* Los checkboxes dentro de .field no deben heredar el ancho ni el padding de
   los campos de texto (afectaba la tarjeta del bot de soporte). */
.field input[type="checkbox"],
.field input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 0 !important;
  padding: 0 !important;
  flex: 0 0 18px;
  accent-color: var(--accent);
}

/* Administración: navegación por áreas y accesos directos del kiosco. */
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  position: sticky;
  top: 8px;
  z-index: 20;
  margin: 14px 0 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.admin-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.admin-tab:hover,
.admin-tab:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  outline: none;
}

.admin-tab.is-active {
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 32%, transparent);
}

[data-admin-panel][hidden] { display: none !important; }

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.admin-quick-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.admin-quick-link strong { font-size: 13.5px; }
.admin-quick-link span { color: var(--muted); font-size: 12px; line-height: 1.4; }

.admin-quick-link:hover,
.admin-quick-link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translateY(-1px);
  outline: none;
}

@media (max-width: 720px) {
  .admin-tabs {
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .admin-tab { flex: 0 0 auto; }
}

/* Identidad del plantel configurable */
.footer-inst-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.footer-inst-text strong {
  font-size: 13px;
  color: var(--muted);
}

.footer-inst-text small {
  color: var(--muted-2);
  font-size: 10.5px;
}

.footer-map-link {
  margin-top: 2px;
  font-size: 10.5px;
}

.brand-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
}

.login-inst-details {
  margin: -4px auto 14px;
  max-width: 460px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

.brand-logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--list-bg);
}

.brand-logo-preview img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}

.brand-logo-preview .preview-copy {
  min-width: 0;
  flex: 1;
}

.brand-logo-preview .preview-copy strong {
  display: block;
  font-size: 13px;
}

.brand-logo-preview .preview-copy small {
  color: var(--muted-2);
  font-size: 11px;
}
