/* inventory.css — Inventory & Logistics (.iv-) and the catalogue admin (.ct-) */

/* Optional item marks: the same name cell becomes the mobile card title. */
.iv-item-identity { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.iv-item-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--aqua-tint); color: var(--aqua-text); border: 1px solid var(--line); }
.iv-item-mark svg { width: 21px; height: 21px; }
.iv-item-copy { min-width: 0; display: grid; gap: 4px; }
.iv-item-name { font-weight: 600; line-height: 1.4; }
.iv-item-name, .iv-item-category { white-space: normal; overflow-wrap: anywhere; }
.iv-use-stock { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; color: var(--ink-soft); font-size: .86rem; line-height: 1.5; }
.iv-use-stock strong { color: var(--ink); font-weight: 600; }
.iv-use-form .notice { font-size: .82rem; line-height: 1.5; }
.iv-use-form .notice[hidden] { display: none; }
@media (max-width: 560px) {
  .iv-item-identity { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .iv-item-mark { width: 36px; height: 36px; border-radius: 11px; }
  .iv-item-mark svg { width: 19px; height: 19px; }
}

.iv-more { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.iv-more > summary { padding: 12px 14px; cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.iv-more-body { padding: 4px 14px 16px; }
.iv-more-body.row { gap: 10px; }

.iv-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 18px; }
.iv-filters .field { margin: 0; min-width: 0; flex: 1 1 170px; }
.iv-filters > * { min-width: 0; max-width: 100%; }
.iv-filters > .field + .field { margin-top: 0; }
.iv-filters .grow { flex: 1 1 auto; }

.iv-locs { display: grid; gap: 8px; }
.iv-loc {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: .92rem;
}
.iv-loc b { font-size: 1.05rem; }
.iv-loc > span { min-width: 0; overflow-wrap: anywhere; }

.iv-move {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.iv-move .grow { min-width: 0; }
.iv-move .grow > * { overflow-wrap: anywhere; }
.iv-move .tag { flex: none; }

.iv-po {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s;
}
.iv-po:hover { border-color: var(--aqua-deep); }
.iv-po .grow { min-width: 0; overflow-wrap: anywhere; }
.iv-po > .tag { flex: none; }

/* A stock-in line: item, how many, what it cost, when it expires. */
.iv-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) 44px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.iv-line > * { min-width: 0; }
.iv-line > .field + .field { margin-top: 0; }
.iv-line > :nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
.iv-line > :nth-child(2) { grid-column: 1; grid-row: 2; }
.iv-line > :nth-child(3) { grid-column: 2; grid-row: 2; }
.iv-line > :nth-child(4) { grid-column: 3 / 5; grid-row: 2; }
.iv-line > :nth-child(5) { grid-column: 4; grid-row: 1; }
.iv-line-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
.iv-line-3 > :nth-child(1) { grid-column: 1 / 3; }
.iv-line-3 > :nth-child(3) { grid-column: 2 / 4; }
.iv-line-3 > :nth-child(4) { grid-column: 3; grid-row: 1; }
.iv-line-head { display: none; }
.iv-line .input, .iv-line .select { min-height: 42px; }
.iv-line .iconbtn { align-self: end; margin-bottom: 1px; }

/* ------------------------------------------------------- catalogue admin */

.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.ct-card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.ct-card:hover { border-color: var(--aqua-deep); box-shadow: var(--shadow-sm); }
.ct-card.off { opacity: .55; }
.ct-card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.ct-card-name { min-width: 0; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ct-card-meta { font-size: .82rem; color: var(--ink-faint); }
.ct-tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ct-tags .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ct-cons { display: grid; grid-template-columns: minmax(0, 1fr) 80px 44px; gap: 8px; align-items: center; }
.ct-cons > * { min-width: 0; }

@media (max-width: 760px) {
  .iv-filters .field { flex-basis: 140px; }
}
@media (max-width: 560px) {
  .iv-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 10px 8px; }
  .iv-line > :nth-child(1) { grid-column: 1 / 3; }
  .iv-line > :nth-child(3) { grid-column: 2 / 4; }
  .iv-line > :nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .iv-line > :nth-child(5) { grid-column: 3; }
  .iv-line-3 > :nth-child(4) { grid-column: 3; grid-row: 1; }
  .iv-move { flex-wrap: wrap; }
  .iv-move .grow { flex: 1 1 180px; }
  .iv-po { align-items: flex-start; flex-wrap: wrap; }
  .ct-cons { grid-template-columns: minmax(0, 1fr) 44px; }
  .ct-cons > :first-child { grid-column: 1 / -1; }
}
