/* Query Desk control panel - the same quiet ledger look as Query Desk itself
   (IBM Plex Sans, one deep-teal action colour, tabular numerals), in the shell
   the POS saas-admin uses: a dark sidebar with icon navigation, a topbar, KPI
   cards, cards around every table and form. */

:root {
  --ink: #1d2427; --ink-soft: #5b676c; --rule: #d9dfe1; --bg: #f3f5f5; --surface: #fff;
  --action: #23615a; --action-ink: #fff; --action-soft: #e4efed;
  --ok: #1e5b3c; --ok-bg: #e3f1e8; --warn: #8a5a00; --warn-bg: #fbf1dc; --err: #9b2c2c; --err-bg: #f9e5e5;
  --info: #255a86; --info-bg: #e3edf6;
  --sidebar: #17302d; --sidebar-ink: #c9d8d5; --sidebar-active: rgba(255, 255, 255, 0.1); --sidebar-w: 232px;
  --radius: 6px; --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--action); }
h1, h2, h3 { margin: 0; font-weight: 600; }
code, pre { font-family: ui-monospace, Consolas, 'Cascadia Mono', monospace; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hint { color: var(--ink-soft); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell ------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: 0 0 auto; background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--action); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.brand-text { line-height: 1.2; } .brand-text small { display: block; font-size: 11px; color: var(--sidebar-ink); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; }
.nav { padding: 6px 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0; border-radius: var(--radius); color: var(--sidebar-ink); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--sidebar-active); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--action); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.sidebar-foot form { margin-left: auto; } .sidebar-foot button { background: none; border: 0; color: var(--sidebar-ink); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; padding: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.topbar .title { font-weight: 600; } .topbar .crumbs { color: var(--ink-soft); font-size: 13px; } .topbar .right { margin-left: auto; font-size: 13px; color: var(--ink-soft); }
.menu-btn { display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px 9px; font-size: 18px; line-height: 1; cursor: pointer; }
.content { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; } .page-head .sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Pieces ------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { background: #f7f9f9; }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); } .btn.primary:hover { background: #1c4f49; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--action); padding: 0; text-decoration: underline; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.6; white-space: nowrap; }
.badge.active, .badge.online, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.grace, .badge.offline, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.suspended, .badge.revoked, .badge.err { background: var(--err-bg); color: var(--err); }
.badge.pending, .badge.muted { background: #e9edee; color: var(--ink-soft); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--rule); vertical-align: 1px; }
.dot.online { background: var(--ok); } .dot.offline, .dot.revoked { background: var(--err); } .dot.pending { background: var(--warn); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--action); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi.warn { border-left-color: var(--warn); } .kpi.err { border-left-color: var(--err); } .kpi.ok { border-left-color: var(--ok); }
.kpi .label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi .value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.kpi .sub { font-size: 13px; color: var(--ink-soft); }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.card-head h2 { font-size: 16px; }
.card-body { padding: 16px; } .card-body p:first-child { margin-top: 0; } .card-body p:last-child { margin-bottom: 0; }
.card .empty { padding: 22px 16px; color: var(--ink-soft); text-align: center; margin: 0; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }

table.ledger { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; font-size: 14px; }
.ledger th { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; background: #fafbfb; }
.ledger tbody tr:last-child td { border-bottom: 0; } .ledger tbody tr:hover td { background: #fafbfb; }
.ledger .main-cell strong { display: block; } .ledger .main-cell small { color: var(--ink-soft); }
.ledger td.act { text-align: right; white-space: nowrap; }
.usage { display: inline-flex; flex-direction: column; gap: 3px; min-width: 70px; font-variant-numeric: tabular-nums; }
.usage .bar { height: 4px; border-radius: 2px; background: #e9edee; overflow: hidden; } .usage .bar i { display: block; height: 100%; background: var(--action); }
.usage.warn .bar i { background: var(--warn); } .usage.err .bar i { background: var(--err); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select { display: inline-block; width: auto; margin: 0; font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.toolbar input[type=search] { min-width: 280px; flex: 1 1 280px; }

form.stack label, .form-grid label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
label .hint { display: block; margin-top: 4px; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=url], input[type=date], select, textarea {
  display: block; width: 100%; min-height: 38px; padding: 8px 11px; font: inherit; font-size: 14px; font-weight: 400; color: var(--ink);
  border: 1px solid #c3ccce; border-radius: 8px; background: #fff; margin-top: 5px; transition: border-color 0.12s, box-shadow 0.12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-soft); }
input:disabled, select:disabled { background: #f3f5f5; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.check { display: inline-flex !important; align-items: center; gap: 6px; margin-right: 14px; } .check input { width: auto; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; } legend { font-weight: 600; font-size: 15px; padding: 0; margin: 10px 0 8px; }

.alert { padding: 11px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; background: var(--surface); }
.alert.ok { border-color: var(--ok); color: var(--ok); } .alert.err { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.alert.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); } .alert.info { border-color: var(--info); color: var(--info); background: var(--info-bg); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; } dl.facts dt { color: var(--ink-soft); } dl.facts dd { margin: 0; }
pre.log { background: #fafbfb; border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; white-space: pre-wrap; margin: 0 0 16px; }
.secret { font-size: 17px; font-weight: 600; user-select: all; font-family: ui-monospace, Consolas, 'Cascadia Mono', monospace; letter-spacing: 0.02em; }
dl.facts dd.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } dl.facts dt { align-self: center; }
.btn.copy { min-width: 64px; justify-content: center; } .btn.copy.copied { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.btn.primary.copy.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.copy-all { margin: 16px 0 4px; }

/* Guides */
.code-block { position: relative; margin: 10px 0 14px; }
.code-block pre { background: #17302d; color: #dbe9e6; border-radius: var(--radius); padding: 14px 16px; padding-right: 86px; margin: 0; overflow-x: auto; font-size: 13px; line-height: 1.55; white-space: pre; }
.code-block .btn.copy { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.92); }
.guide-h { font-size: 14px; margin: 18px 0 4px; }
ol.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; } ol.steps li { padding-left: 4px; line-height: 1.55; }
.danger-zone { border-color: var(--err); } .danger-zone .card-head { background: var(--err-bg); border-color: var(--err); color: var(--err); }

/* Confirmation modal (app.js) ---------------------------------------------- */
dialog.modal { border: 0; padding: 0; border-radius: 12px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 60px rgba(13, 30, 28, 0.28), 0 2px 8px rgba(13, 30, 28, 0.12); display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; padding: 24px;
  animation: modal-in 0.16s ease-out; }
dialog.modal::backdrop { background: rgba(14, 27, 25, 0.55); backdrop-filter: blur(2px); animation: fade-in 0.16s ease-out; }
dialog.modal.closing { animation: modal-out 0.12s ease-in forwards; } dialog.modal.closing::backdrop { animation: fade-out 0.12s ease-in forwards; }
.modal-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--action-soft); color: var(--action); }
.modal-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-danger .modal-icon { background: var(--err-bg); color: var(--err); } .modal-warn .modal-icon { background: var(--warn-bg); color: var(--warn); }
.modal-text h2 { font-size: 17px; margin: 8px 0 6px; } .modal-text p { margin: 0 0 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-actions .btn { min-width: 96px; justify-content: center; }
.btn:focus-visible { outline: 3px solid var(--action-soft); outline-offset: 1px; } .btn.danger:focus-visible { outline-color: var(--err-bg); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(4px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } } @keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.modal, dialog.modal::backdrop { animation: none !important; } }

/* Sign-in / setup: brand panel (the sidebar's colour) + the form ----------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; }
.auth-brand { background: var(--sidebar); color: var(--sidebar-ink); padding: 40px 48px; display: flex; flex-direction: column; gap: 40px;
  background-image: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.07), transparent 45%), radial-gradient(circle at 10% 90%, rgba(35, 97, 90, 0.55), transparent 50%); }
.auth-brand .brand { padding: 0; } .auth-brand .brand-mark { width: 40px; height: 40px; font-size: 16px; border-radius: 9px; } .auth-brand .brand-text { font-size: 18px; }
.auth-pitch { margin-top: auto; } .auth-pitch h2 { color: #fff; font-size: 28px; line-height: 1.25; margin-bottom: 18px; max-width: 14em; }
.auth-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.auth-pitch li { padding-left: 26px; position: relative; } .auth-pitch li::before { content: ''; position: absolute; left: 0; top: 7px; width: 14px; height: 8px; border-left: 2px solid #7fc4b8; border-bottom: 2px solid #7fc4b8; transform: rotate(-45deg); }
.auth-foot { margin: auto 0 0; font-size: 12px; opacity: 0.7; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(23, 48, 45, 0.08); border-radius: 10px; margin: 0; }
.auth-card .card-body { padding: 32px; } .auth-card h1 { font-size: 24px; margin-bottom: 6px; } .auth-card h1 + .hint { margin: 0 0 22px; font-size: 14px; }
.auth-card input[type=text], .auth-card input[type=password] { padding: 11px 12px; font-size: 15px; }
.auth-card form.stack label { margin-bottom: 16px; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.auth-card .btn.primary { width: 100%; justify-content: center; padding: 11px 14px; font-size: 15px; margin-top: 6px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; } .auth-brand { padding: 22px 24px; gap: 0; } .auth-pitch, .auth-foot { display: none; }
  .auth-main { align-items: flex-start; padding-top: 28px; }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); transition: left 0.15s; z-index: 20; } .sidebar.open { left: 0; }
  .menu-btn { display: inline-block; } .content { padding: 16px; }
  .ledger th:nth-child(n+4):not(.keep), .ledger td:nth-child(n+4):not(.keep) { display: none; }
  .kpi .value { font-size: 24px; }
}
@media print { .sidebar, .topbar, .btn { display: none !important; } }
.err-text { color: var(--err); }

/* Operations (ops.js) - the one dark screen, a wall display (D3); scoped to .ops --------- */
.ops { background: #0b1416; color: #cfe3df; border-radius: 10px; padding: 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ops-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ops-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: #e8f3f0; }
.ops-title svg { width: 20px; height: 20px; fill: none; stroke: #5DCAA5; stroke-width: 1.8; }
.ops-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-tab { border: 1px solid #2a3a3d; border-radius: 6px; padding: 3px 10px; }
.ops-tab.on { background: #12302b; border-color: #2a4a45; color: #9FE1CB; } .ops-tab.off { color: #5f7370; cursor: default; }
.ops-range { color: #7d918e; } .ops-range select { background: #10201f; color: #cfe3df; border: 1px solid #2a3a3d; border-radius: 6px; font: inherit; padding: 2px 6px; }
.ops-live { display: inline-flex; align-items: center; gap: 6px; color: #5DCAA5; }
.ops-live i { width: 8px; height: 8px; border-radius: 50%; background: #5DCAA5; animation: ops-blink 1.4s ease-in-out infinite; }
.ops-live.down { color: #EF9F27; } .ops-live.down i { background: #EF9F27; animation: none; }
@keyframes ops-blink { 50% { opacity: 0.3; } }
.ops-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ops-kpi { background: #10201f; border-radius: 8px; padding: 9px 12px; }
.ops-kpi-label { color: #7d918e; font-size: 12px; } .ops-kpi-value { font-size: 22px; font-weight: 600; color: #e8f3f0; }
.ops-notready { color: #EF9F27; font-size: 12px; min-height: 8px; margin: 4px 0; }
.ops-stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; }
#ops-map { width: 100%; background: #0d1a1c; border-radius: 8px; display: block; }
.ops-ring { fill: none; stroke: #1b3532; stroke-dasharray: 2 5; } .ops-ring.outer { stroke: #14292a; stroke-dasharray: 1 7; }
.ops-link { stroke: #1f3d39; stroke-width: 1; }
.ops-person { fill: #4f6e69; }
.ops-company { fill: #12302b; stroke: #1D9E75; } .ops-company.live { stroke: #EF9F27; }
.ops-customer { fill: #10201f; stroke: #5DCAA5; stroke-width: 1.4; } .ops-customer.dim { stroke: #4f6e69; stroke-dasharray: 2 2; }
.ops-label { fill: #cfe3df; font-size: 13px; } .ops-label.small { font-size: 10px; } .ops-hub { fill: #12302b; stroke: #5DCAA5; stroke-width: 1.6; } .ops-hub-text { fill: #e8f3f0; font-size: 13px; font-weight: 600; }
.ops-feed-box, .ops-box { background: #0d1a1c; border-radius: 8px; padding: 10px 12px; min-width: 0; }
.ops-feed-box { height: 100%; overflow: hidden; }
.ops-box-title { color: #7d918e; font-size: 12px; margin-bottom: 6px; }
#ops-feed { display: flex; flex-direction: column; gap: 6px; }
.ops-row { border-left: 2px solid #5DCAA5; padding-left: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.ops-row-meta { color: #7d918e; font-size: 11px; } .ops-row-note { color: #F09595; font-size: 12px; }
.ops-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.ops-li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; } .ops-li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-li .ok { color: #5DCAA5; } .ops-li .warn { color: #EF9F27; } .ops-li .err { color: #E24B4A; }
.ops-empty { color: #5f7370; }
.ops-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: #7d918e; font-size: 12px; align-items: center; }
.ops-legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 5px; }
.ops-note { margin-left: auto; color: #5f7370; }
@media (max-width: 1100px) { .ops-stage, .ops-lists { grid-template-columns: 1fr; } .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ops-feed-box { max-height: 320px; } }
.ops-btn { background: #10201f; color: #cfe3df; border: 1px solid #2a4a45; border-radius: 6px; font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer; }
.ops-btn:hover { background: #12302b; } .ops-title .ops-btn { margin-left: 8px; } #ops-focus { color: #9FE1CB; }
.ops-clickable { cursor: pointer; outline: none; } .ops-clickable:hover .ops-customer, .ops-clickable:focus .ops-customer { stroke-width: 3; fill: #12302b; }
.ops-clickable:focus .ops-label { text-decoration: underline; }
body.ops-wall .sidebar, body.ops-wall .topbar { display: none; }
body.ops-wall .content { padding: 0; max-width: none; } body.ops-wall .ops { min-height: 100vh; border-radius: 0; }
.sec-title svg { stroke: #F09595; } .ops-tab.sec-on { background: #2a1414; border-color: #5a2a2a; color: #F7C1C1; }
a.ops-tab { color: #9fb5b1; text-decoration: none; } a.ops-tab:hover { border-color: #2a4a45; color: #cfe3df; }
.ops-kpi-value.err { color: #F09595; } .ops-kpi-value.warn { color: #EF9F27; } .ops-kpi-value.info { color: #85B7EB; }
#sec-map { width: 100%; background: #0d1a1c; border-radius: 8px; display: block; }
.sec-land { fill: #13262a; stroke: #1f3d39; stroke-width: 0.4; }
.sec-customer { fill: #5DCAA5; } .sec-ring { fill: none; stroke: #5DCAA5; stroke-opacity: 0.5; } .sec-ring.dim { stroke: #4f6e69; stroke-dasharray: 2 2; }
.sec-alert { padding: 4px 0; border-bottom: 1px solid #14292a; } .sec-alert .err { color: #F09595; } .sec-alert .warn { color: #EF9F27; }
.sec-actions { display: flex; gap: 6px; margin-top: 3px; } .ops-note a { color: #7d918e; }

/* The customer's pay page (src/PayPages.php): one card, Query Desk's look, no panel shell. */
body.pay { background: var(--bg); }
.pay-main { max-width: 560px; margin: 0 auto; padding: 32px 16px 48px; }
.pay-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 16px; }
.pay .card-body h1 { font-size: 22px; margin-bottom: 14px; }
.pay .stack { margin-top: 16px; }
.pay-facts { margin: 0 0 6px; }
.pay-h { font-size: 15px; margin: 22px 0 8px; }
.pay-foot { margin-top: 18px; }
.pay .ledger { width: 100%; }

/* Settings pages (Payments, 2026-10-29): status pills in card headers, a footer bar for actions, folded advanced
   options, a setup checklist, toggles, and toasts for background saves (app.js). */
:root { --radius: 8px; }
.card { border-radius: 12px; }
.card-head { min-height: 52px; }
.card-head .badge + .badge { margin-left: 6px; }
.lead { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; line-height: 1.55; }
.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--rule); background: #fafbfb; }
.card-foot.toggle-row { justify-content: space-between; background: var(--surface); }
.card-foot.toggle-row small { display: block; margin-top: 2px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: 6px; }
.field-copy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--rule); border-radius: 8px; margin: 2px 0 12px; font-size: 13px; }
.field-copy span { color: var(--ink-soft); font-weight: 600; } .field-copy code { word-break: break-all; }
.status-tile { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.status-tile > div { background: var(--action-soft); border-radius: 10px; padding: 12px 14px; }
.status-tile small { display: block; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.status-tile .big { display: block; font-size: 18px; font-weight: 600; margin-top: 2px; }
details.more { border-top: 1px solid var(--rule); }
details.more > summary { cursor: pointer; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--action); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '›'; display: inline-block; transition: transform 0.15s; font-size: 18px; line-height: 1; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > div { padding: 0 16px 16px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form label { flex: 1 1 200px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.inline-form .btn { margin-bottom: 1px; min-height: 38px; }
.switch { display: flex !important; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); margin: 4px 0 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span { flex: 0 0 36px; height: 20px; border-radius: 999px; background: #c3ccce; position: relative; transition: background 0.15s; }
.switch > span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch input:checked + span { background: var(--action); } .switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--action-soft); }
.switch input:disabled + span { opacity: 0.5; }
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: -4px 0 20px; position: sticky; top: 56px; background: var(--bg); z-index: 4; }
.subnav a { padding: 10px 14px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.section { scroll-margin-top: 110px; margin-bottom: 8px; }
.section-title { font-size: 18px; margin: 8px 0 14px; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.row2 { align-items: start; }
.setup-row { grid-template-columns: minmax(300px, 380px) 1fr; }
.table-scroll { overflow-x: auto; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.checklist strong { display: block; font-size: 14px; } .checklist small { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--rule); color: #fff; }
.tick.done { background: var(--ok); border-color: var(--ok); } .tick.warn { background: var(--warn); border-color: var(--warn); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 50; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 12px 16px 12px 14px; border-radius: 10px; background: #17302d; color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(13, 30, 28, 0.25);
  border-left: 4px solid #7fd1a8; animation: toast-in 0.18s ease-out; }
.toast.err { border-left-color: #f08a8a; } .toast.warn { border-left-color: #f0c46a; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .setup-row { grid-template-columns: 1fr; } .subnav { top: 56px; overflow-x: auto; } }

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.primary:disabled:hover { background: var(--action); }
.field-copy a { text-decoration: none; }
.row2 > .card.wide { grid-column: 1 / -1; }
main.content:focus { outline: none; }
