/* Admin-Seite (docs/decisions/0006, 0008). Keine externen Ressourcen, keine Inline-Styles (CSP).
   Seit 0067 nur mit den Design-Tokens aus css/tokens.css (vor dieser Datei eingebunden): Farben, Schrift, Größen,
   Abstände, Radien, Höhen. Einzige Ausnahme: die Phasen des CRM (0067 Nachtrag 2026-10-29). Breiten von Seite, Spalten und Dialogen sind Layoutmaße, keine Tokens
   (docs/features/admin/design.md). Hell und dunkel folgen der Einstellung des Systems (T10). */

:root {
  /* Phasen des CRM in der Ampel des Prototyps prototypes/CRM, Ausnahme von den Tokens (0067 Nachtrag 2026-10-29, wie
     0041 E1); die Phase steht immer auch als Text */
  --ph-lead: #c62828; --ph-contacted: #e8590c; --ph-talking: #d4a106; --ph-committed: #7cb518; --ph-registered: #2e7d32;
  --ph-blocked: #374151; --ph-lost: #9ca3af;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ph-lead: #f87171; --ph-contacted: #fb923c; --ph-talking: #facc15; --ph-committed: #a3e635; --ph-registered: #4ade80;
    --ph-blocked: #9ca3af; --ph-lost: #6b7280;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: var(--fs-m); line-height: var(--lh-text); }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mute); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }
code { font-family: var(--font-data); font-size: var(--fs-xs); }
h1, h2, h3 { font-family: var(--font-head); line-height: var(--lh-tight); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Sprungziele nicht unter der festen Subnavigation (0136 NV1) */
html { scroll-padding-top: calc(var(--sp-5) * 4); }

/* Kopf und Subnavigation: Kopf in der Marke (T8) */
header { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5);
  background: var(--brand); color: var(--on-brand); }
header h1 { font-size: var(--fs-l); font-weight: 600; margin: 0; }
header .m { color: var(--on-brand); font-size: var(--fs-xs); }
header .actions { display: flex; gap: var(--sp-2); }
/* Fest beim Scrollen (0136 NV1): nur die Subnavigation, der Kopf scrollt weg */
nav.sub { display: flex; flex-wrap: wrap; padding: 0 var(--sp-5); border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto;
  position: sticky; top: 0; z-index: 10; }
nav.sub a { padding: var(--sp-2); color: var(--mute); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
nav.sub a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
/* Bereiche (0111 AN2, AN4; 0136 NV2): je Bereich ein Block, umgebrochen wird nur zwischen Blöcken; Name als Text ohne
   Link über seinen Ansichten, gut lesbar, keine Versalien; dünne senkrechte Linie zwischen den Blöcken. Unter 600 px
   eine waagerecht scrollbare Zeile */
nav.sub .nav-block { display: flex; flex-direction: column; padding: var(--sp-1) var(--sp-3) 0; }
nav.sub .nav-block + .nav-block { border-left: 1px solid var(--line); }
nav.sub .nav-block:first-child { padding-left: 0; }
nav.sub .nav-group { padding: 0 var(--sp-2); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
nav.sub .nav-links { display: flex; flex-wrap: nowrap; }
@media (max-width: 600px) { nav.sub { flex-wrap: nowrap; } }

/* Inhalt */
main { max-width: 1200px; margin: 0 auto; padding: var(--sp-4); display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
/* Pipeline des CRM auf voller Breite, damit die sechs Spalten nebeneinander passen (Marc, 2026-10-29) */
main:has(.crm-board) { max-width: none; }
/* Fuß mit Meta-Zeile: Version, Stand, Seiten-ID, Commit (docs/decisions/0145 M5) */
.foot { max-width: 1200px; margin: 0 auto; padding: var(--sp-3) var(--sp-4) var(--sp-5); color: var(--mute); font: var(--fs-xs)/1.4 var(--font-data); }
.foot a { color: var(--mute); }
.foot .link { background: none; border: 0; padding: 0; color: var(--mute); font: inherit; text-decoration: underline; cursor: pointer; }
.foot a:hover, .foot .link:hover { color: var(--ink); }
section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--sp-3) var(--sp-4); overflow-x: auto; }
section.wide { grid-column: 1 / -1; }
h2 { font-size: var(--fs-s); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); margin: 0 0 var(--sp-3); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-s); }
td, th { text-align: left; padding: var(--sp-1) var(--sp-2) var(--sp-1) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--mute); font-weight: 500; font-size: var(--fs-xs); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.branch th { color: var(--ink); font-weight: 600; padding-top: var(--sp-3); }  /* Zweig der ECLASS-Hierarchie (0169 S8a-2) */
.note { color: var(--mute); font-size: var(--fs-xs); margin-top: var(--sp-2); }
.loading { color: var(--mute); }

/* Status: Kennzeichnung mit Text, Radius der Kennzeichnung, keine Pillen (T5) */
.b { display: inline-block; padding: 0 var(--sp-2); border-radius: var(--r-tag); font-size: var(--fs-xs); font-weight: 600; border: 1px solid currentColor; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .crit { color: var(--bad); } .idle { color: var(--idle); }

/* Kennzahlen-Kacheln: Zahlen in der Überschriftenschrift (T2) */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); }
.kpi div { border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--sp-2) var(--sp-3); }
.kpi b { display: block; font-family: var(--font-head); font-weight: 600; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.kpi b.small { font-size: var(--fs-m); }
.kpi span { color: var(--mute); font-size: var(--fs-xs); }
/* Kachel als Sprung (0082 F3): ganze Kachel klickbar, Beschriftung unterstrichen, Rand in Akzent beim Überfahren */
.kpi a.kpi-go { display: block; color: inherit; text-decoration: none; }
.kpi a.kpi-go span { text-decoration: underline; text-decoration-color: var(--line); }
.kpi div:has(> a.kpi-go:hover) { border-color: var(--accent); }
/* Recht (docs/decisions/0098 F4, Sichtprüfung 2026-11-04): Abstand der Filter zu den Zählern, Prio-Abzeichen ohne Umbruch */
.legal-filters { margin-top: var(--sp-3); }
.legal .b { white-space: nowrap; }
/* Recht (0113 S2, S1): wichtig in Akzentfarbe, nicht bewertet zurückgenommen, Erläuterung als lesbarer Absatz */
/* seit 0136 RS1 als Auswahlliste mit Herkunft darunter; Quelle über 60 Zeichen eingeklappt (QU1) */
.legal select.sicht { color: var(--accent); font-weight: 600; }
.legal select.sicht-none { color: var(--mute); }
.legal-who { display: block; color: var(--mute); font-size: var(--fs-xs); white-space: nowrap; }
.legal-src summary { color: inherit; font-weight: inherit; margin: 0; }
.legal-src[open] .legal-cut { display: none; }
/* Abstimmung (docs/decisions/0137): drei Zellen je Zeile, eigene als Auswahlliste mit Randfarbe des Werts */
table.votes td.vote { white-space: nowrap; }
table.votes td.vote small { display: block; color: var(--mute); font-size: var(--fs-xs); }
table.votes td.vote.ok select { border-color: var(--ok); }
table.votes td.vote.warn select { border-color: var(--warn); }
table.votes td.vote.crit select { border-color: var(--bad); }
/* 0149: „z. K.“ in Akzentfarbe; Zeile als Titel mit Stichpunkten, Vermerk klein darüber; Kommentare je Person (ZK1–ZK3) */
.b.info { color: var(--accent); }
table.votes td.vote.info select { border-color: var(--accent); }
table.votes td.entry ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); }
table.votes td.entry .row-note { display: block; color: var(--mute); font-size: var(--fs-xs); font-style: italic; }
table.votes .vote-comment { margin: var(--sp-1) 0 0; max-width: 70ch; }
table.votes .vote-comment small { color: var(--mute); font-size: var(--fs-xs); }
table.votes .vote-edit { margin-top: var(--sp-1); }
table.votes .vote-edit summary { cursor: pointer; color: var(--mute); font-size: var(--fs-xs); }
table.votes .vote-edit fieldset { border: 0; margin: 0; padding: 0; }
table.votes .vote-edit textarea { display: block; width: 100%; max-width: 70ch; min-height: 4em; margin: var(--sp-1) 0; }
table.votes .vote-edit small { display: block; color: var(--mute); font-size: var(--fs-xs); margin-bottom: var(--sp-1); }
details.adr, details.rubric { border-top: 1px solid var(--line); padding: var(--sp-2) 0; }
details.adr.crit > summary { color: var(--bad); }
details.adr.warn > summary { color: var(--warn); }
details.adr small { color: var(--mute); font-size: var(--fs-xs); }
details.adr .adr-who, details.adr .dialog p { margin: var(--sp-1) 0; }
/* 0162: Entscheidungen und Annahmen je Feature, Erklärung oben, frühere Kommentare, Zurückgenommenes (EA2, EA5, EA8, EA9) */
details.explain, details.feature, details.withdrawn { border-top: 1px solid var(--line); padding: var(--sp-2) 0; }
details.explain > summary, details.feature > summary, details.withdrawn > summary { cursor: pointer; }
details.feature.crit > summary { color: var(--bad); }
details.feature.warn > summary { color: var(--warn); }
details.feature > summary small, details.withdrawn small { color: var(--mute); font-size: var(--fs-xs); }
details.feature[open] { padding-bottom: var(--sp-4); }
details.feature > :not(summary) { margin-left: var(--sp-4); }
details.feature .context { max-width: 80ch; margin: var(--sp-2) 0; }
details.adr .adr-also { margin: var(--sp-1) 0; color: var(--mute); font-size: var(--fs-xs); }
table.explain { max-width: 100ch; }
table.explain th, table.explain td { vertical-align: top; text-align: left; }
ul.values { list-style: none; padding: 0; margin: var(--sp-1) 0; }
ul.values > li { margin: var(--sp-1) 0; }
table.votes .earlier { margin-top: var(--sp-1); }
table.votes .earlier summary { cursor: pointer; color: var(--mute); font-size: var(--fs-xs); }
.legal-more summary { cursor: pointer; }
.legal-more p { max-width: 70ch; margin: var(--sp-1) 0 0; }

/* Blättern */
.pager { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.pager .note { margin: 0; }

/* Bedienelemente: Radius des Steuerelements, Ränder mit 3 : 1 (0067 Kontrast) */
button, .btn { font: inherit; padding: var(--sp-1) var(--sp-3); border: 1px solid var(--line-ctl); border-radius: var(--r-control); background: var(--surface);
  color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background-color var(--dur-quick) var(--ease-settle), border-color var(--dur-quick) var(--ease-settle); }
button:hover, .btn:hover { border-color: var(--accent); }
button.small { padding: 0 var(--sp-2); font-size: var(--fs-xs); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.badbtn { color: var(--bad); border-color: currentColor; }
button:disabled { background: var(--bg); border-color: var(--line); color: var(--mute); cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
/* Sperren: Knopf auf Höhe des Suchfelds, Aktionen ohne Umbruch vor „…“ */
.trust-actions summary { white-space: nowrap; }

/* Onboarding-Fälle: Umgebungswahl und Meldung der Entscheidung */
nav.switch { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
nav.switch a { padding: 0 var(--sp-3); border: 1px solid var(--line-ctl); border-radius: var(--r-control); color: var(--mute); text-decoration: none; }
nav.switch a[aria-current="page"] { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.flash { max-width: 1200px; margin: var(--sp-3) auto 0; padding: 0 var(--sp-4); font-weight: 600; }
.flash:empty { display: none; }
input, select, textarea { font: inherit; width: 100%; padding: var(--sp-2); border: 1px solid var(--line-ctl); border-radius: var(--r-control); background: var(--surface); color: var(--ink); }

/* Anmeldung */
.login { max-width: 380px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--sp-5); display: grid; gap: var(--sp-3); }
.login h1 { font-size: var(--fs-xl); font-weight: 600; margin: 0; }
/* Einrichtung des zweiten Faktors (0173 F6): Schritte; QR-Code dunkel auf hellem Grund in beiden Modi
   (--brand ist hell wie dunkel dunkel, --on-brand hell), Ruhezone steckt im Pfad */
.setup { max-width: 460px; }
.setup h2 { font-size: var(--fs-l); font-weight: 600; margin: var(--sp-2) 0 0; }
.setup ul { margin: 0; padding-left: var(--sp-4); }
.qr { width: 200px; height: 200px; justify-self: center; background: var(--on-brand); fill: var(--brand); shape-rendering: crispEdges; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.pw { font-family: var(--font-data); font-size: var(--fs-l); padding: var(--sp-3); border: 2px dashed var(--warn); border-radius: var(--r-control); word-break: break-all; }
.err { color: var(--bad); }

/* API-Zugang: Formular zum Anlegen */
.token-form { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 36rem); align-items: start; margin-bottom: var(--sp-1); }
.token-form label { display: grid; gap: var(--sp-1); color: var(--mute); font-size: var(--fs-xs); }

/* CRM (docs/features/crm): Kopf, Formulare, Pipeline, Ansprechpartner */
h3 { font-size: var(--fs-s); font-weight: 600; margin: var(--sp-3) 0 var(--sp-2); }
.crm-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.crm-tabs a { font-weight: 600; }
.crm-new { margin-top: var(--sp-2); }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: var(--sp-1) 0; }
.crm-form, .crm-filter { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 36rem); align-items: start; margin: var(--sp-2) 0; }
.crm-form label, .crm-filter label { display: grid; gap: var(--sp-1); color: var(--mute); font-size: var(--fs-xs); }
.crm-form label.req > span::after, .crm-form label.req:not(:has(> span))::after { content: " *"; color: var(--bad); }
.crm-form .full { grid-column: 1 / -1; }
.crm-filter label.check { display: flex; align-items: center; gap: var(--sp-2); }
.crm-filter label.check input, .crm-form input[type="checkbox"] { width: auto; }
/* Formulare der Organisation (docs/decisions/0103): ein Feld je Zeile, Rubriken mit Überschrift, Beispielwerte grau */
.crm-org { grid-template-columns: minmax(0, 36rem); align-items: start; }
.crm-org > button { justify-self: start; }
.crm-rubric { border: 0; border-top: 1px solid var(--line); margin: 0; padding: var(--sp-2) 0 0; min-width: 0; display: grid; gap: var(--sp-3); }
.crm-rubric > legend { color: var(--ink); font-weight: 600; font-size: var(--fs-s); padding: 0 var(--sp-2) 0 0; }
.crm-org label .note { margin-top: 0; }
.crm-org label.check { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink); font-size: var(--fs-s); }
.crm-form input::placeholder { color: var(--mute); }
/* Warengruppen der Organisation: gewählte, darunter Klassensuche mit Treffern (docs/decisions/0124 T1–T3) */
.crm-groups { display: grid; gap: var(--sp-2); }
.crm-groups [data-crm-groups-chosen] { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-1) var(--sp-3); }
.crm-groups [data-crm-groups-chosen]:empty { display: none; }
.crm-groups label.check { display: flex; align-items: center; gap: var(--sp-2); }
.crm-class-hits ul { list-style: none; margin: 0; padding: 0; max-height: min(70vh, 640px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-surface); }
.crm-class-hits li { display: grid; grid-template-columns: 1fr auto; column-gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--line); }
.crm-class-hits li:first-child { border-top: 0; }
.crm-class-hits li > :not(button) { grid-column: 1; }
.crm-class-hits li > .note { display: block; font-size: var(--fs-xs); }
.crm-class-hits li > button { grid-column: 2; grid-row: 1 / span 3; }
.crm-count { justify-content: space-between; align-items: center; margin: var(--sp-1) 0 var(--sp-2); }
.crm-board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: var(--sp-3); overflow-x: auto; }
/* Swimlanes und Quote der Pipeline (docs/decisions/0068 Z-A) */
.crm-lanes { display: grid; gap: var(--sp-3); }
.crm-lane > summary { padding: var(--sp-2) 0; cursor: pointer; }
.crm-quota { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-s); }
.crm-quota b { font-family: var(--font-head); }
/* Dialoge „Zuordnen …“ und Vorlagen (docs/decisions/0068 Z-B, Z-D): einzige Fläche mit Schatten und Hintergrund (T6) */
.crm-dialog { width: 100%; max-width: 380px; padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-surface); box-shadow: var(--elev-dialog); }
.crm-dialog::backdrop { background: var(--scrim); }
.crm-dialog > form { margin: 0; padding: var(--sp-5); }
.crm-dialog.wide { max-width: 1200px; }
.crm-dialog .row { justify-content: flex-start; align-items: center; gap: var(--sp-2); }
.crm-dialog .row .note { flex-basis: 100%; margin: 0; }
.crm-assign-list { display: grid; gap: var(--sp-2); }
.crm-assign-list label.check { display: flex; align-items: center; gap: var(--sp-2); }
.crm-assign-list label.check[hidden] { display: none; }
.crm-chips { margin: 0; color: var(--mute); font-size: var(--fs-xs); }
.crm-template-preview:not(:empty) { display: grid; gap: var(--sp-1); padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-surface); }
.crm-template-preview div { white-space: pre-wrap; }
/* Vorschlag für den nächsten Schritt (docs/decisions/0068 Z-G), Streifen wie die Spalten der Pipeline */
section.crm-suggest { border-left: 4px solid var(--accent); }
section.crm-suggest p { margin: var(--sp-1) 0; }
.crm-col { border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--sp-2); background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); align-content: start; }
.crm-col h3, .crm-col p { margin: 0; }
.crm-card { border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--sp-2); background: var(--surface); display: grid; gap: var(--sp-1); overflow-wrap: anywhere; }
.crm-card .row { justify-content: space-between; }
.crm-contact { border-top: 1px solid var(--line); padding: var(--sp-2) 0; }
.crm-contact:first-of-type { border-top: 0; }
.crm-danger { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
a.btn.small { padding: 0 var(--sp-2); font-size: var(--fs-xs); }

/* Meeting-Notizen (docs/decisions/0068 Z-H): Einwände als Kästchen mit Satz, Aufgabe mit Fälligkeit in einer Zeile */
.crm-meeting label.check { display: flex; align-items: baseline; gap: var(--sp-2); color: var(--ink); font-size: var(--fs-s); }
.crm-meeting .meeting-task input[type="text"] { flex: 1; }
.crm-meeting h3 { margin: var(--sp-2) 0 0; }

/* Abdeckung je Warengruppe (docs/decisions/0068 Z-F): Graph in den Phasenstufen, Spalte „Verloren“ eingeklappt */
.cov-wrap { overflow-x: auto; margin-top: var(--sp-3); }
.cov-wrap:not(.lost-open) .cov-lost { display: none; }
.cov-target input { width: 8ch; padding: var(--sp-1); text-align: right; } /* Ziel je Zeile (0068 Schritt 5b) */
.cov-chart { margin-top: var(--sp-3); }
.cov-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0 0 var(--sp-2); font-size: var(--fs-xs); color: var(--mute); }
.cov-key { width: var(--sp-3); height: var(--sp-3); vertical-align: middle; }
.cov-svg { display: block; max-width: 100%; height: auto; font-family: var(--font-text); } /* Maße im SVG, verkleinert nur bei Bedarf */
.cov-seg { fill: var(--ph); }
.cov-grid { stroke: var(--line); stroke-width: 1; }
.cov-soll { stroke: var(--ink); stroke-width: 2; }
.cov-tick { fill: var(--mute); font-size: var(--fs-xs); text-anchor: middle; }
.cov-label { fill: var(--ink); font-size: var(--fs-s); text-anchor: end; dominant-baseline: middle; }
.cov-end { fill: var(--mute); font-size: var(--fs-xs); dominant-baseline: middle; }
.cov-row:hover .cov-label, .cov-row:focus-within .cov-label { font-weight: 600; }
/* Transaktionen (0138 T5): Auftragswert je Woche bzw. Monat, eine Reihe in Akzentfarbe, Wert als Tooltip je Spalte */
.tx-chart { overflow-x: auto; margin-bottom: var(--sp-3); }
.tx-svg { display: block; max-width: 100%; height: auto; font-family: var(--font-text); } /* Maße im SVG */
.tx-bar { fill: var(--ink); }  /* Ist dunkel nach IBCS, Akzent nur für Bedienung (0184 D6, F6) */
.tx-hit { fill: transparent; }
.tx-col:hover .tx-hit { fill: var(--line); }
.tx-base { stroke: var(--line); stroke-width: 1; }
.tx-tick { fill: var(--mute); font-size: var(--fs-xs); text-anchor: middle; }
/* Zeitreihe und Strukturen nach IBCS (0184 Schritt 3): Titel mit Wer, Was, Wann; Werte an Säulen und Balken */
.tx-title { font-weight: 600; margin: var(--sp-3) 0 var(--sp-1); }
.tx-val { fill: var(--ink); font-size: var(--fs-xs); text-anchor: middle; font-variant-numeric: tabular-nums; }
.tx-hbar { fill: var(--ink); }
.tx-hlabel, .tx-hval { fill: var(--ink); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tx-head { fill: var(--mute); font-size: var(--fs-xs); text-anchor: middle; }
.tx-dbar.good { fill: var(--ok); }
.tx-dbar.bad { fill: var(--bad); }
.tx-dzero { stroke: var(--line); stroke-width: 1; }
.tx-dstem { stroke-width: 2; }
.tx-dstem.good { stroke: var(--ok); }
.tx-dstem.bad { stroke: var(--bad); }
.tx-dhead.good { fill: var(--ok); }
.tx-dhead.bad { fill: var(--bad); }
.tx-table { margin: var(--sp-2) 0; }
.tx-table summary { cursor: pointer; color: var(--mute); }
/* Kacheln nach IBCS (0184 D3, D6): Abweichung besser grün, schlechter rot, gleich grau; Nadel mit Nulllinie */
.tx-kpi .tx-delta { display: block; font-variant-numeric: tabular-nums; }
.tx-delta.good { color: var(--ok); }
.tx-delta.bad { color: var(--bad); }
.tx-pin { display: block; width: 120px; height: 12px; margin-top: var(--sp-1); }
.tx-pin-zero { stroke: var(--line); stroke-width: 1; }
.tx-pin-stem { stroke-width: 2; }
.tx-pin-stem.good { stroke: var(--ok); }
.tx-pin-stem.bad { stroke: var(--bad); }
.tx-pin-head.good { fill: var(--ok); }
.tx-pin-head.bad { fill: var(--bad); }

/* CRM: Phasen, Abzeichen, Konzern, E-Mails. Die Stufe steht als Streifen; der Text bleibt in der Schriftfarbe (Kontrast) */
.ph-lead { --ph: var(--ph-lead); } .ph-contacted { --ph: var(--ph-contacted); } .ph-talking { --ph: var(--ph-talking); }
.ph-committed { --ph: var(--ph-committed); } .ph-registered { --ph: var(--ph-registered); }
.ph-blocked { --ph: var(--ph-blocked); } .ph-lost { --ph: var(--ph-lost); }
.crm-col[class*="ph-"] { border-top: 4px solid var(--ph); }
.crm-card[class*="ph-"] { border-left: 4px solid var(--ph); }
.b.phase { color: var(--ink); border-color: var(--line-ctl); border-left: 4px solid var(--ph); }
.tag { display: inline-block; padding: 0 var(--sp-1); border-radius: var(--r-tag); font-size: var(--fs-xs); background: var(--bg); border: 1px solid var(--line); color: var(--mute); margin-right: var(--sp-1); }
.tag.prelaunch { color: var(--accent); border-color: var(--accent); }
.tag.platform { color: var(--ok); border-color: var(--ok); }
.tag.chan { color: var(--ink); }
.crm-mails td.err { color: var(--bad); }
/* Kerndaten der Organisation (0082 F1): Bezeichnung und Wert in zwei Spalten */
.crm-master { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-1) var(--sp-3); margin: 0; }
.crm-master dt { color: var(--mute); }
.crm-master dd { margin: 0; overflow-wrap: anywhere; }

/* Warengruppen: Merkmalssatz bearbeiten (docs/features/warengruppen, 0085 Schritt (a)); breite Tabelle scrollt im Abschnitt */
.attr-form { display: grid; gap: var(--sp-3); justify-items: start; margin-top: var(--sp-3); }
.attr-form table { min-width: 1080px; }
.attr-form td { padding: var(--sp-1); }
.attr-form input[type="number"] { width: 7ch; }
.attr-form select { min-width: 14ch; }
/* Kommentare in „Grundlagen“ (docs/decisions/0127 K2): Liste ohne Aufzählungszeichen, Formular unter der Liste */
ul.comments { list-style: none; padding: 0; margin: var(--sp-1) 0; }
ul.comments > li { border-top: 1px solid var(--line); padding: var(--sp-1) 0; }
ul.comments > li > p { margin: var(--sp-1) 0 0; white-space: pre-wrap; }
details.comments form { display: grid; gap: var(--sp-1); margin-top: var(--sp-1); }
details.comments textarea { min-height: calc(var(--sp-2) * 6); }

/* Schaubilder (0157 SB3): Bilder aus HTML und Inline-SVG in den Tokens, je Bild Quelle und Tabelle; Farbe nie allein */
.sb-jump { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-s); }
.sb { scroll-margin-top: calc(var(--sp-7) * 2); }
.sb-chain { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-2); counter-reset: none; }
.sb-step { position: relative; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r-surface); padding: var(--sp-2); display: grid; gap: var(--sp-1); align-content: start; font-size: var(--fs-s); }
.sb-step:not(:last-child)::after { content: "→"; position: absolute; right: calc(var(--sp-2) * -1 - 2px); top: 40%; color: var(--mute); }
.sb-nr { font-family: var(--font-data); color: var(--accent); font-weight: 600; }
.sb-short, .sb-feature { color: var(--mute); }
.sb-flag { font-size: var(--fs-xs); }
.sb-table caption { text-align: left; font-weight: 600; padding-bottom: var(--sp-1); }
.sb-chart, .sb-scroll { overflow-x: auto; margin: var(--sp-3) 0; }
.sb-svg { display: block; max-width: 100%; height: auto; font-family: var(--font-text); } /* Maße im SVG */
.sb-grid { stroke: var(--line); stroke-width: 1; }
.sb-bound { stroke: var(--line-ctl); stroke-width: 1; stroke-dasharray: 3 3; }
.sb-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.sb-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.sb-tick { fill: var(--mute); font-size: var(--fs-xs); text-anchor: middle; }
.sb-tick.sb-y { text-anchor: end; dominant-baseline: middle; }
.sb-val { fill: var(--ink); font-size: var(--fs-xs); font-weight: 600; text-anchor: middle; }
.sb-time { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: flex; flex-wrap: wrap; gap: 2px; }
.sb-time li { flex: 1 1 150px; border-top: 4px solid var(--accent); background: var(--accent-soft); padding: var(--sp-2); display: grid; gap: 2px; font-size: var(--fs-s); }
.sb-time li span { color: var(--mute); font-size: var(--fs-xs); }
.sb-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-3); align-items: start; }
.sb-matrix th, .sb-matrix td { white-space: nowrap; }
.sb-use { color: var(--accent); }
.sb-list { font-size: var(--fs-s); }
.sb-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); }
.sb-group { border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--sp-2) var(--sp-3); }
.sb-group ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); }
/* Schritt 3 (0157 SB16–SB19): Seitenstruktur als Baum, eingerückt nach Tiefe; anderer Status gedämpft (der Status steht als Text) */
.sb-pages { list-style: none; margin: var(--sp-1) 0 0; padding: 0; }
.sb-pages .sb-page { font-size: var(--fs-s); }
.sb-d1 { padding-left: var(--sp-3); }
.sb-d2 { padding-left: calc(2 * var(--sp-3)); }
.sb-d3 { padding-left: calc(3 * var(--sp-3)); }
.sb-d4 { padding-left: calc(4 * var(--sp-3)); }
.sb-d5 { padding-left: calc(5 * var(--sp-3)); }
.sb-page.off { color: var(--mute); }
.sb-page-id { font: var(--fs-xs) var(--font-data); color: var(--mute); }
/* Schritt 2 (0157 SB12, SB13): Zustände, Swimlane, Dienste, Pipeline */
.sb-states { list-style: none; padding: 0; margin: 0 0 var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.sb-states li, .sb-state { border: 1px solid var(--line-ctl); border-radius: var(--r-surface); padding: 0 var(--sp-2); font-size: var(--fs-s); background: var(--accent-soft); }
.sb-moves { font-size: var(--fs-s); margin: 0 0 var(--sp-3); padding-left: var(--sp-4); display: grid; gap: 2px; }
.sb-lanes { font-size: var(--fs-xs); }
.sb-lanes th, .sb-lanes td { vertical-align: top; min-width: 110px; }
.sb-lanes th[scope="row"] { white-space: nowrap; border-left: 4px solid var(--accent); }
.sb-none { color: var(--mute); }
.sb-link { stroke: var(--line-ctl); stroke-width: 1.5; }
.sb-node { fill: var(--surface); stroke: var(--line-ctl); }
.sb-hub { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.sb-label { fill: var(--ink); font-size: var(--fs-xs); text-anchor: middle; }
.sb-jobs li { border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r-surface); padding: var(--sp-2); font-size: var(--fs-s); }
/* ECLASS-Export, Wahl der Teilbäume (0163 EX16): Dialog mit Baum wie die Vormerkung der Pre-Landing */
.export-tree { width: 100%; max-width: 760px; max-height: 85vh; padding: var(--sp-5); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-surface); box-shadow: var(--elev-dialog); }
.export-tree::backdrop { background: var(--scrim); }
.export-tree input[type="search"] { width: 100%; margin-bottom: var(--sp-2); }
.export-tree [data-export-tree] { max-height: 55vh; overflow: auto; }
.tree { list-style: none; margin: 0; padding-left: var(--sp-4); }
.tree li { margin: var(--sp-1) 0; }
.tree .link, .chip .link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }
.tree .note { display: inline; }
.chip { display: inline-block; border: 1px solid var(--line-ctl); border-radius: var(--r-surface); padding: 0 var(--sp-2); margin: 0 var(--sp-1) var(--sp-1) 0;
  background: var(--accent-soft); font-size: var(--fs-s); }
/* Formulare (0188 UL1, UL2, UL4): Felder untereinander, Knopfzeile als letztes Element des Rahmens, links bündig */
.stack { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 36rem); align-items: start; }
.form-cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); grid-column: 1 / -1; align-items: center; justify-content: flex-start; }
.token-form > button, .crm-form > button, .crm-filter > button, .stack > button { justify-self: start; }  /* Knöpfe ohne .form-cta nicht über die ganze Breite */
/* Häkchen und Auswahlknöpfe (0188 UL1): natürliche Breite, je eins mit seinem Text in einer Zeile */
input[type="checkbox"], input[type="radio"] { width: auto; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]), label:has(> span > input[type="checkbox"]) { display: flex; align-items: center; gap: var(--sp-2); }
/* CRM (0188 Schritt 3a, Sichtprüfung): Konzern-Formular im Zuordnen-Dialog mit dem Abstand des Formulars; leere Vorschau ohne Platz */
.crm-dialog > details { padding: 0 var(--sp-5) var(--sp-5); }
[data-bulk-preview]:empty { display: none; }
/* Aufklappbarer Rahmen „Filter“ im CRM (0188 UL-F2) */
details.filter { margin: var(--sp-2) 0 var(--sp-3); }
/* Formulare in Tabellenzeilen (0188 UL-F3): bleiben in der Zeile, Feld und Knopf geordnet nebeneinander */
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: var(--sp-2); }
.inline label { display: grid; gap: var(--sp-1); color: var(--mute); font-size: var(--fs-xs); }
/* 0188 Schritt 4b: Beschriftung in .stack wie in .crm-form; Auswahlknopf mit Text in span in einer Zeile (Export, 0186) */
.stack label { display: grid; gap: var(--sp-1); color: var(--mute); font-size: var(--fs-xs); }
label:has(> span > input[type="radio"]) { display: flex; align-items: center; gap: var(--sp-2); }
/* Zuordnungs-Baum (0187 Schritt 1b): Zähler und Zuordnung je Knoten */
.tree .cov { color: var(--mute); font-size: var(--fs-xs); margin-left: var(--sp-1); }
.tree .tree-map { margin-left: var(--sp-1); }
/* Postfächer im CRM (0203 Schritt 1b): Mail als Text, Zeilenumbrüche bleiben, Kopf und Hinweis gedämpft bzw. als Warnung */
article.mail { border-top: 1px solid var(--line); padding-top: var(--sp-2); margin-top: var(--sp-2); }
article.mail .mail-head, article.mail .mail-reply { color: var(--mute); font-size: var(--fs-xs); }
article.mail .mail-hint { color: var(--warn); }
article.mail .mail-text p { white-space: pre-line; overflow-wrap: anywhere; }
/* White-Hat (0202 Schritt 4b): Evidenz, Empfehlung und Zertifikat als Text mit Umbruch; Kasten „Nur jetzt sichtbar“ hervorgehoben */
section.detail pre, section.once pre { white-space: pre-wrap; overflow-wrap: anywhere; }
section.once { border: 2px solid var(--warn); }

/* Vorschau einer Mitteilung (0211 Schritt 3, AC-04): der Dialog der App nachgebaut, hell oder dunkel über data-theme
   (Werte aus tokens.css); deckend, Schatten wie ein Dialog (0067 T6) */
.msg-preview { padding: var(--sp-5) var(--sp-4); background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-surface); }
.msg-dialog { max-width: 520px; margin: 0 auto; padding: var(--sp-5); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-surface); box-shadow: var(--elev-dialog); }
.msg-kicker { margin: 0 0 var(--sp-2); color: var(--mute); font-size: var(--fs-s); }
.msg-kicker.warn { color: var(--warn); font-weight: 600; }
.msg-dialog h3 { margin: 0 0 var(--sp-3); }
.msg-body p { margin: 0 0 var(--sp-3); white-space: pre-line; }
.msg-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-4); }
p.hint { margin: var(--sp-3) 0; color: var(--warn); font-weight: 600; }
