/* Reiter „Baustellen“ (nur Handwerk, js/baustellen.js, 16.10.2026). Aufbau wie der Reiter Terminal. */

#tab-baustellen.bau-pane {
  padding: 20px 24px;
  max-width: none;
  display: flex;
  flex-direction: column;
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  overflow: hidden;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
}
body.tab-baustellen-active { background: #dce5ed; }
/* Untere Leiste mit dem 7. Reiter (nur Handwerk) */
body.nav-handwerk .app-nav { grid-template-columns: repeat(7, 1fr); }
body.nav-handwerk.nav-ohne-terminal .app-nav { grid-template-columns: repeat(6, 1fr); }   /* Reiter Terminal aus (js/app.js appTerminalReiterAnzeigen) */
html.dark #tab-baustellen.bau-pane { background: linear-gradient(160deg, #141414 0%, #1a1a1a 100%); }
html.dark.tab-baustellen-active { background: #141414; }

.bau-panel .dash-header { flex-wrap: wrap; }
.bau-neu { margin-left: auto; }

.bau-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  gap: 16px;
  flex: 1 1 0;
  min-height: 420px;
}
.bau-grid > .loading, .bau-grid > .dash-empty-note { grid-column: 1 / -1; }
.bau-spalte { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; }
.bau-spalte > .dash-card { flex: 1 1 0; min-height: 0; margin: 0; }
.bau-spalte > .bau-liste-karte { flex-grow: 1.4; }
.bau-spalte > .bau-auffaellig-karte { flex-grow: 2.2; }   /* Sammelliste (17.10.2026) braucht mehr Platz */
.bau-detail { min-height: 0; margin: 0; }

/* Liste */
.bau-zeile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 9px 12px; margin: 0 0 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text); cursor: pointer; font: inherit;
}
.bau-zeile:hover { border-color: var(--primary-light); }
.bau-zeile--aktiv { border-color: var(--primary); background: var(--primary-pale); }
.bau-zeile--fertig { opacity: .65; }
.bau-zeile-name { font-weight: 700; font-size: 14px; }
.bau-zeile-adr { font-size: 12px; color: var(--text-muted); }
.bau-fertig-knopf, .bau-link {
  border: 0; background: none; color: var(--primary); font: inherit; font-size: 12px;
  font-weight: 700; cursor: pointer; padding: 4px 0 8px;
}
.bau-link { padding: 0; margin-left: 8px; }

/* „laut Handy“: der Umkreis wird auf dem Handy geprüft (Handwerk Chef 16.10.) */
.bau-handy-hinweis { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }

/* Detail */
.bau-detail-kopf { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.bau-detail-name { font-size: 18px; font-weight: 800; color: var(--text); }
.bau-detail-adr { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.bau-detail-knoepfe { display: flex; gap: 8px; margin-left: auto; }
.bau-notiz { font-size: 13px; color: var(--text); background: var(--primary-pale); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px; white-space: pre-wrap; }
.bau-abschnitt { margin-bottom: 16px; }
.bau-abschnitt-titel { font-size: 12px; font-weight: 800; letter-spacing: .3px; color: var(--primary); text-transform: uppercase; margin-bottom: 6px; }

.bau-stempel, .bau-bericht { padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 13px; }
.bau-stempel:last-child, .bau-bericht:last-child { border-bottom: 0; }
.bau-stempel-kopf { display: flex; gap: 8px; justify-content: space-between; color: var(--text); }
.bau-stempel-kopf span { color: var(--text-muted); white-space: nowrap; }
.bau-stempel-unter { color: var(--text-muted); font-size: 12px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bau-marke { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.bau-marke--warn   { background: #fff1e0; color: #b25b00; }
.bau-marke--grau   { background: #eef1f4; color: #5b6b7c; }
.bau-marke--info   { background: #e6f0fb; color: #2d5f95; }
.bau-marke--fehler { background: #fdeaea; color: #b3261e; }

.bau-termin { display: grid; grid-template-columns: 110px 100px 1fr; gap: 8px; font-size: 13px; padding: 4px 0; color: var(--text); }
.bau-termin--alt { color: var(--text-muted); }
.bau-termin-tag { font-weight: 700; }
.bau-termin-wer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bau-bericht-text { margin-top: 4px; white-space: pre-wrap; color: var(--text); }
.bau-fotos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bau-foto { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--border); padding: 0; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.bau-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bau-foto--fehlt { cursor: default; }
.bau-foto-gross { display: flex; align-items: center; justify-content: center; cursor: zoom-out; z-index: 3000; }
.bau-foto-gross img { max-width: 92vw; max-height: 88vh; border-radius: 12px; }

/* Fenster Anlegen/Bearbeiten */
.bau-fenster { max-width: 520px; }
.bau-form { padding: 4px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.bau-feld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.bau-feld > span { display: flex; justify-content: space-between; gap: 8px; }
.bau-feld input[type=text], .bau-feld textarea {
  font: inherit; font-weight: 400; font-size: 14px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: var(--text);
}
.bau-feld textarea { resize: vertical; }
.bau-feld small { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.bau-feld input[type=range] { width: 100%; accent-color: var(--primary); }
.bau-fenster .modal-footer { justify-content: flex-end; gap: 10px; }
#shift-baustelle { width: 100%; }

/* Team › Zeiten: Baustelle und Marken am Eintrag (nur Handwerk) */
.bau-zeit-ort { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.bau-zeit-marken { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bau-zeit-marke { display: inline-flex; align-items: center; gap: 4px; }
.bau-zeit-art { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* Fälschungsschutz (17.10.2026): Sammelliste „Auffällig“, Verlauf, Schalter, Aushang */
.bau-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 6px; }
.bau-filter select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card, #fff); color: var(--text); max-width: 100%; }
.bau-schalter { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.bau-schalter input { margin-top: 2px; }
.bau-schalter--klein { color: var(--text-muted); }
.bau-stempel-aktion { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.bau-stempel.is-erledigt { opacity: .55; }
.bau-erledigt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.bau-abstand { font-size: 11px; color: var(--text-muted); }
.bau-pruef-einst { border-top: 1px solid rgba(0,0,0,.06); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bau-pruef-einst .bau-link { margin-left: 0; }
.bau-verlauf-knopf { margin: 4px 0 0; display: inline-block; }
.bau-verlauf { margin-top: 4px; padding: 6px 8px; background: var(--primary-pale); border-radius: var(--radius-sm); font-size: 12px; color: var(--text); display: flex; flex-direction: column; gap: 3px; }
.bau-verlauf.hidden { display: none; }
.bau-verlauf-zeile span { color: var(--text-muted); margin-right: 6px; white-space: nowrap; }
.bau-aushang-fenster { max-width: 620px; }
.bau-aushang-hinweis { font-size: 13px; color: #b25b00; background: #fff1e0; border-radius: var(--radius-sm); padding: 8px 10px; margin: 0 20px 10px; }
.bau-aushang-text { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.5; color: var(--text); margin: 0 20px; max-height: 50vh; overflow: auto; }
html.dark .bau-pruef-einst { border-top-color: rgba(255,255,255,.06); }

html.dark .bau-zeile { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
html.dark .bau-zeile--aktiv { background: rgba(255,255,255,.1); }
html.dark .bau-stempel, html.dark .bau-bericht { border-bottom-color: rgba(255,255,255,.06); }

@media (max-width: 720px) {
  #tab-baustellen.bau-pane { padding: 12px; height: auto; overflow: visible; }
  .bau-grid { grid-template-columns: minmax(0, 1fr); flex: 0 0 auto; min-height: 0; }
  .bau-spalte > .dash-card { flex: 0 0 auto; }
  .bau-termin { grid-template-columns: 90px 90px 1fr; }
}

/* ── Designsprache wie im übrigen Schichtwerk (18.10.2026): Karten wie die Team-Liste (Kürzel-Kachel, Name 14 px,
   Zeile darunter 13 px), EIN Grund statt vieler bunter Marken, Erklärung hinter „?“, Abschnitte wie Karten-Titel ── */
#bau-liste, #bau-auffaellig, #bau-heute { display: flex; flex-direction: column; gap: 8px; }
.bau-zeile { flex-direction: row; align-items: center; gap: 14px; margin: 0; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 16px; }
.bau-spalte > .bau-liste-karte { flex: 0 1 auto; max-height: 45%; }
.bau-liste-karte .dash-card-body, .bau-auffaellig-karte .dash-card-body { overflow-y: auto; }
.bau-zeile-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.bau-zeile-name { font-size: 14px; color: var(--text); }
.bau-zeile-adr { font-size: 13px; }
.bau-zeile-pfeil { font-size: 18px; color: var(--text-muted); }
.bau-kuerzel { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; background: var(--primary-pale); color: var(--primary); }
.bau-stempel { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--white); font-size: 14px; }
.bau-stempel:last-child { border-bottom: 1.5px solid var(--border); }
.bau-stempel--wartet { border-color: #f59e0b; }
.bau-stempel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bau-stempel-kopf b { font-size: 14px; font-weight: 700; }
.bau-stempel-unter { font-size: 13px; }
.bau-stempel-aktion { margin-top: 10px; }
.bau-grund { font-size: 13px; font-weight: 700; margin-top: 2px; }
.bau-grund--fehler { color: #c0392b; }
.bau-grund--warn { color: #b45309; }
.bau-grund--info, .bau-grund--grau { color: var(--text-muted); font-weight: 600; }
.bau-grund--ok { color: #15803d; font-weight: 600; }
.bau-abschnitt-titel { font-size: 15px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.bau-abschnitt-titel .bau-link { font-size: 13px; margin-left: 0; }
.bau-handy-hinweis { font-size: 13px; }
.bau-info-knopf { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); background: none; color: var(--text-muted);
  font-size: 12px; font-weight: 700; line-height: 1; margin-left: 6px; padding: 0; cursor: pointer; vertical-align: 1px; }
.bau-info-knopf[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.bau-wartet-zahl { background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.bau-filter { gap: 8px; margin-bottom: 10px; }
.bau-filter select { font-size: 13px; padding: 7px 12px; border-radius: 20px; }
.bau-schalter, .bau-erledigt { font-size: 13px; }
.bau-termin { font-size: 14px; padding: 8px 0; }
.bau-bericht { font-size: 14px; }
html.dark .bau-stempel, html.dark .bau-zeile { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
html.dark .bau-stempel--wartet { border-color: #b45309; }
html.dark .bau-wartet-zahl { background: #3a2a12; color: #f5c27a; }
html.dark .bau-grund--fehler { color: #f87171; }
html.dark .bau-grund--warn { color: #fbbf24; }
html.dark .bau-grund--ok { color: #4ade80; }
