/* Geräte-CRM – mobile-first, ohne externe Abhängigkeiten */
/* NIMANET Designsystem (Brand Visual Guideline 1.0): Schwarz + Gold #FFB81A als Leitkombination,
   Orange #FF9B19 für Hover, Helvetica. Gold nie als Textfarbe auf Weiß (Druck: Schwarz, Gold nur als Linie/Fläche). */
:root {
  --bg: #000000;
  --surface: #121212;
  --surface-2: #1c1c1c;
  --ink: #ffffff;
  --ink-2: #b3b3b3;
  --ink-3: #8f8f8f;
  --line: #2a2a2a;
  --line-strong: #6e6e6e;
  --brand: #ffb81a;
  --brand-hover: #ff9b19;
  --brand-ink: #000000;
  --brand-soft: rgba(255, 184, 26, .14);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13);
  --warn: #ff7a45; --warn-soft: rgba(255, 122, 69, .14);
  --err: #ff5c5c; --err-soft: rgba(255, 92, 92, .14);
  --nav: #000000; --nav-ink: #b3b3b3; --nav-hover: #141414;
  --radius: 12px;
  --shadow: none;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
/* Druck: Text schwarz, Gold nur als Linie/Tabellenkopf (wie in den Vertragsvorlagen) */
@media print {
  :root {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #fff3d6; --ink: #000000; --ink-2: #4d4d4d; --ink-3: #737373;
    --line: #d9d9d9; --line-strong: #a3a3a3;
    --brand: #000000; --brand-hover: #000000; --brand-ink: #ffffff; --brand-soft: #fff3d6;
    --ok: #166534; --ok-soft: #e7f6ec; --warn: #9a3412; --warn-soft: #ffedd5; --err: #b91c1c; --err-soft: #fdecec;
    color-scheme: light;
  }
}
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.015em; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .2rem 0 .5rem; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; font-weight: 600; }
h2.inline { display: inline; }
code, .code { font-family: var(--mono); font-size: .92em; }
.code.big { font-size: 1.15rem; font-weight: 700; letter-spacing: .03em; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.center { justify-content: center; text-align: center; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: .5rem 1rem; padding-top: max(.5rem, env(safe-area-inset-top)); background: var(--nav); color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); white-space: nowrap; }
/* Bildmarke (Mindestgröße 24 px) statt Lockup – der Lockup braucht laut Guideline mindestens 150 px Breite */
.brand-mark { display: block; height: 26px; width: auto; }
.brand-name { font-size: .95rem; font-weight: 700; letter-spacing: .22em; }
.brand-sub { font-size: .95rem; font-weight: 700; letter-spacing: .22em; color: var(--brand); margin-left: -.2rem; }
@media (max-width: 600px) { .brand-name { display: none; } }

.brand:hover { text-decoration: none; }
.topsearch { flex: 1; max-width: 520px; margin-left: auto; }
.topsearch input { width: 100%; border: 1px solid var(--line-strong); border-radius: 999px; padding-left: 1rem; padding: .5rem .75rem; background: var(--surface-2); color: var(--ink); }
.topsearch input::placeholder { color: var(--ink-3); }
.navtoggle { background: none; border: 0; color: var(--ink); font-size: 1.5rem; padding: .25rem .5rem; cursor: pointer; }

.sidenav {
  display: none; position: fixed; z-index: 25; top: 52px; left: 0; right: 0; bottom: 0; overflow-y: auto;
  background: var(--nav); padding: .5rem 0 2rem;
}
.sidenav.open { display: block; }
.sidenav a { display: block; padding: .8rem 1.25rem; color: var(--nav-ink); font-weight: 500; }
.sidenav a:hover { background: var(--nav-hover); color: var(--ink); text-decoration: none; }
.sidenav a.active { color: var(--brand); background: var(--nav-hover); box-shadow: inset 3px 0 0 var(--brand); font-weight: 700; }
.sidenav .nav-scan { color: var(--nav-ink); }
.sidenav .nav-scan::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-left: .5rem; vertical-align: middle; }
.sidenav .nav-scan.active { color: var(--brand); }
.navfoot { border-top: 1px solid var(--line); margin-top: 1rem; padding: .75rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.navfoot a { padding: 0; }
.navfoot .linkbtn { color: var(--nav-ink); }

.main { padding: 1rem; padding-bottom: 6rem; max-width: 1280px; margin: 0 auto; }
.main-plain { padding: 1rem; }

@media (min-width: 960px) {
  .navtoggle { display: none; }
  .sidenav { display: flex; flex-direction: column; width: 220px; right: auto; top: 52px; border-right: 1px solid var(--line); }
  .navfoot { margin-top: auto; }
  .main { margin-left: 220px; padding: 1.5rem 2rem 4rem; }
  .fab-scan { display: none !important; }
}

.fab-scan {
  position: fixed; z-index: 20; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 16px rgba(255, 184, 26, .25);
}

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 560px; margin: 2rem auto; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--brand); }
.tile h2 { color: var(--brand); }

.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.pagehead h1 { margin-bottom: .35rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }

.grid2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid2 > .card { margin-bottom: 0; }
.grid-main { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 { margin-bottom: 1rem; } }
@media (min-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr) 340px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 40px; padding: .45rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; font-weight: 700; letter-spacing: .04em; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err); color: #000; border-color: var(--err); }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.linkbtn.small { font-size: .8rem; color: var(--ink-2); }
form.inline { display: inline; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; transition: opacity .5s; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--err-soft); color: var(--err); }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
a.pill:hover { text-decoration: none; border-color: var(--brand); }
.pill-red { background: var(--err-soft); color: var(--err); border-color: transparent; }
.pill-amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-blue { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.prio-dringend { background: var(--err-soft); color: var(--err); border-color: transparent; }
.prio-hoch { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.cat { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.cat::before { content: ""; width: .6rem; height: .6rem; border-radius: 3px; background: var(--c, var(--ink-2)); }

.status { display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 700; background: var(--bg); color: var(--ink-2); }
.st-aktiv, .ps-aktiv { background: var(--ok-soft); color: var(--ok); }
.ps-geplant { background: var(--brand-soft); color: var(--brand); }
.st-lager { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.st-reparatur { background: var(--warn-soft); color: var(--warn); }
.st-defekt, .st-verloren, .ps-abgebrochen { background: var(--err-soft); color: var(--err); }

/* Listen & Tabellen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .tablewrap { border: 0; border-radius: 0; margin: 0 -1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table td.code { white-space: nowrap; }
.empty { text-align: center; padding: 2rem 1rem; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.details dt { color: var(--ink-2); font-size: .88rem; }
.details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: .6rem .75rem; margin: .5rem 0 0; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--ink); box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .85rem; }

.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .55rem .9rem; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards .card { margin: 0; }
.projcard h2 { margin: .35rem 0 .2rem; font-size: 1.1rem; }
.projcount { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; min-height: 42px; width: 100%;
}
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; min-height: 0; accent-color: var(--brand); }
input[type=color] { padding: .2rem; height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
label small { font-weight: 400; }
.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.stack { display: grid; gap: .9rem; }
.formgrid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .formgrid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
.formactions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.customfields { border: 1px dashed var(--brand); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 1rem 0; background: var(--brand-soft); }
.customfields legend { font-weight: 700; color: var(--brand); padding: 0 .35rem; }
.inputbtn { display: flex; gap: .4rem; }
.inputbtn input { flex: 1; }
.filters, .searchbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input[type=search], .searchbar input { flex: 1 1 220px; width: auto; }
.filters select { flex: 0 1 auto; width: auto; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form select { flex: 1 1 200px; width: auto; }
.selbar { margin-bottom: .6rem; }
.addbox { margin-bottom: 1rem; }
.addbox > summary { list-style: none; margin-bottom: .75rem; }
.addbox > summary::-webkit-details-marker { display: none; }
.addbox[open] > summary { background: var(--bg); }
details > summary { cursor: pointer; }
.upload { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.upload input { flex: 1 1 180px; width: auto; }

.fieldrows { display: grid; gap: .6rem; margin: .75rem 0; }
.fieldrow { display: grid; gap: .5rem; grid-template-columns: 1fr; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
@media (min-width: 760px) { .fieldrow { grid-template-columns: 2fr 1fr 2fr auto; align-items: end; } }

/* ---------- Gerät ---------- */
.qrcard { text-align: center; }
.qrcard .qr { width: 200px; max-width: 100%; margin: 0 auto .5rem; background: #fff; padding: 10px; border-radius: 8px; }
.qrcard .qr svg, .qrcard .barcode svg { display: block; width: 100%; height: auto; }
.qrcard .barcode { max-width: 240px; margin: .5rem auto; background: #fff; padding: 6px; border-radius: 6px; }
.booking { border-left: 4px solid var(--line); }
.booking.booked { border-left-color: var(--brand); background: linear-gradient(90deg, var(--brand-soft), var(--surface) 60%); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem .75rem; }
.timeline li::before { content: ""; position: absolute; left: -1.42rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--ink-2); border: 2px solid var(--surface); }
.timeline .ev-wartung::before, .timeline .ev-pruefung::before { background: var(--ok); }
.timeline .ev-reparatur::before { background: var(--warn); }
.timeline .ev-buchung::before, .timeline .ev-uebergabe::before { background: var(--brand); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .6rem; }
.file { text-align: center; overflow: hidden; }
.file a { display: flex; flex-direction: column; gap: .25rem; color: var(--ink); }
.file img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.file .fileicon { font-size: 2.2rem; aspect-ratio: 1; display: grid; place-items: center; background: var(--bg); border-radius: 6px; }
.file span.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Scannen ---------- */
.scan-wrap { display: grid; gap: 1rem; grid-template-columns: 1fr; max-width: 1000px; }
.scan-wrap > .card { margin: 0; }
@media (min-width: 900px) { .scan-wrap { grid-template-columns: 1fr 1fr; } }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 1rem; }
.segmented label { display: block; margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: .6rem .3rem; border-radius: 8px; font-size: .85rem; cursor: pointer; line-height: 1.2; }
.segmented input:checked + span { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }
.project-select { margin-bottom: 1rem; }
.scan-input { display: flex; gap: .5rem; }
.scan-input input { font-family: var(--mono); font-size: 1.15rem; min-height: 52px; }
.scan-input .btn { min-height: 52px; }
.hint { color: var(--ink-2); font-size: .85rem; }
.reader { margin-top: .75rem; border-radius: 10px; overflow: hidden; background: #000; }
.reader video { width: 100% !important; display: block; }
.scan-result:empty { display: none; }
.res { border-radius: 10px; padding: .9rem 1rem; margin-bottom: .75rem; font-weight: 600; }
.res-ok { background: var(--ok-soft); color: var(--ok); }
.res-warn { background: var(--warn-soft); color: var(--warn); }
.res-err { background: var(--err-soft); color: var(--err); }
.res .btn { margin-top: .5rem; }
.scan-log { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.scan-log li { padding: .5rem .25rem; border-bottom: 1px solid var(--line); font-size: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.scan-log li.ok { border-left: 3px solid var(--ok); padding-left: .5rem; }
.scan-log li.warn { border-left: 3px solid var(--warn); padding-left: .5rem; }
.scan-log li.err { border-left: 3px solid var(--err); padding-left: .5rem; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 1rem; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 1rem; width: min(480px, 100%); }

/* ---------- Verkauf (Board) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: 1rem; -webkit-overflow-scrolling: touch; }
.board-col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-height: 200px; }
.board-col > header, .board-col > h2, .board-col > .row-between { margin-bottom: .5rem; }
.card.deal { padding: .7rem; margin-bottom: .5rem; }
.card.deal select { min-height: 34px; padding: .25rem .5rem; font-size: .85rem; margin-top: .4rem; }

/* ---------- Login ---------- */
.auth { max-width: 380px; margin: 8vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.5rem; box-shadow: var(--shadow); text-align: center; }
.auth form { text-align: left; margin-top: 1.25rem; }
.auth-logo { display: block; width: 220px; max-width: 80%; height: auto; margin: .5rem auto 1rem; }

/* ---------- Druck (Packliste) ---------- */
.print-table td.box { width: 3.5rem; }
.print-table td.box::before { content: ""; display: inline-block; width: 1rem; height: 1rem; border: 1.5px solid currentColor; border-radius: 3px; }
@media print {
  .topbar, .sidenav, .fab-scan, .noprint, .flash { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .table th { background: #eee; }
}
.ts-offen { background: var(--brand-soft); color: var(--brand); }
.ts-in_arbeit { background: var(--warn-soft); color: var(--warn); }
.ts-wartet { background: var(--bg); color: var(--ink-2); }
.ts-erledigt { background: var(--ok-soft); color: var(--ok); }
.ps-abgeschlossen { background: var(--bg); color: var(--ink-2); }
.scan-log li.res-ok, .scan-log li.res-warn, .scan-log li.res-err { background: none; color: inherit; border-left: 3px solid var(--ok); padding-left: .5rem; }
.scan-log li.res-warn { border-left-color: var(--warn); }
.scan-log li.res-err { border-left-color: var(--err); }
.log-time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.log-code { font-family: var(--mono); font-weight: 700; }
.log-msg { color: var(--ink-2); width: 100%; }
.res-title { font-size: 1.1rem; }
.res-meta { font-family: var(--mono); font-weight: 500; opacity: .85; }
.res-msg { font-weight: 500; }
.upload input[type=file] { min-width: 0; max-width: 100%; flex: 1 1 100%; }
.printform { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.printform select { flex: 1 1 140px; width: auto; }
.printform.center { justify-content: center; }
.printnow { margin-top: 1rem; max-width: 420px; }
.tokenbox { border: 2px solid var(--brand); }
.tokenbox code.copy { user-select: all; word-break: break-all; }

/* === Lexware === */
.lx-gap { margin-top: 1rem; }
.lx-nowrap { white-space: nowrap; }
.lx-nowrap form.inline { margin-right: .25rem; }
.lx-badge { font-size: .7rem; vertical-align: middle; }
.lx-box .actions { margin-bottom: .25rem; }

/* === Reservierungen & Koffer === */
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.bulkbar { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.bulkbar .priceinput { width: 7rem; }
.kitcheck { align-self: end; }
.kitpill { font-size: .72rem; }
.kitparent { margin-top: .4rem; font-size: .9rem; color: var(--ink-2); }
.kitadd, .resadd { margin-bottom: .9rem; align-items: center; }
.kitadd .inputbtn, .resadd .inputbtn { flex: 1 1 260px; }
.kitadd input, .resadd input[name=code] { font-family: var(--mono); }
.resprogress { margin-bottom: .9rem; }
.progressbar { height: .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: .35rem; }
.progressbar span { display: block; height: 100%; background: var(--ok); }
.table tr.res-konflikt td { background: var(--err-soft); }
.table tr.res-gepackt td { color: var(--ink-2); }

/* === Offline & Inventur === */
.offline-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.25rem 0 .9rem; padding: .45rem .7rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: .85rem; }
.offline-banner[hidden], .offline-banner [hidden] { display: none !important; }
.offline-banner.is-offline, .offline-banner.has-pending { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.offline-banner .offline-count { font-weight: 600; flex: 1 1 auto; }
.offline-banner .offline-count:empty { display: none; }
.offline-banner .btn { min-height: 32px; padding: .2rem .7rem; }
.net-indicator { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--ok); }
.net-indicator::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.net-indicator.off { color: var(--warn); }
.res-pending { background: var(--bg); color: var(--ink-2); border: 1px dashed var(--warn); }
.scan-log li.res-pending { background: none; color: var(--ink-2); border: 0; border-left: 3px dashed var(--warn); padding-left: .5rem; }
.res-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.res-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-small { min-height: 32px; padding: .2rem .6rem; font-size: .82rem; }
.progress { height: 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: .4rem 0 .6rem; }
.progress > span { display: block; height: 100%; background: var(--ok); transition: width .3s ease; }
.inv-progress { margin-bottom: .9rem; }
.inv-summary { display: flex; flex-wrap: wrap; gap: .4rem; }
.inv-summary .pill { font-size: .85rem; }

/* === Planer & Mietliste === */
.planner-dictate { display: flex; gap: .5rem; align-items: stretch; margin-top: .3rem; }
.planner-dictate textarea { flex: 1; min-height: 8rem; font-size: 1.05rem; }
.planner-mic { flex: 0 0 auto; flex-direction: column; min-width: 84px; gap: .2rem; }
.planner-mic.is-listening { background: var(--err); border-color: var(--err); color: var(--brand-ink); animation: planner-pulse 1.4s ease-in-out infinite; }
@keyframes planner-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, .45); } 50% { box-shadow: 0 0 0 8px rgba(255, 92, 92, 0); } }
@media (prefers-reduced-motion: reduce) { .planner-mic.is-listening { animation: none; } }
.planner-interim { min-height: 1.2em; color: var(--ink-2); font-style: italic; margin: .35rem 0 0; }
.planner-target { margin-top: .75rem; align-items: end; }
.planner-go { display: flex; align-items: flex-end; }
.planner-warnings { display: grid; gap: .4rem; margin-bottom: .75rem; }
.planner-warn { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: .5rem .75rem; font-weight: 500; }
.planner-lines { display: grid; gap: .6rem; margin-bottom: 1rem; }
.planner-line { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: .65rem .75rem; background: var(--surface); }
.planner-line.is-short { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), var(--surface) 55%); }
.planner-line.is-unmatched { border-left-color: var(--err); background: linear-gradient(90deg, var(--err-soft), var(--surface) 55%); }
.planner-line-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .45rem; }
.planner-line-head .linkbtn { margin-left: auto; }
.planner-query { font-weight: 600; }
.planner-line-body { display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .planner-line-body { grid-template-columns: minmax(0, 1fr) 110px; align-items: end; } }
.planner-pick { display: grid; gap: .35rem; }
.planner-search { min-height: 34px; padding: .3rem .6rem; font-size: .88rem; }
.planner-qtylabel { font-size: .8rem; }
.planner-info { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .45rem; font-size: .9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.planner-info b { color: var(--ink); margin-left: auto; }
.planner-linewarn:empty { display: none; }
.planner-linewarn { margin-top: .35rem; font-size: .88rem; font-weight: 600; color: var(--warn); }
.planner-line.is-unmatched .planner-linewarn { color: var(--err); }
.planner-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.planner-totals div { background: var(--bg); border-radius: 8px; padding: .5rem .75rem; }
.planner-totals span { display: block; font-size: .8rem; color: var(--ink-2); }
.planner-totals b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.mietliste-table .num, .mietliste-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mietliste-table tr.ml-included td { color: var(--ink-2); }
.ml-sums dd { text-align: right; font-variant-numeric: tabular-nums; }
.ml-sums .ml-strong { font-weight: 700; color: var(--ink); }
.ml-sums .ml-gross { border-top: 2px solid var(--ink); padding-top: .3rem; font-size: 1.1rem; }
.ml-lexware { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.printonly { display: none; }
@media print {
  .printonly { display: block; }
  .mietliste .card { box-shadow: none; border: 0; padding: 0; }
  .mietliste .grid2 { display: block; }
  .mietliste .ml-summary { max-width: 320px; margin-left: auto; }
  .mietliste .table td, .mietliste .table th { padding: .3rem .4rem; }
  .mietliste .card .tablewrap { margin: 0; overflow: visible; }
  .mietliste a { color: inherit; }
}

/* === Gerätefoto === */
.devphoto-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.devphoto { display: flex; flex-direction: column; gap: .35rem; width: 160px; }
.devphoto-main { display: block; width: 160px; height: 160px; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: zoom-in; }
.devphoto-empty { width: 160px; height: 110px; display: grid; place-items: center; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); font-size: .85rem; }
.devphoto-upload { display: flex; flex-wrap: wrap; gap: .25rem; }
.devphoto-upload .btn { min-height: 32px; padding: .25rem .5rem; font-size: .82rem; }
.devphoto-cam { position: relative; cursor: pointer; }
.devphoto-cam input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.devphoto-cam:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.devphoto-status { margin: 0; color: var(--ink-2); }
.is-busy { opacity: .6; pointer-events: none; }
@media (max-width: 560px) { .devphoto, .devphoto-main { width: 120px; } .devphoto-main { height: 120px; } .devphoto-empty { width: 120px; height: 80px; } }

td.devname { min-width: 12rem; }
.devthumb-link { float: left; margin-right: .55rem; }
.devthumb { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }

.photofield { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin: 1rem 0; }
.photofield legend { font-weight: 600; padding: 0 .35rem; }
.photofield-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.photofield-ctrl { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1 1 14rem; }
.photofield-ctrl small { flex-basis: 100%; }
.photofield-preview img { display: block; width: 140px; height: 140px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.photofield .flash { margin: .75rem 0 0; }

.photosearch { margin-top: .75rem; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.phototile { display: flex; flex-direction: column; gap: .2rem; text-align: center; min-width: 0; }
.phototile button { padding: 0; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; overflow: hidden; }
.phototile button:hover, .phototile button:focus-visible { border-color: var(--brand); }
.phototile.is-selected button { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.phototile img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.phototile a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photonote { margin: .6rem 0 0; }
.file form .pill.small { font-size: .7rem; }

/* === NIMANET: Feinschliff === */
.auth h1 { font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); margin: 0 0 .25rem; }
.btn { transition: border-color .15s, background-color .15s, filter .15s; }
::placeholder { color: var(--ink-3); }
select option { background: var(--surface-2); color: var(--ink); }
.reader { border: 1px solid var(--line); }
@media print { .topbar { border: 0; } }

/* === Review: Ränder, Status, Hierarchie, Touch, Fokus, Druck === */
input, select, textarea, .segmented, .btn, .pill, .progress, .progressbar { border-color: var(--line-strong); }
.btn-primary, .btn-ghost { border-color: transparent; }
.btn-primary { border-color: var(--brand); }
.btn-danger { border-color: var(--err); }
.status::before { content: ""; display: inline-block; width: .45em; height: .45em; border-radius: 50%; background: currentColor; margin-right: .35em; vertical-align: .1em; }
/* Lime sparsam: Tabellen-/Listenlinks und Kachel-Titel neutral, Lime erst beim Hover */
.table td a:not(.btn):not(.pill):not(.tag-inline), .list a:not(.btn):not(.pill):not(.tag-inline), a.card h2, .tile h2 { color: var(--ink); }
.table td a:not(.btn):not(.pill):not(.tag-inline):hover, .list a:not(.btn):not(.pill):not(.tag-inline):hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
a.card:hover h2 { color: var(--brand); }
.table td.code, .table td.code a:not(.btn) { color: var(--ink-2); }
/* Touch-Ziele für Handy/MDE */
.linkbtn, .navfoot a { display: inline-flex; align-items: center; min-height: 44px; }
.navtoggle { min-width: 44px; min-height: 44px; }
@media (pointer: coarse) {
  .btn, .btn-small, .offline-banner .btn, .devphoto-upload .btn, select, .planner-search, .card.deal select { min-height: 44px; }
}
/* Fokus */
:focus-visible { outline-offset: 3px; }
.sidenav a:focus-visible, .tabs a:focus-visible { outline-offset: -2px; }
.btn-primary:focus-visible, .fab-scan:focus-visible, .segmented input:checked:focus-visible + span { outline-color: var(--ink); outline-offset: 3px; }
/* Datei-Auswahl im Dunkel-Look */
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: .4rem .8rem; margin-right: .6rem; cursor: pointer; }
@media print {
  .btn, .linkbtn, .upload, .devphoto-upload, .formactions, .inputbtn, details.addbox, .printform, .photosearch { display: none !important; }
  input, select, textarea, .btn, .pill { border-color: var(--line); }
}

/* Abschnitts-Labels wie im Designsystem („LEISTUNGEN“) */
.label, .stat span { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.stat b { color: var(--ink); }
a.stat:hover b { color: var(--brand); }
.segmented, .segmented span { border-radius: 999px; }
@media print {
  .table th { background: #ffb81a; color: #000; }
}

/* === Belege === */
.beleg-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .beleg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .beleg-file { position: sticky; top: 64px; } }
.beleg-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.beleg-img { display: block; max-width: 100%; height: auto; border-radius: 8px; background: #fff; }
.checks { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .4rem; }
.checks li { padding: .5rem .75rem; border-radius: 8px; border-left: 4px solid var(--line-strong); background: var(--surface-2); }
.checks .check-fehler { border-left-color: var(--err); background: var(--err-soft); }
.checks .check-warnung { border-left-color: var(--warn); background: var(--warn-soft); }
.checks .check-hinweis { border-left-color: var(--line-strong); }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.beleg-items-title { margin: 1.1rem 0 .5rem; }
.beleg-items { display: grid; gap: .6rem; }
.beleg-item { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.beleg-item .span2 { grid-column: span 2; }
@media (min-width: 760px) { .beleg-item { grid-template-columns: 1.2fr .8fr 1fr 2fr; } .beleg-item .span2 { grid-column: auto; } }
.bs-neu { background: var(--surface-2); color: var(--ink); }
.bs-ausgelesen { background: var(--brand-soft); color: var(--brand); }
.bs-fehler { background: var(--err-soft); color: var(--err); }
.bs-gebucht { background: var(--ok-soft); color: var(--ok); }
.bs-ignoriert { background: var(--surface-2); color: var(--ink-2); }
.label a { color: inherit; }
.beleg-desc { margin-top: .9rem; }
.mono-area { font-family: var(--mono); font-size: .85rem; line-height: 1.5; }

.qty-row { margin-bottom: 1rem; display: grid; gap: .35rem; }
.qty-row > label { font-weight: 600; font-size: .88rem; }
.qty-ctrl { display: flex; gap: .4rem; }
.qty-ctrl input { width: 6rem; text-align: center; font-size: 1.1rem; font-weight: 700; }
.qty-ctrl .btn { min-width: 44px; }

/* === Bestand: Standort, Kacheln, Auslastung === */
.where { font-size: .82rem; font-weight: 600; color: var(--ok); }
.where-projekt { color: var(--brand); }
.where-kunde, .where-koffer { color: var(--ink-2); }
.where-defekt, .where-verloren { color: var(--err); }
.where-reparatur { color: var(--warn); }
.where-ausgemustert { color: var(--ink-3); }
.pagehead .where { display: inline-block; margin-left: .5rem; }
.segtoggle { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.segtoggle a { padding: .45rem .9rem; color: var(--ink-2); font-weight: 700; font-size: .85rem; }
.segtoggle a.on { background: var(--brand); color: var(--brand-ink); }
.segtoggle a:hover { text-decoration: none; color: var(--ink); }
.segtoggle a.on:hover { color: var(--brand-ink); }
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile-dev { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tile-dev:hover { border-color: var(--brand); }
.tile-img { display: block; height: 170px; overflow: hidden; background: #fff; }
.tile-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.noimg { display: block; width: 100%; height: 100%; min-height: 80px; background: var(--surface-2) url("/static/brand/zeichen-gelb.svg") center / 34px no-repeat; opacity: .5; }
.tile-body { padding: .6rem .7rem .75rem; display: grid; gap: .2rem; }
.tile-body a { color: var(--ink); }
.tile-price { font-weight: 700; margin-top: .2rem; }
.tile-sel { position: absolute; top: .4rem; left: .4rem; z-index: 1; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: .2rem; }
.stock { margin-bottom: 1.25rem; }
.stockcard { display: grid; grid-template-columns: 84px 1fr; gap: .75rem; align-items: start; color: var(--ink); }
.stockcard img, .stockcard .noimg { width: 84px; height: 84px; object-fit: contain; background-color: #fff; border-radius: 8px; }
.stocknum { margin-top: .35rem; }
.stocknum b { color: var(--brand); font-size: 1.15rem; }
.where-list { list-style: none; margin: .2rem 0 0; padding: 0; font-size: .82rem; color: var(--ink-2); }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.usage b { display: block; font-size: 1.35rem; }
.usage span { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
@media print { .tiles { grid-template-columns: repeat(4, 1fr); } .segtoggle { display: none; } }

.regroup { margin-top: -.2rem; }
.regroup select { width: auto; min-width: 12rem; }
.regroup .priceinput { width: 11rem; }

/* === Inventar wie ein Onlineshop: Ordner-Navigation, Bereichs-Kacheln === */
.shop { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .shop { grid-template-columns: 250px minmax(0, 1fr); align-items: start; } .shop-nav { position: sticky; top: 72px; } }
.shop-nav-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; }
.shop-nav-box > summary { list-style: none; cursor: pointer; padding: .4rem .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.shop-nav-box > summary::-webkit-details-marker { display: none; }
@media (min-width: 1100px) { .shop-nav-box > summary { pointer-events: none; } }
.shop-nav ul { list-style: none; margin: 0; padding: 0; }
.shop-nav ul ul { margin: .1rem 0 .4rem .9rem; border-left: 1px solid var(--line); padding-left: .4rem; }
.shop-nav a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .6rem; border-radius: 8px; color: var(--ink); font-size: .92rem; }
.shop-nav a:hover { background: var(--surface-2); text-decoration: none; }
.shop-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.shop-nav a span:last-child { color: var(--ink-3); font-size: .8rem; font-weight: 400; }
.shop-nav a.area { font-weight: 600; }
.crumbs a { color: inherit; }
.shop-stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .shop-stats { grid-template-columns: repeat(4, 1fr); } }
.area-tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.5rem; }
.area-tile { display: grid; grid-template-rows: 150px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); }
.area-tile:hover { border-color: var(--brand); text-decoration: none; }
.area-img { display: grid; place-items: center; background: #fff; overflow: hidden; }
.area-img img { width: 100%; height: 100%; object-fit: contain; }
.area-icon { font-size: 3rem; }
.area-body { display: grid; gap: .25rem; padding: .75rem .9rem .9rem; }
.area-body b { font-size: 1.05rem; }
.area-num { font-size: .82rem; color: var(--brand); font-weight: 600; }
.shop-sub { margin: .25rem 0 .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { padding: .4rem .8rem; border: 1.5px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-size: .88rem; font-weight: 600; }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip span { color: var(--ink-3); font-weight: 400; margin-left: .2rem; }
@media print { .shop { display: block; } }

/* Review 2 */
.inline-form > * { min-width: 0; }
@media (max-width: 600px) { .inline-form { flex-direction: column; align-items: stretch; } .inline-form select, .inline-form input, .inline-form .btn { width: 100%; } .main { overflow-x: hidden; } }

/* Etikett-Plakette auf Fotos (wie der Aufkleber am Gerät) */
.tile-img { position: relative; }
.tag-label { position: absolute; left: .45rem; bottom: .45rem; background: #fff; color: #000; border: 1.5px solid #000; border-left: 6px solid var(--brand);
  border-radius: 4px; padding: .1rem .4rem; font: 700 .72rem/1.3 var(--mono); letter-spacing: .02em; box-shadow: 0 1px 3px rgba(0,0,0,.4); white-space: nowrap; }
.photo-tag { position: relative; display: inline-block; }
.tag-label-big { font-size: .8rem; }
@media print { .tag-label { box-shadow: none; } }

.set-incl { color: var(--ink-2); }
.table tr.set-sum td { border-top: 2px solid var(--line-strong); }
.table tr.set-main td { background: var(--surface-2); }
/* Stammartikel */
.article-head { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .article-head { grid-template-columns: 220px 1fr; align-items: center; } .article-head > p { grid-column: span 2; } }
.article-img { height: 200px; background: #fff; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.article-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tag-inline { display: inline-block; background: #fff; color: #000; border: 1.5px solid #000; border-left: 6px solid var(--brand); border-radius: 4px; padding: .05rem .4rem; font: 700 .8rem/1.4 var(--mono); }
.tag-inline:hover { text-decoration: none; filter: brightness(.92); }

/* Angebot: Leistungen */
.svc-add { margin-top: 16px; display: grid; gap: 12px; }
.svc-grid { display: grid; grid-template-columns: 1fr 90px 120px 130px; gap: 10px; }
@media (max-width: 720px) { .svc-grid { grid-template-columns: 1fr 1fr; } .svc-grid .svc-name { grid-column: 1 / -1; } }
.svc-actions { display: inline-flex; gap: 6px; align-items: center; }
.table tr.svc-text td { background: var(--surface-2); }
.pre { white-space: pre-line; }
.mt { margin-top: 20px; }

/* Handy: Inline-Formulare untereinander, ohne dass flex-basis die Höhe aufbläht */
@media (max-width: 600px) {
  .inline-form > *, .inline-form select, .kitadd .inputbtn, .resadd .inputbtn { flex: 0 0 auto; }
  .packliste-table th.pl-cat, .packliste-table td.pl-cat { display: none; }
  .packliste-table td.code { white-space: nowrap; font-size: 12px; }
}
/* Scan: großes farbiges Feedback über den ganzen Bildschirm */
.scanflash { position: fixed; inset: 0; z-index: 9999; pointer-events: none; display: grid; place-items: center; padding: 24px;
  font: 700 clamp(22px, 7vw, 40px)/1.15 var(--font, Helvetica, Arial, sans-serif); text-align: center; color: #000; opacity: 0; transition: opacity .15s; }
.scanflash.on { opacity: .94; }
.scanflash.ok { background: #3ddc84; } .scanflash.warn { background: #ffb81a; } .scanflash.err { background: #ff4d4d; color: #fff; } .scanflash.info { background: #8ab4ff; }
.res-undo { margin-left: auto; }

.allback { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* Startseite: Heute */
.today { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1.25rem; }
@media (max-width: 1000px) { .today { grid-template-columns: minmax(0, 1fr); } }
.today-col h2 { font-size: 1rem; margin: 0 0 .6rem; }
.today-card { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; margin-bottom: .6rem; }
.today-card .btn { min-height: 44px; white-space: nowrap; }
.today-card.is-overdue { border-color: #ff4d4d; }
/* Scanner: Projektstand */
.stand { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.stand h3 { font-size: .95rem; margin: 0 0 .4rem; }
.stand ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.stand li { display: flex; justify-content: space-between; gap: .5rem; }
.stand .done { color: #3ddc84; font-weight: 700; }
@media (pointer: coarse) { .hide-touch { display: none; } }
/* Defekt */
.defekt-card { margin-bottom: 1rem; }
.defekt-card summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.defekt-card.is-broken { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; border-color: #ff4d4d; }
.defekt-card.is-broken input { flex: 1 1 220px; }
/* Vorschläge */
.sugg-wrap { position: relative; }
.sugg { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45); max-height: 60vh; overflow: auto; padding: 4px; }
.sugg button { display: flex; width: 100%; gap: .7rem; align-items: center; text-align: left; background: none; border: 0; color: var(--ink); padding: .45rem .55rem; border-radius: 8px; min-height: 48px; cursor: pointer; font: inherit; }
.sugg button[aria-selected="true"], .sugg button:hover { background: var(--surface-2); }
.sugg img, .sugg .noimg { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.sugg .s-name { font-weight: 600; } .sugg .s-hint { font-size: .8rem; color: var(--ink-2); }
.sugg .s-none { color: #ff8080; }

.flugcheck { margin: .8rem 0; }
.flugcheck h2 { font-size: 1rem; }
.flugcheck.fc-warn { border-color: var(--brand); }
.flugcheck.fc-bad { border-color: #ff4d4d; }
.wh-form { display: inline-flex; gap: .4rem; justify-content: flex-end; }
.wh-form input { width: 90px; }
.cardstate { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-left: .3rem; }

.subnav { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.25rem 0 1rem; }
.subnav a { border: 1px solid var(--line-strong); border-radius: 999px; padding: .4rem .9rem; color: var(--ink); font-size: .9rem; min-height: 36px; display: inline-flex; align-items: center; }
.subnav a:hover { border-color: var(--brand); color: var(--brand); }
.pilot-row, .drone-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.drone-row .svc-grid { flex: 1 1 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .drone-row .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pflicht a { color: var(--ink); }

/* Handy: Eingabe + Scan-Knopf nebeneinander, Feld breit */
@media (max-width: 600px) {
  .inputbtn { display: flex !important; gap: .4rem; width: 100%; }
  .inputbtn input { flex: 1 1 auto !important; min-width: 0; width: auto !important; }
  .inline-form .inputbtn .btn, .inputbtn .btn { flex: 0 0 auto !important; width: auto !important; }
  /* Angebot: Posten als Karten */
  .svc-table thead { display: none; }
  .svc-table, .svc-table tbody, .svc-table tr, .svc-table td { display: block; width: 100%; }
  .svc-table tr { border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .svc-table td { border: 0 !important; padding: .1rem 0 !important; text-align: left !important; }
  .svc-table td.num:empty { display: none; }
  .svc-table td.num { display: inline-block; width: auto; margin-right: .5rem; }
  .svc-table td.num:nth-child(3)::before { content: 'à '; color: var(--ink-2); }
  .svc-table td.num:nth-child(4)::before { content: '= '; color: var(--ink-2); }
  .svc-table td.noprint { display: block; }
  .svc-actions .linkbtn, .svc-actions button { min-width: 44px; min-height: 44px; }
  .main { padding-bottom: 96px; } /* Platz für den Scan-Knopf */
}
.svc-actions button[value=up], .svc-actions button[value=down] { min-width: 36px; min-height: 36px; font-size: 1.1rem; }
.stand b { white-space: nowrap; }
.defekt-inline { display: flex; gap: .5rem; width: 100%; } .defekt-inline input { flex: 1 1 auto; min-width: 0; }
