/* Bautagebuch – bewusst groß und kontrastreich, für Handy auf der Baustelle */
:root {
  --blau: #1d4ed8;
  --blau-hell: #dbeafe;
  --gruen: #15803d;
  --rot: #b91c1c;
  --gelb: #b45309;
  --text: #111827;
  --leise: #6b7280;
  --rand: #e5e7eb;
  --hinter: #f3f4f6;
  --karte: #ffffff;
  --rund: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--hinter);
}
body.mit-tabs { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--blau); }

/* Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--blau); color: #fff;
}
.kopf h1 { margin: 0; font-size: 20px; }
.zurueck { color: #fff; text-decoration: none; font-size: 34px; line-height: 1; padding: 0 10px 4px 0; }

.inhalt { max-width: 680px; margin: 0 auto; padding: 14px 12px 90px; }

/* Untere Tab-Leiste */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; background: #fff; border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px 2px 10px; font-size: 13px; color: var(--leise); text-decoration: none;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tabs a .ico { font-size: 24px; line-height: 1.2; }
.tabs a.aktiv { color: var(--blau); font-weight: 600; }
.badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--rot); color: #fff; font-size: 12px; line-height: 20px; font-weight: 700;
}

/* Karten & Formulare */
.karte {
  display: block; background: var(--karte); border-radius: var(--rund);
  padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  color: inherit; text-decoration: none;
}
label { display: block; margin-bottom: 14px; font-weight: 600; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-weight: 400; padding: 12px; min-height: 48px;
  border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--blau-hell); border-color: var(--blau); }
h2 { margin: 6px 0 8px; font-size: 22px; }
h3 { margin: 0 0 12px; }
.abschnitt { margin: 22px 4px 10px; }
.leise { color: var(--leise); font-size: 14px; font-weight: 400; }
.mitte { text-align: center; }
.text { white-space: pre-wrap; margin: 8px 0; }

.knopf {
  display: inline-block; border: 0; border-radius: 12px; cursor: pointer;
  padding: 12px 20px; min-height: 48px;
  font: inherit; font-weight: 700; text-align: center; text-decoration: none;
  background: var(--blau); color: #fff;
}
.knopf:active { filter: brightness(.9); }
.knopf:disabled { opacity: .6; }
.knopf-gross { display: block; width: 100%; margin: 6px 0 12px; font-size: 18px; padding: 15px; }
.knopf-gruen { background: var(--gruen); }
.knopf-hell { background: var(--blau-hell); color: var(--blau); }
.knopf-text-rot { background: none; border: 0; color: var(--rot); font: inherit; padding: 12px; cursor: pointer; }
.loeschen-zeile { text-align: center; margin-top: 16px; }

.hinweis { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; }
.hinweis-ok { background: #dcfce7; color: #14532d; }
.hinweis-fehler { background: #fee2e2; color: #7f1d1d; }
.leer { text-align: center; color: var(--leise); padding: 40px 16px; font-size: 18px; }

/* Großer Plus-Knopf */
.plus {
  position: fixed; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4;
  padding: 16px 22px; border-radius: 30px; background: var(--blau); color: #fff;
  font-weight: 700; font-size: 18px; text-decoration: none;
  box-shadow: 0 4px 14px rgba(29,78,216,.4);
}

/* Umschalter Offen/Erledigt */
.umschalter { display: flex; background: #e5e7eb; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.umschalter a { flex: 1; text-align: center; padding: 10px; border-radius: 9px; text-decoration: none; color: var(--leise); font-weight: 600; }
.umschalter a.aktiv { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* Meldungen */
.meldung { display: flex; gap: 12px; align-items: center; }
.meldung, .detail { border-left: 6px solid var(--blau); }
.typ-mangel { border-left-color: var(--rot); }
.typ-aufgabe { border-left-color: var(--gelb); }
.typ-info { border-left-color: var(--blau); }
.titelbild { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.meldung-text { min-width: 0; }
.titel { display: block; font-size: 18px; margin: 2px 0; overflow-wrap: anywhere; }
.typ-zeile { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; font-weight: 600; }
.typ-mangel .typ { color: var(--rot); }
.typ-aufgabe .typ { color: var(--gelb); }
.typ-info .typ { color: var(--blau); }
.ort { color: var(--leise); }
.erledigt-info { background: #dcfce7; color: #14532d; padding: 8px 12px; border-radius: 10px; font-weight: 600; }

.typ-wahl { border: 0; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.typ-wahl legend { font-weight: 600; margin-bottom: 8px; }
.typ-wahl label { margin: 0; }
.typ-wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.typ-wahl span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 92px; padding: 8px 4px; border: 2px solid var(--rand); border-radius: 12px;
  text-align: center; font-size: 14px; cursor: pointer; background: #fff;
}
.typ-wahl b { font-size: 28px; }
.typ-wahl input:checked + span { border-color: currentColor; background: #f8fafc; box-shadow: inset 0 0 0 1px currentColor; }
.typ-wahl .typ-mangel { color: var(--rot); }
.typ-wahl .typ-aufgabe { color: var(--gelb); }
.typ-wahl .typ-info { color: var(--blau); }
.typ-wahl input:focus-visible + span { outline: 3px solid var(--blau-hell); }

.kommentar { background: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }

/* Fotos */
.foto-knopf {
  display: block; text-align: center; padding: 14px; margin-bottom: 10px;
  border: 2px dashed #94a3b8; border-radius: 12px; color: var(--blau); cursor: pointer;
}
.foto-knopf input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.foto-vorschau, .galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 12px; }
.foto-vorschau img, .galerie img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.foto-vorschau:empty { display: none; }
.foto-status { grid-column: 1 / -1; color: var(--leise); font-size: 14px; }
.galerie-bild { position: relative; }
.galerie-bild form { margin: 0; }
.foto-weg {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}

/* Einkaufsliste */
.einkauf-neu { display: flex; gap: 8px; align-items: stretch; }
.einkauf-neu input { margin: 0; }
.einkauf-neu .menge { flex: 0 0 90px; }
.einkauf-neu .knopf { font-size: 24px; padding: 0 18px; }
.artikel { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.artikel form { margin: 0; }
.artikel-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.haken {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid #94a3b8; background: #fff;
  cursor: pointer; font-size: 22px; color: #fff; font-weight: 700; flex: none;
}
.haken.an { background: var(--gruen); border-color: var(--gruen); }
.artikel.erledigt strong { text-decoration: line-through; color: var(--leise); }
.menge-tag { display: inline-block; background: var(--blau-hell); color: var(--blau); border-radius: 8px; padding: 0 8px; font-size: 14px; font-weight: 600; }
.menge-tag.rot { background: #fee2e2; color: var(--rot); }
.weg { background: none; border: 0; color: var(--leise); font-size: 26px; width: 44px; height: 44px; cursor: pointer; }
.gekauft summary { padding: 12px 4px; font-weight: 600; cursor: pointer; color: var(--leise); }

/* Tagebuch */
.eintrag-kopf { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 18px; }
.wetter { color: var(--leise); }
.eintrag-fuss { display: flex; justify-content: space-between; align-items: center; }
.eintrag-fuss a { text-decoration: none; padding: 8px 0; }

/* Login, Hilfe, Admin */
.login { margin-top: 30px; }
.hilfe summary { font-weight: 700; cursor: pointer; }
.hilfe li { margin-bottom: 8px; }
.benutzer.gesperrt { opacity: .6; }
.benutzer-kopf { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 18px; }
.zeile { display: flex; gap: 8px; }
.zeile input { margin: 0; }

/* ---------- Version 02: Terminal-Modus (HMI vor Ort) ---------- */
.hinweis-info { background: var(--blau-hell); color: var(--blau); }
.haekchen { display: flex; align-items: center; gap: 10px; }
.haekchen input { width: 26px; height: 26px; min-height: 0; margin: 0; flex: none; }

body.terminal { font-size: 20px; }
body.terminal .inhalt { max-width: 1500px; padding-left: 20px; padding-right: 20px; }
body.terminal .tabs a { font-size: 16px; padding: 10px 2px 12px; }
body.terminal .tabs a .ico { font-size: 30px; }
body.terminal .knopf { min-height: 56px; }
body.terminal .haken { width: 48px; height: 48px; }
.uhr { font-weight: 400; opacity: .85; margin-left: 12px; }

.brett-aktionen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.brett-aktionen .knopf { font-size: 20px; padding: 18px 8px; }
.brett { display: grid; gap: 20px; }
@media (min-width: 900px) {
  .brett { grid-template-columns: 1.3fr 1fr 1fr; align-items: start; }
}
.brett-titel { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; font-size: 22px; }
.brett-titel .zahl { background: var(--blau); color: #fff; border-radius: 14px; padding: 0 12px; font-size: 18px; }

.wer-dialog {
  position: fixed; inset: 0; z-index: 20; background: rgba(15,23,42,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.wer-dialog[hidden] { display: none; }
.wer-box { background: #fff; border-radius: 18px; padding: 22px; width: 100%; max-width: 720px; }
.wer-box h2 { margin: 0 0 16px; text-align: center; font-size: 26px; }
.wer-namen { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.wer-namen button {
  min-height: 84px; border: 2px solid var(--blau); border-radius: 14px; background: var(--blau-hell);
  color: var(--blau); font: inherit; font-size: 22px; font-weight: 700; cursor: pointer;
}
.wer-namen button:active { background: var(--blau); color: #fff; }
