@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-600.woff2") format("woff2"); }
:root {
  --primary: #23324d; --on-primary: #fff; --secondary: #6b7280; --accent: #d9a663; --hi: #d9a663;
  --bg: #f6f4ef; --text: #17181c; --side: #ffffff; --on-side: #17181c;
  --grad: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 72%, white));
  --page: #ececee; --zone: #f5f5f6; --surface: #ffffff; --panel: #f6f6f7;
  --muted: #6b7078; --border: rgba(20, 24, 33, 0.09);
  --ok: #17803d; --warn: #a15c00; --danger: #b42318;
  --brand-ink: color-mix(in srgb, var(--primary) 68%, #000);
  --radius: 16px; --shadow: none;
  --sidebar-w: 264px;
  /* Imanta brand, Verde bistro (login only; each business dashboard keeps its own accent) */
  --rc-ink: #13201c; --rc-green: #1e5b4f; --rc-mustard: #e9a23b; --rc-cream: #fbf6ec; --rc-cream-deep: #f1e6d2;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font-size: 1rem; line-height: 1.5; min-height: 100dvh; }
body.brand-bg { background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 82%, black); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--primary) 24%, white); color: var(--text); }
input, button { accent-color: var(--primary); }
.input { caret-color: var(--primary); }
.nav { scrollbar-color: color-mix(in srgb, var(--primary) 35%, white) transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- buttons / fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 13px 22px; font-weight: 600; background: var(--primary); color: var(--on-primary); min-height: 48px;
  transition: transform .06s ease, filter .15s ease, opacity .15s; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.dark { background: #0d0d0f; color: #fff; padding-inline: 24px; }
.btn.reward { background: var(--accent); color: #1b1b1b; }
.btn.block { width: 100%; }
.btn.small { padding: 8px 16px; min-height: 38px; font-size: .9rem; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.input { width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px; background: #fff; min-height: 48px; }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.code { text-transform: uppercase; letter-spacing: .18em; font-weight: 600; font-variant-numeric: tabular-nums; }
.alert { border-radius: 12px; padding: 12px 14px; font-size: .95rem; border: 1px solid transparent; }
.alert.error { background: #fef3f2; color: var(--danger); border-color: #fecdca; }
.alert.warn { background: #fffaeb; color: var(--warn); border-color: #fedf89; }
.alert.ok { background: #ecfdf3; color: var(--ok); border-color: #abefc6; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- enrollment / login (centered) ---------- */
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.pass { width: min(440px, 100%); background: var(--surface); border-radius: 24px; box-shadow: 0 10px 40px rgba(16,24,40,.08); overflow: hidden; }
.pass-hero { background: var(--grad); color: var(--on-primary);
  padding: 36px 28px 30px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.logo-ring { width: 112px; height: 112px; border-radius: 50%; background: #fff; padding: 5px; box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.logo-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.pass-hero h1 { font-size: 1.7rem; }
.pass-hero p { opacity: .85; }
.pass-body { padding: 26px 26px 30px; display: grid; gap: 20px; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.perk { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 6%, white); }
.perk .dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .85rem; background: var(--primary); color: var(--on-primary); }
.perk b { display: block; }
.perk span { color: var(--muted); font-size: .92rem; }
.fine { font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100dvh - 32px); margin: 16px; max-width: 1480px; margin-inline: auto; width: calc(100% - 32px);
  background: var(--surface); border-radius: 24px; overflow: hidden; }
.sidebar { background: var(--side); color: var(--on-side); position: sticky; top: 16px; height: calc(100dvh - 32px); display: flex; flex-direction: column; z-index: 40; border-right: 1px solid var(--border); }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 14px; }
.side-brand .logo-ring { width: 44px; height: 44px; padding: 0; box-shadow: none; flex: none; border: 1px solid var(--border); }
.side-brand b { display: block; font-size: 1rem; line-height: 1.2; }
.side-brand small { color: var(--muted); font-size: .76rem; }
.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px 14px; -webkit-mask-image: linear-gradient(#000 calc(100% - 12px), transparent); mask-image: linear-gradient(#000 calc(100% - 12px), transparent); scrollbar-width: thin; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; align-content: start; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 14px 4px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 14px; min-height: 38px; line-height: 1.25; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .93rem; }
.nav a svg { flex: none; stroke-width: 1.5; }
.nav a:hover { background: var(--zone); color: var(--text); }
.nav a[aria-current="page"] { background: var(--grad); color: var(--on-primary); font-weight: 600; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent); }
.nav a[aria-current="page"] svg { stroke-width: 1.8; }
.tag-soon { margin-left: auto; flex: none; font-size: .64rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--zone); color: var(--muted); }
.nav a[aria-current="page"] .tag-soon { background: rgba(255,255,255,.22); color: inherit; }
.side-foot { padding: 4px 14px 14px; display: grid; gap: 4px; }
.plan-card { display: block; text-decoration: none; background: var(--grad); color: var(--on-primary); border-radius: 14px; padding: 10px 14px; margin-bottom: 4px; }
.plan-card b { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 600; }
.plan-card small { display: block; opacity: .92; font-size: .72rem; margin-top: 2px; padding-left: 28px; }
.signout { background: none; border: 0; color: var(--muted); display: flex; gap: 12px; align-items: center; padding: 9px 14px; min-height: 40px; border-radius: 999px; text-align: left; font-weight: 500; font-size: .93rem; }
.signout:hover { background: var(--zone); color: var(--text); }
.powered { font-size: .72rem; color: var(--muted); padding-left: 14px; }
.content { min-width: 0; background: var(--zone); display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px clamp(16px, 3vw, 32px) 0; }
.topbar .spacer { flex: 1; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; padding: 0; color: var(--text); }
.menu-btn { display: none; }
.topbar .brand-mini { display: none; font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: var(--on-primary); display: grid; place-items: center; font-weight: 600; flex: none; text-transform: uppercase; }
.who span { font-size: .88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.scrim { display: none; }
.zone-top { padding: 14px clamp(16px, 3vw, 32px) 20px; }
.zone-body { min-width: 0; background: var(--surface); border-radius: 24px 24px 0 0; padding: clamp(14px, 2.4vw, 22px) clamp(14px, 3vw, 28px) 56px; flex: 1; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 600; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: .92rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 26px; }
.kpi { padding: 4px 24px; border-left: 1px solid var(--border); }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi b { display: block; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { color: var(--muted); font-size: .85rem; }

@media (max-width: 899px) {
  .shell { display: block; margin: 0; width: 100%; border-radius: 0; min-height: 100dvh; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); height: 100dvh; transform: translateX(-102%); transition: transform .22s ease, box-shadow .22s ease; visibility: hidden; }
  .shell.open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .nav a, .signout { min-height: 44px; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 14, 22, .5); z-index: 30; }
  .menu-btn { display: grid; }
  .topbar .brand-mini { display: block; }
  .who span { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .kpi:nth-child(odd) { border-left: 0; padding-left: 0; }
  .zone-body { border-radius: 20px 20px 0 0; }
}

/* ---------- cards / panels ---------- */
.panel { background: var(--panel); border-radius: var(--radius); padding: 22px; min-width: 0; }
.panel-title { font-size: 1.08rem; font-weight: 500; }
.panel-sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 180px; }
#reader { width: 100%; border-radius: 14px; overflow: hidden; background: #0e1116; }
#reader video { border-radius: 14px; }
.cardhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cardhead > div { min-width: 0; }
.cardhead h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.cardhead .code-chip { flex: none; }
.cardid { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.wallet-chip { font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.code-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; font-weight: 600; background: color-mix(in srgb, var(--primary) 9%, white); padding: 4px 12px; border-radius: 999px; font-size: .95rem; }
.counter { display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1.5px solid var(--border); }
.counter.ready { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, white); }
.counter-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; }
.counter-top b { font-size: 1.05rem; }
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--text) 25%, transparent); display: grid; place-items: center; }
.stamp.on { border: 0; background: var(--stamp, var(--primary)); color: #1b1b1b; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .03em; }
.badge.ready { background: var(--accent); color: #1b1b1b; }
.badge.soon { background: color-mix(in srgb, var(--primary) 12%, white); color: var(--brand-ink); text-transform: uppercase; letter-spacing: .08em; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, white); }
.tier-hint { font-size: .9rem; font-weight: 600; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* tables -> cards on mobile */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.table tr.link { cursor: pointer; }
.table tr.link:hover td { background: color-mix(in srgb, var(--primary) 4%, white); }
.table tr.link:focus-visible { outline-offset: -2px; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-size: .9rem; margin-right: 12px; white-space: nowrap; }
.mini i { width: 9px; height: 9px; border-radius: 50%; background: var(--stamp, var(--primary)); display: inline-block; }
@media (max-width: 640px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .table td { border: 0; padding: 2px 8px; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  .table td:first-child { padding-top: 0; }
  .table td:first-child::before { content: none; }
  .table td:first-child b { font-size: 1.02rem; }
}

/* program view */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { display: grid; gap: 4px; justify-items: center; font-size: .75rem; color: var(--muted); }
.swatch i { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); display: block; }
.hero-preview { width: 100%; border-radius: 14px; display: block; background: var(--pass-bg, #ddd); aspect-ratio: 1032 / 336; }
.qr-box { display: grid; gap: 12px; justify-items: center; padding: 18px; }
.qr-box > svg { width: min(240px, 100%); height: auto; background: #fff; border-radius: 12px; padding: 10px; }
.url-box { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; background: color-mix(in srgb, var(--primary) 6%, white); padding: 10px 12px; border-radius: 10px; }

/* coming soon */
.soon-wrap { display: grid; place-items: center; min-height: 52vh; }
.panel.soon { max-width: 520px; text-align: center; display: grid; gap: 16px; justify-items: center; padding: 40px 28px; }
.soon-icon { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; color: var(--on-primary);
  background: var(--grad); box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 30%, transparent); }
.soon-icon svg { width: 38px; height: 38px; }
.soon h2 { font-size: 1.6rem; }
.soon p { color: var(--muted); font-size: 1.02rem; }


/* ---------- inicio (real data dashboard) ---------- */
.dash > * { min-width: 0; }
.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: stretch; }
.dash .span-2 { grid-column: 1 / -1; }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 18px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 260px; font-size: .72rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.col { display: grid; gap: 8px; justify-items: center; min-width: 0; }
.track { position: relative; width: 100%; height: 260px; border-radius: 12px; overflow: hidden;
  background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--primary) 9%, transparent) 5px 6px), color-mix(in srgb, var(--primary) 4%, #fff); }
.fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 12px; background: var(--grad); transition: height .4s ease; }
.fill.zero { background: #e4e4e7; }
.fill-n { position: absolute; left: 0; right: 0; text-align: center; font-size: .78rem; font-weight: 600; color: var(--on-primary); top: 6px; }
.fill.zero .fill-n, .fill.short .fill-n { display: none; }
.val-out { position: absolute; left: 0; right: 0; text-align: center; font-size: .78rem; font-weight: 600; }
.day-pill { background: #0d0d0f; color: #fff; font-size: .7rem; font-weight: 500; padding: 1px 10px; border-radius: 999px; text-transform: lowercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-pill.today { background: var(--hi); color: #0d0d0f; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); align-items: center; }
.legend span { white-space: nowrap; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--primary); }
.legend i.off { background: #e4e4e7; }
.gauge { display: grid; justify-items: center; margin-top: 8px; }
.gauge svg { width: 100%; max-width: 300px; height: auto; overflow: visible; }
.gauge-chart { position: relative; width: 100%; max-width: 300px; }
.gauge-num { position: absolute; left: 0; right: 0; bottom: 20%; text-align: center; font-size: 2rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-sub { color: var(--muted); font-size: .82rem; margin-top: 10px; text-align: center; }
.gauge-ends { position: absolute; left: 1%; right: 1%; bottom: 0; display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dist { display: grid; gap: 8px; margin-top: 18px; }
.dist-row { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) 2.4em; gap: 10px; align-items: center; font-size: .78rem; color: var(--muted); }
.dist-bar { height: 6px; border-radius: 999px; background: #e4e4e7; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.dist-row b { text-align: right; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.activity { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.act { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.act-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 14%, #fff); color: var(--primary); }
.act-ic.k-redemption { background: color-mix(in srgb, var(--hi) 28%, #fff); color: #3a2a08; }
.act > div { min-width: 0; }
.act b { display: block; font-weight: 500; font-size: .92rem; overflow-wrap: anywhere; }
.act small { display: block; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-r { text-align: right; font-size: .78rem; white-space: nowrap; color: var(--muted); }
.act-r b { color: var(--text); font-weight: 600; }
.empty-note { color: var(--muted); font-size: .9rem; padding: 22px 8px; text-align: center; }
.empty-note a { color: var(--brand-ink); font-weight: 600; }
@media (max-width: 899px) { .dash { grid-template-columns: 1fr; } .chart-y { height: 180px; } .track { height: 180px; } .chart-cols { gap: 6px; } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #0d0d0f; color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

@media print {
  body * { visibility: hidden; }
  .printable, .printable * { visibility: visible; }
  .printable { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 16px; }
  .printable .no-print { display: none; }
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main:focus { outline: none; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--brand-ink); font-weight: 600; font-size: .92rem; text-decoration: none; min-height: 32px; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-link svg { transform: scaleX(-1); }
.table td, .counter-top, .act-r { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Imanta unified login ---------- */
body.rc-login { --primary: var(--rc-green); --on-primary: #fff; --page: #ececee; }
body.rc-login :focus-visible { outline-color: var(--rc-green); }
body.rc-login .input:focus { border-color: var(--rc-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc-green) 18%, transparent); }
body.rc-login ::selection { background: color-mix(in srgb, var(--rc-green) 24%, white); }
.auth-card { width: min(920px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: 0 10px 40px rgba(16,24,40,.08); }
.auth-brand { background: var(--rc-cream); padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 460px; }
.auth-logo { width: 150px; max-width: 100%; height: auto; display: block; }
.auth-tag { font-size: 1.35rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; color: var(--rc-ink); max-width: 20ch; }
.auth-art { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 280px; padding: 18px; background: #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(20,23,31,.08); transform: rotate(-3deg); }
.auth-art i { aspect-ratio: 1; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--rc-ink) 25%, transparent); }
.auth-art i.on { border: 0; background: var(--rc-green); box-shadow: inset 0 0 0 4px var(--rc-mustard); }
.auth-main { padding: clamp(28px, 4vw, 52px); display: grid; align-content: center; }
.auth-main h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; }
.auth-sub { margin-top: 6px; font-size: .95rem; }
.biz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.biz { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 64px; border-radius: 16px; border: 1.5px solid var(--border); background: #fff; color: var(--text); text-decoration: none; font-weight: 600; transition: border-color .15s, background .15s; }
.biz:hover { border-color: var(--biz, var(--rc-green)); background: color-mix(in srgb, var(--biz, var(--rc-green)) 6%, white); }
.biz .logo-ring { width: 44px; height: 44px; padding: 0; box-shadow: none; border: 1px solid var(--border); flex: none; }
.biz-name { flex: 1; min-width: 0; }
.biz svg { color: var(--muted); flex: none; }
@media (max-width: 759px) {
  .center-page:has(.auth-card) { padding: 0; align-items: stretch; }
  .auth-card { grid-template-columns: 1fr; border-radius: 0; box-shadow: none; min-height: 100dvh; align-content: start; }
  .auth-brand { min-height: 0; padding: 24px 20px 22px; gap: 10px; }
  .auth-tag { font-size: 1rem; max-width: none; font-weight: 500; }
  .auth-art { display: none; }
  .auth-main { padding: 26px 20px 36px; align-content: start; }
}

/* dashboard: who is signed in + business switcher */
.side-who { display: flex; align-items: center; gap: 10px; padding: 6px 14px; min-width: 0; }
.side-who .avatar { width: 30px; height: 30px; font-size: .8rem; }
.side-email { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 9px 14px; min-height: 40px; border-radius: 999px; font-weight: 500; font-size: .93rem; color: var(--muted); cursor: pointer; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover, .switcher[open] summary { background: var(--zone); color: var(--text); }
.switcher ul { list-style: none; margin: 4px 0 6px; padding: 0 0 0 8px; display: grid; gap: 2px; }
.switcher li a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; min-height: 40px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: .9rem; font-weight: 500; }
.switcher li a:hover { background: var(--zone); }
.switcher .logo-ring { width: 28px; height: 28px; padding: 0; box-shadow: none; border: 1px solid var(--border); flex: none; }
@media (min-width: 900px) { .topbar .who { display: none; } }

/* ---------- phones (<= 899px): fit any width, survive Android text scaling ----------
   Rules: no fixed widths in px for text, every grid/flex child may shrink (min-width: 0),
   wrap or ellipsize instead of overflowing, safe-area insets on the edges, 44px tap targets. */
@media (max-width: 899px) {
  .shell { overflow: clip; } /* clip (not hidden) keeps position: sticky working for the top bar */
  .topbar { position: sticky; top: 0; z-index: 20; background: var(--zone); gap: 10px; min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); box-shadow: 0 1px 0 var(--border); }
  .topbar .brand-mini { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .spacer { display: none; }
  .who { flex: none; }
  .zone-top { padding: 14px max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left)); }
  .zone-body { padding: 14px max(12px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .page-head { gap: 12px; }
  .page-head > * { min-width: 0; }
  .page-head h1 { font-size: clamp(1.4rem, 5.6vw, 1.9rem); overflow-wrap: anywhere; }
  .page-head p { font-size: .9rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; row-gap: 14px; }
  .kpi { padding: 4px 16px; min-width: 0; overflow-wrap: anywhere; }
  .kpi b { font-size: clamp(1.5rem, 7vw, 2rem); }
  .panel { padding: 18px 16px; }
  .panel-title { font-size: 1.05rem; }
  .dash { gap: 12px; }
  .chart { gap: 6px; margin-top: 14px; }
  .chart-cols { gap: 4px; }
  .day-pill { padding: 1px 3px; font-size: .68rem; letter-spacing: -0.01em; }
  .fill-n { font-size: .72rem; }
  .act { grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; }
  .act-ic { grid-row: 1 / span 2; }
  .act small { white-space: normal; overflow-wrap: anywhere; }
  .act-r { grid-column: 2; text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 0 10px; }
  .act-r b { display: inline; }
  .grid-2 { gap: 14px; }
  .cardhead { flex-wrap: wrap; }
  .url-box { overflow-wrap: anywhere; }
  #reader video { width: 100% !important; height: auto !important; }
  /* the sidebar is a drawer: scroll it as a whole so a long menu + footer never gets squeezed at large text sizes */
  .sidebar { overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); }
  .nav { flex: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .side-foot { margin-top: auto; }
  .side-brand { padding-top: max(22px, calc(10px + env(safe-area-inset-top))); }
  .side-email { overflow-wrap: anywhere; white-space: normal; }
  .switcher summary, .switcher li a, .signout { min-height: 44px; }
  .back-link { min-height: 44px; }
  .btn.small { min-height: 44px; }
  /* the card's main action stays within thumb reach while the long card scrolls */
  .btn.cta { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 8px 20px rgba(16, 24, 40, .22); }
  .choice { min-height: 44px; }
  .toast { bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .zone-body { padding-top: 12px; }
  .table tr { padding: 12px 2px; }
}

/* ---------- rule editor ("Mi programa", owners) ---------- */
[hidden] { display: none !important; }
.rule-note:empty { display: none; }
.rule-form { display: grid; gap: 18px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--border); min-width: 0; }
.rule-form .field { min-width: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.char-count { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.over { color: var(--danger); font-weight: 600; }
.field-msg { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.field-msg.error { color: var(--danger); font-weight: 500; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent); }
.stepper { display: grid; grid-template-columns: 48px minmax(72px, 112px) 48px; gap: 8px; align-items: center; }
.stepper .input { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; padding-inline: 8px; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--border); background: #fff; display: grid; place-items: center; padding: 0; color: var(--text); transition: background-color .15s, border-color .15s; }
.step-btn:hover:not([disabled]) { background: color-mix(in srgb, var(--primary) 8%, white); border-color: var(--primary); }
.step-btn[disabled] { opacity: .4; cursor: not-allowed; }
.rule-preview { display: grid; gap: 12px; min-width: 0; }
.rule-preview h4 { margin: 0; font-size: .95rem; font-weight: 600; }
.rule-shots { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.rule-shot { margin: 0; display: grid; gap: 6px; min-width: 0; }
.rule-shot figcaption { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rule-shot .hero-preview { transition: opacity .2s ease-out; }
.rule-shot.is-loading .hero-preview { opacity: .5; }
.reward-line { font-size: .95rem; font-weight: 500; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--border); overflow-wrap: anywhere; }
.reward-line.placeholder { color: var(--muted); font-weight: 400; }
.rule-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rule-actions .btn { flex: 1 1 160px; }
dialog.confirm { width: min(440px, calc(100vw - 32px)); max-width: none; border: 0; border-radius: 20px; padding: 24px 22px 22px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(16, 24, 40, .28); }
dialog.confirm[open] { display: grid; gap: 12px; }
dialog.confirm::backdrop { background: rgba(10, 14, 22, .5); }
dialog.confirm h3 { font-size: 1.2rem; overflow-wrap: anywhere; }
dialog.confirm p { overflow-wrap: anywhere; }
.confirm-change { font-weight: 600; padding: 10px 12px; border-radius: 12px; background: var(--zone); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.dialog-actions .btn { flex: 1 1 150px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.history li:first-child { padding-top: 4px; }
.history li:last-child { border-bottom: 0; padding-bottom: 0; }
.history b { font-weight: 600; font-size: .93rem; overflow-wrap: anywhere; }
.history small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.counter.rule { min-width: 0; }
.counter.rule > * { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .rule-shots { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
}
@media (max-width: 899px) {
  dialog.confirm .btn, .rule-actions .btn { min-height: 48px; }
}

/* Wallet buttons on the enrollment page. Apple's badge is black with a white wallet glyph. */
.wallet-buttons { display: grid; gap: 10px; }
.btn.apple-wallet { background: #000; color: #fff; min-height: 48px; }
.btn.apple-wallet svg { flex: none; }
/* Official Google badge: shown as supplied (no recolor, no stretching), 8px clear space around it. */
.gw-badge { justify-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 55px; min-width: 239px; margin: 8px; padding: 0; border: 0; border-radius: 28px; background: #1f1f1f;
  color: #fff; font: inherit; cursor: pointer; }
.gw-badge img { display: block; width: 239px; height: 55px; }
.gw-badge:focus-visible { outline: 3px solid var(--focus, #1a73e8); outline-offset: 3px; }
.gw-badge:disabled { cursor: progress; }

/* ---------- sales, undo and team rules (staff) ---------- */
.block { display: block; }
select.input { appearance: auto; }
.choice > span { min-width: 0; overflow-wrap: anywhere; }
.choice input[type="checkbox"] { width: 22px; height: 22px; flex: none; accent-color: var(--primary); }
.req { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); white-space: nowrap; }
.req.opt { color: var(--muted); font-weight: 600; }
.field input:disabled { background: var(--zone); color: var(--muted); }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.notice > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.undo-btn { min-height: 44px; }
.undo-form { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: #fff; border: 1.5px solid var(--border); min-width: 0; }
.undo-form .row .btn { min-height: 44px; }
.card-history { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); min-width: 0; }
.card-history h3 { font-size: 1rem; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; }
.hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.hist-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hist-row > .undo-form { grid-column: 1 / -1; }
.hist-main { display: grid; gap: 2px; min-width: 0; }
.hist-main b { font-weight: 600; font-size: .93rem; overflow-wrap: anywhere; }
.hist-main small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.hist-sale { font-size: .9rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hist-undo { color: var(--danger); }
.hist-row.is-undone .hist-main > b, .hist-row.is-undone .hist-sale { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--muted); }
.tag { margin-left: 8px; vertical-align: middle; }
.badge.undone { background: #fef3f2; color: var(--danger); text-transform: uppercase; letter-spacing: .06em; }
.sales { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 14px 0 0; }
.sale { display: grid; align-content: start; gap: 2px; padding: 14px 18px 14px 0; min-width: 0; }
.sale dt { font-size: .85rem; color: var(--muted); font-weight: 500; }
.sale dd { margin: 0; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.sale small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
@media (min-width: 900px) { .sales { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sale { padding-right: 20px; } .sale + .sale { padding-left: 20px; border-left: 1px solid var(--border); } }
@media (max-width: 899px) { .sale:nth-child(even) { padding-left: 14px; padding-right: 0; border-left: 1px solid var(--border); } }
@media (max-width: 420px) { .sales { grid-template-columns: minmax(0, 1fr); } .sale:nth-child(even) { padding-left: 0; border-left: 0; } .sale + .sale { border-top: 1px solid var(--border); } }
.sale dd.none { font-size: 1.05rem; font-weight: 500; color: var(--muted); }

/* Customer contact + consent (S7): enrollment block, "Mis datos" and the data policy page */
.fine.left { text-align: left; }
.fine a, .doc-body a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.center-page.top { place-items: start center; }
.pass-hero.compact { padding: 26px 24px 22px; gap: 10px; }
.logo-ring.small { width: 72px; height: 72px; padding: 4px; }
.contact-opt { border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; }
.contact-opt > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; min-height: 48px; font-weight: 600; border-radius: 14px; }
.contact-opt > summary::-webkit-details-marker { display: none; }
.contact-opt > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.contact-opt[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.contact-body { display: grid; gap: 18px; padding: 4px 16px 18px; min-width: 0; }
.contact-item { display: grid; gap: 8px; min-width: 0; }
.consent { display: flex; align-items: flex-start; gap: 12px; font-size: .9rem; line-height: 1.4; cursor: pointer; padding: 4px 0; min-height: 44px; }
.consent input { flex: none; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.consent span { min-width: 0; overflow-wrap: anywhere; }
.bday { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
.field-msg:empty { display: none; }
.data-item { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.data-item h2, .doc-section h2 { font-size: 1.05rem; }
.data-value { font-size: 1.1rem; font-weight: 500; overflow-wrap: anywhere; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.secondary.danger-text { color: var(--danger); }
.alert[hidden] { display: none; }
.doc { width: min(680px, 100%); }
.doc-body { gap: 22px; }
.doc-section { display: grid; gap: 8px; max-width: 65ch; }
.doc-section p, .doc-section li { overflow-wrap: anywhere; }
.doc-section ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Sedes (locations, owners only) */
.sede-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sede { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.sede:first-child { border-top: 0; }
.sede-pin { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 10%, white); color: var(--brand-ink); }
.sede-info { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sede-info a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.sede-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.field-msg a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 640px) {
  .sede { grid-template-columns: auto minmax(0, 1fr); }
  .sede-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .sede-actions .btn { flex: 1 1 120px; min-height: 44px; }
}
/* Mensajes (owner campaigns): composer, live counters, preview and the campaign list. */
.msg-form h3, .msg-list-head h3 { font-size: 1.05rem; font-weight: 600; }
.msg-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.msg-label label { font-weight: 600; font-size: .92rem; }
.msg-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg-count.over { color: var(--danger); font-weight: 600; }
textarea.input { font: inherit; resize: vertical; min-height: 96px; line-height: 1.4; }
.msg-preview { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 7%, white); border: 1px solid var(--border); min-width: 0; }
.msg-preview small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.msg-preview b, .msg-preview span { overflow-wrap: anywhere; }
.msg-when { border: 0; padding: 0; margin: 0; min-width: 0; }
.msg-when legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 8px; }
.msg-problem { color: var(--danger); }
.msg-confirm { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: #fffaeb; border: 1px solid #fedf89; }
.msg-confirm .row .btn { flex: 1 1 140px; }
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg-item { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.msg-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.msg-item-head b { overflow-wrap: anywhere; }
.msg-item-head .badge { flex: none; }
.msg-item-body { overflow-wrap: anywhere; color: var(--text); }
.msg-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.stack.tight { gap: 6px; }
.msg-list-head .btn { flex: none; }
@media (max-width: 640px) {
  .msg-form, .msg-item { padding-inline: 14px; }
  .msg-confirm .row { flex-direction: column; align-items: stretch; }
}
