/* Stocktake tables retain one layout with scrolling inside each detail card. */
:is(#moduleStocktakes, #managerInventoryCountPanel) .grid-2 > div,
:is(#stocktakesModuleInventoryCountDetail, #inventoryCountDetail) {
  min-width: 0;
  max-width: 100%;
}
:is(#stocktakesModuleInventoryCountDetail, #inventoryCountDetail) .table-scroll {
  display: block;
  max-width: 100%;
  overflow: auto !important;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
:is(#stocktakesModuleInventoryCountDetail, #inventoryCountDetail) .data-table {
  width: 100%;
  min-width: 860px;
  table-layout: auto;
}
:is(#stocktakesModuleInventoryCountDetail, #inventoryCountDetail) .data-table :is(th, td) {
  word-break: normal;
  overflow-wrap: normal;
  white-space: nowrap;
}
:is(#stocktakesModuleInventoryCountDetail, #inventoryCountDetail) .data-table td:nth-child(2) {
  min-width: 140px;
  white-space: normal;
}

/* Stocktake dialogs must float above the workspace, not after the page body. */
.stocktake-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(8px);
}
.stocktake-dialog-overlay > .modal-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  background: #0b1a2d;
  color: #f8fafc;
}
.stocktake-dialog-overlay .modal-head,
.stocktake-dialog-overlay .modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stocktake-dialog-overlay .modal-head { margin-bottom: 16px; }
.stocktake-dialog-overlay .modal-head h3 { margin: 0; }
.stocktake-dialog-overlay .modal-actions { margin-top: 16px; justify-content: flex-end; }
.stocktake-dialog-overlay label { display: grid; gap: 6px; min-width: 0; }
.stocktake-dialog-overlay .input { width: 100%; min-width: 0; box-sizing: border-box; }
.stocktake-dialog-overlay [data-stocktake-options-status] { margin: 0; }
@media (max-width: 480px) {
  .stocktake-dialog-overlay > .modal-card { padding: 18px; }
}

.stocktake-dialog-overlay .stocktake-create-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.stocktake-dialog-overlay .modal-head h3 { font-size: 22px; }
.stocktake-dialog-overlay .input { min-height: 44px !important; padding: 10px 12px; }
.stocktake-dialog-overlay .icon-only-btn { min-width: 40px; min-height: 40px; }
