.board {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.7fr;
  gap: 0.7rem;
  padding: 0.7rem;
  align-items: start;
  min-height: calc(100vh - 72px);
}

.spalte { background: var(--flaeche); border-radius: 10px; padding: 0.6rem; }

.spalte > h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0.15rem 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--schrift);
}

.spalte > h2 .zahl {
  background: var(--flaeche-hell);
  color: var(--schrift-leise);
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  font-size: 0.8rem;
}

.gruppe { margin-bottom: 0.4rem; }

.gruppe > h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.55rem 0.15rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kenn-schrift);
}

.gruppe > h3::after { content: ''; flex: 1; height: 1px; background: var(--linie); }

/* Karten ohne zuordenbare Abteilung bekommen keine Kennfarbe, sondern die
   Schriftfarbe: ein heller Rand hebt sich vom Board ab, ohne nach einer
   Abteilung auszusehen. Gesetzt wird die Variable und nicht border-color, damit
   die spaeter stehende Regel .kachel.hohl sie nicht ueberschreibt. */
.gruppe.nicht-zuordenbar > h3 { color: var(--schrift); }
.kachel.nicht-zuordenbar { --kenn: var(--schrift); }

.kachel {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
  min-height: 56px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  background: var(--fuell);
  color: var(--auf-fuell);
}

.kachel .titel { font-size: 1.05rem; font-weight: 700; line-height: 1.15; }
/* Kein opacity mehr auf gefüllten Kacheln: gedimmter weißer Text auf Sales/Lager/
   Technik unterschritt WCAG AA (3.1–4.1:1). Volle --auf-fuell-Farbe statt
   Abblenden bringt alle drei auf mindestens 4.5:1 (siehe Prüfbericht). */
.kachel .zeile2 { font-size: 0.85rem; font-weight: 600; margin-top: 0.12rem; }
.kachel .zeile3 { font-size: 0.78rem; margin-top: 0.25rem; }
.kachel .ueberfaellig-hinweis { font-size: 0.78rem; margin-top: 0.25rem; }

/* Erwartet: hohl, damit die Farbe echt bleibt statt matschig abgeblendet */
.kachel.hohl {
  background: var(--flaeche);
  color: var(--schrift);
  border: 2.5px solid var(--kenn);
  box-shadow: none;
}
.kachel.hohl .zeile2 { color: var(--schrift-leise); }
.kachel.hohl .zeile3 { color: var(--schrift-still); }
.kachel.hohl .ueberfaellig-hinweis { color: var(--schrift-still); }

.kachel.dringend { outline: 3px solid #fff; outline-offset: -3px; }
.kachel.dringend::after {
  content: '!';
  position: absolute;
  top: 0.4rem; right: 0.5rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  color: var(--fehler);
  font-size: 0.78rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}

.kachel.ueberfaellig { border-style: dashed; }

.erledigt {
  background: var(--flaeche-hell);
  border: 0;
  border-left: 4px solid var(--kenn);
  border-radius: 7px;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.32rem;
  width: 100%;
  text-align: left;
  min-height: 48px;
}
.erledigt .titel { color: var(--schrift-leise); font-size: 0.85rem; font-weight: 600; }
.erledigt .zeile2 { color: var(--schrift-still); font-size: 0.72rem; }

.leer { color: var(--schrift-still); font-size: 0.85rem; padding: 0.5rem 0.15rem; }

/* Gedränge: bei vielen Kacheln fällt die dritte Zeile weg */
.board.eng .kachel { padding: 0.4rem 0.5rem; min-height: 48px; }
.board.eng .kachel .titel { font-size: 0.9rem; }
.board.eng .kachel .zeile3 { display: none; }

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; min-height: auto; }
}

.kopf-rechts { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.uhr { text-align: right; color: var(--schrift-leise); font-size: 0.78rem; line-height: 1.2; }
.uhr b { display: block; color: var(--schrift); font-size: 1.3rem; }
.verbindung { font-size: 0.78rem; color: var(--schrift-still); }
.verbindung.unterbrochen { color: var(--grund); background: var(--warnung); border-radius: 6px; padding: 0.3rem 0.6rem; font-weight: 700; }
/* Die kurze Bestaetigung eines gelungenen Drucks - gruen und damit auf einen
   Blick von der gelben Warnung daneben zu unterscheiden. */
.verbindung.gedruckt { color: #fff; background: #17a34a; border-radius: 6px; padding: 0.3rem 0.6rem; font-weight: 700; }

.detail::backdrop { background: rgba(0, 0, 0, 0.6); }
.detail {
  background: var(--flaeche);
  color: var(--schrift);
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 1rem;
  width: min(34rem, 92vw);
}
.detail-titel { margin: 0 0 0.6rem; font-size: 1.4rem; }
.detail-liste { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.8rem; margin: 0 0 1rem; }
.detail-liste dt { color: var(--schrift-still); font-size: 0.8rem; }
.detail-liste dd { margin: 0; }
.detail-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.knopf.gross { min-height: 56px; font-size: 1rem; padding: 0 1.1rem; }
.knopf.gefaehrlich { border-color: var(--fehler); color: #ff9c94; }
.formular { display: flex; flex-direction: column; gap: 0.6rem; }
.formular label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--schrift-leise); }
.formular label.haken { flex-direction: row; align-items: center; gap: 0.5rem; }
.formular input[type="checkbox"] { min-height: auto; width: 20px; height: 20px; }
.formular .leise { margin: 0; color: var(--schrift-leise); font-size: 0.85rem; }
.formular .freiwillig { color: var(--schrift-still); font-size: 0.75rem; }
