/**
 * EventCore — PWA Design System
 *
 * Mobile-First, hohe Kontraste, große Touch-Targets.
 * Optimiert für dunkle Umgebungen (Events, Scan-Betrieb).
 * Kein externes Framework — vollständig vanilla.
 *
 * Inhaltsübersicht:
 *   1. Custom Properties / Design Tokens
 *   2. Reset & Base
 *   3. Layout (App-Shell, Topbar, Bottom-Nav, Main)
 *   4. Status-Bar & Update-Banner
 *   5. Splash / Loading
 *   6. Karten & Listen
 *   7. Formulare & Inputs
 *   8. Buttons
 *   9. Status-Badges
 *  10. Scanner-View
 *  11. Alerts & Feedback
 *  12. Utility-Klassen
 *  13. Dark-Mode (System)
 *  14. Responsive Breakpoints
 */

/* ══════════════════════════════════════════════
   1. Design Tokens
   ══════════════════════════════════════════════ */

:root {
  /* Light-Mode ist der Standard — Nachtmodus via html[data-theme="dark"] */
  color-scheme: light;

  /* Farben — Hauptpalette (hell) */
  --c-bg:          #f9fafb;   /* Hintergrund */
  --c-surface:     #ffffff;   /* Karten, Panels */
  --c-surface-2:   #f3f4f6;   /* Nested surfaces */
  --c-border:      #e5e7eb;   /* Rahmen */
  --c-accent:      #059669;   /* Emerald — Primärakzent */
  --c-accent-dark: #047857;
  --c-accent-text: #ecfdf5;
  --c-text:        #111827;   /* Primärtext */
  --c-text-muted:  #6b7280;   /* Sekundärtext */
  --c-text-dim:    #9ca3af;   /* Deaktiviert/Placeholder */

  /* Semantische Farben (hell — opaque für bessere Lesbarkeit) */
  --c-success:     #059669;
  --c-success-bg:  #dcfce7;
  --c-warning:     #d97706;
  --c-warning-bg:  #fef3c7;
  --c-danger:      #dc2626;
  --c-danger-bg:   #fee2e2;
  --c-info:        #2563eb;
  --c-info-bg:     #eff6ff;

  /* Scanner-Spezifisch */
  --c-scan-ok:     #16a34a;   /* Grün — gültiger Scan */
  --c-scan-fail:   #dc2626;   /* Rot — ungültiger Scan */
  --c-scan-warn:   #d97706;   /* Gelb — Warnung */

  /* Typografie */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --text-xs:   .75rem;
  --text-sm:   .875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;

  /* Spacing */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;
  --sp-4: 1rem;    --sp-5: 1.25rem; --sp-6: 1.5rem;
  --sp-8: 2rem;    --sp-10: 2.5rem; --sp-12: 3rem;

  /* Radien */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full: 9999px;

  /* Touch-Targets (WCAG 2.5.5 — minimum 44px, wir nutzen 48px) */
  --touch-min: 48px;

  /* Topbar & Bottom-Nav */
  --topbar-h: 56px;
  --bottom-nav-h: 64px;

  /* Schatten (hell — dezenter) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10);

  /* Übergänge */
  --transition: 150ms ease;
  --transition-slow: 300ms ease;

  /* Safe Areas (iOS Notch / Dynamic Island) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ── Nachtmodus — via JS Toggle: html[data-theme="dark"] ── */
html[data-theme="dark"] {
  color-scheme: dark;

  --c-bg:          #0f172a;
  --c-surface:     #1e293b;
  --c-surface-2:   #293548;
  --c-border:      #334155;
  --c-text:        #f1f5f9;
  --c-text-muted:  #94a3b8;
  --c-text-dim:    #64748b;

  --c-success:     #10b981;
  --c-success-bg:  rgba(16,185,129,.14);
  --c-warning:     #f59e0b;
  --c-warning-bg:  rgba(245,158,11,.14);
  --c-danger:      #ef4444;
  --c-danger-bg:   rgba(239,68,68,.14);
  --c-info:        #3b82f6;
  --c-info-bg:     rgba(59,130,246,.14);

  --c-scan-ok:     #22c55e;
  --c-scan-fail:   #ef4444;
  --c-scan-warn:   #f59e0b;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.5);
}

/* ══════════════════════════════════════════════
   2. Reset & Base
   ══════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;   /* iOS PWA: erzwingt volles physisches Viewport inkl. Safe-Area */
  background: var(--c-surface);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  height: 100dvh;   /* iOS PWA: erzwingt volles physisches Viewport inkl. Safe-Area */
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: 1.5;
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  overflow: hidden;
  overscroll-behavior-y: none;
  /* NICHT position:fixed — auf iOS Safari standalone ergibt inset:0 auf
     position:fixed nur das Layout bis zur Safe-Area-Grenze, nicht zum
     physischen Screen-Rand. Das verursacht den Gap unter der Bottom-Nav.
     height:100% auf html+body ist zuverlässiger und referenziert das
     Layout Viewport korrekt. */
}

/* Pinch-to-Zoom verhindern (PWA-Pflicht) */
html { touch-action: pan-x pan-y; overscroll-behavior: none; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* Focus-Stile (Tastatur-Navigation) */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ══════════════════════════════════════════════
   3. App-Layout
   ══════════════════════════════════════════════ */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;   /* iOS PWA: erzwingt volles physisches Viewport inkl. Safe-Area
                       → Nav-Unterkante landet am physischen Screen-Rand */
  overflow: hidden;
  touch-action: pan-y;
  /* height:100% auf html+body reicht — kein position:absolute/inset:0 nötig.
     position:absolute inset:0 in einem position:fixed body kopplte das Layout
     ans Visual Viewport und verursachte den „eingezoomt"-Effekt auf iOS PWA. */
}

/* Topbar */
.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: 0 var(--sp-4);
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  z-index: 100;
  /* Fix bleibt fix — keine Touch-Scroll-Interaktion auf der Topbar */
  touch-action: none;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -.03em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Main Content */
.main {
  flex: 1 1 auto;
  min-height: 0;            /* kritisch für flex-scroll */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
  /* Bottom-Nav ist position:fixed → überlappt .main. padding-bottom schiebt
     Scroll-Content über die Nav hinaus (analog demo.qbau.app .app-content). */
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + var(--sp-4));
  overscroll-behavior: contain;
}

/* Bottom Navigation — 1:1 Ansatz aus demo.qbau.app/Template/default/style.css */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  /* KEINE feste Höhe — content-driven. padding-bottom schiebt die Nav
     in die Safe-Area-Zone. Funktioniert zusammen mit
     apple-mobile-web-app-status-bar-style: default (shell.php). */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  z-index: 100;
  touch-action: none;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: var(--touch-min);
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: color var(--transition);
  border: none;
  background: none;
  padding: var(--sp-2) 0;
}

.bottom-nav__item:active,
.bottom-nav__item--active {
  color: var(--c-accent);
}

.bottom-nav__icon {
  font-size: 1.375rem;
  line-height: 1;
}

/* ══════════════════════════════════════════════
   4. Status-Bar & Update-Banner
   ══════════════════════════════════════════════ */

.status-bar {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-top)); /* Unterhalb der Topbar (min-height berücksichtigt safe-top) */
  left: 0; right: 0;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  z-index: 200;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.status-bar--hidden { opacity: 0; pointer-events: none; transform: translateY(-100%); }
.status-bar--online  { background: var(--c-success-bg); color: var(--c-success); border-bottom: 1px solid var(--c-success); }
.status-bar--offline { background: var(--c-danger-bg);  color: var(--c-danger);  border-bottom: 1px solid var(--c-danger); }
.status-bar--syncing { background: var(--c-info-bg);    color: var(--c-info);    border-bottom: 1px solid var(--c-info); }

.update-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--sp-3));
  left: var(--sp-4); right: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-info-bg);
  border: 1px solid var(--c-info);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  z-index: 150;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.update-banner--hidden { opacity: 0; pointer-events: none; transform: translateY(1rem); }
.update-banner__btn {
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-info);
  color: #fff;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  min-height: var(--touch-min);
}

/* ══════════════════════════════════════════════
   5. Splash / Loading
   ══════════════════════════════════════════════ */

.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  min-height: 60dvh;
}

.splash__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.splash__text {
  color: var(--c-text-muted);
  font-size: var(--text-sm);
}

/* ══════════════════════════════════════════════
   6. Karten & Listen
   ══════════════════════════════════════════════ */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
}

.card--interactive {
  transition: background var(--transition);
  cursor: pointer;
}

.card--interactive:active { background: var(--c-surface-2); }

.card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.card__value {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.card__desc {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* Grid für Dashboard-Karten */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* Listenelement */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  min-height: var(--touch-min);
  transition: background var(--transition);
}

.list-item:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.list-item:last-child  { border-bottom: none; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.list-item:only-child  { border-radius: var(--r-lg); }
.list-item:active      { background: var(--c-surface-2); }

.list-item__icon { font-size: 1.5rem; flex-shrink: 0; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__sub   { font-size: var(--text-sm); color: var(--c-text-muted); }
.list-item__aside { flex-shrink: 0; text-align: right; }

/* ══════════════════════════════════════════════
   7. Formulare & Inputs
   ══════════════════════════════════════════════ */

.form-group {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.form-input {
  display: block;
  width: 100%;
  padding: var(--sp-4);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: var(--text-base);
  min-height: var(--touch-min);
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--c-text-dim); }
.form-input:focus         { outline: none; border-color: var(--c-accent); }
.form-input--error        { border-color: var(--c-danger); }

.form-error {
  font-size: var(--text-xs);
  color: var(--c-danger);
  margin-top: var(--sp-1);
}

/* ══════════════════════════════════════════════
   8. Buttons
   ══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  min-height: var(--touch-min);
  border-radius: var(--r-md);
  font-size: var(--text-base);
  font-weight: 600;
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn:active          { opacity: .8; }
.btn:disabled        { opacity: .4; cursor: not-allowed; }
.btn--block          { display: flex; width: 100%; }
.btn--primary        { background: var(--c-accent);   color: #fff; }
.btn--secondary      { background: var(--c-surface-2); color: var(--c-text); border: 1px solid var(--c-border); }
.btn--danger         { background: var(--c-danger);   color: #fff; }
.btn--ghost          { background: transparent; color: var(--c-accent); }
.btn--lg             { min-height: 60px; font-size: var(--text-lg); padding: var(--sp-4) var(--sp-8); }
.btn--icon           { padding: var(--sp-3); border-radius: var(--r-full); min-width: var(--touch-min); }

/* Scan-Button (sehr groß, für Einlass-Betrieb) */
.btn--scan {
  min-height: 80px;
  font-size: var(--text-xl);
  border-radius: var(--r-xl);
  background: var(--c-accent);
  color: #fff;
  letter-spacing: -.01em;
}

/* ══════════════════════════════════════════════
   9. Status-Badges
   ══════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: .2em .65em;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge--success { background: var(--c-success-bg); color: var(--c-success); }
.badge--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--danger  { background: var(--c-danger-bg);  color: var(--c-danger); }
.badge--info    { background: var(--c-info-bg);    color: var(--c-info); }
.badge--muted   { background: rgba(148,163,184,.12); color: var(--c-text-muted); }

/* ══════════════════════════════════════════════
   10. Scanner-View
   ══════════════════════════════════════════════ */

.scanner-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 360px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #000;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scan-Rahmen (Eck-Markierungen) */
.scan-frame {
  width: 60%;
  aspect-ratio: 1;
  position: relative;
}

.scan-frame::before,
.scan-frame::after,
.scan-frame__bl::before,
.scan-frame__bl::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #fff;
  border-style: solid;
}

.scan-frame::before      { top: 0;    left: 0;  border-width: 3px 0 0 3px; }
.scan-frame::after       { top: 0;    right: 0; border-width: 3px 3px 0 0; }
.scan-frame__bl::before  { bottom: 0; left: 0;  border-width: 0 0 3px 3px; }
.scan-frame__bl::after   { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

/* Scan-Ergebnis-Banner */
.scan-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  border-radius: var(--r-xl);
  text-align: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: var(--text-xl);
  animation: result-pop 200ms cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes result-pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.scan-result--ok   { background: var(--c-success-bg); color: var(--c-scan-ok); border: 2px solid var(--c-scan-ok); }
.scan-result--fail { background: var(--c-danger-bg);  color: var(--c-scan-fail); border: 2px solid var(--c-scan-fail); }
.scan-result--warn { background: var(--c-warning-bg); color: var(--c-scan-warn); border: 2px solid var(--c-scan-warn); }

.scan-result__icon { font-size: 3rem; }

/* ══════════════════════════════════════════════
   11. Alerts & Feedback
   ══════════════════════════════════════════════ */

.alert {
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.alert--success { background: var(--c-success-bg); color: var(--c-success); }
.alert--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.alert--danger  { background: var(--c-danger-bg);  color: var(--c-danger); }
.alert--info    { background: var(--c-info-bg);    color: var(--c-info); }

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-12) var(--sp-4);
  text-align: center;
  color: var(--c-text-muted);
}

.empty-state__icon { font-size: 3rem; opacity: .5; }
.empty-state__title { font-weight: 700; font-size: var(--text-lg); color: var(--c-text); }
.empty-state__desc  { font-size: var(--text-sm); max-width: 280px; }

/* ══════════════════════════════════════════════
   12. Utility-Klassen
   ══════════════════════════════════════════════ */

.u-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.u-text-accent  { color: var(--c-accent); }
.u-text-success { color: var(--c-success); }
.u-text-danger  { color: var(--c-danger); }
.u-text-muted   { color: var(--c-text-muted); }
.u-text-center  { text-align: center; }
.u-font-bold    { font-weight: 700; }
.u-font-mono    { font-family: var(--font-mono); }
.u-mt-4  { margin-top: var(--sp-4); }
.u-mb-4  { margin-bottom: var(--sp-4); }
.u-mt-6  { margin-top: var(--sp-6); }
.u-mb-6  { margin-bottom: var(--sp-6); }
.u-gap-3 { gap: var(--sp-3); }
.u-stack { display: flex; flex-direction: column; gap: var(--sp-3); }

.u-money {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ══════════════════════════════════════════════
   13. System Dark-Mode Passthrough
   → App ist standardmäßig hell. Wer kein JS hat
     und dunkles System-Theme nutzt, bekommt trotzdem
     ein funktionsfähiges Layout. Der JS-Toggle setzt
     html[data-theme="dark"] und überschreibt dies.
   ══════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-bg:          #0f172a;
    --c-surface:     #1e293b;
    --c-surface-2:   #293548;
    --c-border:      #334155;
    --c-text:        #f1f5f9;
    --c-text-muted:  #94a3b8;
    --c-text-dim:    #64748b;
    --c-success:     #10b981;
    --c-success-bg:  rgba(16,185,129,.14);
    --c-warning:     #f59e0b;
    --c-warning-bg:  rgba(245,158,11,.14);
    --c-danger:      #ef4444;
    --c-danger-bg:   rgba(239,68,68,.14);
    --c-info:        #3b82f6;
    --c-info-bg:     rgba(59,130,246,.14);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.5);
  }
}

/* ══════════════════════════════════════════════
   14. Responsive Breakpoints
   ══════════════════════════════════════════════ */

@media (min-width: 480px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  /* Tablet: Bottom-Nav optional durch Sidebar ersetzen */
  .main { padding: var(--sp-6); }
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
  .scanner-viewport { max-width: 440px; }
}

/* ══════════════════════════════════════════════
   15. Staff-App (ab v0.44.0)
   ══════════════════════════════════════════════ */

/* ── Bottom-Nav: Icon-only Variante ── */
.bottom-nav--staff .bottom-nav__item {
  gap: 0;
  padding: var(--sp-2) 0;
}
.bottom-nav--staff .bottom-nav__icon {
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav--staff .bottom-nav__icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}
.bottom-nav--staff .bottom-nav__item--active {
  position: relative;
}
.bottom-nav--staff .bottom-nav__item--active::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--c-accent);
}

/* ── Seiten-Header in Modulen ── */
.page-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin: 0 0 var(--sp-1);
  letter-spacing: -.01em;
}
.page-sub {
  color: var(--c-text-muted);
  margin: 0 0 var(--sp-5);
  font-size: var(--text-sm);
}
.section-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: var(--sp-6) 0 var(--sp-3);
}

/* ── Modul-Picker ── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.module-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--sp-2);
  min-height: 160px;
  padding: var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  color: var(--c-text);
  text-align: left;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  cursor: pointer;
}
.module-tile:active {
  transform: scale(.98);
  background: var(--c-surface-2);
  border-color: var(--c-accent);
}
.module-tile__icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  color: var(--c-accent);
}
.module-tile__icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}
.module-tile__label {
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: 1.2;
}
.module-tile__desc {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  line-height: 1.3;
}

@media (min-width: 480px) {
  .module-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .module-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Modul-Kopf (Titel + Meta in Modul-Views) ── */
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}
.module-header h1 {
  font-size: var(--text-xl);
  font-weight: 800;
  margin: 0;
}
.module-header__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}
.module-header__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-accent);
}
.module-header__icon svg { width: 24px; height: 24px; stroke: currentColor; }
.module-header__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.module-body { display: block; }

/* ── Schritt-Indikator (Check-In, ggf. weitere Flows) ── */
.steps {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  font-weight: 600;
}
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-surface-2);
  color: var(--c-text);
  font-weight: 800;
}
.step--active { border-color: var(--c-accent); color: var(--c-text); }
.step--active .step__num { background: var(--c-accent); color: #fff; }
.step--done { border-color: var(--c-success); color: var(--c-success); }
.step--done .step__num { background: var(--c-success); color: #fff; }

/* ── Kasse: Wallet-Info-Karte ── */
.cash-wallet-card {
  padding: var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-align: center;
}
.cash-wallet-card__name {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  font-weight: 600;
}
.cash-wallet-card__balance {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--c-success);
  margin: var(--sp-2) 0;
  font-variant-numeric: tabular-nums;
}
.cash-wallet-card__meta {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}

/* ── Überblick: Kachel-Grid ── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.overview-card {
  padding: var(--sp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.overview-card__label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-1);
}
.overview-card__value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 480px) { .overview-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── Panic-Button (Notruf Security) ── */
.staff-panic-btn {
  position: fixed;
  right: var(--sp-4);
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + var(--sp-3));
  z-index: 350;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-danger);
  color: #fff;
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: .04em;
  border: 2px solid rgba(255,255,255,.18);
  border-radius: var(--r-full);
  box-shadow: 0 6px 16px rgba(239,68,68,.45);
  cursor: pointer;
}
.staff-panic-btn svg { display: inline-block; }
.staff-panic-btn:active { transform: scale(.97); }

#staff-panic-dialog {
  position: fixed; inset: 0; z-index: 600;
}
.staff-panic-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(3px);
}
.staff-panic-sheet {
  position: absolute;
  left: var(--sp-4); right: var(--sp-4); bottom: calc(var(--sp-4) + env(safe-area-inset-bottom));
  background: var(--c-surface);
  border: 1px solid var(--c-danger);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  max-width: 560px;
  margin: 0 auto;
}
.staff-panic-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.staff-panic-sheet__head h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--c-danger);
}
.staff-panic-sheet p {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin: var(--sp-2) 0 var(--sp-4);
}
.staff-panic-sheet__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.btn--confirming {
  animation: pulse 1s ease-in-out infinite;
}

/* ── Night-Mode Toggle Button ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--c-border); color: var(--c-text); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ══════════════════════════════════════════════
   16. Scanner-Screen (ab v0.47.1)
   ══════════════════════════════════════════════ */

/* Topbar: Modul-Name-Variante */
.topbar__brand--module {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -.01em;
}

/* ── main--scan: Full-Bleed-Layout für Scanner + POS ───────────────────────
   Wird von staff-entry.js (Einlass) und staff-service.js (POS) gesetzt.
   Entfernt Padding, macht .main zu einem flex-column ohne Scroll. */
.main--scan {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* scan-screen füllt den gesamten main--scan-Bereich */
.main--scan > .scan-screen {
  flex: 1 1 auto;
  min-height: 0;
}

/* ── scan-screen: Flex-Column — Viewport wächst, Footer bleibt unten ────── */
.scan-screen {
  display: flex;
  flex-direction: column;
  height: 100%;          /* füllt main--scan vollständig */
  overflow: hidden;
}

/* ── Kamera-Viewport: wächst auf den gesamten verfügbaren Raum ─────────── */
.scan-screen__viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  /* Kein aspect-ratio — Kamera füllt den ganzen Platz */
}
.scan-screen__viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Scan-Rahmen + Hint (im Idle-Zustand sichtbar) ─────────────────────── */
.scan-screen__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.scan-screen__frame {
  width: 55%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
}
.scan-screen__hint {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  padding: .5rem 1.1rem;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   Einlass-Overlay: Vollbild über der Kamera
   ════════════════════════════════════════════════════════════ */
.scan-result-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  cursor: pointer;
  flex-direction: column;
}
.scan-result-overlay--visible {
  display: flex;
  animation: src-fade-in .18s ease;
}
@keyframes src-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Karte = gesamte Fläche */
.src-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-weight: 700;
}

/* ── 1. Status-Leiste (oben, farbig) ─────────────────────── */
.src-status-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: #fff;
}
.src--ok   .src-status-bar { background: #15803d; }
.src--fail .src-status-bar { background: #b91c1c; }
.src--warn .src-status-bar { background: #b45309; }

.src-icon {
  font-size: 2rem;
  line-height: 1;
  width: 2.6rem; height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  flex-shrink: 0;
}
.src-title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
}

/* Shake für Fehler */
.src--fail .src-status-bar { animation: scan-shake .25s ease; }
@keyframes scan-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-6px); }
  75%     { transform: translateX(6px); }
}

/* ── 2. Foto-Block (nimmt alle verbleibende Höhe) ─────────── */
.src-photo-block {
  flex: 1;
  position: relative;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.src-photo-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;           /* kein Zuschnitt – ganzes Bild sichtbar */
  object-position: center top;
}
.src-initials-large {
  font-size: 7rem;
  font-weight: 900;
  color: rgba(255,255,255,.12);
  letter-spacing: -.05em;
  user-select: none;
  pointer-events: none;
}

/* Name + Kategorie-Overlay am unteren Bildrand */
.src-person-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3rem 1.25rem 1.1rem;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  pointer-events: none;
}
.src-name-large {
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.src-cat-large {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin-top: .3rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── 2b. Fehler-Body (wenn kein Foto / kein Gast) ─────────── */
.src-error-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 2rem;
  background: #0a0a0f;
  color: rgba(255,255,255,.75);
}
.src-error-icon-large {
  font-size: 4rem;
  line-height: 1;
}
.src-line {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
  opacity: .85;
}

/* ── 3. Alerts-Bar (Alterskontrolle, Wiedereinlass, …) ────── */
.src-alerts-bar {
  flex-shrink: 0;
  background: rgba(0,0,0,.88);
  padding: .6rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.src-alert {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
}

/* ── 4. Tap-Hint (unten) ─────────────────────────────────── */
.src-tap {
  flex-shrink: 0;
  padding: .85rem 1rem;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.88);
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Richtungs-Toggle (Eingang / Ausgang) ───────────────────────────────── */
.scan-dir-toggle {
  display: flex;
  gap: 0;
  background: rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 3px;
  width: 100%;
}
.scan-dir-btn {
  flex: 1;
  padding: .65rem var(--sp-3);
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--c-text-muted);
  opacity: .45;                      /* inaktiv: deutlich gedimmt */
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s, box-shadow .15s;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.scan-dir-btn--active {
  background: var(--c-accent, #059669);   /* Akzentfarbe = EventCore-Grün */
  color: #fff;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(5,150,105,.35);
}
/* Dark-mode */
@media (prefers-color-scheme: dark) {
  .scan-dir-toggle { background: rgba(255,255,255,.08); }
  .scan-dir-btn { color: rgba(255,255,255,.5); }
  .scan-dir-btn--active { background: var(--c-accent, #059669); color: #fff; opacity: 1; }
}

/* ── Tap-to-Activate-State (stilles Kamera-Timeout) ────────────────────── */
.scan-viewport--tap #scan-idle-overlay { background: rgba(0,0,0,.35); }
.scan-viewport--tap .scan-screen__frame { border-color: rgba(255,255,255,.3); animation: none; }
.scan-viewport--tap .scan-screen__hint {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(0,0,0,.4);
  border-radius: 8px;
}

/* ── Footer: Zähler + Details-Button ────────────────────────────────────── */
.scan-screen__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  /* Bottom-Nav ist position:fixed → überlappt den Footer.
     padding-bottom schiebt den Inhalt über die Nav + Safe-Area. */
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + var(--sp-2));
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.scan-screen__footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.scan-screen__counts {
  display: flex;
  gap: var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-muted);
}
.scan-count b {
  font-size: var(--text-base);
  margin-left: .25rem;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.scan-count--ok    b { color: var(--c-success); }
.scan-count--fail  b { color: var(--c-danger); }

/* ══════════════════════════════════════════════════════════════════════════
   Check-In Scanner — Action Sheet + Sub-Panels
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Check-In Sheet: slides up from bottom inside viewport ──────────────── */
.ci-sheet {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.ci-sheet--visible {
  pointer-events: auto;
  opacity: 1;
}
.ci-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.ci-sheet__inner {
  position: relative;
  background: var(--c-surface);
  border-radius: 20px 20px 0 0;
  max-height: 75vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--sp-4) calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0px) + var(--sp-3));
  transform: translateY(40px);
  transition: transform .25s cubic-bezier(.22,.68,0,1.2);
}
.ci-sheet--visible .ci-sheet__inner {
  transform: translateY(0);
}

/* ── Handle ─────────────────────────────────────────────────────────────── */
.ci-sheet__handle {
  width: 40px; height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  margin: var(--sp-3) auto var(--sp-2);
}

/* ── Ticket Sheet: Hero Photo / Initialen ────────────────────────────────── */
.ci-hero {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--c-surface-raised, #1e1e2e);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ci-hero-fallback {
  font-size: 5rem;
  font-weight: 800;
  color: var(--c-border);
  letter-spacing: .05em;
  user-select: none;
}
.ci-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ── Ticket Sheet: Identity Info ─────────────────────────────────────────── */
.ci-identity {
  margin-bottom: var(--sp-3);
}
.ci-identity-name {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--sp-1);
}
.ci-identity-cat {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-accent);
}
.ci-identity-event {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-top: 2px;
}
.ci-identity-balance {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  margin-top: var(--sp-2);
}

/* ── Media Sheet: Customer Card (kompakt, Bändchen/Karte) ────────────────── */
.ci-customer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0 var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-3);
}
.ci-avatar {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-accent, #059669);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700;
}
.ci-photo {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ci-customer-info { flex: 1; min-width: 0; }
.ci-name   { font-weight: 700; font-size: var(--text-base); }
.ci-sub    { font-size: var(--text-sm); color: var(--c-text-muted); margin-top: 2px; }
.ci-balance {
  font-size: var(--text-sm); font-weight: 700;
  color: var(--c-accent, #059669); margin-top: 4px;
}

/* ── Status Badge ────────────────────────────────────────────────────────── */
.ci-status-badge {
  display: inline-flex; align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full, 999px);
  font-size: var(--text-sm); font-weight: 700;
  margin-bottom: var(--sp-3);
}
.ci-status-badge--ok   { background: #dcfce7; color: #15803d; }
.ci-status-badge--warn { background: #fef9c3; color: #854d0e; }
.ci-status-badge--fail { background: #fee2e2; color: #b91c1c; }

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.ci-actions { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.ci-action-btn {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-lg, 12px);
  background: var(--c-surface-raised, #1e293b);
  color: var(--c-text);
  font-size: var(--text-base); font-weight: 600;
  text-align: left; cursor: pointer;
  touch-action: manipulation;
  transition: filter .12s;
  -webkit-tap-highlight-color: transparent;
}
.ci-action-btn:active { filter: brightness(1.15); }
/* Farbige Varianten */
.ci-action-btn--assign { background: #1e3a5f; color: #93c5fd; border-color: #2563eb33; }
.ci-action-btn--topup  { background: #14532d; color: #86efac; border-color: #16a34a33; }
.ci-action-btn--payout { background: #451a03; color: #fdba74; border-color: #ea580c33; }
.ci-action-btn--photo  { background: #2e1065; color: #d8b4fe; border-color: #7c3aed33; }
.ci-action-btn--lock   { background: #450a0a; color: #fca5a5; border-color: #dc262633; }
.ci-action-btn--primary { background: #14532d; color: #86efac; border-color: #16a34a33; }
.ci-action-btn--danger  { background: #450a0a; color: #fca5a5; border-color: #dc262633; }
.ci-action-btn--disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.ci-lock-choice-btn {
  display: block; width: 100%; padding: var(--sp-4);
  border: 1px solid #dc262633; border-radius: var(--r-lg, 12px);
  background: #450a0a; color: #fca5a5;
  text-align: left; cursor: pointer; touch-action: manipulation;
  transition: filter .12s;
}
.ci-lock-choice-btn:active { filter: brightness(1.2); }
.ci-action-icon { line-height: 1; flex-shrink: 0; }
.ci-action-label { flex: 1; }
.ci-soon-badge {
  display: inline-block; margin-left: var(--sp-2);
  font-size: var(--text-xs); font-weight: 700;
  background: rgba(255,255,255,.12);
  color: inherit; opacity: .7;
  padding: 1px 6px; border-radius: var(--r-full, 999px);
}
/* X-Schließen-Button oben rechts im Sheet */
.ci-sheet__close-x {
  position: absolute; top: var(--sp-3); right: var(--sp-3);
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: var(--c-surface-raised, #1e293b);
  color: var(--c-text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; z-index: 2;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ci-sheet__close-x:active { background: var(--c-surface-2, #334155); }
.ci-hint-text {
  font-size: var(--text-sm); color: var(--c-text-muted);
  padding: var(--sp-2) 0; margin-bottom: var(--sp-2);
}

/* ── Sub-Panel (Aktionsformulare) ────────────────────────────────────────── */
.ci-sub-panel {
  position: absolute;
  inset: 0;
  background: var(--c-surface);
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.22,.68,0,1.15);
  z-index: 10;
}
.ci-sub-panel--visible { transform: translateY(0); }
.ci-sub-panel__inner {
  padding: var(--sp-4) var(--sp-4)
           calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0px) + var(--sp-4));
}
.ci-sub-header {
  font-size: var(--text-lg); font-weight: 800;
  margin-bottom: var(--sp-4);
}
.ci-sub-header--danger { color: var(--c-danger); }
.ci-sub-actions { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.ci-balance-display {
  font-size: var(--text-base); color: var(--c-text-muted);
  margin-bottom: var(--sp-3);
}
.ci-balance-display strong { color: var(--c-text); }

/* Preset-Buttons (Betragsvorwahl) */
.ci-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ci-preset-btn {
  padding: var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface-2, #f5f5f5);
  font-size: var(--text-sm); font-weight: 700;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.ci-preset-btn:active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.ci-preset-btn--full  { grid-column: 1 / -1; }

/* Empfänger-Auswahl */
.ci-recipient-group {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ci-recipient-btn {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-full, 999px);
  background: transparent;
  font-size: var(--text-sm); font-weight: 600; cursor: pointer;
  touch-action: manipulation; transition: all .12s;
}
.ci-recipient-btn--active {
  background: var(--c-accent, #059669); color: #fff; border-color: var(--c-accent, #059669);
}

/* Checkbox */
.ci-checkbox-label {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); color: var(--c-text-muted);
  margin: var(--sp-3) 0;
  cursor: pointer;
}

/* Sub-Panel Fehlermeldung */
.ci-sub-err {
  background: #fee2e2; color: #b91c1c;
  padding: var(--sp-3); border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 600;
  margin-bottom: var(--sp-3);
}

/* Sub-Panel Ergebnis (Erfolg/Fehler) */
.ci-sub-result {
  text-align: center; padding: var(--sp-6) var(--sp-4);
}
.ci-sub-result--ok .ci-sub-result-icon {
  font-size: 3rem; color: var(--c-success); margin-bottom: var(--sp-3);
}
.ci-sub-result-msg { font-size: var(--text-base); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════════════ */

/* Stats-Modal (Overlay) */
.ec-modal {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ec-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
}
.ec-modal__sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--c-surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-5) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .35);
  animation: ec-modal-up .2s ease;
}
@keyframes ec-modal-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.ec-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.ec-modal__head h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  margin: 0;
}
.ec-modal__body {
  max-height: 70vh;
  overflow-y: auto;
}

.scan-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.scan-stats-card {
  padding: var(--sp-4);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.scan-stats-card__label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.scan-stats-card__val {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-top: .2rem;
  font-variant-numeric: tabular-nums;
}
.scan-stats-event {
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
}
.scan-stats-event__label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.scan-stats-event__val {
  font-weight: 700;
  margin-top: .2rem;
}

/* ══════════════════════════════════════════════
   18. Staff-Service POS (ab v0.48)
   ══════════════════════════════════════════════ */

/* Layout-Hülle — flex-column, füllt .main--scan */
.svc-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Topbar-Erweiterung: Gast-Chip + Warenkorb */
.svc-topbar-ext {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  min-height: 44px;
}
.svc-guest-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  min-width: 0;
  flex: 1;
}
.svc-guest-chip__photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.svc-guest-chip__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-cart-btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Scan-Zeile */
.svc-scan-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.svc-scan-input {
  flex: 1;
  min-height: 40px;
  font-family: monospace;
  font-size: var(--text-sm);
}
.svc-scan-clear {
  flex-shrink: 0;
}

/* Haupt-Bereich — scrollbar */
.svc-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Gruppen-Grid */
.svc-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3);
}
.svc-group-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 100px;
  background: var(--c-surface);
  border: 2px solid var(--g-color, var(--c-border));
  border-radius: var(--r-xl);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  transition: transform .1s ease, background .15s ease;
  user-select: none;
  padding: var(--sp-4);
}
.svc-group-tile:active {
  transform: scale(.96);
  background: color-mix(in srgb, var(--g-color, var(--c-border)) 15%, var(--c-surface));
}
.svc-group-tile__icon { font-size: 2.2rem; line-height: 1; }
.svc-group-tile__name { font-size: var(--text-base); text-align: center; }

/* Breadcrumb + Untergruppen-Tabs */
.svc-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.svc-breadcrumb__sep {
  font-weight: 700;
  font-size: var(--text-base);
  white-space: nowrap;
}
.svc-cat-tabs {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  scrollbar-width: none;
  position: sticky;
  top: 44px; /* Breadcrumb-Höhe */
  z-index: 9;
}
.svc-cat-tabs::-webkit-scrollbar { display: none; }
.svc-cat-tab {
  flex-shrink: 0;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
}
.svc-cat-tab--active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

/* Produkt-Grid */
.svc-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-3);
}
@media (min-width: 480px) {
  .svc-product-grid { grid-template-columns: repeat(4, 1fr); }
}
.svc-product-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 80px;
  padding: var(--sp-2) var(--sp-1);
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--r-lg);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: transform .1s ease, border-color .1s ease;
  user-select: none;
  overflow: hidden;
}
.svc-product-tile:active { transform: scale(.94); }
.svc-product-tile--in-cart {
  border-color: var(--c-accent);
  background: color-mix(in srgb, var(--c-accent) 8%, var(--c-surface));
}
.svc-product-tile__badge {
  position: absolute;
  top: 4px; right: 6px;
  min-width: 20px;
  height: 20px;
  background: var(--c-accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.svc-product-tile__name {
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}
.svc-product-tile__price {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--c-accent);
  font-variant-numeric: tabular-nums;
}
.svc-product-tile__age {
  font-size: .65rem;
  color: var(--c-danger);
  font-weight: 700;
}

/* Cart-Sheet (innerhalb ec-modal) */
.svc-cart-guest {
  margin-bottom: var(--sp-3);
  font-weight: 700;
  font-size: var(--text-sm);
}
.svc-cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.svc-cart-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.svc-cart-row__name {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-sm);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-cart-row__controls {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.svc-cart-row__qty {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.svc-cart-row__price {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  min-width: 4.5rem;
  text-align: right;
}
.svc-cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: var(--text-lg);
  padding-top: var(--sp-3);
  border-top: 2px solid var(--c-border);
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════════════════════
   Check-In v0.50 — 2-Spalten-Header, VIP-Badge, Scan-Chips, Mini-Scan-Modal,
   Passfoto-Kamera
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── 2-Spalten-Header (Foto + Info) ─────────────────────────────────────────── */
.ci-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  align-items: start;
}
.ci-header__photo {
  width: 180px;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-lg, 12px);
  overflow: hidden;
  background: var(--c-surface-raised, #1a1a2e);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ci-header__fallback {
  font-size: 3.5rem; font-weight: 800;
  color: var(--c-border);
  user-select: none;
}
.ci-header__photo-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.ci-header__info {
  display: flex; flex-direction: column; gap: var(--sp-1, 4px);
  min-width: 0; padding-top: 2px;
}
.ci-header__badges {
  display: flex; flex-wrap: wrap; gap: var(--sp-1, 4px);
  margin-bottom: var(--sp-1, 4px);
}
.ci-header__name {
  font-size: 1.15rem; font-weight: 800; line-height: 1.25;
  word-break: break-word;
}
.ci-header__cat {
  font-size: var(--text-sm); font-weight: 700; color: var(--c-accent);
}
.ci-header__event {
  font-size: var(--text-xs); color: var(--c-text-muted);
}

/* ── VIP-Badge ──────────────────────────────────────────────────────────────── */
.ci-vip-badge {
  display: inline-flex; align-items: center;
  background: #b45309; color: #fff;
  font-size: .65rem; font-weight: 900; letter-spacing: .1em;
  padding: 2px 8px; border-radius: var(--r-full, 999px);
  text-transform: uppercase; width: fit-content;
  margin-bottom: 3px;
}
.ci-vip-badge--guestlist { background: #7c3aed; }

/* ── Scan-Meta (Richtung, Ersteinlass/Wiedereinlass) ────────────────────────── */
.ci-scan-meta {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: var(--sp-1); align-items: center;
}
.ci-scan-chip {
  font-size: var(--text-xs); font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-full, 999px);
  background: var(--c-surface-2, #f0f0f0);
  color: var(--c-text-muted);
  white-space: nowrap;
}
.ci-scan-chip--in      { background: #dcfce7; color: #15803d; }
.ci-scan-chip--out     { background: #fef9c3; color: #854d0e; }
.ci-scan-chip--reentry { background: #fef3c7; color: #92400e; }

/* Wallet-Balance in Header */
.ci-wallet-balance {
  font-size: var(--text-sm); font-weight: 700;
  color: var(--c-accent, #059669); margin-top: var(--sp-1, 4px);
}

/* ── SVG in Action-Icon ─────────────────────────────────────────────────────── */
.ci-action-icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ci-action-icon svg { display: block; }

/* ── Exchange-Wallet-Note ───────────────────────────────────────────────────── */
.ci-exchange-note {
  background: #fef9c3; color: #854d0e;
  font-size: var(--text-xs); font-weight: 600;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
}
.ci-balance-deposit {
  font-size: var(--text-xs); color: var(--c-text-muted);
}

/* ── Mini-Scan-Modal ────────────────────────────────────────────────────────── */
.ci-scan-submodal {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.ci-scan-submodal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
}
.ci-scan-submodal__sheet {
  position: relative;
  background: var(--c-surface);
  border-radius: 20px 20px 0 0;
  padding: 0 var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  max-height: 90vh; overflow-y: auto;
  animation: ec-modal-up .22s cubic-bezier(.22, .68, 0, 1.2);
}
.ci-scan-submodal__handle {
  width: 40px; height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  margin: var(--sp-3) auto var(--sp-2);
}
.ci-scan-submodal__head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.ci-scan-submodal__title {
  font-size: var(--text-base); font-weight: 800;
}
.ci-scan-submodal__close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: var(--c-surface-2, #f0f0f0);
  cursor: pointer; touch-action: manipulation;
  flex-shrink: 0; color: var(--c-text);
}
/* Kleines quadratisches Kamerafenster */
.ci-scan-submodal__viewport {
  position: relative;
  width: 100%; max-width: 260px;
  aspect-ratio: 1;
  margin: 0 auto var(--sp-3);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
}
.ci-scan-submodal__viewport video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Scan-Ecken (4 Ecken-Marker) */
.ci-sub-corners {
  position: absolute; inset: 12px; pointer-events: none;
}
.ci-sub-corner {
  position: absolute; width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .9);
}
.ci-sub-corner--tl { top: 0; left: 0;   border-right: none; border-bottom: none; border-radius: 3px 0 0 0; }
.ci-sub-corner--tr { top: 0; right: 0;  border-left:  none; border-bottom: none; border-radius: 0 3px 0 0; }
.ci-sub-corner--bl { bottom: 0; left: 0;  border-right: none; border-top: none; border-radius: 0 0 0 3px; }
.ci-sub-corner--br { bottom: 0; right: 0; border-left:  none; border-top: none; border-radius: 0 0 3px 0; }

.ci-scan-submodal__hint {
  text-align: center;
  font-size: var(--text-sm); color: var(--c-text-muted);
  min-height: 1.4em;
  margin-bottom: var(--sp-3);
}
.ci-scan-submodal__result {
  margin-bottom: var(--sp-2);
}

/* ── Modal-Erfolg (innerhalb Mini-Scan-Modal) ───────────────────────────────── */
.ci-modal-success {
  text-align: center;
  padding: var(--sp-4) var(--sp-2) var(--sp-2);
}
.ci-modal-success__icon {
  display: flex; justify-content: center;
  margin-bottom: var(--sp-2);
}
.ci-modal-success__msg {
  font-size: var(--text-lg); font-weight: 800;
  margin-bottom: var(--sp-1);
}
.ci-modal-success__sub {
  font-size: var(--text-sm); color: var(--c-text-muted);
  margin-bottom: var(--sp-3);
}

/* ── Passfoto-Kamera-Modal ──────────────────────────────────────────────────── */
.ci-photo-modal {
  position: fixed; inset: 0; z-index: 950;
  background: #000;
  display: flex; flex-direction: column;
}
.ci-photo-modal__head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--sp-3) + env(safe-area-inset-top, 0px)) var(--sp-4) var(--sp-3);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent);
}
.ci-photo-modal__title {
  color: #fff; font-size: var(--text-base); font-weight: 700;
}
.ci-photo-modal__close {
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; flex-shrink: 0;
}
.ci-photo-modal__viewport {
  flex: 1; position: relative; overflow: hidden;
}
.ci-photo-modal__viewport video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Passformat-Overlay: Rahmen zentriert, 3:4, Rest abgedunkelt */
.ci-passport-overlay {
  position: absolute; inset: 0; pointer-events: none;
}
.ci-passport-frame {
  position: absolute;
  width: 62%; aspect-ratio: 3 / 4;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%); /* leicht nach oben für Kopf-Positionierung */
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 8px;
  /* Abgedunkelter Bereich außerhalb des Rahmens */
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, .45);
}
.ci-passport-hint {
  position: absolute;
  bottom: calc(50% - 50vw * 0.62 * 4/3 / 2 - 32px); /* unter dem Rahmen */
  left: 0; right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .85);
  font-size: var(--text-sm); font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
.ci-photo-modal__footer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent);
}
/* Runder Auslöser-Button */
.ci-capture-btn {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: rgba(255, 255, 255, .88);
  cursor: pointer; touch-action: manipulation;
  transition: transform .1s, background .1s;
  flex-shrink: 0;
}
.ci-capture-btn:active {
  transform: scale(.9);
  background: #fff;
}
.ci-capture-btn:disabled { opacity: .5; }
/* Status-Zeile */
.ci-photo-status {
  position: absolute; bottom: 100px; left: var(--sp-4); right: var(--sp-4);
  text-align: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 600;
  z-index: 3;
}
.ci-photo-status--info  { background: rgba(0,0,0,.65); color: #fff; }
.ci-photo-status--ok    { background: #15803d; color: #fff; }
.ci-photo-status--error { background: #b91c1c; color: #fff; }

/* ══════════════════════════════════════════════
   16. Gäste-App Bottom-Nav (Icon-only)
   ══════════════════════════════════════════════ */

.bottom-nav--guest .bottom-nav__item {
  gap: 0;
  padding: var(--sp-2) 0;
}
.bottom-nav--guest .bottom-nav__icon {
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav--guest .bottom-nav__icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  transition: stroke var(--transition);
}
.bottom-nav--guest .bottom-nav__item--active {
  position: relative;
}
.bottom-nav--guest .bottom-nav__item--active::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--c-accent);
}

/* ══════════════════════════════════════════════
   17. Side Drawer (Burger-Menü)
   ══════════════════════════════════════════════ */

.side-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 400;
  opacity: 0;
  transition: opacity var(--transition-slow);
  touch-action: none;
}
.side-drawer-backdrop--visible { opacity: 1; }

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  z-index: 401;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow) cubic-bezier(.22,.68,0,1.2);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.side-drawer--open { transform: translateX(0); }

/* Header */
.side-drawer__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: calc(env(safe-area-inset-top, 0px) + var(--sp-4)) var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.side-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--c-surface-2);
  color: var(--c-text);
  border-radius: var(--r-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.side-drawer__close:hover { background: var(--c-border); }
.side-drawer__user { flex: 1; min-width: 0; }
.side-drawer__user-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-drawer__user-email {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Nav */
.side-drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-3);
  overscroll-behavior: contain;
}
.side-drawer__section { margin-bottom: var(--sp-4); }
.side-drawer__section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-text-dim);
  padding: 0 var(--sp-2) var(--sp-2);
}
.side-drawer__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-2);
  border: none;
  background: none;
  color: var(--c-text);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  min-height: var(--touch-min);
}
.side-drawer__item:hover,
.side-drawer__item:active {
  background: var(--c-surface-2);
  color: var(--c-accent);
}
.side-drawer__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
  transition: color var(--transition), background var(--transition);
}
.side-drawer__item:hover .side-drawer__item-icon,
.side-drawer__item:active .side-drawer__item-icon {
  color: var(--c-accent);
  background: var(--c-success-bg);
}
.side-drawer__item-label { flex: 1; }

/* Footer */
.side-drawer__footer {
  padding: var(--sp-3);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}
.side-drawer__logout {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-2);
  border: none;
  background: none;
  color: var(--c-danger);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
  min-height: var(--touch-min);
}
.side-drawer__logout:hover,
.side-drawer__logout:active { background: var(--c-danger-bg); }
.side-drawer__logout .side-drawer__item-icon {
  color: var(--c-danger);
  background: var(--c-danger-bg);
}

/* Burger-Button in Topbar */
.topbar__burger {
  color: var(--c-text);
  padding: var(--sp-2);
}
.topbar__burger:hover { color: var(--c-accent); }

/* Membercard-Icon in Topbar-Brand */
.topbar__mc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--c-accent);
  color: #fff;
  flex-shrink: 0;
}

