/* ============================================================
   Inventory app styles (prefix .inv-). Tokens only, no hex colours.
   The accent comes from [data-app="inventory"] (violet) in tokens.css.
   ============================================================ */
.inv-page { max-width: 1500px; margin: 0 auto; }
.inv-page .tile { background: var(--accent-soft); color: var(--accent-ink); }
.widget[data-app="inventory"] .tile { background: var(--accent-soft); color: var(--accent-ink); }
.inv-page .fin-notes, .inv-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.inv-loading { display: grid; place-items: center; min-height: 120px; color: var(--text-3); }
.inv-pad { padding: 8px 4px; }
.inv-page .lrow .tx > .t { display: block; }

a.inv-tile:hover, a.inv-row-link:hover, a.inv-hit:hover, a.inv-tree-name:hover, a.inv-chip:hover, a.inv-tile:focus-visible { text-decoration: none; }

/* ---- toolbar / filters ---- */
.inv-toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.inv-toolbar .spacer { flex: 1; }
.inv-search { flex: 1 1 240px; margin: 0; }
.inv-toolbar select.input { width: auto; max-width: 100%; height: 46px; border-radius: var(--r-pill); }
.inv-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.inv-filter-chips:not(:empty) { margin-bottom: var(--sp-2); }
.inv-count { margin: 0 2px var(--sp-2); min-height: 18px; }

/* ---- path chips: Bei mir › Zimmer › Schrank ---- */
.inv-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.inv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; text-decoration: none; max-width: 100%; }
a.inv-chip:hover { background: var(--accent-soft-2); }
.inv-chip.none { background: var(--surface-2); color: var(--text-3); }
.inv-chip.removable { cursor: pointer; border: 0; }
.inv-chip .i { width: 12px; height: 12px; }
.inv-sep { color: var(--text-3); font-weight: 700; }

/* ---- item grid ---- */
.inv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (min-width: 900px) { .inv-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); } }
.inv-tile { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-lg); background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-sm); overflow: hidden; color: inherit; text-decoration: none; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease); }
.inv-tile:hover { box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-md); }
.inv-tile:active { transform: scale(.985); }
.inv-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--accent-soft); }
.inv-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-ink); }
.inv-ph .i { width: 34px; height: 34px; stroke-width: 1.6; }
.inv-qty { position: absolute; right: 8px; top: 8px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-solid); color: var(--text); font-size: 12px; font-weight: 800; box-shadow: var(--shadow-sm); }
.inv-tile-b { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.inv-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-where { display: flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12px; font-weight: 600; min-width: 0; }
.inv-where .i { flex: none; width: 12px; height: 12px; }
.inv-where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-thumb { width: 36px; height: 36px; border-radius: 11px; object-fit: cover; flex: none; display: block; background: var(--accent-soft); }

/* ---- rows (search hits, box content) ---- */
.inv-row { padding: 0 8px 0 0; }
.inv-row-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 10px 0 10px 12px; color: inherit; text-decoration: none; }
.inv-hit { text-decoration: none; color: inherit; }
.inv-hit .s { overflow: hidden; }
.inv-search-page { max-width: 760px; margin: 0 auto; }
.searchbar.big .input.inv-big-search { height: 58px; font-size: 18px; font-weight: 600; }
.inv-search-out { margin-top: var(--sp-3); }

/* ---- detail ---- */
.inv-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
@media (min-width: 900px) { .inv-detail-grid { grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); } }
.inv-gallery { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.inv-main { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--accent-soft); cursor: zoom-in; box-shadow: inset 0 0 0 1px var(--border); }
.inv-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.inv-main.empty-main { display: grid; place-items: center; cursor: default; color: var(--accent-ink); }
.inv-main.empty-main .i { width: 48px; height: 48px; stroke-width: 1.4; }
.inv-thumbs { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding: 2px; }
.inv-thumbbtn { width: 64px; height: 64px; flex: none; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.inv-thumbbtn.active { box-shadow: 0 0 0 2px var(--accent); }
.inv-thumbbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-detail-main { min-width: 0; }
.inv-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.inv-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.inv-title { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: var(--track-tight); line-height: 1.15; overflow-wrap: anywhere; flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.inv-qty-inline { color: var(--accent-ink); font-size: var(--fs-lg, 18px); font-weight: 800; }
.inv-where-line { display: flex; align-items: flex-start; gap: 8px; color: var(--text-3); min-width: 0; }
.inv-where-line > .i { margin-top: 4px; flex: none; }
.inv-actions { gap: 8px; margin-top: 4px; }
.inv-move .t { white-space: normal; }
.inv-lightbox img { max-height: 66dvh; }

/* ---- place picker (inline) ---- */
.inv-place { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.inv-place-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.inv-place-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-picker { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.inv-picker .input { height: 40px; }
.inv-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.inv-pick { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px 6px calc(10px + var(--depth, 0) * 18px); border-radius: var(--r-sm); text-align: left; font-weight: 600; font-size: 14px; color: var(--text); }
.inv-pick:hover { background: var(--surface-3); }
.inv-pick.sel { background: var(--accent-soft); color: var(--accent-ink); }
.inv-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-sheet .inv-picker { margin-bottom: 4px; }

/* ---- editor ---- */
.inv-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-imgs:empty { display: none; }
.inv-img { position: relative; width: 76px; height: 76px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.inv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-img .inv-ph { position: absolute; inset: 0; }
.inv-img-x { position: absolute; right: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-sm); }
.inv-links { border-top: 1px solid var(--border); }
.inv-loc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- location tree ---- */
.inv-tree { padding: 6px; }
.inv-tree-row { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 6px 4px calc(6px + var(--depth, 0) * 20px); border-radius: var(--r-sm); }
.inv-tree-row:hover { background: var(--surface-2); }
.inv-tree-row.archived { opacity: .6; }
.inv-fold { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); }
.inv-fold:hover { background: var(--surface-3); color: var(--text); }
.inv-fold.none { pointer-events: none; }
.inv-tree-name { display: flex; flex-direction: column; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.inv-tree-name .t { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-tree-name .s { font-size: 12px; color: var(--text-3); font-weight: 600; }
.inv-cat-row { cursor: default; }
.inv-cat-row:hover { background: transparent; }

/* ---- QR label (print) ---- */
.inv-label-page { max-width: 560px; margin: 0 auto; }
.inv-label-box { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.inv-label { display: flex; flex-direction: column; align-items: center; gap: 2mm; width: 62mm; padding: 3mm; box-sizing: border-box; border-radius: var(--r-sm); background: Canvas; color: CanvasText; box-shadow: inset 0 0 0 1px var(--border-strong); text-align: center; align-self: center; }
.inv-qr { width: 52mm; height: 52mm; display: block; image-rendering: pixelated; }
.inv-label-t { display: flex; flex-direction: column; gap: 1mm; width: 100%; min-width: 0; }
.inv-label-t strong { font-size: 4.2mm; line-height: 1.15; overflow-wrap: anywhere; }
.inv-label-t span { font-size: 2.8mm; line-height: 1.2; overflow-wrap: anywhere; }
.inv-label-t code { font-family: var(--mono); font-size: 2.8mm; letter-spacing: .12em; }
@media print {
  .sidebar, .topbar, .bottomnav, .wallpaper, .page-tabs, .inv-noprint, .offline, .toasts, .overlay { display: none !important; }
  html, body { background: Canvas !important; }
  .app, .main, .content { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; min-height: 0 !important; background: none !important; }
  .inv-label-page { max-width: none; margin: 0; }
  .inv-label-page .card-box { padding: 0; margin: 0; background: none; box-shadow: none; }
  .inv-label { box-shadow: none; border: 0.3mm solid CanvasText; border-radius: 0; break-inside: avoid; margin: 0; align-self: flex-start; }
  @page { margin: 8mm; }
}
