:root {
  --navy: #0C2340;
  --royal: #0033A0;
  --blau: #003DA5;
  --cyan: #0085CA;
  --himmel: #99D6EA;
  --papier: #F2F5F9;
  --karte: #FFFFFF;
  --tinte: #12263F;
  --nebel: #5A6B80;
  --linie: #D8E0E9;
  --gruen: #1E7B4D;
  --gruen-hell: #E3F3EA;
  --rot: #B3261E;
  --rot-hell: #FBEAE9;
  --gelb-hell: #FFF4D6;
  --gelb-tinte: #7A5B00;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.kopf {
  background: var(--navy);
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.kopf .marke {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  white-space: nowrap;
}

.kopf .marke span { color: var(--himmel); }

.kopf .seite {
  font-size: 0.95rem;
  color: var(--himmel);
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 0.75rem;
}

.kopf .rechts {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.kopf a { white-space: nowrap; }

.kopf a {
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
}

.kopf a:hover, .kopf a:focus-visible { background: rgba(255,255,255,0.25); }

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
}

main.schmal { max-width: 26rem; padding-top: 8vh; }

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

h1 { font-size: 1.35rem; margin: 0 0 0.75rem; color: var(--navy); }
h2 { font-size: 1.05rem; margin: 0 0 0.6rem; color: var(--navy); }

label { display: block; font-size: 0.85rem; color: var(--nebel); margin: 0.7rem 0 0.25rem; }

input[type=text], input[type=password], input[type=email], select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--linie);
  border-radius: 8px;
  font-size: 1.05rem;
  background: #fff;
  color: var(--tinte);
}

input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 1px;
}

button {
  font-family: inherit;
  font-size: 1.05rem;
  border: 0;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  background: var(--royal);
  color: #fff;
  min-height: 3rem;
}

button:hover { background: var(--blau); }
button:disabled { background: var(--nebel); cursor: default; }

button.gross {
  width: 100%;
  font-size: 1.2rem;
  min-height: 3.5rem;
  font-weight: 600;
}

button.zweit {
  background: #fff;
  color: var(--royal);
  border: 1.5px solid var(--royal);
}

button.zweit:hover { background: var(--papier); }

button.leise {
  background: transparent;
  color: var(--nebel);
  border: 1px solid var(--linie);
  min-height: 2.2rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

button.leise:hover { color: var(--tinte); background: var(--papier); }

.hinweis {
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin: 0.7rem 0;
  font-size: 0.95rem;
  display: none;
}

.hinweis.sichtbar { display: block; }
.hinweis.fehler { background: var(--rot-hell); color: var(--rot); }
.hinweis.gut { background: var(--gruen-hell); color: var(--gruen); }
.hinweis.warte { background: var(--gelb-hell); color: var(--gelb-tinte); }

.vorgang-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.vorgang-band .nummer { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.vorgang-band > div:first-child { min-width: 0; flex: 1; }
.vorgang-band .zusatz { color: var(--himmel); font-size: 0.85rem; }
.vorgang-band button { margin-left: auto; }

.miniaturen {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.miniatur {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--linie);
  aspect-ratio: 1;
  background: var(--papier);
}

.miniatur img { width: 100%; height: 100%; object-fit: cover; display: block; }

.miniatur .weg {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(12,35,64,0.75);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 1.7rem;
  height: 1.7rem;
  min-height: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.miniatur .zustand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 0.7rem;
  text-align: center;
  padding: 0.15rem;
  background: rgba(255,255,255,0.9);
}

.miniatur.gut { border-color: var(--gruen); }
.miniatur.schlecht { border-color: var(--rot); }

.balken {
  height: 0.9rem;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0;
}

.balken > div {
  height: 100%;
  width: 0;
  background: var(--cyan);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.fusszeile-fest {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--karte);
  border-top: 1px solid var(--linie);
  padding: 0.7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  z-index: 9;
}

.fusszeile-fest .stand { font-size: 0.9rem; color: var(--nebel); overflow-wrap: anywhere; min-width: 0; flex: 1; }
.fusszeile-fest button { margin-left: auto; }

.zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  padding: 0.65rem 0.2rem;
  border-bottom: 1px solid var(--linie);
}

.zeile:last-child { border-bottom: 0; }
.zeile > div:first-child { min-width: 0; }
.zeile .haupt { font-weight: 600; }
.zeile .neben { color: var(--nebel); font-size: 0.85rem; overflow-wrap: anywhere; }
.zeile .rechts { margin-left: auto; display: flex; gap: 0.4rem; align-items: center; }

.plakette {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
}

.plakette.frei { background: var(--gruen-hell); color: var(--gruen); }
.plakette.gesperrt { background: var(--rot-hell); color: var(--rot); }
.plakette.admin { background: var(--himmel); color: var(--navy); }

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.kachel {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
}

.kachel .wert { font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.kachel .name { font-size: 0.8rem; color: var(--nebel); }
.kachel.warn .wert { color: var(--rot); }

.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.galerie .bild {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--linie);
  aspect-ratio: 1;
  cursor: pointer;
  background: var(--papier);
}

.galerie .bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galerie .bild.gewaehlt { border-color: var(--cyan); }

.galerie .bild .haken {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 2px solid var(--nebel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: transparent;
}

.galerie .bild.gewaehlt .haken {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
}

.galerie .bild .weg {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(179,38,30,0.88);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 1.9rem;
  height: 1.9rem;
  min-height: 0;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.galerie .bild .weg:hover { background: var(--rot); }

.galerie .bild .lupe {
  position: absolute;
  right: 0.25rem;
  bottom: 0.25rem;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--linie);
  border-radius: 50%;
  width: 1.9rem;
  height: 1.9rem;
  min-height: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--navy);
}

.suchzeile { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.suchzeile input { flex: 1; }
.suchzeile button { white-space: nowrap; }

.klapp-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.7rem;
  cursor: pointer;
  padding: 0.2rem 0;
}

.klapp-kopf .haupt { overflow-wrap: anywhere; min-width: 0; }

.klapp-kopf input[type=checkbox] { width: 1.3rem; height: 1.3rem; }
.klapp-kopf .pfeil { margin-left: auto; color: var(--nebel); }

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

details.vorgang summary { list-style: none; }
details.vorgang summary::-webkit-details-marker { display: none; }

.tabellen-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabelle th, .tabelle td { white-space: nowrap; }
.tabelle th { text-align: left; color: var(--nebel); font-weight: 600; padding: 0.4rem 0.5rem; border-bottom: 2px solid var(--linie); }
.tabelle td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--linie); }

.formzeile { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; }

.gross-bild-deckel {
  position: fixed;
  inset: 0;
  background: rgba(12,35,64,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 1rem;
}

.gross-bild-deckel.sichtbar { display: flex; }
.gross-bild-deckel img { max-width: 100%; max-height: 92vh; border-radius: 8px; }

.logo-block { text-align: center; margin-bottom: 1.2rem; }
.logo-block .wortmarke { font-size: 2rem; font-weight: 800; color: var(--navy); letter-spacing: 0.05em; }
.logo-block .wortmarke span { color: var(--cyan); }
.logo-block .unterzeile { color: var(--nebel); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; }

@media (max-width: 40rem) {
  .formzeile { grid-template-columns: 1fr; }
  .kopf .seite { display: none; }
  .kopf { padding: 0.55rem 0.7rem; }
  .kopf .rechts { font-size: 0.8rem; }
  .kopf a { padding: 0.3rem 0.5rem; }
  main { padding-left: 0.7rem; padding-right: 0.7rem; }
}
