/* ============================================================
   LARMAR Folien-Sichtung — Design-System
   Dunkles, industrielles Thema: „Lagerhalle bei Nacht".
   Druck: hell, schwarz auf weiß.
   ============================================================ */

/* ---------- 1) Variablen (Vertrag — exakt) ---------- */

:root {
  --hg: #0b0f14;            /* Seiten-Hintergrund */
  --flaeche: #131a22;       /* Karten */
  --flaeche2: #1a232e;      /* erhöhte Flächen, Tabellen-Header */
  --linie: #26313d;
  --text: #e8edf2; --text2: #93a1b0; --text3: #5c6b7a;
  --akzent: #4cc2ff;        /* LARMAR-blau, Links/Aktiv */
  --entsorgen: #ff5d5d; --behalten: #3ddc97; --pruefen: #ffb347;
  --kat-petrein: #3ddc97; --kat-petlack: #4cc2ff; --kat-petmet: #b48cff;
  --kat-papier: #d9a066; --kat-abs: #ff8fb1; --kat-pp: #7fe3d2;
  --kat-kleber: #e6e07a; --kat-sonstig: #8a97a5;
  --radius: 12px; --mono: ui-monospace, 'SF Mono', Menlo, monospace;

  /* interne Ableitungen (kein Vertragsteil) */
  --kopf-h: 112px;          /* wird per Skript live gemessen */
  --filter-h: 0px;          /* Höhe einer sticky Filterleiste */
  --schatten: 0 12px 32px rgba(0, 0, 0, .35);
  --uebergang: .18s ease;
  color-scheme: dark;
}

/* ---------- 2) Reset + Grundtypografie ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--linie) transparent;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 480px at 78% -12%, rgba(76, 194, 255, .07), transparent 62%),
    radial-gradient(800px 400px at -10% 8%, rgba(76, 194, 255, .04), transparent 55%),
    var(--hg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: inline-block; max-width: 100%; vertical-align: middle; }

input, select, textarea, button { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.4rem; font-weight: 750; letter-spacing: -.01em; margin: .25rem 0 1rem; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .75rem; }
h3 { font-size: .92rem; font-weight: 700; color: var(--text2); margin: 0 0 .5rem; }
p  { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: 0; border-top: 1px solid var(--linie); margin: 1rem 0; }

small { font-size: .8em; color: var(--text2); }
strong, b { font-weight: 700; }

code, kbd, .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

::selection { background: rgba(76, 194, 255, .3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--linie); border-radius: 6px; border: 2px solid var(--hg); }
::-webkit-scrollbar-track { background: transparent; }

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

summary { cursor: pointer; color: var(--text2); font-weight: 600; transition: color var(--uebergang); }
summary:hover { color: var(--text); }
details[open] > summary { color: var(--text); margin-bottom: .5rem; }

/* ---------- 3) Formular-Elemente ---------- */

input:not([type=checkbox]):not([type=radio]):not([type=range]),
select, textarea {
  background: var(--flaeche2);
  border: 1px solid var(--linie);
  border-radius: 8px;
  color: var(--text);
  padding: .45rem .65rem;
  min-height: 36px;
  transition: border-color var(--uebergang), box-shadow var(--uebergang);
}

input::placeholder { color: var(--text3); }

input:not([type=checkbox]):not([type=radio]):focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px rgba(76, 194, 255, .16);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.9rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2393a1b0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  cursor: pointer;
}

input[type=checkbox], input[type=radio] {
  width: 16px; height: 16px;
  accent-color: var(--akzent);
  cursor: pointer;
}

label { cursor: pointer; }

textarea { resize: vertical; min-height: 70px; }

/* ---------- 4) Kopfbereich (sticky) ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 15, 20, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linie);
}

.kopf-innen {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(.75rem, 2.5vw, 1.5rem);
}

.kopf-zeile {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  padding: .6rem 0;
}

.wortmarke {
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wortmarke:hover { text-decoration: none; }
.wortmarke-logo { align-self: center; flex: none; }
.wortmarke strong {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: .16em;
}
.wortmarke span {
  font-weight: 300;
  font-size: .98rem;
  color: var(--text2);
  letter-spacing: .02em;
}

.haupt-nav {
  display: flex;
  gap: .2rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.haupt-nav::-webkit-scrollbar { display: none; }

.nav-link {
  padding: .42rem .8rem;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text2);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--uebergang), background-color var(--uebergang), border-color var(--uebergang);
}
.nav-link:hover { color: var(--text); background: var(--flaeche2); text-decoration: none; }
.nav-link.aktiv {
  color: var(--akzent);
  background: rgba(76, 194, 255, .1);
  border-color: rgba(76, 194, 255, .28);
}

/* KPI-Leiste im Kopf (von app.js gefüllt) */
.kpi-leiste {
  display: flex;
  align-items: stretch;
  gap: 1.1rem;
  padding: .1rem 0 .7rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.kpi-leiste::-webkit-scrollbar { display: none; }
.kpi-leiste:empty { display: none; }

.kpi-leiste .kpi {
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0 0 0 0;
  gap: .05rem;
  min-width: max-content;
}
.kpi-leiste .kpi + .kpi {
  border-left: 1px solid var(--linie);
  padding-left: 1.1rem;
}
.kpi-leiste .kpi-wert { font-size: 1.02rem; }
.kpi-leiste .kpi-label { font-size: .6rem; }

/* ---------- 5) Hauptfläche ---------- */

main#ansicht {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem clamp(.75rem, 2.5vw, 1.5rem) 4.5rem;
}

/* ---------- 6) Karten + KPI-Kacheln ---------- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 8px 24px rgba(0, 0, 0, .22);
}

.kpi {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: .85rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: .18rem;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.kpi-wert {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
}
.kpi-wert small { font-size: .62em; font-weight: 600; color: var(--text2); }

.kpi-label {
  font-size: .68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text2); /* --text3 fiele bei dieser Schriftgröße unter WCAG AA */
  white-space: nowrap;
}

/* ---------- 7) Badges + Status-Chips ---------- */

/* Kategorie-Badge: Farbe per style="--b: var(--kat-…)" */
.badge {
  --b: var(--kat-sonstig);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .05em;
  padding: .13rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--b);
  /* Fallback, falls color-mix nicht verfügbar */
  background: rgba(138, 151, 165, .13);
  border: 1px solid rgba(138, 151, 165, .35);
  background: color-mix(in srgb, var(--b) 13%, transparent);
  border-color: color-mix(in srgb, var(--b) 38%, transparent);
}

.chip-entsorgen, .chip-behalten, .chip-pruefen, .chip-offen {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .02em;
  padding: .16rem .55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-entsorgen { color: var(--entsorgen); background: rgba(255, 93, 93, .12);  border-color: rgba(255, 93, 93, .38); }
.chip-behalten  { color: var(--behalten);  background: rgba(61, 220, 151, .11); border-color: rgba(61, 220, 151, .34); }
.chip-pruefen   { color: var(--pruefen);   background: rgba(255, 179, 71, .12); border-color: rgba(255, 179, 71, .38); }
.chip-offen     { color: var(--text3);     background: rgba(92, 107, 122, .12); border-color: rgba(92, 107, 122, .45); border-style: dashed; }

/* ---------- 8) Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .5rem .95rem;
  border-radius: 9px;
  border: 1px solid var(--linie);
  background: var(--flaeche2);
  color: var(--text);
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--uebergang), border-color var(--uebergang),
              color var(--uebergang), box-shadow var(--uebergang), transform .08s ease;
}
.btn:hover { background: #212d3a; border-color: #34424f; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45;
  pointer-events: none;
}

.btn-primaer {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #04222f;
  box-shadow: 0 4px 18px rgba(76, 194, 255, .22);
}
.btn-primaer:hover {
  background: #71d1ff;
  border-color: #71d1ff;
  color: #04222f;
  box-shadow: 0 6px 22px rgba(76, 194, 255, .3);
}

.btn-gefahr {
  background: rgba(255, 93, 93, .1);
  border-color: rgba(255, 93, 93, .45);
  color: var(--entsorgen);
}
.btn-gefahr:hover {
  background: rgba(255, 93, 93, .2);
  border-color: var(--entsorgen);
  color: #ffb4b4;
}

.btn-mini {
  padding: .2rem .5rem;
  border-radius: 7px;
  font-size: .78rem;
  gap: .3rem;
  min-height: 26px;
}

/* ---------- 9) Tabellen ---------- */

.tabelle {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .86rem;
}

.tabelle th, .tabelle td {
  padding: .48rem .65rem;
  text-align: left;
  border-bottom: 1px solid var(--linie);
  vertical-align: middle;
}

.tabelle thead th {
  position: sticky;
  top: calc(var(--kopf-h, 0px) + var(--filter-h, 0px));
  z-index: 10;
  background: var(--flaeche2);
  color: var(--text2);
  font-size: .66rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--linie);
}
.tabelle thead th:first-child { border-top-left-radius: 8px; }
.tabelle thead th:last-child { border-top-right-radius: 8px; }

.tabelle td {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.tabelle tbody tr { transition: background-color .12s ease; }
.tabelle tbody tr:hover { background: rgba(76, 194, 255, .05); }
.tabelle tbody tr[data-pos], .tabelle tbody tr.klickbar { cursor: pointer; }
.tabelle tbody tr.aktiv { background: rgba(76, 194, 255, .09); }

.tabelle .zahl, .tabelle td.rechts, .tabelle th.rechts { text-align: right; }

/* horizontale Scroll-Hülle für breite Tabellen — wird erst auf Schmal-Viewports
   zum Scroll-Container, damit die sticky Tabellenköpfe auf Desktop am Kopf andocken
   (ein overflow-Wrapper würde position:sticky sonst wirkungslos machen) */
.tabelle-scroll { -webkit-overflow-scrolling: touch; }
@media (max-width: 1080px) {
  .tabelle-scroll { overflow-x: auto; }
}
@media (max-width: 860px) {
  .karte:has(> .tabelle) { overflow-x: auto; }
}

/* ---------- 10) Filterleiste (sticky unter dem Kopf) ---------- */

.filterleiste {
  position: sticky;
  top: var(--kopf-h, 0px);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .6rem;
  padding: .7rem .85rem;
  margin-bottom: 1rem;
  background: rgba(19, 26, 34, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}

.filterleiste label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text2);
  white-space: nowrap;
}

.filterleiste input[type=text],
.filterleiste input[type=search] {
  flex: 1 1 190px;
  min-width: 150px;
}
.filterleiste select { min-width: 120px; max-width: 220px; }

.filterleiste .zaehler {
  margin-left: auto;
  font-size: .8rem;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 11) Panel (Detail-Drawer rechts) ---------- */

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 96vw);
  z-index: 80;
  background: var(--flaeche);
  border-left: 1px solid var(--linie);
  box-shadow: -24px 0 56px rgba(0, 0, 0, .5);
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.32, .72, .28, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.15rem 1.3rem 1.5rem;
}
.panel.offen, .panel.auf, .panel.aktiv { transform: translateX(0); }

.panel h2 { padding-right: 2.2rem; }

.panel-schleier {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 8, 12, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.panel-schleier.offen, .panel-schleier.aktiv { opacity: 1; pointer-events: auto; }

.panel-schliessen {
  position: absolute;
  top: .8rem; right: .8rem;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--flaeche2);
  color: var(--text2);
  cursor: pointer;
  transition: color var(--uebergang), border-color var(--uebergang);
}
.panel-schliessen:hover { color: var(--text); border-color: var(--akzent); }

/* ---------- 12) Balken (horizontal, Label + Wert) ----------
   Nutzung: <div class="balken" style="--w:63%; --b:var(--kat-abs)">
              <span class="balken-label">…</span><span class="balken-wert">…</span>
            </div>                                              */

.balken {
  --w: 0%;
  --b: var(--akzent);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 32px;
  padding: .32rem .65rem;
  background: var(--flaeche2);
  border: 1px solid var(--linie);
  border-radius: 8px;
  overflow: hidden;
  font-size: .84rem;
}
.balken::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--w);
  /* Fallback, falls color-mix nicht verfügbar */
  background: rgba(76, 194, 255, .22);
  background: color-mix(in srgb, var(--b) 24%, transparent);
  box-shadow: inset 0 -2px 0 var(--b);
  transition: width .5s ease;
  pointer-events: none;
}
.balken > * { position: relative; z-index: 1; }
.balken + .balken { margin-top: .4rem; }

.balken-label {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.balken-wert {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text2);
  white-space: nowrap;
}

/* explizites Füll-Element (alternative Bauweise) */
.balken .balken-fuellung {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  z-index: 0;
  background: rgba(76, 194, 255, .22);
  background: color-mix(in srgb, var(--b) 24%, transparent);
  box-shadow: inset 0 -2px 0 var(--b);
}

/* ---------- 13) Ring (SVG-Fortschrittsring) ---------- */

.ring {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.ring svg { display: block; transform: rotate(-90deg); }
.ring .ring-spur { fill: none; stroke: var(--linie); }
.ring .ring-fortschritt {
  fill: none;
  stroke: var(--akzent);
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease;
}
.ring .ring-wert {
  position: absolute;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
}
.ring .ring-wert small {
  display: block;
  font-family: inherit;
  font-size: .55em;
  font-weight: 650;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---------- 14) Schicht-Stapel (Material-Ebenen, Träger → außen) ---------- */

.schicht-stapel {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
  font-size: .78rem;
}
.schicht-stapel > * {
  --b: var(--akzent);
  position: relative;
  padding: .4rem .6rem .4rem .85rem;
  background: var(--flaeche2);
  border: 1px solid var(--linie);
  border-left: 4px solid var(--b);
  border-radius: 6px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.schicht-stapel > :first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.schicht-stapel > :last-child { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }

/* ---------- 15) Toasts ---------- */

#toast-halter {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: max-content;
  max-width: min(92vw, 480px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: 100%;
  background: rgba(26, 35, 46, .96);
  color: var(--text);
  border: 1px solid var(--linie);
  border-left: 3px solid var(--akzent);
  border-radius: 10px;
  padding: .6rem 1rem;
  font-size: .87rem;
  font-weight: 550;
  box-shadow: var(--schatten);
  animation: toast-rein .25s ease;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.weg, .toast.toast-weg { opacity: 0; transform: translateY(8px); }

@keyframes toast-rein {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 16) Druck-Steuerklassen ---------- */

.drucke-nur { display: none !important; }  /* erscheint nur im Druck */
/* .kein-druck: normal sichtbar, verschwindet im Druck (siehe @media print) */

/* ---------- 17) Responsiv ---------- */

@media (max-width: 900px) {
  .kopf-zeile { gap: .4rem .9rem; }
  .haupt-nav { margin-left: 0; flex: 1 0 100%; order: 3; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  main#ansicht { padding-top: 1rem; }
  .wortmarke span { font-size: .9rem; }
  .nav-link { padding: .38rem .6rem; font-size: .84rem; }
  .kpi-leiste { gap: .9rem; }
  .kpi-leiste .kpi + .kpi { padding-left: .9rem; }
  .kpi { padding: .7rem .85rem; }
  .kpi-wert { font-size: 1.28rem; }
  .panel { width: 100vw; border-left: 0; }
  .filterleiste { padding: .55rem .65rem; gap: .45rem .5rem; }
  .filterleiste .zaehler { margin-left: 0; flex: 1 0 100%; }
  .tabelle th, .tabelle td { padding: .4rem .45rem; }
}

@media (max-width: 380px) {
  .wortmarke strong { font-size: .92rem; letter-spacing: .12em; }
  .wortmarke span { display: none; }
  .kpi-wert { font-size: 1.15rem; }
  .btn { padding: .45rem .7rem; font-size: .84rem; }
  .filterleiste select { min-width: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ---------- 18) Druck: hell, schwarz auf weiß ---------- */

@page { margin: 14mm 12mm; }

@media print {
  :root {
    --hg: #fff; --flaeche: #fff; --flaeche2: #f1f1f1;
    --linie: #999;
    --text: #000; --text2: #333; --text3: #555;
    --akzent: #000;
    --schatten: none;
    color-scheme: light;
  }

  html, body {
    background: #fff !important;
    color: #000;
    font-size: 10.5pt;
  }

  /* alles Interaktive verschwindet */
  .kopf, .haupt-nav, .kpi-leiste, .filterleiste,
  .btn, .btn-primaer, .btn-gefahr, .btn-mini,
  .panel, .panel-schleier, #toast-halter, .toast,
  .kein-druck {
    display: none !important;
  }

  .drucke-nur { display: revert !important; }

  main#ansicht { max-width: none; padding: 0; }

  a { color: #000; text-decoration: none; }

  .karte, .kpi {
    background: #fff;
    border: 1px solid #999;
    border-radius: 4px;
    box-shadow: none;
    break-inside: avoid;
  }
  .kpi-wert, .kpi-label, .balken-wert { color: #000; }

  .badge,
  .chip-entsorgen, .chip-behalten, .chip-pruefen, .chip-offen {
    color: #000 !important;
    background: none !important;
    border: 1px solid #000 !important;
    border-style: solid !important;
  }

  .tabelle { font-size: 8.5pt; }
  .tabelle th, .tabelle td {
    color: #000;
    border-bottom: 1px solid #999;
    padding: .22rem .4rem;
  }
  .tabelle thead th {
    position: static;
    background: #eee !important;
    color: #000;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .tabelle thead { display: table-header-group; }
  .tabelle tbody tr { break-inside: avoid; }
  .tabelle tbody tr:hover { background: none; }

  .balken {
    background: #fff;
    border-color: #000;
    color: #000;
  }
  .balken::before, .balken .balken-fuellung {
    background: #ddd !important;
    box-shadow: inset 0 -2px 0 #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ring .ring-spur { stroke: #ccc; }
  .ring .ring-fortschritt { stroke: #000; }

  .schicht-stapel > * {
    background: #fff;
    border-color: #000;
    border-left-width: 4px;
    color: #000;
  }

  .tabelle-scroll, .karte:has(> .tabelle) { overflow: visible; }

  h1, h2, h3 { color: #000; break-after: avoid; }

  /* Gruppen (z. B. je Lagerort) zusammenhalten — bewusst NICHT pauschal auf
     section, sonst schieben lange Abschnitte mit Leerraum auf die nächste Seite */
  .druck-gruppe, details { break-inside: avoid; }
}
