/* Sale Console app prototype — component layer on top of the PL tokens.
   Every colour is a DS token or an alpha of one, so light and dark both work. */

@font-face { font-family: 'Inter'; src: url('/fonts/inter-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-bold.woff2') format('woff2'); font-weight: 600 800; font-display: swap; }

:root {
  /* Aliases (tokens.md two-layer block) */
  --bg:      var(--bg-secondary);
  --bg2:     var(--bg-default);
  --bg3:     var(--bg-hover);
  --bg4:     var(--bg-wash);
  --border:  var(--bg-border);
  --border2: var(--bg-border-hover);
  --text:    var(--content-primary);
  --text2:   var(--content-secondary);
  --text3:   var(--content-secondary);
  --muted:   var(--content-highlight);

  /* Purple has two jobs: a fill under white text (same in both themes)
     and an ink for text/icons (lighter on dark for contrast). */
  --primary-fill: var(--poodle-primary);
  --primary:      light-dark(#7E05E8, #B169F1);
  --primary-bg:   light-dark(rgba(126,5,232,0.08), rgba(177,105,241,0.14));
  --primary-bg2:  light-dark(rgba(126,5,232,0.04), rgba(177,105,241,0.07));
  --primary-line: light-dark(rgba(126,5,232,0.28), rgba(177,105,241,0.40));

  --green:     var(--accent-success);
  --green-ink: var(--accent-success-ink);
  --green-bg:  light-dark(rgba(48,187,71,0.10), rgba(48,187,71,0.16));
  --red:       var(--accent-alert);
  --red-ink:   light-dark(#A63F46, var(--accent-alert));   /* DS: lightest passing red ink on white */
  --red-bg:    light-dark(rgba(249,54,67,0.08), rgba(249,54,67,0.16));
  --amber:     var(--accent-warning);
  --amber-ink: light-dark(#815D37, var(--accent-warning)); /* DS: lightest passing amber ink on white */
  --amber-bg:  light-dark(rgba(255,131,0,0.10), rgba(255,131,0,0.16));
  --blue:      light-dark(#1A56FF, #B169F1);                /* link-base; poodle-40 on dark */
  --blue-bg:   var(--primary-bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.4;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* ── Stage: phone frame on desktop, full screen on a phone ───────────────── */
.stage { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 40px; padding: 28px 24px; }
.phone {
  position: relative; width: 390px; height: 844px; flex: none;
  background: var(--bg); border-radius: 48px; overflow: hidden;
  border: 10px solid var(--aussie-100);
  box-shadow: 0 0 0 1px var(--border2), var(--shadow-lg);
  display: flex; flex-direction: column;
}
.statusbar {
  height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px 0 30px; font-size: 14px; font-weight: 700; background: var(--bg2);
}
.statusbar .sb-right { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.net-dot.off { background: var(--red); }
.net-dot.slow { background: var(--amber); }

.panel { width: 360px; max-height: 844px; overflow: auto; flex: none; }
.panel h1 { font-family: var(--font-accent); font-size: 28px; line-height: 1.1; margin: 14px 0 8px; }
.panel p { color: var(--text2); margin: 0 0 12px; font-size: 14px; }
.panel .p-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-base); padding: 14px 16px; margin-bottom: 12px; }
.panel .p-card h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); }
.panel .jump { display: flex; flex-wrap: wrap; gap: 6px; }
.panel .jump button { border: 1px solid var(--border); background: var(--bg3); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--text); }
.panel .jump button:hover { border-color: var(--primary); color: var(--primary); }
.panel ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.panel li { margin-bottom: 4px; }
.panel .logo-row { display: flex; align-items: center; justify-content: space-between; }

@media (max-width: 860px) { .panel { display: none; } }
@media (max-width: 500px) {
  .stage { padding: 0; display: block; height: 100%; }
  .phone { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .statusbar { display: none; }
}

/* ── Logo swaps with theme ─────────────────────────────────────────────── */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: inline; }

/* ── App chrome ────────────────────────────────────────────────────────── */
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.topbar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 56px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.topbar .t-title { flex: 1; min-width: 0; }
.topbar h2 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .t-sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg2); display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text);
}
.icon-btn:hover { border-color: var(--border2); }
.icon-btn svg { width: 20px; height: 20px; }
[dir="rtl"] .flip svg { transform: scaleX(-1); }

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 14px 24px; -webkit-overflow-scrolling: touch; }
.screen-in { animation: slideIn .18s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.tabbar {
  flex: none; display: grid; grid-template-columns: repeat(var(--tabs, 5), 1fr);
  background: var(--bg2); border-top: 1px solid var(--border); padding: 6px 4px calc(8px + var(--safe-bottom));
}
.tabbar button {
  border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--text2); padding: 6px 0; border-radius: var(--radius-xs);
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--primary); background: var(--primary-bg); }

.actionbar {
  flex: none; background: var(--bg2); border-top: 1px solid var(--border); padding: 10px 14px calc(12px + var(--safe-bottom));
  display: flex; align-items: center; gap: 12px;
}
.actionbar .ab-sum { flex: 1; min-width: 0; }
.actionbar .ab-sum small { display: block; color: var(--text2); font-size: 12px; }
.actionbar .ab-sum strong { font-family: var(--font-accent); font-size: 22px; }

/* ── Type ──────────────────────────────────────────────────────────────── */
.h-display { font-family: var(--font-accent); font-size: 30px; line-height: 1.1; margin: 4px 0 6px; }
.h-section { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); margin: 18px 2px 8px; display: flex; justify-content: space-between; align-items: center; }
.h-section:first-child { margin-top: 2px; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
a, .link { color: var(--blue); text-decoration: none; background: none; border: 0; padding: 0; font-weight: 600; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 13px 18px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; transition: all var(--duration-base);
}
.btn-primary { background: var(--primary-fill); color: #FFFFFF; }
.btn-primary:hover { background: var(--poodle-60); }
.btn-primary:disabled { background: var(--bg3); color: var(--muted); border-color: var(--border); cursor: not-allowed; }
.btn-secondary { background: var(--bg2); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-danger { background: var(--red); color: #FFFFFF; }
.btn-danger:disabled { background: var(--bg3); color: var(--muted); border-color: var(--border); cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #FFFFFF; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards, lists ──────────────────────────────────────────────────────── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-base); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.card.tight { padding: 0; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--bg2); width: 100%; text-align: start; border-left: 0; border-right: 0; border-top: 0; color: var(--text); }
.list-row:last-child { border-bottom: 0; }
button.list-row:hover { background: var(--bg3); }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-sub { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.chev { color: var(--muted); flex: none; }
[dir="rtl"] .chev { transform: scaleX(-1); }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg3); color: var(--text2); white-space: nowrap; }
.chip.purple { background: var(--primary-bg); color: var(--primary); }
.chip.green { background: var(--green-bg); color: var(--green-ink); }
.chip.red { background: var(--red-bg); color: var(--red-ink); }
.chip.amber { background: var(--amber-bg); color: var(--amber-ink); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }

.pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { border: 1px solid var(--border); background: var(--bg2); color: var(--text2); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.active { background: var(--primary-fill); color: #FFFFFF; border-color: var(--primary-fill); }

.seg { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--text2); font-weight: 600; font-size: 13px; padding: 9px 6px; border-radius: 7px; }
.seg button:hover { background: var(--bg3); color: var(--text); }
.seg button.active { background: var(--primary-fill); color: #FFFFFF; }

.banner { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.banner.info { background: var(--primary-bg); border: 1px solid var(--primary-line); }
.banner.warn { background: var(--amber-bg); border: 1px solid var(--amber-bg); }
.banner.err  { background: var(--red-bg); border: 1px solid var(--red-bg); }
.banner.ok   { background: var(--green-bg); border: 1px solid var(--green-bg); }
.banner b { display: block; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.field label .req { color: var(--red-ink); }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-xs);
  padding: 12px 14px; font-size: 16px; color: var(--text); min-height: 48px;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: 2px solid var(--primary-line); border-color: var(--primary); }
.input.invalid { border-color: var(--red); background: var(--red-bg); }
.input.valid { border-color: var(--green); }
.err-msg { color: var(--red-ink); font-size: 12px; font-weight: 600; margin-top: 5px; }
.hint { color: var(--text2); font-size: 12px; margin-top: 5px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .tr-text { flex: 1; }
.toggle-row .tr-text div { font-weight: 600; }
.toggle-row .tr-text small { color: var(--text2); font-size: 12px; display: block; margin-top: 2px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; border: 0; border-radius: 999px; background: var(--border2); padding: 0; transition: background var(--duration-base); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: var(--shadow-sm); transition: transform var(--duration-base); }
.switch.on { background: var(--primary-fill); }
.switch.on::after { transform: translateX(20px); }
[dir="rtl"] .switch::after { left: auto; right: 3px; }
[dir="rtl"] .switch.on::after { transform: translateX(-20px); }

.code-boxes { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.code-boxes input { width: 46px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; border: 1px solid var(--border2); border-radius: var(--radius-xs); background: var(--bg2); }
.code-boxes input:focus { outline: 2px solid var(--primary-line); border-color: var(--primary); }

/* ── Events ────────────────────────────────────────────────────────────── */
.net-banner { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 9px 14px; }
.net-banner.off { background: var(--red-bg); color: var(--red-ink); }
.net-banner.slow { background: var(--amber-bg); color: var(--amber-ink); }
.net-banner.sync { background: var(--green-bg); color: var(--green-ink); }

.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--text2); }
[dir="rtl"] .search svg { left: auto; right: 14px; }
.search .input { padding-left: 44px; }
[dir="rtl"] .search .input { padding-left: 14px; padding-right: 44px; }

.ev-card { display: flex; gap: 12px; padding: 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-base); margin-bottom: 10px; box-shadow: var(--shadow-sm); align-items: center; }
.ev-card.pinned { border-color: var(--primary-line); }
.ev-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); flex: none; display: flex; align-items: flex-end; padding: 6px; color: #FFFFFF; font-family: var(--font-accent); font-size: 12px; line-height: 1; }
.ev-card .ev-main { flex: 1; min-width: 0; }
.ev-card .ev-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-card .ev-meta { font-size: 13px; color: var(--text2); margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star { background: none; border: 0; padding: 6px; color: var(--muted); }
.star.on { color: var(--amber); }
.star svg { width: 22px; height: 22px; }

.ev-hero { border-radius: var(--radius-base); padding: 16px; color: #FFFFFF; margin-bottom: 12px; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; }
.ev-hero h3 { font-family: var(--font-accent); font-size: 26px; margin: 0; line-height: 1.05; }
.ev-hero div { font-size: 13px; opacity: .92; margin-top: 4px; }

.offer { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-base); margin-bottom: 8px; }
.offer.has { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary-fill); }
[dir="rtl"] .offer.has { box-shadow: inset -4px 0 0 var(--primary-fill); }
.offer.disabled { opacity: .55; }
.offer .of-main { flex: 1; min-width: 0; }
.offer .of-name { font-weight: 700; }
.offer .of-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.offer .of-price { font-weight: 700; font-size: 15px; margin-top: 2px; color: var(--primary); }
.stepper { display: flex; align-items: center; border: 1px solid var(--border2); border-radius: var(--radius-sm); overflow: hidden; flex: none; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--bg3); font-size: 20px; font-weight: 700; color: var(--primary); }
.stepper button:disabled { color: var(--muted); cursor: not-allowed; }
.stepper span { width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.timer { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 999px; background: var(--primary-bg); color: var(--primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer.low { background: var(--red-bg); color: var(--red-ink); }
.timer svg { width: 14px; height: 14px; }

/* ── Seat map ──────────────────────────────────────────────────────────── */
.map-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-base); overflow: auto; height: 400px; position: relative; }
.map-inner { transform-origin: 0 0; padding: 16px; width: max-content; }
.stage-label { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--text2); background: var(--bg3); border-radius: 0 0 40px 40px; padding: 8px; margin: 0 30px 16px; }
.sect-name { font-size: 11px; font-weight: 700; color: var(--text2); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.seat-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.seat-row .rl { width: 18px; font-size: 11px; font-weight: 700; color: var(--text2); text-align: center; }
.seat { width: 18px; height: 18px; border-radius: 5px 5px 3px 3px; border: 0; padding: 0; }
.seat.gap { visibility: hidden; }
.seat.sold { background: var(--bg3); cursor: not-allowed; }
.seat.blocked { background: repeating-linear-gradient(45deg, var(--amber) 0 3px, var(--amber-bg) 3px 6px); }
.seat.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.seat.dim { opacity: .18; }
.row-note { font-size: 10px; font-weight: 700; color: var(--amber-ink); background: var(--amber-bg); border-radius: 4px; padding: 1px 5px; margin-left: 4px; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text2); margin: 10px 2px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.zoom-ctl { position: sticky; float: right; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; margin: 8px; }
.sel-strip { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.sel-strip .chip { padding: 6px 10px; font-size: 12px; }

/* ── Sheets & dialogs ──────────────────────────────────────────────────── */
.overlay { position: absolute; inset: 0; background: var(--bg-fade); z-index: 50; display: flex; align-items: flex-end; animation: fade .15s; }
.overlay.center { align-items: center; justify-content: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--bg2); width: 100%; border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + var(--safe-bottom)); max-height: 88%; overflow-y: auto; animation: up .2s ease-out; box-shadow: var(--shadow-lg); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border2); margin: 0 auto 12px; }
.sheet h3, .dialog h3 { margin: 0 0 6px; font-size: 19px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.dialog { background: var(--bg2); border-radius: var(--radius-lg); padding: 20px; width: 100%; box-shadow: var(--shadow-lg); animation: up .2s ease-out; }

.toast { position: absolute; left: 14px; right: 14px; top: 64px; z-index: 60; background: var(--aussie-100); color: #FFFFFF; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: down .2s ease-out; display: flex; gap: 8px; align-items: center; }
@keyframes down { from { transform: translateY(-16px); opacity: 0; } }
[data-theme="dark"] .toast { background: var(--aussie-0); color: var(--aussie-100); }

/* ── Success & payment ─────────────────────────────────────────────────── */
.ok-badge { width: 84px; height: 84px; border-radius: 50%; background: var(--green); color: #FFFFFF; display: flex; align-items: center; justify-content: center; margin: 10px auto 12px; }
.ok-badge svg { width: 44px; height: 44px; }
.ok-badge.queued { background: var(--amber); }
.big-amount { font-family: var(--font-accent); font-size: 40px; text-align: center; margin: 4px 0; font-variant-numeric: tabular-nums; }
.qr { background: #FFFFFF; padding: 12px; border-radius: var(--radius-sm); width: 184px; margin: 8px auto; border: 1px solid var(--border); }
.qr svg { display: block; width: 160px; height: 160px; }
.tap-zone { border: 2px dashed var(--primary-line); border-radius: var(--radius-lg); padding: 28px 16px; text-align: center; margin: 12px 0; background: var(--primary-bg2); }
.tap-rings { width: 110px; height: 110px; margin: 0 auto 10px; position: relative; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.tap-rings::before, .tap-rings::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary-line); animation: ring 1.8s ease-out infinite; }
.tap-rings::after { animation-delay: .9s; }
@keyframes ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }
.tap-rings svg { width: 46px; height: 46px; }
.pay-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-base); background: var(--bg2); margin-bottom: 8px; color: var(--text); }
.pay-opt.active { border-color: var(--primary); background: var(--primary-bg2); box-shadow: 0 0 0 1px var(--primary); }
.pay-opt .po-ic { width: 40px; height: 40px; border-radius: var(--radius-xs); background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.pay-opt .po-ic svg { width: 22px; height: 22px; }
.pay-opt .po-main { flex: 1; }
.pay-opt .po-main b { display: block; }
.pay-opt .po-main small { color: var(--text2); font-size: 12px; }
.change-box { background: var(--green-bg); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; margin: 8px 0 14px; }
.change-box strong { font-family: var(--font-accent); font-size: 24px; color: var(--green-ink); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text2); }
.kv span:last-child { font-weight: 600; text-align: end; }
.kv.total span { font-weight: 800; color: var(--text); font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat small { display: block; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.stat .stat-value { font-family: var(--font-accent); font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; }

.order-row.refunded .lr-title { text-decoration: line-through; color: var(--text2); }
.check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border2); background: var(--bg2); flex: none; display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.check.on { background: var(--primary-fill); border-color: var(--primary-fill); }
.check svg { width: 16px; height: 16px; }

.cam { border-radius: var(--radius-base); border: 2px dashed var(--border2); height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text2); background: var(--bg3); width: 100%; }
.cam svg { width: 36px; height: 36px; color: var(--primary); } /* the CSV file picker */

.progress { height: 8px; background: var(--primary-bg); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, #7E05E8, #9737EC); transition: width .3s; }

.csv-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.csv-table table { border-collapse: collapse; font-size: 12px; }
.csv-table th, .csv-table td { padding: 8px 12px; white-space: nowrap; border-bottom: 1px solid var(--border); text-align: start; }
.csv-table th { background: var(--bg3); color: var(--text2); font-weight: 700; border-right: 1px solid var(--border2); position: sticky; top: 0; }
.csv-table th:last-child { border-right: 0; }
.csv-table tr.bad td { background: var(--red-bg); }

.empty { text-align: center; color: var(--text2); padding: 40px 20px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.theme-toggle { width: 40px; height: 40px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--bg2); font-size: 17px; display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--border2); }
.login-logo { display: flex; justify-content: center; margin: 36px 0 8px; }
.login-logo img { height: 44px; }
.topbar .t-logo img { height: 26px; vertical-align: top; }
.pl-skip { position: absolute; left: 8px; top: 8px; z-index: 100; clip: rect(0 0 0 0); clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.pl-skip:focus { clip: auto; clip-path: none; width: auto; height: auto; padding: 8px 12px; background: var(--bg2); border-radius: var(--radius-xs); }

/* ── Fast sell ─────────────────────────────────────────────────────────── */
.fast-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.fast-tile {
  position: relative; min-height: 92px; text-align: start; border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  border-radius: var(--radius-base); padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: transform .08s, border-color var(--duration-base);
}
.fast-tile::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tile, var(--primary-fill)); }
[dir="rtl"] .fast-tile::before { left: auto; right: 0; border-radius: 4px 0 0 4px; }
.fast-tile:active { transform: scale(.97); }
.fast-tile.has { border-color: var(--primary); background: var(--primary-bg2); }
.fast-tile.held { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.fast-tile.ghost { border-style: dashed; box-shadow: none; justify-content: center; }
.fast-tile.ghost::before { display: none; }
.ft-name { font-weight: 700; font-size: 15px; line-height: 1.2; padding-inline-end: 26px; }
.ft-price { font-family: var(--font-accent); font-size: 19px; color: var(--primary); margin-top: auto; }
.ft-sub { font-size: 11px; color: var(--text2); }
.ft-key { position: absolute; bottom: 8px; right: 10px; font-size: 10px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
[dir="rtl"] .ft-key { right: auto; left: 10px; }
.count-badge { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--primary-fill); color: #FFFFFF; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0 6px; animation: pop .18s ease-out; }
[dir="rtl"] .count-badge { right: auto; left: 8px; }
@keyframes pop { from { transform: scale(.4); } }

.qs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.qs-tile {
  position: relative; text-align: start; border: 0; border-radius: var(--radius-base); padding: 10px 12px; color: #FFFFFF; background: var(--tile);
  display: flex; flex-direction: column; gap: 2px; min-height: 76px; box-shadow: var(--shadow-sm);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: transform .08s;
}
.qs-tile:active { transform: scale(.97); }
.qs-tile.held { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.qs-tile .qs-ev { font-size: 11px; opacity: .85; font-weight: 600; }
.qs-tile b { font-size: 14px; line-height: 1.2; }
.qs-tile .qs-pay { margin-top: auto; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.qs-tile .qs-pay svg { width: 14px; height: 14px; }

.stepper.big button { width: 56px; height: 56px; font-size: 26px; }
.stepper.big span { width: 56px; font-size: 22px; }
.tender-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tender { border: 1px solid var(--border2); background: var(--bg2); color: var(--text); border-radius: var(--radius-sm); min-height: 54px; font-weight: 700; font-size: 15px; }
.tender.active { background: var(--primary-fill); color: #FFFFFF; border-color: var(--primary-fill); }
.spinner.dark { border-color: var(--primary-bg); border-top-color: var(--primary); display: inline-block; vertical-align: -3px; }

.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.pay-tile { border: 1px solid var(--border); background: var(--bg2); color: var(--text); border-radius: var(--radius-sm); padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.pay-tile svg { width: 22px; height: 22px; color: var(--primary); }
.pay-tile.active { border-color: var(--primary); background: var(--primary-bg2); box-shadow: 0 0 0 1px var(--primary); }
.pay-tile:disabled { opacity: .45; cursor: not-allowed; }

.seat-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.seat { width: 22px; height: 22px; }
.seat-row .rl { width: 20px; }

/* ── Swipe rows, pull to refresh, drag ─────────────────────────────────── */
.swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); --swipe-open: -216px; }
.swipe:last-child { border-bottom: 0; }
.swipe .list-row { border-bottom: 0; }
.swipe-row { position: relative; z-index: 1; touch-action: pan-y; transition: transform .22s ease-out; }
.swipe-actions { position: absolute; top: 0; bottom: 0; right: 0; display: flex; }
[dir="rtl"] .swipe-actions { right: auto; left: 0; }
.sa { width: 72px; border: 0; color: #FFFFFF; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.sa svg { width: 18px; height: 18px; }
.sa.again { background: var(--primary-fill); }
.sa.resend { background: var(--aussie-80); }
.sa.refund { background: var(--red); }
.ptr { height: 0; position: relative; opacity: 0; display: flex; justify-content: center; }
.ptr .spinner { position: absolute; top: -34px; width: 22px; height: 22px; animation: none; }
.ptr.armed .spinner, .ptr.spinning .spinner { animation: spin .7s linear infinite; }
.scroll { touch-action: pan-y; }
.map-wrap { touch-action: pan-x pan-y; }
.drag-row { transition: transform .15s; }
.drag-row.lifted { position: relative; z-index: 5; box-shadow: var(--shadow-lg); transition: none; }
.drag-handle { color: var(--text2); cursor: grab; touch-action: none; padding: 6px 2px; display: inline-flex; }
.drag-handle svg { width: 20px; height: 20px; }
.grab-zone { margin: -10px -18px 6px; padding: 10px 0 8px; touch-action: none; cursor: grab; }
.grab-zone .grab { margin-bottom: 0; }
.kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--border2); border-bottom-width: 2px; border-radius: 5px; background: var(--bg3); font: 600 12px var(--font-mono); text-align: center; color: var(--text); }


.actionbar { gap: 8px; }
.actionbar .ab-sum strong { white-space: nowrap; font-size: 20px; }
.actionbar .ab-sum small { white-space: nowrap; }
.actionbar .btn { padding: 12px 14px; white-space: nowrap; }

/* Tiles: the whole tile adds, the − in the corner removes — both visible, both 40px+ */
.fast-tile > :not(button) { pointer-events: none; }
.ft-hit { position: absolute; inset: 0; border: 0; background: transparent; border-radius: inherit; z-index: 1; cursor: pointer; }
.ft-hit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tile-plus { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--primary-line); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.tile-qty { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; align-items: center; background: var(--primary-fill); color: #FFFFFF; border-radius: 999px; padding: 2px 10px 2px 2px; gap: 6px; pointer-events: auto; animation: pop .18s ease-out; }
.tile-qty b { font-size: 15px; min-width: 12px; text-align: center; }
.ft-minus { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--aussie-0); color: var(--poodle-primary); font-size: 22px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; }
[dir="rtl"] .tile-plus, [dir="rtl"] .tile-qty { right: auto; left: 6px; }
.basket-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.basket-row:last-child { border-bottom: 0; }
.br-main { flex: 1; min-width: 0; }
.br-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-sub { font-size: 13px; color: var(--text2); }
.br-x { width: 36px; height: 36px; color: var(--red-ink); }
.br-x svg { width: 16px; height: 16px; }
.sa.off { background: var(--aussie-40); }
/* The − badge sits inside the tile's pass-through layer: it must take taps itself. */
.fast-tile > .tile-qty, .fast-tile > .tile-qty * { pointer-events: auto; }
.tile-qty { z-index: 3; }
.ft-minus { width: 40px; height: 40px; }
.card-photo { border-radius: var(--radius-base); overflow: hidden; border: 1px solid var(--border); margin-bottom: 10px; background: var(--bg3); }
.card-photo img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.card-photo.small img { max-height: 140px; }
.btn-row > .cam { height: 120px; }
.actionbar:has(.fast-bar) { display: block; padding-top: 8px; }
.fast-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fast-bar-pay { display: flex; gap: 8px; }
.remove-all { color: var(--red-ink); border-color: var(--border2); min-height: 36px; }

/* Tile controls: adding and removing are both explicit buttons at the bottom of every tile. */
.fast-tile { min-height: 0; padding-bottom: 10px; }
.fast-tile > .tile-ctl, .fast-tile > .tile-ctl * { pointer-events: auto; }
.tile-ctl { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; }
.tile-ctl b { font-size: 18px; font-weight: 800; min-width: 24px; text-align: center; }
.ft-add { width: 100%; min-height: 40px; border-radius: var(--radius-xs); border: 1.5px solid var(--primary-line); background: var(--primary-bg); color: var(--primary); font-weight: 700; font-size: 14px; }
.ft-add:active, .ft-plus:active, .ft-minus:active { transform: scale(.95); }
.tile-ctl .ft-minus, .tile-ctl .ft-plus { width: 44px; height: 40px; border-radius: var(--radius-xs); font-size: 22px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; }
.tile-ctl .ft-minus { background: var(--bg2); color: var(--primary); border: 1.5px solid var(--primary-line); }
.tile-ctl .ft-plus { background: var(--primary-fill); color: #FFFFFF; border: 0; }
.ft-key { top: 10px; bottom: auto; }
.ft-name { padding-inline-end: 22px; }
.ft-price { margin-top: 4px; }
.btn-secondary:disabled, .icon-btn:disabled { color: var(--muted); border-color: var(--border); background: var(--bg3); cursor: not-allowed; }
.toast { pointer-events: none; } /* a message never blocks a tap on what is under it */
