/* bayar.html (QRIS payment page) and admin.html (approve/reject QRIS payments). Builds on style.css tokens. */

/* The cards set display:flex, which would otherwise beat the [hidden] attribute the scripts toggle. */
.pay-page [hidden] { display: none !important; }
body.pay-page { min-height: 100%; overflow-y: auto; }
.pay-topbar { background: var(--navy); color: var(--bg); padding: calc(12px + var(--safe-top)) 16px 12px; }
.pay-topbar-inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pay-topbar.wide .pay-topbar-inner { max-width: 860px; }
.pay-topbar .pay-logo { height: 36px; width: auto; display: block; }
.pay-topbar .pay-who { font-size: 12.5px; color: var(--navy-muted); overflow-wrap: anywhere; }
.pay-topbar .btn-ghost { color: var(--bg); border-color: var(--navy-line); min-height: 38px; text-decoration: none; }
.pay-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.pay-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(32px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.pay-wrap.wide { max-width: 860px; }
.pay-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 4px 0 0; letter-spacing: -0.01em; }
.pay-sub { color: var(--muted); margin: 4px 0 0; line-height: 1.45; }
.pay-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.pay-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.pay-meta dt { color: var(--muted); }
.pay-meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

.qr-box { align-self: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-box img { width: min(300px, 72vw); height: auto; image-rendering: pixelated; display: block; }
.qr-box .qr-merchant { font-size: 12.5px; color: var(--muted); text-align: center; }
.qr-box .qr-merchant strong { color: var(--navy); }

.pay-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.pay-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.pay-field input { min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--white); padding: 0 14px; font-size: 15px; font-weight: 400; }
.pay-actions { display: flex; flex-direction: column; gap: 10px; }
.pay-actions .btn { width: 100%; text-decoration: none; white-space: normal; text-align: center; padding: 10px 16px; }
.btn-teal { background: var(--teal); color: #fff; }

.pay-note { border-radius: 14px; padding: 14px 16px; line-height: 1.45; border: 1px solid var(--line); background: var(--surface-alt); }
.pay-note strong { display: block; font-size: 15px; margin-bottom: 4px; }
.pay-note.ok { background: var(--teal-tint); border-color: #BFE0D9; color: var(--teal-text); }
.pay-note.wait { background: #FFF6E0; border-color: #F0DDA8; color: #6B5310; }
.pay-note.bad { background: var(--coral-tint); border-color: var(--coral-line); color: var(--warn-text); }
.pay-small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pay-small a { color: var(--teal-text); }
details.pay-more summary { cursor: pointer; color: var(--teal-text); font-weight: 600; }

/* admin.html */
.adm-hint { font-size: 13px; }
.adm-section h2 { font-size: 15px; margin: 6px 0 10px; display: flex; align-items: center; gap: 8px; }
.adm-count { font-family: var(--font-mono); font-size: 12px; background: var(--surface-alt); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.adm-list { display: flex; flex-direction: column; gap: 10px; }
.adm-order { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.adm-order.focus { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-tint); }
.adm-order-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.adm-produk-pilih { margin-bottom: 12px; }
.adm-amount { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.chip { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; letter-spacing: 0.02em; }
.chip.claimed { background: #FFF6E0; color: #6B5310; }
.chip.pending { background: var(--surface-alt); color: var(--muted); }
.chip.paid { background: var(--teal-tint); color: var(--teal-text); }
.chip.rejected, .chip.expired { background: var(--coral-tint); color: var(--warn-text); }
.adm-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-btns .btn { flex: 1 1 160px; }
.adm-empty { color: var(--muted); font-size: 13px; padding: 4px 2px; }

/* admin-tutorial.html */
.tad-h2 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.pay-field textarea, .pay-field select {
  border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--white); padding: 10px 14px;
  font-size: 15px; font-weight: 400; resize: vertical;
}
.pay-field select { min-height: 46px; }
.tad-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tad-source { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tad-source legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.tad-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; }
.tad-radio input { width: 18px; height: 18px; flex: none; accent-color: var(--teal); }
.tad-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.tad-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tad-link { color: var(--teal-text); overflow-wrap: anywhere; }
.adm-btns .btn-ghost, .adm-btns .btn-navy { flex: 1 1 100px; }

/* ---- Admin dashboard (admin-dashboard.html) ---- */
.pay-wrap.dash { max-width: 1120px; }
.pay-topbar.dash .pay-topbar-inner { max-width: 1120px; }
.dash-sec { display: flex; flex-direction: column; gap: 12px; }
.dash-sec > h2 { font-family: var(--font-display); font-size: 20px; margin: 10px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-sec > h2 .adm-count { font-family: var(--font-mono); }
.dash-sub { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dash-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.dash-tile .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.dash-tile .v { font-family: var(--font-display); font-size: clamp(19px, 5vw, 26px); font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-tile .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dash-tile.hero { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.dash-tile.hero .k, .dash-tile.hero .s { color: var(--navy-muted); }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.dash-card h3 { font-size: 14.5px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dash-card h3 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.dash-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.dash-range { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-produk { margin-top: 12px; }
.dash-range button { font: 600 12.5px var(--font-body); border: 1px solid var(--line-strong); background: var(--surface); color: var(--navy); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.dash-range button[aria-pressed="true"] { background: var(--navy); color: var(--bg); border-color: var(--navy); }
.dash-chart { position: relative; }
.dash-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.dash-chart .grid { stroke: var(--line); stroke-width: 1; }
.dash-chart .axis { font: 11px var(--font-mono); fill: var(--muted); }
.dash-chart .hit { fill: transparent; cursor: default; }
.dash-chart .hit:hover + .bar, .dash-chart .bar.on { opacity: .75; }
.dash-tip { position: absolute; pointer-events: none; background: var(--navy); color: var(--bg); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 6px 18px rgba(20,38,46,.25); z-index: 2; }
.dash-tip b { display: block; font-family: var(--font-display); font-size: 15px; }
.dash-funnel { display: flex; flex-direction: column; gap: 10px; }
.dash-fstep .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 4px; }
.dash-fstep .row b { font-family: var(--font-display); font-size: 16px; }
.dash-fstep .track { height: 14px; background: var(--surface-alt); border-radius: 4px; overflow: hidden; }
.dash-fstep .fill { height: 100%; background: var(--teal); border-radius: 0 4px 4px 0; }
.dash-fstep .conv { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dash-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dash-tools input[type=search] { flex: 1 1 220px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; font: 14px var(--font-body); background: var(--white); color: var(--navy); }
.dash-tools label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dash-tools .btn { min-height: 40px; }
.dash-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { text-align: left; font: 600 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.dash-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dash-table td.email { white-space: normal; overflow-wrap: anywhere; min-width: 200px; font-weight: 600; }
.dash-table td.num, .dash-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr.internal td { color: var(--muted); }
.dash-table .chip { white-space: nowrap; }
.chip.warn { background: #FFF6E0; color: #6B5310; }
.dash-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.dash-foot { font-size: 12px; color: var(--muted); }
.dash-body { display: flex; flex-direction: column; gap: 22px; width: 100%; min-width: 0; }
.dash-body > *, .dash-sec > *, .dash-grid2 > * { min-width: 0; max-width: 100%; }
.dash-body[hidden] { display: none; }
