.bb-inventory-tools{display:flex;flex-wrap:wrap;gap:9px;margin:0 0 17px}
.bb-tool-button,.bb-tools button,.bb-tools input,.bb-tools select,.bb-tools textarea{font:inherit}
.bb-tool-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 15px;border:1px solid #d8e2ea;border-radius:11px;background:#fff;color:#18384f;font-size:13px;font-weight:700;cursor:pointer}
.bb-tool-button svg{width:19px;height:19px;flex:none}
.bb-tool-button.primary{background:#18384f;color:#fff;border-color:#18384f}
.bb-tool-button:disabled,.bb-tools button:disabled{opacity:.55;cursor:default}
.bb-purchases{margin-top:21px;display:grid;gap:16px}
.bb-purchases-section{border:1px solid #dce5ec;border-radius:15px;background:#fff;padding:17px}
.bb-purchases-heading{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-bottom:12px}
.bb-purchases-heading h3{font-size:15px;margin:0;color:#18384f}
.bb-purchases-heading button{background:none;border:0;color:#225b7e;font:inherit;font-size:12px;cursor:pointer;padding:7px}
.bb-purchase-list{display:grid;gap:8px}
.bb-purchase-row{display:flex;align-items:center;gap:12px;background:#f6f9fb;border:1px solid #e8eef3;border-radius:11px;padding:11px 12px;min-width:0}
.bb-purchase-row>div{flex:1;min-width:0}
.bb-purchase-row strong{display:block;font-size:13px;color:#18384f;overflow-wrap:anywhere}
.bb-purchase-row small{display:block;color:#607383;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.bb-purchase-row button{border:1px solid #d6e2e9;background:#fff;border-radius:8px;min-height:36px;padding:7px 11px;font-size:12px;font-weight:700;color:#225b7e;cursor:pointer;flex:none}
.bb-purchase-row:is(details){display:block}
.bb-purchase-row summary{cursor:pointer;list-style:inside;font-size:13px}
.bb-purchase-row summary strong{display:inline}
.bb-purchase-row summary small{padding-left:14px}
.bb-purchase-empty{margin:0;font-size:12px;line-height:1.6;color:#667b89}
.bb-tools{width:min(760px,calc(100vw - 28px));max-height:calc(100dvh - 34px);padding:0;border:1px solid #d7e2ea;border-radius:19px;background:#fff;color:#18384f;box-shadow:0 24px 95px #112b4a45;overflow:hidden;font-family:var(--font,Inter,system-ui,sans-serif);font-size:13px}
.bb-tools::backdrop{background:#11253688;backdrop-filter:blur(3px)}
.bb-tools[open]{display:flex;flex-direction:column}
.bb-tools-head{display:flex;align-items:center;gap:12px;padding:19px 22px;border-bottom:1px solid #e4ebf0;flex:none}
.bb-tools-head>div{min-width:0;flex:1}
.bb-tools-head h2{margin:0;color:#18384f;font-size:20px;line-height:1.3}
.bb-tools-head p{margin:5px 0 0;color:#647989;font-size:12px;line-height:1.5}
.bb-tools-close{height:38px;width:38px;flex:none;border:1px solid #e0e8ee;border-radius:50%;background:#f6f9fb;color:#29465b;font-size:25px!important;cursor:pointer;line-height:1}
.bb-tools-body{padding:19px 22px;overflow-y:auto;overscroll-behavior:contain;min-height:0}
.bb-tools-footer{padding:14px 22px max(14px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:9px;border-top:1px solid #e4ebf0;background:#fafcfd;flex:none}
.bb-tools-status{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 13px;min-height:0;font-size:12px;line-height:1.65;color:#516c7d}
.bb-tools-status:empty{display:none}
.bb-tools-status.error{padding:11px 13px;border:1px solid #efd7ca;border-radius:10px;background:#fff6ef;color:#8e3c1e}
.bb-tools-status.success{padding:11px 13px;border:1px solid #d2e6db;border-radius:10px;background:#f0faf4;color:#28724a}
.bb-tools label{display:grid;gap:7px;min-width:0;color:#3a5567;font-size:12px;font-weight:650}
.bb-tools input,.bb-tools select,.bb-tools textarea{box-sizing:border-box;min-width:0;width:100%;border:1px solid #d8e3eb;border-radius:9px;padding:10px 11px;background:#fff;color:#18384f;font-size:14px;min-height:42px}
.bb-tools input:focus,.bb-tools select:focus,.bb-tools textarea:focus{outline:2px solid #b8d4e6;outline-offset:1px;border-color:#6b9ebb}
.bb-tools textarea{resize:vertical;line-height:1.6}
.bb-tools-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-bottom:16px}
.bb-tools-wide{grid-column:1/-1}
.bb-tools-note{font-size:12px;line-height:1.6;color:#647989;margin:10px 0}
.bb-receipt-actions{display:flex;flex-wrap:wrap;gap:9px;margin:6px 0 15px}
.bb-receipt-images{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:15px}
.bb-receipt-image{width:112px;display:grid;gap:5px}
.bb-receipt-image button:first-child{border:1px solid #dbe4eb;background:#f5f8fa;border-radius:10px;height:138px;width:100%;overflow:hidden;padding:0;cursor:zoom-in}
.bb-receipt-image img{width:100%;height:100%;object-fit:contain;background:#eef3f7}
.bb-receipt-image small{text-align:center;font-size:10px;color:#718595}
.bb-receipt-image .bb-text-button{font-size:11px}
.bb-text-button{border:0;background:none;color:#225b7e;padding:5px;cursor:pointer;font-weight:700;font-size:12px}
.bb-text-button.danger{color:#a44628}
.bb-receipt-lines{display:grid;gap:12px;margin:14px 0}
.bb-receipt-line{padding:15px;border:1px solid #dce6ed;border-radius:13px;background:#f8fafc;min-width:0}
.bb-line-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.bb-line-top strong{font-size:12px;color:#637b8d}
.bb-line-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.bb-line-catalog{position:relative;grid-column:1/-1}
.bb-catalog-input-row{display:flex;gap:7px;align-items:center}
.bb-catalog-input-row input{flex:1}
.bb-icon-button{width:42px;height:42px;flex:none;border:1px solid #d8e3eb;border-radius:9px;background:#fff;color:#2d5f7c;cursor:pointer;display:grid;place-items:center}
.bb-icon-button svg{width:20px;height:20px}
.bb-line-splits{margin-top:11px;padding-top:12px;border-top:1px solid #dde6ed;display:grid;gap:10px}
.bb-job-split{display:grid;grid-template-columns:minmax(0,1fr) 95px 30px;gap:9px;align-items:end}
.bb-job-split .bb-text-button{height:42px;font-size:20px}
.bb-line-total{font-size:11px;line-height:1.5;margin:10px 0 0;color:#667e8d}
.bb-line-total.invalid{color:#a44628}
.bb-tools-subheading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:21px 0 10px}
.bb-tools-subheading h3{font-size:14px;margin:0}
.bb-receipt-review{border:1px solid #dce5ec;background:#f3f7fa;padding:13px;border-radius:12px;margin:14px 0;display:grid;gap:11px}
.bb-receipt-review pre{max-height:180px;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;margin:0;padding:10px;border:1px solid #dce5ec;border-radius:8px;background:#fff;font:12px/1.6 system-ui;color:#496676}
.bb-scan-video-wrap{position:relative;background:#112b3e;border-radius:13px;overflow:hidden;margin-bottom:15px;aspect-ratio:4/3;max-height:290px;display:grid;place-items:center}
.bb-scan-video{display:block;width:100%;height:100%;object-fit:cover}
.bb-scan-target{position:absolute;inset:27% 12%;border:2px solid #fff;border-radius:11px;box-shadow:0 0 0 300px #10233250;pointer-events:none}
.bb-scan-placeholder{position:absolute;inset:0;display:grid;place-items:center;color:#d5e5ef;line-height:1.6;text-align:center;padding:24px;font-size:13px}
.bb-scan-video-wrap.active .bb-scan-placeholder{display:none}
.bb-scan-result{background:#edf6fb;border:1px solid #cbdfea;border-radius:11px;padding:14px;margin:13px 0;overflow-wrap:anywhere}
.bb-scan-result strong{display:block;margin-bottom:4px;font-size:14px}
.bb-scan-result p{margin:0;font-size:12px;line-height:1.6;color:#5d7685}
.bb-photo-view{max-height:65dvh;max-width:100%;display:block;margin:auto;object-fit:contain}
.bb-tools-busy{display:flex;align-items:center;gap:9px;font-size:12px;color:#5b7485;line-height:1.6}
.bb-tools-busy:before{content:'';width:13px;height:13px;border:2px solid #d4e1ea;border-top-color:#225b7e;border-radius:50%;animation:bb-tools-spin .8s linear infinite;flex:none}
@keyframes bb-tools-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){.bb-inventory-tools{display:grid;grid-template-columns:1fr 1fr}.bb-inventory-tools .bb-tool-button{padding:11px 10px;font-size:12px;gap:6px}.bb-tools{width:calc(100vw - 14px);max-height:calc(100dvh - 14px);border-radius:17px}.bb-tools-head{padding:16px}.bb-tools-head h2{font-size:18px}.bb-tools-body{padding:16px}.bb-tools-footer{padding-left:16px;padding-right:16px}.bb-tools input,.bb-tools select,.bb-tools textarea{font-size:16px}.bb-receipt-line{padding:12px}.bb-purchases-section{padding:14px}.bb-job-split{grid-template-columns:minmax(0,1fr) 75px 25px}.bb-tools-grid{gap:11px}.bb-line-fields{gap:10px}.bb-tools-footer .bb-tool-button.primary{flex:1}.bb-tools-grid .bb-tools-wide{grid-column:1/-1}}
@media(prefers-reduced-motion:reduce){.bb-tools-busy:before{animation:none}}
@media print{.bb-inventory-tools,.bb-purchases,.bb-tools{display:none!important}}
.bb-barcode-preview{margin:0 0 16px;padding:12px;border:1px solid var(--border,#d8e3eb);border-radius:12px;background:var(--surface-secondary,#f4f7fa);color:var(--foreground,#18384f)}
.bb-barcode-preview img{display:block;max-width:100%;width:100%;height:auto;max-height:220px;object-fit:contain;border-radius:7px}
.bb-barcode-preview figcaption,.bb-barcode-preview-empty{color:var(--muted,#536b7b);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.bb-barcode-preview figcaption{margin-top:8px}
.bb-barcode-preview-empty{padding:12px 4px}
.bb-barcode-details{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:6px 14px;margin:12px 0 0;font-size:12px;line-height:1.5}
.bb-barcode-details dt{color:var(--muted,#536b7b)}
.bb-barcode-details dd{margin:0;color:var(--foreground,#18384f);overflow-wrap:anywhere}
@media(max-width:600px){.bb-tools[data-bb-scan-result="true"] .bb-tools-footer .bb-tool-button{box-sizing:border-box;width:100%;flex:1 0 100%;justify-content:center}}
