@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #f0f3f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #dde3ed;
  --border-subtle: #eaeff6;
  --text: #0f1923;
  --text-2: #3d4f63;
  --muted: #7a8fa6;
  --text-muted: #7a8fa6;
  --accent: #0b4fcc;
  --accent-light: #e8effd;
  --accent-hover: #0940aa;
  --danger: #c0282d;
  --danger-light: #fdecea;
  --success: #137a4a;
  --success-light: #e6f5ec;
  --warning: #b35d00;
  --warning-light: #fff3e0;
  --shadow-sm: 0 1px 3px rgba(15,25,35,0.07), 0 1px 2px rgba(15,25,35,0.04);
  --shadow-md: 0 4px 12px rgba(15,25,35,0.08), 0 2px 4px rgba(15,25,35,0.04);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 220px;
  --ui-font-scale: 0.90;
  --ui-fs-8: 7.2px;
  --ui-fs-10: 9px;
  --ui-fs-10-5: 9.45px;
  --ui-fs-11: 9.9px;
  --ui-fs-12: 10.8px;
  --ui-fs-13: 11.7px;
  --ui-fs-13-5: 12.15px;
  --ui-fs-14: 12.6px;
  --ui-fs-15: 13.5px;
  --ui-fs-16: 14.4px;
  --ui-fs-18: 16.2px;
  --ui-fs-20: 18px;
  --ui-fs-22: 19.8px;
  --ui-fs-26: 23.4px;
  --ui-fs-32: 28.8px;
  font-family: 'DM Sans', sans-serif;
  font-size: var(--ui-fs-13);
}


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

body { background: var(--bg); color: var(--text); min-height: 100vh; display: flex; overflow-x: hidden; }

/* Login */
#loginWrapper {
  width: 100%; display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0b3580 0%, #0b4fcc 50%, #1a68e8 100%);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 44px 40px; width: 380px;
  box-shadow: 0 20px 60px rgba(11,25,55,0.25);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-logo svg { flex-shrink: 0; }
.login-logo-text { line-height: 1.2; }
.login-logo-text span { display: block; font-size: var(--ui-fs-11); font-weight: 400; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }
.login-logo-text strong { font-size: var(--ui-fs-16); font-weight: 600; color: var(--text); }
.login-box h2 { font-size: var(--ui-fs-22); font-weight: 600; margin-bottom: 6px; }
.login-box p { color: var(--muted); font-size: var(--ui-fs-14); margin-bottom: 24px; }

/* Sidebar */
#sidebar {
  width: var(--sidebar-w); background: #0f1f38; min-height: 100vh;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0;
}
.sidebar-brand { padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-icon {
  width: 34px; height: 34px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.sidebar-brand strong { display: block; color: #fff; font-size: var(--ui-fs-13); font-weight: 600; line-height: 1.3; }
.sidebar-brand span { display: block; color: rgba(255,255,255,0.4); font-size: var(--ui-fs-11); margin-top: 2px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.nav-section {
  font-size: var(--ui-fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 7px; color: rgba(255,255,255,0.6); font-size: var(--ui-fs-13-5); font-weight: 500;
  cursor: pointer; transition: all 0.15s; margin-bottom: 1px;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; }
.user-avatar {
  width: 28px; height: 28px; background: rgba(255,255,255,0.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--ui-fs-12); font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; color: #fff; font-size: var(--ui-fs-13); font-weight: 500; }
.user-info span { display: block; color: rgba(255,255,255,0.4); font-size: var(--ui-fs-11); }
.logout-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: rgba(255,255,255,0.4); display: flex; align-items: center; border-radius: 4px; transition: color 0.15s;
}
.logout-btn:hover { color: #fff; }

/* Main */
#appMain { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 58px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 120; flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(15,25,35,0.04);
}
.topbar-title { font-size: var(--ui-fs-15); font-weight: 600; }
.topbar-sub { font-size: var(--ui-fs-12); color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.page-content { padding: 28px; flex: 1; }
.view { display: none; }
.view.active { display: block; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.dashboard-section-title {
  font-size: var(--ui-fs-12); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin: 2px 0 10px;
}
.dashboard-grid { display: grid; gap: 16px; margin-bottom: 24px; }
.dashboard-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-attention { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.stat-card.actionable { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.stat-card.actionable:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: #c3cedd; }
.stat-label { font-size: var(--ui-fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-size: var(--ui-fs-32); font-weight: 600; line-height: 1; color: var(--text); }
.stat-note { margin-top: 9px; font-size: var(--ui-fs-12); color: var(--muted); line-height: 1.35; }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.dashboard-insight-card .card-header { align-items: flex-start; gap: 14px; }
.card-subtitle { margin-top: 3px; font-size: var(--ui-fs-12); color: var(--muted); }
.dashboard-callout {
  margin: 14px 16px 0;
  padding: 10px 12px;
  border: 1px solid #d6e3f5;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--text-2);
  font-size: var(--ui-fs-13);
}

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
}
.card-title { font-size: var(--ui-fs-13); font-weight: 600; color: var(--text); }
.card-body { padding: 20px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: var(--ui-fs-12); font-weight: 500; color: var(--text-2); }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: var(--ui-fs-13); background: var(--surface); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,79,204,0.1);
}
textarea { resize: vertical; min-height: 72px; }


/* User Administration */
.user-admin-form {
  padding: 16px 18px 18px;
  margin-top: 0;
  align-items: end;
}
.user-admin-form .purchase-upload-action {
  align-self: end;
}
.user-admin-msg {
  margin: 0 18px 18px;
}
.user-admin-list-msg {
  margin: 10px 18px 12px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
  border-radius: var(--radius-sm); font: inherit; font-size: var(--ui-fs-13); font-weight: 500;
  cursor: pointer; transition: all 0.15s; border: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: #c0cad8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); padding: 6px 8px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: var(--ui-fs-12); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--ui-fs-13); }
thead th {
  background: var(--surface-2); padding: 10px 14px; text-align: left;
  font-size: var(--ui-fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td { padding: 11px 14px; color: var(--text); vertical-align: middle; }
td.mono { font-family: 'DM Mono', monospace; font-size: var(--ui-fs-12); color: var(--text-2); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: var(--ui-fs-11); font-weight: 500; }
.badge-ok { background: var(--success-light); color: var(--success); }
.badge-low { background: var(--danger-light); color: var(--danger); }
.badge-warn { background: var(--warning-light); color: var(--warning); }
.badge-in { background: var(--success-light); color: var(--success); }
.badge-out { background: var(--danger-light); color: var(--danger); }
.badge-adj { background: var(--accent-light); color: var(--accent); }
.badge-info { background: var(--accent-light); color: var(--accent); }

/* Search */
.search-bar { position: relative; }
.search-bar svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-bar input { padding-left: 34px; min-width: 220px; }

/* Messages */
.msg { font-size: var(--ui-fs-13); margin-top: 10px; min-height: 18px; }
.msg-ok { color: var(--success); }
.msg-err { color: var(--danger); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(10,18,30,0.45); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal, .modal-card { background: var(--surface); border-radius: 14px; width: 520px; max-width: calc(100vw - 40px); box-shadow: 0 24px 60px rgba(10,18,30,0.2); max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); color: var(--text); }
.modal-card { width: min(900px, calc(100vw - 40px)); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); background: var(--surface); }
.modal-header h3 { font-size: var(--ui-fs-16); font-weight: 600; margin: 0; }
.modal-header p { margin: 4px 0 0; color: var(--text-muted); font-size: var(--ui-fs-13); }
.modal-body { padding: 22px; background: var(--surface); }
.modal-footer, .modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-subtle); background: var(--surface); }

/* Misc */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state svg { opacity: 0.3; margin-bottom: 12px; }
.empty-state p { font-size: var(--ui-fs-13); }
.divider { border: none; border-top: 1px solid var(--border-subtle); margin: 16px 0; }
.hidden { display: none !important; }
.qty-positive { color: var(--success); font-weight: 500; }
.qty-negative { color: var(--danger); font-weight: 500; }
.qty-neutral { color: var(--text); font-weight: 500; }
tr.row-low td:first-child { border-left: 3px solid var(--danger); padding-left: 11px; }

@media (max-width: 1180px) {
  .dashboard-kpis, .dashboard-attention { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #sidebar { display: none; }
  #appMain { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .dashboard-kpis, .dashboard-attention { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BULK ADD — v3 additions
   ============================================================ */

/* Dropzone */
.ba-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg-secondary);
}
.ba-dropzone:hover, .ba-dropzone.drag-over {
  border-color: var(--accent);
  background: #f0f5ff;
}
.ba-dropzone-icon { color: var(--text-muted); margin-bottom: 8px; }
.ba-dropzone-label { font-size: var(--ui-fs-14); font-weight: 500; }
.ba-dropzone-label .link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.ba-dropzone-sub { font-size: var(--ui-fs-12); color: var(--text-muted); margin-top: 4px; }

/* File chip */
.ba-file-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #e8f0fe; color: #1a56db;
  padding: 5px 10px; border-radius: 6px; font-size: var(--ui-fs-13);
}
.ba-file-remove {
  background: none; border: none; cursor: pointer;
  color: #1a56db; font-size: var(--ui-fs-14); padding: 0; line-height: 1;
}

/* OCR scanning overlay */
.ba-scanning {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: #fffbea;
  border: 1px solid #fbbf24; border-radius: 8px;
  font-size: var(--ui-fs-13); color: #78350f; margin-top: 14px;
}
.ba-spinner {
  width: 16px; height: 16px;
  border: 2px solid #fbbf24; border-top-color: #d97706;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Review table */
.ba-review-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
.ba-review-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--ui-fs-12); min-width: 760px;
}
.ba-review-table thead th {
  padding: 8px 9px; text-align: left;
  font-size: var(--ui-fs-10); font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ba-review-table tbody tr { border-bottom: 1px solid var(--border); }
.ba-review-table tbody tr:hover { background: var(--bg-secondary); }
.ba-review-table td { padding: 5px 6px; vertical-align: middle; }
.ba-review-table input, .ba-review-table select {
  width: 100%; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: var(--ui-fs-12); background: var(--bg);
  color: var(--text); font-family: inherit;
  min-width: 80px;
}
.ba-review-table input:focus, .ba-review-table select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(11,79,204,.12);
}
.ba-cell-ref input { font-family: monospace; font-size: var(--ui-fs-11); min-width: 110px; }
.ba-cell-lot input { font-family: monospace; font-size: var(--ui-fs-11); min-width: 90px; }
.ba-cell-qty { text-align:center; white-space:nowrap; }
.ba-qty-readonly { display:inline-block; min-width:34px; padding:6px 10px; border:1px solid var(--border); border-radius:8px; background:var(--bg-secondary); font-weight:800; color:var(--primary); }

.ba-review-table .ba-cell-description input { min-width: 280px; }
.ba-review-table th.ba-desc-th { min-width: 280px; }
.ba-stage-description { min-width: 240px; max-width: 420px; white-space: normal; line-height: 1.3; }

/* Confidence badges in review grid */
.ba-conf { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ba-conf-high   { background: #22c55e; }
.ba-conf-medium { background: #f59e0b; }
.ba-conf-low    { background: #ef4444; }
.ba-conf-wrap   { display: flex; align-items: center; justify-content: center; gap: 4px; flex-direction: column; }

/* Engine badge — tiny label showing T (Tesseract), R (RapidOCR), or 2E (dual) */
.ba-engine-badge {
  font-size: var(--ui-fs-8); font-weight: 700; color: var(--text-muted);
  letter-spacing: .02em; line-height: 1;
}

/* Field-level confidence highlights — per-cell background tinting */
.ba-fc-low {
  background: #fef2f2 !important;  /* soft red tint */
}
.ba-fc-low input, .ba-fc-low select {
  border-color: #fca5a5 !important;
  background: #fff5f5 !important;
}
.ba-fc-med {
  background: #fffbeb !important;  /* soft amber tint */
}
.ba-fc-med input, .ba-fc-med select {
  border-color: #fcd34d !important;
  background: #fffef5 !important;
}

/* Warning banner */
.ba-warning-banner {
  padding: 8px 16px;
  background: #fffbea;
  border-bottom: 1px solid #fde68a;
  font-size: var(--ui-fs-12);
  color: #78350f;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.ba-warning-icon { flex: 0 0 auto; }
.ba-warning-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ba-warning-readmore {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0 2px;
  cursor: pointer;
  text-decoration: underline;
}
.ba-warning-readmore:hover { color: var(--primary-dark); }
.ba-warning-modal { width: 720px; }
.ba-warning-modal-summary {
  background: #fffbea;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #78350f;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: var(--ui-fs-13);
}
.ba-warning-details-list {
  margin: 0;
  padding-left: 22px;
  max-height: 55vh;
  overflow-y: auto;
  line-height: 1.45;
  font-size: var(--ui-fs-13);
}
.ba-warning-details-list li { margin-bottom: 8px; }

/* Field confidence legend */
.ba-fc-legend {
  padding: 6px 16px; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: var(--ui-fs-11); color: var(--text-muted);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.ba-fc-legend-label { font-weight: 600; color: var(--text-primary); }
.ba-fc-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.ba-fc-swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
}
.ba-fc-swatch-high { background: #f0fdf4; border: 1px solid #bbf7d0; }
.ba-fc-swatch-med  { background: #fffbeb; border: 1px solid #fcd34d; }
.ba-fc-swatch-low  { background: #fef2f2; border: 1px solid #fca5a5; }
.ba-fc-swatch-badge {
  width: auto; height: auto; font-size: var(--ui-fs-8); font-weight: 700;
  padding: 1px 3px; border-radius: 2px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Delete row button */
.ba-del-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px 4px; border-radius: 4px;
  font-size: var(--ui-fs-16); line-height: 1;
  transition: color .12s, background .12s;
}
.ba-del-btn:hover { color: var(--danger); background: #fee2e2; }

/* GTIN/UDI info sub-row below product rows */
.ba-gtin-row { background: var(--bg-secondary) !important; }
.ba-gtin-row:hover { background: var(--bg-secondary) !important; }
.ba-gtin-row code { font-family: 'Consolas', 'Monaco', monospace; }

/* Results summary */
.ba-results-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.ba-res-card {
  border-radius: 8px; padding: 12px 14px; text-align: center;
}
.ba-res-card .n { font-size: var(--ui-fs-26); font-weight: 700; }
.ba-res-card .l { font-size: var(--ui-fs-11); font-weight: 500; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.ba-res-created { background: #f0fdf4; color: #16a34a; }
.ba-res-skipped { background: #f1f5f9; color: #64748b; }
.ba-res-error   { background: #fef2f2; color: #dc2626; }

.ba-result-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 4px;
  font-size: var(--ui-fs-12);
}
.ba-result-row.created { background: #f0fdf4; }
.ba-result-row.skipped { background: #f8fafc; }
.ba-result-row.error   { background: #fef2f2; }
.ba-result-icon { font-size: var(--ui-fs-14); flex-shrink: 0; margin-top: 1px; }
.ba-result-sku  { font-family: monospace; font-weight: 600; }
.ba-result-msg  { color: var(--text-muted); }

/* Small select */
.ba-select-sm {
  padding: 5px 8px; font-size: var(--ui-fs-12);
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); cursor: pointer;
}

/* Expiry badge */
.exp-ok   { color: #16a34a; font-weight: 500; }
.exp-warn { color: #d97706; font-weight: 500; }
.exp-crit { color: #dc2626; font-weight: 500; }

/* nav-section label */
.nav-section {
  padding: 16px 16px 4px;
  font-size: var(--ui-fs-10); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.45);
}


/* Keep Mistral toggle labels on one line in bulk add + challan screens */
.mistral-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ui-fs-12);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.mistral-toggle-label-sm {
  gap: 6px;
  font-size: var(--ui-fs-13);
}

.mistral-toggle-label span {
  white-space: nowrap;
}


/* v16: keep Bulk Add review actions visible while the wide editable grid scrolls horizontally. */
#ba-step-review .card {
  max-width: 100%;
  overflow: hidden;
}
#ba-step-review .card-header {
  gap: 12px;
  align-items: flex-start;
}
#ba-step-review .card-header > div:first-child {
  min-width: 0;
}
#ba-step-review .card-header > div:last-child {
  flex: 0 0 auto;
  margin-left: auto;
  position: sticky;
  right: 12px;
  z-index: 4;
  background: var(--surface);
  padding-left: 10px;
}
#ba-step-review .ba-review-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.ba-postscan-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ba-timing-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.ba-timing-title {
  font-size: var(--ui-fs-12);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.ba-timing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ui-fs-11);
}
.ba-timing-table th, .ba-timing-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ba-timing-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: var(--ui-fs-10);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ba-timing-table tr:last-child td { border-bottom: none; }
.ba-review-debug-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  #ba-step-review .card-header {
    flex-wrap: wrap;
  }
  #ba-step-review .card-header > div:last-child {
    position: static;
    width: 100%;
    justify-content: flex-end;
  }
}

/* v46: movable zoomable image reference overlay; supports trackpad pinch/Ctrl+wheel pointer-centered zoom. */
.ba-image-overlay {
  position: fixed;
  width: min(480px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 120px));
  min-width: 260px;
  min-height: 220px;
  z-index: 900;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .24);
  overflow: hidden;
  resize: both;
}
.ba-image-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: move;
  user-select: none;
}
.ba-image-overlay-title {
  font-size: var(--ui-fs-12);
  font-weight: 700;
  color: var(--text);
}
.ba-image-overlay-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ba-image-overlay-actions button {
  min-width: 28px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--ui-fs-12);
  line-height: 1;
  cursor: pointer;
}
.ba-image-overlay-actions button:hover {
  background: var(--bg);
}
.ba-image-overlay-body {
  height: calc(100% - 43px);
  overflow: auto;
  background: #111827;
  display: block;
  overscroll-behavior: contain;
  /* Keep the image anchored at the true top-left.
     A centered flex child can overflow with negative left space; then scrollLeft=0
     still hides part of the image. */
}
.ba-image-overlay-body img {
  display: block;
  height: auto;
  object-fit: contain;
  transform-origin: top left;
  margin: 0;
}
.ba-image-dragging, .ba-image-dragging * {
  cursor: grabbing !important;
}

/* v47: click-and-drag panning inside zoomed image reference panel. */
.ba-image-overlay-body {
  cursor: grab;
  user-select: none;
}
.ba-image-overlay-body.ba-image-panning {
  cursor: grabbing;
}
.ba-image-overlay-body img {
  user-select: none;
  -webkit-user-drag: none;
}

/* v47: ISO text expiry field plus native calendar picker limited to future dates. */
.ba-expiry-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ba-expiry-wrap .ba-expiry-input {
  padding-right: 34px;
}
.ba-expiry-date-picker {
  position: absolute;
  right: 0;
  top: 0;
  width: 32px;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}
.ba-expiry-calendar-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--ui-fs-13);
  line-height: 1;
  padding: 0;
}
.ba-expiry-calendar-btn:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

/* v50 challan scan staging */
.challan-stage-modal { width: min(1120px, calc(100vw - 44px)); }
.challan-stage-table td, .challan-stage-table th { white-space: nowrap; }
.challan-stage-table td:last-child { white-space: normal; min-width: 220px; }
.challan-inventory-ok { color: var(--success); font-weight: 700; }
.challan-inventory-blocked { color: var(--danger); font-weight: 700; }

/* v51: image reference button in challan scan staging modal */
.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.challan-image-overlay {
  z-index: 1000;
}

/* Vision API billing dashboard */
.card-subtitle { margin-top: 3px; font-size: var(--ui-fs-12); color: var(--text-muted); font-weight: 400; }
.vision-total-pill {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
  font-size: var(--ui-fs-12); font-weight: 600; color: var(--text-2); background: var(--surface-2);
  white-space: nowrap;
}
.vision-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.vision-provider-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.vision-provider-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.vision-provider-title { font-size: var(--ui-fs-15); font-weight: 700; color: var(--text); }
.vision-provider-rate { margin-top: 2px; font-size: var(--ui-fs-11); color: var(--text-muted); line-height: 1.35; }
.vision-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-metric { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px; background: #fbfdff; }
.mini-label { font-size: var(--ui-fs-11); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.mini-value { margin-top: 4px; font-size: var(--ui-fs-20); line-height: 1.15; font-weight: 700; color: var(--text); }
.mini-date { font-size: var(--ui-fs-14); line-height: 1.35; }
.mini-note { margin-top: 3px; font-size: var(--ui-fs-11); line-height: 1.35; color: var(--text-muted); }
.vision-note { margin-top: 10px; font-size: var(--ui-fs-11); color: var(--text-muted); line-height: 1.4; }

@media (max-width: 1180px) {
  .vision-provider-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .vision-metric-grid { grid-template-columns: 1fr; }
  .vision-total-pill { width: 100%; margin-top: 8px; }
}

/* v57: keyboard-wedge barcode scanner entry for Bulk Add and Challan add */
.scanner-entry-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fbfdff;
}
.scanner-entry-panel-compact {
  margin: 10px 16px;
  padding: 10px 12px;
}
.scanner-entry-after-grid {
  margin-top: 12px;
  margin-bottom: 10px;
}
.scanner-entry-title {
  font-size: var(--ui-fs-12);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.scanner-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.scanner-entry-input {
  min-width: min(460px, 100%);
  flex: 1 1 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .01em;
}
.scanner-entry-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.scanner-entry-help,
.scanner-entry-help-inline {
  font-size: var(--ui-fs-11);
  color: var(--text-muted);
  line-height: 1.35;
}
.scanner-entry-help { margin-top: 6px; }
.scanner-entry-panel .msg {
  margin-top: 6px;
  min-height: 16px;
  font-size: var(--ui-fs-12);
}

/* v59 product catalog / warehouse refinements */
.product-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}
.product-master-header {
  align-items: flex-start;
}
.product-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.product-tab {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.product-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.product-health-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tiny-muted {
  color: var(--text-muted);
  font-size: var(--ui-fs-11);
  margin-top: 3px;
}
.muted-row {
  opacity: 0.64;
}
.product-modal {
  max-width: 760px;
}
.modal-section-title {
  font-size: var(--ui-fs-12);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 4px 0 12px;
}
.form-hint {
  display: block;
  color: var(--text-muted);
  font-size: var(--ui-fs-11);
  margin-top: 5px;
}
.scanner-entry-warehouse-row {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

/* v60 Purchase Invoice Load */
#view-purchase-invoices .card > .dashboard-callout {
  margin: 16px 20px 0;
}
.purchase-upload-grid {
  align-items:end;
  grid-template-columns: minmax(340px, 560px) minmax(180px, max-content);
  max-width: 920px;
  padding: 18px 20px 18px;
}
.purchase-upload-grid .form-group.full { grid-column: 1 / -1; }
.purchase-upload-grid input[type="file"],
.purchase-upload-grid select { max-width: 100%; }
.purchase-upload-action { align-self:end; justify-self:start; }
.purchase-upload-action .btn { min-height: 42px; padding-left:22px; padding-right:22px; }
#piUploadMsg { padding: 0 20px 18px; margin: 0; }
#piReviewCard > .ba-warning-banner { margin: 14px 20px 0 !important; }
#piReviewCard > .purchase-summary-grid { margin: 14px 20px; }
#piReviewCard > .purchase-review-controls { padding: 10px 20px 12px; }
#piReviewCard > .purchase-review-wrap { margin: 0 20px; }
#piReviewCard > .purchase-totals { margin: 12px 20px 16px; }
#piCommitMsg { padding: 0 20px 18px; margin: 0; }
.purchase-summary-grid {
  display:grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap:10px;
  margin: 10px 0 14px;
}
.purchase-summary-grid > div {
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
}
.purchase-summary-grid strong {
  display:block;
  color:var(--muted);
  font-size: var(--ui-fs-12);
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:4px;
}
.purchase-summary-grid span { font-weight:650; }
.purchase-review-controls {
  display:flex;
  gap:14px;
  align-items:center;
  padding:10px 0 12px;
  color:var(--text-muted);
  font-size: var(--ui-fs-14);
}
.purchase-review-wrap { max-height: 480px; overflow:auto; }
.purchase-review-table {
  width: max-content;
  min-width: 0;
  table-layout: auto;
}
.purchase-review-table th { white-space:nowrap; }
.purchase-review-table th,
.purchase-review-table td { padding-left: 10px; padding-right: 10px; }
.purchase-review-table input,
.purchase-review-table textarea,
.purchase-review-table select {
  width:100%;
  min-width:90px;
  padding:8px 9px;
  border:1px solid var(--border);
  border-radius:7px;
  font-size: var(--ui-fs-13);
  background:#fff;
}
.purchase-review-table textarea { min-width:230px; resize:vertical; }
.purchase-review-table .pi-line-desc { min-width:210px; }
.purchase-review-table .pi-line-cat { min-width:105px; }
.purchase-review-table .pi-line-lot { min-width:100px; }
.purchase-review-table .pi-line-exp { min-width:130px; }
.purchase-review-table .pi-line-qty { min-width:62px; }
.purchase-review-table .pi-line-received { min-width:72px; }
.purchase-review-table .pi-line-wh { min-width:165px; }
.purchase-review-table .pi-line-list,
.purchase-review-table .pi-line-taxable,
.purchase-review-table .pi-line-tax,
.purchase-review-table .pi-line-total { min-width:124px; }
.purchase-review-table .pi-line-rate { min-width:86px; }
.purchase-review-table .pi-line-notes { min-width:110px; max-width:150px; }
.purchase-totals {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  font-size: var(--ui-fs-13);
}
.purchase-totals span { padding:4px 8px; border-radius:999px; background:#fff; border:1px solid var(--border); }
.purchase-pdf-modal { max-width: 92vw; width: 92vw; height: 90vh; }
.purchase-pdf-body { height: calc(90vh - 72px); display:flex; flex-direction:column; }
.purchase-pdf-help { color:var(--text-muted); font-size: var(--ui-fs-13); margin-bottom:8px; }
.purchase-pdf-frame-wrap {
  flex:1;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
}
.purchase-pdf-frame-wrap iframe {
  display:block;
  border:0;
  min-height:100%;
  min-width:100%;
}
@media (max-width: 1100px) {
  .purchase-summary-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
  .purchase-upload-grid { grid-template-columns: 1fr; max-width: none; }
  .purchase-upload-action .btn { width: 100%; justify-content: center; }
}

/* v64b scanner batch status log */
.scanner-status-log {
  display: block;
  margin-top: 6px;
  min-height: 16px;
}
.scanner-status-line {
  display: block;
  line-height: 1.35;
  margin: 2px 0;
  white-space: normal;
  word-break: break-word;
}
.scanner-status-ok { color: var(--success); }
.scanner-status-err { color: var(--danger); }
.scanner-status-info { color: var(--text-muted); }

/* v64j: manual challan checkout/check-in helpers */
.cd-manual-row input {
  width: 100%;
  min-width: 78px;
}
.cd-manual-ref-input {
  min-width: 150px;
}
.cd-manual-lot-input,
.cd-manual-lot-select {
  min-width: 150px;
  width: 100%;
}
.cd-manual-lot-readonly {
  background: var(--surface-muted, #f8fafc);
  color: var(--text, #0f172a);
  cursor: default;
}
.cd-manual-row select {
  max-width: 100%;
}
.cd-manual-help {
  margin-top: 4px;
  font-size: var(--ui-fs-11);
  color: var(--danger, #b91c1c);
  line-height: 1.25;
}
.cd-manual-help.ok {
  color: var(--success, #047857);
}
.cd-checkin-row-warning {
  background: #fff7ed;
}

/* incoming consignment DC receipt */
#crUploadMsg { padding: 0 20px 18px; margin: 0; }
#crReviewCard > .ba-warning-banner { margin: 14px 20px 0 !important; }
#crReviewCard > .purchase-summary-grid { margin: 14px 20px; }
#crReviewCard > .purchase-review-controls { padding: 10px 20px 12px; }
#crReviewCard > .scanner-entry-panel { margin: 0 20px 14px; }
#crReviewCard > .purchase-review-wrap { margin: 0 20px; }
#crReviewCard > .purchase-totals { margin: 12px 20px 16px; }
#crCommitMsg { padding: 0 20px 18px; margin: 0; }
.consignment-review-table .cr-line-ref { min-width:120px; }
.consignment-review-table .cr-line-desc { min-width:300px; }
.consignment-review-table .cr-line-lot { min-width:110px; }
.consignment-review-table .cr-line-exp { min-width:130px; }
.consignment-review-table .cr-line-qty,
.consignment-review-table .cr-line-received { min-width:70px; }
.consignment-review-table .cr-line-wh { min-width:170px; }
.consignment-review-table .cr-line-notes { min-width:160px; max-width:220px; }

/* v66d: Bulk Add multi-image import session + cleaner action spacing */
.ba-image-overlay-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.ba-image-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: var(--ui-fs-11);
  white-space: nowrap;
  cursor: pointer;
}
.ba-image-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.ba-extra-scan-modal {
  width: min(980px, calc(100vw - 40px));
  max-height: min(860px, calc(100vh - 40px));
}
.ba-extra-scan-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ba-extra-stage {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.ba-extra-stage-title {
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.ba-extra-stage-table {
  max-height: 330px;
  overflow: auto;
}
.action-cell-gap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.ba-extra-scan-modal .modal-title { margin: 0; }
.modal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.ba-extra-scan-modal input[type="file"] { margin-top: 6px; }

/* v67a: compact Delivery Challan checkbox alignment */
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin: 0;
  cursor: pointer;
}
.checkbox-inline input[type="checkbox"] { margin: 0; }
.challan-eway-required-group {
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 26px;
}

/* v67b: Delivery Challan date picker + compact e-way checkbox polish */
.challan-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.challan-date-wrap input[type="text"] {
  width: 100%;
  padding-right: 40px;
}
.challan-date-picker {
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}
.challan-calendar-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--ui-fs-13);
  line-height: 1;
  padding: 0;
}
.challan-calendar-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.checkbox-inline {
  white-space: nowrap;
}

/* v67c: Delivery Challan draft header summary, edit modal, and clearer controls */
.challan-header-summary {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.challan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
}
.challan-summary-grid div {
  min-width: 0;
}
.challan-summary-grid span {
  display: block;
  font-size: var(--ui-fs-11);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 2px;
}
.challan-summary-grid strong {
  display: block;
  font-size: var(--ui-fs-13);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.challan-summary-note {
  margin-top: 8px;
  font-size: var(--ui-fs-12);
  color: var(--text-muted);
}
.challan-date-picker {
  z-index: 2;
}
.challan-calendar-btn {
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.challan-eway-required-group .checkbox-inline span {
  white-space: nowrap;
}
@media (max-width: 920px) {
  .challan-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .challan-summary-grid { grid-template-columns: 1fr; }
}

/* v67d: Delivery Challan sequence/date/e-way polish */
.challan-eway-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.challan-eway-required-group {
  padding-top: 6px;
}
.challan-eway-required-group .checkbox-inline {
  white-space: nowrap;
}
input[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .challan-eway-fields { grid-template-columns: 1fr; }
}

/* v67e: wider, horizontal draft challan header edit popup */
.challan-header-edit-modal {
  width: min(1120px, calc(100vw - 48px));
  max-width: min(1120px, calc(100vw - 48px));
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.challan-header-edit-modal .modal-body {
  overflow-y: auto;
  padding: 16px 22px;
}
.challan-header-edit-modal .modal-footer {
  flex-shrink: 0;
}
.challan-header-edit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
.challan-header-edit-grid .form-group {
  min-width: 0;
}
.challan-header-edit-grid .challan-field-wide {
  grid-column: span 2;
}
.challan-header-edit-grid .challan-field-full {
  grid-column: 1 / -1;
}
.challan-header-edit-grid .challan-eway-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.challan-header-edit-grid .challan-edit-eway-toggle {
  align-self: end;
  padding-bottom: 4px;
}
.challan-header-edit-grid .challan-notes-compact textarea {
  min-height: 64px;
}
@media (max-width: 980px) {
  .challan-header-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .challan-header-edit-grid .challan-field-wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .challan-header-edit-grid { grid-template-columns: 1fr; }
  .challan-header-edit-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
}

/* v67j: source hospital stock picker for hospital-to-hospital transfer drafts */
.challan-source-stock-modal {
  width: min(1180px, calc(100vw - 44px));
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.challan-source-stock-modal .modal-body {
  overflow-y: auto;
}
.challan-source-stock-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.challan-source-stock-toolbar input {
  min-width: 280px;
  flex: 1 1 320px;
}
.challan-source-stock-toolbar select {
  max-width: 170px;
}
.challan-source-stock-table td,
.challan-source-stock-table th {
  white-space: nowrap;
}
.challan-source-stock-table td:last-child {
  white-space: normal;
}
@media (max-width: 720px) {
  .challan-source-stock-modal { width: calc(100vw - 24px); }
  .challan-source-stock-toolbar input,
  .challan-source-stock-toolbar select,
  .challan-source-stock-toolbar button {
    width: 100%;
    max-width: none;
  }
}

/* v67k: hospital transfer derives ownership from selected source stock */
.challan-derived-ownership-note {
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: var(--ui-fs-12);
  white-space: nowrap;
}

/* v67x: wider horizontal Master Data edit popups */
.master-data-modal {
  width: min(1120px, calc(100vw - 48px));
  max-width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.master-data-modal .modal-body {
  padding: 16px 22px;
  overflow-y: auto;
}
.master-data-modal .modal-footer {
  flex-shrink: 0;
}
.master-data-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}
.master-data-grid .form-group {
  min-width: 0;
}
.master-data-grid .master-field-wide {
  grid-column: span 2;
}
.master-data-grid .master-field-full {
  grid-column: 1 / -1;
}
.master-notes-compact textarea {
  min-height: 54px;
}
.master-data-modal input,
.master-data-modal select,
.master-data-modal textarea {
  min-width: 0;
}
.master-data-modal .form-hint {
  line-height: 1.25;
}
@media (max-width: 980px) {
  .master-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .master-data-grid .master-field-wide,
  .master-data-grid .master-field-full { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .master-data-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
  .master-data-grid { grid-template-columns: 1fr; }
}


/* v72jzzzzzn: text-size control.
   Font sizes scale through --ui-font-scale while the shell, sidebar, cards, tables,
   and viewport width stay fixed. This avoids the old whole-page transform shrinking
   the usable application width when A− was pressed. */
#appShell,
#loginWrapper {
  width: 100% !important;
  min-height: 100vh;
}
.ui-scale-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.ui-scale-btn,
.ui-scale-reset {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--ui-fs-12);
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  padding: 6px 8px;
  cursor: pointer;
  min-width: 32px;
}
.ui-scale-reset {
  min-width: 48px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}
.ui-scale-btn:hover,
.ui-scale-reset:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.ui-scale-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}
@media (max-width: 640px) {
  .ui-scale-control { display: none; }
}
@media print {
  :root {
    --ui-font-scale: 1 !important;
    --ui-fs-8: 8px !important;
    --ui-fs-10: 10px !important;
    --ui-fs-10-5: 10.5px !important;
    --ui-fs-11: 11px !important;
    --ui-fs-12: 12px !important;
    --ui-fs-13: 13px !important;
    --ui-fs-13-5: 13.5px !important;
    --ui-fs-14: 14px !important;
    --ui-fs-15: 15px !important;
    --ui-fs-16: 16px !important;
    --ui-fs-18: 18px !important;
    --ui-fs-20: 20px !important;
    --ui-fs-22: 22px !important;
    --ui-fs-26: 26px !important;
    --ui-fs-32: 32px !important;
  }
  #appShell,
  #loginWrapper {
    width: auto !important;
    min-height: auto;
  }
  .ui-scale-control { display: none !important; }
}

/* v68h: compact manual LOT selection; v68g: middle-align every Delivery Challan line-item cell for a cleaner single-row layout */
#cdItemsBody td,
.cd-manual-row td {
  vertical-align: middle !important;
}
.cd-manual-row .cd-manual-help {
  margin-top: 3px;
}

/* Billing Instruction processing modal */
.billing-instruction-modal {
  width: min(760px, calc(100vw - 48px));
  max-width: min(760px, calc(100vw - 48px));
}
.billing-instruction-process-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .billing-instruction-process-grid { grid-template-columns: 1fr; }
}

/* v69e: single validated modal for Pending Vendor/Consignment Receivables */
.pending-receive-modal {
  width: min(820px, calc(100vw - 48px));
  max-width: min(820px, calc(100vw - 48px));
}
.pending-receive-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.pending-receive-summary > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  min-width: 0;
}
.pending-receive-summary strong {
  display: block;
  color: var(--muted);
  font-size: var(--ui-fs-11);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.pending-receive-summary span,
.pending-receive-summary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-receive-summary span { font-weight: 650; }
.pending-receive-summary small { color: var(--muted); font-size: var(--ui-fs-12); margin-top: 2px; }
.pending-receive-summary-wide { grid-column: span 2; }
.pending-receive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pending-receive-warning {
  display: block;
  border: 1px solid #fde68a;
  border-radius: 10px;
  margin: 0 0 14px;
}
@media (max-width: 820px) {
  .pending-receive-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pending-receive-grid { grid-template-columns: 1fr; }
}

/* stock removals */
.stock-removal-kpis {
  margin-bottom: 16px;
}
.stock-removal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stock-removal-lot-summary {
  margin-top: 14px;
  border: 1px solid var(--border);
  background: #f8fbff;
  border-radius: 10px;
  padding: 12px;
}
.stock-removal-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stock-removal-summary-grid > div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 48px;
}
.stock-removal-summary-grid span {
  display: block;
  font-size: var(--ui-fs-11);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.stock-removal-summary-grid strong {
  display: block;
  font-size: var(--ui-fs-13);
  color: var(--text);
}
@media (max-width: 1100px) {
  .stock-removal-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stock-removal-grid { grid-template-columns: 1fr; }
  .stock-removal-summary-grid { grid-template-columns: 1fr; }
}

/* v70b stock-removal REF / LOT lookup */
.inline-input-action {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline-input-action input {
  flex: 1;
  min-width: 0;
}
.stock-removal-lot-results {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.compact-table-wrap {
  max-height: 360px;
  overflow: auto;
}
.compact-table th,
.compact-table td {
  padding: 9px 10px;
  vertical-align: middle;
}
.stock-removal-lot-table .selected-row {
  background: #f3f7ff;
}
.small-empty {
  padding: 14px;
  text-align: left;
}
@media (max-width: 760px) {
  .inline-input-action { flex-direction: column; align-items: stretch; }
}
.sr-lot-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* v71b Physical Audit workstation cleanup */
.table-input {
  width: 100%;
  min-width: 90px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  background: #fff;
}
.table-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 91, 211, 0.10);
}
.pa-photo-stage-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

/* v71d: physical audit blocking scan indicator
   v72jzzzf: keep OCR blocker above Manual Guided Crop overlay (z-index 10030). */
.pa-scan-blocker {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 11050;
  background: rgba(15, 23, 42, 0.38);
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.pa-scan-blocker.open { display: flex; }
.pa-scan-blocker-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 480px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22);
  color: var(--text);
}

/* v71i: Physical Audit paged grids */
.pa-grid-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.pa-grid-search {
  min-width: 260px;
  max-width: 360px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: var(--ui-fs-13);
  background: #fff;
}

/* v71o: Physical Audit search clear button inside filter boxes */
.pa-search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
}
.pa-search-box .pa-grid-search {
  padding-right: 30px;
}
.pa-search-clear {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--ui-fs-16);
  line-height: 18px;
  cursor: pointer;
  opacity: 0.72;
}
.pa-search-clear:hover,
.pa-search-clear:focus {
  background: var(--bg-secondary);
  color: var(--text);
  opacity: 1;
  outline: none;
}
.pa-search-clear.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pa-grid-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--ui-fs-12);
}
.pa-grid-pager > div {
  display: flex;
  gap: 8px;
}
.pa-table-scroll {
  max-height: 520px;
  overflow: auto;
}
.pa-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* v71p: compact Physical Audit grid column toggles
   The global input rule sets width:100% and padding on every input.
   Checkboxes must override that explicitly or the label gets pushed/clipped
   at browser zoom levels such as 75% and 100%. */
.pa-grid-toggle,
.pa-notes-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  white-space: nowrap;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  min-width: max-content;
  margin: 0;
  font-size: var(--ui-fs-13);
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.pa-grid-toggle input[type="checkbox"],
.pa-notes-toggle input[type="checkbox"] {
  width: 14px !important;
  min-width: 14px;
  max-width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0;
  flex: 0 0 14px;
  box-sizing: border-box;
}
.pa-grid-toggle span,
.pa-notes-toggle span {
  display: inline-block;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pa-grid-pager-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: max-content;
}
.pa-grid-pager-actions .btn {
  margin-left: 0;
  flex: 0 0 auto;
}

.pa-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.pa-icon-action:hover,
.pa-icon-action:focus {
  color: var(--danger);
  background: #fff1f2;
  border-color: #fecdd3;
  outline: none;
}
.pa-icon-action svg {
  flex: 0 0 auto;
}

/* v71q: tighten Physical Audit paged grids without disabling overflow protection.
   Ten rows should usually fit without an internal scrollbar at normal font sizes,
   while the scrollbar still appears if optional columns/wrapping/zoom make content taller. */
.pa-paged-table thead th {
  padding: 7px 12px;
  line-height: 1.15;
}
.pa-paged-table tbody td {
  padding: 7px 12px;
  line-height: 1.25;
}
.pa-paged-table .badge {
  padding-top: 2px;
  padding-bottom: 2px;
}
.pa-paged-table .tiny-muted {
  margin-top: 1px;
  line-height: 1.15;
}
.pa-lines-table .pa-icon-action {
  width: 24px;
  height: 24px;
  min-width: 24px;
}

/* v71u: Physical Audit ownership split tile formatted as three compact lines */
.pa-owner-split-value {
  font-size: var(--ui-fs-15);
  line-height: 1.28;
}
.pa-owner-split-lines {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}
.pa-owner-split-lines div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
.pa-owner-split-lines span {
  color: var(--text-muted);
  font-weight: 500;
}
.pa-owner-split-lines strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pa-session-list-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.pa-session-show-all-toggle {
  margin: 0;
}

.pa-session-pager {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

/* v72: Purchase Invoice Day 7B review checklist and save-review controls */
.purchase-review-checklist {
  margin: 10px 0 4px;
  display: grid;
  gap: 8px;
  font-size: var(--ui-fs-13);
}
.pi-check-ok,
.pi-check-errors,
.pi-check-warnings {
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.4;
}
.pi-check-ok {
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
}
.pi-check-errors {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
}
.pi-check-warnings {
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.08);
}
.purchase-review-controls .btn-sm {
  align-self: center;
}
.purchase-review-table textarea.pi-line-notes {
  min-width: 150px;
}

/* v72aa: Physical Audit captured rows grouped by contributing user */
.pa-user-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.pa-user-tab {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "label count"
    "units units";
  gap: 1px 8px;
  align-items: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  font: inherit;
  font-size: var(--ui-fs-12);
  box-shadow: 0 1px 2px rgba(15,25,35,0.04);
}
.pa-user-tab:hover {
  border-color: var(--accent);
}
.pa-user-tab:focus {
  outline: none;
}
.pa-user-tab:focus-visible {
  outline: 2px solid rgba(11, 92, 255, 0.28);
  outline-offset: 2px;
}
.pa-user-tab.active,
.pa-user-tab[aria-selected="true"] {
  background: #eef4ff;
  border-color: var(--accent);
  border-width: 2px;
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.10), 0 2px 6px rgba(15,25,35,0.08);
  padding: 6px 10px;
}
.pa-user-tab.active span,
.pa-user-tab[aria-selected="true"] span,
.pa-user-tab.active strong,
.pa-user-tab[aria-selected="true"] strong {
  color: var(--accent);
}
.pa-user-tab span {
  grid-area: label;
  font-weight: 700;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-user-tab strong {
  grid-area: count;
  font-family: 'DM Mono', monospace;
  font-size: var(--ui-fs-12);
  color: inherit;
  white-space: nowrap;
}
.pa-user-tab small {
  grid-area: units;
  color: var(--text-muted);
  font-size: var(--ui-fs-10);
  line-height: 1.1;
}


/* v72ae: Purchase Invoice committed-state lock and narrow-pane action wrapping */
#piReviewCard .card-header {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
}
#piReviewCard .card-header > div:first-child {
  min-width: 260px;
  flex: 1 1 320px;
}
#piReviewCard .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}
#piReviewCard .card-actions .btn {
  white-space: nowrap;
}
#piReviewCard .purchase-review-wrap {
  max-width: calc(100% - 40px);
  overflow-x: auto;
  overflow-y: auto;
}
.purchase-review-controls {
  flex-wrap: wrap;
  min-width: 0;
}
.purchase-review-controls.purchase-review-controls-locked {
  opacity: .65;
}
.purchase-review-locked-note {
  margin: 0 20px 12px;
  padding: 9px 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--text-2);
  font-size: var(--ui-fs-13);
}
@media (max-width: 900px) {
  #piReviewCard .card-actions {
    justify-content: flex-start;
    width: 100%;
  }
  #piReviewCard .purchase-review-wrap {
    max-width: calc(100% - 24px);
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* v72af: keep Purchase Invoice review actions reachable inside narrow/right-pane layouts.
   The wide editable table must scroll inside its own wrapper and must not stretch the card/page. */
#appMain,
.page-content,
#view-purchase-invoices,
#piReviewCard {
  min-width: 0;
  max-width: 100%;
}
#view-purchase-invoices,
#piReviewCard {
  overflow-x: hidden;
}
#piReviewCard > .card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
}
#piReviewCard > .card-header > div:first-child {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
}
#piReviewCard > .card-header > .card-actions {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  overflow: visible;
}
#piReviewCard > .card-header > .card-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
#piReviewCard > .purchase-review-wrap {
  display: block;
  width: auto;
  max-width: none;
  margin-left: 20px;
  margin-right: 20px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#piReviewCard .purchase-review-table {
  width: max-content;
  min-width: 1780px;
  max-width: none;
}
@media (max-width: 900px) {
  #piReviewCard > .purchase-review-wrap {
    margin-left: 12px;
    margin-right: 12px;
  }
  #piReviewCard > .card-header > .card-actions .btn {
    flex: 1 1 170px;
    justify-content: center;
  }
}


/* v72ag: Purchase Invoice review must never push the main shell/sidebar horizontally.
   Keep the action row visible and provide a Close Review escape hatch. */
#appMain {
  width: calc(100vw - var(--sidebar-w));
  max-width: calc(100vw - var(--sidebar-w));
  min-width: 0;
  /* clip prevents shell-level horizontal spill without creating a non-scrolling
     overflow container that would break the sticky topbar. */
  overflow-x: clip;
  overflow-y: visible;
}
.page-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
#view-purchase-invoices {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
#view-purchase-invoices .card,
#piReviewCard {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
#piReviewCard > .purchase-review-heading {
  display: block;
}
.purchase-review-main-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  max-width: 100%;
  overflow: visible;
}
.purchase-review-main-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
#piReviewCard > .purchase-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: calc(100% - 40px);
}
#piReviewCard > .purchase-review-wrap {
  width: calc(100% - 40px);
  max-width: calc(100% - 40px);
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
#piReviewCard .purchase-review-table {
  width: max-content;
  min-width: 1780px;
  max-width: none;
}
@media (max-width: 900px) {
  #appMain {
    width: 100vw;
    max-width: 100vw;
  }
  .purchase-review-main-actions {
    padding-left: 12px;
    padding-right: 12px;
  }
  .purchase-review-main-actions .btn {
    flex: 1 1 160px;
    justify-content: center;
  }
  #piReviewCard > .purchase-summary-grid,
  #piReviewCard > .purchase-review-wrap {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
  }
}

/* v72ak: packed review rows for large Vendor DC OCR staging grids */
.consignment-review-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
#crReviewCard.cr-compact-review .purchase-review-wrap {
  max-height: 62vh;
  overflow: auto;
}
#crReviewCard.cr-compact-review .consignment-review-table {
  border-collapse: collapse;
  table-layout: fixed;
}
#crReviewCard.cr-compact-review .consignment-review-table th,
#crReviewCard.cr-compact-review .consignment-review-table td {
  padding: 4px 6px;
  vertical-align: middle;
}
#crReviewCard.cr-compact-review .consignment-review-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-secondary);
}
#crReviewCard.cr-compact-review .consignment-review-table input,
#crReviewCard.cr-compact-review .consignment-review-table select,
#crReviewCard.cr-compact-review .consignment-review-table textarea {
  min-height: 30px;
  height: 30px;
  padding: 4px 8px;
  font-size: var(--ui-fs-12);
  line-height: 1.25;
}
#crReviewCard.cr-compact-review .consignment-review-table textarea {
  resize: vertical;
  min-height: 30px;
  height: 38px;
}
#crReviewCard.cr-compact-review .consignment-review-table .badge,
#crReviewCard.cr-compact-review .consignment-review-table .btn-sm {
  padding: 3px 7px;
  font-size: var(--ui-fs-11);
}
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-ref { min-width: 96px; width: 120px; }
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-desc { min-width: 220px; width: 260px; }
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-lot { min-width: 88px; width: 110px; }
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-exp { min-width: 108px; width: 120px; }
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-qty,
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-received { min-width: 56px; width: 64px; }
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-wh { min-width: 140px; width: 170px; }
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-notes { min-width: 120px; width: 150px; max-width: 180px; }


/* v72al: Vendor DC review UX polish - make compact mode visibly thinner and description single-line */
#crReviewCard .consignment-review-table .cr-line-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#crReviewCard.cr-compact-review .purchase-review-wrap {
  max-height: 62vh;
  overflow: auto;
}
#crReviewCard.cr-compact-review .consignment-review-table th,
#crReviewCard.cr-compact-review .consignment-review-table td {
  padding-top: 2px;
  padding-bottom: 2px;
}
#crReviewCard.cr-compact-review .consignment-review-table input,
#crReviewCard.cr-compact-review .consignment-review-table select {
  min-height: 26px;
  height: 26px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: var(--ui-fs-12);
}
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-desc {
  min-width: 240px;
  width: 280px;
}
#crReviewCard.cr-compact-review .consignment-review-table .badge,
#crReviewCard.cr-compact-review .consignment-review-table .btn-sm {
  padding-top: 2px;
  padding-bottom: 2px;
}

/* v72am: Vendor DC review checkbox label alignment */
.consignment-review-controls {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.consignment-review-controls .cr-option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
  cursor: pointer;
}
.consignment-review-controls .cr-option-label input[type="checkbox"] {
  width: 14px !important;
  min-width: 14px;
  max-width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0;
  flex: 0 0 14px;
}
.consignment-review-controls .cr-option-label span {
  display: inline-block;
  white-space: nowrap;
}
.consignment-review-controls .cr-review-help {
  flex: 1 1 360px;
  min-width: 240px;
  white-space: normal;
  line-height: 1.35;
}

/* v72ap - Simple user administration */
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: var(--ui-fs-12);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.status-badge.ok {
  background: #dcfce7;
  color: #166534;
}
.status-badge.warn {
  background: #fef3c7;
  color: #92400e;
}

/* v72ar: Manual DC Item Master and Delivery Challan quick-add chips */
.manual-dc-item-form {
  align-items: end;
  margin: 14px 16px 10px;
}
.manual-dc-item-action {
  align-self: end;
}
.manual-dc-quick-items {
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.manual-dc-quick-items-bottom {
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.btn-xs {
  padding: 3px 8px;
  font-size: var(--ui-fs-11);
  line-height: 1.4;
}

/* v72b Remote Photo Capture */

/* v72bj: split Photo Scan and Remote Capture controls into clear two-line groups */
.pa-photo-scan-controls,
.pa-remote-controls-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pa-photo-scan-options-row,
.pa-photo-scan-actions-row,
.pa-remote-options-row,
.pa-remote-actions-row {
  align-items: center;
  gap: 10px;
}
.pa-photo-scan-options-row #paPhotoScanMode {
  width: auto;
  min-width: 260px;
  flex: 0 1 340px;
}
.pa-photo-scan-actions-row #paPhotoFile {
  flex: 1 1 320px;
  min-width: 280px;
}
.pa-photo-scan-options-row .mistral-toggle-label,
.pa-remote-options-row .mistral-toggle-label {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pa-remote-options-row #paRemoteCaptureExpiry {
  width: auto;
  min-width: 150px;
  flex: 0 0 150px;
}
.pa-remote-actions-row .btn,
.pa-photo-scan-actions-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 920px) {
  .pa-photo-scan-options-row #paPhotoScanMode,
  .pa-remote-options-row #paRemoteCaptureExpiry {
    flex: 1 1 180px;
  }
  .pa-photo-scan-actions-row #paPhotoFile {
    flex: 1 1 100%;
    min-width: 0;
  }
  .pa-remote-actions-row .btn,
  .pa-photo-scan-actions-row .btn {
    flex: 1 1 190px;
    justify-content: center;
  }
}

.pa-remote-session-box { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.pa-remote-session-card { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.pa-remote-session-header { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:12px 14px; border-bottom:1px solid var(--border); background:#f8fbff; }
.pa-remote-session-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.pa-remote-qr-row { display:grid; grid-template-columns: 132px minmax(0,1fr); gap:14px; align-items:center; padding:14px; }
.pa-remote-qr { width:132px; height:132px; border:1px solid var(--border); border-radius:12px; background:#fff; padding:6px; }
.pa-remote-link-box { min-width:0; }
.pa-remote-url { margin-top:6px; padding:8px 10px; background:#f3f6fb; border:1px solid var(--border); border-radius:10px; word-break:break-all; font-size: var(--ui-fs-12); }
.pa-remote-captures-table { border-top:1px solid var(--border); }
.pa-remote-review { margin-top:12px; border:1px solid var(--border); border-radius:14px; overflow:hidden; background:#fff; }
.pa-remote-review-header { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 14px; border-bottom:1px solid var(--border); background:#f8fbff; }
@media (max-width: 760px) {
  .pa-remote-session-header, .pa-remote-review-header { flex-direction:column; align-items:stretch; }
  .pa-remote-qr-row { grid-template-columns:1fr; }
  .pa-remote-qr { width:180px; height:180px; justify-self:center; }
}

/* v72bc/v72bd: Remote Photo Capture laptop debug viewport preview */
.pa-remote-debug-modal {
  width: auto;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
}
.pa-remote-debug-modal .modal-body {
  overflow: auto;
}
.pa-remote-debug-toolbar {
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.pa-remote-debug-shell {
  width: fit-content;
  max-width: 100%;
  max-height: 74vh;
  overflow: auto;
  padding: 16px;
  margin: 0 auto;
  border: 1px solid var(--border, #dbe4f0);
  border-radius: 16px;
  background: #e9eef6;
}
#paRemoteDebugFrame {
  display: block;
  width: 390px;
  height: 844px;
  max-width: none;
  border: 1px solid #9db2cf;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(12, 31, 66, .18);
}
@media (max-width: 560px) {
  .pa-remote-debug-toolbar { align-items: stretch; }
  .pa-remote-debug-toolbar .form-group { min-width: 0 !important; }
  .pa-remote-debug-toolbar .btn { width: 100%; }
}

/* v72be: Remote Photo Capture same-context session guardrails */
.pa-remote-session-current-context {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12), 0 10px 24px rgba(15, 23, 42, 0.06);
}
.pa-remote-session-highlight {
  animation: paRemoteSessionPulse 1.8s ease-out 1;
}
@keyframes paRemoteSessionPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.36); }
  45% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}


/* v72bf: Remote Capture image popup instead of new window */
.pa-remote-image-modal {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}
.pa-remote-image-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  background: #f8fafc;
}
#paRemoteImagePreview {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 230px);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border, #dbe4f0);
  background: #fff;
  box-shadow: 0 8px 22px rgba(12, 31, 66, .12);
}
@media (max-width: 640px) {
  .pa-remote-image-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
  .pa-remote-image-body { padding: 12px; max-height: calc(100vh - 170px); }
  #paRemoteImagePreview { max-height: calc(100vh - 210px); }
}

/* v72bg: Remote Capture ended-session view-only history */
.pa-remote-session-ended {
  border-color: #cbd5e1;
  background: #fbfdff;
}
.pa-remote-session-history-note {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border: 1px dashed var(--border, #dbe4f0);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted, #64748b);
  font-size: var(--ui-fs-13);
}
.pa-remote-session-view-modal {
  width: min(1100px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}
.pa-remote-session-view-body {
  max-height: calc(100vh - 190px);
  overflow: auto;
  background: #f8fafc;
}
.pa-remote-session-view-card {
  border: 1px solid var(--border, #dbe4f0);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.pa-remote-view-header {
  background: #fff;
}
.pa-remote-view-context {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #dbe4f0);
  background: #f8fbff;
}
.pa-remote-products-row td {
  background: #fbfdff;
  border-top: 0;
}
.pa-remote-product-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pa-remote-product-line {
  font-size: var(--ui-fs-12);
  line-height: 1.35;
  color: #334155;
}
@media (max-width: 760px) {
  .pa-remote-session-view-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
  .pa-remote-session-view-body { padding: 10px; max-height: calc(100vh - 170px); }
}


/* v72bk: force compact control widths where global input/select width:100% was winning */
#view-physical-audit .pa-photo-scan-options-row,
#view-physical-audit .pa-photo-scan-actions-row,
#view-physical-audit .pa-remote-options-row,
#view-physical-audit .pa-remote-actions-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
#view-physical-audit #paRemoteCaptureExpiry {
  width: 170px !important;
  max-width: 170px !important;
  min-width: 150px !important;
  flex: 0 0 170px !important;
}
#view-physical-audit #paPhotoScanMode {
  width: 340px !important;
  max-width: 420px !important;
  min-width: 260px !important;
  flex: 0 0 340px !important;
}
#view-physical-audit #paPhotoFile {
  width: 360px !important;
  max-width: 420px !important;
  min-width: 260px !important;
  flex: 0 1 360px !important;
}
#view-physical-audit .pa-photo-scan-options-row .mistral-toggle-label,
#view-physical-audit .pa-remote-options-row .mistral-toggle-label {
  width: auto !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
}
#view-physical-audit .pa-photo-scan-actions-row .btn,
#view-physical-audit .pa-remote-actions-row .btn {
  width: auto !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
}
#paRemoteCaptureMsg {
  min-height: 0;
  margin-top: -2px;
}
@media (max-width: 720px) {
  #view-physical-audit #paRemoteCaptureExpiry,
  #view-physical-audit #paPhotoScanMode,
  #view-physical-audit #paPhotoFile {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
  #view-physical-audit .pa-photo-scan-actions-row .btn,
  #view-physical-audit .pa-remote-actions-row .btn {
    flex: 1 1 180px !important;
    justify-content: center;
  }
}

/* v72bl: harden Physical Audit photo/remote control alignment */
#view-physical-audit .pa-compact-control-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
#view-physical-audit .pa-compact-control-row > select.pa-compact-select,
#view-physical-audit .pa-compact-control-row > input.pa-compact-file,
#view-physical-audit .pa-compact-control-row > label.pa-compact-check,
#view-physical-audit .pa-compact-control-row > button.btn {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}
#view-physical-audit .pa-remote-expiry-select {
  flex: 0 0 170px !important;
  inline-size: 170px !important;
  min-inline-size: 150px !important;
  max-inline-size: 170px !important;
}
#view-physical-audit .pa-photo-engine-select {
  flex: 0 0 340px !important;
  inline-size: 340px !important;
  min-inline-size: 260px !important;
  max-inline-size: 420px !important;
}
#view-physical-audit .pa-compact-file {
  flex: 0 1 360px !important;
  inline-size: 360px !important;
  min-inline-size: 260px !important;
  max-inline-size: 420px !important;
  align-self: center !important;
}
#view-physical-audit .pa-compact-check {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  min-height: 34px !important;
}
#view-physical-audit .pa-compact-control-row > button.btn {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 760px) {
  #view-physical-audit .pa-remote-expiry-select,
  #view-physical-audit .pa-photo-engine-select,
  #view-physical-audit .pa-compact-file {
    flex: 1 1 100% !important;
    inline-size: 100% !important;
    max-inline-size: 100% !important;
  }
  #view-physical-audit .pa-compact-control-row > button.btn {
    flex: 1 1 180px !important;
    justify-content: center !important;
  }
}


/* v72bm: explicit Physical Audit inline rows + cache-busted asset fix */
#view-physical-audit .pa-inline-control-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
#view-physical-audit .pa-inline-control-row > select,
#view-physical-audit .pa-inline-control-row > input[type="file"],
#view-physical-audit .pa-inline-control-row > label,
#view-physical-audit .pa-inline-control-row > button {
  margin: 0 !important;
}
#view-physical-audit .pa-inline-control-row > select#paRemoteCaptureExpiry {
  width: 170px !important;
  min-width: 150px !important;
  max-width: 170px !important;
  flex: 0 0 170px !important;
}
#view-physical-audit .pa-inline-control-row > select#paPhotoScanMode {
  width: 340px !important;
  min-width: 260px !important;
  max-width: 420px !important;
  flex: 0 0 340px !important;
}
#view-physical-audit .pa-inline-control-row > input#paPhotoFile[type="file"] {
  width: 360px !important;
  min-width: 260px !important;
  max-width: 420px !important;
  flex: 0 1 360px !important;
}
#view-physical-audit .pa-inline-control-row > label.pa-compact-check {
  width: auto !important;
  max-width: none !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
#view-physical-audit .pa-inline-control-row > button.btn {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 760px) {
  #view-physical-audit .pa-inline-control-row > select#paRemoteCaptureExpiry,
  #view-physical-audit .pa-inline-control-row > select#paPhotoScanMode,
  #view-physical-audit .pa-inline-control-row > input#paPhotoFile[type="file"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
  #view-physical-audit .pa-inline-control-row > button.btn {
    flex: 1 1 180px !important;
    justify-content: center !important;
  }
}


/* v72cd: make desktop Delivery Challan manual DC notes subtle/collapsible */
.cd-subtle-notes {
  margin-top: 4px;
}
.cd-subtle-notes summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  width: auto;
  padding: 2px 7px;
  border: 1px solid var(--border, #dbe4f0);
  border-radius: 999px;
  background: var(--surface-muted, #f8fafc);
  color: var(--text-muted, #64748b);
  font-size: var(--ui-fs-11);
  font-weight: 700;
  line-height: 1.35;
}
.cd-subtle-notes[open] summary {
  color: var(--primary, #1d4ed8);
  background: #eff6ff;
  border-color: #bfdbfe;
}
.cd-subtle-notes textarea {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  padding: 7px 8px;
  font-size: var(--ui-fs-12);
  line-height: 1.35;
  resize: vertical;
}
.cd-manual-note-hint {
  margin-top: 3px;
  font-size: var(--ui-fs-10-5);
}

/* v72e - Product Master Refresh */
.status-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

/* v72eb - Product Master Refresh spacing polish.
   Keep upload/mapping controls inside the card gutter instead of touching edges. */
#view-product-master-refresh .card > .dashboard-callout {
  margin: 16px 20px 0;
}
#view-product-master-refresh .card > .form-grid {
  padding: 16px 20px 18px;
}
#view-product-master-refresh .card > .msg {
  margin: 0 20px 18px;
}
#view-product-master-refresh .card > .tiny-muted {
  display: block;
  margin: 0 20px 18px;
}
#view-product-master-refresh .product-refresh-map-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
#view-product-master-refresh .purchase-upload-action .btn {
  min-height: 42px;
}

@media (max-width: 720px) {
  #view-product-master-refresh .card > .form-grid {
    padding: 14px 16px 16px;
  }
  #view-product-master-refresh .card > .dashboard-callout,
  #view-product-master-refresh .card > .msg,
  #view-product-master-refresh .card > .tiny-muted {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* v72ec - Product Master Refresh duplicate-click guard, compact columns, and delete actions */
#view-product-master-refresh .pmr-detected-summary {
  color: var(--text, #0f172a);
  font-weight: 600;
  margin-bottom: 3px;
}
#view-product-master-refresh .pmr-detected-preview {
  color: var(--muted, #64748b);
  margin-bottom: 4px;
}
#view-product-master-refresh .pmr-detected-details summary {
  cursor: pointer;
  color: var(--primary, #1d4ed8);
  font-weight: 700;
  display: inline-block;
  margin-top: 2px;
}
#view-product-master-refresh .pmr-detected-column-list {
  margin-top: 6px;
  max-height: 90px;
  overflow: auto;
  border: 1px solid var(--border, #dbe4f0);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  line-height: 1.35;
}
#view-product-master-refresh .action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.pmr-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(1px);
}
.pmr-busy-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(420px, calc(100vw - 36px));
  max-width: 560px;
  padding: 18px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border, #dbe4f0);
  box-shadow: var(--shadow-lg, 0 18px 45px rgba(15, 23, 42, 0.18));
}
.pmr-spinner {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary, #1d4ed8);
  animation: pmrSpin 0.8s linear infinite;
  flex: 0 0 auto;
}
.pmr-busy-title {
  font-weight: 800;
  color: var(--text, #0f172a);
  margin-bottom: 3px;
}
.pmr-busy-text {
  color: var(--muted, #64748b);
}
@keyframes pmrSpin {
  to { transform: rotate(360deg); }
}

/* v72ed - Product Master Refresh history-first workflow and error guidance */
#view-product-master-refresh .pmr-header-actions,
#view-product-master-refresh .pmr-review-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#view-product-master-refresh .pmr-review-actions select {
  min-width: 130px;
}
#view-product-master-refresh .pmr-error-help {
  margin: 0 20px 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff7f7;
  color: #7f1d1d;
  line-height: 1.4;
}
#view-product-master-refresh .pmr-error-help .btn {
  margin-left: 10px;
}
#view-product-master-refresh #pmrHistoryCard .msg {
  margin: 12px 20px 18px;
}
@media (max-width: 720px) {
  #view-product-master-refresh .pmr-header-actions,
  #view-product-master-refresh .pmr-review-actions {
    justify-content: flex-start;
  }
  #view-product-master-refresh .pmr-error-help {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* v72ei - Product Master committed review is read-only; row review gets search + pagination */
#view-product-master-refresh .pmr-review-search {
  min-width: min(420px, 100%);
  max-width: 460px;
}
#view-product-master-refresh .pmr-review-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 20px 12px;
  flex-wrap: wrap;
}
#view-product-master-refresh .pmr-pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#view-product-master-refresh .pmr-pager-actions select {
  min-width: 76px;
  margin-left: 6px;
  height: 34px;
}
#view-product-master-refresh #pmrFinalBatchNotice {
  margin-left: 0;
  margin-right: 0;
}
@media (max-width: 720px) {
  #view-product-master-refresh .pmr-review-search {
    min-width: 100%;
  }
  #view-product-master-refresh .pmr-review-pager {
    padding-left: 16px;
    padding-right: 16px;
  }
}


/* v72ej - Product Master import pager alignment */
#view-product-master-refresh .pmr-pager-actions label.tiny-muted {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
#view-product-master-refresh .pmr-pager-actions select,
#view-product-master-refresh .pmr-pager-actions .btn {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
}
#view-product-master-refresh .pmr-pager-actions select {
  margin-left: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* v72ek - Product Master import review search/pager alignment */
#view-product-master-refresh .pmr-review-actions .pmr-review-search {
  display: none;
}
#view-product-master-refresh .pmr-pager-actions .pmr-review-search {
  width: min(520px, 38vw);
  min-width: 260px;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  margin: 0 8px 0 0;
}
#view-product-master-refresh .pmr-pager-actions label.tiny-muted.pmr-page-size-label {
  white-space: nowrap;
  line-height: 1;
  height: 38px;
}
#view-product-master-refresh .pmr-pager-actions select,
#view-product-master-refresh .pmr-pager-actions .btn {
  height: 38px;
  min-height: 38px;
  line-height: 1.2;
}
@media (max-width: 900px) {
  #view-product-master-refresh .pmr-pager-actions {
    width: 100%;
    justify-content: flex-start;
  }
  #view-product-master-refresh .pmr-pager-actions .pmr-review-search {
    width: 100%;
    min-width: 100%;
    margin-right: 0;
  }
}

/* v72em - Standalone Vendor GTIN reference cache card */
#view-product-master-refresh .pmr-reference-cache-card {
  margin-top: 16px;
}
#view-product-master-refresh .pmr-reference-cache-card .card-body {
  padding: 16px 20px 20px;
}
#view-product-master-refresh .pmr-reference-cache-grid {
  grid-template-columns: minmax(190px, 0.75fr) minmax(320px, 1.5fr) minmax(190px, 0.75fr) minmax(280px, 1fr);
  gap: 14px 16px;
  align-items: start;
}
#view-product-master-refresh .pmr-reference-cache-grid .form-group {
  align-self: start;
}
#view-product-master-refresh .pmr-reference-cache-upload-action .btn {
  min-height: 38px;
}
#view-product-master-refresh #pmrRefCacheStatus {
  padding: 9px 10px;
  border: 1px solid var(--border, #dbe4f0);
  border-radius: 10px;
  background: #fff;
  min-height: 38px;
}
#view-product-master-refresh #pmrRefMsg {
  margin-top: 10px;
}
@media (max-width: 1000px) {
  #view-product-master-refresh .pmr-reference-cache-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  #view-product-master-refresh .pmr-reference-cache-grid {
    grid-template-columns: 1fr;
  }
}

#view-product-master-refresh .pmr-import-cache-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.25;
}
#view-product-master-refresh .pmr-import-cache-status.success-text {
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.25);
  background: rgba(5, 150, 105, 0.06);
}
#view-product-master-refresh .pmr-import-cache-status.danger-text {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
}

/* v72eo - Product Master review action layout: checkbox gets a clean action row */
#view-product-master-refresh .pmr-review-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  justify-content: stretch;
  min-width: min(860px, 100%);
}
#view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn {
  grid-column: 2;
  justify-self: end;
}
#view-product-master-refresh .pmr-review-actions #pmrRowsFilter {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 38px;
}
#view-product-master-refresh .pmr-review-secondary-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
  margin: 0 auto 0 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  line-height: 1.2;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
}
#view-product-master-refresh .pmr-review-secondary-actions .btn {
  min-height: 38px;
}
#view-product-master-refresh .pmr-review-action-spacer {
  flex: 1 1 auto;
}
@media (max-width: 900px) {
  #view-product-master-refresh .pmr-review-actions {
    min-width: 100%;
    grid-template-columns: 1fr;
  }
  #view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn,
  #view-product-master-refresh .pmr-review-actions #pmrRowsFilter,
  #view-product-master-refresh .pmr-review-secondary-actions {
    grid-column: 1;
  }
  #view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn {
    justify-self: start;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
    white-space: normal;
    width: 100%;
  }
  #view-product-master-refresh .pmr-review-action-spacer {
    display: none;
  }
}


/* v72ep - Product Master review checkbox label fix: keep checkbox and label text together */
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  margin: 0 auto 0 0;
  white-space: nowrap;
  line-height: 1.2;
  cursor: pointer;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap input[type="checkbox"] {
  width: 14px !important;
  min-width: 14px;
  max-width: 14px;
  height: 14px;
  min-height: 14px;
  max-height: 14px;
  padding: 0;
  margin: 0;
  flex: 0 0 14px;
  box-sizing: border-box;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap span {
  display: inline-block;
  white-space: nowrap;
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  #view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap span {
    white-space: normal;
  }
}

/* v72er - Product Master review action row + reference cache row-count wording cleanup */
#view-product-master-refresh .pmr-review-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  justify-content: stretch;
  min-width: min(900px, 100%);
}
#view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
#view-product-master-refresh .pmr-review-secondary-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrRowsFilter {
  width: min(520px, 40vw);
  min-width: 240px;
  height: 38px;
  min-height: 38px;
  flex: 0 1 520px;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
  margin: 0;
  min-height: 38px;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  white-space: nowrap;
  line-height: 1.2;
}
#view-product-master-refresh .pmr-review-secondary-actions .btn {
  min-height: 38px;
  height: 38px;
}
#view-product-master-refresh .pmr-review-action-spacer {
  flex: 1 1 40px;
}
@media (max-width: 980px) {
  #view-product-master-refresh .pmr-review-actions {
    min-width: 100%;
    grid-template-columns: 1fr;
  }
  #view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn,
  #view-product-master-refresh .pmr-review-secondary-actions {
    grid-column: 1;
  }
  #view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn {
    justify-self: start;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrRowsFilter {
    width: 100%;
    min-width: 100%;
    flex-basis: 100%;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap span {
    white-space: normal;
  }
  #view-product-master-refresh .pmr-review-action-spacer {
    display: none;
  }
}

/* v72es - Product Master review controls: keep filter, full-catalog checkbox, and action buttons on one row */
#view-product-master-refresh .pmr-review-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  min-width: min(1120px, 100%);
}
#view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn {
  align-self: flex-end;
  justify-self: auto;
  grid-column: auto;
}
#view-product-master-refresh .pmr-review-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrRowsFilter {
  width: auto !important;
  min-width: 240px;
  max-width: 420px;
  flex: 1 1 340px;
  min-height: 38px;
  grid-column: auto;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
  margin: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 38px;
  min-width: max-content;
  max-width: 520px;
  white-space: nowrap;
  flex: 0 0 auto;
  line-height: 1.2;
}
#view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap input[type="checkbox"] {
  width: auto !important;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
}
#view-product-master-refresh .pmr-review-secondary-actions .btn {
  flex: 0 0 auto;
  min-height: 38px;
}
#view-product-master-refresh .pmr-review-action-spacer {
  display: none;
}
@media (max-width: 1180px) {
  #view-product-master-refresh .pmr-review-secondary-actions {
    flex-wrap: wrap;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrRowsFilter {
    max-width: none;
    flex: 1 1 100%;
  }
}
@media (max-width: 900px) {
  #view-product-master-refresh .pmr-review-actions {
    min-width: 100%;
  }
  #view-product-master-refresh .pmr-review-actions #pmrReviewBackToListBtn {
    align-self: flex-start;
  }
  #view-product-master-refresh .pmr-review-secondary-actions {
    justify-content: flex-start;
  }
  #view-product-master-refresh .pmr-review-secondary-actions #pmrMarkMissingWrap {
    white-space: normal;
    min-width: 0;
    max-width: 100%;
  }
}

/* v72et - Product Master review four-row layout
   1) Back to List, 2) title/status, 3) import controls, 4) search/pagination */
#view-product-master-refresh #pmrReviewCard .pmr-review-header {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-top-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-title-row {
  display: block;
  min-width: 0;
  width: 100%;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-title-row .card-subtitle {
  max-width: 100%;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter {
  flex: 1 1 420px;
  min-width: 240px;
  max-width: 560px;
  min-height: 38px;
  width: auto !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  min-height: 38px;
  min-width: max-content;
  max-width: 560px;
  white-space: nowrap;
  line-height: 1.2;
  flex: 0 0 auto;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap input[type="checkbox"] {
  width: auto !important;
  min-width: 0 !important;
  margin: 0;
  flex: 0 0 auto;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap span {
  white-space: nowrap;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions .btn {
  flex: 0 0 auto;
  min-height: 38px;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-action-spacer {
  display: none;
}
@media (max-width: 1240px) {
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter {
    flex: 1 1 100%;
    max-width: none;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap {
    white-space: normal;
    min-width: 0;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap span {
    white-space: normal;
  }
}

/* v72eu - Product Master review action row: compact left filter, right-aligned actions */
#view-product-master-refresh #pmrReviewCard .pmr-review-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter {
  flex: 0 0 320px !important;
  width: 320px !important;
  min-width: 220px !important;
  max-width: 320px !important;
  margin-right: auto !important;
  min-height: 38px !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap {
  margin-left: 0 !important;
  flex: 0 0 auto !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions .btn {
  flex: 0 0 auto !important;
}
@media (max-width: 1100px) {
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrMarkMissingWrap {
    margin-left: 0 !important;
  }
}


/* v72ev - Product Master review actions: compact left filter, controls right in a real wrapper */
#view-product-master-refresh #pmrReviewCard .pmr-review-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter.pmr-filter-select {
  flex: 0 0 260px !important;
  width: 260px !important;
  min-width: 220px !important;
  max-width: 260px !important;
  margin: 0 !important;
  min-height: 38px !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-action-controls {
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-action-controls #pmrMarkMissingWrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  white-space: nowrap !important;
  flex: 0 1 auto !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-action-controls #pmrMarkMissingWrap input[type="checkbox"] {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  flex: 0 0 16px !important;
}
#view-product-master-refresh #pmrReviewCard .pmr-review-action-controls .btn {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 1200px) {
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter.pmr-filter-select {
    flex: 0 0 260px !important;
    width: 260px !important;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-action-controls {
    margin-left: 0 !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }
}
@media (max-width: 720px) {
  #view-product-master-refresh #pmrReviewCard .pmr-review-actions #pmrRowsFilter.pmr-filter-select {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: none !important;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-action-controls {
    width: 100% !important;
  }
  #view-product-master-refresh #pmrReviewCard .pmr-review-action-controls #pmrMarkMissingWrap {
    white-space: normal !important;
  }
}

/* v72f Quick Product Lookup desktop kiosk */
.quick-lookup-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:14px; align-items:stretch; }
.quick-lookup-panel { border:1px solid var(--border, #d9e2ef); border-radius:14px; padding:14px; background:#fbfdff; display:grid; gap:8px; align-content:start; }
.quick-lookup-panel h3 { margin:0; font-size: var(--ui-fs-15); }
.ql-results { display:grid; gap:10px; }
.ql-result-card { border:1px solid var(--border, #d9e2ef); border-radius:14px; background:#fbfdff; padding:12px; display:grid; gap:8px; }
.ql-result-main { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; align-items:flex-start; }
.ql-error-log { display:grid; gap:8px; margin-top:8px; }
.ql-error-row { border:1px solid #fecaca; background:#fff7f7; color:#b42318; border-radius:12px; padding:8px 10px; display:grid; gap:4px; }
@media (max-width: 1100px) { .quick-lookup-grid { grid-template-columns: 1fr; } }

/* v72fc Quick Lookup staging/reference/error polish */
.ql-error-card .ql-error-log:empty::before {
  content: 'No lookup errors yet.';
  color: var(--muted, #6b7c93);
  font-size: var(--ui-fs-13);
}
.ql-result-card.ql-result-reference-only {
  border-color: #fca5a5;
  background: #fff7f7;
  color: #7f1d1d;
}
.ql-reference-warning {
  color: #b42318;
  font-weight: 700;
  font-size: var(--ui-fs-12);
}
.badge-danger {
  background: #fdecea;
  color: #b42318;
}

/* v72g Quick Lookup Availability Finder + Draft DC basket */
.ql-draft-header { align-items:flex-start; gap:12px; }
.ql-draft-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.ql-draft-actions select { min-width:240px; max-width:360px; }
.ql-availability-badges { margin-top:2px; }
.ql-warehouse-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap:8px; margin-top:2px; }
.ql-warehouse-row { border:1px solid var(--border, #d9e2ef); border-radius:12px; padding:8px 10px; background:#fff; display:grid; gap:2px; font-size: var(--ui-fs-12); }
.ql-warehouse-row.ready { border-color:#bbf7d0; background:#f0fdf4; }
.ql-warehouse-row.blocked { border-color:#e2e8f0; background:#f8fafc; color:#475569; }
.ql-warehouse-row strong { font-size: var(--ui-fs-12); }
.ql-warehouse-row small { color:var(--text-muted); }
@media (max-width: 760px) {
  .ql-draft-actions { width:100%; justify-content:stretch; }
  .ql-draft-actions select,
  .ql-draft-actions button { flex:1 1 100%; }
}

/* v72ga Quick Lookup desktop spacing and manual auto-search cleanup */
.quick-lookup-card .quick-lookup-grid {
  padding: 14px 18px 18px;
}
.quick-lookup-card .quick-lookup-panel {
  min-height: 118px;
}
.quick-lookup-card .quick-lookup-panel .scanner-entry-status {
  min-height: 16px;
}
.ql-error-card .ql-error-log {
  margin-top: 0;
  padding: 12px 18px 16px;
}
.ql-results {
  padding: 14px 18px 18px;
}
.ql-results .empty-state {
  padding: 34px 12px;
}

/* v72gb Quick Lookup exact manual search restore */
.quick-lookup-manual-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.quick-lookup-manual-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.quick-lookup-manual-row .btn {
  flex: 0 0 auto;
}
@media (max-width: 700px) {
  .quick-lookup-manual-row {
    flex-wrap: wrap;
  }
  .quick-lookup-manual-row .btn {
    width: 100%;
  }
}

/* v72ge Quick Lookup Draft DC stock-gated draft button */
.ql-staging-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ql-draft-card[hidden],
#qlCreateDraftBtn[hidden] {
  display: none !important;
}
.ql-draft-card .scanner-entry-status {
  padding: 0 18px;
}
.ql-draft-list {
  display: grid;
  gap: 10px;
  padding: 12px 18px 18px;
}
.ql-draft-row {
  border: 1px solid var(--border, #d9e2ef);
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.ql-draft-qty {
  display: grid;
  gap: 4px;
  min-width: 94px;
  color: var(--text-muted);
  font-size: var(--ui-fs-12);
  font-weight: 700;
}
.ql-draft-qty input {
  width: 88px;
}
.ql-draft-warehouse-modal select {
  width: 100%;
  min-height: 40px;
}
@media (max-width: 760px) {
  .ql-staging-actions { width: 100%; justify-content: stretch; }
  .ql-staging-actions button { flex: 1 1 100%; }
}

/* v72gg Quick Lookup grouped warehouse + lot bucket availability display */
.ql-warehouse-grouped-grid { grid-template-columns: 1fr; }
.ql-warehouse-group { display:block; padding:10px 12px; }
.ql-warehouse-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.ql-warehouse-header strong { font-size: var(--ui-fs-13); }
.warehouse-status-pill { border:1px solid var(--border, #d9e2ef); border-radius:999px; padding:2px 8px; background:#fff; color:var(--text-muted); white-space:nowrap; }
.ql-warehouse-summary { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:7px; }
.ql-warehouse-summary span { border:1px solid var(--border, #d9e2ef); border-radius:999px; padding:2px 8px; background:#fff; font-size: var(--ui-fs-12); }
.ql-warehouse-reason { font-size: var(--ui-fs-12); color:var(--text-muted); margin:4px 0 7px; }
.ql-stock-buckets-title { font-size: var(--ui-fs-11); font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em; margin:7px 0 5px; }
.ql-stock-buckets { display:grid; gap:5px; }
.ql-stock-bucket { display:flex; align-items:center; flex-wrap:wrap; gap:5px 8px; border:1px solid var(--border, #d9e2ef); border-radius:10px; padding:6px 8px; background:#fff; font-size: var(--ui-fs-12); }
.ql-stock-bucket.ready { border-color:#bbf7d0; background:#f8fff9; }
.ql-stock-bucket.blocked { background:#f8fafc; color:#475569; }
.ql-stock-bucket .bucket-main { font-weight:700; min-width:220px; }
.ql-stock-bucket small { width:100%; color:var(--text-muted); }

/* v72gh Quick Lookup spacing and duplicate REF staging cleanup */
.ql-staging-actions + .ql-results,
.card-header + .ql-results {
  margin-top: 4px;
}
.ql-results > .ql-result-card:first-child {
  margin-top: 4px;
}


/* v72gi Quick Lookup Draft DC header confirmation popup */
.ql-draft-header-modal {
  max-width: 620px;
}
.ql-draft-header-modal input[readonly] {
  background: #f8fafc;
  color: var(--text-muted);
}
#qlDraftHeaderMsg {
  margin-top: 8px;
}


/* v72h expiry report */
.expiry-report-header { align-items: flex-start; }
.expiry-report-tabs { padding-top: 12px; }
.expiry-report-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 20px 18px; border-top:1px solid var(--border); flex-wrap:wrap; }
.expiry-report-toolbar .search-box { flex: 1 1 320px; max-width: 520px; }
.expiry-report-toolbar input { width:100%; }
.expiry-report-kpis { margin-top:16px; margin-bottom:16px; }
#view-expiry-report .table-wrap td { vertical-align: top; }
#view-expiry-report .row-warn { background:#fffaf0; }
#view-expiry-report .row-low { background:#fff5f5; }
@media (max-width: 760px) {
  .expiry-report-toolbar { align-items: stretch; }
  .expiry-report-toolbar .search-box { max-width:none; }
}

/* v72i operations / candidate / governance polish */
.operations-card { margin-bottom: 16px; }
.operations-tabs { margin-top: 10px; }
.operations-kpis { margin-top: 14px; }
.link-button { border: 0; background: transparent; color: var(--primary, #0b4fcc); cursor: pointer; padding: 0; font-weight: 700; }
#candidateReviewRows td { vertical-align: top; }

/* v72ia: Remote Capture person/session start popup */
.pa-remote-start-modal { width: min(720px, calc(100vw - 32px)); max-width: 720px; }
.readonly-box { min-height: 40px; display:flex; align-items:center; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: #f8fbff; color: var(--muted); }
.pa-remote-start-modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .pa-remote-start-modal .form-grid { grid-template-columns: 1fr; } }

/* v72ib: admin selectable captured-audit tab grouping */
.pa-lines-tab-grouping-controls {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
}
.pa-tab-group-toggle select {
  height: 32px;
  min-width: 150px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: var(--ui-fs-13);
}

/* v72im: show either audit listing or selected audit workspace, not both */
.pa-workspace-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pa-workspace-title-row .dashboard-section-title {
  margin: 0;
}

/* v72io: Physical Audit polish - OCR debug, stronger ownership, delete safeguards */
.pa-ocr-debug-panel {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
  overflow: hidden;
}
.pa-ocr-debug-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.pa-ocr-debug-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pa-ocr-debug-preview {
  margin: 0;
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  background: #0f172a;
  color: #e5eefc;
  font-size: var(--ui-fs-12);
  line-height: 1.45;
  white-space: pre-wrap;
}
.pa-owner-select-strong {
  border-color: #9db2cf !important;
  font-weight: 700;
}


/* v72ip: in-app Physical Audit count-row delete confirmation */
.pa-delete-line-modal {
  width: min(760px, calc(100vw - 40px));
  overflow-y: visible;
}
.pa-delete-line-body {
  padding-top: 18px;
}
.pa-delete-warning {
  border: 1px solid #f2d5a5;
  background: #fff8e8;
  color: #7a4c00;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  line-height: 1.35;
}
.pa-delete-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.pa-delete-detail-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
  background: var(--surface-muted);
}
.pa-delete-detail-label {
  color: var(--text-muted);
  font-size: var(--ui-fs-11);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pa-delete-detail-value {
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.pa-delete-confirm-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.pa-delete-confirm-row label {
  color: var(--text-muted);
  font-weight: 600;
}
.pa-delete-confirm-row input {
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}
@media (max-width: 720px) {
  .pa-delete-detail-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .pa-delete-confirm-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .pa-delete-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* v72ir/v72is: Physical Audit OCR debug modal, delete feedback and mobile copy fallback */
.pa-ocr-debug-modal {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 42px);
  display: flex;
  flex-direction: column;
}
.pa-ocr-debug-modal-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.pa-ocr-debug-modal-preview {
  margin: 0;
  padding: 14px 16px;
  min-height: 280px;
  max-height: calc(100vh - 240px);
  overflow: auto;
  background: #0f172a;
  color: #e5eefc;
  font-size: var(--ui-fs-12);
  line-height: 1.45;
  white-space: pre-wrap;
}
.pa-row-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pa-delete-confirm-not-ready {
  opacity: .72;
  filter: saturate(.75);
}
.pa-delete-confirm-not-ready:hover {
  opacity: .95;
}

/* v72is: OCR debug mobile clipboard fallback */
.pa-ocr-debug-manual-copy {
  margin: 10px 12px 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--text);
}
.pa-ocr-debug-manual-copy.hidden {
  display: none;
}
.pa-ocr-debug-manual-copy-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.pa-ocr-debug-manual-copy p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--ui-fs-13);
}
.pa-ocr-debug-manual-copy textarea {
  width: 100%;
  min-height: 160px;
  max-height: 35vh;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--ui-fs-12);
  line-height: 1.4;
  background: #fff;
  color: var(--text);
}
.msg.msg-warn {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}

/* v72iu: Physical Audit staging warnings modal */
.pa-stage-warnings-modal {
  width: min(980px, calc(100vw - 28px));
  max-width: 980px;
}
.pa-stage-warnings-body {
  max-height: min(72vh, 720px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pa-stage-warning-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.pa-stage-warning-card.pa-stage-warning-focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: rgba(37, 99, 235, 0.55);
}
.pa-stage-warning-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pa-stage-warning-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.pa-stage-warning-grid > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg-soft);
}
.pa-stage-warning-grid span {
  display: block;
  color: var(--muted);
  font-size: var(--ui-fs-11);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.pa-stage-warning-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.35;
}
.pa-warning-row-btn {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .pa-stage-warning-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

/* v72iw: compact Physical Audit photo/remote staging review UI */
.pa-stage-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pa-stage-gtin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  font-size: var(--ui-fs-13);
  white-space: nowrap;
}
.pa-stage-gtin-toggle input { margin: 0; }
.pa-stage-review-table {
  table-layout: fixed;
}
.pa-stage-review-table th,
.pa-stage-review-table td {
  padding: 6px 8px;
  vertical-align: middle;
}
.pa-stage-review-table th:nth-child(1),
.pa-stage-review-table td:nth-child(1) { width: 42px; text-align: center; }
.pa-stage-review-table th:nth-child(2),
.pa-stage-review-table td:nth-child(2) { width: 52px; text-align: center; }
.pa-stage-review-table th:nth-child(3),
.pa-stage-review-table td:nth-child(3) { width: 140px; }
.pa-stage-review-table th:nth-child(4),
.pa-stage-review-table td:nth-child(4) { width: 150px; }
.pa-stage-review-table th:nth-child(5),
.pa-stage-review-table td:nth-child(5) { width: auto; min-width: 240px; }
.pa-stage-review-table th:nth-child(6),
.pa-stage-review-table td:nth-child(6) { width: 160px; }
.pa-stage-review-table th:nth-child(7),
.pa-stage-review-table td:nth-child(7) { width: 140px; }
.pa-stage-review-table th:nth-child(8),
.pa-stage-review-table td:nth-child(8) { width: 78px; }

.pa-stage-compact-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  font-weight: 800;
  letter-spacing: .01em;
}
.pa-stage-status-cell {
  text-align: center;
}
.pa-stage-review-table td:nth-child(5) .table-input {
  width: 100%;
}
.pa-stage-review-table .table-input {
  min-width: 0;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: var(--ui-fs-13);
  line-height: 1.25;
}
.pa-stage-review-table .status-badge,
.pa-stage-review-table .badge,
.pa-stage-status-cell .badge {
  margin: 0;
  white-space: nowrap;
}
.pa-stage-status-cell .tiny-muted,
.pa-stage-match-message {
  margin-top: 2px;
  line-height: 1.1;
}
.pa-stage-gtin {
  margin-top: 2px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.pa-stage-qty-input {
  max-width: 70px;
}
.pa-warning-row-btn.btn-xs {
  padding: 4px 7px;
  font-size: var(--ui-fs-12);
  line-height: 1.15;
}

/* v72iw: keep staging warning modal footer/close button fully visible */
.pa-stage-warnings-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 28px);
  overflow: hidden;
}
.pa-stage-warnings-modal .modal-header,
.pa-stage-warnings-modal .modal-actions {
  flex: 0 0 auto;
}
.pa-stage-warnings-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.pa-stage-warnings-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 14px 22px;
}

/* v72ix: captured audit line edit action and tighter font consistency */
.pa-lines-table tbody td,
.pa-lines-table tbody td.mono,
.pa-lines-table .pa-line-description {
  font-family: inherit;
  font-size: var(--ui-fs-13);
  line-height: 1.25;
  color: var(--text);
}
.pa-lines-table .tiny-muted {
  font-family: inherit;
  font-size: var(--ui-fs-11);
  color: var(--text-muted);
}
.pa-line-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  white-space: nowrap;
}
.pa-lines-table .pa-edit-line-btn:hover,
.pa-lines-table .pa-edit-line-btn:focus {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.pa-edit-line-modal {
  width: min(860px, calc(100vw - 40px));
}
.pa-edit-line-warning {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  line-height: 1.35;
}
.pa-edit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.pa-edit-summary-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-muted);
  min-width: 0;
}
.pa-edit-summary-item span {
  display: block;
  color: var(--text-muted);
  font-size: var(--ui-fs-11);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.pa-edit-summary-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: var(--ui-fs-13);
}
.pa-edit-line-grid {
  grid-template-columns: 150px minmax(180px, 1fr) minmax(180px, 1fr);
  align-items: end;
}
@media (max-width: 720px) {
  .pa-edit-summary-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .pa-edit-line-grid { grid-template-columns: 1fr; }
}

.pa-edit-expiry-wrap {
  width: 100%;
  display: flex;
}
.pa-edit-expiry-wrap .ba-expiry-input {
  width: 100%;
  min-width: 0;
}
.pa-edit-expiry-wrap .ba-expiry-date-picker {
  min-width: 0;
}

/* v72izh: Remote Capture start modal + low-burden laptop refresh polish */
.pa-remote-mobile-review-setting {
  grid-column: span 2;
}
.pa-remote-mobile-review-setting .mistral-toggle-label {
  justify-content: flex-start;
  width: fit-content;
}
.pa-remote-poll-status {
  min-height: 18px;
  margin-top: 4px;
}
.pa-remote-poll-status.pa-remote-poll-busy::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .75;
}
.pa-remote-review .pa-remote-review-header {
  background: #fff;
}
.pa-remote-review .pa-stage-review-table,
.pa-photo-stage-panel .pa-stage-review-table {
  width: 100%;
}
@media (max-width: 720px) {
  .pa-remote-mobile-review-setting { grid-column: span 1; }
}

/* v72izj: Photo auto-scan + Remote Capture checkbox alignment polish */
#view-physical-audit .pa-remote-actions-row .pa-remote-debug-toggle {
  width: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  margin-left: 4px;
  white-space: nowrap;
}
#view-physical-audit .pa-remote-debug-toggle input,
#paRemoteStartModal .pa-remote-start-check input {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}
#view-physical-audit .pa-remote-debug-toggle span,
#paRemoteStartModal .pa-remote-start-check span {
  flex: 0 0 auto !important;
  white-space: nowrap;
}
#paRemoteStartModal .pa-remote-mobile-review-setting {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  grid-column: 1 / -1;
}
#paRemoteStartModal .pa-remote-mobile-review-setting .pa-remote-start-check {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: auto !important;
  max-width: max-content;
  margin: 0 0 6px 0;
}
#view-physical-audit .pa-photo-scan-actions-row #paPhotoFile {
  flex: 0 1 390px !important;
}
@media (max-width: 720px) {
  #view-physical-audit .pa-remote-actions-row .pa-remote-debug-toggle {
    flex: 1 1 100% !important;
    margin-left: 0;
  }
}

/* v72izk: force Remote Capture popup checkbox + label into compact left-aligned line */
#paRemoteStartModal .pa-remote-mobile-review-setting {
  grid-column: 1 / -1;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 6px !important;
}
#paRemoteStartModal .pa-checkbox-line.pa-remote-start-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
#paRemoteStartModal .pa-checkbox-line.pa-remote-start-check input[type="checkbox"] {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  flex: 0 0 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
#paRemoteStartModal .pa-checkbox-line.pa-remote-start-check label {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  line-height: 16px !important;
  text-align: left !important;
  font-size: var(--ui-fs-13) !important;
  font-weight: 600 !important;
  color: var(--text-2) !important;
}
#paRemoteStartModal .pa-remote-mobile-review-setting .tiny-muted {
  max-width: 520px;
}


/* v72izl: hard-fix Remote Capture popup checkbox rendering as one inline label */
#paRemoteStartModal .pa-remote-mobile-review-setting {
  grid-column: 1 / -1 !important;
  display: block !important;
  text-align: left !important;
}
#paRemoteStartModal label.pa-remote-start-inline-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: auto !important;
  max-width: max-content !important;
  min-width: 0 !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  line-height: 18px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  color: var(--text-2) !important;
  font-size: var(--ui-fs-13) !important;
  font-weight: 600 !important;
}
#paRemoteStartModal label.pa-remote-start-inline-check input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  display: inline-block !important;
  position: static !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  flex: 0 0 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
#paRemoteStartModal label.pa-remote-start-inline-check span {
  display: inline-block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  line-height: 18px !important;
}

/* v72izr: Remote Capture upload table compact timing/action layout */
.pa-remote-captures-table table {
  table-layout: fixed;
  width: 100%;
}
.pa-remote-captures-table th:nth-child(1),
.pa-remote-captures-table td:nth-child(1) { width: 52px; }
.pa-remote-captures-table th:nth-child(2),
.pa-remote-captures-table td:nth-child(2) { width: 150px; }
.pa-remote-captures-table th:nth-child(4),
.pa-remote-captures-table td:nth-child(4) { width: 108px; text-align: left; }
.pa-remote-captures-table th:nth-child(5),
.pa-remote-captures-table td:nth-child(5) { width: 118px; }
.pa-remote-captures-table th:nth-child(6),
.pa-remote-captures-table td:nth-child(6) { width: 178px; }
.pa-remote-captures-table th:nth-child(7),
.pa-remote-captures-table td:nth-child(7) { width: 220px; }
.pa-remote-captures-table td:nth-child(2) .tiny-muted {
  max-width: 140px;
  line-height: 1.2;
}
.pa-remote-timing {
  display: grid;
  gap: 2px;
  font-size: var(--ui-fs-12);
  line-height: 1.15;
  color: var(--muted);
  white-space: nowrap;
}
.pa-remote-timing span,
.pa-remote-timing button {
  display: block;
  text-align: left;
  font-size: var(--ui-fs-12);
}

.pa-remote-ident-count {
  display: grid;
  gap: 1px;
  font-size: var(--ui-fs-12);
  line-height: 1.16;
  color: var(--muted);
  white-space: nowrap;
}
.pa-remote-ident-count strong {
  color: var(--text);
  font-size: var(--ui-fs-13);
  font-weight: 700;
}
.pa-remote-count-caution {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff7e6;
  color: #9a5b00;
  font-size: var(--ui-fs-11);
  font-weight: 700;
  white-space: nowrap;
}
.pa-remote-row-actions,
.pa-remote-captures-table .pa-row-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.pa-remote-row-actions .btn,
.pa-remote-captures-table .pa-row-actions-inline .btn {
  white-space: nowrap;
}
@media (max-width: 980px) {
  .pa-remote-captures-table table { table-layout: auto; }
  .pa-remote-captures-table th:nth-child(n),
  .pa-remote-captures-table td:nth-child(n) { width: auto; }
}

/* v72izs: Remote Capture image filter and non-blocking remote image reference */
.pa-remote-capture-filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px 6px;
  border-top: 1px solid var(--border-soft, #e8eef7);
  background: #fbfdff;
}
.pa-checkbox-inline-tight {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  white-space: nowrap;
  color: var(--muted, #6b7f99);
  font-size: var(--ui-fs-13);
  line-height: 1.2;
}
.pa-checkbox-inline-tight input[type="checkbox"] {
  margin: 0 !important;
  flex: 0 0 auto;
}

/* v72izu: Remote Capture image-list filter alignment and non-duplicated status display */
.pa-remote-capture-filterbar {
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px 16px;
}
.pa-remote-filter-summary {
  flex: 1 1 auto;
  min-width: 240px;
  padding-top: 2px;
}
.pa-remote-capture-filter-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.pa-remote-filter-check {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--muted, #6b7f99);
  font-size: var(--ui-fs-13);
  line-height: 16px;
  white-space: nowrap;
}
.pa-remote-filter-check input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 14px !important;
  position: static !important;
  transform: none !important;
  vertical-align: middle !important;
}
.pa-remote-filter-check span {
  display: inline !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}
.pa-remote-status-cell {
  display: grid;
  align-items: start;
  justify-items: start;
  gap: 3px;
  min-width: 0;
}
.pa-remote-status-detail {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .pa-remote-capture-filterbar { align-items: stretch; }
  .pa-remote-capture-filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}


/* v72izv: pack Photo Scan input controls into one row; debug moves into stage header */
#view-physical-audit .pa-photo-scan-single-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}
#view-physical-audit .pa-photo-scan-single-row #paPhotoFile[type="file"] {
  width: 360px !important;
  min-width: 260px !important;
  max-width: 420px !important;
  flex: 0 1 360px !important;
}
#view-physical-audit .pa-photo-scan-single-row #paPhotoScanMode {
  width: 300px !important;
  min-width: 240px !important;
  max-width: 360px !important;
  flex: 0 0 300px !important;
}
#view-physical-audit .pa-photo-scan-single-row .pa-compact-check {
  width: auto !important;
  max-width: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}
@media (max-width: 920px) {
  #view-physical-audit .pa-photo-scan-single-row #paPhotoFile[type="file"],
  #view-physical-audit .pa-photo-scan-single-row #paPhotoScanMode {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* v72izx: compact Remote Photo Capture ended/open session spacing */
#paRemoteCapturePanel .pa-remote-controls-stack {
  gap: 4px;
}
#paRemoteCapturePanel #paRemoteCaptureMsg:empty,
#paRemoteCapturePanel #paRemotePollStatus:empty {
  display: none !important;
}
#paRemoteCapturePanel #paRemoteCaptureMsg,
#paRemoteCapturePanel #paRemotePollStatus {
  margin-top: 0;
}
#paRemoteCapturePanel .scanner-entry-warehouse-row.pa-remote-actions-row {
  margin-bottom: 0;
  padding-bottom: 8px;
}
#paRemoteCapturePanel .pa-remote-session-box {
  margin-top: 8px;
}
#paRemoteCapturePanel .pa-remote-session-card {
  margin-top: 0;
}

/* v72jd - Audit Sessions card row actions */
.pa-session-row-actions {
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.pa-session-row-end-remote {
  margin: 0;
  white-space: nowrap;
}


/* v72jt: password visibility eye toggle */
.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-field-wrap input[type="password"],
.password-field-wrap input[type="text"] {
  width: 100%;
  padding-right: 42px;
}
.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ui-fs-15);
  line-height: 1;
}
.password-toggle-btn:hover,
.password-toggle-btn:focus {
  background: #e8eef8;
  color: #0f172a;
  outline: none;
}
.password-field-wrap-inline {
  flex: 1 1 auto;
}


/* v72jy/v72jz: Delivery Challan OCR scan busy and in-stock review controls */
.cd-scan-busy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #92400e;
  background: #fffbea;
  border: 1px solid #fde68a;
  padding: 5px 8px;
  border-radius: 8px;
}
#cdScanProductLabel.disabled {
  opacity: 0.65;
  cursor: wait !important;
  pointer-events: none;
}

.cd-checkin-ocr-label.disabled {
  opacity: 0.65;
  cursor: wait !important;
  pointer-events: none;
}
.cd-stage-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cd-show-oos-toggle {
  margin-left: auto;
  color: var(--text-muted);
  white-space: nowrap;
}
@media (max-width: 760px) {
  .cd-stage-review-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .cd-show-oos-toggle { margin-left: 0; }
}

/* v72jzk Manual Guided Crop Rescue */
.pa-manual-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: none;
  background: rgba(15, 23, 42, 0.62);
  padding: 24px;
}
.pa-manual-crop-overlay.open { display: flex; align-items: center; justify-content: center; }
.pa-manual-crop-card {
  width: min(1280px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  background: #fff;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pa-manual-crop-head,
.pa-manual-crop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6edf7;
}
.pa-manual-crop-foot { border-top: 1px solid #e6edf7; border-bottom: 0; }
.pa-manual-crop-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid #e6edf7;
  background: #f8fafc;
}
.pa-manual-crop-sep { width: 1px; height: 24px; background: #d8e2ef; display: inline-block; }
.pa-manual-crop-number { width: 64px; padding: 4px 6px; border: 1px solid #cfd9e8; border-radius: 6px; }

.pa-manual-crop-toolbar .pa-icon-btn {
  min-width: 36px;
  width: 36px;
  height: 32px;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ui-fs-16);
  line-height: 1;
}
.pa-manual-crop-toolbar .pa-icon-btn-wide { width: 42px; min-width: 42px; }
.pa-icon-input-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.pa-manual-crop-toolbar .pa-manual-crop-number {
  width: 58px;
  height: 32px;
  padding: 3px 6px;
}
.pa-manual-crop-toolbar .pa-manual-crop-count { width: 48px; }
.pa-manual-crop-body {
  overflow: auto;
  padding: 12px;
  background: #eef3f9;
  min-height: 320px;
}
#paManualCropCanvas {
  display: block;
  background: #fff;
  border: 1px solid #b9c8db;
  border-radius: 8px;
  cursor: crosshair;
}
@media (max-width: 760px) {
  .pa-manual-crop-overlay { padding: 8px; }
  .pa-manual-crop-card { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .pa-manual-crop-head, .pa-manual-crop-foot { align-items: flex-start; flex-direction: column; }
}

/* v72jzp: editable Manual Guided Crop guides/rectangles */
#paManualCropCanvas {
  touch-action: none;
}
.pa-manual-crop-toolbar .btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* v72jzzd/v72jzze: Physical Audit LOT OCR conflict visibility and exact-match rollup */
.pa-lot-conflict-banner {
  margin: 8px 0 10px 0;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-left: 5px solid #dc2626;
  border-radius: 10px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 0.92rem;
}
.pa-lot-conflict-banner.open { display: block; }
.pa-lot-conflict-banner-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.pa-lot-conflict-banner ul {
  margin: 4px 0 0 0;
  padding-left: 0;
  list-style: none;
}
.pa-lot-conflict-banner li { margin: 3px 0; }
.pa-lot-conflict-row td {
  border-top-color: rgba(220, 38, 38, 0.20) !important;
  border-bottom-color: rgba(220, 38, 38, 0.20) !important;
}
.pa-lot-conflict-0 td { background: #fff7ed !important; }
.pa-lot-conflict-1 td { background: #eff6ff !important; }
.pa-lot-conflict-2 td { background: #fdf2f8 !important; }
.pa-lot-conflict-3 td { background: #f0fdf4 !important; }
.pa-lot-conflict-4 td { background: #f5f3ff !important; }
.pa-lot-conflict-5 td { background: #ecfeff !important; }
.pa-lot-conflict-input {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.10) !important;
  font-weight: 700;
}
.pa-lot-conflict-cell-note {
  margin-top: 3px;
  line-height: 1.1;
}
.pa-lot-conflict-mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: var(--ui-fs-11);
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}
.pa-lot-conflict-badge-0 { background: #fed7aa; color: #7c2d12; }
.pa-lot-conflict-badge-1 { background: #bfdbfe; color: #1e3a8a; }
.pa-lot-conflict-badge-2 { background: #fbcfe8; color: #831843; }
.pa-lot-conflict-badge-3 { background: #bbf7d0; color: #14532d; }
.pa-lot-conflict-badge-4 { background: #ddd6fe; color: #4c1d95; }
.pa-lot-conflict-badge-5 { background: #a5f3fc; color: #164e63; }

.pa-exact-rollup-banner {
  border: 1px solid #93c5fd;
  border-left: 6px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 10px 0;
  font-size: var(--ui-fs-13);
}
.pa-exact-rollup-banner.open { display: block; }
.pa-exact-rollup-banner-title {
  font-weight: 800;
  margin-bottom: 4px;
}
.pa-exact-rollup-banner ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}
.pa-exact-rollup-banner li { margin: 3px 0; }
.pa-exact-rollup-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pa-exact-rollup-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: var(--ui-fs-12);
  font-weight: 800;
  background: #bfdbfe;
  color: #1e3a8a;
  margin-right: 6px;
}


/* v72jzzq: Physical Audit staged required-field visibility */
.pa-required-missing-row td {
  background: #fff7ed !important;
}
.pa-required-missing-input {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.22) !important;
  background: #fff1f2 !important;
}
.pa-required-cell-note {
  margin-top: 3px;
  display: inline-block;
  font-size: var(--ui-fs-11);
  line-height: 1.1;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 2px 7px;
}

/* v72jzzw: temporary green tick marks on Physical Audit image reference. */
.ba-image-overlay-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ba-image-overlay-controls button {
  min-width: 28px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--ui-fs-12);
  line-height: 1;
  cursor: pointer;
}
.ba-image-overlay-controls button:hover,
.ba-image-overlay-controls button.active {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}
.pa-image-reference-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.pa-image-reference-tick-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.pa-image-reference-tick circle {
  fill: rgba(22, 163, 74, .88);
  stroke: #fff;
  stroke-width: 5;
}
.pa-image-reference-tick path {
  fill: none;
  stroke: #fff;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ba-image-overlay-body.pa-image-tick-mode {
  cursor: crosshair;
}
.ba-image-overlay-body.pa-image-tick-mode .pa-image-reference-tick-layer {
  pointer-events: auto;
}

/* v72jzzzzg: Purchase Invoice listing-first UX polish */
.pi-list-card-header {
  align-items: flex-start;
  gap: 12px;
}
.pi-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pi-list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 12px;
  flex-wrap: wrap;
}
.pi-month-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--ui-fs-12);
}
.pi-month-filter label {
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
}
.pi-month-filter select {
  min-width: 150px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
}
.pi-list-summary {
  color: var(--muted);
  font-size: var(--ui-fs-12);
  padding: 0 20px 8px;
}
.pi-list-toolbar .pi-list-summary {
  padding: 0;
}
.pi-smart-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 20px 16px;
  color: var(--muted);
  font-size: var(--ui-fs-12);
}
#piUploadCard .card-header,
#piReviewCard .card-header {
  align-items: flex-start;
}
.pi-readonly-row td {
  vertical-align: top;
  line-height: 1.35;
}
.pi-readonly-row .mono {
  white-space: nowrap;
}
#piReviewCard .purchase-review-table td {
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .pi-list-card-header,
  .pi-list-toolbar {
    align-items: stretch;
  }
  .pi-card-actions,
  .pi-smart-pager {
    justify-content: flex-start;
  }
}

/* v72jzzzzi: users/ledger listing-first polish and nav cleanup */
.user-admin-search-box,
.ledger-search-box {
  min-width: min(520px, 100%);
  flex: 1 1 420px;
}
.ledger-search-box input,
.user-admin-search-box input {
  min-width: 320px;
}
@media (max-width: 760px) {
  .ledger-search-box input,
  .user-admin-search-box input {
    min-width: 0;
    width: 100%;
  }
}

/* v72jzzzzj - left navigation workflow grouping and Products smart listing */
.product-search-box {
  min-width: 340px;
  max-width: 520px;
}
.product-search-box input {
  min-width: 320px;
}
.product-list-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
}
@media (max-width: 900px) {
  .product-search-box,
  .product-search-box input {
    width: 100%;
    min-width: 0;
  }
}

/* v72jzzzzk — Delivery Challan expiry quick-view + FEFO prompt */
.cd-expiry-cell { white-space: nowrap; font-size: var(--ui-fs-12); }
.cd-fefo-modal { width: min(620px, calc(100vw - 32px)); }
.cd-fefo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cd-fefo-choice-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-secondary); }
.cd-fefo-choice-card-preferred { border-color: rgba(15, 118, 110, 0.35); background: rgba(15, 118, 110, 0.06); }
.cd-fefo-line { margin-top: 6px; font-size: var(--ui-fs-13); line-height: 1.45; }
.cd-fefo-line strong { display: block; font-size: var(--ui-fs-14); }
.cd-fefo-line .tiny-muted { display: block; margin-top: 2px; }
@media (max-width: 640px) {
  .cd-fefo-grid { grid-template-columns: 1fr; }
  .cd-fefo-actions { flex-direction: column-reverse; align-items: stretch; }
  .cd-fefo-actions .btn { width: 100%; justify-content: center; }
}

/* v72jzzzzl — photo staging expiry calendar controls */
.pa-stage-expiry-wrap {
  width: 100%;
  max-width: 170px;
}
.pa-stage-expiry-wrap .pa-stage-expiry-input {
  width: 100%;
  padding-right: 34px;
}
.quick-lookup-manual-row input#qlSearchInput {
  flex: 1 1 auto;
}

/* v72jzzzzm: purchase invoice review cleanup and sticky scroll-grid headers */
.btn-warning {
  background: #f59e0b;
  color: #fff;
  border: 1px solid #d97706;
}
.btn-warning:hover { background: #d97706; }
.purchase-review-main-actions {
  justify-content: space-between;
}
.purchase-review-actions-left,
.purchase-review-actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.purchase-review-actions-right { justify-content: flex-end; }
#piReviewCard > .purchase-review-checklist {
  margin: 14px 20px 0;
}
#piReviewCard > #piCommitMsg {
  padding: 8px 20px 0;
  margin: 0;
}
#piReviewCard > .purchase-review-controls {
  padding-top: 12px;
  align-items: center;
}
.pi-create-candidates-btn {
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.purchase-review-wrap thead th,
.table-wrap thead th,
.compact-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
}
.purchase-review-wrap thead th { z-index: 4; }
@media (max-width: 900px) {
  .purchase-review-main-actions {
    align-items: stretch;
  }
  .purchase-review-actions-left,
  .purchase-review-actions-right {
    width: 100%;
  }
  .purchase-review-actions-right .btn,
  .purchase-review-actions-left .btn {
    flex: 1 1 150px;
    justify-content: center;
  }
}

/* v72jzzzzn: purchase review description/notes are single-line inputs to keep rows compact. */
.purchase-review-table input.pi-line-desc,
.purchase-review-table input.pi-line-notes {
  white-space: nowrap;
}


/* v72jzzzzq: align purchase review sticky header labels, hide unnecessary candidate action, and rely on candidate sync guard. */
#piReviewCard .purchase-review-table thead th {
  padding-left: 20px;
}


/* v72jzzzzz: candidate approval creates Product Master; v72jzzzzy: candidate approval state clarity and mobile no-stuck refresh; v72jzzzzt: warehouse width; v72jzzzzs/r: candidate polling, compact columns and expiry picker. */
#piReviewCard .purchase-review-table {
  min-width: 1540px;
}
#piReviewCard .purchase-review-table input,
#piReviewCard .purchase-review-table select {
  height: 38px;
}
#piReviewCard .purchase-review-table .pi-line-match-cell {
  min-width: 138px;
  white-space: nowrap;
}
#piReviewCard .purchase-review-table .pi-line-cat,
#piReviewCard .purchase-review-table .pi-line-lot,
#piReviewCard .purchase-review-table .pi-line-exp,
#piReviewCard .purchase-review-table .pi-expiry-wrap {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}
#piReviewCard .purchase-review-table .pi-line-qty,
#piReviewCard .purchase-review-table .pi-line-received {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
}
#piReviewCard .purchase-review-table .pi-line-desc {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}
#piReviewCard .purchase-review-table .pi-line-wh {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}
#piReviewCard .purchase-review-table .pi-line-list,
#piReviewCard .purchase-review-table .pi-line-taxable,
#piReviewCard .purchase-review-table .pi-line-tax,
#piReviewCard .purchase-review-table .pi-line-total {
  width: 94px;
  min-width: 94px;
  max-width: 94px;
}
#piReviewCard .purchase-review-table .pi-line-rate {
  width: 66px;
  min-width: 66px;
  max-width: 66px;
}
#piReviewCard .purchase-review-table .pi-line-notes {
  width: 135px;
  min-width: 135px;
  max-width: 135px;
}
#piReviewCard .purchase-review-table .pi-expiry-wrap .pi-line-exp {
  padding-right: 34px;
}
#piReviewCard .purchase-review-table .pi-expiry-calendar-btn {
  right: 5px;
}
#piReviewCard .purchase-review-table .ba-expiry-date-picker {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 100%;
  padding: 0;
}


/* v72jzzzzzg: SRP/China GTIN relaxation, split-GS1 label fusion, and PMR history action cleanup. */
#crReviewCard .consignment-review-table {
  min-width: 1210px;
}
#crReviewCard .consignment-review-table thead th {
  padding-left: 20px;
}
#crReviewCard .consignment-review-table input,
#crReviewCard .consignment-review-table select {
  height: 38px;
}
#crReviewCard .consignment-review-table input.cr-line-desc,
#crReviewCard .consignment-review-table input.cr-line-notes {
  white-space: nowrap;
}
#crReviewCard .consignment-review-table .cr-line-match-cell {
  min-width: 138px;
  white-space: nowrap;
}
#crReviewCard .consignment-review-table .cr-line-ref,
#crReviewCard .consignment-review-table .cr-line-lot,
#crReviewCard .consignment-review-table .cr-line-exp,
#crReviewCard .consignment-review-table .cr-expiry-wrap {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}
#crReviewCard .consignment-review-table .cr-line-qty,
#crReviewCard .consignment-review-table .cr-line-received {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
}
#crReviewCard .consignment-review-table .cr-line-desc {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}
#crReviewCard .consignment-review-table .cr-line-wh {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}
#crReviewCard .consignment-review-table .cr-line-notes {
  width: 135px;
  min-width: 135px;
  max-width: 135px;
}
#crReviewCard .consignment-review-table .cr-expiry-wrap .cr-line-exp {
  padding-right: 34px;
}
#crReviewCard .consignment-review-table .cr-expiry-calendar-btn {
  right: 5px;
}
#crReviewCard .consignment-review-table .ba-expiry-date-picker {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 100%;
  padding: 0;
}
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-wh {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-qty,
#crReviewCard.cr-compact-review .consignment-review-table .cr-line-received {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
}
#crReviewCard.cr-compact-review .consignment-review-table .cr-expiry-wrap {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}


/* v72jzzzzzi: Session-row Capture Workspace actions, strict per-Session staging isolation, and protected close/void flow. */
.pa-capture-workspace-overlay { z-index: 90; padding: 10px; background: rgba(7, 16, 30, 0.62); }
.pa-capture-workspace-overlay.open { display: flex; }
.pa-capture-workspace-shell {
  width: min(1680px, calc(100vw - 20px));
  height: calc(100vh - 20px);
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(4, 12, 24, 0.36);
}
.pa-capture-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pa-capture-workspace-header h2 { margin: 0 0 3px; font-size: var(--ui-fs-18); }
.pa-capture-workspace-context {
  padding: 10px 18px 4px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 94%, var(--primary));
}
.pa-capture-workspace-context #paCaptureContextPanel { margin: 0; }
.pa-capture-workspace-context #paCaptureEvidenceCallout { margin: 8px 0 6px; }
.pa-capture-workspace-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pa-capture-workspace-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.pa-capture-workspace-tab span { font-weight: 700; }
.pa-capture-workspace-tab small { color: var(--text-muted); font-size: var(--ui-fs-11); line-height: 1.25; }
.pa-capture-workspace-tab:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.pa-capture-workspace-tab.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.pa-capture-workspace-tab.has-work::after { content: ''; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.pa-capture-workspace-tab.is-busy::after { animation: paWorkspacePulse 1.2s ease-in-out infinite; }
@keyframes paWorkspacePulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.pa-capture-workspace-notice { margin: 0 18px 8px; padding: 9px 12px; border-radius: 9px; font-size: var(--ui-fs-12); font-weight: 600; }
.pa-capture-workspace-notice.is-ok { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border)); }
.pa-capture-workspace-notice.is-warning { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.pa-capture-workspace-body { flex: 1; min-height: 0; overflow: hidden; padding: 0 18px 12px; }
.pa-capture-workspace-pane { display: none; height: 100%; min-height: 0; overflow: auto; padding: 4px 2px 18px; }
.pa-capture-workspace-pane.active { display: block; }
.pa-capture-workspace-pane .scanner-entry-panel { margin: 8px 0 0; }
.pa-capture-workspace-pane #paManualEntryCard { min-height: 180px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.pa-capture-workspace-pane .pa-photo-stage-panel,
.pa-capture-workspace-pane .pa-remote-review { max-width: none; }
.pa-capture-workspace-footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.pa-capture-workspace-global-summary { font-size: var(--ui-fs-12); color: var(--text-muted); font-weight: 600; }
.pa-capture-workspace-footer #paCaptureWorkspaceInlineMsg { margin: 0; min-height: 0; }
body.pa-capture-workspace-open { overflow: hidden; }
.pa-remote-workspace-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}
.pa-remote-workspace-tab {
  flex: 0 0 auto;
  min-width: 210px;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.pa-remote-workspace-tab span { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-remote-workspace-tab small { color: var(--text-muted); font-size: var(--ui-fs-11); }
.pa-remote-workspace-tab.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 14%, transparent); }
.pa-remote-workspace-tab.needs-review:not(.active) { border-color: color-mix(in srgb, var(--warning) 60%, var(--border)); }
.pa-remote-workspace-tab.ended { opacity: .78; }
.pa-capture-workspace-pane-remote .pa-remote-session-card,
#paCaptureWorkspacePane-remote .pa-remote-session-card { margin-top: 0; }
@media (max-width: 900px) {
  .pa-capture-workspace-overlay { padding: 0; }
  .pa-capture-workspace-shell { width: 100vw; height: 100vh; border-radius: 0; border: 0; }
  .pa-capture-workspace-header { padding: 10px 12px; align-items: flex-start; }
  .pa-capture-workspace-header .btn { white-space: nowrap; }
  .pa-capture-workspace-context { padding: 8px 12px 2px; }
  .pa-capture-workspace-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 12px; }
  .pa-capture-workspace-tab { min-height: 52px; padding: 8px 10px; }
  .pa-capture-workspace-body { padding: 0 10px 10px; }
  .pa-capture-workspace-footer { grid-template-columns: 1fr; gap: 6px; padding: 8px 12px; }
}
@media (max-width: 560px) {
  .pa-capture-workspace-header h2 { font-size: var(--ui-fs-16); }
  .pa-capture-workspace-header .tiny-muted { display: none; }
  .pa-capture-workspace-header .btn { font-size: var(--ui-fs-12); padding: 8px 10px; }
  .pa-capture-workspace-tabs { gap: 6px; }
  .pa-capture-workspace-tab small { font-size: var(--ui-fs-10); }
  .pa-remote-workspace-tab { min-width: 190px; }
}


/* v72jzzzzzi: Session-row workspace entry and protected Session lifecycle. */
.pa-capture-session-table td:first-child { min-width: 280px; }
.pa-capture-session-table td:last-child { min-width: 330px; }
.pa-session-workspace-summary {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: var(--ui-fs-11);
  line-height: 1.35;
}
.pa-session-workspace-summary strong { color: var(--text); }
.pa-capture-workspace-mode-banner {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: var(--ui-fs-12);
  font-weight: 700;
}
.pa-capture-workspace-mode-banner.is-readonly {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: var(--text);
}
.pa-capture-workspace-mode-banner.is-void {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
}
.pa-close-capture-session-modal { max-width: 720px; }
.pa-close-session-summary {
  display: grid;
  gap: 8px;
}
.pa-close-session-summary > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 96%, var(--primary));
}
.pa-close-session-summary span { color: var(--text-muted); }
.pa-close-session-blockers { margin-top: 12px; }
.pa-close-session-remote-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 650;
}
.pa-close-session-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .pa-capture-session-table td:last-child { min-width: 260px; }
  .pa-close-session-summary > div { grid-template-columns: 1fr; gap: 3px; }
}


/* v72jzzzzzi: closed/void Capture Workspaces are historical views, not editable staging forms. */
.pa-capture-workspace-overlay.is-readonly [data-pa-readonly-lock="1"],
.pa-capture-workspace-overlay.is-void [data-pa-readonly-lock="1"] {
  cursor: not-allowed;
}
.pa-capture-workspace-overlay.is-readonly .pa-capture-workspace-pane input:disabled,
.pa-capture-workspace-overlay.is-readonly .pa-capture-workspace-pane select:disabled,
.pa-capture-workspace-overlay.is-readonly .pa-capture-workspace-pane textarea:disabled,
.pa-capture-workspace-overlay.is-void .pa-capture-workspace-pane input:disabled,
.pa-capture-workspace-overlay.is-void .pa-capture-workspace-pane select:disabled,
.pa-capture-workspace-overlay.is-void .pa-capture-workspace-pane textarea:disabled {
  opacity: .82;
}

/* v72jzzzzzl: compact Physical Audit header and high-density Capture Workspace UX. */
.pa-selected-audit-card {
  margin-top: 8px;
}
.pa-selected-audit-card .card-header {
  min-height: 0;
  padding: 10px 14px;
}
.pa-selected-audit-card .card-body {
  padding: 8px 14px 10px;
}
.pa-selected-audit-card .stock-removal-lot-summary {
  margin-top: 0;
  padding: 8px;
}
.pa-selected-audit-card .stock-removal-summary-grid {
  gap: 7px;
}
.pa-selected-audit-card .stock-removal-summary-grid > div {
  min-height: 42px;
  padding: 6px 9px;
}
.pa-selected-audit-actions,
.pa-current-audit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.pa-audit-units-cell {
  min-width: 0;
}
.pa-audit-units-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  align-items: baseline;
  gap: 5px 12px;
}
.stock-removal-summary-grid .pa-audit-units-summary > div {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.stock-removal-summary-grid .pa-audit-units-summary span,
.stock-removal-summary-grid .pa-audit-units-summary strong {
  display: inline;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.stock-removal-summary-grid .pa-audit-units-summary span {
  font-size: var(--ui-fs-11);
}
.stock-removal-summary-grid .pa-audit-units-summary strong {
  font-size: var(--ui-fs-12);
}
.stock-removal-summary-grid .pa-audit-units-summary .pa-audit-units-total strong {
  font-size: var(--ui-fs-15);
  font-weight: 800;
}

/* Header controls share one compact row with title and Return to Audit. */
.pa-capture-workspace-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
}
.pa-capture-workspace-heading {
  min-width: 0;
}
.pa-capture-workspace-header h2 {
  margin: 0 0 1px;
}
.pa-capture-workspace-header-context {
  min-width: 0;
}
.pa-capture-context-panel {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 !important;
}
.pa-capture-context-panel .form-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
}
.pa-capture-context-panel .form-group label {
  margin: 0;
  white-space: nowrap;
  font-size: var(--ui-fs-11);
}
.pa-capture-context-panel select {
  height: 34px;
  min-height: 34px;
  padding: 5px 28px 5px 8px;
}
.pa-capture-context-panel #paWarehouse {
  width: min(230px, 22vw);
}
.pa-capture-context-panel #paOwner {
  width: 116px;
}

/* Genuine top tabs instead of four independent button cards. */
.pa-capture-workspace-tabs {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  padding: 6px 14px 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--border));
  scrollbar-width: thin;
}
.pa-capture-workspace-tab {
  flex: 1 1 0;
  min-width: 170px;
  min-height: 45px;
  padding: 7px 11px 6px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border);
  border-radius: 9px 9px 0 0;
  margin-bottom: -1px;
  background: color-mix(in srgb, var(--surface) 88%, var(--border));
  box-shadow: none;
}
.pa-capture-workspace-tab:hover {
  background: var(--surface);
}
.pa-capture-workspace-tab.active {
  z-index: 1;
  border-color: var(--primary) var(--border) var(--surface);
  border-top-width: 2px;
  padding-top: 6px;
  background: var(--surface);
  box-shadow: none;
}
.pa-capture-workspace-tab small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-capture-workspace-body {
  padding: 6px 12px 8px;
}
.pa-capture-workspace-pane {
  padding: 0 2px 8px;
}
.pa-capture-workspace-pane .scanner-entry-panel {
  margin-top: 0;
}
.pa-capture-workspace-footer {
  padding: 7px 14px;
}

/* Remote Capture header and controls stay compact and fixed above the grid. */
#paCaptureWorkspacePane-remote {
  overflow: hidden;
  padding-bottom: 0;
}
#paCaptureWorkspacePane-remote.active {
  display: flex;
  flex-direction: column;
}
#paCaptureWorkspaceHost-remote,
#paRemoteCapturePanel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
#paCaptureWorkspaceHost-remote,
#paRemoteCapturePanel,
#paRemoteCaptureSessionBox,
#paRemoteCaptureSessionBox .pa-remote-session-card {
  display: flex;
  flex-direction: column;
}
#paRemoteCapturePanel {
  overflow: hidden;
  padding: 9px 10px 8px;
}
.pa-remote-panel-title-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-subtle);
}
.pa-remote-panel-title-row .scanner-entry-title {
  margin: 0;
}
#paRemoteCapturePanel .pa-remote-actions-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 7px !important;
  flex-wrap: wrap !important;
  margin: 0;
  padding: 0;
}
#paRemoteCapturePanel .pa-remote-controls-stack {
  flex: 0 0 auto;
  min-height: 0;
}
#paRemoteCapturePanel .pa-remote-session-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin-top: 6px;
  gap: 0;
}

/* Genuine nested Remote Capture session tabs. */
.pa-remote-workspace-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  padding: 3px 3px 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--border));
}
.pa-remote-workspace-tab {
  min-width: 170px;
  max-width: 260px;
  padding: 6px 10px 5px;
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
  background: color-mix(in srgb, var(--surface) 88%, var(--border));
  box-shadow: none;
}
.pa-remote-workspace-tab.active {
  z-index: 1;
  border-color: var(--primary) var(--border) var(--surface);
  border-top-width: 2px;
  padding-top: 5px;
  background: var(--surface);
  box-shadow: none;
}
.pa-remote-workspace-tab small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#paRemoteCaptureSessionBox .pa-remote-session-card {
  flex: 1 1 auto;
  min-height: 0;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.pa-remote-session-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}
.pa-remote-session-toolbar .pa-remote-session-actions {
  gap: 6px;
}
.pa-remote-qr-row {
  flex: 0 0 auto;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.pa-remote-qr {
  width: 106px;
  height: 106px;
  padding: 4px;
}
.pa-remote-url {
  margin: 0;
  padding: 6px 8px;
}
.pa-remote-capture-filterbar {
  flex: 0 0 auto;
}
#paRemoteCaptureSessionBox .pa-remote-captures-table {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-top: 0;
}
#paRemoteCaptureSessionBox .pa-remote-captures-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
  box-shadow: 0 1px 0 var(--border);
}

/* Remote review is a second modal above the full-screen workspace. */
.pa-remote-review-modal-overlay {
  z-index: 130;
  padding: 14px;
  background: rgba(5, 12, 24, .68);
}
.pa-remote-review-modal-card {
  width: min(1500px, calc(100vw - 28px));
  height: min(86vh, 900px);
  max-width: none;
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pa-remote-review-modal-card .modal-header {
  flex: 0 0 auto;
  padding: 10px 14px;
}
.pa-remote-review-modal-card .modal-actions {
  flex: 0 0 auto;
  padding: 8px 14px;
}
.pa-remote-review-modal-card .pa-remote-review {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pa-remote-review-toolbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}
.pa-remote-review-toolbar .pa-stage-actions {
  justify-content: flex-end;
}
.pa-remote-review-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.pa-remote-review-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
  box-shadow: 0 1px 0 var(--border);
}

@media (max-width: 1050px) {
  .pa-capture-workspace-header {
    grid-template-columns: minmax(220px, 1fr) auto;
  }
  .pa-capture-workspace-header-context {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .pa-capture-context-panel {
    justify-content: flex-start;
  }
  .pa-capture-context-panel #paWarehouse {
    width: min(360px, 55vw);
  }
}
@media (max-width: 720px) {
  .pa-selected-audit-actions {
    align-items: flex-end;
    flex-direction: column;
  }
  .pa-audit-units-summary {
    grid-template-columns: repeat(2, minmax(0, auto));
  }
  .pa-capture-workspace-tabs {
    display: flex;
    grid-template-columns: none;
    padding: 5px 8px 0;
  }
  .pa-capture-workspace-tab {
    flex: 0 0 160px;
    min-width: 160px;
  }
  .pa-capture-context-panel {
    flex-wrap: wrap;
  }
  .pa-capture-context-panel #paWarehouse,
  .pa-capture-context-panel #paOwner {
    width: auto;
    min-width: 130px;
  }
  .pa-remote-panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
  #paRemoteCapturePanel .pa-remote-actions-row {
    justify-content: flex-start;
  }
  .pa-remote-review-modal-overlay {
    padding: 0;
  }
  .pa-remote-review-modal-card {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border: 0;
    border-radius: 0;
  }
}
.pa-remote-review-msg {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 12px;
}
.pa-remote-review-msg:not(:empty) {
  padding-top: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
#paStageWarningsModal,
#paOcrDebugModal {
  z-index: 150;
}


/* v72jzzzzzn: sticky page title, duplicate Physical Audit heading removal, and width-stable text scaling. */
/* v72jzzzzzm: compact Remote Capture toolbar, stable footer status, and horizontal context controls. */
.pa-capture-context-panel .form-group {
  flex-direction: row !important;
}
.pa-capture-context-panel #paWarehouse {
  width: min(320px, 26vw);
}
.pa-capture-context-panel #paOwner {
  width: 145px;
}

.pa-capture-workspace-footer {
  display: flex;
  grid-template-columns: none;
  justify-content: space-between;
  min-height: 38px;
}
.pa-capture-workspace-global-summary {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.pa-capture-workspace-footer-status {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.pa-capture-workspace-footer #paRemotePollStatus {
  min-width: 0;
  min-height: 18px;
  max-width: 58vw;
  margin: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-capture-workspace-footer #paRemotePollStatus.is-error {
  color: var(--danger);
  font-weight: 700;
}
.pa-capture-workspace-footer #paRemotePollStatus.is-success {
  color: var(--success);
  font-weight: 600;
}
.pa-capture-workspace-footer #paCaptureWorkspaceMessageHost {
  flex: 0 1 auto;
  min-width: 0;
}

.pa-remote-session-toolbar {
  justify-content: space-between;
  gap: 12px;
}
.pa-remote-session-toolbar > .pa-remote-capture-filterbar {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  flex-wrap: nowrap;
  gap: 10px 14px;
}
.pa-remote-session-toolbar .pa-remote-filter-summary {
  min-width: 0;
  padding-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-remote-session-toolbar .pa-remote-capture-filter-actions {
  margin-left: 0;
  gap: 12px;
}
.pa-remote-session-toolbar .pa-remote-session-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 1050px) {
  .pa-capture-context-panel #paWarehouse {
    width: min(390px, 62vw);
  }
}
@media (max-width: 900px) {
  .pa-capture-workspace-footer {
    flex-wrap: wrap;
  }
  .pa-capture-workspace-footer-status {
    width: 100%;
    justify-content: flex-start;
  }
  .pa-capture-workspace-footer #paRemotePollStatus {
    max-width: 100%;
    text-align: left;
  }
  .pa-remote-session-toolbar {
    flex-wrap: wrap;
  }
  .pa-remote-session-toolbar > .pa-remote-capture-filterbar {
    flex-basis: 100%;
    order: 2;
  }
  .pa-remote-session-toolbar .pa-remote-session-actions {
    order: 1;
  }
}


/* v72jzzzzzo: keep the four capture-method tabs width-stable without a visible tab-strip scrollbar. */
.pa-capture-workspace-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-inline: contain;
}
.pa-capture-workspace-tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* v72jzzzzzp: compact audit header info, workspace layer fix, and hidden remote-grid scrollbar. */
#view-physical-audit #paMsg:empty {
  display: none;
}
.pa-selected-audit-card {
  margin-top: 0;
}
.pa-selected-audit-card.is-info-collapsed .card-header {
  border-bottom: 0;
}
.pa-selected-audit-card.is-info-collapsed .card-body {
  display: none !important;
}
#paSelectedAuditSubtitle {
  line-height: 1.3;
}
#paBatchCaptureCard {
  margin-top: 10px !important;
}

/* Lower only the sticky application topbar while the full-screen workspace is open.
   The workspace stays at z-index 90 so its existing child/sibling modals at 100+ remain reachable. */
body.pa-capture-workspace-open .topbar {
  z-index: 80;
}

/* Keep the Remote Capture grid independently scrollable and visibly discoverable. */
#paRemoteCaptureSessionBox .pa-remote-captures-table {
  scrollbar-width: thin;
  scrollbar-color: #8b98aa #edf2f7;
  scrollbar-gutter: stable;
  -ms-overflow-style: auto;
  overscroll-behavior: contain;
}
#paRemoteCaptureSessionBox .pa-remote-captures-table::-webkit-scrollbar {
  width: 11px;
  height: 10px;
}
#paRemoteCaptureSessionBox .pa-remote-captures-table::-webkit-scrollbar-track {
  background: #edf2f7;
  border-left: 1px solid #dde5ef;
}
#paRemoteCaptureSessionBox .pa-remote-captures-table::-webkit-scrollbar-thumb {
  background: #8b98aa;
  border: 2px solid #edf2f7;
  border-radius: 999px;
}
#paRemoteCaptureSessionBox .pa-remote-captures-table::-webkit-scrollbar-thumb:hover {
  background: #66758a;
}

/* v72jzzzzzq: tighten the Audit Sessions card and fit its table without horizontal scrolling. */
#paBatchCaptureCard {
  margin-top: 8px !important;
  margin-bottom: 12px;
}
#paBatchCaptureCard > .card-header {
  padding: 10px 16px;
}
#paBatchCaptureCard > .card-body {
  padding: 8px 12px 10px;
}
#paBatchCaptureCard #paCaptureSessionPanel {
  margin: 0;
  padding: 5px 7px;
}
#paCaptureSessionList .pa-capture-session-table-wrap {
  width: 100%;
  overflow-x: hidden;
}
#paCaptureSessionList .pa-capture-session-table {
  width: 100%;
  table-layout: fixed;
}
#paCaptureSessionList .pa-capture-session-table th,
#paCaptureSessionList .pa-capture-session-table td {
  min-width: 0 !important;
  overflow-wrap: anywhere;
  word-break: normal;
}
#paCaptureSessionList .pa-capture-session-table th {
  padding: 8px 10px;
}
#paCaptureSessionList .pa-capture-session-table td {
  padding: 8px 10px;
  vertical-align: top;
}
#paCaptureSessionList .pa-capture-session-table th:nth-child(1),
#paCaptureSessionList .pa-capture-session-table td:nth-child(1) { width: 30%; }
#paCaptureSessionList .pa-capture-session-table th:nth-child(2),
#paCaptureSessionList .pa-capture-session-table td:nth-child(2) { width: 9%; }
#paCaptureSessionList .pa-capture-session-table th:nth-child(3),
#paCaptureSessionList .pa-capture-session-table td:nth-child(3) { width: 8%; }
#paCaptureSessionList .pa-capture-session-table th:nth-child(4),
#paCaptureSessionList .pa-capture-session-table td:nth-child(4) { width: 8%; }
#paCaptureSessionList .pa-capture-session-table th:nth-child(5),
#paCaptureSessionList .pa-capture-session-table td:nth-child(5) { width: 7%; }
#paCaptureSessionList .pa-capture-session-table th:nth-child(6),
#paCaptureSessionList .pa-capture-session-table td:nth-child(6) { width: 7%; }
#paCaptureSessionList .pa-capture-session-table th:nth-child(7),
#paCaptureSessionList .pa-capture-session-table td:nth-child(7) { width: 31%; }
#paCaptureSessionList .pa-session-row-actions {
  gap: 6px;
}
#paCaptureSessionList .pa-session-row-actions .btn {
  white-space: normal;
  text-align: center;
  justify-content: center;
}
@media (max-width: 980px) {
  #paBatchCaptureCard > .card-header {
    align-items: flex-start;
    gap: 10px;
  }
  #paCaptureSessionList .pa-capture-session-table th,
  #paCaptureSessionList .pa-capture-session-table td {
    padding-left: 7px;
    padding-right: 7px;
  }
  #paCaptureSessionList .pa-capture-session-table th:nth-child(1),
  #paCaptureSessionList .pa-capture-session-table td:nth-child(1) { width: 27%; }
  #paCaptureSessionList .pa-capture-session-table th:nth-child(7),
  #paCaptureSessionList .pa-capture-session-table td:nth-child(7) { width: 34%; }
}

/* v72jzzzzzr: genuine non-wrapping tab carousels for Audit Lines and Capture Workspace. */
.pa-tab-carousel {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
}
.pa-tab-carousel-rail {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap !important;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pa-tab-carousel-rail::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.pa-tab-carousel-arrow {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin: 0 5px 5px;
  padding: 0 0 2px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 7px rgba(15, 25, 35, 0.10);
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
}
.pa-tab-carousel.has-overflow > .pa-tab-carousel-arrow {
  display: inline-flex;
}
.pa-tab-carousel-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.pa-tab-carousel-arrow:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 32%, transparent);
  outline-offset: 2px;
}
.pa-tab-carousel-arrow:disabled {
  opacity: 0.30;
  cursor: default;
  box-shadow: none;
}

/* Audit Lines: connected rectangular tabs, one row only. */
.pa-lines-tab-carousel {
  padding: 7px 10px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.pa-lines-tab-carousel .pa-user-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  padding: 0;
  border: 0;
  background: transparent;
}
.pa-lines-tab-carousel .pa-user-tab {
  flex: 0 0 auto;
  min-width: 205px;
  max-width: 310px;
  min-height: 55px;
  margin-bottom: -1px;
  padding: 8px 13px 9px;
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--border));
  box-shadow: none;
  scroll-snap-align: start;
}
.pa-lines-tab-carousel .pa-user-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.pa-lines-tab-carousel .pa-user-tab.active,
.pa-lines-tab-carousel .pa-user-tab[aria-selected="true"] {
  z-index: 1;
  padding: 8px 13px 9px;
  border-width: 1px;
  border-color: var(--accent) var(--accent) color-mix(in srgb, var(--accent) 17%, var(--surface));
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, #07111f);
  box-shadow: inset 0 3px 0 var(--accent), 0 -2px 10px color-mix(in srgb, var(--accent) 14%, transparent);
}
.pa-lines-tab-carousel .pa-user-tab span {
  max-width: 235px;
}
.pa-lines-tab-carousel .pa-user-tab small {
  white-space: nowrap;
}

/* Capture method tabs: the same one-row carousel treatment. */
.pa-capture-tabs-carousel {
  padding: 6px 10px 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--border));
}
.pa-capture-tabs-carousel .pa-capture-workspace-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
}
.pa-capture-tabs-carousel .pa-capture-workspace-tab {
  flex: 1 0 205px;
  min-width: 205px;
  min-height: 52px;
  margin-bottom: -1px;
  padding: 8px 12px 7px;
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--surface) 86%, var(--border));
  box-shadow: none;
  scroll-snap-align: start;
}
.pa-capture-tabs-carousel .pa-capture-workspace-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.pa-capture-tabs-carousel .pa-capture-workspace-tab.active,
.pa-capture-tabs-carousel .pa-capture-workspace-tab[aria-selected="true"] {
  z-index: 1;
  padding-top: 8px;
  border-width: 1px;
  border-color: var(--accent) var(--accent) color-mix(in srgb, var(--accent) 17%, var(--surface));
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, #07111f);
  box-shadow: inset 0 3px 0 var(--accent), 0 -2px 10px color-mix(in srgb, var(--accent) 14%, transparent);
}
.pa-capture-tabs-carousel .pa-capture-workspace-tab.active small,
.pa-capture-tabs-carousel .pa-capture-workspace-tab[aria-selected="true"] small {
  color: color-mix(in srgb, var(--accent) 65%, var(--text));
}

/* Nested Remote Capture session tabs use the same carousel and active fill. */
.pa-remote-tabs-carousel {
  margin: 1px 0 8px;
  padding: 2px 0 0;
  border-bottom: 1px solid var(--border);
}
.pa-remote-tabs-carousel .pa-remote-workspace-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
}
.pa-remote-tabs-carousel .pa-remote-workspace-tab {
  min-width: 220px;
  max-width: 340px;
  margin-bottom: -1px;
  padding: 8px 12px 9px;
  border-radius: 9px 9px 0 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--border));
  box-shadow: none;
  scroll-snap-align: start;
}
.pa-remote-tabs-carousel .pa-remote-workspace-tab:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.pa-remote-tabs-carousel .pa-remote-workspace-tab.active,
.pa-remote-tabs-carousel .pa-remote-workspace-tab[aria-selected="true"] {
  z-index: 1;
  border-color: var(--accent) var(--accent) color-mix(in srgb, var(--accent) 17%, var(--surface));
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, #07111f);
  box-shadow: inset 0 3px 0 var(--accent), 0 -2px 9px color-mix(in srgb, var(--accent) 13%, transparent);
}
.pa-remote-tabs-carousel .pa-remote-workspace-tab.active small,
.pa-remote-tabs-carousel .pa-remote-workspace-tab[aria-selected="true"] small {
  color: color-mix(in srgb, var(--accent) 65%, var(--text));
}

@media (max-width: 900px) {
  .pa-lines-tab-carousel,
  .pa-capture-tabs-carousel {
    padding-left: 6px;
    padding-right: 6px;
  }
  .pa-lines-tab-carousel .pa-user-tab {
    min-width: 190px;
  }
  .pa-capture-tabs-carousel .pa-capture-workspace-tab {
    flex-basis: 185px;
    min-width: 185px;
  }
  .pa-tab-carousel-arrow {
    width: 31px;
    height: 31px;
    margin-left: 3px;
    margin-right: 3px;
  }
}

/* v72jzzzzzs: stronger selected tabs and denser Audit Lines header/tab strip. */
#paCapturedLinesCard > .card-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 16px;
}
#paCapturedLinesCard > .card-header > div:first-child {
  flex: 0 0 auto;
  min-width: max-content;
  padding-top: 7px;
}
#paCapturedLinesCard > .card-header .card-title {
  display: block;
  white-space: nowrap;
}
#paCapturedLinesCard > .card-header > .pa-grid-toolbar {
  flex: 1 1 760px;
  min-width: 0;
  gap: 7px;
}

.pa-lines-tab-carousel {
  padding: 4px 8px 0;
}
.pa-lines-tab-carousel .pa-user-tab {
  min-height: 47px;
  padding: 5px 12px 6px;
  gap: 0 8px;
  background: var(--surface-2);
  line-height: 1.08;
}
.pa-lines-tab-carousel .pa-user-tab.active,
.pa-lines-tab-carousel .pa-user-tab[aria-selected="true"] {
  padding: 5px 12px 6px;
  border-color: var(--accent) var(--accent) color-mix(in srgb, var(--accent) 30%, var(--surface));
  background: #dce8ff;
  color: #073b9e;
  box-shadow: inset 0 4px 0 var(--accent), 0 -2px 10px color-mix(in srgb, var(--accent) 18%, transparent);
}
.pa-lines-tab-carousel .pa-user-tab.active small,
.pa-lines-tab-carousel .pa-user-tab[aria-selected="true"] small {
  color: #174caa;
  font-weight: 600;
}
.pa-lines-tab-carousel .pa-user-tab small {
  line-height: 1;
}

.pa-capture-tabs-carousel .pa-capture-workspace-tab,
.pa-remote-tabs-carousel .pa-remote-workspace-tab {
  background: var(--surface-2);
}
.pa-capture-tabs-carousel .pa-capture-workspace-tab.active,
.pa-capture-tabs-carousel .pa-capture-workspace-tab[aria-selected="true"],
.pa-remote-tabs-carousel .pa-remote-workspace-tab.active,
.pa-remote-tabs-carousel .pa-remote-workspace-tab[aria-selected="true"] {
  border-color: var(--accent) var(--accent) color-mix(in srgb, var(--accent) 30%, var(--surface));
  background: #dce8ff;
  color: #073b9e;
  box-shadow: inset 0 4px 0 var(--accent), 0 -2px 10px color-mix(in srgb, var(--accent) 18%, transparent);
}
.pa-capture-tabs-carousel .pa-capture-workspace-tab.active small,
.pa-capture-tabs-carousel .pa-capture-workspace-tab[aria-selected="true"] small,
.pa-remote-tabs-carousel .pa-remote-workspace-tab.active small,
.pa-remote-tabs-carousel .pa-remote-workspace-tab[aria-selected="true"] small {
  color: #174caa;
  font-weight: 600;
}

@media (max-width: 700px) {
  #paCapturedLinesCard > .card-header {
    padding: 9px 12px;
  }
  #paCapturedLinesCard > .card-header > div:first-child {
    padding-top: 0;
  }
  #paCapturedLinesCard > .card-header > .pa-grid-toolbar {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}


/* v72jzzzzzt: selected-tab background variable correction.
   The carousel selectors intentionally use the defined --accent token; do not add a global
   --primary alias because legacy rules also reference that undefined token. */


/* v72jzzzzzv: move selected-tab refresh beside its pager metadata and keep the
   Audit Lines header controls on one desktop row through normal 80%-110% zoom. */
#paCapturedLinesCard > .card-header > .pa-grid-toolbar {
  flex-wrap: nowrap;
}
#paLinesCaptureSessionFilter {
  flex: 0 1 250px;
  width: 250px;
  min-width: 220px;
  max-width: 250px;
}
#paLinesTabGroupingControls .pa-tab-group-toggle select {
  width: 142px;
  min-width: 142px;
  max-width: 142px;
}
#paCapturedLinesCard > .card-header .pa-search-box {
  flex: 1 1 260px;
  min-width: 210px;
  max-width: 360px;
}
#paCapturedLinesCard > .card-header .pa-search-box .pa-grid-search {
  width: 100%;
  min-width: 0;
  max-width: none;
}
#paCapturedLinesCard > .card-header > .pa-grid-toolbar > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pa-lines-grid-pager {
  justify-content: space-between;
}
.pa-lines-pager-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pa-lines-pager-left #paLinesPagerMeta {
  min-width: 0;
}
.pa-lines-pager-left #paLinesRefreshBtn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 980px) {
  #paCapturedLinesCard > .card-header > .pa-grid-toolbar {
    flex-wrap: wrap;
  }
  #paLinesCaptureSessionFilter {
    flex: 1 1 220px;
    width: auto;
    max-width: 250px;
  }
  #paCapturedLinesCard > .card-header .pa-search-box {
    flex: 1 1 260px;
    max-width: none;
  }
}
@media (max-width: 700px) {
  .pa-lines-grid-pager {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .pa-lines-pager-left,
  .pa-grid-pager-actions {
    width: 100%;
  }
  .pa-lines-pager-left {
    justify-content: space-between;
  }
  .pa-grid-pager-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
  }
}

/* v72jzzzzzzb: inline Remote Capture barcode match and acceptance. */
.pa-remote-barcode-timing {
  display: block;
  white-space: nowrap;
}
.pa-remote-barcode-inline-row > td {
  padding: 0 !important;
  border-top: 0 !important;
  background: #f8fbff;
}
.pa-remote-barcode-inline-editor {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(125px, .75fr) minmax(150px, .9fr) minmax(250px, 1.8fr) minmax(135px, .8fr) minmax(145px, .85fr) 72px;
  gap: 8px;
  align-items: end;
  padding: 8px 12px 10px 72px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}
.pa-remote-barcode-inline-editor label {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: var(--ui-fs-11);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.pa-remote-barcode-inline-editor label > span {
  min-height: 14px;
  line-height: 1.1;
}
.pa-remote-barcode-inline-editor label small {
  color: var(--muted);
  font-size: inherit;
  font-weight: 500;
  text-transform: none;
}
.pa-remote-barcode-inline-editor .table-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 9px;
  font-size: var(--ui-fs-13);
  text-transform: none;
  letter-spacing: 0;
}
.pa-remote-barcode-inline-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding-bottom: 2px;
}
.pa-remote-barcode-inline-status > div {
  min-width: 0;
}
.pa-remote-barcode-inline-status strong {
  display: block;
  font-size: var(--ui-fs-13);
  color: var(--text);
}
.pa-remote-barcode-inline-status .tiny-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-remote-barcode-qty .table-input {
  text-align: center;
}
@media (max-width: 1380px) {
  .pa-remote-barcode-inline-editor {
    grid-template-columns: minmax(180px, 1fr) minmax(125px, .7fr) minmax(145px, .8fr) minmax(220px, 1.4fr) minmax(130px, .75fr) minmax(145px, .8fr) 70px;
    padding-left: 12px;
  }
}
@media (max-width: 1080px) {
  .pa-remote-barcode-inline-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pa-remote-barcode-inline-status,
  .pa-remote-barcode-desc {
    grid-column: 1 / -1;
  }
}


/* v72jzzzzzzc: visible Remote Capture scrolling and quick rejection reasons. */
.pa-remote-reject-modal {
  width: min(560px, calc(100vw - 28px));
  max-width: 560px;
}
.pa-remote-reject-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pa-remote-reject-reason {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: var(--ui-fs-13);
  font-weight: 650;
  padding: 8px 12px;
}
.pa-remote-reject-reason:hover {
  border-color: var(--accent);
  background: #eef4ff;
}
.pa-remote-reject-reason.active {
  border-color: var(--accent);
  background: #dce8ff;
  color: #084da8;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pa-remote-reject-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
.pa-remote-reject-input {
  width: 100%;
  min-height: 86px;
  resize: vertical;
}
