/* Optik angelehnt an NetCo: grau, kompakt, Gruppenkästen mit Kopfleiste,
   Werkzeugleiste mit Symbolen, Reiter. */
:root {
  --grund: #e4e6e9;
  --flaeche: #f4f5f6;
  --feld: #ffffff;
  --text: #1c1f23;
  --leise: #5f6670;
  --rahmen: #b3b8bf;
  --rahmen-hell: #d3d7dc;
  --kopf-a: #eef0f2;
  --kopf-b: #dcdfe3;
  --akzent: #3a78c2;
  --akzent-hell: #cfe2fa;
  --leiste: #d7dade;
  --rot: #b42318;  --rot-hell: #fdecea;
  --gelb: #7a5200; --gelb-hell: #fff3cd;
  --gruen: #1b6e3b; --gruen-hell: #e3f3e8;
  --radius: 3px;
  /* kompakt wie NetCo (Tahoma 8,25 pt) */
  font-family: Tahoma, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 10px;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) {
    --grund: #1b1e22; --flaeche: #23272c; --feld: #15181b; --text: #e3e6ea; --leise: #9aa3ad;
    --rahmen: #49515a; --rahmen-hell: #353b42; --kopf-a: #2c3137; --kopf-b: #262a2f;
    --akzent: #6ea8ee; --akzent-hell: #24384f; --leiste: #262a2f;
    --rot: #ff8a80; --rot-hell: #3b1f1d; --gelb: #f5c869; --gelb-hell: #3a2f14; --gruen: #6fd39a; --gruen-hell: #173323;
  }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] {
  --grund: #1b1e22; --flaeche: #23272c; --feld: #15181b; --text: #e3e6ea; --leise: #9aa3ad;
  --rahmen: #49515a; --rahmen-hell: #353b42; --kopf-a: #2c3137; --kopf-b: #262a2f;
  --akzent: #6ea8ee; --akzent-hell: #24384f; --leiste: #262a2f;
  --rot: #ff8a80; --rot-hell: #3b1f1d; --gelb: #f5c869; --gelb-hell: #3a2f14; --gruen: #6fd39a; --gruen-hell: #173323;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); }
body { min-height: calc(100vh / var(--anzeige, 1)); display: flex; flex-direction: column; }
a { color: var(--akzent); }
.sprite { display: none; }
svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Titelleiste und Modulleiste */
.titel { display: flex; align-items: center; gap: .75rem; height: 26px; padding: 0 .6rem;
  background: linear-gradient(#5a6a7d, #43505f); color: #fff; font-size: 10.5px; }
.marke { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .04em; }
.titel-text { opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mandant { margin-left: auto; opacity: .85; white-space: nowrap; }
.module { display: flex; flex-wrap: wrap; align-items: stretch; gap: 1px; padding: 2px 4px;
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); border-bottom: 1px solid var(--rahmen); }
.modul { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; color: var(--text);
  text-decoration: none; border: 1px solid transparent; border-radius: var(--radius); white-space: nowrap; }
.modul svg { width: 18px; height: 18px; }
a.modul:hover { border-color: var(--rahmen); background: var(--feld); }
.modul.aktiv { border-color: var(--akzent); background: var(--akzent-hell); }
.modul.folgt { opacity: .45; cursor: default; }
.modul.rechts { margin-left: auto; }

/* Werkzeugleiste (Ribbon) */
.werkzeuge { display: flex; flex-wrap: wrap; gap: 0; padding: 3px 4px 0; background: var(--leiste);
  border-bottom: 1px solid var(--rahmen); }
.werkzeuge .gruppe { display: flex; flex-direction: column; border-right: 1px solid var(--rahmen); padding: 0 4px; }
.werkzeuge .knoepfe { display: flex; align-items: flex-start; gap: 2px; min-height: 50px; }
.werkzeuge .gruppe-titel { font-size: 9.5px; color: var(--leise); text-align: center; padding: 1px 0 2px;
  border-top: 1px solid var(--rahmen-hell); }
.wk { display: inline-flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  min-width: 52px; padding: 3px 5px; font: inherit; font-size: 10px; color: var(--text); text-decoration: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; }
.wk svg { width: 26px; height: 26px; }
.wk:hover { border-color: var(--rahmen); background: var(--feld); }
.wk.aus { opacity: .4; cursor: default; }
.wk.aus:hover { border-color: transparent; background: transparent; }
.wk.klein { min-width: 40px; }
.schnellsuche { display: flex; align-items: center; gap: 4px; }
.schnellsuche input[type=search] { width: 210px; }
.blaettern { align-items: center; flex-wrap: wrap; width: 132px; gap: 1px; padding-top: 2px; }
.pfeil { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 22px; font-size: 10.5px;
  text-decoration: none; color: var(--akzent); border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); }
.pfeil:hover { background: var(--akzent-hell); }
.pfeil.aus { opacity: .35; pointer-events: none; }
.index { width: 100%; text-align: center; font-size: 10px; padding-top: 3px; }

/* Inhalt */
.inhalt { flex: 1; padding: 8px; min-width: 0; }
.seite-schmal { max-width: 900px; }
h1 { font-size: 1.3rem; margin: .5rem 0 1rem; }
.leise { color: var(--leise); font-weight: 400; font-size: 10px; }
.status { display: flex; gap: 1rem; padding: 3px 8px; font-size: 10px; color: var(--leise);
  background: var(--leiste); border-top: 1px solid var(--rahmen); }
.status .tasten { margin-left: auto; }

/* Hinweise */
.hinweis { padding: .45rem .7rem; border-radius: var(--radius); margin-bottom: 6px; border: 1px solid; }
.hinweis.erfolg { background: var(--gruen-hell); border-color: var(--gruen); color: var(--gruen); }
.hinweis.fehler { background: var(--rot-hell); border-color: var(--rot); color: var(--rot); }
.hinweis.wichtig { background: var(--gelb-hell); border-color: var(--gelb); color: var(--gelb); }
.marke-rot, .marke-gelb, .marke-grau { font-size: 10px; padding: 0 .35rem; border-radius: 3px; white-space: nowrap; }
.marke-rot { background: var(--rot-hell); color: var(--rot); }
.marke-gelb { background: var(--gelb-hell); color: var(--gelb); }
.marke-grau { background: var(--rahmen-hell); color: var(--leise); }

/* Panels (Gruppenkästen mit Kopfleiste wie NetCo) */
.panel { background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); min-width: 0; }
.panel > h2 { margin: 0; padding: 2px 6px; font-size: 10.5px; font-weight: 600;
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); border-bottom: 1px solid var(--rahmen); }
.panel > h2::before { content: "▾ "; color: var(--leise); }
.panel > .felder, .panel > .zwei-raster, .panel > .baum, .panel > table, .panel > .leer, .panel > .seiten,
.panel > .plus, .panel > p { margin: 6px 8px; }

/* Eingabefelder */
input, select, textarea { font: inherit; color: var(--text); background: var(--feld);
  border: 1px solid var(--rahmen); border-radius: 2px; padding: 1px 3px; min-height: 18px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.35; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0; }
input.zahl, .zahl input { text-align: right; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent-hell); }
[aria-invalid=true] { border-color: var(--rot) !important; background: var(--rot-hell) !important; box-shadow: 0 0 0 1px var(--rot); }
.fehler, .fehlertext { color: var(--rot); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.ff { display: block; grid-column: 2 / -1; color: var(--rot); font-size: 11px; font-weight: 600; margin-top: -2px; }
.haken { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.haken.aus { opacity: .55; }

/* Feldraster: Beschriftung links, Feld rechts */
.felder { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 6px; align-items: center; }
.felder > label:not(.haken):not(.inline) { color: var(--text); white-space: nowrap; }
.felder .oben-label { align-self: start; padding-top: 3px; }
.felder.f-2 { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
.felder.f-3 { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
.felder .span2 { grid-column: span 2; }
.felder .span3 { grid-column: span 3; }
.felder .span4 { grid-column: 1 / -1; }
.felder > .ff { grid-column: 1 / -1; }
.zeile { display: flex; align-items: center; gap: 6px; min-width: 0; }
.zeile > input, .zeile > select { flex: 1; min-width: 0; }
.zeile > .schmal { flex: 0 0 70px; }
.zeile > .breit { flex: 2; }
label.inline { white-space: nowrap; }

/* Oberer Bereich: vier Kästen nebeneinander */
.maske { display: flex; flex-direction: column; gap: 8px; }
.oben { display: grid; grid-template-columns: 1.15fr 1fr 1fr .6fr; gap: 8px; align-items: stretch; }
.zwei-raster { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.raster-titel { font-size: 10px; margin: 0 0 2px; }

/* Raster (Tabellen mit Eingabefeldern) */
table.raster { width: 100%; border-collapse: collapse; background: var(--feld); border: 1px solid var(--rahmen); }
table.raster th { text-align: left; font-weight: 400; font-size: 10px; padding: 2px 4px;
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); border: 1px solid var(--rahmen); white-space: nowrap; }
table.raster th.zahl { text-align: right; }
table.raster td { padding: 0; border: 1px solid var(--rahmen-hell); }
table.raster td input, table.raster td select { border: 0; border-radius: 0; background: transparent; min-height: 17px; }
table.raster td input:focus, table.raster td select:focus { box-shadow: inset 0 0 0 2px var(--akzent); }
table.raster td:last-child { width: 22px; text-align: center; }
table.raster td.eng { width: 70px; }
table[data-raster=tel] td:first-child { width: 88px; }
table[data-raster=sk] th:nth-child(-n+2) { width: 90px; }
table[data-raster=vt] th:nth-child(2), table[data-raster=vt] th:nth-child(3) { width: 130px; }
table[data-raster=adr] th:first-child { width: 140px; }
table[data-raster=adr] th:nth-child(9) { width: 64px; }
.weg { border: 0; background: transparent; color: var(--leise); font-size: 13px; line-height: 1; cursor: pointer; padding: 2px 5px; }
.weg:hover { color: var(--rot); }
.plus { display: inline-block; margin-top: 3px; border: 0; background: transparent; color: var(--akzent);
  font: inherit; font-size: 10px; cursor: pointer; padding: 1px 2px; text-decoration: none; }
.plus:hover { text-decoration: underline; }

/* Filialen-Baum */
.baum, .baum ul { list-style: none; margin: 0; padding: 0; }
.baum { background: var(--feld); border: 1px solid var(--rahmen); min-height: 120px; padding: 3px 6px; }
.baum ul { padding-left: 14px; border-left: 1px dotted var(--rahmen); margin-left: 4px; }
.baum li { padding: 2px 0; }
.baum .wurzel { font-weight: 600; }
.baum ul li { font-weight: 400; }

/* Reiter */
.reiter { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); }
.reiter > .reiter-wahl, .unterreiter > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.reiter-kopf { display: flex; flex-wrap: wrap; gap: 3px; padding: 5px 6px 0; border-bottom: 1px solid var(--rahmen); }
.reiter-kopf label { padding: 3px 10px; border: 1px solid var(--rahmen); border-bottom: 0; border-radius: 3px 3px 0 0;
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); cursor: pointer; font-size: 10.5px; white-space: nowrap; }
.reiter-kopf label:hover { background: var(--feld); }
.reiter-kopf.klein label { font-size: 10px; padding: 2px 8px; }
.badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--rot); color: #fff;
  font-size: 9.5px; text-align: center; }
.reiter-kopf .zahl { color: var(--leise); }
.reiter-inhalt { display: none; padding: 8px; }
#r-stamm:checked ~ #p-stamm, #r-stamm2:checked ~ #p-stamm2, #r-bemerkungen:checked ~ #p-bemerkungen,
#r-zahlung:checked ~ #p-zahlung, #r-belege:checked ~ #p-belege, #r-artikel:checked ~ #p-artikel, #r-versand:checked ~ #p-versand, #r-dokumente:checked ~ #p-dokumente { display: block; }
#r-stamm:checked ~ .reiter-kopf label[for=r-stamm], #r-stamm2:checked ~ .reiter-kopf label[for=r-stamm2],
#r-bemerkungen:checked ~ .reiter-kopf label[for=r-bemerkungen], #r-zahlung:checked ~ .reiter-kopf label[for=r-zahlung],
#r-belege:checked ~ .reiter-kopf label[for=r-belege], #r-artikel:checked ~ .reiter-kopf label[for=r-artikel], #r-dokumente:checked ~ .reiter-kopf label[for=r-dokumente],
#b1:checked ~ .reiter-kopf label[for=b1], #b2:checked ~ .reiter-kopf label[for=b2], #b3:checked ~ .reiter-kopf label[for=b3] {
  background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
.reiter-wahl:focus-visible ~ .reiter-kopf label { outline: none; }
.unterreiter .ub { display: none; padding-top: 6px; }
#b1:checked ~ #ub1, #b2:checked ~ #ub2, #b3:checked ~ #ub3 { display: block; }
.unterreiter textarea { min-height: 260px; }

.spalten-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.spalten-2.innen { margin-top: 8px; }
.gruppe-box { border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 4px 8px 8px; margin: 0 0 8px; background: var(--flaeche); }
.gruppe-box legend { font-size: 10.5px; padding: 0 4px; }
table.voll { width: 100%; }
.zb { margin-bottom: 6px; }
.zb select { max-width: 420px; }
.protokoll { margin-top: 6px; font-size: 10px; color: var(--leise); }

/* Listen */
table.liste { width: calc(100% - 16px); border-collapse: collapse; background: var(--feld); border: 1px solid var(--rahmen); }
table.liste th { text-align: left; font-weight: 400; font-size: 10px; padding: 2px 5px; white-space: nowrap;
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); border: 1px solid var(--rahmen); }
table.liste td { padding: 1px 5px; border-bottom: 1px solid var(--rahmen-hell); }
table.liste tbody tr[data-link] { cursor: pointer; }
table.liste tbody tr:hover { background: var(--akzent-hell); }
table.liste td.nr a { font-weight: 600; text-decoration: none; }
table.liste tr.gesperrt td { color: var(--leise); }
table.liste tr.archiviert td { color: var(--leise); font-style: italic; }
.seiten { display: flex; gap: 1rem; justify-content: flex-end; color: var(--leise); font-size: 10px; }
.leer { padding: 2rem; text-align: center; color: var(--leise); }
.leer a { display: block; margin-top: .4rem; }
.formular-liste td { padding: 2px 4px; }
.zeilenform { display: grid; grid-template-columns: 90px 1.2fr 1.6fr 110px 80px 100px; gap: 6px; align-items: center; }
.formular-liste thead th:nth-child(1) { width: 90px; }
.neue-zeile { background: var(--flaeche); }
.knopf { font: inherit; padding: 2px 8px; border: 1px solid var(--rahmen); border-radius: var(--radius);
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); color: var(--text); cursor: pointer; white-space: nowrap; }
.knopf:hover { border-color: var(--akzent); }
.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.einstellungen { display: grid; grid-template-columns: 220px 1fr; gap: 8px; align-items: start; }
.listenwahl a { display: block; padding: 4px 10px; text-decoration: none; color: var(--text); border-left: 3px solid transparent; }
.listenwahl a:hover { background: var(--feld); }
.listenwahl a.aktiv { background: var(--akzent-hell); border-left-color: var(--akzent); font-weight: 600; }

/* Startseite */
.kacheln { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem; }
.kachel { display: flex; flex-direction: column; gap: 2px; width: 170px; padding: 12px; background: var(--flaeche);
  border: 1px solid var(--rahmen); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.kachel:hover { border-color: var(--akzent); }
.kachel svg { width: 28px; height: 28px; }
.kachel .zahl { font-size: 1.6rem; font-weight: 700; color: var(--akzent); }

/* Kleinere Bildschirme: Kästen untereinander */
@media (max-width: 1400px) { .oben { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1000px) {
  .spalten-2, .einstellungen { grid-template-columns: 1fr; }
  .felder.f-3 { grid-template-columns: max-content 1fr max-content 1fr; }
  .status .tasten { display: none; }
}
@media (max-width: 700px) {
  .oben, .zwei-raster { grid-template-columns: 1fr; }
  .felder.f-2, .felder.f-3 { grid-template-columns: max-content 1fr; }
  .felder .span2, .felder .span3 { grid-column: 1 / -1; }
  .zeile { flex-wrap: wrap; }
  .zeilenform { grid-template-columns: 1fr 1fr; }
  .schnellsuche input[type=search] { width: 140px; }
  table.raster { display: block; overflow-x: auto; }
}

/* Import */
.import { display: flex; flex-direction: column; gap: 8px; max-width: 1400px; }
.import-form { padding: 8px; }
.import-form .felder { max-width: 900px; }
.aktionen-zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.knopf:disabled { opacity: .45; cursor: default; }
.kennzahlen { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px; }
.kennzahlen > div { display: flex; flex-direction: column; min-width: 140px; padding: 8px 12px; background: var(--feld);
  border: 1px solid var(--rahmen); border-radius: var(--radius); font-size: 10px; color: var(--leise); }
.kennzahlen .zahl { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.kennzahlen .gut .zahl { color: var(--gruen); }
.kennzahlen .schlecht .zahl { color: var(--rot); }
.kennzahlen .achtung .zahl { color: var(--gelb); }
.panel > p { margin: 6px 8px; }
.marke-gruen { font-size: 10px; padding: 0 .35rem; border-radius: 3px; background: var(--gruen-hell); color: var(--gruen); white-space: nowrap; }

/* Firmeninfo + Bearbeitungsbereich */
.oben2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.stern { color: #d79b00; margin-right: 3px; }
.panel > .plus, .panel > .ff { margin: 0 8px 6px; display: inline-block; }
table.kontakte th:nth-child(1) { width: 110px; } table.kontakte th:nth-child(2) { width: 26px; }
table.kontakte th:nth-child(3) { width: 80px; }  table.kontakte th:nth-child(10) { width: 170px; }
td.mitte { text-align: center; }
td.mail { position: relative; }
td.mail input { padding-right: 20px; }
.mailto { position: absolute; right: 4px; top: 3px; text-decoration: none; color: var(--akzent); }
tr.ausgeblendet { display: none; }
tr.hervorgehoben td { background: var(--gelb-hell); }
table[data-raster=adr] th:nth-child(2) { width: 26px; } table[data-raster=adr] th:nth-child(3) { width: 80px; }
table[data-raster=adr] th:first-child { width: 150px; } table[data-raster=adr] th:nth-child(11) { width: 64px; }
@media (max-width: 1000px) { .oben2 { grid-template-columns: 1fr; } table.kontakte { display: block; overflow-x: auto; } }

[hidden] { display: none !important; }

/* ---- Adressen & Kontakte --------------------------------------------------- */
.js .daten-raster { display: none; }
.daten-raster { margin: 6px 8px; }
.daten-raster h3 { font-size: 10.5px; margin: 8px 0 2px; }
.editor .ed-hinweis { margin: 8px 12px; }
.editor .ed-hinweis p { margin: 0 0 8px; }
.editor.offen { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent-hell); }
.editor > h2 { display: flex; justify-content: space-between; gap: 10px; }
.editor > h2 .zu { text-decoration: none; color: var(--leise); font-weight: normal; }
.editor > h2 .zu:hover { color: var(--rot); }
.editor .felder { margin: 6px 8px; }
.ed-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.knopf.gefahr { color: var(--rot); margin-left: auto; }
.knopf.gefahr:hover { border-color: var(--rot); }
.zeile > .schmal2 { flex: 0 0 110px; }
.ak-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 8px; }
.ak-kopf .suchfeld { flex: 0 1 360px; }
.ak-kopf .plus { margin: 0; }
/* Adressen & Kontakte: eine Liste mit festen Spalten für Adress- und Kontaktzeilen */
.ak-liste { --ak-spalten: 26px minmax(170px, 1.5fr) 150px 150px minmax(150px, 1.2fr) minmax(110px, 1fr);
  margin: 0 8px 8px; border: 1px solid var(--rahmen); border-radius: var(--radius); max-height: 420px; overflow-y: auto; background: var(--feld); }
.ak-spalten { display: grid; grid-template-columns: var(--ak-spalten); gap: 8px; padding: 3px 8px; position: sticky; top: 0; z-index: 1;
  background: var(--flaeche); border-bottom: 1px solid var(--rahmen); font-size: 10px; color: var(--leise); text-transform: none; }
.ak-gruppe + .ak-gruppe { border-top: 1px solid var(--rahmen); }
.ak-adresse { display: grid; grid-template-columns: var(--ak-spalten); align-items: center; gap: 8px; padding: 4px 8px; background: var(--flaeche); min-height: 24px; }
.ak-adresse .ak-hinweis { grid-column: 5 / 7; }
.ak-gruppe.firma .ak-adresse { font-weight: 600; }
.ak-pfeil { border: 0; background: transparent; color: var(--leise); cursor: pointer; padding: 0; font-size: 11px; width: 18px; }
.ak-titel { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-titel:hover .ak-aname, .ak-kontakt:hover .ak-name { text-decoration: underline; }
.ak-art { justify-self: start; font-size: 10px; font-weight: 400; white-space: nowrap; padding: 0 7px; border: 1px solid var(--rahmen-hell); border-radius: 9px; color: var(--leise); background: var(--feld); }
.ak-gruppe.rechnung .ak-art { color: #8a5a00; border-color: #e0c27a; background: #fff6dc; }
.ak-gruppe.firma .ak-art { color: var(--akzent); border-color: var(--akzent); background: var(--akzent-hell); }
.ak-zahl { text-align: left; font-weight: 400; font-size: 10px; }
.ak-hinweis, .ak-bem { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 400; }
.ak-stern { color: #d4a017; display: inline-block; width: 14px; text-align: center; }
.ak-kontakte { padding: 0 0 3px 0; }
.ak-kontakte .plus { margin: 1px 0 0 34px; font-size: 10px; }
.ak-kontakt { display: grid; grid-template-columns: var(--ak-spalten); gap: 8px; align-items: center; padding: 2px 8px; cursor: pointer; min-height: 22px; border-top: 1px solid var(--rahmen-hell); }
.ak-kontakt:first-child { border-top: 0; }
.ak-kontakt > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-kontakt .ak-stern { justify-self: end; }
.ak-kontakt .ak-name { padding-left: 14px; }
.ak-zweck { color: var(--leise); font-size: 10px; }
.ak-kontakt:hover, .ak-adresse:hover { background: var(--akzent-hell); }
.ak-kontakt.gewaehlt, .ak-adresse.gewaehlt { background: var(--akzent-hell); outline: 1px solid var(--akzent); outline-offset: -1px; }
.ak-leer { padding: 8px; }
@media (max-width: 1000px) {
  .ak-liste { --ak-spalten: 22px 1fr auto; }
  .ak-spalten span:nth-child(n+4) { display: none; }
  .ak-adresse .ak-zahl, .ak-adresse .ak-hinweis { display: none; }
  .ak-kontakt .ak-tel, .ak-kontakt .ak-mail, .ak-kontakt .ak-bem { grid-column: 2 / 4; padding-left: 14px; }
}
.editor > h2::before { content: none; }

.ak-filialen { padding: 2px 8px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); }
.zeile > select.passend { flex: 0 0 auto; width: auto; min-width: 80px; }
.listen-dialog { width: min(980px, 94vw); height: min(640px, 86vh); padding: 0; border: 1px solid var(--rahmen);
  border-radius: var(--radius); background: var(--flaeche); color: var(--text); }
.listen-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.listen-dialog[open] { display: flex; flex-direction: column; }
.ld-kopf { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--rahmen); }
.ld-kopf .knopf { margin-left: auto; }
.listen-dialog iframe { flex: 1; border: 0; width: 100%; background: var(--grund, #fff); }
body.eingebettet .einstellungen { grid-template-columns: 1fr; }
body.eingebettet .inhalt { padding: 6px; }

.nr-hinweis { grid-column: 2 / -1; font-size: 10px; margin-top: -2px; min-height: 0; }
.nr-hinweis:empty { display: none; }
.nr-hinweis.vergeben, .nr-hinweis.ungueltig { color: var(--rot); font-weight: 600; }
.nr-hinweis.frei { color: var(--gruen, #2e7d32); }
.nr-hinweis.automatisch { color: var(--leise); }
input.gesperrt { background: var(--flaeche); color: var(--leise); cursor: not-allowed; }
.js #ak.aus { display: none; }
.editor.einfach .nur-erweitert { display: none !important; }
.filialen-haken { margin-top: 4px; font-weight: 600; }
.filialen-haken input:disabled + * , .filialen-haken:has(input:disabled) { cursor: help; }

/* ---- Kundenliste ------------------------------------------------------------- */
.schnellsuche input[type=search].volltext { width: 380px; }
.ansichten { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 8px; }
.ansicht { display: inline-flex; align-items: center; border: 1px solid var(--rahmen); border-radius: 12px;
  background: var(--flaeche); padding: 1px 2px 1px 10px; }
.ansicht a { text-decoration: none; color: var(--text); }
.ansicht.aktiv { border-color: var(--akzent); background: var(--akzent-hell); font-weight: 600; }
.ansicht form { display: inline; margin: 0; }
.ansicht-neu { display: inline-flex; gap: 6px; margin-left: auto; }
.ansicht-neu input { width: 240px; }
.aktive-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 8px; }
.filter-chip { background: var(--akzent-hell); border: 1px solid var(--akzent); border-radius: 12px; padding: 1px 8px;
  text-decoration: none; color: var(--text); font-size: 10.5px; }
.filter-chip b { color: var(--akzent); margin-left: 2px; }
.tabelle-rahmen { overflow-x: auto; margin: 0 8px; }
.kundenliste th { white-space: nowrap; }
.th-innen { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.th-innen a { color: var(--text); text-decoration: none; }
.sp-filter { border: 0; background: transparent; color: var(--leise); cursor: pointer; padding: 0 2px; font-size: 10.5px; }
th.gefiltert .sp-filter { color: var(--akzent); font-weight: 700; }

.filterzeile th { padding: 2px; }
.filterzeile input { width: 100%; min-width: 50px; font-size: 10.5px; padding: 1px 4px; }
.kundenliste .sp-hausnr, .kundenliste .sp-plz { width: 60px; }
.je-seite { margin-left: auto; }
.je-seite select { width: auto; }
.werte-pop { position: absolute; z-index: 50; width: 330px; background: var(--flaeche); border: 1px solid var(--rahmen);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); padding: 6px; }
.wp-kopf { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.wp-alle { display: block; padding: 2px 4px; border-bottom: 1px solid var(--rahmen); }
.wp-liste { max-height: 320px; overflow-y: auto; padding: 2px 0; }
.wp-liste label { display: block; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.wp-liste label:hover { background: var(--akzent-hell); }
.wp-knoepfe { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }

/* Kundenliste im eigenen Fenster: ohne Modulleiste, mehr Platz für die Tabelle */
.listenfenster nav.module { display: none; }

/* gefilterte Spalten farbig markieren */
.kundenliste col.gefiltert { background: var(--gelb-hell); }
.kundenliste th.gefiltert { background: var(--gelb-hell); border-bottom: 2px solid #e0a52a; }
.kundenliste th.gefiltert .th-innen a { font-weight: 700; }
.kundenliste th.gefiltert .sp-filter { color: #c77700; }
.kundenliste th.gefiltert input { border-color: #e0a52a; background: var(--feld); font-weight: 600; }
.filterfeld { display: flex; align-items: center; gap: 2px; }
.sp-leeren { text-decoration: none; color: var(--rot); font-weight: 700; padding: 0 3px; }
.sp-leeren:hover { background: var(--rot-hell); border-radius: 3px; }
.filter-weg { color: var(--rot); text-decoration: none; margin-left: 6px; }
td.leer.start { padding: 24px; text-align: center; color: var(--leise); }

.index.gesucht { color: var(--akzent); font-weight: 600; }
.suchhinweis { display: block; font-size: 9.5px; line-height: 1.3; font-weight: 400; background: var(--gelb-hell); border: 1px solid #e0a52a;
  border-radius: 10px; padding: 0 6px; margin-top: 2px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.suchhinweis a { color: var(--rot); text-decoration: none; font-weight: 700; margin-left: 4px; }
.such-hinweis { color: var(--rot); font-weight: 600; font-size: 10.5px; }

.kundenliste tbody tr[data-zeile] { cursor: default; user-select: none; }
.kundenliste tbody tr.gewaehlt, .kundenliste tbody tr.gewaehlt:hover { background: var(--akzent); color: #fff; outline: none; }
.kundenliste tbody tr.gewaehlt a { color: #fff; }
.kundenliste tbody tr[data-zeile]:focus { outline: none; }

.nummern-pop { width: 360px; }
.nummern-pop .wp-kopf { gap: 6px; }
.np-ab input { width: 90px; }
.np-liste { display: flex; flex-direction: column; max-height: 340px; }
.np-frei { text-align: left; border: 0; background: transparent; padding: 2px 6px; font: inherit; color: var(--text);
  cursor: pointer; border-radius: 3px; }
.np-frei:hover, .np-frei:focus { background: var(--akzent-hell); outline: none; }
.np-belegt { padding: 2px 6px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-liste > * { flex-shrink: 0; }

/* ---- Einstellungen > Artikelstamm ----------------------------------------- */
.sortiment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px; align-items: start; }
.sortiment .panel > .plus { margin: 4px 8px 8px; }
.sortiment-form { margin: 6px 8px 8px; }
.sortiment-form .felder { margin-bottom: 8px; }
table.raster.groessen, table.raster.werte { counter-reset: zeile; width: 100%; }
table.raster.groessen { max-width: 420px; }
table.raster tbody tr { counter-increment: zeile; }
td.pos::before { content: counter(zeile); color: var(--leise); font-size: 10px; }
td.pos { width: 28px; text-align: right; }
.zeilen-knoepfe { white-space: nowrap; width: 70px; }
.schnell { display: grid; grid-template-columns: max-content 1fr; gap: 4px 8px; align-items: center; margin: 10px 0; }
.schnell .leise { grid-column: 2; font-size: 10px; }
.schnell textarea { width: 100%; }
tr.gewaehlt-zeile td { background: var(--akzent-hell); font-weight: 600; }
.listenwahl h2 + a, .listenwahl a + h2 { margin-top: 0; }
.listenwahl h2:not(:first-child) { border-top: 1px solid var(--rahmen); }
@media (max-width: 1100px) { .sortiment { grid-template-columns: 1fr; } }

/* ---- Artikelstamm ---- */
#r-varianten:checked ~ #p-varianten, #r-lager:checked ~ #p-lager { display: block; }
#r-varianten:checked ~ .reiter-kopf label[for=r-varianten], #r-lager:checked ~ .reiter-kopf label[for=r-lager] {
  background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
.oben2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 8px; margin-bottom: 8px; }
.f-artikel, .f-2 { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.f-artikel > .ff, .f-artikel > .nr-hinweis { grid-column: 2; }
.f-artikel .zeile { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.f-artikel .zeile > input:not([type=checkbox]):not(.zahl):not(.datum), .f-artikel .zeile > select { flex: 1 1 140px; min-width: 0; }
.f-artikel label.inline { white-space: nowrap; }
.f-artikel input.zahl { width: 84px; }
.f-artikel input.zahl.schmal { width: 56px; }
/* Preisgruppen: genau Platz für 6 Stellen + Komma + 2 Nachkommastellen (999.999,99, mit Tausenderpunkt) */
.f-artikel input.zahl.preisgruppe { width: calc(10ch + 16px); flex: 0 0 auto; padding-left: 4px; padding-right: 4px; }
.f-artikel input.datum { width: 140px; }
.haken-zeile input[name=sperrgrund] { flex: 1 1 160px; }
.schluessel-wahl { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow: auto; }
.schluessel-wahl label { cursor: pointer; }
.folgt-reiter { padding: 3px 10px; color: var(--leise); font-style: italic; opacity: .6; cursor: not-allowed; }
.raster.varianten select { min-width: 110px; }
.raster.varianten td.eng input { width: 72px; }
.raster .mitte { text-align: center; }
.raster.varianten tr.ohne-eigen td.eng input { opacity: .45; }
.lager-kopf { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.lager-tab { padding: 2px 10px; border: 1px solid var(--rahmen); border-radius: 12px; text-decoration: none; color: inherit; }
.lager-tab.aktiv { background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
.lager-modus { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.lager-modus input[name=grund] { flex: 1 1 220px; }
table.matrix th, table.matrix td { padding: 2px 4px; }
table.matrix td.zelle { min-width: 93px; text-align: right; vertical-align: top; }
table.matrix input.menge { width: 81px; display: block; margin-left: auto; }
table.matrix .bestand { display: block; font-variant-numeric: tabular-nums; color: var(--leise); font-size: 10px; }
table.matrix .nebenwerte { display: block; font-size: 9.5px; color: var(--leise); }
table.matrix td.summe, table.matrix tfoot td { font-weight: 600; text-align: right; }
table.matrix .gesamt { font-size: 1.05em; }
table.matrix tr.aufpreise input { width: 81px; }
table.matrix input.menge.geaendert { background: #fff6d6; border-color: #d9a400; }
.negativ { color: #c0392b; }
.journal-titel { margin: 14px 0 4px; font-size: 11px; }
table.journal td { padding: 1px 6px; }
.spalten-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
label.block { display: block; margin: 6px 0 2px; }
textarea.breit { width: 100%; box-sizing: border-box; }
.lagerform { grid-template-columns: 80px 1.6fr 90px 100px 80px 100px; }
.lieferform { grid-template-columns: 100px 2fr 80px 100px; }
.listen-suche { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.listen-suche input[type=search] { flex: 1 1 300px; }
.seiten { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 8px; }
@media (max-width: 900px) { .oben2, .spalten-2 { grid-template-columns: 1fr; } .lagerform, .lieferform { grid-template-columns: 1fr 1fr; } }

/* ---- Drag & Drop ---- */
.griff { cursor: grab; color: var(--leise); user-select: none; padding: 0 3px; font-size: 11px; }
.griff:hover { color: var(--akzent); }
table[data-raster] > tbody > tr > td.pos { cursor: grab; }
table[data-raster] > tbody > tr > td.pos:hover::before { content: "⠿"; color: var(--akzent); }
.wird-gezogen { opacity: .45; outline: 2px dashed var(--akzent); }
.gerade-gespeichert { background: #e5f6e8 !important; transition: background .9s; }
.griff-feld { display: flex; align-items: center; gap: 2px; }
.griff-feld input { flex: 1; min-width: 0; }
.schluessel-wahl .ziehbar { display: flex; align-items: center; gap: 4px; padding: 1px 2px; border-radius: 3px; }
.schluessel-wahl .ziehbar:hover { background: var(--feld); }
.stern { color: #d9a400; }
th.auslaufend { color: #b9770e; }
table.matrix .gesamtmenge { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
table.matrix .null, table.verteilung td.null { color: var(--leise); opacity: .55; }
table.verteilung tbody tr[data-link] { cursor: pointer; }
table.verteilung td, table.verteilung th { padding: 2px 6px; }
table.verteilung td.summe, table.verteilung tfoot td { font-weight: 600; }

/* ---- Scan / EAN ---- */
#r-scan:checked ~ #p-scan { display: block; }
#r-scan:checked ~ .reiter-kopf label[for=r-scan] { background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
table.varianten.ohne-lief .lief { display: none; }
.link-knopf { background: none; border: 0; color: var(--akzent); cursor: pointer; padding: 0 4px; font: inherit; text-decoration: underline; }
.scanfeld { flex: 0 1 230px; font-family: ui-monospace, Consolas, monospace; border: 1px dashed var(--akzent) !important; }
.scan-hinweis { font-size: 10.5px; }
.scan-hinweis.gut { color: #1e7b34; font-weight: 600; }
.scan-hinweis.schlecht { color: #c0392b; }
td.scan-treffer, tr.scan-treffer td { background: #fff2b3 !important; box-shadow: inset 0 0 0 2px #d9a400; }
table.scan-tabelle td { padding: 1px 6px; }
table.scan-tabelle td.code { font-family: ui-monospace, Consolas, monospace; }
table.scan-tabelle input.ean { width: 100%; min-width: 160px; font-family: ui-monospace, Consolas, monospace; }

/* ---- Merkmale (Farbe, Qualität …) ---- */
.merkmale { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 8px; align-items: start; }
.merkmale.eingebettet { grid-template-columns: minmax(0, 1fr); }
.mm-liste { list-style: none; margin: 0; padding: 4px 0; }
.mm-liste li { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-left: 3px solid transparent; }
.mm-liste li:hover { background: var(--feld); }
.mm-liste li.aktiv { background: var(--akzent-hell); border-left-color: var(--akzent); font-weight: 600; }
.mm-liste li.inaktiv a { color: var(--leise); text-decoration: line-through; }
.mm-liste li a { flex: 1; text-decoration: none; color: inherit; }
.mm-zahl { color: var(--leise); font-size: 10px; min-width: 22px; text-align: right; }
.marke-var { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.mm-kopf { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.mm-kopf .mm-name { flex: 1 1 200px; font-size: 13px; font-weight: 600; padding: 4px 6px; }
.schalter { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.mm-werkzeug { display: flex; gap: 10px; align-items: center; margin: 6px 0 4px; flex-wrap: wrap; }
.mm-werkzeug .suchfeld { flex: 0 1 220px; }
.mm-tipp { margin-left: auto; }
table.werte { width: 100%; }
table.werte td.kuerzel { width: 110px; }
table.werte td.kuerzel input { font-family: ui-monospace, Consolas, monospace; text-transform: none; }
table.werte input[name=mw_bez] { width: 100%; }
table.werte tr.inaktiv input[type=text], table.werte tr.inaktiv input:not([type]) { color: var(--leise); }
table.werte input[aria-invalid=true] { background: #fde2e1; border-color: #c0392b; }
.mm-schnell { margin: 8px 0; }
.mm-schnell summary { cursor: pointer; color: var(--akzent); }
.mm-schnell textarea { width: 100%; box-sizing: border-box; margin-top: 4px; }
@media (max-width: 900px) { .merkmale { grid-template-columns: 1fr; } }

/* ---- Artikelmaske wie NetCo: Variante blättern + Lagerraster ---- */
#r-bestand:checked ~ #p-bestand, #r-fehl:checked ~ #p-fehl, #r-bilder:checked ~ #p-bilder { display: block; }
#r-bestand:checked ~ .reiter-kopf label[for=r-bestand], #r-fehl:checked ~ .reiter-kopf label[for=r-fehl], #r-bilder:checked ~ .reiter-kopf label[for=r-bilder] {
  background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
.oben-voll { margin-bottom: 8px; }
.var-leiste, .lager-leiste { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.var-blaettern { display: flex; gap: 3px; align-items: center; padding: 3px 8px 3px 3px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); }
.var-blaettern .pfeil { min-width: 30px; cursor: pointer; }
.var-index { margin: 0 6px; white-space: nowrap; }
.var-name { font-weight: 600; color: var(--akzent); }
.lager-leiste { padding: 4px 6px; background: var(--feld); border: 1px solid var(--rahmen); border-radius: var(--radius); }
.lager-leiste select { min-width: 200px; }
.lager-leiste .vorgang { flex: 1 1 240px; }
.var-panel { border-top: 1px solid var(--rahmen); padding-top: 6px; }
.var-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; margin-bottom: 8px; }
.var-felder > label { display: flex; flex-direction: column; gap: 1px; font-size: 10.5px; color: var(--leise); }
.var-felder > label > select, .var-felder > label > input:not([type=checkbox]) { color: var(--text, inherit); font-size: 11px; }
.var-felder > label.haken { flex-direction: row; align-items: center; color: inherit; font-size: 11px; padding-top: 14px; }
.var-felder input[readonly] { background: var(--flaeche); color: var(--leise); }
.scan-marke { font-size: 9px; color: var(--akzent); letter-spacing: -1px; }
.var-lager { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; align-items: start; }
.gs-wahl { border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 4px; background: var(--flaeche); max-height: 520px; overflow: auto; }
.gs-titel { font-weight: 600; margin-bottom: 3px; }
.gs-wahl .ziehbar { display: flex; align-items: center; gap: 3px; padding: 1px 2px; }
.raster-rahmen { overflow-x: auto; }
.raster-leer { padding: 20px; border: 1px dashed var(--rahmen); border-radius: var(--radius); }
table.lagerraster { border-collapse: collapse; width: auto; }
table.lagerraster th, table.lagerraster td { padding: 1px 4px; white-space: nowrap; }
table.lagerraster thead th { position: sticky; top: 0; background: var(--feld); z-index: 1; }
table.lagerraster tr.gruppe-kopf th { background: var(--akzent-hell); text-align: left; font-weight: 600; padding: 3px 6px; }
table.lagerraster td.eingabe input { width: 96px; padding: 1px 4px; }
table.lagerraster td.plus input { background: #fffbd0; }
table.lagerraster td.menge input { background: #dcf5d9; font-weight: 600; }
table.lagerraster td.ean input { width: 140px; font-family: ui-monospace, Consolas, monospace; }
table.lagerraster td.code { font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: var(--leise); }
table.lagerraster input.geaendert { outline: 2px solid #d9a400; }
table.lagerraster tr.auslaufend th { color: #b9770e; }
table.lagerraster tr.unter-min td.menge input { background: #fde2e1; }
table.lagerraster .menge-anzeige { font-weight: 600; }
.verlauf-knopf { padding: 0 8px; border: 1px solid var(--rahmen); border-radius: 3px; background: linear-gradient(#f4f8fd, #dfe9f5); cursor: pointer; }
.verlauf-dialog { width: min(820px, 96vw); max-height: 88vh; padding: 0; border: 1px solid var(--rahmen); border-radius: var(--radius); }
.verlauf-dialog .ld-kopf { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--feld); border-bottom: 1px solid var(--rahmen); }
#verlauf-inhalt { padding: 8px 10px; overflow: auto; max-height: calc(88vh - 50px); }
.verlauf-grafik { width: 100%; height: auto; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 3px; }
.verlauf-grafik .achse { stroke: var(--rahmen); }
.verlauf-grafik rect.zu { fill: #2e9e4f; }
.verlauf-grafik rect.ab { fill: #c0392b; }
.verlauf-grafik .bestand { fill: none; stroke: var(--akzent); stroke-width: 2; }
.verlauf-grafik .beschriftung { font-size: 10px; fill: var(--leise); }
.legende { font-size: 10px; margin: 2px 0 8px; display: flex; gap: 12px; }
.legende .zu { color: #2e9e4f; } .legende .ab { color: #c0392b; } .legende .bestand { color: var(--akzent); }
@media (max-width: 900px) { .var-lager { grid-template-columns: 1fr; } }
.lager-leiste > label { display: inline; margin: 0; }
.lager-leiste > select { width: auto; flex: 0 0 260px; }
.lager-leiste .scanfeld { flex: 0 1 260px; }
.lager-leiste .schalter { flex: 0 0 auto; }

/* Mengenmatrix: Werte immer mittig */
table.lagerraster th, table.lagerraster td,
table.lagerraster input, table.lagerraster input.zahl,
table.matrix th, table.matrix td, table.matrix td.zahl, table.matrix th.zahl,
table.verteilung td, table.verteilung th.zahl { text-align: center; }
table.lagerraster tr.gruppe-kopf th, table.matrix tbody th, table.verteilung tbody th, table.matrix tfoot th, table.verteilung tfoot th { text-align: left; }
table.lagerraster tbody.neu-gruppe tr.gruppe-kopf th { background: #fff2b3; }
.neu-marke { font-weight: normal; font-size: 10px; color: #8a6d00; margin-left: 8px; }
table.lagerraster tbody.abgewaehlt { opacity: .5; }
table.lagerraster tbody.abgewaehlt tr.gruppe-kopf th::after { content: " – abgewählt: wird beim Speichern entfernt (bei Bestand bleibt die Größe)"; font-weight: normal; font-size: 10px; }

/* ==== Artikelmaske: drei Ebenen optisch getrennt ====
   1 Artikel (blau) – 2 Variante (grün) – 3 Größen & Bestand (orange).
   Farbe nur als Randleiste und Kopfzeile, Eingabeflächen bleiben neutral. */
:root { --ebene1: #3a78c2; --ebene1-hell: rgba(58,120,194,.10);
        --ebene2: #2f8a57; --ebene2-hell: rgba(47,138,87,.10);
        --ebene3: #c27c1a; --ebene3-hell: rgba(194,124,26,.11); }
.stufe { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: 700; margin-right: 4px; vertical-align: 1px; }
.karte-titel { font-weight: 700; font-size: 11px; white-space: nowrap; margin-right: 6px; }

/* 1 Artikel */
.panel.karte-artikel { border-left: 4px solid var(--ebene1); }
.panel.karte-artikel > h2 { background: var(--ebene1-hell); font-size: 11px; padding: 4px 8px; }
.panel.karte-artikel > h2::before { content: ""; }
.karte-artikel .stufe { background: var(--ebene1); }

/* Reihenfolge im Reiter: Variante (Kopf + Felder), dann Größen (Kopf + Raster) */
#r-varianten:checked ~ #p-varianten { display: flex; flex-direction: column; gap: 0; }
#p-varianten > #var-panels, #p-varianten .var-panel:not([hidden]) { display: contents; }
#p-varianten .var-panel[hidden] { display: none; }
#p-varianten > .var-leiste { order: 1; }
#p-varianten > .ff { order: 2; }
#p-varianten .var-felder { order: 3; }
#p-varianten > .lager-leiste { order: 4; }
#p-varianten > .hinweis { order: 5; }
#p-varianten .var-lager { order: 6; }

/* 2 Variante */
#p-varianten > .var-leiste { margin: 0; padding: 5px 8px; background: var(--ebene2-hell); border: 1px solid var(--ebene2);
  border-left-width: 4px; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.var-leiste .stufe { background: var(--ebene2); }
#p-varianten .var-felder { margin: 0; padding: 8px 10px 10px; border: 1px solid var(--ebene2); border-left-width: 4px; border-top: 1px dashed var(--ebene2);
  border-radius: 0 0 var(--radius) var(--radius); background: var(--feld); }
.var-leiste .var-blaettern { background: var(--feld); }
.var-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 260px; }
.var-chip { border: 1px solid var(--ebene2); background: var(--feld); color: inherit; border-radius: 14px; padding: 2px 10px; cursor: pointer;
  font: inherit; display: inline-flex; align-items: center; gap: 6px; }
.var-chip:hover { background: var(--ebene2-hell); }
.var-chip.aktiv { background: var(--ebene2); color: #fff; font-weight: 600; }
.var-chip.gesperrt { text-decoration: line-through; opacity: .7; }
.var-chip.neu { border-style: dashed; }
.chip-zahl { font-size: 10px; padding: 0 6px; border-radius: 8px; background: rgba(0,0,0,.08); font-weight: 600; }
.var-chip.aktiv .chip-zahl { background: rgba(255,255,255,.25); }

/* 3 Größen & Bestand */
#p-varianten > .lager-leiste { margin: 12px 0 0; padding: 5px 8px; background: var(--ebene3-hell); border: 1px solid var(--ebene3);
  border-left-width: 4px; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.lager-leiste .stufe { background: var(--ebene3); }
#p-varianten .var-lager { margin: 0; padding: 8px; border: 1px solid var(--ebene3); border-left-width: 4px; border-top: 1px dashed var(--ebene3);
  border-radius: 0 0 var(--radius) var(--radius); background: var(--feld); }
#p-varianten > .hinweis { margin: 0; border-radius: 0; border-left: 4px solid var(--ebene3); }
.var-lager .gs-wahl { border-color: var(--ebene3); }
.var-lager .gs-titel { color: var(--ebene3); }
table.lagerraster tr.gruppe-kopf th { background: var(--ebene3-hell); border-top: 2px solid var(--ebene3); }
table.lagerraster thead th { border-bottom: 2px solid var(--ebene3); }
.lager-leiste .speichern-knopf { margin-left: auto; }
.raster-speichern { position: sticky; bottom: 6px; display: flex; justify-content: flex-end; margin-top: 6px; pointer-events: none; }
.raster-speichern .knopf { pointer-events: auto; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.var-lager .raster-speichern { grid-column: 1 / -1; z-index: 2; }
.var-lager .raster-speichern { justify-content: flex-start; padding-left: 158px; }
@media (max-width: 900px) { .var-lager .raster-speichern { padding-left: 0; } }

/* ---- Menüleiste fixieren (Titel, Module, Werkzeuge) ---- */
:root { --kopf-fix: 0px; }
.kopfbereich { z-index: 60; }
.kopfbereich.fixiert { position: sticky; top: 0; }
.kopfbereich.fixiert .module, .kopfbereich.fixiert .werkzeuge {
  background: color-mix(in srgb, var(--leiste, #eef1f4) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); }
.kopfbereich.fixiert .module { background: color-mix(in srgb, var(--kopf-b, #e9edf1) 82%, transparent); }
.kopfbereich.fixiert.gescrollt { box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
.anheften { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 9px 0 6px; margin-right: -2px;
  border: 1px solid rgba(255,255,255,.35); border-radius: 10px; background: rgba(255,255,255,.12); color: #fff;
  font: inherit; font-size: 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.anheften:hover { background: rgba(255,255,255,.24); }
.anheften:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.anheften svg { width: 13px; height: 13px; transform: rotate(45deg); transition: transform .2s ease; }
.anheften .nadel { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.anheften[aria-pressed="true"] { background: #fff; color: #2f5f9a; border-color: #fff; }
.anheften[aria-pressed="true"] svg { transform: rotate(0deg); }
.anheften[aria-pressed="true"] .nadel { fill: currentColor; }
/* Kopfzeilen von Tabellen kleben unter der fixierten Leiste */
table.lagerraster thead th { top: var(--kopf-fix); }
@media (max-width: 700px) { .anheften-text { display: none; } }
@media print { .kopfbereich.fixiert { position: static; } }
@media (min-width: 1200px) { .raster-rahmen { overflow: visible; } }
table.lagerraster thead th { z-index: 3; }
table.lagerraster thead th { background-clip: padding-box; box-shadow: 0 -6px 0 var(--feld); }

/* ==== Arbeitsplatz: Module laufen parallel in eigenen Rahmen ==== */
html.im-rahmen .titel, html.im-rahmen .module, html.im-rahmen footer.status { display: none !important; }
body.arbeitsplatz { height: calc(100vh / var(--anzeige, 1)); overflow: hidden; }
body.arbeitsplatz .inhalt { flex: 1 1 auto; padding: 0; min-height: 0; display: flex; }
body.arbeitsplatz .anheften { display: none; }
body.arbeitsplatz .kopfbereich { position: static; }
.rahmen-bereich { position: relative; flex: 1 1 auto; min-height: 0; }
.rahmen-bereich > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--grund, #e3e5e8); }
.rahmen-bereich > iframe[hidden] { display: none; }
/* Modulleiste als Reiter: offene Module, ungespeicherte Änderungen, Schließen */
body.arbeitsplatz .modul { position: relative; }
body.arbeitsplatz .modul.offen:not(.aktiv)::before { content: ""; position: absolute; left: 8px; right: 8px; bottom: 1px; height: 2px;
  border-radius: 1px; background: var(--akzent); opacity: .55; }
body.arbeitsplatz .modul.geaendert > .modul-punkt { display: inline-block; }
.modul-punkt { display: none; width: 7px; height: 7px; border-radius: 50%; background: #e08a00; margin-left: 2px; }
.modul-zu { display: none; margin-left: 2px; width: 16px; height: 16px; line-height: 15px; text-align: center; border-radius: 50%;
  font-size: 11px; color: var(--leise); }
body.arbeitsplatz .modul.offen > .modul-zu { display: inline-block; }
.modul-zu:hover { background: rgba(0,0,0,.12); color: var(--text, #222); }
body.arbeitsplatz .modul[data-modul="start"] > .modul-zu { display: none; }
/* Anheften-Knopf im Rahmen: rechts in der Werkzeugleiste */
html.im-rahmen .werkzeuge, body.eingebettet .werkzeuge { position: relative; }
html.im-rahmen .werkzeuge > .anheften, body.eingebettet .werkzeuge > .anheften { position: absolute; right: 8px; top: 6px; background: var(--feld); color: var(--leise);
  border-color: var(--rahmen); }
html.im-rahmen .werkzeuge > .anheften[aria-pressed="true"], body.eingebettet .werkzeuge > .anheften[aria-pressed="true"] { background: var(--akzent); color: #fff; border-color: var(--akzent); }

/* Anmeldung und Benutzersteuerung */
.angemeldet { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; white-space: nowrap; }
.angemeldet + .anheften { margin-left: 0; }
.inline-form { display: inline; margin: 0; }
.link-knopf { font: inherit; border: 0; background: transparent; color: var(--akzent); cursor: pointer; padding: 0; }
.link-knopf:hover, .leise-link:hover { text-decoration: underline; }
.leise-link { color: var(--akzent); text-decoration: none; }
.sortiment-form > p, .sortiment-form > ol { margin: 6px 0; }
.warn { color: var(--gelb); font-weight: 600; }
table.rechte { margin: 8px 0; }
table.rechte td.mitte, table.rechte th.mitte { text-align: center; width: 72px; }
table.rechte.admin tbody { opacity: .45; }
.aufdruck-muster { display: inline-block; padding: 0 .4rem; border: 2px solid var(--rot); color: var(--rot);
  font-weight: 700; letter-spacing: .04em; transform: rotate(-3deg); }
ol.ablauf li { margin: 3px 0; }

/* Internet-Suche (KI) */
.ki-knopf { margin-top: 2px; }
.knopf.klein { padding: 1px 6px; font-size: 10px; }
.vies-ergebnis.ok, .ki-uebernommen { color: var(--gruen); font-weight: 600; }
.vies-ergebnis.warn { color: var(--rot); font-weight: 600; }
/* Karte „USt-IdNr.-Prüfung (VIES)“ */
.vies-wrap { grid-column: 2 / -1; }
.vies-karte { border: 1px solid var(--rahmen); border-left-width: 5px; border-radius: 6px; padding: .5rem .8rem; margin: .1rem 0 .3rem; background: var(--flaeche, #fff); max-width: 60rem; }
.vies-karte header { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; }
.vies-badge { font-weight: 700; padding: .05rem .55rem; border-radius: 999px; background: #eee; }
.vies-nr { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.vies-ok { border-left-color: var(--gruen, #1a7f37); }
.vies-ok .vies-badge { background: #dff3e4; color: #14532d; }
.vies-ungueltig { border-left-color: var(--rot, #b3261e); }
.vies-ungueltig .vies-badge { background: #f9dedc; color: #7f1d17; }
.vies-offen { border-left-color: #c77d00; }
.vies-offen .vies-badge { background: #fdebc8; color: #6b4200; }
.vies-leer { border-left-color: #999; }
.vies-marke { font-size: 11px; padding: .05rem .5rem; border-radius: 4px; background: #dfeaf7; color: #1a3c6b; }
.vies-marke.vies-neu { background: #fdebc8; color: #6b4200; }
.vies-daten { display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; margin: .45rem 0 .1rem; }
.vies-daten dt { color: var(--leise); }
.vies-daten dd { margin: 0; }
.vies-daten code { background: #f1f1f1; padding: 0 .3rem; border-radius: 3px; }
.vies-verlauf { margin-top: .4rem; }
.vies-verlauf summary { cursor: pointer; color: var(--leise); }
.vies-karte.vies-alt { opacity: .45; }
.vies-karte.vies-alt::after { content: "Die USt-IdNr. wurde geändert – diese Prüfung gilt für " attr(data-nr) "."; display: block; margin-top: .3rem; font-weight: 600; }
.ki-uebernommen { margin-left: 8px; }
.ki-dialog { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; }
.ki-box { background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius);
  width: min(860px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.ki-kopf { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px;
  background: linear-gradient(var(--kopf-a), var(--kopf-b)); border-bottom: 1px solid var(--rahmen); }
.ki-inhalt { padding: 8px 10px; overflow: auto; }
.ki-fuss { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--rahmen-hell); }
.ki-laeuft { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--akzent-hell), var(--akzent), var(--akzent-hell));
  background-size: 200% 100%; animation: ki-lauf 1.2s linear infinite; }
@keyframes ki-lauf { from { background-position: 200% 0; } to { background-position: 0 0; } }
.ki-treffer { display: grid; gap: 4px; }
.ki-trefferzeile { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 4px 6px;
  border: 1px solid var(--rahmen-hell); border-radius: var(--radius); background: var(--feld); cursor: pointer; }
.ki-hinweis { flex-basis: 100%; margin-left: 22px; }
.ki-vergleich td { vertical-align: top; }
.ki-vergleich tr.gleich td { color: var(--leise); }
.ki-vergleich td:nth-child(5) a { white-space: nowrap; }
.ki-abschnitt { margin: 10px 0 4px; font-weight: 600; }
.ki-personen { display: grid; gap: 3px; }
@media (prefers-reduced-motion: reduce) { .ki-laeuft { animation: none; } }
.ki-gesendet { margin: 4px 0 8px; } .ki-gesendet td:first-child { width: 120px; }
.such-hinweis:not(.fehler) { color: var(--leise); font-weight: 400; }
.such-hinweis { margin-left: 6px; }

/* Trefftabelle der Maskensuche */
.treffer-dialog .ki-box { width: min(1300px, 100%); }
.treffer-tabelle tbody tr { cursor: pointer; }
.treffer-tabelle tbody tr:hover { background: var(--feld); }
.treffer-tabelle tbody tr.gewaehlt, .treffer-tabelle tbody tr:focus { background: var(--akzent-hell); outline: none; }
.treffer-tabelle td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.treffer-dialog .ki-fuss .knopf:first-child { margin-right: auto; }

/* ---- Auftrag erfassen (Belegmaske) ------------------------------------------ */
.beleg-typ { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; max-width: 420px; }
.beleg-typ .typ-wahl { white-space: nowrap; }
.beleg-typ .typ-folgt { color: var(--leise); font-size: 10px; flex-basis: 100%; }
.beleg-feld { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.beleg-oben { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.beleg-oben textarea { width: 100%; resize: vertical; font: inherit; }
.beleg-maske .zeile { display: flex; gap: 4px; align-items: center; }
.beleg-maske .zeile > input[type="text"] { flex: 1; min-width: 0; }
.beleg-maske .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.beleg-maske input.kurz { width: 70px; flex: 0 0 auto !important; }
.leise-hinweis { background: var(--flaeche); border-color: var(--rahmen-hell); color: var(--leise); }
.eingabe-zeile { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 8px; }
.eingabe-zeile input[type="search"] { flex: 1 1 260px; min-width: 0; }
.eingabe-hinweis { color: var(--gruen); }
.eingabe-hinweis.fehler { color: var(--rot); }
.pos-rahmen { overflow-x: auto; margin: 0 8px 8px; }
.pos-tabelle { min-width: 1000px; }
.pos-tabelle td.nr { width: 32px; text-align: right; padding: 0 4px; color: var(--leise); }
.pos-tabelle td.gesamt { padding: 0 4px; white-space: nowrap; }
.pos-tabelle td.mitte { text-align: center; width: 44px; }
.pos-tabelle input[readonly] { color: var(--leise); }
.pos-tabelle tr.fehlerhaft td { background: var(--rot-hell); }
/* Meldung bei 0: Position mit Gesamtpreis 0,00 € */
.pos-tabelle tr.null-wert td.gesamt { background: #ffd8a8; color: #8a3b00; font-weight: 700; }
.pos-tabelle tr.null-wert td.gesamt::before { content: "⚠ "; }
.null-dialog .ki-box { max-width: 560px; }
.null-dialog p.wichtig { font-weight: 700; color: #8a3b00; margin: 4px 0; }
.null-liste { margin: 4px 0 8px 18px; padding: 0; }
.pos-tabelle .pos-leer { padding: 8px; color: var(--leise); text-align: center; }
.beleg-maske:not(.ist-gutschrift) .nur-gutschrift { display: none; }
.bezahlung { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 20px; margin: 6px 8px; }
.bezahlung output { display: block; text-align: right; padding: 2px 4px; background: var(--feld); border: 1px solid var(--rahmen-hell);
  border-radius: var(--radius); min-height: 18px; font-variant-numeric: tabular-nums; }
.bezahlung .zeile output { flex: 1; }
.bezahlung .summen output.brutto { font-weight: 700; font-size: 12px; }
.beleg-dialog .ki-box { width: min(1100px, 100%); }
.matrix-tabelle { width: auto; }
.matrix-tabelle td.zelle { position: relative; width: 96px; }
.matrix-tabelle td.zelle input { width: 100%; text-align: right; padding-right: 4px; }
.matrix-tabelle td.zelle small.bestand { position: absolute; left: 3px; top: 3px; font-size: 10px; color: var(--leise); pointer-events: none; }
.matrix-tabelle td.zelle small.bestand.kein-bestand { color: var(--rot); }
.matrix-tabelle td.keine { background: var(--rahmen-hell); }
/* Einzelpreis in der Matrix: Preis in Klammern unter der Menge, Zelle mit oranger Ecke */
.matrix-tabelle td.zelle.hat-preis { box-shadow: inset 0 -2px 0 #e08a00; }
.matrix-tabelle td.zelle.hat-preis input { padding-bottom: 9px; }
.matrix-tabelle td.zelle small.preis-abw { position: absolute; left: 0; right: 0; bottom: 2px; text-align: right; font-size: 8.5px; line-height: 9px;
  padding: 0 4px; color: #a85a00; font-weight: 400; pointer-events: none; white-space: nowrap; overflow: hidden; }
.mx-preis { position: fixed; z-index: 1000; min-width: 270px; display: flex; flex-direction: column; gap: 5px;
  background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.mx-preis-zeile { display: flex; align-items: center; gap: 6px; justify-content: space-between; white-space: nowrap; }
.mx-preis-zeile input { width: 90px; }
.mx-preis-zeile[hidden] { display: none; }
.mx-gr-wahl { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.mx-gr-wahl[hidden] { display: none; }
.mx-gr { min-width: 38px; padding: 3px 6px; border: 1px solid var(--rahmen); border-radius: 3px; background: var(--feld); cursor: pointer; font: inherit; }
.mx-gr:hover { border-color: #e08a00; }
.mx-gr[aria-pressed="true"] { background: #e08a00; border-color: #b36200; color: #fff; font-weight: 700; }
.mx-preis-knoepfe { display: flex; justify-content: flex-end; gap: 6px; margin-top: 2px; }
.matrix-tabelle td.nv input { text-decoration: line-through; }
.matrix-tabelle td.summe, .matrix-tabelle td:first-child { padding: 0 6px; white-space: nowrap; }
.matrix-tabelle tr.gesperrt td:first-child { color: var(--leise); text-decoration: line-through; }
.beleg-suche input[type="search"] { width: 240px; }
.beleg-suche select { width: auto; }
table.liste th.zahl, table.liste td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
/* Klappliste der Positionserfassung (Art.-Nr., Farbe, Qualität, Größe) */
.auswahl-pop { position: absolute; z-index: 900; background: var(--feld); border: 1px solid var(--rahmen); border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); max-width: 520px; font-size: 12.5px; }
.auswahl-pop .ap-kopf { padding: 2px 6px; background: var(--kopf-b); color: var(--leise); font-size: 10px; border-bottom: 1px solid var(--rahmen-hell); }
.auswahl-pop .ap-liste { max-height: 260px; overflow-y: auto; }
.auswahl-pop .ap-eintrag { display: flex; gap: 12px; justify-content: space-between; padding: 2px 6px; cursor: pointer; white-space: nowrap; }
.auswahl-pop .ap-eintrag.leise { color: var(--leise); }
.auswahl-pop .ap-eintrag.aktiv { background: var(--akzent); color: #fff; }
.auswahl-pop .ap-info { color: var(--leise); font-size: 10px; }
.auswahl-pop .ap-eintrag.aktiv .ap-info { color: #fff; }
.pos-tabelle input.wahl[readonly] { color: var(--text); cursor: pointer; }
.matrix-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; }
.matrix-kopf .abstand { margin-left: 18px; }
.matrix-tabelle td.zelle { background: #fff7b3; }
.matrix-tabelle td.zelle input { background: transparent; }
.matrix-tabelle td.zelle.hat-menge { background: #9fd36a; }
.matrix-tabelle td.zelle.hat-menge input { font-weight: 700; color: #1c1f23; }
.matrix-tabelle td.zelle.hat-menge small.bestand { color: #33421f; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .matrix-tabelle td.zelle { background: #3f3a14; }
  html:not([data-farbschema="hell"]) .matrix-tabelle td.zelle.hat-menge { background: #3e6b1d; }
  html:not([data-farbschema="hell"]) .matrix-tabelle td.zelle.hat-menge input { color: #fff; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .matrix-tabelle td.zelle { background: #3f3a14; }
html[data-farbschema="dunkel"] .matrix-tabelle td.zelle.hat-menge { background: #3e6b1d; }
html[data-farbschema="dunkel"] .matrix-tabelle td.zelle.hat-menge input { color: #fff; }
.matrix-knopf { border: 1px solid var(--rahmen); background: var(--akzent-hell); border-radius: var(--radius); cursor: pointer;
  font-size: 10.5px; line-height: 1; padding: 2px 8px; color: var(--text); }
.matrix-knopf:hover { border-color: var(--akzent); }
tr.pos:not(.mit-artikel) .matrix-knopf { visibility: hidden; }
.druck-dialog .ki-box { width: min(900px, 100%); max-height: 94vh; }
.druck-dialog.ki-dialog { padding-top: 2vh; }
.druck-dialog .ki-inhalt { padding: 8px 10px; }
.druck-dialog .ki-fuss { flex-wrap: wrap; align-items: center; }
.druck-dialog .druck-hinweis { background: var(--gelb-hell); border: 1px solid var(--gelb); color: var(--text); padding: 6px 8px; border-radius: var(--radius); }
.druck-dialog input.kurz { width: 70px; }
.inline-form { display: inline; margin: 0; }
.druck-seite textarea { width: 100%; font: inherit; }
.druck-seite .kreise td, .druck-seite .kreise th { padding: 3px 6px; }
.druck-seite .kreise input { width: 110px; }
.logo-vorschau { max-height: 48px; max-width: 220px; vertical-align: middle; margin: 0 10px; border: 1px solid var(--rahmen-hell); background: #fff; }
@keyframes scan-blitz { from { background: #9fd36a; } to { background: transparent; } }
.pos-tabelle tr.scan-treffer td { animation: scan-blitz 1.2s ease-out; }
/* ---- Beleg laden (wie NetCo) --------------------------------------------------- */
.bl-rahmen { display: flex; flex-direction: column; gap: 0; }
.bl-reiter { display: flex; gap: 2px; flex-wrap: wrap; padding: 0 4px; }
.bl-reiter a { padding: 4px 12px; border: 1px solid var(--rahmen); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--kopf-b); color: var(--text); text-decoration: none; }
.bl-reiter a.aktiv { background: var(--flaeche); font-weight: 600; position: relative; top: 1px; }
.bl-reiter a.bl-reiter-neu { background: #ffb347; color: #000; font-weight: 700; border-color: #c97a00; }
.bl-reiter a.bl-reiter-neu.aktiv { background: #ffc978; }
.shop-status.shop-neu { background: #ffb347; color: #000; padding: 0 6px; border-radius: var(--radius); }
.bl-filter { display: grid; grid-template-columns: minmax(150px, 220px) minmax(280px, 1fr) minmax(260px, 380px); gap: 10px;
  padding: 10px; background: var(--flaeche); border: 1px solid var(--rahmen); margin-bottom: 8px; }
@media (max-width: 900px) { .bl-filter { grid-template-columns: 1fr; } }
.bl-arten { border: 1px solid var(--rahmen-hell); border-radius: var(--radius); background: var(--feld); padding: 8px 10px; margin: 0;
  display: flex; flex-direction: column; gap: 6px; }
.bl-folgt { font-size: 10px; margin-top: 4px; }
.bl-mitte { display: flex; flex-direction: column; gap: 8px; }
.bl-nr { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.bl-nr input { flex: 1; min-width: 0; }
.bl-gruppe { border: 1px solid var(--rahmen-hell); border-radius: var(--radius); margin: 0; padding: 4px 8px 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.bl-gruppe legend { padding: 0 4px; }
.bl-kunden { display: flex; flex-direction: column; gap: 4px; }
.bl-kunde-titel { font-weight: 600; }
.bl-kundenzeile { display: flex; gap: 4px; }
.bl-kundenzeile input { flex: 1; min-width: 0; }
.bl-legende { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; font-size: 10px; }
.bl-legende span { padding: 1px 6px; border: 1px solid var(--rahmen-hell); border-radius: var(--radius); }
/* Zustand der Belege */
.st-entwurf, .bl-tabelle tr.st-entwurf td { background: #fff4c2; }
.st-rechnung, .bl-tabelle tr.st-rechnung td { background: #e6f4e3; }
.st-lieferschein, .bl-tabelle tr.st-lieferschein td { background: #e3eef9; }
.st-gutschrift, .bl-tabelle tr.st-gutschrift td { background: #f9e3e3; }
.st-angebot, .bl-tabelle tr.st-angebot td { background: #f3ecdc; }
.st-auftrag, .bl-tabelle tr.st-auftrag td { background: #e9e3f6; }
.st-packliste, .bl-tabelle tr.st-packliste td { background: #e2f1f1; }
.st-auswahl, .bl-tabelle tr.st-auswahl td { background: #fdeede; }
.st-auswahl_zurueck, .bl-tabelle tr.st-auswahl_zurueck td { background: #f1f1e0; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .st-entwurf, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-entwurf td { background: #3a3315; }
  html:not([data-farbschema="hell"]) .st-rechnung, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-rechnung td { background: #1d3320; }
  html:not([data-farbschema="hell"]) .st-lieferschein, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-lieferschein td { background: #1c2c3d; }
  html:not([data-farbschema="hell"]) .st-gutschrift, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-gutschrift td { background: #3b1f1f; }
  html:not([data-farbschema="hell"]) .st-angebot, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-angebot td { background: #3a3323; }
  html:not([data-farbschema="hell"]) .st-auftrag, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-auftrag td { background: #2d2640; }
  html:not([data-farbschema="hell"]) .st-packliste, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-packliste td { background: #1d3535; }
  html:not([data-farbschema="hell"]) .st-auswahl, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-auswahl td { background: #3d2e1c; }
  html:not([data-farbschema="hell"]) .st-auswahl_zurueck, html:not([data-farbschema="hell"]) .bl-tabelle tr.st-auswahl_zurueck td { background: #353520; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .st-entwurf, html[data-farbschema="dunkel"] .bl-tabelle tr.st-entwurf td { background: #3a3315; }
html[data-farbschema="dunkel"] .st-rechnung, html[data-farbschema="dunkel"] .bl-tabelle tr.st-rechnung td { background: #1d3320; }
html[data-farbschema="dunkel"] .st-lieferschein, html[data-farbschema="dunkel"] .bl-tabelle tr.st-lieferschein td { background: #1c2c3d; }
html[data-farbschema="dunkel"] .st-gutschrift, html[data-farbschema="dunkel"] .bl-tabelle tr.st-gutschrift td { background: #3b1f1f; }
html[data-farbschema="dunkel"] .st-angebot, html[data-farbschema="dunkel"] .bl-tabelle tr.st-angebot td { background: #3a3323; }
html[data-farbschema="dunkel"] .st-auftrag, html[data-farbschema="dunkel"] .bl-tabelle tr.st-auftrag td { background: #2d2640; }
html[data-farbschema="dunkel"] .st-packliste, html[data-farbschema="dunkel"] .bl-tabelle tr.st-packliste td { background: #1d3535; }
html[data-farbschema="dunkel"] .st-auswahl, html[data-farbschema="dunkel"] .bl-tabelle tr.st-auswahl td { background: #3d2e1c; }
html[data-farbschema="dunkel"] .st-auswahl_zurueck, html[data-farbschema="dunkel"] .bl-tabelle tr.st-auswahl_zurueck td { background: #353520; }
.bl-tabelle tbody tr:hover td, .bl-tabelle tbody tr:focus td { background: var(--akzent-hell); }
.bl-knoepfe { display: flex; justify-content: flex-end; gap: 6px; }
.bl-tabelle { width: 100%; }
.bl-tabelle tbody tr { cursor: pointer; }
.bl-tabelle tbody tr:focus { background: var(--akzent-hell); outline: none; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Druckdialog wie NetCo: Buchung, Vermerk, Zusatzangaben, Zahlungsbedingung, Summen, Druck */
.dd { display: flex; flex-direction: column; gap: 6px; }
.dd-box { border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 4px 8px 6px; margin: 0; min-width: 0;
  background: linear-gradient(var(--flaeche), var(--kopf-a)); }
.dd-box > legend { padding: 0 4px; font-weight: 600; }
.dd-box[disabled] { opacity: .6; }
.dd-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; align-items: center; }
.dd-paar { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; }
.dd-art[disabled] { opacity: .45; cursor: not-allowed; }
.zl-arten .zl-art.aus { opacity: .45; cursor: not-allowed; }
.dd-art { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 28px; padding: 2px 8px;
  font: inherit; color: var(--text); border: 1px solid var(--rahmen); border-radius: var(--radius);
  background: linear-gradient(var(--feld), var(--kopf-b)); cursor: pointer; text-align: right; }
.dd-art:hover { border-color: var(--akzent); background: linear-gradient(var(--feld), var(--akzent-hell)); }
.dd-art svg { width: 22px; height: 22px; }
.dd-betrag { height: 30px; font-size: 1.15em; }
.dd-betrag.ungueltig, input.ungueltig { border-color: var(--rot); background: var(--rot-hell); }
.dd-gut { display: flex; align-items: center; gap: 6px; }
.dd-gut .dd-gut-nr { white-space: nowrap; }
.dd-skonto { display: grid; grid-template-columns: 1fr auto 1.4fr; gap: 4px; align-items: center; }
.dd-skonto input { height: 30px; font-size: 1.15em; }
.dd-hilfe { grid-column: 1 / -1; }
.dd-gutliste { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; padding: 4px; background: var(--feld);
  border: 1px solid var(--akzent); border-radius: var(--radius); }
.dd-gut-zeile { text-align: left; font: inherit; padding: 3px 6px; border: 0; background: transparent; cursor: pointer; color: var(--text); }
.dd-gut-zeile:hover, .dd-gut-zeile:focus { background: var(--akzent-hell); }
.dd-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dd-vermerk { display: grid; grid-template-columns: auto auto; gap: 4px 12px; align-items: center; justify-content: start; }
.dd-vermerk label.leise { justify-self: end; }
svg.mini { width: 16px; height: 16px; vertical-align: -3px; }
.dd-zb { display: grid; grid-template-columns: 1fr 2fr auto 70px auto 60px; gap: 4px 6px; align-items: center; margin-bottom: 4px; }
.dd-staffel tbody tr { cursor: pointer; }
.dd-staffel tbody tr:hover, .dd-staffel tbody tr:focus { background: var(--akzent-hell); outline: none; }
.dd-staffel td { padding: 1px 4px; }
.dd-unten { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 6px; align-items: stretch; }
.dd-unten > [hidden] { display: none; }
/* Angebot: Bereiche, die es dort nicht gibt, bleiben sichtbar, sind aber ausgegraut (deaktiviert) */
.dd-aus { opacity: .5; }
/* Angebot: nicht benötigte Bereiche des Druckdialogs (Buchung, Bezahlung, Zusatzangaben, Zahlungsbedingung, Empfangen/Differenz) ausblenden */
fieldset.dd-aus, .dd-kacheln.dd-aus { display: none; }
.dd-aus * { cursor: not-allowed; }
.dd-kacheln { display: grid; gap: 6px; }
.dd-kachel { display: flex; flex-direction: column; border: 1px solid var(--rahmen); border-radius: var(--radius);
  background: linear-gradient(var(--flaeche), var(--kopf-a)); padding: 4px 8px; }
.dd-kachel b { font-size: 1.6em; }
.dd-kachel output { font-size: 1.9em; text-align: center; padding: 6px 0; }
.dd-kachel.dd-warnung output { color: var(--rot); }
.dd-druck .felder { gap: 3px 8px; }
.dd-druck input.kurz { width: 60px; }
.dd-ablage { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; display: inline-block; }
.dd-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.dd-knoepfe .knopf { display: inline-flex; align-items: center; gap: 6px; }
.dd-drucken { font-weight: 600; }
.dd-zahlungen { padding: 4px 10px 8px; border-top: 1px solid var(--rahmen-hell); }
@media (max-width: 760px) {
  .dd-raster { grid-template-columns: 1fr; }
  .dd-hilfe { grid-column: 1 / -1; }
  .dd-zwei, .dd-unten { grid-template-columns: 1fr; }
  .dd-zb { grid-template-columns: 1fr 1fr; }
}

/* Teilzahlungen */
.zl-arten { flex-wrap: wrap; }
.zl-art { position: relative; cursor: pointer; }
.zl-art input { position: absolute; opacity: 0; pointer-events: none; }
.zl-art.aktiv { background: var(--akzent-hell); border-color: var(--akzent); }
.zl-art:focus-within { outline: 2px solid var(--akzent); }
.zl-zahlbetrag .knoepfe { align-items: center; padding: 0 8px; }
.zl-gross { font-size: 1.6em; font-weight: 700; white-space: nowrap; }
.zl-gross output { display: inline-block; min-width: 150px; text-align: right; padding: 2px 8px; background: var(--feld);
  border: 1px solid var(--rahmen); border-radius: var(--radius); }
.zl { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 8px; align-items: start; }
.zl-links .felder hr { width: 100%; border: 0; border-top: 1px dashed var(--rahmen); margin: 2px 0; }
.zl-feld { padding: 2px 4px; border: 1px solid var(--rahmen-hell); background: var(--grund); min-height: 20px; border-radius: 2px; }
#zf:not(.ist-gut) .zl-nur-gut, #zf:not(.ist-bank) .zl-nur-bank { display: none; }
#zl_betrag { background: #e8fbff; }
.zl-belege td.eng { width: 70px; }
.zl-belege tr.zl-bezahlt td { color: var(--leise); }
.zl-belege tr.zl-voll td { background: var(--gruen-hell); }
.zl-belege tbody tr { cursor: default; }
.zl-belege td, .zl-belege th { padding: 2px 4px; }
.zl-vorgaben { margin: 10px 8px 8px; padding-top: 6px; border-top: 1px solid var(--rahmen-hell); }
.zl-hilfe { margin: 4px 8px; }
.zl-historie { margin-top: 8px; }
.zl-fuss { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 1.15em; }
.zl-fuss output { min-width: 120px; padding: 1px 6px; background: var(--feld); border: 1px solid var(--rahmen); text-align: right; }
.bl-offen { color: var(--rot); font-weight: 600; }
@media (max-width: 900px) { .zl { grid-template-columns: 1fr; } }
.panel > table.zl-belege { width: calc(100% - 16px); }
/* falsche Eingabe in der Positionszeile (z. B. Größe gibt es nicht): deutlich rot */
.pos-tabelle tr.fehlerhaft td { background: #f6bdb6; }
.pos-tabelle tr.fehlerhaft input[aria-invalid=true] { color: var(--rot); font-weight: 700; background: #fff; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .pos-tabelle tr.fehlerhaft td { background: #5a2420; }
  html:not([data-farbschema="hell"]) .pos-tabelle tr.fehlerhaft input[aria-invalid=true] { background: var(--feld); }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .pos-tabelle tr.fehlerhaft td { background: #5a2420; }
html[data-farbschema="dunkel"] .pos-tabelle tr.fehlerhaft input[aria-invalid=true] { background: var(--feld); }
.zl-ueber-info { color: var(--gelb); background: var(--gelb-hell); padding: 1px 4px; border-radius: 2px; }
.zl-guthaben > h2 { background: linear-gradient(var(--gelb-hell), var(--gelb-hell)); }
.ue-form { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ue-form select { width: auto; max-width: 260px; }
.ue-form .ue-nr { width: 130px; } .ue-form .ue-betrag { width: 80px; }
.ue-zuo { white-space: nowrap; }
.ue-tabelle td { vertical-align: top; }
/* Teilzahlung als Fenster aus „Beleg laden“ */
.zl-fenster .ki-box { width: min(1400px, 100%); height: 92vh; max-height: 92vh; }
.zl-fenster.ki-dialog { padding-top: 3vh; }
.zl-fenster iframe { flex: 1; border: 0; width: 100%; background: var(--grund); }
.bl-zahl { display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; border: 1px solid var(--rahmen);
  border-radius: var(--radius); background: linear-gradient(var(--feld), var(--kopf-b)); cursor: pointer; }
.bl-zahl svg { width: 16px; height: 16px; }
.bl-zahl:hover { border-color: var(--akzent); }
/* Typ wie NetCo: senkrechte Liste links in der Maske */
.beleg-oben { grid-template-columns: minmax(120px, 140px) repeat(auto-fit, minmax(230px, 1fr)); }
.typ-liste { display: flex; flex-direction: column; gap: 2px; margin: 6px 8px; padding: 4px 6px; background: var(--feld);
  border: 1px solid var(--rahmen-hell); }
.typ-liste .typ-wahl { display: flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.typ-liste .typ-wahl.aus { color: var(--leise); opacity: .6; cursor: default; }
@media (max-width: 700px) { .beleg-oben { grid-template-columns: 1fr; } }
.dv-karte { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); padding: 4px 10px 8px; margin: 8px; max-width: 900px; }
.dv-karte h3 { margin: 4px 0 6px; font-size: 1.1em; }
.dv-haken { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.dv-knoepfe { display: flex; gap: 6px; margin-top: 6px; }
.dv-hilfe { max-width: 900px; }
/* Teilzahlungen neu geordnet: Kontoübersicht, 1. Rechnungen, 2. Zahlung, 3. Guthaben, 4. Zahlungen */
.felder .span5 { grid-column: 2 / -1; }
.zl-suche .zl-vorgaben { align-items: center; gap: 4px; padding: 0 6px; }
.zl-suche .zl-vorgaben input { width: 150px; }
.zl-konto { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.zl-konto > div { display: flex; flex-direction: column; gap: 1px; padding: 4px 10px; background: var(--feld);
  border: 1px solid var(--rahmen); border-radius: var(--radius); }
.zl-konto b { font-size: 1.45em; }
.zl-k-zahl b { text-align: right; }
.zl-k-guthaben { background: var(--gelb-hell) !important; border-color: var(--gelb) !important; }
.zl-k-saldo { background: linear-gradient(var(--feld), var(--kopf-a)) !important; }
.zl-rechnungen, .zl-zahlung { margin-bottom: 8px; }
.panel > table.zl-belege { width: calc(100% - 16px); }
.zl-arten { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 8px; }
.zl-arten .zl-art { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 70px; padding: 4px 6px;
  border: 1px solid var(--rahmen); border-radius: var(--radius); background: linear-gradient(var(--feld), var(--kopf-b)); cursor: pointer; }
.zl-arten .zl-art svg { width: 24px; height: 24px; }
.zl-arten .zl-art.aktiv { background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
.zl-form { margin: 6px 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.zl-betrag-feld { display: flex; align-items: center; gap: 8px; }
.zl-betrag-feld label { font-size: 1.4em; font-weight: 700; min-width: 120px; }
.zl-betrag-feld #zl_betrag { width: 200px; font-size: 1.8em; height: 38px; background: #e8fbff; }
.zl-buchen { font-size: 1.3em; padding: 6px 18px; display: inline-flex; align-items: center; gap: 6px; }
.zl-buchen svg { width: 22px; height: 22px; }
.zl-verteilt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.zl-details { max-width: 1100px; }
@media (max-width: 900px) { .zl-konto { grid-template-columns: 1fr 1fr; } }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .zl-betrag-feld #zl_betrag, html:not([data-farbschema="hell"]) #zl_betrag { background: var(--feld); }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .zl-betrag-feld #zl_betrag, html[data-farbschema="dunkel"] #zl_betrag { background: var(--feld); }
/* Zahlung zweispaltig: links Betrag und Angaben, rechts die Zahlungsarten */
.zl-zwei { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; align-items: start; }
.zl-arten.zl-arten-rechts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 6px 8px 8px 0; align-content: start; }
.zl-arten.zl-arten-rechts .zl-art { flex-direction: row; justify-content: flex-start; gap: 8px; min-width: 0; padding: 5px 8px; }
@media (max-width: 900px) { .zl-zwei { grid-template-columns: 1fr; } }
/* Fenster in der Größe ziehbar (Ecke unten rechts); die Größe wird je Fenster gemerkt */
.ki-dialog[data-groesse-merken] { justify-content: flex-start; align-items: flex-start; padding: 2vh 2vw; }
.ki-dialog[data-groesse-merken] .ki-box { resize: both; overflow: hidden; width: min(1400px, 96vw); height: 92vh;
  max-width: 96vw; max-height: 96vh; min-width: 480px; min-height: 300px; }
/* NetCo-Übernahme */
.netco-quellen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; }
.netco-quelle { font-size: 11px; border: 1px solid var(--rahmen-hell); border-radius: 9px; padding: 0 8px; background: var(--flaeche); }
.netco-quelle.fehlt { color: var(--leise); font-style: italic; }
.netco-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0; }
.netco-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.netco-tabelle tr.netco-fertig > td { color: var(--leise); background: #eef0f2; }
.netco-hinweis { font-size: 11px; }
.netco-env { background: var(--feld); border: 1px solid var(--rahmen); padding: 6px 10px; margin: 6px 0; }
/* NetCo-Übernahme: Anzahl, Prüfung, Stichprobe */
.netco-anzahl { font-size: 12px; }
.netco-anzahl b { font-size: 13px; }
h3 .netco-anzahl { font-weight: 400; color: var(--leise); margin-left: 6px; }
.netco-abgleich { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.netco-kachel { flex: 1 1 320px; padding: 8px 12px; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); }
.netco-kachel h3 { margin: 0 0 4px; font-size: 14px; }
.netco-kachel p { margin: 2px 0; }
.netco-pruefung b.negativ { color: var(--rot); }
.netco-vergleich td { vertical-align: top; }
.netco-vergleich td.netco-roh { color: var(--leise); font-family: Consolas, monospace; font-size: 11px; white-space: pre-wrap; }
.netco-vergleich tr.netco-ungleich > td { background: var(--rot-hell); }
.netco-stichprobe { margin-top: 6px; }
.netco-pruefung details { margin-top: 12px; }
/* Angebote: Umwandeln, aktiv / nicht aktiv */
.angebot-leiste { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); }
.angebot-leiste.inaktiv { background: #e4e4e4; border-color: #9a9a9a; }
.al-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0; }
.al-zeile form { margin: 0; }
.al-status { font-size: 13px; }
.angebot-leiste.inaktiv .al-status { color: #555; }
.al-trenner { width: 1px; align-self: stretch; background: var(--rahmen); margin: 0 4px; }
.al-titel { color: var(--leise); }
/* nicht aktive Angebote in Listen */
.st-inaktiv-leg { background: #dedede; border: 1px solid #8a8a8a; color: #555; text-decoration: line-through; padding: 0 6px; border-radius: 3px; }
tr.st-inaktiv > td { background: #dedede !important; color: #6b6b6b; text-decoration: line-through; text-decoration-color: rgba(80,80,80,.55); }
tr.st-inaktiv > td .marke-inaktiv { text-decoration: none; display: inline-block; font-size: 10px; border: 1px solid #8a8a8a; border-radius: 9px; padding: 0 6px; background: #f2f2f2; color: #555; margin-left: 4px; }
/* Listen (Kunden, Artikel, Lieferanten, Vertreter) als frei verschiebbares, in der Größe änderbares Fenster */
.liste-panel { position: fixed; z-index: 900; display: flex; flex-direction: column; background: var(--flaeche);
  border: 1px solid var(--rahmen); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.38);
  overflow: hidden; min-width: 360px; min-height: 240px; max-width: 99vw; max-height: 99vh; }
.lp-kopf { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: move; user-select: none; touch-action: none;
  font-size: 13px; background: linear-gradient(#fbfcfd, #e9edf2); border-bottom: 1px solid var(--rahmen); }
.lp-titel { font-weight: 700; font-size: 14px; flex: 1 1 auto; }
.lp-groessen { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: rgba(0,0,0,.07); }
.lp-gr { cursor: pointer; border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; color: inherit; }
.lp-gr:hover { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.lp-zu { cursor: pointer; display: inline-flex; align-items: center; gap: 7px; margin-left: 4px; border: 1px solid rgba(0,0,0,.22); background: rgba(255,255,255,.55); font: inherit; font-size: 12px; font-weight: 600; line-height: 1; padding: 6px 12px 6px 9px; border-radius: 999px; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: background .15s, color .15s, border-color .15s, box-shadow .15s; }
.lp-zu .lp-x { font-size: 13px; }
.lp-zu:hover { background: #e5484d; border-color: #e5484d; color: #fff; box-shadow: 0 2px 8px rgba(229,72,77,.45); }
.lp-zu:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.liste-iframe { flex: 1; width: 100%; border: 0; background: var(--grund); }
.lp-griff { position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 50%, #8a94a3 50% 58%, transparent 58% 70%, #8a94a3 70% 78%, transparent 78%); }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .lp-kopf { background: linear-gradient(#2d3238, #252a30); }
  html:not([data-farbschema="hell"]) .lp-gr:hover { background: #3a4048; }
  html:not([data-farbschema="hell"]) .lp-zu { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .lp-kopf { background: linear-gradient(#2d3238, #252a30); }
html[data-farbschema="dunkel"] .lp-gr:hover { background: #3a4048; }
html[data-farbschema="dunkel"] .lp-zu { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
/* Auftrag erfassen: Bezahlung (Summen) immer unten sichtbar */
.beleg-maske .beleg-bezahlung { position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -6px 14px -8px rgba(0,0,0,.35); }
@media print { .beleg-maske .beleg-bezahlung { position: static; box-shadow: none; } }
/* Auftrag erfassen wie NetCo: Maske füllt das Fenster, „Eingabe“ wächst,
   „Bezahlung“ sitzt immer am unteren Rand (auch bei wenigen Positionen) */
.inhalt:has(> .beleg-maske), .inhalt:has(> form.beleg-maske) { display: flex; flex-direction: column; }
.inhalt:has(> form.beleg-maske) { min-height: 0; overflow-y: auto; }
.inhalt > .beleg-maske { flex: 1 1 auto; min-height: 560px; }
/* fieldset gibt Flex-Höhe nicht an seine Kinder weiter → Kinder direkt ins Formular-Raster */
.beleg-maske > .beleg-feld { display: contents; }
.beleg-maske .beleg-eingabe { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
/* Eingabe: eigener Rollbalken rechts, Spaltenköpfe bleiben stehen */
.beleg-maske .beleg-eingabe .pos-rahmen { flex: 1 1 0; min-height: 110px; overflow-x: auto; overflow-y: scroll; background: var(--feld); }
.beleg-maske .pos-rahmen .pos-tabelle thead th { position: sticky; top: 0; z-index: 2; }
.beleg-maske .pos-rahmen::-webkit-scrollbar { width: 14px; height: 12px; }
.beleg-maske .pos-rahmen::-webkit-scrollbar-track { background: var(--kopf-a); border-left: 1px solid var(--rahmen); }
.beleg-maske .pos-rahmen::-webkit-scrollbar-thumb { background: var(--kopf-b); border: 1px solid var(--rahmen); border-radius: 3px; }
.beleg-maske .pos-rahmen::-webkit-scrollbar-button:single-button { display: block; height: 14px; background: var(--kopf-a); border: 1px solid var(--rahmen); }
.beleg-maske .pos-rahmen::-webkit-scrollbar-button:single-button:vertical:decrement { background: var(--kopf-a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 6L4 0L8 6z' fill='%23555'/%3E%3C/svg%3E") center no-repeat; }
.beleg-maske .pos-rahmen::-webkit-scrollbar-button:single-button:vertical:increment { background: var(--kopf-a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0L4 6L8 0z' fill='%23555'/%3E%3C/svg%3E") center no-repeat; }
.beleg-maske .pos-rahmen::-webkit-scrollbar-button:horizontal { display: none; }
.beleg-maske .beleg-bezahlung { margin-top: auto; }
/* Kontrolle/Buchhaltung */
.bh-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.bh-box { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--rahmen); border-radius: var(--radius);
  background: var(--flaeche); padding: 2px 8px 6px; min-width: 160px; }
.bh-box legend { font-weight: 600; padding: 0 4px; }
.bh-box legend.bh-unter { font-weight: 600; padding: 4px 0 0; float: none; }
.bh-box input[type=date] { width: 130px; }
.bh-box .bh-kurz { width: 120px; }
.bh-knoepfe { display: flex; flex-direction: column; gap: 4px; justify-content: flex-end; max-width: 220px; }
.bh-rahmen { overflow-x: auto; margin: 6px 8px; }
.bh-tabelle { width: 100%; }
.bh-tabelle tbody tr { cursor: default; }
.bh-tabelle tbody tr.bh-markiert td { background: var(--akzent-hell) !important; }
.bh-tabelle td.nr a { font-weight: 600; text-decoration: none; }
.bh-tabelle tfoot td { font-weight: 700; border-top: 2px solid var(--rahmen); background: var(--kopf-a); }
/* Klapplisten Kunde und Art.-Nr. */
.kunde-pfeil { padding: 1px 8px; }
.pos-tabelle input[name="p_nr"] { background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%);
  background-position: calc(100% - 9px) 50%, calc(100% - 5px) 50%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 14px; }
/* Positionen als Matrix: eine Zeile je Artikel, Felder aus der Matrix schwarz */
.ansicht-knopf { min-width: 92px; } .ansicht-knopf span { white-space: normal; max-width: 90px; text-align: center; }
.ansicht-knopf[aria-pressed="true"] { background: var(--akzent-hell); border-color: var(--akzent); }
.pos-tabelle tr.matrix-zeile td { background: var(--feld); font-weight: 600; height: 19px; }
.pos-tabelle tr.matrix-zeile td.schwarz { background: #000 !important; }
.pos-tabelle tr.matrix-zeile .mz-wert { display: block; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-tabelle tr.matrix-zeile .mz-wert.zahl { text-align: right; }
.pos-tabelle tr.matrix-zeile:hover td:not(.schwarz) { background: var(--akzent-hell); cursor: default; }

/* Größenmatrix kompakt und gleichmäßig: feste Zellgröße (mit und ohne Einzelpreis gleich hoch),
   Größe als Spaltenkopf deutlich, Menge gut lesbar, Variantenspalte nur so breit wie nötig */
.matrix-tabelle { width: auto !important; }
.matrix-tabelle th { font-size: 11px; font-weight: 700; text-align: center !important; padding: 3px 4px; }
.matrix-tabelle th:first-child { text-align: left !important; }
.matrix-tabelle td.zelle { width: 104px; min-width: 104px; max-width: 104px; height: 34px; padding: 0; vertical-align: middle; }
.matrix-tabelle td.zelle input { height: 34px; font-size: 13px; padding: 0 6px 0 18px; border: 0; }
.matrix-tabelle td.zelle small.bestand { position: absolute; font-size: 9px; line-height: 10px; top: 2px; left: 3px; }
.matrix-tabelle td.zelle small.bestand::before { content: "B "; opacity: .7; }
.matrix-tabelle td.summe { font-weight: 700; text-align: right; min-width: 44px; }
.matrix-tabelle td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* Spalte „Lager“ in Auftrag erfassen und Fenster Bestand je Lager */
.pos-tabelle td.lager-spalte { width: 52px; text-align: center; padding: 0 2px; }
.lager-knopf { width: 100%; min-height: 18px; border: 1px solid transparent; background: transparent; text-align: center; font: inherit;
  font-variant-numeric: tabular-nums; cursor: pointer; color: var(--link, #1a5fb4); text-decoration: underline dotted; padding: 0 4px; }
.lager-knopf:hover, .lager-knopf:focus-visible { border-color: var(--rahmen); background: var(--feld); }
.lager-knopf:empty { text-decoration: none; }
.lager-knopf.kein-bestand { color: var(--rot, #c0392b); font-weight: 700; }
.lager-knopf.knapp { color: #b36200; font-weight: 700; }
.lager-dialog .ki-box { min-width: 460px; max-width: 92vw; width: auto; }
.lager-titel { font-size: 12px; margin: 8px 0 4px; }
.lager-tabelle { width: auto !important; min-width: 380px; }
.lager-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; min-width: 54px; }
.lager-tabelle td, .lager-tabelle th { padding: 2px 8px; }
.lager-tabelle td.kein-bestand { color: var(--rot, #c0392b); }
.lager-tabelle tr.gewaehlt td { font-weight: 700; background: #fff7b3; }
.lager-tabelle tr.eigene td { background: #dff0c8; }
.lager-tabelle td.gew-lager { background: #fff7b3; font-weight: 700; }
.lager-tabelle tfoot th { font-weight: 700; }
.lager-rahmen { max-height: 50vh; overflow: auto; }

/* Größenmatrix: Freimenge links neben der Menge */
.matrix-tabelle td.zelle { width: 104px; min-width: 104px; max-width: 104px; height: 34px; }
.matrix-tabelle td.zelle input { padding-left: 34px; }
.matrix-tabelle td.zelle small.frei { position: absolute; left: 3px; top: auto; bottom: 2px; font-size: 9px; line-height: 10px; color: #1a5fb4;
  font-weight: 600; pointer-events: none; font-variant-numeric: tabular-nums; }
.matrix-tabelle td.zelle small.frei.null { color: var(--leise); font-weight: 400; }
.matrix-tabelle td.zelle small.frei.minus, .mx-frei-ges b.minus { color: var(--rot); }
.matrix-tabelle td.zelle small.frei::before { content: "F "; font-weight: 400; opacity: .7; }
.mx-frei-ges b { color: #1a5fb4; }

/* Fenster Lagerbestand: Stammdaten, Filter, Matrix (Mengen mittig) */
#positionen th:nth-last-child(2), #positionen th:nth-last-child(3) { text-align: center; }
.pos-tabelle .lager-ges { font-weight: 700; }
.lager-stamm { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 14px; padding: 6px 8px;
  border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); margin-bottom: 8px; max-width: 900px; }
.ls-feld { display: flex; gap: 6px; min-width: 0; }
.ls-feld.breit { grid-column: 1 / -1; }
.ls-name { color: var(--leise); white-space: nowrap; }
.ls-name::after { content: ":"; }
.ls-wert { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-feld.breit .ls-wert { white-space: normal; font-weight: 400; }
.lager-filter { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 6px; }
.lager-filter label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lager-matrix { width: auto !important; }
.lager-matrix th, .lager-matrix td { text-align: center; padding: 2px 6px; }
.lager-matrix td.lm-var, .lager-matrix th:first-child { text-align: left; white-space: nowrap; }
.lager-matrix .lm-zelle { min-width: 52px; text-align: center; line-height: 1.15; }
.lager-matrix .lm-zelle b { display: block; font-size: 12px; }
.lager-matrix .lm-zelle b.kein-bestand { color: var(--leise); font-weight: 400; }
.lager-matrix .lm-frei { display: block; font-size: 9.5px; color: #1a5fb4; }
.lager-matrix .lm-frei.minus { color: var(--rot); }
.lager-matrix td.keine { background: var(--rahmen-hell); }
.lager-matrix td.eigene { box-shadow: inset 0 0 0 2px #4c9a2a; background: #dff0c8; }
.lager-matrix .lm-summe, .lager-matrix tfoot th { background: var(--kopf-a); }

/* Lagerbestand: Artikelliste links zum Blättern */
.lager-dialog .ki-box { width: min(1250px, 96vw); }
.lager-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 10px; min-height: 360px; }
.lager-liste { display: flex; flex-direction: column; gap: 4px; min-height: 0; border-right: 1px solid var(--rahmen); padding-right: 8px; }
.ll-eintraege { flex: 1 1 auto; height: 52vh; overflow-y: auto; border: 1px solid var(--rahmen); background: var(--feld); }
.ll-eintraege:focus { outline: 2px solid #1a5fb4; outline-offset: -2px; }
.ll-eintrag { display: grid; grid-template-columns: 78px 1fr 40px; gap: 4px; padding: 2px 6px; cursor: pointer; border-bottom: 1px solid var(--rahmen-hell); white-space: nowrap; }
.ll-eintrag span { overflow: hidden; text-overflow: ellipsis; }
.ll-eintrag:hover { background: var(--kopf-a); }
.ll-eintrag.aktiv { background: #1a5fb4; color: #fff; }
.ll-eintrag.gesperrt .ll-name { text-decoration: line-through; }
.ll-best { text-align: center; font-variant-numeric: tabular-nums; }
.ll-best.kein-bestand { color: var(--rot); }
.ll-eintrag.aktiv .ll-best.kein-bestand { color: #ffd0cc; }
.lager-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lager-nav .ln-pos { min-width: 130px; text-align: center; font-weight: 600; }
.lager-nav .primaer { margin-left: auto; }
.lager-inhalt.laedt { opacity: .5; }
.lager-rechts { min-width: 0; }
.lager-rechts .lager-rahmen { max-height: 42vh; }

/* Legende über der Größenmatrix */
.mx-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 6px; font-size: 11px; }
.mx-legende b { font-weight: 700; }
.mx-legende .lg-b { color: var(--leise); }
.mx-legende .lg-f { color: #1a5fb4; }
.mx-legende .lg-p { color: #a85a00; }
/* Schutz: die allgemeine Klasse .leer (Hinweisfläche mit 2rem Abstand) darf in Tabellen-/Matrixzellen nie greifen */
.matrix-tabelle .leer, .lager-matrix .leer, .ll-eintrag .leer, .pos-tabelle .lager-knopf.leer { padding: 0; }

/* Fenster „Bestand in allen Lagern“ (Doppelklick auf Ges.-Lager) */
.alle-lager-dialog .ki-box { width: min(1250px, 96vw); }
.al-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; max-height: 64vh; overflow: auto; padding: 2px; }
.al-block { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); padding: 6px 8px 8px; min-width: 0; overflow-x: auto; }
.al-block.al-gesamt { grid-column: 1 / -1; border-color: #1a5fb4; box-shadow: inset 0 3px 0 #1a5fb4; }
.al-titel { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin: 0 0 6px; }
.al-summe { font-weight: 700; color: #1a5fb4; }
.al-matrix { width: auto !important; }
.al-matrix th, .al-matrix td { text-align: center; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.al-matrix th:first-child, .al-matrix td.al-var { text-align: left; white-space: nowrap; }
.al-matrix td.al-zelle { min-width: 34px; font-weight: 600; }
.al-matrix td.al-null { color: var(--leise); font-weight: 400; }
.al-matrix td.al-minus { color: var(--rot); }
.al-matrix .al-sum, .al-matrix tfoot th { background: var(--kopf-a); font-weight: 700; }
.al-matrix td.keine { background: var(--rahmen-hell); }
.al-matrix td.eigene { box-shadow: inset 0 0 0 2px #4c9a2a; background: #dff0c8; }

/* Box „Zubuchen“ (über den Lagerfenstern) */
.zubuchen-dialog { z-index: 1100; }
.zubuchen-dialog .ki-box { width: min(1100px, 96vw); }
.zb-leiste { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 4px; }
.zb-leiste label { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.zb-grund { flex: 1 1 280px; }
.zb-rahmen { max-height: 52vh; overflow: auto; }
.zb-matrix { width: auto !important; }
.zb-matrix th { text-align: center; padding: 2px 6px; }
.zb-matrix th:first-child, .zb-matrix td.zb-var { text-align: left; white-space: nowrap; padding: 0 6px; }
.zb-matrix td.zb-zelle { position: relative; width: 70px; min-width: 70px; height: 30px; padding: 0; background: #fff7b3; }
.zb-matrix td.zb-zelle.hat-menge { background: #9fd36a; }
.zb-matrix td.zb-zelle input { width: 100%; height: 30px; border: 0; background: transparent; text-align: right; padding: 0 6px 0 28px; font-size: 12px; font-weight: 700; }
.zb-matrix td.zb-zelle small.zb-best { position: absolute; left: 3px; top: 2px; font-size: 9px; color: var(--leise); pointer-events: none; }
.zb-matrix td.keine { background: var(--rahmen-hell); }
.zb-matrix td.zb-sum { text-align: center; font-weight: 700; min-width: 44px; }
.zb-gesamt { font-weight: 700; margin: 6px 0 0; }
.al-matrix td.al-zelle, .lager-matrix td.lm-zelle { cursor: cell; }
table.raster.zb-matrix th, table.raster.al-matrix th, table.raster.lager-matrix th { text-align: center; }
table.raster.zb-matrix th:first-child, table.raster.al-matrix th:first-child, table.raster.lager-matrix th:first-child { text-align: left; }

/* Lagerraster: Spalte „Alle Lager“ (nur Anzeige) und Fenster je Lager */
table.lagerraster td.menge-alle { font-weight: 700; color: #1a5fb4; background: #eef4fc; cursor: zoom-in; text-align: center; }
table.lagerraster th.menge-alle-kopf { text-align: center; color: #1a5fb4; }
table.lagerraster td.plus { cursor: cell; }
table.lagerraster tr.lr-gebucht td, table.lagerraster tr.lr-gebucht th { animation: scan-blitz 2.4s ease-out; }
.lr-buchen .ki-box { width: min(560px, 96vw); }
.lr-verteilung .ki-box { width: min(1000px, 96vw); }
.lr-tabelle { width: 100%; }
.lr-tabelle td.eingabe input { width: 90px; text-align: right; background: #fff7b3; }
.lr-tabelle tr.gewaehlt td { font-weight: 700; background: #fff7b3; }
.lr-tabelle td.negativ { color: var(--rot); }
.lr-art { font-weight: 700; color: #1a5fb4; min-height: 1.2em; margin: 6px 0; }
.lr-grund { display: flex; gap: 6px; align-items: center; }
.lr-grund input { flex: 1; }
.lr-rahmen { max-height: 60vh; overflow: auto; }
.lr-meldung { margin: 4px 0; }

/* Einstellungen › Zuweisung Netzwerk */
.nz-tabelle td input { width: 100%; box-sizing: border-box; }
.nz-tabelle td:nth-child(1) { width: 24%; }
.nz-tabelle td:nth-child(3) { width: 30%; }
.nz-knoepfe { white-space: nowrap; }
.nz-status { font-size: 11px; }
.nz-ok { color: #1d6b2a; }
.nz-warn { color: #8a5a00; }
.nz-fehler { color: #b3261e; }
.nz-standard { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nz-standard input { flex: 1 1 320px; min-width: 0; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .nz-ok { color: #7fd48b; }
  html:not([data-farbschema="hell"]) .nz-warn { color: #f0c36a; }
  html:not([data-farbschema="hell"]) .nz-fehler { color: #ff8a80; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .nz-ok { color: #7fd48b; }
html[data-farbschema="dunkel"] .nz-warn { color: #f0c36a; }
html[data-farbschema="dunkel"] .nz-fehler { color: #ff8a80; }

/* Kundenmaske › Reiter Belege */
.kb-filter { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--rahmen-hell); border-radius: var(--radius); background: var(--feld); padding: 6px 8px; margin-bottom: 6px; }
.kb-arten, .kb-zeile { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.kb-zeile > label { display: inline; width: auto; margin: 0; }
.kb-zeile select, .kb-zeile input[type=date] { width: auto; flex: 0 0 auto; }
.kb-zeile input[type=search] { flex: 1 1 220px; width: auto; min-width: 120px; }
.kb-tabelle tbody tr { cursor: pointer; }
.kb-tabelle tbody tr:focus { outline: 2px solid var(--akzent); outline-offset: -2px; }
.kb-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 2px 0 4px; }
.kb-summen { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.kb-chip { border: 1px solid var(--rahmen-hell); border-radius: var(--radius); background: var(--feld); padding: 1px 7px; font-size: 11px; white-space: nowrap; }
.kb-chip b { font-weight: 600; }
.kb-chip.kb-wichtig { border-color: var(--akzent); background: var(--akzent-hell); font-size: 12px; }
.kb-filter { margin-bottom: 2px; }
.kb-summen[hidden], .kb-chip[hidden] { display: none; }
.kb-tabelle th[data-sort] { cursor: pointer; user-select: none; }
.kb-tabelle th[data-sort]::after { content: " " attr(data-pfeil); font-size: 9px; }
.kb-tabelle th.kb-sortiert { font-weight: 600; }
.kb-zahl { padding: 0 8px; white-space: nowrap; }
.ka-auf { width: 22px; text-align: center; }
.ka-detail > td { background: var(--flaeche); padding: 4px 8px 6px 34px; }
.ka-belege { border-collapse: collapse; background: var(--feld); border: 1px solid var(--rahmen-hell); min-width: 560px; }
.ka-belege th { font-weight: 400; font-size: 10px; text-align: left; padding: 1px 8px; color: var(--leise); border-bottom: 1px solid var(--rahmen-hell); }
.ka-belege td { padding: 1px 8px; border-top: 1px solid var(--rahmen-hell); }
.ka-belege .zahl { text-align: right; }
.ka-belege tbody tr { cursor: pointer; }
.ka-belege tbody tr:hover, .ka-belege tbody tr:focus { background: var(--akzent-hell); outline: none; }
.ka-belege tr.ka-gut td { color: #b3261e; }

/* Adressen & Kontakte in drei Spalten: Zweigstelle | Funktion, Name, Telefon | alle Angaben */
.ak3 { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(380px, 1.4fr); gap: 8px; margin: 0 8px 8px; align-items: start; }
.ak3-pane { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); min-width: 0; }
.ak3-kopf { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 3px 8px; background: var(--flaeche); border-bottom: 1px solid var(--rahmen); font-size: 10px; color: var(--leise); min-height: 22px; }
.ak3-kopf .plus { margin: 0; font-size: 10px; }
.ak3 .ak-liste { margin: 0; border: 0; border-radius: 0; max-height: 360px; min-height: 160px; }
.ak3-detail { min-width: 0; }
.ak3-detail > .editor { margin: 0; }
.oben2.ohne-editor { grid-template-columns: 1fr; }
.ak-zw { display: grid; grid-template-columns: 14px 18px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 4px 8px; cursor: pointer; border-top: 1px solid var(--rahmen-hell); min-height: 24px; }
.ak-zw:first-child { border-top: 0; }
.ak-zw:hover { background: var(--akzent-hell); }
.ak-zw.aktiv { background: var(--akzent-hell); font-weight: 600; box-shadow: inset 3px 0 0 var(--akzent); }
.ak-zw.gewaehlt { outline: 1px solid var(--akzent); outline-offset: -1px; }
.ak-zw.firma .ak-aname { font-weight: 600; }
.ak-zwname { display: flex; flex-direction: column; min-width: 0; }
.ak-zwname .ak-aname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-zwname .ak-art { align-self: flex-start; margin-top: 1px; }
.ak-ico { width: 18px; height: 18px; flex: none; }
.ak-zw .ak-zahl { font-size: 10px; font-weight: 400; color: var(--leise); border: 1px solid var(--rahmen-hell); border-radius: 9px; padding: 0 6px; min-width: 14px; text-align: center; }
.ak-kontaktliste .ak-spalten { grid-template-columns: minmax(50px, 1fr) minmax(60px, 1.1fr) minmax(70px, 1fr); gap: 6px; }
.ak-kontaktliste .ak-kontakt { grid-template-columns: minmax(50px, 1fr) minmax(60px, 1.1fr) minmax(70px, 1fr); gap: 6px; border-top: 1px solid var(--rahmen-hell); }
.ak-kontaktliste .ak-kontakt:first-of-type { border-top: 0; }
.ak-kontaktliste .ak-kontakt .ak-name { padding-left: 0; }
.ak-fkt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-fkt .ak-stern { width: 14px; }
@media (max-width: 1100px) { .ak3 { grid-template-columns: 1fr; } }
.ak-versteckt { display: none !important; }
/* ruhige Karte statt Formular */
.ak-karte { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); padding: 12px 14px; min-height: 160px; }
.ak-karte-kopf { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rahmen-hell); }
.ak-karte-titel { font-size: 15px; font-weight: 600; }
.ak-karte-unter { color: var(--leise); font-size: 11px; margin-top: 2px; }
.ak-karte-zeile { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; padding: 3px 0; }
.ak-karte-label { color: var(--leise); font-size: 11px; }
.ak-karte-wert { overflow-wrap: anywhere; }
.ak-karte-knoepfe { margin-top: 12px; }

/* Obere Reihe bei mehreren Adressen & Kontakten: Firmeninfo (schmaler) | Zweigstellen und Kontakte | Angaben */
.oben2.mehrere { grid-template-columns: minmax(380px, 1.24fr) minmax(400px, 1.12fr) minmax(330px, 1fr); align-items: stretch; }
.oben2.mehrere > #ak { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.oben2.mehrere > #firmeninfo, .oben2.mehrere > #editor { margin: 0; }
.oben2.mehrere > #ak .ak-kopf { margin: 4px 8px; gap: 6px; }
.oben2.mehrere > #ak .ak-kopf .suchfeld { flex: 1 1 140px; min-width: 100px; }
.oben2.mehrere .ak3 { grid-template-columns: minmax(130px, 1fr) minmax(175px, 1.2fr); margin: 0 8px 8px; }
.oben2.mehrere .ak3 { flex: 1; align-items: stretch; }
.oben2.mehrere .ak3 .ak-liste { height: 230px; min-height: 230px; max-height: 230px; }
.ak-gruppenkopf { display: grid; grid-template-columns: 18px 18px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 4px 8px; cursor: pointer; border-top: 1px solid var(--rahmen-hell); background: var(--flaeche); font-weight: 600; min-height: 24px; }
.ak-gruppenkopf:hover, .ak-gruppenkopf:focus { background: var(--akzent-hell); outline: none; }
.ak-gruppenkopf .ak-zahl { font-size: 10px; font-weight: 400; color: var(--leise); border: 1px solid var(--rahmen-hell); border-radius: 9px; padding: 0 6px; background: var(--feld); }
.ak-zw.eingerueckt { padding-left: 24px; }
@media (max-width: 1250px) { .oben2.mehrere { grid-template-columns: 1fr; } }
.ak-werkzeuge { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ak-neu { position: relative; display: inline-block; }
.ak-menue { position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 2px; min-width: 260px; display: flex; flex-direction: column;
  background: var(--feld); border: 1px solid var(--rahmen); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.ak-menue[hidden] { display: none; }
.ak-menue button { text-align: left; border: 0; background: transparent; padding: 6px 10px; cursor: pointer; font: inherit; }
.ak-menue button:hover, .ak-menue button:focus { background: var(--akzent-hell); outline: none; }
.ak-menue button[hidden] { display: none; }
#ak-loeschen:disabled { opacity: .5; cursor: not-allowed; }
span.matrix-knopf { cursor: pointer; }
/* Daten löschen */
#dl-alles-box[hidden] { display: none; }
.daten-loeschen .dl-unter { margin-left: 22px; }
.daten-loeschen .dl-alles { display: block; margin: 6px 0; }
.daten-loeschen label.haken { display: block; margin: 3px 0; white-space: normal; }
.daten-loeschen { max-width: 100%; overflow-wrap: anywhere; }
.netco-test { margin: 4px 0 4px 18px; }
/* Artikelmaske: Klappliste am Suchfeld */
.suche-klapp { position: absolute; left: 0; top: 100%; z-index: 60; width: 560px; max-width: 90vw; max-height: 360px; overflow-y: auto;
  background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 2px 0; }
.suche-klapp .sk-zeile { display: grid; grid-template-columns: 110px 1fr 140px 50px; gap: 8px; padding: 2px 8px; cursor: pointer; white-space: nowrap; }
.suche-klapp .sk-zeile > * { overflow: hidden; text-overflow: ellipsis; }
.suche-klapp .sk-zeile:hover { background: var(--akzent-hell); }
.suche-klapp .sk-zeile.aktiv { background: var(--akzent); color: #fff; }
.suche-klapp .sk-zeile.gesperrt:not(.aktiv) { color: var(--leise); }
.suche-klapp .sk-lief { color: var(--leise); }
.suche-klapp .sk-zeile.aktiv .sk-lief { color: inherit; }
.suche-klapp .sk-bestand { text-align: right; }
.suche-klapp .sk-leer { padding: 3px 8px; color: var(--leise); font-size: 11px; }

/* Lieferanten: Liste und Maske */
.lf-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.lf-suche { display: flex; gap: 6px; align-items: center; }
.lf-suche input[type=search] { width: 320px; }
.lf-schnell { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
.lf-schnell input:not(.eng) { width: 320px; }
.lf-liste tr[data-link] { cursor: pointer; }
.lf-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 0 10px; }
.lf-maske .zeile { display: flex; align-items: center; gap: 4px; }
.lf-maske input.eng { width: 70px; }
.lf-maske textarea.voll { width: 100%; box-sizing: border-box; }
.lf-farben select { min-width: 200px; }
/* Lieferantenmaske: Reiter wie bei den Kunden */
#r-konditionen:checked ~ #p-konditionen, #r-lfarben:checked ~ #p-lfarben, #r-dokumente:checked ~ #p-dokumente { display: block; }
#r-konditionen:checked ~ .reiter-kopf label[for=r-konditionen], #r-lfarben:checked ~ .reiter-kopf label[for=r-lfarben], #r-dokumente:checked ~ .reiter-kopf label[for=r-dokumente] {
  background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }
.lf-maske .lf-oben { grid-template-columns: minmax(420px, 1.3fr) minmax(0, 1fr); }
.lf-maske .lf-schmal { max-width: 760px; }
.lf-maske .lf-ktab input { width: 100%; box-sizing: border-box; min-width: 80px; }
.lf-maske .lf-kontakte { overflow-x: auto; }
.lf-maske textarea.voll { width: 100%; box-sizing: border-box; }
.lf-liste tr.gewaehlt > td { background: var(--akzent-hell); }
/* Klappliste Kunde: Nummer, dann Name in einer Zeile */
.auswahl-pop .ap-links { display: flex; gap: 10px; min-width: 0; overflow: hidden; }
.auswahl-pop .ap-nr { font-weight: 600; min-width: 56px; }
.auswahl-pop .ap-text { overflow: hidden; text-overflow: ellipsis; }


/* Typ-Liste als Umwandlung (festgeschriebene Belege der Belegkette) */
.typ-liste .typ-wahl.gedruckt { background: #fde9b8; border: 1px solid #d9a93a; border-radius: var(--radius); padding: 1px 6px; font-weight: 600; cursor: default; }
.typ-liste .typ-wahl.gedruckt small { font-weight: 400; color: #7a5a00; }
.typ-liste .typ-wahl.gedruckt .gedr-symbol { width: 15px; height: 15px; flex: none; fill: none; stroke: #7a5a00; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.typ-liste .typ-wahl.ziel { color: inherit; text-decoration: none; padding: 1px 6px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); }
.typ-liste .typ-wahl.ziel:hover, .typ-liste .typ-wahl.ziel:focus-visible { border-color: var(--akzent, #3a7bd5); background: #eaf2ff; }
.typ-liste .typ-wahl.ziel.laeuft { opacity: .55; pointer-events: none; }
/* Spalte „Menge Quelle“ nur bei Belegen mit Quellbeleg */
.beleg-maske .nur-quelle { display: none; }
.beleg-maske.hat-quelle th.nur-quelle, .beleg-maske.hat-quelle td.nur-quelle { display: table-cell; color: var(--leise); }
/* Angebot aktiv / nicht aktiv unter „Bemerkung“ */
.angebot-aktiv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 5px 8px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); }
.angebot-aktiv.inaktiv { background: #e4e4e4; border-color: #9a9a9a; }
.angebot-aktiv.inaktiv .al-status { color: #555; }
.typ-hinweis { margin: 0 8px 6px; font-size: 10.5px; max-width: 150px; }

/* Beleg laden: Kundenfeld wie NetCo (0.40.0) */
.bl-kunden textarea { width: 100%; min-height: 8em; resize: vertical; box-sizing: border-box; font: inherit; }
.bl-kundenzeile { display: flex; gap: 4px; align-items: center; }
.bl-kundenzeile .bl-pfeil { flex: 1; text-align: center; }
.bl-kundenzeile .bl-rot { color: var(--rot); font-weight: 700; }
.bl-kunde-box { width: min(560px, 100%); }
.bl-ai-box { width: min(980px, 100%); }
#bl-ki .felder { grid-template-columns: max-content 1fr; }
#bl-ki .felder input, #bl-ki .felder select { width: 100%; box-sizing: border-box; }
#bl-ki-fehler { color: var(--rot); font-weight: 600; }
.bl-ai-zeile { cursor: pointer; }
.bl-ai-detail > td { background: var(--feld); padding: 2px 8px 8px 24px; }
.bl-ai-unter { width: 100%; }

/* Lager: Größen schnell sperren (0.39.10) */
.nv-schnell { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 8px 4px 158px; }
.nv-schnell input[type=text] { width: 220px; }
.nv-schnell .nv-meldung { flex-basis: 100%; }
.lagerraster tr:has(input[name^="l_nv_"]:checked), .lagerraster tr:has(input[name^="l_nnv_"]:checked) { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(128,128,128,.14) 6px 12px); }
.lagerraster tr:has(input[name^="l_nv_"]:checked) th, .lagerraster tr:has(input[name^="l_nnv_"]:checked) th { text-decoration: line-through; color: var(--leise, #777); }

/* Beleg laden: Löschen-Spalte für Entwürfe (0.39.13) */
.bl-loesch-form { margin: 0; display: inline; }
.bl-loeschen { padding: 0 4px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); cursor: pointer; line-height: 1.3; }
.bl-loeschen:hover { border-color: #c0392b; background: #fdecea; }
.bl-loesch-aus { opacity: .45; cursor: not-allowed; }

/* Anmeldemaske mit Markenbild (1.76.0): Bild füllt den ganzen Schirm, links steht der Text des Bildes, rechts das Formular als Glaskarte */
.anmelden { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); padding: 0; background: #0b1224; overflow: auto; }
.anm-hintergrund { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; pointer-events: none; }
.anm-bild { position: relative; }
.anm-seite { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px; }
.anmelden .anmelde-form { --flaeche: rgba(12,20,40,.80); --text: #e8ecf4; --leise: #aab4c6; --rahmen: rgba(150,175,220,.35); --rahmen-hell: rgba(150,175,220,.2);
  --feld: rgba(8,14,30,.85); --kopf-a: #263552; --kopf-b: #1c2a44; --akzent-hell: #1d3556; color: var(--text); color-scheme: dark;
  width: min(380px, 100%); padding: 28px 28px 20px; border: 1px solid var(--rahmen); border-radius: 14px; background: var(--flaeche);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 14px 44px rgba(0,0,0,.5); }
.anmelden .anmelde-form input:not([type="hidden"]) { background: var(--feld); color: var(--text); border: 1px solid var(--rahmen); border-radius: 6px; }
.anmelden .anmelde-form a { color: #7fc4ff; }
.anmelden .anm-fuss { color: #c8d2e6; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.anm-kopf { text-align: center; margin-bottom: 14px; }
.anm-kopf h2 { margin: 8px 0 2px; font-size: 22px; }
.anm-kopf p { margin: 0; }
.anm-wappen { display: inline-block; padding: 6px 14px; border-radius: 8px; background: var(--akzent); color: #fff; font-weight: 800; letter-spacing: .08em; }
.anm-felder { display: grid; gap: 4px; margin: 10px 0 14px; }
.anm-felder label { font-weight: 600; margin-top: 6px; }
.anm-felder input { width: 100%; padding: 9px 10px; font-size: 15px; box-sizing: border-box; }
.anmelden .anm-knopf { width: 100%; padding: 10px; font-size: 16px; font-weight: 600; }
.anm-hilfe { margin: 12px 0 0; font-size: 12px; text-align: center; }
.anm-fuss { margin: 14px 0 0; font-size: 12px; }
.anmelden .hinweis { margin: 8px 0; }
@media (max-width: 800px) {
  .anmelden { grid-template-columns: 1fr; grid-template-rows: calc(100vw * 9 / 16) 1fr; }
  .anm-hintergrund { inset: 0 0 auto 0; height: calc(100vw * 9 / 16); object-position: center top; }
}
.start-version { font-size: 13px; font-weight: 400; }

/* Matrix-Dialog: sichtbares Preisfeld */
.mx-preiszeile{margin:.4rem 0;display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.mx-preiszeile input{width:6.5rem}
.mx-varpreis{display:block;font-weight:normal;color:#5b6670}

/* Schnell-Adresse im Beleg */
.adr-block{display:flex;flex-direction:column;gap:.35rem;min-width:0}
.adr-schnell{border:1px solid #c9d2da;border-radius:4px;padding:.5rem .6rem;background:#f6f8fa;display:flex;flex-direction:column;gap:.35rem}
.adr-felder{display:grid;grid-template-columns:9rem 1fr;gap:.3rem .5rem;align-items:center}
.adr-plz{display:flex;gap:.3rem}
.adr-plz input#as_ort{flex:1}
.adr-aktion{display:flex;gap:.4rem}

/* Matrix-Dialog: breites Fenster, schmale Größenspalten (alle Größen sichtbar), Notfall: waagerecht scrollen */
.matrix-dialog .ki-box { width: min(1700px, 98vw); }
.mx-rahmen { overflow-x: auto; max-width: 100%; }
.matrix-tabelle.mx-eng td.zelle { width: 46px; min-width: 0; }
.matrix-tabelle.mx-eng th.zahl, .matrix-tabelle.mx-eng td.zelle input { font-size: 11px; }
.matrix-tabelle.mx-eng td.zelle input { padding: 2px 2px 2px 0; }
.matrix-tabelle.mx-eng td.zelle small.bestand, .matrix-tabelle.mx-eng td.zelle small.preis-abw { font-size: 8px; }
.matrix-tabelle.mx-enger td.zelle { width: 38px; }
.matrix-tabelle.mx-enger th.zahl, .matrix-tabelle.mx-enger td.zelle input { font-size: 10px; }
.matrix-tabelle.mx-enger th, .matrix-tabelle.mx-enger td { padding-left: 1px; padding-right: 1px; }
.matrix-tabelle { margin-bottom: 8px; }
.matrix-tabelle caption.mx-schluessel { caption-side: top; text-align: left; font-weight: 700; padding: 2px 0; }
.matrix-tabelle thead th { background: var(--kopf-b); border-bottom: 2px solid var(--rahmen); }
/* Druckvorlagen: Reiter je Belegart, Formular-Generator */
.dv-reiter { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px 8px 0; border-bottom: 1px solid var(--rahmen); max-width: 900px; }
.dv-reiter-art { padding: 3px 10px; border: 1px solid var(--rahmen); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--kopf-b); color: var(--text); text-decoration: none; }
.dv-reiter-art.aktiv { background: var(--feld); font-weight: 700; position: relative; top: 1px; }
.dv-arten { gap: 2px 12px; }
.dv-layout { margin: 6px 0; border: 1px solid var(--rahmen-hell); border-radius: var(--radius); padding: 4px 8px; }
.dv-layout legend { font-weight: 700; padding: 0 4px; }
.dv-ki { border-top: 1px dashed var(--rahmen); margin-top: 6px; padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.dv-ki textarea { width: 100%; }
.dv-ki-zeile { display: flex; gap: 8px; align-items: center; }
/* Nicht verfügbare (gesperrte) Größen: Lager-Raster (Zeile) und Matrix (Zelle) in anderer Farbe */
table.lagerraster tr.nv-gesperrt th, table.lagerraster tr.nv-gesperrt td,
table.lagerraster tr.nv-gesperrt td input:not([type="checkbox"]) { background: #e6c9c9; }
table.lagerraster tr.nv-gesperrt th { text-decoration: line-through; }
.matrix-tabelle td.zelle.nv, .matrix-tabelle td.zelle.nv.hat-menge { background: #d9b3b3; }
.matrix-tabelle td.zelle.nv input { background: transparent; text-decoration: line-through; cursor: not-allowed; }

/* Druckvorlagen: drei Spalten – Liste | Einstellungen | Ansicht */
.dv-seite { min-width: 0; }
.dv-spalten { display: grid; grid-template-columns: minmax(250px, 0.8fr) minmax(380px, 1.3fr) minmax(300px, 1fr); gap: 10px; align-items: start; margin: 8px; }
.dv-spalten .dv-karte { margin: 0; max-width: none; }
.dv-tabelle { width: 100%; }
.dv-zeile { cursor: pointer; }
.dv-zeile:hover td { background: var(--kopf-b); }
.dv-zeile.aktiv td { background: var(--akzent-hell); font-weight: 700; }
.dv-zeile a { color: inherit; text-decoration: none; }
.dv-tabelle td.mitte, .dv-tabelle th:nth-child(n+3) { text-align: center; }
.dv-ansicht-spalte h3 { margin: 4px 0 6px; font-size: 1.1em; }
.dv-ansicht { width: 100%; height: 78vh; min-height: 480px; border: 1px solid var(--rahmen); background: #fff; }
.dv-pdf { display: block; }
@media (max-width: 1250px) { .dv-spalten { grid-template-columns: minmax(230px, 0.8fr) minmax(360px, 1.2fr); } .dv-ansicht-spalte { grid-column: 1 / -1; } }
/* Anmeldung: Passkey */
.anm-oder { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; color: var(--text-leise, #777); }
.anm-oder::before, .anm-oder::after { content: ""; flex: 1; border-top: 1px solid var(--rahmen); }
.anm-passkey { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: normal; line-height: 1.2; overflow: hidden; }
.anm-passkey small { font-size: 12px; font-weight: 400; opacity: .8; }
.anm-hilfe[data-pk-status]:empty { display: none; }

.bh-aus { padding: 12px; }

/* NetCo › Belege: offene Posten */
.netco-op tr.op-offen td { background: #fff7dc; }
.netco-op tr.op-faellig td { background: #fde2e2; }
.netco-op tr.op-gutschrift td { background: #e3f4e3; }
.netco-op .op-legende span { display: inline-block; padding: 0 8px; margin-left: 6px; border-radius: 9px; border: 1px solid var(--rahmen-hell); }
.netco-op .op-legende .op-offen { background: #fff7dc; }
.netco-op .op-legende .op-faellig { background: #fde2e2; }
.netco-op .op-legende .op-gutschrift { background: #e3f4e3; }

/* Kontrolle/Buchhaltung: alte Belege aus NetCo */
.bh-alt { max-width: 260px; }
.bh-tabelle tr.alt-offen td { background: #fde8e8; }
.bh-tabelle tr.alt-bezahlt td { background: #e3f4e3; }
.bh-tabelle tr.alt-summe td { background: #e8edf5; font-weight: 600; }
.alt-marke { font-size: 10px; border: 1px solid var(--rahmen); border-radius: 8px; padding: 0 5px; background: #e8edf5; color: #34495e; }
.alt-legende span { display: inline-block; padding: 0 8px; border-radius: 9px; border: 1px solid var(--rahmen-hell); margin-right: 6px; }
.alt-legende .alt-offen { background: #fde8e8; }
.alt-legende .alt-bezahlt { background: #e3f4e3; }
.bh-find { display: flex; gap: 6px; align-items: center; margin: 4px 0 8px; }
.bh-find input[type=search] { width: 320px; max-width: 60%; }

/* Kontrolle/Buchhaltung: Kopfzeile und Summenzeilen bleiben beim Blättern immer sichtbar */
.bh-rahmen { overflow: auto; max-height: calc(100vh / var(--anzeige, 1) - 340px); min-height: 220px; }
.bh-tabelle thead th { position: sticky; top: 0; z-index: 2; background: var(--kopf-a); }
.bh-tabelle tfoot td { position: sticky; bottom: 0; z-index: 2; }
.bh-tabelle.mit-alt tfoot tr.sum-w td { bottom: 29px; }

/* Kontrolle/Buchhaltung: Sortierung und Filterzeile in den Tabellenköpfen */
.bh-tabelle thead tr.bh-kopf th { user-select: none; white-space: nowrap; }
.bh-tabelle thead tr.bh-kopf th:hover { background: var(--akzent-hell); }
.bh-tabelle thead tr.bh-filterzeile th { padding: 2px 3px; background: var(--kopf-b); font-weight: 400; }
.bh-tabelle .bh-fi { width: 100%; min-width: 60px; box-sizing: border-box; font-size: 12px; padding: 2px 4px; }
.bh-tabelle .bh-pfeil { color: var(--akzent); }
.bh-tabelle tr[hidden] { display: none; }
.bh-tabelle tr.sum-v td { background: #fff3c4; font-weight: 700; }

/* Statusanzeige bei langen NetCo-Läufen */
html.arbeit, html.arbeit * { cursor: progress !important; }
.arbeit-leiste { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff3c4; border-bottom: 2px solid #e0a800; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.arbeit-leiste[hidden] { display: none; }
.arbeit-dreher { width: 16px; height: 16px; border: 3px solid #e0a800; border-top-color: transparent; border-radius: 50%; animation: arbeit-dreh .8s linear infinite; }
.arbeit-zeit { color: #555; font-weight: 400; font-variant-numeric: tabular-nums; }
.arbeit-balken { position: absolute; left: 0; bottom: 0; height: 3px; width: 30%; background: #e0a800; animation: arbeit-lauf 1.4s ease-in-out infinite; }
@keyframes arbeit-dreh { to { transform: rotate(360deg); } }
@keyframes arbeit-lauf { 0% { left: -30%; } 100% { left: 100%; } }

/* Excel-artige Spaltenfilter (excelfilter.js) */
.ef-knopf { margin-left: 4px; padding: 0 4px; font-size: 11px; line-height: 16px; border: 1px solid #aaa; border-radius: 3px; background: #fff; color: #333; cursor: pointer; }
.ef-knopf:hover { background: #eef3ff; }
.ef-knopf.aktiv { background: #ffe08a; border-color: #e0a800; font-weight: 700; }
.ef-pfeil { color: var(--akzent, #2a5db0); }
.ef-leiste { margin: 4px 0; display: flex; gap: 10px; align-items: center; }
.ef-info { font-weight: 600; }
.ef-popup { position: fixed; z-index: 9000; width: 260px; max-height: 80vh; overflow: auto; background: #fff; border: 1px solid #888; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.3); padding: 6px; font-size: 13px; font-weight: 400; color: #222; text-align: left; }
.ef-popup hr { margin: 4px 0; border: 0; border-top: 1px solid #ddd; }
.ef-popup .ef-zeile { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 4px 6px; cursor: pointer; }
.ef-popup .ef-zeile:hover { background: #eef3ff; }
.ef-popup .ef-bed { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.ef-popup input[type=text], .ef-popup input[type=search], .ef-popup select { width: 100%; box-sizing: border-box; }
.ef-popup .ef-liste { max-height: 220px; overflow: auto; border: 1px solid #ddd; margin: 4px 0; padding: 2px; }
.ef-popup .ef-wert { display: flex; gap: 4px; align-items: center; padding: 1px 2px; white-space: nowrap; }
.ef-popup .ef-wert span { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ef-popup .ef-wert i { color: #888; font-style: normal; }
.ef-popup .ef-fuss { display: flex; gap: 6px; justify-content: flex-end; }

/* Fenstergröße: drei Punkte (rot klein, gelb mittel, grün groß) und ziehbar (fenstergroesse.js) */
.fg-punkte { display: inline-flex; align-items: center; gap: 8px; margin: 0 12px 0 auto; flex: 0 0 auto; }
.fg-punkt { position: relative; width: 13px; height: 13px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .28); cursor: pointer; }
.fg-punkt::after { content: ""; position: absolute; inset: -6px; } /* größere Trefferfläche */
.fg-rot { background: #ff5f57; } .fg-gelb { background: #febc2e; } .fg-gruen { background: #28c840; }
.fg-punkt:hover { filter: brightness(.88); box-shadow: 0 0 0 2px rgba(0, 0, 0, .12); }
.fg-punkt:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.ki-kopf .fg-zu { font: inherit; font-size: 11px; padding: 2px 10px; border: 1px solid var(--rahmen); border-radius: 12px; background: var(--flaeche); color: var(--text); text-decoration: none; cursor: pointer; }
.ki-kopf .fg-zu:hover { background: var(--feld); }
.ki-dialog.fg-frei { justify-content: flex-start; align-items: flex-start; padding: 2vh 2vw; }
.fg-box { resize: both; overflow: auto; min-width: 360px; min-height: 220px; max-width: 99vw; max-height: 98vh; }
.ki-dialog.fg-frei .ki-box.fg-box { max-height: 98vh; }
dialog.fg-frei { margin: 2vh 2vw; max-height: 98vh; }
.fg-box > .ki-inhalt, .fg-box > #verlauf-inhalt { flex: 1 1 auto; min-height: 0; max-height: none; }

/* Hilfe: Menü, Kurzinfo (Tooltip), Bearbeitungsmodus, Handbuch */
.hilfe-gruppe { margin-left: auto; display: flex; align-items: stretch; }
.modul.rechts + .hilfe-gruppe { margin-left: 0; }
button.modul.hilfe-knopf { background: transparent; font: inherit; cursor: pointer; }
button.modul.hilfe-knopf:hover, button.modul.hilfe-knopf[aria-expanded="true"] { border-color: var(--rahmen); background: var(--feld); }
.hilfe-menue { position: fixed; z-index: 1200; min-width: 260px; max-width: 340px; background: var(--flaeche); border: 1px solid var(--rahmen);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); padding: 4px 0; }
.hilfe-menue[hidden] { display: none; }
.hilfe-menue a, .hilfe-menue button { display: block; width: 100%; box-sizing: border-box; text-align: left; padding: .35rem .8rem; color: var(--text);
  text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.hilfe-menue a:hover, .hilfe-menue button:hover, .hilfe-menue a:focus, .hilfe-menue button:focus { background: var(--akzent-hell); outline: none; }
.hilfe-menue .leise { float: right; }
.hilfe-trenner { height: 1px; background: var(--rahmen); margin: 4px 0; }
.hilfe-version { display: block; padding: .25rem .8rem; font-size: .85em; }
#hilfe-rahmen { flex: 1 1 auto; width: 100%; border: 0; min-height: 0; background: var(--flaeche); }
.hilfe-einst { max-width: 520px; }
.hilfe-probe { width: 100%; box-sizing: border-box; }
.hilfe-knoepfe { display: flex; gap: .5rem; justify-content: flex-end; }
.hilfe-blase { position: fixed; z-index: 2000; max-width: 360px; padding: .4rem .6rem; background: #fffbe6; color: #222; border: 1px solid #c9b458;
  border-radius: 4px; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); font-size: .9rem; line-height: 1.35; white-space: pre-line; pointer-events: none; }
.hilfe-blase .hilfe-zusatz { display: block; margin-top: .3rem; color: #6a5a10; font-size: .85em; }
html.hilfe-edit :is(input, select, textarea, button, a, label, th, td, [data-hilfe]):hover { outline: 2px dashed var(--akzent); outline-offset: 1px; }
.hilfe-leiste { position: fixed; z-index: 2100; top: 6px; left: 50%; transform: translateX(-50%); background: #fff3cd; border: 1px solid #c9b458;
  border-radius: var(--radius); padding: .3rem .8rem; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.hilfe-editor { position: fixed; z-index: 2200; width: min(460px, 94vw); background: var(--flaeche); border: 1px solid var(--rahmen);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); padding: .6rem .8rem; }
.hilfe-editor textarea { width: 100%; box-sizing: border-box; min-height: 90px; font: inherit; }
.hilfe-editor .hilfe-fehler { color: #b00020; min-height: 1.2em; }
.hilfe-editor code { font-size: .85em; }

.handbuch { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0 1.2rem; align-items: start; max-width: 1200px; margin: 0 auto; }
.handbuch nav.hb-inhalt { position: sticky; top: .5rem; max-height: calc(100vh / var(--anzeige, 1) - 1.5rem); overflow: auto; padding: .4rem .2rem; border-right: 1px solid var(--rahmen); }
.handbuch nav.hb-inhalt h2 { font-size: 1rem; margin: .2rem .4rem .4rem; }
.handbuch nav.hb-inhalt a { display: block; padding: .2rem .5rem; color: var(--text); text-decoration: none; border-radius: var(--radius); }
.handbuch nav.hb-inhalt a:hover, .handbuch nav.hb-inhalt a.aktiv { background: var(--akzent-hell); }
.handbuch nav.hb-inhalt input[type=search] { width: calc(100% - .8rem); margin: 0 .4rem .5rem; box-sizing: border-box; }
.handbuch article section { padding-bottom: .6rem; border-bottom: 1px solid var(--rahmen); margin-bottom: 1rem; }
.handbuch article section[hidden] { display: none; }
.handbuch h1 { margin-top: .2rem; }
.handbuch h2 { margin-top: .4rem; }
.handbuch table { border-collapse: collapse; margin: .4rem 0 .8rem; }
.handbuch th, .handbuch td { border: 1px solid var(--rahmen); padding: .25rem .6rem; text-align: left; vertical-align: top; }
.handbuch kbd { border: 1px solid var(--rahmen); border-bottom-width: 2px; border-radius: 3px; padding: 0 .35em; background: var(--feld); font-size: .9em; }
.handbuch .hb-hinweis { background: #fff8e1; border-left: 4px solid #e0b400; padding: .35rem .7rem; margin: .5rem 0; }
@media (max-width: 800px) { .handbuch { grid-template-columns: 1fr; } .handbuch nav.hb-inhalt { position: static; border-right: 0; } }

/* Druckdialog: „Danach weiterführen in …“ */
.dd-danach { display: inline-flex; align-items: center; gap: .4rem; margin-right: auto; font-size: .9em; }
.dd-danach select { max-width: 16em; }

/* Eingebettete Trefferliste unter der Artikelmaske */
.such-treffer { border: 1px solid var(--rahmen); border-radius: var(--radius); margin-top: 6px; background: var(--flaeche); overflow: hidden; }
.such-treffer[hidden] { display: none; }
.st-kopf { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--kopf); border-bottom: 1px solid var(--rahmen); font-size: .85em; }
.st-kopf b { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-inhalt { overflow: auto; max-height: 260px; }
.st-inhalt table { width: 100%; }
.st-inhalt tbody tr { cursor: pointer; }
.st-inhalt tbody tr:hover { background: var(--feld); }
.st-inhalt tbody tr.aktiv { background: var(--akzent-hell); font-weight: 600; }
.st-inhalt tbody tr.gesperrt { opacity: .55; }
.st-inhalt td { white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.treffer-anzahl { font-weight: 600; }
#treffer-toggle.aktiv { background: var(--akzent-hell); border-color: var(--akzent); }

/* Lots */
.lotform .lot-kopf { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin-bottom: .6rem; }
.lotform label { display: flex; flex-direction: column; gap: 2px; color: var(--leise); }
.lotform label.breit { flex: 1 1 260px; }
.lotform label.haken { flex-direction: row; align-items: center; gap: 4px; }
.lotform .lot-text textarea { width: 100%; }
.lot-suche { position: relative; margin: .5rem 0 .8rem; max-width: 640px; }
.lot-suche input { width: 100%; }
.lot-treffer { position: absolute; z-index: 20; left: 0; right: 0; margin: 2px 0 0; padding: 0; list-style: none; max-height: 260px; overflow: auto;
  background: var(--feld); border: 1px solid var(--rahmen); border-radius: var(--radius); box-shadow: 0 4px 12px rgb(0 0 0 / .18); }
.lot-treffer li { padding: 4px 8px; cursor: pointer; }
.lot-treffer li:hover, .lot-treffer li:focus { background: var(--akzent-hell); outline: none; }

/* Order-Server-Status (Fußzeile und Statusfenster) */
.shop-status { text-decoration: none; font-weight: 600; }
.shop-status.shop-ok, .shop-ampel.shop-ok { color: var(--gruen); }
.shop-status.shop-warn, .shop-ampel.shop-warn { color: var(--gelb); }
.shop-status.shop-aus, .shop-ampel.shop-aus { color: var(--rot); }
.shop-ampel { font-size: 18px; font-weight: 700; margin: 4px 0 8px; }
.shop-status-fenster .felder { margin: 10px 0; }

/* Vertretermaske (Reiter Mitarbeiter & Zugriffe) und Artikelmaske (Reiter Shops) */
#r-mitarbeiter:checked ~ #p-mitarbeiter, #r-shops:checked ~ #p-shops { display: block; }
#r-mitarbeiter:checked ~ .reiter-kopf label[for=r-mitarbeiter], #r-shops:checked ~ .reiter-kopf label[for=r-shops] {
  background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }

/* Einstellungen › Agenturen & Händler: links die Agenturen, rechts die Händler der gewählten Agentur */
.av-raster { display: grid; grid-template-columns: minmax(200px, 270px) 1fr; gap: 12px; align-items: start; }
@media (max-width: 900px) { .av-raster { grid-template-columns: 1fr; } }
.av-liste { display: flex; flex-direction: column; gap: 3px; }
.av-agentur { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; text-decoration: none; color: var(--text);
  background: var(--feld); border: 1px solid var(--rahmen-hell); border-left: 4px solid transparent; border-radius: var(--radius); }
.av-agentur:hover { border-color: var(--rahmen); }
.av-agentur.aktiv { border-left-color: var(--akzent); background: var(--akzent-hell); border-color: var(--akzent); }
.av-neu { margin-top: 10px; padding: 8px; background: var(--flaeche); border: 1px solid var(--rahmen-hell); border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; }
.av-neu h3 { margin: 0 0 2px; font-size: 11px; }
.av-detail h3 { margin: 0 0 6px; }
.av-tabelle td { vertical-align: top; }
.av-tabelle .zeilenform { display: flex; gap: 4px; align-items: center; margin: 2px 0; }
.av-haendler-neu { margin-top: 8px; display: flex; gap: 6px; }
.av-zugang { font-weight: 600; }
.av-zugang.av-ok { color: var(--gruen); }
.av-zugang.av-offen { color: var(--gelb); }
.av-zugang.av-fehlt { color: var(--leise); }
.av-warn { color: var(--gelb); font-weight: 600; }
progress.av-balken { width: 100%; height: 10px; }
progress.av-balken.av-warnung { accent-color: #d98e00; }
progress.av-balken.av-erreicht { accent-color: var(--rot); }
progress.av-balken.av-ok { accent-color: var(--gruen); }
.av-budget summary { cursor: pointer; color: var(--akzent); font-size: 10px; }
.av-budgetform { display: grid; gap: 4px; margin-top: 4px; }
.av-budgetform label { display: flex; flex-direction: column; gap: 1px; }
.av-link { display: flex; flex-direction: column; gap: 4px; }
.av-link-feld { width: 100%; font-family: Consolas, monospace; }

/* Kundenmaske › Belege › Rechnungen (offen / bezahlt / Altsystem) */
.kr-box { margin-bottom: 14px; }
.kr-box h3, .kr-box h4 { margin: 10px 0 4px; }
.kr-tabelle { font-size: .92em; }
.kr-tabelle tr.kr-ueberfaellig td { background: #fdecea; }
.kr-tabelle tr.kr-bezahlt td { color: #4b5d4b; }
.kr-tabelle tr.kr-alt td:first-child { font-weight: 600; }

/* KI-Kundensuche (NetCo-Übernahme) */
.netco-ki { padding: 8px 10px; background: var(--flaeche-2, #f3f6fb); border-radius: 6px; }
.netco-ki-feld { display: flex; align-items: center; gap: 8px; flex: 1 1 520px; }
.netco-ki-feld input { flex: 1; min-width: 220px; }
.netco-ki-text { margin: 4px 0 8px; }

.handbuch nav.hb-inhalt h2 .hb-schliessen { float: right; font-size: .8rem; font-weight: normal; padding: .1rem .5rem; }

/* Artikel-Import */
.panel.ai-import { padding: 16px 22px 20px; }
.panel.ai-import > h1 { margin-top: 0; }
.ai-zu svg { vertical-align: -2px; }
.ai-kiform { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 8px 0; }
.ai-kiform textarea { max-width: 100%; }
.ai-ordner { margin: 6px 0 12px; }
.ai-form, .ai-optionen { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 8px 0; }
.ai-hinweis { color: var(--warnung, #8a5a00); font-size: .9em; }
.ai-alttreffer { margin-top: 4px; padding: 4px 6px; background: var(--flaeche-2, #f3f6fb); border-radius: 6px; }
.ai-tabelle tr.ai-fertig td { opacity: .75; }

.ai-bilder{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0}.ai-bilder img{height:64px;width:auto;border:1px solid var(--rand,#ccc);border-radius:3px;background:#fff}.ai-bildwahl{display:block;font-size:.85em}
.ai-erg{margin-top:4px;padding:4px 6px;background:var(--hinweis-bg,#f4f8ee);border-left:3px solid #6a9a3a;font-size:.9em}

/* Vertretermaske: Mitarbeiter als Kästen mit Detailkasten daneben, Nummernlisten */
.ma-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 12px; align-items: start; }
.ma-karten { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.ma-karte { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 1px 8px; padding: 8px 10px; background: var(--weiss, #fff);
  border: 1px solid var(--rahmen); border-radius: var(--radius); cursor: pointer; font: inherit; color: inherit; }
.ma-karte:hover { border-color: var(--akzent); }
.ma-karte.aktiv { border-color: var(--akzent); background: var(--akzent-hell); box-shadow: inset 3px 0 0 var(--akzent); }
.ma-karte.inaktiv .ma-name { text-decoration: line-through; color: var(--leise); }
.ma-name { grid-column: 1; font-weight: 600; }
.ma-fkt { grid-column: 1; color: var(--leise); font-size: 12px; }
.ma-nr { grid-column: 1; font-size: 12px; }
.ma-marken { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; justify-content: flex-start; }
.ma-detail { border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 10px 12px; margin: 0; min-width: 0; background: var(--weiss, #fff); }
.ma-detail[hidden] { display: none; }
.ma-titel { font-weight: 600; padding: 0 4px; }
.ma-abschnitt { margin: 12px 0 6px; font-size: 13px; border-top: 1px solid var(--rahmen-hell); padding-top: 8px; }
.ma-felder { grid-template-columns: max-content minmax(0, 1fr); gap: 5px 8px; }
.ma-felder textarea, .ma-felder input:not([type=checkbox]), .ma-felder select { max-width: 100%; }
.ma-fuss { margin: 10px 0 0; text-align: right; }
.ma-hinweis { padding: 12px; border: 1px dashed var(--rahmen); border-radius: var(--radius); margin: 0; }
.tel-liste { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tel-zeile { display: flex; gap: 4px; align-items: center; }
.tel-zeile select { width: 7.5em; }
.tel-zeile input { width: 14em; }
.ma-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--rahmen); margin: 0 0 10px; }
.ma-tabs button { background: none; border: 1px solid transparent; border-bottom: none; padding: 5px 12px; cursor: pointer; font: inherit; color: var(--leise);
  border-radius: var(--radius) var(--radius) 0 0; }
.ma-tabs button:hover { color: inherit; }
.ma-tabs button.aktiv { color: inherit; font-weight: 600; background: var(--weiss, #fff); border-color: var(--rahmen); margin-bottom: -1px; border-bottom: 1px solid var(--weiss, #fff); }
.ma-panel[hidden] { display: none; }
.ma-tabs .ma-entfernen { margin-left: auto; margin-bottom: 0; border: none; color: #b3261e; font-size: .9em; }
.ma-tabs .ma-entfernen:hover { color: #8c1d18; text-decoration: underline; }
.filterzeile th { padding: 2px 3px; background: var(--gelb-hell, #fffbe6); }
.filterzeile input { width: 100%; box-sizing: border-box; min-width: 40px; font-size: .9em; padding: 2px 4px; }
.filterzeile input.gefiltert { border-color: #e0a52a; background: #fff; font-weight: 600; }
tr.filter-weg { display: none; }
@media (max-width: 900px) { .ma-layout { grid-template-columns: minmax(0, 1fr); } .ma-karten { flex-direction: row; flex-wrap: wrap; } .ma-karte { min-width: 200px; } }
#r-kunden:checked ~ #p-kunden { display: block; }
#r-kunden:checked ~ .reiter-kopf label[for=r-kunden] { background: var(--akzent-hell); border-color: var(--akzent); font-weight: 600; }

/* Lagerraster: Kernspalten (Größe, Menge +, Menge, Alle Lager, Min., Verlauf, EAN); Rest per Schalter „Alle Spalten“ */
html.lr-kompakt table.lagerraster thead > tr > :is(:nth-child(5), :nth-child(6), :nth-child(7), :nth-child(9), :nth-child(10), :nth-child(11), :nth-child(12), :nth-child(13), :nth-child(16)),
html.lr-kompakt table.lagerraster tbody > tr:not(.gruppe-kopf) > :is(:nth-child(5), :nth-child(6), :nth-child(7), :nth-child(9), :nth-child(10), :nth-child(11), :nth-child(12), :nth-child(13), :nth-child(16)) { display: none; }
.raster-hinweis { margin: 2px 0 4px; }
.lager-aenderungen { font-size: 12px; color: var(--leise); }
.lager-aenderungen.warn { color: #b9770e; font-weight: 600; }

/* ---- Dynamische Statistik (Pivot) ---- */
.st-leiste { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 6px 0; }
.st-leiste label { display: inline-flex; gap: 4px; align-items: center; }
.st-leiste-rechts { margin-left: auto; display: inline-flex; gap: 6px; }
.st-feldliste { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px; border: 1px solid var(--rand, #c9ccd1); background: var(--feld, #fff); max-height: 190px; overflow: auto; }
.st-gruppe { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.st-gruppe-titel { font-size: 11px; color: var(--leise, #667); margin-right: 2px; text-transform: uppercase; letter-spacing: .03em; }
.st-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid #9db6d8; border-radius: 3px; background: #eaf1fb; cursor: grab; user-select: none; font-size: 12px; white-space: nowrap; }
.st-chip.kennzahl { border-color: #d9a400; background: #fff6d6; }
.st-chip.benutzt { opacity: .45; }
.st-chip.zieht { opacity: .3; }
.st-chip .st-x { border: 0; background: transparent; cursor: pointer; padding: 0 2px; font-weight: 700; color: #a33; }
.st-chip .st-filtermarke { color: #1c6bb0; font-weight: 700; }
.st-zonen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
@media (max-width: 1000px) { .st-zonen { grid-template-columns: repeat(2, 1fr); } }
.st-zone { border: 1px solid var(--rand, #c9ccd1); background: #fafbfc; }
.st-zone-titel { padding: 2px 8px; font-weight: 600; background: var(--akzent-hell, #e6edf6); }
.st-zone-feld { min-height: 44px; padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.st-zone-feld.ueber { outline: 2px dashed #1c6bb0; background: #eef5ff; }
.st-zone-feld:empty::after { content: "hierher ziehen"; color: var(--leise, #889); font-size: 12px; }
.st-ausgabe { overflow: auto; max-height: 68vh; }
table.st-tabelle { border-collapse: collapse; font-size: 12px; }
table.st-tabelle th, table.st-tabelle td { border: 1px solid #d5d9df; padding: 2px 6px; white-space: nowrap; }
table.st-tabelle thead th { position: sticky; top: 0; background: var(--akzent-hell, #e6edf6); z-index: 1; text-align: center; }
table.st-tabelle thead th.st-kopf-links { text-align: left; }
table.st-tabelle td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
table.st-tabelle th.st-sortierbar { cursor: pointer; }
table.st-tabelle tr.st-gruppe-zeile td, table.st-tabelle tr.st-gruppe-zeile th { background: #f3e6d3; font-weight: 600; }
table.st-tabelle tr.st-gesamt td, table.st-tabelle tr.st-gesamt th { background: #e9c99d; font-weight: 700; position: sticky; bottom: 0; }
table.st-tabelle td.st-summe-spalte { background: #fbefdc; font-weight: 600; }
table.st-tabelle th.st-zeilenkopf { text-align: left; font-weight: 400; background: #f4f5f7; }
table.st-tabelle tr.st-gruppe-zeile th.st-zeilenkopf { background: #f3e6d3; font-weight: 600; }
table.st-tabelle .st-ebene1 { padding-left: 18px; } table.st-tabelle .st-ebene2 { padding-left: 34px; }
table.st-tabelle .st-ebene3 { padding-left: 50px; } table.st-tabelle .st-ebene4 { padding-left: 66px; }
table.st-tabelle .st-ebene5 { padding-left: 82px; } table.st-tabelle .st-ebene6 { padding-left: 98px; }
table.st-tabelle .st-umschalter { cursor: pointer; display: inline-block; width: 14px; text-align: center; margin-right: 2px; color: #555; }
.st-popup { position: fixed; z-index: 30; background: #fff; border: 1px solid #888; box-shadow: 0 4px 14px rgba(0,0,0,.3); padding: 8px; width: 280px; max-height: 60vh; display: flex; flex-direction: column; gap: 6px; }
.st-popup .st-werteliste { overflow: auto; max-height: 40vh; border: 1px solid #ddd; padding: 2px 4px; }
.st-popup .st-werteliste label { display: flex; gap: 6px; align-items: center; padding: 1px 0; }
.st-popup .st-popup-knoepfe { display: flex; gap: 6px; justify-content: flex-end; }

/* ===== Tabellenköpfe: Optik wie macOS (Finder/Numbers) + Spaltenzug wie in Excel ===== */
table thead th, table.liste th, table.raster th, table.st-tabelle thead th {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; color: #6e6e73;
  background: rgba(246,246,248,.92); background-image: none;
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border: 0; border-bottom: 1px solid #d2d2d7; border-right: 1px solid rgba(60,60,67,.12);
  padding: 4px 8px; user-select: none; -webkit-user-select: none;
}
table thead th:last-child, table.liste th:last-child, table.raster th:last-child { border-right: 0; }
table thead th:hover { background: rgba(236,236,240,.96); color: #1d1d1f; }
table.liste, table.raster, table.st-tabelle { border: 1px solid #d2d2d7; }
table.liste td, table.raster td { border-bottom-color: rgba(60,60,67,.10); }
table.liste tbody tr:hover { background: rgba(0,122,255,.08); }
table thead th .ef-knopf { border: 0; background: transparent; color: #8e8e93; border-radius: 4px; padding: 0 3px; }
table thead th .ef-knopf:hover { background: rgba(60,60,67,.12); color: #1d1d1f; }
table thead th .ef-knopf.aktiv { background: #007aff; color: #fff; }
table thead th .ef-pfeil { color: #007aff; }
.ef-popup { border: 1px solid rgba(60,60,67,.22); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.22);
  background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
.sb-griff { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 4; }
.sb-griff::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: transparent; }
table thead th:hover .sb-griff::after, .sb-griff:hover::after { background: #007aff; width: 2px; left: 3px; }
body.sb-zieht, body.sb-zieht * { cursor: col-resize !important; user-select: none !important; }
table.spalten-fest th, table.spalten-fest td { overflow: hidden; text-overflow: ellipsis; }
table.spalten-fest td input, table.spalten-fest td select { width: 100%; box-sizing: border-box; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) table thead th, html:not([data-farbschema="hell"]) table.liste th, html:not([data-farbschema="hell"]) table.raster th, html:not([data-farbschema="hell"]) table.st-tabelle thead th { background: rgba(44,44,46,.92); color: #aeaeb2; border-bottom-color: #48484a; border-right-color: rgba(255,255,255,.10); }
  html:not([data-farbschema="hell"]) table thead th:hover { background: rgba(58,58,60,.96); color: #fff; }
  html:not([data-farbschema="hell"]) table.liste, html:not([data-farbschema="hell"]) table.raster, html:not([data-farbschema="hell"]) table.st-tabelle { border-color: #48484a; }
  html:not([data-farbschema="hell"]) .ef-popup { background: rgba(44,44,46,.96); color: #f2f2f7; border-color: #48484a; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] table thead th, html[data-farbschema="dunkel"] table.liste th, html[data-farbschema="dunkel"] table.raster th, html[data-farbschema="dunkel"] table.st-tabelle thead th { background: rgba(44,44,46,.92); color: #aeaeb2; border-bottom-color: #48484a; border-right-color: rgba(255,255,255,.10); }
html[data-farbschema="dunkel"] table thead th:hover { background: rgba(58,58,60,.96); color: #fff; }
html[data-farbschema="dunkel"] table.liste, html[data-farbschema="dunkel"] table.raster, html[data-farbschema="dunkel"] table.st-tabelle { border-color: #48484a; }
html[data-farbschema="dunkel"] .ef-popup { background: rgba(44,44,46,.96); color: #f2f2f7; border-color: #48484a; }

/* Handbuch: Bilder und nummerierte Schritte */
.hb-bild { margin: 10px 0 8px; padding: 0; }
.hb-bild img { max-width: 100%; height: auto; border: 1px solid #d2d2d7; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.12); display: block; }
.hb-bild figcaption { font-size: 11px; color: var(--leise); margin-top: 4px; }
ol.hb-schritte { list-style: none; counter-reset: schritt; padding-left: 0; margin: 6px 0 14px; }
ol.hb-schritte > li { counter-increment: schritt; position: relative; padding: 4px 0 4px 34px; line-height: 1.5; }
ol.hb-schritte > li::before { content: counter(schritt); position: absolute; left: 0; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: #8e8e93; color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.handbuch h3 { margin: 22px 0 6px; font-size: 14px; border-bottom: 1px solid #d2d2d7; padding-bottom: 3px; }
.pf { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #ff3b30; color: #fff; font-weight: 700; font-size: 11px; vertical-align: 1px; }

/* Handbuch: Fragefeld und Antwort */
.hb-frage { display: flex; flex-direction: column; gap: 4px; margin: 0 .4rem .6rem; }
.hb-frage textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.hb-antwort { position: sticky; top: 0; z-index: 5; margin: 0 0 12px; padding: 10px 14px; border: 1px solid #007aff; border-radius: 10px;
  background: #f0f7ff; box-shadow: 0 4px 16px rgba(0,0,0,.14); max-height: 45vh; overflow: auto; }
.hb-antwort[hidden] { display: none; }
.hb-antwort-kopf { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.hb-antwort-text { white-space: pre-wrap; line-height: 1.5; }
.hb-antwort-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.hb-antwort-links a { font-weight: 600; }
.hb-treffer { background: #fff3a8; outline: 3px solid #ffd60a; border-radius: 4px; transition: background 1s; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .hb-antwort { background: rgba(28,40,56,.97); }
  html:not([data-farbschema="hell"]) .hb-treffer { background: #5a4a00; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .hb-antwort { background: rgba(28,40,56,.97); }
html[data-farbschema="dunkel"] .hb-treffer { background: #5a4a00; }
.handbuch article section[id], .handbuch article h3[id] { scroll-margin-top: 250px; }

/* Lagerraster (Größen & Bestand): eigener, klarer Kopf – farbig passend zu den Eingabefeldern, kein Spaltenzug */
table.liste.lagerraster thead th, table.liste.lagerraster thead th:hover {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; color: #3a3f4b; text-align: center; vertical-align: middle;
  background: linear-gradient(#f4f6fa, #e3e8f0); -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 0; border-right: 1px solid #cfd6e2; border-bottom: 3px solid #8fa3c2;
  padding: 5px 6px; line-height: 1.25; user-select: auto; -webkit-user-select: auto;
}
table.liste.lagerraster thead th:last-child { border-right: 0; }
table.liste.lagerraster thead th:first-child { border-top-left-radius: 6px; }
table.liste.lagerraster thead th:nth-child(2) { background: linear-gradient(#fffbe0, #fff2a8); border-bottom-color: #d9a400; color: #6b5200; }
table.liste.lagerraster thead th:nth-child(3) { background: linear-gradient(#e8f8e6, #c9eec4); border-bottom-color: #3f9b3a; color: #1f5a1b; }
table.liste.lagerraster thead th.menge-alle-kopf { background: linear-gradient(#eef4fc, #d3e3f8); border-bottom-color: #1a5fb4; color: #1a5fb4; }
table.liste.lagerraster tfoot th { background: #e3e8f0; font-weight: 700; }

/* „In welchen Lagern?“ – klare Übersicht: ruhige Tabelle, Zahlen mittig, Gesamt hervorgehoben */
.lr-verteilung .lr-rahmen { border: 1px solid #d5dbe6; border-radius: 10px; background: #fff; overflow: auto; box-shadow: 0 1px 3px rgba(20,30,60,.08); }
.lr-verteilung table.lr-tabelle { width: 100%; border: 0; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.lr-verteilung table.lr-tabelle thead th { position: sticky; top: 0; z-index: 1; background: #eef2f8; color: #3a4558; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 9px 14px; border: 0; border-bottom: 2px solid #8fa3c2; text-align: center; }
.lr-verteilung table.lr-tabelle thead th:nth-child(-n+2) { text-align: left; }
.lr-verteilung table.lr-tabelle thead th:last-child { background: #dce9fa; color: #1a5fb4; border-bottom-color: #1a5fb4; }
.lr-verteilung table.lr-tabelle tbody td { padding: 9px 14px; border: 0; border-bottom: 1px solid #edf0f5; text-align: center; font-variant-numeric: tabular-nums; }
.lr-verteilung table.lr-tabelle tbody td:nth-child(-n+2) { text-align: left; font-weight: 600; }
.lr-verteilung table.lr-tabelle tbody td:nth-child(n+3) { min-width: 80px; }
.lr-verteilung table.lr-tabelle tbody tr:hover td { background: #f6f9fd; }
.lr-verteilung table.lr-tabelle tbody td.leise { color: #b4bccb; font-weight: 400; }
.lr-verteilung table.lr-tabelle tbody td.negativ { color: #c0392b; font-weight: 700; background: #fdeceb; border-radius: 6px; }
.lr-verteilung table.lr-tabelle tbody td.summe { font-weight: 800; color: #1a5fb4; background: #f0f6fe; border-left: 1px solid #d5e3f6; }
.lr-verteilung table.lr-tabelle tbody tr.gewaehlt td { background: #fff4b8; color: #1d1d1f; }
.lr-verteilung table.lr-tabelle tbody tr.gewaehlt td:first-child { box-shadow: inset 4px 0 0 #d9a400; }
.lr-verteilung table.lr-tabelle tbody tr.gewaehlt td.leise { color: #a89a5a; }
.lr-verteilung table.lr-tabelle tfoot th { position: sticky; bottom: 0; background: #e3e8f0; color: #1f2937; font-size: 14px; font-weight: 800; padding: 10px 14px;
  border: 0; border-top: 2px solid #8fa3c2; text-align: center; }
.lr-verteilung table.lr-tabelle tfoot th:nth-child(-n+2) { text-align: left; }
.lr-verteilung table.lr-tabelle tfoot th:last-child { background: #cfe0f7; color: #1a5fb4; }
.lr-verteilung p.leise { font-size: 12.5px; margin: 10px 2px 0; }

/* ===== Trefferfenster Lager / Kunde (suchfenster.js) ===== */
.sf-dialog { padding: 2vh 1.2vw; background: rgba(20,24,32,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sf-dialog .sf-box { width: min(1760px, 100%); height: 96vh; max-height: 96vh; display: flex; flex-direction: column; border: 0; border-radius: 16px; background: #fff; overflow: hidden;
  box-shadow: 0 24px 70px rgba(10,20,40,.38), 0 0 0 1px rgba(60,60,67,.14);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; font-size: 13px; color: #1d1d1f; }
.sf-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 12px;
  background: linear-gradient(#fbfbfd, #f1f3f7); border-bottom: 1px solid #dfe3ea; }
.sf-titel { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sf-titel b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sf-symbol { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(#4a90e2, #2f6fc0); color: #fff; font-size: 16px; box-shadow: 0 2px 5px rgba(47,111,192,.4); }
.sf-zaehler { font-size: 12px; font-weight: 600; color: #4a5568; background: #e6ebf3; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.sf-werkzeuge { display: flex; align-items: center; gap: 8px; }
.sf-knopf { font: inherit; font-weight: 600; color: #2f6fc0; background: #fff; border: 1px solid #c9d3e3; border-radius: 9px; padding: 6px 13px; cursor: pointer; }
.sf-knopf:hover { background: #eef4fc; }
.sf-knopf.aktiv { background: #2f6fc0; color: #fff; border-color: #2f6fc0; }
.sf-zu { font: inherit; font-size: 15px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #e6e9ef; color: #4a5568; cursor: pointer; }
.sf-zu:hover { background: #d4d9e2; color: #111; }

.sf-suche { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; border-bottom: 1px solid #edf0f5; background: #fff; }
.sf-suchfeld { flex: 1 1 320px; min-width: 240px; font: inherit; font-size: 14px; padding: 8px 14px; border: 1px solid #c9d3e3; border-radius: 999px; background: #f6f8fb; outline: none; }
.sf-suchfeld:focus { background: #fff; border-color: #2f6fc0; box-shadow: 0 0 0 3px rgba(47,111,192,.2); }
.sf-los { font-size: 13px; padding: 7px 20px; border-radius: 999px; }
.sf-alt-haken { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff6e0; border: 1px solid #f0d58a; color: #7a5200; font-weight: 600; cursor: pointer; }
.sf-alt-haken input { width: 16px; height: 16px; accent-color: #c27c1a; }

.sf-status { min-height: 0; padding: 0 18px; font-weight: 600; color: #4a5568; }
.sf-status:not(:empty) { padding: 8px 18px; background: #f3f6fb; border-bottom: 1px solid #edf0f5; }
.sf-status.ok { color: #1b6e3b; background: #e8f6ee; }
.sf-status.fehler { color: #b42318; background: #fdecea; }
.sf-status.hinweis { color: #7a5200; background: #fff6e0; }

.sf-inhalt { padding: 6px 18px 14px; overflow: hidden; flex: 1 1 auto; min-height: 0; background: #fff; display: flex; flex-direction: column; gap: 6px; }
/* Neu- und Alt-Abschnitt teilen sich die Fensterhöhe: ist ein Abschnitt kurz, bekommt der andere den Platz; zu lange Listen scrollen. */
.sf-abschnitt { margin-top: 6px; display: flex; flex-direction: column; flex: 0 1 auto; min-height: min(100%, 11em); }
.sf-abschnitt-kopf { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.sf-abschnitt-kopf h3 { margin: 0; font-size: 14px; font-weight: 700; }
.sf-anzahl { font-size: 12px; font-weight: 700; color: #4a5568; background: #e6ebf3; border-radius: 999px; padding: 1px 9px; }
.sf-punkt { width: 11px; height: 11px; border-radius: 50%; }
.sf-punkt-neu { background: #2f8a57; box-shadow: 0 0 0 3px rgba(47,138,87,.2); }
.sf-punkt-alt { background: #c27c1a; box-shadow: 0 0 0 3px rgba(194,124,26,.22); }
.sf-leer { margin: 4px 2px 8px; color: #6b7280; }
.sf-fehler { color: #b42318; font-weight: 600; }
.sf-rahmen { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; border: 1px solid #d9dfe9; border-radius: 12px; background: #fff; }
.sf-alt .sf-rahmen { border-color: #ecd9a8; }

.sf-dialog table.sf-tabelle { width: 100%; border: 0; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sf-dialog table.sf-tabelle thead th { position: sticky; top: 0; z-index: 2; background: #eef2f8; color: #3a4558; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 6px 12px; border: 0; border-bottom: 2px solid #8fa3c2; text-align: left; white-space: nowrap; }
.sf-dialog .sf-alt table.sf-tabelle thead th { background: #fbf3df; border-bottom-color: #d9a94a; color: #6b4d12; }
.sf-dialog table.sf-tabelle thead th.zahl, .sf-dialog table.sf-tabelle td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.sf-dialog table.sf-tabelle thead tr.sf-filterzeile th { top: 28px; padding: 5px 8px; background: #f7f9fc; border-bottom: 1px solid #d9dfe9; text-transform: none; }
.sf-dialog .sf-alt table.sf-tabelle thead tr.sf-filterzeile th { background: #fffaf0; border-bottom-color: #ecd9a8; }
.sf-filterfeld { width: 100%; min-width: 70px; box-sizing: border-box; font: inherit; font-size: 12px; padding: 4px 9px; border: 1px solid #c9d3e3; border-radius: 8px; background: #fff; }
.sf-dialog table.sf-tabelle tbody td { padding: 2px 12px; line-height: 17px; border: 0; border-bottom: 1px solid #eef1f6; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #fff; }
.sf-dialog table.sf-tabelle tbody tr:nth-child(even) td { background: #fafbfd; }
.sf-neu-tabelle tbody tr { cursor: pointer; }
.sf-neu-tabelle tbody tr:hover td { background: #eef4fc; }
.sf-neu-tabelle tbody tr:focus { outline: none; }
.sf-dialog table.sf-tabelle tbody tr.gewaehlt td { background: #d8e8fb; color: #0b2a52; font-weight: 600; box-shadow: inset 0 1px 0 #9bbfe9, inset 0 -1px 0 #9bbfe9; }
.sf-dialog table.sf-tabelle tbody tr.gewaehlt td:first-child { box-shadow: inset 4px 0 0 #2f6fc0, inset 0 1px 0 #9bbfe9, inset 0 -1px 0 #9bbfe9; }
.sf-dialog table.sf-tabelle tbody tr.gesperrt td { color: #8a909b; }
.sf-alt-tabelle tbody tr { cursor: pointer; }
.sf-alt-tabelle tbody tr:hover td { background: #fff6e0; }
.sf-alt-tabelle tbody tr.markiert td { background: #ffeeb8; font-weight: 600; }
.sf-alt-tabelle tbody tr.schon td { color: #7d8794; cursor: default; background: #f4f7f4; }
.sf-wahlspalte { width: 38px; text-align: center !important; padding-left: 10px !important; padding-right: 6px !important; }
.sf-wahlspalte input { width: 17px; height: 17px; accent-color: #c27c1a; cursor: pointer; vertical-align: middle; }
.sf-wahlspalte input:disabled { cursor: default; opacity: .35; }

.sf-pille { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.sf-pille-rot { background: #fdecea; color: #b42318; }
.sf-pille-gruen { background: #e3f3e8; color: #1b6e3b; }
.sf-oeffnen { margin-left: 6px; font-weight: 600; color: #2f6fc0; text-decoration: none; }
.sf-oeffnen:hover { text-decoration: underline; }

.sf-alt-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 9px 12px; margin-bottom: 8px; border-radius: 12px;
  background: #fff6e0; border: 1px solid #f0d58a; }
.sf-alle, .sf-lager { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #6b4d12; }
.sf-alle input { width: 17px; height: 17px; accent-color: #c27c1a; }
.sf-lager select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid #d9c07a; background: #fff; }
.sf-kopieren { margin-left: auto; font-size: 13px; padding: 8px 20px; border-radius: 999px; font-weight: 700; }
.sf-kopieren:disabled { opacity: .45; }

.sf-fuss { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-top: 1px solid #dfe3ea; background: #f6f7fa; }
.sf-hilfe { margin-left: auto; color: #6b7280; font-size: 12px; }
.sf-fuss .knopf { font-size: 13px; padding: 7px 18px; border-radius: 999px; }
.sf-fuss .knopf.primaer:disabled { opacity: .45; }

/* Haken unter dem Suchfeld der Maske */
.such-alt-haken { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 4px; font-size: 11px; font-weight: 600; color: #7a5200; cursor: pointer; white-space: nowrap; }
.such-alt-haken input { margin: 0; accent-color: #c27c1a; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .sf-dialog .sf-box { background: #1f2227; color: #e8eaee; }
  html:not([data-farbschema="hell"]) .sf-kopf, html:not([data-farbschema="hell"]) .sf-fuss { background: #272b31; border-color: #3a4048; }
  html:not([data-farbschema="hell"]) .sf-suche, html:not([data-farbschema="hell"]) .sf-inhalt { background: #1f2227; border-color: #3a4048; }
  html:not([data-farbschema="hell"]) .sf-dialog table.sf-tabelle tbody td, html:not([data-farbschema="hell"]) .sf-dialog table.sf-tabelle tbody tr:nth-child(even) td { background: #1f2227; border-bottom-color: #2e343b; }
  html:not([data-farbschema="hell"]) .sf-dialog table.sf-tabelle thead th { background: #2b313a; color: #c4cad4; }
  html:not([data-farbschema="hell"]) .sf-suchfeld, html:not([data-farbschema="hell"]) .sf-filterfeld { background: #15181b; color: #e8eaee; border-color: #49515a; }
  html:not([data-farbschema="hell"]) .sf-rahmen { background: #1f2227; border-color: #3a4048; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .sf-dialog .sf-box { background: #1f2227; color: #e8eaee; }
html[data-farbschema="dunkel"] .sf-kopf, html[data-farbschema="dunkel"] .sf-fuss { background: #272b31; border-color: #3a4048; }
html[data-farbschema="dunkel"] .sf-suche, html[data-farbschema="dunkel"] .sf-inhalt { background: #1f2227; border-color: #3a4048; }
html[data-farbschema="dunkel"] .sf-dialog table.sf-tabelle tbody td, html[data-farbschema="dunkel"] .sf-dialog table.sf-tabelle tbody tr:nth-child(even) td { background: #1f2227; border-bottom-color: #2e343b; }
html[data-farbschema="dunkel"] .sf-dialog table.sf-tabelle thead th { background: #2b313a; color: #c4cad4; }
html[data-farbschema="dunkel"] .sf-suchfeld, html[data-farbschema="dunkel"] .sf-filterfeld { background: #15181b; color: #e8eaee; border-color: #49515a; }
html[data-farbschema="dunkel"] .sf-rahmen { background: #1f2227; border-color: #3a4048; }
.sf-lager { white-space: nowrap; }

/* Nummern aus dem Altsystem (NetCo) farbig */
.sf-dialog td.sf-nr-alt { font-weight: 700; color: #9a5b00; }
.sf-dialog td.sf-nr-alt::before { content: "NetCo"; display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 999px;
  background: #ffe7b0; color: #7a4a00; font-size: 10px; font-weight: 800; letter-spacing: .03em; vertical-align: 1px; }
.sf-dialog table.sf-neu-tabelle tbody tr:hover td.sf-nr-alt { color: #7a4a00; }

/* ===== Einheitliches Design (wie das Suchfenster) für das ganze Programm ===== */
.panel { border-radius: 12px; box-shadow: 0 1px 3px rgba(20,30,50,.08); }
.knopf { border-radius: 8px; padding: 4px 12px; font-weight: 600; background: var(--feld); border-color: #cfd5de; transition: background .12s, border-color .12s, box-shadow .12s; }
.knopf:hover { background: var(--akzent-hell); border-color: var(--akzent); }
.knopf.primaer { background: linear-gradient(#4a8bd6, #2f6db4); border-color: #2a62a3; box-shadow: 0 1px 2px rgba(30,70,130,.35); }
.knopf.primaer:hover { background: linear-gradient(#5b97dc, #3a78c2); }
.knopf.klein { padding: 2px 8px; border-radius: 6px; }
input[type=search], input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], select { border-radius: 6px; border-color: #cfd5de; }
.hinweis { border-radius: 8px; padding: .5rem .8rem; }
/* Listen: ruhige Kopfzeile, luftigere Zeilen, Zebra */
table.liste:not(.lagerraster) { border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; border-color: #d5dae3; }
table.liste:not(.lagerraster) th { font-size: 11.5px; font-weight: 700; color: #3a4558; padding: 5px 10px; background: #eef2f8; border: 0; border-bottom: 2px solid #c9d2e0; }
table.liste:not(.lagerraster) td { padding: 2px 10px; line-height: 17px; border-bottom: 1px solid #edf0f5; font-size: 12.5px; }
table.liste:not(.lagerraster) tbody tr:nth-child(even) td { background: #fafbfd; }
table.liste:not(.lagerraster) tbody tr:hover td { background: #e8f0fb; }
table.liste:not(.lagerraster) tbody tr.gewaehlt td { background: #d6e6fb; }
table.liste:not(.lagerraster) td.nr a { color: #1f5fae; }
table.liste:not(.lagerraster) thead th.zahl, table.liste:not(.lagerraster) td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle-rahmen { margin: 0 10px 10px; }
.marke-rot { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #fdecea; color: #b42318; }
/* Werkzeugleiste der Listen */
.listen-suche { gap: 8px; padding: 12px 14px; margin: 0; background: #fff; border-bottom: 1px solid #edf0f5; border-radius: 12px 12px 0 0; }
.listen-suche input[type=search] { flex: 1 1 320px; padding: 7px 12px; border-radius: 999px; font-size: 13px; min-height: 0; border-color: #c4ccd8; }
.listen-suche .knopf { border-radius: 999px; padding: 6px 14px; }
.listen-suche .haken { font-size: 12px; font-weight: 600; color: #7a5200; }
.listen-suche .leise { flex: 1 0 100%; font-size: 11.5px; }
.suchzeile { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #fbf3df; border-bottom: 1px solid #ecd9a8; }
.suchzeile input[type=search] { flex: 1 1 320px; width: auto; padding: 6px 12px; border-radius: 999px; border-color: #d9c07a; min-height: 0; }
.suchzeile .knopf { border-radius: 999px; background: #fff; border-color: #d9c07a; color: #6b4d12; }
.panel > h3 { margin: 10px 14px 6px; font-size: 13px; color: #6b4d12; }
.seiten { padding: 8px 0 12px; }
/* In einem Listenfenster füllt die Liste die ganze Fläche */
html.liste-fenster body .panel { border: 0; border-radius: 0; box-shadow: none; min-height: calc(100vh / var(--anzeige, 1)); }
html.liste-fenster body .listen-suche { position: sticky; top: 0; z-index: 5; border-radius: 0; }
@media (prefers-color-scheme: dark) {
  html:not([data-farbschema="hell"]) .knopf { background: #2b3036; border-color: #3d444d; }
  html:not([data-farbschema="hell"]) .knopf:hover { background: #24384f; }
  html:not([data-farbschema="hell"]) input[type=search], html:not([data-farbschema="hell"]) input[type=text], html:not([data-farbschema="hell"]) input[type=number], html:not([data-farbschema="hell"]) input[type=date], html:not([data-farbschema="hell"]) input[type=email], html:not([data-farbschema="hell"]) input[type=password], html:not([data-farbschema="hell"]) select { border-color: #3d444d; }
  html:not([data-farbschema="hell"]) table.liste:not(.lagerraster) th { background: #2b313a; color: #c4cad4; border-bottom-color: #46505e; }
  html:not([data-farbschema="hell"]) table.liste:not(.lagerraster) td { border-bottom-color: #2c323a; }
  html:not([data-farbschema="hell"]) table.liste:not(.lagerraster) tbody tr:nth-child(even) td { background: #20252a; }
  html:not([data-farbschema="hell"]) table.liste:not(.lagerraster) tbody tr:hover td { background: #24384f; }
  html:not([data-farbschema="hell"]) table.liste:not(.lagerraster) tbody tr.gewaehlt td { background: #2c4668; }
  html:not([data-farbschema="hell"]) table.liste:not(.lagerraster) td.nr a { color: #8dbbf2; }
  html:not([data-farbschema="hell"]) .listen-suche { background: #1f2227; border-bottom-color: #2c323a; }
  html:not([data-farbschema="hell"]) .suchzeile { background: #2e2819; border-bottom-color: #54461f; }
}
/* gleiche Werte bei von Hand gewähltem Dunkel (Kopf der Seite) */
html[data-farbschema="dunkel"] .knopf { background: #2b3036; border-color: #3d444d; }
html[data-farbschema="dunkel"] .knopf:hover { background: #24384f; }
html[data-farbschema="dunkel"] input[type=search], html[data-farbschema="dunkel"] input[type=text], html[data-farbschema="dunkel"] input[type=number], html[data-farbschema="dunkel"] input[type=date], html[data-farbschema="dunkel"] input[type=email], html[data-farbschema="dunkel"] input[type=password], html[data-farbschema="dunkel"] select { border-color: #3d444d; }
html[data-farbschema="dunkel"] table.liste:not(.lagerraster) th { background: #2b313a; color: #c4cad4; border-bottom-color: #46505e; }
html[data-farbschema="dunkel"] table.liste:not(.lagerraster) td { border-bottom-color: #2c323a; }
html[data-farbschema="dunkel"] table.liste:not(.lagerraster) tbody tr:nth-child(even) td { background: #20252a; }
html[data-farbschema="dunkel"] table.liste:not(.lagerraster) tbody tr:hover td { background: #24384f; }
html[data-farbschema="dunkel"] table.liste:not(.lagerraster) tbody tr.gewaehlt td { background: #2c4668; }
html[data-farbschema="dunkel"] table.liste:not(.lagerraster) td.nr a { color: #8dbbf2; }
html[data-farbschema="dunkel"] .listen-suche { background: #1f2227; border-bottom-color: #2c323a; }
html[data-farbschema="dunkel"] .suchzeile { background: #2e2819; border-bottom-color: #54461f; }
html.liste-fenster .titel, html.liste-fenster .module, html.liste-fenster footer.status { display: none !important; }
a.knopf { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }
a.knopf.primaer { color: #fff; }

.sf-balken { height: 6px; margin-top: 6px; border-radius: 999px; background: #d9e2f0; overflow: hidden; }
.sf-balken > i { display: block; height: 100%; background: linear-gradient(90deg, #4a8bd6, #2f6db4); transition: width .2s; }
.sf-dialog table.sf-tabelle input[type=checkbox] { width: 15px; height: 15px; }

/* Mahnungen (Kontrolle/Buchhaltung): jede Mahnung auf eigener Seite, Bedienelemente nicht mitdrucken */
.mahn-seite { max-width: 46rem; }
.mahn-anschrift { white-space: pre-line; }
.mahn-zahlen td, .mahn-zahlen th { text-align: left; }
.mahn-zahlen td.zahl, .mahn-zahlen th.zahl { text-align: right; }
@media print {
  .nicht-drucken, .kopfbereich, .titel, nav.module, .werkzeuge { display: none !important; }
  .mahn-seite { break-after: page; border: 0; box-shadow: none; }
}

/* Statistik › Dashboard */
.db-reiter { display: flex; gap: .4rem; margin-bottom: .6rem; }
.db-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.db-kachel { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche, #fff); min-width: 0; }
.db-kachel.db-breit { grid-column: span 2; }
.db-kachel h3 { margin: 0; padding: .45rem .7rem; font-weight: 400; border-bottom: 1px solid var(--rahmen); font-size: 13px; }
.db-inhalt { padding: .6rem .7rem; overflow-x: auto; }
.db-gross { font-size: 1.5rem; text-align: center; padding-top: .8rem; }
.db-unter { text-align: center; color: #777; margin-top: .3rem; }
.db-svg { width: 100%; height: auto; }
.db-gitter { stroke: #e3e6ea; stroke-width: 1; }
.db-achse { fill: #666; font-size: 9px; }
.db-linie { fill: none; stroke: #7ea6c2; stroke-width: 2; }
.db-flaeche { fill: rgba(143, 180, 204, .25); stroke: none; }
.db-punkt { fill: #7ea6c2; }
.db-saeule { fill: #8fd19e; stroke: #3c9a54; }
.db-saeule.db-alt { fill: #f6b3b3; stroke: #d35a5a; }
.db-ring { width: 150px; height: 150px; display: block; margin: 0 auto; }
.db-ring-text { font-size: 11px; fill: #555; }
.db-legende { list-style: none; margin: .5rem 0 0; padding: 0; font-size: 12px; }
.db-farbe { display: inline-block; width: .8em; height: .8em; border-radius: 2px; }
.db-tabelle { width: 100%; }
@media (max-width: 700px) { .db-kachel.db-breit { grid-column: auto; } }

/* Einheitlicher Schließen-Knopf (seitenzu.js) und Import-Knopf „Schließen“ */
.seite-zu-leiste { position: sticky; top: 0; z-index: 20; display: flex; justify-content: flex-end; padding: 2px 4px 6px; pointer-events: none; }
.seite-zu, .knopf.ai-zu { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); line-height: 1.2; }
.seite-zu { font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.seite-zu { pointer-events: auto; margin: 0; padding: 4px 12px 4px 8px; border-radius: 999px;
  border: 1px solid var(--rahmen); background: linear-gradient(var(--feld), var(--kopf-b));
  box-shadow: 0 1px 2px rgba(20,30,50,.12), 0 4px 12px rgba(20,30,50,.10);
  transition: border-color .15s, box-shadow .15s, transform .08s, background .15s; }
.seite-zu svg { flex: none; width: 15px; height: 15px; }
.knopf.ai-zu svg { flex: none; width: 14px; height: 14px; }
.seite-zu:hover { border-color: var(--rot); background: linear-gradient(var(--feld), var(--rot-hell)); color: var(--rot);
  box-shadow: 0 1px 2px rgba(20,30,50,.14), 0 6px 16px rgba(180,35,24,.18); }
.seite-zu:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(20,30,50,.18); }
.seite-zu:focus-visible, .knopf.ai-zu:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.knopf.ai-zu:hover { border-color: var(--rot); color: var(--rot); background: linear-gradient(var(--feld), var(--rot-hell)); }
@media print { .seite-zu-leiste { display: none; } }

/* Benutzer / Rollen: Reiter und eingerückter Menüpunkt */
.einstellungen a.unterpunkt{padding-left:1.6em;font-size:.95em}
.bu-reiter{display:flex;gap:4px;margin:0 0 12px;border-bottom:2px solid var(--linie,#dde3ea)}
.bu-reiter a{padding:8px 16px;text-decoration:none;color:inherit;border-radius:8px 8px 0 0;border:1px solid transparent;border-bottom:0;margin-bottom:-2px}
.bu-reiter a:hover{background:rgba(0,0,0,.05)}
.bu-reiter a.aktiv{background:#fff;border-color:var(--linie,#dde3ea);font-weight:600;border-bottom:2px solid #fff}

/* Auswahllisten: Spalten Name | Beschreibung | Reihenfolge | Aktiv | Knopf – Kopfzeile und Eingabezeilen gleich breit */
.zeilenform.auswahlform { grid-template-columns: minmax(150px, 220px) minmax(200px, 1fr) 100px 90px 110px; }
.zeilenform.auswahlform input[name=reihenfolge] { width: 100%; }
.zeilenkopf { font-weight: 600; text-align: left; }
.zeilenkopf .zahl { text-align: right; }
@media (max-width: 800px) { .zeilenform.auswahlform { grid-template-columns: 1fr 1fr; } .zeilenkopf { display: none; } }
.formular-liste thead th:nth-child(1) { width: auto; }

/* Kundenrecherche (Menü „Kundenrecherche“) */
.rc-dreher { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; border: 2px solid var(--rahmen); border-top-color: var(--akzent); border-radius: 50%; animation: rc-dreh .8s linear infinite; }
@keyframes rc-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rc-dreher { animation-duration: 3s; } }
.rc-reiter { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0 0; }
.rc-reiter button { padding: 5px 12px; border: 1px solid var(--rahmen); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--kopf-b); cursor: pointer; color: inherit; font: inherit; text-align: left; }
.rc-reiter button[aria-selected="true"] { background: var(--flaeche); font-weight: 700; position: relative; top: 1px; }
.rc-reiter small { display: block; font-weight: 400; color: var(--leise); font-size: 11px; }
.rc-haupt { padding: 14px; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 0 var(--radius) var(--radius) var(--radius); }
.rc-haupt section[hidden] { display: none; }
.rc h2 { font-size: 16px; margin: 0 0 4px; }
.rc h3 { margin: 0; padding: 4px 10px; font-size: 13px; background: linear-gradient(var(--kopf-a), var(--kopf-b)); border-bottom: 1px solid var(--rahmen); }
.rc-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.rc-raster.rc-pool { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.rc-raster.rc-briefraster { grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.4fr); }
.rc-kasten { background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); min-width: 0; }
.rc-innen { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.rc-feld { display: flex; flex-direction: column; gap: 3px; }
.rc-feld > span { color: var(--leise); font-size: 12px; }
.rc input[type="text"], .rc input[type="date"], .rc input[type="number"], .rc select, .rc textarea { padding: 4px 6px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); color: inherit; font: inherit; width: 100%; }
.rc textarea { min-height: 64px; resize: vertical; }
.rc-reihe { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.rc fieldset { border: 1px solid var(--rahmen-hell); border-radius: var(--radius); margin: 0; padding: 6px 10px 8px; }
.rc legend { color: var(--leise); font-size: 12px; padding: 0 4px; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--akzent-hell); border: 1px solid var(--rahmen-hell); font-size: 12px; }
.rc-chip button { border: 0; background: none; cursor: pointer; color: var(--leise); padding: 0; }
.rc-laender { max-height: 190px; overflow: auto; border: 1px solid var(--rahmen); background: var(--feld); border-radius: var(--radius); padding: 4px 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.rc-laender label { display: flex; gap: 6px; align-items: center; padding: 2px 0; cursor: pointer; }
.rc-artikelliste { display: flex; flex-direction: column; max-height: 200px; overflow: auto; border: 1px solid var(--rahmen); background: var(--feld); border-radius: var(--radius); }
.rc-artikelliste[hidden] { display: none; }
.rc-artikel { text-align: left; padding: 4px 8px; border: 0; border-bottom: 1px solid var(--rahmen-hell); background: none; color: inherit; font: inherit; cursor: pointer; }
.rc-artikel:hover, .rc-artikel:focus-visible { background: var(--akzent-hell); }
.rc-ki { padding: 8px 10px; border: 1px solid var(--rahmen); border-left: 4px solid var(--akzent); background: var(--feld); border-radius: var(--radius); }
.rc-tabelle { overflow-x: auto; border: 1px solid var(--rahmen); background: var(--feld); border-radius: var(--radius); }
.rc-tabelle table { width: 100%; border-collapse: collapse; }
.rc-tabelle td { vertical-align: top; }
.rc-tabelle tbody tr.gewaehlt { background: var(--akzent-hell); }
.rc-marke { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 3px; white-space: nowrap; font-weight: 400; letter-spacing: 0; color: var(--text); }
.rc-marke.m-gelb { background: var(--gelb-hell); color: var(--gelb); }
.rc-marke.m-rot { background: var(--rot-hell); color: var(--rot); }
.rc-marke.m-gruen { background: var(--gruen-hell); color: var(--gruen); }
.rc-marke.m-grau { background: var(--rahmen-hell); color: var(--leise); }
.rc-marke.m-blau { background: var(--akzent-hell); color: var(--akzent); }
.rc-statusfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rc-statusfilter button { padding: 2px 10px; border: 1px solid var(--rahmen); border-radius: 999px; background: var(--feld); color: inherit; font: inherit; cursor: pointer; }
.rc-statusfilter button[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.rc-verlauf { margin: 0; padding-left: 16px; }
.rc-dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; }
.rc-dl dt { color: var(--leise); }
.rc-dl dd { margin: 0; overflow-wrap: anywhere; }
.rc-rechts { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rc-brief { background: #fff; color: #1c1f23; border: 1px solid var(--rahmen); box-shadow: 0 1px 6px rgba(0,0,0,.18); padding: 28px 32px; font-family: Georgia, "Times New Roman", serif; font-size: 13px; line-height: 1.55; max-width: 640px; }
.rc-brief-absender { border-bottom: 1px solid #d3d7dc; padding-bottom: 6px; margin-bottom: 18px; color: #5f6670; font-size: 11px; }
.rc-brief-anschrift { margin-bottom: 18px; white-space: pre-line; }
.rc-brief-datum { text-align: right; margin-bottom: 10px; }
.rc-brief-betreff input { font: inherit; font-weight: 700; border: 1px dashed #b3b8bf !important; background: #fff !important; color: #1c1f23 !important; margin-bottom: 12px; }
.rc-brief-text { min-height: 260px !important; font-family: inherit !important; font-size: inherit !important; line-height: inherit; border: 1px dashed #b3b8bf !important; background: #fff !important; color: #1c1f23 !important; }
.rc-fakten { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; font-size: 12px; }
.rc-fakten ul { margin: 4px 0 0; padding-left: 16px; }
@media print {
  .rc-reiter, .rc-haupt > section > h2, .rc-haupt > section > p, .rc-kasten, #rc-meldung, .hinweis, header, nav.module, .rc-fakten { display: none !important; }
  .rc-haupt { border: 0; padding: 0; background: none; }
  .rc-rechts { display: block; }
  .rc-rechts .rc-kasten { display: none !important; }
  .rc-brief { box-shadow: none; border: 0; max-width: none; padding: 0; }
  .rc-brief-betreff input, .rc-brief-text { border: 0 !important; resize: none; }
}

/* ---- Einstellungen: Menü, Tabs, Layout (1.78.1) ---------------------------- */
.einstellungen { grid-template-columns: 240px minmax(0, 1fr); }
.einstellungen > * { min-width: 0; }
.einst-menue { position: sticky; top: 8px; max-height: calc(100vh - 80px); overflow-y: auto; padding: 4px 0; }
.einst-menue details.eg { border-bottom: 1px solid var(--rahmen); }
.einst-menue details.eg:last-child { border-bottom: 0; }
.einst-menue summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.einst-menue summary::-webkit-details-marker { display: none; }
.einst-menue summary::after { content: "▾"; transition: transform .15s; }
.einst-menue details:not([open]) > summary::after { transform: rotate(-90deg); }
.einst-menue summary:hover { background: var(--feld); }
.einst-menue details[open] > summary { color: var(--text); }
.einst-menue details > a { padding: 6px 12px 6px 18px; font-size: 13px; }
.sortiment > .bu-reiter { grid-column: 1 / -1; }
.bu-reiter { margin-bottom: 4px; }
.bu-reiter a { min-height: 40px; display: inline-flex; align-items: center; }
@media (max-width: 900px) { .einstellungen { grid-template-columns: 1fr; } .einst-menue { position: static; max-height: none; } }
.sortiment .panel { overflow-x: auto; }
.sortiment.rollen { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
@media (max-width: 1100px) { .sortiment.rollen { grid-template-columns: 1fr; } }

/* ===== Kundenrecherche: neues Design (grüner Akzent, Stepper, Karten) ===== */
.rc { --rc-g: #1b6e3b; --rc-gh: #e3f3e8; }
.rc .rc-ic { width: 20px; height: 20px; flex: none; }
.rc-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-kopf h1 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-kopf p { margin: 4px 0 0; color: var(--leise); }
.rc-marke-ki { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--rc-gh); color: var(--rc-g); }
.rc-marke-ki .rc-ic { width: 14px; height: 14px; }
.rc-hilfe { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--rahmen); border-radius: var(--radius); color: inherit; text-decoration: none; background: var(--flaeche); }
.rc .rc-reiter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 0 14px; }
.rc .rc-reiter button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); top: 0; position: static; }
.rc .rc-reiter button[aria-selected="true"] { border-color: var(--rc-g); background: var(--rc-gh); }
.rc .rc-nr { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--kopf-b); flex: none; }
.rc .rc-reiter button[aria-selected="true"] .rc-nr { background: var(--rc-g); color: #fff; }
.rc .rc-tx b { display: block; }
.rc-raster { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 14px; align-items: start; }
.rc-kk { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rahmen); }
.rc-kk h3 { margin: 0; font-size: 16px; }
.rc-kk p { margin: 2px 0 0; color: var(--leise); font-size: 13px; }
.rc-sym { width: 40px; height: 40px; border-radius: 10px; background: var(--rc-gh); color: var(--rc-g); display: grid; place-items: center; flex: none; }
.rc-sym .rc-ic { width: 22px; height: 22px; }
.rc-innen { padding: 14px 16px; display: grid; gap: 14px; }
.rc-innen fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.rc-innen legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.rc-zahl { font-weight: 400; color: var(--rc-g); }
.rc-karten { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-wahl { display: flex; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--rahmen); border-radius: var(--radius); cursor: pointer; min-height: 44px; }
.rc-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.rc-wahl small { display: block; color: var(--leise); font-size: 11px; }
.rc-wahl:has(input:checked) { border-color: var(--rc-g); background: var(--rc-gh); }
.rc-wahl:has(input:focus-visible) { outline: 2px solid var(--rc-g); outline-offset: 2px; }
.rc-laenderkasten { border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 8px; display: grid; gap: 8px; }
.rc-suchfeld { display: flex; align-items: center; gap: 6px; border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 0 8px; background: var(--feld); }
.rc-suchfeld input { border: 0; background: none; flex: 1; min-width: 0; padding: 7px 0; outline: none; }
.rc-suchfeld .rc-ic { width: 16px; height: 16px; color: var(--leise); }
.rc-laenderkasten .rc-laender { border: 0; padding: 0; background: none; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 170px; }
.rc-laenderfuss { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.rc-textknopf { border: 0; background: none; color: var(--rc-g); cursor: pointer; font: inherit; padding: 4px 2px; text-decoration: underline; }
.rc-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc-feld { display: grid; gap: 4px; }
.rc-feld > span { font-weight: 600; }
.rc-feld small { font-weight: 400; color: var(--leise); }
.rc-feld textarea { min-height: 84px; resize: vertical; }
.rc .rc-ki { border: 1px solid var(--rc-g); border-left-width: 1px; background: var(--rc-gh); }
.rc-ki-kopf { color: var(--rc-g); margin-bottom: 4px; }
.rc-ki-kopf b { display: inline-flex; align-items: center; gap: 6px; }
.rc-ki-kopf .rc-ic { width: 16px; height: 16px; }
.rc-fuss { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); }
.rc-fuss-text { display: flex; gap: 10px; align-items: flex-start; max-width: 640px; }
.rc-fuss-text .rc-ic { color: var(--rc-g); width: 24px; height: 24px; }
.rc-fuss-text small { display: block; color: var(--leise); font-size: 12px; }
.rc-fuss-start { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-dauer { display: inline-flex; align-items: center; gap: 4px; color: var(--leise); font-size: 13px; }
.rc-dauer .rc-ic { width: 16px; height: 16px; }
.rc .rc-start { display: inline-flex; align-items: center; gap: 8px; background: var(--rc-g); border-color: var(--rc-g); color: #fff; min-height: 44px; padding: 0 18px; }
.rc .rc-start .rc-ic { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .rc-raster { grid-template-columns: minmax(0, 1fr); }
  .rc .rc-reiter { grid-template-columns: 1fr 1fr; }
}
.rc-kk h3 { background: none; border: 0; padding: 0; box-shadow: none; }
.rc-produkte { display: grid; gap: 8px; }
.rc-produkte-kopf { display: flex; justify-content: space-between; align-items: baseline; }
.rc-produkte-kopf small { font-weight: 400; color: var(--leise); }
.rc-prodliste { display: grid; gap: 8px; }
.rc-prodliste:empty { display: none; }
.rc-prod { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--rc-g); background: var(--rc-gh); border-radius: var(--radius); }
.rc-prod img, .rc-dzeile img { object-fit: cover; border-radius: 4px; background: var(--kopf-b); flex: none; }
.rc-prodkein { width: 44px; height: 52px; border-radius: 4px; background: var(--kopf-b); flex: none; }
.rc-prodtext { flex: 1; min-width: 0; }
.rc-prodtext b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-prodtext small, .rc-dzeile small { display: block; color: var(--leise); font-size: 12px; }
.rc-weg { border: 0; background: none; cursor: pointer; color: var(--leise); font-size: 16px; min-width: 44px; min-height: 44px; }
.rc-weg:hover { color: var(--rot); }
.rc-dialog { width: min(560px, 94vw); max-height: 80vh; border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 14px 16px; background: var(--flaeche); color: inherit; }
.rc-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.rc-dialogkopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rc-dialogkopf h3 { margin: 0; background: none; border: 0; padding: 0; }
.rc-dialogliste { display: grid; gap: 4px; margin-top: 10px; max-height: 50vh; overflow: auto; }
.rc-dzeile { display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px 8px; min-height: 44px; border: 1px solid var(--rahmen); background: var(--feld); border-radius: var(--radius); cursor: pointer; color: inherit; font: inherit; }
.rc-dzeile:hover, .rc-dzeile:focus-visible { border-color: var(--rc-g); background: var(--rc-gh); }
.rc-stammtreffer { margin-top: 4px; padding: 4px 6px; border-left: 3px solid var(--gelb); background: var(--gelb-hell); border-radius: 4px; font-size: 12px; }
.rc-stammtreffer small { color: var(--leise); }
.rc-krit small { font-weight: 400; color: var(--leise); }
.rc-kgruppe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.rc-kname { width: 72px; color: var(--leise); font-size: 12px; }
.rc-kchip { border: 1px solid var(--rahmen); background: var(--flaeche); color: inherit; border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; }
.rc-kchip[aria-pressed="true"] { border-color: var(--rc-g); background: var(--rc-gh); color: var(--rc-g); font-weight: 600; }
.rc-kchip[aria-pressed="true"]::before { content: "✓ "; }
.rc .rc-kchip { font-size: 13px; line-height: 1.2; padding: 5px 11px; min-height: 32px; width: auto; flex: none; }
.rc .rc-kname { width: 76px; flex: none; }
.rc-kreis { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--rahmen); border-radius: var(--radius); }
.rc-kreis p { margin: 0; font-size: 12px; }
.rc-kreis-zeile { display: grid; grid-template-columns: 120px 120px 1fr; gap: 10px; align-items: end; }
.rc-kreis-zeile .knopf { min-height: 44px; }
.rc-kreisergebnis { padding: 8px 10px; background: var(--rc-gh); border: 1px solid var(--rc-g); border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.rc-kreisergebnis[hidden] { display: none; }
@media (max-width: 700px) { .rc-kreis-zeile { grid-template-columns: 1fr 1fr; } .rc-kreis-zeile .knopf { grid-column: 1 / -1; } }

/* Lagerorte: zwei Zeilen je Eintrag (Stammdaten, Standort im Lager) */
.lagerform.lagerform2 { display: grid; grid-template-columns: 150px minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(190px, auto); gap: 8px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rahmen-hell, var(--rahmen)); }
.lagerform2 .lz-etikett { display: grid; gap: 2px; justify-items: start; }
.lagerform2 .lz-etikett small { font-size: 11px; }
.lagerform2 .lz-haken { grid-column: 1 / 4; display: flex; gap: 16px; flex-wrap: wrap; }
.lagerform2 .lz-ort { grid-column: 1 / 4; display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.lagerform2 .lz-ort label { display: grid; gap: 2px; font-size: 12px; color: var(--leise); }
.lagerform2 .lz-ort label.breit { flex: 1; min-width: 200px; }
.lagerform2 .lz-ort input { font-size: 14px; color: var(--text, inherit); }
.lagerform2 > .knopf[type=submit] { grid-column: 4; grid-row: 2 / 4; align-self: center; justify-self: start; min-height: 44px; }
@media (max-width: 900px) { .lagerform.lagerform2 { grid-template-columns: 1fr 1fr; } .lagerform2 .lz-haken, .lagerform2 .lz-ort { grid-column: 1 / -1; } .lagerform2 > .knopf[type=submit] { grid-column: 1 / -1; grid-row: auto; } }

/* Shop-Einstellungen (Reiter Allgemein / Anzeige / Bestellung / Erweitert) */
.sd-zurueck { margin: 0 0 .25rem; font-size: .9rem; }
.sd-tabs { display: flex; gap: .25rem; border-bottom: 2px solid #d9dee5; margin: .75rem 0 1rem; flex-wrap: wrap; }
.sd-tab { padding: .6rem 1.1rem; min-height: 44px; box-sizing: border-box; text-decoration: none; color: #4a5568; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; margin-bottom: -2px; display: inline-flex; align-items: center; }
.sd-tab:hover { background: #f1f4f8; }
.sd-tab.aktiv { color: #1f2d3d; font-weight: 600; background: #fff; border-color: #d9dee5; border-bottom: 2px solid #fff; }
.sd-form { max-width: 760px; }
.sd-form fieldset { border: 1px solid #d9dee5; border-radius: 8px; padding: .75rem 1rem 1rem; margin: 0 0 1rem; display: grid; gap: .65rem; }
.sd-form legend { font-weight: 600; padding: 0 .4rem; }
.sd-form label:not(.haken) { display: grid; gap: .25rem; font-size: .9rem; color: #4a5568; }
.sd-form input:not([type=checkbox]):not([type=color]), .sd-form select, .sd-form textarea { width: 100%; box-sizing: border-box; min-height: 40px; }
.sd-form input.eng { max-width: 11rem; }
.sd-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.sd-farbe { display: flex; gap: .5rem; align-items: center; }
.sd-farbe input[type=color] { width: 44px; height: 40px; padding: 0; flex: none; }
.sd-fuss { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Lagerorte: ruhige Tabelle, eine Zeile je Lagerort; Zeilen wechseln den Hintergrund, damit Filialen erkennbar sind */
.lo { --lo-spalten: 5.5rem minmax(9rem, 14rem) 8rem 5.5rem 8rem 4rem 4.5rem 4rem 4rem 4rem minmax(8rem, 1fr) 6rem; font-size: .9rem; }
.lo-kopf, .lo-form { display: grid; grid-template-columns: var(--lo-spalten); gap: .5rem .6rem; align-items: center; }
.lo-kopf { padding: .4rem .6rem; color: #6b7280; font-size: .8rem; border-bottom: 1px solid #d9dee5; }
.lo-zeile { padding: .45rem .6rem; border-bottom: 1px solid #e8ebf0; background: #fff; }
.lo [data-ziehen] > .lo-zeile:nth-child(even) { background: #eef2f8; }
.lo-zeile:hover { background: #e4ecf8 !important; }
.lo-zeile.gesperrt { opacity: .6; }
.lo-neu { background: #f6f7f9; border-bottom: 0; margin-top: .5rem; border-radius: 6px; }
.lo-form input:not([type=checkbox]) { width: 100%; box-sizing: border-box; height: 30px; min-height: 0; padding-top: 0; padding-bottom: 0; }
.lo-form .griff-feld { display: flex; align-items: center; gap: .3rem; }
.lo-form .lo-kz { font-weight: 600; }
.lo-etikett { display: flex; align-items: center; }
.lo-form .haken { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.lo-ort { display: contents; }
.lo-schalter { position: relative; display: inline-block; width: 36px; height: 20px; }
.lo-schalter input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; min-height: 0 !important; }
.lo-schalter span { position: absolute; inset: 0; background: #cbd2db; border-radius: 20px; transition: background .15s; }
.lo-schalter span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.lo-schalter input:checked + span { background: #2f6fd6; }
.lo-schalter input:checked + span::after { transform: translateX(16px); }
.lo-schalter input:focus-visible + span { outline: 2px solid #2f6fd6; outline-offset: 2px; }
@media (max-width: 1100px) {
  .lo-kopf { display: none; }
  .lo-form { grid-template-columns: repeat(4, 1fr); }
  .lo-breit { grid-column: span 3; }
}

/* Versandschlange */
.vs-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.vs-knoepfe { display: flex; gap: .5rem; align-items: center; }
.vs-filter { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0; }
.vs-filter .chip { min-height: 36px; padding: 0 .9rem; border: 1px solid #d9dee5; border-radius: 18px; background: #fff; color: #4a5568; cursor: pointer; }
.vs-filter .chip.aktiv { background: #2f6fd6; border-color: #2f6fd6; color: #fff; }
.vs-score summary { cursor: pointer; list-style: none; }
.vs-score pre { white-space: pre-wrap; text-align: left; font: inherit; font-size: .8rem; margin: .3rem 0 0; padding: .4rem .6rem; background: #f6f7f9; border-radius: 6px; min-width: 22rem; }
.knopf.klein { min-height: 0; padding: 0 .4rem; font-size: .75rem; }
.vs-suche { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.vs-suche input { width: 22rem; max-width: 100%; height: 34px; box-sizing: border-box; }
.vs-kr { display: grid; grid-template-columns: 4.5rem 15rem 9rem 10rem 9.5rem minmax(10rem, 1fr) 6.5rem; gap: .5rem .75rem; align-items: center; padding: .4rem .6rem; }
.vs-krkopf { color: #6b7280; font-size: .8rem; border-bottom: 1px solid #d9dee5; }
.vs-krzeile { border-bottom: 1px solid #e8ebf0; margin: 0; }
.vs-krzeile:nth-child(odd) { background: #eef2f8; }
.vs-krzeile input:not([type=hidden]), .vs-krzeile select { width: 100%; box-sizing: border-box; height: 32px; min-height: 0; }
.vs-ki { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
#vs-ki-ergebnis { flex-basis: 100%; border: 1px solid #d9dee5; border-radius: 8px; padding: .75rem 1rem; background: #fbfcfd; }
.vs-hinweise { margin: .5rem 0; padding-left: 1.2rem; }

/* Versand: Reiter, Werkzeugleiste, zwei Spalten, Wareneingang */
.vs-reiter { display: flex; gap: .25rem; border-bottom: 1px solid #d9dee5; margin-bottom: .75rem; flex-wrap: wrap; }
.vs-reiter a { padding: .6rem 1rem; color: #4a5568; text-decoration: none; border-bottom: 3px solid transparent; min-height: 44px; box-sizing: border-box; }
.vs-reiter a.aktiv { color: #2f6fd6; border-bottom-color: #2f6fd6; font-weight: 600; }
.vs-zahl { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 10px; background: #eef2f8; color: #4a5568; font-size: .75rem; text-align: center; }
.vs-werkzeug { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.vs-werkzeug input[type=search] { width: 18rem; max-width: 100%; height: 36px; box-sizing: border-box; }
.vs-bis { display: flex; align-items: center; gap: .4rem; color: #6b7280; font-size: .85rem; }
.vs-bis input { height: 36px; box-sizing: border-box; }
.vs-neu { margin-left: auto; }
.vs-raster { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .vs-raster { grid-template-columns: 1fr; } }
.vs-haupt h3, .vs-seite h3, .vs-eingang h3 { margin: 0 0 .5rem; font-size: 1rem; }
.vs-tabelle td { vertical-align: middle; }
.vs-prio { display: inline-block; padding: .1rem .55rem; border-radius: 12px; font-size: .8rem; }
.vs-prio1 { background: #fde8e8; color: #9b1c1c; }
.vs-prio2 { background: #e8effc; color: #1f4fa3; }
.vs-prio3 { background: #eef0f3; color: #4a5568; }
.vs-sterne { color: #c98a00; letter-spacing: 1px; white-space: nowrap; }
.vs-sammel { display: flex; gap: .5rem; align-items: center; margin: .25rem 0 .5rem; }
.vs-aktion { white-space: nowrap; }
.vs-menue { display: inline-block; position: relative; }
.vs-menue summary { list-style: none; cursor: pointer; display: inline-block; }
.vs-menue-inhalt { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid #d9dee5; border-radius: 8px; padding: .6rem; display: grid; gap: .5rem; min-width: 14rem; box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.vs-seite { display: grid; gap: 1rem; }
.vs-karte { border: 1px solid #d9dee5; border-radius: 8px; padding: .9rem 1rem; background: #fff; }
.vs-krit-kopf { margin: .9rem 0 .25rem; color: #6b7280; font-size: .8rem; }
.vs-krit { list-style: none; margin: 0 0 .5rem; padding: 0; font-size: .9rem; }
.vs-krit li { display: flex; justify-content: space-between; padding: .2rem 0; border-bottom: 1px solid #eef0f3; }
.vs-eingang { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #d9dee5; }
.vs-eingang-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.vs-schritte { margin-top: 1rem; padding: .8rem 1rem; background: #f6f7f9; border-radius: 8px; }
.vs-schritte ol { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: .5rem 0 0; padding: 0; }
.vs-schritte li { counter-increment: s; display: grid; gap: .15rem; }
.vs-schritte li span::before { content: counter(s) ". "; font-weight: 600; }
.vs-schritte small { color: #6b7280; }
@media (max-width: 800px) { .vs-schritte ol { grid-template-columns: 1fr 1fr; } }
.vs-versenden { display: flex; gap: .5rem; align-items: center; }
.vs-versenden input { height: 34px; box-sizing: border-box; width: 16rem; }
.vs-karte { box-sizing: border-box; min-width: 0; }
.vs-seite { min-width: 0; }
.vs-sammel select { width: auto; min-width: 9rem; height: 32px; min-height: 0; }
.vs-filter .chip { font-size: .85rem; min-height: 32px; }
.vs-raster { grid-template-columns: minmax(0, 1fr) 19rem; }
@media (max-width: 1100px) { .vs-raster { grid-template-columns: 1fr; } }
.vs-raster { grid-template-columns: minmax(0, 1fr) 22rem; }
.vs-karte .knopf { white-space: normal; max-width: 100%; box-sizing: border-box; height: auto; min-height: 36px; }
@media (max-width: 1100px) { .vs-raster { grid-template-columns: 1fr; } }

/* Beleg laden: ruhiges Filterlayout, Sofortfilter, Farben nur als Streifen und Typ-Zelle */
.bl-filter.bl-neu { display: flex; flex-direction: column; gap: 10px; }
.bl-neu .bl-z1 { display: grid; grid-template-columns: 11rem minmax(16rem, 1fr) auto auto auto; gap: 10px 14px; align-items: end; }
@media (max-width: 1250px) { .bl-neu .bl-z1 { grid-template-columns: 11rem minmax(14rem, 1fr) auto auto; } .bl-neu .bl-knoepfe { grid-column: 1 / -1; justify-content: flex-end; } }
.bl-neu .bl-nr { display: flex; flex-direction: column; gap: 2px; white-space: normal; font-weight: 600; }
.bl-neu .bl-nr input, .bl-neu .bl-gruppe input { height: 34px; box-sizing: border-box; }
.bl-neu .bl-kunden { display: flex; flex-direction: column; gap: 2px; }
.bl-neu .bl-kundenzeile { display: flex; gap: 4px; align-items: stretch; }
.bl-neu .bl-kundenzeile textarea { flex: 1; min-width: 0; height: 34px; min-height: 0; resize: none; padding: 6px 8px; box-sizing: border-box; overflow: hidden; }
.bl-neu .bl-kundenzeile .knopf { height: 34px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
.bl-neu .bl-gruppe { display: flex; gap: 8px; align-items: center; padding: 2px 8px 6px; flex-wrap: nowrap; }
.bl-neu .bl-gruppe label { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.bl-neu .bl-knoepfe { display: flex; gap: 6px; align-items: center; }
.bl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bl-chip { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid #c9d1dc; border-radius: 16px; cursor: pointer; font-size: 13px; background: #fff; color: #4a5568; }
.bl-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.bl-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: #cbd2dc; }
.bl-chip.st-angebot::before { background: #d8c79b; } .bl-chip.st-auftrag::before { background: #b9a9e0; }
.bl-chip.st-packliste::before { background: #8fcfcf; } .bl-chip.st-lieferschein::before { background: #8fb7e3; }
.bl-chip.st-rechnung::before { background: #8fcf86; } .bl-chip.st-gutschrift::before { background: #e39a9a; }
.bl-chip.st-auswahl::before { background: #f0b878; } .bl-chip.st-auswahl_zurueck::before { background: #cfcf8f; }
.bl-chip.bl-chip-inaktiv::before { background: #9a9a9a; }
.bl-chip:has(input:checked) { background: #2f6fd6; border-color: #2f6fd6; color: #fff; }
.bl-chip:has(input:focus-visible) { outline: 2px solid #2f6fd6; outline-offset: 2px; }
.bl-hinweis { font-size: 12px; margin-left: auto; }
/* Trefferliste: neutral mit Farbstreifen; die Farbe steht in der Typ-Zelle */
.bl-tabelle tbody tr td, .bl-tabelle tr.st-entwurf td, .bl-tabelle tr.st-rechnung td, .bl-tabelle tr.st-lieferschein td, .bl-tabelle tr.st-gutschrift td,
.bl-tabelle tr.st-angebot td, .bl-tabelle tr.st-auftrag td, .bl-tabelle tr.st-packliste td, .bl-tabelle tr.st-auswahl td, .bl-tabelle tr.st-auswahl_zurueck td { background: #fff; }
.bl-tabelle tbody tr:nth-child(even) td { background: #f6f8fb; }
.bl-tabelle tbody tr:hover td, .bl-tabelle tbody tr:focus td { background: #e8effc; }
.bl-tabelle tr td:first-child { box-shadow: inset 4px 0 0 #cbd2dc; }
.bl-tabelle tr.st-entwurf td:first-child, .bl-tabelle tr.st-entwurf td.typ { box-shadow: inset 4px 0 0 #e6c84a; }
.bl-tabelle tr.st-entwurf td.typ { box-shadow: none; background: #fff4c2; }
.bl-tabelle tr.st-rechnung td:first-child { box-shadow: inset 4px 0 0 #8fcf86; } .bl-tabelle tr.st-rechnung td.typ { background: #e6f4e3; }
.bl-tabelle tr.st-lieferschein td:first-child { box-shadow: inset 4px 0 0 #8fb7e3; } .bl-tabelle tr.st-lieferschein td.typ { background: #e3eef9; }
.bl-tabelle tr.st-gutschrift td:first-child { box-shadow: inset 4px 0 0 #e39a9a; } .bl-tabelle tr.st-gutschrift td.typ { background: #f9e3e3; }
.bl-tabelle tr.st-angebot td:first-child { box-shadow: inset 4px 0 0 #d8c79b; } .bl-tabelle tr.st-angebot td.typ { background: #f3ecdc; }
.bl-tabelle tr.st-auftrag td:first-child { box-shadow: inset 4px 0 0 #b9a9e0; } .bl-tabelle tr.st-auftrag td.typ { background: #e9e3f6; }
.bl-tabelle tr.st-packliste td:first-child { box-shadow: inset 4px 0 0 #8fcfcf; } .bl-tabelle tr.st-packliste td.typ { background: #e2f1f1; }
.bl-tabelle tr.st-auswahl td:first-child { box-shadow: inset 4px 0 0 #f0b878; } .bl-tabelle tr.st-auswahl td.typ { background: #fdeede; }
.bl-tabelle tr.st-auswahl_zurueck td:first-child { box-shadow: inset 4px 0 0 #cfcf8f; } .bl-tabelle tr.st-auswahl_zurueck td.typ { background: #f1f1e0; }
.bl-tabelle tr.st-inaktiv td.typ { background: #dedede; }

/* Schnell-Adresse im Beleg: schmale Spalte – ein Feld je Zeile in Schriftgröße der Maske (Beschriftung als Platzhalter), Trefferliste vorhandener Kunden */
.adr-schnell { font-size: inherit; }
.adr-schnell .as-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; margin: 4px 0; }
.adr-schnell .as-raster label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.adr-schnell input, .adr-schnell textarea { font: inherit; font-size: inherit; line-height: 1.2; padding: 1px 5px; height: 21px; box-sizing: border-box; min-width: 0; width: 100%; border-radius: 3px; }
.adr-schnell textarea { height: auto; resize: vertical; }
.adr-schnell .as-plzort { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 3px; }
.as-treffer { margin: 4px 0; padding: 5px 8px; border: 1px solid #e0c35c; background: #fff8dc; border-radius: 4px; }
.as-treffer b { font-size: inherit; font-weight: 600; }
.as-kunde { display: block; width: 100%; text-align: left; margin-top: 4px; padding: 4px 8px; min-height: 36px; border: 1px solid #c9d1dc; background: #fff; border-radius: 4px; cursor: pointer; font: inherit; font-size: inherit; line-height: 1.3; }
.as-kunde:hover, .as-kunde:focus-visible { border-color: #2f6fd6; background: #eef4ff; outline: none; }
.as-kunde span { display: block; }
.as-kunde .as-nr { color: #6b7280; font-size: 0.9em; }
.as-kunde .as-firma { font-weight: 600; font-size: inherit; }
.as-kunde .as-ort { color: #374151; font-size: inherit; }
.adr-schnell .as-kunde, .adr-schnell .as-kunde span { letter-spacing: 0; }
.as-kunde .as-grund { color: #8a6d00; font-size: 0.9em; }
.as-kunde em { color: #9b1c1c; font-style: normal; font-size: 0.9em; }
.as-status { min-height: 1.2em; margin: 2px 0; font-size: inherit; }
.adr-schnell .adr-aktion { display: flex; flex-wrap: wrap; gap: 4px; }
.adr-schnell .adr-aktion .knopf { font-size: inherit; padding: 3px 8px; }

/* Schnell-Adresse: Fehlermeldung rot, Feld eingefärbt */
.as-status.fehler { color: var(--rot); font-weight: 600; }

/* Kundenauswahl im Beleg (Raster wie im Altsystem) */
.auswahl-pop.kd-raster { max-width: calc(100vw - 16px); }
.kd-raster .kd-liste { max-height: min(60vh, 420px); overflow: auto; }
.kd-tabelle { border-collapse: collapse; width: 100%; font-size: inherit; }
.kd-tabelle th { position: sticky; top: 0; background: var(--kopf-b); color: var(--leise); font-weight: 600; text-align: left; padding: 2px 6px; border-bottom: 1px solid var(--rahmen); white-space: nowrap; }
.kd-tabelle td { padding: 2px 6px; white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--rahmen-hell); }
.kd-tabelle tr.kd-gruppe td { background: var(--kopf-b); font-weight: 700; padding: 3px 6px; }
.kd-raster .kd-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.kd-raster .kd-auf { white-space: nowrap; font-weight: 400; cursor: pointer; }
.kd-tabelle tr.kd-gruppe.kd-klapp { cursor: pointer; }
.kd-tabelle tr.kd-gruppe.kd-klapp:hover td { background: var(--akzent-hell); }
.kd-tabelle tr.kd-zeile { cursor: pointer; }
.kd-tabelle tr.kd-zeile.aktiv td { background: var(--akzent); color: #fff; }
.kd-tabelle tr.leise td { color: var(--leise); }
.kd-tabelle tr.kd-gruppe.kd-alt td { background: var(--gelb-hell); color: var(--gelb); border-top: 1px solid var(--gelb); }
.kd-tabelle tr.kd-zeile.kd-alt td { background: var(--gelb-hell); color: var(--text); }
.kd-tabelle tr.kd-zeile.kd-alt.aktiv td { background: var(--gelb); color: #fff; }
.kd-tabelle td.kd-sym { width: 1.6em; padding-right: 0; }
.kd-tabelle tr.ap-eintrag { display: table-row; justify-content: initial; gap: 0; }
.kd-tabelle td, .kd-tabelle th { border-left: 0; border-right: 0; border-top: 0; box-shadow: none; text-decoration: none; }
.kd-tabelle td { background: transparent; }
.kd-tabelle tr.kd-gruppe td { background: var(--kopf-b); }
.kd-tabelle tr.kd-zeile.aktiv td { background: var(--akzent); }

/* Popup-Bemerkung des Kunden und Editor für formatierte Bemerkungen */
.kh-box { width: min(560px, 94vw); }
.kh-inhalt { max-height: 60vh; overflow: auto; font-size: 1.3em; line-height: 1.35; padding: 8px 4px; word-break: break-word; }
.rt-wrap { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); }
.rt-leiste { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px; background: var(--kopf-b); border-bottom: 1px solid var(--rahmen-hell); align-items: center; }
.rt-knopf { min-width: 26px; padding: 1px 6px; }
.rt-knopf[data-stil=b] { font-weight: 700; } .rt-knopf[data-stil=i] { font-style: italic; } .rt-knopf[data-stil=u] { text-decoration: underline; }
.rt-wahl { height: 22px; font: inherit; }
.rt-feld { min-height: 16em; max-height: 30em; overflow: auto; padding: 6px 8px; outline: none; line-height: 1.35; }
.rt-feld:focus { box-shadow: inset 0 0 0 1px var(--akzent); }

/* Einschränkungen des Kunden (Kein Porto, Keine Vorfracht …): rot, blinkt nach dem Wählen einige Sekunden, bleibt rot */
.einschraenkung { margin: 6px 0; padding: 8px 12px; border: 1px solid var(--rot); border-radius: var(--radius); background: var(--rot-hell); color: var(--rot); font-weight: 700; }
.einschraenkung[hidden] { display: none; }
.einschraenkung.blinkt { animation: einschr-blink .9s ease-in-out 7; }
@keyframes einschr-blink { 0%, 100% { background: var(--rot-hell); color: var(--rot); } 50% { background: var(--rot); color: #fff; } }
@media (prefers-reduced-motion: reduce) { .einschraenkung.blinkt { animation: none; } }
.rt-farbe { width: 20px; height: 20px; padding: 0; border: 1px solid var(--rahmen); border-radius: 3px; cursor: pointer; }
.rt-farbe:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }

/* ✕ / ⓘ neben „Adresse schnell erfassen“, Artikel Info */
.adr-schnell-kopf { display: flex; gap: 4px; align-items: center; }
.adr-schnell-kopf .adr-x { color: #fff; background: #c0392b; border-color: #a93226; font-weight: 700; min-width: 28px; }
.adr-schnell-kopf .adr-i { color: #fff; background: #2f6fd6; border-color: #2457a8; font-weight: 700; font-style: italic; font-family: serif; min-width: 28px; }
.ai-box { width: min(1400px, 96vw); height: 86vh; max-height: 96vh; display: flex; flex-direction: column; }
.ai-box > .ki-inhalt { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ai-filter { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ai-filter input { flex: 1; max-width: 26em; }
.ai-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.ai-zeile { cursor: pointer; }
.ki-offen { margin: 0 0 8px; padding: 4px 8px; border-radius: 4px; }
.ki-offen.fehler { background: var(--rot-hell); color: var(--rot); border: 1px solid var(--rot); }
.ai-filter.ai-unten { margin: 8px 0 0; }
.adr-i:disabled { opacity: .45; cursor: not-allowed; }
/* Versand: Klappliste der Ansichten und Rahmen */
.vs-ansicht-leiste { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; flex: none; }
.vs-ansicht-leiste select { min-width: 22em; }
.vs-ansicht-rahmen { display: block; width: 100%; flex: 1 1 auto; height: auto; min-height: 420px; border: 0; border-top: 1px solid var(--rahmen); background: #fff; }
main.inhalt:has(> section.vs) { display: flex; flex-direction: column; padding: 0; }
section.vs { flex: 1; display: flex; flex-direction: column; border: 0; border-radius: 0; }
.vs-ansicht-leiste select { width: auto; max-width: 30em; }

/* Anzeigegröße (Klappliste im Kopf, je PC gemerkt; Standard 92 %). Nur das Hauptdokument wird skaliert:
   Seiten in den Rahmen des Arbeitsplatzes bleiben bei 1, sonst würde sich der Faktor vervielfachen. */
html { --anzeige: .92; zoom: var(--anzeige); }
html.im-rahmen { --anzeige: 1; }
/* Menüzeile (Titelzeile + Modulleiste) bleibt bei 100 %: der Zoom von html wird dort aufgehoben */
.titel, .module { zoom: calc(1 / var(--anzeige, 1)); }
.anzeige-groesse { font: inherit; font-size: 10px; padding: 1px 2px; max-width: 7em; }
.vs-zoomreg { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.vs-zoomreg .vs-zoom-text { color: var(--leise); }
.vs-zoomreg input[type=range] { width: 120px; min-width: 0; accent-color: #2f6fd6; }
.vs-ansicht-leiste .vs-zb { width: 24px; height: 24px; padding: 0; border-radius: 12px; font-size: 14px; line-height: 1; }
.vs-ansicht-leiste .vs-zw { min-width: 3.6em; height: 24px; border-radius: 12px; }
.vs-ansicht-leiste button { font: inherit; font-size: 10px; padding: 1px 6px; }

/* „Schließen“ in jeder Maske am selben Ort: rechts oben (Maske mit Werkzeugleiste: am rechten Ende der Leiste) */
.werkzeuge-zu { margin-left: auto; align-self: flex-start; padding: 30px 6px 0 8px; }

.ai-altwahl { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; cursor: pointer; }
.ai-alt { margin: 0 0 6px; padding: 4px 8px; background: var(--flaeche-2, #f3f6fb); border-radius: 6px; }

.ai-filter input[type=checkbox] { flex: none; width: auto; max-width: none; margin: 0; }

/* Statistik: Ziehen über Zeigerereignisse */
.st-chip { user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab; }
.st-ghost { position: fixed; z-index: 9999; pointer-events: none; opacity: .85; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
body.st-zieht, body.st-zieht * { cursor: grabbing !important; user-select: none; }

/* Statistik (Pivot): seitlicher Innenabstand, damit nichts am Rand klebt oder abgeschnitten wird */
.panel.st > .st-leiste, .panel.st > #st-hinweis, .panel.st > .st-feldliste, .panel.st > .st-zonen, .panel.st > #st-meldung, .panel.st > .st-ausgabe, .panel.st > #st-fuss { margin-left: 10px; margin-right: 10px; }
.panel.st > .st-feldliste { padding-left: 6px; padding-right: 6px; }
.panel.st { overflow-x: hidden; }
.modul.rechts + .modul.rechts { margin-left: 0; }

/* Statistik: Dashboard mit Bausteinen */
.db-reiter { align-items: center; flex-wrap: wrap; }
.db-reiter .db-reiter-pivot { margin-left: auto; }
.db-reiter-name { font: inherit; padding: .3rem .5rem; }
.db-reiter-weg { padding: .3rem .5rem; }
.db-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.db-leiste-rechts { margin-left: auto; display: flex; gap: .4rem; }
.db-stand { margin: 0 0 .4rem; font-size: 12px; font-weight: 400; }
.db-raster { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--db-zeile, 64px); gap: 10px; grid-auto-flow: dense; }
.db-raster.db-edit { background-image: linear-gradient(#f1f3f5 1px, transparent 1px); background-size: 100% calc(var(--db-zeile, 64px) + 10px); }
.db-b { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche, #fff); overflow: hidden; }
.db-b-kopf { display: flex; align-items: center; gap: .3rem; padding: .35rem .6rem; border-bottom: 1px solid var(--rahmen); flex: none; }
.db-b-titel { margin: 0; font-weight: 400; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-b .db-inhalt { flex: 1 1 auto; min-height: 0; overflow: auto; }
.db-griff { cursor: grab; user-select: none; touch-action: none; background: #f6f8fa; }
.db-b-knopf { border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: .1rem .35rem; border-radius: 4px; min-width: 28px; min-height: 28px; }
.db-b-knopf:hover { background: #e6eaee; }
.db-groesse { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, #9aa7b4 55%, #9aa7b4 62%, transparent 62%, transparent 72%, #9aa7b4 72%, #9aa7b4 79%, transparent 79%); }
.db-b.db-zieht { opacity: .35; }
.db-geist { position: fixed; z-index: 3000; pointer-events: none; opacity: .85; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); padding: .4rem .7rem; }
.db-marke { border: 2px dashed #5b8fb9; border-radius: var(--radius); background: rgba(91, 143, 185, .1); }
body.db-zieht-aktiv { user-select: none; cursor: grabbing; }
.db-leer { grid-column: 1 / -1; grid-row: span 2; padding: 1rem; }
.db-palette { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; padding: .5rem .6rem; margin-bottom: .6rem; border: 1px dashed #b8c4d0; border-radius: var(--radius); background: #fafbfc; }
.db-palette-titel { font-size: 12px; color: #666; width: 100%; }
.db-palette-gruppe { display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.db-palette-gname { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .03em; }
.db-chip { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--rahmen); border-radius: 999px; background: #fff; cursor: grab; user-select: none; touch-action: none; font-size: 13px; min-height: 30px; }
.db-chip:hover, .db-chip:focus { border-color: #5b8fb9; outline: none; }
.db-balken { display: flex; flex-direction: column; gap: 4px; }
.db-balken-zeile { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; gap: .5rem; align-items: center; font-size: 12px; }
.db-balken-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-balken-spur { background: #eef1f4; border-radius: 3px; height: 14px; display: block; }
.db-balken-fuell { display: block; height: 100%; border-radius: 3px; background: #7ea6c2; }
.db-balken-fuell.db-neg { background: #e08a8a; }
.db-balken-wert { text-align: right; white-space: nowrap; }
.db-dlg { width: min(520px, 94vw); }
.db-dlg-inhalt { padding: .8rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.db-dlg-zeile { display: grid; grid-template-columns: 9em 1fr; gap: .6rem; align-items: center; }
@media (max-width: 800px) { .db-raster { grid-template-columns: repeat(6, minmax(0, 1fr)); } .db-b { grid-column: span 6 !important; } }
.db-frage { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; padding: .5rem .6rem; border: 1px solid var(--rahmen); border-radius: var(--radius); background: #fafbfc; }
.db-frage-nr { font-weight: 600; white-space: nowrap; }
.db-frage input[type=text] { flex: 1 1 22em; min-width: 12em; }
.db-frage-meldung { flex: 1 0 100%; min-height: 1.2em; font-size: 12px; }
.db-frage-meldung.fehlertext { color: #b3261e; }
.db-frage-text { margin: 0 0 .4rem; font-size: 11px; }
.db-profile { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.db-profil-name { min-width: 12em; }

/* Statistik: Kopfzeile (Reiter + Schließen in einer Reihe) und gleichmäßige Ränder */
.db-kopf { display: flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; }
.db-kopf .db-reiter { flex: 1 1 auto; margin-bottom: 0; min-width: 0; }
.db-kopf .seite-zu { flex: none; }
.wb-reiter .seite-zu { flex: none; margin-left: auto; align-self: center; margin-bottom: 3px; }
.panel.db { padding: .6rem .75rem .75rem; box-sizing: border-box; max-width: 100%; overflow-x: hidden; }
.db-stand { margin: 0 0 .5rem; }
.panel.st { box-sizing: border-box; max-width: 100%; }
.panel.db > h2.db-stand { background: none; border: 0; padding: 0; margin: 0 0 .5rem; }
.panel.db > h2.db-stand::before { content: none; }

/* Artikel-Kopfkarte: Felder links, Artikelbild rechts über die volle Höhe der Karte */
.karte-artikel .karte-inhalt { display: flex; gap: 12px; align-items: stretch; padding: 6px 10px 8px 10px; box-sizing: border-box; max-width: 100%; }
.karte-artikel .f-artikel { align-content: start; row-gap: 6px; }
.karte-artikel .karte-inhalt > .felder { flex: 1 1 auto; min-width: 0; }
.karte-artikel .karte-bild { flex: 0 0 clamp(150px, 20%, 240px); min-height: 0; margin: 0; position: relative; padding: 0; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.karte-artikel .karte-bild img, .karte-artikel .karte-bild .karte-bild-platz { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 800px) { .karte-artikel .karte-inhalt { flex-direction: column; } .karte-artikel .karte-bild { flex-basis: 180px; } }

/* Übersichtsseite */
.db-blick { margin: 0 0 8px; }
.db-leer-wert { color: var(--leise, #888); }
.db-hinweis { margin-top: 6px; }

/* ---- Werbung (Lookbooks, Konzept, Beiträge, Auswertung) ---- */
.wb-reiter { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 6px; border-bottom: 1px solid var(--rahmen); }
.wb-reiter a { padding: 5px 12px; text-decoration: none; color: inherit; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.wb-reiter a:hover { background: var(--flaeche); }
.wb-reiter a.aktiv { background: var(--flaeche); border-color: var(--rahmen); font-weight: 600; }
.wb-seite { padding-bottom: 8px; margin-bottom: 8px; }
.wb-seite > label, .wb-seite > .wb-raster, .wb-seite > .wb-leiste, .wb-seite > .wb-suche, .wb-seite > details, .wb-seite > .wb-tabelle-rahmen,
.wb-seite > fieldset, .wb-seite > form, .wb-seite > div { margin-left: 8px; margin-right: 8px; }
.wb-seite label { display: block; margin: 4px 0; }
.wb-seite label input:not([type=checkbox]), .wb-seite label select, .wb-seite label textarea { display: block; width: 100%; }
.wb-leiste { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 6px; margin-bottom: 6px; }
.wb-leiste label { margin: 0; display: block; }
.wb-leiste label input:not([type=checkbox]), .wb-leiste label select { width: auto; min-width: 11em; }
.wb-leiste label.wb-breit { flex: 1 1 22em; }
.wb-leiste label.wb-breit input { width: 100%; }
.wb-klein input { min-width: 16em; }
.wb-zahl { width: 4.5em !important; min-width: 0 !important; }
label.wb-check { display: inline-flex; gap: 4px; align-items: center; }
.wb-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: 4px 12px; }
.wb-form fieldset { border: 1px solid var(--rahmen); border-radius: var(--radius); margin: 6px 8px; padding: 4px 8px 8px; }
.wb-fehler { display: block; color: var(--rot); min-height: 0; }
.wb-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 8px; }
.wb-karte { display: flex; flex-direction: column; gap: 3px; padding: 6px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: #fff; color: inherit; text-decoration: none; }
.wb-karte:hover { border-color: #2f6db5; }
.wb-karte img, .wb-leer { width: 100%; height: 150px; object-fit: cover; background: #eceef0; display: flex; align-items: center; justify-content: center; color: var(--leise); }
.wb-treffer { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; margin: 0 8px; min-height: 8px; }
.wb-treffer button { flex: 0 0 120px; display: flex; flex-direction: column; gap: 2px; padding: 3px; border: 1px solid var(--rahmen); background: #fff; border-radius: var(--radius); cursor: pointer; text-align: left; font: inherit; }
.wb-treffer button:hover:not(:disabled) { border-color: #2f6db5; }
.wb-treffer button:disabled { opacity: .45; cursor: default; }
.wb-treffer img { width: 100%; height: 90px; object-fit: cover; background: #eceef0; }
.wb-positionen { display: flex; flex-direction: column; gap: 6px; margin: 6px 8px; }
.wb-pos { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; padding: 6px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: #fff; }
.wb-pos img { width: 110px; height: 110px; object-fit: cover; background: #eceef0; }
.wb-pos .wb-pos-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; min-width: 0; }
.wb-pos .wb-pos-felder .voll { grid-column: 1 / -1; }
.wb-pos .wb-pos-knoepfe { display: flex; flex-direction: column; gap: 3px; }
.wb-bildwahl { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }
.wb-bildwahl img { width: 34px; height: 34px; cursor: pointer; border: 2px solid transparent; }
.wb-bildwahl img.aktiv { border-color: #2f6db5; }
.wb-tabelle-rahmen { overflow: auto; max-height: 360px; }
/* Kampagnen-Assistent: links der Weg (senkrechte Schritte), rechts die Maske des gewählten Schritts */
.wb-aufbau { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: 12px; align-items: start; margin: 0 8px 8px; }
.wb-weg { position: sticky; top: calc(var(--kopf-fix, 0px) + 6px); padding: 10px 12px 12px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--flaeche); }
.wb-weg h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--leise); display: flex; justify-content: space-between; gap: 6px; }
.wb-schritte { display: flex; flex-direction: column; position: relative; }
.wb-schritte::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: var(--rahmen); }
.wb-schritte button { position: relative; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 7px 6px; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--text); font: inherit; cursor: pointer; }
.wb-schritte button:hover { background: var(--feld); }
.wb-schritte button b { flex: none; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--flaeche); border: 2px solid var(--rahmen); font-size: 12px; z-index: 1; }
.wb-schritte button span { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 4px; }
.wb-schritte button small { color: var(--leise); font-size: 10.5px; line-height: 1.35; }
.wb-schritte button.fertig b { border-color: var(--akzent); color: var(--akzent); }
.wb-schritte button.aktiv { border-color: var(--akzent); background: var(--akzent-hell); }
.wb-schritte button.aktiv b { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.wb-schritte button.aktiv strong { color: var(--akzent); }
.wb-bereich { min-width: 0; }
.wb-bereich > .panel { margin: 0; }
@media (max-width: 860px) { .wb-aufbau { grid-template-columns: 1fr; } .wb-weg { position: static; } .wb-schritte small { display: none; } }
/* Titelbild */
.wb-titelbild { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; gap: 14px; align-items: start; margin: 4px 8px 8px; }
.wb-tb-vorschau { border: 1px solid var(--rahmen); border-radius: var(--radius); background: #fff; padding: 4px; }
.wb-tb-vorschau img, .wb-tb-vorschau .wb-leer { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; height: auto; }
.wb-tb-knoepfe { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.wb-tb-knoepfe p { margin: 0; }
.wb-tb-datei { cursor: pointer; }
@media (max-width: 640px) { .wb-titelbild { grid-template-columns: 1fr; } }
/* Übersicht: Kopfbereich mit Stand-Karte */
.wb-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 16px; align-items: start; margin: 8px; padding: 6px 4px 12px; border-bottom: 1px solid var(--rahmen); }
.wb-hero-text h2 { margin: 0 0 6px; font-size: 1.5em; }
.wb-hero-text p { margin: 0 0 10px; max-width: 46em; color: var(--leise); line-height: 1.45; }
.wb-hero-karte { padding: 10px 12px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); }
.wb-hero-karte h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--leise); }
.wb-hero-karte p { margin: 3px 0; }
@media (max-width: 760px) { .wb-hero { grid-template-columns: 1fr; } }
.wb-seite h3 { margin: 14px 8px 4px; font-size: 1.05em; }
.wb-auswahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 8px; }
.wb-auswahl .wb-a { display: flex; flex-direction: column; gap: 2px; padding: 4px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); font-size: .9em; }
.wb-auswahl .wb-a img, .wb-auswahl .wb-a .wb-leer { width: 100%; height: 110px; object-fit: cover; }
.wb-auswahl .wb-a .wb-pos-knoepfe { flex-direction: row; justify-content: flex-end; }
.wb-pruefliste { list-style: none; margin: 4px 8px; padding: 0; display: grid; gap: 3px; }
.wb-pruefliste li::before { content: "○ "; color: var(--leise); }
.wb-pruefliste li.ok::before { content: "✓ "; color: var(--gruen); font-weight: 700; }
.wb-pruefliste li.fehlt::before { content: "✗ "; color: var(--rot); font-weight: 700; }
.wb-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 8px; }
.wb-kpis > div { min-width: 130px; padding: 6px 12px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); }
.wb-kpis b { display: block; font-size: 1.5em; }
.wb-fuss { position: sticky; bottom: 0; padding: 8px; background: var(--flaeche); border-top: 1px solid var(--rahmen); }
.wb-ok { color: var(--gruen); } .wb-schlecht { color: var(--rot); }
.wb-netze { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.wbt-liste { display: flex; flex-direction: column; gap: 6px; margin: 6px 8px; }
.wbt-beitrag { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 6px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: #fff; }
.wbt-beitrag img { width: 90px; height: 90px; object-fit: cover; background: #eceef0; }
.wbt-beitrag.veroeffentlicht { opacity: .7; }
.wbt-kopf { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 4px; }
.wbt-beitrag textarea { width: 100%; }
.wbt-zaehler.zuviel { color: var(--rot); font-weight: 600; }
.wk-block { margin: 6px 8px; }
.wk-block h3 { margin: 8px 0 3px; font-size: 12px; }
.wk-block textarea { width: 100%; }
.wk-tab { width: 100%; border-collapse: collapse; }
.wk-tab th, .wk-tab td { border: 1px solid var(--rahmen); padding: 2px 4px; vertical-align: top; text-align: left; }
.wk-tab input, .wk-tab textarea { width: 100%; }
.wa-balken { display: flex; align-items: end; gap: 1px; height: 46px; max-width: 420px; }
.wa-balken span { flex: 1; background: #2f6db5; min-height: 1px; }
.wa-ki { margin: 8px; padding: 8px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: #fff; }
.wbt-kopf select, .wbt-kopf input, .wb-leiste > input, .wb-leiste > select { width: auto; min-width: 8em; }
#wbt-profile .wb-leiste > input { flex: 1 1 14em; }
.wb-material { font-size: .85em; margin: 2px 0 6px; }
.pflege-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pflege-karte { margin: 0; padding: 8px; border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); text-align: center; font-size: .85em; }
.pflege-karte img { display: block; margin: 0 auto 4px; }
.pflege-wahl { grid-column: 1 / -1; margin: 10px 0; border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 6px 10px; }
.pflege-gruppe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.pflege-gruppe > b { flex: 0 0 11em; font-weight: 600; }
.pflege-sym { position: relative; display: inline-flex; padding: 3px; border: 1px solid var(--rahmen); border-radius: var(--radius); cursor: pointer; }
.pflege-sym:has(input:checked) { border-color: var(--akzent, #2a5db0); background: #e8eefb; }
.pflege-sym input { position: absolute; opacity: 0; pointer-events: none; }
.pflege-sym:focus-within { outline: 2px solid var(--akzent, #2a5db0); outline-offset: 1px; }
.pflege-sym:hover { background: #f0f3f8; }
.wb-vorlagen { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; margin-top: 10px; }
.wb-vorlage { border: 1px solid var(--rahmen); border-radius: var(--radius); background: var(--feld); padding: 10px 12px; }
.wb-vorlage h3 { margin: 0 0 2px; font-size: 1em; }
.wb-vorlage textarea { width: 100%; box-sizing: border-box; }
.wb-vorlage form { margin: 0; }
.wb-vorlage .wb-leiste { align-items: center; }

/* Kopfkarte: Vorschaustreifen links, großes Bild rechts */
.karte-artikel .karte-bild { align-items: stretch; justify-content: flex-start; }
.karte-artikel .karte-bild:has(.kb-thumbs) { flex-basis: clamp(220px, 28%, 380px); }
.karte-artikel .kb-haupt { flex: 1 1 auto; min-width: 0; position: relative; }
.karte-artikel .kb-haupt > img, .karte-artikel .kb-haupt > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.karte-artikel .kb-thumbs ~ .kb-haupt { margin-left: 54px; }
.karte-artikel .kb-thumbs { position: absolute; left: 0; top: 0; bottom: 0; width: 54px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 4px; overflow-y: auto; border-right: 1px solid var(--rahmen); background: #fff; }
.karte-artikel .kb-thumb { padding: 0; width: 44px; height: 44px; flex: 0 0 44px; border: 2px solid transparent; border-radius: 3px; background: #fff; cursor: pointer; overflow: hidden; }
.karte-artikel .kb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.karte-artikel .kb-thumb:hover { border-color: #b8c6dc; }
.karte-artikel .kb-thumb.aktiv { border-color: var(--akzent, #2a5db0); }
/* Artikelimport: Feldzuordnung */
.zu-tabelle th.zu-wahl { padding: 4px; background: #eef2f8; }
.zu-tabelle th.zu-wahl select { width: 100%; min-width: 130px; font-weight: 600; }
.zu-tabelle th.zu-name { font-weight: 400; font-size: .85em; color: var(--text-leise, #555); background: #f7f8fa; }
.zu-tabelle td, .zu-tabelle th { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.zu-tabelle .zu-aus { opacity: .5; }
.zu-tabelle .zu-f-artikel { background: #e3efff; } .zu-tabelle .zu-f-qual { background: #f1e8fb; } .zu-tabelle .zu-f-farbe { background: #fdebd8; }
.zu-tabelle .zu-f-ek { background: #e3f4e5; } .zu-tabelle .zu-f-uvp { background: #daf1ee; } .zu-tabelle .zu-f-gr { background: #fbf3c9; }
#zu-stand.fehler { color: #b00020; font-weight: 600; }

/* Lookbook-Editor Schritt 4: Eingabe links, Vorschau rechts */
.wb-s4 { display: block; }
.wb-s4-links > label, .wb-s4-links > .wb-raster, .wb-s4-links > .wb-leiste, .wb-s4-links > details, .wb-s4-links > .wb-tabelle-rahmen,
.wb-s4-links > div, .wb-s4-links > ul, .wb-s4-links > p { margin-left: 8px; margin-right: 8px; }
.wb-s4-links label { display: block; margin: 4px 0; }
.wb-s4-links label input:not([type=checkbox]), .wb-s4-links label select, .wb-s4-links label textarea { display: block; width: 100%; }
.wb-s4-links .wb-leiste label.knopf { display: inline-block; width: auto; cursor: pointer; }
.wb-s4-rechts { margin: 14px 8px 0; }
.wb-vs-kopf { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.wb-vs-kopf strong { margin-right: auto; }
#wb-vorschau { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--rand, #d7dae0); border-radius: 6px; background: #fff; }
.wb-bsp { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-bsp .knopf { font-size: .85em; padding: 3px 9px; }
/* Karten in Schritt 4: eine Aufgabe je Block, Nebensachen eingeklappt */
.wb-s4-links > .wb-block { margin: 0 8px 12px; padding: 10px 14px 12px; border: 1px solid var(--rahmen); border-radius: 8px; background: var(--feld, #fff); }
.wb-block > h3, .wb-block > summary { margin: 0 0 8px; font-size: 1.05em; font-weight: 700; }
.wb-block > summary { cursor: pointer; margin: 0; list-style-position: inside; }
.wb-block[open] > summary { margin-bottom: 8px; }
.wb-block > summary .leise { font-weight: 400; }
.wb-nr { display: inline-block; min-width: 1.6em; height: 1.6em; line-height: 1.6em; margin-right: 6px; text-align: center; border-radius: 50%; background: var(--akzent-hell, #cfe2fa); color: var(--text); font-size: .85em; }
.wb-senden { border: 2px solid var(--akzent, #2f6fb0) !important; }
.wb-mehr { margin: 6px 0 0; }
.wb-mehr > summary { cursor: pointer; color: var(--leise); }
.wb-s4-links .wb-block > .wb-leiste, .wb-s4-links .wb-block > label, .wb-s4-links .wb-block > .wb-raster, .wb-s4-links .wb-block > ul,
.wb-s4-links .wb-block > p, .wb-s4-links .wb-block > div, .wb-s4-links .wb-block > details { margin-left: 0; margin-right: 0; }
@media (min-width: 1100px) {
  .wb-s4 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 42%); gap: 12px; align-items: start; }
  .wb-s4-rechts { position: sticky; top: 8px; margin-top: 14px; }
  #wb-vorschau { height: calc(100vh - 120px); }
}
.wb-vs-schalter { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 6px; }
.wb-vs-schalter .wb-check { margin: 0; }
/* Aufbau-Editor (Lookbook Schritt 4 und Vorlagen) */
.wb-au-raster { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 6px; }
.wb-au-abschnitte { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-bottom: 6px; }
.wb-au-zeilen { display: grid; gap: 6px; margin: 6px 0; }
.wb-au-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) 9.5em auto auto auto; gap: 6px; align-items: center; }
.wb-au-zeile input[type=text], .wb-au-zeile select { width: 100%; }
.wb-au-k { min-width: 2.2em; padding-left: 6px; padding-right: 6px; }
.wb-au-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.wb-au-chip { font-family: ui-monospace, Consolas, monospace; font-size: .85em; padding: 3px 9px; }
.wb-textvars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.wb-s4-links .wb-block .wb-au-raster label { display: inline-block; margin: 0; }
.wb-s4-links .wb-block .wb-au-raster input, .wb-s4-links .wb-block .wb-au-raster select { display: inline-block; width: auto; }

/* Aufbau-Editor: Zeilen mit der Maus verschieben */
.wb-au-zeile { align-items: center; }
.wb-au-griff { cursor: grab; color: #8a93a3; font-size: 1.1rem; padding: 0 .35rem; user-select: none; }
.wb-au-zeile.zieht { opacity: .4; }
.wb-au-zeile.ziel { outline: 2px solid #2f6fbd; background: #e8f0fb; }
.wb-au-zeile.gewaehlt { outline: 2px solid #2f6fbd; background: #f2f7fd; }

/* Internet-Suche: Firma nicht gefunden */
.ki-nf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 8px 0; }
.ki-nf label { display: grid; gap: 2px; font-size: .9rem; }
.ki-nf input { width: 100%; box-sizing: border-box; }
.ki-nf .ki-nf-breit { grid-column: 1 / -1; }
.ki-nf-hand { margin-top: 6px; }

/* Matrix: Mengen in andere Variantenzeilen übernehmen */
.mx-kopie { border: 1px solid var(--linie, #c9ced6); background: #f6f7f9; border-radius: 4px; cursor: pointer; padding: 0 4px; margin-right: 4px; font-size: .85rem; line-height: 1.3; }
.mx-kopie:hover { background: #e8f0fb; }
.mx-kopie-liste { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; margin: 4px 0; }
.mx-kopie-liste label, .mx-kopie-opt { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.mx-kopie-alle { font-weight: 600; border-bottom: 1px solid var(--linie, #dde1e6); padding-bottom: 3px; margin-bottom: 2px; }
.mx-kopie-box { border: 1px solid var(--linie, #c9ced6); border-radius: 6px; background: #fff; padding: 8px 10px; margin: 8px 0; display: flex; flex-direction: column; gap: 5px; }
.status .status-info { color: var(--text, inherit); font-weight: 600; }

/* Eigene Rückfrage (wwsBestaetigen) */
.ki-dialog.bestaetigen { z-index: 1200; display: flex; align-items: center; justify-content: center; }
.bestaetigen .ki-box { width: min(480px, 92vw); }
.bestaetigen-inhalt p { margin: 0 0 .7rem; line-height: 1.45; }
.bestaetigen-warnung { background: #fff3cd; border: 1px solid #d9a400; border-radius: 6px; padding: .5rem .7rem; font-weight: 600; white-space: pre-line; }
.bestaetigen-knoepfe { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* Kachel Auftragseingang im Monat */
.db-ek-monat { color: #555; }
.db-ek-gross { font-size: 2.2rem; font-weight: 700; text-align: center; color: #17375e; padding: .5rem 0 .1rem; }
.db-ek-delta { text-align: center; margin-bottom: .8rem; color: #555; }
.db-ek-plus b { color: #1f8a3b; }
.db-ek-minus b { color: #c0392b; }
.db-ek-karten { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.db-ek-karte { border: 1px solid var(--rahmen); border-radius: 8px; padding: .5rem .7rem; display: flex; flex-direction: column; gap: .15rem; background: #fff; }
.db-ek-karte span { color: #666; font-size: 12px; }
.db-ek-titel { border-top: 1px solid var(--rahmen); padding-top: .5rem; margin-bottom: .2rem; color: #333; }
.db-ek-vj { stroke: #98a3b3; stroke-width: 1; stroke-dasharray: 5 4; }

/* Matrix: Zellen mit Einzelpreis etwas höher, damit die Preisangabe den Wert nicht überlagert */
.matrix-tabelle td.zelle.hat-preis { height: 42px; }
.matrix-tabelle td.zelle.hat-preis input { height: 42px; padding-bottom: 12px; }
.matrix-tabelle td.zelle small.preis-abw { right: 4px; left: auto; }

/* Übersicht, Cockpit: Ampel unter der Kennzahl (Farbe plus Text, nicht nur Farbe) */
.db-ampel { margin-top: 8px; padding: 5px 9px; border-radius: 6px; border-left: 5px solid var(--rahmen); background: var(--feld); font-size: 12px; font-weight: 600; }
.db-ampel-gruen { border-left-color: #1e8e5a; background: #e6f4ec; color: #14663f; }
.db-ampel-gelb { border-left-color: #d99a00; background: #fff4d6; color: #7a5600; }
.db-ampel-rot { border-left-color: #c0392b; background: #fbe6e3; color: #8e2418; }

/* Cockpit: Sparkline, Alarme, Fokus, Hebel */
.db-spark { display: block; width: 100%; height: 38px; margin-top: 10px; }
.db-spark-linie { stroke: var(--akzent, #1a5fb4); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.db-fuss { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--rahmen); font-size: 11px; color: var(--leise); }
.db-alarme { display: flex; flex-direction: column; gap: 8px; }
.db-alarm { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid var(--rahmen); border-radius: 8px; background: #fff; }
.db-adot { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; flex: none; }
.db-adot-kritisch { background: #c0392b; } .db-adot-beobachten { background: #d99a00; } .db-adot-ok { background: #1e8e5a; }
.db-akoerper { flex: 1; min-width: 0; }
.db-atitel { font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.db-atext { font-size: 12px; color: var(--leise); margin-top: 1px; }
.db-sev { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; text-transform: uppercase; }
.db-sev-kritisch { background: #fbe6e3; color: #8e2418; } .db-sev-beobachten { background: #fff4d6; color: #7a5600; } .db-sev-ok { background: #e6f4ec; color: #14663f; }
.db-abar { height: 6px; background: #eef1f4; border-radius: 4px; margin-top: 7px; overflow: hidden; }
.db-abar i { display: block; height: 100%; border-radius: 4px; }
.db-abar-kritisch { background: #c0392b; } .db-abar-beobachten { background: #d99a00; } .db-abar-ok { background: #1e8e5a; }
.db-ameta { display: flex; justify-content: space-between; font-size: 11px; color: var(--leise); margin-top: 4px; }
.db-ameta b { color: inherit; font-variant-numeric: tabular-nums; }
.db-fokus { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.db-fbox { border: 1px solid var(--rahmen); border-radius: 8px; padding: 10px 12px; background: var(--feld); }
.db-fbox-gelb { background: #fff4d6; border-color: #ecd28a; } .db-fbox-rot { background: #fbe6e3; border-color: #efb4ac; }
.db-flabel { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--leise); }
.db-fwert { font-size: 20px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.db-funter { font-size: 11px; color: var(--leise); margin-top: 3px; }
.db-hebel { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid var(--rahmen); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.db-prio { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 9px; height: fit-content; background: #eef1f4; color: var(--leise); }
.db-prio1 { background: #1c2733; color: #fff; } .db-prio2 { background: #dbeafe; color: #1d4ed8; }
.db-wirkung { font-size: 11px; font-weight: 700; color: #14663f; margin-top: 4px; }

/* ===== Übersicht · Reiter „Cockpit“: Gestaltung nach Entwurf (helle Karten, runde Ecken, Farbakzente) ===== */
.db-raster.db-cockpit { background: #f1f5f9; padding: 16px; border-radius: 14px; gap: 16px;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #0f172a; }
.db-raster.db-cockpit.db-edit { background-image: none; }
.db-cockpit .db-b.db-cp { border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px -4px rgba(15,23,42,.08); }
.db-cockpit .db-b.db-cp .db-b-kopf { border: 0; padding: 18px 20px 0; }
.db-cockpit .db-b.db-cp .db-b-titel { font-size: 15.5px; font-weight: 800; color: #0f172a; white-space: normal; }
.db-cockpit .db-b.db-cp-kpi .db-b-kopf { display: none; }
.db-cockpit.db-edit .db-b.db-cp-kpi .db-b-kopf { display: flex; padding: 6px 12px 0; }
.db-cockpit .db-b.db-cp .db-inhalt { padding: 4px 20px 18px; overflow: auto; }
.db-cockpit .db-b.db-cp-kpi .db-inhalt { padding: 18px 20px 14px; overflow: hidden; }
.db-cockpit .db-b.db-cp .leise { color: #94a3b8; font-size: 11.5px; margin: 10px 0 0; }
.cp-sub { font-size: 12.5px; color: #64748b; margin: 2px 0 10px; }

/* Kennzahlenkarten */
.cp-kpi { display: flex; flex-direction: column; height: 100%; }
.cp-kopf { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.cp-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.cp-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.cp-ico svg { width: 19px; height: 19px; }
.cp-ico-blau { background: #eff6ff; color: #2563eb; } .cp-ico-violett { background: #f5f3ff; color: #8b5cf6; }
.cp-ico-gruen { background: #ecfdf5; color: #059669; } .cp-ico-bernstein { background: #fffbeb; color: #d97706; }
.cp-wert { font-size: 29px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cp-zeile { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cp-hint { font-size: 12px; color: #94a3b8; }
.cp-pille { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 20px; white-space: nowrap; background: #f1f5f9; color: #64748b; }
.cp-pille-gruen { background: #ecfdf5; color: #047857; } .cp-pille-gelb { background: #fffbeb; color: #b45309; }
.cp-pille-rot { background: #fef2f2; color: #b91c1c; } .cp-pille-grau { background: #f1f5f9; color: #64748b; }
.cp-spark, .cp-spark-leer { display: block; width: 100%; height: 38px; margin-top: auto; padding-top: 10px; box-sizing: content-box; }
.cp-spark-leer { border-bottom: 1px dashed #e2e8f0; height: 28px; padding-top: 0; }
.cp-spark-linie { stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cp-spark-blau .cp-spark-linie { stroke: #2563eb; } .cp-spark-blau .cp-stop-a { stop-color: #2563eb; stop-opacity: .28; } .cp-spark-blau .cp-stop-b { stop-color: #2563eb; stop-opacity: 0; }
.cp-spark-violett .cp-spark-linie { stroke: #8b5cf6; } .cp-spark-violett .cp-stop-a { stop-color: #8b5cf6; stop-opacity: .28; } .cp-spark-violett .cp-stop-b { stop-color: #8b5cf6; stop-opacity: 0; }
.cp-spark-gruen .cp-spark-linie { stroke: #10b981; } .cp-spark-gruen .cp-stop-a { stop-color: #10b981; stop-opacity: .28; } .cp-spark-gruen .cp-stop-b { stop-color: #10b981; stop-opacity: 0; }
.cp-spark-bernstein .cp-spark-linie { stroke: #ef4444; } .cp-spark-bernstein .cp-stop-a { stop-color: #ef4444; stop-opacity: .22; } .cp-spark-bernstein .cp-stop-b { stop-color: #ef4444; stop-opacity: 0; }
.cp-fuss { margin-top: 8px; padding-top: 10px; border-top: 1px dashed #e2e8f0; font-size: 12px; color: #64748b; display: flex; justify-content: space-between; gap: 8px; }
.cp-fuss b { color: #0f172a; }
.cp-t-gruen { color: #047857 !important; } .cp-t-gelb { color: #b45309 !important; } .cp-t-rot { color: #b91c1c !important; } .cp-t-grau { color: #64748b; }

/* Ring */
.cp-donut-wrap { display: flex; gap: 20px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cp-donut { position: relative; width: 190px; height: 190px; flex: none; }
.cp-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cp-ring { fill: none; stroke-width: 24; }
.cp-donut-mitte { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.cp-donut-summe { font-size: 14px; max-width: 96px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cp-donut-kap { font-size: 11.5px; color: #64748b; font-weight: 600; }
.cp-legende { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.cp-leg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.cp-leg:hover { background: #f8fafc; border-color: #e2e8f0; }
.cp-leg-punkt { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.cp-leg-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-leg-wert { margin-left: auto; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-leg-pct { font-size: 12px; color: #64748b; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.cp-note { margin-top: 12px; border-radius: 12px; padding: 10px 14px; font-size: 12.5px; border: 1px solid; }
.cp-note-gruen { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; } .cp-note-gelb { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.cp-note-rot { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Säulen */
.cp-chartleg { display: flex; gap: 16px; margin: 4px 0; font-size: 12.5px; color: #64748b; font-weight: 600; }
.cp-chartleg span { display: flex; align-items: center; gap: 7px; }
.cp-sw { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.cp-sw-grau { background: #e2e8f0; border: 1px solid #cbd5e1; } .cp-sw-blau { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.cp-bars { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding: 18px 6px 0; position: relative; border-bottom: 2px solid #e2e8f0; margin-top: 6px; }
.cp-grid { position: absolute; inset: 18px 6px 0; pointer-events: none; }
.cp-grid i { position: absolute; left: 0; right: 0; border-top: 1px dashed #e8eef5; }
.cp-grid i em { position: absolute; right: 0; top: -15px; font-style: normal; font-size: 10.5px; color: #94a3b8; font-weight: 600; }
.cp-bgruppe { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 100%; position: relative; z-index: 1; border-radius: 10px 10px 0 0; padding: 0 4px; }
.cp-bgruppe:hover { background: #f8fafc; }
.cp-bar { width: 34px; max-width: 40%; border-radius: 7px 7px 0 0; min-height: 0; }
.cp-bar-grau { background: linear-gradient(180deg, #e2e8f0, #cbd5e1); border: 1px solid #cbd5e1; border-bottom: 0; }
.cp-bar-blau { background: linear-gradient(180deg, #60a5fa, #2563eb 60%, #1e40af); box-shadow: 0 4px 10px -3px rgba(37,99,235,.45); }
.cp-bx { display: flex; gap: 6px; padding: 10px 6px 0; }
.cp-bx span { flex: 1; text-align: center; font-size: 11.5px; font-weight: 700; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Alarme */
.cp-alarme { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.cp-alarm { display: flex; gap: 13px; align-items: flex-start; padding: 13px 14px; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; }
.cp-alarm:hover { box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px -4px rgba(15,23,42,.08); }
.cp-adot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; }
.cp-adot-kritisch { background: #ef4444; box-shadow: 0 0 0 4px #fef2f2; } .cp-adot-beobachten { background: #f59e0b; box-shadow: 0 0 0 4px #fffbeb; } .cp-adot-ok { background: #10b981; box-shadow: 0 0 0 4px #ecfdf5; }
.cp-akoerper { flex: 1; min-width: 0; }
.cp-atitel { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-atext { font-size: 12.5px; color: #64748b; margin-top: 2px; }
.cp-sev { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 12px; text-transform: uppercase; }
.cp-sev-kritisch { background: #fef2f2; color: #b91c1c; } .cp-sev-beobachten { background: #fffbeb; color: #b45309; } .cp-sev-ok { background: #ecfdf5; color: #047857; }
.cp-abar { height: 6px; background: #f1f5f9; border-radius: 4px; margin-top: 9px; overflow: hidden; }
.cp-abar i { display: block; height: 100%; border-radius: 4px; }
.cp-abar-ok { background: linear-gradient(90deg, #10b981, #34d399); } .cp-abar-beobachten { background: linear-gradient(90deg, #fbbf24, #f59e0b); } .cp-abar-kritisch { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.cp-ameta { display: flex; justify-content: space-between; font-size: 11.5px; color: #64748b; margin-top: 5px; font-weight: 600; }
.cp-ameta b { font-variant-numeric: tabular-nums; }

/* Fokus */
.cp-fokus { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.cp-fbox { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 13px; padding: 14px 16px; }
.cp-fbox:hover { background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px -4px rgba(15,23,42,.08); }
.cp-fbox-gelb { background: #fffbeb; border-color: #fde68a; } .cp-fbox-rot { background: #fef2f2; border-color: #fecaca; }
.cp-flabel { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; }
.cp-fwert { font-size: 23px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cp-funter { font-size: 12px; margin-top: 3px; font-weight: 600; }

/* Tabelle */
.cp-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.cp-tabelle th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #64748b; padding: 10px 12px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.cp-tabelle td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-variant-numeric: tabular-nums; }
.cp-tabelle th.r, .cp-tabelle td.r { text-align: right; }
.cp-tabelle tbody tr:hover { background: #f8fafc; } .cp-tabelle tbody tr:last-child td { border-bottom: 0; }
.cp-name { font-weight: 700; }

/* Hebel */
.cp-hebel { display: flex; gap: 12px; padding: 13px 14px; border: 1px solid #e2e8f0; border-radius: 13px; margin-top: 10px; background: #fff; }
.cp-hebel:hover { box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px -4px rgba(15,23,42,.08); }
.cp-prio { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 3px 9px; border-radius: 10px; height: fit-content; white-space: nowrap; }
.cp-prio1 { background: #0f172a; color: #fff; } .cp-prio2 { background: #dbeafe; color: #1d4ed8; } .cp-prio3 { background: #f1f5f9; color: #64748b; }
.cp-wirkung { font-size: 12px; font-weight: 800; color: #047857; margin-top: 6px; }

/* Beleg im eigenen Fenster: „Schließen“ nur dort sichtbar */
.wk[data-fenster-schliessen] { display: none; }
html.im-fenster .wk[data-fenster-schliessen] { display: inline-flex; }

/* Farbschema von Hand (Auswahl im Kopf): auch Formularfelder und Bildlaufleisten folgen */
html[data-farbschema="hell"] { color-scheme: light; }
html[data-farbschema="dunkel"] { color-scheme: dark; }

/* Auftrag erfassen: Haken „in alter Datenbank suchen“ unter der Anschrift, rechtsbündig */
.felder > .kunde-alt { grid-column: 1 / -1; justify-self: end; font-size: 12px; font-weight: 600; color: #7a5200; cursor: pointer; }
.felder > .kunde-alt[hidden] { display: none; }
.felder > .kunde-alt input { margin: 0; accent-color: #c27c1a; }

/* Aktivität: Zeitverlauf (SVG) */
.graph { width: 100%; height: auto; max-width: 1000px; display: block; }
.graph .g-text { font-size: 11px; fill: var(--text, #333); }
.graph .g-achse { stroke: #8a94a3; stroke-width: 1; }
.graph .g-balken { fill: #2f6fdd; }
.graph .g-grund { fill: rgba(128,128,128,.12); }
.graph-fenster .knopf { margin-right: 4px; text-decoration: none; }
.graph-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.graph-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; }
.gm0 { fill: #2f6fdd; background: #2f6fdd; } .gm1 { fill: #e08a1e; background: #e08a1e; }
.gm2 { fill: #2e9e5b; background: #2e9e5b; } .gm3 { fill: #c0392b; background: #c0392b; }
.gm4 { fill: #8e5bd0; background: #8e5bd0; } .gm5 { fill: #17a2b8; background: #17a2b8; }
.gm6 { fill: #b5a100; background: #b5a100; } .gm7 { fill: #d6458f; background: #d6458f; }
.gm8 { fill: #6b7a8f; background: #6b7a8f; } .gm9 { fill: #7a4f2a; background: #7a4f2a; }

/* Sonderpreis (defekt/schmutzig/sonstiges): Zeile und Matrixzelle dezent gelb-orange */
.pos-tabelle tr.sonderpreis td { background: #fff4df; }
.pos-tabelle tr.sonderpreis:hover td { background: #ffecc6; }
.matrix-tabelle td.zelle.hat-sonder { background: #fff4df; }

/* Letzter Rechnungspreis des Kunden: Preisfeld bläulich (Einstellungen › Preisregeln) */
.pos-tabelle tr.letzterpreis input[name="p_preis"] { background: #e3f0ff; box-shadow: inset 0 -2px 0 #3b82f6; }
.matrix-tabelle td.zelle.hat-letzter { box-shadow: inset 0 -2px 0 #3b82f6; }

/* Datenbankwahl in der Kopfzeile (nur NVM-Admin) und Warnstreifen in der Testdatenbank */
.dbwahl { display: inline-flex; align-items: center; gap: .4em; margin-left: .6em; }
.dbwahl select { max-width: 14em; }
.db-auswahl { position: relative; display: inline-block; }
#db-wahl { max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-menue { position: absolute; z-index: 1000; left: 0; bottom: 100%; margin: 0 0 .2em; padding: .2em 0; list-style: none; min-width: 14em; max-height: 20em; overflow: auto;
  background: var(--flaeche, #fff); color: inherit; border: 1px solid #888; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.db-menue[hidden] { display: none; }
.db-menue li { font-size: 13px; color: initial; padding: .3em .8em; cursor: pointer; white-space: nowrap; }
.db-menue li[aria-selected="true"], .db-menue li:hover, .db-menue li:focus { background: #d9e6f7; outline: none; }
.db-menue li.aktiv { font-weight: 700; }
.db-menue li.test::after { content: " (Test)"; color: #666; font-weight: 400; }
.db-menue li[aria-disabled="true"] { color: #777; cursor: default; }
.db-kontext { position: fixed; bottom: auto; margin: 0; min-width: 16em; }
.db-kontext li.gefahr { color: #b3261e; }
.testdb-streifen { background: #b3261e; color: #fff; text-align: center; font-weight: 600; padding: .25em .6em; }

/* Beleg: Sofortprüfung der Positionen und Bestandshinweis */
.pos-tabelle input.feld-falsch { border-color: var(--rot, #c0392b); background: #ffe3e0; outline: 1px solid var(--rot, #c0392b); }
.pos-tabelle tr.pos-falsch td.nr { background: #ffd0cc; }
.pos-tabelle tr.bestand-null .lager-knopf { background: var(--rot, #c0392b); color: #fff; border-radius: 3px; padding: 0 .35em; }
.pos-tabelle tr.bestand-null .lager-knopf::before { content: "⚠ "; }
.pos-tabelle tr.bestand-knapp .lager-knopf { background: #ffe2b8; border-radius: 3px; padding: 0 .35em; }
#kunde-info.ff-ok { color: var(--leise, #5a6570); }
/* Rückfrage „Lagerbestand reicht nicht“ als schlichtes Fenster */
.mangel-fenster { max-width: 720px; margin: 24px auto; padding: 16px 20px; border: 1px solid var(--rand, #c9d1d9); border-radius: 8px; background: var(--flaeche, #fff); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.mangel-fenster form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Einstellungsfenster (eigenes Browserfenster): Schließen-Knopf */
.fenster-zu { position: fixed; right: 12px; bottom: 12px; z-index: 9999; padding: 6px 12px; border: 1px solid var(--rand, #9aa5b1); border-radius: 6px; background: var(--flaeche, #fff); color: inherit; font: inherit; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.fenster-zu:hover { background: var(--rot-hell, #ffe3e0); }
.dd-nummer { margin: 0 0 8px; font-size: 1.05em; }
/* Tipp-Suche Artikel im Beleg */
.art-tipp { max-height: 320px; overflow-y: auto; white-space: nowrap; }
.art-tipp .ap-zeile { padding: 3px 8px; cursor: pointer; }
.art-tipp .ap-zeile.gewaehlt { background: var(--auswahl, #cfe3ff); }
.art-tipp .ap-zeile.gesperrt { opacity: .6; }

.bestaetigen-eingabe { display: block; margin-top: .4rem; font-weight: 600; }
.bestaetigen-eingabe input { display: block; width: 100%; margin-top: .3rem; padding: .45rem .6rem; box-sizing: border-box; }
.knopf.gefahr { background: #b3261e; border-color: #b3261e; color: #fff; }
.knopf.gefahr:disabled { opacity: .45; cursor: not-allowed; }
.bestaetigen .ki-box { box-shadow: 0 12px 40px rgba(0,0,0,.28); }

/* Übersicht: Kennzahlen und Aufgaben */
.db-kz { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 4px 2px; }
.db-kz-feld { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-left: 3px solid var(--akzent, #2a6df4); background: rgba(127, 127, 127, .07); border-radius: 4px; }
.db-kz-titel { font-size: .8rem; opacity: .75; }
.db-kz-wert { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.db-kz-unter { font-size: .78rem; opacity: .7; }
.db-aufgaben { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.db-aufgaben li { display: grid; grid-template-columns: 5.4rem 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border-left: 4px solid #9aa4b2; background: rgba(127, 127, 127, .07); border-radius: 4px; }
.db-aufgaben li.db-aufg-gelb { border-left-color: #e0a100; }
.db-aufgaben li.db-aufg-rot { border-left-color: #d23b3b; }
.db-aufg-zahl { font-size: 1.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.db-aufg-link { white-space: nowrap; font-size: .85rem; }
.db-ok { margin: 8px 0; color: #2e8b57; }

/* Kundenmaske: Zellen, die ausgeblendet werden können, stehen immer in Spalte 2 (sonst verrutscht das Raster) */
.f-firma > .vies-ergebnis, .f-firma > .vies-wrap, .f-firma > .ki-zeile, .f-firma > .filialen-haken { grid-column: 2; }
.f-firma > .vies-ergebnis:empty { display: none; }

/* Kontrolle/Buchhaltung: selten genutzte Filter eingeklappt */
.bh-mehr { flex-basis: 100%; margin: 0; }
.bh-mehr > summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.bh-mehr-innen { margin: 6px 0 0; }

/* Einstellungen: Suchfeld im Menü */
.einst-menue .einst-suche { width: 100%; box-sizing: border-box; margin: 0 0 6px; }
.einst-menue .einst-suche-leer { margin: 2px 4px 6px; }
.einst-menue a[hidden], .einst-menue details[hidden] { display: none; }

/* Testlampe (Zugänge) */
.lampe { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,.25); background: #b0b6bd; }
.lampe.gruen { background: #2e9e4f; box-shadow: 0 0 5px #2e9e4f; }
.lampe.rot { background: #c62828; box-shadow: 0 0 5px #c62828; }
.lampe.gelb { background: #e0a800; }
.lampe.pruefe { animation: lampe-blinken 1s infinite; }
@keyframes lampe-blinken { 50% { opacity: .35; } }
.zg-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.wofuer { margin: 2px 0 8px; color: var(--leise, #555); }

/* Mengenfelder überall mittig (Belege, Matrix, Lagerraster, Wareneingang, Druck …) */
input[name="p_menge"], input[name="pos_menge"], input[name="menge"], input[name^="l_menge"], input[name="anzahl"], input[name="druck_anzahl"],
input.menge, input.we-menge, input.bd-menge, input.bd-mehr, input.eingabe.menge, input.netco-anzahl,
table.matrix input.menge, table.lagerraster td.menge input, .matrix-tabelle td.zelle input,
.pos-tabelle input[name="p_menge"], .eingang-maske .we-menge { text-align: center !important; }
td.menge, th.menge, td.zahl.menge-anzeige, td.we-menge, th.we-menge, td.ls-ausgeliefert { text-align: center; }
.pos-tabelle td.lager-spalte { cursor: pointer; }
.pos-tabelle td.lager-spalte .lager-knopf { display: block; min-height: 26px; cursor: pointer; }

/* Positionszeile: Lieferwagen und Papierkorb */
.pos-tabelle td.pos-aktion { white-space: nowrap; width: 108px; text-align: right; padding: 0 4px; }
.pos-ikon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; color: var(--text, #333); vertical-align: middle; }
.pos-ikon svg { width: 18px; height: 18px; fill: currentColor; pointer-events: none; }
.pos-ikon + .pos-ikon { margin-left: 10px; }
.pos-ikon:hover, .pos-ikon:focus-visible { border-color: var(--rahmen); background: var(--feld); }
.pos-ikon[data-aktion="pos-lieferstand"] { color: #1a5fb4; }
.pos-papierkorb:hover, .pos-papierkorb:focus-visible { color: var(--rot, #c0392b); border-color: var(--rot, #c0392b); }
.mitte-text { text-align: center !important; }

/* Fenster Lieferstand & Preise */
.pi-box { width: min(880px, 96vw); max-height: 92vh; display: flex; flex-direction: column; }
.pi-inhalt { overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 12px 14px 14px; }
.pi-preise { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; align-items: stretch; }
.pi-vk { background: #1a5fb4; color: #fff; border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 2px 8px rgba(26,95,180,.35); }
.pi-vk-titel { font-size: .8em; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.pi-vk-wert { font-size: 2.1em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pi-vk-hinweis { font-size: .8em; opacity: .85; }
.pi-diese { border: 1px solid var(--rahmen); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; background: var(--feld); }
.pi-diese .pi-vk-titel { color: var(--leise, #5a6570); opacity: 1; }
.pi-diese-wert { font-size: 1.5em; font-variant-numeric: tabular-nums; }
.pi-abw { font-size: .85em; font-weight: 600; }
.pi-abw.minus { color: var(--rot, #c0392b); }
.pi-abw.plus { color: #1d7a34; }
.pi-block h3 { margin: 0 0 6px; font-size: 1em; border-bottom: 1px solid var(--rahmen); padding-bottom: 3px; }
.pi-kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.pi-kachel { border: 1px solid var(--rahmen); border-radius: 6px; padding: 6px 10px; text-align: center; background: var(--feld); }
.pi-kachel-titel { display: block; font-size: .78em; color: var(--leise, #5a6570); }
.pi-kachel-wert { font-size: 1.5em; font-variant-numeric: tabular-nums; }
.pi-kachel.ok .pi-kachel-wert { color: #1d7a34; }
.pi-kachel.warn .pi-kachel-wert { color: var(--rot, #c0392b); }
.pi-kachel.offen { border-color: #d9a400; background: #fff6d6; color: #333; }
.pi-tabelle { width: 100%; }
.pi-tabelle td.pi-vk-spalte, .pi-tabelle th.pi-vk-spalte { background: #e3eefb; color: #0d3f80; font-weight: 700; }
.pi-preis-kunde { font-variant-numeric: tabular-nums; font-weight: 600; }
.pi-sonder { color: var(--rot, #c0392b); font-weight: 400; }
.pi-fuss { margin: 6px 0 0; font-size: .85em; }
html[data-farbschema="dunkel"] .pi-tabelle td.pi-vk-spalte, html[data-farbschema="dunkel"] .pi-tabelle th.pi-vk-spalte { background: #16345c; color: #cfe3ff; }
html[data-farbschema="dunkel"] .pi-kachel.offen { background: #4a3b00; color: #fff; }
@media (max-width: 700px) { .pi-preise { grid-template-columns: 1fr; } .pi-kacheln { grid-template-columns: repeat(2, 1fr); } }

/* Kopfdaten ausgeblendet: der Platz gehört den Artikelzeilen */
.beleg-maske.kopf-zu .beleg-oben { display: none; }
.kopf-kurz { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Rückmeldung (Testphase) */
.rueckmeldung-knopf { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 10px 0 7px; border: 1px solid rgba(255,255,255,.45); border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; font: inherit; font-size: 11px; cursor: pointer; white-space: nowrap; }
.rueckmeldung-knopf svg { width: 13px; height: 13px; fill: #ffd36b; flex: 0 0 auto; }
.rueckmeldung-knopf:hover { background: rgba(255,255,255,.26); }
.rueckmeldung-knopf:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.rm-box { width: min(560px, 96vw); }
.rm-inhalt { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.rm-inhalt textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
.rm-seite { margin: 0; font-weight: 600; }
.rm-zaehler { text-align: right; font-size: .8em; }
.rm-status.ok { color: #1d7a34; font-weight: 600; }
.rm-status.fehler { color: var(--rot, #c0392b); font-weight: 600; }
.rm-status:empty { display: none; }
.rm-hinweis { margin: 0; font-size: .85em; }
.rm-leiste-unten { display: flex; gap: 8px; justify-content: flex-end; }
.rm-leiste { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.rm-tabelle td { vertical-align: top; }
.rm-text { white-space: pre-wrap; max-width: 520px; }
.rm-adresse { font-size: .8em; word-break: break-all; }
.rm-erledigt { opacity: .65; }

/* Postfach (Mailempfang) */
.pf-leiste{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:10px 0}
.pf-reiter{display:flex;flex-wrap:wrap;gap:6px}
.pf-reiter a{padding:4px 10px;border:1px solid #c9d1dc;border-radius:14px;text-decoration:none;color:inherit}
.pf-reiter a.aktiv{background:#1f5fbf;color:#fff;border-color:#1f5fbf}
.pf-suche{display:flex;gap:6px;align-items:center}
.pf-liste tr.ungelesen td{font-weight:600}
.pf-liste .nowrap{white-space:nowrap}
.pf-vorschlag{color:#8a5a00}
.pf-kopf{display:grid;grid-template-columns:max-content 1fr;gap:2px 14px;margin:8px 0}
.pf-kopf dt{color:#667;margin:0}.pf-kopf dd{margin:0}
.pf-zuordnung,.pf-anhaenge{border:1px solid #d6dce6;border-radius:6px;padding:8px 12px;margin:12px 0}
.pf-form{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0}
.pf-text{white-space:pre-wrap;word-break:break-word;background:#f7f8fa;border:1px solid #e1e5ec;border-radius:6px;padding:12px;font-family:inherit;max-height:60vh;overflow:auto}
@media (prefers-color-scheme:dark){.pf-reiter a{border-color:#445}.pf-text{background:#1c2029;border-color:#333a48}.pf-zuordnung,.pf-anhaenge{border-color:#333a48}.pf-vorschlag{color:#e0b050}}
.pf-gefahr{display:inline-block;background:#b3261e;color:#fff;border-radius:10px;padding:0 8px;font-size:.85em;font-weight:600}
.pf-sauber{color:#1b7a3a;font-size:.9em}
.pf-warnung{margin:10px 0}
.hinweis details{margin-top:6px}

/* Signatur-Editor */
.sig-box{display:flex;flex-direction:column;gap:6px;max-width:760px}
.sig-leiste{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sig-farbe{display:inline-flex;gap:4px;align-items:center}
.sig-editor{min-height:150px;max-height:360px;overflow:auto;border:1px solid #b9c2d0;border-radius:6px;padding:10px;background:#fff;color:#111}
.sig-editor:focus{outline:2px solid #1f5fbf}
.sig-editor img{max-width:100%;height:auto}
@media (prefers-color-scheme:dark){.sig-editor{border-color:#445}}
.felder .sig-leiste select{width:auto;max-width:150px}
.felder .sig-leiste input[type=color]{width:36px;height:26px;padding:0;border:1px solid #b9c2d0}
.felder .sig-leiste .knopf{width:auto}
.felder .sig-box{grid-column:2}

/* Roter Streifen oben, wenn der Order-Server eingerichtet ist, aber nicht antwortet. */
.order-banner { background: #b3261e; color: #fff; padding: 4px 12px; text-align: center; font-size: 0.9rem; }
.order-banner a { color: #fff; text-decoration: underline; margin-left: 8px; }
.order-banner[hidden] { display: none; }

.masse-zeile { display: flex; gap: 6px; }
.masse-zeile input { width: 5.5em; }

/* Sonderpreis-Grund: Symbol in der Aktionsspalte, kleines Fenster, Preisfeld bei Sonderpreis eingefärbt */
.pos-ikon.pos-sonder { color: #7a5a1a; }
tr.pos:not(.mit-artikel) .pos-sonder { visibility: hidden; }
.pos-tabelle tr.sonderpreis input[name="p_preis"] { background: #ffd9a0; }
.pos-tabelle tr.sonderpreis .pos-sonder { background: #ffd9a0; border-color: #d08a1f; color: #8a4b00; }
.sonder-fenster { position: fixed; z-index: 1100; min-width: 240px; display: flex; flex-direction: column; gap: 6px; padding: 10px;
  background: var(--flaeche, #fff); border: 1px solid var(--rahmen); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.erledigt-fenster { min-width: 340px; }
.erledigt-fenster input { width: 100%; box-sizing: border-box; }
.sonder-knoepfe { display: flex; gap: 6px; justify-content: flex-end; }

.rm-ki { display: flex; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.rm-ki[hidden], .rm-ki button[hidden] { display: none; }

/* Einstiegsassistent (Einstellungen › Einrichtung) */
.ein-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ein-schritt { border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 8px 12px; background: var(--flaeche, #fff); }
.ein-schritt p { margin: 4px 0; }
.ein-kopf { display: flex; justify-content: space-between; gap: 12px; }
.ein-marke { font-size: .85em; color: #7a4b00; }
.ein-fertig { border-left: 4px solid #2e7d32; }
.ein-fertig .ein-marke { color: #2e7d32; }
.ein-offen { border-left: 4px solid #c0392b; }
.ein-pruefen { border-left: 4px solid #d08a1f; }
.ein-optional { border-left: 4px solid var(--rahmen); }
.ein-detail { font-size: .9em; }
progress { width: 100%; max-width: 480px; height: 14px; }

.erledigt-fenster { min-width: 480px; max-width: min(900px, 96vw); }
.erledigt-liste { max-height: 50vh; overflow: auto; margin: 6px 0; }
.erledigt-tabelle { width: 100%; border-collapse: collapse; }
.erledigt-tabelle th, .erledigt-tabelle td { padding: 3px 6px; text-align: left; border-bottom: 1px solid var(--linie, #ddd); }
.erledigt-tabelle input.erledigt-menge { width: 70px; }
.dk-tabelle { width: 100%; }
.dk-tabelle tr.dk-link { cursor: pointer; }
.dl-tabelle { width: 100%; }
.dl-tabelle td { vertical-align: top; }
.dl-marke { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 0.85em; white-space: nowrap; border: 1px solid transparent; }
.dl-marke.dl-fehlt { background: #fde8e6; color: #9b1c12; border-color: #e9b4ae; }
.dl-marke.dl-teilweise { background: #fff2d6; color: #7a5200; border-color: #e6cf94; }
.dl-marke.dl-leer { background: #e8eef7; color: #2f4a73; border-color: #bccbe0; }
.dl-marke.dl-ok { background: #e3f3e6; color: #1e6b32; border-color: #a9d3b3; }

.hd-form { display: flex; gap: 10px; align-items: end; margin: 8px 0; }
.hd h3 { margin-top: 22px; }
.hd-tab { width: 100%; margin-bottom: 10px; }
.hd-tab .re, .hd-tab th.re { text-align: right; }
.hd-klassen, .hd-erf { max-width: 560px; }
.hd-klasse { display: inline-block; min-width: 20px; text-align: center; border-radius: 4px; padding: 0 5px; font-weight: bold; color: #fff; }
.hd-A { background: #2e9e4f; }
.hd-B { background: #c98a1c; }
.hd-C { background: #8a8f98; }

/* Fenster Lagerbestand: linke Seite in zwei Bereiche (Artikel der Zeile / passende Artikel) */
.ll-block { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.ll-oben { flex: 0 0 auto; }
.ll-unten { flex: 1 1 auto; }
.ll-kopf { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--leise); margin-top: 4px; }
.ll-oben .ll-eintraege { height: 30vh; flex: none; }
.ll-oben.ll-einzeln .ll-eintraege { height: auto; max-height: 90px; overflow-y: auto; }
.ll-unten .ll-eintraege { height: 34vh; }
.ll-eintrag .ll-grund { grid-column: 1 / -1; font-size: 11px; opacity: .75; }
.lager-je { margin-top: 10px; }
.lager-je h4 { margin: 10px 0 4px; font-size: 13px; }
.lager-je-tab { width: 100%; }
.lager-je-tab td, .lager-je-tab th { padding: 2px 8px; text-align: left; }
.lager-je-tab td.mitte, .lager-je-tab th.mitte { text-align: center; }
.lager-je-tab td.kein-bestand { color: var(--leise); }
.lager-kopfzeile { display: flex; gap: 10px; align-items: flex-start; }
.lager-kopfzeile .lager-stamm { flex: 1 1 auto; min-width: 0; }
.lager-bild { flex: 0 0 auto; width: 120px; height: 120px; border: 1px solid var(--rahmen); background: var(--feld); display: flex; align-items: center; justify-content: center; }
.lager-bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lager-rahmen.mx-klein .lager-matrix { font-size: 11px; }
.lager-rahmen.mx-klein .lager-matrix .lm-zelle { min-width: 40px; padding: 1px 3px; }
.lager-rahmen.mx-gross { max-height: 60vh; }
.lager-rahmen.mx-gross .lager-matrix { font-size: 16px; }
.lager-rahmen.mx-gross .lager-matrix .lm-zelle { min-width: 84px; padding: 8px 10px; }
.lager-rahmen.mx-gross .lager-matrix .lm-zelle b { font-size: 20px; }
.lager-rahmen.mx-gross .lager-matrix .lm-var { padding: 8px 10px; }

/* EAN: freie Nummern per Doppelklick, Sammelvergabe */
.ean-frei { position: absolute; z-index: 60; width: 250px; background: var(--feld); color: var(--text); border: 1px solid var(--rahmen); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.ean-frei-kopf { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-weight: 600; border-bottom: 1px solid var(--rahmen-hell); }
.ean-frei-zu { border: 0; background: none; color: var(--text); font-size: 1.2em; cursor: pointer; line-height: 1; }
.ean-frei-liste { padding: 6px; max-height: 230px; overflow-y: auto; }
.ean-frei-code { display: block; width: 100%; text-align: left; font-family: monospace; padding: 3px 6px; margin: 1px 0; cursor: pointer; }
.ean-frei-hinweis { margin: 6px 2px 0; }
.ean-form { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; margin: .5em 0; }
.ean-filter, .ean-kreisform { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-end; padding: 4px 6px; }
.ean-filter label, .ean-kreisform label { display: flex; flex-direction: column; gap: 2px; width: auto; }
.ean-filter input, .ean-filter select, .ean-kreisform input[type="text"], .ean-kreisform input:not([type]) { width: auto; }
.ean-kreisform label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 4px; }
.ean-form label { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; width: auto; }
.ean-form input { width: auto; }
.ean-loeschen { margin: 0; }

/* Handbuch: Bilder und Sprungknopf in der Antwort des Fragefeldes */
.hb-antwort-bilder { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hb-antwort-bilder figure { margin: 0; max-width: 340px; cursor: pointer; border: 1px solid #c7d3e6; border-radius: 8px; overflow: hidden; background: #fff; }
.hb-antwort-bilder img { display: block; width: 100%; height: auto; }
.hb-antwort-bilder figcaption { font-size: 12px; padding: 4px 8px; color: #445; }
