/* cdp-ticketing — checkin.css : mobilní odbavení (tmavé UI pro šero ve foyer) */

.cdp-ci {
  --ci-bg: #141213;
  --ci-surface: #211e1f;
  --ci-surface-2: #2c2829;
  --ci-line: rgba(255,255,255,.12);
  --ci-text: #f4f1ea;
  --ci-muted: #a9a39a;
  --ci-ok: #2F8A1A;
  --ci-warn: #C27C0E;
  --ci-bad: #C83A1B;
  --ci-mute: #5f5a55;
  --ci-accent: #E8C46A;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ci-text);
  background: var(--ci-bg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.cdp-ci *, .cdp-ci *::before, .cdp-ci *::after { box-sizing: border-box; }
.cdp-ci button { font: inherit; cursor: pointer; touch-action: manipulation; }
.ci-boot, .cdp-ci__boot { padding: 2rem; text-align: center; color: var(--ci-muted); }

/* ── Samostatná stránka: celá obrazovka telefonu ── */
html:has(body.cdp-ci-app), body.cdp-ci-app { margin: 0; height: 100%; background: #141213; overscroll-behavior: none; }
body.cdp-ci-app .cdp-ci {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Admin stránka: „telefon“ uprostřed ── */
.cdp-ci-adminwrap .cdp-ci { max-width: 520px; height: 82vh; min-height: 560px; border-radius: 18px; overflow: hidden; margin-top: 1rem; }

/* ════════ PIN ════════ */
.cdp-ci.is-login { display: flex; align-items: center; justify-content: center; overflow: auto; }
.ci-login { width: 100%; max-width: 360px; padding: 1.5rem 1.25rem; text-align: center; }
.ci-login.is-busy { opacity: .6; pointer-events: none; }
.ci-login__brand { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ci-accent); }
.ci-login__h { margin: .35rem 0 .2rem; font-size: 1.5rem; font-weight: 800; color: var(--ci-text); }
.ci-login__sub { margin: 0 0 1.2rem; color: var(--ci-muted); }
.ci-pin { display: flex; justify-content: center; gap: .7rem; height: 18px; margin-bottom: .4rem; }
.ci-pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ci-muted); }
.ci-pin i.on { background: var(--ci-text); border-color: var(--ci-text); }
.ci-login__err { min-height: 1.4em; margin: .4rem 0 .8rem; color: #ff8a70; font-weight: 600; }
.ci-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.ci-key {
  height: 68px; border: 0; border-radius: 16px; background: var(--ci-surface-2); color: var(--ci-text);
  font-size: 1.7rem; font-weight: 600;
}
.ci-key:active { background: #3b3637; transform: scale(.97); }
.ci-key--del { background: transparent; color: var(--ci-muted); }
.ci-key--ok { background: var(--ci-accent); color: #231F20; font-size: 1.2rem; font-weight: 800; }

/* ════════ SKENER ════════ */
.cdp-ci.is-main { display: flex; flex-direction: column; overflow: hidden; }

/* horní lišta */
.ci-top { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; background: var(--ci-surface); border-bottom: 1px solid var(--ci-line); flex: 0 0 auto; }
.ci-perf { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding: .3rem .6rem .35rem; border-radius: 10px; background: var(--ci-surface-2); }
.ci-perf::after { content: "▾"; position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); color: var(--ci-muted); }
.ci-perf__lbl { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ci-muted); }
.ci-perf__val { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 1.1rem; }
.ci-top.is-all .ci-perf__val { color: var(--ci-accent); }
.ci-perf__sel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; }
.ci-stats { flex: 0 0 auto; text-align: right; line-height: 1.05; padding: 0 .2rem; }
.ci-stats b { display: block; font-size: 1.35rem; }
.ci-stats span { font-size: .78rem; color: var(--ci-muted); }
.ci-iconbtn { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 10px; background: var(--ci-surface-2); color: var(--ci-text); font-size: 1.2rem; }

/* kamera */
.ci-cam { position: relative; flex: 1 1 auto; min-height: 150px; background: #000; overflow: hidden; }
.ci-reader { position: absolute; inset: 0; border: 0 !important; }
.ci-reader video { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.ci-reader img[alt="Info icon"], .ci-reader #qr-shaded-region ~ div:empty { display: none !important; }
.ci-cam__msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1.5rem; text-align: center; color: var(--ci-muted); background: #000; line-height: 1.45; }
.ci-cam__msg[hidden] { display: none; }
.ci-camtools { position: absolute; right: .7rem; bottom: .7rem; display: flex; gap: .5rem; z-index: 5; }
.ci-camtool { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.15rem; font-weight: 800; }
.ci-camtool[hidden] { display: none; }
.ci-camtool.is-on { background: var(--ci-accent); color: #231F20; }
.ci-cam__hint { position: absolute; left: .7rem; bottom: .9rem; z-index: 4; padding: .3rem .6rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .78rem; pointer-events: none; }
.ci-cam__toast { position: absolute; left: 50%; top: .8rem; transform: translateX(-50%); z-index: 6; max-width: 90%; padding: .45rem .8rem; border-radius: 10px; background: rgba(0,0,0,.75); color: #fff; font-size: .85rem; text-align: center; }
.ci-cam__toast[hidden] { display: none; }
@media (max-width: 360px) { .ci-cam__hint { display: none; } }

/* poslední sken */
.ci-last { flex: 0 0 auto; padding: .75rem .9rem .8rem; background: var(--ci-surface); border-top: 4px solid var(--ci-line); min-height: 128px; }
.ci-last.is-ok   { border-top-color: var(--ci-ok); }
.ci-last.is-warn { border-top-color: var(--ci-warn); }
.ci-last.is-bad  { border-top-color: var(--ci-bad); }
.ci-last.is-mute { border-top-color: var(--ci-mute); }
.ci-last__empty { color: var(--ci-muted); text-align: center; padding: .9rem 0; line-height: 1.45; }
.ci-last__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.ci-last__badge { font-weight: 800; font-size: .95rem; padding: .22rem .6rem; border-radius: 999px; color: #fff; background: var(--ci-mute); }
.ci-last.is-ok .ci-last__badge   { background: var(--ci-ok); }
.ci-last.is-warn .ci-last__badge { background: var(--ci-warn); }
.ci-last.is-bad .ci-last__badge  { background: var(--ci-bad); }
.ci-last__time { font-size: .76rem; color: var(--ci-muted); white-space: nowrap; }
.ci-last__actions { margin-top: .55rem; display: flex; gap: .5rem; }
.ci-last__actions .ci-btn { flex: 1; }

.ci-e__play { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.ci-e__meta { color: var(--ci-muted); font-size: .85rem; margin-top: .1rem; }
.ci-e__seat { margin-top: .25rem; font-size: 1rem; }
.ci-e__seat.is-big { font-size: 1.2rem; }
.ci-e__type { display: inline-block; margin-top: .3rem; font-size: .7rem; font-weight: 800; letter-spacing: .08em; padding: .1rem .45rem; border-radius: 4px; background: var(--ci-accent); color: #231F20; }
.ci-e__note { margin-top: .3rem; font-size: .85rem; color: #ffd28a; }

/* spodní lišta */
.ci-bottom { flex: 0 0 auto; display: flex; gap: .5rem; padding: .5rem .6rem .6rem; background: var(--ci-surface); border-top: 1px solid var(--ci-line); }
.ci-bottom .ci-btn { flex: 1; }

/* tlačítka */
.ci-btn { min-height: 48px; padding: .6rem 1rem; border: 0; border-radius: 12px; font-weight: 700; font-size: 1rem; color: var(--ci-text); background: var(--ci-surface-2); }
.ci-btn:active { transform: scale(.98); }
.ci-btn:disabled { opacity: .5; }
.ci-btn--ghost { background: var(--ci-surface-2); }
.ci-btn--primary { background: var(--ci-accent); color: #231F20; }
.ci-btn--undo { background: transparent; color: var(--ci-text); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.ci-btn--force { background: var(--ci-warn); color: #fff; }
.ci-count { color: var(--ci-muted); font-weight: 600; }

/* záblesk výsledku */
.ci-flash {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1.5rem; text-align: center; color: #fff; animation: ci-in .12s ease-out;
}
.ci-flash[hidden] { display: none; }
.ci-flash.is-ok   { background: var(--ci-ok); }
.ci-flash.is-warn { background: var(--ci-warn); }
.ci-flash.is-bad  { background: var(--ci-bad); }
.ci-flash.is-mute { background: #3d3936; }
.ci-flash__icon { font-size: 5.5rem; line-height: 1; font-weight: 900; }
.ci-flash__label { font-size: 2rem; font-weight: 900; margin-top: .4rem; text-transform: uppercase; letter-spacing: .02em; }
.ci-flash__play { font-size: 1.15rem; font-weight: 600; margin-top: .9rem; opacity: .95; }
.ci-flash__play small { font-weight: 500; opacity: .85; }
.ci-flash__seat { font-size: 1.6rem; font-weight: 800; margin-top: .6rem; padding: .3rem .9rem; border-radius: 10px; background: rgba(0,0,0,.18); }
.ci-flash__tap { position: absolute; bottom: calc(1.2rem + env(safe-area-inset-bottom)); font-size: .8rem; opacity: .7; }
@keyframes ci-in { from { opacity: .3; transform: scale(1.02); } to { opacity: 1; transform: none; } }

/* listy (sheets) */
.ci-sheet { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.ci-sheet[hidden] { display: none; }
.ci-sheet__bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.ci-sheet__panel {
  position: relative; max-height: 85%; overflow: auto; padding: 1.1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--ci-surface); border-radius: 18px 18px 0 0; animation: ci-up .16s ease-out;
}
@keyframes ci-up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.ci-sheet__h { margin: 0 0 .5rem; font-size: 1.2rem; font-weight: 800; color: var(--ci-text); }
.ci-sheet__p { margin: .2rem 0 .8rem; color: var(--ci-muted); font-size: .92rem; }
.ci-sheet__ticket { padding: .7rem .8rem; border-radius: 12px; background: var(--ci-surface-2); margin-bottom: .6rem; }
.ci-sheet__row { display: flex; gap: .6rem; margin-top: .8rem; }
.ci-sheet__row .ci-btn { flex: 1; }
.ci-input { width: 100%; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--ci-line); background: var(--ci-bg); color: var(--ci-text); font-size: 16px; }

.ci-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.ci-hist__i { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 12px; background: var(--ci-surface-2); border-left: 4px solid var(--ci-mute); }
.ci-hist__i.is-ok   { border-left-color: var(--ci-ok); }
.ci-hist__i.is-warn { border-left-color: var(--ci-warn); }
.ci-hist__i.is-bad  { border-left-color: var(--ci-bad); }
.ci-hist__ico { width: 1.3rem; text-align: center; font-weight: 900; }
.ci-hist__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .88rem; }
.ci-hist__txt span { color: var(--ci-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-hist__act .ci-btn { min-height: 38px; padding: .35rem .7rem; font-size: .85rem; }

/* nízké displeje (telefon na šířku / malé telefony) */
@media (max-height: 620px) {
  .ci-last { min-height: 0; padding: .5rem .8rem; }
  .ci-e__meta { display: none; }
  .ci-btn { min-height: 42px; }
  .ci-key { height: 54px; }
}
