/* ==========================================================================
   Paybito reCAPTCHA — UI tokens
   Black + electric-blue, security-grade fintech aesthetic.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-0:        #05060A;
  --bg-1:        #0A0C12;
  --bg-2:        #10131C;
  --bg-3:        #161A26;
  --bg-grid:     rgba(61, 123, 255, 0.06);

  /* Borders */
  --border-1:    rgba(255, 255, 255, 0.06);
  --border-2:    rgba(255, 255, 255, 0.12);
  --border-blue: rgba(61, 123, 255, 0.35);

  /* Text */
  --text-1:      #E6EAF2;
  --text-2:      #9BA3B4;
  --text-3:      #5C6478;
  --text-mute:   #3A4055;

  /* Brand */
  --blue:        #3D7BFF;
  --blue-hi:     #5C92FF;
  --blue-lo:     #2657D9;
  --cyan:        #5AC8FA;
  --cyan-soft:   rgba(90, 200, 250, 0.15);
  --blue-soft:   rgba(61, 123, 255, 0.12);
  --blue-glow:   rgba(61, 123, 255, 0.45);

  /* Status */
  --ok:          #34D399;
  --ok-soft:     rgba(52, 211, 153, 0.12);
  --warn:        #F5C451;
  --warn-soft:   rgba(245, 196, 81, 0.12);
  --danger:      #FF5C5C;
  --danger-soft: rgba(255, 92, 92, 0.12);

  /* Type */
  --font-sans:   'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:   ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;

  --shadow-1:    0 1px 0 rgba(255,255,255,0.04) inset, 0 6px 24px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 0 1px rgba(61,123,255,0.25), 0 12px 48px rgba(61,123,255,0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-1);
  background: #04050A;
}

/* Dark-themed scrollbars across the whole app. The browser-default light
   scrollbar looks jarring on our near-black surfaces; this keeps every
   scrollable region (event stream, table overflow-x, modal bodies, audit
   metadata) feeling part of the page. */
* {
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.10) transparent;
}
*::-webkit-scrollbar         { width: 8px; height: 8px; }
*::-webkit-scrollbar-track   { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
*::-webkit-scrollbar-thumb:hover  { background: rgba(61, 123, 255, 0.30); }
*::-webkit-scrollbar-thumb:active { background: rgba(61, 123, 255, 0.45); }
*::-webkit-scrollbar-corner       { background: transparent; }

a       { color: var(--blue-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.muted   { color: var(--text-2); }
.small   { font-size: 12px; }
.danger  { color: var(--danger); }
.optional { color: var(--text-3); font-weight: 400; font-size: 11px; }

.hstack  { display: flex; align-items: center; gap: 10px; }
.vstack  { display: flex; flex-direction: column; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow    { flex: 1; }
.divider { height: 1px; background: var(--border-1); margin: 14px 0; }

/* ====================== Frame chrome ====================== */
.frame {
  width: 100%; min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(61,123,255,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(90,200,250,0.06), transparent 60%),
    linear-gradient(180deg, #06070C 0%, #04050A 100%);
  color: var(--text-1);
  position: relative;
}
.frame::before {
  content: ""; position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.frame > * { position: relative; z-index: 1; }

/* ====================== Brand ====================== */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em;
}
/* Logo image used in topbar / login / docs sidebar — the PNG is supplied
   pre-rendered (transparent background) at /logo.png by the server. */
.brand-logo {
  width: 28px; height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(61,123,255,0.35));
}
/* Legacy CSS-drawn mark — kept as a fallback if any template still uses it. */
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #3D7BFF 0%, #1E3FAA 100%);
  position: relative;
  box-shadow: 0 0 0 1px rgba(61,123,255,0.35), 0 6px 18px rgba(61,123,255,0.35);
  display: grid; place-items: center; flex-shrink: 0;
}
.brand-mark::after {
  content: ""; width: 10px; height: 10px;
  border: 1.5px solid #fff; border-radius: 3px;
  border-bottom-color: transparent; border-right-color: transparent;
  transform: rotate(-45deg);
}
.brand-name { font-size: 15px; }
.brand-name b { font-weight: 700; }
.brand-name .accent { color: var(--blue); margin-left: 2px; }
.brand-name .slash { color: var(--text-3); margin: 0 6px; }
.brand-name .sub { color: var(--text-2); font-weight: 500; }

/* ====================== Topbar ====================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-1);
  background: rgba(8,10,16,0.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.topbar nav { display: flex; gap: 4px; }
.nav-btn {
  background: transparent; color: var(--text-2); border: 0;
  padding: 7px 14px; cursor: pointer; border-radius: 8px;
  font: inherit; font-size: 13px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-btn:hover { color: var(--text-1); background: rgba(255,255,255,0.03); text-decoration: none; }
.nav-btn.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(61,123,255,0.18), rgba(61,123,255,0.06));
  box-shadow: 0 0 0 1px rgba(61,123,255,0.35), 0 6px 18px rgba(61,123,255,0.10);
}
.who { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 13px; }
.who .role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue-hi);
  border: 1px solid var(--border-blue);
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase;
}
.who .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2657D9, #5AC8FA);
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08); flex-shrink: 0;
}

/* ====================== Page header / kicker ====================== */
.kicker {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue-hi); font-weight: 600;
}
main h1 { font-size: 26px; margin: 6px 0 0; letter-spacing: -0.02em; font-weight: 600; }
main p.lede { color: var(--text-2); margin: 6px 0 0; font-size: 13px; }

/* Each top-level <section data-view> is layout-styled here instead of inline,
   so the [hidden] attribute (which the user-agent stylesheet renders as
   display:none) wins. With inline display:flex it would always be visible. */
main section[data-view]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}
[hidden] { display: none !important; }

/* ====================== Cards ====================== */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)), var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.card.flush { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Tables inside .card.flush get a sensible min-width so columns don't get
   crushed on narrow viewports. The parent's overflow-x:auto then exposes a
   horizontal scrollbar — the rightmost columns (status badge, action
   buttons) stay reachable instead of being clipped off the screen. */
.card.flush > .tbl { min-width: 760px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.card-head h2 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 8px;
}
.card-head h2 .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 8px var(--blue);
}
.card-head .desc { color: var(--text-2); font-size: 13px; margin-top: 6px; }

/* ====================== Buttons ====================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  background: transparent; color: var(--text-1);
  transition: all 120ms ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #4A86FF 0%, #2A5FE0 100%);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 0 1px rgba(61,123,255,0.5),
    0 8px 24px rgba(61,123,255,0.35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--border-2); color: var(--text-1);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.18); }
.btn-link {
  background: transparent; color: var(--text-2); padding: 8px 10px;
}
.btn-link:hover { color: var(--text-1); text-decoration: underline; }
.btn-danger {
  border-color: rgba(255,92,92,0.35); color: #FFB5B5;
  background: rgba(255,92,92,0.06);
}
.btn-danger:hover { background: rgba(255,92,92,0.18); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* Login: business-owner (SSO) vs business-employee (password) chooser */
.login-choice { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.auth-choice {
  width: 100%; justify-content: flex-start; align-items: center; gap: 12px;
  padding: 14px 16px; text-align: left; white-space: normal; text-decoration: none;
}
.auth-choice svg { flex: none; }
.auth-choice-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.auth-choice-main { font-weight: 600; font-size: 14px; }
.auth-choice-sub  { font-size: 12px; opacity: 0.8; font-weight: 400; }
.auth-choice.is-disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }
.btn-primary.auth-choice .auth-choice-sub { color: rgba(255,255,255,0.88); opacity: 1; }

/* ====================== Inputs ====================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-lbl, .lbl {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 12px; font-weight: 500;
  letter-spacing: 0.01em;
}
.field-lbl .opt, .lbl .opt { color: var(--text-3); font-weight: 400; font-size: 11px; }

.input, .select {
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit; font-size: 13px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
  width: 100%;
}
.input:hover, .select:hover { border-color: var(--border-2); }
.input:focus, .select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(61,123,255,0.18);
  background: var(--bg-2);
}
.input::placeholder { color: var(--text-mute); }
.input.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }

/* ====================== Tooltips on form labels ====================== */
.info {
  position: relative;
  display: inline-grid; place-items: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-3); color: var(--text-2);
  font: italic 600 10px/1 'Times New Roman', serif;
  cursor: help; user-select: none;
}
.info:hover, .info:focus { background: var(--blue); color: #fff; outline: none; }
.info .tooltip {
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  background: #0a1020; border: 1px solid var(--border-2);
  color: var(--text-1);
  padding: 10px 12px; border-radius: 8px;
  font: 400 12px/1.5 var(--font-sans);
  font-style: normal; text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; pointer-events: none;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: opacity 120ms, transform 120ms, visibility 0s 120ms;
}
.info .tooltip code {
  background: var(--bg-2); padding: 1px 5px; border-radius: 3px; font-size: 11px;
}
.info:hover .tooltip, .info:focus .tooltip {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 120ms, transform 120ms, visibility 0s 0s;
}
.info .tooltip::after {
  content: ''; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-2);
}

/* ====================== Tables ====================== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
}
.tbl thead th {
  color: var(--text-3); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(255,255,255,0.015);
}
.tbl tbody tr { transition: background 120ms; }
.tbl tbody tr:hover { background: rgba(61,123,255,0.04); }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* ====================== Status badges ====================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.badge.ok      { background: var(--ok-soft);     color: var(--ok); }
.badge.warn    { background: var(--warn-soft);   color: var(--warn); }
.badge.danger  { background: var(--danger-soft); color: var(--danger); }
.badge.blue    { background: var(--blue-soft);   color: var(--blue-hi); }
.badge.muted   { background: rgba(255,255,255,0.04); color: var(--text-2); }
.badge.muted::before { background: var(--text-3); box-shadow: none; }

/* Aliases for active/suspended status names so legacy markup still works */
.badge.active    { background: var(--ok-soft); color: var(--ok); }
.badge.suspended { background: var(--danger-soft); color: var(--danger); }

/* Rule-type badges (abuse rules) */
.rule-type {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px;
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border-1);
}
.rule-type.block    { background: rgba(255,92,92,0.08);  color: #FF8A8A;    border-color: rgba(255,92,92,0.25); }
.rule-type.throttle { background: rgba(245,196,81,0.08); color: #F5C451;    border-color: rgba(245,196,81,0.25); }
.rule-type.hard     { background: rgba(61,123,255,0.08); color: var(--blue-hi); border-color: rgba(61,123,255,0.25); }
.rule-type.disable  { background: rgba(255,255,255,0.04); color: var(--text-2); }

/* mono code pill */
code, .code-pill {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  padding: 2px 8px; border-radius: 5px; color: var(--text-1);
}

/* ====================== Stat tiles ====================== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.stat-tile {
  position: relative;
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(61,123,255,0.05), rgba(61,123,255,0)),
    var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-tile::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--blue), transparent);
  opacity: 0.7;
}
.stat-tile .label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.stat-tile .label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 6px var(--blue);
}
.stat-tile .v { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 4px; }
.stat-tile .delta { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.stat-tile .delta.up   { color: var(--ok); }
.stat-tile .delta.down { color: var(--danger); }
.stat-tile .spark {
  position: absolute; right: 14px; top: 14px; width: 60px; height: 22px;
  opacity: 0.85;
}

/* ====================== Configuration tiles (Overview quick access) ===== */
/* Used by the Overview view to surface admin-area links (Abuse rules,
   Usage, IP allowlist, Integrations) as clickable tiles. Lets us keep the
   topbar nav lean while still exposing every section one click away. */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.config-tile {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)),
    var(--bg-1);
  border: 1px solid var(--border-1);
  color: var(--text-1); text-decoration: none;
  transition: border-color 120ms, background 120ms, transform 120ms;
}
.config-tile:hover {
  text-decoration: none;
  border-color: var(--border-blue);
  background:
    linear-gradient(180deg, rgba(61,123,255,0.06), rgba(61,123,255,0)),
    var(--bg-1);
  transform: translateY(-1px);
}
.config-tile .config-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--blue-soft); color: var(--blue-hi);
  border: 1px solid var(--border-blue);
}
.config-tile .config-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.config-tile .config-title { font-size: 13.5px; font-weight: 500; color: var(--text-1); }
.config-tile .config-desc  { font-size: 12px; color: var(--text-3); line-height: 1.4; }

/* ====================== Modal ====================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  animation: fade-in 120ms ease-out;
}
.modal[hidden] { display: none; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(2,4,8,0.65); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  overflow-y: auto;
  padding: 24px 16px;
}
.modal-box {
  position: relative;
  background:
    radial-gradient(600px 300px at 100% -10%, rgba(61,123,255,0.12), transparent 60%),
    var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  width: min(560px, 92vw);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(61,123,255,0.12);
  overflow: visible;
}
.modal-box.wide { width: min(640px, 92vw); }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid var(--border-1);
}
.modal-head h2 {
  margin: 0; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.modal-head .x {
  background: transparent; border: 0; color: var(--text-2);
  font-size: 18px; cursor: pointer; line-height: 1; padding: 6px 8px; border-radius: 6px;
}
.modal-head .x:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--border-1);
  background: rgba(0,0,0,0.2);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Cred reveal (one-time secret display) */
.cred { display: flex; flex-direction: column; gap: 8px; }
.cred-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  font-family: var(--font-mono); font-size: 12px;
}
.cred-row .key { color: var(--text-3); flex-shrink: 0; min-width: 88px; font-weight: 500; }
.cred-row .val { color: var(--text-1); flex: 1; word-break: break-all; }
.cred-row .copy {
  background: rgba(61,123,255,0.12); color: var(--blue-hi);
  border: 1px solid var(--border-blue);
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.cred-row .copy:hover { background: rgba(61,123,255,0.22); }

.warn-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(245,196,81,0.06); border: 1px solid rgba(245,196,81,0.25);
  color: #F5C451; padding: 12px 14px; border-radius: 8px; font-size: 12.5px;
  line-height: 1.5;
}

/* Rate-limit overrides fieldset */
.rate-limits {
  border: 1px solid var(--border-1); border-radius: 10px;
  padding: 12px 14px 14px; margin: 0;
}
.rate-limits legend { padding: 0 8px; color: var(--text-2); font-size: 12px; }
.rate-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}

/* Permission picker (Team add/edit employee modals) — one row per resource
   with a level <select> on the right. */
.perm-grid { display: flex; flex-direction: column; gap: 10px; }
.perm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--text-1);
}
.perm-row .select { width: 160px; }

/* Dynamic origins table (manage modal) — read-only listing of API-registered
   origins separate from the static `allowedOrigins` CSV input above it. */
.dynamic-origins-pane {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--bg-2);
}
.dynamic-origins-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dynamic-origins-table th,
.dynamic-origins-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dynamic-origins-table th {
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dynamic-origins-table tr:last-child td { border-bottom: 0; }
.dynamic-origins-table tr.muted td { opacity: 0.55; }
.dynamic-origins-table .btn-sm { padding: 3px 10px; font-size: 12px; }

/* Danger zone (manage modal) */
.danger-zone {
  margin: 0 22px 22px;
  border: 1px solid rgba(255,92,92,0.25); border-radius: 10px; overflow: hidden;
}
.danger-zone h3 {
  margin: 0; padding: 10px 14px; border-bottom: 1px solid rgba(255,92,92,0.25);
  background: rgba(255,92,92,0.05); color: #FFB5B5;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.danger-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 14px;
  border-top: 1px solid rgba(255,92,92,0.15);
}
.danger-row:first-of-type { border-top: 0; }
.danger-row p { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }
.danger-row strong { font-size: 13px; font-weight: 500; color: var(--text-1); }

/* ====================== Login ====================== */
.login-shell {
  width: 100%; min-height: 100vh;
  display: grid; place-items: center;
  position: relative; padding: 32px;
}
.login-card {
  width: 420px; padding: 32px 36px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)), var(--bg-1);
  border: 1px solid var(--border-1);
  box-shadow:
    0 0 0 1px rgba(61,123,255,0.12),
    0 30px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(61,123,255,0.08);
  position: relative; z-index: 2;
}
.login-card .brand { margin-bottom: 22px; }
.login-card h1 { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -0.02em; }
.login-card .sub { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.login-card form {
  display: flex; flex-direction: column; gap: 14px; margin-top: 24px;
}
.login-card .foot-note {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-1);
  color: var(--text-3); font-size: 11.5px; line-height: 1.55;
  display: flex; gap: 10px; align-items: flex-start;
}
.login-card .foot-note .ico { color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.login-card .foot-note b { color: var(--text-2); }

.flash {
  background: rgba(255,92,92,0.08); border: 1px solid rgba(255,92,92,0.3);
  color: #FFB5B5; padding: 10px 12px; border-radius: 8px; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
}
.flash[hidden] { display: none; }

.shield-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: radial-gradient(700px 700px at 50% 50%, rgba(61,123,255,0.18), transparent 60%);
}

/* Login-page "Protected by Paybito reCAPTCHA" badge — appears below the
   form when DASHBOARD_LOGIN_SITEKEY is configured. Subtle border, brand-
   blue shield icon. The captcha itself opens in a modal at Sign-in click
   (handled by paybitoCaptcha.verify in /v1/api.js). */
.captcha-note {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 0;
  padding: 10px 12px;
  background: rgba(61, 123, 255, 0.08);
  border: 1px solid var(--border-blue);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12px; line-height: 1.4;
}
.captcha-note svg {
  flex-shrink: 0; color: var(--blue);
}
.captcha-note b { color: var(--text-1); font-weight: 600; }
.shield-bg .ring {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border: 1px solid rgba(61,123,255,0.25); border-radius: 50%;
}

/* ====================== End-user captcha widget ====================== */
.captcha-widget {
  position: relative;
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #0E1320 0%, #06080F 100%);
  border: 1px solid rgba(61,123,255,0.22);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 18px 48px rgba(0,0,0,0.45),
    0 0 60px rgba(61,123,255,0.12);
  width: 292px; max-width: 100%;
  font-family: var(--font-sans);
  color: var(--text-1);
}
.captcha-puzzle {
  position: relative; height: 160px;
  background-color: #0a0d14;
  background-image:
    linear-gradient(135deg, rgba(61,123,255,0.18) 0%, rgba(90,200,250,0.06) 50%, rgba(61,123,255,0.10) 100%),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.025) 0,
      rgba(255,255,255,0.025) 2px,
      transparent 2px,
      transparent 8px
    );
  overflow: hidden;
}
.captcha-puzzle::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(400px 200px at 30% 30%, rgba(90,200,250,0.18), transparent 60%),
    radial-gradient(300px 180px at 80% 70%, rgba(61,123,255,0.18), transparent 60%);
}
.captcha-puzzle::after {
  content: ""; position: absolute; left: 0; right: 0; top: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90,200,250,0.6), transparent);
  box-shadow: 0 0 8px rgba(90,200,250,0.5);
  animation: scan 3s linear infinite;
}
@keyframes scan {
  0%   { top: 0%; }
  50%  { top: 100%; }
  100% { top: 0%; }
}
.captcha-puzzle img.base {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.9; pointer-events: none;
}
.puzzle-hole {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.55);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.06), inset 0 4px 8px rgba(0,0,0,0.6);
}
.puzzle-hole::before, .puzzle-hole::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  background: rgba(0,0,0,0.55); border-radius: 50%;
}
.puzzle-hole::before { top: -7px; left: 50%; margin-left: -7px; }
.puzzle-hole::after  { right: -7px; top: 50%; margin-top: -7px; }

.puzzle-piece {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #5AC8FA 0%, #3D7BFF 100%);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.3) inset,
    0 0 24px rgba(90,200,250,0.6),
    0 8px 18px rgba(0,0,0,0.4);
  pointer-events: none;
  transition: left 80ms linear;
}
.puzzle-piece::before, .puzzle-piece::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  background: linear-gradient(135deg, #5AC8FA, #3D7BFF); border-radius: 50%;
  box-shadow: 0 0 12px rgba(90,200,250,0.5);
}
.puzzle-piece::before { top: -7px; left: 50%; margin-left: -7px; }
.puzzle-piece::after  { right: -7px; top: 50%; margin-top: -7px; }

.captcha-slider {
  position: relative;
  height: 56px;
  background: linear-gradient(180deg, #0B0F18, #06080F);
  border-top: 1px solid rgba(61,123,255,0.18);
  display: flex; align-items: center; padding: 0 6px;
  user-select: none;
}
.slider-track {
  position: absolute; left: 6px; right: 6px; top: 50%; transform: translateY(-50%);
  height: 36px; background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px; letter-spacing: 0.04em;
  pointer-events: none;
}
.slider-fill {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  height: 36px;
  background: linear-gradient(90deg, rgba(61,123,255,0.28), rgba(90,200,250,0.1));
  border-radius: 18px;
  pointer-events: none;
  transition: width 60ms linear;
}
.slider-knob {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 44px;
  background: linear-gradient(180deg, #4A86FF, #2A5FE0);
  border-radius: 12px;
  display: grid; place-items: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.15) inset,
    0 8px 18px rgba(61,123,255,0.5),
    0 0 30px rgba(61,123,255,0.4);
  cursor: grab; z-index: 2;
  color: #fff;
  transition: box-shadow 120ms;
}
.slider-knob:active { cursor: grabbing; }
.slider-knob.success { background: linear-gradient(180deg, #34D399, #0E966D); box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 8px 18px rgba(52,211,153,0.5); }
.slider-knob.fail    { background: linear-gradient(180deg, #FF6B6B, #C03939); box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 8px 18px rgba(255,92,92,0.5); }

.captcha-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 12px; color: var(--text-2);
  border-top: 1px solid var(--border-1);
  background: rgba(0,0,0,0.25);
}
.captcha-status .l { display: inline-flex; align-items: center; gap: 8px; }
.captcha-status.ok .l  { color: var(--ok); }
.captcha-status.err .l { color: var(--danger); }
.captcha-status .brand-mini {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 11px;
}
.captcha-status .brand-mini .mark {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, #3D7BFF, #1E3FAA);
}

.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(61,123,255,0.25); border-top-color: var(--blue);
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====================== Docs ====================== */
.docs-shell {
  display: grid; grid-template-columns: 280px 1fr; min-height: 100vh;
}

/* ── Sidebar ── */
.docs-side {
  border-right: 1px solid var(--border-1);
  background: rgba(8,10,16,0.6);
  padding: 24px 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.docs-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; flex: 1; }
.docs-side .group-lbl {
  color: var(--text-3); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 14px 10px 6px;
}
.docs-side .group-lbl:first-child { padding-top: 0; }
.docs-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px;
  color: var(--text-2); font-size: 13px; text-decoration: none;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.docs-side a:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-1); text-decoration: none;
}
.docs-side a.active {
  background: var(--blue-soft); color: var(--blue-hi);
  border-color: var(--border-blue);
}
.docs-side a svg { color: inherit; flex-shrink: 0; }
.docs-side a .ext-glyph { color: var(--text-3); font-size: 11px; margin-left: 2px; }
.docs-side-foot {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 18px; padding: 14px 10px 4px;
  border-top: 1px solid var(--border-1);
  color: var(--text-3); font-size: 11.5px; line-height: 1.5;
}
.docs-side-foot svg { color: var(--blue); flex-shrink: 0; margin-top: 1px; }

/* ── Main column ── */
.docs-main { padding: 36px 48px; max-width: 920px; }
.docs-main h1 { font-size: 30px; margin: 6px 0 0; letter-spacing: -0.02em; }
.docs-main .sub { color: var(--text-2); margin: 8px 0 28px; font-size: 14px; line-height: 1.6; }

.docs-article h1 { font-size: 28px; margin: 0 0 14px; letter-spacing: -0.02em; }
.docs-article h2 {
  margin: 36px 0 12px; font-size: 19px; font-weight: 600;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-1);
}
.docs-article h3 { margin: 24px 0 10px; font-size: 15px; font-weight: 600; }
.docs-article h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-1); }
.docs-article p, .docs-article li {
  color: var(--text-2); line-height: 1.7; font-size: 14px;
}
.docs-article ul, .docs-article ol { padding-left: 22px; }
.docs-article li { margin: 4px 0; }
.docs-article a { color: var(--blue-hi); }
.docs-article hr {
  border: 0; border-top: 1px solid var(--border-1); margin: 30px 0;
}
.docs-article pre {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 10px; padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  color: var(--text-1); margin: 14px 0; overflow: auto;
}
.docs-article code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  padding: 1.5px 6px; border-radius: 4px;
}
.docs-article pre code { background: transparent; border: 0; padding: 0; font-size: inherit; }
.docs-article table {
  width: 100%; border-collapse: collapse; margin: 14px 0;
  font-size: 13px;
}
.docs-article th, .docs-article td {
  border-bottom: 1px solid var(--border-1); padding: 9px 12px; text-align: left;
  vertical-align: top;
}
.docs-article th {
  color: var(--text-3); font-weight: 500; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(255,255,255,0.015);
}
.docs-article tbody tr:hover { background: rgba(61,123,255,0.03); }
.docs-article tbody tr:last-child td { border-bottom: 0; }
.docs-article blockquote {
  border-left: 3px solid var(--blue); padding: 6px 14px;
  color: var(--text-2); margin: 16px 0;
  background: rgba(61,123,255,0.04); border-radius: 0 8px 8px 0;
}
.docs-article blockquote p { margin: 4px 0; }
.docs-article strong { color: var(--text-1); font-weight: 600; }

/* ── Inline action buttons inside docs articles ── */
/* Used by the {{DOWNLOAD_AGENT}} placeholder substitution. Looks like a
   primary button, sized to fit naturally inside running prose. */
.docs-article .doc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  margin: 4px 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, #4A86FF 0%, #2A5FE0 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 0 1px rgba(61,123,255,0.5),
    0 8px 24px rgba(61,123,255,0.35);
  transition: filter 120ms, transform 120ms;
}
.docs-article .doc-action-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ── Landing page (intro) — clickable cards for each doc ── */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 22px 0 8px;
}
.docs-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 16px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)),
    var(--bg-1);
  border: 1px solid var(--border-1);
  color: var(--text-1); text-decoration: none;
  transition: border-color 120ms, transform 120ms, background 120ms;
}
.docs-card:hover {
  text-decoration: none;
  border-color: var(--border-blue);
  background:
    linear-gradient(180deg, rgba(61,123,255,0.06), rgba(61,123,255,0)),
    var(--bg-1);
  transform: translateY(-1px);
}
.docs-card-head {
  display: flex; align-items: center; justify-content: space-between;
}
.docs-card-kicker {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue-hi); font-weight: 600;
}
.docs-card-ext {
  color: var(--text-3); font-size: 14px; line-height: 1;
}
.docs-card-title {
  font-size: 15px; font-weight: 600; color: var(--text-1); letter-spacing: -0.005em;
  margin-top: 4px;
}
.docs-card-desc {
  color: var(--text-3); font-size: 12.5px; line-height: 1.55;
  margin-top: 4px;
}

/* ====================== Search input with leading icon ====================== */
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 32px; }
.search-wrap .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
