/* Ciclo Dip. buy flow. Design system taken from brief.html. */

:root {
  --bg:     #0a0a0a;
  --paper:  #111111;
  --ink:    #f4e8d0;
  --muted:  #807060;
  --red:    #e83a3a;
  --blue:   #2e88d4;
  --yellow: #f5c542;
  --orange: #e88a3a;
  --edge:   #2a221c;
  --field:  #1a1410;
  --field-focus: #221a13;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

main.wide { max-width: 1000px; }

/* Document container. same doubled frame as brief.html */
.doc {
  background: var(--paper);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 48px 56px;
  margin: 24px 0;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--blue);
}

/* Cover. compressed vs brief.html */
.cover {
  text-align: center;
  padding: 8px 0 32px;
  border-bottom: 2px solid var(--red);
  margin-bottom: 24px;
}
.cover .pretitle {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--blue);
  margin: 0 0 16px;
  font-weight: 600;
}
.cover h1 {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 72px;
  margin: 0 0 12px;
  letter-spacing: 0;
  line-height: 0.95;
  color: var(--yellow);
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--red);
}
.cover .tagline {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--ink);
  font-size: 17px;
  margin: 0 auto 20px;
  max-width: 480px;
  line-height: 1.4;
}
.cover .meta {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cover .meta strong { color: var(--yellow); font-weight: 600; }

/* Compact cover for post-purchase / secondary pages */
.cover-compact {
  padding: 0 0 24px;
}
.cover-compact h1 {
  font-size: 44px;
  text-shadow: 3px 3px 0 var(--red);
  margin-bottom: 8px;
}
.cover-compact .pretitle { margin-bottom: 10px; }
.cover-compact .meta { margin: 2px 0; font-size: 12px; }

/* Sections */
.section { padding: 24px 0; border-top: 2px solid var(--red); position: relative; }
.section:first-of-type { border-top: none; padding-top: 0; }

.section .pretitle {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--red);
  margin: 0 0 8px;
  font-weight: 700;
}
.section h2 {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 38px;
  margin: 0 0 12px;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
}
.section .intro {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--ink);
  font-size: 16px;
  margin: 0 0 24px;
  opacity: 0.92;
  max-width: 480px;
}

/* Field group */
.field {
  margin-bottom: 20px;
}
.field label,
.field .label {
  display: block;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
  margin: 0 0 8px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  background: var(--field);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 16px;
  transition: border-color 0.12s, background 0.12s;
}
input[type="file"] {
  width: 100%;
  padding: 8px 0;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border: 1.5px solid var(--blue);
  background: transparent;
  color: var(--blue);
  border-radius: 3px;
  cursor: pointer;
  margin-right: 12px;
}
input[type="file"]::file-selector-button:hover { background: var(--blue); color: var(--bg); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--yellow);
  background: var(--field-focus);
}

.field input.has-error,
.field select.has-error,
.field textarea.has-error {
  border-color: var(--red);
  background: rgba(232, 58, 58, 0.06);
}
.field-msg {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--red);
  margin-top: 6px;
  min-height: 0;
  display: none;
}
.field-msg.show { display: block; }

/* Dropzone (drag & drop receipt) */
.dropzone {
  position: relative;
  border: 2px dashed var(--edge);
  border-radius: 4px;
  background: var(--field);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.dropzone:hover { border-color: var(--blue); background: var(--field-focus); }
.dropzone.dragover {
  border-color: var(--yellow);
  background: rgba(245, 197, 66, 0.06);
}
.dropzone.has-error { border-color: var(--red); }
.dropzone-inner {
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.dropzone-inner .btn-secondary { pointer-events: auto; margin-top: 10px; }
.dropzone-icon {
  font-family: 'Bowlby One', sans-serif;
  font-size: 30px;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 6px;
}
.dropzone-text {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  font-weight: 600;
}
.dropzone-sub {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.dropzone-filename {
  font-size: 14px;
  color: var(--yellow);
  word-break: break-all;
  max-width: 100%;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

/* Quantity segmented */
.qty-segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 1.5px solid var(--red);
  border-radius: 3px;
  overflow: hidden;
}
.qty-segmented button {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 22px;
  padding: 14px 0;
  border: none;
  border-right: 1.5px solid var(--red);
  background: var(--field);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.qty-segmented button:last-child { border-right: none; }
.qty-segmented button:hover:not(.active):not(:disabled) { background: var(--field-focus); color: var(--yellow); }
.qty-segmented button.active {
  background: var(--yellow);
  color: var(--bg);
}
.qty-segmented button:disabled { opacity: 0.35; cursor: not-allowed; }

.qty-segmented button .qty-deal {
  display: block;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 2px;
  line-height: 1;
}
.qty-segmented button.active .qty-deal { color: var(--bg); }

/* Code input inline */
.code-row {
  display: flex;
  gap: 8px;
}
.code-row input { flex: 1; text-transform: uppercase; }
.code-row .btn-secondary { white-space: nowrap; }

.code-feedback {
  margin-top: 8px;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  min-height: 16px;
}
.code-feedback.ok  { color: var(--yellow); }
.code-feedback.bad { color: var(--red); }

/* Total display. signature moment */
.total-block {
  margin: 28px 0;
  padding: 18px 0;
  border-top: 1.5px solid var(--edge);
  border-bottom: 1.5px solid var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}
.total-block .label {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--blue);
  margin: 0;
}
.total-block .amount {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 40px;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--red);
  line-height: 1;
}
.total-block .amount.free {
  text-shadow: 3px 3px 0 var(--blue);
}
.deal-tag {
  display: inline-block;
  margin: -12px 0 12px;
  padding: 6px 12px;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bg);
  background: var(--yellow);
  border-radius: 3px;
  box-shadow: 3px 3px 0 var(--red);
  font-weight: 700;
}

/* Summary row (step 2) */
.summary {
  border: 1.5px solid var(--edge);
  padding: 14px 18px;
  margin-bottom: 24px;
  background: rgba(46, 136, 212, 0.04);
}
.summary .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.summary .row .k {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.14em;
}
.summary .row .v {
  color: var(--ink);
  font-weight: 600;
}
.summary .row.total .v {
  color: var(--yellow);
  font-size: 18px;
}

/* Pay info. physical "receipt" feel */
.pay-info { margin-bottom: 24px; }
.pay-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--edge);
}
.pay-row:last-child { border-bottom: none; }
.pay-row .label {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.pay-row .value {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
}
.pay-row .value.plain {
  font-family: Georgia, serif;
  font-style: italic;
}
.copy-btn {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--blue); color: var(--bg); }
.copy-btn.copied {
  background: var(--yellow);
  color: var(--bg);
  border-color: var(--yellow);
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 16px 24px;
  background: var(--yellow);
  color: var(--bg);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--red);
  transition: transform 0.08s, box-shadow 0.08s;
  margin-top: 8px;
}
.btn-primary:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--red);
}
.btn-primary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--red);
}
.btn-primary:disabled {
  background: var(--edge);
  color: var(--muted);
  box-shadow: 4px 4px 0 var(--edge);
  cursor: not-allowed;
}

.btn-secondary {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 18px;
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.12s;
}
.btn-secondary:hover { background: var(--blue); color: var(--bg); }

.step-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.step-actions .btn-primary { margin-top: 0; }

/* Errors, feedback */
.error {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 13px;
  color: var(--red);
  margin-top: 12px;
  letter-spacing: 0.04em;
}

/* Callout. small warm block for status / instructions */
.callout {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  padding: 14px 18px;
  border-left: 3px solid var(--yellow);
  background: rgba(245, 197, 66, 0.05);
  margin: 20px 0;
  line-height: 1.5;
}
.callout.bad {
  border-left-color: var(--red);
  background: rgba(232, 58, 58, 0.06);
}

/* Sold out banner */
.sold-out {
  border: 2px solid var(--red);
  padding: 18px 22px;
  margin-bottom: 24px;
  text-align: center;
}
.sold-out h3 {
  font-family: 'Bowlby One', system-ui, sans-serif;
  color: var(--red);
  font-size: 26px;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.sold-out p {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--ink);
  margin: 0;
}

/* Footer */
.foot {
  text-align: center;
  padding: 32px 0 8px;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Ticket page: real QR wrapper */
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--ink);
  border-radius: 3px;
  margin: 12px 0;
  box-shadow: 4px 4px 0 var(--red);
}
.qr-wrap canvas { width: 100%; max-width: 300px; height: auto; }

/* Placeholder QR (pending): clearly a placeholder, not a real QR */
.qr-placeholder {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  margin: 16px auto;
  border: 3px dashed var(--red);
  border-radius: 3px;
  background: var(--field);
  overflow: hidden;
}
.qr-placeholder-grid {
  position: absolute;
  inset: 18px;
  background-image:
    repeating-linear-gradient(0deg,  transparent 0 12px, rgba(128,112,96,0.16) 12px 13px),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(128,112,96,0.16) 12px 13px);
}
.qr-placeholder-grid::before,
.qr-placeholder-grid::after {
  content: '';
  position: absolute;
  width: 40px; height: 40px;
  border: 6px solid var(--muted);
  opacity: 0.35;
}
.qr-placeholder-grid::before { top: 0; left: 0; }
.qr-placeholder-grid::after  { top: 0; right: 0; }
.qr-placeholder-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: radial-gradient(circle at center, rgba(26,20,16,0.92) 0%, rgba(26,20,16,0.78) 55%, transparent 100%);
}
.qr-placeholder-icon {
  width: 88px;
  height: 88px;
  color: var(--yellow);
  filter: drop-shadow(3px 3px 0 var(--red));
}
.qr-placeholder-text {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
}

/* Ticket compact info line */
.ticket-line {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
  margin: 12px 0 8px;
}
.ticket-line strong { color: var(--yellow); font-weight: 600; }
.ref-line {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 6px 0 0;
}
.ref-line .mono { color: var(--ink); }

/* Link row (share the ticket URL) */
.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--field);
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  margin-top: 12px;
}
.link-row.compact { padding: 8px 10px; margin-top: 8px; }
.link-row .value {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink);
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-row.compact .value { font-size: 11px; }
.link-row .copy-btn { padding: 6px 10px; font-size: 11px; }

/* Tight main container: less padding for compact pages (ticket) */
main.tight { padding: 8px 10px 16px; }
main.tight .doc { padding: 22px 20px; margin: 0; }
main.tight .cover-compact { padding: 0 0 14px; margin-bottom: 14px; border-bottom-width: 1.5px; }
main.tight .cover-compact h1 { font-size: 34px; margin-bottom: 4px; text-shadow: 3px 3px 0 var(--red); }
main.tight .cover-compact .pretitle { margin-bottom: 6px; letter-spacing: 0.28em; font-size: 11px; }
main.tight .qr-placeholder-real { max-width: 240px; margin: 10px auto; padding: 12px; }
main.tight .qr-wrap { padding: 14px; margin: 8px 0; }
main.tight .qr-wrap canvas { max-width: 240px; }
.badge {
  display: inline-block;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 600;
}
.badge.pending  { background: var(--edge); color: var(--yellow); border: 1px solid var(--yellow); }
.badge.verified { background: var(--yellow); color: var(--bg); }
.badge.rejected { background: rgba(232,58,58,0.15); color: var(--red); border: 1px solid var(--red); }
.badge.used     { background: var(--edge); color: var(--muted); }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ============================================================
   ADMIN DASHBOARD
   Distinct shell from buyer pages: sticky header, denser layout,
   no doc-frame, headings without drop shadow. Feels like a tool.
   ============================================================ */

body.admin-body { padding: 0; }

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 2px solid var(--red);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.admin-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.admin-brand .brand-name {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 20px;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}
.admin-brand .brand-role {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-weight: 600;
}
.admin-nav {
  display: flex;
  gap: 22px;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  flex: 1;
}
.admin-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
  font-weight: 500;
}
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.active {
  color: var(--yellow);
  border-color: var(--red);
  font-weight: 600;
}
.admin-logout {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.admin-logout:hover { color: var(--red); }

.admin-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page-header { margin-bottom: 24px; }
.page-header .eyebrow {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  margin: 0 0 4px;
}
.page-header .title {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 28px;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0;
}
.page-header .description {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
}

/* Login card for admin (dashboard-style, not doc-framed) */
.admin-login {
  max-width: 400px;
  margin: 60px auto 0;
  padding: 28px 26px;
  background: var(--paper);
  border: 1.5px solid var(--edge);
  border-radius: 4px;
}
.admin-login .eyebrow {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  margin: 0 0 4px;
}
.admin-login h2 {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 22px;
  color: var(--yellow);
  text-transform: uppercase;
  margin: 0 0 22px;
  line-height: 1;
}

/* Admin sub-section */
.admin-section { margin: 32px 0; }
.admin-section > h2 {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin: 0 0 14px;
  font-weight: 700;
}
.admin-section .section-body {
  background: var(--paper);
  border: 1.5px solid var(--edge);
  border-radius: 4px;
  padding: 20px 22px;
}
.admin-section .section-hint {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 0;
}

@media (max-width: 640px) {
  .admin-header {
    padding: 10px 14px;
    gap: 12px;
  }
  .admin-brand { flex: 1; }
  .admin-brand .brand-role { display: none; }
  .admin-nav { gap: 14px; font-size: 11px; width: 100%; order: 3; padding-top: 6px; border-top: 1px solid var(--edge); }
  .admin-logout { order: 2; }
  .admin-main { padding: 20px 14px 60px; }
  .page-header .title { font-size: 22px; }
}

/* Retained admin utilities from previous iteration */
main.wide { max-width: 900px; }

.stack { display: flex; flex-direction: column; gap: 12px; }

.top-nav {
  display: flex;
  gap: 18px;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--edge);
}
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
  transition: color 0.1s, border-color 0.1s;
}
.top-nav a:hover { color: var(--yellow); }
.top-nav a.active {
  color: var(--yellow);
  border-color: var(--red);
}
.top-nav .logout {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.top-nav .logout:hover { color: var(--red); }

/* Stats card at top of admin verification page */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--field);
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  padding: 14px 16px;
  text-align: center;
}
.stat .k {
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.stat .v {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 22px;
  color: var(--yellow);
  line-height: 1;
}
.stat.small .v { font-size: 16px; }
.stat.small { padding: 10px 12px; }
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Filter pills */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-pill {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 8px 14px;
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.1s;
}
.filter-pill:hover { color: var(--ink); border-color: var(--blue); }
.filter-pill.active {
  background: var(--yellow);
  color: var(--bg);
  border-color: var(--yellow);
  font-weight: 600;
}

/* Admin list of purchases / codes / tandas */
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1.5px solid var(--edge);
  align-items: center;
}
.admin-item:last-child { border-bottom: none; }
.admin-item img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 3px;
  border: 2px solid var(--edge);
  cursor: zoom-in;
  transition: border-color 0.1s;
}
.admin-item img:hover { border-color: var(--yellow); }
.admin-item .main { min-width: 0; }
.admin-item .main .who {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 20px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.admin-item .main .meta {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.5;
}
.admin-item .main .meta strong { color: var(--yellow); font-weight: 600; }
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Compact button variants for admin (smaller than btn-primary) */
.btn-mini {
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 14px;
  border: 1.5px solid var(--edge);
  background: transparent;
  color: var(--ink);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  transition: all 0.1s;
}
.btn-mini:hover { background: var(--edge); }
.btn-mini.good  { color: var(--yellow); border-color: var(--yellow); }
.btn-mini.good:hover  { background: var(--yellow); color: var(--bg); }
.btn-mini.bad   { color: var(--red);    border-color: var(--red); }
.btn-mini.bad:hover   { background: var(--red);    color: var(--ink); }
.btn-mini.blue  { color: var(--blue);   border-color: var(--blue); }
.btn-mini.blue:hover  { background: var(--blue);   color: var(--bg); }

/* Progress bar (used in codes/tandas) */
.progress {
  height: 6px;
  background: var(--edge);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--yellow); transition: width 0.2s; }

.mono-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink);
  background: var(--field);
  padding: 3px 7px;
  border-radius: 2px;
  border: 1px solid var(--edge);
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 15px;
}

/* Inline row for creating new tanda/code */
.new-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
.new-form .field { margin-bottom: 0; }
.new-form button { grid-column: auto; align-self: end; }

/* Row for the ticket page and small kv listings */
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--edge);
  gap: 12px;
}
.row:last-child { border-bottom: none; }
.row .k {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.row .v { color: var(--ink); font-family: Georgia, serif; font-size: 15px; }
.row .v.mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* Scanner (puerta) */
.scan-view {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 3px;
  overflow: hidden;
  border: 2px solid var(--red);
  aspect-ratio: 4 / 3;
  background: var(--field);
}
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; }

.scan-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 5;
  animation: overlay-in 0.18s ease-out;
}
.scan-overlay.show { display: flex; }
.scan-overlay.ok   { background: rgba(21, 128, 61,  0.94); color: #fff; }
.scan-overlay.warn { background: rgba(161, 98, 7,   0.94); color: #fff; }
.scan-overlay.bad  { background: rgba(185, 28, 28,  0.94); color: #fff; }
.scan-overlay-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scan-overlay-icon {
  width: 76px;
  height: 76px;
  display: block;
}
.scan-overlay-icon svg { width: 100%; height: 100%; }
.scan-overlay-title {
  font-family: 'Bowlby One', system-ui, sans-serif;
  font-size: 30px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
}
.scan-overlay-sub {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.3;
  max-width: 90%;
}
@keyframes overlay-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
  .scan-overlay-title { font-size: 24px; }
  .scan-overlay-icon  { width: 60px; height: 60px; }
}

/* Mobile */
@media (max-width: 720px) {
  main { padding: 12px 8px 40px; }
  .doc {
    padding: 24px 18px;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--blue);
  }
  .cover { padding: 0 0 24px; margin-bottom: 16px; }
  .cover h1 {
    font-size: 52px;
    text-shadow: 3px 3px 0 var(--red);
  }
  .cover .tagline { font-size: 15px; margin-bottom: 16px; }
  .section h2 { font-size: 30px; }
  .total-block .amount { font-size: 32px; }
  .btn-primary { font-size: 18px; padding: 14px 20px; box-shadow: 3px 3px 0 var(--red); }
  .qty-segmented button { font-size: 18px; padding: 12px 0; }
  .pay-row { grid-template-columns: 70px 1fr; }
  .pay-row .copy-btn { grid-column: 2; justify-self: end; margin-top: 4px; }
}

@media (max-width: 420px) {
  .doc { padding: 20px 14px; }
  .cover h1 { font-size: 42px; }
  .section h2 { font-size: 26px; }
  .total-block .amount { font-size: 28px; }
}
