/* VstehPay UI — палитра:
   T-Bank yellow:   #FFDD2D
   T-Bank black:    #000000
   vsteh.ru orange (спецтехника / промышленный акцент): #F26C21
   neutral grays:   #F5F5F5 / #E0E0E0 / #6B6B6B / #1A1A1A
*/
:root {
  --tb-yellow: #FFDD2D;
  --tb-yellow-dark: #FFC400;
  --tb-black: #000000;
  --vsteh-orange: #F26C21;
  --vsteh-orange-dark: #C9520F;
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --line: #E5E5E5;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
}

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

/* Принудительно глушим hidden — нужно из-за того что .layout/.cp-layout
   имеют свой display: grid, который перекрывает дефолтное display:none. */
[hidden] { display: none !important; }
body {
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  display:flex; align-items:center; gap:24px;
  padding: 14px 28px;
  background: var(--tb-yellow);
  border-bottom: 3px solid var(--tb-black);
  position: sticky; top: 0; z-index: 50;
  /* Тень при скролле, чтобы шапка отделялась от контента. */
  box-shadow: 0 2px 4px rgba(0,0,0,.04);
}
.brand { display:flex; align-items:center; gap:12px; }
.logo-mark {
  width:40px; height:40px; border-radius:10px;
  background: var(--tb-black); color: var(--tb-yellow);
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:22px;
}
.logo-title { font-weight:900; font-size:18px; line-height:1.1; }
.logo-sub   { font-size:11px; color:#000; opacity:.6; }

.vsteh {
  display:flex; flex-direction:column;
  padding: 6px 14px;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
}
.vsteh-name { font-weight:900; font-size:15px; color:#000; }
.vsteh-tag {
  font-size:10px; letter-spacing:.08em; text-transform:uppercase;
  color: var(--vsteh-orange-dark); font-weight:700;
}

.nav { margin-left:auto; display:flex; gap:4px; align-items: center; }
.nav a {
  padding: 10px 18px; border-radius: 10px;
  color:#000; text-decoration:none; font-weight:700; font-size: 14px;
  transition: background .12s, transform .06s;
  white-space: nowrap;
}
.nav a:hover { background: rgba(0,0,0,.12); }
.nav a:active { transform: translateY(1px); }
.nav a.active {
  background: #000; color: var(--tb-yellow);
  box-shadow: 0 2px 0 rgba(0,0,0,.4);
}
/* Разделитель между внутренней навигацией и внешними ссылками (API/Метрики). */
.nav a[target="_blank"] {
  font-size: 13px; opacity: 0.85;
  border-left: 1px solid rgba(0,0,0,.25);
  border-radius: 0 10px 10px 0;
  padding-left: 18px;
}
.nav a[target="_blank"] + a[target="_blank"] {
  border-left: none; padding-left: 14px;
}
.nav a[target="_blank"]:hover { opacity: 1; }
.nav .nav-user {
  margin-left: 12px; padding: 6px 10px;
  background: #000; color: var(--tb-yellow);
  border-radius: 8px; font-size: 12px; font-weight: 700;
}
.nav .nav-user:empty { display: none; }
.nav #btn-logout { border: 1px solid #000; padding: 7px 14px; }

/* ── Layout ─────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr 420px;
  gap: 20px;
  padding: 20px 28px;
  align-items: start;
}
@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px 1fr; }
  .detail { grid-column: 1 / -1; }
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar { display:flex; flex-direction:column; gap:16px; }

.status-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow);
}
.status-row { display:flex; align-items:center; gap:8px; font-weight:600; }
.status-row + .status-row { margin-top:6px; font-weight:400; color: var(--text-muted); }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot-ok      { background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.15); }
.dot-warn    { background: var(--vsteh-orange); }
.dot-error   { background:#ef4444; }
.dot-pending { background:#a3a3a3; }

.filter { background: var(--bg-card); border:1px solid var(--line); border-radius: 12px; padding: 14px; }
.filter label { display:block; font-size:12px; color: var(--text-muted); margin-bottom:6px; }
.filter select { width:100%; }

.legend {
  background: var(--bg-card); border:1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size:12px;
}
.legend h4 { margin: 0 0 10px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing:.05em; }
.legend > div { display:flex; align-items:center; gap:8px; margin-bottom:6px; }

/* ── Main: deals list ───────────────────────────────────────────── */
.toolbar { display:flex; align-items:center; gap:12px; margin-bottom: 14px; }
.toolbar h1 { margin:0; font-size: 22px; }
.toolbar .btn { margin-left:auto; }

.deals-list { display:flex; flex-direction:column; gap:10px; }
.deal-card {
  background: var(--bg-card); border:1px solid var(--line); border-radius:12px;
  padding: 14px 16px; cursor: pointer;
  display: grid; grid-template-columns: 60px 1fr auto auto; gap: 14px;
  align-items: center;
  transition: border-color .12s, transform .06s;
}
.deal-card:hover { border-color: var(--tb-yellow-dark); }
.deal-card.active { border-color: #000; box-shadow: 0 0 0 2px var(--tb-yellow); }

.deal-id { font-weight:900; font-size:15px; color: var(--text-muted); }
.deal-title { font-weight:600; }
.deal-meta { font-size:12px; color: var(--text-muted); margin-top: 2px; }
.deal-amount { font-weight:800; font-size:16px; white-space:nowrap; }

/* ── Status badges ──────────────────────────────────────────────── */
.badge {
  display:inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing:.04em;
  border: 1px solid transparent; white-space: nowrap;
}
.b-created  { background:#FFF8DA; color:#876900; border-color:#F0D54B; }
.b-funded   { background:#FFFCE0; color:#7A6800; border-color:var(--tb-yellow-dark); }
.b-in_work  { background:#FFE9D9; color: var(--vsteh-orange-dark); border-color: var(--vsteh-orange); }
.b-released { background:#E2F8E5; color:#0F6F2A; border-color:#9BD9A2; }
.b-disputed { background:#FDE7E7; color:#911C1C; border-color:#F2A4A4; }
.b-refunded { background:#EFEFEF; color:#444; border-color:#D0D0D0; }

/* ── Detail pane ────────────────────────────────────────────────── */
.detail {
  background: var(--bg-card); border:1px solid var(--line); border-radius:12px;
  padding: 20px; box-shadow: var(--shadow); position: sticky; top: 20px;
  min-height: 320px;
}
.detail .empty { color: var(--text-muted); text-align:center; padding: 40px 0; }
.detail h2 { margin: 0 0 10px; }
.detail .grid {
  display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin-top: 12px;
  font-size: 13px;
}
.detail .grid dt { color: var(--text-muted); }
.detail .grid dd { margin:0; word-break:break-all; }

.detail .sm-track {
  display:flex; gap:6px; margin: 16px 0; flex-wrap:wrap;
}
.detail .sm-track .step {
  padding: 6px 10px; border-radius: 6px;
  background: #F5F5F5; color: #999; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing:.04em;
}
.detail .sm-track .step.done { background: #000; color: var(--tb-yellow); }
.detail .sm-track .step.cur  { background: var(--tb-yellow); color: #000; }
.detail .sm-track .step.bad  { background: var(--vsteh-orange); color: #fff; }

.detail .actions-row {
  display:flex; gap:8px; flex-wrap:wrap; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--line);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid transparent;
  font: 600 13px/1 inherit; cursor:pointer;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary {
  background: var(--tb-yellow); color: #000; border-color: var(--tb-yellow-dark);
}
.btn-primary:hover { background: var(--tb-yellow-dark); }
.btn-ghost {
  background: #fff; color: #000; border-color: var(--line);
}
.btn-ghost:hover { background:#F5F5F5; }
.btn-warn {
  background: var(--vsteh-orange); color: #fff; border-color: var(--vsteh-orange-dark);
}
.btn-warn:hover { background: var(--vsteh-orange-dark); }
.btn-danger {
  background: #fff; color: #911C1C; border-color: #F2A4A4;
}
.btn-danger:hover { background: #FDE7E7; }

/* ── Form fields ─────────────────────────────────────────────── */
input, select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #000;
  box-shadow: 0 0 0 3px var(--tb-yellow);
}
form label {
  display:block; margin-bottom: 12px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
form label input, form label select { margin-top: 4px; font-weight: 400; color: var(--text); }

/* ── Modals ─────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
  z-index: 100; padding: 20px;
}
.modal[hidden] { display:none; }
.modal-box {
  background: #fff; border-radius: 16px; padding: 24px;
  width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  border-top: 6px solid var(--tb-yellow);
}
.modal-box h2 { margin: 0 0 6px; }
.modal-box .hint { color: var(--text-muted); margin: 0 0 16px; }
.modal-box .row { display:flex; gap:10px; }
.modal-box .actions {
  display:flex; gap:8px; justify-content:flex-end;
  padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px;
}

/* ── Toasts ─────────────────────────────────────────────────────── */
.toast-host {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display:flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1A1A1A; color: #fff;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; min-width: 240px; max-width: 360px;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  border-left: 4px solid var(--tb-yellow);
  animation: slide-in .2s ease-out;
}
.toast.err { border-left-color: var(--vsteh-orange); }
.toast.ok  { border-left-color: #22c55e; }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.empty { color: var(--text-muted); text-align:center; padding: 32px; }
.muted { color: var(--text-muted); font-size: 12px; }

/* ── Pager ─────────────────────────────────────────────────── */
.pager {
  display:flex; align-items:center; gap:8px; margin-top: 16px;
  padding: 12px; border-radius: 10px; background: var(--bg-card);
  border: 1px solid var(--line); font-size: 12px;
}
.pager .info { color: var(--text-muted); }
.pager .spacer { flex: 1; }
.pager .btn { padding: 6px 12px; font-size: 12px; }
.pager .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.toolbar input[type="text"], .toolbar input:not([type]) {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 13px;
}

.totp-qr {
  display:flex; gap:18px; align-items:flex-start; padding: 14px;
  background: #FFFCE0; border: 1px solid var(--tb-yellow-dark);
  border-radius: 10px; margin-top: 10px;
}
.totp-qr img { width: 180px; height: 180px; border-radius: 8px; background: #fff; padding: 8px; }
.totp-qr .secret {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: #000; color: #B5E48C; padding: 6px 10px;
  border-radius: 6px; margin-top: 6px; user-select: all;
  word-break: break-all;
}

/* ── Counterparties tab ─────────────────────────────────────── */
.cp-layout { grid-template-columns: 1fr; }
.main.wide { width: 100%; max-width: 1100px; margin: 0 auto; }
.toolbar select { width: auto; }
.cps-list { display:flex; flex-direction:column; gap:10px; }
.cp-card {
  background: var(--bg-card); border:1px solid var(--line); border-radius:12px;
  padding: 14px 18px;
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 14px;
  align-items: center;
}
.cp-card:hover { border-color: var(--tb-yellow-dark); }
.cp-name { font-weight:700; font-size:15px; }
.cp-meta { font-size:12px; color: var(--text-muted); margin-top:2px; }
.cp-bank { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.role-pill {
  display:inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid transparent;
}
.role-buyer  { background: #FFF8DA; color: #876900; border-color: var(--tb-yellow-dark); }
.role-seller { background: #FFE9D9; color: var(--vsteh-orange-dark); border-color: var(--vsteh-orange); }
.role-both   { background: #EAEAEA; color: #333; border-color: #C0C0C0; }
.risk-low  { background: #E2F8E5; color: #0F6F2A; border-color: #9BD9A2; }
.risk-med  { background: #FFE9D9; color: var(--vsteh-orange-dark); border-color: var(--vsteh-orange); }
.risk-high { background: #FDE7E7; color: #911C1C; border-color: #F2A4A4; }

.cp-summary {
  background: #F5F5F5; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; line-height: 1.5;
}
.cp-summary b { color: #000; }

/* ── Detail: subaccount card ───────────────────────────────── */
.subaccount-card {
  background: linear-gradient(135deg, var(--tb-yellow), #FFF1A8);
  border: 1px solid var(--tb-yellow-dark);
  border-radius: 12px; padding: 12px 14px; margin-top: 14px;
}
.subaccount-card h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #000; }
.subaccount-card .balance { font-weight: 900; font-size: 22px; color: #000; }
.subaccount-card .id { font-family: ui-monospace, monospace; font-size: 11px; color: #5b4c00; word-break: break-all; }

/* ── Bulk-create modal ──────────────────────────────────────── */
.modal-box.wide { max-width: 1100px; }
.bulk-toolbar { display:flex; align-items:center; gap:10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bulk-toolbar .muted { margin-left: auto; }
.bulk-rows { display:flex; flex-direction:column; gap: 8px; max-height: 50vh; overflow:auto; padding-right: 4px; }
.bulk-row {
  display: grid;
  grid-template-columns: 28px 1.6fr 1.6fr 1fr 1.4fr 1.5fr 1.4fr 28px;
  gap: 6px; align-items: center;
  padding: 6px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff;
}
.bulk-row.bad { border-color: #F2A4A4; background: #FFF5F5; }
.bulk-row.ok  { border-color: #9BD9A2; background: #F0FBF2; }
.bulk-row .row-idx { font-weight: 700; color: var(--text-muted); text-align: center; }
.bulk-row select, .bulk-row input { padding: 6px 8px; font-size: 12px; }
.bulk-row .btn-row-del {
  border: none; background: transparent; color: var(--vsteh-orange-dark);
  cursor: pointer; font-size: 18px; line-height: 1; padding: 4px;
}
.bulk-row .btn-row-del:hover { color: #911C1C; }
.bulk-headers {
  display: grid;
  grid-template-columns: 28px 1.6fr 1.6fr 1fr 1.4fr 1.5fr 1.4fr 28px;
  gap: 6px; padding: 0 6px 4px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.bulk-result {
  margin-top: 14px; padding: 12px; border-radius: 10px;
  background: #FFFCE0; border: 1px solid var(--tb-yellow-dark);
  font-size: 13px;
}
.bulk-result table { width:100%; border-collapse: collapse; margin-top: 8px; }
.bulk-result td { padding: 4px 6px; border-bottom: 1px solid #F0E090; font-size: 12px; }
.bulk-result td.ok { color: #0F6F2A; }
.bulk-result td.err { color: #911C1C; }

/* ── Debug drawer ──────────────────────────────────────────── */
#debug-toggle {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  background: #000; color: var(--tb-yellow);
  border: none; border-radius: 10px 0 0 10px;
  padding: 14px 8px;
  writing-mode: vertical-rl; transform-origin: center;
  font-weight: 900; letter-spacing: .15em; font-size: 11px;
  cursor: pointer; z-index: 90;
  box-shadow: -2px 0 8px rgba(0,0,0,.15);
}
#debug-toggle:hover { background: #1A1A1A; }
.debug-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 460px; max-width: 90vw;
  background: #1A1A1A; color: #E5E5E5;
  z-index: 95;
  box-shadow: -8px 0 24px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  animation: slide-in-r .18s ease-out;
}
.debug-drawer[hidden] { display: none; }
@keyframes slide-in-r { from { transform: translateX(100%); } to { transform: translateX(0); } }
.debug-head {
  display:flex; align-items:center; gap:10px;
  padding: 14px 18px; border-bottom: 1px solid #333;
  background: var(--tb-yellow); color: #000;
}
.debug-head h3 { margin: 0; font-size: 14px; font-weight: 900; }
.debug-head #debug-close {
  margin-left: auto; padding: 4px 12px; font-size: 18px;
  background: #000; color: var(--tb-yellow); border: none;
}
.debug-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.debug-body section { margin-bottom: 18px; }
.debug-body h4 {
  margin: 0 0 8px; font-size: 11px; text-transform: uppercase;
  color: var(--tb-yellow); letter-spacing: .08em;
}
.debug-body pre {
  background: #000; padding: 10px; border-radius: 6px;
  max-height: 200px; overflow: auto; margin: 0;
  font-size: 11px; color: #B5E48C;
}
.debug-log { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; margin-top: 6px; }
.debug-log .row {
  padding: 6px 8px; border-radius: 4px; background: #2A2A2A;
  display: grid; grid-template-columns: 50px 50px 1fr 60px; gap: 8px;
  font-size: 11px; align-items: center;
}
.debug-log .row.s2xx { border-left: 3px solid #22c55e; }
.debug-log .row.s4xx { border-left: 3px solid var(--vsteh-orange); }
.debug-log .row.s5xx { border-left: 3px solid #ef4444; }
.debug-log .method { color: var(--tb-yellow); font-weight: 700; }
.debug-log .status { font-weight: 700; }
.debug-log .url    { color: #ddd; word-break: break-all; }
.debug-log .ms     { color: #999; text-align: right; }
.debug-body .btn { margin-right: 6px; margin-bottom: 6px; }

/* ── Settings ──────────────────────────────────────────────── */
.settings-form fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 8px;
  margin-bottom: 18px;
  background: var(--bg-card);
}
.settings-form legend {
  padding: 0 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 700;
}
.settings-form .hint { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }
.commission-preview {
  background: var(--tb-yellow); color: #000;
  border: 1px solid var(--tb-yellow-dark);
  border-radius: 8px; padding: 8px 12px; font-size: 12px;
  margin: 6px 0 12px;
}
.commission-preview b { font-size: 14px; }
.payout-row {
  display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin: 10px 0; padding: 10px; border-radius: 10px;
  background: linear-gradient(90deg, #FFFCE0 0%, #FFF1A8 100%);
  border: 1px solid var(--tb-yellow-dark);
}
.payout-row .cell { text-align: center; }
.payout-row .cell .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #5b4c00; }
.payout-row .cell .val { font-weight: 900; font-size: 16px; color: #000; }

/* ── T-Bank settings: cert + test ───────────────────────────── */
.cert-info {
  margin-top: 10px; padding: 10px 14px;
  background: #1A1A1A; color: #B5E48C;
  border-radius: 8px; font: 12px ui-monospace, monospace;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
}
.cert-info .lbl { color: var(--tb-yellow); }
.cert-info[data-bad="1"] { color: #FFA0A0; }
.cert-info[data-bad="1"] .lbl { color: #FF6060; }

.tbank-test {
  margin-top: 14px; padding: 12px 16px;
  border-radius: 10px; font-size: 13px;
}
.tbank-test.ok   { background: #E2F8E5; color: #0F6F2A; border: 1px solid #9BD9A2; }
.tbank-test.warn { background: #FFFCE0; color: #7A6800; border: 1px solid var(--tb-yellow-dark); }
.tbank-test.fail { background: #FDE7E7; color: #911C1C; border: 1px solid #F2A4A4; }
.tbank-test h4 { margin: 0 0 6px; font-size: 13px; }
.tbank-test ul { margin: 4px 0; padding-left: 20px; }
.tbank-test code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; }

.mode-block {
  border-left: 3px solid var(--tb-yellow);
  background: #FFFCE0;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  margin: 6px 0 12px;
}
.mode-block[hidden] { display: none; }
.mode-block .row > label { font-size: 11px; }

/* ── API keys ─────────────────────────────────────────────── */
.apikeys-toolbar { margin-bottom: 12px; }
.apikeys-list { display: flex; flex-direction: column; gap: 8px; }
.apikey-card {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
}
.apikey-card.revoked { opacity: 0.55; }
.apikey-card .name { font-weight: 700; }
.apikey-card .meta { font-size: 11px; color: var(--text-muted); }
.apikey-card .keyid {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: #F5F5F5; padding: 4px 8px; border-radius: 6px;
}
.apikey-card .scopes { display: flex; flex-wrap: wrap; gap: 4px; }
.apikey-card .scope-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 999px;
  background: #FFF8DA; color: #876900; border: 1px solid var(--tb-yellow-dark);
}
.apikey-card .scope-pill.write { background: #FFE9D9; color: var(--vsteh-orange-dark); border-color: var(--vsteh-orange); }

.secret-banner {
  margin-top: 16px; padding: 16px;
  background: #1A1A1A; color: var(--tb-yellow);
  border-radius: 12px; border-left: 5px solid var(--vsteh-orange);
}
.secret-banner h4 { margin: 0 0 8px; font-size: 14px; color: var(--tb-yellow); }
.secret-banner code {
  display: block; padding: 8px 12px; margin-top: 6px;
  background: #000; color: #B5E48C; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: 12px;
  word-break: break-all; user-select: all;
}
.secret-banner button { margin-top: 10px; }
.secret-banner .warn { color: #FFA0A0; font-size: 12px; margin-top: 8px; }

/* ── Outbox ───────────────────────────────────────────────── */
.outbox-list { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.outbox-row {
  display: grid; grid-template-columns: 50px 100px 130px 1fr 70px auto;
  gap: 10px; align-items: center;
  padding: 8px 12px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12px;
}
.outbox-row.pending   { border-left: 3px solid var(--tb-yellow-dark); }
.outbox-row.delivered { border-left: 3px solid #22c55e; opacity: 0.7; }
.outbox-row.failed    { border-left: 3px solid #ef4444; background: #FFF5F5; }
.outbox-row .id { font-weight: 700; color: var(--text-muted); }
.outbox-row .type { font-family: ui-monospace, monospace; font-size: 11px; }
.outbox-row .url  { font-family: ui-monospace, monospace; font-size: 10px; color: var(--text-muted); word-break: break-all; }
.outbox-row .att { text-align: center; font-weight: 700; }
.outbox-row .err { color: #911C1C; font-size: 10px; margin-top: 2px; }
