/*
 * Wiederverwendbare Bausteine der hellen Fachwerkzeuge.
 *
 * Der pfSense-artige Konsolenrahmen (Seitenleiste, Navigation, Ticket, Dirty-Banner)
 * ist entfallen: Lab B hat als letztes Werkzeug eine eigene Gattung bekommen
 * (tool-firewall.css). Was hier bleibt, sind die Bausteine, die mehrere Werkzeuge
 * teilen - Tabelle, Auswahlfeld, Badge, Aktionsschaltflaeche.
 */

/*
 * Wiederverwendbare "Konsolen-Hülle" für realistische Admin-Tool-Optik in den Labs.
 * Jedes Lab füllt .console-content mit eigenem Inhalt, Sidebar-Items können pro Lab variieren.
 * Bewusst NICHT im WP-Rot der Druckmaterialien - Ziel ist die Anmutung eines echten
 * Fachtools (Firewall-/SIEM-/Ticket-Konsole), nicht des Schulungs-Corporate-Designs.
 */

:root {
  --cs-sidebar-bg: #17222c;
  --cs-sidebar-text: #aab8c2;
  --cs-sidebar-text-dim: #5c6d7d;
  --cs-sidebar-active-bg: #24333f;
  --cs-sidebar-accent: #3b93d6;
  --cs-topbar-bg: #f5f7f9;
  --cs-border: #d7dde3;
  --cs-content-bg: #eef1f4;
  --cs-white: #ffffff;
  --cs-text: #1f2a33;
  --cs-text-mid: #55636e;
  --cs-allow: #1f9254;
  --cs-allow-bg: #e6f4ea;
  --cs-deny: #c0392b;
  --cs-deny-bg: #fbeaea;
  --cs-warn: #a8710a;
  --cs-warn-bg: #fdf3de;
  --cs-mono: var(--font-mono);
  --cs-sans: var(--font-sans);
}

/* Datentabelle im Firewall-/Log-Stil */
.console-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cs-white);
  border: 1px solid var(--cs-border);
  border-radius: 4px;
  overflow: hidden;
  font-size: var(--fs-m);
}

.console-table th {
  background: #f8f9fb;
  border-bottom: 1px solid var(--cs-border);
  text-align: left;
  padding: 8px 10px;
  font-size: var(--fs-s);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--cs-text-mid);
}

.console-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #eef0f2;
  vertical-align: middle;
}

.console-table tbody tr:hover { background: #f7f9fb; }

.console-table tbody tr:last-child td { border-bottom: none; }

.console-table .mono { font-family: var(--cs-mono); font-size: var(--fs-m); }

.console-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: var(--fs-s);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.console-badge.allow { background: var(--cs-allow-bg); color: var(--cs-allow); }

.console-badge.deny { background: var(--cs-deny-bg); color: var(--cs-deny); }

/* Großer, satter Primär-CTA (Abschluss einer Konfiguration/Aktion) */
.console-cta {
  display: block;
  width: 100%;
  border: none;
  border-radius: 6px;
  padding: 16px 20px;
  font-size: var(--fs-l);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  margin-top: 18px;
  background: linear-gradient(135deg, #1f9254, #17703f);
  box-shadow: 0 2px 6px rgba(31,146,84,0.35);
}

.console-cta:hover { filter: brightness(1.06); }

.console-cta:disabled { opacity: 0.5; cursor: default; filter: none; }

.console-cta.danger { background: linear-gradient(135deg, #d64545, #a52424); box-shadow: 0 2px 6px rgba(197,57,57,0.35); }

.console-select {
  padding: 4px 6px;
  font-size: var(--fs-m);
  font-family: var(--cs-sans);
  border: 1px solid var(--cs-border);
  border-radius: 3px;
  background: var(--cs-white);
  width: 100%;
}

.rc-body { padding: 14px 16px; }

.rc-assetline {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid #e3e8ed;
  font-size: var(--fs-m);
}

.rc-row { cursor: pointer; }

.rc-row:hover { background: #f4f7fa; }

.rc-row.sel { background: #eaf3fb; }

.rc-st { font-size: var(--fs-s); }

.rc-st-ok { color: #1f7a4c; }

.rc-st-warn { color: #a8710a; }

.rc-st-bad { color: #c0392b; font-weight: 700; }

.rc-repos { display: flex; gap: 10px; margin: 12px 0 14px; flex-wrap: wrap; }

.rc-repo {
  flex: 1; min-width: 240px;
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid #d7dde3; border-radius: 4px;
  padding: 9px 11px; background: #f8f9fb;
  font-size: var(--fs-s);
}

.rc-repo span { color: #55636e; }

.rc-wizard {
  margin-top: 14px;
  border: 1px solid #d7dde3;
  border-left: 3px solid #2f6fae;
  border-radius: 4px;
  background: #fafbfc;
  padding: 12px 14px;
}

.rc-wiz-head { font-weight: 700; font-size: var(--fs-m); margin-bottom: 10px; }

.rc-wiz-sec { margin-bottom: 12px; }

.rc-wiz-label {
  font-size: var(--fs-s); font-weight: 700; color: #55636e;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.rc-opt {
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 4px; font-size: var(--fs-m); cursor: pointer; line-height: 1.45;
}

.rc-hint { margin-top: 6px; }

/* ---------- Testprogramm-Planer (Lab H) ---------- */
.tp-table td { vertical-align: top; }

.tp-purpose { font-size: var(--fs-s); }

.tp-exp { font-size: var(--fs-s); color: #55636e; }

.tp-exp.exposed { color: #c0392b; font-weight: 700; }

.tp-sourcing { max-width: 300px; font-size: var(--fs-m); }

.tp-m {
  display: flex; gap: 7px; align-items: center;
  font-size: var(--fs-s); cursor: pointer; margin-bottom: 3px;
  white-space: nowrap;
}

/* ---------- Drittparteien (Lab I) ---------- */
.vc-primary {
  display: flex; flex-wrap: wrap; gap: 18px;
  border: 1px solid #d7dde3; border-left: 3px solid #2f6fae;
  border-radius: 4px; background: #f8f9fb;
  padding: 10px 13px; margin-bottom: 10px;
  font-size: var(--fs-m);
}

.vc-plabel {
  display: block;
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em;
  color: #55636e; font-weight: 700; margin-bottom: 1px;
}

.vc-note { margin: 0 0 14px; font-size: var(--fs-s); }

.vc-sub { border: 1px solid #d7dde3; border-radius: 4px; margin-bottom: 7px; overflow: hidden; }

.vc-sub.done { border-left: 3px solid #1f9254; }

.vc-sub-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; cursor: pointer; background: #fff;
}

.vc-sub-head:hover { background: #f4f7fa; }

.vc-sub-name { display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-m); }

.vc-sub-svc { font-size: var(--fs-s); color: #55636e; }

.vc-sub-right { display: flex; align-items: center; gap: 10px; }

.vc-caret { color: #5f6d79; font-size: var(--fs-m); }

.vc-chip {
  font-size: var(--fs-xs); font-weight: 700; border-radius: 3px; padding: 2px 8px;
  border: 1px solid transparent; white-space: nowrap;
}

.vc-chip-open { background: #eef1f4; color: #5f6d79; }

.vc-sub-body { padding: 10px 12px 12px; background: #fafbfc; border-top: 1px solid #e3e8ed; }

.vc-kv td:first-child { width: 110px; }

.vc-decide { display: flex; gap: 14px; flex-wrap: wrap; }

.vc-decide > div { flex: 1; min-width: 240px; }

.vc-api { border: 1px solid #d7dde3; border-radius: 4px; padding: 11px 13px; margin-bottom: 9px; background: #fff; }

.vc-api-head { font-size: var(--fs-m); margin-bottom: 8px; }

.vc-api-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 16px; margin-bottom: 10px;
  font-size: var(--fs-s);
}

.vc-auth { font-size: var(--fs-s); }

.vc-miss { color: #c0392b; font-weight: 700; }

.vc-api-actions { border-top: 1px solid #e3e8ed; padding-top: 8px; }

.vc-ampel { margin-bottom: 6px; }

.vc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

.vc-ritem { padding: 3px 0; }

.vc-sp { margin-top: 14px; }

.vc-count { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Kennungen brechen nicht um: eine ueber vier Zeilen verteilte CVE-Nummer ist
   in keiner echten Konsole zu sehen und macht die Tabelle unlesbar. */
.console-table td.mono { white-space: nowrap; }

.console-table td.mono .muted { white-space: nowrap; }

.fw-foot .console-cta { margin: 0; max-width: 280px; }


/* ================================================================
   Fachwerkzeuge der Module C und F auf dem Designsystem (design.css)
   ================================================================
   Jedes Werkzeug fuehrt am Rahmen .cf-tool, die Ergebnisansichten .cf-aus. style.css
   gestaltet nackte button-, table- und label-Elemente fuer Beitritt und Lobby; im
   Werkzeug gelten nur die Bausteine. :where() haelt die Ruecksetzung auf der
   Spezifitaet von style.css, jeder Baustein (.ds-*) und jede Werkzeugklasse gewinnt. */
:where(.cf-tool, .cf-aus) button {
  height: auto; margin: 0; padding: 0;
  background: none; border: 0; border-radius: 0;
  color: inherit; font: inherit; font-weight: inherit; text-align: inherit;
}
:where(.cf-tool, .cf-aus) button:hover,
:where(.cf-tool, .cf-aus) button:active { background: none; }
:where(.cf-tool, .cf-aus) table { margin: 0; }
:where(.cf-tool, .cf-aus) label { margin: 0; font-size: inherit; font-weight: inherit; color: inherit; }
:where(.cf-tool, .cf-aus) p { margin: 0; }

/* Rahmen eines Werkzeugs im Fenster: Flaeche mit Haarlinie und Tiefe, fuellt das Fenster
   (app.fill), Kopf und Leisten stehen, der Inhalt regelt sein Scrollen selbst. */
.cf-tool {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  background: var(--ds-bg-surface);
  color: var(--ds-text);
  border: var(--bd);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: var(--fs-m);
  line-height: var(--lh-snug);
  font-variant-numeric: tabular-nums;
}
.cf-tool.ds-dark { border-color: var(--ds-dk-border); }
/* Workplace V3: Im Fenster fuellt das Werkzeug die Flaeche von Kante zu Kante wie eine
   echte Anwendung; Rahmen, Radius und Schatten gehoeren dem Fenster. */
.ws-app-fill .cf-tool { border: 0; border-radius: 0; box-shadow: none; }
.cf-tool .ds-toolhead { flex-shrink: 0; }
.cf-tool .ds-toolhead-tab { height: auto; }
.cf-tool .ds-table { margin: 0; }
.cf-tool .ds-panel-body h4:first-child { margin-top: var(--sp-3); }

/* Suchfeld im Signatur-Slot des Kopfes (Scanner, Inventar): echtes Eingabefeld */
.cf-tool .ds-toolhead-search input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: 0; padding: 0;
  color: inherit; font: inherit;
}
.cf-tool .ds-toolhead-search input::placeholder { color: var(--ds-gray-400); }
.cf-tool .ds-toolhead--light .ds-toolhead-search input::placeholder { color: var(--ds-gray-500); }
.cf-tool .ds-toolhead-search:focus-within { border-color: var(--ds-primary); box-shadow: var(--focus-ring); }

/* Kontrast im dunklen Set: Weiss auf Primaer (#3d9be0) und Rot (#ef5f64) bleibt unter
   4,5:1; dunkle Schrift auf der Flaeche erreicht mehr als 6:1. */
.cf-tool.ds-dark .ds-btn--primary, .cf-tool.ds-dark .ds-btn--danger:hover { color: var(--ds-dk-term-bg); }
/* Schwere-Marken auf AA: Weiss auf --ds-warn (3,6:1) und --ds-gray-500 (3,7:1) liegt
   darunter, im dunklen Set Weiss auf Gelb 2,3:1 und auf Rot 3,2:1. Dunkle Schrift auf
   Gelb erreicht 4,8:1 (hell) und 7,7:1 (dunkel); Niedrig nimmt die naechste Graustufe. */
.cf-tool .ds-sev--m { color: var(--ds-gray-900); }
.cf-tool .ds-sev--l { background: var(--ds-gray-600); }
.cf-tool.ds-dark .ds-sev--h, .cf-tool.ds-dark .ds-count { color: var(--ds-dk-term-bg); }
/* Neutraler Zaehler liegt im dunklen Set auf dunkler Flaeche: helle Schrift */
.cf-tool.ds-dark .ds-count--neutral { color: var(--ds-dk-text); }

/* Fortschrittsring (Score, Konformitaet, EPSS): Farbe ueber --ring, Inhalt in der Mitte */
.cf-ring { position: relative; display: inline-flex; width: 64px; height: 64px; flex-shrink: 0; --ring: var(--ds-primary); }
.cf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cf-ring circle { fill: none; stroke-width: 6; }
.cf-ring-spur { stroke: var(--ds-bg-sunken); }
.cf-ring-wert { stroke: var(--ring); stroke-linecap: round; transition: stroke-dasharray var(--dur-3) var(--ease); }
.cf-ring-txt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px;
  font-size: var(--fs-l); font-weight: var(--fw-semibold); color: var(--ds-text); letter-spacing: var(--ls-tight);
}
.cf-ring-txt small { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--ds-text-3); margin-top: 3px; }
.cf-ring--lg { width: 84px; height: 84px; }
.cf-ring--lg .cf-ring-txt { font-size: var(--fs-xl); }
.cf-ring--lg circle { stroke-width: 7; }

/* Schwere mit Buchstabe und Wort (Scanner, Change) */
.cf-sev { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cf-sev .ds-sev { min-width: 20px; height: 18px; padding: 0 4px; }

/* Verweis innerhalb eines Werkzeugs (Kennung, die in ein anderes Werkzeug fuehrt) */
.cf-tool .vb-linkbtn {
  display: inline; padding: 0; margin: 0; height: auto;
  background: none; border: 0;
  color: var(--ds-primary-text); font-size: inherit; font-weight: var(--fw-medium);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px; cursor: pointer;
}
.cf-tool .vb-linkbtn:hover { color: var(--ds-primary); text-decoration-color: currentColor; background: none; }
.cf-tool .vb-linkbtn.ds-mono { font-size: var(--fs-s); }

/* ---------- Ergebnisansichten (Lab C, Lab F) im Stil der Auswertung ----------
   Hell, ruhig, eine Lesespalte wie das Urteil darunter (.aus-urteil). */
.cf-aus {
  max-width: 920px; margin: 0 auto; box-sizing: border-box;
  padding: var(--sp-6) var(--sp-6) var(--sp-2);
  font-family: var(--font-sans); color: var(--ds-text);
  font-variant-numeric: tabular-nums;
}
.cf-aus-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.cf-aus-titel { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.cf-aus-h { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); line-height: var(--lh-tight); color: var(--ds-text); }
.cf-aus-sub { font-size: var(--fs-s); color: var(--ds-text-3); }
.cf-aus-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.cf-aus-meta-l { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--ds-text-3); }
.cf-aus-meta-v { font-size: var(--fs-l); font-weight: var(--fw-semibold); color: var(--ds-text); }
.cf-aus-meta-v.is-bad { color: var(--ds-bad-text); }
.cf-card {
  background: var(--ds-bg-surface);
  border: var(--bd);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-3);
}
.cf-card--bad { border-left: 3px solid var(--ds-bad); }
.cf-card--ok { border-left: 3px solid var(--ds-ok); }
.cf-card--warn { border-left: 3px solid var(--ds-warn); }
.cf-card-h { margin: 0 0 var(--sp-3); font-size: var(--fs-m); font-weight: var(--fw-semibold); color: var(--ds-text); }
.cf-card-text { font-size: var(--fs-m); line-height: var(--lh-relaxed); color: var(--ds-text-2); }
.cf-findlist { list-style: none; margin: 0; padding: 0; }
.cf-findlist li {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-2) 0; border-top: var(--bd-subtle);
  font-size: var(--fs-m); line-height: var(--lh-base); color: var(--ds-text-2);
}
.cf-findlist li:first-child { border-top: 0; padding-top: 0; }
.cf-find-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--ds-gray-500); }
.cf-find-dot.tone-bad { background: var(--ds-bad); }
.cf-find-dot.tone-warn { background: var(--ds-warn); }
.cf-find-dot.tone-ok { background: var(--ds-ok); }
.cf-aus-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-2) 0 var(--sp-4); }

/* ---------- Shell (shell.js): Terminals in Lab C und Lab F ----------
   Echte Konsolenoptik auf dem dunklen Set: Monospace in 13 px, Prompt farbig wie in
   Debian (Benutzer gruen, Pfad blau), PowerShell schlicht. Die Grundform kommt aus
   .lr-term (siem-shell.css); hier steht alles, was die Shell sichtbar macht. */
.sh-term {
  background: var(--ds-dk-term-bg);
  color: var(--ds-dk-text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: var(--lh-base);
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--ds-dk-border-strong) transparent;
  scrollbar-width: thin;
}
.sh-term .lr-out { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.2em; margin: 0; color: var(--ds-dk-text-2); }
.sh-term .lr-out.echo { color: var(--ds-dk-text); }
.sh-term .lr-out.err { color: var(--ds-bad-dk); }
.sh-term .lr-out.ok { color: var(--ds-ok-dk); }
.sh-term .lr-out.dim { color: var(--ds-dk-term-dim); }
.sh-term .lr-out.warn { color: var(--ds-warn-dk); }
.sh-term .lr-out.sh-dir { color: var(--ds-info-dk); }
.sh-term .lr-out.sh-hilfe-titel { color: var(--ds-dk-text); font-weight: var(--fw-semibold); margin-top: var(--sp-2); }
.sh-term .lr-inputline { display: flex; align-items: baseline; gap: 0.6em; }
.sh-term .lr-prompt { color: var(--ds-dk-text); flex-shrink: 0; white-space: pre; }
.sh-term .sh-p-user { color: var(--ds-ok-dk); font-weight: var(--fw-bold); }
.sh-term .sh-p-pfad { color: var(--ds-info-dk); font-weight: var(--fw-bold); }
.sh-term .lr-input {
  flex: 1; min-width: 0; height: auto; padding: 0; margin: 0;
  background: transparent; border: 0; outline: 0; box-shadow: none;
  color: var(--ds-dk-text); caret-color: var(--ds-dk-text);
  font-family: var(--font-mono); font-size: var(--fs-mono); line-height: inherit;
}
.sh-term ::selection { background: color-mix(in srgb, var(--ds-dk-accent) 40%, transparent); }
.sh-term::-webkit-scrollbar { width: 10px; }
.sh-term::-webkit-scrollbar-thumb { background: var(--ds-dk-border-strong); border-radius: 10px; border: 3px solid var(--ds-dk-term-bg); }
.sh-term::-webkit-scrollbar-track { background: transparent; }
.sh-term .lr-out.echo { margin-top: 2px; }
.sh-term .lr-inputline { margin-top: 2px; }
.sh-wahl { display: flex; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.sh-term .sh-wahl-knopf {
  display: inline-flex; align-items: center;
  height: var(--ds-control-h); padding: 0 var(--sp-4); margin: 0;
  font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: var(--fw-medium);
  border: 1px solid var(--ds-dk-border-strong); border-radius: var(--r-s);
  background: var(--ds-dk-surface); color: var(--ds-dk-text);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.sh-term .sh-wahl-knopf:hover:not(:disabled), .sh-term .sh-wahl-knopf:active { background: var(--ds-dk-hover); border-color: var(--ds-ok-dk); color: var(--ds-ok-dk); }
.sh-term .sh-wahl-knopf:disabled { cursor: default; opacity: 0.45; background: var(--ds-dk-surface); }
.sh-term .sh-wahl-knopf.aktiv { opacity: 1; border-color: var(--ds-ok-dk); color: var(--ds-ok-dk); }
.sh-term .sh-wahl-knopf:focus-visible { outline: var(--focus-outline); outline-offset: 1px; }
