/* DVD-Inventar – Erscheinungsbild
   Schriften: nur Systemschriften (Bahnschrift für Zahlen/Überschriften), nichts wird aus dem Netz geladen. */
:root {
  --bg: #f3f1ec;
  --panel: #ffffff;
  --panel-2: #f8f6f2;
  --ink: #1c1a17;
  --muted: #6d675e;
  --line: #e5e0d7;
  --line-strong: #cdc6ba;

  --header: #17161b;
  --header-ink: #f5f2eb;
  --header-muted: #a8a299;
  --brand: #f5b41a;
  --perf: var(--bg);  /* Löcher im Filmstreifen */

  --ok: #14804a;     /* neu angelegt */
  --info: #1f5fd6;   /* +1 */
  --out: #7a3fe0;    /* ausbuchen */
  --err: #cc2f33;
  --warn: #a86200;
  --on-solid: #ffffff;

  --shadow: 0 1px 2px rgba(28, 26, 23, .05), 0 10px 28px -14px rgba(28, 26, 23, .22);
  --r: 16px;
  --r-sm: 10px;

  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: Bahnschrift, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e12;
    --panel: #19181d;
    --panel-2: #201f25;
    --ink: #f2efe9;
    --muted: #a19b92;
    --line: #2b2a31;
    --line-strong: #3d3b45;

    --header: #0a090c;
    --perf: #34323a;

    --ok: #3fcf8a;
    --info: #7aaaff;
    --out: #b79aff;
    --err: #ff7272;
    --warn: #f5b41a;
    --on-solid: #121115;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 30px -16px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--header); color: var(--header-ink); }
.topbar-inner {
  max-width: 1480px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-mark .disc { fill: var(--brand); }
.brand-mark .shine { fill: none; stroke: rgba(255, 255, 255, .6); stroke-width: 3; stroke-linecap: round; }
.brand-mark .hub { fill: var(--header); }
.brand-mark .hole { fill: var(--brand); }
.brand h1 { font: 600 23px/1.1 var(--font-display); letter-spacing: .02em; }
.brand p { font-size: 12.5px; color: var(--header-muted); margin-top: 3px; letter-spacing: .02em; }

.stats { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 108px; padding: 8px 14px 9px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  color: inherit; text-align: left;
}
.stat b { font: 600 27px/1 var(--font-display); font-stretch: 90%; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.stat span { font-size: 11.5px; color: var(--header-muted); text-transform: uppercase; letter-spacing: .07em; }
button.stat:hover { background: rgba(255, 255, 255, .11); }
.stat.is-pending b { color: #8db6ff; }
.stat.is-review { border-color: rgba(245, 180, 26, .5); background: rgba(245, 180, 26, .1); }
.stat.is-review b { color: var(--brand); }
/* Filmstreifen-Perforation */
.perforation {
  height: 9px;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, var(--perf) 9px 21px) center / auto 5px no-repeat,
    var(--header);
  border-bottom: 2px solid var(--brand);
}

main { max-width: 1480px; margin: 0 auto; padding: 24px 28px 48px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- Scan-Bereich ---------- */
.scan {
  --mode: var(--ok);
  display: grid; grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr); gap: 22px;
  padding: 22px;
  transition: border-color .2s, background-color .2s;
}
.scan.mode-out {
  --mode: var(--out);
  border-color: color-mix(in srgb, var(--out) 55%, var(--line));
  background: color-mix(in srgb, var(--out) 5%, var(--panel));
}
.scan-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.scan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { font: 600 13px/1 var(--font-display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.mode-out .eyebrow { color: var(--out); }

.scan-state {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 999px; padding: 4px 12px 4px 10px;
  font-size: 12.5px; color: var(--muted);
}
.scan-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.scan-state.ready { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, var(--panel)); }
.scan-state.ready i { background: var(--ok); animation: pulse 1.8s ease-out infinite; }
.scan-state:not(.ready) { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); font-weight: 600; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}

.scan-field { position: relative; }
.scan-field svg { position: absolute; left: 18px; top: 50%; width: 30px; height: 30px; transform: translateY(-50%); color: var(--muted); pointer-events: none; stroke-width: 1.6; }
#scanInput {
  width: 100%; height: 72px;
  padding: 0 18px 0 62px;
  font: 500 30px/1 var(--font-mono); letter-spacing: .06em;
  background: var(--panel-2);
  border: 2px solid var(--line-strong); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
#scanInput::placeholder { font: 400 16px/1 var(--font-ui); letter-spacing: 0; color: var(--muted); }
#scanInput:focus { outline: none; background: var(--panel); border-color: var(--mode); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mode) 18%, transparent); }
.scan-field:focus-within svg { color: var(--mode); }

.scan-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; border-radius: 9px;
  padding: 8px 15px; color: var(--muted); font-weight: 600; font-size: 14px;
  transition: background-color .15s, color .15s;
}
.segmented button:hover { color: var(--ink); }
.segmented #modeIn.active { background: var(--ok); color: var(--on-solid); }
.segmented #modeOut.active { background: var(--out); color: var(--on-solid); }

.field-inline { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.field-inline:focus-within { border-color: var(--line-strong); }
.field-inline input { width: 132px; border: 0; background: transparent; color: var(--ink); font-size: 14.5px; padding: 0; }
.field-inline input:focus { outline: none; }
.field-inline input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }

.switch { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: relative; width: 36px; height: 21px; border-radius: 999px; background: var(--line-strong); transition: background-color .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--panel); transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(15px); }
.switch input:focus-visible + i { outline: 2px solid var(--info); outline-offset: 2px; }

/* ---------- Ergebnis des letzten Scans (wie ein Ticket) ---------- */
.result {
  --state: var(--line-strong);
  position: relative; overflow: hidden;
  display: flex; align-items: stretch; gap: 18px;
  min-height: 168px; padding: 18px 0 18px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--state) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--state) 38%, var(--line));
}
.result.s-created { --state: var(--ok); }
.result.s-incremented { --state: var(--info); }
.result.s-decremented { --state: var(--out); }
.result.s-error { --state: var(--err); padding-right: 18px; }
.result.flash { animation: pop .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: scale(.975); box-shadow: 0 0 0 6px color-mix(in srgb, var(--state) 30%, transparent); } to { transform: none; box-shadow: 0 0 0 0 transparent; } }

.result.is-idle { background: var(--panel-2); border-style: dashed; border-color: var(--line-strong); padding: 18px 24px; align-items: center; gap: 22px; }
.idle-art {
  flex: none; width: 96px; height: 64px; border-radius: 6px; opacity: .55;
  background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 6px, var(--ink) 6px 7px, transparent 7px 11px, var(--ink) 11px 15px, transparent 15px 17px, var(--ink) 17px 18px, transparent 18px 23px);
}
.idle-text { color: var(--muted); font-size: 14px; max-width: 46ch; }
.idle-text b { display: block; color: var(--ink); font: 600 17px/1.3 var(--font-display); margin-bottom: 4px; letter-spacing: .01em; }

.result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.badge {
  align-self: flex-start;
  font: 600 12px/1 var(--font-display); letter-spacing: .1em;
  padding: 5px 10px 4px; border-radius: 999px;
  background: var(--state); color: var(--on-solid);
}
.result-title { font: 600 23px/1.2 var(--font-display); letter-spacing: .005em; overflow-wrap: anywhere; }
.result-title.placeholder { color: var(--muted); font-weight: 400; font-style: italic; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.result-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.result-error { font: 600 19px/1.35 var(--font-display); color: var(--err); margin-top: 4px; }

.result-qty {
  position: relative; flex: none; width: 128px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  margin: -18px 0; padding: 18px 0;
  border-left: 2px dashed color-mix(in srgb, var(--state) 45%, var(--line));
}
.result-qty::before, .result-qty::after {
  content: ""; position: absolute; left: -10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--state) 38%, var(--line));
}
.mode-out .result-qty::before, .mode-out .result-qty::after { background: color-mix(in srgb, var(--out) 5%, var(--panel)); }
.result-qty::before { top: -10px; }
.result-qty::after { bottom: -10px; }
.result-qty b { font: 600 62px/0.9 var(--font-display); font-stretch: 85%; font-variant-numeric: tabular-nums; color: var(--state); }
.result-qty small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- Cover (echtes Bild oder erzeugte DVD-Hülle) ---------- */
.cover { flex: none; border-radius: 4px; object-fit: cover; background: var(--line); position: relative; overflow: hidden; display: block; }
.cover-lg { width: 92px; height: 130px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45); }
.cover-sm { width: 36px; height: 50px; border-radius: 3px; }
.cover.is-gen {
  --h: 220;
  background: linear-gradient(155deg, hsl(var(--h) 50% 42%), hsl(calc(var(--h) + 38) 58% 22%));
  color: #fff;
  box-shadow: inset 4px 0 0 rgba(0, 0, 0, .28), inset 5px 0 0 rgba(255, 255, 255, .14);
}
.cover-lg.is-gen { box-shadow: inset 5px 0 0 rgba(0, 0, 0, .28), inset 6px 0 0 rgba(255, 255, 255, .14), 0 6px 16px -6px rgba(0, 0, 0, .45); }
.cover.is-blank { background: repeating-linear-gradient(135deg, var(--line) 0 6px, var(--panel-2) 6px 12px); }
.cover-band { position: absolute; top: 0; left: 0; right: 0; padding: 4px 0 3px; text-align: center; font: 600 9.5px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; background: rgba(0, 0, 0, .32); color: rgba(255, 255, 255, .92); }
.is-blank .cover-band { background: var(--line-strong); color: var(--ink); }
.cover-title { position: absolute; inset: 22px 7px 8px 12px; display: flex; align-items: center; font: 600 12.5px/1.15 var(--font-display); overflow: hidden; overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.cover-initials { position: absolute; inset: 0 0 0 4px; display: flex; align-items: center; justify-content: center; font: 600 15px/1 var(--font-display); letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

.notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 16px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--warn) 11%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); font-size: 14px; }
.notice::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--warn); color: var(--on-solid); font: 700 13px/20px var(--font-display); text-align: center; }

/* ---------- Bestand + Protokoll ---------- */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; margin-top: 22px; align-items: start; }
.section-title { font: 600 13px/1 var(--font-display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

.stock-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; min-width: 0; max-width: 420px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#searchInput { width: 100%; height: 38px; padding: 0 10px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
#searchInput:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); }
#sortSelect { height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 13px; color: var(--muted); font-size: 13px; transition: background-color .15s, color .15s, border-color .15s; }
.chips button:hover { color: var(--ink); border-color: var(--line-strong); }
.chips button.active { background: var(--ink); border-color: var(--ink); color: var(--panel); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 10px;
  text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--panel-2); border-color: var(--muted); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--panel); font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--panel)); }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--err) 9%, var(--panel)); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.small svg.ico { width: 15px; height: 15px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn:last-child { border-radius: 0 10px 10px 0; margin-left: -1px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 600 11.5px/1 var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 12px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.zero .t-title, tbody tr.zero .cover { opacity: .5; }
.c-cover { width: 50px; padding-right: 0; }
.c-qty { text-align: center; white-space: nowrap; width: 140px; }
.c-act { text-align: right; width: 1%; white-space: nowrap; }
.t-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.t-title.placeholder { font-weight: 400; font-style: italic; color: var(--muted); }
.t-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.t-ean { font: 13.5px/1 var(--font-mono); color: var(--muted); white-space: nowrap; letter-spacing: .02em; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.pill.loc::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.pill.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .03em; }
a.pill.link { text-decoration: none; color: var(--info); }
a.pill.link:hover { border-color: var(--info); }
.t-asin { display: block; margin-top: 5px; font: 12px/1 var(--font-mono); color: var(--muted); text-decoration: none; letter-spacing: .02em; }
a.t-asin:hover { color: var(--info); text-decoration: underline; }
.result .pill { background: color-mix(in srgb, var(--panel) 70%, transparent); border-color: color-mix(in srgb, var(--state) 25%, var(--line)); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; margin-left: 8px; vertical-align: 1px; white-space: nowrap; }
.tag.pending { background: color-mix(in srgb, var(--info) 14%, var(--panel)); color: var(--info); }
.tag.review { background: color-mix(in srgb, var(--warn) 16%, var(--panel)); color: var(--warn); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.qty b { min-width: 40px; text-align: center; font: 600 18px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.qty button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; transition: background-color .12s, color .12s; }
.qty button:hover { background: var(--panel-2); color: var(--ink); }
.qty button:first-child { border-right: 1px solid var(--line); }
.qty button:last-child { border-left: 1px solid var(--line); }

.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.pager:empty { display: none; }

.log-head { padding: 17px 16px 15px; border-bottom: 1px solid var(--line); }
.log ul { list-style: none; margin: 0; padding: 4px 0; max-height: 660px; overflow-y: auto; }
.log li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px 8px 14px; font-size: 13.5px; }
.log li + li { border-top: 1px solid var(--line); }
.log .delta { width: 38px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font: 600 15px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.log .delta.plus { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, var(--panel)); }
.log .delta.minus { color: var(--out); background: color-mix(in srgb, var(--out) 13%, var(--panel)); }
.log .l-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .l-sub { color: var(--muted); font-size: 12px; }
.log li.undone .delta, .log li.undone .l-title { opacity: .45; text-decoration: line-through; }
.log .log-empty { display: block; color: var(--muted); padding: 22px 16px; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(580px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
dialog::backdrop { background: rgba(12, 11, 14, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
dialog form { padding: 24px 26px 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { font: 600 22px/1.2 var(--font-display); letter-spacing: .01em; }
.dialog-sub { color: var(--muted); font-size: 13.5px; margin-top: -8px; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
dialog input { height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); color: var(--ink); font-size: 15px; font-weight: 400; text-transform: none; letter-spacing: 0; }
dialog input:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); background: var(--panel); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.form-error { color: var(--err); font-size: 14px; font-weight: 600; }

@media (max-width: 1250px) {
  .columns { grid-template-columns: 1fr; }
  .log ul { max-height: 320px; }
}
@media (max-width: 900px) {
  .scan { grid-template-columns: 1fr; }
  .topbar-inner { padding: 12px 16px; }
  .stats { margin-left: 0; }
  main { padding: 16px 14px 32px; }
  .search { max-width: none; flex-basis: 100%; }
}
@media (max-width: 560px) {
  .result-qty { width: 96px; }
  .result-qty b { font-size: 48px; }
  .cover-lg { width: 70px; height: 99px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Buchungsarten: Wareneingang, Versand, Kundenretoure, Retoure an Lieferant ---------- */
:root { --ret: #b4530a; }
@media (prefers-color-scheme: dark) { :root { --ret: #fb9a4b; } }

.scan.mode-eingang { --mode: var(--ok); }
.scan.mode-versand { --mode: var(--out); }
.scan.mode-retoure_kunde { --mode: var(--info); }
.scan.mode-retoure_lieferant { --mode: var(--ret); }
/* Alles außer dem normalen Wareneingang färbt den ganzen Bereich – damit niemand versehentlich falsch bucht. */
.scan:not(.mode-eingang) {
  border-color: color-mix(in srgb, var(--mode) 55%, var(--line));
  background: color-mix(in srgb, var(--mode) 5%, var(--panel));
}
.scan:not(.mode-eingang) .eyebrow { color: var(--mode); }
.scan:not(.mode-eingang) .result-qty::before,
.scan:not(.mode-eingang) .result-qty::after { background: color-mix(in srgb, var(--mode) 5%, var(--panel)); }

.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.modes button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: transparent; border-radius: 9px; padding: 9px 8px;
  color: var(--muted); font-weight: 600; font-size: 13.5px; line-height: 1.15; text-align: left;
  transition: background-color .15s, color .15s;
}
.modes button:hover { color: var(--ink); }
.modes button.active { background: var(--mode); color: var(--on-solid); }
.modes svg.ico { width: 16px; height: 16px; }

#priceInput { width: 88px; }
#referenceInput { width: 150px; }
#supplierInput { width: 120px; }
.field-inline.is-set { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); color: var(--warn); font-weight: 600; }

.result.k-eingang { --state: var(--ok); }
.result.k-versand { --state: var(--out); }
.result.k-retoure_kunde { --state: var(--info); }
.result.k-retoure_lieferant { --state: var(--ret); }
.result-meta:empty { display: none; }
.result .pill.price { background: color-mix(in srgb, var(--state) 16%, var(--panel)); border-color: color-mix(in srgb, var(--state) 45%, var(--line)); font-size: 13px; font-weight: 700; }
.result .pill.prompt { background: color-mix(in srgb, var(--warn) 16%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); color: var(--warn); font-size: 13px; }

.c-price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
th.c-price { text-align: right; }
.dash { color: var(--muted); font-weight: 400; }

.stat.is-value b { color: #7fe0aa; }

.log .l-actions { display: inline-flex; }
.log .l-kind { color: var(--ink); font-weight: 600; }
.log li.k-versand .l-kind { color: var(--out); }
.log li.k-retoure_kunde .l-kind { color: var(--info); }
.log li.k-retoure_lieferant .l-kind { color: var(--ret); }
.log li.k-eingang .l-kind { color: var(--ok); }
.log li.k-retoure_lieferant .delta.minus { color: var(--ret); background: color-mix(in srgb, var(--ret) 13%, var(--panel)); }
.log li.k-retoure_kunde .delta.plus { color: var(--info); background: color-mix(in srgb, var(--info) 13%, var(--panel)); }
.log li.undone .l-kind { opacity: .45; }

@media (max-width: 1100px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Platz für zwei Feldzeilen reservieren, damit die Seite beim Wechsel der Buchungsart nicht springt. */
.scan-options { min-height: 98px; align-content: flex-start; }
.columns { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1250px) { .columns { grid-template-columns: 1fr; } }
@media (max-width: 1250px) { .columns { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Zustand je Exemplar ---------- */
.field-inline select { border: 0; background: transparent; color: var(--ink); font-size: 14.5px; padding: 0; max-width: 150px; cursor: pointer; }
.field-inline select:focus { outline: none; }
.field-inline select option { background: var(--panel); color: var(--ink); }
.cond-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.cond-label { font-size: 12px; color: var(--muted); margin-right: 3px; }
.cond-chips button {
  border: 1px solid color-mix(in srgb, var(--state) 25%, var(--line)); background: color-mix(in srgb, var(--panel) 70%, transparent);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; line-height: 1; color: var(--muted);
  transition: background-color .12s, color .12s, border-color .12s;
}
.cond-chips button:hover { color: var(--ink); border-color: var(--state); }
.cond-chips button.active { background: var(--state); border-color: var(--state); color: var(--on-solid); }
.t-cond { margin-top: 4px; font-size: 11.5px; color: var(--muted); white-space: normal; line-height: 1.25; }
dialog select { height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); color: var(--ink); font-size: 15px; font-weight: 400; text-transform: none; letter-spacing: 0; }
dialog select:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); }

/* ---------- Hinweis zum Amazon-Import ---------- */
.notice.info { align-items: center; background: color-mix(in srgb, var(--info) 9%, var(--panel)); border-color: color-mix(in srgb, var(--info) 35%, var(--line)); }
.notice.info::before { content: "i"; background: var(--info); font-style: italic; }
.notice.info span { flex: 1; }

/* ---------- Anmeldung ---------- */
.user-box { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; padding-left: 6px; }
.user-name { font-size: 12.5px; color: var(--header-muted); }
.user-name::before { content: "Angemeldet: "; }
.user-box .btn { background: transparent; border-color: rgba(255, 255, 255, .25); color: var(--header-ink); height: 28px; }
.user-box .btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }

.login-page { min-height: 100vh; display: flex; background: var(--header); }
.login-wrap { margin: auto; padding: 24px 16px; width: min(420px, 100%); max-width: none; }
.login { display: flex; flex-direction: column; gap: 16px; padding: 28px 28px 26px; border-top: 4px solid var(--brand); }
.login-brand { margin-bottom: 6px; }
.login-brand .hub { fill: var(--panel); }
.login-brand h1 { font: 600 24px/1.1 var(--font-display); }
.login-brand p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.login label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.login input { height: 46px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); color: var(--ink); font-size: 16px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.login input:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); background: var(--panel); }
.login-submit { height: 46px; justify-content: center; font-size: 15.5px; margin-top: 4px; }
.login-submit[disabled] { opacity: .6; }
