/* Status app-lag — bare Botnest semantiske tokens. Chrome er livlig (railen),
   innholdet rolig. */

html, body { height: 100%; }
.st-body { margin: 0; display: flex; min-height: 100dvh; background: var(--bn-bg); color: var(--bn-text); }

/* Rail + hovedflate */
.st-rail { flex: none; height: 100dvh; position: sticky; top: 0; }
.st-brand {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 14px;
  font: var(--bn-weight-heavy) 18px/1 var(--bn-font-ui); text-decoration: none;
  color: var(--bn-chrome-text);
}
.st-brand:hover { text-decoration: none; }
.st-rail-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.st-theme-group { width: 100%; }
.st-theme-group .bn-btn { flex: 1; }
.st-version { font-size: var(--bn-text-tiny); color: var(--bn-chrome-text-dim); padding: 4px 12px 0; }

.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-topbar { position: sticky; top: 0; z-index: 30; }
.st-title { margin: 0; font: var(--bn-weight-bold) var(--bn-text-h3)/1.2 var(--bn-font-ui); }
.st-topbar-right { margin-left: auto; color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-menu-btn { display: none; }
.st-content { flex: 1; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; width: 100%; box-sizing: border-box; }

.st-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; flex: none; }
.st-ic--lg { width: 40px; height: 40px; }

/* Rutenett */
.st-grid { display: grid; gap: 16px; }
.st-grid--kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.st-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.st-hint { color: var(--bn-text-3); font-size: var(--bn-text-small); margin-top: 6px; }

/* Sjekklister med tilstand: grønn = ok, gul = mangler, rød = feil. Bare der det er sant. */
.st-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-checklist li { display: flex; align-items: center; gap: 10px; }
.st-checklist li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--bn-track); }
.st-checklist li.is-ok::before { background: var(--bn-success-fill); box-shadow: 0 0 6px rgba(76,203,151,0.45); }
.st-checklist li.is-warn::before { background: var(--bn-warning-fill, #E0AC47); }
.st-checklist li.is-bad::before { background: var(--bn-danger-fill); }
.st-phases { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Innlogging: .bn-auth er hele siden (to kolonner), brand-kolonnen har himmelscenen. */
.st-body--auth { margin: 0; background: var(--bn-bg); color: var(--bn-text); }
.st-brand--auth { padding: 0; font-size: 20px; }
.st-auth-title { margin: 0 0 4px; font: var(--bn-weight-bold) var(--bn-text-h3)/1.2 var(--bn-font-ui); }
.st-auth-hint { color: var(--bn-text-3); font-size: var(--bn-text-small); margin: 0; }
.st-auth-alt { margin-top: 16px; }
.st-totp-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.st-qr svg { width: 196px; height: 196px; background: #fff; border-radius: var(--bn-radius-sm); padding: 6px; box-sizing: content-box; }
.st-secret { font-size: 13px; letter-spacing: 0.06em; word-break: break-all; text-align: center; padding: 8px 10px; background: var(--bn-surface-2); border-radius: var(--bn-radius-xs); }
.bn-auth-body { flex-direction: column; gap: 0; }

/* Under 840px: railen blir en skuff */
@media (max-width: 840px) {
  .st-rail { position: fixed; height: 100%; }
  .st-rail:not(.is-open) { transform: translateX(-102%); }
  .st-rail.bn-drawer { position: fixed; }
  .st-menu-btn { display: inline-flex; }
  .st-content { padding: 14px; }
}

/* ---- Fase 1: tabeller, kort, logger, grafer ---- */
.st-h2 { margin: 0; font: var(--bn-weight-bold) var(--bn-text-h4)/1.3 var(--bn-font-ui); }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.st-card--danger { border-color: var(--bn-danger-border); }
.st-kpi { text-decoration: none; color: inherit; display: block; }
.st-kpi:hover { text-decoration: none; }
.st-kpi-of { font: var(--bn-weight-medium) 15px/1 var(--bn-font-ui); color: var(--bn-text-3); margin-left: 3px; }
.st-kpi-sm { font-size: 20px; }
.st-text-danger { color: var(--bn-danger-text); }
.st-mt { margin-top: 12px; }
.st-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.st-grid--services { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.st-svc { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.st-svc:hover { text-decoration: none; }
.st-svc--infra { opacity: 0.8; }
.st-svc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-svc-name { font-weight: var(--bn-weight-bold); }
.st-svc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--bn-text-small); }
.st-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 0; }
.st-kv dt { color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-kv dd { margin: 0; overflow-wrap: anywhere; }
.st-row--dim td { color: var(--bn-text-2); }
.st-trunc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-details { margin-top: 10px; }
.st-details summary { cursor: pointer; color: var(--bn-link); font-size: var(--bn-text-small); }
.st-pre { font: 12px/1.45 var(--bn-font-mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bn-surface-2);
  border-radius: var(--bn-radius-xs); padding: 10px 12px; overflow: auto; max-height: 360px; margin: 8px 0 0; white-space: pre-wrap; }
.st-spark { display: block; width: 100%; height: auto; max-width: 420px; }
.st-spark .bn-ch-line { stroke-width: 2; }
.bn-chart svg { width: 100%; }

/* Logger */
.st-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.st-filters .bn-field { min-width: 150px; }
.st-filter-q { flex: 1 1 320px; }
.bn-select { appearance: auto; }
.st-log { font: 12.5px/1.5 var(--bn-font-mono, ui-monospace, Menlo, Consolas, monospace); display: flex; flex-direction: column; gap: 1px; }
.st-log-line { display: grid; grid-template-columns: 82px 96px 1fr; gap: 10px; padding: 2px 6px; border-radius: 3px; border-left: 3px solid transparent; }
.st-log .st-log-line:not(:has(.st-log-src)) { grid-template-columns: 82px 1fr; }
.st-log-ts { color: var(--bn-text-3); white-space: nowrap; }
.st-log-src { color: var(--bn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-log-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.st-log--error { border-left-color: var(--bn-danger-fill); background: var(--bn-danger-subtle); }
.st-log--warn { border-left-color: var(--bn-warning-fill); }
.st-log--noise { color: var(--bn-text-3); }
