/* Lager-Fehlmeldungen – Gestaltung angelehnt an den Webauftritt von P.F. Weber
   (Rot, Blau, Limettengrün, PT Sans, Überschriften in Großbuchstaben).
   Minimales eigenes CSS, kein Framework, keine externen Ressourcen. */

:root {
  --rot: #e30613;
  --rot-dunkel: #b8050f;
  --rot-hell: #fdeaeb;
  --blau: #0e4194;
  --blau-dunkel: #0a3172;
  --blau-hell: #e7edf7;
  --gruen: #a6c739;
  --gruen-hell: #f3f8e4;
  --gruen-text: #4d6114;
  --text: #1a1a1a;
  --text-leise: #666666;
  --rand: #d6d6d6;
  --hintergrund: #f2f2f2;
  --flaeche: #ffffff;
  --dunkel: #222222;
  --radius: 3px;
  --schrift: "PT Sans", "Trebuchet MS", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--schrift);
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background: var(--hintergrund);
}

/* Lange Freitexte ohne Leerzeichen dürfen umbrechen, Knöpfe und Marken nicht. */
.liste .was, .liste .bemerkung, .offen-liste .was, .zusammenfassung dd, .karte p { overflow-wrap: break-word; word-break: break-word; }
.liste td.was { min-width: 11em; }
.knopf, .marke-dringend, .tab, .hauptnav { white-space: nowrap; overflow-wrap: normal; }

main { flex: 1 0 auto; width: 100%; padding: 20px 16px 32px; margin: 0 auto; }
body.schmal main { max-width: 560px; }
body.buero main { max-width: 1400px; }

h1, h2, h3 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.2;
  color: var(--rot);
}
h2 { font-size: 1.15rem; margin: 0 0 0.75em; }

a { color: var(--blau); }
code { font-size: 0.9em; background: #e6e6e6; padding: 0 4px; border-radius: var(--radius); }

/* ---------- Kopf, Band, Fuß ---------- */

.kopf { background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.kopf-innen {
  max-width: 1400px; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
}
body.schmal .kopf-innen { max-width: 560px; }

.marke { display: flex; flex-direction: column; line-height: 1; }
.marke .logo { height: 56px; width: auto; display: block; }
.marke-name {
  font-size: 1.75rem; font-weight: 700; color: var(--rot); letter-spacing: 0.5px;
}
.marke-pf { font-size: 0.8em; }
.marke-zusatz {
  margin-top: 4px; font-size: 0.8rem; font-weight: 700; color: var(--blau);
  text-transform: uppercase; letter-spacing: 1.5px;
}

.hauptnav { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; font-size: 1rem; font-weight: 700; }
.hauptnav a, .hauptnav .link-knopf { color: var(--rot); text-decoration: none; padding: 6px 0; }
.hauptnav a:hover, .hauptnav .link-knopf:hover { color: var(--blau); }
.hauptnav a[aria-current="page"] { color: var(--blau); border-bottom: 2px solid var(--blau); }
.nav-benutzer { font-weight: 400; color: var(--text-leise); }

.band { background: var(--blau); color: #fff; }
.band h1 {
  max-width: 1400px; margin: 0 auto; padding: 12px 16px;
  font-size: 1.35rem; color: #fff; letter-spacing: 1.5px;
}
body.schmal .band h1 { max-width: 560px; }

.fuss {
  flex-shrink: 0; background: var(--dunkel); color: #bbbbbb;
  font-size: 0.85rem; text-align: center; padding: 14px 16px;
}

/* ---------- Karten, Hinweise ---------- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-top: 4px solid var(--rot);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 20px;
}
.karte p:first-child { margin-top: 0; }
.karte p:last-child { margin-bottom: 0; }
.karte.erfolg { border-top-color: var(--gruen); background: var(--gruen-hell); }
.karte.erfolg h2 { color: var(--gruen-text); }

.hinweis { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 700; }
.hinweis.fehler { background: var(--rot-hell); color: var(--rot-dunkel); border-left: 5px solid var(--rot); }
.hinweis.erfolg { background: var(--gruen-hell); color: var(--gruen-text); border-left: 5px solid var(--gruen); }
.hinweis.info { background: var(--blau-hell); color: var(--blau-dunkel); border-left: 5px solid var(--blau); }

/* ---------- Formulare ---------- */

.feld { margin-bottom: 18px; }
.feld label { display: block; font-weight: 700; margin-bottom: 4px; }
.optional { font-weight: 400; color: var(--text-leise); font-size: 0.9em; }

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1.1rem; /* >= 16px verhindert Zoom auf iOS */
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #bbbbbb;
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blau);
  outline: 3px solid rgba(14, 65, 148, 0.25);
  outline-offset: 0;
}
button:focus-visible, a:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }

.zeile { display: flex; gap: 12px; flex-wrap: wrap; }
.zeile .menge { flex: 1 1 120px; }
.zeile .einheit { flex: 1 1 160px; }

.hat-fehler input, .hat-fehler select, .hat-fehler textarea { border-color: var(--rot); border-width: 2px; }
.feldfehler { color: var(--rot-dunkel); margin: 4px 0 0; font-size: 0.95rem; font-weight: 700; }

.checkbox {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; margin-bottom: 22px; padding: 0 12px;
  background: var(--flaeche); border: 1px solid #bbbbbb; border-radius: var(--radius);
  font-weight: 700; cursor: pointer;
}
.checkbox input { width: 28px; height: 28px; margin: 0; accent-color: var(--rot); }
.checkbox:has(input:checked) { border-color: var(--rot); background: var(--rot-hell); color: var(--rot-dunkel); }

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 18px;
  font: inherit; font-size: 1rem; font-weight: 700;
  color: var(--blau); background: var(--flaeche);
  border: 2px solid var(--blau); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
}
.knopf:hover { background: var(--blau-hell); }
.knopf.primaer { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.primaer:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); }
.knopf.gross {
  width: 100%; min-height: 56px; font-size: 1.2rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.knopf.klein { min-height: 34px; padding: 3px 10px; font-size: 0.85rem; border-width: 1px; }
.knopf.gefahr { color: var(--rot); border-color: #eeb0b3; }
.knopf.gefahr:hover { background: var(--rot-hell); border-color: var(--rot); }
.knopf:disabled { opacity: 0.6; cursor: wait; }

.link-knopf {
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
}
form.inline { display: inline; }

/* ---------- Meldeseite (Handy) ---------- */

.bereits { margin-top: 36px; }
.bereits h2 { color: var(--blau); border-bottom: 2px solid var(--blau); padding-bottom: 6px; }
.offen-liste { list-style: none; margin: 0; padding: 0; }
.offen-liste li {
  display: flex; flex-wrap: wrap; gap: 2px 12px;
  padding: 10px 12px; background: var(--flaeche);
  border: 1px solid var(--rand); border-left: 4px solid var(--blau);
  border-radius: var(--radius); margin-bottom: 8px; font-size: 1rem;
}
.offen-liste .was { flex: 1 1 100%; font-weight: 700; }
.offen-liste .wie-viel { font-weight: 700; color: var(--blau); }
.offen-liste .seit { color: var(--text-leise); }
.leer { color: var(--text-leise); }

.zusammenfassung { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.zusammenfassung dt { color: var(--text-leise); }
.zusammenfassung dd { margin: 0; font-weight: 700; }

.marke-dringend {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--rot); color: #fff; vertical-align: middle; line-height: 1.6;
}

/* ---------- Büro ---------- */

.leiste {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 3px solid var(--rot); }
.tab {
  padding: 10px 18px; text-decoration: none;
  color: var(--text); font-weight: 700; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tab:hover { color: var(--rot); }
.tab.aktiv { background: var(--rot); color: #fff; }

.tabelle-scroll { overflow-x: auto; }

table.liste {
  width: 100%; border-collapse: collapse; background: var(--flaeche);
  border: 1px solid var(--rand); font-size: 0.95rem;
}
.liste th, .liste td { padding: 8px 10px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: top; }
.liste th {
  background: var(--blau); color: #fff; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.liste tbody tr:nth-child(even) td { background: #fafafa; }
.liste .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.liste .was { font-weight: 700; }
.liste .bemerkung { max-width: 320px; }
.liste .nowrap { white-space: nowrap; }
.liste tr.ist-dringend td { background: var(--rot-hell) !important; }
.liste tr.ist-dringend td:first-child { box-shadow: inset 4px 0 0 var(--rot); }
.liste tr.ist-bestellt td { color: var(--text-leise); }
.liste tr.verschwindet { opacity: 0; transition: opacity 0.25s; }
.sp-haken { width: 1%; text-align: center !important; }
.sp-aktion { width: 1%; }
.klein { font-size: 0.85rem; color: var(--text-leise); }

.haken {
  width: 44px; height: 44px; font-size: 30px; line-height: 1;
  background: none; border: 0; cursor: pointer; color: var(--blau); padding: 0;
}
.haken.gesetzt { color: var(--gruen-text); }
.haken:hover { color: var(--rot); }

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

/* Schmale Bildschirme: Tabelle als Karten darstellen */
@media (max-width: 800px) {
  .liste thead { display: none; }
  .liste, .liste tbody, .liste tr, .liste td { display: block; width: 100%; }
  .liste tr { border-bottom: 2px solid var(--rand); padding: 8px 0; position: relative; }
  .liste td { border: 0; padding: 2px 12px 2px 64px; }
  .liste td.sp-haken { position: absolute; left: 4px; top: 8px; width: auto; padding: 0; }
  .liste td.sp-aktion { width: auto; padding-top: 6px; }
  .liste tr.ist-dringend td:first-child { box-shadow: none; }
  .liste tr.ist-dringend { box-shadow: inset 4px 0 0 var(--rot); }
  .marke-name { font-size: 1.45rem; }
}

/* ---------- Benutzerverwaltung ---------- */

.spalte { max-width: 720px; }
.spalte .karte h2 { color: var(--blau); }
table.benutzer-tabelle {
  width: 100%; border-collapse: collapse; background: var(--flaeche);
  border: 1px solid var(--rand); margin-bottom: 24px; font-size: 1rem;
}
.benutzer-tabelle th, .benutzer-tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
.benutzer-tabelle th {
  background: var(--blau); color: #fff; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.benutzer-tabelle .was { font-weight: 700; overflow-wrap: anywhere; }
.benutzer-tabelle .rechts { text-align: right; white-space: nowrap; }
.marke-admin {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--blau); color: #fff; line-height: 1.6;
}
@media (max-width: 520px) {
  .benutzer-tabelle th:nth-child(3), .benutzer-tabelle td:nth-child(3) { display: none; }
}

/* ---------- QR-Seite ---------- */

.qr-blatt {
  text-align: center; background: var(--flaeche);
  border: 1px solid var(--rand); border-top: 4px solid var(--rot);
  border-radius: var(--radius); padding: 24px 16px;
}
.qr-blatt h2 { font-size: 1.8rem; }
.qr-rahmen { max-width: 520px; margin: 0 auto; }
svg.qr { width: 100%; height: auto; display: block; }
.qr-url { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; color: var(--text-leise); word-break: break-all; }

/* ---------- Druck (A4) ---------- */

@page { size: A4; margin: 12mm; }

@media print {
  body { background: #fff; font-size: 11pt; display: block; min-height: 0; }
  .band, .hauptnav, .fuss, .leiste, .tabs, .aktionen, .sp-aktion, .nicht-drucken { display: none !important; }
  .kopf { border-bottom: 2px solid var(--rot); }
  .kopf-innen { padding: 0 0 4mm; }
  .nur-druck { display: block; }
  .druck-titel { font-size: 15pt; margin: 4mm 0; }
  main { padding: 0; max-width: none !important; }

  /* Tabelle immer als Tabelle drucken */
  .liste thead { display: table-header-group; }
  table.liste { display: table; border: 0; font-size: 10pt; }
  .liste tbody { display: table-row-group; }
  .liste tr { display: table-row; position: static; break-inside: avoid; box-shadow: none !important; }
  .liste td, .liste th { display: table-cell; padding: 4px 6px; border-bottom: 1px solid #999; position: static; }
  .liste th { background: none; color: #000; border-bottom: 2px solid #000; }
  .liste tbody tr td { background: none !important; box-shadow: none !important; }
  .liste tr.ist-dringend td { font-weight: 700; }
  .liste .bemerkung { max-width: none; }
  .haken { width: auto; height: auto; font-size: 14pt; color: #000; }
  .marke-dringend { background: none; color: #000; border: 1px solid #000; }

  .tabelle-scroll { overflow: visible; }
  .qr-blatt { border: 0; padding: 0; }
  .qr-blatt h2 { font-size: 24pt; margin-top: 8mm; }
  .qr-rahmen { max-width: 150mm; }
  .qr-url { font-size: 10pt; color: #000; }
}
