/* Praxis-Manager – ruhig, modern, gut lesbar; Desktop mit Seitenleiste, Tablet/Handy mit Leiste oben */

:root {
    --anthrazit: #2b3035;            /* Knöpfe, aktive Elemente */
    --anthrazit-dunkel: #16191c;     /* Hover */
    --anthrazit-hell: #eceef0;       /* leise Flächen, Hover */

    --gold: #c9982a;                 /* Logo-Gold, nur Akzente (Linien, Markierungen) */
    --gold-dunkel: #7a5a0c;          /* Gold für kleine Texte (Kontrast AA) */
    --gold-hell: #f7f1e3;
    --akzent: #c40e5b;               /* Magenta aus dem Logo: Fokus, Ausfall, Dringendes */

    --text: #1f2328;
    --text-leise: #5b6067;
    --linie: #e3e3df;
    --linie-feld: #8f949a;           /* Rand von Eingabefeldern, Kontrast ≥ 3:1 */
    --hintergrund: #f4f4f1;
    --flaeche: #ffffff;
    --flaeche-leise: #f8f8f6;

    --erfolg: #1d6b3b;
    --erfolg-hell: #e7f4ec;
    --fehler: #a3201f;
    --fehler-hell: #fbecec;
    --hinweis-hell: #fbf5e6;
    --blau: #23457a;
    --blau-hell: #e9eff8;

    --radius: 5px;
    --radius-karte: 8px;
    --schatten: 0 1px 2px rgb(16 24 32 / 0.05), 0 2px 8px rgb(16 24 32 / 0.04);
    --schatten-hover: 0 2px 4px rgb(16 24 32 / 0.06), 0 8px 24px rgb(16 24 32 / 0.08);
    --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --seitenleiste: 264px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--hintergrund);
}

h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.85rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.25rem; margin: 2.25rem 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }

a {
    color: var(--text);
    text-decoration-color: var(--gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
a:hover { color: var(--anthrazit-dunkel); text-decoration-color: var(--anthrazit); }

:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

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

.springen {
    position: absolute;
    left: 1rem; top: -4rem;
    padding: 0.5rem 1rem;
    background: var(--flaeche);
    z-index: 20;
}
.springen:focus { top: 1rem; }

.leise { color: var(--text-leise); }
.klein-text { font-size: 0.92rem; }
.abstand-oben { margin-top: 1.25rem; }
.mehrzeilig { white-space: pre-line; }

/* Icons */

.icon {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.2em;
}

/* Knöpfe */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--anthrazit);
    border-radius: var(--radius);
    background: var(--anthrazit);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.knopf:hover { background: var(--anthrazit-dunkel); border-color: var(--anthrazit-dunkel); color: #fff; }
.knopf:active { transform: translateY(1px); }

.knopf--zweitrangig { background: var(--flaeche); color: var(--anthrazit); border-color: #c4c8cc; }
.knopf--zweitrangig:hover { background: var(--anthrazit-hell); border-color: var(--anthrazit); color: var(--anthrazit-dunkel); }

.knopf--leise { background: transparent; border-color: transparent; color: #44494f; font-weight: 500; }
.knopf--leise:hover { background: var(--anthrazit-hell); border-color: transparent; color: var(--text); }

.knopf--gross { min-height: 54px; padding: 0.8rem 1.4rem; font-size: 1.05rem; }
.knopf--klein { min-height: 36px; padding: 0.35rem 0.75rem; font-size: 0.92rem; gap: 0.4rem; }
.knopf--breit { width: 100%; }

.knopfleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.knopfleiste--rechts { justify-content: flex-end; }
.knopfleiste form, .abschluss form, .meldung form { margin: 0; }

/* Symbol-Knopf mit Tooltipp (data-tipp), z. B. in Listen */
.knopf-symbol {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid transparent; border-radius: var(--radius);
    color: #44494f; text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.knopf-symbol:hover { background: var(--anthrazit); border-color: var(--anthrazit); color: #fff; }
.knopf-symbol--leer { visibility: hidden; }
.knopf-symbol[data-tipp]::after {
    content: attr(data-tipp);
    position: absolute; bottom: calc(100% + 6px); left: 50%; z-index: 5;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius);
    background: var(--anthrazit-dunkel); color: #fff;
    font-size: 0.8rem; font-weight: 500; white-space: nowrap;
    opacity: 0; pointer-events: none; transform: translate(-50%, 3px);
    transition: opacity 0.12s, transform 0.12s;
}
.knopf-symbol[data-tipp]:hover::after, .knopf-symbol[data-tipp]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.15s; }
.tabelle td.zeilenaktionen { width: 1%; padding-top: 0.45rem; padding-bottom: 0.45rem; white-space: nowrap; text-align: right; vertical-align: middle; }
.tabelle td.zeilenaktionen a { font-weight: inherit; }
.zeilenaktionen .knopf-symbol + .knopf-symbol { margin-left: 0.15rem; }
/* Letzter Knopf am rechten Rand: Tooltipp rechtsbündig, damit er nicht abgeschnitten wird */
.zeilenaktionen .knopf-symbol:last-child::after { left: auto; right: 0; transform: translateY(3px); }
.zeilenaktionen .knopf-symbol:last-child:hover::after, .zeilenaktionen .knopf-symbol:last-child:focus-visible::after { transform: none; }

@media (pointer: coarse) {
    .knopf--klein { min-height: 44px; }
    .knopf-symbol { width: 44px; height: 44px; }
}

/* App-Rahmen */

.app { min-height: 100vh; }

.seitenleiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 0.75rem 1rem 0;
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
}

.seitenleiste__logo { display: block; line-height: 0; padding: 0.25rem 0; }
.seitenleiste__logo img { height: 42px; width: auto; }
.seitenleiste__aktion { display: none; }

.menue { flex-basis: 100%; }
.menue__liste {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
}
.menue__punkt {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 3px solid transparent;
    color: var(--text-leise);
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
}
.menue__punkt:hover { color: var(--text); }
.menue__punkt[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); font-weight: 650; }
.menue__punkt:focus-visible { outline-offset: -3px; }

.kopfleiste {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
}

.suche { position: relative; flex: 1 1 auto; max-width: 640px; }
.suche__icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--text-leise); line-height: 0; pointer-events: none; }
.suche .suche__feld { padding-left: 2.75rem; background: var(--flaeche-leise); border-color: var(--linie); }
.suche .suche__feld:focus { background: var(--flaeche); border-color: var(--anthrazit); }

.kopfleiste__abmelden { margin-left: auto; }

.inhalt {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.75rem 1rem 4rem;
}

/* Desktop: Seitenleiste links */
@media (min-width: 1100px) {
    .app {
        display: grid;
        grid-template-columns: var(--seitenleiste) minmax(0, 1fr);
    }

    .seitenleiste {
        position: sticky;
        top: 0;
        height: 100vh;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        border-bottom: 0;
        border-right: 1px solid var(--linie);
        overflow-y: auto;
    }
    .seitenleiste__logo { padding: 0 0.5rem 0.5rem; }
    .seitenleiste__logo img { height: 48px; }

    .menue { flex-basis: auto; }
    .menue__liste { flex-direction: column; overflow: visible; }
    .menue__punkt {
        padding: 0.7rem 0.9rem;
        border-bottom: 0;
        border-radius: var(--radius);
    }
    .menue__punkt:hover { background: var(--anthrazit-hell); }
    .menue__punkt[aria-current="page"] {
        background: var(--gold-hell);
        box-shadow: inset 3px 0 0 var(--gold);
    }

    .seitenleiste__aktion { display: inline-flex; margin-top: auto; }

    .kopfleiste {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 0.85rem 2.5rem;
        background: rgb(255 255 255 / 0.92);
        backdrop-filter: blur(6px);
    }

    .inhalt { padding: 2.25rem 2.5rem 5rem; }
}

/* Seitenkopf, Brotkrume, Reiter */

.seitenkopf {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.seitenkopf h1 { margin: 0; }
.seitenkopf__unterzeile { margin: 0.4rem 0 0; }

.brotkrume { margin: 0 0 0.4rem; font-size: 0.92rem; }
.brotkrume a { color: var(--text-leise); text-decoration-color: transparent; }
.brotkrume a:hover { color: var(--text); text-decoration-color: var(--gold); }

.reiter {
    display: flex;
    gap: 0.25rem;
    margin: 0 0 1.75rem;
    border-bottom: 1px solid var(--linie);
    overflow-x: auto;
}
.reiter__punkt {
    padding: 0.7rem 1rem;
    border-bottom: 3px solid transparent;
    color: var(--text-leise);
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
}
.reiter__punkt:hover { color: var(--text); border-bottom-color: var(--linie); }
.reiter__punkt[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); font-weight: 650; }
.reiter__punkt:focus-visible { outline-offset: -3px; }

/* Karten */

.karte {
    margin: 0 0 1rem;
    padding: 1.35rem 1.5rem;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-karte);
    box-shadow: var(--schatten);
}
.karte p { margin: 0 0 0.5rem; }
.karte p:last-child { margin-bottom: 0; }
.karte__titel { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.55rem; font-size: 1.05rem; margin: 0 0 0.75rem; }
.karte__titel .icon {
    width: 1.85rem;
    height: 1.85rem;
    padding: 0.38rem;
    border-radius: var(--radius);
    background: var(--gold-hell);
    color: var(--gold-dunkel);
    stroke-width: 1.8;
}
.karte--dringend .karte__titel .icon { background: #fcebf2; color: var(--akzent); }

.karte--hinweis { border-left: 3px solid var(--gold); }
.karte--dringend { border-left: 3px solid var(--akzent); }
.karte--gedaempft { background: transparent; box-shadow: none; border-style: dashed; color: var(--text-leise); }

.karte--link { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.karte--link:hover { color: inherit; border-color: #c4c8cc; box-shadow: var(--schatten-hover); transform: translateY(-1px); }

.raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.raster .karte { margin: 0; }

.alles-erledigt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    padding: 1.1rem 1.35rem;
    background: var(--erfolg-hell);
    border-radius: var(--radius-karte);
    color: var(--erfolg);
    font-weight: 550;
}

/* Startseite */

/* Immer: Begrüßung links, Datum rechts, darunter über die ganze Breite die Affirmation */
.begruessung { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0.9rem 1rem; margin-bottom: 1.5rem; }
.begruessung h1 { margin: 0; }
.begruessung__datum { margin: 0; text-align: right; }

.affirmation {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 1rem;
    margin: 0; padding: 1rem 1.25rem;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-karte);
    box-shadow: var(--schatten);
    font-size: 1.1rem; font-weight: 500; line-height: 1.4;
}
.affirmation__icon { flex: none; width: 2.6rem; height: 2.6rem; padding: 0.6rem; border-radius: 50%; background: var(--anthrazit); color: var(--gold); stroke-width: 2; }
.affirmation__titel { display: block; margin-bottom: 0.15rem; color: var(--gold-dunkel); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; }

.kennzahlen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.kennzahl {
    display: block;
    padding: 1.1rem 1.25rem;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-karte);
    box-shadow: var(--schatten);
    color: inherit;
    text-decoration: none;
}
a.kennzahl:hover { border-color: #c4c8cc; box-shadow: var(--schatten-hover); color: inherit; }
.kennzahl__titel { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.35rem; color: var(--text-leise); font-size: 0.92rem; font-weight: 550; }
.kennzahl__wert { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.kennzahl__zusatz { margin: 0.2rem 0 0; color: var(--text-leise); font-size: 0.9rem; }
.kennzahl--dringend .kennzahl__wert { color: var(--akzent); }

.start-raster { display: grid; gap: 1.5rem; }
.start-raster h2 { margin-top: 0; }
@media (min-width: 1100px) {
    .start-raster { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
}

.schnellaktionen { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.schnellaktionen .knopf { justify-content: flex-start; }

.kurzliste { list-style: none; margin: 0; padding: 0; }
.kurzliste li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid var(--linie); }
.kurzliste li:first-child { border-top: 0; padding-top: 0; }
.kurzliste .rechts { text-align: right; white-space: nowrap; }

/* Meldungen */

.meldung {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: var(--radius-karte);
}
.meldung__text { flex: 1 1 260px; }
.meldung--erfolg { background: var(--erfolg-hell); border-color: #bfe0cb; border-left-color: var(--erfolg); }
.meldung--erfolg .meldung__icon { color: var(--erfolg); }
.meldung--fehler { background: var(--fehler-hell); border-color: #efc4c4; border-left-color: var(--fehler); }
.meldung--fehler .meldung__icon { color: var(--fehler); }
.meldung--hinweis { background: var(--hinweis-hell); border-color: #ecdcae; border-left-color: var(--gold); }
.meldung--hinweis .meldung__icon { color: var(--gold-dunkel); }

.hinweistext { color: var(--akzent); font-weight: 600; }

/* Listen und Tabellen */

.listenkopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.filter { display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0.25rem; background: var(--anthrazit-hell); border-radius: calc(var(--radius) + 3px); }
.filter__punkt {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    color: var(--text-leise);
    font-weight: 550;
    text-decoration: none;
}
.filter__punkt:hover { color: var(--text); background: rgb(255 255 255 / 0.6); }
.filter__punkt[aria-current="true"] { background: var(--flaeche); color: var(--text); box-shadow: 0 1px 2px rgb(16 24 32 / 0.12); }

.listensuche { display: flex; gap: 0.5rem; flex: 0 1 420px; }
.listensuche input { flex: 1; min-width: 0; }
.listensuche--breit { max-width: 600px; margin-bottom: 1rem; }

.tabelle {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-karte);
    box-shadow: var(--schatten);
    overflow: hidden;
}
.tabelle th, .tabelle td { padding: 0.8rem 1.1rem; text-align: left; vertical-align: top; }
.tabelle th {
    background: var(--flaeche-leise);
    border-bottom: 1px solid var(--linie);
    color: var(--text-leise);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tabelle tbody td { border-top: 1px solid var(--linie); }
.tabelle tbody tr:first-child td { border-top: 0; }
.tabelle tbody tr:hover td { background: #fafaf8; }
.tabelle td a { font-weight: 600; text-decoration-color: transparent; }
.tabelle td a:hover { text-decoration-color: var(--gold); }
.tabelle .zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabelle .rechts { text-align: right; }
.tabelle tr.gedaempft td { color: var(--text-leise); }
.tabelle tr.summenzeile td { border-top: 2px solid var(--linie); background: var(--flaeche-leise); }

.trefferliste { padding-left: 1.25rem; }
.trefferliste li { margin-bottom: 0.5rem; }

/* Markierungen */

.marke {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    background: #eceae5;
    color: var(--text-leise);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: 0.05em;
}
a.marke { text-decoration: none; }
.marke--aktiv, .marke--bezahlt, .marke--angebot-angenommen { background: var(--erfolg-hell); color: var(--erfolg); }
.marke--anfrage, .marke--angebot-neu { background: var(--hinweis-hell); color: var(--gold-dunkel); }
/* Noch zu erledigen (Rechnung nicht gedruckt/versendet, fehlende Unterschrift): Orange mit Punkt, fällt in Listen auf */
.marke--neu { background: #fdeedd; color: #8a4500; }
.marke--neu::before { content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-right: 0.4em; border-radius: 50%; background: #e07b00; vertical-align: 0.1em; }
.marke--verschickt, .marke--angebot-offen { background: var(--blau-hell); color: var(--blau); }
.marke--ueberfaellig { background: #fcebf2; color: #9d0b49; }
.marke--storniert, .marke--angebot-abgelaufen, .marke--angebot-abgelehnt { background: #eceae5; color: var(--text-leise); }

/* Angaben (Detailseiten) */

.angaben {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    gap: 0.55rem 1.25rem;
    margin: 0;
}
.angaben dt { color: var(--text-leise); }
.angaben dd { margin: 0; overflow-wrap: break-word; min-width: 0; }

/* Zeilen mit feiner Trennlinie, feste Spalte für die Bezeichnung */
.angaben--zeilen { grid-template-columns: 11rem minmax(0, 1fr); gap: 0; }
.angaben--zeilen dt, .angaben--zeilen dd { padding: 0.7rem 0; border-top: 1px solid var(--linie); }
.angaben--zeilen dt:first-of-type, .angaben--zeilen dt:first-of-type + dd { border-top: 0; padding-top: 0.1rem; }
.angaben--zeilen dt { padding-right: 1rem; font-size: 0.95rem; }
.angaben--zeilen dd:last-of-type, .angaben--zeilen dt:last-of-type { padding-bottom: 0; }

/* Klient: Übersicht mit zwei gleich breiten Karten, Bemerkung darunter über die ganze Breite */
.klient-uebersicht { display: grid; gap: 1rem; }
.klient-uebersicht .karte { margin: 0; }
@media (min-width: 900px) {
    .klient-uebersicht { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
    .klient-uebersicht__breit { grid-column: 1 / -1; }
}
.sternzeichen {
    display: inline-block; margin-left: 0.35rem; padding: 0.1rem 0.55rem;
    border-radius: 999px; background: var(--anthrazit-hell); color: var(--text-leise);
    font-size: 0.85rem; white-space: nowrap;
}

.papierkorb-knopf { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--linie); }

/* Formulare */

.formular { max-width: 960px; }
.formular--breit { max-width: 1100px; }
.formular fieldset { margin: 0 0 1.25rem; min-width: 0; }

/* Legende als Abschnittstitel innerhalb der Karte (float holt sie aus dem Rahmen in die Fläche) */
.formular fieldset > legend {
    float: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.25rem;
    padding: 0 0 0.85rem;
    border-bottom: 1px solid var(--linie);
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.005em;
}
.formular fieldset > legend + * { clear: both; }
.formular fieldset > legend .icon {
    width: 2rem;
    height: 2rem;
    padding: 0.4rem;
    border-radius: var(--radius);
    background: var(--gold-hell);
    color: var(--gold-dunkel);
    stroke-width: 1.8;
}
.legende__nummer {
    margin-left: auto;
    min-width: 1.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--anthrazit-hell);
    color: var(--text-leise);
    font-size: 0.85rem;
    font-weight: 650;
    text-align: center;
}

/* Mehrere Abschnitte nebeneinander auf breiten Bildschirmen */
@media (min-width: 1200px) {
    .formular--raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; max-width: 1240px; align-items: start; }
    .formular--raster > .knopfleiste, .formular--raster > .formular__voll { grid-column: 1 / -1; }
}

.feld { margin-bottom: 1.1rem; }
.feld label, .feld__titel { display: block; margin: 0 0 0.35rem; font-weight: 600; font-size: 0.97rem; }
.feld__pflicht { color: var(--text-leise); font-weight: 400; font-size: 0.88rem; }
.feld__hilfe { margin: 0.3rem 0 0; color: var(--text-leise); font-size: 0.9rem; }
.feld__fehler { margin: 0.3rem 0 0; color: var(--fehler); font-weight: 600; font-size: 0.95rem; }
.feld--fehler input, .feld--fehler textarea, .feld--fehler select { border-color: var(--fehler); }
.feld--schmal { max-width: 230px; }
.feld--datum { max-width: none; }

input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--linie-feld);
    border-radius: var(--radius);
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--anthrazit); box-shadow: 0 0 0 3px rgb(43 48 53 / 0.14); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
textarea { min-height: auto; resize: vertical; }
input[type="file"] { font: inherit; max-width: 100%; }

.zeile { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.zeile > .feld { flex: 1 1 200px; }
.zeile > .feld--schmal { flex: 0 1 180px; }

.feld--haken { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0 0.75rem; }
.feld--haken input { width: 22px; height: 22px; margin: 0.12rem 0 0; accent-color: var(--anthrazit); }
.feld--haken label { margin: 0; font-weight: 500; }
.feld--haken .feld__hilfe { grid-column: 2; }

.mehr { margin: 0.25rem 0 0.75rem; }
.mehr summary { cursor: pointer; color: var(--text); font-weight: 550; padding: 0.4rem 0; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.mehr[open] summary { margin-bottom: 0.75rem; }
.karte.mehr summary { text-decoration: none; }

.abschluss { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.5rem 0 0.75rem; }
.hinweis-abschluss { margin: 1.5rem 0 0; }

/* Rechnung schreiben */

.empfaenger {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
}

.datum-mit-knopf { display: flex; gap: 0.5rem; align-items: center; max-width: 340px; }
.datum-mit-knopf input { flex: 1; }

/* Formular mit mitlaufender Seitenspalte (Abschluss-Knöpfe) auf breiten Bildschirmen */
.mit-seitenspalte__seite { margin-top: 1.5rem; }
.mit-seitenspalte__seite .hinweis-abschluss { margin-top: 0.5rem; font-size: 0.95rem; }
/* Abschluss-Knöpfe immer untereinander, gleich breit, Symbol und Text linksbündig */
.mit-seitenspalte__seite .abschluss { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0.6rem; max-width: 26rem; }
.mit-seitenspalte__seite .abschluss .knopf {
    flex: none; justify-content: flex-start; gap: 0.7rem;
    min-height: 52px; padding: 0.75rem 1rem;
    font-size: 1rem; text-align: left;
}
.mit-seitenspalte__seite .abschluss .knopf .icon { flex: none; }
@media (min-width: 1200px) {
    .formular.mit-seitenspalte {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 1.75rem;
        max-width: 1340px;
        align-items: start;
    }
    .mit-seitenspalte__seite { position: sticky; top: 6rem; margin-top: 2.6rem; }
    .mit-seitenspalte__seite .abschluss { max-width: none; margin-bottom: 0; }
}

/* Kachel-Labels nicht von der allgemeinen Feld-Label-Regel überschreiben lassen */
.feld .kachelwahl { display: flex; margin: 0; font-weight: 400; font-size: 1rem; }

.kachelauswahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }

.kachelwahl {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 74px;
    padding: 0.8rem 1rem 0.8rem 2.85rem;
    background: var(--flaeche);
    border: 1px solid #cfd2d5;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.kachelwahl input { position: absolute; left: 1rem; top: 1rem; width: 20px; height: 20px; margin: 0; accent-color: var(--anthrazit); }
.kachelwahl__titel { font-weight: 650; }
.kachelwahl__unterzeile { color: var(--text-leise); font-size: 0.92rem; }
.kachelwahl:hover { border-color: var(--anthrazit); }
.kachelwahl:has(input:checked) { border-color: var(--anthrazit); background: var(--gold-hell); box-shadow: inset 0 0 0 1px var(--anthrazit); }
.kachelwahl--ausfall:has(input:checked) { border-color: var(--akzent); background: #fcebf2; box-shadow: inset 0 0 0 1px var(--akzent); }
.kachelwahl--ausfall input { accent-color: var(--akzent); }
.kachelwahl:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 2px; }

.kachelliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.kachel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 74px;
    padding: 0.85rem 1.1rem;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-karte);
    box-shadow: var(--schatten);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.kachel:hover { color: var(--text); border-color: var(--anthrazit); box-shadow: var(--schatten-hover); transform: translateY(-1px); }
.kachel__titel { font-weight: 650; font-size: 1.05rem; }
.kachel__unterzeile { color: var(--text-leise); font-size: 0.92rem; }
.kachel--leise { box-shadow: none; border-style: dashed; }

/* Zahlung, Erinnerung, Verläufe */

.zahlung__felder { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.5rem; }
.zahlung__felder .feld { margin-bottom: 0; }
.zahlungsart { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.zahlungsart legend { float: left; margin-right: 0.5rem; padding: 0; }
.zahlungsart label { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 46px; font-weight: 500; }
.zahlungsart input { width: 20px; height: 20px; accent-color: var(--anthrazit); }

form.schnell { display: inline-block; margin-left: 1rem; }

.zu-erinnern { list-style: none; margin: 0; padding: 0; }
.zu-erinnern li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--linie);
}
.zu-erinnern li:first-child { border-top: 0; padding-top: 0; }
.zu-erinnern form { margin: 0; }

.erinnerung p { margin-bottom: 0.75rem; }
.verlauf { margin: 0; padding-left: 1.1rem; }
.verlauf li { margin-bottom: 0.3rem; }

/* Notizen beim Klienten: links schreiben, rechts der Verlauf (Desktop) */

.notizen { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1200px) {
    .notizen { grid-template-columns: minmax(380px, 2fr) minmax(0, 3fr); }
    .notizen__neu { position: sticky; top: 6rem; }
}
.notizen__neu { max-width: none; }
.notizen__neu fieldset { margin: 0; }
.notizen__ueberschrift { margin: 0 0 1rem; font-size: 1.1rem; }

.notiz { margin-bottom: 1rem; }
.notiz:target { box-shadow: 0 0 0 3px var(--gold-hell), var(--schatten); border-color: var(--gold); }
.notiz__kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0 0 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--linie);
}
.notiz__datum { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--text-leise); font-size: 0.92rem; font-weight: 600; }
.notiz__titel { margin: 0.2rem 0 0; font-size: 1.05rem; }
.notiz__aktionen { gap: 0.4rem; }
.notiz__text { line-height: 1.65; overflow-wrap: anywhere; }
.notiz__geaendert { margin: 0.75rem 0 0; font-size: 0.85rem; }
.notiz--bearbeiten { border-color: var(--anthrazit); }

/* Dokumente */

.dokument__kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; }
.dokument__kopf .leise { margin: 0; }
.dokument--neu { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-hell); }
.dokument__weg { margin-top: 0.5rem; text-align: right; }
.dokument .mehr { margin-top: 0.75rem; }
.dokument .zahlung__felder .feld { flex: 1 1 220px; }

/* Einstellungen */

.vorlagentext { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 0.95rem; line-height: 1.5; }
code { background: #efeee9; padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.92em; }
.platzhalter code { display: inline-block; margin: 0 0.25rem 0.35rem 0; }
.schritte { padding-left: 1.25rem; }
.schritte li { margin-bottom: 0.75rem; }
.qr { display: block; width: 220px; height: 220px; margin: 0.75rem 0; background: #fff; padding: 8px; border: 1px solid var(--linie); border-radius: var(--radius); }
.mit-praefix { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Anmelde- und Fehlerseite */

.seite-anmelden {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background: radial-gradient(1200px 600px at 20% 0%, #fbf6ea 0%, transparent 60%), var(--hintergrund);
}
.anmelden {
    width: min(100% - 2rem, 420px);
    margin: 2rem auto;
    padding: 2.25rem 2rem;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: 12px;
    box-shadow: var(--schatten-hover);
}
.anmelden__logo { display: block; width: 100%; max-width: 290px; height: auto; margin: 0 auto 2rem; }
.fehlerdetails { max-height: 320px; overflow: auto; padding: 1rem; background: #f1f0ec; font-size: 0.8rem; white-space: pre-wrap; }

/* Handy */

@media (max-width: 640px) {
    h1 { font-size: 1.5rem; }
    .nur-breit { display: none; }
    .abschluss .knopf--gross { flex: 1 1 100%; }
    .tabelle th, .tabelle td { padding: 0.7rem 0.75rem; }
    .tabelle td.zeilenaktionen { padding-left: 0; padding-right: 0.3rem; }
    .zeilenaktionen .knopf-symbol { width: 40px; height: 40px; }
    .zeilenaktionen .knopf-symbol + .knopf-symbol { margin-left: 0; }
    .angaben { grid-template-columns: 1fr; gap: 0.1rem; }
    .angaben dd { margin-bottom: 0.6rem; }
    .angaben--zeilen dt { padding: 0.7rem 0 0.1rem; font-size: 0.85rem; }
    .angaben--zeilen dd { margin: 0; padding: 0 0 0.7rem; border-top: 0; }
    .angaben--zeilen dt:first-of-type { padding-top: 0; }
    .sternzeichen { margin: 0.3rem 0 0; }
    .listensuche { flex-basis: 100%; }
    .karte { padding: 1.1rem 1.1rem; }
    .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 1.5rem; }
    .kennzahl { padding: 0.8rem 0.9rem; }
    .kennzahl__titel { font-size: 0.8rem; }
    .kennzahl__wert { font-size: 1.3rem; }
    .kennzahl__zusatz { font-size: 0.8rem; }
    .begruessung { margin-bottom: 1rem; gap: 0.75rem; }
    .begruessung__datum { max-width: 8rem; font-size: 0.85rem; line-height: 1.35; }
    .affirmation { gap: 0.8rem; padding: 0.85rem 1rem; font-size: 1rem; }
    .affirmation__icon { width: 2.2rem; height: 2.2rem; padding: 0.5rem; }
}
