/* Krinos Admin Hub — server-rendered admin UI. One cohesive dark theme (light fallback via prefers-color-scheme). */
:root {
  --bg: #0a0e16; --bg2: #0d121c; --panel: #121825; --panel2: #0e1420; --raise: #182236;
  --line: #202a3c; --line2: #2a3752; --text: #e8eef7; --muted: #909cb2; --faint: #66728a;
  --accent: #4f8cff; --accent2: #3b6fe0; --accent-ghost: #16243f;
  --ok: #34d399; --ok-bg: #0d2a20; --ok-line: #176048;
  --warn: #fbbf24; --warn-bg: #1c1810; --warn-line: #5c4a1e; --bad: #f87171; --bad-bg: #2a1215; --bad-line: #7f2c2c;
  --radius: 12px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --nav-w: 250px; --top-h: 58px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1f6; --bg2: #e7ebf2; --panel: #ffffff; --panel2: #f4f6fa; --raise: #eef2f8;
    --line: #dde3ec; --line2: #cbd4e1; --text: #141a26; --muted: #5a6577; --faint: #8a94a6;
    --accent: #2f6bff; --accent2: #2559e0; --accent-ghost: #e8f0ff;
    --ok: #0f9d6b; --ok-bg: #e6f7ef; --ok-line: #9bdcc1;
    --warn: #b7791f; --warn-bg: #fdf3e0; --warn-line: #e8cfa0; --bad: #d64545; --bad-bg: #fdecec; --bad-line: #f1b9b9;
    --shadow: 0 1px 2px rgba(20,30,60,.06), 0 10px 30px rgba(20,30,60,.08);
    --shadow-sm: 0 1px 2px rgba(20,30,60,.08);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { width: 18px; height: 18px; flex: none; }
.muted, .sub { color: var(--muted); }
.faint { color: var(--faint); }
.small-text { font-size: 12px; }

/* buttons */
button, .btn { font: inherit; cursor: pointer; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--accent2); color: #fff; padding: 8px 14px; font-weight: 550; transition: background .12s, border-color .12s, transform .04s, box-shadow .12s; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { background: var(--accent); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent2); }
button.primary:hover { background: var(--accent); }
button.wide { width: 100%; justify-content: center; margin-top: 14px; padding: 10px; }
button.ghost, .btn.ghost, a.ghost, a.ghost.btn { background: transparent; color: var(--text); border-color: var(--line2); }
button.ghost:hover, .btn.ghost:hover, a.ghost:hover, a.ghost.btn:hover { background: var(--raise); border-color: var(--accent); color: var(--text); }
button.small, .btn.small, a.ghost.small, a.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
button.danger, .btn.danger { background: transparent; color: #fecaca; border-color: var(--bad-line); }
button.danger:hover { background: var(--bad-bg); color: #fff; border-color: var(--bad); }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn { padding: 5px 9px; }

/* forms */
input, select, textarea { font: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 8px 11px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input::placeholder { color: var(--faint); }
label { display: block; margin: 10px 0; font-size: 12px; color: var(--muted); font-weight: 550; }
label input, label select { margin-top: 5px; font-weight: 400; color: var(--text); }
.error { color: var(--bad); min-height: 1.2em; font-size: 13px; margin-top: 10px; }

/* ---- login ---- */
.login-body { background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.login { display: grid; place-items: center; min-height: 100%; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 30px; width: 100%; max-width: 380px; box-shadow: var(--shadow); text-align: left; }
.login-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; }
.brand-mark.lg svg { width: 30px; height: 30px; }
.login-card h1 { margin: 0 0 2px; font-size: 22px; font-weight: 650; text-align: center; }
.login-card h1 b { color: var(--accent); font-weight: 650; }
.login-card .sub { text-align: center; margin: 0 0 18px; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100%; }
.nav { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; color: var(--text); font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-name b { color: var(--accent); }
.nav-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.app-group { margin-bottom: 14px; }
.app-label { display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 8px 10px 4px; font-weight: 650; }
.app-label .ico { width: 15px; height: 15px; opacity: .85; }
.nav a.item { display: block; padding: 8px 11px; border-radius: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; position: relative; }
.nav a.item:hover { background: var(--raise); color: var(--text); text-decoration: none; }
.nav a.item.active { background: var(--accent-ghost); color: var(--text); font-weight: 600; }
.nav a.item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 650; font-size: 13px; flex: none; }
.who { flex: 1; min-width: 0; line-height: 1.25; }
.who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 11px; color: var(--faint); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--top-h); padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); }
.topbar-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs h2 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumb .ico { width: 15px; height: 15px; }
.crumb-sep { color: var(--faint); }
.nav-toggle { display: none; }
.nav-scrim { display: none; }
.view { padding: 22px; overflow: auto; }
@media (min-width: 1100px) { .view { padding: 24px 28px; } }

/* ---- cards + tables ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 12px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.view > h3 { font-size: 17px; margin: 2px 0 14px; }
.stack label { display: block; }
.stack > div { margin-top: 10px; }
a.tile, .tile { display: block; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; }
a.tile:hover { border-color: var(--accent); text-decoration: none; }
form.inline { display: inline-block; }
form.inline + form.inline { margin-left: 4px; }
td .item, td a.item { display: inline; padding: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 9px 12px; color: var(--faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line2); white-space: nowrap; }
tbody td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel2); }
.card > table { margin: 0 -2px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line2); color: var(--muted); background: var(--panel2); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.badge.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.badge.ok::before, .badge.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.grid > div:not(.stat):not(.tile):not(.card) { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; }
.grid > div > .muted, .grid > div > span.muted { font-size: 11px; display: block; margin-bottom: 2px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 2px; }
pre { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 60vh; color: var(--text); }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.notice { color: var(--muted); padding: 12px 14px; border: 1px dashed var(--line2); border-radius: var(--radius-sm); background: var(--panel2); margin-bottom: 14px; }
.notice-bad { color: var(--bad); padding: 10px 12px; border: 1px solid var(--bad-line); border-radius: var(--radius-sm); background: var(--bad-bg); margin: 0 0 14px; font-size: 13px; }
.field { margin: 0 0 12px; } .field-l { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.perm-pill { display: inline-block; font-size: 11px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 7px; margin: 2px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.checks label { display: flex; gap: 7px; align-items: center; margin: 3px 0; color: var(--text); font-size: 12.5px; }
.checks label input { width: auto; margin: 0; }

/* ---- request-detail popup ---- */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; background: rgba(0,0,0,.55); overflow: auto; }
.modal-overlay.open { display: flex; }
.modal-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 820px; box-shadow: var(--shadow); }
.modal-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); border-radius: 14px 14px 0 0; }
.modal-content { padding: 16px 18px; }
.modal-content .card { box-shadow: none; }
body.modal-open { overflow: hidden; }

/* ---- collapsible endpoint rows (details/summary) ---- */
.ep-list { display: flex; flex-direction: column; }
details.ep { border-bottom: 1px solid var(--line); }
details.ep:last-child { border-bottom: 0; }
details.ep > summary { display: grid; grid-template-columns: 1fr 300px auto; gap: 12px; align-items: center; padding: 9px 4px; cursor: pointer; list-style: none; }
details.ep > summary::-webkit-details-marker { display: none; }
details.ep > summary:hover { background: var(--panel2); }
.ep-route { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-route::before { content: "▸"; color: var(--faint); font-size: 11px; margin-right: 8px; transition: transform .12s; display: inline-block; }
details.ep[open] .ep-route::before { transform: rotate(90deg); }
.ep-route code { background: none; border: 0; padding: 0; font-size: 12.5px; }
.ep-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ep-body { padding: 6px 4px 14px 18px; }
.ep-body .kv { margin-bottom: 12px; }
.ep-recent-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 650; margin: 6px 0 6px; }
.ep-recent { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ep-recent table { font-size: 12.5px; }
.ep-recent thead th { position: sticky; top: 0; background: var(--panel); }
.ep-recent code { background: none; border: 0; padding: 0; }
.ep-err { justify-self: end; }
.ep-badges { justify-self: end; display: inline-flex; gap: 6px; align-items: center; }
.badge.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
@media (max-width: 760px) { details.ep > summary { grid-template-columns: 1fr; gap: 6px; } .ep-bars { grid-template-columns: 1fr 1fr; } }

/* ---- mini bar graph (per-endpoint count / latency) ---- */
.mbar { position: relative; height: 22px; min-width: 90px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mbar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px 0 0 6px; }
.mbar.c > span { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.mbar.p > span { background: color-mix(in srgb, var(--warn) 34%, transparent); }
.mbar > em { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 8px; font-style: normal; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
td:has(> .mbar) { min-width: 140px; }

/* ---- key/value list (status, backfill, details) ---- */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin: 0; }
@media (max-width: 620px) { .kv { grid-template-columns: 1fr; } }
.kv > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv dt { margin: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.kv dd { margin: 0; font-weight: 550; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.kv dd code { font-weight: 400; }

/* ---- workspace detail: header + tab bar ---- */
.ws-head { margin-bottom: 18px; }
.ws-head h3 { font-size: 20px; font-weight: 650; }
.tabs { display: flex; gap: 2px; margin-top: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 9px 15px; color: var(--muted); font-size: 13.5px; font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; background: var(--panel2); border-top-left-radius: 7px; border-top-right-radius: 7px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- monitoring: graph + live log + in-flight ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.cg-controls { margin-bottom: 10px; }
/* Reusable control toolbar (graph / rate graph / log filters) — one cohesive bar instead of loose controls */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.toolbar .ctl { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.toolbar .ctl select, .toolbar .ctl input[type="number"], .toolbar select, .toolbar input[type="number"] { width: auto; padding: 5px 9px; font-size: 12px; margin: 0; }
.toolbar .toggle { cursor: pointer; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); transition: border-color .12s, background .12s; }
.toolbar .toggle:hover { border-color: var(--accent); } .toolbar .toggle input { margin: 0; accent-color: var(--accent); }
.status-dot { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse-dot 2.2s infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.cg-canvas { width: 100%; height: 360px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
#cg-card:fullscreen { background: var(--bg); padding: 16px; overflow: hidden; }
#cg-card:fullscreen .cg-canvas { height: calc(100vh - 70px); }
.log-filter { margin-bottom: 0; }
.log-filters .log-filter { flex: 1 1 220px; min-width: 160px; }
.log-filters select, .log-filters .f-minms { width: auto; padding: 7px 9px; font-size: 12.5px; }
.log-filters .f-minms { max-width: 96px; }
.log-filters #f-count { margin-left: auto; }
.rate-canvas { width: 100%; height: 150px; display: block; }
.rate-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.rate-key { display: inline-flex; align-items: center; gap: 6px; }
.rate-key i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sum-wrap { max-height: 360px; overflow: auto; }
.sum-table { width: 100%; font-size: 12.5px; }
.sum-table code { background: none; border: 0; padding: 0; }
.sum-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.matrix th, .matrix td { padding: 4px 8px; text-align: center; border: 1px solid var(--line); white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.matrix .mx-h, .matrix .mx-c { text-align: left; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.matrix .mx-c { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
.matrix .mx-v { color: var(--text); } .matrix .mx-t { font-weight: 650; }
.st-path { margin-top: 6px; font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rate-controls #rate-stat { margin-left: auto; }
/* API catalog on the stress page */
.api-grp { border-bottom: 1px solid var(--line); }
.api-grp > summary { cursor: pointer; padding: 7px 4px; font-weight: 600; font-size: 13px; }
.api-list { max-height: 320px; overflow: auto; padding: 2px 0 8px; }
.api-row { display: flex; align-items: center; gap: 9px; padding: 3px 6px; border-radius: 6px; font-size: 12.5px; }
.api-row code { background: none; border: 0; padding: 0; }
.api-row.api-get { cursor: pointer; } .api-row.api-get:hover { background: var(--accent-ghost); }
.api-row:not(.api-get) { opacity: .5; }
.api-m { display: inline-block; min-width: 48px; text-align: center; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line2); color: var(--muted); }
.api-m-get { color: var(--ok); border-color: var(--ok-line); }
.api-m-post { color: var(--accent); border-color: var(--accent); }
.api-m-put, .api-m-patch { color: var(--warn); border-color: var(--warn-line); }
.api-m-delete { color: var(--bad); border-color: var(--bad-line); }
.req-log { height: 360px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; }
.log-row { display: grid; grid-template-columns: 76px 90px 52px 1fr 110px 48px 56px; gap: 6px; padding: 2px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.log-row > span { overflow: hidden; text-overflow: ellipsis; }
.log-row .lt { color: var(--faint); } .log-row .ls { color: #7c93b8; } .log-row .lm { color: #93c5fd; } .log-row .lr { color: var(--text); } .log-row .lc { color: #a78bfa; } .log-row .lms { color: var(--muted); text-align: right; }
.lstat { text-align: right; } .lstat.ok { color: var(--ok); } .lstat.warn { color: var(--warn); } .lstat.err, .lstat.blocked { color: var(--bad); }
.log-row.err, .log-row.blocked { background: var(--bad-bg); } .log-row.warn { background: var(--warn-bg); }
.log-row.log-click { cursor: pointer; } .log-row.log-click:hover { background: var(--line); }
.inflight { height: 260px; overflow: auto; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.if-row { display: grid; grid-template-columns: 100px 54px 1fr 120px 70px; gap: 8px; padding: 2px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.cg-win-l { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); }
.cg-win-l select.small { width: auto; padding: 4px 8px; font-size: 12px; }
.if-row > span { overflow: hidden; text-overflow: ellipsis; }
.if-s { color: #7c93b8; } .if-m { color: #93c5fd; } .if-c { color: #a78bfa; } .if-a { color: var(--muted); text-align: right; }
.log-head, .if-head { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .05em; border-bottom: 1px solid var(--line2); padding-bottom: 5px; margin-bottom: 2px; }
.log-h { cursor: pointer; user-select: none; } .log-h:hover { color: var(--text); } .log-head .log-h.sorted { color: var(--accent); }
.sort-arr { font-style: normal; }
.log-head > span, .if-head > span { color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.log-head { padding-left: 2px; } .if-head > span:last-child { text-align: right; } .log-head > span:nth-child(6), .log-head > span:nth-child(7) { text-align: right; }

/* ---- responsive: sidebar becomes an off-canvas drawer ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; top: 0; bottom: 0; left: 0; width: var(--nav-w); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .nav { transform: translateX(0); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.5); }
  .nav-toggle { display: inline-flex; }
}

/* ---- utilization bar meters (Service health page): a compact bar + small number, themed by threshold ---- */
.meter { position: relative; display: inline-block; width: 94px; height: 15px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px 0 0 8px; opacity: .85; transition: width .3s; }
.meter-num { position: relative; display: block; text-align: center; font-size: 10px; line-height: 15px; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.meter.ok .meter-fill { background: var(--ok); } .meter.warn .meter-fill { background: var(--warn); } .meter.bad .meter-fill { background: var(--bad); }
.svc-mini { display: inline-block; min-width: 64px; }

/* meter + value shown beside it (readable numbers, not just the bar) */
.meter { width: 66px; }
.meter .meter-num { display: none; }
.meter-wrap { display: inline-flex; align-items: center; gap: 7px; }
.meter-txt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* service-name chips (Hosts table "Services" column) */
.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; line-height: 1.5; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); white-space: nowrap; }

/* patient avatar (detail header): initials by default, photo swaps in once loaded */
.pt-avatar { position: relative; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid var(--line2); flex: 0 0 auto; }
.pt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pt-initials { font-weight: 650; font-size: 18px; color: var(--muted); letter-spacing: .02em; }
