/* =====================================================================
   IST-Analyse — Stylesheet
   Gestaltungsidee: ein digitales Prüfprotokoll. Dunkle Navigations-
   schiene wie ein Klemmbrett, helle Papierfläche für die Erfassung,
   technische Kennungen in Monospace als tragendes Strukturelement.
   Die Ampelfarben sind ausschließlich für Bewertung reserviert —
   interaktive Elemente nutzen deshalb Blaugrün, damit "anklickbar"
   nie wie "Warnung" aussieht.
   ===================================================================== */

:root {
  --tinte:        #14212E;
  --tinte-weich:  #3B4C5E;
  --papier:       #FBFAF7;
  --papier-tief:  #F1EEE7;
  --linie:        #DAD5CA;
  --aktion:       #0F6E78;
  --aktion-hell:  #E3F1F2;
  --gruen:        #2F7D4F;
  --gelb:         #B57A11;
  --rot:          #B03A2E;
  --radius:       3px;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--tinte);
  background: var(--papier-tief);
}

a { color: var(--aktion); }

:focus-visible {
  outline: 2px solid var(--aktion);
  outline-offset: 2px;
}

/* ---------- Kopfzeile ---------- */

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1rem;
  background: var(--tinte);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}

.kopf__marke {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  color: #fff;
  text-decoration: none;
}

.kopf__kuerzel {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .18em;
  padding: .2rem .4rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius);
}

.kopf__name { font-weight: 600; letter-spacing: -.01em; }

.kopf__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .9rem;
}

.kopf__nav a { color: #fff; text-decoration: none; opacity: .85; }
.kopf__nav a:hover { opacity: 1; text-decoration: underline; }
.kopf__user { font-family: var(--mono); font-size: .78rem; opacity: .6; }

/* ---------- Grundlayout ---------- */

.inhalt {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1rem 5rem;
}

.fuss {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--tinte-weich);
  border-top: 1px solid var(--linie);
}

.fuss__hinweis { font-family: var(--mono); }

h1 { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; letter-spacing: -.01em; margin: 2rem 0 .75rem; }

.unterzeile { color: var(--tinte-weich); margin: 0 0 1.5rem; }

/* ---------- Meldungen ---------- */

.meldung {
  max-width: 1080px;
  margin: .75rem auto 0;
  padding: .6rem .9rem;
  border-left: 3px solid var(--gruen);
  background: #fff;
  font-size: .9rem;
}

.meldung--fehler { border-left-color: var(--rot); }
.meldung--warn   { border-left-color: var(--gelb); }

/* ---------- Karten & Tabellen ---------- */

.karte {
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.liste { width: 100%; border-collapse: collapse; background: var(--papier); }

.liste th {
  text-align: left;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tinte-weich);
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--linie);
}

.liste td {
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--linie);
  vertical-align: top;
}

.liste tr:hover td { background: var(--aktion-hell); }
.liste a { font-weight: 600; text-decoration: none; }

.leerzustand {
  background: var(--papier);
  border: 1px dashed var(--linie);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--tinte-weich);
}

/* ---------- Schaltflächen ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  border: 1px solid var(--aktion);
  border-radius: var(--radius);
  background: var(--aktion);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: #0B565E; border-color: #0B565E; }

.btn--sekundaer { background: transparent; color: var(--aktion); }
.btn--sekundaer:hover { background: var(--aktion-hell); color: var(--aktion); }

.btn--klein { padding: .35rem .7rem; font-size: .82rem; }

.btnzeile { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }

/* ---------- Formulare ---------- */

label { display: block; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], textarea, select {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--tinte);
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus { border-color: var(--aktion); }

.feld--kurz { max-width: 14rem; }

.feldgruppe { margin-bottom: 1rem; }
.feldgruppe > label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }

.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Fortschritt ---------- */

.balken {
  height: 6px;
  background: var(--papier-tief);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--linie);
}

.balken__fuellung { height: 100%; background: var(--aktion); }

.zahl-gross {
  font-family: var(--mono);
  font-size: 2rem;
  letter-spacing: -.03em;
  line-height: 1;
}

/* ---------- Sektionsübersicht ---------- */

.sektionen { display: grid; gap: .5rem; }

.sektion {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  align-items: center;
  gap: .9rem;
  padding: .7rem .9rem;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-left: 3px solid var(--linie);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.sektion:hover { border-left-color: var(--aktion); background: #fff; }
.sektion--fertig { border-left-color: var(--gruen); }
.sektion--teilweise { border-left-color: var(--gelb); }

.sektion__nr {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--tinte-weich);
  text-align: right;
}

.sektion__titel { font-weight: 600; }
.sektion__ziel { font-size: .82rem; color: var(--tinte-weich); }

.sektion__stand {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--tinte-weich);
  white-space: nowrap;
}

/* ---------- Erfassungsformular ---------- */

.erfassung__kopf {
  position: sticky;
  top: 46px;
  z-index: 30;
  background: var(--papier-tief);
  padding: .75rem 0;
  border-bottom: 1px solid var(--linie);
  margin-bottom: 1rem;
}

.erfassung__zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.frage {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-left: 3px solid var(--linie);
  border-radius: var(--radius);
  margin-bottom: .6rem;
}

.frage--fertig { border-left-color: var(--gruen); }
.frage--offen  { border-left-color: var(--gelb); }
.frage--nz     { opacity: .5; }

.frage__rail { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }

.frage__key {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--tinte-weich);
  word-break: break-all;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--mono);
  font-size: .7rem;
  padding: .18rem .4rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.chip input { margin: 0; }
.chip:has(input:checked) { border-color: var(--tinte); background: var(--tinte); color: #fff; }
.chip--offen:has(input:checked) { border-color: var(--gelb); background: var(--gelb); color: #fff; }

.frage__label { font-weight: 600; margin-bottom: .3rem; }

.pflicht {
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rot);
  border: 1px solid currentColor;
  border-radius: var(--radius);
  padding: 0 .25rem;
  vertical-align: 1px;
}

.frage__hinweis { margin: 0 0 .5rem; font-size: .84rem; color: var(--tinte-weich); }

.notiz {
  margin-top: .5rem;
  font-size: .85rem !important;
  border-style: dashed !important;
  background: transparent !important;
}

.hinweisblock {
  padding: .8rem 1rem;
  background: var(--aktion-hell);
  border-left: 3px solid var(--aktion);
  margin-bottom: .6rem;
  font-size: .9rem;
}

/* Auswahl als Schalterreihe — auf dem Tablet treffsicherer als ein Dropdown */

.optionen { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.option {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .7rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  min-height: 40px;
}

.option input { margin: 0; accent-color: var(--aktion); }
.option:has(input:checked) { border-color: var(--aktion); background: var(--aktion-hell); font-weight: 600; }

.leeren {
  border: 0;
  background: none;
  color: var(--tinte-weich);
  font: inherit;
  font-size: .78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: .3rem;
}

/* Tabellenfelder */

.tabelle__scroll { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }
.tabelle table { border-collapse: collapse; width: 100%; min-width: 34rem; }

.tabelle th {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: .4rem .5rem;
  background: var(--papier-tief);
  border-bottom: 1px solid var(--linie);
  white-space: nowrap;
}

.tabelle td { padding: .2rem; border-bottom: 1px solid var(--linie); }
.tabelle td input { border: 0; padding: .4rem; min-width: 8rem; }
.tabelle .sp-aktion { width: 2.4rem; text-align: center; }

.zeile-minus {
  border: 0;
  background: none;
  color: var(--rot);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: .3rem .5rem;
}

.tabelle .btn--klein { margin-top: .5rem; }

.foto-platzhalter {
  padding: .7rem .9rem;
  border: 1px dashed var(--linie);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--tinte-weich);
}

/* ---------- Speicherstand ---------- */

.speicherstand {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  font-family: var(--mono);
  font-size: .75rem;
  padding: .45rem .8rem;
  border-radius: 99px;
  background: var(--tinte);
  color: #fff;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}

.speicherstand.sichtbar { opacity: .92; }
.speicherstand.fehler { background: var(--rot); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Anmeldung ---------- */

.anmeldung { max-width: 22rem; margin: 4rem auto; }

/* ---------- Klein ---------- */

@media (max-width: 720px) {
  .frage { grid-template-columns: 1fr; gap: .5rem; }
  .frage__rail { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .raster2 { grid-template-columns: 1fr; }
  .sektion { grid-template-columns: 2.2rem 1fr; }
  .sektion__stand { grid-column: 2; }
  .erfassung__kopf { top: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
