/* PayFast partner console — design system.
   Palette: cool paper + deep ink, one jade accent. Type: Space Grotesk (display)
   / Inter (body) / JetBrains Mono (all money, ids, tokens — the ledger line). */

:root {
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --ink: #0e1726;
  --ink-soft: #36425a;
  --muted: #6b7686;
  --line: #e4e8ef;
  --line-strong: #d3d9e3;

  --accent: #0f9d74;
  --accent-ink: #0a6f52;
  --accent-wash: #e7f5f0;
  --amber: #c9821a;
  --amber-wash: #fbf1df;
  --red: #d04848;
  --red-wash: #fbeaea;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(14, 23, 38, 0.04), 0 8px 24px -16px rgba(14, 23, 38, 0.18);
  --sidebar-w: 232px;

  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* tabular money / ids */
.mono {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1, "zero" 1;
}
.amount {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.amount .ccy {
  color: var(--muted);
  font-size: 0.78em;
  text-transform: uppercase;
  margin-right: 0.35em;
  letter-spacing: 0.04em;
}

/* ---------- app shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--ink);
  color: #c2cad8;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 22px;
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand .spark {
  width: 11px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
  transform: skewX(-12deg);
  box-shadow: 0 0 0 3px rgba(15, 157, 116, 0.18);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #aeb8c8;
  font-size: 13.5px;
  position: relative;
  border-left: 2px solid transparent;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #eef1f6;
  text-decoration: none;
}
.nav a.active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-left-color: var(--accent);
}
.nav a.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.nav .tag {
  margin-left: auto;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7790;
  border: 1px solid #2a3650;
  border-radius: 4px;
  padding: 1px 4px;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5d6884;
  padding: 18px 10px 6px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #1d2840;
  font-size: 12px;
  color: #6b7790;
}

/* ---------- main ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.org {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.org .kind {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border-radius: 5px;
  padding: 2px 6px;
}
.topbar .spacer {
  flex: 1;
}
.who {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.who .email {
  color: var(--ink-soft);
}

/* notifications bell + badge */
.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  padding: 6px;
  margin-right: 4px;
}
.bell:hover { color: var(--ink); }
.bell .badge {
  position: absolute;
  top: -1px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-feature-settings: "tnum" 1;
}

/* notifications list */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.notif:last-child { border-bottom: none; }
.notif.unread { background: var(--accent-wash); }
.notif .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.notif-msg { color: var(--ink); flex: 1; }
.notif-msg:hover { text-decoration: none; color: var(--accent-ink); }
.notif-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notif.empty { color: var(--muted); justify-content: center; padding: 26px; }

.content {
  padding: 26px 28px 48px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-head .sub {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- stat cards ---------- */
.stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.stat .k {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat .v {
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin-top: 8px;
  font-feature-settings: "tnum" 1;
}
.stat .note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* dormant — data blocked on the MarketPay feed (the signature state) */
.stat.dormant {
  border-style: dashed;
  border-color: var(--line-strong);
  box-shadow: none;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 7px,
    rgba(14, 23, 38, 0.022) 7px 8px
  );
}
.stat.dormant .v {
  color: var(--line-strong);
}
.stat.dormant .k {
  color: #9aa4b2;
}
.stat.dormant .await {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
}
.stat.dormant .await::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- panels ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
/* breathing room when a full-width panel follows the contact/documents grid
   (e.g. the Shops section on the client detail page) */
.grid-2 + .panel {
  margin-top: 20px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.panel-head .count {
  font-size: 11px;
  color: var(--muted);
}
.panel-head .actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
td.num {
  text-align: right;
}

.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.ok { color: var(--accent-ink); background: var(--accent-wash); }
.pill.warn { color: var(--amber); background: var(--amber-wash); }
.pill.bad { color: var(--red); background: var(--red-wash); }
.pill.neutral { color: var(--ink-soft); background: #eef1f5; }

/* buttons */
.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn:hover { background: #f3f5f8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 5px 9px; }
.btn.ghost:hover { background: #eef1f5; color: var(--ink); }
.btn.link { border: none; background: none; padding: 0; color: var(--muted); }
.btn.link:hover { color: var(--ink); text-decoration: underline; }
.btn.link.danger { color: var(--red); }
.btn.link.danger:hover { color: var(--red); }
.del-form { display: inline; margin: 0; }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.btn.small { padding: 4px 9px; font-size: 12px; }

/* table pager (per-shop transactions) */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

/* clickable transaction rows + right-side detail drawer */
.txn-row { cursor: pointer; }
.txn-row:hover { background: #f5f8fa; }

#txn-panel {
  position: fixed;
  top: 58px; /* start below the sticky topbar */
  right: 0;
  height: calc(100vh - 58px);
  width: min(440px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line);
  box-shadow: -18px 0 44px -28px rgba(14, 23, 38, 0.4);
  z-index: 4; /* below the topbar (z-index 5) so the header stays on top */
  overflow-y: auto;
}
#txn-panel:empty { display: none; }
.drawer-card { padding: 18px 22px 44px; }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.drawer-kicker {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer-id { font-size: 13px; margin-top: 2px; word-break: break-all; }
.drawer-close {
  font: inherit;
  font-size: 22px;
  line-height: 1;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.drawer-close:hover { color: var(--ink); }

/* collapsible field groups (Acceptance / Transaction / Settlement / Merchant) */
.drawer-group { border-top: 1px solid var(--line); }
.drawer-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 8px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.drawer-group > summary::-webkit-details-marker { display: none; }
.drawer-group > summary::before {
  content: "›";
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.drawer-group[open] > summary::before { transform: rotate(90deg); }
.drawer-group .gcount {
  margin-left: auto;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
}
.drawer-group .kv { padding-bottom: 10px; }
.kv { margin: 0; }
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
}
.kv dt { margin: 0; color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; text-align: right; font-size: 13px; }
.drawer-note {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-wash);
  border: 1px solid #e6d4ad;
  color: #6b5526;
  font-size: 12.5px;
}
.drawer-raw { margin-top: 18px; }
.drawer-raw summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.drawer-raw pre {
  margin: 8px 0 0;
  background: var(--ink);
  color: #d7deea;
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------- login ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1100px 520px at 50% -10%, #eef6f3 0%, transparent 60%),
    var(--canvas);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.auth .brand {
  color: var(--ink);
  padding: 0 0 6px;
  font-size: 20px;
}
.auth h1 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  margin: 14px 0 2px;
}
.auth .lede {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfdfe;
  color: var(--ink);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.btn.block { width: 100%; justify-content: center; padding: 10px; }

.flash {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.flash.error { background: var(--red-wash); color: var(--red); border: 1px solid #f1cccc; }
.flash.ok { background: var(--accent-wash); color: var(--accent-ink); border: 1px solid #c3e6da; }

/* one-time secret reveal (a freshly minted API key) */
.flash.secret {
  background: var(--amber-wash);
  border: 1px solid #e6d4ad;
  color: var(--ink);
}
.flash.secret .secret-head {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 8px;
}
.flash.secret .copy-row { padding: 0; }
.flash.secret .copy-row input { background: #fff; color: var(--ink); }

.keys-panel { margin-top: 16px; }

/* ---------- breadcrumbs ---------- */
.crumbs {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 7px; color: var(--line-strong); }

/* ---------- client meta row ---------- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin: 2px 0 22px;
  padding: 15px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.meta .k {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta .mv {
  margin-top: 3px;
  font-size: 14px;
}

/* ---------- inline create form (details popover) ---------- */
.page-head .head-actions { margin-left: auto; }

.disclosure {
  position: relative;
  display: inline-block;
}
.disclosure > summary {
  list-style: none;
  cursor: pointer;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure.right { margin-left: auto; }

.card-form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 32px);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px -12px rgba(14, 23, 38, 0.32);
  padding: 16px;
}
.card-form .field:last-of-type { margin-bottom: 16px; }
.field .opt {
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- filter toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-bottom: 16px;
}
.filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.flabel {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}
.chip {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 11px;
}
.chip:hover { background: #f3f5f8; text-decoration: none; }
.chip.on {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

/* sub-tabs (e.g. Accepted / Acquired on transactions) */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }

.note-line {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.muted { color: var(--muted); }

/* search box + sortable column headers (clients list) */
.search { margin: 0; }
.search-input {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  min-width: 250px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
thead th a.sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
thead th a.sort:hover,
thead th a.sort.on { color: var(--ink); }
.caret { font-size: 9px; }

/* two-field row + inline status select (client contact / documents) */
.form-row.two { display: flex; gap: 10px; }
.form-row.two .field { flex: 1; }
.inline-status { margin: 0; }
select.mini,
input.mini {
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

/* in-store terminal charging (HTMX) */
.htmx-indicator { display: none; }
.htmx-indicator.htmx-request { display: inline; }
.charge-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.charge-form .amt { width: 78px; text-align: right; }
.ccy-pre {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td.tres { padding: 0 16px 8px; }
td.tres:empty { padding: 0; border: 0; }

/* form controls beyond the login card */
.field select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfdfe;
  color: var(--ink);
}
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.check input { width: auto; }

/* column chooser (transactions table) */
.col-search {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfdfe;
  color: var(--ink);
}
.col-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.col-hint { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.col-hint .grip { font-size: 11px; }
.col-choices { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: grab;
  user-select: none;
}
.col-item:hover { background: #f3f5f8; }
.col-item.dragging { opacity: 0.55; background: var(--accent-wash); }
.col-item .drag-handle { color: var(--line-strong); font-size: 12px; }
.col-item:hover .drag-handle { color: var(--muted); }
.col-item input { width: auto; }
.col-item .col-label { flex: 1; cursor: pointer; }

/* a slightly wider popover for the column chooser */
.card-form.wide { width: 340px; }

/* kebab (⋮) icon button + the table's columns menu */
.btn.icon {
  padding: 4px 9px;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--muted);
}
.btn.icon:hover { color: var(--ink); }
.table-menu { margin-left: auto; }

/* unified transactions filter bar (search + client + shop + status + channel + dates) */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin: 0;
}
.filterbar .search-input { min-width: 200px; flex: 1 1 200px; }
.filterbar select,
.filterbar input[type="date"] {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.filterbar select { max-width: 190px; }
.filterbar select:focus,
.filterbar input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.filterbar .dash { color: var(--muted); }

/* inline warning banner inside a panel */
.banner {
  margin: 12px 16px 4px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--amber);
  background: var(--amber-wash);
  border: 1px solid #e6d4ad;
}

/* a second heading inside one panel (e.g. Terminals under Provider accounts) */
.panel-head.sub-head { border-top: 1px solid var(--line); }

/* ---------- payment-link detail ---------- */
.pay-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}
.ledger { margin: 0; }
.ledger > div {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.ledger > div:last-child { border-bottom: none; }
.ledger dt {
  width: 120px;
  flex-shrink: 0;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1px;
}
.ledger dd { margin: 0; }
.ledger .full { flex-direction: column; gap: 8px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.items li:last-child { border-bottom: none; }

.pay-share { text-align: center; }
.qr {
  display: flex;
  justify-content: center;
  padding: 20px 16px 12px;
}
.qr svg { width: 196px; height: 196px; }
.copy-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
.copy-row input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfdfe;
  color: var(--ink-soft);
}
.pay-share .btn.block {
  width: calc(100% - 32px);
  margin: 2px 16px 0;
}
.pay-share .note-line { padding: 0 16px; margin-top: 12px; }

/* focus visibility everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- developer docs ---------- */
.devdoc { max-width: 880px; }
.devbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 58px;
  z-index: 4;
  background: var(--canvas);
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}
.devbar .base { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 280px; }
.devbar .base .flabel { white-space: nowrap; }
.devbar .base input {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
}
.lang-tabs {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-tabs button {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 13px;
  border: none;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.lang-tabs button + button { border-left: 1px solid var(--line-strong); }
.lang-tabs button:hover { background: #f3f5f8; }
.lang-tabs button.on { background: var(--ink); color: #fff; }

.dev-section { margin: 26px 0; }
.dev-section h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.dev-section > p { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; }
.dev-section p code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #eef1f5;
  padding: 1px 5px;
  border-radius: 4px;
}

.endpoint { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.method {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.03em;
}
.method.get { background: var(--accent-wash); color: var(--accent-ink); }
.method.post { background: #e7eefb; color: #2a52b5; }
.epath { font-size: 13px; color: var(--ink-soft); }

.code { position: relative; margin: 0 0 8px; }
.code pre {
  margin: 0;
  background: var(--ink);
  color: #d7deea;
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
}
.code pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font: inherit;
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid #2a3650;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #aeb8c8;
  cursor: pointer;
}
.copy-code:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.devdoc .lang { display: none; }
.devdoc[data-lang="curl"] .lang-curl,
.devdoc[data-lang="python"] .lang-python,
.devdoc[data-lang="node"] .lang-node,
.devdoc[data-lang="html"] .lang-html { display: block; }

.devnote {
  display: none;
  background: #fbf3e4;
  border: 1px solid #ecd9b0;
  border-left: 3px solid #b8863b;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #6b5526;
  margin-bottom: 22px;
}
.devnote code { font-family: var(--mono); font-size: 12.5px; }
.devdoc[data-lang="html"] .devnote { display: block; }

.form-errors {
  background: #f6e7e5; border: 1px solid #ecc9c5; border-left: 3px solid #b23a3a;
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px;
  font-size: 13.5px; color: #8a2a2a;
}
.form-errors ul { margin: 6px 0 0; padding-left: 20px; }

.confirm-editor { display: flex; flex-direction: column; gap: 14px; }
.confirm-editor label {
  display: flex; flex-direction: column; gap: 6px;
  font-weight: 600; font-size: 13px; color: var(--muted);
}
.confirm-editor textarea {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); resize: vertical;
}

/* ---------- desktop responsiveness ----------
   Fluid from wide screens down to ~1024px laptops: reflow the multi-column
   grids so nothing gets crushed. Below ~860px the mobile fallback takes over. */
@media (max-width: 1180px) {
  .grid-2,
  .pay-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .stats { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .meta-row { gap: 20px 28px; }
}
/* On very wide screens, give the full-bleed content a little more breathing room. */
@media (min-width: 1700px) {
  .content { padding-left: 40px; padding-right: 40px; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .nav-label, .sidebar-foot { display: none; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .pay-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
