/* Hollys Loyalty — hoja única. Sistema en docs/DESIGN.md (tokens §2, componentes §5, movimiento §6).
   La marca entra por /marca.css (--marca-*) y se traduce aquí a --brand*. Nada de CDNs. */

@font-face {
  font-family: "Geist";
  src: url("/vendor/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/vendor/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* Marca: lo único que cambia por cliente */
  --brand:       var(--marca-primario, #1E3932);
  --brand-2:     var(--marca-secundario, #C8A253);
  --brand-ink:   var(--marca-primario-contraste, #FFFFFF);
  --brand-2-ink: var(--marca-secundario-contraste, #111111);

  --surface:    #FFFFFF;
  --brand-soft:   color-mix(in oklab, var(--brand) 10%, var(--surface));
  --brand-line:   color-mix(in oklab, var(--brand-ink) 30%, transparent);
  --brand-deep:   color-mix(in oklab, var(--brand) 86%, #000);
  --brand-2-soft: color-mix(in oklab, var(--brand-2) 18%, var(--surface));

  --canvas:     #F7F6F3;
  --canvas-2:   #FAFAFA;
  --surface-2:  #F2F1EE;
  --surface-3:  #E9E8E4;
  --ink:        #111111;
  --ink-2:      #4D4C48;
  --muted:      #787774;
  --line:       #EBEBEB;
  --line-strong:#D6D5D1;
  --primary:    #171717;
  --primary-ink:#FFFFFF;
  --primary-hover: #333333;
  --focus:      color-mix(in oklab, var(--brand) 55%, #2F6FEB);

  --ok: #1E7E3B;     --ok-soft: #EDF3EC;
  --warn: #956400;   --warn-soft: #FBF3DB;
  --danger: #C62828; --danger-soft: #FDEBEC;
  --info: #1F6C9F;   --info-soft: #E1F3FE;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-hero: clamp(2.25rem, 1.6rem + 3.2vw, 3.5rem);
  --fs-xl: 2rem; --fs-lg: 1.5rem; --fs-md: 1.0625rem; --fs-sm: .875rem; --fs-xs: .75rem;
  --lh-tight: 1.05; --lh-head: 1.15; --lh-body: 1.5;
  --track-hero: -.04em; --track-head: -.025em; --track-body: -.011em;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-24: 96px;
  --gutter: 16px; --maxw-app: 440px; --maxw-admin: 1120px;

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-card: 20px; --r-pill: 999px;

  --sh-card: 0 1px 1px rgba(0,0,0,.04), 0 8px 24px -6px rgba(0,0,0,.18), 0 24px 48px -24px rgba(0,0,0,.22);
  --sh-float: 0 0 6px rgba(0,0,0,.10), 0 8px 12px rgba(0,0,0,.08);
  --sh-sheet: 0 -8px 32px rgba(0,0,0,.12);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-press: cubic-bezier(.32, .72, 0, 1);
  --t-fast: 140ms; --t-base: 240ms; --t-slow: 480ms;
  --z-nav: 10; --z-sheet: 20; --z-toast: 30; --z-flash: 40;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas:#0E0E0D; --canvas-2:#0A0A0A; --surface:#171716; --surface-2:#1F1F1D; --surface-3:#2A2A27;
    --ink:#EDEDEC; --ink-2:#B5B4AF; --muted:#8A8984; --line:#2A2A28; --line-strong:#3A3A37;
    --primary:#EDEDEC; --primary-ink:#111111; --primary-hover:#FFFFFF;
    --ok:#6BC28A; --warn:#E0B25A; --danger:#F07A72; --info:#73B6E6;
    --ok-soft:#14261A; --warn-soft:#2A2210; --danger-soft:#2E1414; --info-soft:#10202C;
    --sh-card: 0 0 0 1px rgba(255,255,255,.06), 0 16px 40px -12px rgba(0,0,0,.7);
    --sh-float: 0 0 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas:#0E0E0D; --canvas-2:#0A0A0A; --surface:#171716; --surface-2:#1F1F1D; --surface-3:#2A2A27;
  --ink:#EDEDEC; --ink-2:#B5B4AF; --muted:#8A8984; --line:#2A2A28; --line-strong:#3A3A37;
  --primary:#EDEDEC; --primary-ink:#111111; --primary-hover:#FFFFFF;
  --ok:#6BC28A; --warn:#E0B25A; --danger:#F07A72; --info:#73B6E6;
  --ok-soft:#14261A; --warn-soft:#2A2210; --danger-soft:#2E1414; --info-soft:#10202C;
  --sh-card: 0 0 0 1px rgba(255,255,255,.06), 0 16px 40px -12px rgba(0,0,0,.7);
  --sh-float: 0 0 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ===================================================================== base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--ink);
  font: 400 var(--fs-md)/var(--lh-body) var(--font); letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-weight: 600; line-height: var(--lh-head); letter-spacing: var(--track-head); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--surface); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.sm { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 20px; height: 20px; flex: none; fill: currentColor; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 24px; height: 24px; }
.ico--xl { width: 32px; height: 32px; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
[hidden] { display: none !important; }
.no-js .only-js { display: none !important; }
.js .nojs-only { display: none !important; }

/* ===================================================================== botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  font: 560 var(--fs-md)/1 var(--font); letter-spacing: -.01em; cursor: pointer;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform var(--t-fast) var(--ease-press), background-color var(--t-fast) var(--ease-out), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--brand { background: var(--brand); color: var(--brand-ink); }
.btn--brand:hover { background: var(--brand-deep); }
.btn--gold { background: var(--brand-2); color: var(--brand-2-ink); }
.btn--secondary { background: var(--surface-3); color: var(--ink); }
.btn--secondary:hover { background: color-mix(in oklab, var(--surface-3) 85%, var(--ink)); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--lg { height: 56px; font-size: 1.125rem; padding: 0 28px; }
.btn--xl { height: 72px; font-size: 1.375rem; font-weight: 620; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ===================================================================== campos */
.field { display: grid; gap: 6px; }
.field + .field, .field + .field-row, .field-row + .field { margin-top: var(--s-5); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.field__label { font: 500 var(--fs-sm)/1.3 var(--font); color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.field__label span { color: var(--muted); font-weight: 400; }
.field__hint { font-size: var(--fs-sm); color: var(--ink-2); }
.field__error { color: var(--danger); font-size: var(--fs-sm); }
.input, .select, .textarea {
  height: 52px; padding: 0 16px; width: 100%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font: 400 1.0625rem/1.2 var(--font);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none; -webkit-appearance: none;
}
.textarea { height: auto; min-height: 140px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23787774'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ink) 8%, transparent); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.input::placeholder { color: var(--muted); }
.input--sm { height: 40px; font-size: var(--fs-sm); padding: 0 12px; border-radius: 10px; }
.select.input--sm { padding-right: 34px; background-position: right 10px center; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group__pre { position: absolute; left: 16px; color: var(--muted); pointer-events: none; display: flex; gap: 12px; align-items: center; font-size: 1.0625rem; }
.input-group__pre::after { content: ""; width: 1px; height: 20px; background: var(--line); }
.input-group .input { padding-left: 68px; }
.input-group--icon .input { padding-left: 44px; }
.input-group--icon .input-group__pre::after { display: none; }
.input-group--icon .input-group__pre { left: 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
.check input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.check input::after { content: ""; width: 12px; height: 12px; background: var(--surface); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); transform: scale(0); transition: transform var(--t-fast) var(--ease-spring); }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { transform: scale(1); }
.check strong { color: var(--ink); font-weight: 560; display: block; font-size: var(--fs-md); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: var(--r-pill); background: var(--surface-3); position: relative; cursor: pointer; transition: background var(--t-base) var(--ease-out); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--t-base) var(--ease-spring); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }

/* stepper − 10 + */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: var(--r-pill); padding: 4px; }
.stepper button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform var(--t-fast) var(--ease-press); }
.stepper button:active { transform: scale(.92); }
.stepper button[disabled] { opacity: .35; pointer-events: none; }
.stepper input { width: 56px; height: 44px; border: 0; background: transparent; text-align: center; font: 600 1.25rem/1 var(--font); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

/* control segmentado */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg--block { display: flex; }
.seg--block > * { flex: 1; }
.seg a, .seg button, .seg label { height: 34px; padding: 0 14px; border: 0; background: transparent; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font: 500 var(--fs-sm)/1 var(--font); color: var(--ink-2); text-decoration: none; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); white-space: nowrap; }
.seg [aria-selected="true"], .seg [aria-current="page"], .seg .is-on, .seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.05); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* chips de estado */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: 500 var(--fs-xs)/1 var(--font); white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--gold { background: var(--brand-2-soft); color: var(--ink); }
.chip .ico { width: 14px; height: 14px; }

/* avisos en línea */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.45; background: var(--surface-2); color: var(--ink); }
.notice .ico { margin-top: 1px; }
.notice--ok { background: var(--ok-soft); color: var(--ok); }
.notice--error { background: var(--danger-soft); color: var(--danger); }
.notice--warn { background: var(--warn-soft); color: var(--warn); }
.notice--gold { background: var(--brand-2-soft); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* caja de estado vacío */
.empty { background: var(--surface-2); border-radius: var(--r-lg); padding: 40px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty .ico { width: 32px; height: 32px; color: var(--muted); margin-bottom: 4px; }
.empty__t { font-weight: 560; }
.empty__d { font-size: var(--fs-sm); color: var(--ink-2); max-width: 36ch; }
.empty .btn { margin-top: 12px; }

/* ===================================================================== toasts */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.has-tabbar .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--surface); box-shadow: var(--sh-float); font-size: var(--fs-sm); font-weight: 500; animation: toast-in 320ms var(--ease-spring) both; }
.toast .ico { width: 18px; height: 18px; }
.toast--error { background: var(--danger); color: #fff; }
.toast__x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 4px; display: grid; }
.toast.is-out { animation: toast-out 180ms ease both; }
@keyframes toast-in { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { opacity: 0; } }
.flash-srv { display: none; }

/* ===================================================================== hojas / diálogos */
dialog.sheet { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; max-height: 92dvh; inset: auto 0 0 0; background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: var(--sh-sheet); overflow: auto; overscroll-behavior: contain; }
dialog.sheet::backdrop { background: rgba(0,0,0,.4); }
dialog.sheet[open] { animation: sheet-in 360ms var(--ease-out) both; }
dialog.sheet[open]::backdrop { animation: fade-in 240ms ease both; }
.sheet__in { padding: 12px 20px max(24px, env(safe-area-inset-bottom)); }
.sheet__grip { width: 36px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 16px; }
.sheet__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.sheet__head h2 { font-size: 1.25rem; flex: 1; }
.sheet__head p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.sheet__actions { display: flex; gap: 12px; margin-top: 24px; }
.sheet__actions .btn { flex: 1; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@media (min-width: 640px) {
  dialog.sheet { inset: 0; margin: auto; width: 440px; max-width: calc(100vw - 32px); border-radius: var(--r-card); height: fit-content; }
  dialog.sheet[open] { animation: modal-in 280ms var(--ease-out) both; }
  .sheet__grip { display: none; }
  .sheet__in { padding: 24px; }
}
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===================================================================== pase (tarjeta de lealtad) */
.pass-frame { background: var(--surface); padding: 6px; border-radius: calc(var(--r-card) + 6px); box-shadow: var(--sh-card); }
.pass {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-card); background: var(--brand); color: var(--brand-ink);
  padding: 18px 20px 18px;
}
.pass__head { display: flex; align-items: center; gap: 12px; }
.pass__logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface); flex: none; }
.pass__logo--mono { display: grid; place-items: center; background: var(--brand-ink); color: var(--brand); font: 650 .9375rem/1 var(--font); letter-spacing: -.02em; }
.pass__name { font: 600 1.0625rem/1.2 var(--font); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass__hf { text-align: right; flex: none; }
.pass__label { font: 500 var(--fs-xs)/1.3 var(--font); opacity: .74; letter-spacing: 0; }
.pass__value { font: 600 1.25rem/1.1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pass__strip {
  position: relative; margin: 16px -20px 0; aspect-ratio: 2.6 / 1;
  background-color: var(--brand-deep); background-position: center; background-size: cover; background-repeat: no-repeat;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px 20px;
}
.pass__strip:not(.pass__strip--img) { aspect-ratio: auto; min-height: 92px; background-color: color-mix(in oklab, var(--brand) 92%, var(--brand-ink)); }
.pass__strip--img::before { content: ""; position: absolute; inset: auto 0 0 0; height: 70%; background: linear-gradient(to top, rgba(0,0,0,.5), transparent); pointer-events: none; }
.pass__strip--img { color: #fff; }
.pass__strip > * { position: relative; }
.pass__kicker { font: 500 var(--fs-sm)/1.3 var(--font); opacity: .82; }
.pass__primary { font: 600 var(--fs-lg)/1.1 var(--font); letter-spacing: -.025em; text-wrap: balance; }
.stamps { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 52px)); gap: 10px; justify-content: start; margin-top: 18px; }
.stamp { position: relative; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--brand-line); color: var(--brand-ink); }
.stamp .ico { width: 50%; height: 50%; }
.stamp__n { font: 500 .75rem/1 var(--font); opacity: .55; font-variant-numeric: tabular-nums; }
.stamp--on { border: 0; background: var(--brand-2); color: var(--brand-2-ink); }
.stamp--gift { border-style: solid; border-color: var(--brand-2); color: var(--brand-2); }
.stamp--gift.stamp--on { background: var(--brand-2); color: var(--brand-2-ink); }
.pass__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--brand-line); }
.pass__fields .pass__value { font-size: 1rem; font-weight: 560; overflow: hidden; text-overflow: ellipsis; }
.pass__fields > div:last-child { text-align: right; }
.pass--compact { padding: 16px; }
.pass--compact .stamps { margin-top: 0; gap: 8px; grid-template-columns: repeat(var(--cols, 5), minmax(0, 44px)); }
.pass--compact .pass__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pass--complete::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: rgba(255,255,255,.18); transform: translateX(-120%) skewX(-20deg); pointer-events: none; z-index: 2; }
.pass--mini { transform-origin: top center; }

/* progreso bajo la tarjeta */
.progress { margin-top: 24px; }
.progress__t { font-weight: 560; line-height: 1.35; }
.progress__bar { margin-top: 12px; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--brand); border-radius: inherit; transform-origin: left; }
.progress__meta { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-2); }

/* ===================================================================== app cliente / cajero */
.app { max-width: var(--maxw-app); margin: 0 auto; padding: 0 var(--gutter) max(32px, env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
.app > main { flex: 1; }
.topbar { height: 56px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brandmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brandmark img, .brandmark__mono { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.brandmark__mono { display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font: 650 .75rem/1 var(--font); }
.brandmark span { font: 560 .9375rem/1.2 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.foot { margin-top: 48px; padding-top: 16px; font-size: var(--fs-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot a { color: var(--ink-2); }

/* /unirse */
.hero { padding: 16px 0 0; }
.hero h1 { font-size: var(--fs-hero); line-height: var(--lh-tight); letter-spacing: var(--track-hero); }
.hero__lead { margin-top: 14px; color: var(--ink-2); font-size: 1.125rem; max-width: 30ch; }
.hero__pass { margin: 32px auto 0; width: 82%; transform: rotate(-3deg); }
.hero__pass .pass-frame { box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 18px 40px -16px rgba(0,0,0,.28); }
.formcard { margin-top: 32px; background: var(--surface); border-radius: var(--r-lg); padding: 24px 20px; }
.formcard .btn--block { margin-top: 24px; }
.formcard .check { margin-top: 24px; }
.after-form { margin: 20px auto 0; max-width: 32ch; text-align: center; font-size: var(--fs-sm); color: var(--ink-2); }
.bday { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }

/* /t/{token} */
.card-page .pass-frame { animation: pass-in 640ms var(--ease-out) both; }
.code-cta { margin-top: 20px; }
.wallet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.wallet-btn { height: 48px; border-radius: var(--r-md); background: #000; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font: 500 .9375rem/1 -apple-system, var(--font); text-decoration: none; padding: 0 12px; margin: 0; }
.wallet-btn small { display: block; font-size: .625rem; opacity: .85; }
.tabs-wrap { margin-top: 32px; }
.panel { margin-top: 20px; }
.reward { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--brand-2-soft); }
.reward + .reward { margin-top: 10px; }
.reward__ico { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-2); color: var(--brand-2-ink); display: grid; place-items: center; flex: none; }
.reward__ico .ico { width: 22px; height: 22px; }
.reward__t { font-weight: 560; line-height: 1.3; }
.reward__d { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.reward--muted { background: var(--surface-2); }
.reward--muted .reward__ico { background: var(--surface-3); color: var(--muted); }
.hist__day { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; margin: 20px 0 4px; }
.hist__day:first-child { margin-top: 0; }
.hist__row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist__row:last-child { border-bottom: 0; }
.hist__t { font-weight: 500; }
.hist__d { font-size: var(--fs-sm); color: var(--ink-2); }
.hist__time { margin-left: auto; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.hist__qty { font-variant-numeric: tabular-nums; font-weight: 560; }
.hist__qty--neg { color: var(--ink-2); }
.install { margin-top: 32px; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-sm); color: var(--ink-2); }
.install .ico { color: var(--ink); }

/* hoja del QR: siempre blanca */
dialog.sheet.qr-sheet { background: #fff; color: #111; }
.qr-sheet .sheet__grip { background: #E9E8E4; }
.qr-box { width: min(260px, 70vw); aspect-ratio: 1; margin: 8px auto 0; background: #fff; padding: 12px; }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-code { margin-top: 12px; font: 500 1.125rem/1 var(--font-mono); letter-spacing: .08em; text-align: center; color: #111; }
.qr-who { margin-top: 6px; text-align: center; color: #4D4C48; font-size: var(--fs-sm); }
.qr-sheet h2 { text-align: center; font-size: 1.25rem; }
.qr-sheet .btn--secondary { background: #E9E8E4; color: #111; }

/* ===================================================================== caja (cajero) */
.caja, .ficha, [data-page="caja-escanear"], [data-page="caja-recuperar"] { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.caja-top { display: flex; align-items: center; gap: 8px; height: 56px; }
.caja-top__who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.caja-top__who form { margin: 0; }
.tabbar { position: fixed; z-index: var(--z-nav); left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100vw - 24px), 416px); height: 64px; padding: 6px; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--sh-float); display: flex; gap: 4px; }
.tabbar a, .tabbar button { flex: 1; border: 0; background: transparent; border-radius: var(--r-pill); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font: 500 var(--fs-xs)/1 var(--font); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.tabbar .ico { width: 24px; height: 24px; }
.tabbar [aria-current="page"], .tabbar .is-on { background: var(--surface-2); color: var(--ink); }

/* login con PIN */
.pin-wrap { padding-top: 24px; }
.pin-title { font-size: var(--fs-lg); }
.pin-sub { color: var(--ink-2); margin-top: 6px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 36px 0 32px; height: 14px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.pin-dots i.on { background: var(--ink); transform: scale(1.1); }
.pin-dots.shake { animation: shake 300ms ease both; }
@keyframes shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.keypad button { height: 72px; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: 500 1.75rem/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; display: grid; place-items: center; transition: transform var(--t-fast) var(--ease-press), background var(--t-fast); -webkit-tap-highlight-color: transparent; }
.keypad button:active { transform: scale(.94); background: var(--surface-3); }
.keypad .k-ghost { background: transparent; }
.keypad .ico { width: 28px; height: 28px; }
.pin-input { letter-spacing: .4em; font-size: 1.5rem; text-align: center; }
.js .pin-input { position: absolute; opacity: 0; pointer-events: none; height: 1px; width: 1px; }
.who-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: var(--r-pill); background: var(--surface); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font: 600 .75rem/1 var(--font); flex: none; }
.avatar--lg { width: 44px; height: 44px; font-size: .875rem; }

/* escáner */
.scan { position: relative; aspect-ratio: 1; border-radius: var(--r-card); overflow: hidden; background: #0E0E0D; color: #fff; }
.scan video, .scan canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan__frame { position: absolute; inset: 22%; pointer-events: none; }
.scan__frame i { position: absolute; width: 28px; height: 28px; border: 3px solid #fff; }
.scan__frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.scan__frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.scan__frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.scan__frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.scan.is-hit .scan__frame i { border-color: var(--brand-2); }
.scan__off { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--surface-2); color: var(--ink); }
.scan__off .ico { width: 32px; height: 32px; color: var(--muted); }
.scan__off p { font-size: var(--fs-sm); color: var(--ink-2); max-width: 28ch; }
.scan-hint { text-align: center; margin: 16px 0 20px; color: var(--ink-2); }
.results { margin-top: 12px; }
.result { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--surface-2); }
.result__n { font-weight: 560; }
.result__s { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.result__c { margin-left: auto; font-weight: 560; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.result__c .ico { color: var(--muted); }

/* ficha de cliente en caja */
.back { display: inline-flex; align-items: center; gap: 6px; height: 44px; color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.ficha h1 { font-size: var(--fs-lg); }
.ficha__meta { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ficha .pass-frame { margin-top: 20px; }
.today { margin-top: 12px; font-size: var(--fs-sm); color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.today--full { color: var(--warn); }
.stamp-form { margin-top: 20px; }
.stamp-form .stepper { margin: 12px auto 0; display: flex; width: fit-content; }
.redeem { margin-top: 24px; background: var(--brand-2-soft); border-radius: var(--r-lg); padding: 16px; }
.redeem + .redeem { margin-top: 10px; }
.redeem .btn { margin-top: 14px; }
.section-t { font-size: var(--fs-sm); font-weight: 560; color: var(--ink-2); margin: 32px 0 6px; }
.undo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); margin-top: 12px; }
.undo__t { font-size: var(--fs-sm); }
.undo__clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-sm); }
.undo form { margin: 0 0 0 auto; }
.recover-qr { width: min(300px, 78vw); margin: 24px auto 0; background: #fff; padding: 14px; border-radius: var(--r-lg); }
.recover-qr img { width: 100%; image-rendering: pixelated; }
.linkbox { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); font: 500 var(--fs-sm)/1.4 var(--font-mono); word-break: break-all; color: var(--ink-2); }

/* flash de confirmación a pantalla completa */
.flash { position: fixed; inset: 0; z-index: var(--z-flash); display: grid; place-items: center; align-content: center; gap: 12px; padding: 32px; text-align: center; background: var(--brand); color: var(--brand-ink); animation: flash-in 220ms var(--ease-out) both; cursor: pointer; }
.flash--gold { background: var(--brand-2); color: var(--brand-2-ink); }
.flash--error { background: var(--danger-soft); color: var(--danger); }
.flash__big { font: 650 6rem/1 var(--font); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.flash__ico { width: 72px; height: 72px; }
.flash__t { font: 600 1.5rem/1.2 var(--font); letter-spacing: -.02em; max-width: 18ch; }
.flash__s { font-size: 1.25rem; opacity: .86; }
.flash .stamps { margin-top: 20px; justify-content: center; grid-template-columns: repeat(var(--cols, 5), 40px); }
.flash.is-out { animation: fade-out 220ms ease both; }
@keyframes flash-in { from { opacity: 0; transform: scale(1.02); } }
@keyframes fade-out { to { opacity: 0; } }

/* ===================================================================== admin */
.admin-body { background: var(--canvas-2); }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--canvas-2); }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; text-decoration: none; color: var(--ink); }
.side__brand img, .side__brand .brandmark__mono { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.side__brand span { font: 600 .9375rem/1.2 var(--font); letter-spacing: -.01em; }
.side nav { display: grid; gap: 2px; }
.nav-a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font: 500 var(--fs-sm)/1 var(--font); transition: background var(--t-fast), color var(--t-fast); }
.nav-a .ico { width: 18px; height: 18px; }
.nav-a { letter-spacing: 0; word-spacing: .06em; }
.nav-a:hover { background: var(--surface-2); color: var(--ink); }
.nav-a[aria-current="page"] { background: var(--surface-3); color: var(--ink); }
.side__sep { height: 1px; background: var(--line); margin: 12px 8px; }
.side__foot { margin-top: auto; display: grid; gap: 2px; }
.side__user { padding: 8px 10px; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.side__foot form { margin: 0; }
.side__foot button.nav-a { width: 100%; border: 0; background: transparent; cursor: pointer; }
.content { padding: 28px 32px 64px; max-width: calc(var(--maxw-admin) + 64px); width: 100%; }
.mtop { display: none; }
.mnav { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: var(--fs-lg); display: flex; align-items: baseline; gap: 10px; }
.page-head h1 small { font-size: 1rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.page-head p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.box { background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
.box--flush { padding: 0; overflow: hidden; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.box__head h2 { font-size: 1rem; letter-spacing: -.01em; }
.box__head a { font-size: var(--fs-sm); color: var(--ink-2); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.box__head a:hover { color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
.kpi__label { font-size: var(--fs-sm); color: var(--ink-2); }
.kpi__value { margin-top: 6px; font: 600 var(--fs-xl)/1.05 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi__sub { margin-top: 6px; font-size: var(--fs-sm); color: var(--muted); }
.kpi__sub--ok { color: var(--ok); }
.period [data-p] { display: none; }
.period:has(#p-hoy:checked) [data-p="hoy"], .period:has(#p-semana:checked) [data-p="semana"], .period:has(#p-mes:checked) [data-p="mes"] { display: inline; }
.chart { padding: 8px 20px 16px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--brand); opacity: .85; transition: opacity var(--t-fast); }
.chart .bar:hover { opacity: 1; }
.chart .bar--zero { fill: var(--surface-3); opacity: 1; }
.chart text { fill: var(--muted); font: 500 11px var(--font); }
.chart__total { font-size: var(--fs-sm); color: var(--ink-2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 52px; }
.list-row:hover { background: var(--surface-2); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__t { font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__s { font-size: var(--fs-xs); color: var(--muted); }
.list-row__n { font-size: var(--fs-sm); font-weight: 560; font-variant-numeric: tabular-nums; }
.list-row__time { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; width: 64px; flex: none; }
.rank { width: 22px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }

/* tablas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 500; color: var(--muted); height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover td { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 560; color: var(--ink); }
.table a.row-link { color: inherit; text-decoration: none; font-weight: 560; }
.table a.row-link::after { content: ""; position: absolute; inset: 0; }
.table tr.is-link { position: relative; cursor: pointer; }
.table td.wrap { white-space: normal; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { position: relative; z-index: 1; }
.table code, .code { font: 500 .8125rem/1.4 var(--font-mono); color: var(--ink-2); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.toolbar .input-group { flex: 1; min-width: 220px; }
.toolbar form { display: contents; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.pager .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* ajustes (patrón Stripe) */
.settings { display: grid; gap: 12px; }
.set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; background: var(--surface); border-radius: var(--r-lg); padding: 28px; }
.set__h h2 { font-size: 1rem; letter-spacing: -.01em; }
.set__h p { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); max-width: 32ch; }
.set__b { max-width: 520px; }
.set__b .switch + .field, .set__b .field + .switch, .set__b .switch + .switch { margin-top: 20px; }
.inline-num { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-md); }
.inline-num .input { width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.savebar { position: sticky; bottom: 16px; z-index: var(--z-nav); display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 10px 10px 20px; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--sh-float); }
.savebar p { margin-right: auto; font-size: var(--fs-sm); color: var(--ink-2); }
.nested { margin-top: 16px; padding-left: 16px; border-left: 2px solid var(--surface-3); }

/* marca */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.brand-preview { position: sticky; top: 24px; }
.brand-preview .box { background: var(--surface-2); }
.brand-preview__t { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 14px; display: flex; justify-content: space-between; }
.upload { display: flex; align-items: center; gap: 16px; }
.upload__thumb { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); }
.upload__thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload__strip { width: 100%; aspect-ratio: 2.6 / 1; border-radius: var(--r-md); background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--ink-2); font-size: var(--fs-sm); text-align: center; padding: 16px; border: 1px dashed var(--line-strong); }
.upload__strip.has-img { border: 0; color: transparent; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.color { display: flex; gap: 10px; align-items: center; }
.color input[type="color"] { width: 52px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; flex: none; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 5px; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 8px; }
.color .input { width: 130px; font-family: var(--font-mono); text-transform: uppercase; font-size: 1rem; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform var(--t-fast) var(--ease-spring); }
.swatches button:hover { transform: scale(1.12); }
.contrast { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-2); display: flex; gap: 8px; align-items: center; }

/* detalle de cliente admin */
.cust-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 24px; }
.cust-head h1 { font-size: var(--fs-lg); }
.cust-meta { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cust-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 12px; align-items: start; }
.cust-grid .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

/* login admin / instalación */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 32px var(--gutter); background: var(--canvas-2); }
.auth__in { width: 100%; max-width: 400px; }
.auth h1 { font-size: var(--fs-lg); margin: 28px 0 24px; }
.auth .btn--block { margin-top: 24px; }
.auth__note { margin-top: 20px; font-size: var(--fs-sm); color: var(--ink-2); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.meter i { height: 4px; border-radius: 2px; background: var(--surface-3); transition: background var(--t-base); }
.meter[data-n="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-n="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-n="3"] i:nth-child(-n+3) { background: var(--ok); }
.meter[data-n="4"] i { background: var(--ok); }

/* póster QR */
.poster-tools { max-width: 880px; margin: 0 auto; padding: 24px var(--gutter) 0; }
.poster-tools .row { justify-content: space-between; flex-wrap: wrap; }
.poster-tools h1 { font-size: var(--fs-lg); }
.poster-opts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.poster-stage { padding: 32px var(--gutter) 64px; display: grid; place-items: center; }
.poster { width: 8.5in; height: 11in; background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 60px -24px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; transform-origin: top center; font-family: var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.poster__band { background: var(--brand); color: var(--brand-ink); height: 25%; padding: .6in .7in; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; }
.poster__logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #fff; }
.poster__logo--mono { display: grid; place-items: center; background: var(--brand-ink); color: var(--brand); font: 650 2rem/1 var(--font); }
.poster__name { font: 600 28pt/1.05 var(--font); letter-spacing: -.03em; }
.poster__body { flex: 1; padding: .6in .7in .5in; display: flex; flex-direction: column; }
.poster__h { font: 600 40pt/1.02 var(--font); letter-spacing: -.045em; max-width: 13ch; }
.poster__qr { width: 3.3in; height: 3.3in; margin: .4in 0 .25in -.12in; }
.poster__qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.poster__cta { font: 560 20pt/1.25 var(--font); letter-spacing: -.02em; }
.poster__url { margin-top: auto; padding-top: 12px; font: 500 13pt/1 var(--font); color: #787774; }
.poster--half { width: 5.5in; height: 8.5in; }
.poster--half .poster__band { padding: .4in .45in; gap: 10px; }
.poster--half .poster__logo { width: 64px; height: 64px; }
.poster--half .poster__name { font-size: 18pt; }
.poster--half .poster__body { padding: .4in .45in .35in; }
.poster--half .poster__h { font-size: 28pt; }
.poster--half .poster__qr { width: 2.6in; height: 2.6in; margin: .3in 0 .2in; }
.poster--half .poster__cta { font-size: 13pt; }
.poster--half .poster__url { font-size: 9pt; }
.poster--table { width: 4in; height: 6in; }
.poster--table .poster__band { padding: .3in; gap: 8px; height: 22%; }
.poster--table .poster__logo { width: 44px; height: 44px; }
.poster--table .poster__name { font-size: 13pt; }
.poster--table .poster__body { padding: .3in .3in .25in; }
.poster--table .poster__h { font-size: 19pt; }
.poster--table .poster__qr { width: 2in; height: 2in; margin: .2in 0 .14in; }
.poster--table .poster__cta { font-size: 10pt; }
.poster--table .poster__url { font-size: 7pt; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .poster-stage { padding: 0; display: block; }
  /* la hoja impresa mide < 900px: sin esto se imprimía con el scale() de la vista de celular */
  .poster { box-shadow: none; margin: 0 !important; transform: none !important; }
  .poster-stage { overflow: visible !important; }
}

/* páginas simples (error, privacidad, código) */
.simple { padding-top: 24px; }
.simple h1 { font-size: var(--fs-lg); margin-bottom: 12px; }
.simple .prose { color: var(--ink-2); line-height: 1.65; }
.simple .prose p + p { margin-top: 12px; }
.big-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; margin-bottom: 20px; }
.big-ico .ico { width: 28px; height: 28px; }

/* ===================================================================== responsive */
@media (max-width: 899px) {
  .shell { display: block; }
  .side { display: none; }
  .content { padding: 8px var(--gutter) 112px; }
  .mtop { display: flex; position: sticky; top: 0; z-index: var(--z-nav); height: 56px; align-items: center; gap: 10px; padding: 0 var(--gutter); background: var(--canvas-2); border-bottom: 1px solid var(--line); }
  .mtop .brandmark span { font-weight: 600; }
  .mtop .btn { margin-left: auto; }
  .mnav { display: flex; }
  .grid-2, .brand-grid, .cust-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-preview { position: static; order: -1; }
  .set { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cust-grid .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 1.75rem; }
  .page-head h1 { font-size: 1.375rem; }
  .savebar { bottom: 88px; }
  /* scale() no reduce la caja: el póster sigue midiendo 8.5in y desbordaba la página en celular */
  /* flex centra aunque el hijo desborde (grid lo alineaba a la izquierda y el scale lo corría a la derecha) */
  .poster-stage { overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
  .poster { flex-shrink: 0; }
  .poster { transform: scale(var(--fit, .42)); margin-bottom: calc(11in * (var(--fit, .42) - 1)); }
  .poster--half { margin-bottom: calc(8.5in * (var(--fit, .42) - 1)); }
  .poster--table { margin-bottom: calc(6in * (var(--fit, .42) - 1)); }
}
@media (max-width: 639px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr { display: block; }
  .table--cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px var(--gutter); border-bottom: 1px solid var(--line); min-height: 64px; align-content: center; }
  .table--cards tr:last-child { border-bottom: 0; }
  .table--cards td { display: block; height: auto; padding: 0 !important; border: 0; }
  .table--cards td[data-m="hide"] { display: none; }
  .table--cards td[data-m="sub"] { grid-column: 1; font-size: var(--fs-sm); color: var(--ink-2); }
  .table--cards td[data-m="end"] { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; }
  .table--cards td[data-m="main"] { grid-column: 1; font-size: var(--fs-md); }
  .toolbar { padding: 12px var(--gutter); }
  .box__head, .list-row { padding-left: var(--gutter); padding-right: var(--gutter); }
  .cust-grid .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cust-grid .kpi { padding: 14px 12px; }
  .cust-grid .kpi__value { font-size: 1.375rem; }
}
.mnav { position: fixed; z-index: var(--z-nav); left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100vw - 24px), 440px); height: 64px; padding: 6px; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--sh-float); gap: 2px; }
.mnav a, .mnav button { flex: 1; border: 0; background: transparent; border-radius: var(--r-pill); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font: 500 .6875rem/1 var(--font); cursor: pointer; }
.mnav .ico { width: 22px; height: 22px; }
.mnav [aria-current="page"] { background: var(--surface-2); color: var(--ink); }
@media (min-width: 900px) { .mnav, .mtop { display: none !important; } }

/* ===================================================================== movimiento */
@keyframes pass-in { from { transform: translateY(24px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stamp-in {
  0%   { transform: scale(1.8) rotate(-14deg); opacity: 0; }
  55%  { transform: scale(.9) rotate(2deg); opacity: 1; }
  75%  { transform: scale(1.06) rotate(0); }
  100% { transform: scale(1); }
}
@keyframes ink-ring { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes sheen { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: no-preference) {
  .stamp--new { animation: stamp-in 520ms var(--ease-spring) both; animation-delay: var(--d, 0ms); }
  .stamp--new::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--brand-2); animation: ink-ring 600ms var(--ease-out) both; animation-delay: calc(var(--d, 0ms) + 260ms); }
  .pass--complete::after { animation: sheen 1.1s var(--ease-out) 500ms 1 both; }
  .progress__bar i { animation: grow 900ms var(--ease-out) 200ms both; }
  .reveal > * { animation: pass-in 480ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
.stamp__logo { width: 58%; height: 58%; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.menu-sheet nav { display: grid; gap: 2px; }
.menu-sheet .nav-a { height: 48px; font-size: 1rem; width: 100%; border: 0; background: none; cursor: pointer; }
.menu-sheet .nav-a[aria-current="page"] { background: var(--surface-3); }
.menu-sheet form { margin: 0; }
.nested[data-off] { opacity: .45; }
.brand-scope {
  --brand-soft: color-mix(in oklab, var(--brand) 10%, var(--surface));
  --brand-line: color-mix(in oklab, var(--brand-ink) 30%, transparent);
  --brand-deep: color-mix(in oklab, var(--brand) 86%, #000);
  --brand-2-soft: color-mix(in oklab, var(--brand-2) 18%, var(--surface));
}
.brand-preview .pass__fields .pass__value { font-size: .875rem; }
.brand-preview .pass__fields .pass__label { white-space: nowrap; }
.list-row__main .list-row__t, .list-row__main .list-row__s { display: block; }
.list-row > .list-row__s { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
