/* DAYO UI V1.0 — Product Center compact/scroll hotfix (UI only).
   Loaded after Batch 2 V2 so the approved visual baseline remains intact. */

@media (min-width: 1000px) {
  /* Keep every workspace tab in the Global Shell start position. */
  body.dayo-batch2-layout #workspaceTabs#workspaceTabs#workspaceTabs {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    height: 39px !important;
    min-height: 39px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    transform: none !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid #dbe7f5 !important;
    z-index: 10 !important;
  }

  body.dayo-batch2-layout #workspaceTabs#workspaceTabs .dayo-workspace-tab {
    flex: 0 0 auto !important;
    height: 36px !important;
    padding: 0 13px !important;
    border-radius: 5px 5px 0 0 !important;
    font-size: 14px !important;
  }

  /* The product page scrolls as one document; no viewport-height clipping. */
  body.dayo-batch2-layout:has(#erpProducts#erpProducts.active) .main {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #erpProducts#erpProducts#erpProducts.active {
    height: auto !important;
    min-height: calc(100dvh - 39px) !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    gap: 6px !important;
    padding: 8px 14px 16px !important;
    overflow: visible !important;
  }

  #erpProducts#erpProducts .purchase-ui-heading {
    height: 26px !important;
    min-height: 26px !important;
    flex: 0 0 26px !important;
  }

  #erpProducts#erpProducts .purchase-ui-heading h2,
  #erpProducts#erpProducts .purchase-ui-table-title h3 {
    font-size: 14px !important;
    line-height: 26px !important;
  }

  #erpProducts#erpProducts .product-approved-filter {
    grid-template-columns: minmax(120px, .75fr) minmax(120px, .75fr) minmax(110px, .65fr) minmax(220px, 1.55fr) !important;
    grid-template-rows: auto !important;
    column-gap: 8px !important;
    row-gap: 6px !important;
    padding: 7px 10px !important;
  }

  #erpProducts#erpProducts .product-approved-filter > label {
    gap: 2px !important;
    font-size: 14px !important;
    line-height: 17px !important;
  }

  #erpProducts#erpProducts .product-approved-filter input,
  #erpProducts#erpProducts .product-approved-filter select,
  #erpProducts#erpProducts .purchase-ui-filter-actions button,
  #erpProducts#erpProducts :is(.p01-more, .p01-columns) > summary {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 9px !important;
    font-size: 14px !important;
    line-height: 30px !important;
  }

  #erpProducts#erpProducts .p01-filter-bottom {
    grid-column: 1 / -1 !important;
    min-height: 32px !important;
    gap: 8px !important;
  }

  #erpProducts#erpProducts .purchase-ui-filter-actions {
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  #erpProducts#erpProducts .purchase-ui-filter-actions button,
  #erpProducts#erpProducts .purchase-ui-filter-actions button:nth-child(3),
  #erpProducts#erpProducts .purchase-ui-filter-actions button:nth-child(4),
  #erpProducts#erpProducts .purchase-ui-filter-actions button:last-child {
    min-width: 0 !important;
    padding: 0 10px !important;
  }

  #erpProducts#erpProducts .purchase-ui-filter-actions svg {
    width: 15px !important;
    height: 15px !important;
  }

  #erpProducts#erpProducts .product-approved-tabs {
    height: 36px !important;
    min-height: 36px !important;
    flex: 0 0 36px !important;
    padding: 0 5px !important;
  }

  #erpProducts#erpProducts .product-approved-tabs button {
    height: 36px !important;
    padding: 0 10px !important;
    font-size: 14px !important;
  }

  #erpProducts#erpProducts .product-approved-tabs b {
    min-width: 28px !important;
    height: 22px !important;
    margin-left: 5px !important;
    padding: 0 7px !important;
    font-size: 12px !important;
  }

  #erpProducts#erpProducts .purchase-ui-table-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    padding: 0 10px !important;
    overflow: visible !important;
  }

  #erpProducts#erpProducts .purchase-ui-table-title {
    height: 34px !important;
    min-height: 34px !important;
    flex: 0 0 34px !important;
  }

  #erpProducts#erpProducts .purchase-ui-table-scroll {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    overscroll-behavior: auto !important;
  }

  #erpProducts#erpProducts .approved-product-table {
    font-size: 14px !important;
  }

  #erpProducts#erpProducts .approved-product-table :is(th, td) {
    height: 34px !important;
    min-height: 34px !important;
    padding: 4px 7px !important;
    font-size: 14px !important;
    line-height: 25px !important;
  }

  #erpProducts#erpProducts .approved-product-table th {
    height: 36px !important;
    min-height: 36px !important;
    font-weight: 600 !important;
  }

  #erpProducts#erpProducts .approved-product-table tbody tr {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
  }

  #erpProducts#erpProducts .purchase-ui-pagination {
    height: 38px !important;
    min-height: 38px !important;
    flex: 0 0 38px !important;
    font-size: 14px !important;
  }

  #erpProducts#erpProducts .purchase-ui-pagination button {
    height: 30px !important;
    min-width: 30px !important;
    font-size: 14px !important;
  }
}

@media (min-width: 1000px) and (max-width: 1350px) {
  #erpProducts#erpProducts#erpProducts.active {
    padding: 7px 10px 14px !important;
  }

  #erpProducts#erpProducts .product-approved-filter {
    grid-template-columns: minmax(105px, .75fr) minmax(105px, .75fr) minmax(95px, .65fr) minmax(190px, 1.4fr) !important;
  }
}
