:root {
  color-scheme: dark;
  --bg: #060b08;
  --surface: #0d1812;
  --raised: #14231b;
  --line: #30453a;
  --fg: #edf5ef;
  --soft: #b4c6bb;
  --green: #8ce7ab;
  --red: #ff9a93;
  --amber: #f3ce84;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--fg); background: radial-gradient(ellipse at 25% 0, #183323 0, var(--bg) 48rem); }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px max(16px, calc((100vw - 1000px) / 2)); background: #080f0b; border-bottom: 1px solid var(--line); }
.site-header nav, .actions, .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 720; color: var(--fg); line-height: 1.2; }
.brand img { border-radius: 10px; }
.brand small { display: block; margin-top: 4px; color: var(--soft); font-weight: 500; }
main { width: min(1000px, calc(100% - 32px)); margin: clamp(22px, 5vw, 52px) auto 64px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
.eyebrow { margin: 0 0 8px; color: var(--green); font: 650 .76rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; }
.intro { padding: clamp(18px, 4vw, 36px); margin-bottom: 18px; border: 1px solid #365646; border-radius: 20px; background: linear-gradient(135deg, #203c2c, var(--surface) 72%); }
#status { color: var(--soft); margin: 12px 0 4px; max-width: 65ch; }
.intro .actions { margin-top: 18px; }
button, .button, input, textarea { font: inherit; }
button, .button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; min-height: 40px; color: var(--fg); background: var(--raised); font-weight: 620; text-decoration: none; cursor: pointer; }
button:hover:not(:disabled), .button:hover { background: #223c2e; border-color: #57846b; }
button.accent, .button.accent { background: var(--green); color: #0c2215; border-color: var(--green); }
button.accent:hover:not(:disabled), .button.accent:hover { background: #adf4c3; }
button.danger { color: var(--red); }
button:disabled { opacity: .48; cursor: default; }
input:not([type=radio]), textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
input[type=radio] { accent-color: var(--green); }
.exam-meter { position: sticky; top: 0; z-index: 2; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #101c15; }
.meter-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-variant-numeric: tabular-nums; }
#clock { color: var(--green); font-weight: 720; }
#clock.low { color: var(--amber); }
progress { width: 100%; height: 8px; accent-color: var(--green); }
fieldset { min-width: 0; margin: 20px 0 0; border: 1px solid var(--line); border-radius: 14px; padding: 12px clamp(12px, 3vw, 22px) 18px; background: var(--surface); }
legend { padding: 0 7px; max-width: 100%; color: var(--fg); font-weight: 730; overflow-wrap: anywhere; }
.choice { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-top: 8px; cursor: pointer; }
.choice:hover { background: var(--raised); }
.choice:has(input:checked) { border-color: var(--green); background: #203b2a; }
.choice input { flex: 0 0 auto; margin-top: .36rem; }
.form-actions { margin-top: 18px; }
.admin-heading, .dialog-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tabs { margin: 22px 0 14px; }
.tabs [aria-pressed=true] { color: var(--green); border-color: #659778; }
.staff-card { border: 1px solid var(--line); border-radius: 18px; padding: clamp(14px, 3vw, 25px); background: var(--surface); }
#staff_status:not(:empty) { margin: 0 0 12px; color: var(--green); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.settings label, .bank label, .history-tools label { color: var(--soft); font-size: .91rem; font-weight: 620; }
.settings input, .bank textarea, .bank input:not([type=radio]) { display: block; margin-top: 5px; }
.bank fieldset { background: var(--raised); }
.bank textarea { min-height: 70px; resize: vertical; }
.bank-option { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: end; margin-top: 10px; }
.bank-option .correct { align-self: center; white-space: nowrap; }
.bank-option .correct input { margin-right: 5px; }
.bank .actions { margin-top: 12px; }
.history-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 7px 8px; margin: 14px 0; }
.history-tools label { grid-column: 1 / -1; }
.history-scroll { max-height: min(56vh, 540px); min-height: 120px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overscroll-behavior: contain; }
.history-scroll > p { padding: 16px; color: var(--soft); }
.history-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.history-table th, .history-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.history-table th { position: sticky; top: 0; background: var(--raised); color: var(--soft); font-size: .8rem; letter-spacing: .025em; }
.history-table tr:last-child td { border-bottom: 0; }
.history-table tr:hover td { background: #132019; }
.history-table small { display: block; color: var(--soft); font-size: .78rem; }
.history-table button { min-height: 34px; padding: 4px 9px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--raised); font-weight: 680; font-size: .82rem; }
.badge.passed { color: var(--green); }.badge.failed { color: var(--red); }.badge.cancelled { color: var(--amber); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
dialog { width: min(680px, calc(100% - 24px)); max-height: 85dvh; overflow: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--fg); background: var(--surface); padding: clamp(12px, 3vw, 22px); }
dialog::backdrop { background: #000a; }
.dialog-heading { margin-bottom: 12px; }
#review li { margin-bottom: 11px; } #review ol { padding-left: 22px; } #review li p { color: var(--soft); }
@media (max-width: 540px) {
  .intro { border-radius: 14px; }
  .history-tools { grid-template-columns: 1fr 1fr; }
  .history-tools input { grid-column: 1 / -1; }
  .bank-option { grid-template-columns: 1fr auto; }
  .bank-option > :first-child { grid-column: 1 / -1; }
  .pagination { justify-content: space-between; }
}

.whitelist-page .intro{position:relative;overflow:hidden;background:radial-gradient(ellipse at 92% 0,#335740 0,transparent 45%),linear-gradient(135deg,#1e3e2c,#0d1912 75%)}
.whitelist-page .intro::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(0deg,#0000 0 5px,#ffffff08 5px 6px);pointer-events:none}
.whitelist-page .intro>*{position:relative;z-index:1}
.exam-brief{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.exam-brief span{padding:4px 8px;border:1px solid #3f7454;border-radius:5px;background:#13281c;color:var(--green);font-size:.8rem}
.whitelist-page .exam-meter{box-shadow:0 6px 14px #0004;background:#13281c}
.whitelist-page #questions fieldset{box-shadow:inset 0 3px #6fe39a14}
.whitelist-page #questions legend{color:#c3efd0}
.whitelist-page .tabs [aria-pressed=true]{background:#254734;box-shadow:inset 0 -2px var(--green)}

.closed-notice{margin:12px 0 0;color:var(--amber);border-left:3px solid var(--amber);padding:6px 10px;background:#33291844}

/* El pie ocupa el borde inferior cuando el contenido de la vista es corto. */
body:is(.whitelist-page, .fichas-page) {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}
:is(.whitelist-page, .fichas-page) > main {
  min-width: 0;
  margin-block: clamp(20px, 5vw, 52px) clamp(18px, 3vw, 36px);
}
:is(.whitelist-page, .fichas-page) > .onerol-footer {
  grid-row: 3;
  margin: 0;
}
@media (max-height: 720px) {
  :is(.whitelist-page, .fichas-page) > main { margin-block: 16px 12px; }
}
:is(.whitelist-page, .fichas-page) .onerol-footer-inner {
  max-width: 1032px;
  padding-inline: 16px;
}
@media (max-width: 540px) {
  :is(.whitelist-page, .fichas-page) .admin-heading > div { min-width: 0; }
  :is(.whitelist-page, .fichas-page) .admin-heading h1 { overflow-wrap: anywhere; }
  .fichas-page .portrait-picker label { flex-basis: 100%; }
}
