/* Merchant dashboard, auth pages and customer checkout. Loads after site.css. */

body.app { background: var(--bg-soft); min-height: 100vh; }
.sandbox-bar { background: #fff2c2; color: #5c4300; text-align: center; font-size: 0.85rem; font-weight: 600; padding: 8px 16px; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 0.92rem; min-width: 0; }
.topbar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 6px; background: var(--lime-soft); color: var(--green-dark); }
.badge-paid { background: var(--lime); color: var(--ink); }
.badge-open { background: var(--bg-tint); color: var(--green-dark); }
.badge-expired, .badge-cancelled { background: #eef0ef; color: var(--muted); }
.badge-refunded { background: var(--warn-soft); color: #6b4e00; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 24px 0; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.95rem; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs a[aria-current='page'] { color: var(--ink); border-color: var(--green); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 20px; }
.panel h2 { font-size: 1.3rem; margin-bottom: 4px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; } }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 160px; }

.points { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.point { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; background: #fff; }
.point.off { opacity: 0.55; }
.point img { width: 150px; height: 150px; display: block; margin: 0 auto 10px; }
.point .label { font-weight: 700; }
.point .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 12px; }
.point .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.sale { text-align: center; }
.sale .qr { width: 240px; max-width: 100%; margin: 12px auto; }
.sale .qr svg { width: 100%; height: auto; display: block; }
.sale .amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.04em; }
.sale .status { font-weight: 700; margin-top: 8px; }
.sale.paid .qr { opacity: 0.15; }
.sale .paid-mark { font-size: 1.4rem; font-weight: 800; color: var(--green-dark); }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { font-size: 0.85rem; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
code.emv { display: block; word-break: break-all; font-size: 0.75rem; background: var(--bg-soft); padding: 10px; border-radius: 8px; margin-top: 8px; }
details.tech summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); margin-top: 12px; }

.plan-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-pick label { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; font-weight: 500; margin: 0; }
.plan-pick input { width: auto; margin-right: 6px; }
.plan-pick label:has(input:checked) { border-color: var(--green); background: var(--bg-soft); }
@media (max-width: 700px) { .plan-pick { grid-template-columns: 1fr; } }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow); }
.auth-card .logo { margin-bottom: 24px; }
.auth-card h1 { font-size: 1.7rem; }

/* checkout */
.checkout { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 40px; }
.checkout-card { width: 100%; max-width: 420px; background: #fff; border-radius: 28px; box-shadow: var(--shadow-lg); padding: 28px 24px; text-align: center; }
.checkout .logo { font-size: 1.2rem; margin-bottom: 18px; }
.checkout .logo-mark { width: 24px; height: 24px; }
.co-merchant { font-size: 1.25rem; font-weight: 800; }
.co-verified { font-size: 0.8rem; color: var(--green-dark); font-weight: 700; margin-bottom: 18px; }
.co-amount { font-size: 3rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin: 4px 0; }
.co-amount-input { font-size: 2.4rem; font-weight: 800; text-align: center; padding: 10px; letter-spacing: -0.03em; }
.co-ref { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.banks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; text-align: left; }
.banks button { font: inherit; font-size: 0.9rem; font-weight: 600; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; color: var(--ink); }
.banks button[aria-pressed='true'] { border-color: var(--green); background: var(--bg-soft); }
.co-note { font-size: 0.78rem; color: var(--muted); margin-top: 14px; }
.co-done { font-size: 4rem; line-height: 1; margin-bottom: 8px; }
.bank-sim { background: #14213d; color: #fff; border-radius: 22px; padding: 22px; text-align: left; }
.bank-sim .bank-name { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.bank-sim .bank-sub { font-size: 0.8rem; color: #b6c2d9; margin-bottom: 16px; }
.bank-sim dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.9rem; margin: 0 0 18px; }
.bank-sim dt { color: #b6c2d9; }
.bank-sim dd { margin: 0; font-weight: 600; }
.bank-sim .btn-lime { width: 100%; }
.bank-sim .decline { background: none; border: 0; color: #b6c2d9; width: 100%; margin-top: 8px; cursor: pointer; font: inherit; padding: 8px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; margin: 24px auto; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.h3 { font-size: 1.35rem; }
.view { padding: 0 0 40px; }

/* ---- onboarding ---- */
.docs { display: grid; gap: 10px; margin: 6px 0 18px; }
.doc-check { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 0.92rem; margin: 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--green); }
.doc-check details summary { cursor: pointer; font-size: 0.82rem; color: var(--green-dark); margin-top: 6px; font-weight: 600; }
.doc-text { max-height: 280px; overflow: auto; margin-top: 8px; padding: 12px 14px; background: var(--bg-soft); border-radius: 10px; font-size: 0.85rem; line-height: 1.55; }
.doc-text h2, .doc-text h3 { font-size: 0.95rem; margin: 1em 0 0.4em; }
.doc-text p, .doc-text ul, .doc-text ol { margin: 0 0 0.7em; }
.doc-text table { font-size: 0.8rem; }

.ob { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; margin: 28px 0 60px; align-items: start; }
@media (max-width: 860px) { .ob { grid-template-columns: 1fr; } }
.stepper { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; position: sticky; top: 16px; }
.stepper button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.stepper button[aria-current='step'] { background: #fff; border-color: var(--line); color: var(--ink); }
.stepper .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-tint); font-size: 0.8rem; font-weight: 800; color: var(--green-dark); flex: none; }
.stepper .done .num { background: var(--lime); color: var(--ink); }
@media (max-width: 860px) { .stepper { grid-auto-flow: column; overflow-x: auto; position: static; } .stepper button { white-space: nowrap; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.person { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.person .who { font-weight: 700; }
.badge-verified { background: var(--lime); color: var(--ink); }
.badge-failed, .badge-mismatch { background: var(--danger-soft); color: var(--danger); }
.badge-match { background: var(--lime); color: var(--ink); }
.badge-pending { background: var(--warn-soft); color: #6b4e00; }
.badge-active { background: var(--lime); color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; font-size: 0.92rem; margin: 0 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.status-card { text-align: center; padding: 40px 28px; }
.status-card .icon { font-size: 2.6rem; margin-bottom: 8px; }
.checklist { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.bank-approve { background: #1d2b4f; color: #fff; border-radius: 16px; padding: 20px; margin-top: 12px; }
.bank-approve .kv dt { color: #b9c3da; }
.bank-approve .kv dd { color: #fff; }
.ob > * { min-width: 0; }
#app-view { padding: 24px 0 48px; }
#app-view .grid-2 { align-items: start; }

/* ---- payer app (/me) ---- */
.me { max-width: 520px; margin: 0 auto; padding: 16px 16px 60px; }
.me-top { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 18px; }
.me-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin-bottom: 12px; }
.me-card h1 { font-size: 1.6rem; }
.me-h { font-size: 1.05rem; margin: 26px 0 10px; }
.points-card { background: var(--ink); color: #fff; border: 0; }
.points-card .small { color: #c3d3cb; }
.points { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.04em; color: var(--lime); line-height: 1.1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.points small { font-size: 1rem; color: #fff; letter-spacing: 0; font-weight: 600; }
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .cards-grid { grid-template-columns: 1fr; } }
.scratch { position: relative; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); aspect-ratio: 5 / 3; max-width: 100%; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; border-radius: 18px; }
.scratch-prize { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 12px; background: radial-gradient(circle at 50% 30%, var(--lime-soft), #fff 70%); }
.prize-label { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.scratch .reveal { position: absolute; right: 8px; bottom: 8px; background: #fff; }
.scratch-meta { position: absolute; left: 10px; bottom: 12px; color: var(--ink); font-weight: 600; pointer-events: none; }
.scratch.opened { aspect-ratio: auto; min-height: 90px; }
.scratch.opened .scratch-prize { position: static; padding: 18px 12px; }
.cat, .voucher { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.voucher code { font-weight: 700; background: var(--bg-soft); padding: 6px 10px; border-radius: 8px; }
.pay-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--green-dark); font-weight: 700; }
.me-settings { margin-top: 26px; display: grid; gap: 10px; }

/* checkout rewards strip */
.rewards-strip { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--lime-soft); border-radius: 14px; padding: 10px 12px; font-size: 0.85rem; margin: 12px 0; }
.rewards-strip .gift { font-size: 1.4rem; }
.earned { background: var(--lime-soft); border-radius: 14px; padding: 12px; margin: 14px 0; }
.earned strong { font-size: 1.1rem; }
a.rewards-strip { text-decoration: none; color: var(--ink); }
a.rewards-strip strong { color: var(--green-dark); }
.me section { padding: 0; }
.points { display: flex; align-items: baseline; gap: 10px; }

/* AI review panel */
.ai-panel { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 16px 0; background: var(--bg-soft); }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.ai-head h3 { margin: 0; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.ai-verdict { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ai-checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ai-checks li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: start; }
.badge-risk-low, .badge-check-pass { background: var(--lime); color: var(--ink); }
.badge-risk-medium, .badge-check-unknown { background: var(--warn-soft); color: #6b4e00; }
.badge-risk-high, .badge-check-concern { background: var(--danger-soft); color: var(--danger); }
