/* Schlichtes Grundlayout, für Handy zuerst gedacht */
:root {
  --gruen: #2f6b3a;
  --text: #1d1d1d;
  --leise: #666;
  --flaeche: #f4f5f2;
  --karte: #fff;
  --rahmen: #d9dcd4;
  --fehler: #a4262c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--flaeche);
}

.hinweis-instanz {
  background: #f2c94c;
  text-align: center;
  font-size: 14px;
  padding: 4px 16px;
}

/* Kopf: oben Marke und Konto, darunter eine Menüzeile (am Handy seitlich wischbar) */
.kopf { background: var(--gruen); color: #fff; }
.kopf-zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px 4px; }
.kopf .marke { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; white-space: nowrap; }
.kopf-konto { display: flex; align-items: center; gap: 12px; margin: 0 0 0 auto; min-width: 0; }
.kopf .wer { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 14px; line-height: 1.2; min-width: 0; }
.kopf .wer small { font-size: 12px; opacity: .8; }
.kopf-abmelden { background: none; border: 1px solid rgba(255, 255, 255, .5); color: #fff; border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.kopf-abmelden:hover { background: rgba(255, 255, 255, .15); }
.kopf-menue { display: flex; gap: 2px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.kopf-menue::-webkit-scrollbar { display: none; }
.kopf-menue a { flex: 0 0 auto; color: rgba(255, 255, 255, .85); text-decoration: none; font-size: 15px; padding: 8px 10px 9px; border-bottom: 3px solid transparent; white-space: nowrap; }
.kopf-menue a:hover { color: #fff; }
.kopf-menue a.aktiv { color: #fff; font-weight: 600; border-bottom-color: #fff; }
.kopf-menue .zaehler { margin-left: 2px; }
@media (max-width: 420px) { .kopf .wer small { display: none; } }

.inhalt { max-width: 720px; margin: 0 auto; padding: 16px; }

.karte {
  background: var(--karte);
  border: 1px solid var(--rahmen);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.karte.schmal { max-width: 400px; margin: 32px auto; }

h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 0 0 8px; }

.leise { color: var(--leise); }
.fehler { color: var(--fehler); font-weight: 600; }

label { display: block; margin-bottom: 12px; font-weight: 600; }
input[type="text"], input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  font-size: 17px;
  border: 1px solid var(--rahmen);
  border-radius: 6px;
}

.knopf, .knopf-klein {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.knopf { width: 100%; padding: 12px; background: var(--gruen); color: #fff; font-weight: 600; }
.knopf-klein { padding: 4px 10px; background: #fff; color: var(--gruen); font-size: 14px; }

.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.angaben dt { color: var(--leise); }
.angaben dd { margin: 0; }

/* --- Aufträge ------------------------------------------------------------ */
h3 { font-size: 17px; margin: 16px 0 4px; }
a { color: var(--gruen); }

.titelzeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.titelzeile h1 { margin: 0; }

.reiter { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 16px; }
.reiter a {
  padding: 6px 12px; border: 1px solid var(--rahmen); border-radius: 16px;
  background: var(--karte); color: var(--text); text-decoration: none; font-size: 15px;
}
.reiter a.aktiv { background: var(--gruen); border-color: var(--gruen); color: #fff; }

a.karte.auftrag { display: block; color: var(--text); text-decoration: none; margin-bottom: 8px; }
a.karte.auftrag:hover { border-color: var(--gruen); }

.status { font-size: 13px; padding: 2px 8px; border-radius: 10px; background: #e6e8e3; white-space: nowrap; }
.status-anfrage { background: #eeedfe; color: #3c3489; }
.status-offen { background: #dbeafe; }
.status-abgesagt { background: #f1efe8; color: #5f5e5a; text-decoration: line-through; }
.status-fertig { background: #fde68a; }
.status-abgerechnet { background: #d1fae5; }

.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.aktionen form { margin: 0; }
.aktionen .knopf { width: auto; }
a.knopf { display: inline-block; text-align: center; text-decoration: none; }
.knopf-zweit {
  display: inline-block; padding: 11px 14px; border: 1px solid var(--gruen); border-radius: 6px;
  background: #fff; color: var(--gruen); font: inherit; cursor: pointer; text-decoration: none;
}
.knopf-gruen { background: var(--gruen); color: #fff; border: 1px solid var(--gruen); text-decoration: none; }
.kopf a.knopf-klein { text-decoration: none; }

table { width: 100%; border-collapse: collapse; }
td { padding: 4px 0; border-bottom: 1px solid var(--rahmen); }
td.zahl { text-align: right; white-space: nowrap; }

.erfassung { border-top: 1px solid var(--rahmen); padding: 12px 0; }
.erfassung:first-of-type { border-top: 0; }
.positionen { margin: 4px 0; padding-left: 20px; }

.meldung { padding: 10px 12px; border-radius: 6px; background: #d1fae5; }
.meldung-error { background: #fde2e2; color: var(--fehler); }
.meldung-info { background: #dbeafe; }

/* Formulare */
.formular > div, .formular label { margin-bottom: 12px; }
.formular label { display: block; font-weight: 600; }
.formular input:not([type="checkbox"]):not([type="hidden"]), .formular select, .formular textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit;
  border: 1px solid var(--rahmen); border-radius: 6px; background: #fff;
}
.formular input[type="checkbox"] { width: 22px; height: 22px; vertical-align: middle; margin-left: 8px; }
.formular .helptext { display: block; font-size: 14px; font-weight: normal; color: var(--leise); }
.formular .errorlist { color: var(--fehler); margin: 4px 0; padding-left: 18px; font-weight: 600; }
fieldset { border: 1px solid var(--rahmen); border-radius: 8px; margin: 0 0 16px; padding: 8px 12px; min-width: 0; }
legend { font-weight: 600; padding: 0 4px; }

@media print {
  .kopf, .hinweis-instanz, .aktionen, .reiter, .meldung { display: none; }
  body { background: #fff; }
  .karte { border: 0; padding: 0; }
}

/* Fotos */
.knopf-rahmen { border: 1px solid var(--gruen); }
.fotos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.fotos img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rahmen); }

/* Offline-Hinweis */
.offline-hinweis { background: #fff4d6; border-bottom: 1px solid #f2c94c; padding: 8px 16px; font-size: 15px; }
.offline-hinweis p { max-width: 720px; margin: 4px auto; }

/* Übersichten und Verwaltung */
.inhalt:has(.tabelle) { max-width: 1100px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.kachel {
  display: block; padding: 10px 12px; border: 1px solid var(--rahmen); border-radius: 8px;
  background: var(--karte); color: var(--leise); text-decoration: none; font-size: 15px;
}
a.kachel:hover, .kachel.aktiv { border-color: var(--gruen); }
.kachel.aktiv { box-shadow: inset 0 0 0 1px var(--gruen); }
.kachel-fertig { background: #fffbeb; }
.kachel-anfrage { background: #f6f5ff; }
.zahl-gross { display: block; font-size: 24px; font-weight: 700; color: var(--text); }

.filterzeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 12px 0; }
.filterzeile label { display: flex; flex-direction: column; font-size: 14px; color: var(--leise); }
.filterzeile input, .filterzeile select {
  padding: 8px; font: inherit; border: 1px solid var(--rahmen); border-radius: 6px; background: #fff; min-width: 160px;
}

.tabelle-rahmen { overflow-x: auto; padding: 0; }
.tabelle { min-width: 640px; }
.tabelle th { text-align: left; font-size: 14px; color: var(--leise); font-weight: 600; padding: 8px; border-bottom: 2px solid var(--rahmen); }
.tabelle td { padding: 8px; vertical-align: top; }
.tabelle th.zahl { text-align: right; }

.bereiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
a.karte.bereich { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; margin: 0; }
a.karte.bereich:hover { border-color: var(--gruen); }


/* --- Einsatzplanung ---------------------------------------------------------- */
[hidden] { display: none !important; }
.klein { font-size: 13px; }
.marke-aushilfe { display: inline-block; font-size: 12px; color: #8a5a00; background: #fdf3dc; border-radius: 10px; padding: 1px 8px; font-weight: 600; }
.knopf-gefahr { border-color: var(--fehler); color: var(--fehler); }

.inhalt:has(.pl) { max-width: none; padding: 16px 20px 80px; }
.pl { --namebreite: 200px; --spalte: 120px; --balkenhoehe: 62px; --freiraum: 28px; }
.pl .ansicht-tag { --spalte: 320px; }
.pl .ansicht-2wochen { --spalte: 88px; }
.pl .ansicht-monat { --spalte: 46px; --balkenhoehe: 34px; }

/* Werkzeugleiste */
.pl-leiste { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.pl-navi { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pl-titel { font-size: 20px; margin: 0 0 0 10px; }
.pl-knopf {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px;
  border: 1px solid var(--rahmen); border-radius: 8px; background: #fff; color: var(--text);
  text-decoration: none; font: inherit; font-size: 15px; cursor: pointer;
}
.pl-knopf:hover { border-color: var(--gruen); color: var(--gruen); }
.pl-umschalter { display: inline-flex; border: 1px solid var(--rahmen); border-radius: 8px; overflow: hidden; background: #fff; }
.pl-umschalter a { padding: 7px 14px; color: var(--leise); text-decoration: none; font-size: 15px; border-left: 1px solid var(--rahmen); }
.pl-umschalter a:first-child { border-left: 0; }
.pl-umschalter a:hover { color: var(--gruen); }
.pl-umschalter a.aktiv { background: var(--gruen); color: #fff; }
.pl-neu { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; font-size: 15px; border-radius: 8px; }
.pl-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.pl-filter select { height: 34px; padding: 0 8px; border: 1px solid var(--rahmen); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.pl-legende { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--leise); }
.pl-punkt { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 10px; }

/* Raster */
.pl-bereich { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.pl-raster-rahmen { overflow-x: auto; background: #fff; border: 1px solid var(--rahmen); border-radius: 12px; }
.pl-raster { min-width: calc(var(--namebreite) + var(--spalten) * var(--spalte)); }
.pl-kopf, .pl-zeile { display: grid; grid-template-columns: var(--namebreite) repeat(var(--spalten), minmax(var(--spalte), 1fr)); }
.pl-kopf { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--rahmen); border-radius: 12px 12px 0 0; }
.pl-ecke { padding: 10px 14px; font-size: 13px; color: var(--leise); position: sticky; left: 0; background: #fff; z-index: 4; border-right: 1px solid var(--rahmen); }
.pl-tagkopf { padding: 8px 2px; text-align: center; font-size: 12px; color: var(--leise); line-height: 1.25; }
.pl-tagkopf b { display: block; margin: 2px auto 0; font-size: 15px; color: var(--text); width: fit-content; min-width: 26px; padding: 1px 6px; border-radius: 12px; }
.pl-tagkopf.we { background: #fafaf7; }
.pl-tagkopf.heute span { color: var(--gruen); font-weight: 600; }
.pl-tagkopf.heute b { background: var(--gruen); color: #fff; }
.pl-zeile { border-top: 1px solid var(--rahmen); }
.pl-kopf + .pl-zeile { border-top: 0; }
.pl-person {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 0;
  position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--rahmen);
}
.pl-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e3efe5; color: var(--gruen);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.pl-avatar.aushilfe { background: #fdf3dc; color: #8a5a00; }
.pl-person-text { min-width: 0; }
.pl-person-text b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-person-text small { display: block; color: var(--leise); font-size: 12px; }
.pl-tage { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--spalten), minmax(var(--spalte), 1fr)); padding: 4px 0; }

/* Tagesflächen: Klick plant ein, beim Ziehen sind sie das Ziel */
.pl-tag { grid-row: 1 / -1; position: relative; border-left: 1px solid #eef0ea; text-decoration: none; color: var(--leise); min-height: calc(var(--freiraum) + 8px); }
.pl-tag:first-child { border-left: 0; }
.pl-tag.we { background: #fafaf7; }
.pl-tag.heute { background: #f2f8f3; }
.pl-tag:hover { background: #eaf3eb; }
.pl-stunden { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: var(--leise); }
.pl-plus { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); font-size: 18px; line-height: 1; color: var(--gruen); opacity: 0; transition: opacity .15s; }
.pl-tag:hover .pl-plus { opacity: 1; }
.pl-tag.pl-ziel { background: #d6ecda; box-shadow: inset 0 0 0 2px var(--gruen); }
.pl-modus-ziel .pl-tag { cursor: copy; }
.pl-modus-ziel .pl-plus { opacity: 0 !important; }
/* Während des Verschiebens lassen andere Balken die Maus zum Tag darunter durch */
.pl-modus-ziel .pl-balken:not(.pl-gewaehlt) { pointer-events: none; }

/* Balken */
.pl-balken {
  z-index: 1; min-width: 0; margin: 2px 3px; padding: 5px 9px; border-radius: 8px;
  border: 1px solid transparent; border-left-width: 4px;
  text-decoration: none; overflow: hidden; line-height: 1.25; cursor: grab;
  transition: box-shadow .15s, transform .15s, opacity .15s;
}
.pl-balken:active { cursor: grabbing; }
.pl-balken b, .pl-balken span, .pl-balken small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-balken b { font-size: 13px; }
.pl-balken span { font-size: 12px; opacity: .85; }
.pl-balken small { font-size: 11px; opacity: .75; }
.pl-balken:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .12); transform: translateY(-1px); }
.ansicht-monat .pl-balken { padding: 6px; }
.ansicht-monat .pl-balken span, .ansicht-monat .pl-balken small { display: none; }

/* Farben nach Auftragsstatus (Balken, Legende) */
.pl-balken.status-anfrage { background: #eeedfe; color: #3c3489; border-left-color: #7f77dd; }
.pl-balken.status-offen { background: #e6f1fb; color: #0c447c; border-left-color: #378add; }
.pl-balken.status-fertig { background: #faeeda; color: #633806; border-left-color: #ba7517; }
.pl-balken.status-abgerechnet { background: #eaf3de; color: #27500a; border-left-color: #639922; }
.pl-punkt.status-anfrage { background: #7f77dd; }
.pl-punkt.status-offen { background: #378add; }
.pl-punkt.status-fertig { background: #ba7517; }
.pl-balken.einsatz-verschoben { border-style: dashed; border-left-style: solid; border-color: currentColor; }
.pl-balken.einsatz-ausgefallen {
  background: repeating-linear-gradient(135deg, #f4f4f1 0 6px, #ebebe6 6px 12px);
  color: #888780; border-left-color: #b4b2a9; text-decoration: line-through;
}
.pl-balken.aushilfe { box-shadow: inset 0 0 0 1px #d9a74a; }
.pl-zieht, .pl-wartet { opacity: .45; }
.pl-wartet { pointer-events: none; }
.pl-gewaehlt { outline: 3px solid var(--gruen); outline-offset: 1px; }

/* Seitenleiste */
.pl-seite {
  background: #fff; border: 1px solid var(--rahmen); border-radius: 12px; padding: 14px;
  position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto;
}
.pl-seite-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-seite-kopf h2 { font-size: 16px; margin: 0; }
.pl-anzahl { background: #eef0ea; border-radius: 10px; padding: 1px 9px; font-size: 13px; font-weight: 600; }
.pl-sortierung { font-size: 12px; color: var(--leise); margin: 6px 0 12px; }
.pl-sortierung a { margin-left: 6px; color: var(--leise); }
.pl-sortierung a.aktiv { color: var(--gruen); font-weight: 600; text-decoration: none; }
.pl-karte {
  border: 1px solid var(--rahmen); border-left: 4px solid #888780; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; background: #fff; cursor: grab; transition: box-shadow .15s, border-color .15s;
}
.pl-karte:hover, .pl-karte:focus-visible { border-color: var(--gruen); box-shadow: 0 3px 10px rgba(0, 0, 0, .1); outline: none; }
.pl-karte b, .pl-karte span, .pl-karte small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-karte b { font-size: 14px; }
.pl-karte span { font-size: 13px; color: var(--leise); }
.pl-karte small { font-size: 12px; color: var(--leise); }
.pl-seite-leer, .pl-tipp { font-size: 13px; color: var(--leise); margin: 8px 0 0; }
.pl-leer { padding: 16px; color: var(--leise); }

/* Hinweisleisten unten: Auswahl beim Antippen, Rückmeldung nach dem Speichern */
.pl-auswahl, .pl-meldung {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  background: #1f2a21; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.pl-meldung.fehler { background: var(--fehler); }
.pl-auswahl .pl-knopf, .pl-meldung button {
  height: 32px; padding: 0 12px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}

/* Dialog Einplanen */
.pl-dialog { border: 0; border-radius: 14px; padding: 22px; width: min(460px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.pl-dialog::backdrop { background: rgba(20, 30, 22, .4); }
.pl-dialog h2 { margin: 0 0 2px; }
.pl-dialog-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-dialog .pl-haken { display: flex; align-items: center; gap: 8px; font-weight: normal; }
.pl-dialog .pl-haken input { margin: 0; }
.pl-dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pl-dialog-knoepfe .knopf { width: auto; padding: 0 18px; height: 38px; }

@media (max-width: 1000px) {
  .pl-bereich { grid-template-columns: minmax(0, 1fr); }
  .pl-seite { position: static; max-height: none; }
}
@media (max-width: 700px) {
  .pl { --namebreite: 118px; }
  .inhalt:has(.pl) { padding: 12px 10px 80px; }
  .pl-avatar { display: none; }
  .pl-titel { font-size: 17px; margin-left: 4px; }
  .pl-legende { display: none; }
}
.pl-meldung .pl-zu { border: 0; font-size: 20px; padding: 0 4px; opacity: .8; }
/* In engen Ansichten: Kundenname darf auf zwei Zeilen umbrechen, Objekt steht im Tooltip */
.ansicht-2wochen .pl-balken { padding: 5px 7px; }
.ansicht-2wochen .pl-balken b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.ansicht-2wochen .pl-balken span { display: none; }

/* Termine aus Outlook im Raster */
.pl { --terminhoehe: 40px; }
.pl .ansicht-monat { --terminhoehe: 20px; }
.pl-kalender { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 12px; font-size: 13px; color: var(--leise); }
.pl-knopf-klein { height: 28px; font-size: 13px; padding: 0 10px; }
.pl-testhinweis { background: #fdf3dc; color: #8a5a00; border-radius: 10px; padding: 1px 8px; font-weight: 600; }
.pl-termine { z-index: 1; min-width: 0; margin: 2px 3px 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.pl-termin {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 11px; line-height: 1.45; padding: 0 6px; border-radius: 4px;
  background: repeating-linear-gradient(135deg, #eceae4 0 4px, #f4f3ef 4px 8px); color: #444441;
}
.pl-termin b { font-weight: 600; }
.pl-termin.termin-abwesend { background: #fbe4e4; color: #791f1f; }
.pl-termin.termin-vorlaeufig { background: #f4f3ef; border: 1px dashed #b4b2a9; line-height: 1.3; }
.pl-termin.termin-woanders { background: #eeedfe; color: #3c3489; }
.pl-termin-mehr { font-size: 11px; color: var(--leise); padding: 0 6px; }
.ansicht-monat .pl-termin { font-size: 0; padding: 0; height: 6px; }
.ansicht-monat .pl-termine .pl-termin:nth-child(n+2), .ansicht-monat .pl-termin-mehr { display: none; }
.pl-modus-ziel .pl-termine { pointer-events: none; }
.meldung-warning { background: #fff4d6; color: #633806; }

/* Zusatz-Kennzeichen und Absage */
.marke-zusatz { display: inline-block; font-size: 12px; font-weight: 600; color: #8a5a00; background: #fdf3dc; border-radius: 10px; padding: 0 8px; }
details.absage { display: inline-block; }
details.absage > summary { list-style: none; cursor: pointer; }
details.absage > summary::-webkit-details-marker { display: none; }
details.absage[open] { display: block; flex-basis: 100%; border: 1px solid var(--rahmen); border-radius: 8px; padding: 10px; }
details.absage .formular { margin-top: 10px; }
details.absage select, details.absage input[type="text"] { display: block; width: 100%; padding: 8px; font: inherit; border: 1px solid var(--rahmen); border-radius: 6px; }

/* Stundenzettel */
.sz-titel { margin-bottom: 0; }
.sz-anweisung summary { font-weight: 600; cursor: pointer; }
.sz-anweisung p { margin: 8px 0 0; }
.sz-entwurf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: #dbeafe; }
.sz-kopf { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.sz-kopf label { margin-bottom: 0; }
.sz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.formular .sz-chip { display: inline-flex; align-items: center; margin: 0; padding: 8px 14px; border: 1px solid var(--rahmen); border-radius: 20px; background: #fff; font-weight: 600; cursor: pointer; user-select: none; }
.formular .sz-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.formular .sz-chip:has(input:checked) { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.formular .sz-chip-tn:has(input:checked) { background: #4f7f5a; border-color: #4f7f5a; }
.formular .sz-chip:has(input:focus-visible) { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.formular .sz-chip:has(input:checked)::before { content: "✓"; margin-right: 6px; }
.sz-uhr { text-align: center; }
.sz-uhr-anzeige { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sz-uhr [data-uhr-abschnitte] { min-height: 1.5em; margin-bottom: 8px; }
.sz-uhr-knopf { font-size: 20px; padding: 16px; margin-bottom: 8px; }
.sz-uhr-knopf.laeuft { background: #b45309; }
.sz-tabelle-rahmen { overflow-x: auto; margin: 0 -4px; }
.sz-zeiten { width: 100%; border-collapse: collapse; font-size: 15px; }
.sz-zeiten th, .sz-zeiten td { padding: 3px 2px; text-align: center; }
.sz-zeiten th[scope="row"] { text-align: left; font-weight: 600; min-width: 72px; max-width: 110px; hyphens: auto; padding-right: 6px; font-size: 14px; line-height: 1.25; }
.sz-zeiten thead th { font-size: 13px; color: var(--leise); font-weight: 600; }
.sz-zeiten tbody tr + tr { border-top: 1px solid var(--rahmen); }
.sz-zeiten .sz-alle { background: #eef5ef; }
.sz-zeiten tfoot td, .sz-zeiten tfoot th { border-top: 2px solid var(--text); font-weight: 600; }
.formular.sz .sz-zeiten input { min-width: 40px; margin: 0; padding: 8px 2px; text-align: center; font-size: 16px; }
.sz-reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--rahmen); }
.sz-reihe:last-child { border-bottom: 0; }
.sz-name { flex: 1 1 120px; font-weight: 600; }
.formular.sz .sz-reihe input[type="number"] { width: 90px; margin: 0; }
.formular.sz .sz-reihe input[type="text"] { flex: 1 1 100%; margin: 0; }
.formular.sz .sz-reihe select { width: auto; margin: 0; }
.formular .sz-haken { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: normal; }
.formular .sz-haken input[type="checkbox"] { margin: 0; }
.sz-einheit { min-width: 30px; color: var(--leise); }
.sz-absenden { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--flaeche) 30%); }
.sz-absenden .knopf { font-size: 18px; padding: 14px; }

/* Korrekturen und Storno */
.marke-korrigiert, .marke-storniert { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 0 8px; margin-left: 4px; }
.marke-korrigiert { color: #1e40af; background: #dbeafe; }
.marke-storniert { color: var(--fehler); background: #fde2e2; }
.erfassung.storniert .positionen, .erfassung.storniert > p:not(.klein) { text-decoration: line-through; color: var(--leise); }
.erfassung.storniert .fotos { opacity: .5; }
.protokoll { margin: 8px 0; font-size: 15px; }
.protokoll summary { cursor: pointer; color: var(--leise); }
.protokoll-eintrag { border-left: 3px solid #93c5fd; padding: 4px 0 4px 10px; margin: 8px 0; }
.protokoll-eintrag ul { margin: 4px 0 0; padding-left: 18px; }
.zettel-aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 8px 0; }
.zettel-aktionen a { text-decoration: none; }
.sz-begruendung { border-color: #93c5fd; }

/* Fehlende Stundenzettel */
.zaehler { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--fehler); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 18px; }
.fz-anzahl { display: inline-block; min-width: 26px; padding: 0 8px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--rahmen); font-size: 15px; text-align: center; }
.fz-zeile { border-top: 1px solid var(--rahmen); padding: 10px 0; }
.fz-zeile:first-of-type { border-top: 0; }
.fz-alter { font-size: 14px; color: var(--leise); }
.fz-alter.alt { color: var(--fehler); font-weight: 600; }
.fz-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.fz-aktionen form { margin: 0; }
.fz-aktionen a { text-decoration: none; }
.fz-hell { background: #fafaf7; }
.fz-meine { border-color: #f2c94c; background: #fffbea; }

/* Abrechnung */
.marke-abgerechnet { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 0 8px; margin-left: 4px; color: #3f3f46; background: #e4e4e7; }
.ab-posten { display: block; color: inherit; text-decoration: none; border-top: 1px solid var(--rahmen); padding: 10px 0; }
.ab-posten:first-child { border-top: 0; }
.ab-posten:hover strong { text-decoration: underline; }
.ab-hinweise { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: #8a5a00; }
.ab-monat { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 12px 0 0; }
.ab-monat label { margin: 0; font-size: 14px; font-weight: 600; }
.ab-monat input { display: block; padding: 6px; font: inherit; border: 1px solid var(--rahmen); border-radius: 6px; }
.ab-tabelle { width: 100%; border-collapse: collapse; }
.ab-tabelle td, .ab-tabelle th { padding: 6px 4px; border-top: 1px solid var(--rahmen); }
.ab-tabelle tr:first-child td, .ab-tabelle tr:first-child th { border-top: 0; }
.ab-tabelle th { text-align: left; font-size: 14px; color: var(--leise); }
.ab-tabelle td.zahl { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: copy; }
.ab-tabelle td.zahl.kopiert { background: #d1fae5; }
.ab-einheit { width: 40px; color: var(--leise); }
.ab-info { opacity: .7; }
.ab-info h2::after { content: " – nur zur Info"; font-size: 14px; font-weight: normal; color: var(--leise); }
.ab-zettel summary { font-weight: 600; cursor: pointer; }
.ab-abschluss { border-color: var(--gruen); }
@media print {
  .nicht-drucken, details.ab-zettel:not([open]) { display: none !important; }
  .ab-abschnitt { break-inside: avoid; }
}

/* Anfragen und Notizen */
.anfrage-alter { color: var(--leise); margin: 0 0 8px; }
.anfrage-alter.ueberfaellig { color: var(--fehler); font-weight: 600; }
.notiz-formular { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.notiz-formular textarea { flex: 1 1 240px; }
.formular.notiz-formular textarea { margin: 0; }
.notiz { border-top: 1px solid var(--rahmen); padding: 8px 0; }

/* Meine Woche */
.mw-navi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mw-navi a { text-decoration: none; }
.mw-navi select { padding: 4px 6px; font: inherit; border: 1px solid var(--rahmen); border-radius: 6px; }
.mw-tag h2 { font-size: 18px; }
.mw-tag.heute { border: 2px solid var(--gruen); }
.mw-tag.vorbei { opacity: .75; }
.mw-einsatz { border-top: 1px solid var(--rahmen); padding: 10px 0 4px; }
.mw-tag h2 + .mw-einsatz, .mw-termin + .mw-einsatz { border-top: 0; }
.mw-einsatz p { margin: 4px 0; }
.mw-einsatz.ausgefallen > :not(.fz-aktionen) { text-decoration: line-through; color: var(--leise); }
.mw-notiz { background: #fffbea; border-radius: 4px; padding: 2px 6px; }
.mw-hinweise { border-left: 3px solid #f2c94c; padding-left: 8px; }
.mw-termin { margin: 4px 0; padding: 2px 8px; border-radius: 4px; font-size: 14px; background: #e8eef9; }
.mw-termin.termin-abwesend { background: #fde2e2; }
.mw-erfasst { color: var(--gruen); font-weight: 600; }

/* Wochenplan zum Aushang */
.wp-titel { font-size: 20px; }
.wp-tabelle { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; font-size: 13px; }
.wp-tabelle th, .wp-tabelle td { border: 1px solid #b8bdb3; padding: 4px; vertical-align: top; text-align: left; }
.wp-tabelle thead th { background: #eef5ef; font-size: 13px; }
.wp-tabelle thead th span { font-weight: normal; color: var(--leise); }
.wp-tabelle thead th.heute { background: #cfe6d3; }
.wp-tabelle .wp-name { width: 120px; }
.wp-einsatz { margin-bottom: 4px; line-height: 1.25; }
.wp-einsatz + .wp-einsatz { border-top: 1px dashed #b8bdb3; padding-top: 3px; }
.wp-einsatz b, .wp-einsatz span, .wp-einsatz small { display: block; overflow-wrap: anywhere; }
.wp-einsatz small { color: var(--leise); }
.wp-termin { font-size: 12px; background: #e8eef9; border-radius: 3px; padding: 0 4px; margin-bottom: 3px; }
.wp-termin.termin-abwesend { background: #fde2e2; font-weight: 600; }
.wp-fuss { font-size: 12px; color: var(--leise); }
@media print {
  .inhalt { max-width: none; padding: 0; }
  .wp .tabelle-rahmen { overflow: visible; }
  .wp-tabelle { font-size: 11px; }
  .wp-tabelle tr { break-inside: avoid; }
  .wp-termin, .wp-tabelle thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.inhalt:has(.wp) { max-width: 1300px; }

/* Tageszeit (vormittags/nachmittags) */
.tageszeit { display: inline-block; font-size: 12px; font-weight: 700; color: #1e40af; background: #dbeafe; border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.wp-einsatz .tageszeit { display: inline-block; margin-bottom: 1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pl-tageszeit { font-weight: 700; }

/* Hinweis „Uhr läuft“ auf allen Seiten */
.laufende-uhr { position: sticky; top: 0; z-index: 50; }
.laufende-uhr-eintrag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 16px; color: #fff; text-decoration: none; font-size: 15px; }
.laufende-uhr-eintrag.laeuft { background: #b45309; }
.laufende-uhr-eintrag.pausiert { background: #fde68a; color: #633806; }
.laufende-uhr-eintrag + .laufende-uhr-eintrag { border-top: 1px solid rgba(255, 255, 255, .4); }
.laufende-uhr-eintrag b { font-variant-numeric: tabular-nums; font-size: 17px; }
.laufende-uhr-eintrag span { overflow-wrap: anywhere; }
.laufende-uhr-weiter { margin-left: auto; font-weight: 600; white-space: nowrap; }
@media print { .laufende-uhr { display: none; } }

/* Zurück-Link oben auf Unterseiten: ruhig, mit Pfeil, große Tippfläche */
.zurueck-zeile { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
.zurueck, .zurueck-weiter { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--leise); text-decoration: none; font-size: 15px; }
.zurueck::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 2px; }
.zurueck:hover, .zurueck-weiter:hover { color: var(--gruen); }
.zurueck-weiter::after { content: "›"; font-size: 18px; line-height: 1; }
/* Rechts ausblenden, wenn das Menü breiter als der Bildschirm ist (Hinweis: wischen) */
.kopf-menue.ueberlauf { mask-image: linear-gradient(to right, #000 85%, transparent); -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); }
.kopf-menue.ueberlauf.am-ende { mask-image: none; -webkit-mask-image: none; }
