.modal.stock-document-modal {
  width: min(1440px, calc(100vw - 32px));
  max-width: 1440px;
}
.stock-document-modal .modal-body {
  padding: 24px;
}
.stock-document-header {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stock-products-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 0 14px;
}
.stock-search-bar {
  display: flex;
  gap: 10px;
}
.stock-search-bar > input {
  flex: 1;
  min-width: 140px;
}
.stock-catalog-note {
  margin: 12px 0 16px;
  line-height: 1.7;
}
.stock-search-results {
  padding: 8px;
  background: #f7f8fa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 18px;
  max-height: 340px;
  overflow: auto;
}
.stock-search-result {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px;
  border: 0;
  background: white;
  border-radius: 6px;
  margin-bottom: 4px;
}
.stock-search-result:hover {
  background: #f0f1ee;
}
.stock-search-result img,
.stock-pick img {
  width: 40px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
}
.stock-search-result span,
.stock-pick span {
  flex: 1;
  min-width: 0;
}
.stock-search-result small,
.stock-pick small {
  display: block;
  color: #727779;
  font-size: 12px;
  line-height: 1.6;
}
.stock-search-result strong,
.stock-pick strong {
  font-size: 13px;
  font-weight: 600;
}
.stock-picker-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stock-picker-list {
  max-height: 350px;
  overflow: auto;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 20px;
}
.stock-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #efefef;
  cursor: pointer;
}
.stock-pick:has(input:checked) {
  background: #f3f6f2;
}
.stock-pick input,
.stock-picker-toolbar input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
.stock-line-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.stock-line-tools > input {
  max-width: 300px;
}
.stock-line-tools .stock-bulk-quantity {
  width: 80px;
}
.stock-lines-table {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  max-height: 470px;
}
.stock-lines-table table {
  min-width: 1040px;
}
.stock-lines-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.stock-lines-table td,
.stock-lines-table th {
  padding: 12px 10px;
}
.stock-lines-table input {
  min-width: 85px;
  width: 100%;
  font-size: 13px;
  padding: 9px;
}
.stock-lines-table input[data-stock-number="quantity"] {
  width: 85px;
}
.stock-product-name {
  min-width: 160px;
  max-width: 300px;
  font-size: 13px;
  line-height: 1.6;
}
.stock-product-name strong {
  font-weight: 600;
}
.stock-product-name p {
  font-size: 12px;
}
.stock-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px;
}
.stock-document-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 18px;
  background: #f4f5f2;
  border-radius: 8px;
  font-size: 14px;
}
.stock-empty {
  text-align: center;
  padding: 38px;
  border: 1px dashed #d1d3d0;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
}
.stock-empty p {
  font-size: 13px;
  margin-top: 8px;
}
.stock-document-note {
  white-space: pre-line;
}
.stocktake-review {margin:14px 0;}
.stocktake-missing {padding:12px;border:1px solid #e7bd74;border-radius:8px;background:#fff7e8;color:#704711;}
.stocktake-missing .table-wrap {margin-top:8px;max-height:330px;}
.stocktake-missing th {position:sticky;top:0;background:#fff5e1;}
.stocktake-missing small,.stocktake-zero {display:block;}
.stocktake-missing .action-row {gap:5px;}
.stocktake-reviewed {color:#236044;}
.stocktake-changed {background:#fff9eb;}
.stock-document-detail .table-wrap {
  max-height: 60vh;
}
@media (max-width: 780px) {
  .stock-document-modal .modal-body {
    padding: 16px;
  }
  .stock-document-header {
    grid-template-columns: 1fr;
  }
  .stock-search-bar,
  .stock-line-tools {
    flex-wrap: wrap;
  }
  .stock-search-bar > input,
  .stock-line-tools > input {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }
  .stock-picker-toolbar {
    align-items: flex-start;
  }
  .stock-pick {
    padding: 8px;
    gap: 8px;
  }
  .stock-pick > small {
    display: none;
  }
  .stock-line-tools .row {
    flex-wrap: wrap;
  }
  .stock-document-summary {
    flex-direction: column;
  }
  .stock-products-head {
    align-items: flex-start;
  }
  .stock-products-head h3 {
    font-size: 18px;
  }
}
