/* V33: inventory follows its available width, including an open sidebar. */
#panel-relatorios { container-type: inline-size; container-name: inventory; }
#panel-relatorios :is(.inventory-page-shell, .inventory-command-copy, .inventory-command-actions, .inventory-command-metrics, .inventory-history-panel, .inventory-stock-history-tools) { min-width: 0; max-width: 100%; }
#panel-relatorios #inventoryStockFlowHistory { min-width: 0; max-width: 100%; }
#panel-relatorios .inventory-history-panel { grid-template-columns: minmax(0, 1fr); }
#panel-relatorios .inventory-command-actions .btn svg { flex-shrink: 0; }
@media (min-width: 681px) and (max-width: 1280px) {

  #panel-relatorios .inventory-command-hero-v2 { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 22px; }
  #panel-relatorios .inventory-command-status-row { justify-content: flex-start; flex-wrap: wrap; }
  #panel-relatorios .inventory-command-sync { max-width: none; text-align: left; }
  #panel-relatorios .inventory-command-guide { flex-wrap: wrap; }
  #panel-relatorios .inventory-command-action-buttons .btn { white-space: normal; min-height: 44px; height: auto; padding: 10px 14px; }
  #panel-relatorios .inventory-overview-grid { grid-template-columns: minmax(0, 1fr); }
  #panel-relatorios #inventoryStockSummaryGrid,
  #panel-relatorios #inventoryStockFlowShortcuts .stock-flow-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #panel-relatorios #inventoryStockSummaryGrid .stock-summary-card { min-width: 0; min-height: 96px; }
  #panel-relatorios #inventoryStockSummaryGrid .stock-summary-copy { min-width: 0; }
  #panel-relatorios #inventoryStockSummaryGrid .stock-summary-card small { white-space: normal; overflow: visible; text-overflow: clip; }
  #panel-relatorios .inventory-stock-history-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-relatorios .inventory-history-search { grid-column: 1 / -1; }
  #panel-relatorios .inventory-stock-history-tools :is(input, select) { width: 100%; min-width: 0; min-height: 44px; }
  #panel-relatorios :is(.inventory-stock-history-head, .inventory-stock-flow-head) { flex-wrap: wrap; }
  #panel-relatorios #inventoryStockFlowHistory .stock-table-wrap { display: none; }
  #panel-relatorios #inventoryStockFlowHistory .stock-movement-card-list { display: grid; gap: 14px; }
  #panel-relatorios .stock-movement-card :is(strong, span, small) { overflow-wrap: anywhere; white-space: normal; }
  #panel-relatorios .stock-movement-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-relatorios .stock-movement-card .stock-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  #panel-relatorios .stock-movement-card .stock-row-actions .btn { min-height: 44px; }
}
@container inventory (min-width: 561px) and (max-width: 960px) {

  #panel-relatorios .inventory-command-hero-v2 { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 22px; }
  #panel-relatorios .inventory-command-status-row { justify-content: flex-start; flex-wrap: wrap; }
  #panel-relatorios .inventory-command-sync { max-width: none; text-align: left; }
  #panel-relatorios .inventory-command-guide { flex-wrap: wrap; }
  #panel-relatorios .inventory-command-action-buttons .btn { white-space: normal; min-height: 44px; height: auto; padding: 10px 14px; }
  #panel-relatorios .inventory-overview-grid { grid-template-columns: minmax(0, 1fr); }
  #panel-relatorios #inventoryStockSummaryGrid,
  #panel-relatorios #inventoryStockFlowShortcuts .stock-flow-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #panel-relatorios #inventoryStockSummaryGrid .stock-summary-card { min-width: 0; min-height: 96px; }
  #panel-relatorios #inventoryStockSummaryGrid .stock-summary-copy { min-width: 0; }
  #panel-relatorios #inventoryStockSummaryGrid .stock-summary-card small { white-space: normal; overflow: visible; text-overflow: clip; }
  #panel-relatorios .inventory-stock-history-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-relatorios .inventory-history-search { grid-column: 1 / -1; }
  #panel-relatorios .inventory-stock-history-tools :is(input, select) { width: 100%; min-width: 0; min-height: 44px; }
  #panel-relatorios :is(.inventory-stock-history-head, .inventory-stock-flow-head) { flex-wrap: wrap; }
  #panel-relatorios #inventoryStockFlowHistory .stock-table-wrap { display: none; }
  #panel-relatorios #inventoryStockFlowHistory .stock-movement-card-list { display: grid; gap: 14px; }
  #panel-relatorios .stock-movement-card :is(strong, span, small) { overflow-wrap: anywhere; white-space: normal; }
  #panel-relatorios .stock-movement-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-relatorios .stock-movement-card .stock-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  #panel-relatorios .stock-movement-card .stock-row-actions .btn { min-height: 44px; }
}
@media (min-width: 681px) and (max-width: 1280px) {
  #stockTransactionOverlay { padding: 16px; }
  #stockTransactionOverlay .stock-modal-card { width: min(100%, 1000px); max-width: 100%; max-height: calc(100dvh - 32px); padding: 20px; }
  #stockTransactionOverlay :is(.stock-transaction-grid, .stock-flow-context-grid, .stock-storage-inner, .stock-reservation-inner) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #stockTransactionOverlay :is(.form-field, .option-select, .option-input, .stock-flow-context) { min-width: 0; max-width: 100%; }
  #stockTransactionOverlay :is(input, select, button) { min-height: 44px; }
  #stockTransactionOverlay .stock-modal-head { flex-direction: row; }
  #stockTransactionOverlay .stock-modal-actions { position: sticky; bottom: -20px; z-index: 3; margin-top: 18px; padding: 16px 0 20px; background: var(--bg-raised, #fff); }
  body.stock-modal-open #mobileNavigationDock { display: none !important; visibility: hidden !important; pointer-events: none !important; }
}
@media (max-width: 680px) {
  #panel-relatorios .inventory-command-action-buttons .btn { white-space: normal; }
  #panel-relatorios #inventoryStockSummaryGrid,
  #panel-relatorios #inventoryStockFlowShortcuts .stock-flow-shortcut-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
