/* po.css — PO screens (po.html, stock-pos.html, not-in-catalog.html, material.html).
   Colours: only the variables from app.css and /office-widgets.css.
   Every control a finger can hit sets min-height: 44px on its own class (CLAUDE.md "Mobile tap targets"). */

/* Labelled fields (label wraps its control, so no element ids are needed) */
.po-field { display: block; margin: 0 0 14px; }
.po-field > .label { display: block; font-weight: 700; margin-bottom: 6px; }
.po-field .input, .po-field select.input, .po-input { min-height: 44px; font-weight: 400; }
.po-field .qty-row .input { min-height: 44px; }
.po-field .qty-row select.input { min-height: 44px; }

/* Buttons and chips on these pages */
.po-btn { min-height: 44px; }
.po-chip { min-height: 44px; }
.po-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.po-actions .btn { min-height: 44px; }
.po-row-btn { min-height: 44px; }
.po-pick { min-height: 44px; }

/* Header */
.po-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.po-title h1 { margin: 0; overflow-wrap: anywhere; }
.po-head { margin-top: 12px; }
.po-stock-label { font-weight: 800; letter-spacing: .02em; }

/* Lines */
.po-lines { list-style: none; margin: 0; padding: 0; }
.po-line { padding: 12px 14px; border-top: 1px solid var(--gray-100); }
.po-line:first-child { border-top: 0; }
.po-line-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.po-line-main { min-width: 0; }
.po-line-qty { flex: none; text-align: right; font-weight: 800; white-space: nowrap; }
.po-line-money { display: block; font-size: 13px; font-weight: 600; color: var(--gray-500); }
.po-line-note { margin: 8px 0 0; }
.po-line-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.po-line-actions .btn { min-height: 44px; }
.po-line-edit { margin-top: 12px; padding: 12px; border-left: 4px solid var(--orange); background: var(--gray-50); border-radius: var(--radius-sm); }
.po-line-edit .btn { min-height: 44px; }
.po-line.is-removed .list-title { text-decoration: line-through; color: var(--gray-500); }
.po-total { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--gray-100); font-weight: 800; }

/* History (removed / changed lines) */
details.po-history { margin-top: 12px; }
details.po-history > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; padding: 0 4px; }

/* Item search results */
.po-results { margin: 0 0 14px; max-height: 420px; overflow: auto; }
.po-results-head { padding: 8px 14px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); background: var(--gray-50); }
.po-results .picker-row { min-height: 44px; }
.po-picked { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 12px; border: 1.5px solid var(--orange); border-radius: var(--radius-sm); background: var(--white); }
.po-picked .btn { min-height: 44px; flex: none; }

/* Coil / reel choice and receive rows */
.po-places { display: grid; gap: 8px; margin: 0 0 14px; }
.po-place { min-height: 44px; }
.po-recv { list-style: none; margin: 0 0 12px; padding: 0; }
.po-recv-row { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--gray-100); }
.po-recv-row:first-child { border-top: 0; }
.po-recv-row .input { min-height: 44px; }

/* Stage filter */
.po-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

/* Material view */
.mat-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--gray-100); }
.mat-row:first-child { border-top: 0; }
.mat-row.is-reversal .list-title { color: var(--gray-500); }
.mat-side { flex: none; text-align: right; white-space: nowrap; }
.mat-qty { font-weight: 800; }
.mat-money { display: block; font-size: 13px; color: var(--gray-500); }
.mat-po-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.mat-po-head h2 { margin: 0; }
.mat-po-head .btn { min-height: 44px; }

/* Not in catalog list */
.nic-row { padding: 12px 14px; border-top: 1px solid var(--gray-100); }
.nic-row:first-child { border-top: 0; }

@media (max-width: 768px) {
  .po-actions .btn { flex: 1 1 auto; min-height: 44px; }
  .po-recv-row { grid-template-columns: 1fr 110px; }
  .po-line-actions .btn { flex: 1 1 auto; min-height: 44px; }
}
.po-sub { display: block; }
.mat-total { margin: 10px 0 0; }
.po-link { display: inline-flex; align-items: center; min-height: 44px; }

/* Add materials (Release 2, owner Oct 17 2026): Freight / other, the "Update catalog cost" tick, the invoice check */
.po-add-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.po-add-head h2 { margin: 0; }
.po-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; margin: 4px 0 6px; border-radius: 10px; background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-200, #e5e7eb); font-size: 16px; font-weight: 600; cursor: pointer; }
.po-check input { width: 24px; height: 24px; min-height: 24px; flex: 0 0 auto; accent-color: var(--orange, #F47920); margin: 0; }
.po-check.is-big { border-color: #f59e0b; background: #fffbeb; }
.po-big-flag { margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 15px; line-height: 1.4; }
.po-inv-check { margin-top: 6px; border-top: 2px solid var(--gray-100, #f3f4f6); }
.po-inv-check.is-off .po-total:nth-child(2) { color: #b45309; }
.po-inv-check p { margin-left: 14px; margin-right: 14px; }
.po-cat-same { margin: 0 0 8px; }
/* Materials not entered */
.ne-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.ne-filters .input { min-height: 44px; font-size: 16px; }
.ne-row { min-height: 64px; text-decoration: none; color: inherit; }
.ne-missing { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
/* Truck requests */
.tr-card .tr-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tr-note { font-size: 16px; margin: 10px 0 0; }
.tr-photo { max-width: 220px; max-height: 160px; border-radius: 10px; margin-top: 10px; display: block; }
.tr-lines { list-style: none; margin: 12px 0 0; padding: 0; }
.tr-line { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--gray-100, #f3f4f6); }
.tr-what { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 16px; }
.tr-qty { display: flex; align-items: center; gap: 6px; }
.tr-qty .input { width: 84px; min-height: 44px; text-align: center; font-weight: 800; }
.tr-find .input { min-height: 44px; margin-top: 6px; }
.tr-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tr-acts .btn, .tr-acts .input { min-height: 44px; }
.tr-acts .input { width: auto; min-width: 200px; }
/* An item's photo in Add materials results (round 3 item 7) */
.po-results .picker-row .po-res-photo { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); margin-right: 10px; flex: none; border: 1px solid var(--gray-300); }
.po-results .picker-row .po-res-photo + .list-main { flex: 1; }
