/* ============================================================================
   OpenFleet design system — a polished, data-forward operations console.
   Stripe/Notion craft (type, spacing, restrained depth) + Datadog/Grafana
   density. Self-hosted Geist; monochrome neutrals with semantic colour only.
   CSP: everything self-hosted (fonts, css, js).
   ========================================================================== */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/geist-sans.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
}

:root {
  /* neutrals ------------------------------------------------------------- */
  --bg:        #09090b;
  --surface:   #121214;
  --surface-2: #17171a;
  --sidebar:   #0b0b0d;
  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.12);
  --text:      #e9e9ec;
  --text-2:    #9b9ba6;
  --text-3:    #6c6c77;
  --text-strong: #f6f6f7;
  --hover:     rgba(255,255,255,.045);
  --hover-2:   rgba(255,255,255,.07);
  --ink-faint: rgba(255,255,255,.08);

  --accent:    #5b9bff; --accent-rgb: 91,155,255;
  --on-solid:  #09090b; --solid: #fafafa; --solid-hover: #e7e7ea;

  --green: #37c76a; --green-rgb: 55,199,106;
  --amber: #e9a73d; --amber-rgb: 233,167,61;
  --red:   #f05850; --red-rgb:   240,88,80;
  --blue:  #549bf2; --blue-rgb:  84,155,242;

  /* depth — restrained, role-based, not decorative ----------------------- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.28);
  --shadow-pop: 0 12px 34px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
  --zebra: rgba(255,255,255,.018);

  /* radius / type / fonts ------------------------------------------------ */
  --r: 9px; --r-sm: 6px; --r-lg: 13px;
  --sidebar-w: 244px;
  --sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-11: .6875rem; --fs-12: .75rem; --fs-13: .8125rem; --fs-14: .875rem;
  --fs-15: .9375rem; --fs-17: 1.0625rem; --fs-19: 1.1875rem; --fs-24: 1.5rem; --fs-30: 1.875rem;
}
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg); --bs-body-bg-rgb: 9,9,11;
  --bs-body-color: var(--text); --bs-body-color-rgb: 233,233,236;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: var(--text-2); --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-color: var(--text-3); --bs-tertiary-bg: var(--surface-2);
  --bs-heading-color: var(--text-strong);
  --bs-border-color: var(--line); --bs-border-color-translucent: var(--line);
  --bs-link-color: #c9d6ea; --bs-link-color-rgb: 201,214,234; --bs-link-hover-color: #fff;
  --bs-code-color: #cbd3df;
  --bs-primary: var(--accent); --bs-primary-rgb: var(--accent-rgb);
  --bs-card-bg: var(--surface); --bs-card-cap-bg: transparent; --bs-card-border-color: var(--line);
  --bs-border-radius: var(--r); --bs-border-radius-sm: var(--r-sm); --bs-border-radius-lg: var(--r-lg);
  --bs-emphasis-color-rgb: 255,255,255;
  color-scheme: dark;
}

* { scrollbar-width: thin; scrollbar-color: #2b2b30 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #27272c; border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #35353c; background-clip: padding-box; }

body {
  font-family: var(--sans);
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: var(--fs-14); line-height: 1.5; letter-spacing: -.006em;
  font-feature-settings: "cv01","ss03";
}
::selection { background: rgba(var(--accent-rgb), .30); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.of-skip { position: absolute; left: .75rem; top: -3rem; z-index: 100; padding: .45rem .7rem; background: var(--solid); color: var(--on-solid); border-radius: var(--r-sm); font-size: var(--fs-14); font-weight: 600; }
.of-skip:focus { top: .75rem; color: var(--on-solid); }
main[tabindex="-1"]:focus { outline: none; }
h1,h2,h3,h4,h5,h6 { letter-spacing: -.02em; font-weight: 600; color: var(--text-strong); }
.h6, h6 { font-size: var(--fs-13); text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; }
a { color: var(--bs-link-color); text-decoration: none; }
a:hover { color: var(--text-strong); }
.text-secondary { color: var(--text-2) !important; }
small, .small { font-size: var(--fs-12); }
code:not(.of-json) { font-family: var(--mono); font-size: .85em; color: var(--bs-code-color); background: var(--hover-2); padding: .1em .42em; border-radius: 5px; }
.font-mono, .of-mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }

/* ---- shell ---------------------------------------------------------------- */
.of-app { display: flex; min-height: 100vh; }
.of-sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--sidebar); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.of-brand { display: flex; align-items: center; gap: 0; padding: 1.15rem 1.15rem .9rem; }
.of-brand-logo { height: 21px; width: auto; display: block; }
.of-brand-black { display: none; } .of-brand-white { display: block; }

.of-nav-scroll { flex: 1; overflow-y: auto; padding: .35rem .6rem 1rem; }
.of-nav { display: flex; flex-direction: column; gap: 1px; }
.of-nav-group { margin-top: 1.25rem; }
.of-nav-group:first-child { margin-top: .5rem; }
.of-nav-label { display: block; padding: .3rem .65rem .4rem; font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .11em; color: var(--text-3); }
.of-sidebar .nav-link { display: flex; align-items: center; gap: .65rem; color: var(--text-2); padding: .46rem .65rem; border-radius: var(--r-sm); font-size: var(--fs-14); font-weight: 500; position: relative; transition: color .12s, background .12s; }
.of-sidebar .nav-link svg { width: 16px; height: 16px; opacity: .75; flex: 0 0 16px; transition: opacity .12s; }
.of-sidebar .nav-link:hover { color: var(--text); background: var(--hover); }
.of-sidebar .nav-link:hover svg { opacity: 1; }
.of-sidebar .nav-link.active { color: var(--text-strong); background: var(--hover-2); font-weight: 550; }
.of-sidebar .nav-link.active svg { opacity: 1; color: var(--accent); }
.of-sidebar .nav-link.active::before { content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%); width: 2px; height: 1.15rem; border-radius: 0 2px 2px 0; background: var(--accent); }
.of-sidebar-foot { padding: .75rem 1.15rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; font-size: var(--fs-11); color: var(--text-3); font-family: var(--mono); }
.of-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(var(--green-rgb), .14); flex: 0 0 auto; }
.of-dot-live { animation: of-dot-pulse 1.6s ease-in-out infinite; }
@keyframes of-dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .of-dot-live { animation: none; } }

.of-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.of-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.75rem; background: rgba(9,9,11,.82); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.of-header-left { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.of-eyebrow { display: none; }
.of-title { font-size: var(--fs-17); font-weight: 600; margin: 0; color: var(--text-strong); letter-spacing: -.02em; }
.of-header-right { display: flex; align-items: center; gap: .5rem; }

.of-userchip { display: flex; align-items: center; gap: .55rem; padding-left: .4rem; margin-left: .15rem; }
.of-avatar { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 600; font-size: var(--fs-13); color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); }
.of-usermeta { display: flex; flex-direction: column; line-height: 1.25; }
.of-usermeta strong { font-size: var(--fs-13); color: var(--text); font-weight: 600; }
.of-role { font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 0; background: none; }
.of-role-admin { color: var(--amber); } .of-role-user { color: var(--text-3); }

.of-iconbtn { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .6rem; background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text-2); transition: color .12s, background .12s, border-color .12s; }
.of-iconbtn:hover { color: var(--text); background: var(--hover); border-color: var(--line-2); }
.of-iconbtn svg { width: 16px; height: 16px; }
.of-kbd { font-family: var(--mono); font-size: var(--fs-11); color: var(--text-3); border: 1px solid var(--line); border-radius: 4px; padding: .02rem .3rem; }
@media (max-width: 992px) { .of-cmdk-trigger .of-kbd { display: none; } }
.of-theme-sun { display: none; } .of-theme-moon { display: inline-flex; }
:root[data-bs-theme="light"] .of-theme-sun { display: inline-flex; } :root[data-bs-theme="light"] .of-theme-moon { display: none; }
.of-bell { position: relative; }
.of-bell-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: var(--fs-11); font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

.of-content { padding: 1.75rem 1.75rem 4rem; max-width: 1520px; width: 100%; }
.of-content > h1:first-child, .of-content > .h3:first-child { margin-bottom: 1.1rem; }

/* ---- cards: subtle elevation, crafted headers ----------------------------- */
.card, .of-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: .85rem 1.1rem; font-weight: 600; font-size: var(--fs-14); color: var(--text-strong); letter-spacing: -.01em; }
.card-body { padding: 1.1rem; }
.card-header + .table-responsive > .table > thead th, .card-header + .table > thead th { border-top: 0; }

/* ---- KPI / stat tiles ----------------------------------------------------- */
.text-secondary.small { color: var(--text-3) !important; font-weight: 500; }
[data-testid="dashboard-stats"] .card-body, .of-kpis .card-body { padding: .95rem 1.05rem; }
[data-testid="dashboard-stats"] .text-secondary.small, .of-kpis .text-secondary.small { text-transform: uppercase; letter-spacing: .07em; font-size: var(--fs-11); }
.of-stat { font-size: var(--fs-30); font-weight: 600; line-height: 1.05; margin-top: .3rem; color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
[data-testid="dashboard-stats"] .of-card, .of-kpis .of-card { transition: border-color .12s, box-shadow .12s; }
[data-testid="dashboard-stats"] .of-card:hover, .of-kpis .of-card:hover { border-color: var(--line-2); }
.of-stat-sub { font-size: var(--fs-12); color: var(--text-3); margin-top: .2rem; }

/* ---- tables: the operational core ----------------------------------------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); color: var(--text); margin-bottom: 0; border-color: var(--line); }
.table > thead th { position: sticky; top: 0; background: var(--surface); color: var(--text-3); font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); padding: .6rem 1rem; white-space: nowrap; z-index: 1; }
.table > :not(caption) > * > * { padding: .62rem 1rem; border-bottom-color: var(--line); background: transparent; vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .46rem .8rem; }
.table > tbody > tr { transition: background .1s; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table-of > tbody > tr:nth-of-type(even) > * { background: var(--zebra); }
.table-of > tbody > tr:hover > *, .table-hover > tbody > tr:hover > * { background: var(--hover); color: var(--text); }
.table a { color: var(--bs-link-color); font-weight: 500; } .table a:hover { color: var(--text-strong); }
.table .small, td.small { color: var(--text-2); }
.table td.num, .table th.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
/* A KPI tile's headline number reads left like the dashboard's, even when it also carries .num. */
.of-stat.num { text-align: start; }
.table-responsive { border-radius: var(--r); }

/* ---- buttons -------------------------------------------------------------- */
.btn { --bs-btn-border-radius: var(--r-sm); --bs-btn-padding-y: .44rem; --bs-btn-padding-x: .8rem; font-weight: 550; font-size: var(--fs-14); letter-spacing: -.005em; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .6rem; font-size: var(--fs-13); }
.btn-primary { --bs-btn-color: var(--on-solid); --bs-btn-bg: var(--solid); --bs-btn-border-color: var(--solid); --bs-btn-hover-bg: var(--solid-hover); --bs-btn-hover-border-color: var(--solid-hover); --bs-btn-hover-color: var(--on-solid); --bs-btn-active-bg: #d4d4d8; --bs-btn-active-border-color: #d4d4d8; --bs-btn-active-color: var(--on-solid); box-shadow: var(--shadow-sm); }
.btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); --bs-btn-hover-bg: #e2493f; --bs-btn-hover-border-color: #e2493f; --bs-btn-active-bg: #d33f36; }
.btn-success { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-color: #04230f; --bs-btn-hover-bg: #2fb95f; --bs-btn-hover-color: #04230f; }
.btn-outline-light, .of-logout { --bs-btn-color: var(--text-2); --bs-btn-border-color: var(--line-2); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: var(--line-2); --bs-btn-hover-color: var(--text-strong); }
.btn-outline-secondary { --bs-btn-color: var(--text-2); --bs-btn-border-color: var(--line-2); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-color: var(--text-strong); --bs-btn-hover-border-color: var(--line-2); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: rgba(var(--accent-rgb), .45); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: #fff; }
.of-logout svg { width: 15px; height: 15px; }

/* ---- badges --------------------------------------------------------------- */
.badge { font-weight: 600; font-size: var(--fs-11); letter-spacing: .01em; padding: .34em .55em; border-radius: 5px; }
.text-bg-success { background: rgba(var(--green-rgb), .14) !important; color: #63d98f !important; }
.text-bg-danger  { background: rgba(var(--red-rgb), .14) !important;  color: #f78b84 !important; }
.text-bg-warning { background: rgba(var(--amber-rgb), .14) !important; color: #edbb6b !important; }
.text-bg-secondary { background: var(--hover-2) !important; color: var(--text-2) !important; }
.text-bg-info { background: rgba(var(--blue-rgb), .14) !important; color: #8bb6f6 !important; }
.text-bg-primary { background: rgba(var(--accent-rgb), .15) !important; color: #a0c2ff !important; }

/* ---- forms ---------------------------------------------------------------- */
.form-label { font-size: var(--fs-13); font-weight: 550; color: var(--text-2); margin-bottom: .35rem; }
.form-control, .form-select { background: #0d0d0f; border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r-sm); padding: .5rem .7rem; font-size: var(--fs-14); }
.form-control::placeholder { color: var(--text-3); }
.form-control:focus, .form-select:focus { background: #0d0d0f; border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.form-control-sm, .form-select-sm { font-size: var(--fs-13); padding: .32rem .55rem; }
.form-check-input { background-color: #0d0d0f; border-color: var(--line-2); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.input-group-text { background: var(--surface-2); border-color: var(--line-2); color: var(--text-2); }
.form-text { color: var(--text-3); }

/* ---- alerts --------------------------------------------------------------- */
.alert { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: var(--fs-14); }
.alert-success { background: rgba(var(--green-rgb), .07); border-color: rgba(var(--green-rgb), .22); }
.alert-danger  { background: rgba(var(--red-rgb), .07);   border-color: rgba(var(--red-rgb), .22); }
.alert-warning { background: rgba(var(--amber-rgb), .07); border-color: rgba(var(--amber-rgb), .22); }
.alert-info    { background: rgba(var(--blue-rgb), .07);  border-color: rgba(var(--blue-rgb), .22); }

/* ---- tabs ----------------------------------------------------------------- */
.nav-tabs { border-bottom: 1px solid var(--line); gap: .15rem; }
.nav-tabs .nav-link { color: var(--text-2); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .55rem .9rem; font-weight: 550; font-size: var(--fs-14); }
.nav-tabs .nav-link:hover { color: var(--text-strong); border-bottom-color: var(--line-2); }
.nav-tabs .nav-link.active { color: var(--text-strong); background: transparent; border-bottom-color: var(--accent); }

/* ---- misc ----------------------------------------------------------------- */
details > summary { cursor: pointer; color: var(--text-2); }
details > summary:hover { color: var(--text); }
.of-bare-main { max-width: 23rem; margin: 11vh auto; padding: 0 1rem; }
.of-bare-main .card, .of-bare-main .of-card { box-shadow: var(--shadow-pop); }
.of-bare-tools { position: absolute; top: 1rem; right: 1rem; }
.of-bare-brand { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.of-bare-brand .of-brand-logo { height: 24px; }
.of-caps { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; font-size: var(--fs-12); font-weight: 500; color: var(--text-2); }
.of-caps::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex: none; }
.of-caps:empty { margin: 0; }
.of-caps:empty::before { display: none; }
.of-qr { background: #fff; padding: 11px; border-radius: var(--r); image-rendering: pixelated; max-width: 240px; }
.of-secret { font-family: var(--mono); font-size: var(--fs-15); letter-spacing: .06em; color: var(--text); background: var(--hover); padding: .4rem .65rem; border-radius: var(--r-sm); display: inline-block; }
pre.of-json { background: #0c0c0e; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .85rem; max-height: 24rem; overflow: auto; font-size: var(--fs-12); color: #c3c9d4; white-space: pre-wrap; word-break: break-all; font-family: var(--mono); }
hr { border-color: var(--line); opacity: 1; }
.list-group-item { background: transparent; border-color: var(--line); color: var(--text); }
.of-mw-18{max-width:18rem}.of-mw-36{max-width:36rem}.of-mw-40{max-width:40rem}.of-mw-48{max-width:48rem}.of-w-2{width:2rem}

/* ---- command palette ------------------------------------------------------ */
.of-cmdk { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding-top: 13vh; background: rgba(0,0,0,.6); }
.of-cmdk-box { width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-pop); }
.of-cmdk-head { display: flex; align-items: center; gap: .55rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.of-cmdk-head svg { width: 17px; height: 17px; color: var(--text-3); flex: 0 0 17px; }
.of-cmdk-input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-size: var(--fs-15); }
.of-cmdk-input::placeholder { color: var(--text-3); }
.of-cmdk-list { list-style: none; margin: 0; padding: .4rem; max-height: 52vh; overflow-y: auto; }
.of-cmdk-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .7rem; border-radius: var(--r-sm); cursor: pointer; color: var(--text); font-size: var(--fs-14); }
.of-cmdk-item small { color: var(--text-3); font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .06em; }
.of-cmdk-item.active, .of-cmdk-item:hover { background: var(--hover-2); }
.of-cmdk-empty { padding: 1rem; color: var(--text-3); text-align: center; }

/* ---- searchable multi-select ([data-multiselect] enhanced by app.js) ------ */
.of-ms-ui { position: relative; }
.of-ms-control { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-height: 34px; padding: .25rem .4rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: text; }
.of-ms-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .18); }
.of-ms-chips { display: contents; }
.of-ms-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .15rem .1rem .45rem; background: var(--hover-2); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-12); color: var(--text-strong); }
.of-ms-chip-x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .18rem; border-radius: 3px; }
.of-ms-chip-x:hover { color: var(--text-strong); background: var(--hover); }
.of-ms-input { flex: 1 1 7rem; min-width: 5rem; border: 0; outline: none; background: transparent; color: var(--text); font-size: var(--fs-13); padding: .2rem; }
.of-ms-input::placeholder { color: var(--text-3); }
.of-ms-menu { list-style: none; margin: .25rem 0 0; padding: .3rem; position: absolute; z-index: 30; left: 0; right: 0; max-height: 15rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); }
.of-ms-opt { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: var(--r-sm); cursor: pointer; color: var(--text); font-size: var(--fs-13); }
.of-ms-opt .of-ms-opt-nm { flex: 1 1 auto; }
.of-ms-opt small { color: var(--text-3); font-size: var(--fs-11); }
.of-ms-opt .of-ms-tick { width: .9rem; text-align: center; color: var(--accent); }
.of-ms-opt.active, .of-ms-opt:hover { background: var(--hover-2); }
.of-ms-opt.sel .of-ms-opt-nm { color: var(--text-strong); }
.of-ms-empty { padding: .5rem .55rem; color: var(--text-3); font-size: var(--fs-13); }
.of-ms-foot { display: flex; align-items: center; gap: .7rem; margin-top: .35rem; }
.of-ms-act { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: var(--fs-12); padding: 0; }
.of-ms-act:hover { text-decoration: underline; }
.of-ms-count { margin-left: auto; color: var(--text-3); font-size: var(--fs-12); }
/* Searchable single-select (select[data-searchable]): a combobox input in front of the hidden native select. */
.of-ss { position: relative; display: inline-block; min-width: 14rem; max-width: 100%; }
.of-ss-input { padding-right: 1.6rem; text-overflow: ellipsis; }
.of-ss-caret { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: var(--fs-11); cursor: pointer; }
.of-ss-menu { min-width: 100%; right: auto; width: max-content; max-width: min(28rem, 90vw); }
.of-ss-group { padding: .45rem .55rem .2rem; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ---- toasts --------------------------------------------------------------- */
.of-toasts { position: fixed; top: 4.3rem; right: 1.1rem; z-index: 90; display: flex; flex-direction: column; gap: .5rem; max-width: 360px; }
.of-toast { display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font-size: var(--fs-14); box-shadow: var(--shadow-pop); }
.of-toast.hide { opacity: 0; transform: translateX(10px); transition: opacity .22s, transform .22s; }
.of-toast-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--text-3); }
.of-toast-success .of-toast-dot { background: var(--green); }
.of-toast-danger  .of-toast-dot { background: var(--red); }
.of-toast-warning .of-toast-dot { background: var(--amber); }
.of-toast-info    .of-toast-dot { background: var(--blue); }
.of-toast-close { margin-left: auto; background: transparent; border: 0; color: var(--text-3); cursor: pointer; font-size: 1.05rem; line-height: 1; }

/* ---- dashboard meters + charts (CSP-safe inline SVG) ---------------------- */
.of-meter { height: 5px; border-radius: 3px; background: var(--ink-faint); overflow: hidden; min-width: 64px; }
.of-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--text-2); }
.of-meter-ok > span { background: var(--green); } .of-meter-warn > span { background: var(--amber); } .of-meter-crit > span { background: var(--red); }
.of-spark { display: block; width: 100%; height: 58px; overflow: visible; }
.of-spark-ok { fill: var(--green); } .of-spark-part { fill: var(--amber); } .of-spark-fail { fill: var(--red); }
.of-spark-run { fill: var(--text-3); } .of-spark-empty, .of-spark-axis { fill: var(--line-2); }
.of-spark-hit { fill: transparent; }
.of-spark a:hover .of-spark-hit { fill: var(--line); }
.of-spark a:focus { outline: none; }
.of-spark a:focus-visible .of-spark-hit { fill: rgba(var(--accent-rgb), .14); stroke: var(--accent); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.of-key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.of-key-ok { background: var(--green); } .of-key-part { background: var(--amber); } .of-key-fail { background: var(--red); } .of-key-run { background: var(--text-3); }
.of-key-info { background: var(--blue); }
.of-chart { display: block; width: 100%; height: auto; max-height: 160px; }
.of-chart-grid { stroke: var(--line); stroke-width: 1; }
.of-chart-axis { stroke: var(--line-2); stroke-width: 1; }
.of-chart-tick { fill: var(--text-3); font-size: 8px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.of-chart-val { fill: var(--text); font-size: 9px; font-weight: 600; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.of-chart-now { fill: var(--text-2); font-weight: 600; }
.of-chart-cat { fill: var(--text-2); }
.of-chart-critical { fill: var(--red); } .of-chart-warning { fill: var(--amber); } .of-chart-info { fill: var(--blue); }
.of-chart g:hover .of-spark-hit, .of-chart a:hover .of-spark-hit { fill: var(--line); }
.of-chart a:focus { outline: none; }
.of-chart a:focus-visible .of-spark-hit { fill: rgba(var(--accent-rgb), .14); stroke: var(--accent); stroke-width: 1.5px; }
.of-trend-line { fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.of-trend-dot { stroke: var(--surface); stroke-width: 1.5; }
.of-trend-ok { fill: var(--green); } .of-trend-warn { fill: var(--amber); } .of-trend-crit { fill: var(--red); }
.of-sparkcell { display: inline-flex; align-items: center; gap: .5rem; }
.of-sparkline { display: block; width: 96px; height: 24px; flex: 0 0 96px; overflow: visible; }
.of-metric-num { font-variant-numeric: tabular-nums; font-size: var(--fs-13); color: var(--text-2); min-width: 2.4rem; display: inline-block; }
.of-pct-0{width:0}.of-pct-5{width:5%}.of-pct-10{width:10%}.of-pct-15{width:15%}.of-pct-20{width:20%}.of-pct-25{width:25%}.of-pct-30{width:30%}.of-pct-35{width:35%}.of-pct-40{width:40%}.of-pct-45{width:45%}.of-pct-50{width:50%}.of-pct-55{width:55%}.of-pct-60{width:60%}.of-pct-65{width:65%}.of-pct-70{width:70%}.of-pct-75{width:75%}.of-pct-80{width:80%}.of-pct-85{width:85%}.of-pct-90{width:90%}.of-pct-95{width:95%}.of-pct-100{width:100%}
.of-sev-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.of-sev-critical { background: var(--red); } .of-sev-warning { background: var(--amber); } .of-sev-info { background: var(--blue); }
.of-host-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: .4rem; }
.of-up { background: var(--green); box-shadow: 0 0 0 3px rgba(var(--green-rgb), .13); } .of-down { background: var(--red); box-shadow: 0 0 0 3px rgba(var(--red-rgb), .13); }

/* ---- table pagination ----------------------------------------------------- */
[hidden] { display: none !important; }
.of-pager { display: flex; align-items: center; gap: .55rem; padding: .7rem .1rem .2rem; font-size: var(--fs-13); color: var(--text-2); }
.of-pager-info { margin-right: auto; font-variant-numeric: tabular-nums; }
.of-pager-pos { font-variant-numeric: tabular-nums; color: var(--text-3); }
.of-pager-btn { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); border-radius: var(--r-sm); padding: .28rem .7rem; font-size: var(--fs-13); font-weight: 550; cursor: pointer; }
.of-pager-btn:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.of-pager-btn:disabled { opacity: .4; cursor: default; }

/* ---- responsive ----------------------------------------------------------- */
.of-navtoggle { display: none; background: transparent; border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r-sm); width: 34px; height: 34px; align-items: center; justify-content: center; }
.of-navtoggle svg { width: 17px; height: 17px; }
@media (max-width: 992px) {
  .of-navtoggle { display: inline-flex; }
  .of-sidebar { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  body.of-nav-open .of-sidebar { transform: translateX(0); }
  body.of-nav-open::after { content: ""; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); }
  .of-content { padding: 1.25rem 1.1rem 3rem; }
  .of-header { padding: .75rem 1.1rem; }
  .of-usermeta { display: none; }
}

/* ============================================================================
   Light theme — warm-white, same system; crafted, not inverted.
   ========================================================================== */
:root[data-bs-theme="light"] {
  --bg: #fbfbfc; --surface: #ffffff; --surface-2: #f6f6f8; --sidebar: #fafafb;
  --line: rgba(9,9,11,.085); --line-2: rgba(9,9,11,.14);
  --text: #1a1a1f; --text-2: #585863; --text-3: #8a8a95; --text-strong: #09090b;
  --hover: rgba(9,9,11,.04); --hover-2: rgba(9,9,11,.06); --ink-faint: rgba(9,9,11,.08);
  --solid: #18181b; --solid-hover: #2a2a2e; --on-solid: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --shadow-pop: 0 14px 40px rgba(16,24,40,.14), 0 3px 10px rgba(16,24,40,.08);
  --zebra: rgba(9,9,11,.018);
  color-scheme: light;
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-emphasis-color: #000;
  --bs-secondary-color: var(--text-2); --bs-secondary-bg: var(--surface-2); --bs-tertiary-bg: var(--surface-2);
  --bs-heading-color: #09090b; --bs-border-color: var(--line); --bs-border-color-translucent: var(--line);
  --bs-link-color: #334155; --bs-link-hover-color: #000; --bs-code-color: #334155;
  --bs-card-bg: #fff; --bs-card-border-color: var(--line);
}
:root[data-bs-theme="light"] body { background: var(--bg); }
:root[data-bs-theme="light"] .of-header { background: rgba(251,251,252,.82); }
:root[data-bs-theme="light"] .of-title { color: #09090b; }
:root[data-bs-theme="light"] .of-stat { color: #09090b; }
:root[data-bs-theme="light"] .table > thead th { background: var(--surface); }
:root[data-bs-theme="light"] .form-control, :root[data-bs-theme="light"] .form-select { background: #fff; color: var(--text); }
:root[data-bs-theme="light"] .form-control:focus, :root[data-bs-theme="light"] .form-select:focus { background: #fff; }
:root[data-bs-theme="light"] code:not(.of-json) { background: rgba(9,9,11,.05); }
:root[data-bs-theme="light"] pre.of-json { background: #f5f5f7; color: #27272a; }
:root[data-bs-theme="light"] .of-avatar { background: #f1f1f3; }
:root[data-bs-theme="light"] .of-brand-black { display: block; }
:root[data-bs-theme="light"] .of-brand-white { display: none; }
:root[data-bs-theme="light"] .btn-outline-secondary,
:root[data-bs-theme="light"] .btn-outline-light,
:root[data-bs-theme="light"] .of-logout { --bs-btn-hover-bg: rgba(9,9,11,.05); --bs-btn-hover-color: #09090b; --bs-btn-active-bg: rgba(9,9,11,.08); --bs-btn-active-color: #09090b; }
:root[data-bs-theme="light"] .text-bg-success { color: #157a3c !important; }
:root[data-bs-theme="light"] .text-bg-danger  { color: #b42318 !important; }
:root[data-bs-theme="light"] .text-bg-warning { color: #8a5a00 !important; }
:root[data-bs-theme="light"] .text-bg-info    { color: #1d5bbf !important; }
:root[data-bs-theme="light"] .text-bg-primary { color: #2b5dc7 !important; }
:root[data-bs-theme="light"] .of-trend-dot { stroke: #fff; }

/* ---- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .of-header { backdrop-filter: none; }
}

.of-search { min-width: 220px; max-width: 300px; }
/* Compact key/value list inside a table cell (audit details): label muted, value mono, one pair per line. */
.of-kv { margin: 0; min-width: 14rem; }
.of-kv > div { display: flex; gap: .45rem; line-height: 1.45; }
.of-kv dt { flex: 0 0 auto; font-weight: 500; color: var(--text-3); }
.of-kv dd { margin: 0; min-width: 0; font-family: var(--mono); color: var(--text); overflow-wrap: anywhere; }
