/* Stiegler-Plattform — die ganze Gestaltung.
 *
 * NICHTS VON FREMDEN SERVERN: keine Schrift von Google, kein CSS-Rahmenwerk, kein Symbolsatz aus
 * einem CDN (LG Muenchen I, 20.01.2022, 3 O 17493/20). Deshalb Systemschriften — sie sind auf
 * jedem Geraet vorhanden, laden in null Sekunden und uebertragen keine IP-Adresse.
 *
 * Kurz gehalten, damit man es lesen kann. Wer hier etwas nicht findet, sucht an der falschen
 * Stelle.
 */

:root {
  --grund: #ffffff;
  --text: #16181d;
  --leise: #5b6270;
  --linie: #d9dde5;
  --flaeche: #f5f7fa;
  --akzent: #1a4d8f;
  --ok: #1f6b3a;
  --ok-flaeche: #e8f5ed;
  --warn: #8a5a00;
  --warn-flaeche: #fdf4e3;
  --stopp: #a3231f;
  --stopp-flaeche: #fdeceb;
}

/* Der Dunkelmodus folgt der Einstellung des Geraets. Ein Monteur, der abends im Fahrzeug aufs
 * Handy sieht, soll nicht geblendet werden. */
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #14161a; --text: #e8eaee; --leise: #99a1b0; --linie: #2c313a;
    --flaeche: #1c1f26; --akzent: #7fb0ea;
    --ok: #6fce93; --ok-flaeche: #16281d;
    --warn: #e0b45c; --warn-flaeche: #2a2214;
    --stopp: #f08b86; --stopp-flaeche: #2c1817;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

header {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding: .7rem 1.2rem;
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}
nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
nav a {
  color: var(--text); text-decoration: none; padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
nav a:hover { border-bottom-color: var(--linie); }
/* aria-current statt einer Klasse: Dieselbe Angabe, die ein Screenreader vorliest, faerbt auch. */
nav a[aria-current="page"] { border-bottom-color: var(--akzent); font-weight: 600; }
.wer { display: flex; align-items: center; gap: .8rem; color: var(--leise); font-size: .9rem; }

main { max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
footer {
  max-width: 62rem; margin: 0 auto; padding: 0 1.2rem 2rem;
  color: var(--leise); font-size: .82rem;
}

h1 { font-size: 1.5rem; margin: 0 0 .2rem; }
h2 { font-size: 1.08rem; margin: 1.8rem 0 .5rem; }
.datum { color: var(--leise); margin: 0 0 1.5rem; }
.klein { font-size: .85rem; color: var(--leise); }
.leer { color: var(--leise); font-style: italic; }
.zurueck { margin: 0 0 .8rem; }
a { color: var(--akzent); }

table { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: .93rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--linie);
         vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--leise);
     font-weight: 600; }
tr.ueberfaellig td { background: var(--stopp-flaeche); }
tr.faellig td { background: var(--warn-flaeche); }
tr.nicht-bereit td:first-child { border-left: 3px solid var(--stopp); }

dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 1rem 0; }
dt { color: var(--leise); font-size: .88rem; }
dd { margin: 0; }

.marke { display: inline-block; padding: .1rem .45rem; border-radius: .25rem; font-size: .8rem; }
.marke.ok { background: var(--ok-flaeche); color: var(--ok); }
.marke.stopp { background: var(--stopp-flaeche); color: var(--stopp); }
.marke.offen { background: var(--warn-flaeche); color: var(--warn); }

.zustand { padding: .6rem .8rem; border-radius: .3rem; margin: 1rem 0; }
.zustand.ok { background: var(--ok-flaeche); color: var(--ok); }
.zustand.stopp { background: var(--stopp-flaeche); color: var(--stopp); }

/* Der Sonderfall sieht anders aus als eine Tabellenzeile — mit Absicht: Ein Betriebsverbot
 * gehoert nicht zwischen die uebrigen Aufgaben. */
section.sperrend {
  border: 2px solid var(--stopp); background: var(--stopp-flaeche);
  border-radius: .4rem; padding: .8rem 1rem; margin: 1.2rem 0;
}
section.sperrend h2 { margin-top: 0; color: var(--stopp); }
section.sperrend .quelle { font-size: .85rem; margin-bottom: 0; }
section.offen { border-left: 3px solid var(--warn); padding-left: .9rem; }

form { display: grid; gap: .45rem; max-width: 30rem; margin: .8rem 0; }
label { font-size: .88rem; color: var(--leise); }
input, select {
  padding: .5rem .6rem; font: inherit; border: 1px solid var(--linie);
  border-radius: .25rem; background: var(--grund); color: var(--text);
}
button {
  padding: .5rem 1rem; font: inherit; cursor: pointer;
  border: 1px solid var(--akzent); border-radius: .25rem;
  background: var(--akzent); color: #fff;
}
.wer button { background: none; color: var(--leise); border-color: var(--linie); font-size: .85rem;
              padding: .25rem .6rem; }
button.warnend { background: var(--stopp); border-color: var(--stopp); }
/* Sichtbarer Fokusrahmen: Wer mit der Tastatur arbeitet, muss sehen, wo er steht. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.anmelden { max-width: 24rem; margin: 3rem auto; }
.anmelden h1 { margin-bottom: 1.2rem; }
.fehler { background: var(--stopp-flaeche); color: var(--stopp); padding: .6rem .8rem;
          border-radius: .3rem; }
.hinweis { margin-top: 2rem; font-size: .88rem; color: var(--leise); }
.hinweis code { background: var(--flaeche); padding: .05rem .3rem; border-radius: .2rem; }
.hinweis-zeile { background: var(--flaeche); padding: .5rem .7rem; border-radius: .3rem;
                 font-size: .9rem; }

ol.protokoll { list-style: none; padding: 0; margin: .5rem 0; font-size: .9rem; }
ol.protokoll li { padding: .4rem 0; border-bottom: 1px solid var(--linie);
                  display: flex; flex-wrap: wrap; gap: .7rem; }
.zeit { color: var(--leise); font-variant-numeric: tabular-nums; white-space: nowrap; }
ol.protokoll .wer { font-weight: 600; }

@media (max-width: 40rem) {
  header { flex-direction: column; align-items: flex-start; }
  dl { grid-template-columns: 1fr; gap: 0 0; }
  dt { margin-top: .6rem; }
  /* Tabellen duerfen scrollen statt die Seite zu sprengen. */
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Kopfzeile mit Knopf rechts */
.kopfzeile { display: flex; align-items: center; justify-content: space-between;
             flex-wrap: wrap; gap: .8rem; }
a.knopf { display: inline-block; padding: .45rem .9rem; border-radius: .25rem;
          background: var(--akzent); color: #fff; text-decoration: none; font-size: .92rem; }
section.erledigen { border-left: 3px solid var(--ok); padding-left: .9rem; }
section.aendern { border-left: 3px solid var(--linie); padding-left: .9rem; }
section.sperren { border-left: 3px solid var(--stopp); padding-left: .9rem; }

/* Logbuch */
section.tagesueberblick { background: var(--flaeche); border-radius: .4rem; padding: .8rem 1rem;
                          margin: 1rem 0; }
section.tagesueberblick h2 { margin-top: 0; }
section.tagesueberblick .handeln { border-left: 3px solid var(--stopp); padding-left: .8rem;
                                   margin-top: .8rem; }
section.tagesueberblick .handeln ul { margin: .3rem 0 0; padding-left: 1.1rem; }
form.filter { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: flex-end;
              max-width: none; background: var(--flaeche); padding: .8rem 1rem;
              border-radius: .4rem; }
form.filter > div { display: grid; gap: .25rem; }
form.filter .haken { display: flex; flex-direction: column; gap: .3rem; }
form.filter .haken label { display: flex; align-items: center; gap: .4rem; color: var(--text);
                           font-size: .88rem; }
section.tag h2 { font-size: .95rem; color: var(--leise); border-bottom: 1px solid var(--linie);
                 padding-bottom: .3rem; }
ol.logbuch { list-style: none; padding: 0; margin: .3rem 0 1.5rem; }
ol.logbuch li { display: flex; flex-wrap: wrap; gap: .8rem; align-items: baseline;
                padding: .4rem .5rem; border-bottom: 1px solid var(--linie); font-size: .93rem; }
/* Dringlichkeit als Farbe am Rand, nicht als Text — die Zeile bleibt lesbar. */
ol.logbuch li.g3 { border-left: 3px solid var(--stopp); background: var(--stopp-flaeche); }
ol.logbuch li.g2 { border-left: 3px solid var(--warn); }
ol.logbuch li.technisch { opacity: .62; }
ol.logbuch .art { font-size: .78rem; color: var(--leise); text-transform: uppercase;
                  letter-spacing: .03em; min-width: 7rem; }
ol.logbuch .text { flex: 1 1 18rem; }
@media (max-width: 40rem) {
  ol.logbuch .art { min-width: 0; }
  form.filter { flex-direction: column; align-items: stretch; }
}

/* Cockpit */
.kopfzeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
             gap: .5rem 1.5rem; }
.kopfzeile h1 { margin-bottom: .2rem; }
.datum { color: var(--leise); margin-top: 0; }
nav.umschalter { display: flex; border: 1px solid var(--linie); border-radius: .3rem;
                 overflow: hidden; }
nav.umschalter a { padding: .35rem .8rem; font-size: .88rem; text-decoration: none;
                   color: var(--text); background: var(--flaeche); }
nav.umschalter a.an { background: var(--akzent); color: #fff; }
section.fach h2 { display: flex; align-items: baseline; gap: .6rem; font-size: 1.05rem;
                  border-bottom: 2px solid var(--linie); padding-bottom: .3rem; }
section.fach h2 .anzahl { font-size: .8rem; color: var(--leise); font-weight: normal; }
/* Nur das erste Fach ist rot. Wäre alles Überfällige rot, wäre nach zwei Wochen alles rot. */
section.fach.f1 h2 { border-bottom-color: var(--stopp); color: var(--stopp); }
section.fach.f2 h2 { border-bottom-color: var(--warn); }
ul.posten { list-style: none; padding: 0; margin: .4rem 0 1.6rem; }
ul.posten li { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: baseline;
               padding: .5rem .2rem; border-bottom: 1px solid var(--linie); }
ul.posten .quelle { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
                    color: var(--leise); min-width: 6.5rem; }
ul.posten .titel { flex: 1 1 16rem; font-weight: 500; }
ul.posten .klartext { color: var(--leise); font-size: .88rem; }
ul.posten .wer { font-size: .8rem; border: 1px solid var(--linie); border-radius: .8rem;
                 padding: 0 .5rem; color: var(--leise); }
ul.posten .knoepfe { display: flex; gap: .5rem; align-items: baseline; }
ul.posten button.leise { background: none; border: 1px solid var(--linie); color: var(--text);
                         font-size: .8rem; padding: .15rem .6rem; }
details.zurueck summary, details.neue-aufgabe summary { cursor: pointer; font-size: .85rem;
                                                        color: var(--akzent); }
details.zurueck form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end;
                       margin-top: .4rem; }
details.neue-aufgabe { margin: 1.5rem 0; }
section.bereiche { margin-top: 2.5rem; }
ul.quellenliste { list-style: none; padding: 0; display: grid;
                  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .3rem .9rem; }
ul.quellenliste li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline;
                     padding: .35rem .5rem; border-left: 3px solid var(--ok);
                     background: var(--flaeche); font-size: .88rem; }
ul.quellenliste li.aus { border-left-color: var(--linie); opacity: .8; }
ul.quellenliste .name { font-weight: 500; flex: 1 1 8rem; }
ul.quellenliste .zustand-wort { font-size: .78rem; color: var(--leise); }
ul.quellenliste li.an .zustand-wort { color: var(--ok); }
ul.posten a.leise { font-size: .8rem; border: 1px solid var(--linie); border-radius: .25rem;
                    padding: .15rem .6rem; text-decoration: none; }
