/* Wochenplaner – Stylesheet
   Grundidee: eine Planungstafel in der Werkstatt. Graphit-Kopfzeile, Beton-Hintergrund,
   weißes Planungsblatt mit kräftigem Raster, Signalgelb nur für Heute/aktiv/primär. */

:root {
  --graphit: #2d3138;
  --graphit-dunkel: #22252b;
  --tinte: #262626;
  --beton: #e9ebee;
  --papier: #ffffff;
  --linie: #cfd3d9;
  --linie-stark: #a9aeb6;
  --leise: #6b7079;
  --signal: #e3a600;
  --signal-hell: #fff3c4;
  --gruen: #2e8b57;
  --gruen-hell: #d9f0e2;
  --rot: #c43d3d;
  --rot-hell: #fbe3e3;
  --blau: #3b6fc4;
  --blau-hell: #dde8fa;
  --feiertag-hell: #ffe9c2;
  --we-hell: #f1f2f4;
  --radius: 3px;
  --schrift: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--beton);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.4;
}
a { color: inherit; }
h1, h2 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
code { font-family: ui-monospace, Consolas, "Liberation Mono", monospace; font-size: 0.92em; background: var(--we-hell); padding: 0 4px; border-radius: 2px; }
.leise { color: var(--leise); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Kopfzeile ---------- */
.kopf { background: var(--graphit); color: #fff; }
.kopf-innen {
  display: flex; align-items: stretch; gap: 1.5rem; flex-wrap: wrap;
  padding: 0 1.25rem; min-height: 56px;
}
.marke { display: flex; flex-direction: column; justify-content: center; text-decoration: none; padding: 8px 0; line-height: 1.15; }
.marke-firma { font-size: 0.78rem; color: #c9ccd2; }
.marke-app { font-size: 1.15rem; font-weight: 600; }
.hauptnav { display: flex; gap: 0.25rem; overflow-x: auto; flex: 1; }
.hauptnav a {
  display: flex; align-items: center; padding: 0 0.9rem; text-decoration: none; color: #e4e6ea;
  border-bottom: 4px solid transparent; border-top: 4px solid transparent; white-space: nowrap; font-weight: 500;
}
.hauptnav a:hover { background: var(--graphit-dunkel); color: #fff; }
.hauptnav a.aktiv { color: #fff; border-bottom-color: var(--signal); }
.konto { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; color: #c9ccd2; }
.konto a { color: #fff; }
.konto-name::before { content: "●"; color: var(--signal); margin-right: 0.4rem; font-size: 0.7em; vertical-align: 1px; }

/* ---------- Seiteninhalt ---------- */
.inhalt { padding: 1rem 1.25rem 2.5rem; max-width: 1800px; }
.seite-login .inhalt, .seite-reklamation .inhalt, .seite-verwaltung .inhalt { max-width: 1000px; }

.meldung { padding: 0.6rem 0.9rem; border-left: 4px solid var(--linie-stark); background: var(--papier); margin: 0 0 0.75rem; border-radius: var(--radius); }
.meldung-ok { border-left-color: var(--gruen); }
.meldung-fehler { border-left-color: var(--rot); }

.leer { background: var(--papier); border: 1px dashed var(--linie-stark); padding: 2rem; text-align: center; border-radius: var(--radius); }
.leer p { margin: 0.4rem 0; }
.hinweis { color: var(--leise); font-size: 0.88rem; margin: 0.75rem 0 0; max-width: 80ch; }
.zurueck { margin: 0 0 0.75rem; }

/* ---------- Werkzeugleiste ---------- */
.werkzeugleiste { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; margin: 0 0 0.9rem; }
.kw-nav { display: flex; align-items: center; gap: 0.5rem; }
.kw-titel { display: flex; flex-direction: column; align-items: center; min-width: 11rem; line-height: 1.15; padding: 0 0.5rem; }
.kw-titel strong { font-size: 1.35rem; font-weight: 600; }
.kw-titel span { font-size: 0.85rem; color: var(--leise); }
.kw-wahl { display: flex; gap: 0.75rem; align-items: center; }
.kw-wahl label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--leise); }
.aktionen { display: flex; gap: 0.5rem; margin-left: auto; flex-wrap: wrap; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.45rem 0.85rem; border: 1px solid var(--graphit); border-radius: var(--radius);
  background: var(--papier); color: var(--tinte); text-decoration: none; cursor: pointer; font-weight: 500; line-height: 1.2;
}
.knopf:hover { background: var(--graphit); color: #fff; }
.knopf-primaer { background: var(--signal); border-color: var(--signal); color: var(--tinte); }
.knopf-primaer:hover { background: #c99300; border-color: #c99300; color: var(--tinte); }
.knopf-leise { border-color: var(--linie-stark); background: transparent; }
.knopf-leise:hover { background: var(--papier); color: var(--tinte); border-color: var(--graphit); }
.knopf-gefahr { border-color: var(--rot); color: var(--rot); background: transparent; }
.knopf-gefahr:hover { background: var(--rot); color: #fff; }
.knopf-klein { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.knopf:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blau); outline-offset: 1px;
}

/* ---------- Formulare ---------- */
input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  padding: 0.45rem 0.55rem; border: 1px solid var(--linie-stark); border-radius: var(--radius); background: var(--papier); width: 100%;
}
textarea { resize: vertical; min-height: 6rem; }
input[type="number"] { width: 6rem; }
.formular-zeile { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; }
.formular-zeile label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--leise); }
.formular-zeile label > input, .formular-zeile label > select { color: var(--tinte); font-size: 0.95rem; width: auto; min-width: 9rem; }
.kontrollkaestchen { flex-direction: row !important; align-items: center !important; gap: 0.4rem !important; padding-bottom: 0.5rem; }
.kontrollkaestchen input { width: auto; }

.kasten { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kasten h2 { margin-bottom: 0.5rem; }
.kasten > .leise { margin-top: 0; font-size: 0.88rem; }
.kasten h3 { font-size: 0.95rem; font-weight: 600; margin: 1rem 0 0.5rem; }

/* ---------- Tabellen allgemein ---------- */
.tabelle-scroll { overflow-x: auto; background: var(--papier); border: 1px solid var(--linie-stark); border-radius: var(--radius); }
table { border-collapse: collapse; }
th { font-weight: 600; text-align: left; }

/* ---------- Maschinenplanung ---------- */
.plan { width: 100%; min-width: 1080px; table-layout: fixed; }
.plan th, .plan td { border: 1px solid var(--linie); vertical-align: top; }
.plan thead th { background: var(--graphit); color: #fff; border-color: #4a4f58; padding: 0.5rem 0.6rem; vertical-align: bottom; }
.plan thead th .wt { display: block; font-size: 0.8rem; font-weight: 500; color: #c9ccd2; }
.plan thead th .dt { display: block; font-size: 1.05rem; }
.plan thead th .ft { display: block; font-size: 0.78rem; color: var(--signal-hell); font-weight: 500; }
.plan thead th.heute { box-shadow: inset 0 4px 0 var(--signal); }
.plan thead th.heute .wt::after { content: " · heute"; color: var(--signal); }
.plan .sp-maschine { width: 190px; }
.plan .sp-bediener { width: 140px; }
.plan .sp-we { width: 150px; }
.plan tbody th.sp-maschine { background: var(--we-hell); padding: 0.55rem 0.7rem; font-size: 1rem; position: sticky; left: 0; z-index: 1; border-right: 2px solid var(--linie-stark); }
.plan tbody td { padding: 0.5rem 0.6rem; height: 3.4rem; overflow-wrap: anywhere; }
.plan tbody td.sp-bediener { background: #fafafb; font-weight: 500; }
.plan tbody td.sp-bediener.abweichend { box-shadow: inset 3px 0 0 var(--signal); }
.plan tbody td.heute { background: #fffbea; }
.plan tbody td.feiertag { background: var(--feiertag-hell); }
.plan tbody td.bediener-abwesend { background: var(--rot-hell); }
.plan tbody td.bediener-abwesend::before { content: "abwesend"; display: block; font-size: 0.72rem; color: var(--rot); font-weight: 600; line-height: 1; margin-bottom: 0.2rem; pointer-events: none; }
.plan tbody td.sp-we { background: var(--we-hell); }
.plan tbody td.sp-we.heute { background: #fffbea; }

.abw-liste { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0.3rem; }
.abw { font-size: 0.72rem; font-weight: 500; padding: 1px 6px; border-radius: 10px; background: #fff; color: var(--tinte); line-height: 1.5; }
.abw-U { background: var(--gruen-hell); color: #1e5c39; }
.abw-K { background: var(--rot-hell); color: #8a2727; }
.abw-S { background: var(--blau-hell); color: #244a8f; }

/* Tageszelle: Bediener-Zeile (nur bei Abweichung oder im Bearbeitungsmodus) + Belegungstext */
.be { min-height: 1.4em; padding: 0.15rem 0.25rem; margin: -0.15rem -0.25rem; border-radius: 2px; }
.tb-zeile { display: none; align-items: baseline; gap: 0.35rem; font-size: 0.78rem; line-height: 1.35;
            margin: -0.25rem -0.35rem 0.3rem; padding: 0.1rem 0.35rem; border-radius: 2px; background: var(--we-hell); }
.tb-zeile.abweichend { display: flex; background: var(--signal-hell); color: #5a4300; }
.tb-label { opacity: 0.75; white-space: nowrap; }
.tb { font-weight: 600; min-width: 0; }
.tb-zeile.abweichend .tb { color: #3d2e00; }
body.zeige-tagesbediener .tb-zeile { display: flex; }
.tb[contenteditable="true"] { flex: 1; min-width: 3rem; padding: 0 0.2rem; border-radius: 2px; }
.tb:empty::before { content: attr(data-placeholder); color: var(--leise); font-weight: 400; }
.plan tbody td.sp-tag, .plan tbody td.sp-we { cursor: default; }
body.darf-maschinen .plan tbody td.sp-tag, body.darf-maschinen .plan tbody td.sp-we { cursor: text; }

/* Bearbeitbare Felder */
.plan [contenteditable="true"] { cursor: text; }
.plan .zelle[contenteditable="true"]:hover { box-shadow: inset 0 0 0 1px var(--linie-stark); }
.plan .zelle[contenteditable="true"]:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blau); background: #fff; }
.plan .be[contenteditable="true"]:focus, .plan .tb[contenteditable="true"]:focus { outline: none; box-shadow: 0 0 0 2px var(--blau); background: #fff; }
.plan .wird-gespeichert { opacity: 0.6; }
.plan .gespeichert { animation: gespeichert 1.2s ease-out; }
.plan .fehler { box-shadow: 0 0 0 2px var(--rot) !important; }
.knopf-aktiv, .knopf-aktiv:hover { background: var(--graphit); color: #fff; border-color: var(--graphit); }
@keyframes gespeichert { 0% { background: var(--gruen-hell); } 100% { background: inherit; } }
@media (prefers-reduced-motion: reduce) { .plan .gespeichert { animation: none; } }

/* ---------- Urlaubsplaner ---------- */
.malmodus { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.75rem; font-size: 0.9rem; }
.malmodus-text { color: var(--leise); margin-right: 0.25rem; }
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border: 1px solid var(--linie-stark); border-radius: 999px; background: var(--papier); cursor: pointer; font-weight: 500; }
.chip input { margin: 0; accent-color: var(--graphit); }
.chip:has(input:checked) { border-color: var(--graphit); box-shadow: inset 0 0 0 1px var(--graphit); }
.chip-U:has(input:checked) { background: var(--gruen-hell); }
.chip-K:has(input:checked) { background: var(--rot-hell); }
.chip-S:has(input:checked) { background: var(--blau-hell); }

.urlaub { min-width: 100%; }
.urlaub th, .urlaub td { border: 1px solid var(--linie); text-align: center; }
.urlaub thead th { background: var(--graphit); color: #fff; border-color: #4a4f58; padding: 0.3rem 0.2rem; font-weight: 500; }
.urlaub thead th.kw { font-size: 0.78rem; border-bottom-color: #6a6f78; }
.urlaub thead .tag-zeile th { width: 30px; min-width: 30px; line-height: 1.1; padding: 0.3rem 0; }
.urlaub thead .tag-zeile th .wt { display: block; font-size: 0.68rem; color: #c9ccd2; }
.urlaub thead .tag-zeile th .nr { display: block; font-size: 0.9rem; }
.urlaub thead .tag-zeile th.we { background: #3d424a; }
.urlaub thead .tag-zeile th.ft { background: #5a4a1e; }
.urlaub thead .tag-zeile th.heute { box-shadow: inset 0 3px 0 var(--signal); }
.urlaub thead .tag-zeile th.heute .nr { color: var(--signal); }
.urlaub .sp-name { text-align: left; padding: 0.35rem 0.7rem; white-space: nowrap; min-width: 150px; position: sticky; left: 0; z-index: 1; }
.urlaub thead .sp-name { background: var(--graphit); }
.urlaub tbody .sp-name { background: var(--we-hell); border-right: 2px solid var(--linie-stark); }
.urlaub .sp-summe { white-space: nowrap; padding: 0.3rem 0.5rem; font-size: 0.85rem; min-width: 5.5rem; }
.urlaub tbody .sp-summe { color: var(--leise); }
.urlaub tbody .sp-summe .genommen { color: var(--tinte); font-weight: 600; }
.urlaub .utag { height: 32px; font-weight: 600; font-size: 0.85rem; user-select: none; -webkit-user-select: none; }
.urlaub .utag.we { background: var(--we-hell); }
.urlaub .utag.ft { background: var(--feiertag-hell); }
.urlaub .utag.heute { box-shadow: inset 2px 0 0 var(--signal), inset -2px 0 0 var(--signal); }
.urlaub .utag.art-U { background: var(--gruen); color: #fff; }
.urlaub .utag.art-K { background: var(--rot); color: #fff; }
.urlaub .utag.art-S { background: var(--blau); color: #fff; }
body.darf-urlaub .urlaub .utag { cursor: pointer; }
body.darf-urlaub .urlaub .utag:hover { box-shadow: inset 0 0 0 2px var(--graphit); }
.urlaub .utag.wird-gespeichert { opacity: 0.5; }

.legende { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0.6rem 0 1rem; font-size: 0.85rem; color: var(--leise); }
.lg { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 2px; border: 1px solid var(--linie); background: var(--papier); color: var(--tinte); font-weight: 600; font-size: 0.8rem; }
.lg-U { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.lg-K { background: var(--rot); color: #fff; border-color: var(--rot); }
.lg-S { background: var(--blau); color: #fff; border-color: var(--blau); }
.lg-we { background: var(--we-hell); font-weight: 500; }
.lg-ft { background: var(--feiertag-hell); font-weight: 500; }

.urlaub-unten { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 1100px) { .urlaub-unten { grid-template-columns: 3fr 2fr; } }
.zeitraum-liste { list-style: none; margin: 0; padding: 0; }
.zeitraum-liste li { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.3rem 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.zeitraum-liste li:last-child { border-bottom: 0; }
.zeitraum-liste .lg { min-width: 1.6rem; text-align: center; }

/* ---------- Reklamationen ---------- */
.filter { display: flex; border: 1px solid var(--linie-stark); border-radius: var(--radius); overflow: hidden; background: var(--papier); }
.filter a { padding: 0.45rem 0.9rem; text-decoration: none; font-weight: 500; border-right: 1px solid var(--linie); }
.filter a:last-child { border-right: 0; }
.filter a.aktiv { background: var(--graphit); color: #fff; }
.filter .zahl { display: inline-block; min-width: 1.4em; padding: 0 0.35em; margin-left: 0.3em; border-radius: 10px; background: var(--we-hell); color: var(--tinte); font-size: 0.8rem; text-align: center; }
.filter a.aktiv .zahl { background: var(--signal); }

.rk-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.rk-eintrag { background: var(--papier); border: 1px solid var(--linie); border-left: 5px solid var(--signal); border-radius: var(--radius); }
.rk-eintrag.status-erledigt { border-left-color: var(--gruen); }
.rk-link { display: block; padding: 0.75rem 0.9rem 0.9rem; text-decoration: none; }
.rk-link:hover { background: #fafafb; }
.rk-bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 0.6rem; }
.rk-bilder img { width: 100%; height: 210px; object-fit: cover; border-radius: 2px; background: var(--we-hell); }
.rk-mehr { display: flex; align-items: center; justify-content: center; height: 210px; background: var(--we-hell); color: var(--leise); font-size: 1.1rem; border-radius: 2px; }
.rk-anzahl { color: var(--leise); }
.rk-link h2 { margin: 0.2rem 0 0.3rem; font-size: 1.15rem; }
.rk-link p { margin: 0; color: var(--leise); max-width: 90ch; }
.rk-kopf { display: flex; gap: 0.75rem; align-items: center; font-size: 0.85rem; color: var(--leise); }
.status { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 10px; font-weight: 600; font-size: 0.78rem; }
.status-offen { background: var(--signal-hell); color: #7a5a00; }
.status-erledigt { background: var(--gruen-hell); color: #1e5c39; }

.rk-formular, .rk-ansicht { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; }
.rk-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.feld { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--leise); }
.feld > input, .feld > select, .feld > textarea { color: var(--tinte); font-size: 0.95rem; }
.feld-breit { grid-column: 1 / -1; }
.feld-hinweis { font-size: 0.8rem; }
.rk-aktionen { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.rk-aktionen .knopf-gefahr { margin-left: auto; }
.rk-ansicht h1 { margin: 0.25rem 0 0.75rem; }
.rk-beschreibung { white-space: pre-wrap; max-width: 80ch; }

.galerie-bereich { margin-top: 1rem; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.galerie-bild { margin: 0; background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 4px; }
.galerie-bild a { display: block; }
.galerie-bild img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: var(--we-hell); }
.galerie-loeschen { margin: 4px 0 0; text-align: right; }

/* ---------- Verwaltung ---------- */
.verwaltung { display: flex; flex-direction: column; gap: 1rem; }
.stamm { width: 100%; }
.stamm th, .stamm td { padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.stamm thead th { font-size: 0.85rem; color: var(--leise); font-weight: 500; }
.stamm .schmal { width: 8rem; }
.stamm .mitte { text-align: center; }
.stamm .aktionen-zelle { white-space: nowrap; width: 1%; }
.stamm .aktionen-zelle .knopf { margin-right: 0.3rem; }
.stamm tr.neu td { background: #fafafb; }
.stamm input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }
.rechte { display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; }
.rechte label { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; font-size: 0.9rem; }
.rechte input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; }
.rechte-feld { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding-bottom: 0.45rem; }
.formular-zeile .rechte label { flex-direction: row; color: var(--tinte); }

/* ---------- Anmeldung / Einrichtung ---------- */
.login-kasten { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.5rem; max-width: 460px; margin: 2rem auto; }
.install-kasten { max-width: 640px; }
.login-kasten form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.login-kasten label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--leise); }
.login-kasten label > input { color: var(--tinte); font-size: 1rem; }
.login-kasten .knopf { align-self: flex-start; margin-top: 0.25rem; }
.login-kasten h2 { margin-top: 1.5rem; }
.pruefliste { list-style: none; padding: 0; margin: 0; }
.pruefliste li { padding: 0.3rem 0 0.3rem 1.6rem; position: relative; }
.pruefliste li::before { content: "✓"; position: absolute; left: 0.2rem; color: var(--gruen); font-weight: 700; }
.pruefliste li.fehler::before { content: "✕"; color: var(--rot); }

/* ---------- Vorschläge beim Tippen ---------- */
.ac-liste { position: absolute; z-index: 60; background: var(--papier); border: 1px solid var(--linie-stark); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,0.18); max-height: 260px; overflow-y: auto; font-size: 0.92rem; max-width: min(480px, 90vw); }
.ac-eintrag { padding: 0.4rem 0.7rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--linie); }
.ac-eintrag:last-child { border-bottom: 0; }
.ac-eintrag:hover, .ac-eintrag.aktiv { background: var(--signal-hell); }

/* ---------- Bildschirm-Anzeige der Reklamationen ---------- */
.seite-anzeige { background: #1b1e23; color: #f2f3f5; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.anz-fortschritt { flex: none; height: 6px; background: #2d3138; }
#anz-balken { height: 100%; width: 0; background: var(--signal); }
.anz-buehne { flex: 1; min-height: 0; padding: 1.25rem 2rem; }
.dia { display: flex; gap: 2rem; height: 100%; }
.dia[hidden] { display: none; }
.dia-text { flex: 0 0 32%; max-width: 32%; display: flex; flex-direction: column; min-height: 0; }
.dia-kopf { display: flex; gap: 1rem; align-items: center; color: #b9bdc5; font-size: 1.15rem; }
.dia-text h1 { font-size: 2.3rem; line-height: 1.12; margin: 0.6rem 0 1rem; }
.dia-beschreibung { font-size: 1.4rem; line-height: 1.45; white-space: pre-wrap; overflow: auto; color: #e2e4e8; }
.dia-bilder { flex: 1; display: grid; gap: 0.75rem; min-height: 0; min-width: 0; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.dia-bilder.n-2, .dia-bilder.n-3, .dia-bilder.n-4 { grid-template-columns: 1fr 1fr; }
.dia-bilder.n-5, .dia-bilder.n-6, .dia-bilder.n-7, .dia-bilder.n-8, .dia-bilder.n-9 { grid-template-columns: repeat(3, 1fr); }
.dia-bilder img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #111317; border-radius: 4px; }
.dia-keinbild, .dia-mehr { display: flex; align-items: center; justify-content: center; color: #8a8f98; font-size: 1.6rem; background: #24282e; border-radius: 4px; }
.anz-leer { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #b9bdc5; text-align: center; }
.anz-leer h1 { font-size: 2rem; }
.anz-leiste { flex: none; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.5rem 1rem; background: #2d3138; transition: opacity 0.4s; }
.seite-anzeige.ruhig .anz-leiste { opacity: 0; }
.seite-anzeige .knopf { border-color: #6a6f78; color: #f2f3f5; background: transparent; }
.seite-anzeige .knopf:hover { background: #40454d; color: #fff; }
.anz-firma { color: #8a8f98; margin: 0 0.5rem; }
.anz-zaehler { margin: 0 0.5rem; color: #c9ccd2; min-width: 4rem; text-align: center; font-variant-numeric: tabular-nums; }
.anz-feld { display: flex; align-items: center; gap: 0.35rem; color: #c9ccd2; font-size: 0.9rem; margin-left: 0.5rem; }
.anz-feld input, .anz-feld select { width: auto; background: #1b1e23; color: #fff; border-color: #6a6f78; padding: 0.3rem 0.4rem; }
.anz-feld input { width: 4.5rem; }
@media (max-width: 900px), (orientation: portrait) {
  .anz-buehne { padding: 0.75rem; }
  .dia { flex-direction: column; gap: 0.75rem; }
  .dia-text { flex: none; max-width: none; }
  .dia-text h1 { font-size: 1.5rem; margin: 0.3rem 0 0.5rem; }
  .dia-beschreibung { font-size: 1.05rem; max-height: 28vh; }
  .anz-leiste { gap: 0.35rem; padding: 0.4rem 0.6rem; }
}

/* ---------- Toast & Lightbox ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--graphit); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.25); z-index: 50; max-width: 90vw; }
.toast.fehler { background: var(--rot); }
.lightbox { position: fixed; inset: 0; background: rgba(20,22,26,0.92); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 40px rgba(0,0,0,0.6); }
.lightbox-schliessen { position: absolute; top: 0.5rem; right: 0.75rem; background: transparent; border: 0; color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; padding: 0.25rem 0.5rem; }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 720px) {
  .kopf-innen { padding: 0 0.75rem; gap: 0.75rem; }
  .marke-firma { display: none; }
  .hauptnav { order: 3; flex-basis: 100%; margin: 0 -0.75rem; padding: 0 0.5rem; }
  .hauptnav a { padding: 0.55rem 0.7rem; font-size: 0.95rem; }
  .inhalt { padding: 0.75rem 0.75rem 2rem; }
  .kw-titel { min-width: 0; }
  .kw-titel strong { font-size: 1.1rem; }
  .aktionen { margin-left: 0; }
  .rk-felder { grid-template-columns: 1fr; }
  .rk-bilder { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
  .rk-bilder img, .rk-mehr { height: 140px; }
  .stamm .schmal { width: auto; }
  .stamm input[type="number"] { width: 4.5rem; }
}

/* ---------- Druck ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .kopf, .werkzeugleiste, .malmodus, .hinweis, .knopf, .urlaub-unten .kasten:first-child, .galerie-loeschen, .rk-aktionen, .toast { display: none !important; }
  .inhalt { padding: 0; max-width: none; }
  .tabelle-scroll { border: 0; overflow: visible; }
  .plan { min-width: 0; }
  .plan thead th, .urlaub thead th { background: #e5e7ea !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .plan thead th .wt, .urlaub thead .tag-zeile th .wt { color: #333; }
  .plan tbody th.sp-maschine, .urlaub .sp-name { position: static; }
  body.zeige-tagesbediener .tb-zeile:not(.abweichend) { display: none; }
  .tb-zeile.abweichend { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .urlaub .utag.art-U, .urlaub .utag.art-K, .urlaub .utag.art-S { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: landscape; margin: 10mm; }
}
