:root {
  --bg: #0f0d0a; --panel: #1a1712; --line: #3a3326; --text: #f3ece0; --muted: #a59a86;
  --gold: #c9a45c; --gold-2: #e2c27f; --ok: #3fb27f; --warn: #e0a83a; --bad: #e35d5d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #000; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--gold-2); letter-spacing: .3px; }
nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
nav button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font-size: 15px; cursor: pointer; }
nav button.active { color: #111; background: var(--gold); }
#who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
h2 { font-size: 20px; margin: 4px 0 12px; color: var(--gold-2); }
h3 { margin: 0 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 16px; }
.card.muted { color: var(--muted); }
.muted, small { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.err { color: var(--bad); }
.ok { color: var(--ok); }
.big { font-size: 20px; font-weight: 600; }
.hidden { display: none !important; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--gold-2); }
.btn { background: #2a251c; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; font-size: 15px; cursor: pointer; min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.btn.danger { background: transparent; color: var(--bad); border-color: #6b2b2b; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 14px; }
.btn.big { padding: 14px 22px; font-size: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { background: #0f0d0a; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 15px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 8px 6px; font-size: 13px; }
td { border-bottom: 1px solid #241f17; padding: 8px 6px; vertical-align: top; }
td select { min-width: 190px; }
tr.voided td { opacity: .5; }
td.actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; margin-left: 4px; }
.st-issued { background: #2f3b52; color: #bcd0ff; }
.st-held { background: #4a3a14; color: #ffd47a; }
.st-paid { background: #163a2b; color: #7fe0b2; }
.st-void { background: #3a2020; color: #f2a0a0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 12px; }
.ticket { display: grid; gap: 6px; margin-top: 6px; min-width: 200px; }
.printer-bar { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.green { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.red { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.tour-head { display: flex; gap: 10px; align-items: end; margin: 0 0 8px; }
.tour-head label { flex: 1; }
.tour-info { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.tour-info span:first-child { color: var(--text); font-weight: 700; }
.scan-form { display: flex; gap: 10px; margin: 0 0 16px; }
.scan { font-size: 20px; padding: 14px; }
.voucher-card dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 12px 0; }
.voucher-card dt { color: var(--muted); }
.voucher-card dd { margin: 0; }
.voucher-card .amount { font-size: 34px; font-weight: 800; color: var(--gold-2); }
.vc-head { display: flex; align-items: center; gap: 10px; }
.vc-head code { font-size: 26px; }
.vc-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 17px; color: var(--text); }
label.check input { width: 22px; height: 22px; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 0 0 14px; }
.filters label { min-width: 200px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.stat strong { font-size: 22px; color: var(--gold-2); }
.login { max-width: 380px; margin: 60px auto; display: flex; flex-direction: column; gap: 12px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--gold); border-radius: 14px; padding: 20px; max-width: 520px; width: calc(100% - 32px); }
dialog.wide { max-width: 760px; }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.radios { display: flex; flex-direction: column; gap: 8px; }
label.radio { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 16px; }
label.radio input { width: 20px; height: 20px; }
.voucher-img { width: 100%; max-width: 380px; display: block; margin: 0 auto; background: #fff; border-radius: 6px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #222; border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; max-width: min(720px, calc(100% - 32px)); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.show { opacity: 1; }
.toast.ok { border-color: var(--ok); }
.toast.error { border-color: var(--bad); color: #ffd0d0; }
@media (max-width: 720px) {
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: 0; padding: 4px 0; }
  .scan-form { flex-direction: column; }
}
.card:empty { display: none; }
.btn { justify-content: center; white-space: nowrap; }
table + .card { margin-top: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0 0 12px; }
.dlg-body .card { margin: 14px 0 0; padding: 12px; }
.st-blank { background: #2a2a2a; color: #d8d0c0; border: 1px dashed #8a7f6a; }
.vc-actions .blank-name { width: 100%; max-width: 620px; margin: 0; }
