:root {
  --gruen: #2f5d3a; --gruen-hell: #e7efe3; --creme: #faf7f0; --text: #1f2a22; --grau: #6b7368;
  --rot: #b3402f; --rot-hell: #f8e4df; --linie: #dcd8cc; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--creme); }
a { color: var(--gruen); }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; background: var(--gruen); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; opacity: .8; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
nav a, nav .link { color: #fff; text-decoration: none; font-size: 15px; }
nav a.scan { background: #fff; color: var(--gruen); padding: 4px 12px; border-radius: 20px; font-weight: 600; }
nav form { margin: 0; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
small { display: block; color: var(--grau); font-size: 13px; }
.meta { color: var(--grau); margin: 4px 0; }
.card { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.narrow { max-width: 380px; margin: 40px auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > label { flex: 1 1 140px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea { font: inherit; font-weight: 400; padding: 10px; border: 1px solid var(--linie); border-radius: 8px; background: #fff; width: 100%; }
input[type=checkbox] { width: 20px; height: 20px; }
fieldset { border: 1px dashed var(--linie); border-radius: 8px; padding: 8px 12px 12px; }
legend { font-size: 13px; color: var(--grau); }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--gruen); color: #fff; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--gruen); border: 1px solid var(--gruen); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.filter input { flex: 1 1 200px; width: auto; }
.filter select { flex: 0 1 200px; width: auto; }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--gruen-hell); }
.msg.err { background: var(--rot-hell); color: var(--rot); }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: 13px; color: var(--grau); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.num small { display: inline; }
tr.knapp { background: var(--rot-hell); }
.pos { color: var(--gruen); font-weight: 600; }
.neg { color: var(--rot); font-weight: 600; }
.head h1 { margin: 2px 0 8px; }
.stock { font-size: 18px; margin-top: 8px; }
.stock b { font-size: 40px; color: var(--gruen); }
.stock span { color: var(--grau); font-size: 14px; }
.stock.knapp b { color: var(--rot); }
.stock.small b { font-size: 24px; }
.actions { display: grid; gap: 10px; margin: 16px 0; }
@media (min-width: 700px) { .actions { grid-template-columns: 1fr 1fr; } }
.act { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); }
.act summary { padding: 14px 16px; font-weight: 700; font-size: 17px; cursor: pointer; list-style: none; }
.act summary::-webkit-details-marker { display: none; }
.act form { padding: 0 16px 16px; }
.act.plus summary { background: var(--gruen); color: #fff; border-radius: var(--radius); }
.act.minus summary { background: var(--rot); color: #fff; border-radius: var(--radius); }
.act[open] summary { border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 12px; }
.links { margin: 8px 0 16px; }
.scanner { background: #000; border-radius: var(--radius); overflow: hidden; }
.scanner video { width: 100%; max-height: 60vh; display: block; object-fit: cover; }
.scanner .meta { color: #fff; padding: 8px 12px; margin: 0; }

/* Etiketten */
body.labels { background: #fff; }
body.labels .bar { padding: 12px; gap: 12px; justify-content: flex-start; }
.sheet { display: flex; flex-wrap: wrap; }
.label { display: flex; align-items: center; gap: 2.5mm; overflow: hidden; page-break-inside: avoid; break-inside: avoid; }
.label .qr svg { display: block; width: 100%; height: 100%; }
.label .txt { display: flex; flex-direction: column; min-width: 0; font-size: 9pt; line-height: 1.2; }
.label .txt b { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.label .txt span { font-family: ui-monospace, Menlo, monospace; font-size: 8pt; margin-top: 1mm; }
.rolle .label { width: 62mm; height: 29mm; padding: 2mm; page-break-after: always; }
.rolle .qr { width: 25mm; height: 25mm; flex: none; }
.a4 .sheet { width: 210mm; padding: 10mm 5mm; }
.a4 .label { width: 66mm; height: 34mm; padding: 3mm; border: 0.2mm dashed #ccc; }
.a4 .qr { width: 26mm; height: 26mm; flex: none; }
@media print {
  .noprint { display: none !important; }
  .rolle { margin: 0; } @page { margin: 0; }
  .a4 .label { border-color: transparent; }
}
