/* Màn Kho hàng đợt 7 (js/views/products.js, product-parts.js, product-modals.js, product-detail.js). */

.stk-chips { margin-bottom: 12px; }
.stk-name { color: var(--ink); }
.stk-name:hover { text-decoration: underline; }
.stk-recipe { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-table .prod-actions { flex-wrap: wrap; }
.stk-filters select { max-width: 280px; }

/* Chi tiết sản phẩm */
.stk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stk-stat { padding: 14px 16px; }
.stk-stat .stat-value { font-size: 20px; }

/* Modal kiểm kho */
.stk-count-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; margin-bottom: 14px; padding-right: 4px; }
.stk-count-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 64px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stk-count-name { min-width: 0; }
.stk-diff { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Dòng phiếu nhập / thành phần combo */
.stk-lines { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.stk-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 170px 32px; gap: 8px; align-items: center; }
.stk-line.no-cost { grid-template-columns: minmax(0, 1fr) 90px 32px; }
.stk-preview { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }

@media (max-width: 860px) {
  .stk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Điện thoại: bảng thành thẻ, ẩn Giá vốn + Lãi gộp, chip cuộn ngang, không tràn trang. */
@media (max-width: 520px) {
  .stk-chips .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .stk-chips .chip { flex: none; }
  .stk-table thead, .stk-ledger thead { display: none; }
  .stk-table tr, .stk-ledger tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stk-table td, .stk-ledger td { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border: 0; text-align: right; }
  .stk-table td::before, .stk-ledger td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .stk-table td:first-child { display: block; text-align: left; min-width: 0; }
  .stk-table td:first-child::before { content: none; }
  .stk-table .stk-cost { display: none; }
  .stk-table .prod-actions { justify-content: flex-start; }
  .stk-recipe { white-space: normal; }
  .stk-line { grid-template-columns: minmax(0, 1fr) 70px 32px; }
  .stk-line > input[name=line_cost] { grid-column: 1 / 3; }
  .stk-count-row { grid-template-columns: minmax(0, 1fr) 84px 48px; }
  .stk-filters select { max-width: 100%; width: 100%; }
}
