/* Inventory scanner: scoped styles keep the shared sales scanner unchanged. */
.dashboard-content-inner:has(> .barcode-page) { padding: 24px 32px 32px; }
.barcode-page {
    --pm-green: #006b5c;
    --pm-green-dark: #004e45;
    --pm-green-soft: #e4f5f1;
    --pm-text: #173a40;
    --pm-muted: #627984;
    --pm-line: #d8e4e6;
    width: 100%; min-width: 0; max-width: 1600px; margin: 0 auto;
    color: var(--pm-text); font-size: 14px; line-height: 1.45;
}
.barcode-page *, .barcode-page *::before, .barcode-page *::after { box-sizing: border-box; }
.barcode-page [hidden] { display: none !important; }
.barcode-page svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.barcode-page button { font-family: inherit; cursor: pointer; }
.barcode-page button:disabled { cursor: default; opacity: .55; }
.barcode-page-header { margin-bottom: 26px; }
.barcode-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; color: var(--pm-muted); }
.barcode-breadcrumb a { color: var(--pm-green); text-decoration: none; font-weight: 650; }
.barcode-breadcrumb a:hover { text-decoration: underline; }
.barcode-title-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.barcode-page-heading-copy { min-width: 0; }
.barcode-page-heading-copy h1 { margin: 0; color: #073f3d; font-size: clamp(26px, 2.8vw, 44px); line-height: 1.15; letter-spacing: -.04em; font-weight: 750; }
.barcode-page-heading-copy p { margin: 6px 0 0; color: var(--pm-muted); font-size: 15px; }
.barcode-status-slot { flex-shrink: 0; }
.barcode-status-slot:empty { display: none; }
.barcode-status-slot .pm-offline-status { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; min-height: 40px; border: 0; border-radius: 12px; background: #dbf5e5; color: #064e45; font-size: 12px; font-weight: 700; text-decoration: none; box-shadow: none; }
.barcode-status-slot .pm-offline-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #09a332; flex-shrink: 0; }
.barcode-status-slot .pm-offline-status:hover { background: #caeed8; }
.barcode-offline-entry-relocated { display: none !important; }
.barcode-workspace { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); grid-template-areas: 'settings camera' 'settings recent'; gap: 16px; align-items: start; }
.barcode-workspace > * { min-width: 0; }
.barcode-panel, .barcode-result-panel, .barcode-count { background: #fff; border: 1px solid #dce7e9; border-radius: 13px; box-shadow: 0 3px 12px rgba(18,59,61,.04); }
.barcode-panel { padding: 18px; }
.barcode-settings-panel { grid-area: settings; }
.barcode-camera-panel { grid-area: camera; }
.barcode-recent-panel { grid-area: recent; }
.barcode-panel-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.barcode-panel-title { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.barcode-panel-title > div { min-width: 0; }
.barcode-title-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 7px; background: var(--pm-green-soft); color: var(--pm-green); flex-shrink: 0; }
.barcode-title-icon svg { width: 25px; height: 25px; }
.barcode-panel-title h2 { margin: 0; color: #123b42; font-size: 20px; line-height: 1.3; letter-spacing: -.035em; font-weight: 750; }
.barcode-settings-heading h2 { font-size: 23px; }
.barcode-panel-title p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--pm-muted); }
.barcode-fullscreen, .barcode-clear-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 12px; border: 1px solid #cedde0; border-radius: 7px; background: #fff; color: #24464f; font-size: 12px; font-weight: 650; white-space: nowrap; }
.barcode-fullscreen svg, .barcode-clear-button svg { width: 16px; height: 16px; }
.barcode-fullscreen:hover, .barcode-clear-button:hover:not(:disabled) { background: #f0f8f6; }
.barcode-camera-stage { position: relative; height: 278px; overflow: hidden; border: 1px solid #dbe6ec; border-radius: 9px; background: #eaf0f4; }
.barcode-camera-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; z-index: 1; }
.barcode-camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--pm-muted); pointer-events: none; }
.barcode-camera-stage:has(video:not([hidden])) .barcode-camera-placeholder { display: none; }
.barcode-camera-placeholder strong { margin-top: 14px; font-size: 15px; color: #5c7180; }
.barcode-camera-placeholder > span, .barcode-camera-placeholder small { margin-top: 3px; font-size: 13px; }
.barcode-focus-frame { width: 160px; height: 110px; color: #a9b8c2; }
.barcode-focus-frame svg { width: 100%; height: 100%; stroke-width: 1.6; }
.barcode-focus-frame svg path:last-child { stroke-width: 3; }
.barcode-scan-line { display: none; }
.barcode-camera-stage:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.barcode-field { display: flex; flex-direction: column; gap: 5px; margin: 0; color: #00574f; font-size: 13px; font-weight: 650; }
.barcode-field-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; margin-top: 15px; }
.barcode-field select, .barcode-field input { width: 100%; min-width: 0; height: 40px; border: 1px solid #cddde2; border-radius: 7px; background-color: #fff; color: #173a40; font: inherit; padding: 0 32px 0 40px; }
.barcode-field input { height: 43px; padding-right: 12px; font-weight: 450; }
.barcode-field input::placeholder { color: #627984; opacity: 1; }
.barcode-field select:focus, .barcode-field input:focus { border-color: #008575; outline: 2px solid #c9ece4; outline-offset: 1px; }
.barcode-select-wrap, .barcode-input-wrap { position: relative; display: block; min-width: 0; color: #31535d; }
.barcode-select-wrap > svg, .barcode-input-wrap > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; pointer-events: none; }
.barcode-manual-block { display: grid; gap: 12px; margin: 18px 0; }
.barcode-lookup-button, .barcode-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border-radius: 8px; padding: 10px 14px; font-size: 13px; font-weight: 650; line-height: 1.3; white-space: normal; }
.barcode-lookup-button, .barcode-primary { border: 1px solid #00695d; background: #00695d; color: #fff; }
.barcode-lookup-button:hover, .barcode-primary:hover { background: #00564c; color: #fff; }
.barcode-secondary { border: 1px solid #c8d9df; background: #f7fafb; color: #506773; }
.barcode-page .barcode-secondary:disabled { opacity: 1; color: #637780; }
.barcode-field-hint { font-size: 11px; color: var(--pm-muted); font-weight: 400; }
.barcode-camera-controls { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--pm-line); }
.barcode-control-label { display: block; margin-bottom: 7px; color: #00574f; font-size: 13px; font-weight: 650; }
.barcode-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.barcode-actions .btn { flex: 1 1 140px; }
.barcode-ready { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; }
.barcode-ready-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: #0aab30; flex-shrink: 0; }
.barcode-ready div { display: flex; flex-direction: column; min-width: 0; }
.barcode-ready strong { color: #006052; font-size: 12px; overflow-wrap: anywhere; }
.barcode-ready small { margin-top: 3px; color: var(--pm-muted); font-size: 11px; }
.barcode-recent-table-head { display: grid; grid-template-columns: .9fr 1fr 1.3fr auto; gap: 10px; padding: 10px; color: var(--pm-muted); font-size: 11px; background: #f5f9fa; }
.barcode-recent-panel:has(.barcode-recent-empty) .barcode-recent-table-head { display: none; }
.barcode-recent-list { border: 1px solid #d4e1e7; border-radius: 9px; overflow: hidden; }
.barcode-recent-list:has(.barcode-recent-empty) { border-style: dashed; }
.barcode-recent-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 154px; padding: 20px; text-align: center; background: #f8fafb; color: var(--pm-muted); }
.barcode-recent-empty svg { width: 31px; height: 31px; margin-bottom: 8px; }
.barcode-recent-empty strong { font-size: 15px; color: #506773; }
.barcode-recent-empty span { margin-top: 3px; font-size: 12px; }
.barcode-recent-item { display: grid; grid-template-columns: .9fr 1fr 1.3fr auto; align-items: center; gap: 10px; padding: 12px 10px; border-top: 1px solid #edf2f2; }
.barcode-recent-item:first-child { border-top: 0; }
.barcode-recent-cell { min-width: 0; font-size: 12px; color: var(--pm-muted); overflow-wrap: anywhere; }
.barcode-recent-cell strong { color: var(--pm-text); }
.barcode-recent-badge { padding: 4px 7px; border-radius: 12px; background: #e6f8f0; color: #08704c; font-size: 10px; font-weight: 700; }
.barcode-recent-badge.not-found { background: #fff4da; color: #805700; }
.barcode-result-panel{margin-top:1rem;padding:1.15rem;min-width:0}.barcode-result-panel:empty{display:none}.barcode-result-panel h2{font-size:1.2rem;margin:0 0 .75rem}.barcode-page img{max-width:160px;border-radius:12px}.barcode-page dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:.65rem;margin-top:1rem}.barcode-page dt{font-size:.76rem;color:var(--pm-muted)}.barcode-page dd{margin:0;overflow-wrap:anywhere;font-weight:700}.barcode-result-panel .barcode-actions a{display:inline-flex;align-items:center;min-height:38px;padding:.5rem .75rem;border:1px solid #c6d8d2;border-radius:8px;color:var(--pm-green-dark);text-decoration:none;font-size:.77rem;font-weight:750}.barcode-count{padding:1rem;margin:1rem 0}.barcode-page form{min-width:0}.barcode-page :focus-visible{outline:3px solid rgba(0,107,92,.22);outline-offset:2px}.barcode-workspace>*,.barcode-ready,.barcode-ready div{min-width:0}.barcode-scanner>video{width:100%;max-height:360px;object-fit:contain}.barcode-page label,.barcode-page input,.barcode-page select{max-width:100%;min-width:0}


@media (max-width: 1250px) {
    .barcode-title-row { flex-wrap: wrap; gap: 12px; }
    .dashboard-content-inner:has(> .barcode-page) { padding: 24px; }
    .barcode-workspace { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .barcode-panel-topline { flex-wrap: wrap; }
}
@media (max-width: 1000px) {
    .barcode-workspace { grid-template-columns: minmax(0,1fr); grid-template-areas: 'settings' 'camera' 'recent'; }
}
@media (max-width: 520px) {
    .dashboard-content-inner:has(> .barcode-page) { padding: 18px 12px 80px; }
    .barcode-panel { padding: 16px; }
    .barcode-field-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .barcode-page-heading-copy p { font-size: 13px; }
    .barcode-panel-title h2 { font-size: 19px; }
    .barcode-camera-stage { height: 255px; }
    .barcode-actions { gap: 8px; }
    .barcode-actions .btn { flex-basis: 110px; padding-inline: 8px; }
    .barcode-recent-table-head { display: none; }
    .barcode-recent-item { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .barcode-recent-badge { justify-self: start; }
}
