:root {
  --bg: #f4f5f7;
  --karte: #ffffff;
  --rand: #dcdfe4;
  --text: #1c1f23;
  --gedimmt: #62696f;
  --akzent: #2563eb;
  --akzent-text: #ffffff;
  --gut: #16a34a;
  --warn: #d97706;
  --fehler: #dc2626;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --karte: #1d2126;
    --rand: #2f353c;
    --text: #e8eaed;
    --gedimmt: #9aa3ad;
    --akzent: #3b82f6;
    --gut: #22c55e;
    --warn: #f59e0b;
    --fehler: #ef4444;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.versteckt { display: none !important; }

header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
}
header .titel { font-weight: 650; font-size: 17px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .nutzer { color: var(--gedimmt); font-size: 13px; }

main { max-width: 760px; margin: 0 auto; padding: 14px; }
.karte {
  background: var(--karte); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--gedimmt); text-transform: uppercase; letter-spacing: .04em; }

label { display: block; font-size: 13px; color: var(--gedimmt); margin-bottom: 4px; }
input, select, button {
  font: inherit; border-radius: 10px;
}
input, select {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--rand); background: var(--bg); color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.feld { margin-bottom: 12px; }

button {
  padding: 11px 16px; border: 1px solid transparent;
  background: var(--akzent); color: var(--akzent-text);
  font-weight: 600; cursor: pointer;
}
button.sekundaer { background: transparent; color: var(--text); border-color: var(--rand); }
button.gefahr { background: transparent; color: var(--fehler); border-color: var(--rand); }
button.klein { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }

.scanfeld { display: flex; gap: 8px; }
.scanfeld input { font-size: 20px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.scanfeld .menge { max-width: 90px; text-align: center; }

#video {
  width: 100%; max-height: 46vh; background: #000;
  border-radius: var(--radius); display: block; object-fit: contain;
}
.kamera-huelle { position: relative; margin-bottom: 12px; }
.zielbalken {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 2px;
  background: var(--fehler); opacity: .7;
}

.status { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.status.gut { background: color-mix(in srgb, var(--gut) 16%, transparent); color: var(--gut); }
.status.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.status.fehler { background: color-mix(in srgb, var(--fehler) 16%, transparent); color: var(--fehler); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rand); }
th { color: var(--gedimmt); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
td.ean { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tabellenhuelle { overflow-x: auto; }

.reiter { display: flex; gap: 6px; margin-bottom: 14px; }
.reiter button {
  flex: 1; background: transparent; color: var(--gedimmt);
  border: 1px solid var(--rand); font-weight: 600;
}
.reiter button.aktiv { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--rand);
}
.liste li:last-child { border-bottom: 0; }
.liste .haupt { flex: 1; min-width: 0; }
.liste .ean { font-size: 16px; font-variant-numeric: tabular-nums; }
.liste .meta { font-size: 12px; color: var(--gedimmt); }
.abzeichen {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--rand); color: var(--gedimmt);
}
.abzeichen.offen { color: var(--gut); border-color: var(--gut); }

.kennzahlen { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.kennzahl { flex: 1; min-width: 110px; }
.kennzahl .wert { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kennzahl .bez { font-size: 12px; color: var(--gedimmt); }

.hinweis { font-size: 13px; color: var(--gedimmt); }
