/* OSP-Server-Monitor · css/ansichten/betrieb.css — Dienste, n8n, Bridge (v1.0.0 Stufe B, AP-07).
   Jede Ansicht ist so hoch wie der Inhaltsbereich (Kopf 44 px, Polster 16 px; unter 560 px Höhe 8 px): ein einzeiliger Hinweis,
   darunter die Tabelle (osp-tabelle.v1), die in sich scrollt. Seitenpanel für das Detail, Zustandsfarben per Wortliste. */

.bt { height: calc(100dvh - 44px - 16px); min-height: 0; display: flex; flex-direction: column; gap: 6px; }
@media (max-height: 560px) { .bt { height: calc(100dvh - 44px - 8px); gap: 4px; } }
.bt-hinweisbox:empty { display: none; }
.bt-tab { flex: 1 1 0; min-height: 0; min-width: 0; }
.bt-tab .ot { height: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
#tab-services .loading, #tab-n8n .loading, #tab-bridge .loading { padding: 26px 4px; }

/* ── Hinweiszeile über der Tabelle: eine Zeile ≤ 34 px (Dichtemodus ≤ 30 px) ── */
.bt-hinweis { display: flex; align-items: center; gap: 10px; min-height: 30px; max-height: 34px; padding: 3px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); font-size: 13px; line-height: 1.25; }
.bt-hinweis--warn { border-color: rgba(210, 153, 34, .5); background: rgba(210, 153, 34, .1); }
.bt-hinweis--crit { border-color: rgba(248, 81, 73, .55); background: rgba(248, 81, 73, .1); }
.bt-hinweis--ok { border-color: rgba(46, 160, 67, .4); background: rgba(46, 160, 67, .07); }
.bt-h-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-h-k { font-weight: 600; }
.bt-h-b { flex: none; display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; }
.bt-h-b:hover { border-color: var(--text-3); }
.bt-h-steuer { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.bt-h-steuer .bt-seg button { min-height: 24px; font-size: 12px; }
@media (max-height: 560px) {
  .bt-hinweis { min-height: 26px; max-height: 28px; padding: 1px 10px; }
  .bt-tab .ot { border-width: 0; border-radius: 0; }   /* jeder Pixel zählt: 8 Zeilen bei 150 % */
}

/* ── Erweiterungen der Werkzeugleiste der Tabelle (osp-tabelle.v1 baut sie, hier stehen nur Zusätze) ── */
.bt-last-link { margin-left: auto; }   /* 0.9.8: Link „Serverlast ansehen“ rechts in der Leiste der Dienste */
.bt-zus { font-size: 13px; color: var(--ot-gedaempft, var(--text-2)); white-space: nowrap; }
@media (max-width: 1250px) { .bt-zus { display: none; } }
.bt-seg { display: inline-flex; border: 1px solid var(--ot-feldrand, var(--border-2)); border-radius: 8px; overflow: hidden; }
.bt-seg button { min-height: 26px; padding: 0 10px; font: inherit; font-size: .93em; white-space: nowrap; color: var(--ot-text, var(--text)); background: var(--ot-feld, var(--panel)); border: 0; border-right: 1px solid var(--ot-feldrand, var(--border-2)); cursor: pointer; }
.bt-seg button:last-child { border-right: 0; }
.bt-seg button[aria-pressed="true"] { background: var(--ot-aktiv-bg, #0070B0); color: var(--ot-aktiv-text, #fff); }
.bt-seg-n { opacity: .85; font-variant-numeric: tabular-nums; }

/* ── Zustandsfarben in der Tabelle: Text bleibt, Farbpunkt und Farbe kommen dazu (Kontrast ≥ 4,5 : 1 auf Dunkel) ── */
.ot-z[data-st]::before { content: "●"; margin-right: 6px; font-size: .8em; vertical-align: 1px; }
.ot-z[data-st="ok"] { color: #4ade80; }
.ot-z[data-st="warn"] { color: #fbbf24; }
.ot-z[data-st="crit"] { color: #fb8a8a; }
.ot-z[data-st="na"] { color: #a9b7cc; }
.ot-z[data-st="info"] { color: #7dd3fc; }
.ot-zeile[aria-selected="true"] td { background: var(--ot-hover, #1B3350); box-shadow: inset 0 -1px 0 var(--ot-linie, #0080C9); }
#tab-services .ot-zeile, #tab-n8n .ot-zeile { cursor: pointer; }

/* ── Seitenpanel (Detail je Dienst und Workflow) ── */
.bt-panel { position: fixed; z-index: 60; top: 44px; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--bg-2); border-left: 1px solid var(--border-2); box-shadow: -14px 0 32px -16px rgba(0, 0, 0, .7); outline: none; }
.bt-panel[hidden] { display: none; }
.bt-panel-hd { flex: none; display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.bt-panel-tt { flex: 1; min-width: 0; }
.bt-panel-tt h2 { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.bt-panel-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; min-height: 0; }
.bt-panel-sub:empty { display: none; }
.bt-sub-t { font-size: 12px; color: var(--text-2); }
.bt-panel-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text-2); }
.bt-panel-x:hover { color: var(--text); border-color: var(--border-2); }
.bt-panel-bd { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 12px 14px; }
.bt-panel-ft { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--bg); }
.bt-panel-ft[hidden] { display: none; }
.bt-lead { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--text); max-width: 75ch; }
.bt-p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--text-2); max-width: 75ch; }
.bt-p--leise { font-size: 12px; }
.bt-h3 { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); }
.bt-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 6px; font-size: 13px; }
.bt-kv dt { color: var(--text-2); }
.bt-kv dd { margin: 0; overflow-wrap: anywhere; }
.bt-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 9px; border-radius: 11px; border: 1px solid var(--border-2); font-size: 12px; font-weight: 600; }
.bt-badge::before { content: "●"; font-size: .8em; }
.bt-badge[data-st="ok"] { color: #4ade80; border-color: rgba(74, 222, 128, .45); background: rgba(46, 160, 67, .1); }
.bt-badge[data-st="warn"] { color: #fbbf24; border-color: rgba(251, 191, 36, .45); background: rgba(210, 153, 34, .1); }
.bt-badge[data-st="crit"] { color: #fb8a8a; border-color: rgba(248, 81, 73, .5); background: rgba(248, 81, 73, .1); }
.bt-badge[data-st="na"] { color: #a9b7cc; }
.bt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.bt-btn:hover { border-color: var(--text-3); }
.bt-btn.primary { background: #0070B0; border-color: #0070B0; color: #fff; }
.bt-btn.primary:hover { background: #0080C9; border-color: #0080C9; }
.bt-btn.warn { background: #9a3412; border-color: #9a3412; color: #fff; }
.bt-btn.danger { background: #b42318; border-color: #b42318; color: #fff; }
.bt-btn.danger:hover, .bt-btn.warn:hover { filter: brightness(1.12); }
.bt-leer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 64ch; padding: 20px 4px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.bt-leer-t { color: var(--text); font-size: 14px; font-weight: 600; }

@media (max-width: 760px) { .bt-panel { width: 100vw; } }
@media (prefers-reduced-motion: reduce) { .bt * { transition: none !important; animation: none !important; } }
