:root {
    --hg: #f6f7f9; --flaeche: #fff; --text: #1d2330; --leise: #5c6578; --rand: #d9dde5;
    --primaer: #1f6fd1; --primaer-text: #fff;
    --ok-hg: #e3f4e8; --ok-text: #1b5e31; --warn-hg: #fff3d6; --warn-text: #7a4b00;
    --fehler-hg: #fde6e6; --fehler-text: #8f1d1d;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --hg: #14171d; --flaeche: #1d2129; --text: #e6e9ef; --leise: #9aa3b5; --rand: #343a46;
        --primaer: #5b9bea; --primaer-text: #0b1220;
        --ok-hg: #163a24; --ok-text: #a6e3b8; --warn-hg: #3d2f0d; --warn-text: #f3d28a;
        --fehler-hg: #451a1a; --fehler-text: #f5b5b5;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--hg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--primaer); }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.leise { color: var(--leise); font-size: .92rem; }
.umbruch { white-space: pre-line; }

.kopf { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 10px 16px; background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.marke { font-weight: 700; text-decoration: none; color: var(--text); }
.kopf nav { display: flex; gap: 4px; flex-wrap: wrap; }
.kopf nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.kopf nav a[aria-current] { background: var(--hg); font-weight: 600; }
.ich { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: .92rem; }

.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.schmal { max-width: 480px; }
label { display: grid; gap: 4px; font-weight: 500; }
label.haken { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; color: inherit; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px; padding: 8px 10px; min-width: 0; }
input[type=checkbox] { width: 18px; height: 18px; }
.nebeneinander { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feldfehler { color: var(--fehler-text); margin: -6px 0 0; font-size: .9rem; }

.knopf { display: inline-block; font: inherit; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.knopf.primaer { background: var(--primaer); border-color: var(--primaer); color: var(--primaer-text); }
.knopf:hover { filter: brightness(.95); }
button.link { background: none; border: 0; padding: 0; color: var(--primaer); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }

.titelzeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter input { flex: 1 1 200px; }

.liste { list-style: none; padding: 0; margin: 0; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; }
.zeile { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--rand); }
.zeile:first-child { border-top: 0; }
.zeile-text { flex: 1 1 260px; min-width: 0; }
.zeile-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.antwort, .zeilenformular { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.antwort input { flex: 1 1 200px; }
.zeilenformular input:not([type=checkbox]), .zeilenformular select { flex: 1 1 140px; }
.notiz { font-size: .92rem; font-style: italic; }
.zahl { display: inline-block; min-width: 1.6em; text-align: center; border-radius: 99px; background: var(--rand); font-size: .85rem; padding: 0 6px; }

.badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 99px; background: var(--hg); border: 1px solid var(--rand); vertical-align: 2px; }
.badge-ok, .badge-bestaetigt { background: var(--ok-hg); color: var(--ok-text); border-color: transparent; }
.badge-angefragt, .badge-warnung { background: var(--warn-hg); color: var(--warn-text); border-color: transparent; }
.badge-abgelehnt { background: var(--fehler-hg); color: var(--fehler-text); border-color: transparent; }

.meldung { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.meldung-ok { background: var(--ok-hg); color: var(--ok-text); }
.meldung-warnung { background: var(--warn-hg); color: var(--warn-text); }
.meldung-fehler { background: var(--fehler-hg); color: var(--fehler-text); }

.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 8px; }
.daten dt { color: var(--leise); }
.daten dd { margin: 0; }

.login { max-width: 380px; margin: 8vh auto 0; }
.login h1 { margin-bottom: 0; }

@media (max-width: 560px) {
    .ich { margin-left: 0; width: 100%; }
    .nebeneinander { grid-template-columns: 1fr; }
    .zeile-knoepfe, .zeile-knoepfe form, .zeile-knoepfe .knopf { width: 100%; }
    .knopf { text-align: center; }
}
