/* OrbytPay design system — white & gold */

:root {
  --paper: #fffcf7;
  --paper-2: #faf6ee;
  --ink: #1a1612;
  --ink-2: #5c5348;
  --ink-3: #8a8070;
  --line: #e8dfc8;
  --accent: #c9a227;
  --accent-2: #9a7b1a;
  --accent-soft: #faf3e0;
  --gold: #d4af37;
  --gold-soft: #f5ecd4;
  --success: #1a7a4a;
  --success-soft: #e8f5ee;
  --warn: #9a6b0a;
  --warn-soft: #faf0da;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(26, 22, 18, .04), 0 8px 28px rgba(26, 22, 18, .07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ nav */
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 247, .94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav .brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav .brand:hover { text-decoration: none; }
.nav .brand .orb {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--ink);
  position: relative;
  display: inline-block;
}
.nav .brand .orb::after {
  content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); top: -3px; right: -2px;
}
.nav .links { display: flex; gap: 22px; margin-left: 12px; }
.nav .links a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.nav .links a.active { color: var(--ink); font-weight: 600; }
.nav .links a:hover { color: var(--ink); text-decoration: none; }
.nav .spacer { flex: 1; }
.nav-toggle { display: none; }
.nav-divider { width: 1px; height: 18px; background: var(--line); margin: 0 4px; align-self: center; }

.mode-pill {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid rgba(146, 97, 10, .18);
}
.mode-pill.live { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(201, 162, 39, .35); }

/* ----------------------------------------------------------------- page */
.wrap { max-width: 1120px; margin: 0 auto; padding: 44px 40px 80px; }
.wrap.narrow { max-width: 660px; }

.page-head { margin-bottom: 34px; }
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 10px;
}
h1 { font-size: 34px; letter-spacing: -.03em; margin: 0 0 8px; font-weight: 700; }
.sub { color: var(--ink-2); margin: 0; max-width: 56ch; }

/* ---------------------------------------------------------------- cards */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
}
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .ledger-grid { grid-template-columns: 1fr !important; }
  .wrap { padding: 28px 16px 60px; }
  .nav { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .nav .links { gap: 10px; flex-wrap: wrap; }
  h1 { font-size: 26px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table { min-width: 560px; }
  .footer { padding: 24px 16px; }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 48px; }
}

@media (max-width: 640px) {
  .nav .links { display: none; width: 100%; flex-direction: column; padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 8px; }
  .nav.menu-open .links { display: flex; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; font-size: 20px; cursor: pointer; margin-left: auto;
    -webkit-tap-highlight-color: transparent;
  }
  .grid.cols-4 { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .rail-pick { grid-template-columns: 1fr; }
}

.stat .label { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; display: flex; gap: 7px; align-items: center; }
.stat .value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 6px; color: var(--ink-2); }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field { margin-bottom: 18px; }
.field .note { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: #fff;
  font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform .08s, opacity .15s;
  width: 100%;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); opacity: 1; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.slim { width: auto; padding: 9px 16px; font-size: 14px; border-radius: 10px; }

/* --------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
td { padding: 13px 14px; border-bottom: 1px solid var(--paper-2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--paper); }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.ref { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  text-transform: none;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.pending, .badge.processing { background: var(--warn-soft); color: var(--warn); }
.badge.failed, .badge.expired { background: var(--danger-soft); color: var(--danger); }

/* -------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 30px; }
.timeline li::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: -4px;
  width: 2px; background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
  content: ""; position: absolute; left: 2px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
}
.timeline .t-label { font-weight: 600; font-size: 14.5px; }
.timeline .t-time { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }

/* ---------------------------------------------------------------- feed */
.feed { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.feed li { padding: 12px 4px; border-bottom: 1px solid var(--paper-2); display: flex; gap: 12px; align-items: baseline; }
.feed .f-type { font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.feed .f-sum { font-size: 14px; color: var(--ink-2); flex: 1; }
.feed .f-time { font-size: 12px; color: var(--ink-3); font-family: var(--mono); white-space: nowrap; }

/* --------------------------------------------------------------- extras */
.empty { text-align: center; color: var(--ink-3); padding: 44px 20px; }
.empty .glyph { font-size: 34px; display: block; margin-bottom: 10px; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 18px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); font-weight: 500; margin: 0; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.hash { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }

.divider { border: none; border-top: 1px solid var(--line); margin: 26px 0; }

.alert { border-radius: 12px; padding: 13px 16px; font-size: 14px; margin-bottom: 18px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--success-soft); color: var(--success); }

.footer {
  border-top: 1px solid var(--line);
  padding: 30px 40px; text-align: center;
  color: var(--ink-3); font-size: 13.5px;
}
.footer .tag { letter-spacing: .05em; }

/* ----------------------------------------------- verification cascade */
.vsteps { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; }
.vsteps li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--paper-2); }
.vsteps li:last-child { border-bottom: none; }
.vs-ic { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--paper-2); color: var(--ink-3); transition: all .3s; }
.vsteps li.doing .vs-ic { background: var(--accent-soft); color: var(--accent); }
.vsteps li.doing .vs-ic::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: vspin .9s linear infinite; }
.vsteps li.doing .vs-ic span { display: none; }
.vsteps li.done .vs-ic { background: var(--success-soft); color: var(--success); animation: vpop .4s cubic-bezier(.2,1.4,.4,1); }
.vsteps li.fail .vs-ic { background: var(--danger-soft); color: var(--danger); }
.vsteps .vs-t { font-weight: 600; font-size: 14.5px; }
.vsteps .vs-s { font-size: 12.5px; color: var(--ink-3); }
.vsteps li.wait { opacity: .5; }
@keyframes vspin { to { transform: rotate(360deg); } }
@keyframes vpop { from { transform: scale(.4); opacity: 0; } }

/* Big status orb on receipt */
.orb-status {
  width: 84px; height: 84px; margin: 6px auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
}
.orb-status.success { background: var(--success-soft); color: var(--success); }
.orb-status.pending { background: var(--warn-soft); color: var(--warn); }
.orb-status.failed { background: var(--danger-soft); color: var(--danger); }
.orb-status.pending .spin { animation: orbit 1.6s linear infinite; display: inline-block; }
@keyframes orbit { to { transform: rotate(360deg); } }

.rail-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rail-pick button {
  padding: 16px 14px; border-radius: 13px; border: 1.5px solid var(--line);
  background: #fff; font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-align: left; color: var(--ink); transition: border-color .12s, background .12s;
}
.rail-pick button .r-icon { display: block; font-size: 20px; margin-bottom: 6px; }
.rail-pick button:hover { border-color: var(--ink-2); }
.rail-pick button.on { border-color: var(--accent); background: var(--accent-soft); }
