/* Grand Bazar voucher – paleta: #FFFFFF, #0BFFAE, #113A51 */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --white: #FFFFFF;
  --mint: #0BFFAE;
  --navy: #113A51;
  --line: rgba(17, 58, 81, .18);
  --muted: rgba(17, 58, 81, .68);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --ring: 0 0 0 3px var(--mint), 0 0 0 5px var(--navy);
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--sans); color: var(--navy); background: var(--white); }
[hidden] { display: none !important; }
h1, h2, p, dl, dd { margin: 0; }
code { font-family: var(--mono); font-size: .92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- Przyciski i pola ---------- */
.btn, .btn-top {
  font: 600 16px/1.2 var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 12px; cursor: pointer; text-decoration: none;
  border: 2px solid var(--navy); background: var(--white); color: var(--navy);
}
.btn:hover { background: rgba(11, 255, 174, .22); }
.btn.primary { background: var(--mint); }
.btn.primary:hover { background: #00e89b; }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn.ghost:hover { background: rgba(17, 58, 81, .06); }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 14px; border-radius: 9px; }
.btn.danger { border-color: var(--navy); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .btn-top:focus-visible, .tab:focus-visible { outline: none; box-shadow: var(--ring); }

.field { margin: 0 0 16px; }
.field label, .lbl { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=search] {
  width: 100%; font: inherit; color: var(--navy); background: var(--white);
  padding: 12px 14px; border: 2px solid var(--navy); border-radius: 12px;
}
input::placeholder { color: rgba(17, 58, 81, .45); }
input:focus { outline: none; box-shadow: var(--ring); }
.msg-err { margin-top: 12px; padding: 10px 12px; border-left: 5px solid var(--navy); background: rgba(17, 58, 81, .08); font-weight: 500; }
.hint { color: var(--muted); font-size: 15px; margin-top: 10px; }

/* ---------- Strona wystawcy i logowanie: bilet ---------- */
body.ex { background: var(--navy); color: var(--white); min-height: 100vh; }
.ex .wrap { max-width: 480px; margin: 0 auto; padding: 30px 18px 56px; }
.brand { margin-bottom: 22px; }
.brand h1 { font: 700 clamp(32px, 9vw, 40px)/1.05 var(--serif); letter-spacing: -.01em; }
.brand p { margin-top: 6px; color: rgba(255, 255, 255, .78); }

.ticket { position: relative; background: var(--white); color: var(--navy); border-radius: 20px; margin-bottom: 18px; }
.t-top { padding: 24px 22px 22px; }
.t-bottom { padding: 22px; display: grid; gap: 10px; }
.perf { position: relative; height: 0; margin: 0 20px; border-top: 2px dashed rgba(17, 58, 81, .28); }
.perf::before, .perf::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--navy);
}
.perf::before { left: -32px; }
.perf::after { right: -32px; }
.t-title { font: 700 26px/1.15 var(--serif); margin-bottom: 14px; }

.code-input {
  font: 600 clamp(26px, 8vw, 34px)/1 var(--mono) !important; letter-spacing: .26em;
  text-transform: uppercase; text-align: center; padding: 16px 4px !important; padding-left: calc(4px + .26em) !important;
}
.code-show { font: 600 clamp(26px, 8vw, 34px)/1.1 var(--mono); letter-spacing: .2em; }
.code-inline { font-family: var(--mono); font-weight: 600; letter-spacing: .1em; }
.balance { margin: 4px 0 8px; }
.amount {
  font: 700 clamp(44px, 13vw, 62px)/1.15 var(--serif); letter-spacing: -.01em;
  background: linear-gradient(transparent 58%, var(--mint) 58%); padding: 0 .1em; margin-left: -.1em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.ok-badge {
  width: 52px; height: 52px; border-radius: 50%; background: var(--mint); border: 2px solid var(--navy);
  display: grid; place-items: center; margin-bottom: 14px;
}
.receipt { display: grid; gap: 10px; }
.receipt div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.receipt dt { color: var(--muted); }
.receipt dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Skaner */
dialog#scan { border: 0; padding: 0; background: transparent; width: min(480px, 94vw); }
dialog::backdrop { background: rgba(17, 58, 81, .82); }
.scan-box { background: var(--white); color: var(--navy); border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
.scan-title { font-weight: 600; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: var(--navy); min-height: 120px; }
#reader video { width: 100% !important; }

/* ---------- Panel administratora ---------- */
.top { background: var(--navy); color: var(--white); }
.top-in { max-width: 1100px; margin: 0 auto; padding: 12px 20px 0; display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.brand-sm { font: 700 24px/1 var(--serif); padding-bottom: 14px; }
.tabs { display: flex; gap: 22px; }
.tab {
  background: none; border: 0; border-bottom: 5px solid transparent; color: rgba(255, 255, 255, .78);
  font: 600 16px/1 var(--sans); padding: 10px 2px 11px; cursor: pointer; border-radius: 4px 4px 0 0;
}
.tab:hover { color: var(--white); }
.tab[aria-selected=true] { color: var(--white); border-bottom-color: var(--mint); }
.btn-top { margin-left: auto; margin-bottom: 10px; padding: 8px 14px; background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .6); font-size: 14px; }
.btn-top:hover { background: rgba(255, 255, 255, .12); }
.btn-top:focus-visible { box-shadow: 0 0 0 3px var(--mint); }
.tab:focus-visible { box-shadow: 0 0 0 3px var(--mint); }

.page { max-width: 1100px; margin: 0 auto; padding: 26px 20px 70px; }
.panel { border: 2px solid var(--navy); border-radius: 16px; padding: 18px; margin-bottom: 26px; }
.add-form { display: grid; grid-template-columns: 150px 1fr 110px auto; gap: 0 14px; align-items: end; }
.add-form .field { margin-bottom: 0; }
.add-form .btn { height: 50px; }
.add-form .full { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .add-form { grid-template-columns: 1fr 1fr; gap: 14px; }
  .add-form .field:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .add-form .btn { grid-column: 1 / -1; order: 4; }
}

.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.h2 { font: 700 24px/1.2 var(--serif); margin-right: auto; }
.toolbar .search { margin: 0; width: min(340px, 100%); }
.table-wrap { overflow-x: auto; border: 2px solid var(--navy); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 2px solid var(--navy); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(11, 255, 174, .1); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code { font: 600 15px var(--mono); letter-spacing: .14em; }
.code.big { font-size: 28px; letter-spacing: .2em; text-align: center; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px 14px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { margin-left: 4px; }
.more { text-align: center; margin-top: 16px; }

dialog { border: 2px solid var(--navy); border-radius: 18px; padding: 0; color: var(--navy); background: var(--white); width: min(440px, 94vw); }
.dlg-box { padding: 24px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.qr-box { text-align: center; }
.qr-img { width: min(280px, 100%); margin: 8px auto 0; }
.qr-img svg { width: 100%; height: auto; display: block; }
.qr-box .dlg-actions { justify-content: center; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; max-width: 92vw;
  background: var(--navy); color: var(--white); padding: 12px 18px; border-radius: 12px; border-left: 6px solid var(--mint); font-weight: 500;
}

@media print {
  body.adm .top, body.adm .page, body.adm .toast, #dlg-qr .dlg-actions { display: none !important; }
  dialog#dlg-qr { border: 0; position: static; margin: 0 auto; width: 100%; }
  dialog#dlg-qr::backdrop { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
