/* Lager-UI: große Ziele, hoher Kontrast, eine Spalte (Memor 10/11 ≈ 360 px breit). */

:root {
  --blau: #1e3a8a;
  --blau-hell: #3b5bdb;
  --gruen: #2b8a3e;
  --rot: #c92a2a;
  --gelb: #e67700;
  --grau: #495057;
  --rand: #ced4da;
  --hintergrund: #f1f3f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  background: var(--hintergrund);
  color: #212529;
}

header.app {
  background: var(--blau);
  color: #fff;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
header.app a { color: #fff; text-decoration: none; font-weight: 600; }
header.app .nutzer { font-size: 0.8rem; opacity: 0.85; }

main { padding: 1rem; max-width: 640px; margin: 0 auto; }

h1 { font-size: 1.3rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }

.karte {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Menü-Buttons (Home) und Listeneinträge */
a.kachel, button.kachel {
  display: block;
  width: 100%;
  background: #fff;
  border: 2px solid var(--blau);
  border-radius: 12px;
  color: var(--blau);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 1.1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
a.kachel small { display: block; font-weight: 400; font-size: 0.85rem; color: var(--grau); }

ul.liste { list-style: none; margin: 0; padding: 0; }
ul.liste li { margin-bottom: 0.5rem; }
ul.liste a {
  display: block;
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.8rem;
  text-decoration: none;
  color: inherit;
}
ul.liste .titel { font-weight: 700; }
ul.liste .meta { font-size: 0.85rem; color: var(--grau); }

/* Formulare */
label { display: block; font-size: 0.85rem; color: var(--grau); margin: 0.6rem 0 0.2rem; }
input, textarea, select {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.7rem;
  border: 2px solid var(--rand);
  border-radius: 10px;
  background: #fff;
}
input:focus, textarea:focus { outline: 3px solid var(--blau-hell); border-color: var(--blau-hell); }
input.scan { border-color: var(--blau); font-weight: 600; }

button.primaer, button.sekundaer {
  width: 100%;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.9rem;
  margin-top: 0.9rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}
button.primaer { background: var(--gruen); color: #fff; }
button.sekundaer { background: #fff; color: var(--grau); border: 2px solid var(--rand); }

/* Meldungen */
.flash { border-radius: 10px; padding: 0.8rem; margin-bottom: 0.75rem; font-weight: 600; }
.flash.ok { background: #d3f9d8; color: var(--gruen); border: 1px solid var(--gruen); }
.flash.fehler { background: #ffe3e3; color: var(--rot); border: 1px solid var(--rot); }

/* Positions-/Bestandstabellen */
table.zeilen { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.zeilen th, table.zeilen td { padding: 0.6rem 0.5rem; text-align: left; border-bottom: 1px solid var(--rand); }
table.zeilen th { font-size: 0.75rem; text-transform: uppercase; color: var(--grau); }
/* Zeilen-Zustand: grün = exakt, orange = unter, blau = über; rejected immer rot. */
table.zeilen tr.zustand-voll td { color: var(--gruen); }
table.zeilen tr.zustand-unter td { color: var(--gelb); }
table.zeilen tr.zustand-ueber td { color: var(--blau-hell); }
table.zeilen .rejected { color: var(--rot); font-weight: 700; }
table.zeilen td.menge { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.klickbar { cursor: pointer; }
tr.klickbar:active { background: var(--hintergrund); }

.badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; }
.badge.open { background: #e7f5ff; color: var(--blau-hell); }
.badge.partial { background: #fff3bf; color: var(--gelb); }
.badge.complete { background: #d3f9d8; color: var(--gruen); }
.badge.closed { background: #e9ecef; color: var(--grau); }
/* Auftrags-Status */
.badge.new { background: #e7f5ff; color: var(--blau-hell); }
.badge.allocated { background: #e7f5ff; color: var(--blau-hell); }
.badge.picking { background: #fff3bf; color: var(--gelb); }
.badge.picked { background: #d3f9d8; color: var(--gruen); }
.badge.packed { background: #d3f9d8; color: var(--gruen); }
.badge.shipped { background: #e9ecef; color: var(--grau); }
.badge.short { background: #ffe3e3; color: var(--rot); }
.badge.cancelled { background: #e9ecef; color: var(--grau); }

.produktkopf { font-size: 1.15rem; font-weight: 700; }
.produktkopf small { display: block; font-size: 0.8rem; color: var(--grau); font-weight: 400; }

/* HTMX-Ladeindikator */
.htmx-request { opacity: 0.6; }
