  /* =====================================================================
     INVENTAR (inv-) — Inventarliste, Bearbeiten-Formular, QR-Drucklayout
     ===================================================================== */
  .inv-root { display: flex; flex-direction: column; gap: 0; }

  /* ---- Toolbar / Suche ---- */
  .inv-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .inv-search {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 9px 14px; max-width: 520px;
  }
  .inv-search input { flex: 1; border: none; outline: none; background: none; font-size: 14px; color: var(--text); }
  .inv-search .icon { width: 16px; height: 16px; color: var(--text-muted); }
  .inv-inaktiv-toggle { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
  .inv-switch { position: relative; width: 40px; height: 22px; }
  .inv-switch input { opacity: 0; width: 0; height: 0; }
  .inv-switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .15s; cursor: pointer; }
  .inv-switch .track::before { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: var(--shadow-sm); }
  .inv-switch input:checked + .track { background: var(--brand); }
  .inv-switch input:checked + .track::before { transform: translateX(18px); }

  /* ---- Typ-Filter Checkboxen ---- */
  .inv-typefilter { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
  .inv-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
  .inv-check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

  /* ---- Listen-Tabelle ---- */
  .inv-list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-y: auto; overflow-x: hidden; max-height: calc(100vh - 320px); min-height: 180px; }
  table.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  table.inv-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  table.inv-table tr:last-child td { border-bottom: none; }
  table.inv-table tr.inv-row { cursor: pointer; }
  table.inv-table tr.inv-row:hover { background: var(--brand-soft); }
  table.inv-table tr.inv-row.inaktiv { opacity: 0.5; }
  .inv-nr {
    display: inline-block; min-width: 64px; text-align: center;
    font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px;
    padding: 4px 9px; border-radius: var(--radius-sm);
    background: #eef1f4; color: var(--text-muted);
  }
  .inv-nr.t-anlage   { background: #d6e4f0; color: #2a567e; }
  .inv-nr.t-fahrzeug { background: #fce4d6; color: #b05a2a; }
  .inv-nr.t-geraet   { background: #c6e0b4; color: #3f6b2a; }
  .inv-bezcell .bez { font-weight: 600; color: var(--text); }
  .inv-bezcell .bez .schaden { color: #c0392b; font-weight: 600; }
  .inv-bezcell .sub { color: var(--text-muted); font-size: 12px; margin-top: 1px; }
  .inv-typebadge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
  .inv-typebadge.anlage   { background: #d6e4f0; color: #2a567e; }
  .inv-typebadge.fahrzeug { background: #fce4d6; color: #b05a2a; }
  .inv-typebadge.geraet   { background: #c6e0b4; color: #3f6b2a; }
  .inv-pruef { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #7a6516; background: #fbf0bf; border-radius: 6px; padding: 2px 8px; margin-left: 6px; }
  .inv-actions { display: flex; gap: 4px; justify-content: flex-end; }
  .inv-actions .act { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: var(--text-dim); border: none; background: none; }
  .inv-actions .act:hover { background: var(--bg); color: var(--brand-dark); }
  .inv-actions .act svg { width: 15px; height: 15px; }
  .inv-check-cell input { width: 16px; height: 16px; accent-color: var(--brand); }

  /* ---- Footer-Leiste ---- */
  .inv-footer { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 16px; background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
  .inv-footer .ver { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .inv-footer .lnk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brand-dark); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 11px; }
  .inv-footer .lnk:hover { background: var(--bg); }
  .inv-footer .lnk .icon { width: 14px; height: 14px; }
  .inv-footer .count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand-dark); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 12px; }
  .inv-footer .adminmode { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }

  /* ---- Detail / Bearbeiten-Formular ---- */
  .inv-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
  .inv-back { display: inline-flex; align-items: center; gap: 6px; }
  .inv-banner { display: flex; align-items: center; gap: 16px; background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 20px; }
  .inv-banner .bn-nr { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
  .inv-banner .bn-title { font-weight: 700; font-size: 18px; }

  .inv-form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
  .inv-field { display: flex; flex-direction: column; gap: 6px; }
  .inv-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
  .inv-field input, .inv-field select {
    padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
    font-size: 14px; background: var(--surface); color: var(--text); font-family: inherit; width: 100%;
  }
  .inv-row2 { display: flex; gap: 16px; }
  .inv-row2 > * { flex: 1; }
  .inv-typeradio { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 4px 0; }
  .inv-radio { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
  .inv-radio input { width: 16px; height: 16px; accent-color: var(--brand); }
  .inv-url { display: flex; gap: 8px; align-items: stretch; }
  .inv-url input { flex: 1; }
  .inv-url .iconbtn { width: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text-muted); }
  .inv-url .iconbtn:hover { background: var(--bg); color: var(--brand-dark); }
  .inv-url .iconbtn svg { width: 16px; height: 16px; }
  .inv-form-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
  .btn.inv-solid-danger { background: #d64545; border-color: #d64545; color: #fff; }
  .btn.inv-solid-danger:hover { background: #b83838; border-color: #b83838; }
  .inv-perma-box { background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
  .inv-perma-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 10px; }
  .inv-perma-head span { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
  .inv-perma-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .inv-perma-row .tag { flex: 0 0 130px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
  .inv-perma-row a { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; color: var(--brand-dark); text-decoration: none; word-break: break-all; }
  .inv-perma-row a:hover { text-decoration: underline; }
  .inv-perma-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }
  .inv-perma-note code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

  /* ---- QR-Drucklayout ---- */
  .inv-qr-sheet { background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 28px 32px; max-width: 760px; margin-bottom: 18px; position: relative; box-shadow: var(--shadow-md); }
  .inv-qr-mail { position: absolute; top: 14px; right: 18px; font-size: 12px; color: var(--text-muted); }
  .inv-qr-name { text-align: center; font-size: 17px; font-weight: 600; margin-bottom: 14px; }
  .inv-qr-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 2px dashed var(--border-strong); border-radius: 8px; padding: 18px 22px; }
  .inv-qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
  .inv-qr-code { width: 120px; height: 120px; background: #fff; display: flex; align-items: center; justify-content: center; }
  .inv-qr-code svg, .inv-qr-code img { width: 100%; height: 100%; display: block; }
  .inv-qr-code.loading { background:
      repeating-linear-gradient(45deg, #e7edf1 0 6px, #f4f7f9 6px 12px); border-radius: 4px; }
  .inv-qr-cap { font-size: 10px; color: var(--text-muted); text-align: center; max-width: 150px; line-height: 1.3; }
  .inv-qr-center { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
  .inv-qr-center img { width: 96px; height: auto; }
  .inv-qr-center .bignr { font-size: 34px; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
  .inv-qr-perma { font-size: 10px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--brand-dark); text-decoration: none; word-break: break-all; max-width: 150px; text-align: center; }
  .inv-qr-perma:hover { text-decoration: underline; }
  .inv-qr-info { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; font-size: 13px; color: var(--text-muted); margin-top: 18px; max-width: 760px; line-height: 1.5; }
  .inv-qr-info b { color: var(--text); }
  .inv-qr-info code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

  /* ---- Live-Banner + Lade-/Fehler-Zustände (LIVE-Pattern §3) ---- */
  .inv-banner-live { display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin-bottom: 14px; background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
  .inv-live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
  .inv-live-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
  .inv-live-pill.on { background: rgba(22,163,74,0.12); color: #15803d; }
  .inv-live-pill.on .dot { background: #16a34a; }
  .inv-live-pill.mock { background: rgba(120,120,120,0.15); color: var(--text-muted); }
  .inv-live-pill.mock .dot { background: var(--text-muted); }
  .inv-live-text { color: var(--text-muted); }
  .inv-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 60px 20px; color: var(--text-muted); text-align: center; }
  .inv-spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: inv-spin 0.8s linear infinite; }
  @keyframes inv-spin { to { transform: rotate(360deg); } }

  /* ---- Zwei-Tabellen-Liste: Nummern + aufklappbare Geräte ---- */
  .inv-nr-row { cursor: pointer; }
  .inv-nr-row .inv-nr { font-weight: 700; }
  .inv-dev-row { background: var(--bg); }
  .inv-dev-row:hover { background: var(--brand-soft); }
  .inv-dev-bez { padding-left: 8px; border-left: 2px solid var(--brand); }
  .inv-sub-meta { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--text-muted); }
  .inv-sub-head { display: flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 13px; font-weight: 700; color: var(--brand-dark); }

  /* ---- Geführter Neu-Flow ---- */
  .inv-step { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: var(--text); margin: 4px 0 10px; }
  .inv-step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; }
  .inv-modeswitch { display: flex; gap: 18px; margin-bottom: 14px; padding: 10px 14px; background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius); }
  .inv-orphan-row { background: #fff7ed; }
  .inv-orphan-row .inv-nr { color: #b45309; }
  .inv-ba-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .inv-ba-have { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #15803d; }

  /* ---- Druck: nur das QR-Etikett, massgenau (Höhe 65 mm, Breite 210 mm) ---- */
  @media print {
    @page { size: A4 portrait; margin: 10mm; }
    body * { visibility: hidden; }
    .inv-qr-sheet, .inv-qr-sheet * { visibility: visible; }
    .inv-detail-head, .inv-qr-info { display: none !important; }
    .inv-qr-sheet { position: absolute; left: 0; top: 0; width: 210mm; margin: 0; padding: 6mm 8mm;
      border: none; border-radius: 0; box-shadow: none; max-width: none; }
    .inv-qr-strip { height: 65mm; border: 1.5px dashed #1a232e; gap: 10mm; padding: 4mm 8mm; }
    .inv-qr-code { width: 45mm; height: 45mm; }
    .inv-qr-center img { width: 38mm; }
    .inv-qr-center .bignr { font-size: 30pt; }
    .inv-qr-cap { font-size: 8pt; }
    .inv-qr-perma { font-size: 7pt; }
    .inv-qr-name { font-size: 13pt; }
  }
