/* Kontor - Erscheinungsbild.
   Angelehnt an die gewohnte Buerosoftware: dunkelblaue Menue- und
   Funktionsleiste, Navigationsbereich links als Akkordeon, Rasterlisten mit
   gruener Markierung, Knoepfe mit sichtbarer F-Taste, Statusleiste in der
   Farbe des Mandanten. Eigene Farben und Symbole, keine fremde Marke. */

:root {
  --blau-dunkel: #15336b;
  --blau: #1f4e8c;
  --blau-hell: #2f6db3;
  --blau-text: #2a5ea8;
  --grau-rahmen: #b9c2cc;
  --grau-flaeche: #eceef1;
  --grau-kopf: #dde2e8;
  --markiert: #6aa84f;
  --schrift: "Segoe UI", Tahoma, Arial, sans-serif;
  --text: #1d2329;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 12px var(--schrift); color: var(--text); background: #fff; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }

#programm {
  height: 100vh; display: grid;
  grid-template-columns: 196px 1fr;
  grid-template-rows: auto auto 1fr 22px;
  grid-template-areas: "menue menue" "funktion funktion" "nav arbeit" "status status";
}
body.abgemeldet #programm { filter: grayscale(.6) opacity(.5); }

/* --- Menueleiste ------------------------------------------------------- */
#menueleiste { grid-area: menue; background: var(--blau-dunkel); display: flex; flex-wrap: wrap; padding: 0 4px; }
#menueleiste .mm { background: none; border: 0; color: #fff; text-transform: uppercase; font-size: 11px; padding: 4px 8px; cursor: pointer; letter-spacing: .02em; }
#menueleiste .mm:hover { background: rgba(255, 255, 255, .15); }

/* --- Funktionsleiste --------------------------------------------------- */
#funktionsleiste { grid-area: funktion; display: flex; align-items: center; gap: 4px; padding: 5px 8px; background: linear-gradient(#1f4b8a, #163a70); border-bottom: 1px solid #0d2650; }
.logo { color: #fff; font-weight: 800; font-style: italic; font-size: 19px; letter-spacing: .04em; width: 178px; text-transform: uppercase; }
.fl-knopf { background: linear-gradient(#fdfdfd, #dfe4ea); border: 1px solid #7e8ea3; border-radius: 3px; height: 26px; min-width: 26px; padding: 0 8px; cursor: pointer; font-size: 14px; }
.fl-knopf:hover { background: #fff; }
.fl-neu { font-size: 12px; }
.fl-suche { display: flex; align-items: center; gap: 0; margin-left: 10px; background: #fff; border: 1px solid #7e8ea3; border-radius: 3px; height: 26px; }
.fl-lupe { padding: 0 6px; font-size: 16px; color: var(--blau); }
.fl-suche select { border: 0; border-left: 1px solid #ccd; border-right: 1px solid #ccd; height: 24px; font-style: italic; background: #f6f8fa; }
.fl-suche input { border: 0; height: 24px; width: 240px; padding: 0 6px; outline: none; }
.fl-frei { flex: 1; }

/* --- Navigationsbereich ------------------------------------------------ */
#navigation { grid-area: nav; background: var(--grau-flaeche); border-right: 1px solid var(--grau-rahmen); overflow-y: auto; display: flex; flex-direction: column; }
.nv-gruppe { text-align: left; border: 0; border-bottom: 1px solid #c4ccd6; background: var(--grau-kopf); color: var(--blau-text); text-transform: uppercase; font-size: 11px; padding: 7px 10px; cursor: pointer; }
.nv-gruppe:hover { background: #e8ecf1; }
.nv-gruppe.offen { background: var(--blau-dunkel); color: #fff; }
.nv-eintraege { display: flex; flex-direction: column; padding: 6px 0; background: #f4f5f7; }
.nv-eintrag { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 8px 4px; cursor: pointer; color: var(--text); font-size: 11px; }
.nv-eintrag:hover:not(:disabled) { background: #e3e9f1; }
.nv-eintrag.aktiv { background: #fff; box-shadow: inset 3px 0 0 var(--blau-hell); }
.nv-eintrag.spaeter { opacity: .42; cursor: default; }
.nv-symbol svg { width: 34px; height: 34px; display: block; }

/* --- Arbeitsbereich ---------------------------------------------------- */
#arbeit { grid-area: arbeit; overflow: hidden; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* --- Statusleiste ------------------------------------------------------ */
#statusleiste { grid-area: status; background: var(--blau); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; font-size: 11px; }

/* --- Rasterliste ------------------------------------------------------- */
.raster { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 6px 8px 0; }
.r-titel { color: var(--blau-text); text-transform: uppercase; font-size: 13px; padding: 2px 0 6px; }
.r-gefiltert { color: #8a5a00; text-transform: none; font-size: 11px; }
.r-suchzeile { display: flex; gap: 24px; align-items: center; padding-bottom: 4px; }
.r-suchzeile label { display: flex; align-items: center; gap: 6px; }
.r-suche { width: 170px; height: 21px; border: 1px solid var(--grau-rahmen); padding: 0 4px; }
.r-spaltenwahl { height: 21px; border: 1px solid var(--grau-rahmen); }
.r-buchstaben { display: flex; gap: 1px; padding: 2px 0 4px; flex-wrap: wrap; }
.r-buchstaben button { border: 1px solid transparent; background: none; padding: 1px 6px; cursor: pointer; color: var(--blau-text); font-size: 11px; }
.r-buchstaben button:hover { border-color: var(--grau-rahmen); }
.r-buchstaben button.aktiv { background: #c9daf3; border-color: #8aa9d6; color: var(--text); }
.r-gruppenfeld { border: 1px solid #d3d8de; background: #f2f4f6; padding: 5px 8px; min-height: 28px; display: flex; gap: 6px; align-items: center; color: #6c7682; }
.r-gruppenfeld.ziel { background: #e2ecf9; border-color: var(--blau-hell); }
.r-gruppenmarke { background: #fff; border: 1px solid #9aa8b8; padding: 1px 4px 1px 8px; color: var(--text); display: inline-flex; gap: 4px; align-items: center; }
.r-gruppenmarke button { border: 0; background: none; cursor: pointer; color: #888; }
.r-tabelle { position: relative; flex: 1; min-height: 80px; display: flex; flex-direction: column; border: 1px solid var(--grau-rahmen); border-top: 0; }
.r-kopf, .r-filterzeile { overflow: hidden; flex: none; background: #f3f4f6; border-bottom: 1px solid var(--grau-rahmen); }
.r-zeileninnen { display: flex; width: max-content; }
.r-kz { position: relative; padding: 3px 18px 3px 5px; font-weight: 600; border-right: 1px solid #d6dbe0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; user-select: none; flex: none; }
.r-kz.rechts { text-align: right; }
.r-kz:hover { background: #e7ebef; }
.kz-sort { margin-left: 4px; font-size: 9px; color: var(--blau-hell); }
.kz-filter { position: absolute; right: 5px; top: 3px; font-size: 10px; color: #9aa3ad; visibility: hidden; }
.r-kz:hover .kz-filter, .kz-filter.aktiv { visibility: visible; }
.kz-filter.aktiv { color: var(--blau-hell); }
.kz-greifer { position: absolute; right: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; }
.r-filterzeile .r-fz { flex: none; height: 21px; border: 0; border-right: 1px solid #d6dbe0; background: #fbfbfc; padding: 0 4px; outline: none; }
.r-filterzeile .r-fz:focus { background: #fffbe0; }
.r-filterzeile[hidden] { display: none; }
.r-koerper { position: relative; flex: 1; overflow: auto; outline: none; background: #fff; }
.r-platz { position: relative; }
.r-zeile, .r-gruppe { position: absolute; left: 0; height: 22px; display: flex; align-items: center; width: max-content; min-width: 100%; }
.r-zeile.ungerade { background: #f7f8f9; }
.r-zeile:hover { background: #eef3fa; }
.r-zeile.markiert, .r-koerper:focus .r-zeile.markiert { background: var(--markiert); color: #fff; }
.r-koerper:not(:focus) .r-zeile.markiert { background: #8bbf73; }
.r-zeile.archiviert { color: #8d96a0; font-style: italic; }
.r-zeile.kategorie { font-style: italic; text-decoration: underline; }
.r-zeile.k1 { color: #b0322b; } .r-zeile.k2 { color: #1f7a37; } .r-zeile.k3 { color: #2f5fa8; } .r-zeile.k4 { color: #8a5a00; }
.r-zeile.k5 { color: #7b3fa0; } .r-zeile.k6 { color: #0f7f86; } .r-zeile.k7 { color: #c25d00; } .r-zeile.k8 { color: #555; }
.r-zeile.markiert.kategorie { color: #fff; }
.r-zelle { flex: none; padding: 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-zelle.rechts, .r-sz.rechts { text-align: right; }
.r-gruppe { background: #e9edf2; font-weight: 600; cursor: pointer; border-bottom: 1px solid #d0d6dd; }
.rg-klapp { display: inline-block; width: 16px; color: var(--blau-hell); }
/* Die Gruppenueberschrift bleibt links stehen, auch wenn seitlich geblaettert wird. */
.rg-text { position: sticky; left: 0; white-space: nowrap; }
.r-leer { position: absolute; top: 60px; left: 0; right: 0; text-align: center; color: #8d96a0; }
.r-leer[hidden] { display: none; }
.r-summen { overflow: hidden; border: 1px solid var(--grau-rahmen); border-top: 0; background: #f3f4f6; font-weight: 600; flex: none; }
.r-sz { flex: none; padding: 3px 5px; white-space: nowrap; overflow: hidden; }
.r-knoepfe { display: flex; justify-content: space-between; padding: 6px 0; flex: none; }
.rk-links, .rk-rechts { display: flex; gap: 6px; }
.r-detail { flex: 0 0 38%; min-height: 160px; border-top: 2px solid var(--grau-rahmen); display: flex; flex-direction: column; overflow: hidden; }
.r-detail[hidden] { display: none; }
.r-detailinhalt { flex: 1; overflow: auto; padding: 10px; }
.raster.mitdetail .r-tabelle { min-height: 120px; }

/* Schnellansicht im Detailbereich */
.schnell { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.sa-name { color: var(--blau-text); font-size: 16px; }
.sa-grau { color: #7a838d; white-space: pre-line; margin-top: 2px; }
.sa-mitte div { margin-bottom: 4px; }
.sa-hinweis { color: #7a838d; font-style: italic; text-align: right; }

/* --- Knoepfe mit F-Taste ---------------------------------------------- */
.fknopf { display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 9px 0 3px; border: 1px solid #8e9aab; border-radius: 3px; background: linear-gradient(#ffffff, #e3e8ee); cursor: pointer; white-space: nowrap; }
.fknopf:not(:has(.ftaste)) { padding-left: 9px; }
.fknopf:hover:not(:disabled) { background: linear-gradient(#ffffff, #eef3f8); border-color: var(--blau-hell); }
.fknopf:disabled { opacity: .5; cursor: default; }
.fknopf.primaer { border-color: #2f5fa8; }
.fknopf.gedrueckt { background: #d7e3f3; border-color: var(--blau-hell); }
.ftaste { display: inline-block; background: var(--blau); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 3px; min-width: 24px; text-align: center; }
.fknopf .pfeil { font-size: 10px; color: #555; }

/* --- Menues ------------------------------------------------------------- */
.menue { position: fixed; z-index: 1000; background: #fff; border: 1px solid #98a3b0; box-shadow: 2px 3px 8px rgba(0, 0, 0, .25); padding: 2px 0; min-width: 210px; }
.menue-eintrag { position: relative; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; padding: 4px 10px 4px 2px; cursor: pointer; white-space: nowrap; }
.menue-eintrag:hover { background: #dce7f6; }
.menue-eintrag.aus { color: #a0a7af; cursor: default; }
.menue-eintrag.aus:hover { background: none; }
.menue-eintrag.fett .me-text { font-weight: 700; }
.me-haken { text-align: center; color: var(--blau); }
.me-taste { color: #6c7682; padding-left: 22px; font-size: 11px; }
.menue-trenner { height: 1px; background: #dfe3e8; margin: 3px 4px 3px 24px; }
.untermenue { display: none; position: absolute; left: 100%; top: -3px; }
.menue-eintrag.hatunter:hover > .untermenue { display: block; }

/* --- Fenster ------------------------------------------------------------ */
.fensterhuelle { position: fixed; inset: 0; z-index: 500; background: rgba(20, 30, 45, .28); display: flex; align-items: center; justify-content: center; }
.fenster { background: #f6f7f9; border: 1px solid #6f7f94; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); display: flex; flex-direction: column; max-width: 96vw; max-height: 94vh; width: 640px; }
.fenstertitel { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(#e5edf8, #cfdcee); border-bottom: 1px solid #9fb0c6; padding: 4px 6px 4px 10px; }
.ft-text { font-weight: 600; }
.ft-zu { border: 1px solid transparent; background: none; cursor: pointer; font-size: 12px; width: 26px; height: 20px; }
.ft-zu:hover { background: #d9534f; color: #fff; }
.fensterkoerper { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; min-height: 0; }
.fensterfuss { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-top: 1px solid #cfd5dc; background: #eceef1; }
.ff-links, .ff-rechts { display: flex; gap: 6px; }

.reiterleiste { display: flex; gap: 2px; border-bottom: 1px solid #a9b4c1; flex: none; flex-wrap: wrap; }
.reiter { border: 1px solid #a9b4c1; border-bottom: 0; background: linear-gradient(#f8f9fa, #e2e6eb); padding: 4px 10px; cursor: pointer; margin-bottom: -1px; }
.reiter.aktiv { background: #fff; border-bottom: 1px solid #fff; font-weight: 600; }
.reiterleiste.klein .reiter { padding: 2px 9px; font-size: 11px; }
.reiterinhalt { background: #fff; border: 1px solid #a9b4c1; border-top: 0; padding: 10px; flex: 1; overflow: auto; }
.reiterinhalt[hidden] { display: none !important; }

/* --- Formulare ---------------------------------------------------------- */
.gruppe { border: 1px solid #c8d0d9; border-radius: 3px; margin: 0 0 10px; padding: 6px 10px 8px; min-width: 0; }
.gruppe legend { color: #3b4a5c; padding: 0 4px; }
.feldzeile { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 6px; }
.feld { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.feld.schmal { flex: 0 0 90px; }
.feld.weit { flex: 1 1 100%; }
.feld.ohnetitel > .beschriftung { display: none; }
.beschriftung { color: #3b4a5c; font-size: 11px; }
.beschriftung.pflicht { font-weight: 700; }
.feld input, .feld select, .feld textarea { width: 100%; border: 1px solid #b4bec9; border-radius: 2px; background: #fff; padding: 3px 5px; min-height: 23px; }
.feld textarea { resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: none; border-color: var(--blau-hell); box-shadow: 0 0 0 2px rgba(47, 109, 179, .18); background: #fffef2; }
.feld input:disabled, .feld select:disabled { background: #f0f2f4; color: #6c7682; }
.feld .rechts { text-align: right; }
.fehlerhaft { border-color: #c0392b !important; background: #fff1f0 !important; }
.mitneben { display: flex; gap: 8px; align-items: center; }
.mitneben > input, .mitneben > select { flex: 1; }
.hakenfeld { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.gruppentext { color: #3b4a5c; font-size: 11px; }
.verweis { color: var(--blau-hell); white-space: nowrap; font-size: 11px; }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spalte { min-width: 0; }
.maskenkopf { display: flex; align-items: flex-end; gap: 30px; background: #eef1f4; border: 1px solid #d3d9e0; padding: 6px 10px; margin-bottom: 10px; }
.artwahl { display: flex; gap: 16px; padding-bottom: 4px; }
.hinweisblock { color: #6c7682; font-style: italic; padding: 18px; text-align: center; }
.absatz { margin-bottom: 10px; line-height: 1.45; }
.adressvorschau { white-space: pre-line; color: #6c7682; min-height: 60px; }

/* kleine Listen in Masken */
.kleinliste { display: flex; flex-direction: column; gap: 6px; }
.kl-tabelle { border: 1px solid #b4bec9; min-height: 140px; max-height: 320px; overflow: auto; background: #fff; }
.kl-kopf, .kl-zeile { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 3px 6px; }
.kl-kopf { background: #f3f4f6; font-weight: 600; border-bottom: 1px solid #c8d0d9; }
.kl-zeile { cursor: pointer; }
.kl-zeile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-zeile.markiert { background: var(--markiert); color: #fff; }
.kl-leer { color: #8d96a0; padding: 20px; text-align: center; }
.kl-knoepfe { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }

/* Rueckfragen */
.fenster.klein .fensterkoerper { padding: 14px 16px; }
.fragetext { display: flex; gap: 14px; align-items: flex-start; white-space: pre-line; line-height: 1.45; }
.frage-symbol { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--blau-hell); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.frage-symbol.fehler { background: #c0392b; }

/* Anmeldung */
.anmeldekopf { display: flex; gap: 18px; align-items: center; padding: 6px 4px 4px; }
.anmeldeschluessel { font-size: 46px; filter: grayscale(.3); }
.anmeldefelder { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.anmeldefelder .feld { flex-direction: row; align-items: center; }
.anmeldefelder .beschriftung { flex: 0 0 110px; font-weight: 700; font-size: 12px; }
.anmeldefehler { color: #b0322b; min-height: 18px; padding: 6px 4px 0; }

/* Lieferbedingungen u. Ae.: Liste links, Felder rechts */
.wahlliste { border: 1px solid #b4bec9; background: #fff; min-height: 220px; overflow: auto; }
.wl-eintrag { padding: 4px 8px; cursor: pointer; }
.wl-eintrag.aktiv { background: var(--markiert); color: #fff; }

/* Notizen */
.notizen { display: flex; flex-wrap: wrap; gap: 10px; }
.notiz { position: relative; background: #fff7b8; border: 1px solid #e4d779; width: 240px; padding: 6px 8px 8px; box-shadow: 1px 2px 3px rgba(0, 0, 0, .08); }
.nz-kopf { display: flex; justify-content: space-between; color: #6b5f17; font-size: 11px; margin-bottom: 4px; }
.nz-text { font-weight: 600; white-space: pre-wrap; }
.nz-weg { position: absolute; right: 2px; bottom: 2px; border: 0; background: none; color: #a99a3c; cursor: pointer; }
.notizfeld textarea { background: #fff7b8; }

.tastentabelle td { padding: 3px 8px; }
.suchliste { flex: 1; display: flex; min-height: 0; }
.fensterkoerper.spalten { display: flex; flex-direction: column; }

/* --- Artikelmaske ------------------------------------------------------- */
.maskenkopf.viersp { display: grid; grid-template-columns: 1fr 1fr 1fr 2fr; gap: 12px; align-items: end; }
.feld.schmal.breiter { flex: 0 0 140px; }
.feldhinweis { color: #6c7682; font-size: 11px; font-style: italic; margin: 4px 0 8px; line-height: 1.4; }
.preistabelle { display: flex; flex-direction: column; border: 1px solid #b4bec9; background: #fff; }
.pt-zeile { display: grid; grid-template-columns: 2fr 1fr 100px 120px 120px 28px; gap: 6px; align-items: center; padding: 3px 6px; border-top: 1px solid #eef0f3; }
.pt-zeile.kopf { background: #f3f4f6; font-weight: 600; border-top: 0; }
.pt-zeile.standard { background: #f8fbff; }
.pt-zeile input { border: 1px solid #c7cfd8; border-radius: 2px; padding: 2px 5px; min-height: 22px; width: 100%; }
.pt-zeile input.rechts, .kft-zeile input.rechts, .inlinefeld input.rechts { text-align: right; }
.kundenwahl { text-align: left; border: 1px solid #c7cfd8; background: linear-gradient(#fff, #eef1f4); border-radius: 2px; padding: 2px 6px; min-height: 22px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kundenwahl:disabled { cursor: default; color: #3b4a5c; background: #f7f8fa; }
.d-weg { border: 0; background: none; color: #a3adb8; cursor: pointer; font-size: 14px; }
.d-weg:hover { color: #b23; }
.kl-knoepfe.links { justify-content: flex-start; margin-top: 6px; }

/* --- Pflegefenster (Liefer-/Zahlungsbedingungen) ------------------------ */
.pflege { display: grid; grid-template-columns: 240px 1fr; gap: 14px; margin-bottom: 10px; }
.pflege-links { display: flex; flex-direction: column; gap: 8px; }
.pflege-links .wahlliste { min-height: 170px; }
.pflege-rechts { display: flex; flex-direction: column; gap: 8px; }
/* Im Spaltenfluss darf ein Feld nicht in die Hoehe wachsen. */
.pflege-rechts > .feld, .pflege-rechts > .textreiter { flex: none; }
.wl-kopf { background: #f3f4f6; border-bottom: 1px solid #c8d0d9; padding: 3px 8px; font-weight: 600; }
.satzzeile { display: flex; align-items: center; gap: 6px; }
.inlinefeld input { border: 1px solid #b4bec9; border-radius: 2px; padding: 2px 5px; min-height: 22px; }
.mahnteil-zb { display: grid; grid-template-columns: 1fr 230px; gap: 16px; align-items: start; }
.mahnraster { display: grid; grid-template-columns: auto 64px 1fr; gap: 5px 8px; align-items: center; }
.textreiter { display: flex; flex-direction: column; }
.textreiter-inhalt { border: 1px solid #a9b4c1; border-top: 0; padding: 6px; background: #fff; }
.textreiter-inhalt textarea { width: 100%; border: 1px solid #c7cfd8; padding: 4px; resize: vertical; }
.gruppe[hidden] { display: none; }

/* --- Konfiguration (Meine Firma) --------------------------------------- */
.fenster.konfiguration .fensterkoerper { padding: 0; }
.kf { display: grid; grid-template-columns: 130px 1fr; height: 100%; min-height: 0; }
.kf-leiste { display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; background: #fff; border-right: 1px solid #c8d0d9; overflow-y: auto; }
.kf-symbol { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid transparent; background: none; padding: 8px 4px; cursor: pointer; font-size: 11px; color: var(--text); }
.kf-symbol:hover { background: #eef3fa; }
.kf-symbol.aktiv { border-color: #8aa9d6; background: #e2ecf9; }
.kf-bild svg { width: 38px; height: 38px; display: block; }
.kf-rechts { overflow-y: auto; padding: 10px 14px 14px; background: #f1f3f6; min-height: 0; }
.kf-titel { color: var(--blau-hell); font-size: 20px; margin-bottom: 10px; }
.kf-seite[hidden] { display: none; }
.kf-abschnitt { margin-bottom: 8px; background: #fff; border: 1px solid #c8d0d9; }
.kf-abschnitt-kopf { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: var(--blau); color: #fff; font-weight: 600; padding: 4px 10px; cursor: pointer; text-align: left; }
.kf-abschnitt-kopf:hover { background: var(--blau-hell); }
.kf-abschnitt-inhalt { display: none; padding: 10px; }
.kf-abschnitt.offen .kf-abschnitt-inhalt { display: block; }
.gruppe.ohnerahmen { border: 0; padding: 0; margin: 0 0 6px; }
.kf-tabelle { display: flex; flex-direction: column; border: 1px solid #b4bec9; }
.kft-zeile { display: grid; grid-template-columns: var(--kft-spalten); gap: 6px; align-items: center; padding: 3px 6px; border-top: 1px solid #eef0f3; }
.kft-zeile.kopf { background: #f3f4f6; font-weight: 600; border-top: 0; }
.kft-zeile input[type=text] { border: 1px solid #c7cfd8; border-radius: 2px; padding: 2px 5px; min-height: 22px; width: 100%; }
.kft-zeile .mitte { text-align: center; }
.kf-beispiel { color: #1f7a37; font-weight: 600; }
/* --- Belege ------------------------------------------------------------- */
.st.gelb { color: #d9a400; } .st.gruen { color: #2e8b3e; } .st.rot { color: #c62d2d; } .st.schwarz { color: #222; } .st.grau { color: #9aa3ad; } .st.blau { color: #2f6db3; }
.r-zelle.st { text-align: center; font-size: 13px; }
.r-zeile.markiert .r-zelle.st { color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.4); }
.symbolerklaerung { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 6px; font-size: 11px; color: #3b4a5c; border: 1px solid var(--grau-rahmen); border-top: 0; background: #fafbfc; }
.fenster.belegfenster .fensterkoerper { padding: 6px 8px; }
.fenster.belegfenster .reiterinhalt { padding: 8px; display: flex; flex-direction: column; min-height: 0; }
.belegkopf { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; }
.belegkopf .gruppe { margin-bottom: 6px; }
.belegkunde .kundennr { font-weight: 700; color: var(--blau-text); margin-right: 14px; }
.belegdaten .feldzeile { margin-bottom: 4px; }
.positionen { display: flex; flex-direction: column; flex: 1; min-height: 160px; }
.werkzeugleiste { display: flex; gap: 4px; align-items: center; padding: 4px 0; flex-wrap: wrap; }
.werkzeugleiste .wz { border: 1px solid #a9b4c1; background: linear-gradient(#fff, #e9edf1); border-radius: 3px; padding: 2px 8px; cursor: pointer; font-size: 11px; }
.werkzeugleiste .wz:hover:not(:disabled) { border-color: var(--blau-hell); }
.werkzeugleiste .wz:disabled { opacity: .45; cursor: default; }
.werkzeugleiste .fl-frei { flex: 1; }
.preisart-wahl { font-size: 11px; display: flex; gap: 4px; align-items: center; }
.postabelle-huelle { flex: 1; overflow: auto; border: 1px solid #b4bec9; background: #fff; min-height: 120px; }
.postabelle { width: 100%; border-collapse: collapse; table-layout: fixed; }
.postabelle th { position: sticky; top: 0; z-index: 1; background: #f3f4f6; border-bottom: 1px solid #c8d0d9; font-size: 11px; text-align: left; padding: 3px 4px; }
.postabelle th:nth-child(1) { width: 34px; } .postabelle th:nth-child(2) { width: 104px; } .postabelle th:nth-child(3) { width: 70px; }
.postabelle th:nth-child(4) { width: 56px; } .postabelle th:nth-child(5) { width: 90px; }
.postabelle:not(.ohnepreis) th:nth-last-child(5) { width: 96px; } .postabelle:not(.ohnepreis) th:nth-last-child(4) { width: 62px; }
.postabelle:not(.ohnepreis) th:nth-last-child(3) { width: 90px; } .postabelle:not(.ohnepreis) th:nth-last-child(2) { width: 66px; }
.postabelle:not(.ohnepreis) th:nth-last-child(1) { width: 96px; }
.postabelle td { border-bottom: 1px solid #eef0f3; padding: 2px 3px; vertical-align: top; }
.postabelle td.r { text-align: right; padding-top: 5px; white-space: nowrap; }
.postabelle td.gesamt { font-weight: 600; }
.postabelle td.p-nr { color: #6c7682; padding-top: 5px; text-align: center; }
.postabelle input, .postabelle select, .postabelle textarea { width: 100%; border: 1px solid transparent; background: transparent; padding: 2px 3px; font: inherit; min-height: 22px; border-radius: 2px; }
.postabelle input:focus, .postabelle select:focus, .postabelle textarea:focus { border-color: var(--blau-hell); background: #fffef2; outline: none; }
.postabelle input.rechts { text-align: right; }
.postabelle textarea { resize: none; overflow: hidden; line-height: 1.35; }
.postabelle tr.markiert td { background: #eef5ec; }
.postabelle tr.p-ueberschrift textarea { font-weight: 700; }
.postabelle tr.p-alternative td { color: #6c7682; font-style: italic; }
.postabelle tr.p-zwischensumme td, .postabelle tr.p-trenner td, .postabelle tr.p-seitenumbruch td { background: #f7f8fa; }
.postabelle tr.weiter td.p-nr { color: #2e8b3e; font-weight: 700; }
.postabelle input:disabled, .postabelle select:disabled, .postabelle textarea:disabled { color: #3b4a5c; }
.postabelle .leerzeile { border: 0; background: none; color: #8d96a0; cursor: pointer; padding: 4px; font-style: italic; text-align: left; width: 100%; }
.postabelle .leerzeile:hover { color: var(--blau-hell); }
.belegsummen { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.summenkasten { background: #e7eef8; border: 1px solid #b6c7e0; padding: 4px 12px; display: flex; gap: 10px; align-items: baseline; }
.summenkasten b { font-size: 14px; }
.belegstatus { flex: 1 1 100%; order: -1; font-size: 12px; padding-bottom: 6px; }
.belegfenster .fensterfuss { flex-wrap: wrap; }
.belegstatus .fest { color: #2e8b3e; } .belegstatus .offen { color: #1d2329; }
.druckrahmen { flex: 1; width: 100%; min-height: 60vh; border: 1px solid #b4bec9; background: #e9ecef; }
.feldhinweis.warnung { color: #b05a00; font-style: normal; }
.auswahl-gruppe { border: 1px solid #c8d0d9; padding: 8px 10px; margin-bottom: 10px; background: #fff; }
.auswahl-titel { font-weight: 700; color: var(--blau-text); margin-bottom: 6px; }
.auswahl-option { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.teiltabelle, .detailtabelle { width: 100%; border-collapse: collapse; background: #fff; }
.teiltabelle th, .detailtabelle th { text-align: left; background: #f3f4f6; border-bottom: 1px solid #c8d0d9; padding: 3px 6px; font-size: 11px; }
.teiltabelle td, .detailtabelle td { padding: 3px 6px; border-bottom: 1px solid #eef0f3; }
.teiltabelle td.r, .detailtabelle td.r { text-align: right; }
.teiltabelle input { width: 90px; border: 1px solid #b4bec9; padding: 2px 4px; text-align: right; }
.teiltabelle tr.erledigt td { color: #9aa3ad; }
.kette div { padding: 3px 0; }
.sa-rechts { text-align: right; }
.sa-betrag { font-size: 17px; font-weight: 700; }
.sa-betrag.blau { color: var(--blau-hell); } .sa-betrag.rot { color: #c62d2d; }
.sa-grau.rechtsb { margin-bottom: 6px; }
.detailtabelle tr.klickbar { cursor: pointer; } .detailtabelle tr.klickbar:hover td { background: #eef3fa; }
/* --- Zahlungen Bank/Kasse und Offene Posten ------------------------------ */
.st.orange { color: #e07b00; }
.zr-kopf { flex: none; padding: 6px 8px 0; }
.zr-titel { color: var(--blau-text); text-transform: uppercase; font-size: 13px; padding: 2px 0 6px; }
.zr-raster { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.zr-fuss .symbolerklaerung, .zr-raster > .symbolerklaerung { margin: 0 8px; }
.kontenleiste { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
.kachel { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-width: 150px; padding: 6px 10px; border: 1px solid var(--grau-rahmen); background: #f7f8fa; cursor: pointer; text-align: left; }
.kachel:hover { background: #eef3fa; }
.kachel.aktiv { background: #dbe7f7; border-color: var(--blau-hell); box-shadow: inset 0 -3px 0 var(--blau-hell); }
.kachel.verrechnung { margin-left: auto; }
.kachel-symbol { grid-row: span 2; font-size: 22px; }
.kachel-name { font-weight: 600; }
.kachel-saldo { font-size: 11px; color: #3b4a5c; } .kachel-saldo.rot, .rot { color: #c62d2d; } .gruen { color: #2e8b3e; }
.zr-reiter { margin-bottom: 0; }
.zeitraumleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 6px 2px; }
.zeitraumleiste input[type=date], .zeitraumleiste select, .jahrfeld { height: 22px; border: 1px solid var(--grau-rahmen); }
.jahrfeld { width: 70px; }
.saldoangabe b { font-size: 13px; }
.zahlungsfenster .zf-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.zf-spalten { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.richtung { display: flex; gap: 14px; }
.kategorieliste { width: 100%; border: 1px solid var(--grau-rahmen); }
.zuordnung .zu-kunde { font-weight: 600; padding: 0 8px; }
.zu-tabelle { margin-top: 6px; }
.zuordnungsfenster .fensterkoerper { display: flex; flex-direction: column; min-height: 0; }
.zuordnung-inhalt { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.verteil-huelle { flex: 1; min-height: 0; overflow: auto; border: 1px solid #dfe3e8; }
.verteilung tr.an td { background: #f1f7ee; }
.verteilung select { max-width: 230px; }
.verteilsummen { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 6px 2px; }
.kontentabelle input[type=text] { width: 100%; text-align: left; }
.kontentabelle input.rechts { text-align: right; }
.eg-kopf { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; font-weight: 600; }
.eg-summen { display: flex; gap: 14px; }
.abgleich { border: 1px solid #e3c98f; background: #fffaf0; padding: 6px 10px; margin-top: 6px; }
.abgleich:empty { display: none; }
.abgleich-text { margin-bottom: 4px; }
/* --- Mahnungen ----------------------------------------------------------- */
.r-zelle.mw-haken { cursor: pointer; text-align: center; font-size: 14px; }
.st-text.gelb { color: #a07800; } .st-text.orange { color: #c26400; } .st-text.schwarz { color: #222; font-weight: 600; } .st-text.rot { color: #c62d2d; font-weight: 600; }
.r-zeile.markiert .st-text { color: #fff; }
.mw-auswahl { font-weight: 600; color: var(--blau-text); }
.mh-naechste { margin-top: 8px; align-items: center; }
/* --- Abo-Rechnungen ------------------------------------------------------ */
.satzfeld { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.satzfeld .feld { display: inline-flex; margin: 0; }
.satzfeld .beschriftung { display: none; }
/* --- Kontoauszug-Import -------------------------------------------------- */
.kontoauszugfenster .fensterkoerper { display: flex; flex-direction: column; min-height: 0; gap: 6px; }
.ka-oben { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; flex: none; }
.ka-feldraster { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.ka-feldraster select { width: 100%; }
.ka-vorschau { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.ka-huelle { flex: 1; min-height: 0; overflow: auto; border: 1px solid #dfe3e8; }
.ka-tabelle td.ka-text { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ka-tabelle td { vertical-align: top; }
/* --- Statistiken --------------------------------------------------------- */
.sx-inhalt { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px 8px; display: flex; flex-direction: column; }
.sx-titel { color: var(--blau-text); font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.sx-zweispaltig { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .sx-zweispaltig { grid-template-columns: 1fr; } }
.sx-huelle { position: relative; border: 1px solid var(--grau-rahmen); background: #fcfcfb; padding: 8px; }
.sx-diagramm { width: 100%; height: auto; display: block; }
.sx-jahr { fill: #2f6db3; } .sx-vorjahr { fill: #d9822b; }
.sx-gitter { stroke: #e4e7eb; stroke-width: 1; } .sx-null { stroke: #8b96a3; stroke-width: 1; }
.sx-achse { font-size: 10px; fill: #5b6672; }
.sx-ziel { fill: transparent; } .sx-monat:hover .sx-ziel { fill: rgba(47, 109, 179, .07); }
.sx-tip { position: absolute; background: #fff; border: 1px solid #b9c2cc; box-shadow: 0 2px 8px rgba(0,0,0,.15); padding: 6px 9px; font-size: 11px; pointer-events: none; min-width: 150px; z-index: 2; }
.sx-tip[hidden] { display: none; }
.sx-legende { display: flex; gap: 14px; font-size: 11px; color: #3b4a5c; margin-bottom: 4px; }
.sx-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sx-jahr-f { background: #2f6db3; } .sx-vorjahr-f { background: #d9822b; }
.sx-tabelle td.r, .sx-tabelle th.r { text-align: right; white-space: nowrap; }
.sx-tabelle tr.sx-summe td { font-weight: 700; border-top: 1px solid #5b6672; }
.sx-tabelle tr.sx-hervor td { background: #eef3fa; font-weight: 600; }
.sx-auf { color: #2e8b3e; } .sx-ab { color: #c62d2d; } .sx-gleich { color: #a07800; }
.sx-balken { display: inline-block; height: 10px; background: #2f6db3; border-radius: 0 3px 3px 0; }
.sx-rasterseite { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sx-raster { flex: 1; min-height: 300px; display: flex; flex-direction: column; }
/* --- E-Mail ---------------------------------------------------------------- */
.mail-anhang { padding: 6px 2px; }
.mailfenster textarea { font-family: inherit; }