/* Such-CMS – Grundlayout */
:root {
    --text: #1f2933;
    --text-leise: #616e7c;
    --flaeche: #ffffff;
    --hintergrund: #f4f6f8;
    --linie: #d9e2ec;
    --akzent: #1f5f8b;
    --akzent-dunkel: #174a6d;
    --hervor: #fff7e0;
    --fehler: #b42318;
    --fehler-hg: #fdecea;
    --ok: #2f6f44;
    --ok-hg: #e6f4ea;
    --hinweis-hg: #fff4d6;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    background: var(--hintergrund);
}

a { color: var(--akzent); }
h1 { font-size: 22px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 0 0 12px; }
code { background: #eef2f6; padding: 1px 5px; border-radius: 3px; }

/* Kopf */
.kopf {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 24px;
    height: 54px;
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
    position: sticky;
    top: 0;
    z-index: 10;
}
.marke { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.hauptnav, .kontonav { display: flex; gap: 4px; }
.kontonav { margin-left: auto; }
.hauptnav a, .kontonav a {
    padding: 7px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-leise);
}
.hauptnav a:hover, .kontonav a:hover { background: var(--hintergrund); color: var(--text); }
.hauptnav a.aktiv, .kontonav a.aktiv { background: #e3edf5; color: var(--akzent-dunkel); font-weight: 600; }

.inhalt { padding: 24px; max-width: 1600px; margin: 0 auto; }
.fuss { padding: 16px 24px 28px; color: var(--text-leise); font-size: 12px; text-align: center; }
.fuss a { color: inherit; }

/* Karten */
.karte {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.karte.schmal { max-width: 420px; margin: 40px auto; }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.spalten > .karte { margin-bottom: 0; }
.spalten + .karte, .spalten + section { margin-top: 18px; }

/* Formulare */
.formular { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; color: var(--text-leise); }
input[type=text], input[type=password], input[type=date], select {
    font: inherit;
    font-weight: 400;
    color: var(--text);
    padding: 7px 9px;
    border: 1px solid #bcccdc;
    border-radius: var(--radius);
    background: #fff;
    width: 100%;
    min-width: 0;
}
input:focus, select:focus { outline: 2px solid #9fc3e0; outline-offset: 0; border-color: var(--akzent); }

.filter-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px 14px;
}
.filter-raster .breit { grid-column: span 2; }
.typen { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.typen legend { font-weight: 600; font-size: 13px; color: var(--text-leise); margin-bottom: 6px; padding: 0; }
label.auswahl { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); margin-top: 10px; }
.typen label.auswahl { margin-top: 0; }
.aktionen { display: flex; gap: 10px; margin-top: 14px; }

.knopf {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--akzent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.knopf:hover { background: var(--akzent-dunkel); }
.knopf.zweitrangig { background: #fff; color: var(--akzent); }
.knopf.zweitrangig:hover { background: #eef4f9; }

.meldung { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; }
.meldung.fehler { background: var(--fehler-hg); color: var(--fehler); }
.meldung.ok { background: var(--ok-hg); color: var(--ok); }
.meldung.hinweis { background: var(--hinweis-hg); }
.hinweis { color: var(--text-leise); }
.klein { font-size: 12px; color: var(--text-leise); font-weight: 400; }
.zurueck { margin: 0 0 8px; }

/* Ergebnis */
.ergebnis-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 12px; flex-wrap: wrap; }
.ergebnis-kopf p { margin: 0; }

.tabelle-rahmen {
    overflow-x: auto;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
}
.karte .tabelle-rahmen { border-radius: 4px; }
.tabelle { border-collapse: collapse; width: 100%; font-size: 13px; }
.tabelle th, .tabelle td { padding: 7px 10px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle th {
    background: #f0f4f8;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.tabelle th a { color: var(--text); text-decoration: none; }
.tabelle th a:hover { color: var(--akzent); }
.tabelle tbody tr:hover { background: #f7fafc; }
.tabelle .zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabelle .nowrap { white-space: nowrap; }
.tabelle td.kontakt { max-width: 240px; overflow-wrap: anywhere; }
.tabelle tr.alt-geloescht td { color: var(--text-leise); background: #fafafa; }
.tabelle tr.hervorgehoben td { background: var(--hervor); }

.marke-typ {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #e3edf5;
    color: var(--akzent-dunkel);
    white-space: nowrap;
}
.marke-typ.typ-0 { background: #ece9f7; color: #4c3f91; }
.marke-typ.typ-2 { background: #fdf0d5; color: #8a5a00; }
.marke-typ.typ-4 { background: #fbe3d4; color: #9a3a0b; }
.marke-typ.typ-5 { background: #eceff1; color: #616e7c; }

.objektnummer {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius);
    background: #e3edf5;
    color: var(--akzent-dunkel);
    font-size: 16px;
    white-space: nowrap;
}

.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-aktiv { background: var(--ok-hg); color: var(--ok); }
.status-geloescht { background: var(--fehler-hg); color: var(--fehler); }
.status-gesperrt { background: #fdf0d5; color: #8a5a00; }

.gesamt {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    align-items: center;
    margin: -6px 0 16px;
    color: var(--text-leise);
}
.gesamt strong { color: var(--text); font-size: 15px; }

.knopf-gruppe { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.knopf.klein-knopf { padding: 4px 10px; font-size: 12px; }
.knopf.gefahr { background: #fff; color: var(--fehler); border-color: var(--fehler); }
.knopf.gefahr:hover { background: var(--fehler-hg); }
textarea { font: inherit; padding: 7px 9px; border: 1px solid #bcccdc; border-radius: var(--radius); width: 100%; min-height: 90px; resize: vertical; }
.formular-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.formular-raster .breit { grid-column: 1 / -1; }
.tabelle td form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tabelle td form input[type=text], .tabelle td form input[type=date] { width: auto; min-width: 90px; padding: 4px 6px; }
.tabelle td form textarea { min-height: 34px; width: 220px; padding: 4px 6px; }
.ja { color: var(--ok); font-weight: 600; }
.nein { color: var(--text-leise); }

.blaettern { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 14px 0; }

.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.daten dt { color: var(--text-leise); }
.daten dd { margin: 0; }
.notiz { white-space: normal; max-height: 360px; overflow: auto; }
.merkmal-liste { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.merkmal-liste span { background: #eef2f6; padding: 2px 9px; border-radius: 10px; font-size: 12px; }

@media (max-width: 700px) {
    .kopf { gap: 12px; padding: 0 12px; height: auto; min-height: 54px; flex-wrap: wrap; }
    .kontonav { margin-left: 0; }
    .inhalt { padding: 14px; }
    .filter-raster .breit { grid-column: auto; }
}
