/* Lagerverwaltung – ergänzende Styles zu Bootstrap (mobile-first). */
:root {
  --brand: #1f3a5f;
  --bottom-bar-h: 64px;
}
body { background: #f4f6f9; overflow-x: hidden; }
.bg-brand { background: var(--brand) !important; }
.min-w-0 { min-width: 0; }

/* HTMX-Ladeanzeige (ohne eingebettete Styles, CSP-freundlich) */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
#scan-indicator.htmx-request { display: block; }

/* Große Bedienelemente */
.btn-lg, .form-control-lg, .form-select-lg { min-height: 3rem; }
.barcode-input { font-family: var(--bs-font-monospace); font-size: 1.35rem; letter-spacing: .03em; }
.qty-input { font-size: 1.6rem; font-weight: 600; text-align: center; max-width: 14rem; }
.btn-submit { font-size: 1.2rem; padding-top: .8rem; padding-bottom: .8rem; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 768px) { .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .quick-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Kennzahlen */
.kpi-label { font-size: .85rem; color: var(--bs-secondary-color); }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--bs-body-color); word-break: break-word; }
.kpi-warn { border-color: var(--bs-warning); border-width: 2px; }

/* Produktbilder */
.product-thumb { width: 88px; height: 88px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--bs-border-color); background: #fff; flex: none; }
.list-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: .35rem; border: 1px solid var(--bs-border-color); background: #fff; }
.product-image { max-height: 360px; width: 100%; object-fit: contain; background: #fff; }
.visually-hidden-file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.stock-now { font-size: 1.15rem; }

/* Kamera */
.camera-view { position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; background: #000; border-radius: .5rem; overflow: hidden; }
.camera-view video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%; border: 3px solid rgba(255,255,255,.85); border-radius: .5rem; box-shadow: 0 0 0 2000px rgba(0,0,0,.25); }

/* Buchungsergebnis */
.booking-result { font-size: 1.1rem; border-width: 2px; }
.booking-card { border-width: 2px; }

/* Bestandsmarkierung (zusätzlich zu Text-Badges) */
tr.row-low > td { background-color: #fff8e1 !important; }
tr.row-out > td { background-color: #fdecea !important; }

/* Untere Schnellzugriffsleiste auf dem Smartphone */
.has-bottom-bar { padding-bottom: calc(var(--bottom-bar-h) + 1.5rem + env(safe-area-inset-bottom)) !important; }
@media (min-width: 992px) { .has-bottom-bar { padding-bottom: 2rem !important; } }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: #fff; border-top: 1px solid var(--bs-border-color); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.bottom-bar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--bottom-bar-h); color: var(--bs-body-color); text-decoration: none; font-size: .75rem; }
.bottom-bar a span { font-size: 1.35rem; line-height: 1.1; }
.bottom-bar a.active { color: var(--brand); font-weight: 700; box-shadow: inset 0 3px 0 var(--brand); }

/* Tabellen auf dem Smartphone als Karten darstellen – kein horizontales Abschneiden */
@media (max-width: 767.98px) {
  .product-table table, .movement-table table { border: 0; }
  .product-table thead, .movement-table thead { display: none; }
  .product-table tr, .movement-table tr { display: block; background: #fff; border: 1px solid var(--bs-border-color); border-radius: .5rem; margin-bottom: .6rem; padding: .35rem .6rem; }
  .product-table td, .movement-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .2rem 0; text-align: right !important; }
  .product-table td::before, .movement-table td::before { content: attr(data-label); font-weight: 600; color: var(--bs-secondary-color); text-align: left; flex: none; }
  .product-table td[data-label="Bild"]::before { content: ""; }
}
.main-nav .nav-link.active { font-weight: 700; text-decoration: underline; text-underline-offset: .35em; }
@media (min-width: 1200px) {
  .main-nav .nav-link { white-space: nowrap; padding-left: .45rem !important; padding-right: .45rem !important; font-size: .95rem; }
  .navbar-brand { margin-right: .5rem; }
}
.container-xxl-wide { max-width: 1600px; }
.movement-table td, .product-table td { vertical-align: middle; }
@media (min-width: 768px) {
  .movement-table .text-break, .product-table .text-break { word-break: normal !important; overflow-wrap: break-word; }
  .movement-table td[data-label="Produkt"], .product-table td[data-label="Produkt"] { min-width: 11rem; }
  .movement-table td[data-label="Grund"], .movement-table td[data-label="Notiz"] { min-width: 10rem; }
  .movement-table td[data-label="Barcode"], .product-table td[data-label="Barcode"] { white-space: nowrap; }
}
