:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #0e1726;
  --muted: #5b6878;
  --line: #e2e7ec;
  --accent: #0b7a6e;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4f1;
  --warn: #9a5b00;
  --warn-soft: #fff4dc;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --ok: #0b7a45;
  --ok-soft: #e2f6ea;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1016;
    --surface: #131a22;
    --surface-2: #18212b;
    --ink: #e8edf2;
    --muted: #94a2b3;
    --line: #25303c;
    --accent: #2bb5a4;
    --accent-ink: #04201c;
    --accent-soft: #12332f;
    --warn: #f0b95a;
    --warn-soft: #33270f;
    --danger: #ff8a80;
    --danger-soft: #3a1917;
    --ok: #5fd08f;
    --ok-soft: #12301f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.right { text-align: right; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover, .btn:hover { border-color: var(--muted); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 6px 8px; }
button.ghost:hover { color: var(--ink); }
button:disabled { opacity: 0.55; cursor: default; }
button.block, .btn.block { width: 100%; }

label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
}
textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; min-height: 62px; word-break: break-all; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.confirming, .badge.pending { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.underpaid, .badge.testnet { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.expired { background: var(--surface-2); color: var(--muted); }

.notice { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Ödeme sayfası ---------- */
.checkout { min-height: 100dvh; display: grid; place-items: start center; padding: 28px 16px 40px; }
.pay-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.pay-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.pay-head .brand { font-weight: 700; letter-spacing: 0.01em; }
.pay-head .total { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.pay-body { padding: 20px; display: grid; gap: 16px; }
.pay-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); text-align: center; }

.asset-list { display: grid; gap: 8px; }
.asset-btn { justify-content: space-between; padding: 13px 14px; font-weight: 600; }
.asset-btn span:last-child { font-weight: 500; color: var(--muted); font-size: 13px; }

.field { display: grid; gap: 6px; }
.field > .label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 10px 10px 12px;
}
.copy-box .value { flex: 1; min-width: 0; font-family: var(--mono); word-break: break-all; }
.copy-box .value.big { font-size: 20px; font-weight: 700; font-family: inherit; }
.copy-box button { padding: 6px 10px; font-size: 13px; flex: none; }

.qr { justify-self: center; width: 188px; height: 188px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--line); }
.qr img { width: 100%; height: 100%; display: block; }

.status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.result { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0; }
.result .icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.result .icon.ok { background: var(--ok-soft); color: var(--ok); }
.result .icon.off { background: var(--surface-2); color: var(--muted); }
.result h2 { font-size: 20px; }
.tx-list { display: grid; gap: 6px; font-size: 13px; width: 100%; }
.tx-list a { font-family: var(--mono); }
.tx-list .tx { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Panel ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; }
.tabs button.active { background: var(--accent-soft); color: var(--accent); }
.page { max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { font-size: 16px; margin-bottom: 4px; }
.card > .stack { margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.stat .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }

.table-wrap { overflow-x: auto; margin: 0 -18px -18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 18px; border-top: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td.empty { text-align: center; color: var(--muted); padding: 28px; cursor: default; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; }
.login h1 { font-size: 20px; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 0; width: min(620px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(6, 12, 20, 0.55); }
dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
dialog .dialog-body { padding: 18px; display: grid; gap: 14px; max-height: 72vh; overflow-y: auto; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font: 12.5px/1.55 var(--mono); margin: 0; }

tbody.static tr { cursor: default; }
tbody.static tr:hover { background: transparent; }
.badge.sent, .badge.active { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.approved, .badge.sending { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.rejected, .badge.suspended { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
button.danger { color: var(--danger); }
button.small { padding: 5px 10px; font-size: 13px; }

input.check { width: auto; }
label.row { font-weight: 500; color: var(--ink); grid-auto-flow: column; justify-content: start; }

.stack > *, .page > * { min-width: 0; }
.table-wrap.inline { margin-bottom: 0; }
.card.stack > .stack { margin-top: 0; }
