/* Plantafel – Grundstil */

:root {
    --bg: #f4f5f2;
    --surface: #ffffff;
    --ink: #1d2320;
    --ink-quiet: #5b6560;
    --line: #dde1dc;
    --brand: #1f4e5f;
    --ok: #2f7d4f;
    --ok-tint: #e5f2ea;
    --warn: #a66a00;
    --warn-tint: #fbf0dc;
    --fail: #b3362c;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141816;
        --surface: #1c2220;
        --ink: #e8ece9;
        --ink-quiet: #9aa59f;
        --line: #2e3633;
        --brand: #8fc3d4;
        --ok: #5cc184;
        --ok-tint: #1d3326;
        --warn: #e0a640;
        --warn-tint: #3a2e17;
        --fail: #ef7a6f;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.topbar {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    color: var(--brand);
    text-decoration: none;
}

.tagline { color: var(--ink-quiet); font-size: 14px; }

.wrap {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

.hero {
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    margin-bottom: 24px;
}

.hero.is-ok { background: var(--ok-tint); border-color: transparent; }
.hero.is-warn { background: var(--warn-tint); border-color: transparent; }

.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.hero p { margin: 0; color: var(--ink-quiet); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.panel h2 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-quiet);
}

.checks { list-style: none; margin: 0; padding: 0; }

.check {
    display: grid;
    grid-template-columns: 14px 160px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.check:first-child { border-top: 0; }

.dot { width: 12px; height: 12px; border-radius: 50%; }
.check.is-ok .dot { background: var(--ok); }
.check.is-fail .dot { background: var(--fail); }

.label { font-weight: 600; }
.detail { color: var(--ink-quiet); overflow-wrap: anywhere; }
.check.is-fail .detail { color: var(--fail); }

.info { margin: 0; }
.info div {
    display: grid;
    grid-template-columns: 186px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}
.info div:first-child { border-top: 0; }
.info dt { color: var(--ink-quiet); }
.info dd { margin: 0; overflow-wrap: anywhere; }

.next { color: var(--ink-quiet); font-size: 14px; margin-top: 24px; }

.foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--ink-quiet);
    font-size: 13px;
}

a { color: var(--brand); }
.foot a, .next a { text-underline-offset: 2px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 560px) {
    .check { grid-template-columns: 14px 1fr; }
    .check .detail { grid-column: 2; }
    .info div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Seitenkopf mit Anmeldung ---------- */

.kopf-nav {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 16px;
    font-size: 14px;
}
.kopf-nav form { margin: 0; }
.kopf-nav .wer { color: var(--ink-quiet); }
.link-knopf {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.wrap.breit { max-width: 1240px; }

/* ---------- Formulare und Knöpfe ---------- */

.formular { display: grid; gap: 16px; }
.formular label > span:not(.pflicht), .feld-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.formular input[type="text"], .formular input[type="password"], .formular input[type="number"],
.formular input[type="search"], .formular input:not([type]), .formular select, .formular textarea,
.v-werkzeuge input[type="search"] {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.formular textarea { resize: vertical; }
.formular input:focus, .formular select:focus, .formular textarea:focus,
.v-werkzeuge input:focus, .knopf:focus-visible, .v-tabelle tbody tr:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
.pflicht { color: var(--fail); }
.feld-hilfe { display: block; color: var(--ink-quiet); margin-top: 4px; }
.feld-fehler { display: block; color: var(--fail); min-height: 0; }
.feld-fehler:empty { display: none; }
.feld.hat-fehler input, .feld.hat-fehler select, .feld.hat-fehler textarea { border-color: var(--fail); }
.feld-janein label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.feld-nurlesen { color: var(--ink-quiet); font-size: 14px; }
.feld-nurlesen .feld-label { display: inline; margin-right: 8px; }

.auswahl-gruppe { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}
.chip:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }

.knopf {
    padding: 8px 16px;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}
.knopf.haupt { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.knopf:disabled { opacity: 0.6; cursor: default; }

.fehler { color: var(--fail); }
.leise { color: var(--ink-quiet); }

/* ---------- Anmeldung ---------- */

.anmelden {
    max-width: 380px;
    margin: 24px auto 0;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.anmelden h1 { margin: 0 0 16px; font-size: 22px; }
.anmelden .knopf { justify-self: start; }

/* ---------- Verwaltung ---------- */

.verwaltung {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 24px;
    align-items: start;
}
.v-reiter { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.v-reiter-link {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
}
.v-reiter-link:hover { background: var(--surface); }
.v-reiter-link.aktiv { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }

.v-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.v-kopf h1 { margin: 0; font-size: 24px; }
.v-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.v-werkzeuge input[type="search"] { width: 220px; background: var(--surface); }
.v-schalter { font-size: 14px; color: var(--ink-quiet); white-space: nowrap; }

.v-allgemein { max-width: 560px; }
.v-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.v-tabelle-rahmen { padding: 0; overflow-x: auto; }
.v-tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.v-tabelle th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-quiet);
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.v-tabelle td { padding: 10px 16px; border-top: 1px solid var(--line); }
.v-tabelle tbody tr:first-child td { border-top: 0; }
.v-tabelle tbody tr { cursor: pointer; }
.v-tabelle tbody tr:hover td { background: var(--bg); }
.v-tabelle tr.inaktiv td { color: var(--ink-quiet); font-style: italic; }
.v-tabelle td.leer { color: var(--ink-quiet); cursor: default; text-align: center; padding: 28px; }
.v-tabelle td.typ-zahl { font-variant-numeric: tabular-nums; }

.v-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 24px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.v-dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.v-dialog header { margin-bottom: 16px; }
.v-dialog h2 { margin: 0; font-size: 20px; }
.v-dialog-meldung {
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--warn-tint);
    color: var(--ink);
    font-size: 14px;
}

.v-hinweis {
    position: fixed;
    right: 16px;
    bottom: 56px;
    max-width: calc(100vw - 32px);
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--surface);
    font-size: 14px;
    box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);
    transition: opacity 0.6s;
    z-index: 10;
}
.v-hinweis.fehler { background: var(--fail); color: #fff; }
.v-hinweis.weg { opacity: 0; }

@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; }
    .tagline { display: none; }
    .verwaltung { grid-template-columns: 1fr; }
    .v-reiter { position: static; flex-direction: row; flex-wrap: wrap; }
    .v-werkzeuge input[type="search"] { width: 100%; }
    .v-tabelle thead { display: none; }
    .v-tabelle tr { display: block; border-top: 1px solid var(--line); padding: 8px 0; }
    .v-tabelle td { display: flex; gap: 12px; border: 0; padding: 4px 16px; }
    .v-tabelle td::before { content: attr(data-label); min-width: 110px; color: var(--ink-quiet); font-size: 13px; }
    .v-tabelle td.leer::before { content: none; }
}
