/* ═══════════════════════════════════════════════════════════════
   STAFF · interfaz del equipo en el stand (tema claro .theme-staff)
   Pensada para el celular en una mano (Escanear, Fotos, Programa) y
   para la laptop en el Panel (se ensancha en pantallas grandes).
   Índice:
     1. Cabecera, pestañas y avisos
     2. Títulos y tarjetas
     3. Ingreso (login)
     4. Escáner y buscador
     5. Ficha de la persona (sellos, acciones, historial)
     6. Fotos (cola de revisión)
     7. Programa en vivo
     8. Panel: pestañas, números, tablas, formularios
   ═══════════════════════════════════════════════════════════════ */

.theme-staff { --kicker: var(--link); }
.page--wide { max-width: 1120px; }

/* ── 1. Cabecera, pestañas y avisos ────────────────────────── */
.st-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff; }
.st-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.st-brand .tag { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; padding: 3px 7px; border-radius: 6px; background: var(--cc-yellow); color: var(--ink); }
.st-who { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; background: transparent; border: 0; color: #fff; padding: 6px 4px; }
.st-who .dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; flex: none; }
.st-who.is-off .dot { background: var(--cc-red); animation: aiPulse 1.4s ease-out infinite; }

.st-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; pointer-events: none; }
.st-tabbar nav { pointer-events: auto; width: 100%; max-width: 560px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: #fff; border-top: 2px solid var(--st-line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(22, 32, 46, .08); }
.st-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--st-muted); font-size: 11.5px; font-weight: 800; text-decoration: none; }
.st-tab:hover { color: var(--ink); }
.st-tab[aria-current="page"] { color: var(--ink); background: var(--sky-3); }
.st-tab .badge { position: absolute; top: 0; left: 52%; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--cc-red); color: #fff; font-size: 11px; line-height: 19px; text-align: center; border: 2px solid #fff; animation: aiFade .3s var(--ease-pop); }

/* Aviso flotante grande de acción hecha (además del toast) */
.st-flash { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.st-flash > div { background: var(--ink); color: #fff; border: 3px solid #3DDC84; border-radius: 26px; padding: 18px 26px; text-align: center; font-family: var(--f-display); font-weight: 800; font-size: 22px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); animation: aiFlash 1.2s ease-out both; }
.st-flash > div small { display: block; font-family: var(--f-text); font-size: 14px; font-weight: 700; color: #C2D0EA; margin-top: 4px; }
@keyframes aiFlash { 0% { opacity: 0; transform: scale(.85); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.98); } }

/* ── 2. Títulos y tarjetas ─────────────────────────────────── */
.st-title { padding: 14px 14px 0; }
.st-title .h1 { font-size: 26px; margin-top: 4px; line-height: 1.15; }
.st-card { background: #fff; border: 2px solid var(--st-line); border-radius: 20px; padding: 14px; }
.st-card + .st-card { margin-top: 12px; }
.st-card--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.st-card--warn { background: var(--yellow-soft); border-color: #E8C35A; }
.st-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--st-muted); }
.st-sep { border: 0; border-top: 1px solid #E6ECF2; margin: 12px 0; }
.st-note { font-size: 12.5px; color: var(--st-muted); line-height: 1.45; }
.st-empty { text-align: center; padding: 26px 12px; color: var(--st-muted); }
.st-empty img { margin: 0 auto 8px; width: 80px; height: auto; }
.st-input { width: 100%; min-width: 0; font: inherit; font-size: 15px; padding: 11px 12px; border: 2px solid var(--st-line-2); border-radius: 13px; background: #fff; color: var(--ink); }
.st-input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(31, 111, 153, .15); }
select.st-input { appearance: auto; }
textarea.st-input { min-height: 80px; resize: vertical; }
.st-input--sm { padding: 7px 9px; font-size: 14px; border-radius: 10px; }
.st-input.is-invalid { border-color: var(--danger); }

/* ── 3. Ingreso ────────────────────────────────────────────── */
.st-login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 18px 40px; }
.st-login .card { padding: 20px 18px; }
.pin-input { letter-spacing: .5em; font-family: var(--f-display); font-weight: 800; font-size: 26px; text-align: center; }

/* ── 4. Escáner y buscador ─────────────────────────────────── */
.scanner { position: relative; height: 240px; border-radius: 22px; background: radial-gradient(circle at 50% 40%, #2A3A55 0%, #0F1828 75%); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: relative; width: 160px; height: 160px; }
.scanner .frame i { position: absolute; width: 34px; height: 34px; border: 0 solid var(--cc-yellow); }
.scanner .frame i:nth-child(1) { left: 0; top: 0; border-left-width: 5px; border-top-width: 5px; border-radius: 10px 0 0 0; }
.scanner .frame i:nth-child(2) { right: 0; top: 0; border-right-width: 5px; border-top-width: 5px; border-radius: 0 10px 0 0; }
.scanner .frame i:nth-child(3) { left: 0; bottom: 0; border-left-width: 5px; border-bottom-width: 5px; border-radius: 0 0 0 10px; }
.scanner .frame i:nth-child(4) { right: 0; bottom: 0; border-right-width: 5px; border-bottom-width: 5px; border-radius: 0 0 10px 0; }
.scanner .frame b { position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 3px; background: #3DDC84; box-shadow: 0 0 12px #3DDC84; animation: aiScan 2.4s ease-in-out infinite; }
.scanner .mascot { position: absolute; right: 8px; bottom: 0; width: 74px; height: 92px; }
.scanner .hint { position: absolute; left: 14px; bottom: 12px; right: 90px; font-size: 12.5px; font-weight: 700; color: #C2D0EA; }
.scanner .cam-btn { position: absolute; z-index: 2; }
.scanner.is-on .mascot, .scanner.is-on .cam-btn { display: none; }
.scanner.is-hit { box-shadow: 0 0 0 4px #3DDC84; }
.search-row { display: flex; gap: 8px; margin-top: 10px; }
.results { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.result { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid var(--st-line); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.result:hover { border-color: var(--ink); }
.result b { font-family: var(--f-display); }
.recent { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent button { flex: none; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--st-line-2); background: #fff; font-size: 12.5px; font-weight: 800; color: var(--ink); }

/* ── 5. Ficha de la persona ────────────────────────────────── */
.vis-head { display: flex; align-items: center; gap: 12px; }
.vis-av { flex: none; width: 50px; height: 50px; border-radius: 50%; background: #FFE3EE; border: 2px solid var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.vis-aj { font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: .03em; }
.vis-name { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.vis-pts { flex: none; text-align: right; }
.vis-pts b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 22px; }
.vis-pts span { font-size: 11px; font-weight: 700; color: var(--st-muted); }
.vis-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vis-flags .chip { font-size: 11px; padding: 4px 9px; }
.step-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #E6ECF2; }
.step-row:last-child { border-bottom: 0; }
.step-row .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--st-bg); color: var(--st-muted); font-family: var(--f-display); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.step-row.is-done .n { background: var(--green); color: #fff; }
.step-row.is-gold .n { background: var(--cc-yellow); color: var(--ink); }
.step-row .t { font-weight: 800; font-size: 14.5px; }
.step-row .s { font-size: 12.5px; color: var(--ink-4); }
.step-row .act { flex: none; display: flex; gap: 6px; align-items: center; }
.box-panel { margin: 4px 0 6px 40px; padding: 12px; border-radius: 16px; background: var(--cream); border: 2px dashed #D9A000; }
.box-panel .real { font-size: 12.5px; color: #6B4E00; }
.box-panel .real b { color: var(--ink); }
.big-num { font-family: var(--f-display); font-weight: 800; font-size: 24px; text-align: center; letter-spacing: .04em; }
.log-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #E6ECF2; font-size: 13px; }
.log-row:last-child { border-bottom: 0; }
.log-row time { flex: none; width: 42px; font-weight: 800; color: var(--st-muted); font-variant-numeric: tabular-nums; }
.log-row .who { color: var(--st-muted); font-size: 12px; }
.log-row.is-undone { opacity: .5; text-decoration: line-through; }
.temp-pass { font-family: var(--f-display); font-weight: 800; font-size: 30px; letter-spacing: .12em; text-align: center; padding: 12px; border-radius: 14px; background: var(--yellow-soft); border: 2px dashed #D9A000; user-select: all; }

/* ── 6. Fotos ──────────────────────────────────────────────── */
.ph-main { border-radius: 22px; overflow: hidden; border: 3px solid var(--ink); background: #0F1828; }
.ph-main img { display: block; width: 100%; max-height: 50vh; object-fit: contain; background: #0F1828; }
.ph-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; }
.ph-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 12px; }
.ph-actions .btn { min-height: 58px; font-size: 18px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.reasons button { padding: 9px 12px; border-radius: 999px; border: 2px solid var(--danger); background: #fff; color: var(--danger); font-weight: 800; font-size: 13px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ph-tile { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; border: 2px solid var(--ink); background: #ddd; padding: 0; cursor: pointer; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-tile .chip { position: absolute; left: 4px; bottom: 4px; font-size: 10px; padding: 2px 7px; }
.ph-tile.is-off img { opacity: .4; filter: grayscale(1); }
.ph-tile.is-current { outline: 4px solid var(--cc-yellow); outline-offset: -4px; }
.kbd { display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 5px; border: 1.5px solid currentColor; font-size: 11px; font-weight: 800; text-align: center; opacity: .7; }

/* ── 7. Programa ───────────────────────────────────────────── */
.sh-row { display: flex; gap: 10px; padding: 12px; border-radius: 18px; background: #fff; border: 2px solid var(--st-line); }
.sh-row + .sh-row { margin-top: 8px; }
.sh-row.is-live { border-color: var(--cc-red); box-shadow: 4px 4px 0 var(--cc-red); }
.sh-row.is-next { border-color: var(--link); }
.sh-row.is-done { opacity: .6; }
.sh-row .time { flex: none; width: 58px; font-family: var(--f-display); font-weight: 800; font-size: 18px; line-height: 1.1; }
.sh-row .time small { display: block; font-family: var(--f-text); font-size: 11px; color: var(--st-muted); font-weight: 700; white-space: nowrap; }
.sh-row img { flex: none; width: 44px; height: 50px; }
.sh-row .t { font-weight: 800; font-size: 15px; }
.sh-row .d { font-size: 12.5px; color: var(--ink-4); }
.sh-row .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sh-badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--st-bg); color: var(--st-muted); margin-bottom: 4px; }
.is-live .sh-badge { background: var(--cc-red); color: #fff; }
.is-next .sh-badge { background: var(--sky-3); color: var(--link); }
.mascot-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }
.mascot-pick button { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--st-line); background: #fff; padding: 4px; }
.mascot-pick button[aria-pressed="true"] { border-color: var(--ink); background: var(--yellow-soft); }
.mascot-pick img { width: 100%; height: 100%; object-fit: contain; }
.templates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.templates button { padding: 6px 10px; border-radius: 999px; border: 1.5px dashed var(--link); background: #fff; color: var(--link); font-size: 12px; font-weight: 800; text-align: left; }

/* ── 8. Panel ──────────────────────────────────────────────── */
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 12px 14px 4px; scrollbar-width: none; position: sticky; top: 52px; z-index: 20; background: var(--st-bg); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 8px 13px; border-radius: 999px; border: 2px solid var(--st-line-2); background: #fff; color: var(--ink); font-weight: 800; font-size: 13px; text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.panel-body { padding: 8px 14px 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 2px solid var(--st-line); border-radius: 18px; padding: 12px 14px; }
.kpi b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1.05; }
.kpi span { font-size: 12.5px; font-weight: 700; color: var(--st-muted); }
.kpi small { display: block; font-size: 11.5px; color: var(--st-muted); margin-top: 2px; }
.kpi.is-alert { border-color: var(--cc-red); background: var(--danger-soft); }
.kpi.is-good b { color: var(--green); }
.panel-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .panel-grid--2 { grid-template-columns: 1fr 1fr; } .panel-grid--3 { grid-template-columns: 1.4fr 1fr; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--st-muted); padding: 6px 8px; border-bottom: 2px solid var(--st-line); }
.tbl td { padding: 8px; border-bottom: 1px solid #E6ECF2; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.form-grid .field { margin: 0; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.edit-card { background: #fff; border: 2px solid var(--st-line); border-radius: 18px; padding: 12px; display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.edit-card + .edit-card { margin-top: 10px; }
.edit-card.is-off { opacity: .65; }
.edit-card .pic { position: relative; width: 96px; height: 110px; border-radius: 14px; overflow: hidden; border: 2px solid var(--ink); background: var(--sky-3); display: flex; align-items: center; justify-content: center; }
.edit-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.edit-card .pic img.mascot { object-fit: contain; padding: 8px; }
.edit-card .pic label { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 4px; border-radius: 8px; background: rgba(22, 32, 46, .85); color: #fff; font-size: 11px; font-weight: 800; text-align: center; cursor: pointer; }
.edit-card .pic input { display: none; }
@media (max-width: 420px) { .edit-card { grid-template-columns: 1fr; } .edit-card .pic { width: 100%; height: 150px; } }
.winner-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--st-bg); }
.winner-row + .winner-row { margin-top: 6px; }
.winner-row .pos { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--cc-yellow); border: 2px solid var(--ink); font-family: var(--f-display); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.winner-row.is-delivered { background: var(--green-soft); }
.winner-row.is-expired { opacity: .5; text-decoration: line-through; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; }
.countdown.is-late { color: var(--danger); }
.meta-mini { height: 12px; border-radius: 999px; background: var(--st-bg); overflow: hidden; }
.meta-mini > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cc-red), var(--cc-yellow)); border-radius: inherit; }
.export-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.export-list a { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; background: #fff; border: 2px solid var(--st-line); color: var(--ink); text-decoration: none; }
.export-list a:hover { border-color: var(--ink); }
.export-list a small { display: block; color: var(--st-muted); font-size: 12px; }

@media (min-width: 900px) {
  .page--wide .st-title { padding-left: 20px; padding-right: 20px; }
  .page--wide .panel-body { padding-left: 20px; padding-right: 20px; }
}
