/* Stocktake (Inwentaryzacja, WP9). Desktop: one card with table-like rows (Inventory look).
   Phone (<= 760 px): each model is its own card, labels above the numbers, a 44 px count input. */

/* ---------- Header notes ---------- */
.stk-note { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--text-tertiary); font-size: var(--fs-small); }
.stk-notice {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--st-watch-tint); border-radius: var(--r-md); background: var(--st-watch-tint); color: var(--st-watch);
}
.stk-notice.is-error { border-color: var(--danger-line); background: var(--danger-tint); color: var(--danger); }
.stk-notice__text { display: flex; flex-direction: column; gap: 4px; color: var(--text-primary); font-size: var(--fs-body); line-height: 1.45; }
.stk-notice__link { font-size: var(--fs-meta); }

/* ---------- Toolbar ---------- */
.stk-toolbar {
  position: relative; z-index: var(--z-toolbar); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px;
}
.stk-toggle__label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: var(--fs-meta); }

/* ---------- List ---------- */
.stk-list { margin-top: 16px; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-card); }
.stk-list .placeholder { margin: 16px; min-height: 180px; }
.stk-head, .stk-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 180px 250px; gap: 20px; align-items: center; padding: 0 20px;
}
.stk-head {
  height: 40px; color: var(--text-tertiary); font-size: var(--fs-caption); font-weight: 500;
  box-shadow: inset 0 -1px 0 var(--border-subtle);
}
.stk-head .is-right { text-align: left; } /* Rafal 2026-09-28: numbers left-aligned, like Inventory */
.stk-row { min-height: 60px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--border-subtle); }
.stk-head + .stk-row { border-top: 0; }
.stk-row:hover { background: var(--bg-row-hover); }
.stk-row.is-dirty { background: var(--accent-tint-06); box-shadow: inset 2px 0 0 var(--accent); }
.stk-row.is-invalid { box-shadow: inset 2px 0 0 var(--danger); }

.stk-row__model { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stk-row__names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stk-row__code { color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--fs-small); }
.stk-row__name { overflow: hidden; font-size: var(--fs-nav); font-weight: 450; text-overflow: ellipsis; white-space: nowrap; }
.stk-row__warn .pill { white-space: normal; border-radius: var(--r-md); } /* sized base: reservations without a size */
.stk-row__badge { margin-left: auto; flex: none; }
.stk-row__num { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.stk-row__val { font-family: var(--font-mono); font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.stk-orders {
  max-width: 100%; overflow: hidden; color: var(--text-tertiary); font-family: var(--font-mono); font-size: var(--fs-tiny);
  text-overflow: ellipsis; white-space: nowrap;
}
.stk-row__label { display: none; }
.stk-row__input { display: flex; align-items: center; gap: 12px; }
.stk-input { width: 92px; text-align: left; }
.stk-row__hint { color: var(--text-tertiary); font-size: var(--fs-small); white-space: nowrap; }
.stk-row__hint b { color: var(--text-primary); font-weight: 600; }
.stk-row__hint b.t-out { color: var(--st-out); }

/* ---------- Sticky save bar ---------- */
.stk-bar { margin-top: 16px; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .stk-toolbar { gap: 10px; }
  .stk-toolbar .search { flex: 1 1 100%; width: auto; }
  .stk-list { overflow: visible; border: 0; background: transparent; display: flex; flex-direction: column; gap: 10px; }
  .stk-list .placeholder { margin: 0; }
  .stk-head { display: none; }
  .stk-row {
    grid-template-columns: 64px minmax(0, 1fr) 118px; gap: 12px 12px; align-items: start; padding: 12px 14px;
    border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-card);
  }
  .stk-row:hover { background: var(--bg-card); }
  .stk-row.is-dirty { background: var(--accent-tint-06); box-shadow: inset 3px 0 0 var(--accent); }
  .stk-row__model { grid-column: 1 / -1; }
  .stk-row__num { align-items: flex-start; }
  .stk-row__label { display: block; color: var(--text-tertiary); font-size: var(--fs-caption); }
  .stk-row__val { font-size: 15px; line-height: 44px; }
  .stk-row__input { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
  .stk-input { width: 100%; height: 44px; font-size: 16px; }
  .stk-row__hint { white-space: normal; font-size: var(--fs-caption); }
  .stk-bar { bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .stk-bar .unsaved__text { flex: 1 1 100%; }
  .stk-bar .btn--ghost { margin-left: 0; }
  .stk-bar .btn--primary { flex: 1; justify-content: center; }
}
/* "Model not in the list?" + Add model (empty/search state) */
.stk-add { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
