/* Funkvogel identity: midnight blue, signal cyan and ice white. No build required. */
/* Switzer Medium matches the shared Lab7 footer on clientel.com. */
@font-face {
    font-family: "Switzer";
    src: url("/assets/fonts/switzer-medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
:root {
    color-scheme: dark;
    --sidebar-bg: #080f19; --page-glow: #122c4538;
    --nav-text: #b7cce0; --nav-hover: #132a40; --soft-accent: #17344b;
    --table-head: #132538; --table-hover: #162c41; --button-hover: #1b344c;
    --placeholder: #91a6bb; --success-border: #315c50; --error-border: #71404c;
    --info-border: #306181; --login-glow: #16344e;
    --input-bg: #0c1928; --input-border: #425b72; --focus: #4fd8ff;

    --font-sans: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
    --footer-text: #a7a7a7; --footer-logo: #fff;
    --font-mono: "SFMono-Regular", Consolas, monospace;
    --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
    --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem;
    --accent: #4fd8ff; --accent-text: #75dfff; --ink: #080f19; --paper: #0b1422;
    --line: #24374d; --muted: #a0b3c8; --ok: #80dfb4; --fail: #ffaaa4; --warn: #ffca7f;
    --color-bg: var(--paper); --color-surface: #101f30; --color-border: var(--line);
    --color-border-strong: #59748f; --color-text: #e8f4ff; --color-text-muted: var(--muted);
    --color-primary: var(--accent-text); --color-primary-dark: #b3efff;
    --color-danger: #94353e; --color-danger-dark: #ad393f;
    --color-ok-bg: #173a35; --color-ok-fg: var(--ok);
    --color-fail-bg: #3b222e; --color-fail-fg: var(--fail);
    --color-warn-bg: #3b3023; --color-warn-fg: var(--warn);
    --color-muted-bg: #1b2d42; --color-muted-fg: #b6c9dc;
    --radius: 16px;
}
* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font-sans); font-size: 14px; line-height: 1.6; color: var(--color-text); background: radial-gradient(ellipse at 80% 0%, var(--page-glow), transparent 55%), var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--color-primary); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3vw, 42px); font-weight: 600; line-height: 1.16; letter-spacing: -.055em; margin-bottom: 24px; }
h2 { letter-spacing: -.025em; }
.container { width: 100%; margin-inline: auto; padding-inline: 40px; }
.main-content { max-width: 1600px; padding-bottom: 36px; }
.dashboard-shell { padding-left: 238px; }
.topbar { position: fixed; inset: 0 auto 0 0; width: 238px; background: var(--sidebar-bg); color: var(--color-text); z-index: 10; border-right: 1px solid var(--line); }
.topbar-inner { padding: 38px 20px 24px; height: 100%; display: flex; flex-direction: column; align-items: stretch; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; white-space: nowrap; }
.brand-mark { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; color: var(--accent); }
.brand-mark svg { width: 43px; height: 43px; display: block; }
.brand-lockup { display: flex; flex-direction: column; }
.brand-name { font-size: 25px; font-weight: 700; letter-spacing: -.065em; line-height: 1.15; }
.brand-dot { color: var(--accent); }
.brand-caption { color: var(--muted); font: 9px var(--font-mono); letter-spacing: .2em; margin-top: 7px; }
.nav-label { font: 10px var(--font-mono); color: var(--muted); letter-spacing: .16em; margin: 58px 14px 16px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 13px; color: var(--nav-text); text-decoration: none; padding: 11px 14px; border-radius: 9px; font-weight: 500; transition: background .16s, color .16s; }
.nav a:hover { background: var(--nav-hover); color: var(--color-text); }
.nav a.active { background: var(--accent); color: var(--ink); font-weight: 700; }
.nav-symbol svg { width: 19px; height: 19px; display: block; }
.nav-symbol { width: 22px; text-align: center; font-size: 22px; line-height: 1; font-family: sans-serif; }
.logout { margin: auto 0 0; padding-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.account-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--soft-accent); color: var(--accent-text); }
.account-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.account-name small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.logout .btn-link { color: var(--nav-text); font-size: 11px; }
.workspace-bar { display: flex; justify-content: space-between; gap: 16px; padding-block: 25px; margin-bottom: 35px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; min-width: 0; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: flex; align-items: baseline; min-width: 0; }
.breadcrumbs a { color: var(--muted); text-underline-offset: 3px; }
.breadcrumbs a:hover { color: var(--color-text); }
.breadcrumbs [aria-current] { color: var(--color-text); font-weight: 500; overflow-wrap: anywhere; }
.breadcrumb-separator { padding-inline: 13px; color: var(--muted); }
.workspace-product { font: 10px var(--font-mono); align-self: center; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 36px; }
.page-heading h1 { margin-bottom: 11px; }
.eyebrow { font: 10px var(--font-mono); letter-spacing: .15em; color: var(--muted); margin-bottom: 12px; }
.page-description { color: var(--muted); margin-bottom: 0; font-size: 14px; }
.section-label { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-label h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-label > span { font-size: 11px; color: var(--muted); }
.grid, .grid-2, .grid-3 { display: grid; gap: 20px; }
.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.card { background: var(--color-surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; margin-bottom: 24px; min-width: 0; }
.card-title { margin: 0 0 20px; font-size: 16px; font-weight: 600; }
div.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.panel-heading .card-title { margin-bottom: 0; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.stat { display: flex; flex-direction: column; padding: 23px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--color-surface); overflow: hidden; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stat-label { font-size: 13px; font-weight: 500; }
.stat-icon { display: grid; place-items: center; border-radius: 50%; width: 30px; height: 30px; flex: 0 0 30px; background: #4fd8ff18; line-height: 1; }
.stat-icon svg { display: block; width: 18px; height: 18px; }
.stat-featured { background: var(--soft-accent); border-color: var(--info-border); }
.stat-featured .stat-value { color: var(--accent-text); }
.stat-featured .stat-icon { color: var(--accent-text); }
.stat-value { font-size: clamp(35px, 4vw, 52px); font-weight: 600; line-height: 1.2; letter-spacing: -.05em; margin: 20px 0 12px; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 11px; color: var(--muted); text-decoration: none; }
a.stat-note:hover { text-decoration: underline; }
.status-fail { color: var(--fail); background: var(--color-fail-bg); }
.status-warn { color: var(--warn); background: var(--color-warn-bg); }
.month-strip { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; align-items: center; margin: 20px 0 32px; padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius); }
.month-strip > div + div { padding-left: 25px; border-left: 1px solid var(--line); }
.month-strip strong { display: block; font-size: 25px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.month-strip strong small { font-size: 12px; letter-spacing: 0; font-weight: 500; }
.month-strip span:not(.eyebrow), .month-heading a { display: block; font-size: 11px; color: var(--muted); }
.month-heading .eyebrow { display: block; }
.month-heading a { text-decoration: none; color: var(--color-primary); }
.empty-state { padding: 25px 10px; text-align: center; }
.empty-symbol { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 14px; background: var(--soft-accent); color: var(--accent-text); border-radius: 13px; font-size: 25px; }
.empty-state h3 { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.empty-state p { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state-success { display: flex; align-items: center; gap: 18px; text-align: left; padding: 8px 0; }
.empty-state-success .empty-symbol { margin: 0; flex-shrink: 0; }
.table-wrap { overflow-x: auto; max-width: 100%; margin-bottom: 20px; }
.table-wrap:last-child { margin-bottom: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { background: var(--table-head); font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--table-hover); }
.table a { text-decoration: none; }
.table a:not(.btn):hover { text-decoration: underline; }
.table .text-right { text-align: right; }
.table .table-actions { width: 1%; text-align: right; }
.table td.table-actions { vertical-align: middle; }
.table-actions .row-actions { justify-content: flex-end; }
.table-actions .compact-form { text-align: left; }
.backends-table .backend-error { min-width: 150px; max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.apps-table .app-identity { min-width: 160px; max-width: 250px; white-space: normal; }
.app-table-name { font-weight: 600; overflow-wrap: anywhere; }
.app-table-lines { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.text-right .app-table-lines { align-items: flex-end; }
.apps-table .app-countries { min-width: 110px; width: 140px; white-space: normal; }
.apps-table .app-validation { min-width: 160px; white-space: normal; }
.apps-table .app-limits { min-width: 140px; white-space: normal; }
.app-country-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.app-settings { scroll-margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; font: inherit; font-size: 12px; font-weight: 600; padding: 11px 16px; border-radius: 8px; border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); cursor: pointer; text-decoration: none; line-height: 1.4; transition: background .16s, border-color .16s, transform .16s; }
.btn:hover { background: var(--button-hover); border-color: var(--color-border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #8ee7ff; border-color: #8ee7ff; }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-dark); border-color: var(--color-danger-dark); }
.btn-sm { padding: 7px 11px; font-size: 11px; }
.btn-link { background: none; border: none; color: var(--color-primary); padding: 5px 0; font-weight: 500; }
.btn-link:hover { background: none; }
input, select, textarea { width: 100%; min-width: 0; font-size: 13px; padding: 11px 12px; border: 1px solid var(--color-border-strong); border-radius: 8px; background: var(--color-surface); color: var(--color-text); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
::selection { background: #4fd8ff; color: #080f19; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--color-text); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.form-row { margin-bottom: 20px; }
.form-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-help { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.form-help.error { color: var(--fail); }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 10px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.badge-ok { background: var(--color-ok-bg); color: var(--ok); }
.badge-fail { background: var(--color-fail-bg); color: var(--fail); }
.badge-warn { background: var(--color-warn-bg); color: var(--warn); }
.badge-muted { background: var(--color-muted-bg); color: var(--color-muted-fg); }
.flash { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 13px; border: 1px solid transparent; }
.flash-success { background: var(--color-ok-bg); color: var(--ok); border-color: var(--success-border); }
.flash-error { background: var(--color-fail-bg); color: var(--fail); border-color: var(--error-border); }
.flash-info { background: var(--soft-accent); color: var(--color-text); border-color: var(--info-border); }
.token-box { font-family: var(--font-mono); font-size: 12px; background: var(--soft-accent); border: 1px solid var(--info-border); border-radius: 8px; padding: 14px 18px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-right { text-align: right; }
.pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; font-size: 12px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 5px 8px; border-radius: 6px; text-decoration: none; }
.pagination a:hover { background: var(--color-muted-bg); }
.pagination .current { background: var(--accent); color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 24px; padding: 20px; background: var(--line); border-radius: 12px; }
.filters .form-row { margin-bottom: 0; }
.filters .form-inline { align-items: flex-end; width: 100%; }
.filters .form-inline > input, .filters .form-inline > select { width: auto; flex: 1 1 140px; }
.footer { margin-top: auto; padding: 22px 0; color: var(--footer-text); font-family: "Switzer", var(--font-sans); font-size: 16px; font-weight: 500; line-height: 1.4; }
.footer-inner { display: flex; align-items: center; justify-content: flex-start; gap: 5px; }
.footer-inner > span:first-child { width: 118px; flex: 0 0 118px; text-align: center; letter-spacing: -.02em; white-space: nowrap; }
.footer-logo { display: flex; align-items: center; width: 35px; height: 26px; flex: 0 0 35px; line-height: 0; }
.footer-logo svg { display: block; width: 35px; height: auto; color: var(--footer-logo); }
.heart { color: inherit; }
.auth-shell .topbar { position: static; width: 100%; background: transparent; }
.auth-shell .topbar-inner { padding: 30px 40px; }
.auth-shell .brand { color: var(--color-text); }
.auth-shell .brand-mark { color: var(--accent); }
.auth-shell .brand-dot { color: #4fd8ff; }
.auth-shell .brand-caption { color: var(--muted); }
.auth-shell { background: radial-gradient(ellipse at 50% 45%, var(--login-glow) 0, var(--paper) 65%); }
.login-layout { display: flex; justify-content: center; padding: 5vh 0 9vh; }
.login-card { width: 100%; max-width: 430px; padding: 38px; }
.login-brand { text-align: center; margin-bottom: 30px; }
.login-brand .brand-mark { color: var(--accent); background: var(--login-glow); border-radius: 18px; width: 65px; height: 65px; margin: 0 auto 23px; }
.login-title { font-size: 27px; margin: 0 0 10px; }
.login-subtitle { font-size: 13px; color: var(--muted); }
.login-card .btn-primary { width: 100%; }
.login-card .actions { margin-bottom: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 30; background: var(--accent); color: var(--ink); padding: 12px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (min-width: 1101px) { .metrics-today { animation: arrive .4s ease-out both; } }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1100px) {
    .dashboard-shell { padding-left: 208px; }
    .topbar { width: 208px; }
    .topbar-inner { padding-inline: 14px; }
    .container.main-content, .footer .container { padding-inline: 25px; }
    .brand-name { font-size: 23px; }
    .stat { padding: 20px; }
    .page-heading { align-items: flex-start; }
    .month-strip { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
    .month-heading { grid-column: 1 / -1; display: flex; justify-content: space-between; }
    .month-heading .eyebrow { margin: 0; }
    .month-strip > div:nth-child(2) { padding-left: 0; border-left: 0; }
    .grid-2 { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 760px) {
    .dashboard-shell { padding-left: 0; }
    .topbar { position: relative; width: 100%; }
    .topbar-inner { display: grid; grid-template-columns: 1fr auto; padding: 20px; gap: 20px 12px; }
    .nav-label { display: none; }
    .nav { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
    .nav a { white-space: nowrap; font-size: 12px; padding: 9px 11px; }
    .nav-symbol { font-size: 18px; width: 18px; }
    .logout { margin: 0; padding: 0; border: 0; gap: 8px; justify-content: flex-end; }
    .account-avatar, .account-name { display: none; }
    .container.main-content, .footer .container { padding-inline: 20px; }
    .workspace-bar { padding-block: 18px; margin-bottom: 26px; }
    .workspace-product { display: none; }
    .page-heading { flex-direction: column; gap: 18px; margin-bottom: 28px; }
    .page-heading h1 { font-size: 36px; }
    .grid, .grid-3 { grid-template-columns: 1fr; gap: 12px; }
    .stat { display: grid; grid-template-columns: 1fr auto; padding: 20px; gap: 8px 20px; }
    .stat-top { justify-content: flex-end; flex-direction: row-reverse; }
    .stat-value { grid-column: 2; grid-row: 1 / 3; margin: 0; align-self: center; font-size: 39px; }
    .stat-note { grid-column: 1; }
    .month-strip { padding: 20px; gap: 20px; grid-template-columns: 1fr; }
    .month-heading { grid-column: 1; }
    .month-strip > div + div { border-left: 0; padding: 0; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; }
    .month-strip strong { font-size: 22px; }
    .card { padding: 20px; }
    .panel-heading { flex-wrap: wrap; }
    .filters .form-inline > * { flex: 1 1 100%; }
    .auth-shell .topbar-inner { display: flex; padding: 25px 20px; }
    .login-layout { padding-top: 3vh; }
    .login-card { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Shared control geometry and layouts for all administrative views. */
:root { --control-height: 44px; --field-gap: 20px; --radius: 12px; }
.main-content > h1 { margin-bottom: 24px; }
.page-heading { margin-bottom: 28px; align-items: flex-start; }
.page-heading h1 { font-size: 32px; letter-spacing: -.04em; margin-bottom: 8px; }
.page-heading > .btn { flex-shrink: 0; }
.card { padding: 24px; }
.card > p:last-child { margin-bottom: 0; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select { height: var(--control-height); padding: 10px 12px; line-height: 22px; background: var(--input-bg); border-color: var(--input-border); }
textarea { background: var(--input-bg); border-color: var(--input-border); }
input:hover, select:hover, textarea:hover { border-color: var(--color-border-strong); }
.btn { min-height: var(--control-height); padding: 10px 16px; white-space: nowrap; }
.btn-sm { min-height: 34px; padding: 6px 10px; }
.form-row { margin: 0 0 var(--field-gap); min-width: 0; }
.form-help { margin-bottom: 0; line-height: 1.6; }
label { line-height: 1.5; margin-bottom: 8px; }
.form-grid, .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--field-gap); align-items: start; }
.form-grid > .form-row, .filter-grid > .form-row, .billing-filters > .form-row { margin: 0; }
.field-wide { grid-column: 1 / -1; }
.input-compact { max-width: 340px; }
.text-preview > summary { cursor: pointer; padding-block: 10px; font-size: 12px; font-weight: 600; min-height: 44px; }
.text-preview > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.text-preview[open] > summary { margin-bottom: 12px; }
.text-preview-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 16px; }
.text-preview-examples .form-help { margin: 0 4px 0 0; }
.text-preview-result { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--color-surface); font-family: inherit; }
.form-card { max-width: 960px; }
.form-section { border: 0; margin: 0; padding: 0 0 24px; min-width: 0; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 24px; }
.form-section legend { float: left; width: 100%; font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 20px; }
.form-section legend + * { clear: both; }

.checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 10px 12px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 8px; }
.checkbox-label input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.form-actions { display: flex; gap: 12px; align-items: center; padding-top: 20px; border-top: 1px solid var(--line); margin: 0; flex-wrap: wrap; }
.filter-panel { padding: 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--color-surface); }
.filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; }
.filter-grid .field-wide { grid-column: span 2; }
.filter-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--line); }
.billing-filters { display: grid; grid-template-columns: minmax(180px, 240px) minmax(180px, 1fr) auto; gap: 16px; align-items: end; }
.list-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.section-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 24px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.system-table td, .system-table th { white-space: normal; overflow-wrap: anywhere; }
.row-actions { display: grid; grid-template-columns: repeat(4, max-content); column-gap: 6px; align-items: start; }
.row-actions-small { grid-template-columns: repeat(2, max-content); }
.row-actions-small:not(:has(.row-action-delete)) { grid-template-columns: max-content; }
.row-actions .row-disclosure { display: contents; }
.row-actions .row-disclosure::details-content { display: contents; }
.row-actions .row-disclosure > summary { justify-self: end; }
.row-disclosure summary { cursor: pointer; color: var(--color-primary); padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; min-height: 34px; }
.row-disclosure summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.row-disclosure:not([open]) > .compact-form { display: none; }
.compact-form { grid-column: 1 / -1; grid-row: 2; min-width: 0; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); white-space: normal; }
.compact-form input { margin-bottom: 14px; }
.compact-form .form-help { margin: 0 0 14px; }
.ui-icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; }
.btn-action, .row-disclosure summary.btn-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--color-text); font-size: 11px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.btn-action:hover, .row-disclosure summary.btn-action:hover { border-color: var(--color-border-strong); background: var(--button-hover); text-decoration: none; }
.btn-action.btn-icon { width: 38px; padding-inline: 0; }
.btn-action.status-toggle { min-width: 104px; justify-content: flex-start; color: var(--color-muted-fg); background: var(--color-muted-bg); }
.status-toggle-track { position: relative; display: block; flex: 0 0 32px; height: 20px; border: 1px solid var(--muted); border-radius: 20px; }
.status-toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.status-toggle[aria-checked="true"] { color: var(--ok); background: var(--color-ok-bg); border-color: var(--success-border); }
.status-toggle[aria-checked="true"] .status-toggle-track { border-color: var(--ok); background: var(--ok); }
.status-toggle[aria-checked="true"] .status-toggle-track::after { transform: translateX(12px); background: var(--color-surface); }
.btn-action.status-toggle:hover { border-color: var(--color-border-strong); background: var(--button-hover); }
.btn-action.status-toggle[aria-checked="true"]:hover { border-color: var(--ok); background: var(--color-ok-bg); }
.btn-action.btn-action-danger { color: var(--fail); border-color: transparent; }
.btn-action.btn-action-danger:hover { background: var(--color-fail-bg); border-color: var(--error-border); }
.row-action-delete { border-left: 1px solid var(--line); padding-left: 8px; margin-left: 2px; }
.row-disclosure summary.btn-action { list-style: none; }
.row-disclosure summary.btn-action::-webkit-details-marker { display: none; }
.row-disclosure[open] > summary.btn-action { background: var(--soft-accent); border-color: var(--info-border); color: var(--color-primary); }
@supports not selector(::details-content) {
    .row-actions { display: flex; flex-wrap: nowrap; }
    .row-actions .row-disclosure { display: block; }
    .row-disclosure[open] { width: 240px; }
    .compact-form { width: 240px; }
}
@media (max-width: 760px) {
    .btn-action, .row-disclosure summary.btn-action { min-height: 44px; }
    .btn-action.btn-icon { width: 44px; }
}
.table td { vertical-align: top; }
.app-metrics { margin-bottom: 24px; }
pre.token-box { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1200px) { .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .settings-layout { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 760px) { .form-grid, .filter-grid { gap: 20px 16px; } .billing-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .billing-filters > .btn { grid-column: 1 / -1; justify-self: end; } .page-heading h1 { font-size: 30px; } }
@media (max-width: 540px) { .form-grid, .filter-grid, .billing-filters { grid-template-columns: minmax(0, 1fr); } .filter-grid .field-wide { grid-column: 1; } .card, .filter-panel { padding: 20px; } .filter-actions { justify-content: stretch; } .filter-actions > .btn { flex: 1; padding-inline: 10px; } .list-toolbar > .btn { font-size: 11px; padding-inline: 10px; } .form-actions { gap: 10px; } }

.app-metrics .stat-value { font-size: clamp(26px, 2.8vw, 40px); margin-top: 0; }
.app-metrics .stat-value small { font-size: 14px; letter-spacing: 0; }
.system-table th { width: 140px; }

/* A stored preference takes precedence; CSS also follows the system without JavaScript. */
:root[data-theme="light"] {
    color-scheme: light;
    --footer-text: var(--muted); --footer-logo: var(--color-text);
    --paper: #f3f7fb; --sidebar-bg: #ffffff; --page-glow: #cceefa45;
    --accent-text: #006b8a; --line: #ccd9e4; --muted: #536a7f;
    --ok: #176444; --fail: #a12d38; --warn: #805000;
    --color-surface: #ffffff; --color-text: #182c3e;
    --color-border-strong: #748a9e; --color-primary-dark: #004f68;
    --color-ok-bg: #e2f4eb; --color-fail-bg: #fdebed; --color-warn-bg: #fff2d9;
    --color-muted-bg: #e9eff5; --color-muted-fg: #425c73;
    --nav-text: #425c73; --nav-hover: #edf4f9; --soft-accent: #e2f3fa;
    --table-head: #edf3f8; --table-hover: #f3f8fc; --button-hover: #eaf2f8;
    --placeholder: #586e81; --success-border: #92cbb0; --error-border: #e0a0a7;
    --info-border: #8bbacb; --login-glow: #dfedf7;
    --input-bg: #f8fbfd; --input-border: #8b9fae; --focus: #007695;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
    color-scheme: light;
    --footer-text: var(--muted); --footer-logo: var(--color-text);
    --paper: #f3f7fb; --sidebar-bg: #ffffff; --page-glow: #cceefa45;
    --accent-text: #006b8a; --line: #ccd9e4; --muted: #536a7f;
    --ok: #176444; --fail: #a12d38; --warn: #805000;
    --color-surface: #ffffff; --color-text: #182c3e;
    --color-border-strong: #748a9e; --color-primary-dark: #004f68;
    --color-ok-bg: #e2f4eb; --color-fail-bg: #fdebed; --color-warn-bg: #fff2d9;
    --color-muted-bg: #e9eff5; --color-muted-fg: #425c73;
    --nav-text: #425c73; --nav-hover: #edf4f9; --soft-accent: #e2f3fa;
    --table-head: #edf3f8; --table-hover: #f3f8fc; --button-hover: #eaf2f8;
    --placeholder: #586e81; --success-border: #92cbb0; --error-border: #e0a0a7;
    --info-border: #8bbacb; --login-glow: #dfedf7;
    --input-bg: #f8fbfd; --input-border: #8b9fae; --focus: #007695;
    }
}
.brand-mark, .brand-dot, .auth-shell .brand-mark, .auth-shell .brand-dot, .login-brand .brand-mark { color: var(--accent); }
.nav a.active circle[fill] { fill: var(--accent); }
.nav a:not(.active) circle[fill] { fill: var(--sidebar-bg); }
.theme-control { display: flex; align-items: center; flex-shrink: 0; }
.theme-control[hidden] { display: none; }
.workspace-bar { align-items: center; }
.auth-shell .topbar-inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
@media (max-width: 760px) {
    .workspace-bar { flex-wrap: wrap; gap: 12px; }
    .auth-shell .topbar-inner { flex-wrap: wrap; }
}

/* Native radios preserve keyboard navigation within the appearance selector. */
.appearance-settings[hidden] { display: none; }
.appearance-settings .card-title { margin-bottom: 8px; }
.appearance-settings .section-note { margin-bottom: 24px; }
.theme-segments { display: inline-flex; max-width: 100%; padding: 4px; gap: 4px; border-radius: 10px; background: var(--color-muted-bg); }
.theme-option { position: relative; margin: 0; cursor: pointer; min-width: 0; }
.theme-option input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; }
.theme-option > span { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 18px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--muted); }
.theme-option svg { display: block; width: 20px; height: 20px; flex: 0 0 20px; }
.theme-option:hover > span { color: var(--color-text); }
.theme-option input:checked + span { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 3px #00000012; }
.theme-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 540px) { .theme-segments { display: flex; } .theme-option { flex: 1; } .theme-option > span { padding-inline: 8px; gap: 6px; font-size: 13px; } }

.price-form { align-items: flex-end; }
.price-form > div { width: min(100%, 280px); }
.price-form.form-row:last-child { margin-bottom: 0; }
.cost-history-title { margin-top: 28px; }

/* Keep single-value selects native while giving the indicator a stable inset. */
select:not([multiple]):not([size]), select[size="1"] {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23748a9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}
@media (forced-colors: active) {
    select:not([multiple]):not([size]), select[size="1"] { appearance: auto; background-image: none; }
}
.form-grid > .section-note { margin: 0; }
.form-followup { margin-top: 20px; }
.table .text-right { font-variant-numeric: tabular-nums; }
.table .empty-state { white-space: normal; }
.empty-state { padding: 20px 12px; }
.empty-state h3 { font-size: 14px; font-weight: 600; }
.empty-state p { margin-inline: auto; }
.empty-state-success p { margin-inline: 0; }
.page-heading > div { min-width: 0; }
.page-heading h1, .card-title { overflow-wrap: anywhere; }
.footer-inner { max-width: 1600px; }
.filter-disclosure > summary { display: none; }
.filter-disclosure > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
@media (max-width: 760px) {
    .filter-disclosure > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; font-weight: 600; }
    .filter-disclosure > summary::-webkit-details-marker { display: none; }
    .filter-disclosure > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
    .filter-disclosure[open] > summary { margin-bottom: 20px; }
    .filter-disclosure[open] > summary::after { transform: rotate(225deg); }
    .nav.can-scroll-right { mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); }
    .nav.can-scroll-left { mask-image: linear-gradient(to right, transparent, #000 20px); }
    .nav.can-scroll-left.can-scroll-right { mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent); }
    .nav a { min-height: 44px; }
    .btn-sm, .row-disclosure summary { min-height: 44px; }
}
@media (max-width: 540px) {
    .price-form > div, .price-form > .btn { width: 100%; }
}

/* Currency suffixes remain separate from the editable decimal amount. */
.money-input { position: relative; }
.money-input input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { padding-right: 56px; }
.money-input > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13px; }
.view-tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.view-tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 4px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 600; }
.view-tabs a:hover { color: var(--color-text); }
.view-tabs a[aria-current="page"] { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.stat-period { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
@media (max-width: 540px) { .view-tabs { gap: 20px; } }

/* Reveal the compact tenant form only when a price needs to be added. */
.tenant-editor { margin-bottom: 20px; }
.tenant-editor > summary { display: flex; align-items: center; gap: 10px; width: fit-content; min-height: 44px; padding: 8px 12px; border: 1px solid var(--color-border-strong); border-radius: 8px; color: var(--color-text); font-size: 12px; font-weight: 600; cursor: pointer; }
.tenant-editor > summary::-webkit-details-marker { display: none; }
.tenant-editor > summary::before { content: "+"; font-size: 20px; line-height: 1; font-weight: 400; }
.tenant-editor[open] > summary::before { content: "−"; }
.tenant-editor > summary:hover { background: var(--button-hover); }
.tenant-editor > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.tenant-price-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(150px, .8fr) auto; gap: 12px 16px; align-items: end; margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.tenant-price-form .form-row, .tenant-price-form .form-help { margin: 0; }
.tenant-prices-table td { vertical-align: middle; }
.tenant-price-inline { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tenant-price-inline .money-input { flex: 0 0 140px; width: 140px; }
.tenant-price-inline input { text-align: right; }
.tenant-prices-table .table-actions .btn { min-height: 44px; }
@media (max-width: 1100px) {
    .tenant-price-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .tenant-price-form { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .tenant-editor > summary { width: 100%; justify-content: center; }
}

/* API reference shares its source with the downloadable Markdown document. */
.reference-actions { justify-content: flex-end; }
[data-copy-status]:not(:empty) { margin-bottom: var(--space-4); }
.reference-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-6); }
.reference-nav a { font-size: 13px; }
.reference-document section { scroll-margin-top: var(--space-6); min-width: 0; }
.reference-document section + section { margin-top: var(--space-8); padding-top: var(--space-8); border-top: 1px solid var(--line); }
.reference-document h2 { font-size: 22px; margin-bottom: var(--space-5); }
.reference-document h3 { font-size: 16px; margin-top: var(--space-6); margin-bottom: var(--space-3); }
.reference-document p, .reference-document li { overflow-wrap: anywhere; }
.reference-document li + li { margin-top: var(--space-2); }
.reference-document code { font-family: var(--font-mono); font-size: .9em; }
.reference-document :not(pre) > code { background: var(--input-bg); padding: 2px 4px; border-radius: 4px; }
.reference-document .table-wrap { margin-block: var(--space-5); }
.reference-table th, .reference-table td { white-space: normal; min-width: 90px; }
.reference-table th:first-child, .reference-table td:first-child { min-width: 100px; }
.reference-code { margin-block: var(--space-5); background: var(--input-bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.reference-code-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); color: var(--muted); font: 12px var(--font-mono); }
.reference-code pre { margin: 0; padding: var(--space-4); overflow-x: auto; white-space: pre; line-height: 1.7; }
.reference-markdown { min-height: 240px; margin-bottom: var(--space-6); }
.reference-actions [hidden], .reference-code [hidden], .reference-markdown[hidden] { display: none; }
@media (min-width: 761px) {
    .dashboard-shell .topbar-inner { overflow-y: auto; }
    .dashboard-shell .topbar-inner > * { flex-shrink: 0; }
    .dashboard-shell .nav { flex-grow: 1; }
    .dashboard-shell .nav-bottom { margin-top: auto; }
    .dashboard-shell .logout { margin-top: var(--space-3); }
}
@media (max-width: 760px) {
    .reference-actions { justify-content: flex-start; }
    .reference-actions .btn { min-height: 44px; }
    .reference-nav { gap: var(--space-3) var(--space-4); }
}

.auth-shell .footer-inner { justify-content: center; }
.theme-icons .theme-option > span { width: 44px; padding: 10px; }
