/* المستودع — إضافات فوق تصميم المنصات (style.css + app.css) */
.wrap { max-width: 980px; }
.bar { display: flex; gap: 8px; align-items: center; }
.bar input { flex: 1; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-actions .btn { justify-content: center; padding: 14px 10px; font-size: 15px; border-radius: 12px; }
.big-actions .btn svg.i { width: 22px; height: 22px; }
.plist { display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: 56px 1fr auto; gap: 11px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.prow:active { transform: scale(.99); }
.prow .t { font-weight: 600; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prow .s { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; font-size: 12px; color: var(--muted); align-items: center; }
.prow .q { text-align: left; font-weight: 700; font-size: 16px; }
.prow .q small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--sunk) center/contain no-repeat; border: 1px solid var(--line); display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.chip.ok { background: #e7f3ec; color: var(--ok); }
.chip.warn { background: #fbefe2; color: var(--s3); }
.chip.bad { background: #f8e3e0; color: var(--s4); }
.chip.ink { background: var(--ink); color: var(--bg); }
.chip.cp { background: #f3ece5; color: var(--copper); }
.sheet-photo { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: start; }
.photo-box { position: relative; width: 132px; aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed var(--line2); background: var(--sunk); display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden; color: var(--muted); font-size: 12.5px; }
.photo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.photo-box .busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .85); display: grid; place-items: center; font-size: 12px; color: var(--ink); }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line2); border-top-color: var(--copper); border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.suggest { border: 1px solid #ead9c8; background: #fbf7f2; border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.suggest .h { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--copper); font-size: 13px; }
.suggest .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest .opts button { border: 1px solid #e3cdb7; background: #fff; border-radius: 20px; padding: 5px 12px; cursor: pointer; font-size: 13px; text-align: start; }
.suggest .opts button.on, .suggest .opts button:hover { border-color: var(--copper); background: #f3ece5; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; }
.hint-list { display: grid; gap: 4px; margin-top: 4px; }
.hint-list button { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 8px; cursor: pointer; text-align: start; font-size: 13px; }
.hint-list button img { width: 28px; height: 28px; object-fit: contain; border-radius: 5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 8px; }
.stat { background: var(--sunk); border-radius: 10px; padding: 8px 10px; }
.stat b { display: block; font-size: 18px; font-family: var(--display); }
.stat small { color: var(--muted); font-size: 11.5px; }
.stat.out b { color: var(--copper); } .stat.bad b { color: var(--s4); } .stat.ok b { color: var(--ok); }
.qty-pad { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; }
.qty-pad button { height: 56px; font-size: 26px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.qty-pad input { height: 56px; font-size: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lines { display: grid; gap: 6px; }
.line { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.line .thumb { width: 40px; height: 40px; border-radius: 8px; }
.line .n { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.line .m { font-size: 12px; color: var(--muted); }
.line input { width: 76px; text-align: center; padding: 6px; }
.line select { width: auto; padding: 6px; font-size: 12.5px; }
.diff-pos { color: var(--ok); font-weight: 700; } .diff-neg { color: var(--s4); font-weight: 700; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--sunk); position: sticky; top: 0; }
.table-scroll { overflow-x: auto; }
.sig-pad { border: 1px dashed var(--line2); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 140px; display: block; }
.sect-t { font-family: var(--display); font-weight: 600; font-size: 14px; margin: 4px 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.note { background: var(--sunk); border-radius: 10px; padding: 9px 12px; font-size: 13px; color: var(--ink2); }
.note.warn { background: #fbefe2; color: #8a4b12; }
.tl-mini { display: grid; gap: 6px; font-size: 13px; }
.tl-mini > div { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.filters-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters-row button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 12px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.filters-row button.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.sticky-foot { position: sticky; bottom: -16px; background: linear-gradient(transparent, #fff 30%); padding-top: 14px; margin-top: 8px; display: flex; gap: 8px; }
.sticky-foot .btn { flex: 1; justify-content: center; padding: 12px; }
/* الماسح */
.scanner { position: fixed; inset: 0; z-index: 80; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-frame i { width: min(78vw, 360px); height: min(36vw, 170px); border: 3px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.scanner.hit .scan-frame i { border-color: #5fd68d; }
.scan-top, .scan-bottom { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; font-size: 14px; }
.scan-bottom { bottom: 0; top: auto; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
.toasts { z-index: 90; }
.scan-bottom input { flex: 1; background: rgba(255, 255, 255, .95); }
.scan-top .btn, .scan-bottom .btn { border-color: transparent; }
@media (max-width: 760px) {
  .sheet-photo { grid-template-columns: 112px 1fr; }
  .photo-box { width: 112px; }
  .modal-card { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  table.t.compact .hm { display: none; }
}
@media print { .top, .tabs-bar { display: none; } }
@media (max-width: 760px) { #sb .grid2 { grid-template-columns: 1fr; } }
