/* SKU / barcode UI: form helpers, scanner overlay, label dialog. Light + dark (html.dark). */
.bc-inline { display: flex; gap: .5rem; align-items: stretch; }
.bc-inline input { flex: 1; min-width: 0; }
.bc-mini {
  flex: none; padding: 0 .85rem; border-radius: .6rem; border: 1px solid #99f6e4; background: #f0fdfa; color: #0f766e;
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s;
}
.bc-mini:hover { background: #ccfbf1; }
.bc-mini:active { transform: scale(.96); }
html.dark .bc-mini { background: rgba(45, 212, 191, .12); border-color: rgba(45, 212, 191, .35); color: #2dd4bf; }
html.dark .bc-mini:hover { background: rgba(45, 212, 191, .2); }

.form-hint.bad { color: #be123c; }
.form-hint.ok { color: #0f766e; }
.form-hint.warn { color: #b45309; }
html.dark .form-hint.warn { color: #fbbf24; }
html.dark .form-hint.bad { color: #fb7185; }
html.dark .form-hint.ok { color: #2dd4bf; }
.bc-invalid { border-color: #f43f5e !important; box-shadow: 0 0 0 2px rgba(244, 63, 94, .18); }

.bc-preview { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border: 1px dashed #cbd5e1; border-radius: .75rem; background: #fff; }
.bc-preview svg { height: 64px; width: auto; max-width: 62%; flex: none; }
.bc-preview .bc-pv-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; font-size: 12px; color: #64748b; }
.bc-preview .bc-pv-side button { padding: .3rem .7rem; border-radius: .5rem; border: 1px solid #99f6e4; background: #f0fdfa; color: #0f766e; font-weight: 600; font-size: 12px; cursor: pointer; }
html.dark .bc-preview { border-color: #334155; }
.bc-sku-sub { display: block; font-size: 11px; color: #94a3b8; font-weight: 400; margin-top: 1px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------------- overlay (scanner + label dialog) */
body.bc-lock { overflow: hidden; }
.bc-ov {
  position: fixed; inset: 0; z-index: 2000; background: rgba(8, 15, 30, .62); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; animation: bcFade .18s ease-out;
}
@media (min-width: 640px) { .bc-ov { align-items: center; } }
@keyframes bcFade { from { opacity: 0; } }
.bc-card {
  width: 100%; max-width: 440px; max-height: 94vh; overflow-y: auto; background: #fff; color: #0b1b3a;
  border-radius: 22px 22px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); animation: bcUp .22s ease-out;
}
@media (min-width: 640px) { .bc-card { border-radius: 22px; } }
@keyframes bcUp { from { transform: translateY(24px); opacity: 0; } }
html.dark .bc-card { background: #121b2d; color: #eaf1f8; }
.bc-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bc-card h3 { font-size: 16px; font-weight: 700; margin: 0; }
.bc-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(100, 116, 139, .14); color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.bc-sub { font-size: 12.5px; color: #64748b; margin: -4px 0 10px; }

.bc-cam { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.bc-cam[hidden] { display: none; }
.bc-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-frame { position: absolute; inset: 18% 10%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.bc-laser { position: absolute; left: 12%; right: 12%; height: 2px; background: #2dd4bf; box-shadow: 0 0 10px #2dd4bf; top: 30%; animation: bcLaser 1.6s ease-in-out infinite alternate; pointer-events: none; }
@keyframes bcLaser { to { top: 68%; } }
@media (prefers-reduced-motion: reduce) { .bc-laser, .bc-card, .bc-ov { animation: none; } }
.bc-torch { position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.bc-torch.on { background: #f59e0b; color: #1f1300; }

.bc-status { margin: 10px 2px 6px; font-size: 13.5px; color: #64748b; min-height: 1.4em; }
.bc-status.ok { color: #0f766e; font-weight: 600; }
.bc-status.bad { color: #be123c; font-weight: 600; }
html.dark .bc-status.ok { color: #2dd4bf; } html.dark .bc-status.bad { color: #fb7185; }
.bc-log { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.bc-log div { font-size: 12.5px; padding: 6px 10px; border-radius: 10px; background: rgba(13, 148, 136, .1); color: #0f766e; }
html.dark .bc-log div { color: #2dd4bf; }

.bc-manual { display: flex; gap: 8px; margin: 6px 0 10px; }
.bc-manual input, .bc-grid select, .bc-grid input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #cbd5e1; background: #fff; color: inherit; font-size: 14px; width: 100%;
}
html.dark .bc-manual input, html.dark .bc-grid select, html.dark .bc-grid input { background: #0b1220; border-color: #26344d; }
.bc-manual button { padding: 0 16px; border-radius: 12px; border: 0; background: #0d9488; color: #fff; font-weight: 600; cursor: pointer; }
.bc-done { width: 100%; padding: 12px; border-radius: 14px; border: 0; background: #0d9488; color: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.bc-done:disabled { opacity: .5; cursor: not-allowed; }
.bc-manual input:focus-visible, .bc-done:focus-visible, .bc-x:focus-visible, .bc-mini:focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }

/* label dialog */
.bc-prev { display: flex; justify-content: center; padding: 14px; border-radius: 14px; background: #eef2f6; margin-bottom: 12px; overflow: auto; }
html.dark .bc-prev { background: #0b1220; }
.bc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.bc-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; font-weight: 600; }
.bc-grid label[hidden] { display: none; }
.bc-checks { display: flex; gap: 16px; margin-bottom: 10px; font-size: 13.5px; }
.bc-checks label, .bc-warn { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bc-warn { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: #fef3c7; color: #92400e; margin-bottom: 10px; }
html.dark .bc-warn { background: rgba(251, 191, 36, .14); color: #fbbf24; }
.bc-total { font-size: 12.5px; color: #64748b; margin: 0 0 10px; }

/* scan button inside the mobile search pill */
.mz-scanbtn { flex: none; width: 34px; height: 34px; border-radius: 12px; border: 0; background: var(--mz-teal-l, #e3f6f2); color: var(--mz-teal-d, #0f766e); display: grid; place-items: center; cursor: pointer; }
.mz-scanbtn svg { width: 18px; height: 18px; }
html.dark .mz-scanbtn { color: var(--mz-teal, #2dd4bf); }

.bc-manual[hidden] { display: none; }
.bc-type { display: block; width: 100%; margin: 6px 0 10px; padding: 11px; border-radius: 12px; border: 1px dashed rgba(100, 116, 139, .5); background: transparent; color: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.bc-cam.flash::after { content: ""; position: absolute; inset: 0; background: rgba(16, 185, 129, .45); animation: bcflash .28s ease-out forwards; pointer-events: none; }
@keyframes bcflash { to { opacity: 0; } }
.bc-type[hidden] { display: none; }
.bc-done { position: sticky; bottom: 0; }
