/* admin-receipt.css — "استلام بضاعة" receipt form redesign + receipt list/view print buttons (owner request,
   2026-10-22). New file, registered in admin/index.html. Scoped entirely to rc2-* classes (receiptModal /
   receiptCorrectModal shared line editor, admin-stock.js) and rc-print-btn (purchases list row + receiptView) so
   it cannot collide with admin-stock.css's table rules (owned by the table-page agent) or any other screen. */

/* a bit wider than the generic .modal.wide (820px) — this form has 8 columns in its line table */
#modal.rc2-wide { width: 1080px; max-width: 97vw; }

.rc2-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.rc2-head .f.full { grid-column: 1 / -1; }
.rc2-head-tot { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; }
.rc2-head-tot small { color: #1d4ed8; font-weight: 600; }
.rc2-head-tot b { font-size: 20px; color: #1d4ed8; }

.rc2-table { border: 1px solid var(--line, #e5e9f2); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.rc2-row-head, .rc2-row {
  display: grid;
  grid-template-columns: 30px 1.5fr 1.3fr 85px 130px 130px 170px 32px;
  gap: 8px; align-items: center; padding: 8px 10px;
}
.rc2-row-head { background: #f1f5f9; font-size: 12px; font-weight: 700; color: var(--mut, #64748b); }
.rc2-row { border-top: 1px solid var(--line, #e5e9f2); }
.rc2-row:nth-child(odd) { background: #fafbfe; }
.rc2-row.rc2-dup { background: #fffbeb; }
.rc2-f > label { display: none; }
.rc2-code-wrap { position: relative; }
.rc2-code-wrap input.bad { border-color: #b91c1c; background: #fef2f2; }
.rc2-err, .rc2-warn { display: block; font-size: 11px; margin-top: 2px; }
.rc2-err { color: #b91c1c; }
.rc2-warn { color: #92400e; }
.rc2-qty { width: 100%; }
.rc2-name { font-weight: 600; }
.rc2-del { border: none; background: none; cursor: pointer; font-size: 15px; color: var(--mut, #64748b); padding: 4px; border-radius: 6px; }
.rc2-del:hover:not(:disabled) { background: #fee2e2; color: #b91c1c; }
.rc2-del:disabled { opacity: .35; cursor: default; }

.rc2-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; background: #f8fafc; border-radius: 10px; }
.rc2-foot b { font-size: 17px; }

/* receipt-list / receipt-view print buttons */
.rc-print-btn { padding: 0 8px; }

@media (max-width: 760px) {
  .rc2-head { grid-template-columns: 1fr 1fr; }
  #modal.rc2-wide { width: 94vw; }
  .rc2-row-head { display: none; }
  .rc2-row {
    grid-template-columns: 1fr; gap: 8px;
    border: 1px solid var(--line, #e5e9f2); border-radius: 10px; margin-bottom: 10px; padding: 10px;
    position: relative;
  }
  /* stacked card: label above value — a side-by-side row (label left, value right) is too cramped for Arabic
     field labels like «كود أو اسم الصنف» at 390px and caused text/input overlap (seen in a live screenshot). */
  .rc2-f { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 2px 0; }
  .rc2-f > label { display: block; font-size: 11.5px; color: var(--mut, #64748b); font-weight: 600; }
  .rc2-f input, .rc2-f span { width: 100%; max-width: 100%; }
  .rc2-no { position: absolute; top: 10px; left: 10px; font-size: 11.5px; color: var(--mut, #64748b); }
  .rc2-no > label { display: none; }
  .rc2-f-del { align-items: flex-end; }
  .rc2-f-del > label { display: none; }
  .rc2-del { align-self: flex-end; }
}

@media (max-width: 420px) {
  .rc2-head { grid-template-columns: 1fr; }
}
