/* VenaPass console. Tokens follow the VenaPass design system; light and dark. */
:root {
  --bg: #f4f7f6; --surface: #ffffff; --ink: #0d1b1e; --muted: #4a5e62; --line: #cfdcda;
  --brand: #0b5f5c; --brand-ink: #ffffff; --brand-soft: #dcefeb; --ir: #ff6a3d;
  --ok: #1b7a43; --ok-soft: #e3f2e9; --warn: #8a5a00; --warn-soft: #fbf0d9; --bad: #b3261e; --bad-soft: #fbe4e2;
  --display: 'Sora', 'Avenir Next', system-ui, sans-serif; --text: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace; --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --surface-2: #f8fbfa; --band: #0d1b1e; --band-line: #0d1b1e; --shadow: 0 1px 2px rgba(13,27,30,.06), 0 8px 24px rgba(13,27,30,.06);
  color-scheme: light;
}
/* Three modes: System follows the device; Light and Dark are chosen in the theme switch (theme.js). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b1416; --surface: #13211f; --surface-2: #182a28; --ink: #e7f1ef; --muted: #9db2ae; --line: #2b4c47;
  --brand: #45b8ad; --brand-ink: #04211f; --brand-soft: #16302d;
  --ok: #4cc27f; --ok-soft: #12301f; --warn: #f0b84a; --warn-soft: #33270d; --bad: #ff8a80; --bad-soft: #3a1714;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --band: linear-gradient(135deg, #11332f 0%, #0f2421 60%, #13211f 100%); --band-line: #2b4c47; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0b1416; --surface: #13211f; --surface-2: #182a28; --ink: #e7f1ef; --muted: #9db2ae; --line: #2b4c47;
  --brand: #45b8ad; --brand-ink: #04211f; --brand-soft: #16302d;
  --ok: #4cc27f; --ok-soft: #12301f; --warn: #f0b84a; --warn-soft: #33270d; --bad: #ff8a80; --bad-soft: #3a1714;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --band: linear-gradient(135deg, #11332f 0%, #0f2421 60%, #13211f 100%); --band-line: #2b4c47; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--text); }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; line-height: 36px; } h2 { font-size: 20px; line-height: 28px; }
p { margin: 0; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }

/* Auth pages */
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 48px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); font: 600 20px var(--display); }
.card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.card-wide { max-width: 640px; }
.help { color: var(--muted); font-size: 14px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: 14px; line-height: 20px; }
.hint { font-size: 14px; color: var(--muted); }
input, select { font: inherit; min-height: 44px; padding: 10px 12px; border: 1px solid var(--muted); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.code-input { font: 24px var(--mono); letter-spacing: 6px; text-align: center; }
.error { color: var(--bad); font-size: 14px; }
fieldset.group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px 20px; margin: 0; display: flex; flex-direction: column; gap: 16px; }
legend { font-weight: 600; padding: 0 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 16px; line-height: 24px; min-height: 44px; }
.check input { width: 22px; min-height: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--brand); }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--r-md); border: 1px solid transparent; font: 600 16px var(--text); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-quiet { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-danger { background: var(--bad); color: #ffffff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.htmx-request.btn, .htmx-request .btn-primary { opacity: .7; }

/* Feedback */
.notice { padding: 12px 14px; border-radius: var(--r-md); font-size: 15px; }
.notice-info { background: var(--brand-soft); } .notice-warn { background: var(--warn-soft); color: var(--warn); } .notice-error { background: var(--bad-soft); color: var(--bad); }
.banner { padding: 16px 20px; border-radius: var(--r-md); }
.banner-success { background: var(--ok-soft); color: var(--ink); border: 1px solid var(--ok); }
.chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.chip-sandbox { background: var(--warn-soft); color: var(--warn); } .chip-review { background: var(--brand-soft); color: var(--brand); }
.chip-live { background: var(--ok-soft); color: var(--ok); } .chip-stop { background: var(--bad-soft); color: var(--bad); }

/* Sign-up progress */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 13px; color: var(--muted); }
.steps li { border-top: 4px solid var(--line); padding-top: 6px; }
.steps li.done { border-color: var(--brand); } .steps li.current { border-color: var(--ir); color: var(--ink); font-weight: 600; }

/* Signed-in shell */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px max(16px, 4vw); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .org { color: var(--muted); font-weight: 600; }
.menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.menu-item { width: 100%; justify-content: flex-start; }
.page { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px max(16px, 4vw) 64px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist div { display: flex; flex-direction: column; gap: 4px; }
.tick { flex: none; width: 28px; height: 28px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 14px; }
.checklist li.done .tick { background: var(--ok); color: #ffffff; }

/* Dialog */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 12, 13, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; padding: 16px; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Console navigation, tables and one-time secrets */
.tabs { display: flex; gap: 4px; padding: 0 max(16px, 4vw); background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ir); }
.lead { max-width: 46em; }
details.add > summary { list-style: none; align-self: flex-start; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 4px; }
.panel-key { border-color: var(--brand); }
.setup-code { font: 600 clamp(28px, 6vw, 40px)/1.2 var(--mono); letter-spacing: .12em; color: var(--brand); }
.secret { font: 15px/1.5 var(--mono); word-break: break-all; padding: 12px 14px; background: var(--brand-soft); border-radius: var(--r-sm); }
.mono { font-family: var(--mono); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { max-width: 520px; flex-wrap: nowrap; }
.search input { flex: 1; }
.btn-quiet-danger { color: var(--bad); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.add-passkey { max-width: 420px; }

/* Back office */
.subtabs, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.subtabs a, .filters a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.subtabs a[aria-current="page"], .filters a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.count { font-weight: 400; opacity: .8; }
.enquiries summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.enquiries details[open] summary { margin-bottom: 12px; }
.message { white-space: pre-wrap; }

/* Header account menu: initials, then "Name · Company", no box */
.who { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px; border-radius: var(--r-md); font-weight: 600; }
.who:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 9999px; background: var(--brand); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--display); letter-spacing: .02em; }
.who-org { color: var(--muted); font-weight: 400; }
.menu summary.who { border: 0; padding: 0 6px; }
.menu-panel { box-shadow: var(--shadow); }
.menu-email { font-size: 14px; color: var(--muted); word-break: break-all; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); }
.menu-section { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); padding: 4px 4px 0; }
.menu-panel .menu-item { border-color: transparent; }
.menu-panel .menu-item:hover { background: var(--surface-2); }

/* Theme switch (System / Light / Dark) */
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 9999px; background: var(--surface-2); }
.theme-switch button { min-height: 36px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 9999px; background: transparent; color: var(--muted); font: 600 13px var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager-count { color: var(--muted); font-size: 14px; }
.pager-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-num, .pager-step { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 600; }
.pager-num:hover, .pager-step:hover { background: var(--surface-2); }
.pager-num[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.pager-step[aria-disabled="true"] { color: var(--muted); opacity: .5; }
.pager-gap { padding: 0 6px; color: var(--muted); }

/* Back office shell: a darker, distinct frame so staff always know where they are */
body.staff { background: var(--bg); }
.staff-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.staff-nav { background: #0b1416; color: #e7f1ef; padding: 20px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid #1d3532; }
.staff-nav .brand { color: #e7f1ef; padding: 0 8px; }
.staff-nav nav { display: flex; flex-direction: column; gap: 2px; }
.staff-nav nav a { color: #9db2ae; text-decoration: none; font-weight: 600; font-size: 15px; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: var(--r-sm); }
.staff-nav nav a:hover { background: #13211f; color: #e7f1ef; }
.staff-nav nav a[aria-current="page"] { background: #16302d; color: #e7f1ef; box-shadow: inset 3px 0 0 var(--ir); }
.staff-nav nav a svg { flex: none; opacity: .85; }
.nav-group { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6f8784; }
.staff-badge { margin: 0; padding: 0 8px; align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ir); }
.staff-body { min-width: 0; display: flex; flex-direction: column; }
.staff-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 8px max(16px, 3vw);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.staff-crumb { margin: 0; font-weight: 600; color: var(--muted); } .staff-crumb a { color: var(--muted); }
.staff-main { max-width: 1320px; width: 100%; }
@media (max-width: 860px) { .staff-shell { grid-template-columns: 1fr; } .staff-nav { position: static; height: auto; }
  .staff-nav nav { flex-direction: row; flex-wrap: wrap; } .nav-group { display: none; } }

/* Team */
.roles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.roles legend { font-weight: 600; font-size: 14px; padding: 0 0 6px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; font-weight: 400; }
.role-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-option input { width: 18px; min-height: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
.role-option > span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 20px; }
.invite-form { max-width: 760px; }
select.compact { min-height: 40px; padding: 6px 10px; width: auto; }
.matrix td:not(:first-child), .matrix th:not(:first-child) { text-align: center; }
.matrix .yes { color: var(--ok); font-weight: 600; } .matrix .no { color: var(--muted); }

/* Overview */
.hero-band { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 28px 28px 26px; border-radius: var(--r-lg); background: var(--band); border: 1px solid var(--band-line); color: #e7f1ef; }
.hero-veins { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-veins path { fill: none; stroke: #45b8ad; stroke-width: 1.5; opacity: .35; }
.hero-veins circle { fill: var(--ir); opacity: .8; }
.hero-text { position: relative; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.hero-band h1 { color: #ffffff; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
.hero-org { margin: 0; display: inline-flex; align-items: center; gap: 8px; color: #9db2ae; font-size: 14px; font-weight: 600; }
.hero-summary { color: #c7d8d4; font-size: 17px; line-height: 26px; }
.status-dot { width: 9px; height: 9px; border-radius: 9999px; background: #f0b84a; }
.status-dot.status-live { background: #4cc27f; box-shadow: 0 0 0 0 rgba(76,194,127,.6); animation: pulse 2.4s infinite; }
.status-dot.status-suspended { background: #ff8a80; } .status-dot.status-in_review { background: #45b8ad; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76,194,127,.55); } 70% { box-shadow: 0 0 0 8px rgba(76,194,127,0); } 100% { box-shadow: 0 0 0 0 rgba(76,194,127,0); } }
.btn-onband { position: relative; background: #ffffff; color: #0b5f5c; }
.btn-onband:hover { background: #dcefeb; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.kpi-value { font: 600 34px/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-note { font-size: 13px; color: var(--muted); }
.kpi-note .up { color: var(--ok); font-weight: 600; } .kpi-note .down { color: var(--bad); font-weight: 600; }
.meter { display: block; width: 100%; height: 6px; }
.meter-track { fill: var(--brand-soft); } .meter-fill { fill: var(--brand); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: 1fr; } }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.legend { margin: 0; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.key-ok { background: var(--brand); } .key-bad { background: var(--ir); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 200px; align-items: stretch; padding-top: 8px; }
.bar-col { height: 100%; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-stack { width: 100%; max-width: 28px; flex: 1 1 0; min-height: 0; height: auto; display: block; }
.bar-ok { fill: var(--brand); } .bar-bad { fill: var(--ir); }
.bar-day { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-empty { font-size: 14px; }

.setup { display: flex; gap: 20px; align-items: flex-start; }
.ring { flex: none; width: 84px; height: 84px; }
.ring-track { fill: none; stroke: var(--brand-soft); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; }
.ring text { fill: var(--ink); font: 600 18px var(--display); }
.steps-compact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.steps-compact li { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.steps-compact li.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.tick-sm { width: 20px; height: 20px; flex: none; border-radius: 9999px; border: 2px solid var(--line); display: inline-grid; place-items: center; font-size: 12px; }
.steps-compact li.done .tick-sm { background: var(--ok); border-color: var(--ok); color: #ffffff; text-decoration: none; }
form.inline { display: inline; }
.link-button { background: none; border: 0; padding: 0; color: var(--brand); font: 600 15px var(--text); cursor: pointer; text-decoration: underline; min-height: 28px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.feed li:first-child { border-top: 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 9999px; } .feed-dot.ok { background: var(--brand); } .feed-dot.bad { background: var(--ir); }
@media (max-width: 640px) { .feed li { grid-template-columns: auto 1fr; } .feed-where, .feed li time { grid-column: 2; } .hero-band { padding: 22px; } }
.steps-compact li > span:not(.tick-sm) { display: inline; }

/* Header: theme switch and account menu, top right */
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-end .menu { margin-left: 0; }
.theme-switch button { min-width: 36px; padding: 0 8px; }
@media (max-width: 520px) { .topbar-end .who-org { display: none; } }

/* Shared bits */
.banner-info { background: var(--brand-soft); color: var(--ink); border: 1px solid var(--brand); }
.banner-error { background: var(--bad-soft); color: var(--ink); border: 1px solid var(--bad); }
.chip-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.empty-state { align-items: flex-start; }
.empty-state h2 { margin: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.small { font-size: 13px; }
.pre { white-space: pre-line; margin: 0; }
.grow { flex: 1 1 220px; min-width: 0; }

/* Production and sandbox */
.env-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); align-self: flex-start; }
.env-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; text-decoration: none; }
.env-tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.env-count { font: 600 12px var(--mono); padding: 1px 7px; border-radius: 9999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.env-dot { width: 8px; height: 8px; border-radius: 9999px; display: inline-block; flex: none; }
.env-live .env-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.env-sandbox .env-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.env-note { padding: 12px 16px; border-radius: var(--r-md); border-left: 4px solid; background: var(--surface); }
.env-note p { margin: 0; }
.env-note.env-live { border-color: var(--ok); } .env-note.env-sandbox { border-color: var(--warn); }
.env-note code, .key-chip { font-family: var(--mono); font-size: 14px; }
.key-chip { display: inline-block; padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
.key-chip.env-live { border-left: 3px solid var(--ok); } .key-chip.env-sandbox { border-left: 3px solid var(--warn); }
.env-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }

/* Billing */
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.bill-total { margin: 0; font: 600 40px/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bill-lines { margin: 0; display: flex; flex-direction: column; }
.bill-lines div { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.bill-lines dt { font-weight: 600; } .bill-lines dd { margin: 0; }
.bill-lines dd:nth-of-type(1) { grid-column: 1; color: var(--muted); font-size: 14px; }
.bill-lines dd:nth-of-type(2) { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Invoice document */
.invoice { gap: 24px; }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.invoice-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.invoice-meta h1, .invoice-meta p { margin: 0; }
.invoice-parties { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.invoice-parties p { margin: 4px 0 0; }
.invoice tfoot th { text-align: right; } .invoice-total { font: 600 20px var(--display); }
.invoice-pay { padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.invoice-pay p { margin: 4px 0 0; }
@media print {
  .topbar, .tabs, .site-footer, .no-print, .staff-nav, .staff-top { display: none !important; }
  body, .panel { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .invoice { border: 0; padding: 0; }
}

/* Back office: data pages */
.auth-theme { position: fixed; top: 12px; right: 16px; z-index: 5; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.search { display: flex; gap: 8px; align-items: center; flex: 0 1 420px; }
.filter-bar { justify-content: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.filter-bar .field { flex: 0 1 180px; } .filter-bar .field.grow { flex: 1 1 220px; }
.filter-bar label { font-size: 13px; font-weight: 600; color: var(--muted); }
.filter-bar input, .filter-bar select { min-height: 40px; padding: 6px 10px; }
.panel.flush { padding: 0; gap: 0; overflow: hidden; }
.panel.flush .pager { padding: 12px 16px; border-top: 1px solid var(--line); }
.pad { padding: 20px; margin: 0; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.data th, table.data td { padding: 12px 16px; }
table.data tbody tr:hover { background: var(--surface-2); }
table.dense th, table.dense td { padding: 8px 12px; font-size: 14px; }
.nowrap { white-space: nowrap; }
.outcome { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.outcome::before { content: ""; width: 8px; height: 8px; border-radius: 9999px; }
.outcome.ok { color: var(--ok); } .outcome.ok::before { background: var(--ok); }
.outcome.bad { color: var(--bad); } .outcome.bad::before { background: var(--bad); }
.bad { color: var(--bad); }
.attention { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ir); border-radius: var(--r-lg); padding: 14px 18px; }
.attention h2 { margin: 0 0 6px; }
.attention ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attention li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.ov-grid h3 { margin: 0 0 8px; font-size: 16px; }
.bars.bars-30 { grid-template-columns: repeat(30, 1fr); gap: 3px; }
.stack-bar { display: flex; height: 12px; border-radius: 9999px; overflow: hidden; background: var(--surface-2); }
.stack-bar svg { display: block; }
.seg-live rect, .seg-key.seg-live { fill: var(--ok); background: var(--ok); }
.seg-in_review rect, .seg-key.seg-in_review { fill: var(--brand); background: var(--brand); }
.seg-sandbox rect, .seg-key.seg-sandbox { fill: var(--warn); background: var(--warn); }
.seg-suspended rect, .seg-key.seg-suspended { fill: var(--bad); background: var(--bad); }
.stat-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.stat-row a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.seg-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.stat-list { margin: 0; display: flex; flex-direction: column; }
.stat-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.stat-list div:first-child { border-top: 0; }
.stat-list dt { color: var(--muted); font-weight: 600; } .stat-list dd { margin: 0; display: flex; flex-direction: column; align-items: flex-end; font: 600 18px var(--display); font-variant-numeric: tabular-nums; }
.kpi-link { text-decoration: none; color: var(--ink); } .kpi-link:hover { border-color: var(--brand); }
.kpi-value small { font-size: 18px; color: var(--muted); margin-left: 2px; }
.kpi-value.kpi-money { font-size: 24px; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.detail-head p { margin: 4px 0 0; }
.rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.rates label { font-size: 13px; font-weight: 600; color: var(--muted); }
.add-inline { margin-top: 12px; } .add-inline > summary { list-style: none; } .add-inline form { margin-top: 12px; }

/* Status page */
.status-page { width: min(860px, 100%); margin: 0 auto; padding: 32px 16px 24px; display: flex; flex-direction: column; gap: 20px; }
.status-head { display: flex; align-items: center; gap: 12px; }
.status-head .muted { font-weight: 600; border-left: 1px solid var(--line); padding-left: 12px; }
.status-banner { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.status-banner h1 { margin: 0; font-size: 24px; } .status-banner p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.status-icon { flex: none; width: 18px; height: 18px; border-radius: 9999px; background: var(--muted); }
.status-operational { border-color: var(--ok); } .status-operational .status-icon { background: var(--ok); box-shadow: 0 0 0 6px var(--ok-soft); }
.status-degraded { border-color: var(--warn); } .status-degraded .status-icon { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-soft); }
.status-outage { border-color: var(--bad); } .status-outage .status-icon { background: var(--bad); box-shadow: 0 0 0 6px var(--bad-soft); }
.components { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.components li { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.components li:first-child { border-top: 0; padding-top: 0; }
.components p { margin: 2px 0 0; }
.uptime { width: 100%; height: 28px; display: block; }
.up-ok { fill: var(--ok); } .up-minor { fill: var(--warn); } .up-bad { fill: var(--bad); } .up-none { fill: var(--line); }
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.state::before { content: ""; width: 10px; height: 10px; border-radius: 9999px; background: var(--muted); }
.state-operational { color: var(--ok); } .state-operational::before { background: var(--ok); }
.state-degraded, .state-maintenance { color: var(--warn); } .state-degraded::before, .state-maintenance::before { background: var(--warn); }
.state-outage { color: var(--bad); } .state-outage::before { background: var(--bad); }
.state-unknown { color: var(--muted); }
.incident { border-left: 4px solid var(--warn); } .incident-outage { border-left-color: var(--bad); } .incident-maintenance { border-left-color: var(--brand); }
.incident h2, .incident-past h3 { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline p { margin: 2px 0 0; }
.incident-past { padding: 12px 0; border-top: 1px solid var(--line); } .incident-past:first-of-type { border-top: 0; }
.incident-past p { margin: 4px 0 0; }

/* Agreements and inventory */
textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--muted); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r-lg); padding: 16px 18px; }
.plan-card.plan-offline { border-top-color: var(--ir); } .plan-card.plan-purchase { border-top-color: var(--ok); }
.plan-card p { margin: 6px 0 10px; }
.plan-facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.stock-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; max-height: 280px; overflow-y: auto; }
