/* regio-logistik: Grün #89B71A als Akzent, Text Dunkelgrau #39393A, Hintergrund Weiß/Hellgrau, Schrift Calibri/Carlito.
   Grün nie als Textfarbe auf Weiß (zu wenig Kontrast) - nur Flächen, Linien, Buttons mit dunkler Schrift. */
@font-face { font-family: "Carlito"; src: url("/static/fonts/Carlito-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("/static/fonts/Carlito-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
:root {
  --gruen: #89B71A; --gruen-hell: #eef5dc; --gruen-dunkel: #4d6a0a; --grau: #39393A; --grau-mittel: #6b6b6d;
  --grau-hell: #f4f4f2; --linie: #dcdcd8; --weiss: #fff; --rot: #9b1c14; --rot-hell: #fbeae8; --gelb-hell: #fff5d6; --gelb: #7a5a00;
  --radius: 6px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--grau-hell); color: var(--grau); font-family: Calibri, Carlito, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.4; }
a { color: var(--grau); text-decoration-color: var(--gruen); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; border-left: 4px solid var(--gruen); padding-left: .5rem; margin-top: 1.4rem; }
h3 { font-size: 1rem; }
.kopf { background: var(--weiss); border-bottom: 3px solid var(--gruen); padding: .6rem 16px; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; }
.kopf .titel { font-weight: 700; font-size: 1.15rem; }
.kopf .titel small { display: block; font-weight: 400; font-size: .85rem; color: var(--grau-mittel); }
.kopf nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.kopf nav a { white-space: nowrap; text-decoration: none; padding: .35rem .7rem; border-radius: var(--radius); font-weight: 700; }
.kopf nav a.aktiv, .kopf nav a:hover { background: var(--gruen-hell); }
.kopf nav .zahl { background: var(--gruen); color: var(--grau); border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; font-size: .85rem; }
.kopf .rechts { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.kopf .wer { text-align: right; font-size: .9rem; }
.kopf .wer button { font-size: .85rem; }
.kopf img.logo, .anmelden img.logo, .oeffentlich img.logo { height: 44px; width: auto; display: block; }
.stand { width: 100%; font-size: .85rem; color: var(--grau-mittel); display: flex; gap: 1rem; flex-wrap: wrap; }
.stand .warn { color: var(--rot); font-weight: 700; }
.vorf { background: var(--grau); color: var(--weiss); font-weight: 700; padding: .1rem .6rem; border-radius: var(--radius); }
.inhalt { max-width: 1240px; margin: 0 auto; padding: 1rem 16px 3rem; }
.inhalt.schmal { max-width: 640px; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.raster.zwei { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 860px) { .raster.zwei { grid-template-columns: 1fr; } }
.kachel { background: var(--weiss); border: 1px solid var(--linie); border-top: 4px solid var(--gruen); border-radius: var(--radius); padding: .9rem 1rem; }
.kachel .wert { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.kachel .text { color: var(--grau-mittel); margin-top: .3rem; }
.kachel.achtung { border-top-color: var(--rot); }
button, .knopf { font: inherit; font-weight: 700; color: var(--grau); background: var(--gruen); border: 1px solid var(--gruen-dunkel); border-radius: var(--radius);
  padding: .45rem .9rem; cursor: pointer; text-decoration: none; display: inline-block; }
button.zweit, .knopf.zweit { background: var(--weiss); border-color: var(--linie); }
button.gefahr { background: var(--weiss); border-color: var(--rot); color: var(--rot); }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, tr[tabindex]:focus-visible { outline: 3px solid var(--grau); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--grau); border: 1px solid #b9b9b4; border-radius: var(--radius); padding: .45rem .6rem; background: var(--weiss); width: 100%; }
label { display: block; font-weight: 700; margin: .6rem 0 .25rem; }
label .klein { font-weight: 400; }
.zeile { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.zeile > * { flex: 0 0 auto; }
.zeile input { flex: 1 1 260px; width: auto; }
.zeile select { width: auto; max-width: 100%; }
.klein, small { font-size: .85rem; color: var(--grau-mittel); }
table { width: 100%; border-collapse: collapse; background: var(--weiss); }
th { text-align: left; font-size: .85rem; background: var(--gruen-hell); border-bottom: 2px solid var(--gruen); padding: .45rem .5rem; white-space: nowrap; }
td { border-bottom: 1px solid var(--linie); padding: .45rem .5rem; vertical-align: top; }
tr[tabindex] { cursor: pointer; }
tr[tabindex]:hover td { background: #fafaf6; }
.mono { font-family: Consolas, "DejaVu Sans Mono", monospace; font-size: .9rem; }
.marke { display: inline-block; border-radius: 999px; padding: .05rem .55rem; font-size: .85rem; font-weight: 700; white-space: nowrap; background: var(--grau-hell); border: 1px solid var(--linie); }
.marke.gut { background: var(--gruen-hell); border-color: var(--gruen); }
.marke.schlecht { background: var(--rot-hell); border-color: #e3b1ab; color: var(--rot); }
.marke.mittel { background: var(--gelb-hell); border-color: #e9d38c; color: var(--gelb); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.chip { background: var(--gruen-hell); border: 1px solid var(--gruen); border-radius: 999px; padding: .1rem .6rem; font-size: .9rem; }
.chip.nicht { background: var(--grau-hell); border-color: var(--linie); }
.fall { border: 1px solid var(--linie); border-left: 5px solid var(--gruen); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .6rem; background: var(--weiss); }
.fall.rot { border-left-color: var(--rot); }
.fall.gelb { border-left-color: #d9a400; }
.fall h3 { margin-bottom: .25rem; }
.fall .meta { font-size: .9rem; color: var(--grau-mittel); }
.verlauf { list-style: none; padding: 0; margin: 0; }
.verlauf li { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--linie); }
.verlauf li.problem b { color: var(--rot); }
.verlauf .zeit { color: var(--grau-mittel); font-size: .9rem; }
.leiste { position: relative; height: 54px; margin: 2.6rem .5rem 1.6rem; }
.leiste .strich { position: absolute; top: 33px; width: 1px; height: 6px; background: #b9b9b4; }
.leiste .beschr.oben2 { top: -24px; }
.leiste .beschr.fett { font-weight: 700; }
.leiste .punkt.neu { background: var(--gelb); }
.legende { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .85rem; color: var(--grau-mittel); margin-bottom: .4rem; }
.legende .muster { display: inline-block; width: 22px; height: 10px; margin-right: .35rem; vertical-align: middle; border-radius: 3px; }
.legende .muster.karenz { background: var(--gelb-hell); border: 1px solid #e9d38c; }
.legende .muster.fenster { background: rgba(137, 183, 26, .35); border: 1px solid var(--gruen); }
input.kurz { width: 7rem; flex: 0 0 7rem; }
details > summary { cursor: pointer; font-weight: 700; }
details[open] > summary { margin-bottom: .6rem; }
.leiste .bahn { position: absolute; left: 0; right: 0; top: 22px; height: 10px; background: var(--grau-hell); border: 1px solid var(--linie); border-radius: 5px; }
.leiste .karenz { position: absolute; top: 22px; height: 10px; background: var(--gelb-hell); border: 1px solid #e9d38c; }
.leiste .fenster { position: absolute; top: 18px; height: 18px; background: rgba(137, 183, 26, .35); border: 1px solid var(--gruen); border-radius: 4px; }
.leiste .punkt { position: absolute; top: 14px; width: 4px; height: 26px; background: var(--grau); transform: translateX(-2px); }
.leiste .punkt.zu { background: var(--gruen-dunkel); width: 6px; }
.leiste .beschr { position: absolute; font-size: .8rem; white-space: nowrap; transform: translateX(-50%); }
.leiste .beschr.oben { top: -6px; }
.leiste .beschr.unten { top: 40px; font-size: .75rem; color: var(--grau-mittel); }
.knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.meldetext { white-space: pre-wrap; background: var(--grau-hell); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem; font-size: .95rem; }
.hinweis { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--grau); color: var(--weiss); padding: .6rem 1rem; border-radius: var(--radius); max-width: calc(100% - 32px); }
.leer { color: var(--grau-mittel); padding: .6rem 0; }
.banner { background: var(--gelb-hell); border: 1px solid #e9d38c; border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: 1rem; }
.anmelden { max-width: 380px; margin: 8vh auto; }
.anmelden .karte { padding: 1.5rem; }
.anmelden img.logo { margin: 0 0 1rem auto; }
.fehler { color: var(--rot); font-weight: 700; margin-top: .6rem; }
.oeffentlich .kopfzeile { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
@media (max-width: 700px) {
  .kopf { gap: .4rem; }
  .kopf .rechts { margin-left: auto; gap: .6rem; }
  .kopf .wer div { display: none; }
  .kopf nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .kopf img.logo { height: 34px; }
  .kachel .wert { font-size: 1.8rem; }
  .raster { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .kachel { padding: .6rem; }
  .kachel .text { font-size: .85rem; }
  table.karten thead { display: none; }
  table.karten, table.karten tbody, table.karten tr, table.karten td { display: block; width: 100%; }
  table.karten tr { border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: .6rem; padding: .4rem .6rem; background: var(--weiss); }
  table.karten td { border: 0; padding: .15rem 0; }
  table.karten td[data-titel]::before { content: attr(data-titel) ": "; color: var(--grau-mittel); font-size: .85rem; }
  table.karten td[data-titel=""]::before { content: none; }
  .verlauf li { grid-template-columns: 1fr; gap: 0; }
}
label.wahl { font-weight: 400; display: flex; gap: .5rem; align-items: center; }
label.wahl input { width: auto; }
.schmal-block { max-width: 640px; }

/* Staffel: Service-Zeile, darunter die Dienstleister eingerückt */
h3.abschnitt { margin: 1.4rem 0 .5rem; }
table.staffel tr.gruppe td { background: var(--gruen-hell); }
table.staffel tr.unter td:first-child { padding-left: 1.6rem; }
@media (max-width: 700px) {   /* Handy: echte Tabelle statt Karten, ohne Spalte „Anteil“ */
  table.staffel { display: table; font-size: .85rem; }
  table.staffel thead { display: table-header-group; }
  table.staffel tbody { display: table-row-group; }
  table.staffel tr { display: table-row; border: 0; margin: 0; padding: 0; }
  table.staffel td, table.staffel th { display: table-cell; width: auto; padding: .35rem .3rem; border-bottom: 1px solid var(--linie); }
  table.staffel td::before { content: none !important; }
  table.staffel td:nth-child(4), table.staffel th:nth-child(4) { display: none; }
  table.staffel th, table.staffel td:first-child, table.staffel td:nth-child(5) { white-space: normal; }
  table.staffel td { white-space: nowrap; }
  table.staffel th { font-size: .75rem; }
  table.staffel .marke { white-space: nowrap; }
  table.staffel tr.unter td:first-child { padding-left: .9rem; }
}

/* Verwaltung: Zugänge je Kunde */
.zugang { padding: .7rem 0; border-bottom: 1px solid var(--linie); display: grid; gap: .35rem; }
.zugang:last-child { border-bottom: 0; }
.zugang .zeile input { flex: 1 1 180px; }
.zugang .zeile input.kurz { flex: 0 0 8rem; width: 8rem; }
/* Filter und Sortierung über jeder Liste */
.listenleiste { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin: .4rem 0 .6rem; }
.listenleiste input[type=search] { flex: 1 1 14rem; width: auto; min-width: 0; }
.listenleiste select { width: auto; max-width: 100%; flex: 0 1 auto; }
.listenleiste button { padding: .4rem .7rem; }
th button.sortier { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; white-space: nowrap; }
th button.sortier .pfeil { color: var(--grau-mittel); }
th button.sortier.aktiv .pfeil { color: var(--grau); }
@media (max-width: 700px) { .listenleiste input[type=search] { flex-basis: 100%; } .listenleiste select { flex: 1 1 45%; } }
a.zurueck { display: inline-block; margin: 0 0 .7rem; font-weight: 700; }

/* Etappe 4: Datenstand (Schwund) und nur-lesend-Zustand */
.banner.rot { background: var(--rot-hell); border-color: #e3b1ab; }
.karte.nurlesen { border-left: 5px solid var(--grau); }
.mengen { display: flex; align-items: flex-end; gap: 4px; margin: .6rem 0; flex-wrap: wrap; }
.mengen .menge { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.2rem; padding: .15rem .2rem;
  border: 1px solid var(--linie); border-radius: 4px; background: var(--gruen-hell); }
.mengen .menge.schwund { background: var(--rot-hell); border-color: #e3b1ab; color: var(--rot); }
.mengen .menge small { font-size: .8rem; color: inherit; }
.kopf .stand a.warn { color: var(--rot); font-weight: 700; }
.karte.gruppe { border-left: 5px solid var(--gruen); }
.klein.entwarnung, .meta.entwarnung { color: var(--gruen-dunkel); font-weight: 700; }
.zeile > h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }   /* lange Titel am Handy umbrechen */
