/* ============================================================================
 * CryptoGate Merchant Dashboard — Stripe Aesthetic (DESIGN.md)
 * Primary CTA: True Black (#000000) instead of Indigo (#533afd)
 * ============================================================================ */

:root {
  /* Primary: True Black */
  --primary: #000000;
  --primary-deep: #1a1d21;
  --primary-press: #2f343b;
  --primary-soft: #434b56;
  --primary-subdued: #eef1f5;
  --on-primary: #ffffff;

  /* Dark IDE panels */
  --brand-dark-900: #0c1017;
  --brand-dark-800: #141a24;
  --brand-dark-border: rgba(255, 255, 255, 0.1);

  /* Surfaces (DESIGN.md) */
  --canvas: #ffffff;
  --canvas-soft: #f6f9fc;
  --canvas-cream: #f5e9d4;
  --hairline: #e3e8ee;
  --hairline-input: #cbd5e1;

  /* Ink (DESIGN.md — deep navy) */
  --ink: #0d253d;
  --ink-secondary: #3c4257;
  --ink-mute: #697386;
  --ink-mute-2: #61718a;

  /* Semantic dashboard badges */
  --success: #0d7a4b;
  --success-bg: #e7f6ee;
  --warning: #9b6829;
  --warning-bg: #f5e9d4;
  --danger: #c81e45;
  --danger-bg: #fdecef;
  --info: #0d253d;
  --info-bg: #edf2f7;

  /* Elevation (DESIGN.md) */
  --shadow-1: rgba(0, 55, 112, 0.06) 0 1px 3px, rgba(0, 0, 0, 0.04) 0 1px 2px;
  --shadow-2: rgba(60, 66, 87, 0.08) 0 15px 35px 0, rgba(0, 0, 0, 0.12) 0 5px 15px 0;

  /* Radii (DESIGN.md) */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tnum {
  font-feature-settings: "tnum", "ss01";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.32px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* Boot spinner */
.boot-loader { min-height: 100vh; display: grid; place-items: center; }
.boot-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--hairline); border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
 * Buttons (DESIGN.md pill geometry — crisp Black primary)
 * ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-deep); }
.btn-primary:active:not(:disabled) { background: var(--primary-press); }

.btn-secondary {
  background: var(--canvas);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover:not(:disabled) { background: var(--canvas-soft); }

.btn-subtle {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--hairline);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-subtle:hover:not(:disabled) {
  background: var(--canvas-soft);
  border-color: #cfd8e3;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-mute);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--primary-subdued);
  color: var(--ink);
}

.btn-danger {
  background: var(--canvas);
  color: var(--danger);
  border-color: rgba(200, 30, 69, 0.25);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); }

.btn-sm { padding: 6px 12px; min-height: 30px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; min-height: 44px; font-size: 14.5px; }
.btn-block { width: 100%; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  font-size: inherit;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================================
 * Form Controls (Stripe crisp 6px inputs, black focus ring)
 * ============================================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.field .hint {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.4;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline-input);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 2px rgba(13, 37, 61, 0.03) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea { min-height: 84px; resize: vertical; }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.09);
}

.input::placeholder, .textarea::placeholder {
  color: #9aa5b4;
}

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

.alert {
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(200, 30, 69, 0.2); }
.alert-cream { background: var(--canvas-cream); color: var(--ink); border: 1px solid rgba(155, 104, 41, 0.22); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(13, 122, 75, 0.2); }

/* ============================================================================
 * Auth Pages (Authentic Stripe dashboard.stripe.com/login & /register aesthetic)
 * ============================================================================ */
.auth-stage {
  position: relative;
  min-height: 100vh;
  background: var(--canvas);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 56px;
}

/* Iconic Stripe slanted gradient mesh band at the upper third (warm cream/amber/rose/slate, zero indigo) */
.stripe-slant-bg {
  position: absolute;
  top: -120px;
  left: -10%;
  right: -10%;
  height: 430px;
  transform: skewY(-6deg);
  background:
    radial-gradient(60% 90% at 15% 30%, #f5e9d4 0%, rgba(245, 233, 212, 0) 70%),
    radial-gradient(55% 85% at 52% 20%, #f7cba5 0%, rgba(247, 203, 165, 0) 68%),
    radial-gradient(50% 85% at 86% 35%, #f2b7c7 0%, rgba(242, 183, 199, 0) 68%),
    linear-gradient(115deg, #f6f9fc 0%, #f5e9d4 38%, #f8d4bc 68%, #e6ecf4 100%);
  border-bottom: 1px solid rgba(13, 37, 61, 0.06);
  pointer-events: none;
  z-index: 0;
}

/* Architectural vertical guide lines (signature Stripe auth background detail) */
.stripe-guides {
  position: absolute;
  inset: 0;
  max-width: 1080px;
  margin: 0 auto;
  pointer-events: none;
  z-index: 0;
  border-left: 1px solid rgba(13, 37, 61, 0.055);
  border-right: 1px solid rgba(13, 37, 61, 0.055);
}
.stripe-guides::before,
.stripe-guides::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(13, 37, 61, 0.055) 0 4px,
    transparent 4px 10px
  );
}
.stripe-guides::before { left: 33.333%; }
.stripe-guides::after { left: 66.666%; }

/* Centered Login layout (exact Stripe /login silhouette) */
.auth-centered {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-left: 4px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.brand-cube {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Register two-column clean layout (exact Stripe /register silhouette) */
.auth-register-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: start;
}

.auth-side {
  padding-top: 12px;
}

.auth-side h1 {
  margin: 24px 0 12px;
  font-size: 32px;
  font-weight: 300;
  line-height: 1.14;
  letter-spacing: -0.64px;
  color: var(--ink);
}

.auth-side-sub {
  margin: 0 0 28px;
  font-size: 14.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.auth-value-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.auth-value-list li {
  position: relative;
  padding-left: 16px;
}
.auth-value-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--primary);
}
.auth-value-list strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.auth-value-list span {
  display: block;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.45;
}

/* Crisp floating Auth Card */
.auth-card {
  background: var(--canvas);
  border: 1px solid rgba(13, 37, 61, 0.08);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 36px 36px 32px;
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.auth-card .sub {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--ink-mute);
}

.auth-card-footer {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute);
}

.auth-legal-row {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  font-size: 12px;
  color: var(--ink-mute);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================================
 * Dark IDE panel (DESIGN.md composited code block)
 * ============================================================================ */
.ide-panel {
  background: var(--brand-dark-900);
  color: #e6edf3;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.ide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--brand-dark-800);
  border-bottom: 1px solid var(--brand-dark-border);
  font-size: 12px;
  color: #8b949e;
}

.ide-dots { display: inline-flex; gap: 6px; }
.ide-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }

.ide-tabs { display: inline-flex; gap: 4px; }
.ide-tabs button {
  background: transparent; border: 0; color: #8b949e;
  font-size: 12px; padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer;
}
.ide-tabs button.active { background: rgba(255, 255, 255, 0.14); color: #ffffff; }

.ide-code {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: #d8e1ec;
}

.tok-k { color: #9ecbff; }
.tok-s { color: #a5f3c4; }
.tok-n { color: #f8c89c; }
.tok-c { color: #7b8a9b; }

/* ============================================================================
 * Dashboard App Shell (Authentic clean Stripe Dashboard layout)
 * ============================================================================ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--canvas);
}

.sidebar {
  background: var(--canvas-soft);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}

.sidebar-merchant-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-merchant-id {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

.nav-section {
  margin-top: 18px;
  margin-bottom: 4px;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: var(--r-md);
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-item:hover {
  text-decoration: none;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  color: var(--ink-mute);
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(13, 37, 61, 0.045);
  color: var(--ink);
}

/* Stripe-style subtle active nav item (crisp black text/icon on light pill, not heavy black bar) */
.nav-item.active {
  background: var(--canvas);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(13, 37, 61, 0.07), inset 0 0 0 1px var(--hairline);
}
.nav-item.active svg {
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-pill {
  padding: 8px 10px;
  border-radius: var(--r-md);
}
.user-pill .email {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-pill .role { font-size: 11px; color: var(--ink-mute); }

/* Main column */
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--canvas);
}

.test-ribbon {
  background: var(--canvas-cream);
  border-bottom: 1px solid rgba(155, 104, 41, 0.2);
  color: var(--warning);
  padding: 5px 32px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
  padding: 11px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
  display: none;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  border-radius: var(--r-sm);
  width: 34px;
  height: 34px;
  place-items: center;
  cursor: pointer;
}

.breadcrumb-title { font-size: 14px; font-weight: 500; color: var(--ink-mute); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.net-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
}
.net-switch button {
  border: 0; background: transparent; padding: 5px 11px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 500;
  color: var(--ink-mute); cursor: pointer;
}
.net-switch button.active { background: var(--primary); color: var(--on-primary); }

.lang-select {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--canvas-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.lang-select:focus {
  border-color: var(--primary);
}

.auth-lang-corner {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
}

/* Workspace */
.workspace {
  padding: 28px 32px 64px;
  max-width: 1140px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 300;
  line-height: 1.14;
  letter-spacing: -0.56px;
  color: var(--ink);
}

.page-header p { margin: 0; font-size: 13.5px; color: var(--ink-mute); }

/* KPI Strip (clean Stripe hairline grid, no cluttered cards) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  margin-bottom: 24px;
}

.kpi-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--hairline);
}
.kpi-cell:last-child { border-right: 0; }

.kpi-label { font-size: 12.5px; color: var(--ink-mute); margin-bottom: 6px; }
.kpi-value { font-size: 24px; font-weight: 300; line-height: 1.15; letter-spacing: -0.35px; color: var(--ink); }
.kpi-sub { margin-top: 5px; font-size: 12px; color: var(--ink-mute); }

/* Cards */
.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-cream {
  background: var(--canvas-cream);
  border-color: rgba(155, 104, 41, 0.22);
}

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head h2 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.15px; color: var(--ink); }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-mute); }
.card-body { padding: 20px; }

.split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 20px;
  align-items: start;
}

/* Onboarding Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--hairline);
}
.checklist li:first-child { border-top: 0; }
.chk-left { display: flex; align-items: center; gap: 12px; }
.chk-circle {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--hairline-input);
  display: grid; place-items: center; font-size: 11px; flex-shrink: 0; color: var(--ink-mute);
}
.chk-circle.done { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 18px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.35px;
  color: var(--ink-mute); background: var(--canvas-soft); border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
tbody td { padding: 12px 18px; border-bottom: 1px solid var(--hairline); color: var(--ink); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--canvas-soft); }

.empty-state { padding: 40px 24px; text-align: center; color: var(--ink-mute); }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.empty-state p { margin: 0 0 16px; font-size: 13px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-soft { background: var(--primary-subdued); color: var(--ink); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip {
  padding: 6px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); background: var(--canvas);
  color: var(--ink-secondary); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Asset icons */
.asset-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.asset-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 7px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); background: var(--canvas-soft);
  font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.coin-stack { position: relative; width: 24px; height: 24px; display: inline-block; flex-shrink: 0; }
.coin-stack img.coin { width: 24px; height: 24px; border-radius: 50%; display: block; }
.coin-stack img.net {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
  border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; background: #fff;
}

.secret-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-radius: var(--r-md);
  background: var(--brand-dark-900); color: #f0f6fc;
  font-family: var(--font-mono); font-size: 12.5px; word-break: break-all;
}

.event-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.event-toggle {
  padding: 5px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); background: var(--canvas-soft);
  font-size: 11.5px; font-family: var(--font-mono); color: var(--ink-secondary); cursor: pointer;
}
.event-toggle.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13, 37, 61, 0.38); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}
.modal-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-foot {
  padding: 14px 22px 18px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: flex-end; gap: 10px;
}
.icon-close {
  width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: var(--canvas-soft); color: var(--ink-mute); font-size: 16px; cursor: pointer;
}
.icon-close:hover { background: var(--primary-subdued); color: var(--primary); }

.event-row-payload {
  background: var(--brand-dark-900); color: #d8e1ec;
  padding: 14px 18px; font-family: var(--font-mono); font-size: 12px;
  line-height: 1.55; overflow-x: auto; margin: 0;
}

#toast-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--primary); color: var(--on-primary);
  padding: 9px 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-2);
}

/* Responsive */
@media (max-width: 1024px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-cell { border-bottom: 1px solid var(--hairline); }
  .split-2, .auth-register-wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 252px;
    transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-2);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .workspace { padding: 20px 16px 48px; }
  .topbar { padding: 10px 16px; }
  .auth-card { padding: 26px 22px; }
  .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .btn { min-height: 42px; }
}
