body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; max-width: 1080px; margin: 0 auto; }
.topbar .right { display: flex; gap: 8px; align-items: center; }
.icon-button { position: relative; border: 1px solid var(--line); background: var(--surface); color: var(--plum); border-radius: 12px; min-width: 40px; height: 40px;
  display: inline-grid; place-items: center; cursor: pointer; font: inherit; padding: 0 10px; text-decoration: none; }
.badge { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px;
  display: grid; place-items: center; padding: 0 4px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs a { flex: 1; max-width: 140px; text-align: center; padding: 10px 4px 8px; color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 500; }
.tabs a .tab-icon { display: grid; place-items: center; width: 40px; height: 34px; margin: 0 auto 3px; border-radius: 11px; transition: background .15s, color .15s; }
.tabs a.active .tab-icon { background: var(--plum); color: #fff; }
.tabs a.active { color: var(--heading); }
.view { max-width: 1080px; margin: 0 auto; padding: 0 16px 16px; }
.view > h1 { margin-top: 4px; }
.stack > * + * { margin-top: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.tile .label { color: var(--muted); font-size: .8rem; }
.tile .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: .8rem; color: var(--muted); }
.tile.highlight { background: var(--brand); color: var(--brand-ink); }
.tile.highlight .label, .tile.highlight .sub { color: inherit; opacity: .85; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 14px; font: inherit; color: var(--ink); cursor: pointer; }
.seg button.active { background: var(--brand); color: var(--brand-ink); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item .meta { color: var(--muted); font-size: .85rem; }
.item img.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { color: var(--muted); font-weight: 500; font-size: .8rem; }
table.data td.num, table.data th.num { text-align: right; }
.scroll-x { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 72px; padding-top: 6px; }
.bars div { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bars div.zero { background: var(--line); }
.status { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.status.paid, .status.active, .status.available, .status.valid { background: var(--ok-soft); color: var(--ok); }
.status.requested, .status.pending, .status.draft, .status.paused { background: var(--warn-soft); color: var(--warn); }
.status.refunded, .status.declined, .status.suspended, .status.closed { background: var(--bad-soft); color: var(--bad); }
.code-card { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.code-card img.qr { width: 112px; height: 112px; background: #fff; border-radius: 8px; padding: 4px; }
.code-card .link { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.choice { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice a { display: block; padding: 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.choice a b { display: block; font-size: 1.15rem; margin-bottom: 4px; }
.choice a span { color: var(--muted); }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.checklist li { margin: 6px 0; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; z-index: 20; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }
dialog { border: 0; border-radius: var(--radius); padding: 18px; width: min(560px, calc(100% - 24px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
.scanner video { width: 100%; border-radius: var(--radius); background: #000; max-height: 50vh; object-fit: cover; }
.dev-code { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 10px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.hide { display: none !important; }
.icon-only { min-width: 34px; padding: 4px 8px; }
.icon-only .icon { width: 18px; height: 18px; }
.status .icon { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-left: 3px; }
a.back { display: inline-flex; align-items: center; gap: 4px; }
a.back .icon { width: 16px; height: 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs a.active .tab-icon { background: var(--violet); color: var(--plum-deep); } :root:not([data-theme="light"]) .icon-button { color: var(--ink); } }
/* Listing editor: photos, flyer and ticket types. */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.photo { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.photo.cover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo figcaption { gap: 4px; padding: 6px; justify-content: flex-start; flex-wrap: nowrap; }
.photo figcaption .button.icon-only { min-width: 30px; padding: 4px 6px; }
.photo figcaption .danger { margin-left: auto; }
.badge-cover { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 4px; background: var(--plum); color: #fff; font-size: .75rem;
  font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 999px; }
.badge-cover .icon { width: 13px; height: 13px; }
.empty-media { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 10px 0 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.empty-media .icon { width: 28px; height: 28px; flex: none; color: var(--accent); }
.empty-media p { margin: 0; }
.flyer-edit { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.flyer-thumb { width: 160px; max-height: 240px; object-fit: contain; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.flyer-edit .stack { display: flex; flex-direction: column; gap: 8px; }
.flyer-edit .stack > * + * { margin-top: 0; }
.item.ticket-type { flex-wrap: wrap; }
.item.ticket-type.inactive .title, .item.ticket-type.inactive .meta { opacity: .6; }
.item.editing { display: block; background: var(--bg); }
.row.tight { gap: 4px; }
.panel.inset { box-shadow: none; border: 1px solid var(--line); }
.panel.inset h3 { margin-top: 0; }
.type-form .form-grid.narrow-fields { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check .big-sub { font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
@media (max-width: 520px) { .item.ticket-type > .row { width: 100%; justify-content: flex-end; } }
