:root {
  --fs-primary: #5D7FA7;
  --fs-dark: #3F5974;
  --ok: #1f9d55;
  --error: #d63b3b;
  --warn: #e0932f;
  --done: #147a8c;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e2e7ee;
  --text: #1f2733;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--fs-dark); color: #fff;
  padding: 10px 18px;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.header-right { display: flex; align-items: center; gap: 18px; }
.header-right label { font-size: 14px; opacity: .95; }
.header-right input {
  margin-left: 6px; padding: 6px 8px; border: none; border-radius: 6px;
  font-size: 14px;
}
.link { color: #dce6f3; text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }

.config-warning {
  background: #fff4e5; color: #8a5300; border-bottom: 1px solid #f0d8b0;
  padding: 10px 18px; font-size: 14px;
}

/* --- Status-Banner --- */
.banner {
  margin: 18px; padding: 28px 24px; border-radius: 14px;
  color: #fff; text-align: center; transition: background .12s;
}
.banner.flash { filter: brightness(1.25); }
#banner-title { font-size: 40px; font-weight: 800; line-height: 1.1; }
#banner-sub { font-size: 20px; margin-top: 6px; opacity: .95; }
.banner.idle  { background: #6b7688; }
.banner.ok    { background: var(--ok); }
.banner.error { background: var(--error); }
.banner.warn  { background: var(--warn); }
.banner.done  { background: var(--done); }

/* --- Scan-Feld (klein gehalten, Fokus liegt hier) --- */
.scan-input {
  display: block; width: calc(100% - 36px); margin: 0 18px 18px;
  padding: 14px 16px; font-size: 22px; border: 2px solid var(--fs-primary);
  border-radius: 10px; outline: none;
}
.scan-input:focus { border-color: var(--fs-dark); box-shadow: 0 0 0 3px #5d7fa733; }

/* --- Bestellung --- */
.order { margin: 0 18px 40px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.order-head {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; background: #eef2f7; border-bottom: 1px solid var(--line);
}
.order-name { font-size: 24px; font-weight: 800; }
.order-progress { font-size: 18px; color: #56617a; margin-right: auto; }

.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 20px;
}
.item:last-child { border-bottom: none; }
.item .tick {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  border: 2px solid #c3ccda; color: #fff; background: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.item.done { background: #eefaf1; }
.item.done .tick { background: var(--ok); border-color: var(--ok); }
.item-name { flex: 1 1 auto; }
.item-count { font-variant-numeric: tabular-nums; font-weight: 700; color: #46516a; }
.inv {
  font-size: 14px; color: #56617a; background: #eef2f7;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.inv-critical { background: var(--error); color: #fff; font-weight: 800; }

/* ---- Wareneingang ---- */
.setup { max-width: 900px; margin: 24px auto; padding: 0 16px; }
.setup h2 { margin: 0 0 6px; }
.setup .hint { color: #56617a; font-size: 14px; margin: 0 0 14px; }
.setup .hint code { background: #eef2f7; padding: 1px 6px; border-radius: 4px; }
.setup-label { display: block; margin-bottom: 10px; font-weight: 600; }
.setup-label input { margin-left: 8px; padding: 8px 10px; font-size: 15px;
  border: 1px solid #c9d3e0; border-radius: 6px; min-width: 320px; }
.setup-row { margin-bottom: 12px; display: flex; gap: 12px; align-items: center; }
.setup-row textarea { width: 100%; font-family: Consolas, monospace; font-size: 14px;
  padding: 10px; border: 1px solid #c9d3e0; border-radius: 8px; }
.setup-error { color: #fff; background: var(--error); padding: 10px 14px;
  border-radius: 8px; font-weight: 600; }
.item.over { background: #fff7ed; }
.item .count-over { color: #c2570b; }
.item-ean-sub { display: block; font-size: 12px; color: #8a94a6; }
.actions-receiving { display: flex; align-items: center; gap: 18px; justify-content: flex-end; }
.book-label { font-size: 14px; color: #46516a; display: flex; align-items: center; gap: 6px; }
.diff-less { color: var(--error); font-weight: 800; }
.diff-more { color: #c2570b; font-weight: 800; }
.auto-open-label { font-size: 14px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.btn-partial { background: #c2570b; border-color: #c2570b; }
.item.no-ean:not(.done) { background: #fff8ec; }
.item.no-ean .item-name::after {
  content: " · ohne EAN"; color: var(--warn); font-size: 14px; font-weight: 600;
}

.actions { padding: 18px; text-align: right; }
.btn {
  padding: 10px 16px; font-size: 16px; border: 1px solid var(--fs-primary);
  background: #fff; color: var(--fs-dark); border-radius: 8px; cursor: pointer;
}
.btn:hover { background: #f0f4f9; }
.btn-small { padding: 6px 10px; font-size: 14px; }
.btn-primary {
  background: var(--fs-primary); color: #fff; border-color: var(--fs-primary);
  font-size: 20px; font-weight: 700; padding: 14px 26px;
}
.btn-primary:disabled { background: #b8c4d4; border-color: #b8c4d4; cursor: not-allowed; }

.hidden { display: none; }

/* --- Report --- */
.report { max-width: 1000px; margin: 24px auto; padding: 0 18px; }
.report h1 { font-size: 24px; }
.report table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.report th, .report td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.report th { background: #eef2f7; }
.badge { padding: 2px 8px; border-radius: 999px; color: #fff; font-size: 12px; }
.badge.ok { background: var(--ok); }
.badge.error { background: var(--error); }
