:root {
  --fondo: #f4f6f8;
  --papel: #ffffff;
  --tinta: #1d2330;
  --suave: #5b6272;
  --tenue: #8a91a0;
  --linea: #e3e6eb;
  --linea-fuerte: #cfd5dd;
  --acento: #0b5d6b;
  --acento-2: #0e7486;
  --acento-claro: #e6f2f4;
  --ok: #1b7f4b;
  --ok-claro: #e5f4eb;
  --aviso: #8a5a00;
  --aviso-claro: #fdf3e0;
  --error: #b42318;
  --error-claro: #fdecea;
  --radio: 12px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--acento); }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.015em; }
h2 { font-size: 18px; margin: 0 0 10px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.sub { color: var(--suave); margin: 0; }
.mini { font-size: 12.5px; color: var(--tenue); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; white-space: nowrap; }
.derecha { text-align: right; }

/* ── Botones ─────────────────────────────────────────── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--linea-fuerte);
  background: var(--papel); color: var(--tinta); font: inherit; font-weight: 550; font-size: 14.5px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s;
}
.boton:hover { background: #f7f8fa; border-color: #b9c0ca; }
.boton.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.boton.primario:hover { background: var(--acento-2); border-color: var(--acento-2); }
.boton.peligro { color: var(--error); border-color: #efc4bf; }
.boton.peligro:hover { background: var(--error-claro); }
.boton.peligro.lleno { background: var(--error); border-color: var(--error); color: #fff; }
.boton.peque { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.boton.grande { padding: 13px 20px; font-size: 16px; }
.boton:disabled { opacity: .5; cursor: not-allowed; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
td.acciones { justify-content: flex-end; flex-wrap: nowrap; }

/* ── Etiquetas y bandas ──────────────────────────────── */
.etiqueta { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #edf0f3; color: var(--suave); white-space: nowrap; vertical-align: middle; }
.etiqueta.ok { background: var(--ok-claro); color: var(--ok); }
.etiqueta.aviso { background: var(--aviso-claro); color: var(--aviso); }
.etiqueta.error { background: var(--error-claro); color: var(--error); }
.etiqueta.acento { background: var(--acento-claro); color: var(--acento); }
.banda { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; font-size: 14.5px; }
.banda.info { background: var(--acento-claro); border-color: #cfe5e9; }
.banda.aviso { background: var(--aviso-claro); border-color: #f3dfb4; color: #5e3e00; }
.banda.ok { background: var(--ok-claro); border-color: #c7e7d3; color: #0f5132; }
.banda.error { background: var(--error-claro); border-color: #f5c2bd; color: #7a1a12; }
.banda ul { margin: 8px 0 0; padding-left: 20px; }

/* ── Formularios ─────────────────────────────────────── */
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--tinta); padding: 9px 11px; width: 100%;
  border: 1px solid var(--linea-fuerte); border-radius: 9px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--acento-claro); border-color: var(--acento); }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--acento); flex: none; }
input[type=color] { padding: 3px; height: 40px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 550; color: var(--suave); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.rejilla .ancho { grid-column: 1 / -1; }
.rejilla-sesion { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(100px, 1fr) minmax(100px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 10px; }
fieldset { border: 0; padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--linea); }
fieldset:last-of-type { border-bottom: 0; margin-bottom: 0; }
legend { font-weight: 650; font-size: 16.5px; margin-bottom: 4px; padding: 0; }
.ayuda { color: var(--suave); font-size: 13.5px; margin: 0 0 12px; }
.opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 4px 22px; }
.opcion { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; cursor: pointer; }
.eleccion { border: 1.5px solid var(--linea); border-radius: 11px; padding: 14px; display: flex; gap: 12px; cursor: pointer; align-items: flex-start; font-size: 14.5px; }
.eleccion:has(input:checked) { border-color: var(--acento); background: var(--acento-claro); }
.pie-form { display: flex; gap: 10px; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--linea); margin-top: 6px; flex-wrap: wrap; }

/* ── Estructura del panel ────────────────────────────── */
.barra { background: var(--papel); border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 20; }
.barra-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 22px; }
.marca { font-weight: 750; font-size: 18px; color: var(--tinta); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.marca-icono { width: 30px; height: 30px; border-radius: 8px; background: var(--acento); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--suave); text-decoration: none; font-weight: 550; white-space: nowrap; }
.nav a:hover { color: var(--tinta); background: #f1f3f5; }
.nav a.activa { background: var(--acento-claro); color: var(--acento); }
.barra-der { display: flex; align-items: center; gap: 12px; color: var(--suave); font-size: 14px; white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 90px; }
.cabecera-vista { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.volver { display: inline-block; margin-bottom: 10px; color: var(--suave); text-decoration: none; font-size: 14px; }
.volver:hover { color: var(--acento); }
.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 22px; box-shadow: var(--sombra); margin-bottom: 16px; }
.zona-peligro { border-color: #f3d2ce; }
.pestanas { display: flex; gap: 2px; border-bottom: 1px solid var(--linea); margin-bottom: 20px; overflow-x: auto; }
.pestanas a { padding: 10px 14px; color: var(--suave); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 550; }
.pestanas a:hover { color: var(--tinta); }
.pestanas a.activa { color: var(--acento); border-bottom-color: var(--acento); }
.barra-herramientas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.espaciador { flex: 1; }
.vacio { text-align: center; padding: 56px 20px; color: var(--suave); background: var(--papel); border: 1px dashed var(--linea-fuerte); border-radius: var(--radio); }
.vacio h2 { color: var(--tinta); }

.lista-cursos { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.tarjeta-curso { display: flex; flex-direction: column; gap: 6px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 18px; text-decoration: none; color: inherit; box-shadow: var(--sombra); transition: border-color .12s, transform .12s; }
.tarjeta-curso:hover { border-color: var(--acento); transform: translateY(-1px); }
.tc-titulo { font-weight: 650; font-size: 16px; line-height: 1.3; }
.tc-meta { color: var(--suave); font-size: 13.5px; }
.tc-pie { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 13.5px; color: var(--suave); flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 14px 16px; }
.stat b { display: block; font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.stat span { color: var(--suave); font-size: 13px; }
.pasos { list-style: none; margin: 0; padding: 0; }
.pasos li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--linea); }
.pasos li:last-child { border-bottom: 0; }
.paso-marca { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #edf0f3; color: var(--suave); flex: none; }
.paso-marca.hecho { background: var(--ok); color: #fff; }
.pasos .paso-texto { flex: 1; }

/* ── Tablas ──────────────────────────────────────────── */
.tabla-envoltura { overflow-x: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--suave); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--linea); background: #fafbfc; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfd; }
.celda-sesion { text-align: center; }
th.celda-sesion { text-transform: none; letter-spacing: 0; }

.fila-imagen { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.zona-imagen { width: 220px; height: 110px; border: 1px dashed var(--linea-fuerte); border-radius: 10px; display: grid; place-items: center; background: #fafbfc; overflow: hidden; }
.zona-imagen img { max-width: 90%; max-height: 90px; object-fit: contain; }
.rejilla-ajustes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.clave-generada { font-size: 20px; padding: 10px 14px; background: #fff; border: 1px dashed var(--acento); border-radius: 8px; display: inline-block; margin: 6px 0; user-select: all; }

/* ── Diálogos y avisos ───────────────────────────────── */
dialog.dialogo { border: 0; border-radius: 16px; padding: 0; width: min(500px, calc(100vw - 28px)); box-shadow: 0 24px 60px rgba(16, 24, 40, .28); color: var(--tinta); }
dialog.dialogo.ancho { width: min(720px, calc(100vw - 28px)); }
dialog.dialogo form { padding: 24px; }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
.dlg-cuerpo { max-height: 65vh; overflow-y: auto; }
.dlg-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--tinta); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 1000; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); font-size: 14.5px; }
.toast.error { background: var(--error); }

/* ── Páginas públicas ────────────────────────────────── */
.cabecera-publica { background: var(--papel); border-bottom: 1px solid var(--linea); }
.cabecera-publica .barra-in { justify-content: space-between; }
.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.estrecho { max-width: 680px; margin: 0 auto; padding: 36px 20px 80px; }
.pie-publico { text-align: center; color: var(--tenue); font-size: 13px; padding: 30px 20px; }

.hero { padding: 70px 0 50px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -.03em; line-height: 1.08; margin-bottom: 18px; }
.hero .entradilla { font-size: 18.5px; color: var(--suave); max-width: 560px; margin-bottom: 26px; }
.muestra-diploma { background: #fff; border-radius: 6px; padding: 12px; box-shadow: 0 30px 60px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08); transform: rotate(-1.2deg); }
.muestra-marco { border: 3px solid var(--acento); outline: 1px solid var(--acento); outline-offset: -8px; padding: 26px 22px 18px; text-align: center; font-family: Georgia, "Times New Roman", serif; }
.muestra-empresa { font-family: system-ui, sans-serif; font-weight: 700; font-size: 10px; letter-spacing: .14em; color: var(--acento); }
.muestra-titulo { font-size: 22px; font-weight: 700; color: var(--acento); letter-spacing: .06em; margin: 8px 0 10px; }
.muestra-nombre { font-size: 19px; font-weight: 700; margin: 6px 0; }
.muestra-texto { font-size: 11.5px; color: #444; }
.muestra-pie { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; font-family: system-ui, sans-serif; text-align: left; }
.muestra-qr { width: 46px; height: 46px; background:
  linear-gradient(90deg, #1d2330 50%, transparent 0) 0 0 / 9px 9px,
  linear-gradient(#1d2330 50%, transparent 0) 0 0 / 9px 9px; opacity: .85; border: 3px solid #1d2330; }
.muestra-csv { font-family: ui-monospace, Menlo, monospace; font-size: 10px; font-weight: 700; }
.bloque { padding: 56px 0; }
.bloque h2 { font-size: 30px; letter-spacing: -.02em; margin-bottom: 8px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 26px; }
.ventaja { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 22px; }
.ventaja-icono { width: 38px; height: 38px; border-radius: 10px; background: var(--acento-claro); color: var(--acento); display: grid; place-items: center; font-size: 19px; margin-bottom: 12px; }
.ventaja p { color: var(--suave); margin: 0; font-size: 14.5px; }
.pasos-home { counter-reset: paso; list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.pasos-home li { counter-increment: paso; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px; }
.pasos-home li::before { content: counter(paso); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--acento); color: #fff; font-weight: 700; margin-bottom: 10px; }
.pasos-home p { color: var(--suave); font-size: 14.5px; margin: 0; }
.caja-verificar { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); }
.fila-verificar { display: flex; gap: 8px; }
.fila-verificar input { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .05em; }
.banda-oscura { background: #0f2a30; color: #e8f1f3; border-radius: 18px; padding: 40px; }
.banda-oscura h2 { color: #fff; }
.banda-oscura ul { margin: 16px 0 0; padding-left: 20px; color: #c5d6da; }
.banda-oscura li { margin-bottom: 8px; }

.veredicto { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 14px; margin-bottom: 18px; }
.veredicto.ok { background: var(--ok-claro); color: #0f5132; }
.veredicto.error { background: var(--error-claro); color: #7a1a12; }
.veredicto.neutro { background: #eef0f3; color: var(--tinta); }
.veredicto-icono { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; flex: none; }
.veredicto.ok .veredicto-icono { background: var(--ok); }
.veredicto.error .veredicto-icono { background: var(--error); }
.veredicto.neutro .veredicto-icono { background: var(--tenue); }
.veredicto-titulo { font-weight: 700; font-size: 18.5px; }
dl.datos { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; margin: 0 0 22px; }
dl.datos dt { color: var(--suave); font-size: 13.5px; padding-top: 1px; }
dl.datos dd { margin: 0; }
.soltar { display: block; border: 2px dashed var(--linea-fuerte); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; color: var(--suave); margin-top: 10px; }
.soltar.encima { border-color: var(--acento); background: var(--acento-claro); }
.comprobar-pdf { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--linea); }

/* Check-in en el móvil */
.checkin { max-width: 460px; margin: 0 auto; padding: 22px 18px 60px; }
.checkin .tarjeta { padding: 22px 20px; }
.checkin h1 { font-size: 22px; }
.exito { text-align: center; padding: 26px 10px 10px; }
.exito-icono { width: 84px; height: 84px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 46px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 16px; }

/* Pantalla de la sala */
body.proyector { background: #0c2328; color: #eaf3f5; min-height: 100vh; }
.proyector-in { min-height: 100vh; display: grid; grid-template-columns: 1fr auto; gap: 5vw; align-items: center; padding: 4vh 5vw; }
.proyector h1 { font-size: clamp(26px, 3.4vw, 54px); color: #fff; letter-spacing: -.02em; margin-bottom: 10px; }
.proyector .sesion { font-size: clamp(16px, 1.7vw, 26px); color: #a9c4ca; margin-bottom: 4vh; }
.proyector .sesion::first-letter { text-transform: uppercase; }
.proyector .instruccion { font-size: clamp(20px, 2.3vw, 36px); color: #fff; margin-bottom: 3vh; line-height: 1.3; }
.proyector .contador { font-size: clamp(18px, 2vw, 30px); color: #a9c4ca; }
.proyector .contador b { font-size: clamp(40px, 5vw, 84px); color: #fff; display: block; line-height: 1.05; }
.qr-caja { background: #fff; border-radius: 22px; padding: 2.4vh; width: min(78vh, 44vw); }
.qr-caja svg { display: block; width: 100%; height: auto; }
.qr-progreso { height: 6px; background: #e3e9eb; border-radius: 3px; margin-top: 1.6vh; overflow: hidden; }
.qr-progreso div { height: 100%; background: var(--acento); width: 100%; }
.qr-cerrado { width: min(78vh, 44vw); aspect-ratio: 1; border: 3px dashed #3b5b62; border-radius: 22px; display: grid; place-items: center; text-align: center; color: #a9c4ca; font-size: clamp(18px, 2vw, 30px); padding: 20px; }
.proyector-controles { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; opacity: .35; transition: opacity .2s; }
.proyector-controles:hover { opacity: 1; }
.proyector-error { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--error); color: #fff; padding: 8px 14px; border-radius: 8px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 34px; }
  .proyector-in { grid-template-columns: 1fr; text-align: center; }
  .qr-caja, .qr-cerrado { width: min(80vw, 60vh); margin: 0 auto; }
}
@media (max-width: 640px) {
  main { padding-top: 18px; }
  .barra-in { gap: 12px; }
  .barra-der .quien { display: none; }
  h1 { font-size: 22px; }
  .rejilla-sesion { grid-template-columns: 1fr 1fr; }
  .rejilla-sesion .campo:first-child { grid-column: 1 / -1; }
  dl.datos { grid-template-columns: 1fr; gap: 2px; }
  dl.datos dd { margin-bottom: 10px; }
  .fila-verificar { flex-direction: column; }
  .banda-oscura { padding: 26px; }
}
