/* ============================================================
   WC 2026 Watch Party — Erbil Arena
   styles.css — Modern dual-theme system (Dark + Light)
   Brand: Arena Erbil red on a refined neutral surface.
   All component class names are preserved so the existing
   JS / HTML keep working unchanged.
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

/* ---- Dark theme (default) ---- */
:root,
:root[data-theme="dark"] {
  --bg:        #0a0a0c;
  --bg2:       #111114;
  --card:      #17171c;
  --card2:     #20202a;
  --border:    #2a2a33;
  --border2:   #3a3a46;
  --fg:        #f4f4f7;
  --fg-soft:   #c9c9d2;
  --muted:     #8a8a96;

  --accent:    #ef4444;
  --accent2:   #dc2626;
  --accent3:   #b91c1c;
  --accent-soft: rgba(239,68,68,0.14);

  --vip:       #fca5a5;
  --regular:   #ef4444;
  --outdoor:   #f87171;
  --danger:    #ef4444;
  --success:   #22c55e;
  --wc-purple: #a78bfa;
  --wc-purple-soft: rgba(139, 92, 246, 0.16);
  --wc-red:    #ef4444;

  /* seat fills (theme-aware) */
  --seat-vip-bg:     rgba(239,68,68,0.28);
  --seat-vip-bd:     rgba(252,165,165,0.55);
  --seat-reg-bg:     rgba(239,68,68,0.28);
  --seat-reg-bd:     rgba(239,68,68,0.55);
  --seat-out-bg:     rgba(248,113,113,0.30);
  --seat-out-bd:     rgba(248,113,113,0.6);
  --seat-num:        rgba(255,255,255,0.92);
  --sold-a:          #4b5563;
  --sold-b:          #3f4855;
  --sold-bd:         #6b7280;

  /* glass / surfaces */
  --glass-bg:     rgba(17,17,20,0.72);
  --glass-bg2:    rgba(23,23,28,0.6);
  --glass-border: rgba(255,255,255,0.07);
  --hairline:     rgba(255,255,255,0.06);

  /* atmosphere */
  --atmo-1: rgba(220,38,38,0.12);
  --atmo-2: rgba(239,68,68,0.09);
  --atmo-3: rgba(185,28,28,0.07);
  --noise-opacity: 0.03;

  /* elevation */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.45), 0 1px 1px rgba(0,0,0,0.3);
  --shadow-md:  0 6px 20px rgba(0,0,0,0.40);
  --shadow-lg:  0 18px 50px rgba(0,0,0,0.55);
  --shadow-accent: 0 10px 34px rgba(239,68,68,0.28);

  --skel-1: rgba(255,255,255,0.04);
  --skel-2: rgba(255,255,255,0.09);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --header-h: 57px;
  --nav-h: 46px;
  --sticky-below-nav: calc(var(--header-h) + var(--nav-h) + 10px);
  color-scheme: dark;
}

/* ---- Light theme ---- */
:root[data-theme="light"] {
  --bg:        #e8ebf1;
  --bg2:       #ffffff;
  --card:      #ffffff;
  --card2:     #eef1f6;
  --border:    #d3d8e2;
  --border2:   #b9c0cd;
  --fg:        #0f1115;
  --fg-soft:   #333845;
  --muted:     #565d6c;

  --accent:    #dc2626;
  --accent2:   #c1201f;
  --accent3:   #991b1b;
  --accent-soft: rgba(220,38,38,0.10);

  --vip:       #e11d48;
  --regular:   #dc2626;
  --outdoor:   #ea580c;
  --danger:    #dc2626;
  --success:   #16a34a;
  --wc-purple: #7c3aed;
  --wc-purple-soft: rgba(124, 58, 237, 0.12);
  --wc-red:    #dc2626;

  --seat-vip-bg:     #e11d48;
  --seat-vip-bd:     #be123c;
  --seat-reg-bg:     #dc2626;
  --seat-reg-bd:     #b91c1c;
  --seat-out-bg:     #ea580c;
  --seat-out-bd:     #c2410c;
  --seat-num:        #ffffff;
  --sold-a:          #cbd0d9;
  --sold-b:          #bcc2cd;
  --sold-bd:         #98a0ad;

  --glass-bg:     rgba(255,255,255,0.92);
  --glass-bg2:    rgba(255,255,255,0.88);
  --glass-border: rgba(15,23,42,0.07);
  --hairline:     rgba(15,23,42,0.06);

  --atmo-1: rgba(220,38,38,0.07);
  --atmo-2: rgba(239,68,68,0.05);
  --atmo-3: rgba(185,28,28,0.04);
  --noise-opacity: 0.02;

  --shadow-sm:  0 1px 2px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.08);
  --shadow-md:  0 8px 24px rgba(16,24,40,0.10);
  --shadow-lg:  0 24px 60px rgba(16,24,40,0.16);
  --shadow-accent: 0 12px 34px rgba(220,38,38,0.20);

  --skel-1: rgba(15,23,42,0.05);
  --skel-2: rgba(15,23,42,0.10);

  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
}
h1, h2, h3, h4, h5 { font-family: 'Oswald', sans-serif; }

/* Smooth, BRIEF cross-fade when the theme flips. Bounded to a small set of
   surfaces and cheap properties only (no pseudo-elements, no box-shadow, no
   backdrop-filter) so the switch stays smooth instead of repainting the whole
   tree at once. Untargeted elements simply snap (instant = no jank). */
html.theme-transition,
html.theme-transition body,
html.theme-transition header,
html.theme-transition nav,
html.theme-transition .panel,
html.theme-transition .match-card,
html.theme-transition .stat-card,
html.theme-transition .field,
html.theme-transition .chip,
html.theme-transition .tab-btn,
html.theme-transition .acct-table th,
html.theme-transition .acct-table td {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease !important;
}

/* During a theme flip, the seat map (≈610 nodes) plus the QR / ticket artifacts
   must NOT each run their own background animation — that's what caused the lag.
   They snap instantly (no per-element repaint storm); the page still cross-fades. */
html.theme-transition .seat,
html.theme-transition .seat::after,
html.theme-transition .seat-num,
html.theme-transition .particle,
html.theme-transition .qr-card,
html.theme-transition .ticket-card,
html.theme-transition .legend-dot,
html.theme-transition .screen-bar { transition: none !important; }

/* ---------- Atmosphere ---------- */
.bg-atmo {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 520px 420px at 14% 12%, var(--atmo-1) 0%, transparent 70%),
    radial-gradient(ellipse 440px 420px at 86% 82%, var(--atmo-2) 0%, transparent 70%),
    radial-gradient(ellipse 640px 320px at 50% 100%, var(--atmo-3) 0%, transparent 60%);
  transition: opacity .4s ease;
}
.bg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ---------- Reusable glass panel (added to wrapper cards in HTML) ---------- */
.panel {
  background: var(--glass-bg2);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(9px) saturate(1.08);
  backdrop-filter: blur(9px) saturate(1.08);
  box-shadow: var(--shadow-md);
}

/* ---------- Seats ---------- */
.seat-section-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 0 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--card2);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.seat-section-scroll::-webkit-scrollbar { height: 8px; }
.seat-section-scroll::-webkit-scrollbar-track {
  background: var(--card2);
  border-radius: 99px;
  margin: 0 18px;
}
.seat-section-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 99px;
  border: 1px solid var(--bg2);
}
.seat-section-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.seat-rows {
  display: flex; flex-direction: column; gap: 8px;
  width: max-content; margin: 0 auto; min-width: 100%;
}
.seat-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: max-content; margin: 0 auto;
  padding-top: 6px;   /* room so the selected badge isn't clipped at the top */
}
.seat-rowlabel {
  font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--muted); width: 20px; text-align: center; flex-shrink: 0; letter-spacing: 1px;
}

.seat {
  cursor: pointer;
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), filter .15s ease, background .2s, border-color .2s, box-shadow .2s;
  position: relative; border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.seat:hover:not(.sold):not(.selected) { transform: scale(1.2) translateY(-1px); z-index: 2; filter: brightness(1.2); }
.seat:active:not(.sold) { transform: scale(1.05); }
.seat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 3; }

.seat-num {
  font-family: 'Oswald', sans-serif; font-weight: 600; line-height: 1;
  color: var(--seat-num); pointer-events: none; user-select: none;
}

/* VIP — round */
.seat.vip { width: 42px; height: 42px; border-radius: 50%; background: var(--seat-vip-bg); border-color: var(--seat-vip-bd); }
.seat.vip .seat-num { font-size: 13px; }
.seat.vip:hover:not(.sold):not(.selected) { border-color: var(--vip); box-shadow: 0 0 14px rgba(225,29,72,0.5); }
.seat.selected.vip { background: var(--vip); border-color: #fff; box-shadow: 0 0 18px rgba(225,29,72,0.65); }
.seat.selected.vip .seat-num { color: #fff; }

/* Bench — rectangular */
.seat.regular { width: 50px; height: 38px; border-radius: 6px; background: var(--seat-reg-bg); border-color: var(--seat-reg-bd); }
.seat.regular .seat-num { font-size: 14px; }
.seat.regular:hover:not(.sold):not(.selected) { border-color: var(--regular); box-shadow: 0 0 14px rgba(239,68,68,0.5); }
.seat.selected.regular { background: var(--regular); border-color: #fff; box-shadow: 0 0 18px rgba(239,68,68,0.65); }
.seat.selected.regular .seat-num { color: #fff; }

/* Outdoor */
.seat.outdoor { width: 42px; height: 42px; border-radius: 7px 7px 4px 4px; background: var(--seat-out-bg); border-color: var(--seat-out-bd); }
.seat.outdoor .seat-num { font-size: 13px; }
.seat.outdoor:hover:not(.sold):not(.selected) { border-color: var(--outdoor); box-shadow: 0 0 14px rgba(234,88,12,0.5); }
.seat.selected.outdoor { background: var(--outdoor); border-color: #fff; box-shadow: 0 0 18px rgba(234,88,12,0.65); }
.seat.selected.outdoor .seat-num { color: #fff; }

.seat.selected { transform: scale(1.14); z-index: 3; }
/* Selected marker — sits on the corner; parent rows have top padding so it isn't clipped */
.seat.selected::after {
  content: '\2713';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  border: 2px solid var(--bg2);
  z-index: 5;
  pointer-events: none;
}

/* Sold / taken */
.seat.sold {
  background: repeating-linear-gradient(45deg, var(--sold-a) 0 5px, var(--sold-b) 5px 10px);
  border-color: var(--sold-bd); cursor: not-allowed; opacity: 1; filter: none;
}
.seat.sold .seat-num { display: none; }
.seat.sold::after {
  content: '\2715'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}
.seat.sold:hover { transform: none; box-shadow: 0 0 0 1px var(--sold-bd); }
.seat.held { opacity: .55; cursor: default; }

.seatmap-loading { opacity: .4; pointer-events: none; filter: grayscale(.4); transition: opacity .25s; }

#seatMap { overflow: visible; }

/* ---------- Section colour picker (under the cart) ---------- */
.cc-swatchbox {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.18); box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
}
.cc-swatch-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.cc-swatch {
  width: 30px; height: 30px; border-radius: 8px; padding: 0; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s ease, box-shadow .15s ease;
}
.cc-swatch:hover { transform: scale(1.14); }
.cc-swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); transform: scale(1.1); }
.cc-colorwell {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; padding: 2px;
  border: 1px solid var(--border); background: var(--bg2); cursor: pointer;
}

.section-label {
  font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; padding: 0 0 10px;
  display: flex; align-items: center; gap: 6px;
}

.screen-bar {
  text-align: center; font-size: 9px; letter-spacing: 3px; text-transform: uppercase;
  font-family: 'Oswald', sans-serif; color: var(--muted);
  padding: 7px 0; margin: 6px 0;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent-soft); border-radius: 8px;
  position: relative; overflow: hidden;
}
.screen-bar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .55;
}

/* ---------- Match selector ---------- */
.match-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.4,.64,1), border-color .2s, box-shadow .25s, background .2s;
  position: relative; overflow: hidden; text-align: left; width: 100%;
  box-shadow: var(--shadow-sm);
  /* perf: skip rendering offscreen cards (104 fixtures) */
  content-visibility: auto;
  contain-intrinsic-size: auto 128px;
}
.match-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.match-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md), var(--shadow-accent); }
.match-card:hover::after { opacity: 1; }
.match-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.match-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-accent); }
.match-card.selected::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; z-index: 1;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
}
.match-card .stage-pill {
  display: inline-block; font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.match-card.is-final .stage-pill { background: var(--accent-soft); color: var(--accent2); }
.match-card.is-third .stage-pill { background: rgba(180, 83, 9, 0.18); color: #fbbf24; }
.match-card.is-third { border-color: rgba(251, 191, 36, 0.35); }
.match-card.is-third:hover { border-color: #fbbf24; box-shadow: var(--shadow-md), 0 0 18px rgba(251, 191, 36, 0.2); }

/* Placeholder chip for slots with no country yet (TBD / winner-of-…).
   Shares the flag sizing contract so a bracket row of mixed
   flags + placeholders still lines up perfectly. */
.team-badge {
  --fb-scale: 1;
  height: calc(var(--fb-h, 34px) * var(--fb-scale));
  width: calc(var(--fb-h, 34px) * var(--fb-scale) * 4 / 3);
  flex: 0 0 auto;
  border-radius: calc(var(--fb-h, 34px) * 0.18);
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: calc(var(--fb-h, 34px) * var(--fb-scale) * 0.34);
  color: #fff; line-height: 1; overflow: hidden;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.team-badge.flag-badge--gold { border-color: var(--accent); }

.selected-match-bar {
  background: linear-gradient(90deg, var(--accent-soft), transparent 65%);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 13px 18px; margin-bottom: 18px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(8px);
  position: sticky; top: var(--sticky-below-nav); z-index: 20;
}

/* ---------- App chrome ---------- */
.app-header { min-height: var(--header-h); }
.app-nav {
  top: var(--header-h) !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav-inner {
  padding-bottom: 2px;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.cart-panel {
  position: static;
  overflow: visible;
}
@media (min-width: 1024px) {
  .cart-panel {
    position: sticky;
    top: var(--sticky-below-nav);
    align-self: start;
  }
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table-scroll::after {
  content: '';
  display: block;
  height: 0;
}

.match-banner-inner {
  gap: 1rem;
}
@media (max-width: 639px) {
  .match-banner-side {
    position: static !important;
    transform: none !important;
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .match-banner-teams { flex-wrap: wrap; justify-content: center; }
}

/* ---------- Filters ---------- */
.chip {
  font-family: 'Oswald', sans-serif; font-size: 12px; letter-spacing: .5px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  transition: all .2s ease;
}
.chip:hover { color: var(--fg); border-color: var(--accent); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  border-color: transparent; font-weight: 600; box-shadow: var(--shadow-accent);
}

.field {
  background: var(--card); border: 1px solid var(--border); color: var(--fg);
  padding: 9px 12px; border-radius: 10px; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; width: 100%;
}
.field:hover { border-color: var(--border2); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field::placeholder { color: var(--muted); }
:root[data-theme="dark"] .field::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--fg);
  cursor: pointer; font-size: 15px; position: relative; overflow: hidden;
  transition: border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.theme-toggle:active { transform: translateY(0) scale(.94); }
.theme-toggle i { transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.theme-toggle:hover i { transform: rotate(35deg); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(140px);
  padding: 14px 28px; border-radius: 14px; font-weight: 600; z-index: 999;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1); pointer-events: none; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,4,6,0.84); backdrop-filter: blur(6px);
  z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto;
}
:root[data-theme="light"] .modal-overlay {
  background: rgba(15, 17, 21, 0.72);
}
.modal-overlay.active { display: flex; animation: overlayIn .3s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* The ticket stays a deliberately dark "ticket stub" artifact in BOTH themes
   so the QR keeps maximum contrast and it reads like a real printed ticket. */
.ticket-card {
  /* The stub is always dark, so it carries its OWN dark token context —
     this keeps every themed utility inside it (bg-[--bg2], text-[--muted],
     border-[--border]) readable in BOTH light and dark page themes. */
  --bg2:     rgba(255,255,255,0.06);
  --card:    rgba(255,255,255,0.04);
  --card2:   rgba(255,255,255,0.09);
  --border:  rgba(255,255,255,0.14);
  --border2: rgba(255,255,255,0.22);
  --fg:      #f6f6f8;
  --fg-soft: #d9d4d4;
  --muted:   #ad9f9f;
  background: linear-gradient(160deg, #20100f 0%, #0c0707 100%);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 22px;
  max-width: 440px; width: 100%; overflow: hidden;
  animation: ticketIn .5s cubic-bezier(.34,1.56,.64,1);
  max-height: 94vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(239,68,68,0.12);
  color: #f6f6f8;
}
@keyframes ticketIn {
  from { opacity: 0; transform: scale(.85) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.ticket-card-scroll { overflow-y: auto; flex: 1; scrollbar-width: none; -ms-overflow-style: none; }
.ticket-card-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.tear-line {
  height: 1px; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0, rgba(255,255,255,0.18) 6px, transparent 6px, transparent 12px);
  margin: 0 20px;
}
.tear-circles { position: relative; height: 20px; margin: 0 -1px; flex-shrink: 0; }
.tear-circles::before, .tear-circles::after {
  content: ''; position: absolute; top: 50%; width: 20px; height: 20px;
  background: #0a0809; border-radius: 50%; transform: translateY(-50%);
}
.tear-circles::before { left: -10px; }
.tear-circles::after { right: -10px; }

.verify-input {
  background: var(--card); border: 2px solid var(--border); color: var(--fg);
  padding: 14px 18px; border-radius: 12px; font-size: 16px; width: 100%; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.verify-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Tabs ---------- */
.tab-btn {
  padding: 12px 22px; border-radius: 10px 10px 0 0; font-family: 'Oswald', sans-serif;
  font-weight: 500; font-size: 14px; letter-spacing: 1px; cursor: pointer;
  transition: color .25s, background .25s; border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--muted); white-space: nowrap; position: relative;
}
.tab-btn::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0); transform-origin: center; transition: transform .25s ease;
}
.tab-btn.active { background: var(--card); color: var(--fg); border-color: var(--border); }
.tab-btn.active::after { transform: scaleX(1); }
.tab-btn:hover:not(.active) { color: var(--fg); }
.tab-btn:hover:not(.active)::after { transform: scaleX(.5); opacity: .5; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  font-family: 'Oswald', sans-serif; letter-spacing: 1px; font-weight: 700;
  border: none; cursor: pointer; position: relative; overflow: hidden;
  transition: filter .2s, transform .1s, box-shadow .25s, opacity .2s;
  box-shadow: var(--shadow-accent);
}
.btn-primary::before {
  content: ''; position: absolute; top: 0; left: -120%; width: 80%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-18deg); transition: left .6s ease;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-accent), var(--shadow-md); }
.btn-primary:hover:not(:disabled)::before { left: 140%; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  border: 1px solid var(--border); color: var(--muted); background: var(--card); cursor: pointer;
  transition: all .2s; font-family: 'Oswald', sans-serif; letter-spacing: 1px;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost:active { transform: translateY(0); }

.btn-free {
  border: 1px solid var(--wc-purple); color: var(--wc-purple); background: transparent;
  font-family: 'Oswald', sans-serif; letter-spacing: 1px; font-weight: 700; cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s, opacity .2s;
}
.btn-free:hover:not(:disabled) { background: var(--wc-purple-soft); border-color: var(--wc-purple); transform: translateY(-1px); }
.btn-free:active:not(:disabled) { transform: translateY(0); }
.btn-free:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Misc effects ---------- */
@keyframes pulseAccent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
.pulse-badge { animation: pulseAccent 2s infinite; }

.particle {
  position: fixed; width: 3px; height: 3px; border-radius: 50%;
  pointer-events: none; z-index: 0; opacity: 0; animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: .5; }
  90% { opacity: .2; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

.legend-dot { width: 14px; height: 14px; border-radius: 4px 4px 2px 2px; flex-shrink: 0; }

.seats-left-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.seats-left-item {
  text-align: center;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  position: relative;
  overflow: hidden;
}
.seats-left-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sec-color, var(--accent));
  opacity: 0.85;
}
.seats-left-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sec-color, var(--muted));
  font-family: 'Oswald', sans-serif;
  margin-bottom: 8px;
}
.seats-left-row {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.seats-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}
.seats-left-num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  line-height: 1.1;
  color: var(--sec-color, var(--fg));
}
.seats-left-sold-num {
  color: var(--muted);
  font-size: 1.5rem;
}
.seats-left-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}
.seats-left-sub {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
}

/* VIP / outdoor layout editor (Seats sidebar) */
.layout-section-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  position: relative;
  overflow: hidden;
}
.layout-section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--layout-accent, var(--accent));
  opacity: 0.9;
}
.layout-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.layout-section-cap {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.layout-dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.layout-dim-label {
  font-size: 11px;
  color: var(--muted);
}
.layout-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.layout-step-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.layout-step-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent);
}
.layout-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.layout-step-val {
  min-width: 28px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.layout-preview {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px dashed var(--border);
}

.layout-grid-hint {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0 8px;
}
.layout-min-hint {
  font-size: 10px;
  color: #fbbf24;
  margin: 0 0 8px;
  opacity: 0.9;
}
.layout-min-hint.layout-min-warn {
  color: #fb923c;
}
.layout-seat-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 8px;
}
.layout-seat-count {
  min-width: 64px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fg);
  padding: 0 4px;
}

.layout-input-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.layout-seat-input-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.layout-seat-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 10px 8px;
}
.layout-seat-input-row .layout-step-chip {
  flex: 0 0 40px;
  padding: 0;
  min-height: 44px;
}
.layout-apply-btn {
  flex: 0 0 44px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  cursor: pointer;
  transition: background 0.12s;
}
.layout-apply-btn:hover {
  background: rgba(34, 197, 94, 0.28);
}

.layout-unlock-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent);
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.layout-unlock-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}
.layout-unlocked-msg {
  font-size: 10px;
  color: #4ade80;
  text-align: center;
  margin-top: 8px;
}
.layout-lock-now-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.layout-lock-now-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.layout-section-locked {
  opacity: 0.72;
}
.layout-radio-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.layout-step-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.layout-step-chip {
  flex: 1 1 calc(16.66% - 4px);
  min-width: 36px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.layout-step-chip.is-add { color: #4ade80; }
.layout-step-chip.is-remove { color: #f87171; }
.layout-step-chip:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg2);
}
.layout-step-chip:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.layout-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.layout-radio-chip {
  position: relative;
  cursor: pointer;
}
.layout-radio-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.layout-radio-chip span {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.12s;
  min-width: 44px;
  text-align: center;
}
.layout-radio-chip:hover:not(.is-disabled) span {
  border-color: var(--layout-accent, var(--accent));
  color: var(--fg);
}
.layout-radio-chip.is-selected span,
.layout-radio-chip input:checked + span {
  border-color: var(--layout-accent, var(--accent));
  background: color-mix(in srgb, var(--layout-accent, var(--accent)) 18%, transparent);
  color: var(--fg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--layout-accent, var(--accent)) 40%, transparent);
}
.layout-radio-chip.is-disabled span {
  opacity: 0.35;
  cursor: not-allowed;
}

.layout-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.layout-quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.layout-quick-add {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}
.layout-quick-add:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.45);
}
.layout-quick-remove {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}
.layout-quick-remove:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}
.layout-quick-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.layout-trim-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.layout-trim-btn:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.55);
}
.layout-trim-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}
.layout-fine-tune {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.layout-fine-summary {
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.layout-fine-summary::-webkit-details-marker { display: none; }
.layout-fine-summary::before {
  content: '▸ ';
  font-size: 9px;
}
details[open].layout-fine-tune .layout-fine-summary::before {
  content: '▾ ';
}

.fade-in { animation: fadeIn .4s cubic-bezier(.22,.61,.36,1) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* staggered card entrance (applied to grids of cards if desired) */
@keyframes cardRise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--skel-1);
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--skel-2), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-card { height: 118px; }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center; padding: 56px 20px; color: var(--muted);
}
.empty-state i { font-size: 40px; color: var(--accent); opacity: .8; margin-bottom: 14px; display: block; }

/* ---------- Accounting table ---------- */
.acct-table { width: 100%; min-width: 1020px; border-collapse: separate; border-spacing: 0; }
.acct-table thead th {
  background: var(--card2); padding: 12px 14px; text-align: left; font-family: 'Oswald', sans-serif;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid var(--border); position: sticky; top: 0; z-index: 1;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.acct-table thead th:first-child { border-radius: 10px 0 0 0; }
.acct-table thead th:last-child { border-radius: 0 10px 0 0; }
.acct-table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle;
  transition: background .15s;
}
.acct-table tbody tr { transition: background .15s; }
.acct-table tbody tr:hover { background: var(--accent-soft); }

.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), box-shadow .25s, border-color .2s;
  animation: cardRise .45s cubic-bezier(.22,.61,.36,1) both;
}
.stat-card.stat-grand {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.stat-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), transparent);
  opacity: .8;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 90px; height: 90px;
  border-radius: 0 14px 0 90px; opacity: 0.07;
  background: var(--accent);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border2); }
.stat-card.stat-grand::before { opacity: 1; }
.stat-card.stat-grand::after { background: var(--accent); opacity: .12; }
.stat-card.gold::after { background: var(--vip); }
.stat-card.green::after { background: var(--regular); }
.stat-card.blue::after { background: var(--outdoor); }
.stat-card.purple::after { background: var(--wc-purple); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

/* ---------- Branded QR (dark artifact, both themes) ---------- */
.qr-card {
  background: #000; border: 1.5px solid var(--accent); border-radius: 16px;
  overflow: hidden; width: 210px; margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.25), 0 10px 30px rgba(0,0,0,0.5);
}
.qr-card-top {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  padding: 7px 10px;
}
.qr-card-top img { height: 13px; width: auto; display: block; background: #fff; padding: 3px 6px; border-radius: 4px; }
.qr-card-top span {
  font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 2px;
  color: rgba(255,255,255,0.85); text-transform: uppercase; font-weight: 600;
}
.qr-frame {
  position: relative; background: #fff; padding: 14px; display: flex; align-items: center; justify-content: center;
}
.qr-frame img, .qr-frame canvas { display: block; }
.qr-frame::before, .qr-frame::after {
  content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none;
}
.qr-frame::before { top: 8px; left: 8px; border-top: 2.5px solid var(--accent); border-left: 2.5px solid var(--accent); }
.qr-frame::after  { bottom: 8px; right: 8px; border-bottom: 2.5px solid var(--accent); border-right: 2.5px solid var(--accent); }
.qr-card-foot {
  text-align: center; font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 2px;
  color: #9ca3af; padding: 6px; background: #000; text-transform: uppercase;
}

/* ---------- Match status badge ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: 'Oswald', sans-serif;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.status-badge.live { background: var(--accent); color: #fff; }
.status-badge.upcoming { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-soft); }
.status-badge.ended { background: var(--card2); color: var(--muted); border: 1px solid var(--border); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.live .status-dot { background: #fff; animation: livePulse 1.2s infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.match-card.is-ended { opacity: 0.7; }
.match-card.is-live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-accent); }

/* header logo — shown on a white chip so the red mark reads on any theme */
.brand-logo { height: 24px; width: auto; display: block; background: #fff; padding: 5px 9px; border-radius: 8px; box-shadow: var(--shadow-sm); }

/* ---------- Country flag badges ----------
   Sizing contract: callers set --fb-h (chip height). Width follows from a
   fixed 4:3 box, so every flag on the page shares one aspect ratio and one
   baseline, and nothing can overflow its row. See flagBadge() in js/flags.js.
   --fb-scale lets small screens shrink every flag at once (see media query). */
.flag-badge {
  --fb-scale: 1;
  height: calc(var(--fb-h, 34px) * var(--fb-scale));
  width: calc(var(--fb-h, 34px) * var(--fb-scale) * 4 / 3);
  flex: 0 0 auto;                 /* never squeezed by a long team name */
  border-radius: calc(var(--fb-h, 34px) * 0.18);
  overflow: hidden;
  background: var(--card2);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;         /* sits on the text baseline, not above it */
  line-height: 1;
  position: relative;
}
/* Hairline over the image so pale flags (Japan, Poland) don't bleed into the card */
.flag-badge::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}
.flag-badge img {
  width: 100%; height: 100%;
  object-fit: cover;              /* 3:2 -> 4:3 trims ~11%, flag stays readable */
  display: block;
}
.flag-badge--gold {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(239, 68, 68, 0.45);
}
/* Image failed to load: fall back to the country code, scaled to fit the chip */
.flag-badge.flag-fail {
  font-family: 'Oswald', sans-serif; font-weight: 700; color: #fff;
  font-size: calc(var(--fb-h, 34px) * var(--fb-scale) * 0.34);
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  border-color: var(--hairline);
}
.flag-badge.flag-fail::after { box-shadow: none; }

/* ---------- Live Arena clock ---------- */
.arena-clock {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 13px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent-soft);
  position: relative; overflow: hidden; user-select: none;
}
.arena-clock::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent3));
}
.arena-clock .ac-face {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px;
  line-height: 1; letter-spacing: 1px; color: var(--fg);
  font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline;
}
.arena-clock .ac-colon {
  color: var(--accent); margin: 0 1px; animation: clkBlink 1s steps(1) infinite;
}
@keyframes clkBlink { 50% { opacity: 0.25; } }
.arena-clock .ac-sec {
  font-size: 12px; color: var(--accent); margin-left: 4px; font-weight: 600;
  align-self: flex-start; padding-top: 1px;
}
.arena-clock .ac-meta { display: flex; flex-direction: column; line-height: 1.15; }
.arena-clock .ac-zone {
  font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.arena-clock .ac-date {
  font-size: 9px; letter-spacing: .5px; color: var(--muted); text-transform: uppercase;
}
@media (max-width: 640px) {
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --header-h: 52px;
    --nav-h: 42px;
  }
  .arena-clock .ac-meta { display: none; }
  .arena-clock { padding: 5px 11px; gap: 0; }
  .arena-clock .ac-face { font-size: 17px; }
  .header-inner { padding-left: 12px !important; padding-right: 12px !important; gap: 8px !important; }
  .header-actions { gap: 6px !important; }
  #fbStatus .fb-label { display: none; }
  #fbStatus { padding: 6px 8px !important; min-width: 0; }
  .brand-logo { height: 22px; padding: 4px 7px; }
  main.app-main { padding-left: 14px !important; padding-right: 14px !important; }
  .seat.vip { width: 30px; height: 30px; }
  .seat.regular { width: 38px; height: 28px; }
  .seat.outdoor { width: 30px; height: 30px; border-radius: 5px 5px 3px 3px; }
  .seat.vip .seat-num, .seat.outdoor .seat-num { font-size: 11px; }
  .seat.regular .seat-num { font-size: 12px; }
  .seat-rowlabel { width: 16px; font-size: 10px; }
  .section-label { font-size: 11px; letter-spacing: 1px; }
  .tab-btn { padding: 10px 14px; font-size: 12px; }
  .tab-btn i { margin-right: 0 !important; }
  .tab-btn .tab-label { display: none; }
  .selected-match-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .selected-match-bar .btn-ghost { width: 100%; text-align: center; }
  .verify-row { flex-direction: column; }
  .verify-row .btn-primary { width: 100%; }
  .acct-actions .btn-ghost { flex: 1 1 calc(50% - 4px); justify-content: center; text-align: center; }
}
@media (min-width: 641px) and (max-width: 768px) {
  .seat.vip { width: 30px; height: 30px; }
  .seat.regular { width: 38px; height: 28px; }
  .seat.outdoor { width: 30px; height: 30px; border-radius: 5px 5px 3px 3px; }
  .seat.vip .seat-num, .seat.outdoor .seat-num { font-size: 11px; }
  .seat.regular .seat-num { font-size: 12px; }
  .seat-rowlabel { width: 16px; font-size: 10px; }
  .section-label { font-size: 11px; letter-spacing: 1px; }
  .tab-btn { padding: 10px 14px; font-size: 12px; }
}

/* ---------- Accessibility: respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .particle { display: none !important; }
}

/* ---------- Print: accounting report ---------- */
@media print {
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
  .stat-card { border-color: #ddd; background: #f9f9f9; box-shadow: none; }
  .stat-card::before, .stat-card::after { display: none; }
  .acct-table thead th { background: #eee; color: #333; border-color: #ccc; }
  .acct-table tbody td { border-color: #eee; color: #333; }
}

/* ---------- Print: clean single QR ticket ---------- */
.ticket-print { display: none; }

@page { margin: 0; size: auto; }

@media print {
  body.printing-ticket { background: #fff !important; }
  body.printing-ticket > .relative.z-10,
  body.printing-ticket .bg-atmo,
  body.printing-ticket .bg-noise,
  body.printing-ticket #particles,
  body.printing-ticket #toast { display: none !important; }
  body.printing-ticket .modal-overlay {
    position: static !important; background: none !important; backdrop-filter: none !important;
    display: block !important; padding: 0 !important; overflow: visible !important;
  }
  body.printing-ticket .ticket-card {
    max-width: 420px !important; max-height: none !important; margin: 0 auto !important;
    box-shadow: none !important; border: none !important; background: #fff !important; animation: none !important;
    overflow: visible !important; color: #000 !important;
  }
  body.printing-ticket .ticket-card-scroll,
  body.printing-ticket .ticket-card .no-print { display: none !important; }
  body.printing-ticket .ticket-print { display: block !important; }
}

.ticket-print { color: #000; text-align: center; padding: 6px 4px; }
.ticket-print .tp-logo { height: 30px; width: auto; margin: 0 auto 16px; display: block; }
.ticket-print .qr-card { border-color: #000; box-shadow: none; margin-bottom: 18px; }
.ticket-print .qr-card-top { background: #000; }
.ticket-print .qr-card-foot { background: #000; color: #bbb; }
.ticket-print .tp-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1.5px solid #000; border-radius: 10px; overflow: hidden; max-width: 360px; margin: 0 auto;
}
.ticket-print .tp-cell { padding: 10px 12px; text-align: left; border-bottom: 1px solid #ddd; }
.ticket-print .tp-cell.full { grid-column: 1 / -1; }
.ticket-print .tp-cell:nth-child(odd) { border-right: 1px solid #ddd; }
.ticket-print .tp-cell .tp-k { font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: #666; }
.ticket-print .tp-cell .tp-v { font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; color: #000; margin-top: 2px; word-break: break-word; }

/* ============================================================
   SIGN IN  (js/auth.js)
   Replaces the old PIN splash. Mobile-first: the box is a full-bleed
   card under 420px and a floating panel above it.
   ============================================================ */
.auth-lock {
  position: fixed; inset: 0; z-index: 2000;
  height: 100dvh;   /* cover the FULL mobile viewport, even as the URL bar hides */
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(239,68,68,0.16), transparent 60%),
    linear-gradient(160deg, #0b0d12 0%, #12151d 55%, #0b0d12 100%);
  transition: opacity .3s ease;
  overscroll-behavior: contain;
}
.auth-lock.auth-unlock { opacity: 0; pointer-events: none; }

/* While the login is up, fully lock the page behind it (mobile scrolls <html>,
   not <body>, so body{overflow:hidden} alone isn't enough). */
html.auth-open, html.auth-open body {
  overflow: hidden !important;
  height: 100%;
  overscroll-behavior: none;
}

.auth-box {
  width: 100%; max-width: 380px;
  background: rgba(22, 25, 33, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 30px 26px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  text-align: center;
  animation: authIn .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.auth-box.shake { animation: authShake .42s; }
@keyframes authShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.auth-logo {
  height: 38px; width: auto; object-fit: contain;
  margin: 0 auto 14px; display: inline-block;
  background: #fff; padding: 10px 15px; border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.auth-title {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 25px; letter-spacing: 4px; color: #fff; line-height: 1;
}
.auth-sub { color: #9aa0ac; font-size: 12.5px; margin-top: 5px; }

.auth-box form { text-align: left; margin-top: 22px; }
.auth-submit { width: 100%; margin-top: 18px; padding: 13px; border-radius: 12px; }

.auth-error {
  color: #fca5a5; font-size: 12px; min-height: 16px; margin-top: 10px;
  opacity: 0; transition: opacity .15s; text-align: center;
}
.auth-error.show { opacity: 1; }

.auth-hint {
  color: #6b7280; font-size: 10.5px; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.07);
  line-height: 1.5;
}

/* ---------- Shared form field furniture (login + approval modal) ---------- */
.field-label {
  display: block; font-size: 10px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
  font-weight: 600;
}
.auth-box .field-label { color: #9aa0ac; }
/* Hide the browser's OWN password-reveal / clear controls (Edge & some
   Chromium builds add a native "eye"). Without this you get two eyes on the
   login and PIN fields — one native, one ours. We keep only our own button. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }

.field-wrap { position: relative; }
.field-wrap .field { padding-right: 44px; }
.field-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: none;
  color: var(--muted); cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.field-eye:hover { color: var(--fg); background: var(--card2); }

/* ============================================================
   Header user chip
   ============================================================ */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card2);
  max-width: 190px;
}
.user-chip-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 13px;
  color: #fff;
}
.user-chip-avatar.role-admin   { background: linear-gradient(135deg, #f59e0b, #b45309); }
.user-chip-avatar.role-cashier { background: linear-gradient(135deg, var(--accent), var(--accent3)); }
.user-chip-avatar.role-viewer  { background: linear-gradient(135deg, #6366f1, #4338ca); }
.user-chip-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-chip-name {
  font-size: 12px; font-weight: 700; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip-role { font-size: 9px; letter-spacing: .6px; text-transform: uppercase; }
.user-chip-role.role-admin   { color: #fbbf24; }
.user-chip-role.role-cashier { color: var(--accent); }
.user-chip-role.role-viewer  { color: #818cf8; }

/* ============================================================
   Permissions
   ============================================================ */
.perm-hidden { display: none !important; }

.read-only-banner {
  /* Hidden for EVERYONE by default. It is shown only when the authoritative
     role class body.is-viewer is present (set in js/auth.js). This means a
     cashier or admin can never see it, even if a stale "hidden" class is
     ever left on the element. */
  display: none; align-items: center; gap: 10px;
  padding: 9px 18px; font-size: 12px;
  background: rgba(99, 102, 241, 0.12);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}
body.is-viewer .read-only-banner { display: flex; }
.read-only-banner.hidden { display: none !important; }
.read-only-banner i { flex: 0 0 auto; }
.read-only-banner strong { color: #c7d2fe; }

/* ============================================================
   Admin approval modal (js/auth.js)
   ============================================================ */
.approval-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: authIn .2s ease;
}
.approval-box {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.approval-head { text-align: center; margin-bottom: 20px; }
.approval-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 20px;
}
.approval-title {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 17px; letter-spacing: 2px; color: var(--fg);
}
.approval-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.approval-actions { display: flex; gap: 10px; margin-top: 18px; }
.approval-actions button { flex: 1; padding: 11px; border-radius: 10px; justify-content: center; }

/* ============================================================
   DASHBOARD + REPORTS
   ============================================================ */

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
.kpi {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--border2); }
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-color, var(--accent));
}
.kpi-icon {
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: color-mix(in srgb, var(--kpi-color, var(--accent)) 16%, transparent);
  color: var(--kpi-color, var(--accent));
}
.kpi-label {
  font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.kpi-value {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 22px; line-height: 1.15; margin-top: 3px; color: var(--fg);
  word-break: break-word;
}
.kpi-sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.kpi-accent { --kpi-color: var(--accent); }
.kpi-green  { --kpi-color: #22c55e; }
.kpi-purple { --kpi-color: var(--wc-purple, #a78bfa); }
.kpi-blue   { --kpi-color: #38bdf8; }
.kpi-red    { --kpi-color: #ef4444; }
.kpi-amber  { --kpi-color: #f59e0b; }

/* ---------- Panels ---------- */
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } }

.dash-panel { padding: 0; overflow: hidden; }
.dash-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  background: var(--card2); flex-wrap: wrap;
}
.dash-panel-head h3 {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--fg);
}
.dash-panel-sub { font-size: 10.5px; color: var(--muted); }
.dash-panel-body { padding: 14px 16px; }
.dash-panel-body.p-0 { padding: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Performance rows + bars ---------- */
.perf-row { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.perf-row:last-child { border-bottom: 0; }
.perf-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.perf-name {
  font-weight: 700; font-size: 13px; color: var(--fg);
  display: flex; align-items: center; gap: 7px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.perf-rank {
  width: 17px; height: 17px; border-radius: 5px; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent);
  font-size: 9.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.perf-value {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 13.5px; color: var(--fg); white-space: nowrap; flex: 0 0 auto;
}
.perf-meta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px;
  font-size: 10.5px; color: var(--muted);
}
.perf-meta i { margin-right: 4px; opacity: .7; }
.perf-warn { color: #f87171; }

.mini-bar {
  display: block; height: 5px; border-radius: 99px; margin-top: 7px;
  background: var(--card2); overflow: hidden;
}
.mini-bar-fill {
  display: block; height: 100%; border-radius: 99px;
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Recent activity ---------- */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 16px; border-bottom: 1px solid var(--hairline);
}
.recent-item:last-child { border-bottom: 0; }
.recent-icon {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: var(--card2); color: var(--muted);
}
.recent-body { flex: 1; min-width: 0; }
.recent-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.recent-title { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.recent-amt { font-family: 'Oswald', sans-serif; font-size: 12.5px; white-space: nowrap; }
.recent-sub {
  display: flex; gap: 9px; flex-wrap: wrap; margin-top: 3px;
  font-size: 10.5px; color: var(--muted);
}

/* ---------- Badges + chips ---------- */
.cashier-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 6px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--border);
  font-size: 10.5px; font-weight: 600; color: var(--fg); white-space: nowrap;
}
.cashier-badge-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
}

.action-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap;
  background: var(--card2); color: var(--muted);
}
.action-sale       { background: rgba(34, 197, 94, 0.16);  color: #4ade80; }
.action-free_issue { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.action-refund     { background: rgba(239, 68, 68, 0.16);   color: #fca5a5; }
.action-move       { background: rgba(245, 158, 11, 0.16);  color: #fcd34d; }
.action-checkin    { background: rgba(56, 189, 248, 0.16);  color: #7dd3fc; }
.action-reprint,
.action-print,
.action-print_all  { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
/* Same palette drives the round icon in the recent-activity list */
.recent-icon.action-sale       { color: #4ade80; }
.recent-icon.action-free_issue { color: #c4b5fd; }
.recent-icon.action-refund     { color: #fca5a5; }
.recent-icon.action-move       { color: #fcd34d; }
.recent-icon.action-checkin    { color: #7dd3fc; }

.pay-chip {
  display: inline-block; padding: 2px 7px; border-radius: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
}
.pay-paid     { background: rgba(34, 197, 94, 0.16);  color: #4ade80; }
.pay-free     { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.pay-refunded { background: rgba(239, 68, 68, 0.16);   color: #fca5a5; }

.amt-pos { color: #4ade80; font-weight: 700; }
.amt-neg { color: #f87171; font-weight: 700; }

/* ---------- Report tables ---------- */
.rep-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rep-table th {
  text-align: left; padding: 10px 12px;
  font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--card2);
  position: sticky; top: 0; z-index: 1;
  white-space: nowrap;
}
.rep-table td { padding: 9px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.rep-table tbody tr:last-child td { border-bottom: 0; }
.rep-table tbody tr:hover { background: var(--card2); }
.rep-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rep-table .strong { font-family: 'Oswald', sans-serif; font-weight: 700; }
.rep-ledger { min-width: 940px; }   /* scrolls horizontally on small screens */
.rep-event { display: block; font-weight: 600; color: var(--fg); white-space: nowrap; }
.rep-event-sub { display: block; font-size: 10px; color: var(--muted); }
.rep-seats { font-size: 11px; color: var(--muted); max-width: 150px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: var(--wc-purple, #a78bfa); }
.nowrap { white-space: nowrap; }

/* ---------- Report filters ---------- */
.rep-filters { padding: 15px 16px; }
.rep-filter-row {
  display: grid; gap: 12px; margin-bottom: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .rep-filter-row { grid-template-columns: repeat(3, 1fr); } }
.rep-field { min-width: 0; }
.rep-filter-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 7px 12px !important; font-size: 11px !important; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 40px; opacity: .18; display: block; margin-bottom: 14px; }
.empty-state p { font-size: 14px; }
.empty-sub { font-size: 11.5px; opacity: .7; margin-top: 5px; }

/* ============================================================
   MOBILE  (the till runs on phones and small tablets)
   ============================================================ */
@media (max-width: 640px) {
  /* Flags scale down together — one knob, every call site */
  .flag-badge, .team-badge { --fb-scale: .82; }

  .auth-box { padding: 26px 20px 20px; border-radius: 16px; }
  .auth-title { font-size: 22px; letter-spacing: 3px; }

  /* Bigger touch targets: iOS also stops zooming on focus at >=16px */
  .field { font-size: 16px !important; padding-top: 11px; padding-bottom: 11px; }
  .auth-submit, .approval-actions button { min-height: 46px; }

  .user-chip { max-width: 132px; padding-right: 9px; }
  .user-chip-meta { display: none; }        /* avatar only — the header is tight */
  .user-chip { padding: 3px; border-radius: 50%; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 18px; }
  .kpi-icon { width: 26px; height: 26px; font-size: 11px; margin-bottom: 7px; }

  .dash-panel-head { padding: 11px 13px; }
  .dash-panel-body { padding: 11px 13px; }
  .dash-panel-body.p-0 { padding: 0; }

  .recent-item { padding: 10px 13px; }
  .recent-sub { gap: 7px; }

  .rep-filters { padding: 13px; }
  .rep-filter-foot { justify-content: stretch; }
  .rep-filter-foot .btn-ghost { width: 100%; justify-content: center; }
  .chip-row { width: 100%; }

  .read-only-banner { padding: 8px 13px; font-size: 11px; align-items: flex-start; }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Enhanced Receipt Styles — COMPACT, thermal-printer friendly
   Width is driven by --tp-width. Default 280px ≈ 74mm (fits an
   80mm roll). For a 58mm printer, set --tp-width: 180px.
   Everything is pure black on white so 1-bit thermal heads
   reproduce it cleanly.
   ============================================================ */
:root { --tp-width: 280px; }

.tp-receipt {
  font-family: 'Oswald', sans-serif; color: #000;
  width: var(--tp-width); max-width: 100%; margin: 0 auto;
  padding: 0; line-height: 1.25;
}

/* Header */
.tp-head { text-align: center; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid #000; }
.tp-logo { height: 34px; width: auto; display: block; margin: 0 auto 4px; }
.tp-venue { font-size: 18px; font-weight: 900; letter-spacing: 2px; line-height: 1; }
.tp-subtitle { font-size: 9px; letter-spacing: 2px; color: #000; margin-top: 2px; }
.tp-free-badge { display: inline-block; border: 1px solid #000; color: #000; font-size: 9px; font-weight: 700; letter-spacing: 2px; padding: 1px 8px; border-radius: 99px; margin-top: 4px; }

/* Teams row */
.tp-teams { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 2px; }
.tp-team { text-align: center; flex: 1; min-width: 0; }
.tp-flag { width: 38px; height: auto; display: block; margin: 0 auto 3px; border: 1px solid #000; }
.tp-flag-fallback { filter: grayscale(1) contrast(1.5); }   /* used only if dithering can't run */
.tp-code { font-size: 13px; font-weight: 900; letter-spacing: 1px; line-height: 1; }
.tp-team-name { font-size: 9px; font-weight: 600; line-height: 1.15; margin-top: 1px; overflow-wrap: anywhere; }
.tp-vs { font-size: 14px; font-weight: 900; letter-spacing: 1px; color: #000; flex-shrink: 0; }
.tp-round { text-align: center; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: #000; margin-bottom: 6px; }

/* QR */
.tp-qr-wrap { display: flex; flex-direction: column; align-items: center; margin: 6px 0; }
.tp-qr-wrap #qrPrint { line-height: 0; }
.tp-qr-cap { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; font-weight: 700; }

/* Info — single column key/value rows (much shorter than the old boxed grid) */
.tp-rows { width: 100%; border-top: 1px dashed #000; margin-top: 4px; }
.tp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #bbb; }
.tp-row .tp-k { font-size: 9px; letter-spacing: .5px; text-transform: uppercase; color: #000; white-space: nowrap; }
.tp-row .tp-v { font-size: 12px; font-weight: 700; color: #000; text-align: right; overflow-wrap: anywhere; }
.tp-row.tp-total .tp-k, .tp-row.tp-total .tp-v { font-size: 14px; font-weight: 900; }
.tp-row.tp-total { border-bottom: none; border-top: 2px solid #000; padding-top: 5px; margin-top: 2px; }
.tp-free { font-weight: 900 !important; }

/* Seat breakdown */
.tp-seat-table { margin: 6px 0 0; }
.tp-seat-table-title { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: #000; margin: 4px 0 3px; font-weight: 700; }
.tp-seat-table table { width: 100%; border-collapse: collapse; font-size: 10px; }
.tp-seat-table th { text-align: left; padding: 2px 3px; border-bottom: 1px solid #000; font-size: 8px; letter-spacing: .5px; text-transform: uppercase; }
.tp-seat-table td { padding: 2px 3px; border-bottom: 1px dashed #bbb; }

/* Footer */
.tp-footer { border-top: 1px dashed #000; margin-top: 8px; padding-top: 6px; font-size: 9px; color: #000; text-align: center; letter-spacing: .3px; }
.tp-footer p { margin: 0; }

/* In actual print: tighten margins and force flags/QR to render at full ink */
@media print {
  body.printing-ticket .ticket-card { max-width: var(--tp-width) !important; }
  body.printing-ticket .ticket-print { padding: 0 !important; }
  .tp-flag, .tp-flag-mono { image-rendering: pixelated; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   Color Config UI (in-app, not print)
   ============================================================ */
#colorConfigPanel .color-swatch-active {
  border: 2px solid #fff !important;
  transform: scale(1.15) !important;
  box-shadow: 0 0 0 2px var(--accent) !important;
}

/* Manager PIN Modal animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Print All Seats — progress overlay
   ============================================================ */
.pa-overlay{position:fixed;inset:0;z-index:120;display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.6);backdrop-filter:blur(4px);padding:16px;}
.pa-overlay.active{display:flex;}
.pa-card{width:100%;max-width:440px;background:var(--card);border:1px solid var(--border);
  border-radius:18px;padding:20px;box-shadow:0 24px 60px rgba(0,0,0,.45);}
.pa-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;}
.pa-title{font-family:'Oswald',sans-serif;font-weight:700;letter-spacing:1px;font-size:15px;}
.pa-x{background:none;border:none;color:var(--muted);font-size:26px;line-height:1;cursor:pointer;}
.pa-x:disabled{opacity:.3;cursor:not-allowed;}
.pa-sub{font-size:11px;color:var(--muted);margin-bottom:12px;}
.pa-sub.pa-warn{color:#f59e0b;}
.pa-barwrap{height:8px;border-radius:99px;background:var(--bg2);overflow:hidden;margin-bottom:8px;}
.pa-bar{height:100%;width:0;border-radius:99px;background:linear-gradient(90deg,var(--accent),var(--accent2));
  transition:width .25s ease;}
.pa-stats{font-size:12px;color:var(--muted);margin-bottom:10px;}
.pa-stats span{font-weight:700;color:var(--fg);font-family:'Oswald',sans-serif;}
.pa-current{font-size:13px;margin-bottom:10px;min-height:20px;}
.pa-ok{color:#22c55e;font-weight:700;}
.pa-fail{color:#ef4444;font-weight:700;}
.pa-log{max-height:160px;overflow:auto;font-family:ui-monospace,monospace;font-size:11.5px;
  background:var(--bg2);border-radius:10px;padding:8px 10px;}
.pa-line{padding:1px 0;color:var(--muted);}
.pa-line.pa-ok{color:#22c55e;}
.pa-line.pa-fail{color:#ef4444;}
.pa-line.pa-retry{color:#f59e0b;}
.pa-foot{display:flex;gap:8px;margin-top:14px;}
.pa-foot:empty{display:none;}
.pa-btn{flex:1;padding:10px;border-radius:10px;border:1px solid var(--border);background:transparent;
  color:var(--fg);font-size:13px;cursor:pointer;font-family:'Oswald',sans-serif;letter-spacing:.5px;}
.pa-btn-accent{background:linear-gradient(135deg,var(--accent),var(--accent2));border:none;color:#fff;font-weight:700;}

/* ============================================================
   Seat colour redesign + Move/Refund UI  (added by update)
   Green = available · Red = taken · seat numbers always visible.
   Shapes (round VIP / rectangular bench / outdoor) are kept.
   This block is intentionally last so it overrides the base rules.
   ============================================================ */

/* Seat numbers stay visible and legible on the saturated fills */
.seat .seat-num { color: #ffffff !important; text-shadow: 0 1px 1px rgba(0,0,0,0.35); }

/* AVAILABLE — green (all sections) */
.seat.vip,
.seat.regular,
.seat.outdoor {
  background: #159a52;
  border-color: #23c06d;
}
.seat.vip:hover:not(.sold):not(.selected),
.seat.regular:hover:not(.sold):not(.selected),
.seat.outdoor:hover:not(.sold):not(.selected) {
  border-color: #34d17f;
  box-shadow: 0 0 14px rgba(34,197,94,0.55);
}

/* SELECTED — brighter green + white ring (keeps the ✓ corner badge) */
.seat.selected.vip,
.seat.selected.regular,
.seat.selected.outdoor {
  background: #22c55e;
  border-color: #ffffff;
  box-shadow: 0 0 18px rgba(34,197,94,0.7);
}
.seat.selected.vip .seat-num,
.seat.selected.regular .seat-num,
.seat.selected.outdoor .seat-num { color: #ffffff !important; }

/* TAKEN — solid red, seat number kept (no ✕ overlay so the number shows) */
.seat.sold {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: not-allowed;
}
.seat.sold .seat-num { display: inline !important; color: #ffffff !important; }
.seat.sold::after { display: none !important; content: none !important; }
.seat.sold:hover { transform: none; box-shadow: 0 0 0 1px #b91c1c; }

/* ---------- Move pick-source: guide the operator to a sold seat ---------- */
body.move-pick-source .seat:not(.sold) { opacity: .35 !important; }
body.move-pick-source .seat.selected { opacity: .35; }
body.move-pick-source .seat.sold {
  cursor: pointer !important;
  animation: seatPulseSold 1.15s ease-in-out infinite;
}
body.move-pick-source .seat.sold.move-source-selected {
  animation: none;
  opacity: 1 !important;
  outline: 3px solid #fcd34d;
  outline-offset: 1px;
  box-shadow: 0 0 16px rgba(252,211,77,0.65);
}
body.move-mode .seat.move-dest-picked {
  outline: 3px solid #22c55e;
  outline-offset: 1px;
  animation: none;
  opacity: 1 !important;
  cursor: pointer !important;
}
@keyframes seatPulseSold {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.0); }
  50%     { box-shadow: 0 0 0 4px rgba(245,158,11,0.55); }
}

/* ---------- Refund pick-source: select sold seats to refund ---------- */
body.refund-pick-source .seat:not(.sold) { opacity: .35 !important; }
body.refund-pick-source .seat.selected { opacity: .35; }
body.refund-pick-source .seat.sold {
  cursor: pointer !important;
  animation: seatPulseRefund 1.15s ease-in-out infinite;
}
body.refund-pick-source .seat.sold.refund-source-selected {
  animation: none;
  opacity: 1 !important;
  outline: 3px solid #f87171;
  outline-offset: 1px;
  box-shadow: 0 0 16px rgba(248,113,113,0.65);
}
@keyframes seatPulseRefund {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.0); }
  50%     { box-shadow: 0 0 0 4px rgba(239,68,68,0.5); }
}
.refund-banner { border-color: rgba(239,68,68,0.45); background: rgba(69,10,10,0.92); }

/* ---------- Move mode: guide the operator to a green seat ---------- */
body.move-mode .seat.sold { opacity: .3 !important; }
body.move-mode .seat.selected { opacity: .3; }
body.move-mode .seat:not(.sold):not(.selected) {
  animation: seatPulse 1.15s ease-in-out infinite;
}
@keyframes seatPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.0); }
  50%     { box-shadow: 0 0 0 4px rgba(34,197,94,0.45); }
}

/* Move banner (fixed, top-centre) */
.move-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 190; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1206; font-weight: 600; font-size: 14px;
  padding: 11px 16px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); max-width: 92vw;
  animation: fadeInUp .2s ease;
}
.move-banner b { font-weight: 800; }
.move-banner button {
  background: rgba(0,0,0,0.22); color: #fff; border: none;
  padding: 6px 12px; border-radius: 9px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.move-banner button:hover { background: rgba(0,0,0,0.35); }
.move-banner .move-banner-confirm {
  background: #1a1206 !important; color: #fcd34d !important; font-weight: 800;
}

/* Move / refund confirm dialog (manage.js) — must sit above the move banner (190) */
.mgmt-dialog-overlay {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,0.88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.mgmt-dialog-panel {
  width: 100%; max-width: 26rem; max-height: min(90vh, 640px);
  overflow-y: auto; background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.55); animation: fadeInUp .2s ease;
}
.mgmt-dialog-actions { display: flex; gap: 8px; margin-top: 20px; }
.mgmt-dialog-actions .mgmt-dialog-cancel {
  flex: 1; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer;
}
.mgmt-dialog-actions .mgmt-dialog-cancel:hover { color: var(--fg); border-color: var(--accent); }
.mgmt-dialog-actions .mgmt-dialog-confirm {
  flex: 1; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  font-weight: 700; color: #fff; border: none; cursor: pointer;
}

/* ---------- Move / Refund confirm dialogs ---------- */
.mgmt-move-row { display: flex; align-items: stretch; gap: 10px; }
.mgmt-move-cell {
  flex: 1; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 10px; text-align: center;
}
.mgmt-move-arrow { display: flex; align-items: center; color: var(--muted); }
.mgmt-cap { font-size: 9px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.mgmt-seat { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px; margin-top: 2px; }
.mgmt-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.mgmt-delta {
  margin-top: 14px; padding: 11px 12px; border-radius: 12px;
  text-align: center; font-size: 14px; font-weight: 600;
}
.mgmt-delta.collect  { background: rgba(245,158,11,0.14);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.35); }
.mgmt-delta.refund   { background: rgba(239,68,68,0.14);   color: #f87171; border: 1px solid rgba(239,68,68,0.35); }
.mgmt-delta.neutral  { background: var(--bg2);             color: var(--muted); border: 1px solid var(--border); }
.mgmt-delta b { font-weight: 800; }

.mgmt-refund-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; text-align: center;
}
.mgmt-seat-list { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px; margin: 4px 0 8px; }
.mgmt-refund-amount { font-size: 14px; }
.mgmt-refund-amount b { font-weight: 800; }

/* Section colour swatch inside the move dialog */
.mgmt-swatch { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:var(--muted); }
.mgmt-swatch-dot { width:11px; height:11px; border-radius:50%; border:1px solid rgba(0,0,0,0.25); display:inline-block; }
