/* Cormag 2.0 (Standalone) — Basis-Styles (Schritt 1). Das volle Neumorphism-UI folgt. */
:root {
	--bg: #F2FAFF; --card: #FFFFFF; --text: #2E333A; --muted: #7B8390;
	--blau: #5AA9E6; --akz: #FF7A00; --rand: #D7E3EE;
	--hell: rgba(255,255,255,.9); --dunkel: rgba(120,140,165,.28);
}
* { box-sizing: border-box; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	display: flex; justify-content: center; padding: 40px 16px;
}
.huelle {
	width: 100%; max-width: 560px; background: var(--card); border-radius: 18px; padding: 28px 32px;
	box-shadow: 6px 6px 14px var(--dunkel), -6px -6px 14px var(--hell);
}
/* Absteigende Gewichtung: h1 > h2 > h3 > h4 (Größe UND Farbe). h3 hatte keine Regel und
   erbte sonst den großen Browser-Default und wirkte damit stärker als h2. */
h1 { font-size: 22px; font-weight: 700; margin: 0 0 14px; }
h2 { font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
h3 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 18px 0 6px; }
h4 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
label { display: block; margin: 8px 0; font-size: 14px; }
input, select, textarea {
	display: block; width: 100%; margin-top: 4px; border: 0; border-radius: 12px; padding: 10px 12px;
	background: var(--card); color: var(--text); font: inherit;
	box-shadow: inset 3px 3px 7px var(--dunkel), inset -3px -3px 7px var(--hell);
}
button {
	border: 0; cursor: pointer; border-radius: 999px; padding: 11px 22px; font-size: 14px; font-weight: 600;
	color: #fff; background: linear-gradient(145deg, #8DC6F0, var(--blau));
	box-shadow: 5px 5px 12px var(--dunkel), -5px -5px 12px var(--hell);
	transition: transform .12s ease, box-shadow .12s ease;
}
button:hover { transform: scale(1.05); box-shadow: 7px 7px 16px var(--dunkel), -7px -7px 16px var(--hell); }
button:active { transform: translateY(1px) scale(.98); box-shadow: inset 3px 3px 7px rgba(0,0,0,.22), inset -3px -3px 7px rgba(255,255,255,.25); }
@media (prefers-reduced-motion: reduce) { button { transition: none; } button:hover { transform: none; } }
a { color: var(--blau); }
.flash { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.flash-warn { background: #ffe6cc; color: #7a3d00; }
.flash-info { background: #e6f1fb; color: #12324a; }
code { background: rgba(163,152,133,.2); padding: 1px 6px; border-radius: 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #8DC6F0; color: #12324a; font-size: 12px; margin: 1px; }
.chip-admin { background: var(--akz); color: #3a2600; }
.muted { color: var(--muted); }
details summary { cursor: pointer; color: var(--blau); font-size: 14px; }
/* GRUNDSATZ: Tabellen füllen IMMER die volle Breite (Kopfbalken über die ganze Tabelle). Horizontales
   Scrollen bei breiten Tabellen macht der Wrapper .tabelle-scroll — NICHT die Tabelle selbst (display:block
   ließ den inneren Tabellenkasten auf Inhaltsbreite schrumpfen → Kopf endete vor dem Rand). */
.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px;
	border: 1px solid var(--rand); border-radius: 12px; box-shadow: 2px 2px 8px var(--dunkel), -2px -2px 8px var(--hell); }
.tabelle th, .tabelle td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle thead th { background: #E9F4FD; color: var(--text); font-weight: 700; border-bottom: 2px solid var(--rand); white-space: nowrap; }
.tabelle tbody tr:nth-child(even) td { background: rgba(120,140,165,.045); }
.tabelle tbody tr:hover td { background: rgba(90,169,230,.10); }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle button { padding: 5px 12px; font-size: 12px; }
.tabelle input[type="checkbox"] { width: auto; margin: 0; box-shadow: none; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--rand); box-shadow: 2px 2px 6px var(--dunkel), -2px -2px 6px var(--hell); }
.versteckt { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.inline-form { display: inline; }
.inline-form + .inline-form { margin-left: 8px; }
.codes { columns: 2; font-size: 18px; line-height: 1.9; }
.check-zeile { display: flex; gap: 8px; align-items: center; }
.eig-block { margin: 10px 0; padding-top: 8px; border-top: 1px solid var(--rand); }
.eig-titel { display: block; font-weight: 600; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
/* Verknüpfungen (Struktur) */
.vkn-liste { list-style: none; padding: 0; margin: 8px 0; }
.vkn-item { padding: 10px 0; border-bottom: 1px solid var(--rand); }
.vkn-kopf { margin-bottom: 6px; }
.vkn-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vkn-edit input, .vkn-edit select { width: auto; margin: 0; }
.vkn-edit input { min-width: 160px; }
/* Verknüpfungs-Widget (Detailansicht) */
.vkn-widget { margin-bottom: 16px; }
.vkn-box { background: var(--card); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; box-shadow: 3px 3px 8px var(--dunkel), -3px -3px 8px var(--hell); }
.vkn-box h3 { margin: 0 0 6px; font-size: 14px; }
.vkn-ziele { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 4px; }
.vkn-ziele li { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.vkn-ziele a { text-decoration: none; }
.vkn-trennen { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; box-shadow: none; }
.vkn-trennen:hover { color: var(--akz); }
.vkn-add { margin-top: 4px; }
.vkn-picker { margin-top: 6px; }
.vkn-tabelle { width: 100%; margin: 0 0 6px; }
.vkn-suche { width: 100%; margin: 0 0 6px; }
.vkn-treffer { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.vkn-treffer-item { padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.vkn-treffer-item:hover { background: rgba(90,169,230,.12); }
.vkn-leer { padding: 6px 8px; font-size: 13px; }
/* Filter-Wert „verknüpft mit" (Datensatz-Suche) */
.fvkn { display: inline-flex; flex-direction: column; gap: 4px; min-width: 220px; }
.fvkn .fvkn-suche { width: auto; margin: 0; }
.fvkn-label { font-size: 12px; color: var(--blau); }
.fvkn-treffer { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto; }
.fvkn-item { padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; background: var(--card); }
.fvkn-item:hover { background: rgba(90,169,230,.12); }
/* Anlege-Maske (typisierte Verknüpfungen) */
.masken { margin-top: 8px; }
.maske { border: 1px solid var(--rand); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.maske legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.maske-suche { width: 100%; margin: 0 0 6px; }
.maske-treffer { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.maske-treffer-item { padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.maske-treffer-item:hover { background: rgba(90,169,230,.12); }
.maske-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.maske-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(90,169,230,.14); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; }
.maske-chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; box-shadow: none; }
.maske-chip-x:hover { color: var(--akz); }
.maske-neu { margin-top: 8px; }
.maske-neu summary { cursor: pointer; color: var(--blau); font-size: 13px; }
.maske-neu-felder { margin-top: 6px; }
.check-zeile input { width: auto; margin: 0; box-shadow: none; }
.admin-nav { font-size: 13px; margin: 0 0 16px; }
.kacheln { display: flex; flex-wrap: wrap; gap: 14px; }
.kachel {
	flex: 1 1 110px; text-align: center; text-decoration: none; color: var(--text);
	background: var(--card); border-radius: 14px; padding: 16px 10px;
	box-shadow: 5px 5px 12px var(--dunkel), -5px -5px 12px var(--hell);
}
.kachel strong { display: block; font-size: 26px; }
.kachel span { font-size: 12px; color: var(--muted); }
a.kachel:hover { transform: translateY(-2px); transition: transform .12s ease; }
.farb-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 14px; }
.farbe { width: 64px; height: 40px; padding: 2px; margin: 0; box-shadow: none; border: 1px solid var(--rand); border-radius: 10px; cursor: pointer; }
.logo-vorschau { max-width: 128px; max-height: 128px; border: 1px solid var(--rand); border-radius: 10px; padding: 6px; background: var(--card); }

/* Struktur: Drag & Drop, Inline-Umbenennen, Optionen */
.dnd { list-style: none; padding: 0; margin: 0 0 8px; }
.dnd-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin: 6px 0; border-radius: 12px; background: var(--card); box-shadow: 3px 3px 8px var(--dunkel), -3px -3px 8px var(--hell); }
.dnd-item.dragging { opacity: .5; }
.griff { cursor: grab; color: var(--muted); user-select: none; font-size: 15px; }
.inline-edit { display: flex; gap: 6px; align-items: center; margin: 0; flex: 1; }
.inline-edit input { margin-top: 0; }
.inline-edit button { padding: 6px 12px; font-size: 13px; }
.option-zeile { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.option-zeile input { margin-top: 0; }
.option-zeile input[name*="[label]"] { flex: 1; }
.option-zeile .check-zeile { margin: 0; white-space: nowrap; }
.option-zeile [data-option-remove] { padding: 5px 13px; font-size: 15px; line-height: 1; }
.opt-name { min-width: 130px; }

/* Verwaltungsmodul */
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { padding: 6px 0; }
.liste li a { font-weight: 600; }
.bereich-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.bereich-kachel { background: var(--card); border-radius: 14px; padding: 14px 18px; box-shadow: 5px 5px 12px var(--dunkel), -5px -5px 12px var(--hell); }
.bereich-kachel h2 { margin-top: 4px; }
/* Infomodul-Kopf: Titel links, Typ-Filter rechts */
.info-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.info-kopf h1 { margin: 0; }
.typ-filter { position: relative; }
.typ-filter > summary { list-style: none; cursor: pointer; padding: 8px 14px; border-radius: 10px; background: var(--card); box-shadow: 3px 3px 8px var(--dunkel), -3px -3px 8px var(--hell); font-size: 14px; white-space: nowrap; }
.typ-filter > summary::-webkit-details-marker { display: none; }
.typ-filter[open] > summary { box-shadow: inset 2px 2px 5px var(--dunkel), inset -2px -2px 5px var(--hell); }
.typ-filter-panel { position: absolute; right: 0; z-index: 30; margin-top: 6px; min-width: 200px; background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: 6px 6px 16px var(--dunkel), -6px -6px 16px var(--hell); display: flex; flex-direction: column; gap: 6px; }
.typ-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.typ-filter-aktion { display: flex; gap: 8px; margin-top: 6px; }
/* Monatskalender (Startscreen) */
.kal-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.kal-kopf h2 { margin: 0; }
.kal-picker .kal-opt { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.kal-picker .kal-opt input { width: auto; margin: 0; flex: 0 0 auto; }
.kal-punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: var(--f, var(--blau)); }
/* Farbpalette je Tabelle (CSP: keine Inline-Styles → Klassen setzen die Variable --f) */
.kal-farbe-0 { --f: #5AA9E6; } .kal-farbe-1 { --f: #5FB37A; } .kal-farbe-2 { --f: #E6A15A; } .kal-farbe-3 { --f: #A97BE6; }
.kal-farbe-4 { --f: #E67B9E; } .kal-farbe-5 { --f: #4FBFBF; } .kal-farbe-6 { --f: #C7A94F; } .kal-farbe-7 { --f: #7E8BA3; }
.kal-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0; }
.kal-nav strong { min-width: 160px; text-align: center; }
.kal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.kal-wochentage { margin-bottom: 6px; }
.kal-wt { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.kal-zelle { min-height: 92px; background: var(--card); border-radius: 10px; padding: 5px 6px; box-shadow: inset 2px 2px 5px var(--dunkel), inset -2px -2px 5px var(--hell); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.kal-leer { background: transparent; box-shadow: none; }
.kal-heute { outline: 2px solid var(--blau); }
.kal-tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.kal-heute .kal-tag { color: var(--blau); }
.kal-eintrag { display: block; text-decoration: none; color: var(--text); font-size: 12px; line-height: 1.25; padding: 2px 6px; border-left: 3px solid var(--f, var(--blau)); border-radius: 4px; background: rgba(90,169,230,.10); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kal-eintrag:hover { background: rgba(90,169,230,.20); }
/* Erledigte (Endpunkt-Status): sichtbar lassen, aber ausgegraut + durchgestrichen. */
.kal-eintrag.kal-erledigt { color: var(--muted); border-left-color: var(--muted); background: rgba(120,140,165,.10); text-decoration: line-through; }
.kal-mehr { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) {
  .kal-zelle { min-height: 60px; }
  .kal-eintrag { font-size: 11px; }
}
/* Ansichts-Umschalter (Tabelle · Kanban · Kalender) + Kalender-Unterschalter Monat/Woche */
.ans-umschalter, .kal-sub { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); box-shadow: inset 2px 2px 5px var(--dunkel), inset -2px -2px 5px var(--hell); margin: 0 0 14px; }
.kal-sub { margin: 12px 0; }
.ans-tab { text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.ans-tab:hover { background: rgba(90,169,230,.10); }
.ans-tab.aktiv { color: #fff; background: linear-gradient(145deg, #8DC6F0, var(--blau)); }
/* Wochenansicht: Tage = Zeilen, Stunden = Spalten (HTML-Tabelle, CSP-konform) */
.woche-huelle { overflow-x: auto; border-radius: 12px; }
table.woche { border-collapse: collapse; width: 100%; min-width: 760px; table-layout: fixed; }
table.woche th, table.woche td { border: 1px solid var(--rand); padding: 0; }
.woche-h { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; height: 26px; }
.woche-eck, .woche-tag { width: 92px; }
.woche-tag { font-size: 12px; font-weight: 600; padding: 4px 6px; text-align: left; vertical-align: top; white-space: nowrap; background: var(--card); }
.woche-zeile.woche-heute .woche-tag { color: var(--blau); }
td.woche-frei { height: 30px; }
.woche-event { height: 26px; }
.woche-event a { display: block; height: 100%; line-height: 26px; padding: 0 6px; font-size: 12px; text-decoration: none; color: #fff; border-radius: 4px; background: var(--f, var(--blau)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Erledigte (Endpunkt-Status) im Wochenraster: ausgegraut + durchgestrichen. */
.woche-event.woche-erledigt a { background: var(--muted); text-decoration: line-through; opacity: .7; }
.woche-ganztag a { opacity: .92; }
/* Kanban */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
.kanban-spalte { flex: 0 0 260px; background: var(--bg); border-radius: 12px; box-shadow: inset 2px 2px 5px var(--dunkel), inset -2px -2px 5px var(--hell); display: flex; flex-direction: column; max-height: calc(100vh - 240px); }
.kanban-spalte-kopf { position: sticky; top: 0; padding: 10px 12px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--rand); background: var(--bg); border-radius: 12px 12px 0 0; }
.kanban-endpunkt .kanban-spalte-kopf { color: var(--muted); }
.kanban-anzahl { color: var(--muted); font-weight: 600; font-size: 12px; }
.kanban-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; }
.kanban-cards.kanban-ziel { outline: 2px dashed var(--blau); outline-offset: -4px; border-radius: 8px; }
.kanban-karte { display: block; text-decoration: none; color: var(--text); background: var(--card); border-radius: 8px; padding: 9px 11px; font-size: 13px; box-shadow: 3px 3px 8px var(--dunkel), -3px -3px 8px var(--hell); border-left: 3px solid var(--blau); }
.kanban-karte:hover { background: rgba(90,169,230,.06); }
.kanban-board[data-kanban-dnd] .kanban-karte { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; -webkit-user-select: none; }
.kanban-drag { opacity: .4; }
.kanban-ghost { position: fixed; pointer-events: none; transform: translate(-50%, -50%); opacity: .9; z-index: 1000; box-shadow: 6px 6px 16px var(--dunkel); }
/* Grid: eigener Scroll-Container (horizontal + vertikal), Kopfzeile bleibt oben sichtbar */
.grid-huelle { overflow: auto; max-height: calc(100vh - 260px); border-radius: 12px; }
.tabelle.grid { display: table; overflow: visible; width: 100%; }
.tabelle.grid td, .tabelle.grid th { white-space: nowrap; }
.tabelle.grid thead th { position: sticky; top: 0; z-index: 2; background: #E9F4FD; box-shadow: inset 0 -2px 0 var(--rand); }
.tabelle.grid thead th a { color: var(--text); text-decoration: none; font-weight: 700; }
.tabelle.grid thead th a:hover { color: var(--blau); }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover { background: rgba(90, 169, 230, .08); }
.suchleiste { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.suchleiste input { margin-top: 0; }
.suchleiste button { padding: 9px 16px; }
/* Grid-Kopfzeile: Suche + Filter + Neuer Datensatz in einer Reihe */
.grid-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.grid-toolbar .suchleiste { margin: 0; }
.grid-toolbar .knopf { padding: 9px 16px; }
.suchfeld { width: auto; flex: 0 1 240px; max-width: 240px; }
.knopf { display: inline-block; text-decoration: none; color: #fff; font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 999px; background: linear-gradient(145deg, #8DC6F0, var(--blau)); box-shadow: 4px 4px 10px var(--dunkel), -4px -4px 10px var(--hell); transition: transform .12s ease; }
.knopf:hover { transform: scale(1.04); }
.knopf-warn, .knopf-akz { background: linear-gradient(145deg, #FFB37A, var(--akz)); color: #3a2600; }
.feld { margin: 12px 0; }
.feld > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pflicht { color: var(--akz); }
.mehrfach { display: flex; flex-direction: column; gap: 2px; }
/* History als Karten (Icon · Typ · Datum · Änderung · von wem) */
.verlauf { margin: 0; }
.hist { border-left: 4px solid var(--rand); background: var(--card); border-radius: 8px; padding: 8px 10px; margin: 8px 0; box-shadow: 2px 2px 6px var(--dunkel), -2px -2px 6px var(--hell); }
.hist-kopf { display: flex; align-items: center; gap: 7px; }
.hist-kopf strong { font-size: 14px; }
.hist-icon { font-size: 14px; }
.hist-zeit { margin-left: auto; font-size: 12px; white-space: nowrap; }
.hist-text { font-size: 13.5px; margin: 5px 0 2px; }
.hist-diff { margin: 2px 0; }
.hist-wer { font-size: 12px; margin-top: 2px; }
.hist-anlegen { border-left-color: #3BA55D; }
.hist-aendern { border-left-color: var(--blau); }
.hist-archivieren { border-left-color: #E5484D; }
.hist-wiederhergestellt { border-left-color: #3BA55D; }
.hist-notiz { border-left-color: var(--akz); }
.hist-mail { border-left-color: #7C6BF0; }
.hist-sonst { border-left-color: var(--muted); }
/* History-Filter-Chips (bleiben beim Scrollen oben stehen) */
.verlauf-typen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; position: sticky; top: 0; z-index: 1; background: var(--card); padding: 2px 0 6px; }
.vtyp { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rand); background: var(--card); color: var(--muted); cursor: pointer; box-shadow: none; }
.vtyp:hover { background: rgba(90, 169, 230, .10); transform: none; box-shadow: none; }
.vtyp.aktiv { color: #fff; background: linear-gradient(145deg, #8DC6F0, var(--blau)); border-color: transparent; }
.vtyp-icon { font-size: 12px; }
/* Dezenter Hinweis über der Liste (ausgeblendete Endpunkt-Datensätze) */
.grid-hinweis { font-size: 12.5px; margin: 0 0 10px; }
.notiz-form { display: flex; gap: 8px; margin: 8px 0 14px; }
.notiz-form input { margin-top: 0; }
.blaetter { font-size: 14px; }
.grid-anzahl { font-size: 12px; color: var(--muted); margin: -8px 0 14px; }
/* Detail: Formular links, Verlauf/Notiz als eigene Spalte rechts */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.detail-haupt { max-width: 640px; }
.detail-seite { background: var(--bg); border: 1px solid var(--rand); border-radius: 14px; padding: 14px 16px; }
.detail-seite h2 { margin-top: 0; }
.detail-seite .verlauf { max-height: 340px; overflow-y: auto; }
.archiv-form { margin-top: 12px; }

/* Filter-Oberfläche */
.knopf-sek { background: var(--card); color: var(--text); box-shadow: 2px 2px 6px var(--dunkel), -2px -2px 6px var(--hell); padding: 8px 14px; font-size: 13px; font-weight: 600; }
.knopf-sek:hover { transform: scale(1.03); }
a.knopf-sek { display: inline-block; text-decoration: none; border: 0; border-radius: 999px; }
.filterbereich { background: var(--bg); border: 1px solid var(--rand); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.filterbereich.zu { display: none; }
.filterbereich > form, .filterbereich > .fset-speichern { margin: 0 0 10px; }
.fset-laden { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fset-laden select { width: auto; margin: 0; }
.filter-aktionen { display: flex; gap: 10px; align-items: center; }
.fset-speichern { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* nur das Namensfeld darf sich dehnen — NICHT die Checkbox im „öffentlich"-Label */
.fset-speichern > input { width: auto; margin: 0; flex: 1; min-width: 180px; }
.fset-speichern .check-zeile input { flex: 0 0 auto; width: auto; }
/* Flache Filter-Liste: je Regel eine Zeile, ab der 2. Zeile eine UND/ODER-Auswahl davor */
.filter-liste { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px; }
.fgruppe { display: flex; flex-direction: column; gap: 2px; }
.filter-add { align-self: flex-start; margin-top: 6px; }
.fregel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.fregel select, .fregel input { width: auto; margin: 0; }
/* Verknüpfer als eigene kleine Zeile ZWISCHEN zwei Bedingungen; bei der ersten Gruppe raus. */
.fverkn-zeile { display: flex; align-items: center; margin: 4px 0; }
.filter-liste .fgruppe:first-child .fverkn-zeile { display: none; }
.fverkn { flex: 0 0 78px; width: 78px; margin: 0; padding: 4px 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--blau); text-align: center; }
.fwert { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fwert select[multiple] { min-width: 140px; }
.fdel { background: transparent; color: var(--muted); box-shadow: none; padding: 4px 10px; }
.fdel:hover { transform: none; box-shadow: none; color: #E5484D; }
@media (max-width: 820px) {
	.detail-layout { grid-template-columns: 1fr; }
	.detail-haupt { max-width: none; }
}

/* ── App-Shell ── */
.app-body { padding: 24px 16px; }
.shell { width: 100%; max-width: none; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: stretch; height: calc(100vh - 48px); }
.shell .bubble { background: var(--card); border-radius: 18px; padding: 18px 20px; box-shadow: 6px 6px 14px var(--dunkel), -6px -6px 14px var(--hell); }
/* Menü- und Content-Spalte scrollen unabhängig voneinander (jede mit eigenem overflow). */
.spalte { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; }
.inhalt { min-height: 0; overflow-y: auto; }
/* Content füllt standardmäßig die volle Breite; einzelne Module dürfen sich per .schmal begrenzen. */
.inhalt.schmal { max-width: 860px; }
.modul-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 14px; margin: 0 0 18px; }
.modul-nav .inline-form { margin-left: auto; }
.modul-nav strong { color: var(--text); }

.status .ident { display: flex; align-items: center; gap: 12px; }
.avatar-klein { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--rand); flex: 0 0 auto; }
.avatar-leer { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--blau); background: rgba(90, 169, 230, .12); }
.ident-txt { min-width: 0; }
.ident-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ident-titel { font-size: 13px; color: var(--blau); font-weight: 600; }
.glocke { margin-left: auto; background: transparent; color: var(--muted); box-shadow: none; padding: 6px 8px; border-radius: 50%; font-size: 16px; flex: 0 0 auto; }
.glocke:hover { background: rgba(90, 169, 230, .12); transform: none; box-shadow: none; }
.rollen-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px; }
.uhr { margin-top: 12px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.menu { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.menu-eintrag { display: block; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px; }
.menu-eintrag:hover { background: rgba(90, 169, 230, .10); }
.menu-eintrag.aktiv { color: #fff; background: linear-gradient(145deg, #8DC6F0, var(--blau)); box-shadow: 3px 3px 8px var(--dunkel); }
.menu-logout { margin-top: 8px; }
.menu-logout button { width: 100%; }
/* Menü-Abschnittstitel (z. B. „Erweiterungen") */
.menu-sektion { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin: 10px 0 2px; padding: 0 14px; }
/* Menü-Sub-Navigation (Infomodul: Tabellen nach Bereich) */
.info-sub { margin: 2px 0 6px 10px; border-left: 2px solid var(--rand); padding-left: 8px; }
.info-sub-bereich { margin: 4px 0; }
.info-sub-titel { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 2px; }
.info-sub-tab { display: block; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px; }
.info-sub-tab:hover { background: rgba(90, 169, 230, .10); }
.info-sub-tab.aktiv { background: rgba(90, 169, 230, .18); font-weight: 600; }

.alex { text-align: center; }
.alex-icon { font-size: 30px; }
.alex strong { display: block; margin: 2px 0 4px; }
.alex p { font-size: 13px; margin: 0; }

/* Reiter (Tabs) für Kopf-Navigation (Admin- + Konto-Bereich) */
.reiter { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 20px; border-bottom: 1px solid var(--rand); }
.reiter a, .reiter strong { padding: 8px 16px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.reiter a:hover { color: var(--text); }
.reiter strong { color: var(--blau); border-bottom-color: var(--blau); }
.reiter .inline-form { margin-left: auto; }
.reiter .inline-form button { padding: 6px 14px; font-size: 13px; }

/* Statusbox: Firma (Logo + Name) · Benutzer · Uhr */
.firma { display: flex; align-items: center; gap: 10px; }
.firma-name { flex: 1; margin: 0; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.firma-logo { max-height: 40px; max-width: 90px; object-fit: contain; border-radius: 6px; }
.benutzer-name { margin-top: 12px; font-weight: 600; }

.bottom-bar { display: none; }

@media (max-width: 820px) {
	.shell { grid-template-columns: 1fr; height: auto; }
	.app-body { padding: 16px 12px 84px; }
	/* Mobil scrollt die Seite als Ganzes; interne Spalten-Scrollbereiche zurücknehmen. */
	.spalte { position: static; overflow: visible; min-height: 0; }
	.inhalt { overflow: visible; }
	.spalte .bubble { display: none; }
	/* ALEx hat eine eigene Basis-Regel (.bubble.alex{display:flex}); die würde das
	   Ausblenden oben überstimmen und ALEx zusätzlich zum Bottom-Sheet oben anzeigen.
	   Deshalb hier spezifischer aus- und (nur geöffnet) wieder einblenden. */
	.spalte .bubble.alex { display: none; }
	.spalte .bubble.offen {
		display: block; position: fixed; left: 12px; right: 12px; bottom: 78px; z-index: 50;
		max-height: 70vh; overflow: auto;
		/* Schwebendes Overlay: opake Fläche + Elevation (die flache „Rail"-Regel macht .bubble sonst transparent). */
		background: var(--card); border: 1px solid var(--rand); border-radius: var(--radius-l, 14px);
		box-shadow: var(--shadow, 0 14px 40px -14px rgba(40,60,90,.28)); padding: 14px 16px;
	}
	.spalte .bubble.alex.offen { display: flex; }
	/* Prozessmenü hat (wie ALEx) eine Basis-Regel display:flex → mobil ausblenden, nur geöffnet als Sheet zeigen. */
	.spalte .bubble.prozess { display: none; }
	.spalte .bubble.prozess.offen { display: flex; }
	.bottom-bar {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; gap: 8px; padding: 8px;
		background: var(--card); box-shadow: 0 -4px 16px var(--dunkel); z-index: 60;
	}
	.bottom-bar button { flex: 1; }
	/* Bubble-Drag ist ein Desktop-Feature; im Sheet-Modus der Umschalter statt Griff. */
	.bubble-drag { display: none; }
	.spalte .bubble.offen .menu-mobil-swap { display: block; width: 100%; margin: 0 0 8px; }
}

/* ── Aufgabenmodul: Detail-Zusatzblock (Unteraufgaben, Zeiterfassung, Verantwortlich) ── */
.modulblock { margin: 20px 0 6px; display: grid; gap: 16px; }
.modul-kopf { display: flex; align-items: baseline; gap: 10px; }
.modul-kopf h3 { margin: 0; }
.ua-fortschritt, .timer-summe { font-size: 12px; color: var(--muted); }
.ua-block, .timer-block, .verantwort-block { border: 1px solid var(--rand); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.ua-liste { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ua-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; }
.ua-item:hover { background: rgba(90,169,230,.07); }
.ua-item.ua-drag { opacity: .5; }
.ua-griff { cursor: grab; color: var(--muted); font-size: 12px; letter-spacing: -3px; touch-action: none; user-select: none; }
.ua-check { width: auto; margin: 0; box-shadow: none; }
.ua-titel { flex: 1; padding: 2px 4px; border-radius: 6px; outline: none; }
.ua-titel:focus { background: var(--bg); box-shadow: inset 0 0 0 1px var(--blau); }
.ua-item.erledigt .ua-titel { text-decoration: line-through; color: var(--muted); }
.ua-del, .zeit-del { background: transparent; box-shadow: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.ua-del:hover, .zeit-del:hover { color: #E5484D; box-shadow: none; transform: none; }
.ua-neu, .zeit-manuell { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ua-neu-feld { flex: 1; margin: 0; min-width: 140px; }
.timer-status { font-size: 13px; color: var(--blau); font-weight: 600; min-height: 18px; }
.timer-aktionen { margin: 8px 0; }
.timer-toggle { font-weight: 600; }
.zeit-manuell .zm-min { flex: 0 0 90px; margin: 0; }
.zeit-manuell .zm-bem { flex: 1; margin: 0; min-width: 120px; }
.zeit-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.zeit-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.zeit-item:hover { background: rgba(90,169,230,.07); }
.zeit-item.offen { color: var(--blau); font-weight: 600; }
.verantwort-select { width: auto; min-width: 220px; margin: 4px 0 0; }

/* ── Eisenhower-Matrix ── */
.eh-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.eh-quadrant { border: 1px solid var(--rand); border-radius: 14px; padding: 12px 14px; min-height: 150px; display: flex; flex-direction: column; background: var(--card); box-shadow: 2px 2px 8px var(--dunkel), -2px -2px 8px var(--hell); }
.eh-kopf { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rand); }
.eh-kopf strong { font-size: 15px; }
.eh-hint { font-size: 11px; color: var(--muted); flex: 1; }
.eh-anzahl { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 1px 8px; }
.eh-tun { border-top: 3px solid #E5484D; }
.eh-planen { border-top: 3px solid #5AA9E6; }
.eh-delegieren { border-top: 3px solid #F5A623; }
.eh-spaeter { border-top: 3px solid #9AA6B2; }
.eh-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 40px; border-radius: 10px; padding: 2px; }
.eh-cards.eh-ziel { outline: 2px dashed var(--blau); outline-offset: -4px; }
.eh-karte { display: block; text-decoration: none; color: var(--text); background: var(--bg); border: 1px solid var(--rand); border-radius: 10px; padding: 8px 10px; cursor: grab; touch-action: none; user-select: none; }
.eh-karte:hover { box-shadow: 2px 2px 8px var(--dunkel); }
.eh-titel { display: block; font-weight: 600; font-size: 13px; }
.eh-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.eh-drag { opacity: .4; }
.eh-ghost { position: fixed; pointer-events: none; transform: translate(-50%, -50%); opacity: .95; z-index: 1000; box-shadow: 6px 6px 16px var(--dunkel); }
@media (max-width: 760px) { .eh-board { grid-template-columns: 1fr; } }

/* ── Startscreen: Kachel „Meine Aufgaben" (Fortschrittsring, Motivations-Design) ── */
.start-aufgaben { display: block; text-decoration: none; color: var(--text); max-width: 380px; border: 1px solid var(--rand); border-radius: 14px; margin: 14px 0 20px; background: var(--card); box-shadow: 2px 2px 8px var(--dunkel), -2px -2px 8px var(--hell); overflow: hidden; }
.sa-kopf { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 12px 16px; border-bottom: 1px solid var(--rand); }
.sa-check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: #3BA55D; color: #fff; font-size: 13px; line-height: 1; }
.sa-ring-wrap { position: relative; width: 170px; height: 170px; margin: 20px auto 24px; }
.sa-ring { display: block; width: 170px; height: 170px; }
.sa-ring-track { stroke: #E7EDF3; }
.sa-ring-fill { stroke: var(--akz); transition: stroke-dashoffset .5s ease; }
.sa-ring-mitte { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 20px; }
.sa-mz { display: flex; flex-direction: column; align-items: center; }
.sa-num { font-size: 30px; font-weight: 700; line-height: 1; }
.sa-heute { color: var(--akz); }
.sa-ueberf-n { color: #E5484D; }
.sa-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Schnell-Erfassung (Aufgabenliste) ── */
.schnell-erfassung { display: flex; gap: 8px; margin: 0 0 12px; }
.schnell-erfassung input { flex: 1; margin: 0; }
.schnell-erfassung button { flex: 0 0 auto; padding: 10px 18px; font-size: 18px; line-height: 1; }

/* ── Filter: relatives Datum (festes Datum / heute / morgen) ── */
.fdat { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fdat select, .fdat input { width: auto; margin: 0; }

/* ── ALEx-Chat (linke Menüspalte) ── */
.bubble.alex { display: flex; flex-direction: column; gap: 8px; }
.alex-kopf { display: flex; align-items: center; gap: 8px; }
.alex-kopf strong { flex: 1; }
.alex-icon { font-size: 18px; line-height: 1; }
.alex-reset { background: transparent; box-shadow: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.alex-reset:hover { color: var(--blau); box-shadow: none; transform: none; }
.alex-verlauf { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.alex-verlauf:empty { display: none; }
.alex-msg { padding: 7px 10px; border-radius: 12px; font-size: 13px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.alex-user { align-self: flex-end; background: linear-gradient(145deg, #8DC6F0, var(--blau)); color: #fff; }
.alex-bot { align-self: flex-start; background: var(--bg); }
.alex-fehler { background: #ffe6cc; color: #7a3d00; }
.alex-warte { color: var(--muted); }
.alex-form { display: flex; gap: 6px; }
.alex-eingabe { flex: 1; margin: 0; }
.alex-senden { flex: 0 0 auto; padding: 8px 14px; }

/* ── ALEx-Voice-Buttons ── */
.alex-tts, .alex-mic { background: transparent; box-shadow: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 6px; line-height: 1; }
.alex-tts:hover, .alex-mic:hover { color: var(--blau); box-shadow: none; transform: none; }
.alex-tts.an { color: var(--akz); }
.alex-mic { flex: 0 0 auto; }
.alex-mic.an { color: #E5484D; }

/* ── KI-Agenten: Stimmen-Auswahl ── */
.voices-zeile { display: flex; gap: 8px; align-items: center; }
.voices-zeile input { flex: 1; margin: 0; }
.voices-liste { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.voices-liste .voice-pick { padding: 4px 10px; font-size: 12px; }

/* ── ALEx: Vorlese-Knopf pro Antwort ── */
.alex-say { background: transparent; box-shadow: none; border: 0; padding: 0 0 0 6px; margin: 0; font-size: 12px; line-height: 1; cursor: pointer; color: var(--muted); vertical-align: middle; }
.alex-say:hover { color: var(--blau); box-shadow: none; transform: none; }
.alex-say.laeuft { opacity: .5; cursor: default; }

/* ── ALEx: Werkzeug-/Routen-Katalog ── */
textarea.mono { font-family: ui-monospace, "Fira Code", Menlo, Consolas, monospace; font-size: 13px; }
.tool-akt { display: flex; gap: 10px; align-items: center; white-space: nowrap; }

/* ── Admin: Modul-Grid (optionale Module zuschalten) ── */
.modul-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.modul-kachel { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px; border: 1px solid var(--rand); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; }
button.modul-kachel { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
button.modul-kachel:hover { border-color: var(--blau); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.modul-kachel .modul-icon { font-size: 28px; line-height: 1; }
.modul-kachel .modul-name { font-weight: 600; }
.modul-kachel .modul-beschreibung { font-size: 13px; color: var(--muted); }
.modul-kachel .modul-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.modul-kachel.aktiv .modul-status { color: #2e9e5b; }
.modul-kachel.inaktiv { opacity: .6; }
.modul-kachel.inaktiv .modul-status { color: var(--muted); }
.modul-kachel.nicht-verfuegbar { opacity: .45; }

/* Server-Info */
.server-info th { width: 180px; text-align: left; }
.ext-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.ext-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-family: ui-monospace, "Fira Code", monospace; }
.ext-chip.ext-ja { background: rgba(46,158,91,.14); color: #2e9e5b; }
.ext-chip.ext-nein { background: rgba(180,35,24,.12); color: #b42318; }

/* Modal (Passwort-Bestätigung) */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-box { background: var(--card); color: var(--text); border: 1px solid var(--rand); border-radius: 14px; padding: 22px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-box h3 { margin: 0 0 6px; }
.modal-pw { width: 100%; margin: 10px 0 4px; }
.modal-fehler { min-height: 18px; font-size: 13px; color: #b42318; margin-bottom: 10px; }
.modal-aktionen { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Kommunikation: Konversations-Detail ── */
.post-verlauf { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 20px; }
.post-msg { border: 1px solid var(--rand); border-radius: 10px; padding: 12px 14px; background: var(--card); }
.post-msg.post-outbound { border-left: 3px solid var(--blau); }
.post-msg.post-inbound { border-left: 3px solid var(--muted); }
.post-msg-kopf { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.post-msg-body { white-space: normal; line-height: 1.5; }
.post-ki { background: rgba(46,158,91,.12); color: #2e9e5b; border-radius: 8px; padding: 8px 12px; font-size: 14px; }

/* ── Kommunikation: Detail zweispaltig (Cormag-1-Look) ── */
.post-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.post-haupt { min-width: 0; }
.post-verlauf { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 18px; }
.post-msg { max-width: 82%; border-radius: 12px; padding: 10px 14px; border: 1px solid var(--rand); background: var(--card); }
.post-msg.post-outbound { align-self: flex-end; background: rgba(46,158,91,.12); border-color: rgba(46,158,91,.35); }
.post-msg.post-inbound { align-self: flex-start; }
.post-msg-kopf { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; font-size: 13px; }
.post-msg-kopf .muted { margin-left: auto; }
.post-ok { color: #2e9e5b; font-weight: 700; }
/* Ältere Mails (jenseits der 3 neuesten) in eine Scroll-Box, damit das Antwortformular nah bleibt. */
.post-verlauf-aelter { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; border-top: 1px dashed var(--rand); margin-top: 4px; padding-top: 10px; }
.post-verlauf-aelter-titel { font-size: 12px; margin-bottom: 2px; }
.post-antwort { border-top: 1px solid var(--rand); padding-top: 12px; }
.post-sidebar { display: flex; flex-direction: column; gap: 14px; }
.post-card { border: 1px solid var(--rand); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.post-card h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.post-card select { width: 100%; }
.post-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 14px; }
.post-dl dt { color: var(--muted); }
.post-dl dd { margin: 0; }
/* Verlauf (History) + Konversationsnotiz in der Post-Sidebar */
.hist-mail { border-left-color: var(--akz); }
.php-log { max-height: 420px; overflow: auto; background: var(--card); border: 1px solid var(--rand); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.log-scroll { max-height: 420px; overflow: auto; }
.log-scroll thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.audit-filter { margin: 10px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.audit-filter .filter-zeile { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.audit-filter label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; flex: 1 1 180px; }
.audit-filter label select, .audit-filter label input { font-size: 14px; width: 100%; min-width: 0; box-sizing: border-box; }
.audit-filter .filter-aktion { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.post-sidebar .verlauf { max-height: 340px; overflow-y: auto; }
.post-notiz-form textarea { width: 100%; box-sizing: border-box; }
.post-knotiz-liste { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.post-knotiz { border-left: 3px solid var(--akz); background: var(--card); border-radius: 8px; padding: 7px 9px; box-shadow: 2px 2px 6px var(--dunkel), -2px -2px 6px var(--hell); }
.post-knotiz-kopf { font-size: 12px; margin-bottom: 3px; }
.post-knotiz-body { font-size: 13.5px; line-height: 1.45; }
@media (max-width: 820px) { .post-detail { grid-template-columns: 1fr; } .post-msg { max-width: 100%; } }

/* Post: Anhänge in Bubbles */
.post-anhaenge { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.post-anhang { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 9px; border: 1px solid var(--rand); border-radius: 8px; text-decoration: none; color: var(--text); background: var(--bg); }
.post-anhang:hover { border-color: var(--blau); }

.post-leiste { display: flex; gap: 10px; align-items: center; margin: 6px 0 14px; }

/* Post: interne Notizen + Kollisions-Lock */
.post-msg.post-notiz { align-self: center; max-width: 92%; background: rgba(241,196,15,.14); border-color: rgba(241,196,15,.45); }
.post-notiz-form { margin-top: 14px; border-top: 1px dashed var(--rand); padding-top: 12px; }
.post-lock { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(241,196,15,.16); border: 1px solid rgba(241,196,15,.5); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.post-lock .inline-form { margin: 0; }

.post-baustein { margin: 4px 0 8px; }
.post-baustein select { max-width: 100%; }

/* Post: Startscreen-Widget */
.post-widget { margin-top: 18px; }
.post-widget h2 { margin-bottom: 8px; }

/* Post-Startscreen-Kachel neben der Aufgaben-Kachel */
.start-kacheln { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; margin: 14px 0 20px; }
.start-kacheln > * { margin: 0; }
.start-post { display: flex; flex-direction: column; min-width: 260px; max-width: 380px; border: 1px solid var(--rand); border-radius: 14px; background: var(--card); box-shadow: 2px 2px 8px var(--dunkel), -2px -2px 8px var(--hell); overflow: hidden; }
.start-post-body { display: flex; flex: 1; }
.start-post-zahl { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 12px; text-decoration: none; color: var(--text); }
.start-post-zahl + .start-post-zahl { border-left: 1px solid var(--rand); }
.start-post-zahl strong { font-size: 30px; line-height: 1; }
.start-post-zahl span { font-size: 13px; color: var(--muted); }
.start-post-zahl:hover { background: var(--bg); }

/* Startscreen-Kacheln volle Breite ausnutzen (je zur Hälfte, Umbruch auf schmal) */
.start-kacheln > * { flex: 1 1 320px; max-width: none; }

.post-msg-empf { font-size: 12px; color: var(--muted); margin-bottom: 2px; word-break: break-word; }

/* Post: ausgehende Anhänge */
.post-anhang-weg { opacity: .55; cursor: default; }
.post-anhang-dok { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 8px; text-decoration: none; color: #2e9e5b; background: rgba(46,158,91,.12); }
.post-anhang-dokform { display: inline; }
.post-anhang-dokform .knopf-link { font-size: 12px; color: var(--blau); }
.post-entwurf-anh { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.post-entwurf-anh li { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.knopf-link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.knopf-link:hover { color: #b42318; }

.post-sende-leiste { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Post: volle Tabellenbreite (Kopf-Balken über die ganze Bubble) + Postfach-Reiter */
.tabelle.voll { display: table; }
.post-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.post-tab { padding: 6px 14px; border: 1px solid var(--rand); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 14px; background: var(--card); }
.post-tab:hover { border-color: var(--blau); }
.post-tab.aktiv { background: var(--blau); color: #fff; border-color: var(--blau); }

/* ── Post: Filterpanel, Schlagwortwolke, Tags ── */
/* Aktiv-Markierung des Filter-Buttons: höhere Spezifität, damit knopf-sek die Akzentfarbe nicht überdeckt. */
.knopf-sek.knopf-akz { background: linear-gradient(145deg, #FFB37A, var(--akz)); color: #3a2600; }
.post-filter { margin: 6px 0 12px; }
.post-filter.zu { display: none; }
.post-filter .post-entwurf-check { align-self: center; }
.post-wolke { margin: 0 0 14px; }
.post-wolke > summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.post-wolke-tags { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-top: 8px; }
.post-tag { text-decoration: none; color: var(--blau); border: 1px solid var(--rand); border-radius: 999px; padding: 2px 10px; line-height: 1.6; background: var(--card); }
.post-tag:hover { border-color: var(--blau); background: rgba(90, 169, 230, .10); }
.post-tag-n { color: var(--muted); font-size: .8em; font-variant-numeric: tabular-nums; }
.post-tag-w1 { font-size: 12px; } .post-tag-w2 { font-size: 14px; } .post-tag-w3 { font-size: 16px; }
.post-tag-w4 { font-size: 19px; } .post-tag-w5 { font-size: 23px; }
.post-tags-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.post-tag-chip { font-size: 12px; background: rgba(90, 169, 230, .12); color: var(--text); border-radius: 999px; padding: 2px 9px; }
.post-tags-form { display: flex; gap: 6px; }
.post-tags-form input { flex: 1; min-width: 0; }

/* ── Report-Modul (Berichte) ── */
.crp-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reiter a.reiter-tab.aktiv { color: var(--blau); border-bottom-color: var(--blau); font-weight: 600; }
.crp-verwalten { flex: 0 0 auto; margin-bottom: 6px; }

.crp-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 14px; align-items: start; }
.crp-card { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 6px 6px 14px var(--dunkel), -6px -6px 14px var(--hell); display: flex; flex-direction: column; min-width: 0; }
.crp-card.dragging { opacity: .5; }
.crp-card--chart, .crp-card--liste { grid-column: span 2; }
@media (max-width: 720px) { .crp-card--chart, .crp-card--liste { grid-column: auto; } }
.crp-card__kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.crp-card__titel { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crp-griff { cursor: grab; color: var(--muted); user-select: none; font-size: 15px; }
.crp-card__body[data-href] { cursor: pointer; }
.crp-empty { color: var(--muted); font-size: 13px; margin: 6px 0; }

.crp-kpi { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; }
.crp-kpi__zahl { font-size: 40px; font-weight: 700; color: var(--blau); line-height: 1; font-variant-numeric: tabular-nums; }
.crp-kpi--zero .crp-kpi__zahl { color: var(--muted); }
.crp-kpi__label { font-size: 13px; color: var(--muted); }

.crp-liste-huelle { overflow-x: auto; }
.crp-liste { width: 100%; border-collapse: collapse; font-size: 13px; }
.crp-liste th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.crp-liste td { padding: 4px 8px; border-bottom: 1px solid var(--rand); }

/* SVG-Diagramme */
.crp-svg { width: 100%; height: auto; max-height: 240px; }
.crp-svg--pie { max-width: 170px; flex: 0 0 auto; }
.crp-pie-wrap { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.crp-grid { stroke: var(--rand); stroke-width: 1; }
.crp-axis { fill: var(--muted); font-size: 9px; }
.crp-line { stroke: var(--blau); stroke-width: 2; }
.crp-bar, .crp-dot, .crp-slice { fill: var(--ch, #5AA9E6); }
.crp-slice { stroke: var(--card); stroke-width: 1; }
.crp-legende { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.crp-legende li { display: flex; align-items: center; gap: 6px; }
.crp-leg-punkt { width: 11px; height: 11px; border-radius: 3px; background: var(--ch, #5AA9E6); flex: 0 0 auto; }
.crp-leg-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crp-leg-wert { color: var(--muted); font-variant-numeric: tabular-nums; }
.ch-c0 { --ch: #5AA9E6; } .ch-c1 { --ch: #3BA55D; } .ch-c2 { --ch: #FF7A00; } .ch-c3 { --ch: #7C6BF0; }
.ch-c4 { --ch: #17A2B8; } .ch-c5 { --ch: #E5487D; } .ch-c6 { --ch: #E0A800; } .ch-c7 { --ch: #6C7A89; }

/* Editoren */
.crp-form { max-width: 720px; }
.crp-form > label { display: block; margin: 12px 0; font-weight: 600; }
.crp-form > label input, .crp-form > label select { display: block; width: 100%; margin-top: 4px; box-sizing: border-box; font-weight: 400; }
.crp-block { border-top: 1px solid var(--rand); margin-top: 14px; padding-top: 6px; }
.crp-block > label { display: block; margin: 10px 0; font-weight: 600; }
.crp-block > label input, .crp-block > label select { display: block; width: 100%; max-width: 360px; margin-top: 4px; box-sizing: border-box; font-weight: 400; }
.crp-feldgruppe { margin: 12px 0; }
.crp-check { display: block; font-weight: 400; margin: 3px 0; }
.crp-filter-zeile { display: flex; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.crp-filter-zeile select, .crp-filter-zeile input { flex: 1 1 120px; min-width: 0; }
.crp-filter-weg { flex: 0 0 auto; }
.crp-rep-liste { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.crp-rep-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--card); }
.crp-rep-item.dragging { opacity: .5; }
.crp-actions { white-space: nowrap; }
.knopf-gefahr { color: #E5484D; }

/* ── Dokumentmodul ── */
.chip-tag { background: rgba(90, 169, 230, .16); color: var(--text); }
.chip-warn { background: #F6C177; color: #4a2c00; }
.dok-upload { margin: 0 0 14px; }
.dok-upload > summary { cursor: pointer; font-weight: 600; color: var(--blau); }
.dok-upload-form { margin-top: 10px; display: grid; gap: 10px; max-width: 720px; }
.dok-block { max-width: 100%; }
.dok-aktuell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dok-neue-version { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.dok-tags-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.dok-tags-form { display: flex; gap: 6px; }
.dok-tags-form input { flex: 1; min-width: 0; }

/* ── Messenger ── */
.menu-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--akz); color: #3a2600; font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle; }
/* hidden-Attribut muss gewinnen — sonst überschreiben die display:flex/grid-Regeln unten das Verstecken. */
.msngr [hidden] { display: none !important; }
.msngr { display: grid; grid-template-columns: 300px 1fr; grid-template-rows: minmax(0, 1fr); gap: 16px; height: 72vh; min-height: 420px; }
.msngr-liste { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--rand); padding-right: 12px; }
.msngr-liste-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.msngr-neu-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: var(--blau); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; margin-bottom: 10px; }
.msngr-neu-btn:hover { filter: brightness(1.06); }
.msngr-std-ben { font-size: 12px; margin-bottom: 8px; }
.msngr-std-ben select { width: 100%; }
.msngr-konvs { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.msngr-konv { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; position: relative; }
.msngr-konv:hover, .msngr-konv.aktiv { background: rgba(90,169,230,.10); }
.msngr-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--rand); }
.msngr-gruppe-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--blau); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.msngr-konv-txt { min-width: 0; flex: 1; }
.msngr-konv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msngr-konv-vorschau { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msngr-unread { background: var(--akz); color: #3a2600; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; flex: 0 0 auto; }
.msngr-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.msngr-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.msngr-chat-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rand); }
.msngr-kopf-info { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.msngr-kopf-aktionen { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msngr-freq { font-size: 12px; }
.msngr-nachrichten-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msngr-nachrichten { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 4px; }
.msngr-load-more { text-align: center; padding: 6px 0; }
.msngr-msg { max-width: 78%; align-self: flex-start; background: var(--card); border: 1px solid var(--rand); border-radius: 14px; padding: 8px 12px; }
.msngr-msg.eigen { align-self: flex-end; background: rgba(90,169,230,.12); }
.msngr-msg-abs { font-size: 12px; font-weight: 600; color: var(--blau); margin-bottom: 2px; }
.msngr-msg-body { white-space: pre-wrap; word-break: break-word; }
.msngr-msg-body a { color: var(--blau); }
.msngr-msg-zeit { font-size: 11px; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.msngr-msg-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.msngr-eingabe { display: flex; align-items: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--rand); position: relative; }
.msngr-input { flex: 1; min-width: 0; min-height: 42px; max-height: 140px; overflow-y: auto; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--text); box-shadow: inset 3px 3px 7px var(--dunkel), inset -3px -3px 7px var(--hell); white-space: pre-wrap; word-break: break-word; font: inherit; line-height: 1.4; cursor: text; }
.msngr-input:focus { outline: none; }
.msngr-input:empty:before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.msngr-chip { background: rgba(90,169,230,.14); color: var(--blau); font-weight: 600; border-radius: 6px; padding: 1px 6px; margin: 0 1px; white-space: nowrap; }
.msngr-emoji-btn { border: 0; background: none; font-size: 22px; cursor: pointer; line-height: 1; }
.msngr-emoji-palette { position: absolute; bottom: 54px; left: 0; background: var(--card); border: 1px solid var(--rand); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; box-shadow: 4px 4px 12px var(--dunkel); z-index: 5; }
.msngr-emoji { border: 0; background: none; font-size: 20px; cursor: pointer; padding: 2px 4px; }
.msngr-send { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; font-size: 17px; line-height: 1; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 0; }
.msngr-neu-panel { background: rgba(90,169,230,.06); border: 1px solid var(--rand); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.msngr-suche { width: 100%; box-sizing: border-box; margin: 6px 0; }
.msngr-such-ergebnis { max-height: 180px; overflow-y: auto; }
.msngr-such-treffer { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; cursor: pointer; }
.msngr-such-treffer:hover { background: rgba(90,169,230,.10); }
.msngr-auswahl { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.msngr-rollen-wahl { max-height: 120px; overflow-y: auto; margin-top: 4px; }
.msngr-rollen-titel { font-size: 12px; margin: 6px 0 2px; }
.msngr-neu-fuss { margin-top: 10px; display: flex; gap: 8px; }
.msngr-mitglieder-panel { background: rgba(90,169,230,.06); border: 1px solid var(--rand); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.msngr-mp-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.msngr-mp-kopf button { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.msngr-mp-rename { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.msngr-mp-rename span { display: flex; gap: 6px; margin-top: 3px; }
.msngr-mp-rename input { flex: 1; min-width: 0; }
.msngr-mp-liste { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.msngr-mp-liste li { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.msngr-mp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msngr-mp-admin { color: var(--akz); }
.msngr-mp-del { border: 0; background: none; color: #E5484D; font-size: 16px; cursor: pointer; padding: 0 4px; }
.msngr-mp-add input { width: 100%; box-sizing: border-box; }
.msngr-mp-fuss { margin-top: 8px; text-align: right; }
.msngr-link-btn { border: 0; background: none; font-size: 20px; cursor: pointer; line-height: 1; padding: 0; color: var(--muted); }
.msngr-link-btn:hover { color: var(--blau); }
.msngr-objsuche { padding-top: 8px; }
.msngr-objsuche-feld { width: 100%; box-sizing: border-box; }
.msngr-objsuche-erg { max-height: 200px; overflow-y: auto; margin-top: 4px; }
.msngr-objsuche-treffer { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.msngr-objsuche-treffer:hover { background: rgba(90,169,230,.10); }
.msngr-objsuche-typ { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.msngr-objsuche-leer { padding: 6px 8px; font-size: 13px; }
.msngr-objlink { color: var(--blau); text-decoration: none; font-weight: 600; background: rgba(90,169,230,.10); border-radius: 6px; padding: 0 4px; }
.msngr-objlink:hover { text-decoration: underline; }
@media (max-width: 720px) {
	.msngr { grid-template-columns: 1fr; height: auto; }
	.msngr-liste { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--rand); padding-bottom: 10px; }
	.msngr-konvs { max-height: 34vh; }
	.msngr-nachrichten { max-height: 52vh; }
}

/* ── Formulare ── */
.ff-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ff-karte { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 6px 6px 14px var(--dunkel), -6px -6px 14px var(--hell); }
.ff-karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ff-offen-titel { font-size: 12px; margin: 10px 0 4px; }
.ff-offen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ff-form { max-width: 640px; }
.ff-form .feld { margin: 12px 0; }
.ff-form label { font-weight: 600; display: block; }
.ff-form .feld > label { margin-bottom: 3px; }
.ff-aktionen { margin-top: 16px; }
/* öffentliches Web-Formular */
.ffw-body { background: var(--bg, #F2FAFF); margin: 0; }
.ffw-huelle { max-width: 640px; margin: 0 auto; padding: 22px 18px; }
.ffw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ffw-captcha-bild { margin: 6px 0; }
.ffw-erfolg { background: var(--card); border-radius: 14px; padding: 20px; text-align: center; font-size: 16px; }
/* Editor */
.ff-editor label { display: block; font-weight: 600; margin: 12px 0; }
.ff-editor label input, .ff-editor label select, .ff-editor label textarea { display: block; width: 100%; max-width: 480px; box-sizing: border-box; margin-top: 4px; font-weight: 400; }
.ff-ed-felder { margin-top: 8px; }
.ff-ed-feld { border: 1px solid var(--rand); border-radius: 10px; padding: 8px 10px; margin: 6px 0; background: var(--card); }
.ff-ed-feld.an { border-color: var(--blau); }
.ff-ed-feld-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ff-ed-inc { font-weight: 400; margin: 0; display: flex; align-items: center; gap: 6px; }
.ff-ed-ord { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.ff-ord-btn { width: 28px; height: 28px; border: 0; background: none; color: var(--text); border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ff-ord-btn:hover:not(:disabled) { background: rgba(0,0,0,.06); }
.ff-ord-btn:disabled { opacity: .28; cursor: default; }
.ff-ed-feld-opt { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--rand); }
.ff-ed-feld-opt label { margin: 6px 0; font-weight: 400; }
.ff-ed-cond { margin-top: 6px; }
.ff-ed-cond-kopf { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ff-ed-rule { display: flex; gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.ff-ed-rule select, .ff-ed-rule input { flex: 1 1 120px; min-width: 0; margin: 0; }
.ff-snippet textarea { width: 100%; max-width: 100%; box-sizing: border-box; font-family: var(--mono, monospace); font-size: 12px; }
.knopf-link { border: 0; background: none; color: var(--blau); cursor: pointer; padding: 2px 0; font-size: 13px; }

/* ── Termine ── */
.tm-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 20px; }
.tm-add select, .tm-add input { min-width: 0; }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; max-width: 720px; }
.tm-editor label { display: block; font-weight: 600; margin: 10px 0; }
.tm-editor .tm-grid label { margin: 0; }
.tm-editor label input, .tm-editor label select, .tm-editor label textarea { display: block; width: 100%; max-width: 480px; box-sizing: border-box; margin-top: 4px; font-weight: 400; }
.tm-editor .tm-grid label input { max-width: 100%; }
.tm-hosts { display: flex; flex-direction: column; gap: 2px; max-width: 480px; }
.tm-snippet textarea { width: 100%; max-width: 100%; box-sizing: border-box; font-family: ui-monospace, "Fira Code", monospace; font-size: 12px; }
/* öffentliche Buchung */
.tm-slotwahl { margin: 12px 0; }
.tm-tag { margin-bottom: 12px; }
.tm-tag-titel { font-weight: 600; margin-bottom: 4px; }
.tm-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-slot { border: 1px solid var(--blau); background: var(--card); color: var(--blau); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-weight: 600; }
.tm-slot:hover { background: rgba(90,169,230,.12); }
.tm-slot.aktiv { background: var(--blau); color: #fff; }
.tm-formfelder { border-top: 1px solid var(--rand); margin-top: 14px; padding-top: 12px; }
.tm-gewaehlt { color: var(--blau); font-weight: 700; }

/* ── Konnektoren/API + Erweiterungen ── */
.karte { border: 1px solid var(--rand); border-radius: 14px; background: var(--card); padding: 18px 20px; margin: 16px 0; }
.karte.schmal { max-width: 560px; }
.karte > h2 { margin-top: 0; }
.mt { margin-top: 14px; }
.stapel { display: flex; flex-direction: column; gap: 10px; }
.stapel label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.stapel label input, .stapel label select, .stapel label textarea { font-weight: 400; padding: 7px 9px; border: 1px solid var(--rand); border-radius: 8px; background: var(--card); color: var(--text); box-sizing: border-box; }
.stapel fieldset { border: 1px solid var(--rand); border-radius: 8px; padding: 8px 12px; }
.reihe { display: flex; gap: 14px; flex-wrap: wrap; }
.reihe label { flex: 1 1 180px; }
.tabelle-scroll { overflow-x: auto; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--rand); color: var(--muted); white-space: nowrap; }
.pill-ok { background: rgba(46,158,91,.16); color: #2e9e5b; }
.pill-warn { background: rgba(180,35,24,.14); color: #b42318; }
button.klein, .klein { font-size: 12px; padding: 4px 10px; }
button.warnung, .warnung { background: #b42318; border-color: #b42318; color: #fff; }
button.warnung:hover { background: #97200f; }
.geheimnis { background: var(--rand); color: var(--text); }
.ext-liste { display: flex; flex-direction: column; gap: 12px; }
.ext-karte .ext-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ext-karte .ext-kopf h2 { margin: 0; }
.ext-aktion form { display: inline; }

/* ── Prozessmenü + frei anordenbare Bubbles ── */
.bubbles-sortier { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.bubble[data-bubble] { position: relative; }
.bubble.prozess { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.bubble-drag { position: absolute; top: 8px; right: 10px; z-index: 2; cursor: grab; color: var(--muted); font-size: 14px; line-height: 1; user-select: none; padding: 2px 4px; border-radius: 6px; }
/* Platz für den Griff schaffen, damit er nicht mit dem ALEx-Reset kollidiert. */
.bubble.alex .alex-kopf { padding-right: 22px; }
.bubble-drag:active { cursor: grabbing; }
.bubble-drag:hover { background: rgba(90, 169, 230, .12); color: var(--text); }
.bubble.ziehe { opacity: .5; }
.prozess-extern { font-size: 11px; color: var(--muted); }
.menu-mobil-swap { display: none; }
/* Admin-Prozessmenü: Aktionsspalte je Eintrag */
.pm-akt { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pm-akt form { display: inline; }
.pm-edit { width: 100%; }

/* Profil-Verlinkung von Namen (Messenger, Infomodul, Post u. a.) — erbt die Textfarbe, dezenter Hover */
.profil-link { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════════════════════════════════
   DESIGNLINIE „RUHIGES HIGHTECH" — Override-Ebene (Konzept: Doku/cormag-2.0/konzept-designlinie.md)
   Flach + Haarlinie + EIN dezenter Schatten (nur Content-Karten/Overlays). Sidebar = flaches Chrome.
   Tokens kommen aus /design.css (hell + dunkel). Diese Ebene steht bewusst am Dateiende (gewinnt per
   Quellreihenfolge bei gleicher Spezifität) — deshalb kein Umbau der 900 Zeilen darüber nötig.
   ══════════════════════════════════════════════════════════════════════════ */

/* — Schriften: lokal vorgehalten, KEIN externes Nachladen (siehe public/assets/fonts/README.md) — */
@font-face{ font-family:"Sora"; src:url("/assets/fonts/Sora-SemiBold.woff2") format("woff2"); font-weight:600; font-display:swap }
@font-face{ font-family:"Sora"; src:url("/assets/fonts/Sora-Bold.woff2") format("woff2"); font-weight:700; font-display:swap }
@font-face{ font-family:"Public Sans"; src:url("/assets/fonts/PublicSans-Regular.woff2") format("woff2"); font-weight:400; font-display:swap }
@font-face{ font-family:"Public Sans"; src:url("/assets/fonts/PublicSans-Medium.woff2") format("woff2"); font-weight:500; font-display:swap }
@font-face{ font-family:"Public Sans"; src:url("/assets/fonts/PublicSans-SemiBold.woff2") format("woff2"); font-weight:600; font-display:swap }
@font-face{ font-family:"Public Sans"; src:url("/assets/fonts/PublicSans-Bold.woff2") format("woff2"); font-weight:700; font-display:swap }
@font-face{ font-family:"JetBrains Mono"; src:url("/assets/fonts/JetBrainsMono-Medium.woff2") format("woff2"); font-weight:500; font-display:swap }
:root{
  --font-ui:"Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-disp:"Sora", system-ui, sans-serif;
  --font-mono:"JetBrains Mono", ui-monospace, "Fira Code", Menlo, Consolas, monospace;
}
body{ font-family:var(--font-ui); }
h1, h2, h3, h4 { font-family:var(--font-disp); letter-spacing:-.01em; }
.uhr, .mono, .crp-kpi__zahl, .kachel strong, .sa-num, .start-post-zahl strong, td.num, th.num { font-family:var(--font-mono); font-variant-numeric:tabular-nums; }

/* — Buttons: flach, rechteckig, dezenter Klick-„Reindrück" (kein Verlauf, keine Pille) — */
button, .knopf {
  border-radius:var(--radius-s); background:var(--brand); color:var(--on-brand); box-shadow:none;
  font-weight:600; padding:9px 17px;
  transition:filter .15s ease, background .15s ease, color .15s ease, transform .08s ease, box-shadow .12s ease;
}
/* Hover über HELLIGKEIT statt Hintergrundwechsel: respektiert die eigene Fläche jedes Buttons —
   Karten, Filter-Chips und Icon-Buttons werden dadurch NICHT mehr blau überfüllt (Kontrast bleibt). */
button:hover, .knopf:hover { filter:brightness(0.95); transform:none; box-shadow:none; }
button:active, .knopf:active { transform:translateY(1px) scale(.99); filter:brightness(0.9); }
@media (prefers-reduced-motion:reduce){ button:active, .knopf:active { transform:none; } }
.knopf-sek { background:var(--card); color:var(--text); border:1px solid var(--rand); box-shadow:none; }
.knopf-sek:hover { background:var(--surface-2); color:var(--text); filter:none; }
.knopf-akz, .knopf-warn, .knopf-sek.knopf-akz { background:var(--akz); color:var(--on-akz); border-color:transparent; }
.vtyp, .modul-kachel, .post-tab, .tm-slot, .ans-umschalter, .kal-sub { box-shadow:none; }
.vtyp.aktiv, .ans-tab.aktiv, .post-tab.aktiv, .tm-slot.aktiv { background:var(--brand); color:var(--on-brand); box-shadow:none; }

/* — Eingaben: flach + Haarlinie + klarer Fokusring (kein Inset-Neumorph) — */
input, select, textarea, .msngr-input {
  border:1px solid var(--rand); border-radius:var(--radius-s); background:var(--card); color:var(--text); box-shadow:none;
}
input:focus, select:focus, textarea:focus, .msngr-input:focus {
  outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);
}
input[type="checkbox"], input[type="radio"] { box-shadow:none; }
/* Browser-Autofill (gelbe Felder) neutralisieren — Fläche + Text konsistent in Hell & Dunkel.
   Der Inset-Boxshadow überdeckt die vom Browser erzwungene gelbe Autofill-Fläche. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color:var(--text);
  -webkit-box-shadow:0 0 0 1000px var(--card) inset;
  box-shadow:0 0 0 1000px var(--card) inset;
  caret-color:var(--text);
  border:1px solid var(--rand);
  transition:background-color 9999s ease-out 0s;
}
input:-webkit-autofill:focus, textarea:-webkit-autofill:focus, select:-webkit-autofill:focus {
  -webkit-box-shadow:0 0 0 1000px var(--card) inset, 0 0 0 3px var(--brand-ring);
  box-shadow:0 0 0 1000px var(--card) inset, 0 0 0 3px var(--brand-ring);
  border-color:var(--brand);
}
.ans-umschalter, .kal-sub, .typ-filter > summary { box-shadow:none; border:1px solid var(--rand); }

/* — Tabellen: flach, getönter Kopf, spaltenbündige Zahlen — */
.tabelle { border:1px solid var(--rand); border-radius:var(--radius-m); box-shadow:none; }
.tabelle thead th, .tabelle.grid thead th { background:var(--surface-2); color:var(--text); border-bottom:1px solid var(--rand); }
.tabelle.grid thead th { box-shadow:inset 0 -1px 0 var(--rand); }
.tabelle tbody tr:nth-child(even) td { background:transparent; }
.tabelle tbody tr:hover td, tr.klickbar:hover, tr.klickbar:hover td { background:var(--brand-soft); }

/* — Content-Karten: flach + Haarlinie + EINE dezente Elevation (heben sich vom Chrome ab) — */
.karte, .bereich-kachel, .crp-card, .ff-karte, .eh-quadrant,
.start-aufgaben, .start-post, .kachel, .modul-box, .hist {
  border:1px solid var(--rand); box-shadow:var(--elev-card);
}
.kachel { border-radius:var(--radius-m); }
a.kachel:hover, button.modul-kachel:hover { box-shadow:var(--elev-card-h); }
.modul-kachel { box-shadow:var(--elev-card); }
button.modul-kachel:hover { border-color:var(--brand); }
.modul-kachel.aktiv .modul-status { color:var(--ok); }

/* — Chips / Pills — */
.chip { background:var(--brand-soft); color:var(--brand-strong); }
.chip-admin { background:var(--akz); color:var(--on-akz); }
.pill { background:var(--surface-3); color:var(--muted); }
.pill-ok, .ext-chip.ext-ja { background:var(--ok-soft); color:var(--ok); }
.pill-warn, .ext-chip.ext-nein { background:var(--crit-soft); color:var(--crit); }

/* — Reiter (Kopf-Navigation) — */
.reiter strong, .reiter a.reiter-tab.aktiv { color:var(--brand); border-bottom-color:var(--brand); }

/* ── App-Shell: Sidebar-Rail + Content = EIN zusammenhängender Rahmen (kein Spalt dazwischen) ── */
.app-body { background:var(--bg); }
.shell { gap:0; }
.shell .bubble { box-shadow:none; }
/* Content-Fläche rechts: schließt bündig an die Sidebar an; die Trennlinie ist die rechte Rail-Kante.
   `.shell .inhalt` (Spezifität 0,2,0) schlägt die alte `.shell .bubble`-Rundung → linke Ecken bleiben eckig. */
.shell .inhalt { background:var(--card); border:1px solid var(--rand); border-left:0; border-radius:0 var(--radius-l) var(--radius-l) 0; padding:0; overflow:hidden; display:flex; flex-direction:column; }
/* Content-Header (durchgehende Kopfzeile; bleibt beim Scrollen oben) */
.ch { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 22px; border-bottom:1px solid var(--rand); background:var(--surface-2); }
.ch-crumb { font-family:var(--font-disp); font-weight:600; font-size:15px; display:flex; align-items:center; gap:8px; min-width:0; }
.ch-crumb .ch-seg, .ch-crumb .ch-sep { color:var(--muted); font-weight:600; text-decoration:none; }
.ch-crumb .ch-seg:hover { color:var(--brand); }
.ch-crumb .ch-cur { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ch-akt { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.ch-body { flex:1; min-height:0; overflow-y:auto; padding:20px 22px; }
/* Linke Spalte = ruhiger, flacher Rail; Bereiche nur durch eine SICHTBARE Haarlinie (--rand) getrennt. */
.spalte { gap:0; background:var(--surface-2); border:1px solid var(--rand); border-radius:var(--radius-l) 0 0 var(--radius-l); overflow:hidden; }
.spalte .bubble { background:transparent; border-radius:0; box-shadow:none; border-bottom:1px solid var(--rand); }
/* Status = Rail-Ton (--surface-2) — DERSELBE Farbton wie der Content-Header (.ch), der sich damit
   gemeinsam vom Card-Content abhebt (durchgehende, leicht getönte Kopfzeile links+rechts). */
/* ALEx: nur der Dialogbereich bekommt einen dezenten Rahmen (siehe .alex-verlauf). */
/* Status bleibt fix oben (Teil des Rails); die verschiebbaren Bereiche scrollen bei Bedarf. */
.spalte .bubbles-sortier { gap:0; flex:1; min-height:0; overflow-y:auto; }
.spalte .bubbles-sortier > .bubble:last-child { border-bottom:0; }
.spalte .bubble.ziehe { background:var(--card); box-shadow:var(--shadow); border-radius:var(--radius-m); }
.bubble-drag:hover { background:var(--brand-soft); color:var(--brand); }

/* Menü-Einträge mit Icon; Aktiv = ruhige Brand-Pille mit Akzentkante (statt knalliger Vollfläche) */
.menu-eintrag { display:flex; align-items:center; gap:11px; border-radius:var(--radius-s); }
.menu-icon { flex:0 0 auto; display:inline-flex; color:var(--muted); }
.menu-icon svg { width:18px; height:18px; }
.menu-icon:empty { display:none; }
.menu-text { min-width:0; flex:1; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.menu-eintrag:hover .menu-icon { color:var(--brand); }
.menu-eintrag.aktiv { background:var(--brand-soft); color:var(--brand-strong); box-shadow:inset 3px 0 0 var(--brand); }
.menu-eintrag.aktiv .menu-icon { color:var(--brand); }
.info-sub-tab.aktiv { background:var(--brand-soft); color:var(--brand-strong); }

/* ── Theme-Umschalter (Auto / Hell / Dunkel) im Status-Band ── */
.theme-schalter { display:flex; gap:2px; margin-top:12px; background:var(--surface-2); border:1px solid var(--rand); border-radius:999px; padding:3px; }
.theme-schalter button {
  flex:1; font-family:var(--font-ui); font-size:11px; font-weight:600; color:var(--muted);
  background:transparent; border:0; box-shadow:none; border-radius:999px; padding:6px 4px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:5px; transition:background .15s, color .15s;
}
.theme-schalter button:hover { background:transparent; color:var(--text); transform:none; }
.theme-schalter button[aria-pressed="true"] { background:var(--brand-soft); color:var(--brand-strong); }
.theme-schalter svg { width:13px; height:13px; }

/* Mobil: Rail-Rahmen zurücknehmen, damit die Bottom-Sheet-Logik (Spalte scrollt/positioniert frei) greift. */
@media (max-width: 820px) {
  .spalte { background:transparent; border:0; border-radius:0; overflow:visible; }
  .shell .inhalt { border:0; border-radius:0; overflow:visible; display:block; }
  .ch { padding:12px 16px; }
  .ch-body { overflow:visible; padding:16px 16px; }
}
/* ALEx-Chat: eigene Nachrichten in Markenfläche mit passendem Textkontrast (auch im Dark-Mode lesbar). */
.alex-user { background:var(--brand); color:var(--on-brand); }
.profil-link:hover { text-decoration: underline; text-decoration-color: var(--blau); }
.post-verantw-profil { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--blau); }

/* Profilansicht (schreibgeschützt) */
.pv-kopf { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.pv-kopf h1 { margin: 0; }
.pv-titel { margin: 2px 0 0; }
.avatar-gross { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.avatar-leer { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #8DC6F0, var(--blau)); color: #fff; font-size: 30px; font-weight: 700; }
.pv-bemerkung { margin-top: 10px; }

/* Organigramm (Rollenbaum) */
.org-baeume { display: flex; flex-direction: column; gap: 28px; }
.org-knoten { display: inline-block; border: 1px solid var(--rand); border-radius: 12px; background: var(--card); padding: 10px 14px; min-width: 200px; box-shadow: 2px 2px 6px var(--dunkel); }
.org-rolle { font-weight: 700; color: var(--text); text-decoration: none; display: block; }
a.org-rolle:hover { color: var(--blau); text-decoration: underline; }

/* Organisation: Prozessbeschreibungen (Ebenen) */
.pb-bubbles { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.pb-bubble { display: flex; flex-direction: column; gap: 4px; min-width: 200px; max-width: 260px; text-decoration: none; color: var(--text); }
.pb-bubble:hover { border-color: var(--blau); }
.pb-icon { font-size: 26px; }
.pb-bubble-name { font-weight: 700; }
.pb-liste, .pb-schritte { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pb-zeile, .pb-schritt { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); padding: 10px 14px; }
.pb-zeile:hover, .pb-schritt:hover { border-color: var(--blau); }
.pb-zeile-name, .pb-schritt-name { flex: 1; font-weight: 600; }
.pb-schritt-nr { min-width: 2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pb-schritt-typ { font-size: 18px; }
.pb-flags { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pb-flags li { display: flex; align-items: center; gap: 8px; }
.pb-beschreibung, .pb-bubble-be { margin-top: 6px; }
.org-bed-row { align-items: center; gap: 8px; margin-bottom: 6px; }
.org-bed-row select, .org-bed-row input { min-width: 120px; }
.org-akt-row { padding: 10px 12px; margin: 8px 0; }
.org-akt-row [data-akt-params]:empty { display: none; }
.org-users { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.org-user { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.org-user:hover { background: rgba(90, 169, 230, .12); }
.org-user-leer:hover { background: none; }
.org-ava { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.org-ava-leer { display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; }
.org-kinder { list-style: none; margin: 0 0 0 18px; padding: 0; display: flex; flex-direction: column; }
.org-kinder > li { position: relative; padding: 12px 0 0 22px; }
/* Vertikale Linie: beim letzten Kind nur bis zur Abzweigung, sonst weiter zum nächsten Geschwister. */
.org-kinder > li::before { content: ''; position: absolute; left: 0; top: 0; height: 30px; border-left: 2px solid var(--rand); }
.org-kinder > li:not(:last-child)::before { height: 100%; }
/* Horizontale Abzweigung zum Knoten. */
.org-kinder > li::after { content: ''; position: absolute; left: 0; top: 30px; width: 20px; border-top: 2px solid var(--rand); }

/* Übersicht: Kennzahlen-Dashboard unter dem Kalender */
.uebersicht-reports { margin-top: 24px; }
.uebersicht-reports-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.uebersicht-reports-kopf h2 { margin: 0; }
.ur-wahl { font-size: 14px; color: var(--muted); }
.ur-wahl select { margin-left: 6px; }
.ur-inhalt:empty { display: none; }

/* Flußdiagramm (Organisation, 3e) */
.fd-wrap { overflow-x: auto; margin: 8px 0 4px; }
.fd-svg { display: block; max-width: 100%; height: auto; }
.fd-box { fill: var(--card); stroke: var(--rand); stroke-width: 1.5; }
.fd-aktion { stroke: var(--blau); }
.fd-verzweigung { stroke: var(--akz); stroke-dasharray: 5 3; }
.fd-manuell { stroke: var(--muted); }
.fd-svg a { cursor: pointer; }
/* Hover theme-aware: vorher hartes #E9F4FD → im Dark-Mode fast weiß, heller Text darauf verschwand. */
.fd-svg a:hover .fd-box { fill: var(--surface-3); stroke: var(--brand); }
.fd-nr { fill: var(--muted); font-size: 11px; font-weight: 700; }
.fd-name { fill: var(--text); font-size: 13px; font-weight: 600; }
.fd-trig { fill: var(--muted); font-size: 10.5px; }
.fd-trig-warn { fill: var(--akz); }
.fd-rolle { fill: var(--muted); font-size: 10.5px; }
.fd-start { fill: var(--ok); }
.fd-kante { fill: none; stroke: var(--blau); stroke-width: 1.6; }
.fd-kante-txt { fill: var(--muted); font-size: 10px; }
.fd-pfeil-f { fill: var(--blau); }
.fd-kante-seq { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .6; }
.fd-pfeil-seq-f { fill: var(--muted); opacity: .8; }
/* Rückkante (Loop, zurücklaufend) — seitlich außen geführt, gestrichelt in Akzentfarbe */
.fd-kante-rueck { fill: none; stroke: var(--akz); stroke-width: 1.6; stroke-dasharray: 5 3; }
.fd-kante-rueck-txt { fill: var(--akz); font-size: 10px; }
.fd-pfeil-rueck-f { fill: var(--akz); }
/* Vorgangs-Status-Pills (Organisation) */
.pill-live { background: rgba(90,169,230,.18); color: #2f7dbf; }
.pill-warten { background: rgba(255,122,0,.16); color: #c65f00; }

/* ══════════════════════════════════════════════════════════════════════════
   DESIGNLINIE — Dark-Mode / Token-Konsistenz (Rollout über alle Module).
   Hartkodierte Farben, die im Dunkelmodus nicht mitziehen, werden hier zentral
   auf das Token-System gelegt. Steht am Dateiende → gewinnt per Quellreihenfolge.
   ══════════════════════════════════════════════════════════════════════════ */

/* Hinweis-/Flash-Boxen */
.flash-warn { background:var(--warn-soft); color:var(--warn); }
.flash-info { background:var(--brand-soft); color:var(--brand-strong); }
.alex-fehler { background:var(--crit-soft); color:var(--crit); }

/* Semantik: Grün (OK) */
.post-ok, .modul-kachel.aktiv .modul-status { color:var(--ok); }
.post-ki, .post-anhang-dok { background:var(--ok-soft); color:var(--ok); }
.hist-anlegen, .hist-wiederhergestellt { border-left-color:var(--ok); }
.sa-check { background:var(--ok); color:#fff; }
.post-msg.post-outbound { background:var(--ok-soft); border-color:var(--ok-soft); }

/* Semantik: Rot (kritisch) */
.knopf-gefahr, .sa-ueberf-n, .alex-mic.an, .msngr-mp-del, .knopf-link:hover,
.ua-del:hover, .zeit-del:hover, .fdel:hover, .vkn-trennen:hover, .maske-chip-x:hover { color:var(--crit); }
.hist-archivieren { border-left-color:var(--crit); }
button.warnung, .warnung { background:var(--crit); border-color:var(--crit); color:#fff; }

/* Semantik: Amber (Warnung / Notizen / Sperren) */
.chip-warn { background:var(--warn-soft); color:var(--warn); }
.post-msg.post-notiz, .post-lock { background:var(--warn-soft); border-color:var(--warn-soft); }
.pill-warten { background:var(--warn-soft); color:var(--warn); }
.eh-delegieren { border-top-color:var(--warn); }

/* Blaue Tints → Brand (Hover / Auswahl / Chips / Kanten) */
.kanban-karte:hover, .ua-item:hover, .zeit-item:hover, .eh-karte:hover,
.vkn-treffer-item:hover, .maske-treffer-item:hover, .fvkn-item:hover,
.msngr-konv:hover, .msngr-konv.aktiv, .msngr-such-treffer:hover, .msngr-objsuche-treffer:hover,
.post-tag:hover, .kal-eintrag:hover { background:var(--brand-soft); }
.msngr-msg.eigen, .chip-tag, .post-tag-chip, .kal-eintrag { background:var(--brand-soft); }
.pill-live { background:var(--brand-soft); color:var(--brand-strong); }
.eh-planen { border-top-color:var(--brand); }
.eh-spaeter { border-top-color:var(--muted); }
.sa-ring-track { stroke:var(--rand); }
.kanban-karte { border-left-color:var(--brand); }
.msngr-msg-abs, .crp-kpi__zahl, .post-verantw-profil { color:var(--brand); }

/* Textfarbe auf blauen Markenflächen → --on-brand (Dark-Mode-Lesbarkeit) */
.msngr-neu-btn { background:var(--brand); color:var(--on-brand); }
.msngr-gruppe-icon, .msngr-send { color:var(--on-brand); }
.avatar-leer { background:var(--brand); color:var(--on-brand); }

/* ALEx-Bot-Bubble etwas heller als der Rail-Grund */
.alex-bot { background:var(--surface-2); }

/* ── Admin: Bereichs-Navigation — kompakter Button HINTER dem Breadcrumb (per JS in den Header verschoben);
   Klick → vollbreites Raster gleitet bündig unter dem Header nach unten (WordPress-„Ansicht-anpassen"-Muster).
   Klick-gesteuert (kein Hover-Overfill), smoothes grid-template-rows-Ausklappen, Raster statt Endlos-Liste. ── */
.secnav { margin:-20px -22px 20px; }
.secnav-trigger { display:none; align-items:center; gap:6px; margin-left:8px; padding:4px 11px;
  font-family:var(--font-ui); font-size:12.5px; font-weight:600; color:var(--muted);
  background:var(--surface-2); border:1px solid var(--rand); border-radius:999px; cursor:pointer; box-shadow:none; }
.ch .secnav-trigger { display:inline-flex; }              /* erst sichtbar, wenn im Header angekommen */
.secnav-trigger:hover { background:var(--surface-3); color:var(--text); filter:none; }
.secnav-trigger[aria-expanded="true"] { background:var(--brand-soft); color:var(--brand-strong); border-color:transparent; }
.secnav-chev { width:14px; height:14px; transition:transform .3s cubic-bezier(.16,1,.3,1); }
.secnav-trigger[aria-expanded="true"] .secnav-chev { transform:rotate(180deg); }
/* Slide-down: grid-template-rows 0fr→1fr (smooth, ohne feste max-height) */
.secnav-wrap { display:grid; grid-template-rows:0fr; background:var(--card); transition:grid-template-rows .32s cubic-bezier(.16,1,.3,1); }
.secnav.offen .secnav-wrap { grid-template-rows:1fr; }
.secnav-inner { overflow:hidden; min-height:0; }
.secnav-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:4px; padding:14px 22px; border-bottom:1px solid var(--rand); }
.secnav-grid a, .secnav-grid strong { display:flex; align-items:center; padding:10px 13px; border-radius:var(--radius-s);
  text-decoration:none; color:var(--text); font-weight:500; font-size:14px; border:0; margin:0; }
.secnav-grid a:hover { background:var(--brand-soft); color:var(--brand-strong); }
.secnav-grid strong { background:var(--brand-soft); color:var(--brand-strong); font-weight:600; }
/* „Cool": Einträge staffeln beim Öffnen sanft ein */
.secnav-grid > * { opacity:0; transform:translateY(6px); }
.secnav.offen .secnav-grid > * { animation:secnav-in .34s cubic-bezier(.16,1,.3,1) forwards; }
.secnav.offen .secnav-grid > *:nth-child(1){animation-delay:.02s} .secnav.offen .secnav-grid > *:nth-child(2){animation-delay:.05s}
.secnav.offen .secnav-grid > *:nth-child(3){animation-delay:.08s} .secnav.offen .secnav-grid > *:nth-child(4){animation-delay:.11s}
.secnav.offen .secnav-grid > *:nth-child(5){animation-delay:.14s} .secnav.offen .secnav-grid > *:nth-child(6){animation-delay:.17s}
.secnav.offen .secnav-grid > *:nth-child(7){animation-delay:.20s} .secnav.offen .secnav-grid > *:nth-child(8){animation-delay:.23s}
.secnav.offen .secnav-grid > *:nth-child(n+9){animation-delay:.26s}
@keyframes secnav-in { to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) {
  .secnav-wrap, .secnav-chev { transition:none; }
  .secnav-grid > * { opacity:1; transform:none; }
  .secnav.offen .secnav-grid > * { animation:none; }
}

/* Login-/Einzelseiten-Karte (.huelle) auf die neue Materialsprache: flach + Haarlinie + eine Elevation. */
.huelle { border:1px solid var(--rand); box-shadow:var(--elev-card); border-radius:var(--radius-l); }

/* WCAG: Text auf Akzentfarbe nutzt die kontrastsichere Variante (Pflichtfeld-Asterisk etc.). */
.pflicht { color:var(--akz-strong); }

/* Konto: Abmelden dezent rechts (nicht im Ausklapp-Reiter versteckt) */
.konto-abmelden { text-align:right; margin-bottom:12px; }
.konto-abmelden .inline-form { display:inline; }

/* ALEx: Dialogbereich (Verlauf) bekommt einen dezenten 1px-Rahmen, damit der Chat nicht frei im Rail schwebt.
   Der Rest der ALEx-Bubble bleibt flach wie die übrigen Rail-Bereiche. (:empty ist bereits display:none.) */
.alex-verlauf { background:var(--card); border:1px solid var(--rand); border-radius:var(--radius-m); padding:8px; }

/* ── Tourenplanung: Plantafel (selbstgezeichnete Zeitachse) ── */
.tf-controls { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:0 0 14px; }
.tf-tabs { display:inline-flex; border:1px solid var(--rand); border-radius:var(--radius-s); overflow:hidden; }
.tf-tab { padding:6px 14px; color:var(--muted); text-decoration:none; }
.tf-tab.aktiv { background:var(--brand); color:var(--on-brand); }
.tf-nav { display:flex; align-items:center; gap:6px; }
.tf-span { margin-left:6px; color:var(--muted); font-size:.92em; }

.tf-scroll { overflow-x:auto; border:1px solid var(--rand); border-radius:var(--radius-m); background:var(--card); }
.tf-row { display:flex; align-items:stretch; border-top:1px solid var(--rand); }
.tf-headrow { border-top:none; position:sticky; top:0; z-index:2; }
.tf-name { flex:0 0 190px; width:190px; padding:8px 10px; display:flex; align-items:center; gap:8px; background:var(--surface-2); border-right:1px solid var(--rand); font-size:.9em; }
.tf-name-ic { opacity:.7; font-size:.95em; }
.tf-corner { font-weight:600; }
.tf-track { position:relative; flex:1 1 auto; min-width:calc(var(--tf-cols) * 54px); }
.tf-head { display:flex; background:var(--surface-2); }
.tf-col { flex:1 1 0; min-width:0; text-align:center; padding:6px 2px; border-left:1px solid var(--rand); font-size:.78em; color:var(--muted); }
.tf-col:first-child { border-left:none; }
.tf-col span { display:block; font-weight:600; color:var(--text); }
.tf-col small { display:block; font-size:.85em; }
.tf-lane { background-image:linear-gradient(to right, var(--rand) 1px, transparent 1px); background-size:calc(100% / var(--tf-cols)) 100%; }

.tf-bar { position:absolute; height:26px; box-sizing:border-box; padding:2px 6px; border-radius:6px; overflow:hidden; font-size:.76em; line-height:1.15; text-decoration:none; border:1px solid transparent; box-shadow:var(--elev-card); }
.tf-bar-t { display:block; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tf-bar-o { display:block; opacity:.9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
a.tf-bar:hover { filter:brightness(1.06); }
.tf-bar--normal { background:var(--brand); color:var(--on-brand); border-color:var(--brand-strong); }
.tf-bar--konflikt { background:var(--crit); color:#fff; border-color:var(--crit); }
.tf-bar--akzeptiert { background:var(--warn); color:#231600; border-color:var(--warn); }
.tf-bar--sperre { background:var(--surface-3); color:var(--text); border:1px dashed var(--muted); background-image:repeating-linear-gradient(45deg, transparent 0 5px, rgba(128,128,128,.14) 5px 10px); }

.tf-legende { display:flex; flex-wrap:wrap; gap:16px; margin:12px 0; font-size:.85em; color:var(--muted); }
.tf-key { display:inline-block; width:14px; height:14px; border-radius:4px; vertical-align:-2px; margin-right:5px; }
.tf-key--normal { background:var(--brand); }
.tf-key--konflikt { background:var(--crit); }
.tf-key--akzeptiert { background:var(--warn); }
.tf-key--sperre { background:var(--surface-3); border:1px dashed var(--muted); }
.tf-leer { padding:20px; color:var(--muted); }

.tf-form { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:flex-end; }
.tf-form label { display:flex; flex-direction:column; gap:4px; font-size:.85em; color:var(--muted); }
.tf-form label.check-zeile { flex-direction:row; align-items:center; gap:8px; }
.tf-form input, .tf-form select { min-width:150px; }
.tf-form textarea { min-width:260px; width:100%; max-width:520px; }

.tf-badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:.75em; font-weight:600; vertical-align:1px; }
.tf-badge--entwurf { background:var(--surface-3); color:var(--muted); }
.tf-badge--gebucht { background:var(--brand-soft); color:var(--brand-strong); }
.tf-badge--storniert { background:var(--crit-soft); color:var(--crit); }
.tf-badge--abgeschlossen { background:var(--ok-soft); color:var(--ok); }
.tf-badge--konflikt { background:var(--crit-soft); color:var(--crit); }
.tf-badge--akzeptiert { background:var(--warn-soft); color:var(--warn); }
.tf-rowacts { display:flex; gap:10px; align-items:center; white-space:nowrap; }
.tf-grp td { background:var(--surface-2); font-weight:600; }
.tf-toggle { margin:0 0 8px; text-align:right; }
/* Drag & Drop */
.tf-bar { cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }
.tf-bar--drag { opacity:.85; z-index:50; cursor:grabbing; box-shadow:0 4px 14px rgba(0,0,0,.28); pointer-events:none; }
.tf-lane--ziel { outline:2px dashed var(--brand); outline-offset:-2px; background:var(--brand-soft); }

/* Durchsuchbarer Ressourcen-Picker */
.tf-picker { position:relative; display:inline-block; }
.tf-picker-such { min-width:200px; }
.tf-picker-liste { position:absolute; z-index:40; top:100%; left:0; min-width:220px; max-height:240px; overflow-y:auto; margin-top:2px; background:var(--card); border:1px solid var(--rand); border-radius:var(--radius-s); box-shadow:var(--elev-card-h); }
.tf-picker-grp { position:sticky; top:0; padding:4px 10px; font-size:.72em; font-weight:700; letter-spacing:.02em; color:var(--muted); background:var(--surface-2); }
.tf-picker-opt { display:block; width:100%; text-align:left; padding:6px 10px; background:none; border:none; cursor:pointer; color:var(--text); font-size:.9em; }
.tf-picker-opt:hover { background:var(--brand-soft); }
.tf-picker-leer { padding:8px 10px; color:var(--muted); font-size:.85em; }
.tf-picker-fehlt { border-color:var(--crit); box-shadow:0 0 0 3px var(--crit-soft); }

/* Touren-Listen: Sortierung + zuklappbarer Filter */
.tf-filter { margin:0 0 12px; }
.tf-filter-panel { margin-top:8px; padding:10px 12px; background:var(--surface-2); border:1px solid var(--rand); border-radius:var(--radius-s); }
.tf-filter-panel input[type=search] { min-width:240px; }
.tf-th-sort { cursor:pointer; user-select:none; white-space:nowrap; }
.tf-th-sort::after { content:'↕'; opacity:.3; margin-left:6px; font-size:.85em; }
.tf-th-sort[data-dir=asc]::after { content:'↑'; opacity:.85; }
.tf-th-sort[data-dir=desc]::after { content:'↓'; opacity:.85; }

/* ── Zeiterfassung ── */
.zt-form { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:flex-end; }
.zt-form label { display:flex; flex-direction:column; gap:4px; font-size:.85em; color:var(--muted); }
.zt-form label.check-zeile { flex-direction:row; align-items:center; gap:8px; }
.zt-form input, .zt-form select { min-width:150px; }
.zt-form textarea { min-width:260px; width:100%; max-width:520px; }
.zt-jahrnav { margin:0 0 12px; }
.zt-uhr { display:flex; flex-wrap:wrap; align-items:center; gap:18px; margin-bottom:6px; }
.zt-uhr-status { font-size:1.1em; }
.zt-uhr-zeit { font-variant-numeric:tabular-nums; }
.zt-uhr .knopf-akz, .zt-uhr .knopf-warn { padding:10px 22px; font-size:1em; }
.zt-kpi { display:flex; flex-wrap:wrap; gap:12px; margin:8px 0 2px; }
.zt-kpi > div { flex:1 1 120px; background:var(--surface-2); border:1px solid var(--rand); border-radius:var(--radius-s); padding:10px 12px; }
.zt-kpi dt { font-size:.72em; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.zt-kpi dd { margin:2px 0 0; font-size:1.25em; font-weight:600; font-variant-numeric:tabular-nums; }
.zt-plus { color:var(--ok); }
.zt-minus { color:var(--crit); }
.zt-acts { display:flex; gap:10px; align-items:center; white-space:nowrap; }
.zt-checks { display:flex; flex-wrap:wrap; gap:6px 18px; margin:6px 0 12px; }
.zt-badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:.75em; font-weight:600; }
.zt-badge--beantragt { background:var(--warn-soft); color:var(--warn); }
.zt-badge--genehmigt { background:var(--ok-soft); color:var(--ok); }
.zt-badge--abgelehnt { background:var(--crit-soft); color:var(--crit); }
.zt-badge--storniert { background:var(--surface-3); color:var(--muted); }

/* Zeiterfassungs-Status im Kopf (klickbarer Ein-/Ausstempel-Umschalter, neben der Uhr) */
.uhr-zeile { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:nowrap; margin-top:12px; }
.uhr-zeile .uhr { margin-top:0; white-space:nowrap; }
.ze-form { margin:0; flex:0 0 auto; }
.ze-status { display:inline-flex; align-items:center; gap:5px; margin:0; padding:2px 8px; border-radius:999px; font:600 .72em/1.15 inherit; white-space:nowrap; text-decoration:none; cursor:pointer; border:1px solid var(--rand); color:var(--muted); background:var(--surface-2); transition:filter .12s, transform .12s; }
.ze-status:hover { filter:brightness(1.04); transform:translateY(-1px); }
.ze-status:active { transform:translateY(0); }
.ze-status svg { width:12px; height:12px; flex:0 0 auto; }
.ze-status--an { background:var(--ok-soft); color:var(--ok); border-color:transparent; }
.ze-status--an svg { animation:ze-tick 2s steps(1) infinite; }
@keyframes ze-tick { 50% { opacity:.45; } }

/* Nur-Lese-Modus (Schreibschutz): dezentes Hinweisband über dem Inhalt */
.ro-band { margin:0 0 16px; padding:8px 14px; border-radius:var(--radius-s,6px); background:var(--warn-soft); color:var(--warn); border:1px solid var(--rand); font-size:.85em; font-weight:600; }
