:root {
  --blue: #0a4fe0;
  --blue-dark: #0838a8;
  --navy: #0d1b3e;
  --bg: #f4f7fd;
  --card: #ffffff;
  --muted: #5b6785;
  --line: #e1e7f3;
  --green: #12a150;
  --green-bg: #e6f7ee;
  --amber: #b26a00;
  --amber-bg: #fff4e0;
  --red: #c62828;
  --red-bg: #fdecec;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--navy);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, input, select { font: inherit; color: inherit; }

.shell { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.topbar img { height: 36px; width: auto; display: block; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }

.lang { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.link { background: none; border: 0; color: var(--blue); font-weight: 600; cursor: pointer; padding: 6px 4px; font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(13, 27, 62, .06), 0 6px 24px rgba(13, 27, 62, .05); margin-bottom: 16px; }
.card h1 { font-size: 22px; margin: 0 0 6px; }
.card h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; line-height: 1.5; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 16px; }
input:focus, select:focus { outline: 2px solid rgba(10, 79, 224, .25); border-color: var(--blue); }
input.code { letter-spacing: 10px; font-size: 26px; text-align: center; font-weight: 700; }
input.amount { font-size: 30px; font-weight: 700; text-align: center; }

.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font-weight: 700; font-size: 16px; cursor: pointer; margin-top: 18px; background: var(--blue); color: #fff; }
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 4px; font-size: 13px; font-weight: 600; cursor: pointer; }

.msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; line-height: 1.45; }
.msg.err { background: var(--red-bg); color: var(--red); }
.msg.info { background: #eaf0fd; color: var(--blue-dark); }
.msg.warn { background: var(--amber-bg); color: var(--amber); }

.chip { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.chip.paid, .chip.live { background: var(--green-bg); color: var(--green); }
.chip.pending, .chip.registered, .chip.draft { background: var(--amber-bg); color: var(--amber); }
.chip.failed, .chip.expired, .chip.cancelled, .chip.suspended, .chip.refunded { background: var(--red-bg); color: var(--red); }

.merchant { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.merchant .name { font-weight: 700; font-size: 17px; }
.merchant .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.qr { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr .box { width: min(78vw, 300px); aspect-ratio: 1; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.qr .box svg { width: 100%; height: 100%; display: block; }
.qr .amt { font-size: 30px; font-weight: 800; margin: 14px 0 2px; }
.qr .who { color: var(--muted); font-size: 14px; }
.qr .timer { margin-top: 8px; font-size: 13px; color: var(--muted); }
.done { font-size: 64px; line-height: 1; margin: 8px 0; }
.done.ok { color: var(--green); }
.done.bad { color: var(--red); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .l1 { font-weight: 700; }
.list .l2 { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list .r { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; font-size: 14px; }

.big { font-size: 32px; font-weight: 800; margin: 4px 0 8px; }
.rows { margin-top: 8px; }
.rows div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rows div:last-child { border-bottom: 0; }
.rows span:first-child { color: var(--muted); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs .in { display: flex; width: 100%; max-width: 560px; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 4px 14px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button .ic { display: block; font-size: 20px; margin-bottom: 2px; }
.tabs button.on { color: var(--blue); }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; line-height: 1.6; }
.center { text-align: center; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: s 0.8s linear infinite; vertical-align: -3px; }
@keyframes s { to { transform: rotate(360deg); } }
