/* ============================================================
   Crypto Portal — admin design system
   Aesthetic: brutalist financial terminal.
   Mono-first, sharp 1px borders, zero radius, single acid-lime accent.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg:           #0c0c0d;
  --surface:      #141416;
  --surface-2:    #1a1a1d;
  --surface-hi:   #202024;
  --border:       #26262b;
  --border-strong:#3a3a42;
  --fg:           #e8e6e0;
  --fg-muted:     #9a9aa3;
  --fg-dim:       #5e5e66;

  --accent:       #c5ff00;
  --accent-dim:   #6f8f00;
  --success:      #7df47a;
  --warning:      #ffba49;
  --danger:       #ff5470;
  --info:         #5ac8ff;
  --magenta:      #ff5cf0;

  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --font-display: 'Space Grotesk', system-ui, sans-serif;

  --sidebar-w:    248px;
  --topbar-h:     56px;

  --shadow-pop:   0 8px 32px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.04) 1px, transparent 0);
  background-size: 24px 24px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 14px; }

.display-num { font-family: var(--font-display); font-weight: 600; font-size: 56px;
               line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.label-cap   { font-family: var(--font-mono); font-size: 10px; font-weight: 500;
               text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-muted); }

.muted { color: var(--fg-muted); }
.dim   { color: var(--fg-dim); }

a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border-strong); transition: border-color .15s; }
a:hover { border-color: var(--accent); }
a.plain, nav a { border-bottom: 0; }

code, .mono { font-family: var(--font-mono); font-size: 12px; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  color: var(--fg);
}

::selection { background: var(--accent); color: var(--bg); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr;
       grid-template-areas: "brand topbar" "side main"; min-height: 100vh; }

.brand-cell {
  grid-area: brand;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; background: var(--surface);
}
.brand-mark {
  width: 14px; height: 14px; background: var(--accent);
  box-shadow: 0 0 12px rgba(197,255,0,.55);
}
.brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.brand-version { color: var(--fg-dim); font-size: 10px; margin-left: auto; }

.topbar {
  grid-area: topbar; border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; padding: 0 24px;
  position: relative;
}
.topbar::after { /* thin acid-lime hairline under the topbar */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 30%);
  opacity: 0.5;
}
.topbar .crumbs { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.topbar .crumbs strong { color: var(--fg); font-weight: 500; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--fg-muted); }
.topbar .right a { color: var(--fg-muted); border-bottom: 0; }
.topbar .right a:hover { color: var(--accent); }
.topbar .pulse { width: 6px; height: 6px; background: var(--success); border-radius: 50%;
                 box-shadow: 0 0 8px var(--success); animation: pulse 2s infinite; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Sidebar ---------- */
.sidebar {
  grid-area: side; border-right: 1px solid var(--border); background: var(--surface);
  padding: 24px 0; overflow-y: auto;
}
.sidebar .nav-section { padding: 0 0 8px; }
.sidebar .nav-section-title {
  padding: 0 24px 8px; font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-dim);
}
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 24px; font-size: 13px; color: var(--fg-muted);
  border-bottom: 0; border-left: 2px solid transparent;
  transition: all .12s ease;
}
.sidebar a:hover { color: var(--fg); background: var(--surface-2); }
.sidebar a.active {
  color: var(--accent); border-left-color: var(--accent); background: var(--surface-2);
}
.sidebar a .nav-icon {
  width: 14px; height: 14px; border: 1px solid currentColor; flex-shrink: 0;
}
.sidebar a.active .nav-icon { background: var(--accent); }

/* ---------- Main ---------- */
main {
  grid-area: main; padding: 32px 40px 80px;
  animation: rise .28s ease-out both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 28px; gap: 24px; flex-wrap: wrap;
}
.page-head h1 { display: flex; align-items: baseline; gap: 12px; }
.page-head h1 .index {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  color: var(--fg-dim); letter-spacing: 0.1em;
}
.page-sub { color: var(--fg-muted); font-size: 12px; max-width: 56ch; line-height: 1.6; }

/* ---------- Tiles (dashboard KPIs) ---------- */
.tiles {
  display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); margin-bottom: 32px;
  grid-template-columns: 1fr 1fr 2fr;  /* asymmetric on purpose */
}
.tile { background: var(--surface); padding: 20px 24px; }
.tile .label-cap { margin-bottom: 12px; }
.tile .display-num { color: var(--fg); }
.tile .delta { font-size: 11px; color: var(--fg-muted); margin-top: 8px; }
.tile.accent .display-num { color: var(--accent); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 24px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
                letter-spacing: 0.12em; font-weight: 500; color: var(--fg-muted); }

/* ---------- Table ---------- */
.table-wrap {
  border: 1px solid var(--border); background: var(--surface); overflow-x: auto;
}
table.data {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: 12px;
}
table.data thead th {
  position: sticky; top: 0;
  text-align: left; padding: 12px 14px;
  font-weight: 500; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--fg-muted);
  background: var(--surface); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr td strong { font-family: var(--font-display); font-weight: 600; }
table.data .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 8px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--fg);
  white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; background: currentColor; }
.pill.confirmed,.pill.delivered,.pill.ok       { color: var(--success); border-color: var(--success); }
.pill.awaiting,.pill.awaitingpayment,.pill.pending,.pill.await { color: var(--warning); border-color: var(--warning); }
.pill.seen,.pill.info                           { color: var(--info); border-color: var(--info); }
.pill.underpaid,.pill.expired,.pill.cancelled,.pill.latepayment,.pill.failed,.pill.dead,.pill.err { color: var(--danger); border-color: var(--danger); }
.pill.overpaid                                  { color: var(--magenta); border-color: var(--magenta); }
.pill.enabled,.pill.on                          { color: var(--success); border-color: var(--success); }
.pill.disabled,.pill.off                        { color: var(--danger); border-color: var(--danger); }
.pill.admin                                     { color: var(--info); border-color: var(--info); }
.pill.merchant                                  { color: var(--success); border-color: var(--success); }
.pill.system                                    { color: var(--fg-muted); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label, label.field-label {
  display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-muted);
  margin-bottom: 6px;
}

input[type=text], input[type=password], input[type=email], input[type=number],
input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; font-family: var(--font-mono); font-size: 13px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong);
  outline: none; transition: border-color .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
                    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat; padding-right: 36px;
}
::placeholder { color: var(--fg-dim); }

/* ---------- Buttons ---------- */
button, .btn {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 9px 16px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--fg);
  cursor: pointer; transition: all .12s;
  display: inline-flex; align-items: center; gap: 8px;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.4; cursor: not-allowed; border-color: var(--border); }
button:disabled:hover { color: var(--fg); }
button.primary, .btn.primary {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
button.primary:hover, .btn.primary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
button.danger, .btn.danger { color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger); color: var(--bg); }
button.ghost, .btn.ghost { background: transparent; }
button.sm { padding: 5px 10px; font-size: 10px; }

/* ---------- Toolbar (page-level filter strip) ---------- */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 16px;
}
.toolbar .label-cap { margin: 0; }
.toolbar .grow { flex: 1; }

/* ---------- Status banners ---------- */
.banner { padding: 12px 16px; border: 1px solid; font-size: 12px; margin: 12px 0; }
.banner.ok    { color: var(--success); border-color: var(--success); background: rgba(125,244,122,0.05); }
.banner.err   { color: var(--danger);  border-color: var(--danger);  background: rgba(255,84,112,0.05); }
.banner.warn  { color: var(--warning); border-color: var(--warning); background: rgba(255,186,73,0.05); }
.banner a     { color: inherit; text-decoration: underline; }

/* Node status page accents */
.pill.warn { color: var(--warning); border-color: var(--warning); }
.warn { color: var(--warning); }
.err  { color: var(--danger); }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(2px);
}
.modal-bg.open { display: flex; }
.modal-card {
  background: var(--surface); border: 1px solid var(--border-strong);
  padding: 28px; max-width: 560px; width: 90%; box-shadow: var(--shadow-pop);
}
.modal-card h2 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- Token reveal ---------- */
.token-reveal {
  font-family: var(--font-mono); font-size: 13px; word-break: break-all;
  padding: 14px; border: 1px solid var(--accent); background: var(--surface-2);
  color: var(--accent);
}

/* ---------- Chips (event subscription tags) ---------- */
.chip {
  display: inline-block; padding: 2px 8px; font-size: 10px;
  font-family: var(--font-mono); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--fg-muted);
}
.chip.empty { font-style: italic; color: var(--fg-dim); border-style: dashed; }

/* ---------- Disclosure (details/summary) ---------- */
details { background: var(--surface); border: 1px solid var(--border); margin-top: 16px; }
details > summary {
  cursor: pointer; padding: 14px 20px; list-style: none;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg);
  display: flex; align-items: center; gap: 10px;
}
details > summary::before { content: '+'; color: var(--accent); font-size: 14px; }
details[open] > summary::before { content: '−'; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { border-bottom: 1px solid var(--border); }
details > .details-body { padding: 20px; }

/* ---------- Address preview row ---------- */
.addr-row {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg); border: 1px solid var(--border);
  padding: 10px 12px; margin: 4px 0; word-break: break-all;
}
.addr-row .idx { color: var(--accent); margin-right: 12px; }

/* ---------- Diff JSON in audit log ---------- */
pre.diff {
  margin: 0; font-family: var(--font-mono); font-size: 11px; line-height: 1.5;
  color: var(--fg-muted); white-space: pre-wrap; word-break: break-word;
  max-width: 480px;
}

/* ---------- Login page (centered card) ---------- */
.login-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.04) 1px, transparent 0),
    radial-gradient(ellipse at 50% 0%, rgba(197,255,0,0.04) 0%, transparent 60%);
  background-size: 24px 24px, 100% 100%;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 36px 32px;
  animation: rise .35s ease-out both;
  position: relative;
}
.login-card::before {
  content: ''; position: absolute; top: -1px; left: -1px; width: 24px; height: 24px;
  border-top: 1px solid var(--accent); border-left: 1px solid var(--accent);
}
.login-card::after {
  content: ''; position: absolute; bottom: -1px; right: -1px; width: 24px; height: 24px;
  border-bottom: 1px solid var(--accent); border-right: 1px solid var(--accent);
}
.login-card .brand-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
}
.login-card h1 { font-size: 22px; margin-bottom: 28px; }

/* ---------- Hosted checkout ---------- */
.checkout-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.checkout-card {
  width: 100%; max-width: 480px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 28px;
  animation: rise .35s ease-out both; position: relative;
}
.checkout-card::before {
  content: ''; position: absolute; top: -1px; left: -1px; width: 32px; height: 32px;
  border-top: 1px solid var(--accent); border-left: 1px solid var(--accent);
}
.checkout-card::after {
  content: ''; position: absolute; bottom: -1px; right: -1px; width: 32px; height: 32px;
  border-bottom: 1px solid var(--accent); border-right: 1px solid var(--accent);
}
.checkout-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.checkout-head h1 {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-muted);
  font-weight: 500;
}
.qr-frame {
  background: #ffffff; padding: 16px; margin: 16px 0; display: grid; place-items: center;
}
.qr-frame svg { width: 100%; max-width: 240px; height: auto; }
.checkout-amount { text-align: center; margin: 16px 0 4px; }
.checkout-amount .num {
  font-family: var(--font-display); font-weight: 600;
  font-size: 36px; letter-spacing: -0.02em; word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.checkout-amount .unit {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted);
  margin-left: 8px; text-transform: uppercase; letter-spacing: 0.1em;
}
.checkout-fiat {
  text-align: center; color: var(--fg-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 20px;
}
.checkout-row { padding: 14px 0; border-top: 1px solid var(--border); }
.checkout-row .row-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-muted); margin-bottom: 8px;
}
.checkout-row.required .row-head { color: var(--warning); }
.checkout-row .badge {
  background: var(--warning); color: var(--bg);
  padding: 1px 6px; font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
}
.checkout-row .copy-row { display: flex; gap: 8px; align-items: stretch; }
.checkout-row .copy-row code {
  flex: 1; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; word-break: break-all;
}
.checkout-row .copy-row button { flex-shrink: 0; }
.checkout-meta {
  display: flex; justify-content: space-between; font-size: 10px;
  color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.12em;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
#countdown { font-variant-numeric: tabular-nums; color: var(--fg); }

.checkout-success {
  padding: 20px; margin: 16px 0 8px;
  background: var(--surface-2); border: 1px solid var(--accent);
  display: grid; gap: 12px; text-align: center;
}
.checkout-success .success-title {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent);
}
.checkout-success .success-tx code {
  display: inline-block; max-width: 100%; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 11px; word-break: break-all;
}
.checkout-success .success-redirect {
  font-size: 12px; color: var(--fg-muted);
}
.checkout-success .success-redirect strong {
  color: var(--fg); font-variant-numeric: tabular-nums;
}
.checkout-success .success-btn {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 10px 16px; border: 1px solid var(--accent); border-bottom-color: var(--accent);
  background: var(--accent); color: var(--bg);
  text-decoration: none; justify-self: center;
}
.checkout-success .success-btn:hover {
  background: var(--fg); border-color: var(--fg); color: var(--bg);
}

/* ---------- Pairing consent (BTCPay-style auth flow) ---------- */
.consent-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.consent-card {
  width: 100%; max-width: 540px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 32px; animation: rise .35s ease-out both; position: relative;
}
.consent-card::before {
  content: ''; position: absolute; top: -1px; left: -1px; width: 32px; height: 32px;
  border-top: 1px solid var(--accent); border-left: 1px solid var(--accent);
}
.consent-card h1 { font-size: 22px; margin-bottom: 16px; }
.consent-perms { list-style: none; padding: 0; margin: 12px 0; }
.consent-perms li {
  font-family: var(--font-mono); font-size: 12px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); margin: 4px 0;
}

/* ---------- Utility ---------- */
.spacer  { flex: 1; }
.hstack  { display: flex; align-items: center; gap: 12px; }
.vstack  { display: flex; flex-direction: column; gap: 12px; }
.text-r  { text-align: right; }
.nowrap  { white-space: nowrap; }
.hidden  { display: none !important; }

/* ---------- Invoice detail ---------- */
.inv-statusbar {
  background: var(--surface); border: 1px solid var(--border);
  padding: 18px 20px; margin-bottom: 16px;
}
.inv-statusbar-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.pill.lg { font-size: 11px; padding: 5px 12px; }
.inv-statusbar-meta { font-size: 11px; color: var(--fg-dim); letter-spacing: 0.04em; }

/* live-connection indicator */
.conn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-muted); white-space: nowrap;
}
.conn .dot { width: 7px; height: 7px; background: var(--fg-dim); flex-shrink: 0; }
.conn.live .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.conn.wait .dot { background: var(--warning); animation: pulse 1.4s infinite; }
.conn.dead .dot { background: var(--danger); }

/* lifecycle timeline */
.timeline { display: flex; }
.timeline .t-node { flex: 1; position: relative; padding: 17px 16px 0 0; min-width: 0; }
.timeline .t-node::before {
  content: ''; position: absolute; top: 4px; left: 11px; right: 0; height: 1px;
  background: var(--border);
}
.timeline .t-node:last-child::before { display: none; }
.timeline .t-dot {
  position: absolute; top: 0; left: 0; width: 9px; height: 9px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
}
.timeline .t-dot.done { background: var(--success); border-color: var(--success); }
.timeline .t-dot.bad  { background: var(--danger);  border-color: var(--danger); }
.timeline .t-dot.current {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 9px rgba(197,255,0,0.55);
}
.timeline .t-label {
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--fg); margin-bottom: 4px;
}
.timeline .t-time { font-size: 11px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.timeline .t-node.pending .t-label,
.timeline .t-node.pending .t-time { color: var(--fg-dim); }

/* asymmetric KPI tiles at detail scale */
.inv-tiles { margin-bottom: 16px; }
.inv-tiles .display-num { font-size: 30px; word-break: break-all; }
.inv-tiles .display-num .unit { font-size: 14px; color: var(--fg-muted); }
.inv-tiles .tile .sub { font-size: 11px; color: var(--fg-muted); margin-top: 8px; }

/* two-column card row */
.inv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inv-cols > .card { margin-top: 0; }

/* key-value grid */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 11px 24px; margin: 0; }
.kv dd { margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.kv dd.break { word-break: break-all; }
.kv dd.empty { color: var(--fg-dim); }

/* delta colour cues */
.delta-ok    { color: var(--success); }
.delta-under { color: var(--danger); }
.delta-over  { color: var(--magenta); }

/* tolerance band */
.band { margin-top: 18px; }
.band-track {
  position: relative; height: 8px; margin: 8px 0 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
}
.band-zone {
  position: absolute; top: 0; bottom: 0;
  background: rgba(125,244,122,0.20);
  border-left: 1px solid var(--success); border-right: 1px solid var(--success);
}
.band-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); }
.band-scale {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--fg-dim); font-variant-numeric: tabular-nums;
}

/* inline copy button */
button.copy { padding: 3px 8px; font-size: 9px; }

/* explorer-linked tx hash inside a data table */
table.data a:hover code { border-color: var(--accent); color: var(--accent); }

/* raw JSON / payload block */
.inv-json {
  margin: 0; font-family: var(--font-mono); font-size: 11px; line-height: 1.6;
  color: var(--fg-muted); background: var(--bg); border: 1px solid var(--border);
  padding: 12px 14px; white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow: auto;
}

/* webhook delivery expand row */
tr.wh-detail > td { padding: 0; background: var(--bg); }
.wh-detail-body { display: grid; gap: 14px; padding: 16px 14px; }

/* live-update flash */
@keyframes inv-flash {
  from { background: rgba(197,255,0,0.20); }
  to   { background: transparent; }
}
.flash { animation: inv-flash 0.8s ease-out; }

/* empty / not-found state */
.inv-empty { text-align: center; padding: 56px 24px; }
.inv-empty .big { font-family: var(--font-display); font-size: 20px; margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) auto 1fr;
         grid-template-areas: "topbar" "side" "main"; }
  .brand-cell { display: none; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 0; }
  .sidebar a { padding: 8px 16px; }
  main { padding: 24px 16px 60px; }
  .tiles { grid-template-columns: 1fr; }
  .inv-cols { grid-template-columns: 1fr; }
  .timeline { flex-direction: column; gap: 14px; }
  .timeline .t-node { padding: 0 0 0 20px; }
  .timeline .t-node::before { display: none; }
}
