/* BaustellenManager – Gestaltung ab Version 0.6.0
   Grundsatz: klar, reduziert, Steingrau + eine Akzentfarbe (Petrol).
   Alle Farben/Abstände stehen als Variablen hier oben – Änderungen nur hier. */

:root {
  /* Steingrau (hell → dunkel) */
  --stein-50: #fafaf9;
  --stein-100: #f5f5f4;
  --stein-200: #e7e5e4;
  --stein-300: #d6d3d1;
  --stein-400: #a8a29e;
  --stein-500: #78716c;
  --stein-600: #57534e;
  --stein-700: #44403c;
  --stein-800: #292524;
  --stein-900: #1c1917;

  /* Akzent: Petrol – nur für Aktionen, Auswahl, „heute“ */
  --akzent: #0f766e;
  --akzent-dunkel: #115e59;
  --akzent-hell: #f0fdfa;
  --akzent-rand: #99d5cd;

  /* Bedeutungsfarben (nur für Zustände) */
  --rot: #b91c1c;      --rot-hell: #fef2f2;   --rot-rand: #fecaca;
  --gelb: #92400e;     --gelb-hell: #fffbeb;  --gelb-rand: #fde68a;
  --gruen: #166534;    --gruen-hell: #f0fdf4; --gruen-rand: #bbf7d0;
  --blau: #1e40af;     --blau-hell: #eff6ff;

  --text: var(--stein-900);
  --text-leise: var(--stein-600);
  --hintergrund: var(--stein-100);
  --flaeche: #ffffff;
  --rand: var(--stein-200);
  --rand-stark: var(--stein-300);

  --radius: 10px;
  --radius-klein: 6px;
  --schatten: 0 1px 2px rgba(28, 25, 23, .05);
  --kopf-hoehe: 56px;
  --leiste-hoehe: 64px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--hintergrund);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--akzent-dunkel); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

.sym {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.25em;
}
.sym-vorrat { position: absolute; width: 0; height: 0; overflow: hidden; }

h1 { font-size: 1.5rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; margin: .25rem 0 1.25rem; }
h1 small, .untertitel { display: block; font-size: .9rem; font-weight: 500; color: var(--text-leise); letter-spacing: 0; margin-top: .25rem; }
h2 { font-size: 1rem; font-weight: 650; color: var(--stein-700); margin: 2rem 0 .75rem; }
h2 small { font-weight: 400; color: var(--text-leise); font-size: .875rem; margin-left: .35rem; }
h3 { font-size: 1.05rem; font-weight: 650; line-height: 1.35; margin: .35rem 0 .15rem; }
h3 a { color: var(--text); }
p { margin: .5rem 0; }

/* ---------- Kopfzeile ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  height: var(--kopf-hoehe);
  padding: 0 1rem; padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right));
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}
.marke { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.marke:hover { text-decoration: none; }
.marke-zeichen { width: 1.6rem; height: 1.6rem; color: var(--akzent); }

/* Hauptmenü – PC: Reiter in der Kopfzeile */
.menue { display: flex; align-items: stretch; gap: .25rem; height: 100%; margin-left: 1.5rem; }
.menue a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: 0 .75rem; color: var(--text-leise); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.menue a:hover { color: var(--text); text-decoration: none; }
.menue a[aria-current="page"] { color: var(--akzent-dunkel); border-bottom-color: var(--akzent); }

/* Konto: angemeldet als … + Abmelden */
.konto { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.nutzer { position: relative; }
.nutzer summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .5rem; border-radius: var(--radius);
}
.nutzer summary::-webkit-details-marker { display: none; }
.nutzer summary:hover, .nutzer[open] summary { background: var(--stein-100); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--stein-200); color: var(--stein-700); font-weight: 700; font-size: .9rem;
}
.angemeldet { display: flex; flex-direction: column; line-height: 1.2; font-size: .875rem; }
.angemeldet strong { font-weight: 650; }
.angemeldet .name { white-space: nowrap; }
.angemeldet .login { color: var(--text-leise); font-weight: 400; }
.rolle { font-size: .75rem; color: var(--text-leise); font-weight: 500; }
.rolle::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .3rem; background: var(--stein-400); vertical-align: .05em; }
.rolle-administrator::before { background: var(--rot); }
.rolle-disposition::before { background: var(--akzent); }
.rolle-mitarbeiter::before { background: var(--stein-500); }
.nutzer-menue {
  position: absolute; right: 0; top: calc(100% + .35rem); min-width: 13rem;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 25, 23, .12); padding: .35rem; z-index: 30;
}
.nutzer-menue a { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border-radius: var(--radius-klein); color: var(--text); }
.nutzer-menue a:hover { background: var(--stein-100); text-decoration: none; }

/* Abmelden: dunkler Steinton, klar abgesetzt */
.knopf-abmelden {
  display: inline-flex; align-items: center; gap: .4rem;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--stein-700); border: 0; border-radius: var(--radius-klein);
  padding: .5rem .85rem; min-height: 2.25rem;
}
.knopf-abmelden:hover { background: var(--stein-900); }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.inhalt.breit { max-width: none; padding-left: 1.5rem; padding-right: 1.5rem; }
.fuss { text-align: center; color: var(--stein-600); font-size: .8rem; padding: 1rem 1rem 2rem; }

/* ---------- Karten ---------- */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1rem 1.1rem;
}
.karte + .karte { margin-top: .6rem; }
.schmal { max-width: 420px; margin: 2.5rem auto; padding: 1.75rem; }
a.karte.verweis { display: block; color: inherit; }
a.karte.verweis:hover { text-decoration: none; border-color: var(--rand-stark); }
a.karte.verweis:active { background: var(--stein-50); }
a.karte.verweis h3 { color: var(--text); }

.zeile-oben { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.zeitraum, .frist, .unterzeile {
  display: inline-flex; align-items: flex-start; gap: .4rem;
  color: var(--text-leise); font-size: .875rem; margin: 0; font-variant-numeric: tabular-nums;
}
.unterzeile { display: flex; margin-top: .15rem; }
.unterzeile a { color: var(--text-leise); }
.ressource { font-weight: 600; font-size: .9rem; margin: .35rem 0 0; }
.adresse { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .2rem .4rem; margin: .4rem 0 0; color: var(--stein-700); font-size: .95rem; }
.adresse .sym { color: var(--stein-500); }
.adresse > .sym { margin-top: .2rem; }
.adresse > a { margin-left: .35rem; display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; }
.zeitraum > .sym, .unterzeile > .sym { margin-top: .1rem; }
.notiz { margin: .5rem 0 0; font-size: .925rem; color: var(--stein-700); }
.leer { color: var(--text-leise); margin: .25rem 0; }
.zurueck { margin: 0 0 .5rem; font-size: .9rem; }
.zurueck a { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-leise); }
.aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.aktionen:empty { display: none; }
.felder { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .75rem 0 0; }
.felder dt { color: var(--text-leise); font-size: .9rem; }
.felder dd { margin: 0; }

/* Einsatz-Karte: farbiger Streifen = Mitarbeiter/Maschine */
.karte.einsatz { border-left: 4px solid var(--stein-300); }
.karte.ist-heute { border-color: var(--akzent-rand); box-shadow: 0 0 0 1px var(--akzent-rand); }
.karte.aufgabe.meine { border-left: 4px solid var(--akzent); }

/* Abwesenheit */
.karte.abwesenheit { display: flex; align-items: center; gap: .6rem; border-left: 4px solid var(--stein-400); }
.karte.abwesenheit-urlaub { border-left-color: #d6b23a; background: linear-gradient(90deg, #fefbea, #fff 60%); }
.karte.abwesenheit-abwesend { background: linear-gradient(90deg, var(--stein-100), #fff 60%); }

/* ---------- Kennzeichen (Status, heute) ---------- */
.status, .marke-heute {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 600; line-height: 1; white-space: nowrap;
  padding: .3rem .55rem; border-radius: 999px;
  background: var(--stein-100); color: var(--stein-700);
}
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .8; }
.status-geplant { background: var(--blau-hell); color: var(--blau); }
.status-in_arbeit, .status-laufend { background: var(--gelb-hell); color: var(--gelb); }
.status-erledigt, .status-abgeschlossen { background: var(--gruen-hell); color: var(--gruen); }
.marke-heute { background: var(--akzent); color: #fff; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: 1rem; padding: .7rem 1.15rem; min-height: 2.75rem;
  font: inherit; font-weight: 600; line-height: 1.2;
  color: #fff; background: var(--akzent);
  border: 1px solid var(--akzent); border-radius: var(--radius-klein);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); text-decoration: none; }
form .knopf { width: 100%; }
form.inline .knopf { width: auto; }
.knopf.klein { margin-top: 0; padding: .4rem .75rem; min-height: 2.25rem; font-size: .875rem; width: auto; }
.knopf.zweitrangig { background: var(--flaeche); color: var(--stein-800); border-color: var(--rand-stark); }
.knopf.zweitrangig:hover { background: var(--stein-100); border-color: var(--stein-400); }
.knopf.umriss { background: var(--flaeche); color: var(--akzent-dunkel); border-color: var(--akzent-rand); }
.knopf.umriss:hover { background: var(--akzent-hell); border-color: var(--akzent); }
.knopf.nur-symbol { padding-left: .55rem; padding-right: .55rem; }
.inline { display: inline; margin: 0; }
.knopfgruppe { display: inline-flex; }
.knopfgruppe .knopf { border-radius: 0; margin-left: -1px; }
.knopfgruppe .knopf:first-child { border-radius: var(--radius-klein) 0 0 var(--radius-klein); margin-left: 0; }
.knopfgruppe .knopf:last-child { border-radius: 0 var(--radius-klein) var(--radius-klein) 0; }

/* ---------- Formulare ---------- */
label { display: block; margin-top: 1rem; margin-bottom: .3rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=password] {
  width: 100%; padding: .7rem .8rem;
  font: inherit; font-size: 1rem;   /* 16px verhindert Zoom auf dem iPhone */
  color: var(--text); background: var(--flaeche);
  border: 1px solid var(--rand-stark); border-radius: var(--radius-klein);
}
input[type=text]:focus, input[type=password]:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }

/* ---------- Meldungen ---------- */
.fehler { color: var(--rot); font-size: .9rem; margin: .35rem 0 0; }
.hinweis { color: var(--text-leise); font-size: .875rem; }
.meldung {
  padding: .7rem .9rem; margin: 0 0 1rem; border-radius: var(--radius-klein); font-size: .925rem;
  background: var(--stein-50); border: 1px solid var(--rand); border-left-width: 4px;
}
.meldung-success { background: var(--gruen-hell); border-color: var(--gruen-rand); border-left-color: var(--gruen); }
.meldung-warning, .meldung-info { background: var(--gelb-hell); border-color: var(--gelb-rand); border-left-color: #d97706; }
.meldung-error { background: var(--rot-hell); border-color: var(--rot-rand); border-left-color: var(--rot); }
.warnung {
  display: flex; align-items: flex-start; gap: .45rem;
  margin: .6rem 0 0; padding: .5rem .65rem; font-size: .875rem; line-height: 1.4;
  color: var(--rot); background: var(--rot-hell); border-radius: var(--radius-klein);
}
.warnung .sym { margin-top: .05rem; }
.liste { padding-left: 1.2rem; }

/* ---------- Einsatzplan ---------- */
.ep-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.ep-kopf h1 { margin: 0; }
.ep-navigation { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ep-zaehler {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .875rem; font-weight: 600; color: var(--rot);
  background: var(--rot-hell); border: 1px solid var(--rot-rand); border-radius: 999px; padding: .35rem .75rem;
}
.bedienung { margin: 0 0 .75rem; font-size: .875rem; color: var(--text-leise); }
.bedienung summary { cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--stein-700); list-style: none; }
.bedienung summary::-webkit-details-marker { display: none; }
.bedienung ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.bedienung li { margin: .15rem 0; }

.ep-zeitleiste {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); overflow: hidden; font-family: var(--schrift);
}
.ep-zeitleiste .vis-timeline { border: 0; }
.ep-zeitleiste .vis-panel.vis-center, .ep-zeitleiste .vis-panel.vis-left,
.ep-zeitleiste .vis-panel.vis-top, .ep-zeitleiste .vis-panel.vis-bottom { border-color: var(--rand); }
.ep-zeitleiste .vis-time-axis .vis-text { color: var(--stein-600); font-size: .8rem; }
.ep-zeitleiste .vis-time-axis .vis-text.vis-major { color: var(--stein-800); font-weight: 600; }
.ep-zeitleiste .vis-time-axis .vis-grid.vis-minor { border-color: var(--stein-100); }
.ep-zeitleiste .vis-time-axis .vis-grid.vis-major { border-color: var(--stein-200); }
.ep-zeitleiste .vis-labelset .vis-label { border-bottom-color: var(--stein-200); color: var(--text); }
.ep-zeitleiste .vis-foreground .vis-group { border-bottom-color: var(--stein-200); }
.ep-zeitleiste .vis-label .vis-inner { padding: 6px 10px; line-height: 1.2; font-weight: 600; font-size: .875rem; }
.ep-zeitleiste .vis-label small { font-weight: 400; font-size: .75rem; color: var(--text-leise); }
.ep-zeitleiste .vis-label.ep-gruppe-maschine { background: var(--stein-50); }

.ep-zeitleiste .vis-item {
  border: 1px solid rgba(28, 25, 23, .14); border-radius: 5px;
  color: var(--stein-900); font-size: .8rem; font-weight: 500;
}
.ep-zeitleiste .vis-item .vis-item-content { padding: 3px 7px; }
.ep-zeitleiste .vis-item.vis-selected { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent); z-index: 2; }
.ep-zeitleiste .vis-item.ep-konflikt { border: 2px solid var(--rot); box-shadow: 0 0 0 2px var(--rot-rand); }
.ep-zeitleiste .vis-item.vis-background { border: 0; border-radius: 0; }
.ep-zeitleiste .vis-item.vis-background.ep-wochenende { background: rgba(120, 113, 108, .09); }
.ep-zeitleiste .vis-item.vis-background.ep-kw { background: transparent; border-left: 1px solid var(--stein-400); }
.ep-zeitleiste .vis-item.vis-background.ep-kw-gerade { background: rgba(120, 113, 108, .035); }
.ep-zeitleiste .vis-item.vis-background.ep-kw .vis-item-content {
  font-size: .7rem; font-weight: 700; color: var(--stein-600); letter-spacing: .02em;
  padding: 2px 6px; background: rgba(255, 255, 255, .9); border-radius: 0 0 4px 0;
}
.ep-zeitleiste .vis-custom-time, .ep-zeitleiste .vis-current-time { background-color: var(--akzent); width: 2px; }

/* Urlaub / Abwesenheit im Einsatzplan */
.ep-zeitleiste .vis-item.ep-abwesenheit { border: 1px dashed var(--stein-500); color: var(--stein-700); font-style: italic; }
.ep-zeitleiste .vis-item.ep-urlaub,
.ep-muster-urlaub { background: repeating-linear-gradient(45deg, #fdf3c4, #fdf3c4 6px, #fff 6px, #fff 12px) !important; }
.ep-zeitleiste .vis-item.ep-abwesend,
.ep-muster-abwesend { background: repeating-linear-gradient(45deg, var(--stein-200), var(--stein-200) 6px, #fff 6px, #fff 12px) !important; }

.ep-legende { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.ep-legende h2 { margin: 0 .5rem 0 0; font-size: .875rem; }
.ep-legende-eintrag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .825rem; color: var(--stein-700);
  padding: .25rem .6rem .25rem .4rem; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 999px;
}
a.ep-legende-eintrag:hover { text-decoration: none; border-color: var(--rand-stark); }
.ep-legende-eintrag > span { width: .85rem; height: .85rem; border-radius: 3px; border: 1px solid rgba(28, 25, 23, .18); display: inline-block; }

/* Baustellen-Liste */
a.karte.baustelle-zeile { display: flex; align-items: center; gap: .75rem; }
.baustelle-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.baustelle-text h3 { margin: 0 0 .15rem; }
.zaehler { font-size: .8rem; font-weight: 600; color: var(--text-leise); white-space: nowrap; }
.zaehler.hat-offene { color: var(--akzent-dunkel); }
.baustelle-zeile .pfeil { color: var(--stein-400); }
.seitenkopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.seitenkopf h1 { margin-bottom: 1rem; }
.seitenkopf .status { margin-top: .45rem; }

/* Formularseiten (Anmelden, Passwort) */
.formkopf { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.formkopf h1 { margin: 0; }
.sym.gross { width: 2.25rem; height: 2.25rem; color: var(--stein-500); }
.sym.gross.marke-zeichen { color: var(--akzent); }
.sym.gross.erfolg { color: var(--gruen); }
.sym.gross.warn { color: var(--rot); margin-bottom: .25rem; }

/* Fehlerseite */
.fehlerseite h1 { color: var(--rot); font-size: 1.3rem; }
.fehlerseite form .knopf { width: 100%; }

/* ---------- Handy / schmale Fenster ---------- */
@media (max-width: 899px) {
  :root { --kopf-hoehe: 52px; }
  .kopf { gap: .5rem; }
  .marke-text { display: none; }
  .konto { gap: .4rem; min-width: 0; }
  .nutzer { min-width: 0; }
  .nutzer summary { padding: .25rem .35rem; gap: .45rem; min-width: 0; }
  .angemeldet { min-width: 0; }
  .angemeldet .name, .angemeldet .rolle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .angemeldet .login { display: none; }
  .avatar { width: 1.85rem; height: 1.85rem; font-size: .85rem; }
  .knopf-abmelden { padding: .45rem .65rem; }

  /* Menü als Leiste unten (Daumen) */
  .menue {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    height: auto; margin: 0; gap: 0;
    padding: .3rem max(.25rem, env(safe-area-inset-right)) calc(.3rem + env(safe-area-inset-bottom)) max(.25rem, env(safe-area-inset-left));
    background: #fff; border-top: 1px solid var(--rand);
    box-shadow: 0 -2px 12px rgba(28, 25, 23, .06);
  }
  .menue a {
    flex: 1; flex-direction: column; justify-content: center; gap: .15rem;
    min-height: 3.25rem; padding: .25rem; margin: 0; border: 0; border-radius: var(--radius-klein);
    font-size: .7rem; font-weight: 600; color: var(--stein-500);
  }
  .menue a .sym { width: 1.5rem; height: 1.5rem; }
  .menue a[aria-current="page"] { color: var(--akzent-dunkel); background: var(--akzent-hell); }
  body.mit-menue { padding-bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom)); }

  .inhalt { padding: 1.1rem .85rem 1.5rem; }
  .inhalt.breit { padding-left: .6rem; padding-right: .6rem; }
  h1 { font-size: 1.35rem; margin-bottom: 1rem; }
  .ep-kopf { align-items: flex-start; }
  .ep-navigation { width: 100%; }
  .ep-navigation .knopf-neu { margin-left: auto; }
  .baustelle-zeile { flex-wrap: wrap; }
  .baustelle-zeile .zaehler { order: 3; flex-basis: 100%; }
  .baustelle-zeile .pfeil { display: none; }
  .felder { grid-template-columns: 1fr; gap: 0; }
  .felder dd { margin-bottom: .5rem; }
  .ep-zeitleiste .vis-label .vis-inner { padding: 4px 6px; font-size: .8rem; max-width: 7rem; }
  .ep-zeitleiste .vis-label small { display: none; }
  .ep-zeitleiste .vis-item { font-size: .75rem; }
}

/* ---------- Kanban-Board (Etappe 5) ---------- */
.nur-lesbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kb-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.kb-filter select, .kb-neu-form select, .kb-neu-form input {
  font: inherit; font-size: .9rem; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--rand-stark); border-radius: var(--radius-klein); padding: .45rem .6rem; min-height: 2.25rem;
}
.kb-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: .75rem;
  overflow-x: auto; padding-bottom: .5rem; align-items: start;
  scroll-snap-type: x proximity;
}
.kb-spalte {
  background: var(--stein-200); border-radius: var(--radius); padding: .6rem; min-height: 8rem;
  scroll-snap-align: start; display: flex; flex-direction: column; gap: .4rem;
}
.kb-spalte-erledigt { background: #e3ebe5; }
.kb-kopf { display: flex; justify-content: space-between; align-items: center; padding: .15rem .3rem .3rem; }
.kb-kopf h3 { margin: 0; font-size: .9rem; font-weight: 700; color: var(--stein-800); }
.kb-anzahl { font-size: .75rem; font-weight: 700; color: var(--stein-600); background: rgba(255,255,255,.7); border-radius: 999px; padding: .1rem .5rem; }
.kb-liste { display: flex; flex-direction: column; gap: .5rem; min-height: 2.5rem; }
.kb-karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-klein);
  box-shadow: var(--schatten); padding: .6rem .7rem; cursor: grab; touch-action: pan-y;
  border-left: 3px solid var(--stein-300);
}
.kb-karte.kb-meine { border-left-color: var(--akzent); }
.kb-karte.kb-fest { cursor: default; background: var(--stein-50); }
.kb-karte:active { cursor: grabbing; }
.kb-geist { opacity: .4; }
.kb-gewaehlt { box-shadow: 0 6px 18px rgba(28,25,23,.18); }
.kb-titel { margin: 0 0 .2rem; font-size: .925rem; font-weight: 650; line-height: 1.3; }
.kb-termin, .kb-zeile { display: flex; align-items: flex-start; gap: .3rem; margin: 0 0 .15rem; font-size: .8rem; color: var(--text-leise); }
.kb-termin .sym, .kb-zeile .sym { width: 1em; height: 1em; margin-top: .15rem; }
.kb-zeile a { color: var(--text-leise); }
.kb-aktionen { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .35rem; font-size: .8rem; }
.kb-status summary { cursor: pointer; color: var(--akzent-dunkel); font-weight: 600; list-style: none; }
.kb-status summary::-webkit-details-marker { display: none; }
.kb-status-menue { display: flex; flex-direction: column; gap: .25rem; margin-top: .35rem; }
.kb-status-menue form { margin: 0; }
.kb-status-menue button {
  width: 100%; text-align: left; font: inherit; font-size: .8rem; cursor: pointer;
  background: var(--stein-100); border: 1px solid var(--rand); border-radius: var(--radius-klein); padding: .4rem .55rem; color: var(--text);
}
.kb-status-menue button:hover { background: var(--akzent-hell); border-color: var(--akzent-rand); }
.kb-bearbeiten { color: var(--text-leise); }
.kb-leer { margin: 0; padding: .4rem; font-size: .8rem; color: var(--stein-500); text-align: center; }
.kb-hinweis { margin: 0; font-size: .8rem; color: var(--text-leise); text-align: center; }
.kb-neu summary {
  display: flex; align-items: center; gap: .3rem; cursor: pointer; list-style: none;
  font-size: .85rem; font-weight: 600; color: var(--stein-600); padding: .35rem .4rem; border-radius: var(--radius-klein);
}
.kb-neu summary::-webkit-details-marker { display: none; }
.kb-neu summary:hover { background: rgba(255,255,255,.6); color: var(--text); }
.kb-neu-form { background: var(--flaeche); border-radius: var(--radius-klein); padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.kb-neu-form label { margin: 0; font-size: .8rem; font-weight: 600; display: flex; flex-direction: column; gap: .2rem; }
.kb-neu-form input, .kb-neu-form select { width: 100%; font-size: 1rem; }
.kb-neu-daten { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.kb-neu-form .knopf { width: 100%; margin-top: .2rem; }
.kb-abschnitt h2 { display: flex; align-items: baseline; gap: .5rem; }
.kb-alle { margin-left: auto; font-size: .85rem; font-weight: 500; }
@media (max-width: 899px) {
  .kb-board { grid-auto-columns: 82%; margin: 0 -.6rem; padding: 0 .6rem .5rem; }
  .kb-filter { width: 100%; }
  .kb-filter select { flex: 1; min-width: 0; }
}
@media (min-width: 900px) {
  .kb-abschnitt .kb-board { grid-auto-columns: minmax(180px, 1fr); }
}
@media (max-width: 899px) {
  .menue a { font-size: .66rem; }
  .menue a span { white-space: nowrap; }
}
.kb-status summary, .kb-bearbeiten { white-space: nowrap; }

/* ---------- Zeitplan / Gantt (Etappe 6) ---------- */
.ansicht-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 2rem 0 .75rem; }
.ansicht-kopf h2 { margin: 0; }
.ansicht-kopf .kb-alle { margin-left: auto; }
.umschalter { display: inline-flex; background: var(--stein-200); border-radius: var(--radius-klein); padding: 3px; }
.umschalter a {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 4px;
  font-size: .875rem; font-weight: 600; color: var(--stein-600);
}
.umschalter a:hover { text-decoration: none; color: var(--text); }
.umschalter a[aria-current="page"] { background: var(--flaeche); color: var(--akzent-dunkel); box-shadow: var(--schatten); }
.zp-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.zp-ansicht .knopf.aktiv { background: var(--akzent-hell); color: var(--akzent-dunkel); border-color: var(--akzent-rand); }
.zp-hilfe { margin: 0; font-size: .8rem; }
.zp-konflikte { margin-bottom: .75rem; }
.zp-konflikte .warnung { margin: .3rem 0 0; }
.zp-diagramm { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; font-family: var(--schrift); }
.zp-diagramm .vis-timeline { border: 0; }
.zp-diagramm .vis-panel.vis-center, .zp-diagramm .vis-panel.vis-left, .zp-diagramm .vis-panel.vis-top { border-color: var(--rand); }
.zp-diagramm .vis-time-axis .vis-text { color: var(--stein-600); font-size: .8rem; }
.zp-diagramm .vis-time-axis .vis-text.vis-major { color: var(--stein-800); font-weight: 600; }
.zp-diagramm .vis-time-axis .vis-grid.vis-minor { border-color: var(--stein-100); }
.zp-diagramm .vis-time-axis .vis-grid.vis-major { border-color: var(--stein-200); }
.zp-diagramm .vis-labelset .vis-label { border-bottom-color: var(--stein-100); color: var(--text); }
.zp-diagramm .vis-foreground .vis-group { border-bottom-color: var(--stein-100); }
.zp-diagramm .vis-label .vis-inner { padding: 5px 10px; font-size: .85rem; font-weight: 600; max-width: 16rem; white-space: normal; line-height: 1.25; }
.zp-diagramm .vis-label .vis-inner a { color: var(--text); }
.zp-diagramm .vis-label.zp-zeile-baustelle { background: var(--akzent-hell); }
.zp-diagramm .vis-label.zp-zeile-baustelle .vis-inner { color: var(--akzent-dunkel); }
.zp-diagramm .vis-item { border: 1px solid rgba(28, 25, 23, .18); border-radius: 5px; color: var(--stein-900); font-size: .75rem; font-weight: 500; }
.zp-diagramm .vis-item .vis-item-content { padding: 3px 6px; }
.zp-diagramm .vis-item.vis-selected { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent); }
.zp-diagramm .vis-custom-time { background-color: var(--akzent); width: 2px; }
.zp-diagramm .vis-custom-time > .vis-custom-time-marker { display: none; }
.zp-diagramm .vis-time-axis .vis-grid.vis-saturday, .zp-diagramm .vis-time-axis .vis-grid.vis-sunday { background: var(--stein-100); }
/* Statusfarben (wie die Kennzeichen im Kanban) */
.vis-item.zp-offen, .zp-farbe.zp-offen { background: #e7e5e4; }
.vis-item.zp-geplant, .zp-farbe.zp-geplant { background: #bfdbfe; }
.vis-item.zp-in_arbeit, .zp-farbe.zp-in_arbeit { background: #fde68a; }
.vis-item.zp-erledigt, .zp-farbe.zp-erledigt { background: #bbf7d0; }
.vis-item.zp-konflikt, .zp-farbe.zp-konflikt { background: #fecaca; border: 2px solid #b91c1c !important; }
.vis-item.zp-baustelle, .zp-farbe.zp-baustelle { background: #99d5cd; color: var(--akzent-dunkel); font-weight: 600; }
.vis-item.zp-b-geplant, .zp-farbe.zp-b-geplant { background: #bfdbfe; }
.vis-item.zp-b-laufend, .zp-farbe.zp-b-laufend { background: #99d5cd; }
.vis-item.zp-b-abgeschlossen, .zp-farbe.zp-b-abgeschlossen { background: #e7e5e4; }
.zp-farbe { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; border: 1px solid rgba(28,25,23,.18); vertical-align: -.15em; margin-right: .3rem; }
.zp-legende { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .75rem; font-size: .825rem; color: var(--stein-700); align-items: center; }
.zp-legende .hinweis { margin: 0; }
.zp-ohne { margin-top: .75rem; font-size: .9rem; }
.zp-ohne summary { cursor: pointer; font-weight: 600; color: var(--stein-700); }
.zp-ohne li { margin: .3rem 0; }
@media (max-width: 899px) {
  .zp-diagramm .vis-label .vis-inner { max-width: 8rem; font-size: .75rem; padding: 3px 6px; }
}
@media (max-width: 899px) {
  .menue a.menue-verwaltung { display: none; }
  .zp-hilfe { display: none; }
}
@media (min-width: 900px) {
  .nutzer-menue .nur-handy { display: none; }
}
/* Hauptmenü mit vielen Punkten: Beschriftung einzeilig, Markenname nur auf breiten Bildschirmen */
@media (min-width: 900px) {
  .menue a { white-space: nowrap; padding: 0 .6rem; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .marke-text { display: none; }
  .menue { margin-left: .5rem; }
}
