:root {
  color-scheme: light;
  --canvas: #f5f6f7;
  --surface: #fff;
  --ink: #172127;
  --secondary: #4f5d66;
  --muted: #5e6b74;
  --line: #dce2e6;
  --accent: #176656;
  --accent-hover: #124e43;
  --side: #20282e;
  --side-active: #303c43;
  --side-muted: #bcc8cc;
  --danger: #9a302c;
  --radius: 8px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
p { line-height: 1.55; }
:focus-visible { outline: 2px solid #368775; outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 12px; background: white; border-radius: var(--radius); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.side { position: fixed; inset: 0 auto 0 0; width: 228px; display: flex; flex-direction: column; background: var(--side); color: white; }
.brand { display: flex; gap: 12px; align-items: center; margin: 20px 16px 24px; padding: 4px; color: white; font-weight: 650; font-size: 17px; line-height: 1.25; }
.brand:hover, .nav a:hover { text-decoration: none; }
.brand-symbol { width: 40px; height: 40px; border-radius: 8px; background: #303a40; display: grid; place-items: center; flex: none; }
.brand small, .signed-in small { color: var(--side-muted); display: block; margin-top: 4px; font-size: 12px; font-weight: 400; }
.nav { display: grid; gap: 4px; padding: 0 16px; }
.nav a { --icon-bg: var(--side); display: flex; gap: 12px; align-items: center; min-height: 40px; padding: 0 12px; color: var(--side-muted); border-radius: var(--radius); font-weight: 550; }
.nav a:hover, .nav a[aria-current] { --icon-bg: var(--side-active); background: var(--side-active); color: white; }
.nav a[aria-current] { box-shadow: inset 3px 0 #74bfab; }
.side-footer { margin-top: auto; padding: 16px; border-top: 1px solid #3a454b; }
.signed-in { display: flex; align-items: center; gap: 8px; min-width: 0; }
.signed-in > span:last-child { min-width: 0; font-size: 12px; }
.operator-email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #597068; border-radius: 50%; background: #303f3e; color: #c4e8de; font-weight: 600; }
.signout { background: none; border: 0; color: var(--side-muted); padding: 8px 0 0; text-align: start; margin: 4px 0 0 40px; }
.signout:hover { color: white; }
.workspace { margin-left: 228px; }
.topbar { min-height: 60px; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--secondary); font-size: 13px; }
.topbar a { color: var(--secondary); }
.private { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.private .icon { width: 16px; height: 16px; }
.slash { padding: 0 4px; color: var(--muted); }
main { max-width: 1500px; margin: auto; padding: 32px; }
.page-head, .panel-head, .split { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 16px; }
.page-head { margin-bottom: 24px; }
h1, h2 { margin: 0; line-height: 1.2; font-weight: 620; overflow-wrap: anywhere; }
h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.025em; }
h2 { font-size: 17px; }
.page-head p, .panel-head p, .panel-pad > p, .split p { color: var(--secondary); margin: 8px 0 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; white-space: nowrap; }
.button:hover { text-decoration: none; background: #f1f4f5; }
.button.primary { border-color: var(--accent); background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-hover); }
.button.danger { background: var(--danger); color: white; border-color: var(--danger); }
.button.danger:hover { background: #782622; }
.button.compact { min-height: 32px; font-size: 12px; padding: 0 8px; }
.button.compact .icon { width: 14px; height: 14px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr)); gap: 12px; margin: 0 0 24px; }
.metrics article, .panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.metrics article { padding: 16px; }
.metrics span, .metrics small { display: block; color: var(--secondary); }
.metrics strong { display: block; font-size: 25px; font-weight: 620; margin: 8px 0 0; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metrics small { margin-top: 4px; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head span, .result-count, .muted, .help { color: var(--muted); font-size: 13px; }
.panel-pad { padding: 20px; }
.panel-pad > h2 + form { margin-top: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section { margin-top: 16px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px; }
input:not([type=checkbox]), select, textarea { min-height: 36px; border: 1px solid #cbd4d9; border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 8px; min-width: 0; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.search { display: flex; align-items: center; gap: 8px; min-width: min(100%, 240px); border: 1px solid #cbd4d9; border-radius: var(--radius); padding-left: 8px; color: var(--muted); }
.search input { border: 0; width: 100%; }
.search:focus-within { outline: 2px solid #368775; outline-offset: 2px; }
.search input:focus-visible { outline: 0; }
.result-count { margin-left: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 620; background: #eef1f3; color: var(--secondary); white-space: nowrap; }
td { border-bottom: 1px solid #e6ebee; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td:not(.empty) { background: #f7f9f9; }
td small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.record { color: var(--ink); font-weight: 620; overflow-wrap: anywhere; }
.record-value { font-weight: 600; }
.row-action { text-align: right; }
.row-controls { display: flex; justify-content: flex-end; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 20px; color: #46545c; background: #edf0f2; font-size: 12px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { background: #e2f3eb; color: #1c604b; }
.status.draining, .status.needs-nodes { background: #faf0db; color: #774a0c; }
.status.expired, .status.suspended { background: #f9e8e5; color: #862e2a; }
.warning-text { color: #784e0b; }
progress { display: block; margin-top: 8px; width: min(100%, 112px); height: 6px; border: 0; border-radius: 8px; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #e7edef; border-radius: 8px; }
progress::-webkit-progress-value { background: #4b9b83; border-radius: 8px; }
progress::-moz-progress-bar { background: #4b9b83; border-radius: 8px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 8px; font-weight: 620; }
.compact-empty { padding: 20px 16px; }
.form-page { max-width: 740px; }
.back-link { display: inline-flex; color: var(--secondary); gap: 4px; align-items: center; margin-bottom: 16px; }
.form-stack { display: grid; gap: 16px; margin-top: 16px; }
.form-stack > .button { justify-self: start; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel-pad > .form-actions { margin-top: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field.checkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field [aria-invalid=true] { border-color: var(--danger); }
.help { line-height: 1.45; }
.help ul, .errorlist { margin: 0; padding-left: 16px; }
.errorlist { color: var(--danger); line-height: 1.45; }
.login-card { max-width: 420px; margin: clamp(16px, 6vh, 64px) auto 0; }
.login-card h1 { font-size: 26px; }
.login-card h1 + a { margin-top: 16px; }
.notice { margin: 0 0 16px; padding: 12px; background: #e6f4ef; color: #215442; border-radius: var(--radius); }
.notice.error { background: #fbeae7; color: var(--danger); }
.key-values { margin: 16px 0; }
.key-values > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e6ebee; }
.key-values dt { color: var(--muted); }
.key-values dd { margin: 0; font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 12px; }
.danger-link { color: var(--danger); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; color: var(--secondary); border-top: 1px solid var(--line); }
@media (max-width: 870px) {
  .side { width: 192px; }
  .workspace { margin-left: 192px; }
  main, .topbar { padding-inline: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .side { position: static; width: auto; }
  .workspace { margin: 0; }
  .brand { margin: 8px 12px; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 8px; }
  .nav a { gap: 4px; padding: 0 8px; min-height: 36px; font-size: 12px; }
  .side-footer { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
  .signout { margin: 0; padding: 4px; }
  .topbar { min-height: 44px; padding-inline: 12px; }
  main { padding: 20px 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics strong { font-size: 21px; }
  .result-count { margin-left: 0; }
}

.payment-settings,.payment-review{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px}
.payment-settings h2,.payment-review h2{margin:0 0 10px}
.payment-settings p,.payment-review p{margin:0 0 12px}
.payment-receipt{display:block;width:min(100%,540px);max-height:610px;object-fit:contain;object-position:top left;border-radius:10px}
.payment-reference{overflow-wrap:anywhere}
.payment-settings input[type=checkbox]{width:auto}
.payment-qr-list{margin:10px 0 16px}
.payment-qr-entry{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:9px 0;border-bottom:1px solid var(--line)}
.payment-qr-entry>div{flex:1 1 110px;min-width:0;overflow-wrap:anywhere}
.payment-qr-entry p{margin:3px 0 0;font-size:.82rem}
.pricing-form .field{max-width:330px}
.pricing-table input[type=number]{min-width:90px;width:min(100%,120px)}
.pricing-table input[type=checkbox]{width:auto}
.pricing-table output{font-weight:650;font-variant-numeric:tabular-nums}
.pricing-table th{white-space:nowrap}
