/* =============================================
   RRB Voorraad - inventory-dashboard.css
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   Login
   ============================================= */

.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 40px; width: 100%; max-width: 400px; }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* =============================================
   Layout
   ============================================= */

.app-layout { display: flex; min-height: 100vh; }

.page-body {
  padding: var(--sp-xl);
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
  width: 220px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-800) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: width 0.2s ease;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar.collapsed { width: 56px; padding: 12px 0; align-items: center; }

.sidebar-logo {
  font-weight: 700; font-size: 16px; padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo .brand-green { color: var(--accent); }

.sidebar-toggle { background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; font-size: 18px; padding: 0; }
.sidebar-toggle:hover { color: white; }

.sidebar-close {
  display: none; background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 24px; cursor: pointer; padding: 8px; margin: -8px;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.sidebar-close:active { background: rgba(255,255,255,0.15); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  padding: 10px 12px; border-radius: 6px; display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.8); text-decoration: none; cursor: pointer; font-size: 14px; transition: background 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.1); text-decoration: none; color: white; }
.nav-item.active { background: rgba(255,255,255,0.2); font-weight: 600; color: white; box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 6px 6px 0; }

.nav-group-label {
  padding: 16px 12px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.4); white-space: nowrap;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-group-label:hover { color: rgba(255,255,255,0.6); }
.nav-group-chevron {
  font-size: 8px; transition: transform 0.15s ease;
}
.nav-group-chevron.expanded { transform: rotate(90deg); }
.sidebar.collapsed .nav-group-label { display: none; }

.nav-sub { padding-left: 28px; font-size: 13px; opacity: 0.85; }
.nav-sub .nav-icon svg { width: 14px; height: 14px; }
.sidebar.collapsed .nav-sub { padding-left: 0; }

.nav-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; flex-shrink: 0; }
.nav-label { white-space: nowrap; }

.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-logo span:not(.sidebar-toggle),
.sidebar.collapsed .sidebar-user-name { display: none; }
.sidebar.collapsed .nav-item { width: 36px; height: 36px; padding: 0; justify-content: center; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }

.sidebar-user {
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.2); margin-top: 8px;
  font-size: 12px; opacity: 0.7; display: flex; align-items: center; gap: 10px;
}

.sidebar-avatar {
  width: 28px; height: 28px; background: rgba(255,255,255,0.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.sidebar-user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =============================================
   Mobile Topbar & Sidebar
   ============================================= */

.mobile-topbar {
  display: none; background: var(--primary); color: white;
  padding: 8px 16px; align-items: center; gap: 12px;
}
.mobile-topbar .hamburger {
  font-size: 24px; background: none; border: none; color: white; cursor: pointer;
  padding: 8px; margin: -8px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.mobile-topbar .hamburger:active { background: rgba(255,255,255,0.15); }
.mobile-topbar-title { font-weight: 700; font-size: 15px; }
.mobile-page-indicator { font-size: 11px; opacity: 0.7; font-weight: 400; display: block; }

.sidebar-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0); z-index: 99; pointer-events: none; transition: background 0.3s ease;
}
.sidebar-backdrop.active { background: rgba(0,0,0,0.5); pointer-events: auto; }

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed; width: 240px; transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important; padding-top: max(16px, env(safe-area-inset-top, 16px));
  }
  .sidebar.collapsed { width: 240px; padding: 16px; align-items: stretch; }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .sidebar-user-name { display: inline !important; }
  .sidebar.collapsed .nav-item { width: auto; height: auto; padding: 14px 16px; justify-content: flex-start; }
  .sidebar.collapsed .sidebar-logo { justify-content: space-between; }
  .sidebar.collapsed .sidebar-logo span:not(.sidebar-toggle) { display: inline !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar .nav-item { padding: 14px 16px; font-size: 15px; gap: 12px; min-height: 48px; }
  .sidebar .nav-sub { padding-left: 32px; font-size: 14px; min-height: 44px; }
  .sidebar.collapsed .nav-group-label { display: block; }
  .sidebar.collapsed .nav-sub { padding-left: 32px; }
  .sidebar .nav-icon { font-size: 18px; }
  .sidebar .sidebar-user { padding: 14px 16px; }
  .sidebar-close { display: flex; }
  .sidebar-toggle { display: none; }
  .app-layout { flex-direction: column; }
  .login-container { padding: 16px; }
  .login-card { padding: 24px; }
}

@media (max-width: 480px) {
  .login-container { padding: 12px; }
  .login-card { padding: 20px; }
}

body.sidebar-open { overflow: hidden; }

/* =============================================
   Page Header
   ============================================= */

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-btn);
  transition: background 0.15s, color 0.15s;
}

.back-btn:hover { background: var(--bg); color: var(--text); }

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-wrap: wrap;
  row-gap: 8px;
}
/* Mobile: nested action cluster inside card-title stacks below title */
@media (max-width: 480px) {
  .card-title > div[style*="margin-left:auto"] {
    margin-left: 0 !important;
    width: 100%;
    justify-content: flex-start;
  }
  .card-title > [style*="margin-left:auto"],
  .card-subtitle {
    margin-left: 0 !important;
    width: 100%;
    justify-content: flex-start;
  }
  .card-title .btn-sm { flex: 1 1 auto; min-width: 0; }
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: auto;
  text-transform: none;
  letter-spacing: normal;
}

/* =============================================
   Stat Cards
   ============================================= */

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-value.primary { color: var(--primary); }
.stat-value.accent { color: var(--accent); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

.stat-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

/* Sparkline SVG inside stat cards */
.spark {
  width: 52px;
  height: 22px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}
.spark .line {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.spark .area { stroke: none; opacity: 0.18; }
.spark.up   .line { stroke: var(--accent); }
.spark.up   .area { fill:   var(--accent); }
.spark.down .line { stroke: var(--danger); }
.spark.down .area { fill:   var(--danger); }
.spark.flat .line { stroke: var(--text-muted); }
.spark.flat .area { fill:   var(--text-muted); opacity: 0.10; }

/* Sparkline sized for dashboard hero cards */
.hero-row .spark { width: 80px; height: 28px; flex: 0 0 auto; }

/* =============================================
   Dashboard Grid
   ============================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-xl);
  align-items: start;
}
.dashboard-grid > div:last-child > [class~="card"] {
  max-height: 600px;
  display: flex;
  flex-direction: column;
}
.dashboard-grid > div:last-child > [class~="card"] .activity-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.dash-activity-card {
  display: flex;
  flex-direction: column;
}
.dash-activity-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 430px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dash-activity-scroll .list-row {
  margin: 0;
}
.dash-activity-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid > div:last-child > [class~="card"] {
    max-height: 400px;
  }
  .dash-activity-scroll {
    max-height: 320px;
  }
}

/* =============================================
   Tables
   ============================================= */

.table-container {
  overflow-x: auto;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: var(--sp-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg);
  padding: 6px var(--sp-sm);
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: var(--primary);
}

.data-table td {
  padding: 6px var(--sp-sm);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.3;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--primary-50); }
.data-table tbody tr:hover { background: var(--primary-100); }

.data-table tbody tr.clickable { cursor: pointer; }

.table-empty {
  text-align: center;
  padding: var(--sp-2xl);
  color: var(--text-muted);
}

/* Responsive table → cards */
@media (max-width: 768px) {
  .responsive-table .data-table thead { display: none; }
  .responsive-table .data-table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    margin-bottom: var(--sp-sm);
    padding: var(--sp-md);
    background: var(--surface);
  }
  .responsive-table .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    padding: 5px 0;
    font-size: 14px;
  }
  .responsive-table .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
  }
  .table-container { border: none; background: transparent; }

  /* All inputs/selects full-width on mobile */
  .toolbar input[type="text"],
  .toolbar input[type="search"],
  .toolbar select {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px;
  }

}

/* =============================================
   Forms
   ============================================= */

.form-group {
  margin-bottom: var(--sp-lg);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--sp-xs);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 7px var(--sp-md);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}

.form-control:focus { border-color: var(--primary); }
.form-control:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: var(--sp-xs);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-actions {
  display: flex;
  gap: var(--sp-sm);
  justify-content: flex-end;
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--border);
}

/* =============================================
   Toolbar / Filters
   ============================================= */

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}
.toolbar select.form-control {
  max-width: 160px;
  flex: 0 1 auto;
}

.toolbar-right { margin-left: auto; }

.search-input {
  min-width: 0;
  flex: 1 1 220px;
  padding: 7px var(--sp-md);
  padding-left: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
}

.search-input:focus { border-color: var(--primary); }

/* =============================================
   Activity Feed
   ============================================= */

.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  gap: var(--sp-md);
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  border-radius: 4px;
  margin: 0 -8px;
  transition: background 0.15s ease;
}

.activity-item:hover { background: var(--bg); }
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-text { flex: 1; }
.activity-action { font-weight: 500; }
.activity-byline { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.activity-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* =============================================
   Toast Notifications
   ============================================= */

.toast-container {
  position: fixed;
  bottom: var(--sp-xl);
  right: var(--sp-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  max-width: 360px;
}

@media (max-width: 480px) {
  .toast-container {
    left: var(--sp-md);
    right: var(--sp-md);
    bottom: var(--sp-md);
    max-width: none;
  }
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Qty change notification */
.qty-notification {
  position: fixed;
  bottom: var(--sp-xl);
  left: var(--sp-xl);
  z-index: 9998;
  background: var(--accent);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--r-card);
  font-size: 13px;
  line-height: 1.5;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.qty-notification.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .qty-notification {
    left: var(--sp-md);
    right: var(--sp-md);
    max-width: none;
  }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-md) var(--sp-lg);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  animation: slideIn 0.25s ease;
  border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-message { flex: 1; }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  font-size: 16px;
}

/* =============================================
   Modals
   ============================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 35, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
}

.modal {
  background-color: var(--surface);
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(15, 23, 35, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg { max-width: 760px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-lg) var(--sp-xl);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: var(--sp-xs);
}

.modal-body {
  padding: var(--sp-xl);
}

.modal-footer {
  padding: var(--sp-lg) var(--sp-xl);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp-sm);
  justify-content: flex-end;
}

/* rrb-primitives styles .form-group as a bordered fieldset; in modals
   .form-group is just an input wrapper — strip the fieldset look. */
.modal-body .form-group {
  border: 0;
  padding: 0;
  margin-bottom: var(--sp-lg);
  border-radius: 0;
  background: transparent;
}
.modal-body .form-group > * + * { margin-top: var(--spacing-xs, 4px); }

/* =============================================
   Product Picker (autocomplete)
   ============================================= */

.pp-wrap {
  position: relative;
}

.pp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pp-input-wrap input {
  padding-right: 32px;
}

.pp-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.pp-clear:hover {
  color: var(--danger);
}

.pp-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pp-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg);
}

.pp-item:last-child {
  border-bottom: none;
}

.pp-item:hover {
  background: var(--bg);
}

.pp-item.pp-loading,
.pp-item.pp-empty {
  color: var(--text-muted);
  font-size: 13px;
  cursor: default;
}

.pp-name {
  font-weight: 500;
  font-size: 14px;
}

.pp-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.pp-stock {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* =============================================
   Info Section (toggle)
   ============================================= */

.info-section {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--r-card);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  font-size: 13px;
  color: var(--primary-800);
  line-height: 1.6;
}

/* =============================================
   Tabs
   ============================================= */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--sp-xl);
}

.tab-item {
  padding: var(--sp-sm) var(--sp-lg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

@media (max-width: 768px) {
  .tab-bar {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-item {
    flex: 0 0 auto;
  }
}

/* =============================================
   Inline editing
   ============================================= */

.edit-hint {
  opacity: 0;
  color: var(--primary);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Edit mode input wrapper */
.edit-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: editSlideIn 0.2s ease;
}

@keyframes editSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.edit-mode-wrap .form-control {
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 106, 163, 0.1);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.edit-mode-wrap .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26, 106, 163, 0.15);
}

.edit-mode-wrap .btn-accent {
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.edit-mode-wrap .btn-ghost {
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.edit-mode-wrap .btn-ghost:hover {
  color: var(--danger);
  background: rgba(220, 53, 69, 0.08);
}

@media (max-width: 768px) {
  .edit-hint { opacity: 0.4; }
}

/* Suggestion chips — mobile-friendly replacement for <datalist> */
.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.suggest-chip {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--gray-50);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  line-height: 18px;
  transition: background 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.suggest-chip:hover, .suggest-chip:active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}

.suggest-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}

@media (max-width: 768px) {
  .suggest-chip { padding: 8px 14px; font-size: 14px; min-height: 44px; }
}

/* =============================================
   Scanner
   ============================================= */

.scanner-container {
  max-width: 900px;
  margin: 0 auto;
}
.scanner-card {
  max-width: 520px;
}

.scanner-viewport {
  position: relative;
  width: 100%;
  border-radius: var(--r-card) var(--r-card) 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-950);
}

#qr-reader {
  border-radius: var(--r-card);
  overflow: hidden;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.scanner-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  border-radius: 2px;
  opacity: 0;
}

.scanner-overlay.active .scanner-line {
  opacity: 1;
  animation: scanLine 2s ease-in-out infinite;
}

.scanner-overlay.paused .scanner-line {
  opacity: 0;
  animation: none;
}

@keyframes scanLine {
  0% { top: 10%; }
  50% { top: 85%; }
  100% { top: 10%; }
}

/* +/- direction icon */
.scanner-dir-icon {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.scanner-dir-label {
  font-size: 13px;
}

/* Lookup button: narrower, icon only */
.scanner-dir-lookup {
  flex: 0 0 52px;
}

.scanner-last-scanned {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  margin: var(--sp-sm) 0;
  min-height: 44px;
  transition: border-color 0.3s, background 0.3s;
}

.scanner-last-scanned.has-scan {
  border-color: var(--accent);
  animation: scanHighlight 0.6s ease-out;
}

.scanner-last-scanned-info {
  flex: 1;
  min-width: 0;
}

.scanner-last-scanned-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanner-last-scanned-sku {
  font-size: 14px;
  color: var(--text-muted);
}

.scanner-scan-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--accent);
  color: var(--surface);
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
}

@keyframes scanHighlight {
  0% { background: rgba(0, 193, 48, 0.15); }
  100% { background: var(--bg); }
}

/* Direction toggle */
.scanner-direction-toggle {
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: var(--sp-md);
}

.scanner-direction-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 48px;
}

.scanner-direction-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.scanner-direction-btn.active-incoming {
  background: var(--accent);
  color: var(--surface);
}

.scanner-direction-btn.active-outgoing {
  background: var(--danger);
  color: var(--surface);
}

.scanner-direction-btn.active-lookup {
  background: var(--primary);
  color: var(--surface);
}

.scanner-direction-btn svg {
  width: 18px;
  height: 18px;
}

/* Scanner action buttons — mobile-optimized */
.scanner-actions {
  display: flex;
  gap: var(--sp-sm);
  margin: var(--sp-md) 0;
}

.scanner-actions [class~="btn"] {
  flex: 1;
  min-height: 52px;
  font-size: 16px;
}

/* Queue direction badge */
.direction-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.direction-badge.incoming {
  background: rgba(0, 193, 48, 0.12);
  color: var(--accent);
}

.direction-badge.outgoing {
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger);
}

.stock-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Mobile scanner improvements */
@media (max-width: 768px) {
  .scanner-viewport {
    border-radius: 0;
    margin: 0 calc(-1 * var(--sp-md));
    width: calc(100% + 2 * var(--sp-md));
    min-height: 50vh;
  }

  .scanner-direction-toggle {
    margin: 0 0 var(--sp-md) 0;
  }

  .scanner-direction-btn {
    padding: 10px 6px;
    gap: 4px;
    min-height: 48px;
  }

  .scanner-dir-icon {
    font-size: 24px;
  }

  .scanner-dir-label {
    font-size: 14px;
  }

  .scanner-direction-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  /* Modal fixes: prevent iOS zoom on input focus */
  .modal .form-control,
  .modal select,
  .modal input {
    font-size: 16px !important;
  }

  /* Modal max-height: scrollable on small screens */
  .modal {
    max-height: 85vh;
    overflow-y: auto;
  }
}

/* =============================================
   Pagination
   ============================================= */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  justify-content: center;
  padding: var(--sp-lg) 0;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  cursor: pointer;
  font-size: 13px;
  background: white;
  color: var(--text);
  transition: background 0.15s;
}

.pagination-btn:hover:not(:disabled) { background: var(--bg); }
.pagination-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   Toggle / Checkbox
   ============================================= */

.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

.toggle-input { display: none; }

.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-input:checked + .toggle-track { background: var(--accent); }

.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle-input:checked + .toggle-track::after { transform: translateX(16px); }

/* =============================================
   Chart container
   ============================================= */

.chart-container {
  position: relative;
  height: 240px;
}

/* =============================================
   Stock quantity controls
   ============================================= */

.qty-input-direct {
  width: 64px; height: 44px; text-align: center; font-size: 16px; font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--r-btn);
  background: white; color: var(--text); -moz-appearance: textfield;
}
.qty-input-direct::-webkit-inner-spin-button,
.qty-input-direct::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input-direct:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,106,163,0.2); }

/* Location stock grid (dual-location on product detail) */
.location-stock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-sm);
}
.location-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-xs);
}
.location-stock-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.location-stock-qty {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.location-badge-sm {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--r-btn);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-left: 4px;
  vertical-align: middle;
}
@media (max-width: 480px) {
  .location-stock-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Responsive stats grid
   ============================================= */

@media (max-width: 480px) {
  .stat-value { font-size: 18px; }
  .page-body { padding: var(--sp-lg); }
}

/* =============================================
   Loading spinner
   ============================================= */

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* =============================================
   Detail sections
   ============================================= */

/* Desktop: hide collapsible chrome, always show body */
.pd-chevron { display: none; }
.pd-collapsible-body { max-height: none; opacity: 1; }

@media (max-width: 768px) {
  /* Product detail: flatten columns and reorder cards so Voorraad is 2nd */
  .pd-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
  }
  .pd-col-left, .pd-col-right {
    display: contents;
  }
  .pd-card-info  { order: 1; }
  .pd-card-stock { order: 2; }
  .pd-col-left > [class~="card"]:not(.pd-card-info) { order: 3; }
  .pd-col-right > [class~="card"]:not(.pd-card-stock) { order: 4; }

  /* Tighter cards on mobile */
  .pd-grid [class~="card"] { padding: 12px; margin-bottom: 8px; }
  .pd-grid .card-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-100);
  }

  .edit-mode-wrap {
    flex-wrap: wrap;
    gap: 6px;
  }
  .edit-mode-wrap .form-control {
    width: 100% !important;
    min-width: 0;
  }

  /* Compact stock card on mobile */
  .pd-stock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  .pd-stock-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
  }
  .location-stock-grid { grid-template-columns: 1fr; gap: 6px; }
  .location-stock-header { margin-bottom: 2px; }
  .location-stock-qty { font-size: 16px; }

  /* Collapsible history sections on mobile */
  .pd-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .pd-collapsible-header .pd-chevron {
    font-size: 14px;
    color: var(--primary);
    transition: transform 0.25s ease;
  }
  .pd-collapsible-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease;
  }
  .pd-collapsible.pd-expanded .pd-collapsible-body {
    max-height: 2000px;
    opacity: 1;
  }
  .pd-collapsible.pd-expanded .pd-chevron {
    transform: rotate(90deg);
  }

  /* Secondary card styling for history */
  .pd-card-secondary {
    background: var(--gray-50) !important;
    border-color: var(--primary-200) !important;
  }
}

/* =============================================
   Empty state
   ============================================= */

.empty-state {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--sp-md);
  opacity: 0.3;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--sp-sm);
  color: var(--text);
}

.empty-state-text {
  font-size: 13px;
}

/* =============================================
   Misc utilities
   ============================================= */

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); font-size: 12px; }
.fw-600 { font-weight: 600; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-lg { margin-bottom: var(--sp-lg); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.w-full { width: 100%; }
[x-cloak] { display: none !important; }

/* =============================================
   Timeline
   ============================================= */

.timeline { position: relative; padding-left: 24px; }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-header { font-size: 13px; }

/* Dashboard charts wrapper spacing lives on the local wrapper, not the shared grid. */
.dash-collapsible { margin-top: 16px; }

@media (max-width: 768px) {
  .stat-label { font-size: 14px; margin-bottom: 2px; }
  .stat-value { font-size: 18px; }

  /* Dashboard: compact activity feed */
  .activity-item {
    padding: 5px 0;
    gap: 0;
  }
  .activity-dot { display: none; }
  .activity-action { font-size: 14px; line-height: 1.3; }
  .activity-byline { font-size: 14px; color: var(--text-muted); }

  /* Dashboard: charts collapsible toggle */
  .dash-charts-toggle {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 10px 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--gray-100);
  }
  .dash-collapsible { margin-top: 8px; }
}
.timeline-date { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }

/* =============================================
   Mobile: Toolbar stacking
   ============================================= */

@media (max-width: 768px) {
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .search-input {
    flex: 1 1 0;
    min-width: 120px;
  }
  .toolbar .toolbar-right {
    margin-left: 0;
    flex: 0 0 auto;
  }
}

/* =============================================
   Mobile: Product cards
   ============================================= */

@media (max-width: 480px) {
  .product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 12px 14px;
    margin-bottom: var(--sp-sm);
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .product-card:active {
    border-color: var(--primary);
  }
  .product-card {
    position: relative;
    overflow: hidden;
  }
  .product-card.selected {
    border-color: var(--primary);
    background: linear-gradient(90deg, rgba(26,106,163,0.06) 0%, rgba(26,106,163,0.02) 100%);
  }
  .product-card.selected::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 8px 0 0 8px;
  }
  .product-card-select {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    margin: -2px 2px -2px -4px;
  }
  .product-card-select input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    opacity: 0.4;
    transition: opacity 0.15s;
  }
  .product-card.selected .product-card-select input[type="checkbox"],
  .product-card-select input[type="checkbox"]:checked {
    opacity: 1;
  }
  .product-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .product-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
  }
  .product-card-name .font-mono {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
  }
  .product-card-qty {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 2px;
  }
  .product-card-qty-num {
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
  }
  .mobile-select-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    font-size: 14px;
    color: var(--text-muted);
  }
  .mobile-select-all label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
  }
  .mobile-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
  }
  .product-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-muted);
  }
  .product-card-meta span {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Bulk action bar — fixed top overlay, never shifts page content */
.bulk-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  flex-wrap: wrap;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
  pointer-events: none;
}
.bulk-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bulk-bar span {
  font-weight: 500;
  margin-right: 8px;
}

@media (max-width: 480px) {
  .bulk-bar {
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    border-bottom: none;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    gap: 6px;
    /* Wrap instead of forcing nowrap — 5 actions + counter overflow 320–390px viewports otherwise (Codex M-2). */
    flex-wrap: wrap;
    row-gap: 6px;
    justify-content: flex-start;
    max-height: 50vh;
    overflow-y: auto;
  }
  .bulk-bar.visible {
    transform: translateY(0);
  }
  .bulk-bar span {
    font-size: 14px;
    margin-right: 0;
    flex-basis: 100%;
    text-align: center;
    white-space: nowrap;
  }
  .bulk-bar [class~="btn"] { font-size: 14px; padding: 10px 12px; min-height: 44px; white-space: nowrap; flex: 0 1 auto; }
  .bulk-bar .btn-danger { margin-left: auto; }
}

/* Qty-confirm bar — surfaces pending +/- changes that have not been written yet.
   Quantity changes need explicit confirmation (memory: never_change_quantities). */
.qty-confirm-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 2px solid var(--warning);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
  pointer-events: none;
}
.qty-confirm-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.qty-confirm-bar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.qty-confirm-bar-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.qty-confirm-bar-summary {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qty-confirm-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.qty-confirm-bar .btn-confirm {
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
  font-weight: 600;
  min-height: 36px;
  padding: 0 14px;
}
.qty-confirm-bar .btn-confirm:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.qty-confirm-bar .btn-confirm[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.qty-confirm-bar .btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  min-height: 36px;
  padding: 0 12px;
}
.qty-confirm-bar .btn-cancel:hover {
  background: var(--bg);
  color: var(--text);
}
.qty-confirm-bar.is-loading .btn-confirm,
.qty-confirm-bar.is-loading .btn-cancel { pointer-events: none; }

/* Pending row tint — amber wash, no shift */
.prod-row.is-pending {
  background: rgba(239, 108, 0, 0.06);
  box-shadow: inset 3px 0 0 0 var(--warning);
}
.prod-qty-chip.is-pending {
  outline: 2px solid var(--warning);
  outline-offset: 1px;
}
.qty-delta {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--r-field, 4px);
  font-size: 11px;
  font-weight: 700;
  background: var(--warning);
  color: var(--surface);
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .qty-confirm-bar { padding: 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .qty-confirm-bar-summary { font-size: 14px; }
  .qty-confirm-bar .btn-confirm,
  .qty-confirm-bar .btn-cancel { min-height: 44px; padding: 0 14px; }
}

/* Reserve space at bottom of list when bar visible — avoid covering last row */
.products-has-pending { padding-bottom: 84px; }
@media (max-width: 768px) {
  .products-has-pending { padding-bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .qty-confirm-bar { transition: opacity 0.15s ease; transform: none; }
  .qty-confirm-bar:not(.visible) { display: none; }
}

/* Filter toggle button */
.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  background: var(--danger);
  color: var(--surface);
}

.btn-primary .filter-count-badge {
  background: rgba(255,255,255,0.3);
}

/* Collapsible filter panel */
.filter-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.filter-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm) var(--sp-md);
  align-items: end;
}

.filter-panel-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-panel-field select.form-control,
.filter-panel-field .filter-range-group {
  max-width: none !important;
  width: 100% !important;
}

.filter-panel-toggles {
  display: flex;
  flex-direction: row;
  gap: var(--sp-md);
  align-items: center;
  padding-top: 4px;
}

.filter-panel-clear {
  margin-top: var(--sp-sm);
  text-align: right;
}

/* Range filter inputs */
.filter-range-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.filter-range-input {
  width: 72px !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
}
.filter-range-sep {
  color: var(--color-text-secondary);
  font-size: 12px;
}

@media (max-width: 768px) {
  .filter-panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-panel-toggles {
    grid-column: 1 / -1;
  }
  .filter-range-group { width: 100%; }
  .filter-range-input { flex: 1; }
}

@media (max-width: 480px) {
  .filter-panel-grid {
    grid-template-columns: 1fr;
  }
}

/* Autocomplete dropdown */
.ac-wrap { position: relative; }
.ac-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-card) var(--r-card);
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.ac-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.ac-item:last-child {
  border-bottom: none;
}
.ac-item:hover, .ac-item:active {
  background: var(--surface-muted);
}

/* Favorite star button */
.fav-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--border);
  padding: 0;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.fav-star:hover { color: var(--warning); transform: scale(1.2); }
.fav-star.active { color: var(--warning); }

/* =============================================
   Foldable sections
   ============================================= */

.foldable-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}

.foldable-header:hover {
  opacity: 0.8;
}

.fold-chevron {
  display: inline-flex;
  transition: transform 0.25s ease;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.fold-chevron.open {
  transform: rotate(90deg);
}

.fold-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.fold-body.open {
  grid-template-rows: 1fr;
}

.fold-body-inner {
  overflow: hidden;
}

.product-expand-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.product-expand-content.open {
  grid-template-rows: 1fr;
}

.product-expand-inner {
  overflow: hidden;
}

.product-expand-details {
  padding: 12px 16px 16px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.product-expand-field {
  font-size: 13px;
}

.product-expand-field .field-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 2px;
}

.product-expand-field .field-value {
  font-weight: 500;
}

.expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.expand-toggle:hover {
  color: var(--primary);
}

.expand-toggle.open {
  transform: rotate(90deg);
}

/* Mobile product card expand */
.product-card-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.product-card-expand.open {
  grid-template-rows: 1fr;
}

.product-card-expand-inner {
  overflow: hidden;
}

.product-card-details {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}

@media (max-width: 480px) {
  .product-card-details {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Design refinements — Products page polish
   ============================================= */

/* 1. Search bar: more prominent, rounded, focus glow */
.search-input {
  border-radius: 6px;
  font-size: 14px;
  padding: 9px var(--sp-md) 9px 36px;
  transition: border-color 0.15s, box-shadow 0.2s ease;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,106,163,0.1);
}

/* 2. Table row hover: blue tint with left accent */
.data-table tbody tr:hover {
  background: rgba(26,106,163,0.03);
}
.data-table tbody tr.clickable {
  transition: background 0.12s ease;
}
.data-table tbody tr.clickable:hover {
  background: rgba(26,106,163,0.04);
  box-shadow: inset 3px 0 0 var(--primary);
}

/* 4. Expand detail panel: left accent, refined fields */
.product-expand-details {
  border-left: 3px solid var(--primary);
  border-top: none;
  margin-left: 48px;
  padding: 14px 16px 14px 20px;
  background: var(--gray-50);
  border-radius: 0 0 6px 0;
}
.product-expand-field .field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* 5. Filter panel: lighter, top accent border */
.filter-panel {
  background: var(--gray-50);
  border: none;
  border-top: 3px solid var(--primary);
  border-radius: 0 0 var(--r-card) var(--r-card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: var(--sp-lg);
}

/* 7. Empty state: larger, more refined */
.empty-state {
  padding: 48px var(--sp-xl);
}
.empty-state-icon {
  font-size: 56px;
  opacity: 0.2;
  margin-bottom: var(--sp-lg);
}
.empty-state-title {
  font-size: 17px;
  letter-spacing: -0.2px;
}

/* 8. Stock level indicators — desktop rows + mobile cards */
.data-table tr.low-stock {
  border-left: 3px solid var(--warning);
}
.data-table tr.out-of-stock {
  border-left: 3px solid var(--danger);
}
.product-card.low-stock {
  border-left: 3px solid var(--warning);
}
.product-card.out-of-stock {
  border-left: 3px solid var(--danger);
}

/* 9. Product count subtitle in header */
.products-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* 10. Favorite star refinement */
.fav-star {
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fav-star:active { transform: scale(0.85); }
.fav-star.active {
  animation: fav-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fav-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 11. Toolbar button refinement */
.btn-filter-toggle {
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-filter-toggle:hover:not(:disabled) {
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 12. Table header refinement */
.data-table th {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-text-ornamental);
  border-bottom: 2px solid var(--gray-200);
  padding: 8px var(--sp-sm);
}

/* 13. Product count footer */
.products-count-footer {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
}

/* =============================================
   Design refinements — Scanner page polish
   (Visual refinements only — sizing stays desktop-native)
   ============================================= */

/* Scanner container */
.scanner-container {
  max-width: 900px;
}

/* Mobile: keep the start block directly below the header by moving the
   scanner-specific toggles and queue CTA after the default-order content. */
@media (max-width: 768px) {
  .scanner-container.scanner-ux:not(.is-hud) {
    display: flex;
    flex-direction: column;
  }
  .scanner-container.scanner-ux:not(.is-hud) > .scanner-input-mode-toggle--prominent,
  .scanner-container.scanner-ux:not(.is-hud) > .scanner-split-hero,
  .scanner-container.scanner-ux:not(.is-hud) > .scanner-split-queue,
  .scanner-container.scanner-ux:not(.is-hud) > .scanner-bulk-toggle--hero {
    order: 1;
  }
}

/* Direction toggle: segmented control visual style (no size changes) */
.scanner-direction-toggle {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 3px;
  gap: 3px;
}

.scanner-direction-btn {
  border-radius: 6px;
  background: transparent;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.scanner-direction-btn:not(:last-child) {
  border-right: none;
}

.scanner-direction-btn.active-incoming {
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0,193,48,0.3);
}
.scanner-direction-btn.active-outgoing {
  background: var(--danger);
  box-shadow: 0 1px 3px rgba(220,53,69,0.3);
}
.scanner-direction-btn.active-lookup {
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(26,106,163,0.3);
}

/* Last scanned: refined visuals */
.scanner-last-scanned {
  border-radius: 6px;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.scanner-last-scanned.has-scan {
  box-shadow: 0 0 0 2px rgba(0,193,48,0.15);
}

/* Queue card title with count badge */
.scanner-queue-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scanner-queue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--primary);
  color: var(--surface);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
}

/* Direction badge: pill style */
.direction-badge {
  border-radius: 10px;
  padding: 2px 10px;
}

/* Queue direction toggle button */
.direction-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.direction-toggle-btn.incoming {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 193, 48, 0.08);
}

.direction-toggle-btn.outgoing {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(220, 53, 69, 0.08);
}

.direction-toggle-btn:active {
  transform: scale(0.92);
}

/* Scanner manual input row */
.scanner-manual-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.scanner-manual-row > div {
  flex: 1;
  min-width: 0;
}

/* Scanner stop button: centered on all sizes */
.scanner-stop-btn {
  display: block;
  margin: 12px auto;
  border-radius: 8px;
}

/* Scanner debug: more subtle */
.scanner-debug-toggle {
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.15s;
}
.scanner-debug-toggle:hover { opacity: 1; }

/* Mobile + tablet scanner: compact sizing */
@media (max-width: 768px) {
  .scanner-direction-toggle {
    margin: 0 0 var(--sp-sm) 0;
  }
  .scanner-direction-btn {
    padding: 8px 4px;
    font-weight: 600;
    gap: 3px;
    min-height: 48px;
  }
  /* Compact the main scanner card */
  .scanner-card {
    padding: var(--sp-sm);
    margin-bottom: var(--sp-sm) !important;
  }
  /* Start/stop buttons: compact but touch-friendly */
  .scanner-card .btn-lg {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 20px;
  }
  .scanner-stop-btn {
    max-width: 200px;
  }
  /* Scan count pill: smaller */
  .scanner-scan-count {
    font-size: 14px;
    min-width: 26px;
    height: 26px;
    border-radius: 13px;
  }
  /* Scanner action buttons: compact */
  .scanner-actions [class~="btn"] {
    min-height: 44px;
    font-size: 14px;
    border-radius: 6px;
  }
  /* Queue cards: tighter */
  .scanner-queue-area [class~="card"] {
    padding: var(--sp-md);
    margin-bottom: var(--sp-sm);
  }
  .scanner-queue-area .card-title {
    font-size: 14px;
    margin-bottom: var(--sp-sm);
  }
}

/* =============================================
   Dashboard Scanner wachtrij — card list
   ============================================= */
.dash-queue-card { padding: 16px; }

.dash-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dash-queue-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.dash-queue-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-queue-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.dash-queue-row--outgoing {
  border-left-color: var(--warning);
}
.dash-queue-row:hover {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dash-queue-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.dash-queue-product { min-width: 0; }
.dash-queue-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-queue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}
.dash-queue-meta-sep { color: var(--border); }
.dash-queue-barcode {
  font-size: 11px;
  letter-spacing: 0.02em;
}
.dash-queue-scaninfo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.dash-queue-locs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.dash-queue-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  background: var(--bg);
  color: var(--text-muted);
  white-space: nowrap;
}
.dash-queue-loc-label { font-weight: 500; }
.dash-queue-loc-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  min-width: 14px;
  text-align: right;
}

.dash-queue-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dash-queue-dir-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  transition: background 120ms ease, border-color 120ms ease;
}
.dash-queue-dir-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
}
.dash-queue-dir-btn--outgoing {
  color: var(--warning);
}
.dash-queue-dir-btn--outgoing:hover {
  border-color: var(--warning);
}
.dash-queue-dir-sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: currentColor;
  color: var(--surface);
  font-size: 13px;
  line-height: 1;
}
.dash-queue-dir-label { letter-spacing: 0.01em; }

.dash-queue-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.dash-queue-qty-step {
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--text);
  transition: background 120ms ease;
}
.dash-queue-qty-step:hover {
  background: var(--bg);
}
.dash-queue-qty-input {
  width: 50px;
  height: 28px;
  text-align: center;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.dash-queue-qty-input:focus { outline: none; }
.dash-queue-qty-input::-webkit-outer-spin-button,
.dash-queue-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.dash-queue-qty-input[type=number] { -moz-appearance: textfield; }
.dash-queue-unit {
  padding: 0 6px 0 2px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dash-queue-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.dash-queue-remove:hover {
  background: rgba(220, 53, 69, 0.08);
  color: var(--danger);
  border-color: var(--danger);
}

.dash-queue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 4px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.dash-queue-empty-icon { font-size: 28px; line-height: 1; }
.dash-queue-empty-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-top: 4px;
}
.dash-queue-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.dash-queue-pending-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.dash-queue-pending-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dash-queue-pending-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.dash-queue-pending-action { margin-left: auto; }
.dash-queue-pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-queue-pending-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: var(--surface);
}
.dash-queue-pending-info { min-width: 0; }
.dash-queue-pending-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .dash-queue-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dash-queue-row-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .dash-queue-row-controls {
    flex-wrap: wrap;
    justify-content: space-between;
  }
.dash-queue-qty-step { min-width: 44px; min-height: 44px; }
  .dash-queue-remove { width: 36px; height: 36px; }
  .dash-queue-locs { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .dash-queue-card { padding: 12px; }
  .dash-queue-row { padding: 10px 12px; }
  .dash-queue-name { font-size: 14px; }
  .dash-queue-meta { font-size: 14px; }
  .dash-queue-dir-btn { font-size: 14px; padding: 8px 10px; }
}

/* Low-stock group row: wrap on very narrow screens so name+qty don't clip */
@media (max-width: 480px) {
  .low-stock-group-row { flex-wrap: wrap; gap: 4px 10px; padding: 10px; }
  .low-stock-group-row .name { flex: 1 1 100%; white-space: normal; }
  .low-stock-group-row .meta { order: 2; }
  .low-stock-group-row .qty  { order: 3; margin-left: auto; }
}

/* =============================================
   Scanner UX Improvements
   ============================================= */

/* Task 1: Scan cooldown overlay */
.scan-cooldown-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 193, 48, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  animation: cooldownFadeIn 0.15s ease-out;
  pointer-events: none;
}
.scan-cooldown-overlay .cooldown-check {
  font-size: 48px;
  color: var(--surface);
  margin-bottom: 8px;
  animation: cooldownPop 0.3s ease-out;
}
.scan-cooldown-overlay .cooldown-text {
  color: var(--surface);
  font-size: 16px;
  font-weight: 600;
}
@keyframes cooldownFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cooldownPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Task 5: Scan success flash on viewport */
.scanner-viewport.scan-success {
  animation: scanSuccessFlash 0.5s ease-out;
}
@keyframes scanSuccessFlash {
  0% { box-shadow: inset 0 0 0 4px var(--accent); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* Task 6: Sticky queue count badge while scanning */
.scanner-queue-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: var(--surface);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}
.scanner-queue-badge:active {
  transform: scale(0.95);
}
.scanner-queue-badge-count {
  background: rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 14px;
}

/* Task 7: Swipe to delete in queue */
.swipe-row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.swipe-row-content {
  position: relative;
  background: var(--surface);
  transition: transform 0.2s ease-out;
  z-index: 1;
}
.swipe-row-delete {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 80px;
  background: var(--danger);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  z-index: 0;
}
.swipe-row.swiping .swipe-row-content {
  transition: none;
}

/* Task 8: Product info in last-scanned area */
.scanner-last-scanned-detail {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scanner-last-scanned-detail .stock-label {
  font-weight: 600;
  color: var(--text);
}

/* Task 10: Recent scans quick-add */
.recent-scans {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.recent-scan-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-scan-btn:hover {
  border-color: var(--primary);
  background: rgba(26,106,163,0.05);
}
.recent-scan-btn:active {
  background: rgba(26,106,163,0.1);
}

/* Task 3: Manual input row while scanning */
.scanner-inline-manual {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.scanner-inline-manual input {
  flex: 1;
  min-width: 0;
  height: 40px;
  font-size: 14px;
}
.scanner-inline-manual button {
  flex-shrink: 0;
}

/* Inline search results */
.scanner-search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  background: var(--surface);
  gap: 12px;
}
.scanner-search-result:active {
  background: var(--surface-muted);
}

/* Task 4: Camera error with retry */
.scanner-error-card {
  text-align: center;
  padding: 24px 16px;
  margin-bottom: 12px;
}
.scanner-error-card .error-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.scanner-error-card .error-message {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.scanner-error-card .error-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .scanner-queue-badge {
    bottom: 16px;
    right: 16px;
    font-size: 14px;
    padding: 6px 12px;
  }
  .recent-scan-btn {
    padding: 8px 12px;
    min-height: 44px;
    font-size: 14px;
  }
  .scanner-inline-manual input {
    height: 44px;
    font-size: 16px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== Gerelateerde producten ========== */
.related-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: background-color var(--t) var(--ease), border-left-color var(--t) var(--ease);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.related-row:last-child { border-bottom: 0; }
.related-row:hover { background: var(--surface-muted); border-left-color: var(--primary); }

.rr-main { min-width: 0; }
.rr-name {
  font: 500 13px/1.2 var(--font);
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rr-sub {
  margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
  font: 500 12px/1 'SF Mono', Menlo, monospace;
  color: var(--text-muted);
}
.rr-sub .rr-loc { font-family: var(--font); font-weight: 500; }

.rr-qty-wrap { display: inline-flex; align-items: center; }
.rr-qty-wrap .qty { height: 28px; }
.rr-qty-wrap .qty button { width: 26px; height: 26px; font-size: 14px; }
.rr-qty-wrap .qty .qty-value {
  min-width: 34px; padding: 0 6px; text-align: center;
  font: 500 12px/1 var(--font); font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Product detail quantity controls: center text in compact steppers. */
.pd-grid .qty { align-items: center; }
.pd-grid .qty button,
.pd-grid .qty .qty-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pd-grid .qty .qty-value { align-self: stretch; }
.pd-grid .qty .qty-input-direct { line-height: normal; }
.pd-stock-body .loc-qty .qty button { height: 44px; }

.rr-total { justify-self: end; }
.rr-menu svg { width: 14px; height: 14px; display: block; }

@media (max-width: 768px) {
  .rr-sub .rr-loc { display: none; }
}
@media (max-width: 480px) {
  .related-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name menu" "sub sub" "qty total";
    gap: 6px 10px; padding: 12px;
  }
  .rr-main     { grid-area: name; }
  .rr-sub      { grid-area: sub; }
  .rr-qty-wrap { grid-area: qty; justify-self: start; }
  .rr-total    { grid-area: total; justify-self: end; align-self: center; }
  .rr-menu     { grid-area: menu; justify-self: end; }
  .rr-qty-wrap .qty        { height: 36px; }
  .rr-qty-wrap .qty button { width: 32px; height: 34px; font-size: 18px; }
}

/* ========== Producten redesign (dense row + group) ========== */
/* Toolbar stays in normal flow; search focus scrolls it into view on mobile. */
.prod-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.prod-toolbar .prod-search {
  flex: 1 1 280px;
  min-width: 180px;
}
.prod-toolbar .prod-toolbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-field, 4px);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}
.prod-toolbar .prod-toolbar-pill:hover { background: var(--surface-muted); }
.prod-toolbar-search { flex: 3 1 360px; min-width: 240px; }
.prod-toolbar.prod-toolbar-wide > .prod-toolbar-search { flex: 6 1 720px; min-width: 440px; }
.prod-toolbar-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted, var(--gray-500));
}
.prod-toolbar-select select {
  height: 38px;
  padding: 0 30px 0 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.2s ease;
}
.prod-toolbar-select select:hover { border-color: var(--color-text-muted, var(--gray-400)); }
.prod-toolbar-select select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,106,163,0.1);
}
.prod-toolbar .search-input {
  height: 40px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  scroll-margin-top: 12px;
  box-shadow: 0 0 0 4px rgba(26, 106, 163, 0.12),
              0 1px 3px rgba(26, 106, 163, 0.08);
  transition: box-shadow 0.18s ease-out, border-color 0.18s ease-out;
}
.prod-toolbar .search-input:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 5px rgba(26, 106, 163, 0.22),
              0 2px 6px rgba(26, 106, 163, 0.18);
}
.prod-toolbar .btn-filter-toggle {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
}
.prod-toolbar-label { white-space: nowrap; }
.prod-group-fav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--warning);
  font-size: 18px;
  line-height: 1;
}
@media (max-width: 1024px) {
  .prod-toolbar-select .prod-toolbar-label { display: none; }
  .prod-toolbar-select select { height: 36px; }

  /* Mobiel + tablet = puur de zoekbalk in de toolbar. De rest (Groep /
     Sorteer / Filters / Snelvoorbeeld / Vanuit URL / + Nieuw product)
     zit in de bottom-sheet (.prod-mfilter-sheet) die opent via de
     "+ Filter" pill. Het oude inline filter-panel wordt onder 1024px
     ook vervangen door de sheet. */
  .prod-toolbar > .prod-toolbar-select,
  .prod-toolbar > .btn-filter-toggle,
  .prod-toolbar > .prod-split-toggle,
  .prod-toolbar > .prod-compact-toggle,
  .prod-toolbar > [class~="btn-outline"],
  .prod-toolbar > [class~="btn-primary"] {
    display: none;
  }
  .prod-toolbar {
    box-sizing: border-box;
    padding: 12px 8px;
    gap: 0;
    /* Escape both .page-body (xl=24) AND .page-container (20px @ ≤1024)
       paddings. Per-breakpoint overrides below match container padding
       changes (16/12/10). overflow-x:hidden on .page-container clips at
       its own outer edge, so any extra negative margin is safe. */
    margin-left: calc(var(--sp-xl) * -1 - 20px);
    margin-right: calc(var(--sp-xl) * -1 - 20px);
    border-left: 0;
    border-right: 0;
  }
  .prod-toolbar > .prod-toolbar-search {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .prod-toolbar.prod-toolbar-wide > .prod-toolbar-search {
    min-width: 0;
  }
  .prod-toolbar-search input.search-input {
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    padding-left: 44px;
    font-size: 15px;
    border: 2px solid var(--primary);
    border-radius: 14px;
    background-color: var(--surface);
    background-position: 14px center;
    background-size: 18px 18px;
    box-shadow: 0 0 0 5px rgba(26, 106, 163, 0.16),
                0 2px 6px rgba(26, 106, 163, 0.12);
    transition: box-shadow 0.18s ease-out, border-color 0.18s ease-out;
  }
  .prod-toolbar-search input.search-input::placeholder {
    color: var(--text-muted);
  }
  .prod-toolbar-search input.search-input:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 7px rgba(26, 106, 163, 0.24),
                0 3px 10px rgba(26, 106, 163, 0.22);
  }
  .filter-panel { display: none; }
}

/* ===== Mobile + tablet filter UX (Option 1: Bottom sheet) =====
   Pill row sits between toolbar and list. Always visible ≤1024px.
   "+ Filter" pill opens a bottom sheet with drill rows.
   Tapping a row opens a full-screen picker (search + multi-select). */
.prod-mfilter-pillrow { display: none; }
@media (max-width: 1024px) {
  .prod-mfilter-pillrow {
    display: flex;
    gap: 8px;
    padding: 8px 12px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .prod-mfilter-pillrow::-webkit-scrollbar { display: none; }
  .prod-mfilter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
  }
  .prod-mfilter-pill.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
  }
  .prod-mfilter-pill .pill-x {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-right: -4px;
    border-radius: 9px;
    background: rgba(255,255,255,0.25);
    color: var(--surface);
    font-size: 14px;
    line-height: 1;
  }
  .prod-mfilter-pill.pill-add {
    color: var(--primary);
    border-color: var(--primary);
    border-style: dashed;
    background: transparent;
  }
  .prod-mfilter-pill.pill-clear {
    color: var(--primary);
    border-color: transparent;
    background: transparent;
  }
}

.prod-mfilter-backdrop,
.prod-mfilter-sheet,
.prod-mfilter-picker { display: none; }

@media (max-width: 1024px) {
  body.prod-mfilter-locked { overflow: hidden; }

  .prod-mfilter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    animation: prodMfilterFade 180ms ease-out;
  }

  .prod-mfilter-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1101;
    animation: prodMfilterSlideUp 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .prod-mfilter-sheet-handle {
    display: grid;
    place-items: center;
    padding: 6px 0 2px;
  }
  .prod-mfilter-sheet-handle::before {
    content: '';
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
  }
  .prod-mfilter-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 4px;
    border-bottom: 1px solid var(--border);
  }
  .prod-mfilter-sheet-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
  }
  .prod-mfilter-sheet-head .close-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
  }
  .prod-mfilter-sheet-rows {
    flex: 1;
    overflow-y: auto;
    padding: 0;
  }
  .prod-mfilter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
  }
  .prod-mfilter-row:active { background: var(--surface-muted); }
  .prod-mfilter-row .row-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }
  .prod-mfilter-row .row-value {
    color: var(--text-muted);
    font-size: 13px;
    text-align: right;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .prod-mfilter-row .row-value.has-value { color: var(--primary); font-weight: 500; }
  .prod-mfilter-row .row-chev {
    color: var(--text-muted);
    font-size: 14px;
  }
  .prod-mfilter-row.row-toggle .row-value {
    flex: 0 0 auto;
    max-width: none;
  }
  .prod-mfilter-row .toggle-check {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: transparent;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    transition: border-color 150ms ease-out, background 150ms ease-out, color 150ms ease-out;
  }
  .prod-mfilter-row.is-on .toggle-check {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--surface);
  }
  .prod-mfilter-row .row-range {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .prod-mfilter-row .row-range input {
    width: 72px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
  }
  .prod-mfilter-mobile-qty-row,
  .prod-mfilter-result-first {
    display: none;
  }
  .prod-mfilter-sheet-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 16px 10px;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .prod-mfilter-sheet-foot [class~="btn"] {
    justify-content: center;
    height: 38px;
    padding: 0 14px;
  }

  /* Pair row: two label+select cells side by side (Groepering + Sorteer) */
  .prod-mfilter-row.mfilter-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
    cursor: default;
  }
  .prod-mfilter-row.mfilter-pair:active { background: transparent; }
  .mfilter-pair-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  .mfilter-pair-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .mfilter-pair-select {
    width: 100%;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-size: 13px;
    color: var(--text);
  }

  /* Picker row: 3-up chip grid (Merk / Categorie / Groep) */
  .prod-mfilter-row.mfilter-pickers {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    cursor: default;
  }
  .prod-mfilter-row.mfilter-pickers:active { background: transparent; }
  .mfilter-pchip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }
  .mfilter-pchip:active { background: var(--surface-muted); }
  .mfilter-pchip.is-active {
    border-color: var(--primary);
    background: rgba(26, 106, 163, 0.06);
  }
  .mfilter-pchip-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .mfilter-pchip-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .mfilter-pchip-value.has-value { color: var(--primary); }

  /* Range picker drill-in: hosts both Prijs + Aantal sliders. */
  .prod-mfilter-picker-range .prod-mfilter-picker-range-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .prod-mfilter-picker-range .mfilter-range-row {
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px;
  }
  .prod-mfilter-picker-range .mfilter-range-row:last-child { border-bottom: none; }

  /* Range-row variant: stacks label+value above a dual-thumb slider. */
  .prod-mfilter-row.mfilter-range-row {
    display: block;
    padding: 8px 16px 10px;
    cursor: default;
  }
  .prod-mfilter-row.mfilter-range-row:active { background: transparent; }
  .mfilter-range-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  .mfilter-dual-range {
    position: relative;
    height: 28px;
    margin: 0 12px;
    touch-action: pan-y;
  }
  .mfilter-dual-range .dr-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transform: translateY(-50%);
  }
  .mfilter-dual-range .dr-fill {
    position: absolute;
    top: 50%;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    transform: translateY(-50%);
  }
  .mfilter-dual-range input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    pointer-events: none;
    margin: 0;
    padding: 0;
    outline: none;
  }
  .mfilter-dual-range input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
    height: 28px;
    border: none;
  }
  .mfilter-dual-range input[type="range"]::-moz-range-track {
    background: transparent;
    height: 28px;
    border: none;
  }
  .mfilter-dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18),
                0 0 0 1px var(--border);
    cursor: pointer;
    margin-top: 0;
  }
  .mfilter-dual-range input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18),
                0 0 0 1px var(--border);
    cursor: pointer;
  }
  .mfilter-dual-range input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18),
                0 0 0 4px rgba(26, 106, 163, 0.18);
  }
  .mfilter-dual-range input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18),
                0 0 0 4px rgba(26, 106, 163, 0.18);
  }
  .mfilter-dual-range .dr-min { z-index: 2; }
  .mfilter-dual-range .dr-max { z-index: 1; }

  .prod-mfilter-picker {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--surface);
    z-index: 1102;
    animation: prodMfilterSlideRight 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .prod-mfilter-picker-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--border);
  }
  .prod-mfilter-picker-head .back-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .prod-mfilter-picker-head h3 {
    margin: 0;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding-right: 60px;
  }
  .prod-mfilter-picker-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
  }
  .prod-mfilter-picker-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
  }
  .prod-mfilter-picker-list {
    flex: 1;
    overflow-y: auto;
  }
  .prod-mfilter-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
  }
  .prod-mfilter-picker-item:active { background: var(--surface-muted); }
  .prod-mfilter-picker-item .check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: transparent;
  }
  .prod-mfilter-picker-item.is-checked .check {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
  }
  .prod-mfilter-picker-item .label {
    flex: 1;
    font-size: 14px;
    color: var(--text);
  }
  .prod-mfilter-picker-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
  }
  .prod-mfilter-picker-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
  }
  .prod-mfilter-picker-foot [class~="btn"] { justify-content: center; }
}

/* Result-first mobile filter sheet. Tablet keeps the existing compact sheet. */
@media (max-width: 768px) {
  .prod-mfilter-sheet {
    max-height: min(82vh, 620px);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 48px rgba(15, 40, 65, .18);
  }
  .prod-mfilter-sheet-head {
    padding: 0 16px 8px;
  }
  .prod-mfilter-sheet-head h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.03em;
  }
  .prod-mfilter-sheet-head .close-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface);
    font-size: 20px;
  }
  .prod-mfilter-sheet-rows {
    padding: 0 12px 84px;
  }
  .prod-mfilter-row {
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-top: 8px;
    padding: 11px 12px;
    background: var(--surface);
  }
  .prod-mfilter-row.mfilter-pair {
    grid-template-columns: 1fr 1fr;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .mfilter-pair-cell,
  .mfilter-pchip {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 10px;
    min-height: 58px;
  }
  .mfilter-pair-select {
    height: 28px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    font-weight: 700;
  }
  .prod-mfilter-row.mfilter-pickers {
    grid-template-columns: 1fr 1fr;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .prod-mfilter-row.mfilter-pickers .mfilter-pchip--group {
    display: none;
  }
  .prod-mfilter-mobile-qty-row {
    display: flex;
  }
  .prod-mfilter-range-entry {
    display: none;
  }
  .prod-mfilter-row .row-label {
    font-size: 14px;
    font-weight: 700;
  }
  .prod-mfilter-row .row-value.has-value,
  .mfilter-pchip.is-active .mfilter-pchip-value,
  .mfilter-pair-select:focus {
    color: var(--primary);
  }
  .prod-mfilter-row.row-toggle.is-on {
    border-color: rgba(26, 106, 163, .32);
    background: rgba(26, 106, 163, .06);
  }
  .prod-mfilter-result-first {
    display: block;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(15, 40, 65, .07);
  }
  .mfilter-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .mfilter-result-head strong {
    color: var(--primary);
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
  }
  .mfilter-result-list {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
  }
  .mfilter-result-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .mfilter-result-row:first-child {
    border-top: 0;
  }
  .mfilter-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
  }
  .mfilter-result-icon .brand-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px;
  }
  .mfilter-result-main {
    min-width: 0;
  }
  .mfilter-result-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
  }
  .mfilter-result-link:active,
  .mfilter-result-link:focus,
  .mfilter-result-link:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .mfilter-result-main em {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
  }
  .mfilter-result-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-50);
    color: var(--accent-800);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .mfilter-result-qty.is-low {
    background: var(--warning-50);
    color: var(--warning-800);
  }
  .mfilter-result-qty.is-out {
    background: var(--danger-50);
    color: var(--danger-800);
  }
  .mfilter-result-empty {
    padding: 18px 10px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
  }
  .prod-mfilter-sheet-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
  }
  .prod-mfilter-sheet-foot [class~="btn"] {
    height: 44px;
    border-radius: 14px;
    font-weight: 700;
  }
  .prod-mfilter-picker-qty .prod-mfilter-picker-range-body {
    padding-top: 28px;
  }
}

@keyframes prodMfilterSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes prodMfilterSlideRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes prodMfilterFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.prod-group {
  border-bottom: 1px solid var(--border);
}
.prod-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.prod-group-header .caret {
  width: 12px;
  display: inline-block;
  transition: transform 150ms ease-out;
}
.prod-group.is-collapsed .prod-group-header .caret { transform: rotate(-90deg); }
.prod-group-header .title { font-weight: 600; flex: 1; }
.prod-group-header .meta { color: var(--text-muted); font-size: 12px; display: flex; gap: 10px; }
.prod-group-body { display: block; }
.prod-group.is-collapsed .prod-group-body { display: none; }

/* ===== Pill-card grouping (groupMode = brand | vendor) ===== */
.prod-list--cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--r-card);
}
.prod-list--cards .prod-group--card {
  border: 0;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow var(--t, 180ms) var(--ease, ease-out),
              transform var(--t, 180ms) var(--ease, ease-out);
}
.prod-list--cards .prod-group--card.is-collapsed {
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  border: 1px solid var(--border);
}
.prod-list--cards .prod-group--card.is-collapsed:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  transform: translateY(-1px);
}
.prod-list--cards .prod-group--card:not(.is-collapsed) {
  grid-column: 1 / -1;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 12px rgba(26,106,163,.08);
}
.prod-list--cards .prod-group--card:not(.is-collapsed) {
  overflow: visible;
}
.prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-pill {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-muted);
  box-shadow: 0 1px 0 var(--border);
}

.prod-list--cards .pgc-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  min-height: 60px;
}
.prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-pill {
  background: var(--surface-muted);
}
.pgc-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.pgc-icon .brand-icon {
  width: 32px !important;
  height: 32px !important;
}
.pgc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pgc-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pgc-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pgc-stat strong { color: var(--text); font-weight: 600; }
.pgc-stat--value { font-variant-numeric: tabular-nums; }
.pgc-stat--muted { color: var(--text-subtle); }
.pgc-alert {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.4;
}
.pgc-alert--low {
  background: var(--warning-100);
  color: var(--warning, var(--warning));
}
.pgc-alert--out {
  background: var(--danger-100);
  color: var(--danger, var(--danger));
}
.pgc-alert--ok {
  display: none;
  background: var(--success-100);
  color: var(--success);
}
.pgc-caret {
  flex-shrink: 0;
  color: var(--text-subtle, var(--gray-400));
  transition: transform 150ms ease-out, color 150ms ease-out;
}
.prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-caret {
  transform: rotate(90deg);
  color: var(--primary);
}

/* Mobile manufacturer cards: 2 compact cards per row, opened group inline full-width. */
@media (max-width: 480px) {
  .prod-list--cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    background: var(--surface-muted);
  }
  .prod-list--cards .prod-group--card {
    border-radius: 16px;
  }
  .prod-list--cards .prod-group--card.is-collapsed {
    min-width: 0;
    box-shadow: 0 8px 18px rgba(15, 40, 65, .06);
  }
  .prod-list--cards .prod-group--card:not(.is-collapsed) {
    grid-column: 1 / -1;
    border-radius: 18px;
  }
  .prod-list--cards .pgc-pill {
    align-items: flex-start;
    min-height: 108px;
    padding: 10px;
    gap: 8px;
    position: relative;
  }
  .prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-pill {
    min-height: 64px;
    align-items: center;
  }
  .pgc-icon {
    width: 30px;
    height: 30px;
  }
  .pgc-icon .brand-icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px;
  }
  .pgc-body {
    gap: 5px;
  }
  .pgc-name {
    font-size: 13px;
    font-weight: 700;
  }
  .pgc-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    font-size: 11px;
  }
  .pgc-stat {
    min-width: 0;
    padding: 4px 6px;
    border-radius: 9px;
    background: var(--surface-muted);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pgc-stat--qty,
  .pgc-stat--value,
  .pgc-stat--muted {
    display: none;
  }
  .pgc-alert {
    position: absolute;
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-pill {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-icon {
    grid-column: 1;
    grid-row: 1;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-body {
    display: contents;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-name {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
    overflow: visible;
    white-space: normal;
    line-height: 1.15;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-stats {
    grid-column: 1 / 3;
    grid-row: 2;
    display: flex;
    width: auto;
    min-width: 0;
    margin-top: 8px;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-alert {
    position: static;
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    max-width: 100%;
    margin-top: 8px;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-alert--ok {
    display: inline-flex;
  }
  .prod-list--cards .prod-group--card.is-collapsed .pgc-caret {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }
  .prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-alert {
    position: static;
    max-width: none;
  }
  .prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-stats {
    display: flex;
    width: auto;
  }
  .prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-stat {
    padding: 0;
    background: transparent;
    text-align: left;
  }
  .prod-list--cards .prod-group--card:not(.is-collapsed) .pgc-stat--qty {
    display: inline;
  }
}
@media (max-width: 360px) {
  .pgc-stat--muted { display: none; }
  .prod-list--cards {
    gap: 6px;
    padding: 6px;
  }
  .prod-list--cards .pgc-pill {
    padding: 9px;
  }
}

.prod-list-header {
  display: grid;
  grid-template-columns: 28px 22px 1fr 120px 120px 100px 90px 80px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  position: sticky;
  top: 0;
  z-index: 4;
}
.prod-list-shell .prod-list-header,
.prod-list-shell .prod-row {
  grid-template-columns: 28px 22px minmax(220px, 1fr) 120px 120px 100px 90px 80px;
}
@media (max-width: 768px) {
  .prod-list-header { display: none; }
  .prod-list-shell .prod-row {
    grid-template-columns: 28px 28px 1fr auto;
  }
}
.prod-sort-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-field, 4px);
  text-align: left;
  white-space: nowrap;
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}
.prod-sort-cell:hover { background: rgba(0,0,0,0.05); }
.prod-sort-cell.is-sorted { color: var(--primary); }
.prod-sort-arrow {
  font-size: 10px;
  opacity: 0.4;
  line-height: 1;
}
.prod-sort-arrow.is-active { opacity: 1; }

.prod-col {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.col-resize-handle {
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  background: transparent;
  border: 0;
  padding: 0;
}
.col-resize-handle::before {
  content: '';
  width: 2px;
  height: 65%;
  background: rgba(0,0,0,0.22);
  border-radius: 2px;
  transition: background 120ms ease-out, width 120ms ease-out, height 120ms ease-out;
}
.col-resize-handle:hover::before,
.col-resize-handle.is-active::before,
.col-resize-handle:focus-visible::before {
  background: var(--primary);
  width: 3px;
  height: 85%;
}
.col-resize-handle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
.prod-list-shell.is-resizing,
.prod-list-shell.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
@media (max-width: 1024px) and (min-width: 769px) {
  .col-resize-handle { width: 22px; right: -11px; }
}
@media (max-width: 768px) {
  .col-resize-handle { display: none; }
}
.prod-split .prod-list-header { display: none; }

.prod-row {
  display: grid;
  grid-template-columns: 28px 22px 1fr 120px 120px 100px 90px 80px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}
.prod-row:hover { background: var(--surface-muted); }
.prod-row-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-row-link { color: inherit; text-decoration: none; }
.prod-row-link:hover { text-decoration: underline; text-decoration-color: var(--primary); }
.prod-row .prod-meta { font-size: 11px; color: var(--text-muted); }

.brand-icon {
  display: inline-block;
  border-radius: var(--r-field, 4px);
  vertical-align: middle;
}

.prod-qty-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: var(--r-field, 4px);
  font-weight: 600;
  font-size: 12px;
}
.prod-qty-chip.is-ok     { background: var(--accent-50); color: var(--accent-800); }
.prod-qty-chip.is-low    { background: var(--warning-50); color: var(--warning-800); }
.prod-qty-chip.is-out    { background: var(--danger-50); color: var(--danger-800); }
.prod-qty-chip.is-muted  { background: var(--gray-100); color: var(--gray-500); }
.prod-qty-chip .qty-btn {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.06); border-radius: var(--r-field, 4px);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.prod-qty-chip.is-muted .qty-btn { background: rgba(0,0,0,0.05); color: var(--gray-500); }
.prod-qty-chip .qty-val { min-width: 24px; text-align: center; }

/* Select-all affordance (Codex M-3) */
.prod-selectall {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.prod-selectall-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.prod-selectall-label input[type="checkbox"] { width: 16px; height: 16px; }
.prod-selectall-count { color: var(--text-muted); font-size: 12px; }

@media (max-width: 768px) {
  .prod-row {
    grid-template-columns: 28px 22px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 6px 8px;
    padding: 8px 10px;
    min-height: 44px;
    align-items: center;
  }
  .prod-row .col-category, .prod-row .col-location,
  .prod-row .col-value, .prod-row .col-updated { display: none; }
  .prod-row .prod-row-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .prod-row .prod-row-main .prod-meta { display: none; }
  .prod-row .prod-qty-chip { justify-self: end; flex-shrink: 0; }
  .prod-group-header { min-height: 48px; padding: 12px; }
  .prod-qty-chip .qty-btn { width: 32px; height: 32px; }
  .prod-selectall { padding: 10px 12px; font-size: 14px; }
  .prod-selectall-label input[type="checkbox"] { width: 20px; height: 20px; }
}

.prod-row.is-out {
  box-shadow: inset 3px 0 0 var(--danger-500, #dc3545);
}

.prod-shell-compact .prod-list-header { display: none; }
@media (min-width: 1100px) {
  .prod-shell-compact .prod-list,
  .prod-shell-compact .prod-group-body {
    column-count: 2;
    column-gap: 12px;
  }
  .prod-shell-compact .prod-row {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    grid-template-columns: 24px 22px minmax(0, 1fr) auto;
    padding: 5px 10px;
    font-size: 12.5px;
  }
  .prod-shell-compact .prod-row .col-category,
  .prod-shell-compact .prod-row .col-location,
  .prod-shell-compact .prod-row .col-value,
  .prod-shell-compact .prod-row .col-updated { display: none; }
  .prod-shell-compact .prod-row .prod-row-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prod-shell-compact .prod-row .prod-row-main .prod-meta { display: none; }
  .prod-shell-compact .prod-row .prod-qty-chip { justify-self: end; }
}
@media (max-width: 1099px) {
  .prod-compact-toggle { display: none !important; }
}

/* Per-breakpoint negative-margin escape for the toolbar.
   Match each breakpoint's .page-container padding (set in rrb-responsive.css). */
@media (max-width: 768px) {
  .prod-toolbar {
    margin-left: calc(var(--sp-xl) * -1 - 16px);
    margin-right: calc(var(--sp-xl) * -1 - 16px);
  }
  /* Match .mobile-topbar visibility (also ≤768px): leave room for it
     when the input scrolls into view. Topbar ≈ 60px (44px hamburger +
     16px padding); +12px breathing room. */
  .prod-toolbar .search-input { scroll-margin-top: calc(60px + 12px); }
}
@media (max-width: 480px) {
  .prod-toolbar {
    padding: 10px 8px;
    gap: 6px;
    /* page-body switches to --spacing-lg (16) at ≤480 (line 1598) */
    margin-left: calc(var(--sp-lg) * -1 - 12px);
    margin-right: calc(var(--sp-lg) * -1 - 12px);
  }
}
@media (max-width: 360px) {
  .prod-toolbar {
    margin-left: calc(var(--sp-lg) * -1 - 10px);
    margin-right: calc(var(--sp-lg) * -1 - 10px);
  }
}

/* Search result chip — appears above the product list when a search query is
   active. Counts both items and groups (fabrikanten / leveranciers / etc).
   Empty-state variant when no matches. */
.prod-result-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  padding: 6px 12px;
  background: var(--primary-50);
  border-radius: 6px;
  color: var(--primary-700);
  font-size: 13px;
}
.prod-result-chip svg { flex-shrink: 0; color: currentColor; }
.prod-result-chip strong { font-weight: 700; }
.prod-result-chip--empty {
  background: var(--surface-muted);
  color: var(--text-muted);
}

/* Highlight the matching substring inside product names. */
.prod-row-main mark {
  background: rgba(26, 106, 163, .15);
  color: var(--primary-700);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

/* Mobile: keep the search input large and the toolbar comfortably tappable
   while it stays in normal document flow. */
@media (max-width: 768px) {
  .prod-toolbar-search input.search-input {
    font-size: 16px; /* >= 16px prevents iOS auto-zoom on focus */
  }
}

/* ============================================================
   Split-view (products list <-> embedded product-detail)
   Active >=1024px only; mobile falls back to navigate
   ============================================================ */

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.toggle-pill:hover { border-color: var(--primary); }
.toggle-pill .toggle-pill-track {
  position: relative;
  width: 30px;
  height: 18px;
  background: var(--gray-300);
  border-radius: 999px;
  transition: background .18s ease;
  flex-shrink: 0;
}
.toggle-pill .toggle-pill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.toggle-pill.on .toggle-pill-track { background: var(--primary); }
.toggle-pill.on .toggle-pill-thumb { transform: translateX(12px); }
.toggle-pill .toggle-pill-label { white-space: nowrap; }

@media (max-width: 1024px) {
  /* Hide toggle on mobile/tablet — split is desktop-only */
  .prod-split-toggle { display: none !important; }
}

.prod-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}
.prod-split-list {
  min-width: 0;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-gutter: stable;
}
/* In split mode the list is half-width: drop secondary columns and let the
   title wrap so the full product name stays readable. */
.prod-split .prod-row {
  grid-template-columns: 28px 22px minmax(0, 1fr) auto auto auto;
}
.prod-split .prod-row .col-category,
.prod-split .prod-row .col-location,
.prod-split .prod-row .col-value,
.prod-split .prod-row .col-updated {
  display: none;
}
.prod-split .prod-row .prod-row-main {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}
.prod-split-detail {
  min-width: 0;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}
.prod-split-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  min-height: 280px;
}
.prod-split-empty-icon {
  font-size: 32px;
  opacity: .35;
  margin-bottom: 12px;
}
.prod-split-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.prod-split-empty-text {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.5;
}
.pd-embed-loading { padding: 16px; }
.pd-embed-skel {
  height: 16px;
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-50) 50%, var(--gray-100) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 10px;
  animation: pd-shimmer 1.2s infinite linear;
}
.pd-embed-skel.short { width: 50%; }
@keyframes pd-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   BV-STRIP — bestelverzoek action strip
   Used on product-detail (.pd-card-vendors footer) and
   low-stock (.lvt-actions footer). Soft primary-50 tint.
   Always single row; label truncates with ellipsis when tight.
   ============================================================ */
.bv-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--primary-50);
  border-top: 1px solid var(--primary-100);
  flex-wrap: nowrap;
  min-width: 0;
}
.bv-strip-pd {
  margin: 12px -16px -16px;
  border-radius: 0 0 var(--r-card, 8px) var(--r-card, 8px);
}
.bv-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
}
.bv-label {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
.bv-label svg { color: var(--primary, var(--primary)); flex-shrink: 0; width: 14px; height: 14px; }
.bv-label .bv-label-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bv-vendor { font-weight: 600; color: var(--text); }
.bv-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.bv-actions [class~="btn"] { white-space: nowrap; }
.bv-actions [class~="btn"] svg { width: 14px; height: 14px; flex-shrink: 0; }
.bv-actions .bv-wissel-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bv-actions .bv-wissel-icon svg { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .bv-strip { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .bv-info { flex: 1 1 100%; min-width: 0; }
  .bv-actions { flex: 1 1 100%; }
  .bv-actions [class~="btn"] { flex: 1 1 0; min-height: 44px; }
  .bv-actions .bv-wissel-icon { flex: 0 0 40px; width: 40px; height: 40px; }
}

.pd-vendors-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-vendors-title > span:first-child { flex: 1; min-width: 0; }
.pd-add-vendor-btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 480px) {
  .pd-vendors-title { flex-wrap: wrap; }
  .pd-add-vendor-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
  }
}

.prod-row.prod-row-active {
  background: rgba(26,106,163,.06);
  box-shadow: inset 3px 0 0 var(--primary);
}

/* Product detail — Openstaande bewegingen sub-sections */
.pd-card-movements .pd-mov-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
}
.pd-card-movements .pd-mov-section-title:first-of-type { border-top: 0; }
.pd-card-movements .pd-mov-section-count {
  background: var(--surface-muted, var(--primary-50));
  color: var(--text-muted);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.pd-card-movements .br-bv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 12px 12px;
}
/* Compact 4-col variant for product-detail (no .br-req column) */
.pd-bv-compact .br-bv-row {
  grid-template-columns: auto 1fr auto auto;
}
.pd-card-movements .mov-row { padding: 10px 16px; }
.pd-card-movements .mov-row:last-child { border-bottom: 0; }
@media (max-width: 480px) {
  .pd-card-movements .br-bv-row .br-actions .btn-sm,
  .pd-card-movements .mov-row .btn-sm {
  min-height: 44px;
  }
}

/* Embedded product-detail header (compact) */
.pd-embed-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--r-card);
  border-top-right-radius: var(--r-card);
}
.pd-embed-title-wrap { flex: 1; min-width: 0; }
.pd-embed-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.pd-embed-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pd-embed-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pd-embed-actions .icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-field, 8px);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.pd-embed-actions .icon-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.pd-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.pd-title-row .page-title,
.pd-title-row .pd-embed-title {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.pd-title-nav {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.pd-title-nav:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.pd-title-nav:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.pd-embed-title-wrap .pd-title-row { margin-bottom: 4px; }
@media (max-width: 640px) {
  .pd-title-row { gap: 6px; }
  .pd-title-nav {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
}

/* Embedded grid: single column, narrower internal spacing */
.pd-grid-embedded {
  display: block !important;
  padding: 14px;
}
.pd-grid-embedded > * {
  margin-bottom: 14px;
}
.pd-grid-embedded > *:last-child { margin-bottom: 0; }

/* Mobile/tablet: collapse split to single column (right pane stacks below) */
@media (max-width: 1024px) {
  .prod-split {
    display: block;
  }
  .prod-split-list,
  .prod-split-detail {
    max-height: none;
    position: static;
    overflow: visible;
  }
  .prod-split-detail { margin-top: 12px; }
}

/* ============================================================
   LAGE VOORRAAD — bestelmodus (split + stats + brand-icons)
   ============================================================ */
.lvt-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.lvt-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.lvt-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 600;
}
.lvt-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-top: 6px;
  line-height: 1;
}
.lvt-stat-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.lvt-stat.lvt-danger .lvt-stat-value { color: var(--danger); }
.lvt-stat.lvt-warning .lvt-stat-value { color: var(--warning); }
.lvt-stat.lvt-success .lvt-stat-value { color: var(--accent); }

.lvt-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.lvt-toolbar .lvt-search { flex: 1; min-width: 220px; }
.lvt-toolbar input,
.lvt-toolbar select {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
  background: var(--surface);
}
.lvt-toolbar input { width: 100%; }

.lvt-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  align-items: start;
}
.lvt-list { display: flex; flex-direction: column; gap: 8px; }

.lvt-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  position: relative;
  overflow: hidden;
}
.lvt-row:hover { border-color: var(--primary); }
.lvt-row.lvt-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 106, 163, 0.08);
}
.lvt-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.lvt-row.lvt-sev-crit::before { background: var(--danger); }
.lvt-row.lvt-sev-low::before { background: var(--warning); }
.lvt-row.lvt-sev-watch::before { background: var(--gray-400); }

.lvt-row .lvt-logo {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
}
.lvt-row .lvt-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.lvt-row .lvt-info { min-width: 0; }
.lvt-row .lvt-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lvt-row .lvt-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lvt-row .lvt-meta .lvt-sep { color: var(--border); }

.lvt-row .lvt-qty { text-align: right; min-width: 90px; }
.lvt-row .lvt-qty .lvt-have { font-size: 14px; font-weight: 700; color: var(--danger); }
.lvt-row.lvt-sev-low .lvt-qty .lvt-have { color: var(--warning); }
.lvt-row .lvt-qty .lvt-target { font-size: 11px; color: var(--text-muted); }
.lvt-row .lvt-chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

.lvt-eta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.lvt-eta-ok { background: rgba(0, 193, 48, 0.12); color: var(--accent-800); }
.lvt-eta-soon { background: rgba(239, 108, 0, 0.12); color: var(--warning-700); }
.lvt-eta-no { background: rgba(220, 53, 69, 0.10); color: var(--danger-700); }
.lvt-eta-unk { background: var(--gray-100); color: var(--gray-600); }

.lvt-age {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}
.lvt-age-fresh { background: var(--gray-100); color: var(--gray-600); }
.lvt-age-stale { background: rgba(239, 108, 0, 0.10); color: var(--warning-700); }
.lvt-age-rotten { background: rgba(220, 53, 69, 0.10); color: var(--danger-700); }

.lvt-detail {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}
.lvt-pd-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.lvt-pd-head .lvt-logo-lg {
  width: 64px; height: 64px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}
.lvt-pd-head .lvt-logo-lg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lvt-pd-head .lvt-pd-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.2; }
.lvt-pd-head .lvt-pd-sub {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap;
}

.lvt-pd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.lvt-pd-stat {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}
.lvt-pd-stat .lvt-pd-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  font-weight: 600;
}
.lvt-pd-stat .lvt-pd-stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; line-height: 1; }
.lvt-pd-stat.lvt-pd-have .lvt-pd-stat-value { color: var(--danger); }
.lvt-pd-stat.lvt-pd-target .lvt-pd-stat-value { color: var(--text); }
.lvt-pd-stat.lvt-pd-suggest .lvt-pd-stat-value { color: var(--accent); }

.lvt-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 700;
  margin: 14px 0 8px;
}

.lvt-stock-adjust {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
}
.lvt-stock-adjust .lvt-stock-adjust-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.lvt-stock-adjust .lvt-stock-adjust-chip {
  justify-self: end;
}
.lvt-stock-adjust .lvt-stock-adjust-hint {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.lvt-row.is-pending { background: rgba(239, 108, 0, 0.06); }

.lvt-vendor-card {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: border-color .15s;
}
.lvt-vendor-card:hover { border-color: var(--primary); }
.lvt-vendor-card.lvt-preferred {
  border-color: var(--primary);
  background: rgba(26, 106, 163, 0.04);
}
.lvt-vendor-card .lvt-vlogo {
  width: 28px; height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  padding: 2px;
}
.lvt-vendor-card .lvt-vlogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lvt-vendor-card .lvt-vname { font-weight: 600; font-size: 12.5px; color: var(--text); line-height: 1.2; }
.lvt-vendor-card .lvt-vmeta { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; line-height: 1.2; }
.lvt-vendor-card .lvt-vprice {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  text-align: right;
  line-height: 1.1;
}
.lvt-vendor-card .lvt-vprice .lvt-each { font-size: 10px; color: var(--text-muted); font-weight: 400; display: block; margin-top: 1px; }
@media (max-width: 480px) {
  .lvt-vendor-card {
    grid-template-columns: 24px 1fr auto;
    gap: 6px;
    padding: 6px 8px;
  }
  .lvt-vendor-card .lvt-vlogo { width: 24px; height: 24px; }
  .lvt-vendor-card .lvt-vprice {
    grid-column: 3;
    grid-row: 1;
  font-size: 14px;
  }
  .lvt-vendor-card > div:nth-child(3) {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left !important;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .lvt-vendor-card > div:nth-child(3) .lvt-vmeta { margin-top: 0; }
.lvt-vendor-card .lvt-vname { font-size: 14px; }
.lvt-vendor-card .lvt-vmeta { font-size: 14px; }
.lvt-pref-tag { font-size: 14px; padding: 2px 6px; }
}

.lvt-stock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.lvt-stock-in { background: rgba(0, 193, 48, 0.12); color: var(--accent-800); }
.lvt-stock-low { background: rgba(239, 108, 0, 0.12); color: var(--warning-700); }
.lvt-stock-out { background: rgba(220, 53, 69, 0.10); color: var(--danger-700); }
.lvt-stock-unk { background: var(--gray-100); color: var(--gray-600); }

.lvt-pref-tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  background: var(--primary);
  color: var(--surface);
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-left: 6px;
  vertical-align: middle;
}

.lvt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  container-type: inline-size;
  container-name: lvt-actions;
}
.bv-strip-lvt { border-radius: var(--r-card); border: 1px solid var(--primary-100); border-top-color: var(--primary-100); padding: 8px 10px; gap: 6px; }
.bv-strip-lvt .bv-label { font-size: 12px; }
.bv-strip-lvt .lvt-stepper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}
.bv-strip-lvt .lvt-stepper button { width: 24px; min-height: 30px; height: 30px; font-size: 14px; }
.bv-strip-lvt .lvt-stepper input { width: 30px; min-height: 30px; height: 30px; font-size: 13px; padding: 0; }
.bv-strip-lvt .bv-aanmaken { flex: 0 0 auto; padding: 0 10px; }
.bv-strip-lvt .bv-aanmaken span { font-size: 12px; }
.bv-strip-lvt .bv-wissel-icon { flex: 0 0 auto; }

/* Container-query wrap: triggers on narrow split-aside AND on mobile viewport */
@container lvt-actions (max-width: 460px) {
  .bv-strip-lvt { flex-wrap: wrap; }
  .bv-strip-lvt .bv-info { flex: 1 1 100%; }
  .bv-strip-lvt .bv-actions { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
  .bv-strip-lvt .lvt-stepper { flex: 1 1 100%; height: 40px; justify-content: space-between; }
  .bv-strip-lvt .lvt-stepper button { width: 44px; min-height: 44px; height: 44px; font-size: 16px; }
  .bv-strip-lvt .lvt-stepper input { flex: 1 1 auto; min-height: 44px; height: 44px; font-size: 14px; width: auto; }
  .bv-strip-lvt .bv-aanmaken { flex: 1 1 0; min-height: 44px; }
  .bv-strip-lvt .bv-wissel-icon { width: 40px; height: 40px; }
}

/* Fallback for browsers without container query support */
@supports not (container-type: inline-size) {
  @media (max-width: 480px) {
    .bv-strip-lvt { flex-wrap: wrap; }
    .bv-strip-lvt .bv-info { flex: 1 1 100%; }
    .bv-strip-lvt .bv-actions { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
    .bv-strip-lvt .lvt-stepper { flex: 1 1 100%; height: 44px; }
    .bv-strip-lvt .lvt-stepper button { width: 44px; min-height: 44px; height: 44px; font-size: 16px; }
    .bv-strip-lvt .lvt-stepper input { flex: 1 1 auto; min-height: 44px; height: 44px; font-size: 14px; width: auto; }
    .bv-strip-lvt .bv-aanmaken { flex: 1 1 0; min-height: 44px; }
  }
}
.lvt-action-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .lvt-action-btn { min-height: 44px; }
}
.lvt-action-btn svg { flex: 0 0 auto; }
.lvt-action-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.lvt-action-row .lvt-stepper { flex: 0 0 auto; }
.lvt-action-row .lvt-add-btn { flex: 1 1 auto; min-width: 0; }
.lvt-stepper {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.lvt-stepper button {
  background: var(--surface);
  border: 0;
  width: 34px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.lvt-stepper button:hover { background: var(--gray-50); }
.lvt-stepper input {
  border: 0;
  width: 44px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}
.lvt-action-row .lvt-stepper,
.lvt-action-row .lvt-stepper button,
.lvt-action-row .lvt-stepper input { min-height: 38px; }
@media (max-width: 768px) {
  .lvt-action-row .lvt-stepper,
  .lvt-action-row .lvt-stepper button,
  .lvt-action-row .lvt-stepper input { min-height: 44px; }
  .lvt-action-row .lvt-stepper button { width: 38px; }
  .lvt-action-row .lvt-stepper input { width: 40px; }
  .lvt-add-btn span { font-size: 14px; }
}

.lvt-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.lvt-empty .lvt-empty-ico { font-size: 32px; margin-bottom: 8px; }

.lvt-basket {
  position: sticky;
  bottom: 0;
  background: var(--primary);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  z-index: 10;
}
.lvt-basket .lvt-basket-count { font-weight: 700; font-size: 14px; }
.lvt-basket .lvt-basket-lines { font-size: 11px; opacity: 0.85; }
.lvt-basket .lvt-basket-grow { flex: 1; }
.lvt-basket button {
  background: var(--surface);
  color: var(--primary);
  border: 0;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .lvt-split { display: block; }
  .lvt-detail {
    max-height: none;
    position: static;
    overflow: visible;
    margin-top: 12px;
  }
  .lvt-detail-inline {
    margin: -1px 0 12px 0;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: var(--gray-50);
    box-shadow: 0 6px 14px -8px rgba(15, 23, 42, 0.18);
    animation: lvt-fold-in 0.18s ease-out;
  }
  .lvt-row.lvt-active {
    border-radius: 8px 8px 0 0;
    border-bottom-color: transparent;
  }
}
@keyframes lvt-fold-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  .lvt-stats { display: none; }
}
@media (max-width: 480px) {
  .lvt-row { grid-template-columns: 32px 1fr auto; }
  .lvt-row .lvt-chips { display: none; }
  .lvt-pd-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .lvt-pd-stat { padding: 8px 6px; }
  .lvt-pd-stat .lvt-pd-stat-value { font-size: 17px; }
  .lvt-pd-stat .lvt-pd-stat-label { font-size: 14px; }
  .lvt-section-title { margin: 10px 0 6px; font-size: 14px; }
  .lvt-stock-adjust { padding: 8px 10px; gap: 6px 10px; margin-bottom: 4px; }
  .lvt-stock-adjust .lvt-stock-adjust-label { font-size: 14px; }
  .lvt-stock-adjust .lvt-stock-adjust-hint { font-size: 14px; }
  .lvt-actions { margin-top: 10px; padding-top: 10px; gap: 6px; }
}

/* ============================================================
   STICKY FILTER BAR — mobile only, smart-hide on scroll
   ============================================================ */
.sf-bar { display: none; }
@media (max-width: 1024px) {
  .sf-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 35;
    align-items: center;
    gap: 8px;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom, 8px));
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    transform: translateY(0);
    transition: transform .22s cubic-bezier(.2,.7,.3,1);
    box-shadow: 0 -4px 10px -6px rgba(15, 23, 42, 0.18);
  }
  .sf-bar.hide { transform: translateY(110%); }
  .sf-bar .sf-title {
    font-size: 13px; font-weight: 700; color: var(--text);
    white-space: nowrap;
  }
  .sf-bar .sf-chips {
    display: flex; gap: 4px; flex: 1; min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sf-bar .sf-chips::-webkit-scrollbar { display: none; }
  .sf-bar .sf-chip {
    flex-shrink: 0;
    background: rgba(26, 106, 163, 0.10);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    white-space: nowrap;
  }
  .sf-bar .sf-chip-empty {
    color: var(--text-muted);
    background: transparent;
    font-weight: 500;
  }
  .sf-bar .sf-edit {
    flex-shrink: 0;
    height: 32px; padding: 0 12px;
    background: var(--primary);
    color: var(--surface);
    border: 0; border-radius: 6px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .sf-bar .sf-edit:active { transform: scale(0.96); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   DASHBOARD CARD — Lage voorraad (compacte versie)
   ============================================================ */
.lvc { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lvc-head { padding: 14px 16px 8px; display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lvc-head .lvc-ttl { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.lvc-head .lvc-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: lvc-pulse 2s infinite; }
@keyframes lvc-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.4); } }
.lvc-head .lvc-ttl small { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.lvc-head .lvc-grow { flex: 1; }
.lvc-head .lvc-open { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600; cursor: pointer; }
.lvc-head .lvc-open:hover { text-decoration: underline; }

.lvc-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); padding: 0; margin: 8px 0 0; }
.lvc-mini { background: var(--surface); padding: 10px 12px; text-align: center; }
.lvc-mini .lvc-mv { font-size: 18px; font-weight: 700; line-height: 1; color: var(--text); }
.lvc-mini .lvc-ml { font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.lvc-mini.lvc-danger .lvc-mv { color: var(--danger); }
.lvc-mini.lvc-warning .lvc-mv { color: var(--warning); }

.lvc-rows { padding: 6px 4px; }
.lvc-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.lvc-row:hover { background: var(--gray-50); }
.lvc-row::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; }
.lvc-row.lvc-crit::before { background: var(--danger); }
.lvc-row.lvc-low::before { background: var(--warning); }
.lvc-row .lvc-lg {
  width: 28px; height: 28px;
  border-radius: 4px; background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 3px;
}
.lvc-row .lvc-lg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lvc-row .lvc-nm { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvc-row .lvc-mt { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvc-row .lvc-qt { font-size: 11px; color: var(--text-muted); text-align: right; }
.lvc-row .lvc-qt b { color: var(--danger); font-size: 13px; display: block; line-height: 1.2; }
.lvc-row.lvc-low .lvc-qt b { color: var(--warning); }
.lvc-row .lvc-ec { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.lvc-row .lvc-ec .lvc-e {
  display: inline-flex; gap: 3px; align-items: center;
  padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.lvc-row .lvc-ec .lvc-e.lvc-ok { background: rgba(0, 193, 48, 0.12); color: var(--accent-800); }
.lvc-row .lvc-ec .lvc-e.lvc-so { background: rgba(239, 108, 0, 0.12); color: var(--warning-700); }
.lvc-row .lvc-ec .lvc-e.lvc-no { background: rgba(220, 53, 69, 0.10); color: var(--danger-700); }
.lvc-row .lvc-ec .lvc-age { font-size: 10px; color: var(--text-muted); }

.lvc-foot {
  background: var(--gray-50);
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
}
.lvc-foot strong { color: var(--text); }
.lvc-foot a { color: var(--primary); text-decoration: none; font-weight: 600; margin-left: auto; cursor: pointer; }
.lvc-foot a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .lvc-row { grid-template-columns: 28px 1fr auto; }
  .lvc-row .lvc-ec { display: none; }
}

/* ============================================================
   Variant B: Prominent stock card on product detail
   Container queries so split-aside (narrow pane) scales same as mobile
   ============================================================ */
.pd-card-prominent {
  border: 1px solid var(--primary-100);
  padding: 0;
  overflow: hidden;
  container-type: inline-size;
  container-name: pd-stock;
}
.pd-stock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--primary-100);
  border-left: 3px solid var(--primary, var(--primary));
}
.pd-stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--primary-100);
  border-radius: 999px;
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pd-stock-pill svg { width: 14px; height: 14px; color: var(--primary, var(--primary)); }
.pd-stock-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.pd-stock-sub strong { color: var(--primary-700); font-weight: 700; }
.pd-stock-body { padding: 14px 16px; }

.pd-stock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.pd-stock-stat {
  border: 1px solid var(--border);
  border-radius: var(--r-btn, 6px);
  padding: 10px 8px;
  background: var(--surface);
  text-align: center;
  min-width: 0;
}
.pd-stock-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}
.pd-stock-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-700);
  margin-top: 2px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.pd-stock-stat-edit svg { width: 11px; height: 11px; color: var(--text-muted); }
.pd-stock-stat-warn {
  background: var(--warning-50, var(--surface)4e6);
  border-color: var(--warning-200);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pd-stock-stat-warn:hover { box-shadow: 0 1px 4px rgba(239, 108, 0, 0.15); }
.pd-stock-stat-warn:active { transform: scale(0.98); }
.pd-stock-stat-warn .pd-stock-stat-val { color: var(--warning, var(--warning)); }
.pd-stock-stat-warn .pd-stock-stat-edit svg { color: var(--warning, var(--warning)); }
.pd-stock-stat-good {
  background: var(--accent-50);
  border-color: var(--accent-200);
}
.pd-stock-stat-good .pd-stock-stat-val { color: var(--accent-dark, var(--accent-dark)); }
.pd-stock-stat-muted {
  background: var(--primary-50);
  border-color: var(--primary-100);
}

.pd-stock-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.pd-stock-section-title:first-child { margin-top: 0; }

.pd-card-prominent .loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.pd-card-prominent .loc-grid-single { grid-template-columns: 1fr; }
.pd-card-prominent .loc-grid-single .loc { width: 100%; }

.pd-min-edit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 12px 0 0;
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-btn, 6px);
  flex-wrap: wrap;
  transition: box-shadow 0.3s ease;
}
.pd-min-edit-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-700);
  flex: 1 1 auto;
  min-width: 0;
}
.pd-min-edit .qty { flex: 0 0 auto; }
.pd-min-edit-flash {
  box-shadow: 0 0 0 3px rgba(26, 106, 163, 0.25);
}

.vendor-row.vendor-row-head {
  font: 600 11px/1 var(--font, system-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  border-left-color: transparent !important;
  cursor: default;
}
.vendor-row.vendor-row-head:hover {
  background: var(--surface-muted);
  border-left-color: transparent !important;
}
.vendor-row.vendor-row-head .vendor-name,
.vendor-row.vendor-row-head .vendor-sku,
.vendor-row.vendor-row-head .vendor-price {
  font: inherit;
  color: inherit;
}
.vendor-row.vendor-row-head .vendor-name {
  display: block;
}
@media (max-width: 768px) {
  .vendor-row.vendor-row-head { display: none; }
}

.pd-card-prominent .bv-strip-pd {
  margin: 0;
  border-radius: 0;
  border-top: 1px solid var(--primary-100);
}

/* Product detail card boundaries need a visible edge on white surfaces.
   Scoped to .pd-grid so shared card primitives keep their default border. */
.pd-grid [class~="card"] {
  border-color: var(--primary-200);
  box-shadow: 0 0 0 1px rgba(26, 106, 163, 0.08);
}
.pd-grid [class~="card"]:hover {
  border-color: var(--primary-300);
}
.pd-grid .card-title,
.pd-grid .info-row,
.pd-grid .vendor-row,
.pd-grid .mov-row,
.pd-grid .pd-stock-section-title,
.pd-grid .pd-mov-section-title {
  border-color: var(--primary-100);
}

/* Container-query scaling: narrow pane (split-aside) and small screens */
@container pd-stock (max-width: 460px) {
  .pd-stock-head { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  .pd-stock-sub { margin-left: 0; flex: 1 1 100%; font-size: 11px; }
  .pd-stock-body { padding: 12px; }
  .pd-stock-stats { gap: 6px; }
  .pd-stock-stat { padding: 8px 4px; }
  .pd-stock-stat-label { font-size: 10px; gap: 3px; }
  .pd-stock-stat-val { font-size: 18px; }
  .pd-card-prominent .loc-grid { grid-template-columns: 1fr; }
  .pd-min-edit { padding: 8px 10px; gap: 8px; }
  .pd-min-edit-label { flex: 1 1 100%; }
}
@container pd-stock (max-width: 340px) {
  .pd-stock-stat-val { font-size: 16px; }
  .pd-stock-stat-label { font-size: 9px; letter-spacing: 0.02em; }
}
/* Fallback for browsers without container query support */
@supports not (container-type: inline-size) {
  @media (max-width: 480px) {
    .pd-stock-head { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
    .pd-stock-sub { margin-left: 0; flex: 1 1 100%; font-size: 14px; }
    .pd-stock-body { padding: 12px; }
    .pd-stock-stats { gap: 6px; }
    .pd-stock-stat { padding: 8px 4px; }
    .pd-stock-stat-label { font-size: 14px; gap: 3px; }
    .pd-stock-stat-val { font-size: 18px; }
    .pd-card-prominent .loc-grid { grid-template-columns: 1fr; }
    .pd-min-edit { padding: 8px 10px; gap: 8px; }
    .pd-min-edit-label { flex: 1 1 100%; }
  }
}

/* ============================================================
   Bestelverzoeken — actie-rijen (variant B)
   Used on: goederenstroom (incoming) + dashboard homepage
   ============================================================ */
.br-bv { display: flex; flex-direction: column; gap: 8px; }
.br-bv-empty { padding: 16px; color: var(--text-muted); font-size: 13px; text-align: center; }
.br-bv-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--primary-50); border: 1px solid var(--primary-100);
  border-radius: var(--r-card); font-size: 13px;
}
.br-bv-summary .num { font-weight: 700; color: var(--primary); }
.br-bv-summary .pipe { width: 1px; height: 16px; background: var(--primary-100); }
.br-bv-summary .actions { margin-left: auto; display: flex; gap: 6px; }

.br-bv-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin: 8px 0 4px;
  background: var(--surface-muted, var(--primary-50));
  border-left: 3px solid var(--primary);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.br-bv-group-head .text-muted { font-weight: 400; }

.br-bv-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--r-card);
}
.br-bv-row .br-icon {
  width: 30px; height: 30px;
  border-radius: var(--r-btn);
  background: var(--warning-50);
  color: var(--warning);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.br-bv-row .br-body { min-width: 0; }
.br-bv-row .br-name {
  font-weight: 600; font-size: 13px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.br-bv-row .br-sub {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.br-bv-row .br-qty-pill {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--warning-50); color: var(--warning);
  padding: 4px 10px; border-radius: var(--r-btn);
  min-width: 48px;
}
.br-bv-row .br-qty-pill .n { font-weight: 700; font-size: 16px; line-height: 1; }
.br-bv-row .br-qty-pill .u { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.br-bv-row .br-req {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap;
}
.br-bv-row .br-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 600; font-size: 11px; line-height: 1;
  flex-shrink: 0;
}
.br-bv-row .br-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Mobile/narrow: collapse to 2 columns + stack request/actions row */
@media (max-width: 768px) {
  .br-bv-row {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 10px;
  }
  .br-bv-row .br-req,
  .br-bv-row .br-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .br-bv-row .br-actions { justify-content: flex-end; }
  .br-bv-summary { flex-wrap: wrap; gap: 8px; }
  .br-bv-summary .pipe { display: none; }
  .br-bv-summary .actions { margin-left: 0; flex: 1 1 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
  .br-bv-row .br-name { white-space: normal; }
  .br-bv-row .br-sub { font-size: 14px; }
}

/* =============================================
   Bento Vivid dashboard
   ============================================= */

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bento-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.bento-card:hover {
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 18px rgba(15,23,42,.05);
}

/* Bento spans */
.b-hero { grid-column: span 8; }
.b-donut { grid-column: span 4; grid-row: span 2; }
.b-kpi { grid-column: span 2; }
.b-half { grid-column: span 6; }
.b-two-thirds { grid-column: span 8; }
.b-one-third { grid-column: span 4; }
.b-full { grid-column: 1 / -1; }

/* Bento card eyebrow (top-left tag) */
.bento-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.bento-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,193,48,0.15);
}
.bento-eyebrow .dot.warn { background: var(--warning); box-shadow: 0 0 0 2px rgba(239,108,0,0.15); }
.bento-eyebrow .dot.primary { background: var(--primary); box-shadow: 0 0 0 2px rgba(26,106,163,0.15); }
.bento-eyebrow .dot.purple { background: var(--chart-4); box-shadow: 0 0 0 2px rgba(139,92,246,0.15); }

.bento-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.bento-card-title .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: auto;
}

/* Hero — gradient blue → green */
.bento-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 45%, var(--accent-500) 100%);
  color: var(--surface);
  border: 0;
  padding: 22px;
  min-height: 168px;
  justify-content: space-between;
}
.bento-hero::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -70px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.bento-hero .bento-eyebrow { color: rgba(255,255,255,0.7); }
.bento-hero .bento-eyebrow .dot { background: var(--accent-300); box-shadow: 0 0 0 2px rgba(255,255,255,0.2); }
.bento-hero .hero-greeting {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 4px;
}
.bento-hero .hero-num {
  font: 700 clamp(36px, 5vw, 52px) var(--font);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--surface);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.bento-hero .hero-num .currency {
  font-size: 0.55em;
  font-weight: 500;
  opacity: 0.7;
  margin-right: 4px;
  vertical-align: 0.18em;
}
.bento-hero .hero-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.bento-hero .hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: var(--surface);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.bento-hero .hero-chip.up { background: rgba(113,208,147,0.22); }
.bento-hero .hero-chip.down { background: rgba(251,113,133,0.22); }
.bento-hero .hero-chip.flat { background: rgba(255,255,255,0.12); }
.bento-hero .hero-spark { flex: 1 1 auto; min-width: 80px; height: 36px; opacity: 0.85; }
.bento-hero .hero-spark .line { stroke: var(--accent-300); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.bento-hero .hero-spark .area { fill: rgba(113,208,147,0.25); stroke: none; }

/* KPI tinted cards — vivid signature */
.bento-kpi {
  padding: 14px 14px 12px;
  border-radius: 12px;
  border-top-width: 3px;
  border-top-style: solid;
  background: linear-gradient(180deg, var(--kpi-bg, rgba(26,106,163,0.06)) 0%, var(--surface) 65%);
  min-height: 110px;
}
.bento-kpi.kpi-primary { border-top-color: var(--primary); --kpi-bg: rgba(26,106,163,0.07); }
.bento-kpi.kpi-warn    { border-top-color: var(--warning); --kpi-bg: rgba(239,108,0,0.08); }
.bento-kpi.kpi-accent  { border-top-color: var(--accent); --kpi-bg: rgba(0,193,48,0.08); }
.bento-kpi.kpi-purple  { border-top-color: var(--chart-4); --kpi-bg: rgba(139,92,246,0.08); }
.bento-kpi.kpi-danger  { border-top-color: var(--danger); --kpi-bg: rgba(220,53,69,0.07); }

.bento-kpi .kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.bento-kpi .kpi-num {
  font: 700 24px/1.05 var(--font);
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.bento-kpi.kpi-primary .kpi-num { color: var(--primary); }
.bento-kpi.kpi-warn .kpi-num    { color: var(--warning); }
.bento-kpi.kpi-accent .kpi-num  { color: var(--accent-800); }
.bento-kpi.kpi-purple .kpi-num  { color: var(--chart-4); }
.bento-kpi.kpi-danger .kpi-num  { color: var(--danger); }
.bento-kpi .kpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  min-height: 22px;
}
.bento-kpi .kpi-row .spark { width: 64px; height: 22px; }

/* Donut card — rainbow stripe + ring layout */
.bento-card.donut-card {
  padding-top: 22px;
  min-height: 348px;
}
.bento-card.donut-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--warning), var(--chart-4), var(--chart-5));
}
.donut-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.donut-canvas-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex: 0 0 auto;
}
.donut-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 6px 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.donut-total .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.donut-total .v {
  font: 700 16px/1 var(--font);
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.donut-legend {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  font-size: 12px;
}
.donut-legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.donut-legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.donut-legend .name {
  flex: 1 1 auto;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.donut-legend .val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

/* Bento responsive */
@media (max-width: 1024px) {
  .b-hero { grid-column: span 12; }
  .b-donut { grid-column: span 12; grid-row: auto; }
  .bento-card.donut-card { min-height: 0; }
  .b-kpi { grid-column: span 3; }
}
@media (max-width: 768px) {
  .bento { gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .b-hero, .b-donut, .b-full, .b-two-thirds, .b-one-third, .b-half { grid-column: 1 / -1; }
  .b-kpi { grid-column: span 3; }
  .bento-hero { padding: 18px; min-height: 0; }
  .bento-hero .hero-num { font-size: 36px; }
}
@media (max-width: 480px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-kpi { grid-column: span 1; }
  .bento-kpi { min-height: 92px; }
  .bento-kpi .kpi-num { font-size: 20px; }
  .donut-canvas-wrap { width: 140px; height: 140px; }
}

/* === Bulk tray (Spec 2) === */
.bulk-tray-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}
.bulk-tray-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.bulk-tray-list { display: flex; flex-direction: column; gap: 8px; }
.bulk-tray-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.bulk-tray-icon { display: flex; align-items: center; justify-content: center; }
.bulk-tray-info { min-width: 0; }
.bulk-tray-name {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bulk-tray-sub { font-size: 12px; color: var(--text-muted); }
.bulk-tray-error {
  margin-top: 4px;
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  background: rgba(220, 53, 69, .1);
  color: var(--danger);
}
.bulk-tray-stepper {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}
.bulk-tray-stepper button {
  border: 0; background: transparent;
  min-width: 44px; height: 44px;
  font-size: 18px; font-weight: 600;
  cursor: pointer;
}
.bulk-tray-stepper .step-value { min-width: 56px; font-size: 16px; }
.bulk-tray-stepper.pos .step-value { color: var(--accent); }
.bulk-tray-stepper.neg .step-value { color: var(--warning); }
.bulk-tray-stepper.zero .step-value { color: var(--text-muted); }
.bulk-tray-remove {
  border: 0; background: transparent;
  width: 32px; height: 32px;
  font-size: 22px; color: var(--text-muted);
  cursor: pointer; border-radius: 4px;
}
.bulk-tray-remove:hover { background: rgba(220,53,69,.1); color: var(--danger); }
.bulk-tray-footer {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.bulk-tray-summary {
  flex: 1; font-size: 13px; color: var(--text-muted);
}
.bulk-search-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.bulk-search-result {
  text-align: left;
  display: flex; flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface); cursor: pointer;
}
.bulk-search-result:hover { background: var(--surface-muted); }
.bulk-search-name { font-weight: 600; font-size: 14px; }
.bulk-search-meta { font-size: 12px; color: var(--text-muted); }
.bulk-search-empty, .bulk-search-error {
  padding: 8px 12px; font-size: 13px;
  color: var(--text-muted);
}
.bulk-search-error { color: var(--danger); }

@media (max-width: 480px) {
  .bulk-tray-row {
    grid-template-columns: 28px 1fr auto;
    gap: 8px;
    padding: 8px;
  }
  .bulk-tray-row .bulk-tray-remove { grid-column: 3; grid-row: 1; }
  .bulk-tray-stepper {
    grid-column: 1 / -1; grid-row: 2;
    justify-self: stretch; width: 100%;
  }
  .bulk-tray-stepper button { flex: 1; }
  .bulk-tray-footer { flex-wrap: wrap; }
  .bulk-tray-summary { flex-basis: 100%; order: -1; text-align: center; }
}

/* === URL-Scrape Modal === */
.url-scrape-textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}
.url-scrape-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 106, 163, 0.15);
}
.url-scrape-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.url-scrape-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}
.url-scrape-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  min-width: 0;
}
.url-scrape-row.dup {
  border-color: var(--warning);
  background: rgba(239, 108, 0, 0.05);
}
.url-scrape-row.err {
  border-color: var(--danger);
  background: rgba(220, 53, 69, 0.05);
}
.url-scrape-row .meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.url-scrape-row .url-line {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}
.url-scrape-row .field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.url-scrape-row .field-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}
.url-scrape-row .field-grid input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
}
.url-scrape-row .field-grid input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 106, 163, 0.15);
}
.url-scrape-row .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.url-scrape-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.modal-tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}
.modal-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--surface);
  margin-bottom: -1px;
}
.modal-tab:hover:not(.active) {
  background: var(--gray-200);
}
.modal-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .url-scrape-row .field-grid { grid-template-columns: 1fr; }
  .url-scrape-row .row-actions { justify-content: stretch; }
  .url-scrape-row .row-actions [class~="btn"] { flex: 1; }
  .modal-tab { font-size: 14px; padding: 8px 10px; }
}

/* === qty-confirm bar — centered variant (Codex 2026-04-29) === */
.qty-confirm-bar.qty-confirm-bar--centered {
  justify-content: center;
  gap: 18px;
  padding-left: 24px;
  padding-right: 24px;
}
.qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-info {
  flex: 0 1 auto;
  max-width: min(560px, calc(100vw - 280px));
  text-align: center;
}
.qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
}
.qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-title span {
  color: var(--color-text-secondary) !important;
  font-weight: 650 !important;
}
.qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-summary {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-actions {
  align-items: center;
}
.qty-confirm-bar.qty-confirm-bar--centered .btn-confirm {
  min-width: 124px;
  font-weight: 750;
}
.qty-confirm-bar.qty-confirm-bar--centered .btn-cancel {
  color: var(--color-text-secondary);
  font-weight: 650;
}
@media (max-width: 768px) {
  .qty-confirm-bar.qty-confirm-bar--centered {
    flex-direction: column;
    gap: 10px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-info {
    max-width: 100%;
  }
  .qty-confirm-bar.qty-confirm-bar--centered .qty-confirm-bar-actions {
    width: 100%;
    justify-content: center;
  }
  .qty-confirm-bar.qty-confirm-bar--centered .btn-confirm {
    min-width: 136px;
  }
}

/* === Parser confidence panel (Leveranciers) === */
.parser-conf-card {
  margin-bottom: 16px;
  padding: 12px 16px;
}
.parser-conf-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.parser-conf-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.parser-conf-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.parser-conf-grid-head,
.parser-conf-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) 1fr 0.7fr 1.3fr 0.8fr;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}
.parser-conf-grid-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.parser-conf-row + .parser-conf-row {
  border-top: 1px solid var(--border);
}
.parser-conf-domain {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.parser-conf-host {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.parser-conf-counts,
.parser-conf-ratio,
.parser-conf-when {
  color: var(--text);
}
@media (max-width: 768px) {
  .parser-conf-grid-head { display: none; }
  .parser-conf-row {
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    padding: 8px 0;
  }
  .parser-conf-row .parser-conf-domain { grid-column: 1 / 2; grid-row: 1 / 3; }
  .parser-conf-row .parser-conf-badge  { grid-column: 2 / 3; grid-row: 1 / 2; justify-self: end; }
  .parser-conf-row .parser-conf-counts { grid-column: 1 / 3; grid-row: 3 / 4; font-size: 14px; color: var(--text-muted); }
  .parser-conf-row .parser-conf-ratio  { grid-column: 1 / 2; grid-row: 4 / 5; font-size: 14px; color: var(--text-muted); }
  .parser-conf-row .parser-conf-when   { grid-column: 2 / 3; grid-row: 4 / 5; font-size: 14px; color: var(--text-muted); justify-self: end; }
}

/* Staleness badge — vendor row when MAX(stock_last_check) > 26h or null */
.badge-stale {
  background: var(--warning-50);
  color: var(--warning);
  margin-left: 6px;
  cursor: help;
}

/* === Runtime helper classes emitted by SPA renderers === */
.plain-link {
  color: inherit;
  text-decoration: none;
}

.muted { color: var(--text-muted); }
.show { display: block; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface-muted);
  color: var(--text);
}
.alert-info {
  background: var(--primary-50);
  border-color: var(--primary-100);
  color: var(--primary-dark);
}
.alert-success {
  background: var(--accent-50);
  border-color: var(--accent-200);
  color: var(--accent-dark);
}
.alert-warning {
  background: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning);
}

.chip-success {
  background: var(--accent-50);
  color: var(--accent-dark);
}
.chip-warn {
  background: var(--warning-50);
  color: var(--warning);
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table-sm th,
.table-sm td {
  padding: 6px 8px;
}

.tl-head,
.run-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: 500 13px/1 var(--font);
}
.tab-btn.active {
  border-color: var(--primary-100);
  background: var(--primary-50);
  color: var(--primary-dark);
}

/* Mobile audit refinements for inventory pages. These are scoped to local page
   composition and leave shared RRB primitives/responsive files unchanged. */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
  }
  .stats-grid > .stat {
    min-width: 0;
    overflow: hidden;
    padding: 12px;
  }
  .stats-grid > .stat .stat-label,
  .stats-grid > .stat .stat-value,
  .stats-grid > .stat .stat-meta {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .page-container,
  .page-body,
  .page-body > *,
  .page-body .card,
  .page-body .bento-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .page-container,
  .page-body {
    width: 100%;
    overflow-x: clip;
  }

  .back-btn,
  .tab-item,
  .tab-btn,
  .prod-mfilter-pill,
  .sf-bar .sf-edit {
    min-height: 44px;
    touch-action: manipulation;
  }
  .back-btn {
    padding: 0 14px;
  }
  .tab-bar {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-item,
  .tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 14px;
    white-space: nowrap;
  }
  .prod-mfilter-pill {
    height: auto;
    border-radius: 999px;
    padding: 0 14px;
  }
  .sf-bar .sf-edit {
    height: 44px;
    padding: 0 14px;
    font-size: 13px;
  }
  .pd-title-nav {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .page-body .plain-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .page-body a[href]:not(.nav-item):not(.skip-link) {
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
  .page-body .btn-sm {
    min-width: 36px;
  }
  .page-body .form-control,
  .scanner-inline-manual input {
    min-height: 44px;
    font-size: 16px;
  }
  .page-body input[type="range"] {
    min-height: 36px;
  }
  .scanner-inline-manual button,
  .page-body summary,
  .scanner-container summary,
  .scanner-processed-summary {
    min-height: 44px;
  }
  .page-body summary,
  .scanner-container summary,
  .scanner-processed-summary {
    display: flex;
    align-items: center;
  }
  .scanner-scan-count {
    min-width: 36px;
    height: 36px;
    border-radius: 18px;
  }
  .page-body input[type="checkbox"]:not(.toggle-input) {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    accent-color: var(--primary);
  }
  .prod-row {
    grid-template-columns: 28px 22px minmax(0, 1fr) auto;
    padding: 6px 8px;
    gap: 6px;
  }
  /* Row checkbox stays compact — qty-chip already eats the row width. */
  .page-body .prod-row > input[type="checkbox"]:not(.toggle-input) {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    justify-self: center;
  }
  .page-body .qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
  }
  /* Row qty buttons stay tappable but trim horizontal so name room blijft. */
  .page-body .prod-row .prod-qty-chip .qty-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px;
    min-height: 30px;
    font-size: 16px;
  }
  .prod-row .prod-qty-chip {
    padding: 2px 4px;
    gap: 2px;
  }
  .prod-row .prod-qty-chip .qty-val {
    min-width: 20px;
    font-size: 13px;
  }
  /* Rij-boxen tegen schermrand — page-container heeft 12px padding. */
  .prod-list-shell {
    margin-left: -12px;
    margin-right: -12px;
  }
  /* Bulk-bar past op één rij: korte counter, kleinere knoppen, geen auto-margin. */
  .bulk-bar {
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    gap: 4px;
  }
  .bulk-bar span {
    flex-basis: auto;
    font-size: 13px;
    margin-right: 4px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .bulk-bar [class~="btn"] {
    font-size: 12px;
    padding: 6px 8px;
    min-height: 36px;
    flex: 0 1 auto;
  }
  .bulk-bar .btn-danger { margin-left: 0; }
  .page-body .responsive-table .data-table tr {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .page-body .responsive-table .data-table td {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .page-body .responsive-table .data-table td::before {
    flex: 0 1 118px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .page-body .responsive-table .data-table td > * {
    min-width: 0;
    max-width: 100%;
  }
  .page-body .responsive-table .chip {
    height: auto;
    min-height: 24px;
    white-space: normal;
    line-height: 1.3;
  }
  .page-body .editable-field {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .page-body .qty input {
    min-height: 36px;
  }
  .page-body .pd-collapsible-header {
    min-height: 44px;
    align-items: center;
  }
  [data-archetype="settings"] .badge {
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
    align-items: center;
  }

  [data-archetype="settings"],
  [data-archetype="settings"] .detail-grid,
  [data-archetype="settings"] .card,
  [data-archetype="settings"] .table-container,
  [data-archetype="settings"] .responsive-table {
    min-width: 0;
    max-width: 100%;
  }
  [data-archetype="settings"] .card {
    overflow: hidden;
  }
  [data-archetype="settings"] .card > [style*="margin:0 -16px"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
  }
  [data-archetype="settings"] .info-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0;
  }
  [data-archetype="settings"] .info-row .lbl,
  [data-archetype="settings"] .info-row .val {
    flex: 1 1 100%;
    max-width: 100%;
  }
  [data-archetype="settings"] .info-row .val {
    justify-content: flex-start;
    text-align: left;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }
  [data-archetype="settings"] .font-mono,
  [data-archetype="settings"] code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  [data-archetype="settings"] .form-control {
    max-width: 100% !important;
  }
  [data-archetype="settings"] .responsive-table .data-table tr {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  [data-archetype="settings"] .responsive-table .data-table td {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  [data-archetype="settings"] .responsive-table .data-table td::before {
    flex: 0 1 118px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  [data-archetype="settings"] .responsive-table .data-table td > * {
    min-width: 0;
    max-width: 100%;
  }
  [data-archetype="settings"] .list-row {
    align-items: flex-start;
    flex-wrap: wrap;
    min-width: 0;
    padding: 12px;
  }
  [data-archetype="settings"] .list-row > div:not(.ico):not(.trail) {
    flex: 1 1 min(100%, 180px);
    min-width: 0;
  }
  [data-archetype="settings"] .list-row .title,
  [data-archetype="settings"] .list-row .sub {
    overflow-wrap: anywhere;
  }
  [data-archetype="settings"] .list-row .trail {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 360px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.fi-btn,
.dash-queue-process-btn,
.scanner-hud-retry,
.scanner-torch-btn,
.scanner-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fi-btn-new,
.fi-btn-search,
.dash-sort-indicator,
.dash-low-stock-sort-indicator {
  color: var(--primary-dark);
}
.fi-btn-accept { color: var(--accent-dark); }
.fi-btn-skip { color: var(--text-muted); }

.fi-product-option,
.scanner-queue-product,
.scanner-start-block,
.scanner-bulk-order-actions,
.scanner-bulk-unknown-actions {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
}

.scanner-bulk-mode,
.dash-queue-title-text,
.pd-card-vendors,
.prod-list,
.dr-input {
  min-width: 0;
}
.dr-input { width: 100%; }

.barcode-line,
.scanner-mut-headline,
.qty-display-loc1,
.qty-display-loc2,
.qty-display-total {
  font-variant-numeric: tabular-nums;
}

.brand-icon-initials,
.brand-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prod-split.has-selected {
  border-color: var(--primary-100);
  box-shadow: var(--e1);
}
.scanner-mode-camera .scanner-start-block {
  border-color: var(--primary-100);
}
