:root {
  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --text-2xs: 0.733rem;
  --text-xs: 0.8rem;
  --text-sm: 0.867rem;
  --text-base: 1rem;
  --text-md: 1.067rem;
  --text-lg: 1.2rem;
  --text-xl: 1.333rem;
  --text-2xl: 1.467rem;
  --text-3xl: 1.6rem;
  --text-kpi: 1.533rem;
  --text-display: 1.733rem;
  --leading-tight: 1.25;
  --leading-snug: 1.35;
  --leading-normal: 1.52;
  --leading-relaxed: 1.62;
  --bg: #080c12;
  --surface: #0d1219;
  --surface-2: #111827;
  --line: #242b38;
  --line-soft: #1a2230;
  --text: #e6edf8;
  --muted: #8b95a7;
  --faint: #5d6778;
  --purple: #8b5cf6;
  --purple-2: #a855f7;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.16);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.18);
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  font-size: 13px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: 0.01em;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, strong, b {
  font-weight: 600;
  letter-spacing: -0.008em;
}

button, input, select, textarea { font: inherit; }

button {
  border: 1px solid rgba(139, 92, 246, 0.55);
  background: linear-gradient(180deg, #35206e, #24175a);
  color: #f4f0ff;
  border-radius: 7px;
  padding: 7px 12px;
  min-height: 32px;
  cursor: pointer;
}

button.secondary {
  border-color: #334155;
  background: #111827;
  color: var(--text);
}

button.danger {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  border: 1px solid #273244;
  border-radius: 7px;
  background: #0b1017;
  color: var(--text);
  padding: 8px 10px;
  min-height: 34px;
  outline: none;
}

input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16); }

a { color: #a78bfa; }

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: stretch;
  background: var(--bg);
}

.checkout-shell { grid-template-columns: 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: stretch;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #101725;
  border-right: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6d28d9, #d946ef);
  color: white;
  font-weight: 700;
  font-size: 12px;
}

.brand-name { color: #d946ef; font-weight: 600; font-size: 16px; }

.side-scroll { overflow: auto; padding: 14px 8px; }

.side-section { margin-bottom: 14px; }

.side-title {
  color: #a78bfa;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 9px;
  text-transform: uppercase;
}

.side-link {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  color: #9aa4b5;
  text-decoration: none;
  border-radius: 7px;
  margin: 2px 0;
}

.side-link:hover { color: var(--text); background: rgba(139, 92, 246, 0.12); }

.side-link.active {
  color: #ede9fe;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.36), rgba(139, 92, 246, 0.14));
  box-shadow: inset 3px 0 0 var(--purple);
}

.side-icon { color: #7c8798; text-align: center; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.admin-mini { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }

.avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 999px;
  background: #312e81;
  color: #ddd6fe;
  font-weight: 600;
}

.app { min-width: 0; display: grid; grid-template-rows: 40px 1fr; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 18px;
  background: #111827;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.breadcrumb { display: flex; align-items: center; gap: 10px; }
.breadcrumb strong { color: var(--text); }

.workspace { padding: 18px 22px 28px; }

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.page-title h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 24px; }

.title-icon { color: #c026d3; }

.stats-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid #2b3548;
  border-radius: 999px;
  background: #0b1017;
  color: #8a94a6;
  padding: 0 11px;
  font-size: 13px;
}

.stat-pill strong { color: #ede9fe; }
.stat-pill.green strong { color: var(--green); }
.stat-pill.purple strong { color: #d946ef; }
.stat-pill.orange strong { color: #fb923c; }
.stat-pill.red strong { color: #fb7185; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar.compact { justify-content: flex-start; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.panel-header h2 { margin: 0; font-size: 15px; }
.panel-body { padding: 14px; }

.form-grid { display: grid; gap: 10px; }
.form-row { display: grid; gap: 5px; }
.form-row label { color: #8c96aa; font-size: 13px; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.kpi span { color: var(--muted); display: block; font-size: 13px; }
.kpi strong { display: block; margin-top: 4px; font-size: 21px; }
.kpi .faint { margin-top: 2px; font-size: 12px; }

.table-panel, .table-wrap { overflow: auto; }

table { width: 100%; border-collapse: collapse; min-width: 720px; }

th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #8994a7;
  background: #1a2033;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

tbody tr { background: #10151c; }
tbody tr:hover td { background: #141b25; }

.mono { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.faint { color: var(--faint); font-size: 12px; }
.amount-cell { font-weight: 600; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1f2937;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}

.status.paid, .status.approved { background: var(--green-soft); color: var(--green); }
.status.waiting-payment, .status.waiting_payment,
.status.customer-claimed-paid, .status.customer_claimed_paid,
.status.under-review, .status.under_review { background: var(--orange-soft); color: #fb923c; }
.status.expired, .status.cancelled, .status.disputed, .status.rejected { background: var(--red-soft); color: #f87171; }

.notice {
  border: 1px solid #2a3546;
  background: #101827;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.output {
  background: #070b11;
  color: #dbeafe;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 12px;
  min-height: 80px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 13px;
}

.empty { padding: 28px; color: var(--muted); text-align: center; }

/* Login screen */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(139, 92, 246, 0.18), transparent), var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: #ede9fe;
}

.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 6px; }

.login-error {
  background: var(--red-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.login-card button[type="submit"] {
  width: 100%;
  margin-top: 4px;
  min-height: 38px;
  font-weight: 600;
}

.login-hint { color: var(--faint); font-size: 12px; text-align: center; }

/* Operator topbar chip */
.op-chip {
  background: #312e81;
  color: #ddd6fe;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.trader-top-actions { gap: 14px; }
.trader-balance-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--panel, #f4f6f8);
  border: 1px solid var(--border, #e2e8f0);
}
.tr-balance-item { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.tr-balance-item strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.tr-balance-item.profit strong { color: #7c3aed; }

/* Toast */
.op-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  max-width: 320px;
}

.op-toast.show { opacity: 1; transform: translateY(0); }
.op-toast.ok { border-color: rgba(34, 197, 94, 0.5); }
.op-toast.error { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

/* Section intro */
.section-intro { margin-bottom: 14px; }
.section-intro h2 { margin: 0 0 4px; font-size: 20px; }
.section-intro p { margin: 0; color: var(--muted); font-size: 14px; max-width: 720px; line-height: 1.5; }

/* Headline cards */
.headline-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.headline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.headline-card.accent {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.14), var(--surface));
}

.headline-num { font-size: 36px; font-weight: 700; line-height: 1; color: #ede9fe; }
.headline-cap { margin-top: 8px; font-size: 15px; font-weight: 600; }
.headline-sub { margin-top: 3px; font-size: 13px; color: var(--muted); }

/* Donut */
.donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { flex: 0 0 auto; }
.donut-value { fill: #ede9fe; font-size: 34px; font-weight: 700; font-family: var(--font-sans); }
.donut-label { fill: var(--muted); font-size: 14px; font-family: var(--font-sans); }

.legend { flex: 1 1 200px; display: grid; gap: 8px; min-width: 200px; }
.legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-label { color: var(--text); font-size: 14px; }
.legend-value { font-weight: 600; color: #ede9fe; }
.legend-pct { color: var(--muted); font-size: 13px; width: 42px; text-align: right; }

/* Metric tiles with description */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metric-grid.three { grid-template-columns: repeat(3, 1fr); }

.metric {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  padding: 12px 14px;
}
.metric.green { border-left-color: var(--green); }
.metric.orange { border-left-color: var(--orange); }
.metric.red { border-left-color: var(--red); }
.metric.purple { border-left-color: var(--purple-2); }

.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 22px; font-weight: 600; color: #eaf2ff; margin: 3px 0; }
.metric-desc { color: var(--faint); font-size: 12px; line-height: 1.4; }

/* Search + multi-column forms */
.search-input { flex: 1; max-width: 380px; }
.form-grid.cols2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.form-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 14px 0 8px;
}
.form-section-title:first-child { margin-top: 0; }

/* Detail header */
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-title { display: flex; align-items: center; gap: 10px; }
.detail-title h2 { margin: 0; font-size: 22px; }
.detail-actions { margin-left: auto; }
.detail-sub { margin-top: 6px; font-size: 13px; }

/* Side drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 40;
}
.drawer-overlay.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(480px, 96vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 41;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer.wide { width: min(720px, 96vw); }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.drawer-titles h2 { margin: 0; font-size: 17px; }
.drawer-close {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 8px;
  width: 32px;
  min-height: 32px;
  padding: 0;
}
.drawer-close:hover { color: var(--text); border-color: var(--purple); }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.drawer-panel { margin-top: 14px; }
.drawer-panel:first-child { margin-top: 0; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.drawer-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 16px 0 14px;
  padding-bottom: 0;
  border-bottom: none;
}

.drawer-tab-panel {
  display: none;
}

.drawer-tab-panel.is-active { display: block; }
.drawer-tab-panel.hidden { display: none !important; }

.trader-detail .drawer-tabs,
.merchant-detail .drawer-tabs,
.order-detail .drawer-tabs {
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.trader-detail .drawer-tab,
.merchant-detail .drawer-tab,
.order-detail .drawer-tab {
  border-color: transparent;
  flex: 0 0 auto;
  white-space: nowrap;
}

.drawer-tab-panels {
  margin-top: 4px;
  min-height: 120px;
}

.drawer-tab {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.trader-detail .drawer-tab {
  border-color: transparent;
}

.drawer-tab:hover { border-color: rgba(139, 92, 246, 0.45); color: var(--text); }
.drawer-tab.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
  color: #e9d5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.drawer-tab-panels .drawer-panel:first-child { margin-top: 0; }

.drawer-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.drawer-section + .drawer-section { margin-top: 12px; }

.drawer-section--table {
  padding: 0;
  overflow: hidden;
}

.drawer-section--table .drawer-section-head {
  padding: 14px 16px 0;
}

.drawer-section--table .table-panel,
.drawer-section--table .table-wrap {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.drawer-section-head {
  margin-bottom: 14px;
}

.drawer-section-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.drawer-section-head p {
  margin: 0;
  font-size: 13px;
}

.drawer-actions--footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.order-row-clickable {
  cursor: pointer;
}

.order-row-clickable:hover td {
  background: rgba(139, 92, 246, 0.08);
}

.order-row-actions {
  white-space: nowrap;
  min-width: 200px;
}

.order-row-actions .order-action-btn {
  padding: 6px 10px;
  font-size: 12px;
  margin: 0 0 4px 4px;
}

.order-callbacks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-callback-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-left-width: 3px;
}

.order-callback-card--delivered { border-left-color: #22c55e; }
.order-callback-card--failed { border-left-color: #ef4444; }
.order-callback-card--pending { border-left-color: #f59e0b; }

.order-callback-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.order-callback-card-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.order-callback-card--delivered .order-callback-card-icon {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
}

.order-callback-card--failed .order-callback-card-icon {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}

.order-callback-card--pending .order-callback-card-icon {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.order-callback-card-main {
  flex: 1;
  min-width: 0;
}

.order-callback-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.order-callback-type {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.order-callback-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.order-callback-status--delivered {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.order-callback-status--failed {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.order-callback-status--pending {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.order-callback-http {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono, ui-monospace, monospace);
}

.order-callback-error {
  color: #f87171;
}

.order-callback-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.order-callback-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-callback-url {
  word-break: break-all;
  margin-bottom: 6px;
}

.order-callback-meta {
  margin-bottom: 8px;
}

.order-callback-details {
  margin-top: 0;
}

.order-callback-expand {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.order-callback-details-icon {
  display: inline-block;
  width: 1.25em;
  margin-right: 4px;
  opacity: 0.65;
  font-family: var(--mono, ui-monospace, monospace);
}

.order-callback-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.order-callback-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  overflow: auto;
  max-height: 220px;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-callback-retry {
  margin-top: 10px;
}

/* Order detail drawer */
.order-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(139, 92, 246, 0.06) 45%, rgba(255, 255, 255, 0.02) 100%);
}

.order-detail-hero-main { min-width: 0; }

.order-detail-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.order-detail-amount {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: #f8fafc;
}

.order-detail-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #94a3b8;
}

.order-detail-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.order-detail-status {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
}

.order-detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.order-webhook-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.order-webhook-pill--ok {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
}

.order-webhook-pill--fail {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}

.order-webhook-pill--wait {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.order-webhook-pill--empty {
  color: #64748b;
}

.order-detail-tabs {
  margin-top: 14px;
}

.order-detail-tab-icon {
  margin-right: 5px;
  opacity: 0.75;
}

.order-detail-panels {
  margin-top: 6px;
}

.order-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.order-info-tile {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.order-info-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.order-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.order-info-sub {
  margin-top: 4px;
  font-size: 11px;
}

.order-callback-url-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.order-callback-url-line {
  margin-top: 4px;
  font-size: 12px;
  word-break: break-all;
  line-height: 1.45;
}

.order-status-panel {
  margin-top: 0;
}

.order-callbacks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  color: var(--muted);
}

.order-callbacks-empty-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  margin-bottom: 4px;
}

.order-table-row {
  cursor: pointer;
  transition: background 0.12s;
}

.order-table-row:hover {
  background: rgba(139, 92, 246, 0.06);
}

.order-table-row:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.45);
  outline-offset: -2px;
}

.order-row-id,
.order-row-profit,
.order-row-card {
  font-size: 12px;
  margin-top: 2px;
}

.crypto-deposit-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crypto-deposit-status-cell .icon-btn {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 6px;
  font-size: 13px;
}

.order-row-gateway-id {
  font-size: 11px;
  line-height: 1.35;
  word-break: break-all;
  color: #94a3b8;
  max-width: 11rem;
}

.order-detail .drawer-actions--footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Trader detail drawer */
.trader-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(255, 255, 255, 0.02) 55%);
}

.trader-detail-identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.trader-detail-meta { min-width: 0; flex: 1; }

.trader-detail-sub {
  font-size: 14px;
  color: #cbd5e1;
  margin-top: 2px;
}

.trader-detail-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.trader-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trader-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.trader-detail-action {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.trader-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.trader-stat {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.trader-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #64748b;
  opacity: 0.7;
}

.trader-stat--green::before { background: #22c55e; }
.trader-stat--blue::before { background: #60a5fa; }
.trader-stat--orange::before { background: #fb923c; }
.trader-stat--purple::before { background: #a78bfa; }

.trader-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.trader-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.2;
}

.trader-stat-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.trader-stat--green .trader-stat-value { color: #4ade80; }
.trader-stat--orange .trader-stat-value { color: #fdba74; }
.trader-stat--purple .trader-stat-value { color: #c4b5fd; }

.perm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.perm-row:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.06);
}

.perm-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
  font-size: 15px;
  font-weight: 700;
}

.perm-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.perm-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.perm-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.perm-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  pointer-events: none;
}

.perm-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}

.perm-toggle-ui {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #3f3f46;
  position: relative;
  transition: background 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.perm-toggle-ui::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f4f5;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.perm-row:has(input:checked) {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}

.perm-row:has(input:checked) .perm-icon {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.perm-toggle input:checked + .perm-toggle-ui {
  background: #22c55e;
}

.perm-toggle input:checked + .perm-toggle-ui::before {
  transform: translateX(18px);
}

.perm-toggle input:focus-visible + .perm-toggle-ui {
  outline: 2px solid rgba(34, 197, 94, 0.55);
  outline-offset: 2px;
}

.kpis-2 { grid-template-columns: repeat(2, 1fr); }

/* Trader profile inside drawer */
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-name { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.push-right { margin-left: auto; }

/* TRC wallet */
.wallet-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

.wallet-box--linked {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.06);
}

.wallet-box-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallet-box-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.wallet-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.05);
}

.wallet-empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  font-size: 20px;
  margin-bottom: 4px;
}

.wallet-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.wallet-empty-hint {
  font-size: 13px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.45;
}
.wallet-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
.ghost { border: none; background: transparent; color: var(--muted); padding: 2px 6px; min-height: auto; }
.ghost:hover { color: var(--text); background: transparent; }
.copy-btn { margin-left: auto; font-size: 15px; cursor: pointer; }

/* Credentials reveal box */
.cred-box { background: var(--surface-2); border: 1px dashed rgba(139, 92, 246, 0.6); border-radius: 9px; padding: 12px 14px; margin-top: 12px; }
.cred-title { font-weight: 600; color: var(--green); margin-bottom: 8px; }
.cred-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.cred-row span { color: var(--muted); }
.cred-row b { overflow-wrap: anywhere; text-align: right; }

/* Balance amounts */
.amt-plus { color: var(--green); }
.amt-minus { color: #fb7185; }

/* Rates / providers */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Crypto asset badges */
.crypto-asset-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
.crypto-asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.crypto-asset-chip:hover { border-color: var(--purple); }
.crypto-asset-chip.active {
  border-color: var(--purple);
  background: var(--purple-soft);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.25);
}
.crypto-asset-chip-meta {
  font-size: 12px;
  color: var(--muted);
}
.crypto-asset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.crypto-asset--compact { padding: 2px 8px; font-size: 11px; }
.crypto-asset-symbol { letter-spacing: 0.02em; }
.crypto-asset-network {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.crypto-asset--usdt {
  background: rgba(38, 161, 123, 0.14);
  border-color: rgba(38, 161, 123, 0.35);
  color: #34d399;
}
.crypto-asset--usdt .crypto-asset-network { background: rgba(38, 161, 123, 0.2); color: #6ee7b7; }
.crypto-asset--usdc {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}
.crypto-asset--usdc .crypto-asset-network { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.crypto-asset--btc {
  background: rgba(247, 147, 26, 0.14);
  border-color: rgba(247, 147, 26, 0.35);
  color: #fbbf24;
}
.crypto-asset--eth {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}
.crypto-asset--bnb {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.35);
  color: #fde047;
}
.crypto-asset--trx {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.crypto-asset--ltc {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}
.crypto-asset--bch {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}
.crypto-asset--doge {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.35);
  color: #fde68a;
}
.crypto-asset-filters--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
  width: 100%;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.crypto-asset-filters--grid .crypto-asset-chip {
  width: 100%;
  justify-content: space-between;
  padding: 5px 8px;
  gap: 4px;
  border-radius: 8px;
  min-width: 0;
}
.crypto-asset-filters--grid .crypto-asset-chip-meta {
  font-size: 10px;
  flex-shrink: 0;
  opacity: 0.75;
}
.crypto-asset-filters--grid .crypto-asset {
  padding: 1px 5px;
  font-size: 10px;
  gap: 3px;
  min-width: 0;
}
.crypto-asset-filters--grid .crypto-asset-network {
  font-size: 8px;
  padding: 0 3px;
}
.crypto-panel-toolbar--stacked {
  flex-direction: column;
  align-items: stretch;
}
.crypto-panel-toolbar--stacked .crypto-status-filters {
  justify-content: flex-end;
}
.crypto-asset-financials {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.crypto-asset-financials h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.crypto-asset-financials .faint {
  margin: 0 0 10px;
}
.crypto-add-hint {
  margin: 10px 0 0;
  font-size: 12px;
}
.crypto-asset--default {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}
.crypto-add-panel .crypto-wallet-notice--hd {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}
.crypto-wallet-notice--demo {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.08);
}
.crypto-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.crypto-address-cell { word-break: break-all; max-width: 220px; display: inline-block; }

/* Crypto page tabs */
.crypto-page { display: grid; gap: 14px; }
.crypto-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.crypto-hero--secondary { margin-top: 0; }
.crypto-merchant-stats {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.crypto-merchant-stats h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.crypto-merchant-stats .crypto-panel-toolbar {
  margin-bottom: 10px;
  padding: 0;
}
.crypto-merchant-stats-empty {
  padding: 24px;
  text-align: center;
}
table.crypto-merchant-stats-grid {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
}
table.crypto-merchant-stats-grid th,
table.crypto-merchant-stats-grid td {
  font-size: 13px;
  padding: 8px 10px;
}
@media (max-width: 1100px) {
  .crypto-hero,
  .crypto-hero--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.crypto-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.crypto-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.crypto-tab:hover { color: var(--text); background: var(--surface-2); }
.crypto-tab.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(59, 130, 246, 0.12));
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15);
}
.crypto-tab-icon { opacity: 0.85; font-size: 13px; }
.crypto-tab-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.crypto-tab.active .crypto-tab-count {
  background: rgba(139, 92, 246, 0.25);
  color: #ddd6fe;
}
.crypto-tab-panels { min-height: 200px; }
.crypto-tab-panel { display: none; }
.crypto-tab-panel.is-active { display: block; }
.crypto-tab-panel.hidden { display: none !important; }
.crypto-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.crypto-asset-filters--inline { margin: 0; }
.crypto-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crypto-status-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.crypto-status-chip.active {
  border-color: rgba(34, 197, 94, 0.45);
  background: var(--green-soft);
  color: var(--green);
}
.crypto-pool-add {
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.crypto-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.crypto-table-toolbar .search-input { max-width: 320px; flex: 1; }
.crypto-pool-table,
.crypto-clients-table,
.crypto-deposits-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.crypto-pool-table table,
.crypto-clients-table table,
.crypto-deposits-table table {
  min-width: 100%;
}
.crypto-table .crypto-address-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
  color: #cbd5e1;
}
.crypto-address-code--copy {
  cursor: pointer;
  transition: color 0.15s;
}
.crypto-address-code--copy:hover {
  color: #c4b5fd;
}
.crypto-address-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 280px;
}
.crypto-address-row .crypto-copy {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}
.crypto-api-docs { display: grid; gap: 12px; }
.crypto-api-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.crypto-api-method {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.crypto-api-method.get { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.crypto-api-method.post { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.crypto-pool-id {
  display: inline-block;
  font-size: 12px;
  cursor: default;
}
.crypto-pool-table .danger {
  padding: 6px 10px;
  font-size: 12px;
}

/* Merchant type picker */
.merchant-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.merchant-type-badge--p2p {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
.merchant-type-badge--crypto {
  background: rgba(38, 161, 123, 0.15);
  border: 1px solid rgba(38, 161, 123, 0.35);
  color: #6ee7b7;
}
.merchant-type-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.merchant-type-option { cursor: pointer; }
.merchant-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.merchant-type-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.merchant-type-option input:checked + .merchant-type-card {
  border-color: rgba(139, 92, 246, 0.55);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(59, 130, 246, 0.08));
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2);
}
.merchant-type-card strong { font-size: 14px; }
.merchant-type-card .faint { font-size: 12px; line-height: 1.35; }
@media (max-width: 640px) {
  .merchant-type-picker { grid-template-columns: 1fr; }
}
.rate-rank {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--purple-soft);
  color: #c4b5fd;
  font-weight: 600;
  font-size: 13px;
}

/* --- Global polish: transitions, hover, scrollbars --- */
button { transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s; }
button:not(:disabled):active { transform: translateY(1px); }
button:not(.secondary):not(.danger):not(.ghost):hover { box-shadow: 0 4px 14px rgba(139, 92, 246, 0.28); }
a { transition: color 0.15s; }
input, select, textarea { transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.side-link { transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.panel, .kpi, .metric, .headline-card, .card { transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s; }
.kpi:hover, .metric:hover { border-color: rgba(139, 92, 246, 0.4); }
tbody tr { transition: background 0.12s; }
.stat-pill { transition: border-color 0.15s, transform 0.1s; }
.t-avatar { transition: transform 0.15s; }
.trader-cell:hover .t-avatar { transform: scale(1.06); }

* { scrollbar-width: thin; scrollbar-color: #2a3344 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #283142; border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #344056; }

.search-input::placeholder, input::placeholder { color: #586378; }

/* Fade-in for section content */
#op-content { animation: fadeIn 0.22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Status pills: trader on/off states */
.status.active { background: var(--green-soft); color: var(--green); }
.status.paused { background: var(--orange-soft); color: #fb923c; }

/* Traders list — card-like rows */
.trader-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.t-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #312e81, #1f1b54);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.t-id { min-width: 0; }
.t-id strong { display: block; font-weight: 600; color: var(--text); }
.actions-compact { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.actions-compact button { padding: 6px 10px; font-size: 13px; }
.icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  border-radius: 8px;
}
.icon-btn.secondary { background: rgba(255, 255, 255, 0.04); }
.req-settings-head { margin-bottom: 4px; }
.req-settings-head .mono { font-size: 16px; font-weight: 600; }
.req-card-full { font-size: 14px; letter-spacing: 0.04em; white-space: nowrap; overflow: visible; text-overflow: clip; font-variant-numeric: tabular-nums; }
.req-card-preview { margin: 6px 0 2px; font-size: 16px; font-weight: 600; }
.req-card-input { width: 100%; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.requisites-table table { min-width: 1120px; }
.requisites-table th:nth-child(4),
.requisites-table td:nth-child(4) { min-width: 188px; overflow: visible; white-space: nowrap; }
.requisites-table th:nth-child(3),
.requisites-table td:nth-child(3) { min-width: 140px; }
.field-hint { margin-top: 4px; font-size: 12px; color: var(--muted); }
.form-row input.valid { border-color: rgba(52, 211, 153, 0.55); }
.form-row input.invalid { border-color: rgba(248, 113, 113, 0.65); }
.group-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Larger avatar for the detail profile header */
.t-avatar-lg {
  width: 46px;
  height: 46px;
  font-size: 17px;
}

/* Trader PayIn */
.payin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payin-kpi {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.payin-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}

.payin-kpi.purple .payin-kpi-icon { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
.payin-kpi.green .payin-kpi-icon { background: var(--green-soft); color: var(--green); }
.payin-kpi.orange .payin-kpi-icon { background: var(--orange-soft); color: var(--orange); }
.payin-kpi.red .payin-kpi-icon { background: var(--red-soft); color: #fb7185; }
.payin-kpi.blue .payin-kpi-icon { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }

.payin-kpi-label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.payin-kpi-value { font-size: 24px; font-weight: 700; line-height: 1.12; color: #ede9fe; }
.payin-kpi-hint { font-size: 12px; margin-top: 4px; color: var(--faint); }
.payin-kpi-hint.up { color: var(--green); }

.payin-panel { margin-top: 0; }
.payin-panel-head { flex-direction: column; align-items: stretch; gap: 14px; }
.payin-panel-head h2 { margin: 0; font-size: 20px; }

.payin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payin-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payin-filter-tab {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 600;
}

.payin-filter-tab.active {
  background: linear-gradient(180deg, #35206e, #24175a);
  border-color: rgba(139, 92, 246, 0.55);
  color: #f4f0ff;
}

.payin-filter-count {
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.payin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 240px;
}

.payin-search {
  max-width: 320px;
  min-width: 200px;
  flex: 1;
}

.payin-table-wrap .table-wrap { border-radius: 0; }
.payin-table-wrap table th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.payin-req-id { font-weight: 600; color: #ede9fe; }
.payin-req-pair { font-size: 12px; margin-top: 2px; }
.payin-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.payin-profit { color: var(--green); font-size: 13px; margin-top: 2px; font-weight: 600; }

.payin-details-btn { font-size: 13px; padding: 5px 10px; min-height: 28px; }

.payin-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.payin-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payin-page-size select {
  width: auto;
  min-width: 64px;
  padding: 4px 8px;
  min-height: 30px;
}

.payin-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.payin-page-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 4px 8px;
}

.payin-page-btn.active {
  background: linear-gradient(180deg, #35206e, #24175a);
  border-color: rgba(139, 92, 246, 0.55);
  color: #f4f0ff;
}

.payin-total-count { font-size: 13px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid.two, .kpis { grid-template-columns: 1fr; }
  .headline-row { grid-template-columns: 1fr; }
  .metric-grid, .metric-grid.three { grid-template-columns: 1fr; }
  .form-grid.cols2, .form-grid.cols3 { grid-template-columns: 1fr; }
  .kpis-2 { grid-template-columns: repeat(2, 1fr); }
  .payin-kpi-grid { grid-template-columns: 1fr 1fr; }
  .payin-toolbar-right { width: 100%; justify-content: stretch; }
  .payin-search { max-width: none; }
  .drawer, .drawer.wide { width: 100vw; }
  .trader-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trader-detail-hero { flex-direction: column; }
  .trader-detail-action { align-self: flex-start; }
  .order-detail-hero { flex-direction: column; }
  .order-detail-hero-side { align-items: flex-start; }
  .order-info-grid { grid-template-columns: 1fr; }
  .order-callback-expand { grid-template-columns: 1fr; }
}

/* ── Notifications panel ── */
.notif-recipient-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.notif-rec-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.notif-rec-btn:hover { border-color: #475569; background: #14141c; }
.notif-rec-btn.active {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(124, 58, 237, 0.1);
  color: #c4b5fd;
}
.notif-rec-icon { font-size: 1rem; flex-shrink: 0; }

.notif-preview {
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  padding: 12px;
}
.notif-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.notif-preview-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notif-preview-icon { font-size: 1.25rem; flex-shrink: 0; }
.notif-preview-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.notif-preview-body {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.notif-send-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.notif-send-btn:hover:not(:disabled) { opacity: 0.9; }
.notif-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.notif-send-to {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.notif-history-list {
  display: flex;
  flex-direction: column;
}
.notif-history-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.notif-history-item:last-child { border-bottom: none; }
.notif-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.notif-history-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}
.notif-badge-all {
  background: rgba(124, 58, 237, 0.15);
  color: #c4b5fd;
}
.notif-badge-one {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}
.notif-history-time {
  font-size: 0.75rem;
  color: var(--muted);
}
.notif-history-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.notif-history-body {
  font-size: 0.825rem;
  color: #94a3b8;
  line-height: 1.5;
}
.notif-history-author {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Merchants table — fit viewport width (admin) */
.tr-app table.merchants-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}
.tr-app .merchants-panel,
.tr-app .merchants-panel > .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tr-app .tr-page--merchants {
  gap: 0;
}
.tr-app .tr-page--merchants > .merchants-panel {
  flex: 1;
  min-height: 0;
}
