/* =========================================================
   Hipp & Son – Wartung
   Design angelehnt an den Online-Leitstand (Leitstand-Online-Probe):
   helle Flächen, Pill-Navigation, Poppins/Martel Sans, Dark Mode.
   ========================================================= */

@import url('vendor/fonts-local.css');

:root {
  /* Markenfarben Hipp and Son */
  --brand-primary:  #10977a;
  --brand-accent:   #1be0af;
  --font-heading: 'Martel Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;

  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);
  --hover-bg:       rgba(11,11,11,0.035);
  --today-bg:       rgba(16,151,122,0.10);
  --success-text:   #006300;

  --urgent:  #e60000;
  --danger:  #d03b3b;
  --warn:    #b58f00;

  --ok-bg:      rgba(16,151,122,0.14);
  --warn-bg:    rgba(181,143,0,0.14);
  --danger-bg:  rgba(214,59,59,0.12);
  --neutral-bg: rgba(11,11,11,0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-primary:  #1baf8f;
    --brand-accent:   #1be0af;

    --surface-1:      #1a1a19;
    --page-plane:     #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255,255,255,0.10);
    --hover-bg:       rgba(255,255,255,0.045);
    --today-bg:       rgba(27,175,143,0.18);
    --success-text:   #0ca30c;

    --urgent:  #ff4040;
    --danger:  #e66767;
    --warn:    #c9a520;

    --ok-bg:      rgba(27,175,143,0.22);
    --warn-bg:    rgba(201,165,32,0.20);
    --danger-bg:  rgba(230,103,103,0.18);
    --neutral-bg: rgba(255,255,255,0.08);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--page-plane);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Toolbar (wie Leitstand) ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--brand-primary);
  flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo img.brand-mark { width: 22px; height: 22px; flex-shrink: 0; display: block; }
.logo .claim {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-primary);
  white-space: nowrap;
}

nav.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

nav.main-nav a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
nav.main-nav a:hover { background: var(--hover-bg); color: var(--text-primary); text-decoration: none; }
nav.main-nav a.active { background: var(--brand-primary); color: #fff; }
nav.main-nav a .badge {
  background: var(--urgent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: middle;
}
nav.main-nav a.active .badge { box-shadow: 0 0 0 1px rgba(255,255,255,0.85); }

/* ---------- Sync-Status (wie Leitstand) ---------- */
.sync-chip {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.sync-chip.ok  { background: var(--ok-bg);     color: var(--brand-primary); }
.sync-chip.err { background: var(--danger-bg); color: var(--urgent); }

/* ---------- Bereichs-Umschalter (Kopfzeile) ---------- */
.bereich-schalter {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
}
.bereich-schalter button {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.bereich-schalter button + button { border-left: 1px solid var(--border); }
.bereich-schalter button:hover { background: var(--hover-bg); color: var(--text-primary); }
.bereich-schalter button.aktiv { background: var(--brand-primary); color: #fff; }
.bereich-schalter button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Seitentitel ---------- */
.page-band { padding: 22px 0 0; }
.page-band h1 { font-size: 21px; }
.page-band .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.container { max-width: 1210px; margin: 0 auto; padding: 22px 20px 50px; }

/* ---------- Karten ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.card .big-number {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}
.card .big-number.rot { color: var(--urgent); }
.card .big-number.orange { color: var(--warn); }
.card .big-number.gruen { color: var(--brand-primary); }
.card .hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ---------- Tabellen ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

table.liste {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.liste th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--baseline);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface-1);
}
table.liste td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gridline);
  vertical-align: middle;
  color: var(--text-primary);
}
table.liste tr:last-child td { border-bottom: none; }
table.liste tr:hover td { background: var(--hover-bg); }

table.liste select, table.liste input[type="number"] {
  font-family: inherit;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--page-plane);
  color: var(--text-primary);
}
table.liste input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* ---------- Anpassen: Maschinen-Akkordeon ---------- */
.einst-maschinen { display: flex; flex-direction: column; gap: 10px; }

.einst-maschine {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  overflow: hidden;
}
.einst-maschine-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.einst-maschine-kopf:hover { background: var(--hover-bg); }
.einst-maschine-kopf .pfeil { color: var(--text-muted); font-size: 12px; width: 14px; flex-shrink: 0; }
.einst-maschine-kopf strong { font-size: 15px; white-space: nowrap; }
.einst-maschine-kopf .typ { color: var(--text-muted); font-size: 13px; }
.einst-maschine-kopf .anzahl { margin-left: auto; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }

.einst-maschine .einst-tabelle {
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

/* ---------- Anpassen: Vorlagen-Editor ---------- */
.fragen-editor-liste { display: flex; flex-direction: column; gap: 12px; }

.frage-editor label, .editor-zeile label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 12px;
}
.frage-editor input[type="text"],
.frage-editor input[type="number"],
.frage-editor textarea,
.frage-editor select,
.card input[data-fe] {
  display: block;
  width: 100%;
  font-family: inherit;
  font-weight: 400;
  font-size: 13px;
  padding: 8px 12px;
  margin-top: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-plane);
  color: var(--text-primary);
}
.frage-editor textarea { resize: vertical; }
.frage-editor input:focus, .frage-editor textarea:focus, .card input[data-fe]:focus {
  outline: 2px solid var(--today-bg);
  border-color: var(--brand-primary);
}
.frage-editor input:disabled { opacity: 0.45; }

.frage-editor-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.frage-editor-kopf .nummer {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.frage-editor-kopf select {
  display: inline-block;
  width: auto;
  margin-top: 0;
}
.frage-editor-kopf .editor-optional {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary);
}
.frage-editor-kopf .editor-optional input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand-primary); }
.frage-editor-aktionen { margin-left: auto; display: flex; gap: 6px; }

.editor-zeile { display: flex; gap: 14px; flex-wrap: wrap; }
.editor-zeile label { flex: 1 1 260px; }

/* ---------- Maßnahmen: Liste + Detailseite (wie Lumiform) ---------- */
table.liste tr.klickbar { cursor: pointer; }

.massnahme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .massnahme-layout { grid-template-columns: 1fr; }
}

.massnahme-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 16px;
}
.massnahme-form input[type="text"],
.massnahme-form input[type="date"],
.massnahme-form input[type="number"],
.massnahme-form select,
.massnahme-form textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-weight: 400;
  font-size: 13px;
  padding: 8px 12px;
  margin-top: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-plane);
  color: var(--text-primary);
}
.massnahme-form textarea { resize: vertical; }
.massnahme-form input:focus, .massnahme-form textarea:focus, .massnahme-form select:focus {
  outline: 2px solid var(--today-bg);
  border-color: var(--brand-primary);
}

.massnahme-quelle {
  background: var(--today-bg);
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 4px;
}

/* Status-/Prioritäts-Schalter (segmentierte Buttons wie bei Lumiform) */
.status-schalter {
  display: flex;
  margin-top: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.status-schalter button {
  flex: 1;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--page-plane);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.status-schalter button:last-child { border-right: none; }
.status-schalter button:hover { color: var(--text-primary); }
.status-schalter button.aktiv { color: #fff; font-weight: 600; }
.status-schalter button.aktiv[data-status="ausstehend"] { background: var(--warn); }
.status-schalter button.aktiv[data-status="gestartet"]  { background: #2f80c3; }
.status-schalter button.aktiv[data-status="fertig"]     { background: var(--brand-primary); }
.status-schalter button.aktiv[data-status="gehtnicht"]  { background: var(--urgent); }
.status-schalter button.aktiv[data-prio="normal"]       { background: var(--text-primary); color: var(--surface-1); }
.status-schalter button.aktiv[data-prio="hoch"]         { background: var(--urgent); }

/* Aktivitätsprotokoll */
.kommentar-zeile {
  display: flex;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gridline);
}
.kommentar-zeile input {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page-plane);
  color: var(--text-primary);
}
.kommentar-zeile input:focus { outline: 2px solid var(--today-bg); border-color: var(--brand-primary); }

.protokoll { margin-top: 4px; }
.protokoll-eintrag {
  padding: 12px 0;
  border-bottom: 1px solid var(--gridline);
  font-size: 13px;
}
.protokoll-eintrag:last-child { border-bottom: none; }
.protokoll-eintrag .zeit {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.protokoll-leer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 46px 20px;
}
.protokoll-leer .symbol { font-size: 30px; margin-bottom: 10px; color: var(--baseline); }
.protokoll-leer strong { display: block; color: var(--text-secondary); margin-bottom: 4px; }

/* ---------- Vorlagen-Editor: Layout mit Live-Vorschau ---------- */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 24px;
  align-items: start;
}
.vorschau-spalte {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding-bottom: 10px;
}
.vorschau-kopf {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.vorschau-kopf span { font-weight: 400; text-transform: none; letter-spacing: 0; }
.vorschau-rahmen { pointer-events: none; }
.vorschau-rahmen .form-runner { max-width: none; }

@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: 1fr; }
  .vorschau-spalte { position: static; max-height: none; overflow: visible; }
}

.baustein-palette h3 { margin-bottom: 10px; }
.baustein-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }

.baustein-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page-plane);
  color: var(--text-primary);
  cursor: pointer;
}
.baustein-knopf span { font-size: 15px; line-height: 1; }
.baustein-knopf:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--ok-bg);
}

/* Farbakzent je Baustein-Typ (linker Rand der Karte) */
.frage-editor { border-left: 4px solid var(--border); }
.frage-editor[data-typ="janein"]    { border-left-color: #10977a; }
.frage-editor[data-typ="auswahl"]   { border-left-color: #2f80c3; }
.frage-editor[data-typ="mehrfach"]  { border-left-color: #7b5cc9; }
.frage-editor[data-typ="dropdown"]  { border-left-color: #4a5fc9; }
.frage-editor[data-typ="zahl"]      { border-left-color: #d98c1f; }
.frage-editor[data-typ="text"]      { border-left-color: #0fa3b1; }
.frage-editor[data-typ="checkbox"]  { border-left-color: #d4589c; }
.frage-editor[data-typ="datum"]     { border-left-color: #2f80c3; }
.frage-editor[data-typ="datumzeit"] { border-left-color: #2f80c3; }
.frage-editor[data-typ="foto"]      { border-left-color: #d4589c; }
.frage-editor[data-typ="zeichnung"] { border-left-color: #8a6dcf; }
.frage-editor[data-typ="info"]      { border-left-color: #8a939b; }
.frage-editor[data-typ="abschnitt"] { border-left-color: #10977a; }

.frage-editor-kopf .typ-icon { font-size: 16px; line-height: 1; }

/* Wenn-dann-Logik (Maßnahmen/Grenzwerte) als farbiger Block */
.logik-block {
  margin-top: 14px;
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px 14px;
}
.logik-block .logik-titel {
  font-size: 12px;
  font-weight: 700;
  color: var(--warn);
}
.logik-block label { margin-top: 8px; }

/* Vorlagen-Antwortsets */
.antwortset-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Status-Pillen ---------- */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.pill.ausstehend   { background: var(--warn-bg);    color: var(--warn); }
.pill.gestartet    { background: rgba(47,128,195,0.12); color: #2f80c3; }
.pill.gehtnicht    { background: var(--danger-bg);  color: var(--urgent); }
.pill.ok           { background: var(--ok-bg);      color: var(--brand-primary); }
.pill.faellig      { background: var(--warn-bg);    color: var(--warn); }
.pill.ueberfaellig { background: var(--danger-bg);  color: var(--urgent); font-weight: 700; }
.pill.inaktiv      { background: var(--neutral-bg); color: var(--text-muted); }
.pill.offen        { background: var(--warn-bg);    color: var(--warn); }
.pill.fertig       { background: var(--ok-bg);      color: var(--brand-primary); }
.pill.hoch         { background: var(--danger-bg);  color: var(--urgent); }
.pill.normal       { background: var(--neutral-bg); color: var(--text-secondary); }

/* ---------- Buttons (Pill-Stil wie Leitstand) ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--hover-bg); text-decoration: none; }

.btn:not(.sekundaer):not(.gefahr) {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn:not(.sekundaer):not(.gefahr):hover { filter: brightness(1.08); background: var(--brand-primary); }

.btn.sekundaer { background: var(--surface-1); color: var(--text-primary); }
.btn.sekundaer:hover { background: var(--hover-bg); color: var(--text-primary); }

.btn.klein { padding: 5px 12px; font-size: 12px; }

.btn.gefahr {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.gefahr:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Filterleiste ---------- */
.filterbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.filterbar select,
.filterbar input[type="text"],
.filterbar input[type="search"] {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
  min-width: 160px;
}
.filterbar select:focus, .filterbar input:focus {
  outline: 2px solid var(--today-bg);
  border-color: var(--brand-primary);
}
.filterbar label { color: var(--text-secondary); }
.filterbar input[type="checkbox"] { accent-color: var(--brand-primary); }

/* ---------- Formular-Runner ---------- */
.form-runner { max-width: 760px; margin: 0 auto; }

.form-kopf {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-bottom: none;
  border-top: 3px solid var(--brand-primary);
  border-radius: 10px 10px 0 0;
  padding: 20px 26px;
}
.form-kopf h2 {
  font-size: 18px;
  color: var(--brand-primary);
}
.form-kopf .beschreibung { color: var(--text-secondary); margin-top: 4px; font-size: 13px; }
.form-kopf .meta { color: var(--text-muted); font-size: 12px; margin-top: 10px; display: flex; gap: 20px; flex-wrap: wrap; }

.form-body {
  border: 1px solid var(--border);
  border-top: 1px solid var(--gridline);
  border-radius: 0 0 10px 10px;
  padding: 6px 26px 24px;
  background: var(--surface-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.frage { padding: 20px 0; border-bottom: 1px solid var(--gridline); }
.frage:last-child { border-bottom: none; }
.frage .frage-text { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.frage .frage-text .pflicht { color: var(--urgent); }

.frage .info-block {
  background: var(--today-bg);
  border-left: 3px solid var(--brand-primary);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 12.5px;
  white-space: pre-line;
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}
.frage.nur-info .info-block { background: var(--hover-bg); border-left-color: var(--baseline); }

.antwort-optionen { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.antwort-optionen button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 28px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.antwort-optionen button:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Grundfarben nach Bedeutung (wie Lumiform: Ja grün, Nein rot, K.A. grau) */
.antwort-optionen button.opt-ja   { background: var(--ok-bg);      border-color: transparent; color: var(--brand-primary); }
.antwort-optionen button.opt-nein { background: var(--danger-bg);  border-color: transparent; color: var(--urgent); }
.antwort-optionen button.opt-ka   { background: var(--neutral-bg); border-color: transparent; color: var(--text-secondary); }
.antwort-optionen button.opt-ja:hover:not([class*="gewaehlt"])   { border-color: var(--brand-primary); color: var(--brand-primary); }
.antwort-optionen button.opt-nein:hover:not([class*="gewaehlt"]) { border-color: var(--urgent); color: var(--urgent); }

/* Gewählte Antwort (überstimmt die Grundfarbe) */
.antwort-optionen button.gewaehlt-ok { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.antwort-optionen button.gewaehlt-negativ { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.antwort-optionen button.gewaehlt-neutral { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface-1); }
.antwort-optionen.auswahl button { padding: 6px 14px; font-size: 12px; }

.frage input[type="number"], .frage input[type="text"], .frage input[type="date"],
.frage input[type="datetime-local"], .frage select, .frage textarea {
  width: 100%;
  font-family: inherit;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  margin-top: 10px;
  background: var(--page-plane);
  color: var(--text-primary);
}
.frage textarea { min-height: 80px; resize: vertical; }
.frage input:focus, .frage textarea:focus {
  outline: 2px solid var(--today-bg);
  border-color: var(--brand-primary);
}

/* Checkbox-Baustein */
.check-bestaetigung {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page-plane);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-primary);
}
.check-bestaetigung input {
  width: 17px; height: 17px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}
.check-bestaetigung:has(input:checked) {
  background: var(--ok-bg);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
}

/* Zeichnungs-Baustein nutzt das Unterschrift-Pad-Design */
.zeichnung-pad { margin-top: 12px; }

/* Abschnitts-Überschrift im Formular */
.abschnitt-titel {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-primary);
}

/* Foto-Baustein */
.foto-liste { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.foto-liste img {
  width: 130px;
  height: 98px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.foto-liste.bericht img { width: 170px; height: 128px; }
.foto-vorschau { position: relative; display: inline-block; }
.foto-vorschau button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--urgent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.massnahme-hinweis {
  margin-top: 10px;
  background: var(--danger-bg);
  border-left: 3px solid var(--urgent);
  color: var(--urgent);
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 0 6px 6px 0;
}
.grenzwert-hinweis { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* Unterschrift */
.unterschrift-pad {
  border: 1px dashed var(--baseline);
  border-radius: 8px;
  margin-top: 10px;
  touch-action: none;
  /* immer hell – die Unterschrift wird dunkel gezeichnet und im Bericht auf Weiß angezeigt */
  background: #fdfdfd;
  width: 100%;
  height: 140px;
  display: block;
  cursor: crosshair;
}
.unterschrift-aktionen { margin-top: 8px; display: flex; gap: 10px; align-items: center; }
.unterschrift-aktionen .hint { color: var(--text-muted); font-size: 12px; }

.form-aktionen {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--baseline);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.fehler-meldung { color: var(--urgent); font-size: 13px; font-weight: 500; }

/* ---------- Modal ---------- */
.modal-hintergrund {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  background: var(--surface-1);
  border-radius: 10px;
  max-width: 460px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  color: var(--text-primary);
}
.modal h3 {
  font-size: 17px;
  color: var(--brand-primary);
  margin-bottom: 12px;
}
.modal label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 12px 0 4px;
}
.modal input, .modal select, .modal textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--page-plane);
  color: var(--text-primary);
}
.modal .modal-aktionen { margin-top: 18px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Bericht-Detail ---------- */
.detail-antwort {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--gridline);
  font-size: 13px;
}
.detail-antwort .wert { font-weight: 700; white-space: nowrap; }
.detail-antwort .wert.negativ { color: var(--urgent); }
.detail-antwort .wert.positiv { color: var(--brand-primary); }
img.unterschrift-bild {
  max-width: 260px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

/* ---------- Abschnittsköpfe ---------- */
.abschnitt-kopf {
  display: flex; align-items: center; justify-content: space-between;
  margin: 28px 0 12px; flex-wrap: wrap; gap: 10px;
}
.abschnitt-kopf h2 { font-size: 16px; }
.abschnitt-kopf h2 .anzahl { color: var(--text-muted); font-weight: 400; font-size: 13px; }

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-1);
  margin-top: 40px;
  padding: 16px 0;
}
.footer-inner {
  max-width: 1210px; margin: 0 auto; padding: 0 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center;
}
.footer-inner .titel {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
}
.footer-inner .meta { color: var(--text-muted); font-size: 11.5px; }

/* ---------- Leerzustand ---------- */
.leer {
  text-align: center;
  color: var(--text-muted);
  padding: 42px 20px;
  border: 1px dashed var(--baseline);
  border-radius: 10px;
  font-size: 13px;
  background: var(--surface-1);
}

/* ---------- Druck ---------- */
@media print {
  header.site-header, footer.site-footer, .filterbar, .form-aktionen, .btn, nav { display: none !important; }
  body { background: #fff; color: #000; }
  .container { padding: 0; }
  .card, .table-wrap, .form-kopf, .form-body { box-shadow: none; border-color: #ccc; }
}

@media (max-width: 720px) {
  .header-inner { gap: 8px; }
  nav.main-nav { border-left: none; padding-left: 0; margin-left: 0; }
  .form-body { padding: 4px 16px 20px; }
  .form-kopf { padding: 16px; }
}
