/* =========================================================
   USER COMMON STYLES
   ========================================================= */
:root {
  --primary: #0f172a;
  --primary-2: #1e293b;
  --accent: #1e40af;
  --accent-hover: #1d4ed8;
  --text: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --surface: #f8fafc;
  --surface-raised: #ffffff;
  --gold: #b8860b;
  --gold-soft: #d4a843;
  --red: #b42318;
  --red-bg: #fff0ef;
  --green: #067647;
  --green-bg: #e9f8f0;
  --amber: #a15c00;
  --amber-bg: #fff4df;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f3f8ff 0, #fff 520px), #fff;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

.sms-slider-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .42);
}
.sms-slider-card {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
}
.sms-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px 0 22px;
  border-bottom: 1px solid #edf1f7;
}
.sms-slider-head h2 {
  color: #1f2937;
  font-size: 17px;
  font-weight: 700;
}
.sms-slider-close {
  width: 34px;
  height: 34px;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.sms-slider-close:hover { color: var(--accent); }
.sms-slider-body {
  padding: 24px 28px 28px;
}
.sms-slider-body p {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 14px;
}
.sms-slider-track {
  --sms-slider-progress: 42px;
  position: relative;
  height: 42px;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #f8fafc;
}
.sms-slider-track::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--sms-slider-progress);
  background: #dbeafe;
}
.sms-slider-track span {
  position: absolute;
  inset: 0 12px 0 54px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
  user-select: none;
}
.sms-slider-track button {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 42px;
  height: 40px;
  border-right: 1px solid #dbe3ef;
  background: #fff;
  color: var(--accent);
  cursor: grab;
  touch-action: none;
  transition: transform .08s linear, background .16s ease, color .16s ease;
}
.sms-slider-track button:active { cursor: grabbing; }
.sms-slider-track button i,
.sms-slider-track button i::before,
.sms-slider-track button i::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  transform: translateY(-50%);
}
.sms-slider-track button i { left: 13px; }
.sms-slider-track button i::before { left: 7px; }
.sms-slider-track button i::after { left: 14px; }
.sms-slider-track.is-resetting button,
.sms-slider-track.is-resetting::before {
  transition: transform .22s ease, width .22s ease;
}
.sms-slider-track.is-error {
  border-color: #fca5a5;
  background: #fff1f2;
}
.sms-slider-track.is-done {
  border-color: #86efac;
  background: #f0fdf4;
}
.sms-slider-track.is-done::before { background: #bbf7d0; }
.sms-slider-track.is-done span { color: #15803d; }
.sms-slider-track button.is-done {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { appearance: none; border: 0; background: none; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, .12);
}

.wrap {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   FORM COMPONENTS
   ========================================================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.single-form-grid {
  width: min(480px, 100%);
  grid-template-columns: 1fr;
}
.field { display: block; }
.field-note {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: .3px;
}
.required-label::before,
label:has(input[required]) > span:first-child:not(.required-label)::before,
label:has(select[required]) > span:first-child:not(.required-label)::before,
label:has(textarea[required]) > span:first-child:not(.required-label)::before {
  content: "*";
  display: inline-block;
  margin-right: 4px;
  color: #ef4444;
  font-weight: 700;
}
.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: var(--primary);
  background: #fff;
  border: 1px solid #d0dae8;
  border-radius: var(--radius);
  outline: none;
  font-size: 15px;
  transition: var(--transition), box-shadow 0.2s ease;
}
.input::placeholder { color: #94a3b8; }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, .08), 0 0 12px rgba(30, 64, 175, .05);
}
.input.input-error {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}
textarea.input {
  min-height: 92px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  line-height: 1.6;
}

.code-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.code-row .input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
}
.code-button {
  flex: 0 0 140px;
  min-width: 110px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(90deg, #0025CA, #0093CD);
  border: 1px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.code-button:hover,
.code-button:active {
  box-shadow: 0 10px 22px rgba(0, 37, 202, .20);
  transform: translateY(-1px);
}
.code-button.is-disabled,
.code-button:disabled {
  color: #94a3b8;
  background: #e2e8f0;
  border-color: #d0dae8;
  cursor: not-allowed;
}

.submit {
  width: 100%;
  height: 50px;
  margin-top: 22px;
  color: #fff;
  background: linear-gradient(90deg, #0025CA, #0093CD);
  border: 1px solid rgba(30, 64, 175, .2);
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.submit:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.minor-button {
  height: 44px;
  margin: 16px 0;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(90deg, #0025CA, #0093CD);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 15px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.minor-button:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Invoice */
.payment-invoice-form {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e1e8f2;
  border-radius: var(--radius);
  background: #f8fbff;
}
.payment-invoice-form h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--primary);
}
.invoice-radio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 16px;
  color: var(--primary);
  font-weight: 600;
}
.invoice-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}
.invoice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.invoice-grid label {
  display: grid;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
}
.invoice-grid label.wide { grid-column: 1 / -1; }

.company-autocomplete-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--primary);
  font-weight: 600;
}
.form-grid > .company-autocomplete-field { align-content: start; }
.company-autocomplete { position: relative; min-width: 0; }
.company-autocomplete .input { display: block; }
.company-autocomplete-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
.company-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 14px rgba(15, 23, 42, .12);
  font-weight: 400;
}
.company-suggestion-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.company-suggestion-option + .company-suggestion-option {
  border-top: 1px solid #eef2f7;
  border-radius: 0;
}
.company-suggestion-option:hover,
.company-suggestion-option.active { background: #eff6ff; }
.company-suggestion-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.company-suggestion-name {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.company-suggestion-meta,
.company-suggestion-tax {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.company-suggestion-tax {
  color: #475569;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}
.company-suggestion-status {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.company-suggestions-error .company-suggestion-status { color: #b91c1c; }
.company-suggestions-loading .company-suggestion-status::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: company-suggestion-spin .7s linear infinite;
}
@keyframes company-suggestion-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .company-suggestions-loading .company-suggestion-status::before { animation: none; }
}
@media (max-width: 760px) {
  .company-suggestions { max-height: min(300px, 48vh); }
  .company-suggestion-option { min-height: 64px; padding: 11px 12px; }
}

/* =========================================================
   TICKET GRID
   ========================================================= */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ticket-card {
  min-height: 132px;
  display: grid;
  grid-template-rows: minmax(24px, auto) auto minmax(20px, 1fr);
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, var(--surface));
  color: var(--text);
  text-align: left;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ticket-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.ticket-card.active {
  border-color: #1e40af;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, .08), var(--shadow);
  background: linear-gradient(180deg, #fff, rgba(30, 64, 175, .02));
}
.ticket-card-title {
  display: block;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  overflow-wrap: anywhere;
}
.ticket-card-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.ticket-card-price del {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.2;
}
.ticket-card-price strong {
  color: #1e40af;
  font-size: 24px;
  line-height: 1.2;
}
.ticket-card-discount {
  display: block;
  align-self: end;
  min-width: 0;
  color: var(--amber);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.ticket-card.sold-out,
.ticket-card:disabled {
  cursor: not-allowed;
  opacity: .58;
}

/* =========================================================
   PAYMENT METHODS
   ========================================================= */
.pay-methods {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pay-methods label {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  font-size: 14px;
}
.pay-methods label:hover {
  border-color: #c8d6e8;
  background: var(--surface);
}
.pay-methods label:has(input:checked) {
  border-color: #1e40af;
  background: rgba(30, 64, 175, .04);
  color: var(--primary);
}

/* =========================================================
   OFFLINE PAYMENT
   ========================================================= */
.offline-box {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
.voucher-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 13px;
}
.offline-payment-info {
  display: grid;
  grid-template-columns: minmax(240px, 4fr) minmax(0, 6fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}
.offline-qr {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  cursor: zoom-in;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.offline-qr:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.offline-qr img {
  width: min(220px, 100%);
  aspect-ratio: 1;
  height: auto;
  display: block;
  object-fit: contain;
}
.offline-qr span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.offline-account {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.offline-account h3 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
}
.offline-account dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}
.offline-account div { min-width: 0; }
.offline-account dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.offline-account dd {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}
.offline-account p {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* =========================================================
   VOUCHER UPLOADER
   ========================================================= */
.voucher-uploader {
  width: 100%;
  min-height: 80px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px dashed #c0cce0;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: var(--transition);
}
.voucher-uploader:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.voucher-uploader:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, .08);
}
.voucher-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.voucher-preview {
  width: 64px;
  height: 64px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.voucher-preview[hidden],
.voucher-preview img[hidden] { display: none; }
.voucher-uploader.has-file .voucher-preview { cursor: zoom-in; }
.voucher-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.voucher-icon {
  width: 40px;
  height: 40px;
  position: relative;
  display: block;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 -6px 0 rgba(30, 64, 175, .06);
}
.voucher-icon::before,
.voucher-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.voucher-icon::before {
  top: 10px;
  width: 3px;
  height: 16px;
  border-radius: 999px;
}
.voucher-icon::after {
  top: 10px;
  width: 12px;
  height: 12px;
  border-top: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
  background: transparent;
  transform: translateX(-50%) rotate(45deg);
}
.voucher-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  cursor: pointer;
}
.voucher-copy strong {
  color: var(--primary);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
}
.voucher-copy em {
  color: var(--text-muted);
  font-style: normal;
  line-height: 1.5;
  font-size: 13px;
}
.voucher-actions {
  min-width: 120px;
  display: grid;
  justify-items: end;
  gap: 6px;
}
.voucher-name {
  display: none;
}
.voucher-uploader.has-file {
  border-style: solid;
  border-color: #10a66a;
  background: #f0fdf4;
}
.voucher-uploader.has-file .voucher-preview {
  background: #dcfce7;
  box-shadow: 0 0 0 1px rgba(16, 166, 106, .2);
  border-color: #86efac;
}
.voucher-uploader.has-file .voucher-icon { display: none; }
.voucher-uploader.has-file .voucher-name {
  color: #16a34a;
  background: #dcfce7;
  border-color: #86efac;
}
.voucher-delete {
  min-height: 28px;
  min-width: 68px;
  padding: 0 10px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  color: #ef4444;
  background: #fef2f2;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: var(--transition);
}
.voucher-delete:hover {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #dc2626;
}

/* =========================================================
   DIALOG
   ========================================================= */
.dialog-backdrop,
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}
.dialog-backdrop {
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(6px);
}
.dialog-card {
  position: relative;
  width: min(400px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.dialog-close:hover {
  background: var(--border);
  color: var(--primary);
}
.dialog-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: #fff;
  background: #10a66a;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.dialog-error .dialog-icon {
  background: #e53935;
}
.dialog-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  color: var(--primary);
  font-weight: 700;
}
.dialog-card p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 14px;
}
.dialog-code {
  margin: 18px auto 0;
  padding: 12px 16px;
  color: #1e40af;
  background: rgba(30, 64, 175, .04);
  border: 1px solid rgba(30, 64, 175, .15);
  border-radius: var(--radius);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
}
.dialog-primary {
  width: 100%;
  height: 44px;
  margin-top: 20px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(30, 64, 175, .2);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s ease;
}
.dialog-primary:hover { background: var(--accent-hover); }
.dialog-error .dialog-primary {
  background: linear-gradient(90deg, #0025CA, #0093CD);
}
.dialog-error .ghost-button {
  color: #0b70d7;
  border-color: #2388ff;
  background: #fff;
}
.dialog-error .ghost-button:hover {
  background: #f4f9ff;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}
.dialog-actions:has(> :not([hidden]) ~ :not([hidden])) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dialog-actions > button,
.dialog-actions > a {
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  justify-content: center;
}

.image-viewer {
  z-index: 45;
  background: rgba(15, 23, 42, .7);
  backdrop-filter: blur(10px);
}
.image-viewer-card {
  width: min(860px, 100%);
  max-height: calc(100dvh - 48px);
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.image-viewer-card img {
  max-width: 100%;
  max-height: calc(100dvh - 96px);
  display: block;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.image-viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: rgba(0,0,0,.6);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  border: 1px solid rgba(255,255,255,.2);
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}
.image-viewer-close:hover { background: rgba(239,68,68,.8); }

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  top: 72px;
  z-index: 80;
  width: auto;
  min-width: min(320px, calc(100% - 32px));
  max-width: min(520px, calc(100% - 32px));
  padding: 11px 18px 11px 20px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.toast-error {
  color: #b42318;
  background: #fff5f5;
  border-color: #fda29b;
  border-left-color: #d92d20;
}
.toast-success {
  color: #087443;
  background: #f0fdf4;
  border-color: #86efac;
  border-left-color: #16a34a;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .invoice-grid { grid-template-columns: 1fr; }
  .offline-payment-info { grid-template-columns: 1fr; }
  .offline-account dl { grid-template-columns: 1fr; }
  .ticket-grid { grid-template-columns: 1fr; }
  .pay-methods { display: grid; gap: 8px; }
  .voucher-uploader {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: flex-start;
    padding: 12px;
  }
  .voucher-preview { width: 56px; height: 56px; }
  .voucher-icon { width: 36px; height: 36px; }
  .voucher-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-items: start;
  }
  .voucher-name {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }
  .voucher-delete { width: fit-content; }
  .dialog-card { padding: 22px 16px; }
  .image-viewer { padding: 12px; }
  .image-viewer-card {
    max-height: calc(100dvh - 24px);
    padding: 10px;
  }
  .image-viewer-card img { max-height: calc(100dvh - 56px); }
}

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

.wechat-pay-dialog { z-index: 1200; }
.wechat-pay-card { max-width: 380px; text-align: center; }
.wechat-pay-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #07c160;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.wechat-pay-qrcode {
  display: grid;
  place-items: center;
  width: 244px;
  min-height: 244px;
  margin: 18px auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.wechat-pay-qrcode img,
.wechat-pay-qrcode canvas { display: block; max-width: 220px; height: auto; }

.alipay-wechat-guide {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 92px 24px 24px;
  color: #fff;
  background: rgba(0, 0, 0, .82);
}
.alipay-wechat-guide.show { display: flex; }
.alipay-guide-close {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.14);
  font-size: 28px;
  line-height: 1;
}
.alipay-guide-arrow {
  position: fixed;
  top: 26px;
  right: 30px;
  font-size: 58px;
  font-weight: 700;
  transform: rotate(-10deg);
}
.alipay-guide-card {
  width: min(360px, 100%);
  text-align: center;
}
.alipay-guide-dots {
  margin: 0 auto 20px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111827;
  background: #fff;
  font-size: 24px;
  letter-spacing: 2px;
}
.alipay-guide-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 700;
}
.alipay-guide-card p {
  margin: 0 auto 12px;
  color: rgba(255,255,255,.88);
  font-size: 16px;
  line-height: 1.8;
}
.alipay-guide-copy {
  padding: 10px 12px;
  border: 1px dashed rgba(255,255,255,.36);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
}
.alipay-guide-copy-button {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: #fff;
  font-weight: 700;
}
