:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #131e38;
  background: #f4f6fa;
  accent-color: #1538f2;
  --ink: #131e38;
  --muted: #536179;
  --line: #dce2ed;
  --surface: #fff;
  --blue: #1538f2;
  --blue-hover: #0b27ca;
  --radius: 18px;
  --shadow: 0 10px 30px #17284a09, 0 1px 3px #17284a08;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
.shell { width: min(1216px, 100% - 3rem); margin-inline: auto; }
main { padding-bottom: 3.25rem; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner, .branding, .account, .actions, .panel-heading, .page-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.top-inner { min-height: 76px; justify-content: space-between; }
.brand { color: var(--blue); font-size: 1.78rem; font-weight: 900; letter-spacing: -.072em; line-height: 1; white-space: nowrap; }
.brand-label { border-left: 1px solid var(--line); padding-left: .8rem; color: var(--muted); font-weight: 680; font-size: .92rem; }
.account { gap: .8rem; overflow-wrap: anywhere; }
#current-user { font-size: .875rem; font-weight: 650; }
.skip { position: fixed; z-index: 5; left: 1rem; top: .5rem; padding: .75rem; background: white; transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }
.workspace-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .38rem;
  margin: 1.15rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  width: fit-content;
  max-width: 100%;
}
.workspace-nav button { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid transparent; color: var(--muted); background: transparent; }
.workspace-nav button:hover { background: #f4f6fa; color: var(--ink); }
.workspace-nav button[aria-current] { background: #eaf0ff; color: #132caa; }
.count { background: #edf0f7; color: #405271; border-radius: 50rem; padding: .12rem .43rem; font-size: .75rem; }
.count:empty { display: none; }
.workspace-nav button[aria-current] .count { background: #d7e1ff; color: #172e99; }
.capture-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: #0e1b40;
  padding: clamp(1.15rem, 3.65vw, 2.65rem);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}
.capture-hero::before, .sign-in::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: #122149 url("./inventur-banner.webp") center 54% / cover no-repeat;
}
.capture-hero::before { z-index: -1; inset: 0 0 0 30%; }
.capture-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0;
  background: linear-gradient(90deg, #0e1b40 23%, #0e1b40e8 43%, #0e1b4050 68%, transparent);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .6rem; font-size: clamp(2rem, 4.9vw, 3.4rem); line-height: 1.04; font-weight: 780; letter-spacing: -.055em; }
h2 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -.027em; margin-bottom: 0; }
h3 { font-size: 1rem; margin-bottom: .72rem; line-height: 1.35; }
p { line-height: 1.56; }
.capture-hero p { color: #e3eafb; max-width: 36ch; margin-bottom: 1.3rem; }
.capture-hero .primary { background: #fff; color: #102cba; border-color: #fff; }
.capture-hero .primary:hover { background: #eaf0ff; }
.capture-hero .outline { background: #12224c; color: white; border-color: #6e83b3; }
.capture-hero .outline:hover { background: #223566; }
.layout { display: grid; grid-template-columns: minmax(265px,.84fr) minmax(0,1.72fr); gap: 1.05rem; align-items: start; }
.management { grid-template-columns: repeat(2,minmax(0,1fr)); }
.panel, .device, dialog { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel, .device { padding: clamp(1.1rem, 2.35vw, 1.55rem); min-width: 0; }
.panel-heading { justify-content: space-between; flex-wrap: wrap; padding-bottom: .85rem; }
.panel-heading .pill { margin: 0; }
.source-section + .source-section { border-top: 1px solid var(--line); padding-top: 1.05rem; margin-top: 1.05rem; }
.source h2 { margin-bottom: .55rem; }
.source p, .intro, .sign-in p, #admin .panel > p { color: var(--muted); }
.source p { margin-bottom: .8rem; }
.dropzone { width: 100%; justify-content: center; text-align: center; min-height: 62px; color: #1835a8; border: 1px dashed #8d9de0; background: #f3f5ff; }
.dropzone:hover { background: #e9eeff; }
.field-section { border-top: 1px solid #e4e8f0; padding: 1.05rem 0 .95rem; }
.field-section:last-of-type { padding-bottom: .3rem; }
.category-field { margin-bottom: .8rem; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .83rem; }
label { display: block; color: #2e3d59; font-size: .9rem; font-weight: 650; }
input:not([type=file],[type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  margin-top: .34rem;
  padding: .67rem .75rem;
  min-height: 46px;
  border: 1px solid #c4cedf;
  border-radius: 9px;
  color: var(--ink);
  background-color: #fbfcfe;
  font: 400 1rem/1.25 system-ui, sans-serif;
}
input:disabled { background-color: #edf0f5; }
input::placeholder, textarea::placeholder { color: #627087; }
textarea { resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  padding-right: 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23354964' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: right .72rem center;
  background-repeat: no-repeat;
}
button, .upload { border-radius: 9px; padding: .61rem .88rem; font: inherit; font-size: .9rem; font-weight: 720; min-height: 44px; cursor: pointer; }
.primary { background: var(--blue); color: white; border: 1px solid var(--blue); }
.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.outline { background: white; color: var(--ink); border: 1px solid #becae0; }
.outline:hover { background: #f2f5ff; border-color: #8093c5; }
.actions { flex-wrap: wrap; gap: .55rem; }
.upload { position: relative; display: inline-flex; align-items: center; }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
:focus-visible, .upload:focus-within { outline: 3px solid #4c6cff; outline-offset: 3px; }
.capture-hero :focus-visible, .capture-hero .upload:focus-within { outline-color: #9db4ff; }
button:disabled { opacity: .55; cursor: default; }
.check { display: flex; align-items: flex-start; gap: .62rem; margin: .82rem 0 .12rem; line-height: 1.45; }
.check input { height: 20px; width: 20px; flex: none; margin: 0; }
.pill { display: inline-flex; align-items: center; margin: .36rem 0; padding: .36rem .62rem; border-radius: 999px; background: #edf1ff; color: #263a79; font-size: .83rem; font-weight: 730; line-height: 1.25; }
.warn { background: #fff0ce; color: #714900; }
.danger { background: #ffe7e8; color: #862331; }
.success { background: #e0f4e9; color: #15533a; }
.message { color: #354968; font-size: .9rem; margin-block: .75rem 0; overflow-wrap: anywhere; }
.message:empty { display: none; }
.notice { padding: .75rem 1rem; margin: 0 0 1rem; background: #eaf0ff; border: 1px solid #cbd7ff; border-radius: 10px; color: #163496; }
.proofs { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,102px),1fr)); gap: .65rem; margin-top: .75rem; }
.proofs:empty { display: none; }
.proofs img { display: block; width: 100%; height: 100px; object-fit: contain; background: #edf0f6; border-radius: 8px; }
.proofs figure { margin: 0; min-width: 0; }
.proofs figcaption { overflow-wrap: anywhere; font-size: .84rem; }
.proofs button { margin-top: .25rem; min-height: 36px; padding: .25rem .5rem; }
.photo-kind-label { margin-bottom: .75rem; }
.more-camera { margin-top: .55rem; }
.proof-category select { padding: .34rem 1.55rem .34rem .4rem; min-height: 36px; background-position: right .34rem center; font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.check-group { min-inline-size: 0; margin: 0; padding: .6rem; border: 1px solid var(--line); border-radius: 9px; }
.check-group legend { padding-inline: .25rem; color: #2e3d59; font-size: .9rem; font-weight: 680; }
.check-toggles { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: .22rem; }
.check-toggles label { position: relative; display: grid; place-items: center; padding: .35rem .22rem; min-height: 42px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.check-toggles label:hover { background: #f1f4fc; }
.check-toggles label:has(input:checked) { background: #edf1ff; color: #1835a8; border-color: #c3cffd; }
.check-toggles label:has(input[value="OK"]:checked) { background: #e0f4e9; color: #15533a; border-color: #b6dccb; }
.check-toggles label:has(input[value="Fehler"]:checked) { background: #ffe7e8; color: #862331; border-color: #f1bfc4; }
.check-toggles input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.check-toggles label:has(input:focus-visible) { outline: 3px solid #4c6cff; outline-offset: 2px; }
.notes-label { margin-top: .9rem; }
.note-options { margin-top: .56rem; }
.note-options button { min-height: 40px; font-size: .86rem; }
.form-actions { margin-top: 1.1rem; }
#battery-health { margin-top: .85rem; }
.grading { margin-top: .82rem; padding: .65rem .8rem; border-radius: 8px; background: #edf1fc; color: #2b456f; font-size: .9rem; }
.grading summary { cursor: pointer; font-weight: 700; }
.grading li { margin: .3rem 0; }
.grading p { margin-bottom: .1rem; }
.grading a { color: #1536ae; }
.suggested { display: block; margin-top: .3rem; color: #154b91; font-size: .82rem; overflow-wrap: anywhere; }
#charger-model-status a { color: #1536ae; white-space: nowrap; }
.page-heading { justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .9rem; margin: 1.8rem 0 1.15rem; }
.page-heading .intro { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin-bottom: 1rem; }
.stats button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .28rem;
  text-align: left;
  min-width: 0;
  padding: .87rem 1rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
}
.stats button strong { color: var(--ink); font-size: 1.65rem; line-height: 1.08; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stats button:hover, .stats button[aria-pressed="true"] { color: #1735a6; background: #edf1ff; border-color: #9fb1fc; }
.stats button[aria-pressed="true"] strong { color: #1230bc; }
.inventory-tools { display: grid; grid-template-columns: minmax(210px,1.4fr) repeat(2,minmax(145px,.75fr)) auto; align-items: end; gap: .85rem; margin-bottom: 1rem; }
.devices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .9rem; }
.device { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; }
.device p { margin: 0; overflow-wrap: anywhere; }
.device h2 { overflow-wrap: anywhere; }
.device .device-id { color: var(--muted); font-size: .875rem; font-weight: 650; }
.device .device-open { color: var(--muted); font-size: .875rem; }
.device .pill { margin: 0; }
.device-actions { margin-top: auto; padding-top: .22rem; }
.empty { grid-column: 1 / -1; text-align: center; padding: 2.1rem 1rem; }
.empty p { margin: .65rem 0 1rem; color: var(--muted); }
.sign-in {
  position: relative;
  overflow: hidden;
  width: min(100%, 940px);
  min-height: 370px;
  margin: clamp(1.4rem, 9vh, 5rem) auto 0;
  padding: clamp(1.35rem, 5vw, 3rem);
}
.sign-in::after { inset: 0 0 0 52%; background-position: 78% center; }
.sign-in > :is(h1, p, form) { width: 47%; }
.sign-in h1 { font-size: clamp(2.15rem, 4.4vw, 3.3rem); }
.sign-in p { margin-bottom: 1.3rem; }
.sign-in label, #account-form label { margin-bottom: .86rem; }
.sign-in button { width: 100%; margin-top: .25rem; }
#admin .panel h2 { margin-bottom: .65rem; }
.review { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; overflow-wrap: anywhere; }
.review ul { padding-left: 1.25rem; line-height: 1.65; }
.review .proofs { grid-template-columns: repeat(auto-fill,minmax(90px,1fr)); }
.accounts-panel { grid-column: 1 / -1; }
.account-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; border-top: 1px solid var(--line); padding: .75rem 0; }
.account-row p { margin: .25rem 0 0; color: var(--muted); font-size: .86rem; }
#reset-secret { font: 700 1rem/1.3 monospace; }
dialog { width: min(calc(100% - 1.5rem),540px); max-height: 88dvh; border-color: #b8c8e3; color: var(--ink); padding: 1.45rem; }
dialog::backdrop { background: #0d1834ae; }
dialog p { margin-top: .5rem; color: var(--muted); }
dialog ul { padding-left: 1.35rem; line-height: 1.6; }
dialog .actions { margin-top: 1rem; }
.qr-label { width: fit-content; display: grid; justify-items: center; gap: .2rem; margin: 1rem auto; padding: .5rem .65rem .75rem; border: 1px solid #dce2ed; border-radius: 10px; color: #000; background: #fff; }
.qr-label img { display: block; image-rendering: pixelated; }
.qr-label strong { font-size: 1.1rem; }
@media print {
  body:has(#qr-dialog[open]) { background: white; }
  body:has(#qr-dialog[open]) > :not(#qr-dialog) { display: none !important; }
  #qr-dialog[open] { position: static; display: block; width: auto; max-height: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  #qr-dialog[open]::backdrop { background: transparent; }
  #qr-dialog[open] > :not(.qr-label) { display: none !important; }
  #qr-dialog .qr-label { margin: 0; padding: 2mm; border: 1px solid #777; border-radius: 0; break-inside: avoid; }
  #qr-dialog img { width: 29mm; height: 29mm; }
  #qr-dialog strong { font-size: 12pt; }
}
@media (max-width: 960px) {
  .inventory-tools { grid-template-columns: 1.3fr 1fr; }
  .search-label { grid-column: 1 / -1; }
  .export-tools { grid-column: 1 / -1; }
  .devices { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 730px) {
  .shell { width: calc(100% - 1.5rem); }
  .top-inner { min-height: 64px; }
  .branding { gap: .22rem; align-items: flex-start; flex-direction: column; }
  .brand { font-size: 1.38rem; }
  .brand-label { padding: 0; border: 0; font-size: .78rem; }
  .workspace-nav { margin-block: .8rem; }
  .layout, .management { grid-template-columns: 1fr; }
  .capture-hero::before { left: 12%; background-position: 69% center; }
  .capture-hero::after { background: linear-gradient(90deg,#0e1b40 12%,#0e1b40e8 42%,#0e1b4066); }
  .sign-in { max-width: 440px; min-height: 0; padding-right: clamp(1.35rem,5vw,3rem); }
  .sign-in > :is(h1, p, form) { width: 100%; }
  .sign-in::after { display: none; }
}
@media (max-width: 525px) {
  .account { gap: .38rem; }
  #current-user { font-size: .8rem; }
  .workspace-nav { margin-inline: 0; gap: .1rem; }
  .workspace-nav button { padding-inline: .55rem; font-size: .84rem; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .devices { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
  .inventory-tools { grid-template-columns: 1fr; }
  .inventory-tools .export-tools button { flex: 1 1 auto; }
}
@media (max-width: 375px) {
  .fields { grid-template-columns: 1fr; }
  .capture-hero .actions > * { flex-grow: 1; justify-content: center; }
}

