:root {
  --ink: #17211f;
  --muted: #687874;
  --soft: #8a9895;
  --line: #dce5e2;
  --line-strong: #c9d6d2;
  --page: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #f8fbfa;
  --sidebar: #082f2e;
  --sidebar-soft: #0f4442;
  --brand: #0e6662;
  --brand-dark: #084b48;
  --brand-light: #dff3f0;
  --success: #176b52;
  --success-bg: #e6f6ef;
  --warning: #916100;
  --warning-bg: #fff5d9;
  --danger: #a33d41;
  --danger-bg: #fff0f0;
  --info: #285f8b;
  --info-bg: #eaf4fb;
  --neutral-bg: #edf2f1;
  --shadow-sm: 0 1px 2px rgba(9, 41, 38, .05), 0 5px 16px rgba(9, 41, 38, .04);
  --shadow-md: 0 18px 45px rgba(7, 39, 36, .11);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 258px;
  --topbar-height: 82px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
svg { fill: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.15; }
h2 { margin-bottom: 8px; font-size: 1.16rem; line-height: 1.3; }
h3 { margin-bottom: 6px; font-size: 1rem; }
p { margin-bottom: 12px; }
small { display: block; color: var(--muted); }
code, pre, .mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
pre {
  max-width: 100%;
  margin: 12px 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid #d8e3e0;
  border-radius: 11px;
  background: #102b2a;
  color: #eaf5f2;
  font-size: 12.5px;
  line-height: 1.65;
}
pre code { color: inherit; white-space: pre; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.center { text-align: center; }
.wrap { overflow-wrap: anywhere; word-break: break-word; }
.numeric { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }

/* Buttons */
.button,
.icon-button,
.link-button {
  border: 0;
  cursor: pointer;
}
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.15;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible,
.icon-button:focus-visible,
.link-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(26, 126, 119, .2);
  outline-offset: 2px;
}
.button.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 18px rgba(14, 102, 98, .18);
}
.button.primary:hover { background: var(--brand-dark); }
.button.secondary {
  border-color: #c8d9d5;
  background: #edf7f5;
  color: var(--brand-dark);
}
.button.secondary:hover { background: #e2f2ef; }
.button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: #3a4b48;
}
.button.ghost:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.button.danger { background: var(--danger); color: #fff; }
.button.compact { min-height: 34px; padding: 7px 11px; border-radius: 8px; font-size: 12px; }
.button.full { width: 100%; }
.button[disabled] { cursor: not-allowed; opacity: .5; transform: none; }
.link-button {
  padding: 3px 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.link-button:hover, .text-link:hover { color: var(--brand); }
.text-link { color: var(--brand); font-weight: 750; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 8px;
  border-radius: 9px;
  background: transparent;
  color: inherit;
}
.icon-button:hover { background: rgba(255,255,255,.08); }
.icon-button svg { width: 21px; height: 21px; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 20px 16px 18px;
  overflow-y: auto;
  background: var(--sidebar);
  color: #d9eeeb;
  box-shadow: 12px 0 38px rgba(3, 28, 27, .07);
}
.brand-row { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e1f3f0;
  color: var(--sidebar);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.07em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}
.brand-mark.large { width: 62px; height: 62px; border-radius: 18px; font-size: 30px; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
.brand-copy strong { color: #fff; font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: #83aaa5; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-close { display: none; font-size: 25px; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; margin-top: 25px; }
.nav-label {
  margin: 20px 10px 5px;
  color: #719b96;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #a9cbc7;
  font-weight: 650;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .83; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active { background: #14534f; color: #fff; box-shadow: inset 3px 0 #8bd3ca; }
.sidebar-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(207,235,231,.12); }
.gateway-state { display: flex; align-items: center; gap: 10px; padding: 8px 9px; }
.gateway-state > div { min-width: 0; }
.gateway-state strong { display: block; overflow: hidden; color: #eaf7f5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.gateway-state small { overflow: hidden; margin-top: 2px; color: #7ea7a2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #94a19f; }
.status-dot.online { background: #56c9a4; box-shadow: 0 0 0 4px rgba(86,201,164,.12); }
.status-dot.offline { background: #dd8a8d; box-shadow: 0 0 0 4px rgba(221,138,141,.11); }
.status-dot.pulse { animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 3px rgba(86,201,164,.17)} 50%{box-shadow:0 0 0 8px rgba(86,201,164,0)} }
#installAppButton { width: 100%; margin-top: 8px; border-color: rgba(255,255,255,.16); background: transparent; color: #dcefeb; }
.sidebar-overlay { display: none; }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 30px;
  border-bottom: 1px solid rgba(202,216,212,.8);
  background: rgba(248,251,250,.94);
  backdrop-filter: blur(16px);
}
.topbar-title { display: flex; min-width: 0; align-items: center; gap: 12px; }
.topbar-title h1 { overflow: hidden; margin: 0; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.mobile-menu { display: none; color: var(--brand-dark); }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.admin-menu { display: flex; align-items: center; gap: 9px; padding-left: 15px; border-left: 1px solid var(--line); }
.admin-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-light); color: var(--brand-dark); font-weight: 850; }
.admin-name { min-width: 105px; line-height: 1.25; }
.admin-name strong { display: block; max-width: 130px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-name small { max-width: 130px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 28px 30px 48px; }
.narrow-content { max-width: 920px; }

/* Cards, labels and messages */
.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading p:last-child { margin-bottom: 0; }
.eyebrow { margin-bottom: 6px; color: var(--brand); font-size: 9.5px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}
.alert.success { border-color: #c7e8da; background: var(--success-bg); color: var(--success); }
.alert.warning { border-color: #eedda9; background: var(--warning-bg); color: #79520a; }
.alert.danger { border-color: #efcdcf; background: var(--danger-bg); color: var(--danger); }
.alert.info { border-color: #cddfec; background: var(--info-bg); color: var(--info); }
.alert-close { flex: 0 0 auto; border: 0; background: transparent; color: currentColor; cursor: pointer; font-size: 20px; opacity: .7; }
.alert.persistent { align-items: center; }
.info-box {
  padding: 14px 15px;
  border: 1px solid #cfe2de;
  border-radius: 10px;
  background: #f2faf8;
  color: #31504b;
}
.info-box strong { display: block; margin-bottom: 3px; }
.info-box p { margin: 0; }
.note { padding: 11px 13px; border-left: 3px solid var(--brand); background: var(--surface-soft); color: var(--muted); }
.mode-chip,
.code-chip,
.client-code {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--neutral-bg);
  color: #4c5f5b;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mode-chip.sandbox { background: #eef2f1; color: #566763; }
.mode-chip.production { background: #e4f4ee; color: var(--success); }
.client-code { background: var(--brand-light); color: var(--brand-dark); }
.code-chip { text-transform: none; letter-spacing: 0; font-family: "SFMono-Regular", Consolas, monospace; }
.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 780;
  line-height: 1;
  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.muted, .badge.neutral { background: var(--neutral-bg); color: #61706d; }

/* Stats and layouts */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card {
  min-width: 0;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stat-card.accent { border-color: transparent; background: var(--sidebar); color: #fff; }
.stat-card .stat-label { color: var(--muted); font-size: 11px; font-weight: 680; }
.stat-card.accent .stat-label, .stat-card.accent small { color: #a8cdca; }
.stat-card strong { display: block; overflow: hidden; margin: 8px 0 5px; font-size: clamp(1.22rem, 2.5vw, 1.65rem); line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.stat-card small { font-size: 10.5px; }
.stat-grid.four-compact .stat-card { min-height: 105px; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 20px; margin-bottom: 20px; }
.dashboard-grid { align-items: start; }
.detail-grid { align-items: start; }
.detail-grid > aside { position: sticky; top: calc(var(--topbar-height) + 20px); }
.quick-actions { display: grid; gap: 10px; }
.quick-card { display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; transition: border .15s ease, background .15s ease; }
.quick-card:hover { border-color: #bbd2cd; background: var(--surface-soft); }
.quick-card > span:first-child { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-light); color: var(--brand-dark); font-weight: 900; }
.quick-card strong { display: block; }
.quick-card small { margin-top: 2px; font-size: 10px; }
.quick-card > span:last-child { color: var(--soft); }
.system-list { display: grid; gap: 0; }
.system-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.system-list > div:last-child { border-bottom: 0; }
.system-list dt { color: var(--muted); }
.system-list dd { margin: 0; font-weight: 700; text-align: right; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--surface-soft); color: #657570; font-size: 9.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdfc; }
td small { max-width: 260px; overflow: hidden; margin-top: 3px; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.table-primary { color: #174e4a; font-weight: 750; }
.table-primary:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.empty-cell { padding: 34px; color: var(--muted); text-align: center; }
.inline-json { display: block; max-width: 420px; overflow: hidden; color: #5b6966; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

/* Forms */
.stack-form { display: grid; gap: 15px; }
.max-form { max-width: 620px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field > span { color: #344440; font-size: 11px; font-weight: 750; }
.field em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.field small { font-size: 9.5px; }
input, select, textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #aebfbb; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,102,98,.1); outline: 0; }
input::placeholder, textarea::placeholder { color: #a2aeab; }
input[readonly] { background: #f5f8f7; color: #566561; }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, #687874 50%), linear-gradient(135deg, #687874 50%, transparent 50%); background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-divider { display: flex; align-items: center; gap: 10px; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.form-divider::before, .form-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.filter-card { margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: 1.5fr repeat(4,minmax(130px,.8fr)) auto; gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; }
.compact-filter { grid-template-columns: 1fr 1fr auto; }
.toggle-field { display: flex; align-items: flex-start; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.toggle-field input { width: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.toggle-field strong { display: block; margin-bottom: 2px; font-size: 11px; }
.toggle-field small { font-size: 9.5px; }
.settings-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.75fr); gap: 20px; align-items: start; }
.settings-main { grid-row: span 3; }
.settings-save { position: sticky; top: calc(var(--topbar-height) + 20px); }
.settings-save .button { width: 100%; }
.webhook-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.webhook-banner > div:first-child { min-width: 250px; }
.copy-row.wide { min-width: min(560px, 55%); margin-top: 0; }
.key-card .stack-form { margin: 15px 0; }
.key-card > .button { width: 100%; }
.copy-row { display: flex; gap: 8px; margin-top: 17px; }
.copy-row input { min-width: 0; font-size: 11px; }
.button-stack { display: grid; gap: 9px; margin-top: 18px; }
.button-stack form { width: 100%; }

/* Transactions / detail */
.detail-hero { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(200px,.7fr) auto; align-items: center; gap: 22px; margin-bottom: 20px; }
.detail-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-hero h2 { overflow-wrap: anywhere; margin-bottom: 4px; font-size: 1.35rem; }
.amount-block { padding: 3px 20px; border-left: 1px solid var(--line); }
.amount-block span { color: var(--muted); font-size: 10px; }
.amount-block strong { display: block; margin: 5px 0; font-size: 1.55rem; }
.amount-block small { max-width: 220px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hero-actions form { display: inline-flex; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 155px minmax(0,1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.detail-list dd small { display: inline; margin-left: 4px; }
.qr-preview-card { text-align: center; }
.qr-frame { width: min(310px, 100%); margin: 0 auto 14px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: inset 0 0 0 6px #f7faf9; }
.qr-frame img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.state-illustration { min-height: 250px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; }
.state-illustration > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--neutral-bg); color: var(--muted); font-size: 28px; font-weight: 800; }
.state-illustration.success-state > span { background: var(--success-bg); color: var(--success); }
.state-illustration strong { font-size: 1rem; }
.raw-card { margin-top: 20px; }
.raw-card details { border-bottom: 1px solid var(--line); }
.raw-card details:last-child { border-bottom: 0; }
.raw-card summary { padding: 13px 0; cursor: pointer; font-weight: 750; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 18px; color: var(--muted); font-size: 11px; }
.pagination a { color: var(--brand); font-weight: 750; }

/* Client cards and credentials */
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.client-card { display: flex; min-height: 230px; flex-direction: column; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: transform .15s ease, border .15s ease, box-shadow .15s ease; }
.client-card:hover { transform: translateY(-2px); border-color: #b8d0cb; box-shadow: var(--shadow-md); }
.client-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.client-card h3 { margin-top: 15px; font-size: 1.08rem; }
.client-card p { flex: 1; color: var(--muted); font-size: 11px; }
.client-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 7px 0 13px; }
.client-card dl div { padding: 10px; border-radius: 9px; background: var(--surface-soft); }
.client-card dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.client-card dd { margin: 3px 0 0; font-size: 12px; font-weight: 800; }
.client-footer { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.empty-state { grid-column: 1/-1; padding: 48px 20px; text-align: center; }
.empty-state strong { display: block; font-size: 1.15rem; }
.empty-state p { color: var(--muted); }
.credential-panel { margin-bottom: 20px; padding: 18px; border: 1px solid #eed497; border-radius: var(--radius); background: #fff9e9; box-shadow: var(--shadow-sm); }
.credential-warning { margin-bottom: 13px; }
.credential-warning strong { color: #7d5708; }
.credential-warning p { margin: 3px 0 0; color: #846e42; font-size: 11px; }
.credential-row { display: flex; align-items: center; gap: 12px; margin-top: 9px; padding: 11px; border: 1px solid #eadfbf; border-radius: 9px; background: #fff; }
.credential-row > div { min-width: 0; flex: 1; }
.credential-row span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.credential-row code { display: block; overflow: auto; margin-top: 3px; color: #3e4a47; white-space: nowrap; }
.key-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.key-card + .key-card { margin-top: 10px; }
.key-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Docs */
.docs-grid { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--topbar-height) + 20px); display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.docs-nav a { padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.docs-nav a:hover { background: var(--surface-soft); color: var(--brand); }
.docs-content, .docs-sections { display: grid; gap: 18px; min-width: 0; }
.docs-hero { padding: 25px; border-radius: var(--radius); background: var(--sidebar); color: #fff; }
.docs-hero p { color: #b9d7d4; }
.docs-section { scroll-margin-top: 110px; }
.docs-section h2 { font-size: 1.28rem; }
.docs-section h3 { margin-top: 24px; }
.endpoint-title { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.endpoint-title code { overflow-wrap: anywhere; color: var(--brand-dark); font-size: 13px; font-weight: 750; }
.method { padding: 5px 8px; border-radius: 6px; color: #fff; font-size: 9px; font-weight: 850; }
.method.post { background: var(--brand); }
.method.get { background: var(--info); }
.status-doc-list { display: grid; gap: 8px; }
.status-doc-list > div { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-doc-list p { margin: 0; color: var(--muted); }

/* Auth */
.auth-body { min-height: 100vh; background: #eef4f2; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(430px, .95fr); }
.auth-brand-panel { display: grid; place-items: center; padding: clamp(35px,7vw,95px); overflow: hidden; background: var(--sidebar); color: #fff; }
.auth-brand-panel::before { position: fixed; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; content: ""; transform: translate(-42%,-40%); }
.auth-brand-inner { position: relative; z-index: 1; max-width: 590px; }
.auth-brand-inner .eyebrow { margin-top: 28px; color: #81c3bb; }
.auth-brand-inner h1 { max-width: 560px; margin-bottom: 20px; font-size: clamp(2.3rem,5vw,4.3rem); }
.auth-brand-inner > p:not(.eyebrow) { max-width: 540px; color: #accbc7; font-size: 15px; }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.auth-points span { padding: 8px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #cde3df; font-size: 10px; }
.auth-form-panel { display: grid; place-items: center; padding: 35px; }
.auth-card { width: min(430px,100%); padding: 35px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.auth-card h2 { margin-bottom: 6px; font-size: 1.65rem; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-foot { margin: 24px 0 0; color: var(--soft); font-size: 9.5px; text-align: center; }

/* Public payment */
.payment-body { min-height: 100vh; background: linear-gradient(180deg, #082f2e 0, #0c4643 270px, #eef4f2 270px, #eef4f2 100%); }
.payment-shell { width: min(570px,100%); margin: 0 auto; padding: 25px 18px 42px; }
.payment-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #fff; }
.public-brand { display: flex; align-items: center; gap: 10px; }
.public-brand > span:last-child { display: flex; flex-direction: column; }
.public-brand strong { font-size: 14px; }
.public-brand small { color: #a8ccc8; font-size: 9px; }
.payment-card { padding: clamp(20px,5vw,34px); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 24px 65px rgba(4,31,29,.2); }
.payment-summary { text-align: center; }
.payment-summary h1 { margin-bottom: 7px; font-size: 1.28rem; }
.payment-reference { color: var(--muted); font-size: 10px; }
.payment-amount { margin: 18px 0 25px; padding: 16px; border-radius: 12px; background: var(--surface-soft); }
.payment-amount span { color: var(--muted); font-size: 10px; }
.payment-amount strong { display: block; margin-top: 3px; color: var(--sidebar); font-size: clamp(1.65rem,6vw,2.3rem); }
.payment-state { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.public-qr { width: min(325px,100%); }
.status-line { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; }
.countdown { margin: 5px 0 12px; color: var(--warning); font-size: 12px; font-weight: 750; text-align: center; }
.payment-help { max-width: 390px; margin: 0 auto 15px; color: var(--muted); font-size: 11px; text-align: center; }
.large-state { min-height: 280px; }
.large-state > span { width: 78px; height: 78px; font-size: 36px; }
.large-state strong { font-size: 1.25rem; }
.payment-meta { margin: 18px 0; }
.payment-meta > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.payment-meta dt { color: var(--muted); font-size: 10px; }
.payment-meta dd { max-width: 68%; margin: 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 700; text-align: right; }
.secure-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 10px; background: #f0f8f6; color: #44605b; }
.secure-note > span { width: 21px; height: 21px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 11px; font-weight: 900; }
.secure-note p { margin: 1px 0 0; font-size: 9.5px; }
.payment-footer { padding: 22px 0; color: rgba(255,255,255,.66); font-size: 9.5px; text-align: center; }

/* Errors */
.error-content, .standalone-error { min-height: 72vh; display: grid; place-items: center; padding: 30px; }
.standalone-error { min-height: 100vh; background: var(--page); }
.error-card { width: min(500px,100%); padding: 40px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-md); text-align: center; }
.error-code { display: inline-grid; min-width: 72px; height: 72px; place-items: center; margin-bottom: 17px; border-radius: 18px; background: var(--brand-light); color: var(--brand-dark); font-size: 22px; font-weight: 900; }
.error-card p { color: var(--muted); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .client-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filter-actions { grid-column: span 3; }
  .detail-hero { grid-template-columns: minmax(0,1fr) minmax(180px,.55fr); }
  .detail-hero .hero-actions { grid-column: 1/-1; justify-content: flex-start; }
}

@media (max-width: 920px) {
  :root { --sidebar-width: 278px; --topbar-height: 70px; }
  body.sidebar-open { overflow: hidden; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: 16px 0 50px rgba(3,28,27,.22); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .mobile-menu { display: inline-grid; }
  .sidebar-overlay { position: fixed; z-index: 45; inset: 0; display: block; visibility: hidden; background: rgba(2,20,19,.5); opacity: 0; transition: .2s ease; }
  body.sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .app-main { margin-left: 0; }
  .topbar { padding: 11px 18px; }
  .topbar-actions > .button { display: none; }
  .content { padding: 22px 18px 40px; }
  .split-grid, .settings-layout { grid-template-columns: 1fr; }
  .settings-main { grid-row: auto; }
  .detail-grid > aside, .settings-save { position: static; }
  .webhook-banner { align-items: stretch; flex-direction: column; }
  .copy-row.wide { min-width: 0; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-nav { position: static; flex-direction: row; overflow-x: auto; }
  .docs-nav a { flex: 0 0 auto; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-form-panel { min-height: 100vh; }
}

@media (max-width: 700px) {
  body { font-size: 13px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .admin-name { display: none; }
  .admin-menu { gap: 7px; padding-left: 10px; }
  .content { padding: 17px 12px 35px; }
  .card { padding: 16px; border-radius: 12px; }
  .section-heading { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-heading > .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 108px; padding: 14px; }
  .stat-card strong { font-size: 1.22rem; }
  .split-grid { gap: 12px; }
  .client-grid { grid-template-columns: 1fr; }
  .form-grid, .filter-grid, .compact-filter { grid-template-columns: 1fr; }
  .span-2, .filter-actions { grid-column: 1; }
  .filter-actions { flex-direction: column; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .detail-hero { grid-template-columns: 1fr; padding: 18px; }
  .amount-block { padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .hero-actions { grid-column: 1; flex-direction: column; }
  .hero-actions .button, .hero-actions form, .hero-actions form .button { width: 100%; }
  .detail-list > div { grid-template-columns: 1fr; gap: 3px; }
  .copy-row { flex-direction: column; }
  .credential-row { align-items: stretch; flex-direction: column; }
  .credential-row .button { width: 100%; }
  .pagination { justify-content: center; }
  .status-doc-list > div { grid-template-columns: 95px 1fr; }
  .auth-form-panel { padding: 18px; }
  .auth-card { padding: 24px 19px; }
  .payment-shell { padding: 16px 11px 30px; }
  .payment-card { padding: 21px 16px; }
  .payment-header { padding: 0 5px; }
}

@media (max-width: 430px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 100px; }
  .admin-menu form { display: none; }
  .payment-meta > div { flex-direction: column; gap: 2px; }
  .payment-meta dd { max-width: 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
