/* Panel del autorizador. Sin fuentes externas ni scripts (CSP). */
:root {
  --fondo: #eef1f4;
  --hoja: #ffffff;
  --tinta: #1c2430;
  --tenue: #5b6676;
  --linea: #c9d1da;
  --accion: #2457c5;
  --accion-tinta: #ffffff;
  --aire: #1e9e5a;
  --aviso: #d99a00;
  --fuera: #c8372d;
  --fuera-fondo: #fbeceb;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #12171e;
    --hoja: #1a212b;
    --tinta: #e4e9ef;
    --tenue: #9aa6b4;
    --linea: #2f3a47;
    --accion: #6b93f0;
    --accion-tinta: #0d1420;
    --fuera-fondo: #2e1b1a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accion); }
:focus-visible { outline: 3px solid var(--accion); outline-offset: 2px; }

.barra {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
  padding: 0.75rem 1rem; background: var(--hoja); border-bottom: 1px solid var(--linea);
}
.barra .marca { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--tinta); }
.barra nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; flex: 1; }
.barra nav a { text-decoration: none; color: var(--tenue); }
.barra nav a:hover, .barra nav a[aria-current] { color: var(--tinta); }
.barra form { margin: 0; }
@media (max-width: 760px) {
  .barra { justify-content: space-between; }
  .barra nav { order: 3; flex-basis: 100%; }
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.estrecho { max-width: 440px; padding-top: 12vh; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
p { max-width: 70ch; }
.tenue { color: var(--tenue); }
.numeros, td.numeros { font-variant-numeric: tabular-nums; white-space: nowrap; }

.cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }

.hoja { background: var(--hoja); border: 1px solid var(--linea); border-radius: 8px; padding: 1.25rem; }
.hoja + .hoja { margin-top: 1rem; }
.hoja > h2:first-child { margin-top: 0; }

table { width: 100%; border-collapse: collapse; background: var(--hoja); }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-weight: 600; color: var(--tenue); font-size: 0.9rem; }
.tabla { overflow-x: auto; border: 1px solid var(--linea); border-radius: 8px; }
.tabla tr:last-child td { border-bottom: 0; }

/* La luz de tally: en el aire, a punto de salir, fuera del aire. */
.tally { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.tally::before {
  content: ""; width: 0.8rem; height: 0.8rem; border-radius: 50%;
  background: var(--color-tally); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-tally) 25%, transparent);
}
.tally.bien { --color-tally: var(--aire); }
.tally.aviso { --color-tally: var(--aviso); }
.tally.mal { --color-tally: var(--fuera); }
.tally.neutro { --color-tally: var(--tenue); }
tr.mal td:first-child { box-shadow: inset 4px 0 0 var(--fuera); }
tr.aviso td:first-child { box-shadow: inset 4px 0 0 var(--aviso); }

form.campos { display: grid; gap: 1rem; }
form.campos .doble { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
/* En cada par, las cajas de texto a la misma altura aunque una ayuda sea más larga. */
form.campos .doble label { align-content: end; }
label { display: grid; gap: 0.3rem; font-weight: 600; }
label small { font-weight: 400; color: var(--tenue); }
input, textarea, select {
  font: inherit; font-weight: 400; color: inherit; background: var(--fondo);
  border: 1px solid var(--linea); border-radius: 6px; padding: 0.5rem 0.6rem; width: 100%;
}
textarea { min-height: 5.5rem; }
.en-linea { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.en-linea input, .en-linea select { width: auto; flex: 1; min-width: 12rem; }
form.en-linea, td form { margin: 0; }

button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.5rem 1rem; border-radius: 6px;
  border: 1px solid var(--accion); background: var(--accion); color: var(--accion-tinta);
}
a.boton {
  display: inline-block; font-weight: 600; text-decoration: none;
  padding: 0.5rem 1rem; border-radius: 6px; background: var(--accion); color: var(--accion-tinta);
}
button.secundario { background: transparent; color: var(--accion); }
button.peligro { background: var(--fuera); border-color: var(--fuera); color: #fff; }
button.discreto { background: none; border: 0; padding: 0; color: var(--accion); font-weight: 400; text-decoration: underline; }

.error, .aviso-caja {
  border-radius: 6px; padding: 0.75rem 1rem; margin: 0 0 1rem;
  border: 1px solid var(--fuera); background: var(--fuera-fondo);
}
.aviso-caja { border-color: var(--aviso); background: color-mix(in srgb, var(--aviso) 12%, var(--hoja)); }
.cuidado { border-color: var(--fuera); }
.separada { margin-top: 2rem; }
.cuidado h2 { margin-top: 0; color: var(--fuera); }

.lista-alias { list-style: none; padding: 0; margin: 0 0 1rem; }
.lista-alias li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--linea); }

code { font-size: 0.95em; overflow-wrap: anywhere; }
code.clave { display: inline-block; font-size: 1.3rem; padding: 0.5rem 0.75rem; background: var(--fondo); border: 1px solid var(--linea); border-radius: 6px; user-select: all; }
.logo-muestra { background: #000; padding: 1rem; border-radius: 6px; margin: 0 0 0.5rem; }
.logo-muestra img { height: 28px; width: auto; display: block; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 6px; }
.rejilla { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

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