/* packagingPreview.css — the print-time packaging modal (packagingPreview.js), shown from
   Packing Station's printClaimedLabels() when packaging_feature_enabled is on. Ported from the
   approved mockup, with its CSS custom properties resolved to RMS's real token values. */

/* ── read-only packaging chip on each pending order card (attachPackagingChips) ── */
.pk-pack-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f0; flex-wrap: wrap; }
.pk-pack-chip { display: inline-flex; align-items: center; gap: 6px; background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; border-radius: 7px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; }
.pk-pack-chip.none { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.pk-pack-chip .ic { font-size: 12px; }

/* ── Pick List: packaging restock-request band (fulfilment.js's #plRestockBand mount) ── */
#plRestockBand:not(:empty) { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.restock-band { display: flex; align-items: center; gap: 14px; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 12px; padding: 14px 16px; }
.restock-ic { width: 42px; height: 42px; border-radius: 10px; background: #7c3aed; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.restock-info { flex: 1; min-width: 0; }
.restock-info b { font-size: 14px; color: #0f172a; }
.restock-info span { display: block; font-size: 12px; color: #6d28d9; margin-top: 2px; }
.restock-qty { font-family: Consolas,"SF Mono",monospace; font-size: 20px; font-weight: 800; color: #7c3aed; flex: none; text-align: center; }
.restock-qty small { display: block; font-size: 9.5px; font-weight: 700; color: #8b5cf6; text-transform: uppercase; }
.restock-go { flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: #7c3aed; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.restock-go:hover { background: #6d28d9; }
.restock-go:disabled { opacity: .6; cursor: default; }
.restock-band.done { background: #f0fdf4; border-color: #bbf7d0; }
.restock-band.done .restock-ic { background: #16a34a; }
.restock-band.done .restock-info span { color: #166534; }

#pkgPvOverlay.pv-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10500; }
.pv-modal { width: 100%; max-width: 620px; max-height: min(680px, 88vh); background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; font: 13.5px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif; color: #0f172a; }
.pv-head { padding: 18px 22px 14px; border-bottom: 1px solid #e2e8f0; }
.pv-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #7c3aed; margin-bottom: 6px; }
.pv-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #7c3aed; }
.pv-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.pv-sub { color: #475569; font-size: 12.5px; margin-top: 4px; }
.pv-sub b { color: #0f172a; font-variant-numeric: tabular-nums; }
.pv-body { padding: 16px 22px; overflow-y: auto; flex: 1; }

.pv-section-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; margin-bottom: 8px; }
.pv-mat { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.pv-mat + .pv-mat { margin-top: 7px; }
.pv-mat-info { flex: 1; min-width: 0; }
.pv-mat-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-mat-src { font-size: 10.5px; color: #94a3b8; font-weight: 500; margin-top: 2px; }
.pv-mat-need { flex: none; min-width: 30px; text-align: right; font-family: Consolas,"SF Mono",monospace; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 800; color: #0f172a; white-space: nowrap; }
.pv-mat-stock { flex: none; font-size: 11px; color: #94a3b8; white-space: nowrap; min-width: 116px; text-align: right; }
.pv-mat.out { border-color: #fecaca; background: #fef2f2; }
.pv-mat.out .pv-mat-stock { color: #dc2626; font-weight: 700; }
.pv-mat.out .pv-mat-need { color: #dc2626; }
.pv-mat .ok-ic { color: #16a34a; margin-left: 3px; }
.pv-resolve-btn { flex: none; background: #dc2626; color: #fff; border: none; border-radius: 8px; padding: 8px 13px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.pv-resolve-btn:hover { background: #b91c1c; }

/* ── out-of-stock resolve popup: request stock, or swap in a different material ── */
.oos-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.65); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10600; }
.oos-modal { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden; font: 13.5px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif; color: #0f172a; }
.oos-head { padding: 18px 20px 14px; border-bottom: 1px solid #e2e8f0; text-align: center; }
.oos-ic { width: 44px; height: 44px; border-radius: 50%; background: #fef2f2; color: #dc2626; display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 10px; }
.oos-title { font-size: 15px; font-weight: 800; color: #0f172a; }
.oos-sub { font-size: 12px; color: #64748b; margin-top: 4px; }
.oos-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.oos-opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid #e2e8f0; border-radius: 11px; padding: 13px 14px; cursor: pointer; text-align: left; background: #fff; width: 100%; }
.oos-opt:hover { border-color: #2563eb; }
.oos-opt .ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.oos-opt.req .ic { background: #ede9fe; color: #7c3aed; }
.oos-opt-t { font-size: 13px; font-weight: 700; color: #0f172a; }
.oos-opt-s { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.oos-done { display: flex; align-items: center; gap: 10px; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 11px; padding: 12px 14px; font-size: 12.5px; font-weight: 700; color: #166534; }
.oos-swap-box { margin-top: 4px; }
.oos-swap-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.oos-swap-opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; cursor: pointer; margin-bottom: 6px; }
.oos-swap-opt:hover { border-color: #2563eb; }
.oos-swap-opt.picked { border-color: #2563eb; background: #eff6ff; }
.oos-swap-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cbd5e1; flex: none; position: relative; }
.oos-swap-opt.picked .oos-swap-radio { border-color: #2563eb; }
.oos-swap-opt.picked .oos-swap-radio::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #2563eb; }
.oos-swap-name { font-size: 12.5px; font-weight: 700; }
.oos-swap-stock { font-size: 10.5px; color: #94a3b8; }
.oos-foot { padding: 14px 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 10px; }

.pv-next { display: flex; align-items: center; gap: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 11px; padding: 12px 14px; margin-top: 14px; }
.pv-next-ic { width: 34px; height: 34px; border-radius: 9px; background: #ede9fe; color: #7c3aed; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.pv-next-t { font-size: 12.5px; font-weight: 700; }
.pv-next-s { font-size: 11px; color: #64748b; margin-top: 1px; }
.pv-next-btn { margin-left: auto; background: #0f172a; color: #fff; border: none; border-radius: 8px; padding: 9px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pv-next-btn:hover { background: #2563eb; }

.pv-set { display: flex; flex-direction: column; }
.pv-set-ctx { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 11px 13px; font-size: 12.5px; color: #475569; margin-bottom: 14px; }
.pv-set-ctx b { color: #0f172a; }

.pv-foot { padding: 14px 22px; border-top: 1px solid #e2e8f0; display: flex; align-items: center; gap: 10px; }
.pv-foot-note { font-size: 11.5px; color: #b45309; font-weight: 600; margin-right: auto; }
.pv-btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.pv-btn.ghost { background: #fff; border: 1.5px solid #cbd5e1; color: #475569; }
.pv-btn.primary { background: #0f172a; color: #fff; margin-left: auto; }
.pv-btn.primary:hover { background: #2563eb; }
.pv-btn.primary:disabled { background: #cbd5e1; color: #fff; cursor: not-allowed; }

/* ── scope choice + material rows, used inside the "set packaging" sub-panel ── */
.cs-scope { padding: 0 0 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; }
.cs-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1.5px solid #e2e8f0; border-radius: 10px; cursor: pointer; }
.cs-opt.on { border-color: #2563eb; background: #eff6ff; }
.cs-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cbd5e1; flex: none; margin-top: 1px; position: relative; }
.cs-opt.on .cs-radio { border-color: #2563eb; }
.cs-opt.on .cs-radio::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #2563eb; }
.cs-opt-t { font-size: 12.5px; font-weight: 700; }
.cs-opt-s { font-size: 11px; color: #64748b; margin-top: 2px; }

.cs-mats { display: flex; flex-direction: column; gap: 7px; }
.cs-mrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 9px 11px; }
.cs-mrow.checked { border-color: #2563eb; background: #eff6ff; }
.cs-cb { width: 17px; height: 17px; border-radius: 5px; border: 2px solid #cbd5e1; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; font-size: 11px; color: #fff; font-weight: 900; }
.cs-mrow.checked .cs-cb { background: #2563eb; border-color: #2563eb; }
.cs-mname { font-size: 12.5px; font-weight: 700; cursor: pointer; min-width: 0; }
.cs-mstock { font-size: 10.5px; color: #94a3b8; font-weight: 500; margin-top: 1px; }
.cs-mstock.out { color: #dc2626; font-weight: 700; }
.cs-mqty { display: flex; align-items: center; gap: 5px; flex: none; }
.cs-qty-btn { width: 22px; height: 22px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #0f172a; }
.cs-qty-btn:hover { background: #f1f5f9; }
.cs-qty-val { width: 30px; text-align: center; font-family: Consolas,"SF Mono",monospace; font-size: 12px; font-weight: 700; border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 2px; }
