/* Ticketsystem – dunkles, schlichtes Design */
:root {
  --accent: #e8b33c;
  --bg: #0e0f12;
  --surface: #16181d;
  --surface-2: #1c1f25;
  --line: #2a2e36;
  --text: #e9eaed;
  --muted: #9298a3;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --bad: #ef5d5d;
  --info: #5b9cf5;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* Formulare */
label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 .3rem; }
input, select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .7rem; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: .9rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; color: var(--text); font-size: .92rem; margin-bottom: .6rem; }
.check input { margin-top: .25rem; }
.grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 0 1rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #3a3f49; text-decoration: none; }
.btn.primary { background: var(--accent); color: #111317; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.block { width: 100%; padding: .8rem 1rem; font-size: 1rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Karten, Tabellen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-weight: 550; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.dim td { opacity: .5; }
table.t .r, .r { text-align: right; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }

.badge { display: inline-block; padding: .12rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.b-paid, .b-valid, .b-published, .b-active { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.b-pending, .b-draft, .b-partially_refunded { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.b-failed, .b-cancelled, .b-void, .b-struck, .b-expired { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.b-refunded, .b-closed { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); }
.flash-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.flash-err { border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: #ffb4b4; }
.flash-warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .k { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 1.55rem; font-weight: 700; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: .82rem; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: .5rem; }
.bars > div { flex: 1; background: color-mix(in srgb, var(--accent) 75%, transparent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars > div:hover { background: var(--accent); }
.bars-x { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: .3rem; }

/* Admin-Layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: linear-gradient(to right, #0b0c0f 229px, var(--line) 229px, var(--line) 230px, var(--bg) 230px); }
.side { background: #0b0c0f; border-right: 1px solid var(--line); padding: 1.2rem .9rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { display: block; padding: .2rem .5rem 1.2rem; }
.logo { max-height: 38px; max-width: 170px; }
.logo-text { font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.01em; }
.side nav a { display: block; color: var(--muted); padding: .55rem .7rem; border-radius: 8px; margin-bottom: 2px; font-weight: 500; }
.side nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.side nav a.on { color: var(--text); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; font-size: .82rem; color: var(--muted); padding: .7rem; border-top: 1px solid var(--line); }
.side-foot .who { color: var(--text); font-weight: 600; margin-bottom: .3rem; }
.side-foot .who small { display: block; font-weight: 400; }
.main { padding: 1.6rem 2rem 3rem; min-width: 0; max-width: 1280px; }
.topbar h1 { font-size: 1.5rem; margin-bottom: 1.1rem; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tabs a { padding: .55rem .85rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a.ext { margin-left: auto; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .7rem; }
  .side .brand { padding: 0 .5rem 0 0; }
  .side nav { display: flex; flex-wrap: wrap; gap: 2px; width: 100%; order: 3; }
  .side nav a { padding: .4rem .6rem; font-size: .9rem; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .side-foot .who { display: none; }
  .main { padding: 1.1rem 1rem 3rem; }
}

/* Login */
.center-box { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.center-box .brand { text-align: center; margin-bottom: 1.4rem; }

/* Shop */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.shop-head { border-bottom: 1px solid var(--line); background: #0b0c0f; }
.shop-head .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.shop-head .slogan { color: var(--muted); font-size: .85rem; }
.shop-main { padding: 2rem 16px 3rem; min-height: 70vh; }
.shop-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 1.4rem 0; }
.shop-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.shop-foot .links a { color: var(--muted); margin-left: 1rem; }
.hero { margin-bottom: 1.6rem; }
.hero .kicker { color: var(--accent); font-weight: 650; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: .3rem 0 .4rem; }
.hero .meta { color: var(--muted); display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; }
.event-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.event-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; color: var(--text); transition: border-color .15s; }
.event-card:hover { border-color: var(--accent); text-decoration: none; }
.event-card .date { color: var(--accent); font-weight: 650; font-size: .85rem; }
.event-card h2 { margin: .35rem 0 .3rem; font-size: 1.25rem; }
.event-card .from { margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.shop-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.4rem; align-items: start; }
@media (max-width: 860px) { .shop-grid { grid-template-columns: 1fr; } }
.cat { margin-bottom: 1.4rem; }
.cat-head { display: flex; align-items: baseline; gap: .7rem; margin-bottom: .6rem; }
.cat-head h2 { margin: 0; }
.prod { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .6rem; }
.prod .info { flex: 1; min-width: 0; }
.prod .name { font-weight: 650; }
.prod .desc { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.prod .price { font-weight: 700; white-space: nowrap; text-align: right; }
.prod .price s { color: var(--muted); font-weight: 400; font-size: .85rem; display: block; }
.prod .tag { font-size: .75rem; color: var(--warn); margin-top: .2rem; }
.prod.off { opacity: .55; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { background: var(--surface-2); color: var(--text); border: 0; width: 34px; height: 36px; font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: #262a31; }
.qty input { width: 42px; border: 0; border-radius: 0; text-align: center; padding: .4rem 0; background: var(--bg); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.summary { position: sticky; top: 1rem; }
.sum-line { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-size: .93rem; }
.sum-line.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .7rem; }
.sum-line.disc { color: var(--ok); }
.pay-opt { display: flex; gap: .7rem; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; margin-bottom: .5rem; cursor: pointer; color: var(--text); font-size: .95rem; }
.pay-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.doc-list a { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; color: var(--text); }
.doc-list a:hover { border-color: var(--accent); text-decoration: none; }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); padding: 1rem 1.1rem; border-radius: 8px; margin-bottom: 1rem; }

/* Check-in */
body.scan { background: #000; min-height: 100vh; }
html:has(body.scan) { background: #000; }
.scan-wrap { max-width: 560px; margin: 0 auto; padding: 12px 12px 40px; }
.scan-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.scan-top select { width: auto; flex: 1; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #111; min-height: 260px; border: 1px solid var(--line); }
#reader video { border-radius: 12px; }
.result { margin-top: .8rem; border-radius: 12px; padding: 1.1rem 1.2rem; display: none; border: 1px solid var(--line); }
.result.show { display: block; }
.result.ok { background: #0f3d26; border-color: #1f7a4b; }
.result.warn { background: #4a3708; border-color: #9a7414; }
.result.bad { background: #4a1414; border-color: #9a2b2b; }
.result .big { font-size: 1.7rem; font-weight: 800; }
.result .sub { opacity: .85; }
.counter { display: flex; gap: .6rem; margin: .7rem 0; }
.counter .stat { flex: 1; padding: .6rem .8rem; }
.counter .stat .v { font-size: 1.2rem; }
.search-results .row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .2rem; border-bottom: 1px solid var(--line); }

/* Hilfsklassen */
.mt0 { margin-top: 0; } .mt1 { margin-top: 1rem; } .mb0 { margin-bottom: 0; } .mb1 { margin-bottom: 1rem; }
.flex { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
details summary { cursor: pointer; color: var(--accent); margin: .4rem 0; }
.log { font-size: .87rem; }
.log li { padding: .4rem 0; border-bottom: 1px solid var(--line); list-style: none; }
.log ul { padding: 0; margin: 0; }
.empty { color: var(--muted); padding: 1.4rem; text-align: center; }

/* Datumsauswahl */
:root { color-scheme: dark; }
.dp { position: relative; }
.dp-field { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; font: inherit; text-align: left; cursor: pointer; min-height: 2.65rem; }
.dp-field:hover { border-color: #3a3f49; }
.dp-field:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.dp-field.empty span:first-child { color: var(--muted); }
.dp-ico { color: var(--accent); display: inline-flex; flex: none; }
.dp-pop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; width: 300px; max-width: calc(100vw - 32px); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: .8rem; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.dp-nav { background: transparent; border: 0; color: var(--text); font-size: 1.4rem; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }
.dp-nav:hover { background: var(--surface); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; color: var(--muted); font-size: .75rem; padding: .2rem 0; }
.dp-day { background: transparent; border: 0; color: var(--text); height: 36px; border-radius: 8px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--surface); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dp-day.on { background: var(--accent); color: #111317; font-weight: 700; }
.dp-time { display: flex; align-items: center; gap: .4rem; margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.dp-time label { margin: 0 auto 0 0; }
.dp-time select { width: auto; padding: .35rem .5rem; }
.dp-foot { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .7rem; }

/* Einlass-App */
[hidden] { display: none !important; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; max-width: 536px; margin: 0 auto;
  display: flex; align-items: center; gap: .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .8rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.install-ico img { display: block; border-radius: 10px; }
.install-txt { flex: 1; min-width: 0; display: grid; font-size: .88rem; color: var(--muted); }
.install-txt strong { color: var(--text); font-size: .95rem; }
.install-txt b { color: var(--text); }
.install-x { background: transparent; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
html.app-mode body.scan .scan-wrap { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
html.app-mode body.scan .center-box { margin-top: calc(8vh + env(safe-area-inset-top, 0px)); }
