:root {
  --bg: #f6f7f8; --panel: #fff; --text: #1d2529; --muted: #64707a; --line: #e2e7ea;
  --akzent: #0f5c6e; --akzent-hell: #e3f0f3; --hoch: #a3312b; --hoch-bg: #fbecea;
  --mittel: #9a6b00; --mittel-bg: #fdf4df; --info: #3e5c76; --info-bg: #eaf0f6; --ok: #2e7d4f;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14191c; --panel: #1c2327; --text: #e3e8eb; --muted: #95a2ab; --line: #2c363c;
          --akzent: #5fb3c6; --akzent-hell: #1d3a42; --hoch: #f08a83; --hoch-bg: #3a2220;
          --mittel: #e4b75a; --mittel-bg: #362c17; --info: #9dbad3; --info-bg: #1f2b36; --ok: #7ccf9c; }
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg);
       color: var(--text); line-height: 1.45; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
nav.top { display: flex; align-items: center; gap: 4px; padding: 0 20px; background: var(--panel);
          border-bottom: 1px solid var(--line); height: 52px; position: sticky; top: 0; z-index: 5; overflow-x: auto; }
nav.top .marke { font-weight: 700; letter-spacing: .04em; color: var(--akzent); margin-right: 18px; white-space: nowrap; }
nav.top a { padding: 6px 10px; border-radius: var(--radius); color: var(--text); white-space: nowrap; }
nav.top a.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
nav.top a:hover { text-decoration: none; background: var(--bg); }
nav.top form { margin-left: auto; }
main { max-width: 1280px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 1.55rem; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 1.1rem; margin: 26px 0 10px; font-weight: 650; }
h3 { font-size: .95rem; margin: 18px 0 8px; font-weight: 650; }
.sub { color: var(--muted); margin-bottom: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .w { font-size: 1.35rem; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
     font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; }
td.nowrap { white-space: nowrap; }
.tabelle { overflow-x: auto; }
.muted { color: var(--muted); }
.klein { font-size: .85rem; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: .75rem; font-weight: 600;
         background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.hoch, .badge.fehler, .badge.storniert, .badge.geloescht, .badge.abgelaufen { background: var(--hoch-bg); color: var(--hoch); border-color: transparent; }
.badge.mittel, .badge.erstellt, .badge.laeuft { background: var(--mittel-bg); color: var(--mittel); border-color: transparent; }
.badge.info, .badge.versendet, .badge.extern { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.ok, .badge.bezahlt, .badge.aktiv { background: var(--akzent-hell); color: var(--ok); border-color: transparent; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; background: var(--akzent-hell); color: var(--akzent); }
.flash.fehler { background: var(--hoch-bg); color: var(--hoch); }
form.inline { display: inline; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
       border-radius: var(--radius); padding: 6px 8px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent-hell); border-color: var(--akzent); }
textarea { width: 100%; min-height: 70px; }
input.num { width: 90px; text-align: right; }
input.datum { width: 140px; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.felder { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.felder input:not([type=checkbox]), .felder select { width: 100%; }
.check { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: .9rem; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text);
               border-radius: var(--radius); padding: 6px 12px; cursor: pointer; display: inline-block; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--akzent); text-decoration: none; }
button.primaer, .btn.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.gefahr { color: var(--hoch); }
button.klein, .btn.klein { padding: 2px 8px; font-size: .8rem; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.befund { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.befund:last-child { border-bottom: none; }
.befund .t { flex: 1; }
.befund form { display: flex; gap: 6px; }
.befund input[name=begruendung] { width: 160px; }
details summary { cursor: pointer; color: var(--akzent); }
details[open] summary { margin-bottom: 8px; }
.domaingruppe td { background: var(--bg); font-weight: 600; }
tr.nachhol td { background: var(--mittel-bg); }
.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.login { max-width: 340px; margin: 12vh auto; }
.login input { width: 100%; margin-bottom: 12px; }
@media (max-width: 720px) { main { padding: 14px 12px 40px; } .befund { flex-direction: column; } }
.flat { margin: 0; }
.top0 { margin-top: 0; }
td input:not(.num):not(.datum):not([type=checkbox]) { width: 140px; }
