/* Auth & admin pages — dark theme matching landing */

.auth-body {
  background: #0a0a0a;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(50% 50% at 20% 0%, rgba(185, 122, 42, 0.22) 0%, transparent 60%),
    radial-gradient(40% 50% at 100% 30%, rgba(42, 74, 142, 0.18) 0%, transparent 60%),
    radial-gradient(40% 50% at 50% 100%, rgba(106, 42, 142, 0.15) 0%, transparent 60%);
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.auth-body > * { position: relative; z-index: 1; }

/* Sticky header keeps its place — no overlap */
.auth-body .site-header {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, #0a0a0a 75%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.auth-body .site-header .brand { color: #f5f5f4; }
.auth-body .site-header .brand .dot { color: rgba(255,255,255,0.4); }
.auth-body .lang { background: rgba(255,255,255,0.06); }
.auth-body .lang a { color: rgba(255,255,255,0.55); }
.auth-body .lang a.active { background: rgba(255,255,255,0.95); color: #0a0a0a; }
.auth-body .btn-link { color: rgba(255,255,255,0.85); }
.auth-body .btn.btn-sm.btn-primary { background: linear-gradient(180deg, #ffe7c2 0%, #f0c878 100%); color: #1a0e00; border-color: transparent; }
.auth-body .muted { color: rgba(255,255,255,0.55) !important; }

/* Default container — fluid full screen */
.auth-body main.container {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 3.5rem) clamp(1rem, 4vw, 4rem) 5rem;
}
.auth-body main.container.narrow {
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Heading & content above the form card */
.auth-body h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  margin: 16px 0 10px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #c6c6c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-body main.container > p {
  text-align: center;
  margin: 0 0 8px;
}

/* The form card itself */
.auth-body .form {
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.035) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 2rem 4rem -1rem rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  margin: 1.5rem 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.auth-body .form label {
  gap: 0.5rem;
}
.auth-body .form label > span {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

/* Input fields — dark theme, white text */
.auth-body .form input,
.auth-body .form select,
.auth-body .form textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ffffff;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  min-height: 3.25rem;
  font-size: 1rem;
  font-weight: 500;
  color-scheme: dark;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background 150ms var(--ease);
}
.auth-body .form input::placeholder,
.auth-body .form textarea::placeholder {
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}
.auth-body .form input:focus,
.auth-body .form select:focus,
.auth-body .form textarea:focus {
  border-color: rgba(255,231,194,0.7);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 0.25rem rgba(255,231,194,0.18);
  outline: none;
}
.auth-body .form select option,
.auth-body .form option {
  background: #18181b;
  color: #f5f5f4;
}
.auth-body .form input[type="color"] {
  padding: 0.25rem;
  height: 3rem;
  cursor: pointer;
}
.auth-body .form input[type="file"] {
  padding: 0.75rem 1rem;
  cursor: pointer;
  color-scheme: dark;
}
.auth-body .form input[type="file"]::file-selector-button {
  background: rgba(255,231,194,0.16);
  color: #ffe7c2;
  border: 1px solid rgba(255,231,194,0.3);
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  margin-right: 0.875rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-body .form input[type="file"]::file-selector-button:hover {
  background: rgba(255,231,194,0.24);
}
.auth-body .form label small {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.25rem;
}
.auth-body .form input::placeholder { color: rgba(255,255,255,0.35); }
.auth-body .form input:focus,
.auth-body .form select:focus,
.auth-body .form textarea:focus {
  border-color: rgba(255,231,194,0.6);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 4px rgba(255,231,194,0.12);
  outline: none;
}
.auth-body .form label small {
  color: rgba(255,255,255,0.45);
  font-size: 0.8rem;
}

.auth-body .btn-primary {
  background: linear-gradient(180deg, #ffe7c2 0%, #f0c878 100%);
  color: #1a0e00;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(240,200,120,0.25), inset 0 1px 0 rgba(255,255,255,0.7);
  min-height: 54px;
  font-size: 1.02rem;
}
.auth-body .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(240,200,120,0.35), inset 0 1px 0 rgba(255,255,255,0.7);
}

.auth-body .alert-error {
  background: rgba(176,0,32,0.15);
  color: #ff9aa6;
  border-color: rgba(176,0,32,0.4);
}
.auth-body .alert-ok {
  background: rgba(10,122,62,0.18);
  color: #6ee7a3;
  border-color: rgba(10,122,62,0.4);
}

.auth-body main.container a:not(.btn) { color: #ffe7c2; }
.auth-body main.container a:not(.btn):hover { opacity: 0.8; }

.auth-body .spread {
  width: 100%;
  margin-top: 4px;
  font-size: 0.9rem;
}

/* Badge above title */
.auth-body .badge.success {
  background: rgba(10,122,62,0.18);
  color: #6ee7a3;
  border: 1px solid rgba(10,122,62,0.35);
}
.auth-body .badge.warn {
  background: rgba(255,231,194,0.16);
  color: #ffe7c2;
  border: 1px solid rgba(255,231,194,0.3);
}
.auth-body .badge {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  TEMPLATE EDITOR                                                  ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.tpl-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  margin: 16px 0 18px;
  flex-wrap: wrap;
}
.tpl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 980px) {
  .tpl-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}
@media (min-width: 1280px) {
  .tpl-grid { grid-template-columns: 1.6fr 460px; }
}

.tpl-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
}
.tpl-section h3 {
  margin: 0 0 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255,231,194,0.85);
  font-weight: 700;
}
.tpl-fieldgroup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (min-width: 580px) { .tpl-fieldgroup { grid-template-columns: 1fr 1fr; } }

.tpl-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tpl-field:last-child { margin-bottom: 0; }
.tpl-field > span {
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: var(--tracking-tight);
}
.tpl-field small {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}

.color-pair {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.375rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.75rem;
}
.color-pair input[type="color"] {
  width: 3.25rem; height: 2.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  min-height: 0;
  cursor: pointer;
}
.color-pair__value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Brand banner — shows shared colors with a quick link */
.brand-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(255,231,194,0.08) 0%, rgba(255,231,194,0.02) 100%);
  border: 1px solid rgba(255,231,194,0.25);
  border-radius: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.brand-banner > div:nth-child(2) { flex: 1; min-width: 180px; }
.brand-banner strong { color: #f5f5f4; font-weight: 700; font-size: 0.95rem; }
.brand-banner .muted { color: rgba(255,255,255,0.55); }
.brand-banner__dots { display: flex; gap: 6px; }
.brand-banner__dots span {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Save + push button row */
.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 8px;
}
.form-actions__primary { flex: 2; min-width: 200px; }
.form-actions__push { flex: 1; min-width: 180px; }

/* Live push status banner */
.push-status {
  display: flex; align-items: center; gap: 14px;
  margin: 12px 0;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(255,231,194,0.16) 0%, rgba(255,231,194,0.05) 100%);
  border: 1px solid rgba(255,231,194,0.3);
  border-radius: 14px;
  color: #ffe7c2;
}
.push-status--done {
  background: linear-gradient(180deg, rgba(10,122,62,0.18) 0%, rgba(10,122,62,0.05) 100%);
  border-color: rgba(10,122,62,0.4);
  color: #6ee7a3;
}
.push-status__spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,231,194,0.2);
  border-top-color: #ffe7c2;
  animation: push-spin 800ms linear infinite;
  flex-shrink: 0;
}
.push-status--done .push-status__spinner {
  border: 0;
  background: #6ee7a3;
  animation: none;
  position: relative;
}
.push-status--done .push-status__spinner::before {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #0a0a0a;
  font-weight: 900;
  font-size: 0.85rem;
}
.push-status__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.push-status__body strong { font-weight: 700; font-size: 0.95rem; }
.push-status__body .muted { color: rgba(255,231,194,0.7) !important; }
.push-status--done .push-status__body .muted { color: rgba(110,231,163,0.75) !important; }
@keyframes push-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Toast — non-blocking success notice that fades out */
.toast {
  background: linear-gradient(180deg, rgba(10,122,62,0.22) 0%, rgba(10,122,62,0.10) 100%);
  border: 1px solid rgba(10,122,62,0.4);
  color: #6ee7a3;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.92rem;
  animation: toast-in 220ms var(--ease);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.toast strong { font-weight: 700; }
.toast .muted { color: rgba(110,231,163,0.7) !important; }
.toast--out { opacity: 0; transform: translateY(-6px); }
.toast--err {
  background: linear-gradient(180deg, rgba(176,0,32,0.22) 0%, rgba(176,0,32,0.10) 100%);
  border-color: rgba(176,0,32,0.4);
  color: #ff9aa6;
}
.toast--err .muted { color: rgba(255,154,166,0.7) !important; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Color packs ─────────────────────────────────────────────────── */
.color-packs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.color-pack {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 6px;
  cursor: pointer;
  font: inherit;
  display: flex; flex-direction: column; align-items: stretch;
  gap: 6px;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.color-pack:hover { transform: translateY(-2px); }
.color-pack.is-active {
  border-color: rgba(255,231,194,0.6);
  background: rgba(255,231,194,0.06);
}
.color-pack__swatch {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  padding: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
}
.color-pack__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(255,255,255,0.3);
}
.color-pack__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-align: center;
}
.color-pack.is-active .color-pack__name { color: #ffe7c2; }

.tpl-advanced {
  margin-top: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 4px 12px;
}
.tpl-advanced > summary {
  cursor: pointer;
  padding: 10px 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  list-style: none;
  user-select: none;
}
.tpl-advanced > summary::after { content: " ▾"; opacity: 0.5; }
.tpl-advanced[open] > summary::after { content: " ▴"; }

/* Reward tier rows */
.tier-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: stretch;
}
@media (max-width: 720px) {
  .tier-row { grid-template-columns: 110px 1fr auto; }
  .tier-row .tier-row__txt:last-of-type { grid-column: 2 / span 2; }
}
.tier-row__at {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,231,194,0.12);
  border: 1px solid rgba(255,231,194,0.25);
  border-radius: 10px;
  padding: 0 10px;
}
.tier-row__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,231,194,0.85);
  letter-spacing: 0.04em;
}
.tier-row__at input {
  width: 60px; min-height: 0; height: 38px; padding: 6px 4px !important;
  background: transparent !important;
  border: 0 !important;
  color: #ffe7c2 !important;
  font-weight: 700;
}
.tier-row__txt {
  min-height: 40px; padding: 8px 12px !important;
}
.tier-row__del {
  width: 38px; height: 38px;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border-radius: 10px;
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  align-self: center;
}
.tier-row__del:hover { background: rgba(176,0,32,0.18); color: #ff9aa6; }

/* Quick pick row */
.quick-pick {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.quick-pick__btn {
  padding: 0.45rem 0.85rem;
  border-radius: 0.6rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
  font-variant-numeric: tabular-nums;
}
.quick-pick__btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.quick-pick__btn.is-active {
  background: rgba(255,231,194,0.18);
  color: #ffe7c2;
  border-color: rgba(255,231,194,0.4);
}

/* Segmented control (radio-styled buttons) */
.seg {
  display: inline-flex; align-items: stretch;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  transition: background 150ms var(--ease), color 150ms var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.seg label:hover { color: rgba(255,255,255,0.9); }
.seg input[type="radio"]:checked + label {
  background: rgba(255,231,194,0.16);
  color: #ffe7c2;
}

/* Card preview */
.tpl-preview-wrap { position: relative; }
.tpl-preview-sticky {
  position: sticky;
  top: 84px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 22px 18px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.tpl-preview-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(0,0,0,0.4);
  border-radius: 999px;
  width: 100%;
  margin-bottom: 18px;
}
.tpl-preview-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.tpl-preview-tab:hover { color: #fff; }
.tpl-preview-tab.is-active {
  background: rgba(255,231,194,0.18);
  color: #ffe7c2;
}
.tpl-preview-pane.hidden { display: none; }
.tpl-preview-pane {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%;
}

.tpl-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

/* ─── Logo uploader ───────────────────────────────────────────────── */
.logo-uploader {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 1rem;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
  cursor: pointer;
}
.logo-uploader:hover { border-color: rgba(255,231,194,0.4); background: rgba(255,255,255,0.06); }
.logo-uploader.is-dragover {
  border-color: #ffe7c2;
  background: rgba(255,231,194,0.08);
  border-style: solid;
}
.logo-uploader__preview {
  width: 4rem; height: 4rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.92);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: #0a0a0a;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.logo-uploader__preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-uploader__placeholder { display: inline-block; }
.logo-uploader__body { flex: 1; }
.logo-uploader__title { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.logo-uploader__hint { font-size: 0.78rem; color: rgba(255,255,255,0.5); margin-bottom: 0.5rem; }
.logo-uploader__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.logo-uploader__name { margin-top: 0.5rem; font-family: var(--font-mono); word-break: break-all; }
.btn.btn-sm { padding: 0.5rem 0.85rem; min-height: 0; font-size: 0.85rem; border-radius: 0.55rem; }

/* Background image uploader — wider aspect like Apple Wallet strip */
.bg-uploader {
  display: flex; align-items: stretch; gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 1rem;
}
.bg-uploader__preview {
  width: 140px;
  aspect-ratio: 375 / 123;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bg-uploader__preview img { width: 100%; height: 100%; object-fit: cover; }
.bg-uploader__placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  text-align: center;
}
.bg-uploader__body { flex: 1; }

/* ─── Poster preview ──────────────────────────────────────────────── */
.poster-preview {
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 105 / 148;
  background: #ffffff;
  color: #0a0a0a;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.5);
  position: relative;
}
.pp-strip {
  background: var(--pp-primary, #0a0a0a);
  color: var(--pp-label, #ffffff);
  padding: 0.85rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.pp-logo {
  width: 2.4rem; height: 2.4rem;
  background: rgba(255,255,255,0.95);
  border-radius: 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #0a0a0a;
  font-weight: 800;
  overflow: hidden;
}
.pp-logo img { width: 100%; height: 100%; object-fit: cover; }
.pp-shop__name { font-size: 0.95rem; font-weight: 700; line-height: 1.1; }
.pp-shop__sub { font-size: 0.65rem; opacity: 0.65; margin-top: 1px; font-weight: 500; }

.pp-body {
  flex: 1;
  padding: 1rem 1rem 0.5rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.4rem;
}
.pp-headline {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0a0a0a;
}
.pp-headline2 {
  font-size: 0.8rem;
  color: #6a6a6a;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.pp-qr {
  width: 60%;
  aspect-ratio: 1/1;
  background: #fff;
  padding: 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 0.4rem 1rem rgba(0,0,0,0.12);
  position: relative;
}
.pp-qr::before,
.pp-qr::after,
.pp-qr > div:after,
.pp-qr > div:before {
  /* corner ticks */
  content: ""; position: absolute;
  width: 1rem; height: 1rem;
  border: 2px solid var(--pp-primary, #0a0a0a);
}
.pp-qr::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.pp-qr::after  { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.pp-qr > div::before { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.pp-qr > div::after  { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.pp-qr .qr-pattern { width: 100%; height: 100%; border-radius: 2px; position: relative; }
.pp-cta { font-size: 0.85rem; font-weight: 700; margin-top: 0.4rem; color: #0a0a0a; }
.pp-sub { font-size: 0.7rem; color: #6a6a6a; font-weight: 500; }
.pp-footer-note { font-size: 0.7rem; color: #6a6a6a; font-weight: 600; margin-top: 0.3rem; }
.pp-foot {
  padding: 0.5rem 1rem;
  background: #f5f5f3;
  font-size: 0.6rem; letter-spacing: 0.06em;
  text-align: center;
  color: rgba(0,0,0,0.45);
  font-family: var(--font-mono);
  border-top: 1px solid rgba(0,0,0,0.05);
}
.tpl-preview-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  margin: 4px 0 0;
  max-width: 280px;
}

/* Legacy preview kept for fallback */
.tpl-card-preview {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 320 / 460;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(155deg, #0a0a0a 0%, #2a2a2a 70%, #0a0a0a 100%);
  box-shadow: 0 32px 70px -20px rgba(0,0,0,0.8), 0 12px 24px -8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex; flex-direction: column;
  overflow: hidden;
  --stamp-color: #ffe7c2;
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  APPLE WALLET FAITHFUL PREVIEW                                   ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.aw-card {
  width: 100%;
  max-width: 380px;
  background: var(--aw-bg, #0a0a0a);
  color: var(--aw-fg, #ffffff);
  border-radius: 14px;
  box-shadow: 0 32px 60px -20px rgba(0,0,0,0.8), 0 12px 24px -8px rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex; flex-direction: column;
  font-family: var(--font-sans);
  --aw-stamp: #ffe7c2;
}

/* Top — logo (left) + logoText + header field (right) */
.aw-head {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 14px 16px 10px;
  min-height: 38px;
}
.aw-head.has-logo { grid-template-columns: auto 1fr auto; }
.aw-head.no-logo  { grid-template-columns: 1fr auto; }
.aw-logo {
  height: 28px;
  max-width: 90px;
  display: inline-flex; align-items: center; justify-content: flex-start;
  overflow: visible;
}
.aw-logo img {
  height: 100%; width: auto;
  max-width: 90px;
  object-fit: contain;
  object-position: left center;
}
.aw-logotext {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aw-header-field { text-align: right; }
.aw-header-field .aw-value { font-size: 0.85rem; font-weight: 600; opacity: 0.85; }

/* Strip with the stamps row + primary field overlaid */
.aw-strip {
  position: relative;
  height: 86px;
  margin: 0;
  padding: 14px 24px;
  display: flex; flex-direction: column; justify-content: space-between;
  background-color: rgba(255,255,255,0.04);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.06) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.18);
}
.aw-strip.has-bg { background-image: var(--aw-bg-image); }
.aw-stamps-row { padding: 0 6px; }
.aw-stamps-row {
  display: grid;
  grid-template-columns: repeat(var(--aw-cols, 10), 1fr);
  gap: 4px 5px;
}
.aw-stamps-row .aw-dot {
  aspect-ratio: 1/1;
  background: rgba(255,255,255,0.18);
  border-radius: var(--aw-dot-radius, 50%);
}
.aw-stamps-row .aw-dot.on {
  background: var(--aw-stamp);
  box-shadow: 0 0 8px color-mix(in srgb, var(--aw-stamp) 60%, transparent);
}
.aw-primary {
  position: absolute;
  bottom: 8px; right: 16px;
  text-align: right;
}

.aw-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.6;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.aw-value {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.aw-primary .aw-value { font-size: 1.3rem; }

/* Secondary fields row */
.aw-secondary {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px 14px;
  gap: 16px;
}
.aw-field { min-width: 0; }

/* QR section (shown below the card or on tap in real Wallet) */
.aw-qr {
  background: #ffffff;
  color: #0a0a0a;
  padding: 14px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.aw-qr-frame {
  width: 130px; height: 130px;
  padding: 8px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}
.aw-qr-frame .qr-pattern { width: 100%; height: 100%; border-radius: 2px; }
.aw-qr-serial {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(0,0,0,0.45);
  font-weight: 600;
}
.tpc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 8px;
}
.tpc-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.95);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: #0a0a0a;
  font-weight: 800;
  font-size: 1.1rem;
}
.tpc-logo img { width: 100%; height: 100%; object-fit: cover; }
.tpc-name { font-size: 0.85rem; font-weight: 700; letter-spacing: var(--tracking-tight); }
.tpc-sub { font-size: 0.7rem; opacity: 0.6; font-weight: 500; margin-top: 2px; }

.tpc-qr-wrap {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 4px 16px;
}
.tpc-qr {
  width: 56%; aspect-ratio: 1/1;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.tpc-qr .qr-pattern { width: 100%; height: 100%; border-radius: 4px; }
.tpc-serial {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  opacity: 0.55;
  font-weight: 600;
}

.tpc-foot {
  padding: 10px 18px 16px;
  border-top: 1px dashed rgba(255,255,255,0.12);
  margin: 0 14px;
}
.tpc-foot-title {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  opacity: 0.55;
  margin: 6px 0 6px;
}
.tpc-stamps { display: grid; gap: 4px 5px; }
.tpcs {
  aspect-ratio: 1/1;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.2);
}
.tpcs.on {
  background: var(--stamp-color);
  border-color: var(--stamp-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--stamp-color) 50%, transparent);
}
/* Stamp shape variants — each shape applies a clip-path or border-radius */
.tpc-stamps--circle  .tpcs { border-radius: var(--r-full); }
.tpc-stamps--bubble  .tpcs { border-radius: 35% 65% 65% 35% / 45% 35% 65% 55%; }
.tpc-stamps--square  .tpcs { border-radius: 3px; }
.tpc-stamps--diamond  .tpcs { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); border: 0; }
.tpc-stamps--diamond  .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--hexagon  .tpcs { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%); border: 0; }
.tpc-stamps--hexagon  .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--octagon  .tpcs { clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); border: 0; }
.tpc-stamps--octagon  .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--star     .tpcs { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: 0; }
.tpc-stamps--star     .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--heart    .tpcs { clip-path: polygon(50% 100%, 100% 45%, 100% 22%, 80% 0%, 60% 0%, 50% 18%, 40% 0%, 20% 0%, 0% 22%, 0% 45%); border: 0; }
.tpc-stamps--heart    .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--drop     .tpcs { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 0; }
.tpc-stamps--drop     .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--flower   .tpcs { clip-path: polygon(50% 0%, 62% 25%, 92% 22%, 75% 50%, 92% 78%, 62% 75%, 50% 100%, 38% 75%, 8% 78%, 25% 50%, 8% 22%, 38% 25%); border: 0; }
.tpc-stamps--flower   .tpcs:not(.on) { background: rgba(255,255,255,0.2); }
.tpc-stamps--bubble   .tpcs:not(.on) { background: rgba(255,255,255,0.18); }

/* Shape preview in selector */
.seg-shapes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.4rem;
  background: transparent;
  border: 0;
  padding: 0;
}
.seg-shapes label {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.seg-shapes input[type="radio"]:checked + label {
  background: rgba(255,231,194,0.18);
  color: #ffe7c2;
  border-color: rgba(255,231,194,0.4);
}
.shape-preview {
  width: 18px; height: 18px;
  background: #ffe7c2;
  flex-shrink: 0;
  display: inline-block;
}
.shape-circle  { border-radius: 50%; }
.shape-bubble  { border-radius: 35% 65% 65% 35% / 45% 35% 65% 55%; }
.shape-square  { border-radius: 3px; }
.shape-diamond { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.shape-hexagon { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%); }
.shape-octagon { clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); }
.shape-star    { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.shape-heart   { clip-path: polygon(50% 100%, 100% 45%, 100% 22%, 80% 0%, 60% 0%, 50% 18%, 40% 0%, 20% 0%, 0% 22%, 0% 45%); }
.shape-drop    { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.shape-flower  { clip-path: polygon(50% 0%, 62% 25%, 92% 22%, 75% 50%, 92% 78%, 62% 75%, 50% 100%, 38% 75%, 8% 78%, 25% 50%, 8% 22%, 38% 25%); }

.tpc-big { font-size: 2rem; font-weight: 700; letter-spacing: var(--tracking-tighter); line-height: 1; font-variant-numeric: tabular-nums; }
.tpc-big span { font-size: 0.85rem; font-weight: 600; opacity: 0.55; letter-spacing: 0; }
.tpc-foot-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.7rem; font-weight: 600; }
.tpc-foot-meta .reward { opacity: 0.6; font-weight: 500; }

/* Tables / admin index */
.auth-body main.container:has(table) h1 { text-align: left; }
.auth-body main.container:has(table) > p { text-align: left; }

/* Data table on dark */
.auth-body .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  color: #f5f5f4;
  background: rgba(255,255,255,0.02);
}
.auth-body .data-table th {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  padding: 14px 16px;
}
.auth-body .data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.auth-body .data-table .tiny.muted { color: rgba(255,255,255,0.45); }
.auth-body .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(255,255,255,0.08);
  color: #f5f5f4;
}
.auth-body .bento .stat-num { color: #ffe7c2; }
.auth-body .user-chip {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.auth-body .user-chip .avatar {
  background: linear-gradient(135deg, #ffe7c2 0%, #f0c878 100%);
  color: #1a0e00;
}
