:root {
  --bg: #F4F6F3; --karte: #FFFFFF; --text: #1B2A22; --text2: #5A6760; --linie: #DDE3DE; --gruen: #4F7A2E; --gruen-hell: #E7F0DD; --grau: #B8C0BA; --rot: #B42318; --rot-hell: #FDE8E7;
  --gelb: #7A4B00; --gelb-hell: #FFF2D5; --akzent: #2F6FED; --schatten: 0 8px 30px rgba(20, 30, 24, .18);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101713; --karte: #18211B; --text: #E8EEE9; --text2: #9AA89F; --linie: #2A362E; --gruen: #86B65B; --gruen-hell: #22301A; --grau: #4A574E; --rot: #F0857A; --rot-hell: #3A1D1A;
    --gelb: #F2C36B; --gelb-hell: #3A2E14; --akzent: #7EA6FF; --schatten: 0 8px 30px rgba(0, 0, 0, .5); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.kopf { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.marke { flex: 1; } .marke span { color: var(--text2); margin-left: 6px; }
#kopf-rechts { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.text2 { color: var(--text2); }
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 53px); }
.nav { padding: 12px; border-right: 1px solid var(--linie); background: var(--karte); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 53px; align-self: start; height: calc(100vh - 53px); overflow: auto; }
.nav button { text-align: left; padding: 10px 12px; border: 0; background: none; color: var(--text); border-radius: 8px; font: inherit; cursor: pointer; }
.nav button:hover { background: var(--bg); } .nav button.an { background: var(--gruen-hell); font-weight: 600; } .nav button[hidden] { display: none; }
#inhalt { padding: 16px; display: grid; gap: 16px; align-content: start; min-width: 0; max-width: 1180px; }
h1 { font-size: 22px; margin: 0 0 12px; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 14px 0 6px; color: var(--text2); text-transform: uppercase; letter-spacing: .03em; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 16px; min-width: 0; }
.schmal { max-width: 420px; margin: 40px auto; width: calc(100% - 32px); }
.erklaerung { background: var(--bg); border-left: 3px solid var(--akzent); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--text2); font-size: 13px; margin: 0 0 12px; }
label { display: grid; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--text2); }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--linie); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; min-height: 110px; resize: vertical; }
button { font: inherit; cursor: pointer; }
.primaer { padding: 10px 14px; border: 0; border-radius: 8px; background: var(--gruen); color: #fff; font-weight: 600; }
form .primaer { width: 100%; }
.sekundaer { padding: 8px 12px; border: 1px solid var(--linie); border-radius: 8px; background: var(--bg); color: var(--text); }
.gefahr { padding: 8px 12px; border: 1px solid var(--rot); border-radius: 8px; background: var(--rot-hell); color: var(--rot); font-weight: 600; }
.link { background: none; border: 0; color: var(--akzent); padding: 6px 4px; } .link:disabled { color: var(--text2); cursor: default; }
.fehler { color: var(--rot); margin: 8px 0 0; } .hinweis { color: var(--text2); font-size: 13px; margin: 8px 0 0; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 14px; }
.kachel b { display: block; font-size: 26px; line-height: 1.1; } .kachel span { color: var(--text2); font-size: 13px; }
.kachel.rot { border-color: var(--rot); background: var(--rot-hell); } .kachel.gelb { border-color: var(--gelb); background: var(--gelb-hell); } .kachel.gruen { border-color: var(--gruen); }
.achtung { display: grid; gap: 8px; }
.achtung .zeile { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; background: var(--gelb-hell); color: var(--text); border: 1px solid var(--gelb); }
.achtung .zeile.rot { background: var(--rot-hell); border-color: var(--rot); } .achtung .zeile.ok { background: var(--gruen-hell); border-color: var(--gruen); }
.wykres { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.tag { flex: 1; min-width: 4px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.tag i { display: block; background: var(--gruen); border-radius: 2px 2px 0 0; } .tag i.t, .tag i.f { background: var(--grau); border-radius: 0; } .tag i.f { background: var(--rot); }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; } .werkzeuge input[type=search] { flex: 1 1 220px; width: auto; } .werkzeuge select { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chips button { padding: 7px 12px; border: 1px solid var(--linie); border-radius: 999px; background: var(--bg); color: var(--text); }
.chips button.an { background: var(--gruen-hell); border-color: var(--gruen); font-weight: 600; }
.tabelle-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; vertical-align: top; }
th { color: var(--text2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr.klick { cursor: pointer; } tr.klick:hover td { background: var(--bg); }
td.mono, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; } td.lang { white-space: normal; max-width: 420px; word-break: break-word; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--gruen-hell); border: 0; color: var(--text); }
.pill.test { background: var(--linie); color: var(--text2); } .pill.warn { background: var(--gelb-hell); color: var(--gelb); } .pill.bad { background: var(--rot-hell); color: var(--rot); }
.pill.sudo { background: var(--gelb-hell); color: var(--gelb); cursor: pointer; }
.seiten { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--text2); font-size: 13px; }
.schublade { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--karte); border-left: 1px solid var(--linie); box-shadow: var(--schatten); z-index: 20; overflow: auto; padding: 0 16px 24px; }
.schublade-kopf { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; position: sticky; top: 0; background: var(--karte); border-bottom: 1px solid var(--linie); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 14px; } .kv span { color: var(--text2); } .kv b { font-weight: 500; word-break: break-word; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; } .aktionen select { width: auto; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal-karte { background: var(--karte); border-radius: 12px; padding: 20px; width: min(460px, 100%); box-shadow: var(--schatten); }
.modal-karte .aktionen { justify-content: flex-end; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; }
pre { background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; padding: 10px; overflow: auto; max-height: 300px; font-size: 12.5px; }
.db-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; } .db-liste { display: grid; gap: 4px; align-content: start; }
.db-liste button { text-align: left; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--bg); color: var(--text); } .db-liste button.an { background: var(--gruen-hell); border-color: var(--gruen); }
.db-liste small { color: var(--text2); display: block; }
.rollen { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.menue-knopf { font-size: 20px; display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; } .menue-knopf { display: inline-block !important; }
  .nav { position: fixed; left: 0; top: 53px; bottom: 0; width: 250px; z-index: 15; transform: translateX(-105%); transition: transform .15s; height: auto; box-shadow: var(--schatten); }
  .nav.offen { transform: none; } .db-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 110px 1fr; }
}
@media (max-width: 560px) { #inhalt { padding: 12px; } .kopf { padding: 8px 12px; } }
