/* LIPP Projekt-Dashboard – Stylesheet. Farben als Variablen, Dunkelmodus über Systemeinstellung, Schriftgröße umschaltbar. */
:root {
  --marke: #252E3A; --akzent: #2E75B6; --akzent-hell: #DCE6F1; --rot: #C00000; --gruen: #1E6B23; --gelb-punkt: #E0A800;   /* Grün dunkler: auf der markierten Zeile (--akzent-hell) reichte #2E7D32 nicht für 4,5:1 */
  /* Schrift auf farbiger Fläche (Knopf, Zähler, Plakette). Im Dunkelmodus sind die Farben hell,
     dort wäre Weiß darauf nicht mehr lesbar – deshalb ein eigener Token statt festem #fff. */
  --auf-farbe: #ffffff;
  --bg: #f5f6f8; --flaeche: #ffffff; --flaeche2: #f7f7f7; --text: #222; --grau: #666; --rahmen: #d9d9d9; --linie: #eeeeee;
  --hover: #f0f4fa; --kopf-text: #1f3d5c; --gelb-bg: #FFF3CD; --gelb: #8A6D00; --rot-bg: #FDE8E4;
  --hinweis-bg: #fff8e1; --hinweis-rahmen: #ffe08a; --fehler-bg: #fdecea; --fehler-rahmen: #f5b5b0; --vorschau-bg: #f4f8fc; --erfolg-bg: #e6f4ea; --erfolg-rahmen: #9fd3ab;
  --diagramm-soll: #D9DEE5; --diagramm-raster: #eeeeee; --diagramm-ziel: #E3EEF8;
  --schrift: 15px;
  color-scheme: light;
}
html.gross { --schrift: 17px; }
:root[data-farbschema="dunkel"] {
    --akzent: #6FA8DC; --akzent-hell: #24364A; --rot: #FF8B8B; --gruen: #6CCB7F; --gelb-punkt: #F2C94C;
    --auf-farbe: #10161D;
    --bg: #14181E; --flaeche: #1C2229; --flaeche2: #232B34; --text: #E6EAF0; --grau: #9AA5B1; --rahmen: #33404D; --linie: #2A343F;
    --hover: #243040; --kopf-text: #CFE0F2; --gelb-bg: #3B3410; --gelb: #F2C94C; --rot-bg: #3F1F1C;
    --hinweis-bg: #2E2A16; --hinweis-rahmen: #5A4F1E; --fehler-bg: #3A1F1D; --fehler-rahmen: #6B2E2A; --vorschau-bg: #1E2A36; --erfolg-bg: #1B3324; --erfolg-rahmen: #2E6B45;
    --diagramm-soll: #3A4654; --diagramm-raster: #2A343F; --diagramm-ziel: #1F3446;
    color-scheme: dark;
}
/* Dunkle Farben gelten bei Systemeinstellung dunkel und bei ausdruecklicher Wahl.
   Wer hell waehlt, bekommt sie nicht - daher die Ausnahme im Medienblock. */
@media (prefers-color-scheme: dark) {
  :root:not([data-farbschema="hell"]) {
    --akzent: #6FA8DC; --akzent-hell: #24364A; --rot: #FF8B8B; --gruen: #6CCB7F; --gelb-punkt: #F2C94C;
    --auf-farbe: #10161D;
    --bg: #14181E; --flaeche: #1C2229; --flaeche2: #232B34; --text: #E6EAF0; --grau: #9AA5B1; --rahmen: #33404D; --linie: #2A343F;
    --hover: #243040; --kopf-text: #CFE0F2; --gelb-bg: #3B3410; --gelb: #F2C94C; --rot-bg: #3F1F1C;
    --hinweis-bg: #2E2A16; --hinweis-rahmen: #5A4F1E; --fehler-bg: #3A1F1D; --fehler-rahmen: #6B2E2A; --vorschau-bg: #1E2A36; --erfolg-bg: #1B3324; --erfolg-rahmen: #2E6B45;
    --diagramm-soll: #3A4654; --diagramm-raster: #2A343F; --diagramm-ziel: #1F3446;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: var(--schrift)/1.45 Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--akzent); }
code { font-size: .85em; overflow-wrap: anywhere; }   /* lange Pfade (Eingangsordner) brechen statt aus der Seitenleiste zu ragen */
small, .klein-text { font-size: .86em; }
.stumm { color: var(--grau); }
.gut { color: var(--gruen); }
.warnung { color: var(--rot); font-weight: 600; }
.rechts { text-align: right; }
.nowrap { white-space: nowrap; }
.abstand { margin: 6px 0; }

/* Kopfzeile */
header { background: var(--marke); color: #fff; padding: 8px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header img { height: 40px; width: 40px; display: block; cursor: pointer; }
/* Das LIPP-Logo ist dunkelgrau auf durchsichtig – ohne helle Platte verschwindet es im Dunkelmodus. */
img[src="/logo-lipp.png"] { background: #fff; border-radius: 4px; padding: 3px; box-sizing: border-box; }
header h1 { font-size: 1.15em; margin: 0; flex: 1; min-width: 200px; cursor: pointer; }
header h1 small { display: block; font-size: .7em; font-weight: normal; opacity: .7; letter-spacing: .08em; text-transform: uppercase; }
header .nutzer { font-size: .9em; opacity: .9; }
header button { border-color: rgba(255,255,255,.5); background: transparent; color: #fff; }
header button[aria-pressed="true"] { background: rgba(255,255,255,.2); }

/* Bedienelemente */
button { font: inherit; padding: 6px 12px; border: 1px solid var(--akzent); background: var(--flaeche); color: var(--akzent); border-radius: 4px; cursor: pointer; }
button.primaer { background: var(--akzent); color: var(--auf-farbe); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.klein { padding: 2px 8px; font-size: .86em; }
button.leise { border-color: transparent; padding: 0 6px; font-size: .8em; }
button.warnknopf { border-color: var(--rot); color: var(--rot); }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--rahmen); border-radius: 4px; background: var(--flaeche); color: var(--text); }
label.wahl { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }

/* Rahmen */
main { display: grid; grid-template-columns: 270px 1fr; gap: 16px; padding: 16px 20px; max-width: 1400px; margin: 0 auto; }
aside, section { background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 6px; padding: 14px; min-width: 0; }
aside h2, section h2, section h3 { margin: 0 0 10px; font-size: 1.05em; color: var(--akzent); }
h3 { font-size: 1em; }
#meldung, #erfolg { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; padding: 10px 16px; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 90vw; }
#meldung { background: var(--fehler-bg); border: 1px solid var(--fehler-rahmen); }
#erfolg { background: var(--erfolg-bg); border: 1px solid var(--erfolg-rahmen); }

/* Seitenleiste mit Reitern */
.reiter { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--linie); }
.reiter button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--grau); padding: 6px 10px; }
.reiter button[aria-selected="true"] { color: var(--akzent); border-bottom-color: var(--akzent); font-weight: bold; }
.reiter .zaehler { background: var(--rot); color: var(--auf-farbe); border-radius: 9px; font-size: .75em; padding: 0 6px; margin-left: 4px; }
/* Ladeanzeige: dünner Balken am oberen Rand, solange Anfragen laufen */
#ladebalken { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--akzent), transparent); background-size: 200% 100%; animation: laden 1s linear infinite; z-index: 30; }
@keyframes laden { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.laedt { opacity: .55; pointer-events: none; transition: opacity .15s; }
/* Popover unter einer Zelle, Suchtreffer, Rundgang-Hervorhebung */
.popover { position: absolute; z-index: 25; background: var(--flaeche); border: 1px solid var(--akzent); border-radius: 6px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); min-width: 280px; }
.popover input { width: 100%; }
.suchtreffer { position: absolute; z-index: 24; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-height: 60vh; overflow: auto; width: min(520px, 90vw); padding: 6px 0; font-size: .9em; }
.suchtreffer h4 { margin: 6px 10px 2px; font-size: .8em; color: var(--grau); text-transform: uppercase; letter-spacing: .05em; }
.suchtreffer a { display: block; padding: 5px 10px; color: var(--text); text-decoration: none; } .suchtreffer a:hover { background: var(--hover); }
.suchtreffer mark { background: var(--gelb-bg); color: inherit; }
.hervorgehoben { outline: 3px solid var(--akzent); outline-offset: 3px; border-radius: 4px; transition: outline .2s; }
/* Projektliste */
#filter { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px; font-size: .86em; }
#filter label { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
#filterInfo { font-size: .86em; color: var(--grau); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.projektliste { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow: auto; }
.projektliste li { padding: 7px 8px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; }
.projektliste li:hover { background: var(--hover); } .projektliste li.aktiv { background: var(--akzent-hell); font-weight: bold; }
.projektliste li.mehr { justify-content: center; cursor: default; }
.projektliste small { color: var(--grau); font-weight: normal; }

/* Tabelle */
.tabelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--linie); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { background: var(--akzent-hell); color: var(--kopf-text); font-weight: bold; }
tr.summe td { font-weight: bold; background: var(--flaeche2); border-top: 2px solid var(--akzent); }
tr.abgeleitet td { color: var(--grau); font-style: italic; }
.plus { color: var(--rot); } .minus { color: var(--gruen); } .leer { color: var(--grau); }
tr.status-gelb td:nth-child(4), tr.status-gelb td:nth-child(5) { background: var(--gelb-bg); }
tr.status-rot td:nth-child(4), tr.status-rot td:nth-child(5) { background: var(--rot-bg); }
/* Ampel als Balken am linken Zeilenrand */
#positionen tbody tr td:first-child { border-left: 4px solid transparent; }
#positionen tr.status-rot td:first-child { border-left-color: var(--rot); }
#positionen tr.status-gelb td:first-child { border-left-color: var(--gelb-punkt); }
#positionen tr.status-ok td:first-child, #positionen tr.status-gut td:first-child { border-left-color: var(--gruen); }
#positionen tr.status-offen td:first-child { border-left-color: var(--rahmen); }
/* Sortierbare Spalten und Tastatur */
th.sortierbar { cursor: pointer; user-select: none; } th.sortierbar:hover { text-decoration: underline; }
th.sortierbar[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; } th.sortierbar[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; }
td.editierbar:focus { outline: 2px solid var(--akzent); outline-offset: -2px; }
.ampel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.ampel.rot { background: var(--rot); } .ampel.gelb { background: var(--gelb-punkt); } .ampel.ok, .ampel.gut { background: var(--gruen); } .ampel.offen { background: var(--rahmen); }
.badge { display: inline-block; font-size: .78em; padding: 1px 6px; border-radius: 9px; color: var(--auf-farbe); margin-left: 3px; }
.badge.rot { background: var(--rot); } .badge.gelb { background: var(--gelb-punkt); color: #14181E; }
td.editierbar { cursor: text; } td.editierbar:hover { outline: 1px dashed var(--akzent); }
td input { width: 120px; text-align: right; padding: 2px 4px; }
.schloss { color: var(--grau); font-size: .8em; margin-left: 4px; }
.vorschau-tabelle { font-size: .86em; margin: 6px 0; } .vorschau-tabelle td { padding: 3px 6px; }
/* In der schmalen Seitenleiste wurde die Wertespalte rechts abgeschnitten: dort waagrecht scrollbar, Werte ohne Umbruch */
/* In der schmalen Seitenleiste je Änderung zwei Zeilen: oben die Position, darunter alt → neu und der Grund.
   Als breite Tabelle standen neuer Wert und Grund rechts außerhalb des Sichtbaren (bis 23.09.2026). */
aside .vorschau-tabelle, aside .vorschau-tabelle tbody { display: block; }
aside .vorschau-tabelle tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding: 3px 0; border-bottom: 1px solid var(--rahmen); }
aside .vorschau-tabelle td { padding: 0; }
aside .vorschau-tabelle td:first-child { flex: 1 0 100%; }
aside .vorschau-tabelle td.rechts { white-space: nowrap; }
.vorschau-titel { margin: 8px 0; font-weight: bold; }
.hinweis.vorschau { background: var(--vorschau-bg); border-color: var(--akzent-hell); }

/* Projektkopf */
.kopf { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; margin-bottom: 10px; }
.kopf .titel { font-size: 1.3em; font-weight: bold; }
.kopf .meta { color: var(--grau); font-size: .9em; display: flex; flex-wrap: wrap; gap: 4px 6px; } .kopf .punkt { opacity: .5; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kachel { border: 1px solid var(--rahmen); border-radius: 6px; padding: 10px; }
.kachel .l { font-size: .86em; color: var(--grau); } .kachel .w { font-size: 1.25em; font-weight: bold; } .kachel .w small { font-size: .7em; font-weight: normal; color: var(--grau); }
.hinweis { background: var(--hinweis-bg); border: 1px solid var(--hinweis-rahmen); padding: 8px 10px; border-radius: 4px; margin: 8px 0; font-size: .93em; }
.fehler { background: var(--fehler-bg); border-color: var(--fehler-rahmen); }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
/* Änderungsverlauf: standardmäßig zugeklappt, die Überschrift bleibt der Aufklapper. */
#verlaufBox > summary { cursor: pointer; list-style: none; }
#verlaufBox > summary::-webkit-details-marker { display: none; }
#verlaufBox > summary h3 { display: inline-flex; align-items: center; gap: 8px; }
#verlaufBox > summary h3::before { content: "▸"; color: var(--grau); font-weight: normal; }
#verlaufBox[open] > summary h3::before { content: "▾"; }
/* Jedes Diagramm sitzt in einer eigenen Karte – sonst sieht man nicht, wo eins aufhört und das nächste anfängt. */
.diagramm-karte { border: 1px solid var(--rahmen); border-radius: 2px; padding: 12px 14px 12px; background: var(--flaeche); }
.diagramm-karte > h2:first-child, .diagramm-karte > h3:first-child { margin-top: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; }
/* Diagramm vergrößern: Klick auf das Bild oder auf „⤢" in der Überschrift. */
.lupe { line-height: 1; padding: 2px 7px; }
#uebersichtDiagramm, #diagrammBalken, #diagrammDb, #diagrammVerlauf { cursor: zoom-in; }
#uebersichtDiagramm a, #diagrammBalken a, #diagrammDb a, #diagrammVerlauf a { cursor: pointer; }
dialog.breit { width: min(1200px, 94vw); max-width: 94vw; }
#dlgDiagrammInhalt svg { width: 100%; height: auto; max-width: none !important; }
.historie, .anhaenge { font-size: .93em; max-height: 300px; overflow: auto; }
/* Ein Anhang je Block: der Knopf „entfernen" rutscht bei langen Namen in die zweite Zeile,
   deshalb etwas Luft dazwischen – sonst sieht er aus, als gehöre er zum nächsten Eintrag. */
#anhaenge > div { padding: 3px 0; border-bottom: 1px solid var(--linie); }
#anhaenge > div:last-child { border-bottom: 0; }
.historie div { padding: 4px 0; border-bottom: 1px solid var(--linie); } .historie .rueck { text-decoration: line-through; color: var(--grau); }
.historie time, #undoVorschau time { color: var(--grau); margin-right: 6px; font-size: .9em; }   /* Vorschau vor dem Zurücknehmen: Zeit und Name standen bis 28.09.2026 ohne Abstand */
.kommentar { padding: 6px 0; border-bottom: 1px solid var(--linie); } .kommentar-text { white-space: pre-wrap; }
.uploadbox { border: 2px dashed var(--akzent); border-radius: 6px; padding: 12px; text-align: center; color: var(--grau); }
.uploadbox.drag { background: var(--akzent-hell); }
.diagramm-fuss { font-size: .78em; color: var(--grau); margin-top: 2px; }

/* Leerzustand (frische Installation) */
.leer-start { text-align: center; padding: 30px 10px; }
.leer-start img { width: 64px; height: 64px; }
.schritte { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 20px auto; max-width: 780px; text-align: left; }
.schritt { border: 1px solid var(--rahmen); border-radius: 6px; padding: 14px; }
.schritt b { display: block; color: var(--akzent); margin-bottom: 4px; } .schritt .nr { display: inline-block; width: 24px; height: 24px; border-radius: 50%; background: var(--akzent); color: var(--auf-farbe); text-align: center; line-height: 24px; margin-right: 6px; }

/* Anmeldung */
#login { max-width: 360px; margin: 80px auto; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 6px; padding: 24px; display: grid; gap: 10px; }
#login img, #loginTotp img { width: 72px; height: 72px; margin: 0 auto 6px; display: block; }
#login h2 { color: var(--akzent); margin: 0 0 6px; text-align: center; }
/* Der Microsoft-Knopf ist der Hauptweg, bekommt aber bewusst keine Klasse `primaer`: im Formular soll
   „Anmelden" der einzige Hauptknopf bleiben (sonst greifen Tests und Tastaturbedienung daneben). */
#msLogin { text-align: center; } #msLogin button { width: 100%; background: var(--akzent); color: var(--auf-farbe); }
/* Die Passwort-Maske sitzt in einem eigenen Kasten, damit sie sich bei „nur Entra ID“ am Stück ausblenden
   lässt – innen dieselbe Anordnung untereinander wie im Formular selbst. */
#passwortLogin { display: grid; gap: 10px; }
#btnNotfallLogin { justify-self: center; }

/* Dialoge */
dialog { border: 1px solid var(--rahmen); border-radius: 6px; padding: 18px; min-width: min(420px, 92vw); max-width: 94vw; overflow: auto; background: var(--flaeche); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog h3 { margin-top: 0; color: var(--akzent); }
dialog td, dialog th { white-space: normal; }
.nutzertabelle td, .nutzertabelle th { text-align: left; }
.formular { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .formular .voll { grid-column: 1 / -1; }
.formular label { display: grid; gap: 3px; font-size: .86em; color: var(--grau); } .formular label input { font-size: 1.1em; }
[hidden] { display: none !important; }

/* Mittlere Bildschirme (700–1000 px): schmalere Seitenleiste, Diagramme untereinander */
@media (max-width: 1000px) { main { grid-template-columns: 220px 1fr; gap: 12px; padding: 12px; } .zwei { grid-template-columns: 1fr; } .kacheln { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } th, td { padding: 6px 6px; } }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } .projektliste { max-height: 32vh; } }
/* Mobil: Tabelle wird zu Karten – jede Zeile ein Block, Zellen mit Beschriftung aus data-label */
@media (max-width: 700px) {
  header { padding: 8px 12px; } header h1 { font-size: 1em; }
  #positionen thead { display: none; }
  #positionen tr { display: block; border: 1px solid var(--rahmen); border-radius: 6px; margin: 8px 0; padding: 6px 8px; background: var(--flaeche); }
  #positionen tr.summe { border-color: var(--akzent); }
  #positionen td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 3px 0; white-space: normal; text-align: right; }
  #positionen td:first-child { font-weight: bold; display: block; text-align: left; padding-bottom: 5px; border-bottom: 1px solid var(--linie); margin-bottom: 3px; }
  #positionen td::before { content: attr(data-label); color: var(--grau); font-size: .86em; text-align: left; }
  #positionen td:first-child::before, #positionen td:empty { display: none; }
  tr.status-gelb td:nth-child(4), tr.status-gelb td:nth-child(5), tr.status-rot td:nth-child(4), tr.status-rot td:nth-child(5) { background: transparent; }
  .kacheln { grid-template-columns: 1fr 1fr; } .kachel .w { font-size: 1.1em; }
  .aktionen button { flex: 1 1 45%; }
  .formular { grid-template-columns: 1fr; }
}

/* Wiederherstellungscodes: gut lesbar, zum Abschreiben oder Ausdrucken */
.codeliste { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 8px 0; padding: 0; }
.codeliste li { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05em; letter-spacing: .5px; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 4px; padding: 5px 8px; text-align: center; }

/* ---------- Tastatur: sichtbarer Fokus ---------- */
/* Nur bei Tastaturbedienung sichtbar (:focus-visible), damit Mausklicks keinen Rahmen hinterlassen. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
#zeilen td.editierbar:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
  border-radius: 3px;
}
header button:focus-visible { outline-color: #fff; }
/* Browser ohne :focus-visible bekommen wenigstens den Standardrahmen zurück */
@supports not selector(:focus-visible) { :where(a, button, input, select, textarea):focus { outline: 3px solid var(--akzent); outline-offset: 2px; } }

/* ---------- Bewegung reduzieren (Systemeinstellung) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  #ladebalken { animation: none; background: var(--akzent); }
}

/* ---------- Druck ---------- */
/* Gedruckt wird der Inhalt, nicht die Bedienung: Kopfzeile, Projektliste, Knöpfe und Dialoge bleiben draußen.
   Für ein vollständiges Dokument mit Deckblatt ist der PDF-Export gedacht – das hier ist der schnelle Ausdruck. */
@media print {
  :root { --bg: #fff; --flaeche: #fff; --flaeche2: #fff; --text: #000; --rahmen: #999; --linie: #ccc; --grau: #444; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  header, aside, #ladebalken, #meldung, #erfolg, #login, #loginTotp,
  .aktionen, #filter, #filterInfo, #reiterLeiste, .reiter, #eingang, #importBereich,
  #btnKommentare, #kommentarPopover, dialog, .nicht-drucken,
  button.lupe, button[data-kommentar] { display: none !important; }   /* Lupe und Kommentar-Knöpfe gehören nicht aufs Papier */
  main { display: block; max-width: none; padding: 0; }
  section { border: 0; padding: 0; }
  #detail { break-inside: auto; }
  table { border-collapse: collapse; width: 100%; }
  thead { display: table-header-group; }          /* Kopfzeile auf jeder Seite wiederholen */
  tr, .kachel, .diagramm, .diagramm-karte { break-inside: avoid; }
  a[href]::after { content: ""; }                  /* keine URLs hinter Links */
  #zeilen td.editierbar { cursor: default; }
  #positionen th#thAktion, #positionen tbody td:last-child { display: none; }   /* Freigabe-Knöpfe gehören nicht aufs Papier */
  select { appearance: none; border: 0; background: transparent; padding: 0; font: inherit; }
  .ampel { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Wiederherstellungscodes sollen sich ausdrucken lassen – der Rest des Dialogs nicht */
  dialog[open]:has(#ersatzcodeAnzeige:not([hidden])) { display: block !important; position: static; border: 0; }
  dialog[open]:has(#ersatzcodeAnzeige:not([hidden])) > *:not(#ersatzcodeAnzeige) { display: none !important; }
  #ersatzcodeAnzeige .aktionen { display: none !important; }
  @page { margin: 15mm; }
}
.badge.veraltet { background: var(--hinweis-bg); border: 1px solid var(--hinweis-rahmen); color: var(--gelb); }
#veraltetHinweis a { margin-right: 2px; }

/* Nutzerverwaltung: die Rollenauswahl mit ihrer langen Beschriftung sonst so breit,
   dass die hinteren Spalten (Sichtgruppen, Herunterladen) aus dem Dialog laufen. */
#nutzertabelle select { max-width: 190px; }
#nutzertabelle th, #nutzertabelle td { padding: 4px 6px; vertical-align: middle; }
/* „td input" (Eingabefeld in der Projekttabelle, 120 px) machte sonst jede Häkchen-Spalte so breit – mit der Spalte
   „Eintrag" lief die Tabelle bei 1280 px aus dem Dialog. */
#nutzertabelle input[type=checkbox] { width: auto; }

/* ---------- Verwaltungsmenü in der Kopfzeile ---------- */
.menue { position: relative; }
.menue > summary { list-style: none; cursor: pointer; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; padding: 4px 10px; font-size: .93em; user-select: none; }
.menue > summary::-webkit-details-marker { display: none; }
.menue > summary::after { content: " ▾"; opacity: .7; }
.menue[open] > summary { background: rgba(255,255,255,.2); }
.menue-inhalt { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; display: grid; gap: 4px; padding: 8px; min-width: 190px;
  background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.28); }
.menue-inhalt button { border-color: var(--rahmen); background: var(--flaeche2); color: var(--text); text-align: left; }

/* ---------- Sprunglink für die Tastatur ---------- */
.sprunglink { position: absolute; left: -9999px; top: 0; z-index: 40; background: var(--flaeche); color: var(--text);
  border: 2px solid var(--akzent); border-radius: 0 0 6px 0; padding: 8px 14px; }
.sprunglink:focus { left: 0; }

/* ---------- Kacheln im Projekt: drei je Reihe, damit die sechste nicht allein steht.
   Die vier Summen-Kacheln der Übersicht behalten die automatische Aufteilung. ---------- */
@media (min-width: 900px) { #kacheln { grid-template-columns: repeat(3, 1fr); } }
.listenwert { text-align: right; white-space: nowrap; line-height: 1.5; }
/* Bleibt in der letzten Reihe eine Kachel allein oder zu zweit, füllt sie die Reihe aus. */
@media (min-width: 900px) {
  #kacheln > .kachel:last-child:nth-child(3n + 1) { grid-column: span 3; }
  #kacheln > .kachel:last-child:nth-child(3n + 2) { grid-column: span 2; }
}

/* Filter: Auswahlfelder dürfen schrumpfen, sonst laufen sie auf dem Handy aus dem Bild. */
#filter select { width: 100%; min-width: 0; }
/* Die Sortierung hat die längsten Beschriftungen – sie bekommt beide Spalten, sonst steht dort „Sortierung: Ha…“. */
#filter #fSortierung { grid-column: 1 / -1; }
@media (max-width: 700px) {
  #filter { grid-template-columns: 1fr; }
  header h1 { font-size: 1.05em; }
  .listenwert { line-height: 1.35; }
}

/* Stand 25.09.2026 – Nachbesserungen aus der Prüfrunde */
/* Lange Dateinamen ohne Trennstelle („24-033_KostenWarenabgabe_Whitewater.pdf") ragten aus den Kästen der Seitenleiste */
.hinweis, #importErgebnis, #letzteImporte, #anhaenge, #eingang { overflow-wrap: anywhere; }
/* Handy: Auswahl und Lupe in den Diagrammköpfen umbrechen statt die Seite zu verbreitern (375 px → 429 px breit) */
.diagramm-karte > h3 { flex-wrap: wrap; }
.diagramm-karte > h3 select { max-width: 100%; min-width: 0; }
.zwei > * { min-width: 0; }
/* Sichtgruppen: die Tabelle scrollt in ihrem Kasten, der Dialog öffnet nicht seitlich verschoben */
#sichtgruppenListe { overflow-x: auto; }
#formSichtgruppe input, #formSchwellen input, #umsatzstufen input { min-width: 0; }
