/* Stripe Dashboard — tokens + police système (inspect Stripe) */
:root {
  --navy: #0a2540;
  --purple: #635bff;
  --purple-hover: #5851ea;
  --purple-soft: #eeedfe;
  --bg: #f6f9fc;
  --surface: #ffffff;
  --border: #e3e8ee;
  --border-2: #dee2e8;
  --text: #1a2c44;
  --mute: #697386;
  --mute-2: #8792a2;
  --body: #425466;
  --link: #533afd;
  --warn: #b76e00;
  --ok: #09825d;
  --ok-bg: #e6f9f1;
  --danger: #df1b41;
  --sidebar-w: 260px;
  /* Exact Stripe UI stack (DevTools) */
  --font: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, sans-serif;
  --r: 6px;
  --r-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.04);
  --fs: 16px;
  --fs-sm: 14px;
  --fs-xs: 13px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-display: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: var(--fs);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
code, .mono-block {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
}

/* —— Auth (merchant sign-in) —— */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
  background: var(--bg);
}
.auth.hidden { display: none; }

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: 36px clamp(28px, 4vw, 56px) 32px;
  color: #fff;
  background: #2f23a8;
  overflow: hidden;
  isolation: isolate;
}
/* Blurred photo underneath… */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -2;
  background: url("/media/kanga-hero.jpg") center / cover no-repeat;
  filter: blur(7px) saturate(1.15);
  transform: scale(1.05);
}
/* …and the brand gradient on top, slightly see-through. */
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(80% 55% at 100% 0%, rgba(255, 255, 255, 0.14), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(0, 212, 170, 0.16), transparent 65%),
    linear-gradient(155deg, rgba(91, 79, 240, 0.72) 0%, rgba(61, 47, 196, 0.76) 50%, rgba(38, 27, 138, 0.86) 100%);
}
.auth-brand .ab-top { display: flex; align-items: center; gap: 10px; }
.auth-brand .ab-logo {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
  color: #3d2fc4; background: #fff;
  box-shadow: 0 6px 18px rgba(20, 10, 90, 0.35);
}
.auth-brand .ab-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand .ab-tag {
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.auth-brand .ab-copy { max-width: 450px; }
.auth-brand .ab-eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: #c9c4ff;
}
.auth-brand .ab-title {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 650; line-height: 1.08; letter-spacing: -0.035em;
  text-wrap: balance;
}
.auth-brand .ab-lead { margin: 0; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, 0.78); }
.auth-brand .ab-features { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.auth-brand .ab-features li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.auth-brand .ab-ico {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: #fff; background: rgba(255, 255, 255, 0.16);
}
.auth-brand .ab-features strong { display: block; font-size: 14px; font-weight: 600; }
.auth-brand .ab-features span:not(.ab-ico) {
  display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.72);
}
.auth-brand .ab-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.auth-brand .ab-ops span {
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.12); color: #fff;
}
.auth-brand .ab-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-brand .ab-foot a { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 500; text-decoration: none; }
.auth-brand .ab-foot a:hover { color: #fff; }
.auth-brand .ab-status {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px; color: rgba(255, 255, 255, 0.9);
}
.auth-brand .ab-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #c9c4ff; }
.auth-brand .ab-status.is-ok .ab-dot { background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.22); }
.auth-brand .ab-status.is-down .ab-dot { background: #ff6b81; box-shadow: 0 0 0 4px rgba(255, 107, 129, 0.22); }

.auth-panel { display: flex; flex-direction: column; padding: 24px clamp(20px, 4vw, 48px); }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 8px 0; }
.auth-logo { display: none; }
.auth-title { margin: 0 0 6px; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; color: var(--text); }
.auth-desc { margin: 0 0 22px; color: var(--mute); font-size: 15px; line-height: 1.5; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 22px;
  background: #eef1f6; border-radius: 10px;
}
.auth-tabs.hidden { display: none; }
.auth-tab {
  border: 0; background: none; padding: 9px 0; border-radius: 8px;
  color: var(--mute); cursor: pointer; font-weight: 600; font-size: 14px;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(10, 37, 64, 0.12); }
.auth-tab:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.auth .field span { color: var(--text); font-weight: 600; }
.auth .field .opt { font-style: normal; font-weight: 400; color: var(--mute); margin-left: 4px; }
.auth .field input:not([type="checkbox"]):not([type="radio"]) {
  height: 46px; padding: 0 14px; font-size: 15px;
  border-color: #d5dbe3; border-radius: 10px;
  box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);
}
.auth .field input::placeholder { color: #a3acb9; }
.auth .input-reveal { position: relative; }
.auth .input-reveal input { width: 100%; padding-right: 50px !important; }
.auth .reveal-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--mute); cursor: pointer;
}
.auth .reveal-btn:hover { color: var(--text); background: #f1f4f8; }
.auth .reveal-btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
.auth .reveal-btn .eye-closed { display: none; }
.auth .reveal-btn[aria-pressed="true"] .eye-open { display: none; }
.auth .reveal-btn[aria-pressed="true"] .eye-closed { display: block; }
.auth .otp-input {
  max-width: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 18px !important; letter-spacing: 0.45em;
}
.auth .field-note { margin: -6px 0 0; font-size: 12px; color: #b76e00; }
.auth .auth-submit { height: 46px; border-radius: 10px; font-size: 15px; width: 100%; }
.auth .auth-submit.is-loading { opacity: 0.8; pointer-events: none; }
.auth .text-link { justify-self: center; }
.auth-error {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 8px;
  background: #fff0f2; border: 1px solid #ffd3da; color: #b4123a;
  font-size: 13px; line-height: 1.45;
}
.auth-error.hidden { display: none; }
.auth-fine { margin: 0; text-align: center; font-size: 12px; color: var(--mute); }
.auth-legal { margin: 0; text-align: center; font-size: 12px; color: var(--mute); }
.auth-legal a { color: var(--mute); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { gap: 18px; padding: 22px 20px; }
  .auth-brand .ab-title { font-size: 26px; }
  .auth-brand .ab-lead { font-size: 14px; }
  .auth-brand .ab-features, .auth-brand .ab-foot a { display: none; }
  .auth-brand .ab-ops { margin-top: 14px; }
  .auth-brand .ab-status { border-radius: 12px; }
  .auth-panel { padding: 8px 16px 28px; }
  .auth-card { margin: 24px auto; }
}

.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field span {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--mute);
}
.field input:not([type="checkbox"]):not([type="radio"]) {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
}
.field input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 1.5px solid #c4c9d4;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}
input[type="checkbox"]::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.5px solid transparent;
  border-bottom: 1.5px solid transparent;
  transform: rotate(-45deg) translateY(-0.5px);
}
input[type="checkbox"]:checked {
  background: var(--purple);
  border-color: var(--purple);
}
input[type="checkbox"]:checked::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.2);
}
.field.check-row {
  display: flex !important;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  grid-template-columns: unset;
}
.field.check-row > input[type="checkbox"] {
  margin-top: 3px;
}
.field.check-row > span {
  color: var(--body);
  font-weight: 400;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
.form-error { color: var(--danger); font-size: var(--fs-sm); margin: 12px 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
}
.btn-fill {
  background: var(--purple);
  color: #fff;
  width: 100%;
}
.btn-fill:hover { background: var(--purple-hover); }
.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--bg); }
.btn-banner {
  background: var(--purple);
  color: #fff;
  height: 32px;
  font-size: var(--fs-xs);
  padding: 0 14px;
  flex-shrink: 0;
}
.btn-danger-soft {
  background: #ffe8ec;
  color: var(--danger);
  border: 0;
  height: 32px;
  font-size: var(--fs-xs);
  padding: 0 12px;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 0;
}
.btn-danger:hover { background: #c41435; }
.btn-warn-soft {
  background: #fff4e5;
  color: var(--warn);
  border: 0;
  height: 32px;
  font-size: var(--fs-xs);
  padding: 0 12px;
}

/* —— App shell —— */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.test-banner {
  min-height: 48px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  font-size: var(--fs-sm);
  font-weight: 500;
  z-index: 40;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.test-banner > span { min-width: 0; }
.test-banner a { color: #a5b4fc; text-decoration: underline; }
.test-banner .mode-pill { flex-shrink: 0; }
.test-banner.live-mode { background: #0d7a4f; }
.test-banner.live-mode a { color: #d1fae5; }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

/* Sidebar — Stripe: light surface */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border-2);
  display: flex;
  flex-direction: column;
  padding: 12px 12px 16px;
  min-height: calc(100vh - 48px);
  position: sticky;
  top: 0;
  height: calc(100vh - 48px);
  overflow-y: auto;
}
.account-switch {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  margin-bottom: 10px;
}
.account-switch:hover { background: #eef2f7; }
.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.account-meta { flex: 1; min-width: 0; display: grid; }
.account-meta strong {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-meta small {
  font-size: 12px;
  color: var(--warn);
  font-weight: 600;
}
.account-meta small.live { color: var(--ok); }

.nav { display: grid; gap: 1px; }
.nav-section {
  margin: 18px 8px 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute-2);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
}
.nav-link svg { flex-shrink: 0; color: #697386; }
.nav-link .chev { margin-left: auto; color: var(--mute-2); }
.nav-link:hover { background: #eef2f7; color: var(--text); }
.nav-link:hover svg { color: var(--text); }
.nav-link.active {
  background: #e8e7ff;
  color: var(--text);
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--purple);
  border-radius: 0 6px 6px 0;
}
.nav-link.active svg { color: var(--purple); }
.nav-link.subtle { color: var(--mute); margin-top: 4px; font-size: 15px; }

.nav-group { display: grid; gap: 1px; }
.nav-toggle {
  font-weight: 500;
}
.nav-toggle .chev {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.nav-group:not(.is-collapsed) .nav-toggle {
  background: #f0f3f7;
}
.nav-group.is-collapsed .nav-toggle .chev {
  transform: rotate(-90deg);
}
.nav-group.is-collapsed .nav-sub {
  display: none;
}
.nav-sub {
  display: grid;
  gap: 1px;
  padding: 2px 0 6px;
  margin: 0 0 2px 10px;
  border-left: 2px solid #e3e8ee;
}
.nav-sublink {
  height: 32px;
  padding-left: 22px;
  font-size: var(--fs-sm);
  color: var(--mute);
  box-shadow: none !important;
  border-radius: 6px;
}
.nav-sublink:hover { color: var(--text); }
.nav-sublink.active {
  color: var(--text);
  font-weight: 500;
  background: #e8e7ff;
}

.empty-product {
  text-align: center;
  padding: 40px 24px;
}
.empty-product h2 {
  margin: 0 0 8px;
  font-size: 16px;
}
.empty-product p {
  margin: 0 0 16px;
  color: var(--mute);
  font-size: 13px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.app-tile {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-decoration: none !important;
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.app-tile:hover {
  border-color: #c7c3ff;
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.08);
}
.app-tile strong { font-size: 15px; font-weight: 600; }
.app-tile span { font-size: var(--fs-xs); color: var(--mute); }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 2px;
}
.env-select {
  display: grid;
  gap: 4px;
  padding: 4px 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mute-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.env-select select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--text);
  background: #fff;
}
.rates-hint {
  margin: 0 8px 8px;
  font-size: 12px;
  color: var(--mute-2);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* Main */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px) 1fr;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.search {
  grid-column: 2;
  height: 36px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--mute);
}
.search input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: var(--fs-sm);
  color: var(--text);
}
.top-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  justify-self: end;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--body);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: #eef2f7; }
.plus-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: var(--purple);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 400;
}

.page { padding: 28px 32px 64px; max-width: 1400px; }
.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.page-title-row h1 {
  margin: 0;
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.page-eyebrow {
  margin: 0 0 4px;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--mute);
}
.page-sub {
  margin: 6px 0 0;
  color: var(--mute);
  font-size: var(--fs);
  line-height: 1.5;
  max-width: 56ch;
  font-weight: 400;
}
.page-header-card {
  background: #f6f9fc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: -4px 0 18px;
  color: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.page-header-card strong {
  color: var(--text);
  font-weight: 600;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.content-primary { display: grid; gap: 16px; }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.metric-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 4px;
}
.metric-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-label .info { opacity: 0.5; font-size: var(--fs-xs); }
.metric-value {
  margin-top: 6px;
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1.1;
}
.metric-value.sm { font-size: 26px; }
.metric-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--mute-2);
}

.chart-head {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 8px;
}
.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--mute);
  font-weight: 500;
}
.chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.chart-legend .lg-vol { background: #635bff; }
.chart-legend .lg-cnt { background: #98a2b3; }
.chart-wrap {
  position: relative;
  margin-top: 8px;
  min-height: 180px;
}
#volume-chart,
#reporting-chart {
  width: 100%;
  height: 180px;
  display: block;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--mute);
  font-size: var(--fs-sm);
  pointer-events: none;
}

.activation-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.activation-steps {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  position: sticky;
  top: 72px;
}
.activation-step {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--body);
}
.activation-step:hover { background: #f6f9fc; }
.activation-step.active {
  background: #eeedfe;
  color: var(--text);
}
.activation-step .step-num {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #c4c9d4;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--mute);
  margin-top: 2px;
  position: relative;
}
.activation-step.done .step-num {
  background: var(--purple);
  border-color: var(--purple);
  color: transparent;
  font-size: 0;
}
.activation-step.done .step-num::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-0.5px);
}
.activation-step.active .step-num {
  border-color: var(--purple);
  color: var(--purple);
}
.activation-step.active.done .step-num {
  color: transparent;
}
.activation-step strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.activation-step span {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.35;
}
.activation-main {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px 28px;
  min-height: 420px;
}
.activation-conditions {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f3f7;
}
.activation-cond {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  line-height: 1.35;
  color: var(--body);
}
.activation-cond .mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid #c4c9d4;
  background: #fff;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0;
  color: transparent;
  position: relative;
}
.activation-cond .mark::after {
  content: "";
  width: 6px;
  height: 3.5px;
  border-left: 1.5px solid transparent;
  border-bottom: 1.5px solid transparent;
  transform: rotate(-45deg) translateY(-0.5px);
  opacity: 0;
}
.activation-cond.met .mark {
  background: var(--purple);
  border-color: var(--purple);
}
.activation-cond.met .mark::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
  opacity: 1;
}
.activation-cond.met { color: var(--text); font-weight: 500; }
.activation-main h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.activation-main .act-lead {
  margin: 0 0 20px;
  color: var(--mute);
  font-size: var(--fs-sm);
  max-width: 58ch;
}
.activation-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.activation-main textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font: inherit;
  resize: vertical;
}
.activation-main textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}
@media (max-width: 960px) {
  .activation-layout { grid-template-columns: 1fr; }
  .activation-steps { position: static; }
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--mute-2);
}

.balance-card .balance-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}
.text-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.text-link:hover { text-decoration: underline; }

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.overview-head h2,
.table-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ov-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.ov-card .ov-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mute);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}
.ov-card .ov-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.table-scroll { overflow: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid #f0f3f7;
  font-size: var(--fs-sm);
  vertical-align: top;
}
th {
  color: var(--mute);
  font-weight: 500;
  font-size: var(--fs-xs);
  letter-spacing: 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2f7;
  color: var(--body);
}
.status-pill.held { background: var(--purple-soft); color: var(--purple); }
.status-pill.released { background: var(--ok-bg); color: var(--ok); }
.status-pill.failed,
.status-pill.refunded,
.status-pill.suspended { background: #ffe8ec; color: var(--danger); }
.status-pill.active { background: var(--ok-bg); color: var(--ok); }
.status-pill.submitted { background: #fff4e5; color: #b76e00; }
.status-pill.pending { background: #eef2f7; color: var(--mute); }
.status-pill.delivered { background: var(--ok-bg); color: var(--ok); }

.content-aside { display: grid; gap: 12px; position: sticky; top: 72px; }
.aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.aside-card.muted-card { background: #fafbff; }
.aside-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.aside-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.aside-close {
  border: 0;
  background: none;
  color: var(--mute);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.aside-block {
  padding: 12px 0;
  border-top: 1px solid #f0f3f7;
}
.aside-block:first-of-type { border-top: 0; padding-top: 0; }
.aside-block strong {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: 4px;
}
.aside-block p {
  margin: 0 0 8px;
  color: var(--mute);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.key-line {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-size: var(--fs-xs);
}
.key-line span { color: var(--mute); }
.key-line code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.copy-btn {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--mute);
}
.mono-block {
  display: block;
  word-break: break-all;
  color: var(--mute);
}

.help-text { color: var(--mute); font-size: var(--fs-sm); margin: 0 0 16px; }
.key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f3f7;
}
.key-row strong { font-size: var(--fs-sm); }
.key-row code { display: block; margin-top: 3px; color: var(--mute); }
.reveal {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.reveal code { display: block; margin-top: 6px; word-break: break-all; }
.settings-nav-label {
  margin: 16px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8792a2;
}
.settings-nav-label:first-child { margin-top: 0; }
.settings-pane.hidden { display: none !important; }
.settings-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.settings-quick-card {
  text-align: left;
  padding: 14px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbff;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.settings-quick-card:hover {
  border-color: #c7c3ff;
  background: #eeedfe;
}
.settings-quick-card strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
}
.settings-quick-card span {
  font-size: 12px;
  color: var(--mute);
}
@media (max-width: 640px) {
  .settings-quick { grid-template-columns: 1fr; }
}
.divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.muted { color: var(--mute); font-size: var(--fs-xs); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat {
  display: grid;
  gap: 6px;
}
.stat span {
  font-size: 13px;
  color: var(--mute);
  font-weight: 500;
}
.stat strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
}

/* Stripe-style Workbench (bottom developer panel) */
.workbench {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 44px;
  z-index: 34;
  height: min(42vh, 420px);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 28px rgba(10, 37, 64, 0.08);
  display: flex;
  flex-direction: column;
}
.workbench[hidden] { display: none !important; }
.wb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
  flex-shrink: 0;
}
.wb-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  min-width: 0;
}
.wb-tab {
  border: 0;
  background: none;
  height: 40px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.wb-tab:hover { color: var(--text); }
.wb-tab.active {
  color: var(--text);
  border-bottom-color: var(--purple);
}
.wb-collapse {
  border: 0;
  background: none;
  color: var(--mute);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
}
.wb-collapse:hover { background: #eef2f7; color: var(--text); }
.wb-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.wb-main {
  padding: 16px 20px;
  overflow: auto;
  border-right: 1px solid var(--border);
}
.wb-pane { display: none; }
.wb-pane.active { display: block; }
.wb-pane h3 {
  margin: 0 0 6px;
  font-size: var(--fs-lg);
  font-weight: 600;
}
.wb-lead {
  margin: 0 0 16px;
  color: var(--mute);
  font-size: var(--fs-sm);
  max-width: 70ch;
}
.wb-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wb-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fafbff;
}
.wb-card strong {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: 6px;
}
.wb-card p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--mute);
}
.wb-dl {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}
.wb-dl div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  font-size: var(--fs-sm);
}
.wb-dl dt { color: var(--mute); margin: 0; }
.wb-dl dd { margin: 0; word-break: break-all; }
.wb-shell {
  margin: 0;
  padding: 14px 16px;
  background: var(--navy);
  color: #e8eef7;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
}
.wb-tools {
  padding: 16px;
  overflow: auto;
  background: #fafbff;
}
.wb-tools h4 {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.wb-tool-block {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.wb-tool-block strong {
  display: block;
  font-size: var(--fs-xs);
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.wb-tool-block p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--body);
}
.wb-key-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: var(--fs-xs);
}
.wb-key-row span { color: var(--mute); font-weight: 600; }
.wb-key-row code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .wb-body { grid-template-columns: 1fr; }
  .wb-tools { display: none; }
  .wb-cards { grid-template-columns: 1fr; }
}

/* Stripe-style sticky app footer */
.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 10px;
  background: #f6f9fc;
  border-top: 1px solid #e3e8ee;
  font-size: 13px;
  color: #425466;
}
.app-footer .footer-dev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1a2c44;
  font-weight: 500;
  text-decoration: none;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.app-footer .footer-dev:hover { background: #eef2f7; text-decoration: none; }
.app-footer .footer-dev svg { color: #697386; }
.app-footer .footer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.app-footer .footer-tool {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #697386;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.app-footer .footer-tool:hover { background: #eef2f7; color: #1a2c44; }
.footer-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #09825d;
  box-shadow: 0 0 0 2px rgba(9, 130, 93, 0.18);
  flex-shrink: 0;
}
.app.with-footer .layout {
  padding-bottom: 44px;
}
.app.with-footer .sidebar {
  min-height: calc(100vh - 48px - 44px);
  height: calc(100vh - 48px - 44px);
}
.app.workbench-open .layout {
  padding-bottom: calc(44px + min(42vh, 420px));
}
.app.workbench-open .guide {
  bottom: calc(56px + min(42vh, 420px));
}

.guide {
  position: fixed;
  right: 16px;
  bottom: 56px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 16px;
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.12);
  z-index: 36;
}
.guide-bar {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple) 40%, #e3e8ee 40%);
  margin: -14px -14px 12px;
}
.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.guide-head strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.guide-actions { display: flex; gap: 4px; }
.guide-close,
.guide-expand {
  border: 0;
  background: none;
  color: var(--mute);
  cursor: pointer;
  font-size: var(--fs);
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}
.guide-close:hover,
.guide-expand:hover { background: #f6f9fc; color: var(--text); }
.guide p {
  margin: 0 0 10px;
  color: var(--mute);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.guide .guide-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}
.modal.confirm-modal {
  opacity: 0;
  transition: opacity 0.16s ease;
}
.modal.confirm-modal.is-open { opacity: 1; }
.modal.confirm-modal.is-leaving { opacity: 0; }
.modal-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
}
.modal-card h2 { margin: 12px 0 6px; font-size: 18px; }
.modal-card > p { margin: 0 0 14px; color: var(--mute); font-size: 13px; }
.confirm-card {
  width: min(400px, 100%);
  text-align: center;
  padding: 28px 24px 22px;
}
.confirm-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
}
.confirm-icon.is-danger {
  background: #ffe8ec;
  color: var(--danger);
}
.confirm-icon.is-warn {
  background: #fff4e5;
  color: var(--warn);
}
.confirm-card h2 {
  margin: 14px 0 8px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.confirm-msg {
  margin: 0 0 22px;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-actions .btn { min-width: 110px; }
.key-dump { display: grid; gap: 10px; margin-bottom: 16px; }
.key-dump div {
  padding-top: 10px;
  border-top: 1px solid #f0f3f7;
  font-size: 12px;
}
.key-dump code { display: block; margin-top: 4px; word-break: break-all; }

.mode-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--purple-soft);
  color: var(--purple);
}
.mode-pill.off {
  background: #fff4e5;
  color: var(--warn);
}

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
  .overview-cards { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .content-aside { position: static; }
}
/* —— Toasts —— */
.toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 12px 32px rgba(10, 37, 64, 0.22);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--ok); }
.toast-error { background: var(--danger); }
.toast-warn { background: #c47a00; }
.toast-info { background: var(--purple); }
.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.85);
}
.toast-title {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
}
.toast-body p {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.4;
}
.toast-x {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.toast-x:hover { color: #fff; }

/* —— Custom select —— */
.sr-select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}
.cselect {
  position: relative;
  min-width: 140px;
}
.cselect-btn {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.cselect-btn:hover { background: var(--bg); }
.cselect.is-open .cselect-btn {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.12);
}
.cselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(10, 37, 64, 0.12);
  z-index: 40;
  display: none;
  max-height: 240px;
  overflow: auto;
}
.cselect.is-open .cselect-menu { display: block; }
.cselect-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  cursor: pointer;
  color: var(--body);
}
.cselect-option:hover { background: var(--bg); color: var(--text); }
.cselect-option.is-selected {
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 600;
}
.cselect.is-disabled { opacity: 0.55; pointer-events: none; }
.chip-select { min-width: 160px; }
.chip-select .cselect-btn { height: 32px; font-size: var(--fs-xs); }

/* —— Search results —— */
.search-wrap { position: relative; grid-column: 2; width: 100%; }
.search-wrap .search { grid-column: auto; }
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(10, 37, 64, 0.14);
  z-index: 50;
  overflow: hidden;
  display: none;
}
.search-results.is-open { display: block; }
.search-group {
  padding: 8px 0;
  border-bottom: 1px solid #f0f3f7;
}
.search-group:last-child { border-bottom: 0; }
.search-group-title {
  padding: 4px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute-2);
}
.search-item {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.search-item:hover { background: var(--bg); }
.search-item strong { font-size: var(--fs-sm); color: var(--navy); }
.search-item small { color: var(--mute); font-size: var(--fs-xs); }
.search-empty {
  padding: 16px;
  text-align: center;
  color: var(--mute);
  font-size: var(--fs-sm);
}

/* —— Account menu / logout center —— */
.account-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 56px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10, 37, 64, 0.12);
  padding: 8px;
  z-index: 30;
  display: none;
}
.account-menu.is-open { display: block; }
.account-menu .menu-row {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--body);
  cursor: pointer;
}
.account-menu .menu-row:hover { background: var(--bg); color: var(--text); }
.account-menu .menu-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--danger);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  width: 100%;
}
.account-menu .menu-logout:hover { background: #ffe8ec; }
.sidebar { position: relative; }
.sidebar-bottom .logout-center {
  display: flex;
  justify-content: center;
  padding: 10px 8px 4px;
}
.sidebar-bottom .logout-center .nav-link {
  width: auto;
  min-width: 140px;
  justify-content: center;
  color: var(--danger);
  border: 1px solid #ffd0d8;
  background: #fff;
}
.sidebar-bottom .logout-center .nav-link:hover {
  background: #ffe8ec;
  color: var(--danger);
}

/* —— Limits / guide cards —— */
.limits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.limit-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.limit-card span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--mute);
  font-weight: 500;
  margin-bottom: 6px;
}
.limit-card strong {
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
  color: var(--navy);
}
.guide-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.guide-list li {
  padding: 12px 0;
  border-top: 1px solid #f0f3f7;
}
.guide-list li.activation-cond {
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}
.guide-list li.activation-cond .mark { margin-top: 3px; }
.guide-list li:first-child { border-top: 0; padding-top: 0; }
.guide-list strong {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: 4px;
}
.guide-list p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--mute);
  line-height: 1.45;
}
.review-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.review-list li {
  margin: 0;
  border-top: 1px solid #f0f3f7;
}
.review-list li:first-child { border-top: 0; }
.review-jump {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.review-jump:hover { background: #f6f9fc; }
.review-jump .mark { margin-top: 3px; }
.review-jump .review-meta {
  flex: 1;
  min-width: 0;
}
.review-jump strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}
.review-jump .review-status {
  margin: 0;
  font-size: 12px;
  color: var(--mute);
  line-height: 1.35;
}
.review-jump.met .review-status { color: var(--ok); }
.review-jump:not(.met) .review-status { color: var(--warn); }
.review-jump .review-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
  white-space: nowrap;
  margin-top: 2px;
}
.review-jump.met .review-cta {
  color: var(--mute);
  font-weight: 500;
}
.act-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #f6f9fc;
  border-radius: 8px;
  font-size: 13px;
  color: var(--body);
}
.act-progress strong { color: var(--text); }
.act-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--mute);
  max-width: 52ch;
}
.activation-conditions .conds-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}
.activation-conditions .conds-head p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.activation-conditions .conds-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
}

.notif-panel {
  position: absolute;
  right: 20px;
  top: 64px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(10, 37, 64, 0.14);
  z-index: 45;
  display: none;
  overflow: hidden;
}
.notif-panel.is-open { display: block; }
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.notif-list { max-height: 280px; overflow: auto; }
.notif-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f3f7;
  font-size: 12px;
}
.notif-item strong { display: block; margin-bottom: 2px; font-size: var(--fs-sm); }
.notif-item span { color: var(--mute); }
.notif-empty { padding: 20px; text-align: center; color: var(--mute); font-size: var(--fs-sm); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}
.toolbar input[type="search"] {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
}
.toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.12);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  font-size: 13px;
}
.detail-grid dt { color: var(--mute); font-size: 12px; }
.detail-grid dd { margin: 2px 0 0; font-weight: 500; }

.modal-card.wide { width: min(560px, 100%); }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pager .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  width: auto;
}
.pager-label {
  font-size: 13px;
  color: var(--mute);
}
.kyc-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.kyc-modal-actions .btn { width: auto; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1100px) {
  .limits-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
}

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.nav-toggle-btn:hover { background: #eef2f7; }
.sidebar-backdrop {
  display: none;
}

@media (max-width: 860px) {
  .nav-toggle-btn { display: inline-grid; }

  .layout { grid-template-columns: 1fr; }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(10, 37, 64, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-backdrop[hidden] { display: none !important; }
  body.nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100dvh !important;
    min-height: 100dvh !important;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--border-2);
    border-bottom: 0;
    background: #fff;
    box-shadow: none;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(10, 37, 64, 0.22);
  }
  .app.with-footer .sidebar {
    height: 100dvh !important;
    min-height: 100dvh !important;
  }
  .sidebar-bottom { position: static; margin-top: 24px; }
  .nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
  }
  .nav-section { margin-top: 14px; }
  .account-switch { margin-bottom: 8px; }

  .test-banner {
    flex-direction: column;
    height: auto;
    min-height: 48px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    align-items: flex-start;
    gap: 8px;
  }
  .test-banner .btn-banner,
  .test-banner .mode-pill { align-self: flex-start; }

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
    align-items: center;
  }
  .nav-toggle-btn { grid-column: 1; grid-row: 1; }
  .top-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .search { width: 100%; }

  .page { padding: 16px 14px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .page-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-title-row h1 { font-size: 24px; }
  .page-title-row .btn { width: 100%; }
  .page-header-card { font-size: 13px; }

  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 22px; }
  .overview-cards { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .metric-pair { gap: 16px; }
  .metric-value { font-size: 28px; }
  .balance-card .balance-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .balance-card .balance-row > :last-child { grid-column: 1 / -1; }

  .activation-layout { grid-template-columns: 1fr; }
  .activation-steps {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .activation-step { flex: 0 0 auto; min-width: 140px; }

  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px;
  }
  th, td { padding: 12px 8px; white-space: nowrap; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .field-inline { min-width: 100%; }
  .pager { gap: 8px; }
  .pager .btn { flex: 1; min-width: 0; }

  .notif-panel { right: 12px; left: 12px; width: auto; }
  .form-row-2 { grid-template-columns: 1fr; }

  .workbench {
    left: 0;
    right: 0;
    height: min(55vh, 480px);
    bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  }
  .app.workbench-open .layout {
    padding-bottom: calc(44px + min(55vh, 480px) + env(safe-area-inset-bottom, 0px));
  }
  .guide {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .app-footer {
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(44px + env(safe-area-inset-bottom, 0px));
  }
  .app-footer .footer-dev span:not(.footer-dot) {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .modal {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  .modal-card,
  .modal-card.wide,
  .kyc-modal-card {
    width: 100%;
    max-height: min(92dvh, 900px);
    margin: 0;
    border-radius: 14px 14px 10px 10px;
    overflow: auto;
  }
  .confirm-actions {
    flex-direction: column-reverse;
  }
  .confirm-actions .btn { width: 100%; min-width: 0; }
  .kyc-modal-actions .btn { width: 100%; }

  .toast-host {
    top: auto;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 520px) {
  .stat-row { grid-template-columns: 1fr; }
  .metric-pair { grid-template-columns: 1fr; }
  .balance-card .balance-row { grid-template-columns: 1fr; }
  .balance-card .balance-row > :last-child { grid-column: auto; }
  .top-actions .plus-btn span { display: none; }
  .top-actions .icon-btn#help-btn { display: none; }
  .auth-card { padding: 22px 18px; }
  .wb-dl div { grid-template-columns: 1fr; gap: 2px; }
  .apps-grid { grid-template-columns: 1fr 1fr; }
  .page-sub { font-size: 13px; }
}

/* Direct collections / payouts statuses */
.status-pill.succeeded { background: var(--ok-bg); color: var(--ok); }
.status-pill.created { background: var(--purple-soft); color: var(--purple); }
.status-pill.expired { background: #eef2f7; color: var(--mute); }

.dir-in { color: var(--ok); font-weight: 600; }
.dir-out { color: #c2410c; font-weight: 600; }

#activity-body td { white-space: nowrap; }

/* Let wide tables scroll inside their card instead of stretching the column */
.content-primary { min-width: 0; grid-template-columns: minmax(0, 1fr); }

/* ============================================================
   Payinstant purple theme — applied across dashboard and admin.
   Semantic colors (live/success green, danger red, warn orange)
   are intentionally left unchanged.
   ============================================================ */
:root {
  --brand-deep: #2f23a8;
  --brand-grad: linear-gradient(90deg, #3d2fc4 0%, #5b4ff0 100%);
  --brand-tint: #f4f2ff;
  --brand-line: #e4e0fb;
  --bg: #f8f7fe;
  --border: #e7e4f6;
}
.test-banner { background: var(--brand-grad); }
.test-banner a { color: #e2deff; }
.test-banner.live-mode { background: #0d7a4f; }
.account-avatar { background: var(--brand-grad); }
.sidebar { background: #fcfbff; border-right-color: var(--brand-line); }
.nav-link:hover,
.account-switch:hover { background: #efecff; }
.nav-section { color: #7b72c9; }
.topbar { border-bottom-color: var(--brand-line); }
.page-header-card {
  background: var(--brand-tint);
  border-color: var(--brand-line);
  border-left: 3px solid var(--purple);
}
.panel-card,
.aside-card,
.ov-card,
.stat,
.limit-card,
.wb-card { border-color: var(--brand-line); }
.ov-card,
.stat { box-shadow: inset 0 2px 0 var(--purple); }
.metric-value,
.ov-card .ov-val,
.stat strong { color: var(--brand-deep); }
.page-eyebrow { color: var(--purple); }
.toast { background: var(--brand-deep); }
.wb-shell { background: #1d1857; }
.app-footer { background: #fcfbff; border-top-color: var(--brand-line); }
.app-footer .footer-dev:hover,
.app-footer .footer-tool:hover { background: #efecff; }
.mode-pill { background: var(--purple-soft); color: var(--brand-deep); }
.limit-card { box-shadow: inset 0 2px 0 var(--purple); }
.limit-card strong,
.wb-card p[style*="font-weight:700"] { color: var(--brand-deep) !important; }

/* —— KYC document dropzone (replaces the native file input) —— */
.sr-file {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.dropzone {
  position: relative;
  border: 1.5px dashed #c9c2f5;
  border-radius: 12px;
  background: var(--brand-tint, #f4f2ff);
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.dropzone:hover,
.dropzone.is-drag { border-color: var(--purple); background: #ece9ff; }
.dropzone:focus-within { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.14); }
.dz-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
}
.dz-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; background: var(--brand-grad, #635bff);
  box-shadow: 0 6px 16px rgba(61, 47, 196, 0.25);
}
.dz-title { font-size: 14px; color: var(--text); }
.dz-title u { color: var(--purple); text-underline-offset: 3px; font-weight: 600; }
.dz-hint { font-size: 12px; color: var(--mute); }
.dz-file { display: none; align-items: center; gap: 12px; padding: 14px 16px; }
.dropzone.has-file { border-style: solid; border-color: var(--brand-line, #e4e0fb); background: #fff; }
.dropzone.has-file .dz-empty { display: none; }
.dropzone.has-file .dz-file { display: flex; }
.dz-file-ico {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--purple); background: var(--purple-soft);
}
.dz-file-meta { display: grid; min-width: 0; flex: 1; }
.dz-file-meta strong { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-file-meta span { font-size: 12px; color: var(--ok); }
.dz-replace { width: auto !important; height: 34px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.dz-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; display: none; background: #ece9ff; }
.dz-progress span { display: block; height: 100%; width: 40%; background: var(--purple); animation: dz-slide 1s ease-in-out infinite; }
.dropzone.is-uploading .dz-progress { display: block; }
.dropzone.is-uploading .dz-file-meta span { color: var(--mute); }
.dropzone.is-uploading .dz-replace { pointer-events: none; opacity: 0.5; }
@keyframes dz-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .dz-progress span { animation-duration: 3s; } }
.field input.is-locked {
  background: #f1f0f8 !important;
  color: var(--mute) !important;
  border-color: var(--brand-line, #e4e0fb) !important;
  cursor: not-allowed;
  box-shadow: none !important;
}
.field-lock { font-size: 12px; color: var(--mute); }
/* Dropzone parts live inside .field: win over the generic `.field span` rule. */
.field .dropzone .dz-ico { color: #fff; }
.field .dropzone .dz-title { color: var(--text); font-size: 14px; font-weight: 400; }
.field .dropzone .dz-title strong { font-weight: 600; }
.field .dropzone .dz-hint { color: var(--mute); font-size: 12px; font-weight: 400; }
.field .dropzone .dz-file-ico { color: var(--purple); }
.field .dropzone .dz-file-meta span { font-size: 12px; font-weight: 500; color: var(--ok); }
.field .dropzone.is-uploading .dz-file-meta span { color: var(--mute); }
