:root {
  --brand: #423baa; --brand-2: #2568b0; --ink: #232122; --muted: #5d5a5b; --line: #d9d9e3;
  --bg: #f5f6fb; --card: #fff; --ok: #166b45; --ok-bg: #e4f5ec; --err: #b3193a; --err-bg: #fde8ec; --info-bg: #eef0fe;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); }
h1 { font-size: 1.7rem; margin: 1.5rem 0 1rem; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.wrap { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }
.top { background: var(--brand); color: #fff; }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; }
.brand span { font-weight: 400; opacity: .8; margin-left: 6px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: .92rem; }
.top nav a, .top nav .link { color: #fff; }
.foot { padding: 24px 16px 40px; color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin: 0 0 16px; }
.narrow { max-width: 460px; }
.muted { color: var(--muted); font-size: .92rem; }
.msg { padding: 12px 16px; border-radius: 8px; margin: 16px 0; background: var(--info-bg); }
.msg-ok { background: var(--ok-bg); color: var(--ok); }
.msg-err { background: var(--err-bg); color: var(--err); }
.types { display: grid; gap: 10px; margin: 0 0 16px; }
.type { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.type:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.type-off { opacity: .6; }
.type-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.type small { color: var(--muted); }
.price { font-weight: 700; font-size: 1.1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sold { color: var(--err); }
.summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.field { margin: 0 0 14px; }
.field.short { max-width: 260px; }
label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
label.check { display: inline-flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 1rem; margin-right: 18px; }
label.check input { margin-top: 5px; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit; background: #fff; border: 1px solid #a9a9bb; border-radius: 7px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #9d97ee; outline-offset: 1px; }
input.code { font-size: 1.5rem; letter-spacing: .3em; max-width: 220px; font-variant-numeric: tabular-nums; }
.has-err input:not([type=radio]):not([type=checkbox]), .has-err textarea { border-color: var(--err); }
.err { color: var(--err); font-size: .9rem; margin: 4px 0 0; }
.row, .row3 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: 1fr 1fr 1fr; } }
fieldset.att { border: 0; border-top: 1px solid var(--line); padding: 12px 0 0; margin: 0; }
fieldset.att legend { font-weight: 700; font-size: .85rem; color: var(--muted); padding: 0 8px 0 0; }
.btn { display: inline-block; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 7px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #352f8f; }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-ghost:hover { background: var(--info-bg); }
.btn-danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-2); text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }
.dl { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0 0 8px; overflow-wrap: anywhere; }
@media (min-width: 560px) { .dl { grid-template-columns: 190px 1fr; } .dl dd { margin: 0 0 6px; } }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #e6e6ee; color: #3c3a4a; white-space: nowrap; }
.st-paid { background: var(--ok-bg); color: var(--ok); }
.st-awaiting_transfer, .st-awaiting_card { background: #fff1d1; color: #7a5200; }
.st-expired, .st-cancelled, .st-refunded { background: var(--err-bg); color: var(--err); }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .82rem; color: var(--muted); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.off td { color: #8a8a96; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.filters input[name=q] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.spacer { flex: 1; }
.cols { display: grid; gap: 0 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; } }
input.copy { min-width: 220px; font-size: .82rem; padding: 5px 8px; }
.qr { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 12px 0; }
.qr img { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; }
.qr p { flex: 1 1 260px; margin: 0; }
.credit { margin: 10px 0 0; font-size: .8rem; }
.credit a { color: inherit; }
[hidden] { display: none !important; }
