:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #152033;
  --muted: #65738a;
  --line: #dce4ee;
  --primary: #1267e9;
  --primary-dark: #0b4fb8;
  --success: #159a62;
  --warning: #c97904;
  --danger: #d9485f;
  --shadow: 0 18px 45px rgba(31, 51, 73, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar { min-height: 72px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: #fff; font-size: 13px; font-weight: 800; background: linear-gradient(140deg, #0e5de2, #41a2ff); box-shadow: 0 9px 20px rgba(18,103,233,.25); }
.brand-centered { justify-content: center; margin-bottom: 30px; }
.nav-links { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.nav-links > a:not(.button) { color: var(--muted); padding: 10px 12px; border-radius: 10px; }
.nav-links > a:not(.button):hover { background: var(--surface-2); color: var(--text); }
.nav-links form { margin: 0; }

.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.container.narrow { width: min(850px, calc(100% - 40px)); }
.page-stack { padding: 42px 0 60px; display: grid; gap: 26px; }
.page-heading h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.045em; margin: 4px 0 8px; line-height: 1.05; }
.page-heading p { color: var(--muted); margin: 0; }
.split-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.eyebrow { margin: 0 0 8px !important; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: var(--primary) !important; }
.back-link { display: inline-block; color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.text-link { color: var(--primary); font-weight: 700; font-size: 14px; }

.button { border: 0; border-radius: 11px; padding: 12px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; transition: .18s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--primary); box-shadow: 0 9px 20px rgba(18,103,233,.18); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: #eaf1fb; color: #264363; }
.button-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button-success { color: white; background: var(--success); }
.button-small { padding: 9px 12px; font-size: 13px; border-radius: 9px; }
.button-block { width: 100%; }
.button-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.mode-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.mode-pill span { width: 8px; height: 8px; border-radius: 999px; }
.mode-demo { background: #fff2dc; color: #9c5b00; }.mode-demo span { background: #f4a11a; }
.mode-live { background: #ddf8eb; color: #087b4a; }.mode-live span { background: #0eac67; box-shadow: 0 0 0 5px rgba(14,172,103,.12); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { min-height: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 8px 30px rgba(31,51,73,.04); }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { font-size: clamp(24px, 2.5vw, 32px); letter-spacing: -.04em; }
.stat-card small { color: var(--muted); }
.stat-primary { background: linear-gradient(145deg, #0f60df, #2385f6); color: #fff; border-color: transparent; box-shadow: 0 17px 35px rgba(15,96,223,.22); }
.stat-primary span, .stat-primary small { color: rgba(255,255,255,.78); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(31,51,73,.045); overflow: hidden; }
.panel-heading { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.02em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 16px 22px; text-align: left; border-bottom: 1px solid #ebf0f5; font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: #fbfcfe; }
td small { display: block; color: var(--muted); margin-top: 4px; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; transition: background .15s ease; }
.clickable-row:hover { background: #f8fbff; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.status-large { padding: 10px 15px; font-size: 13px; }
.status-pending { background: #fff1d7; color: #9b5c02; }
.status-settlement { background: #dcf7e9; color: #087b4a; }
.status-expired { background: #edf0f5; color: #627087; }
.status-failed { background: #ffe2e6; color: #b5263b; }
.delivery { text-transform: capitalize; font-size: 12px; font-weight: 800; }
.delivery-delivered { color: var(--success); }.delivery-failed { color: var(--danger); }.delivery-retrying, .delivery-pending { color: var(--warning); }

.filters { display: grid; grid-template-columns: minmax(250px, 1fr) 210px auto; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
input, select { width: 100%; border: 1px solid #cfd9e5; background: white; border-radius: 11px; padding: 12px 13px; outline: none; color: var(--text); transition: .15s; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(18,103,233,.1); }
label { display: grid; gap: 8px; color: #32425a; font-size: 13px; font-weight: 700; }
label > span { color: var(--danger); }
label small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.form-panel { padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-grid .full { grid-column: 1 / -1; }
.section-divider { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 20px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .08em; font-weight: 800; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 22px; }
.money-input { display: flex; align-items: center; border: 1px solid #cfd9e5; border-radius: 11px; overflow: hidden; }
.money-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(18,103,233,.1); }
.money-input span { padding-left: 13px; color: var(--muted); font-weight: 800; }
.money-input input { border: 0; box-shadow: none !important; }
.alert { border-radius: 12px; padding: 13px 15px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fff0f2; color: #ad2438; border: 1px solid #ffcbd3; }

.detail-grid { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 24px; }
.payment-preview { padding: 28px; text-align: center; }
.qr-frame { width: min(100%, 290px); aspect-ratio: 1; margin: 0 auto; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: white; box-shadow: inset 0 0 0 7px #f7f9fc; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; image-rendering: crisp-edges; }
.detail-amount { display: block; margin: 18px 0; font-size: 29px; letter-spacing: -.04em; }
.detail-list { margin: 0; padding: 8px 24px 24px; }
.detail-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid #edf1f5; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; font-size: 14px; text-align: right; }
code { font-family: "SFMono-Regular", Consolas, monospace; background: #eef3f8; color: #32516f; padding: 3px 6px; border-radius: 6px; font-size: 11px; }
.break-word { overflow-wrap: anywhere; }

.empty-state { text-align: center; padding: 56px 20px; }
.empty-state.compact { padding: 34px 20px; }
.empty-state h3 { margin: 8px 0; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }
.empty-icon { margin: 0 auto 12px; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: #e8f1ff; color: var(--primary); font-size: 24px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 20px 35px; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 560px) 1fr; }
.auth-card { background: white; padding: clamp(42px, 7vw, 90px); display: flex; flex-direction: column; justify-content: center; }
.auth-copy h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -.055em; margin: 0 0 18px; }
.auth-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; margin-bottom: 32px; }
.form-stack { display: grid; gap: 17px; }
.auth-visual { position: relative; overflow: hidden; display: grid; place-items: center; background: linear-gradient(145deg, #0755cc 0%, #1679ef 58%, #6cbaff 100%); }
.visual-orb { position: absolute; border-radius: 999px; filter: blur(2px); background: rgba(255,255,255,.14); }
.orb-one { width: 420px; height: 420px; top: -130px; right: -100px; }.orb-two { width: 520px; height: 520px; bottom: -270px; left: -130px; }
.mock-phone { width: min(330px, 60%); min-height: 480px; background: rgba(255,255,255,.96); border-radius: 38px; box-shadow: 0 40px 90px rgba(0,24,74,.28); padding: 60px 32px; text-align: center; transform: rotate(3deg); position: relative; }
.mock-title { color: var(--muted); font-size: 14px; }.mock-check { margin: 50px auto 35px; width: 80px; height: 80px; border-radius: 999px; display: grid; place-items: center; color: white; background: var(--success); font-size: 39px; box-shadow: 0 15px 35px rgba(21,154,98,.25); }.mock-amount { font-size: 34px; font-weight: 850; letter-spacing: -.04em; }.mock-meta { margin-top: 11px; color: var(--muted); font-size: 13px; }

.checkout-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 24px; }
.checkout-brand { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.secure-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.checkout-card { min-height: 625px; display: grid; grid-template-columns: 43% 57%; overflow: hidden; background: var(--surface); border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.checkout-summary { padding: clamp(30px, 5vw, 60px); background: linear-gradient(160deg, #f9fbfe, #edf4fc); border-right: 1px solid var(--line); }
.checkout-summary h1 { margin: 5px 0 16px; font-size: clamp(37px, 5vw, 54px); letter-spacing: -.06em; }
.order-chip { display: inline-block; color: #35526f; background: white; border: 1px solid var(--line); padding: 8px 11px; border-radius: 9px; font-family: monospace; font-size: 12px; margin-bottom: 42px; }
.checkout-summary dl { margin: 0; }
.checkout-summary dl > div { display: grid; gap: 5px; padding: 16px 0; border-bottom: 1px solid #dce5ef; }
.checkout-summary dt { color: var(--muted); font-size: 12px; }.checkout-summary dd { margin: 0; font-weight: 700; font-size: 14px; }
.checkout-help { margin-top: 38px; padding: 16px; border-radius: 13px; background: rgba(255,255,255,.7); }
.checkout-help strong { font-size: 13px; }.checkout-help p { color: var(--muted); margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.checkout-payment { padding: clamp(30px, 5vw, 58px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.checkout-payment h2 { margin: 2px 0 10px; font-size: 28px; letter-spacing: -.035em; }
.checkout-payment p:not(.eyebrow) { color: var(--muted); margin: 0 auto 25px; max-width: 400px; line-height: 1.55; }
.checkout-qr { width: 305px; }
.scan-note { margin-top: 17px; display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.scan-note span { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }
.qris-footer { margin-top: 28px; display: flex; align-items: baseline; gap: 10px; color: #31506d; }.qris-footer strong { font-size: 23px; letter-spacing: .05em; }.qris-footer span { font-size: 11px; color: var(--muted); }
.state-icon { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 26px; color: #fff; font-size: 35px; font-weight: 850; }.success-icon { background: var(--success); box-shadow: 0 16px 35px rgba(21,154,98,.25); }.failed-icon { background: var(--danger); }
.checkout-footer { text-align: center; color: var(--muted); font-size: 11px; margin-top: 20px; }

.error-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; }.error-code { width: 70px; height: 70px; border-radius: 20px; display: grid; place-items: center; background: #ffe6e9; color: var(--danger); font-size: 34px; font-weight: 900; }.error-page h1 { margin: 20px 0 8px; font-size: 35px; }.error-page p { color: var(--muted); margin: 0 0 24px; }

@media (max-width: 960px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .payment-preview { order: 2; }
  .auth-shell { grid-template-columns: 1fr; }.auth-visual { display: none; }
  .checkout-card { grid-template-columns: 1fr; }.checkout-summary { border-right: 0; border-bottom: 1px solid var(--line); }.checkout-summary dl, .checkout-help { display: none; }.checkout-summary { padding: 28px; }.checkout-summary h1 { margin-bottom: 8px; }.order-chip { margin-bottom: 0; }
}

@media (max-width: 700px) {
  .topbar { padding: 12px 18px; align-items: flex-start; }.nav-links { flex-wrap: wrap; justify-content: flex-end; }.nav-links > a:not(.button) { display: none; }
  .container, .container.narrow { width: min(100% - 24px, 1180px); }
  .page-stack { padding-top: 28px; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }.form-grid .full { grid-column: auto; }.form-actions { flex-direction: column-reverse; }.form-actions .button { width: 100%; }
  .detail-list > div { grid-template-columns: 1fr; gap: 5px; }.detail-list dd { text-align: left; }
  .auth-card { padding: 38px 24px; }
  .checkout-shell { width: min(100% - 20px, 1040px); padding-top: 18px; }.checkout-brand { margin-bottom: 15px; }.secure-label { display: none; }.checkout-card { border-radius: 18px; }.checkout-payment { padding: 34px 18px; }.checkout-qr { width: min(280px, 88vw); }
}

.alert-success { background: #e6f8ef; color: #087b4a; border: 1px solid #bfead4; }
.auth-actions { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-centered-link { text-align: center; }
.otp-input { text-align: center; font-size: 24px; font-weight: 850; letter-spacing: .35em; padding-left: calc(13px + .35em); }
.auth-visual-otp { background: linear-gradient(145deg, #084fbd, #1679ef 55%, #79c4ff); }
.otp-visual-card { width: min(380px, 72%); padding: 44px; border-radius: 28px; text-align: center; background: rgba(255,255,255,.95); box-shadow: 0 40px 90px rgba(0,24,74,.28); position: relative; }
.otp-visual-card > span { width: 78px; height: 78px; margin: 0 auto 24px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: var(--primary); font-size: 34px; font-weight: 900; }
.otp-visual-card strong { display: block; font-size: 25px; letter-spacing: -.03em; }
.otp-visual-card p { color: var(--muted); line-height: 1.55; margin: 12px 0 0; }
