/* Estacionamiento BLACK Mall — sistema visual BLACK (fondo oscuro, acento oro, Inter + JetBrains Mono)
   Layout: barra superior con pestañas por rol; tótem a pantalla completa; verificador pensado para celular. */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c232c;
  --line: #2a313b;
  --line-2: #3a434f;
  --fg: #e6edf3;
  --muted: #8b949e;
  --gold: #f0a500;
  --gold-ink: #1a1200;
  --ok: #3fb950;
  --ok-bg: #12261a;
  --bad: #f85149;
  --bad-bg: #2d1416;
  --warn: #d29922;
  --warn-bg: #2b2210;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100%; }
h1, h2 { margin: 0; font-weight: 700; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0; }
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.mt { margin-top: 18px; }
.t-bad { color: var(--bad); }
kbd {
  font-family: var(--mono);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--fg);
  background: var(--panel-2);
}

/* ---------- marca ---------- */
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--fg); }
.brand-mark { font-weight: 800; letter-spacing: 0.22em; font-size: 1.05rem; }
.brand-sub { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-weight: 600; }
.brand.big .brand-mark { font-size: 1.5rem; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel-2); color: var(--fg);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 0.82rem; }
.btn.big { min-height: 56px; font-size: 1.1rem; }
.btn.block { width: 100%; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn.confirm, .btn.danger.confirm { background: var(--bad); border-color: var(--bad); color: #fff; }
.linkish { background: none; border: 0; padding: 0; color: var(--gold); font-family: var(--mono); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- barra superior ---------- */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--panel); }
.top-in { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-block: 10px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs a {
  padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 0.9rem; white-space: nowrap;
}
.tabs a:hover { color: var(--fg); background: var(--panel-2); }
.tabs a.on { color: var(--gold-ink); background: var(--gold); }
.who { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; margin-left: auto; }
.who-n { font-weight: 600; }
.who-r { color: var(--muted); }
.demo-bar { border-bottom: 1px solid var(--line); background: var(--bg); font-size: 0.8rem; color: var(--muted); }
.demo-in { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding-block: 6px; }
.tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold); border-radius: 4px; padding: 1px 6px; }
.demo-clock b { font-family: var(--mono); color: var(--fg); font-variant-numeric: tabular-nums; }
.demo-clock em { font-style: normal; color: var(--gold); }
.demo-btns { display: flex; gap: 4px; margin-left: auto; }

@media (max-width: 720px) {
  .top-in { gap: 8px 12px; }
  .tabs { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  .who-r { display: none; }
  .demo-txt { display: none; }
  .demo-btns { margin-left: 0; }
}
@media (max-width: 440px) { .top .brand-sub { display: none; } }

/* ---------- estructura ---------- */
.main { padding-block: 24px 48px; }
.page-head { display: grid; gap: 4px; margin-bottom: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 0; }
.kv { display: grid; gap: 10px; margin: 10px 0 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.kv.grid2 > div { flex-direction: column; gap: 2px; padding: 10px 0; }
.kv.grid2 dd { text-align: left; }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.muted { color: var(--muted); background: var(--panel-2); }
.err { color: var(--bad); font-size: 0.88rem; margin-top: 8px; }

/* ---------- formularios ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field input, .field select, .field textarea, .code-input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .code-input:focus { border-color: var(--gold); outline: none; }
.pre-in { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); }
.pre-in:focus-within { border-color: var(--gold); }
.pre-in input { border: 0; background: transparent; min-width: 0; }
.pre-in i { font-style: normal; color: var(--muted); padding: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.check.tall { margin-top: 22px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }

/* ---------- escaneo ---------- */
.scan { display: grid; gap: 8px; }
.scan-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-input {
  flex: 1 1 220px; min-height: 52px;
  font-family: var(--mono); font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.code-input::placeholder { color: var(--line-2); }
.scan-row .btn { min-height: 52px; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: 100%; max-width: 440px; display: grid; gap: 22px; }
.demo-users { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.du-list { display: grid; gap: 8px; }
.du {
  display: grid; gap: 2px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
}
.du:hover { border-color: var(--gold); }
.du-top { display: flex; justify-content: space-between; gap: 8px; }
.du-top b { font-family: var(--mono); }
.du code { font-family: var(--mono); font-size: 0.78rem; color: var(--gold); }
.du-rol { font-weight: 600; font-size: 0.9rem; }
.du-desc { color: var(--muted); font-size: 0.82rem; }

/* ---------- tótem de ingreso ---------- */
.kiosk { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.kiosk-top { display: flex; justify-content: space-between; align-items: center; padding-block: 18px; }
.kiosk-clock { font-family: var(--mono); font-size: 1.1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kiosk-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: center; }
.kiosk-main { display: grid; justify-items: center; gap: 36px; text-align: center; padding-block: 24px; }
.kiosk-title { font-size: clamp(1.6rem, 4.2vw, 3rem); max-width: 18ch; }
.kiosk-hint { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 1.05rem; }
.kiosk-out { align-self: stretch; display: grid; align-content: center; }
.ko-empty { border: 1px dashed var(--line-2); border-radius: 14px; padding: 24px; display: grid; gap: 8px; }
.ko-ticket { display: grid; gap: 12px; justify-items: center; animation: slideIn .45s ease-out both; }
.ko-retire { font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.9rem; }
.kiosk-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 16px; color: var(--muted); border-top: 1px solid var(--line); }
.kiosk-foot b { color: var(--fg); }
.kf-actions { display: flex; gap: 6px; }
@media (max-width: 860px) {
  .kiosk-body { grid-template-columns: minmax(0, 1fr); }
  .kiosk-out { justify-items: center; }
}
@keyframes slideIn { from { transform: translateY(-14px); opacity: 0.2; } to { transform: none; opacity: 1; } }

/* botón grande */
.big-btn {
  --size: clamp(200px, 40vmin, 360px);
  position: relative; width: var(--size); max-width: 100%; aspect-ratio: 1;
  border-radius: 50%; border: 0; cursor: pointer;
  background: var(--btn, var(--gold)); color: #0d1117;
  display: grid; place-content: center; gap: 6px;
  transition: transform .12s ease, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.big-btn::before, .big-btn::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--btn, var(--gold)); opacity: 0; pointer-events: none;
}
.bb-label { font-family: var(--mono); font-weight: 800; font-size: calc(var(--size) * 0.15); letter-spacing: 0.08em; line-height: 1; }
.bb-sub { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.big-btn.firing { transform: scale(.92); }
.big-btn:disabled { filter: saturate(.3) brightness(.65); cursor: wait; }
.big-btn:disabled::before, .big-btn:disabled::after { animation: none; opacity: 0; }
.big-btn.mini { --size: 128px; cursor: default; }
.big-btn.mini .bb-label { font-size: 1.1rem; }

@media (prefers-reduced-motion: no-preference) {
  .anim-anillos::before { animation: ring 2.4s ease-out infinite; }
  .anim-anillos::after { animation: ring 2.4s ease-out 1.2s infinite; }
  .anim-pulso { animation: pulse 1.6s ease-in-out infinite; }
  .anim-pulso.firing { animation: none; }
  .anim-respiracion::before { border-width: 12px; animation: breathe 3.2s ease-in-out infinite; }
}
@keyframes ring { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes breathe { 0%, 100% { transform: scale(1.03); opacity: .12; } 50% { transform: scale(1.14); opacity: .45; } }

/* ---------- ticket (papel térmico) ---------- */
.ticket {
  width: 280px; max-width: 100%;
  background: #fff; color: #000;
  font-family: var(--mono);
  padding: 18px 16px 16px;
  border-radius: 4px;
  display: grid; gap: 8px; text-align: center;
}
.tk-brand { font-family: var(--sans); font-weight: 800; letter-spacing: 0.24em; font-size: 1.1rem; }
.tk-sub { font-size: 0.68rem; letter-spacing: 0.3em; margin-top: -6px; }
.tk-rule { border-top: 1.5px dashed #000; margin: 4px 0; }
.tk-qr svg { width: 168px; height: 168px; display: block; margin-inline: auto; }
.tk-code { font-size: 1.3rem; font-weight: 800; letter-spacing: 0.1em; }
.tk-rows { display: grid; gap: 3px; font-size: 0.75rem; text-align: left; }
.tk-rows div { display: flex; justify-content: space-between; gap: 8px; }
.tk-rows b { font-weight: 700; }
.tk-msg { font-family: var(--sans); font-size: 0.72rem; line-height: 1.35; }
.qr-missing { width: 168px; height: 168px; margin-inline: auto; border: 2px dashed #000; display: grid; place-items: center; }

/* ---------- cobro ---------- */
.cobro-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .cobro-grid { grid-template-columns: minmax(0, 1fr); } }
.res-wrap { margin-top: 20px; }
.empty { border: 1px dashed var(--line-2); border-radius: 12px; padding: 28px 20px; display: grid; gap: 6px; text-align: center; }
.empty-t { font-weight: 700; font-size: 1.05rem; }
.res { display: grid; gap: 4px; }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.res-code { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 18px 0 10px; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); }
.total-n { font-family: var(--mono); font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.medios { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 600; font-size: 0.88rem; }
.chip input:checked + span { border-color: var(--gold); color: var(--gold); background: rgba(240, 165, 0, .1); }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.state { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid; display: grid; gap: 4px; }
.state-t { font-weight: 700; font-size: 1.1rem; }
.state.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.state.ok p:not(.state-t) { color: var(--fg); }
.state.muted { border-color: var(--line-2); background: var(--panel-2); }
.mini-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.mini {
  width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  background: none; border: 0; border-bottom: 1px dashed var(--line); padding: 8px 0; cursor: pointer; text-align: left;
  font-variant-numeric: tabular-nums; font-size: 0.88rem;
}
.mini:hover .mono { color: var(--gold); }

/* ---------- verificador ---------- */
.verif { max-width: 520px; margin-inline: auto; display: grid; gap: 18px; }
.vres {
  border-radius: 18px; border: 2px solid var(--line-2); background: var(--panel);
  padding: 28px 20px; display: grid; gap: 10px; text-align: center; min-height: 260px; align-content: center;
}
.vres-t { font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.05; }
.vres-s { font-size: 1rem; }
.vres-code { font-family: var(--mono); font-size: 1.3rem; letter-spacing: 0.1em; font-weight: 700; }
.vres-amount { font-family: var(--mono); font-size: 2.4rem; font-weight: 800; }
.vres.idle .vres-t { color: var(--muted); font-size: 1.4rem; }
.vres.idle .vres-s { color: var(--muted); }
.vres.ok { border-color: var(--ok); background: var(--ok-bg); }
.vres.ok .vres-t { color: var(--ok); }
.vres.bad { border-color: var(--bad); background: var(--bad-bg); }
.vres.bad .vres-t, .vres.bad .vres-amount { color: var(--bad); }
.vres.warn { border-color: var(--warn); background: var(--warn-bg); }
.vres.warn .vres-t { color: var(--warn); font-size: 1.6rem; }
.vres.muted .vres-t { color: var(--muted); }
.vres:not(.idle) { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.97); } to { transform: none; } }
.btn.on-ok { background: var(--ok); border-color: var(--ok); color: #04210d; margin-top: 6px; min-height: 52px; font-size: 1.05rem; }
.verif .scan-row .btn { flex: 1 1 120px; }

/* ---------- movimientos ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.stat b { font-family: var(--mono); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.chip-btn.on { border-color: var(--gold); color: var(--gold); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tabla th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td, .tabla tr.clic:focus td { background: var(--panel-2); }

/* ---------- configuración ---------- */
.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cfg-grid .panel { display: grid; gap: 14px; align-content: start; }
.cfg-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .cfg-grid { grid-template-columns: minmax(0, 1fr); } }
.promo-grid { display: grid; gap: 8px; }
.promo-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.stepper button { width: 38px; height: 38px; background: var(--panel-2); border: 0; cursor: pointer; font-size: 1.1rem; }
.stepper button:hover { color: var(--gold); }
.stepper input { width: 52px; height: 38px; text-align: center; border: 0; background: var(--bg); font-family: var(--mono); font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ing-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
@media (max-width: 760px) { .ing-grid { grid-template-columns: minmax(0, 1fr); } }
.ing-fields { display: grid; gap: 14px; min-width: 0; }
.ing-prev { display: grid; gap: 10px; align-content: start; }
.prev-stage { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 28px 16px; overflow: hidden; }
.prev-kiosk { display: grid; justify-items: center; gap: 16px; text-align: center; }
.prev-title { font-weight: 700; font-size: 1.05rem; }
.prev-sub { color: var(--muted); font-size: 0.82rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { display: grid; justify-items: center; gap: 4px; cursor: pointer; position: relative; }
.sw input { position: absolute; opacity: 0; }
.sw span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); }
.sw input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--fg); }
.sw input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 4px; }
.sw em { font-style: normal; font-size: 0.72rem; color: var(--muted); }
.user-form { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.uf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }

/* ---------- cámara ---------- */
.cam-ov { position: fixed; inset: 0; z-index: 50; background: rgba(1, 4, 9, .85); display: grid; place-items: center; padding: 16px; }
.cam-box { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; }
.cam-head { display: flex; justify-content: space-between; align-items: center; }
#cam-reader { width: 100%; min-height: 240px; border-radius: 10px; overflow: hidden; background: #000; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); font-weight: 600; padding: 12px 18px; border-radius: 10px;
  max-width: calc(100% - 32px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

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

/* ---------- impresión en comandera 80 mm ---------- */
#print-area { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  html, body { background: #fff !important; height: auto; }
  body::before { display: none; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area .ticket { width: 72mm; margin: 0 auto; padding: 3mm 2mm 8mm; border-radius: 0; }
  #print-area .tk-qr svg { width: 44mm; height: 44mm; }
}
