/* Desktop layout corrections, shared by the existing page components. */
body.workspace { min-width: 0; }
.workspace #app > main, .workspace .view { min-width: 0; }
.workspace .guide-secret { display: flex; align-items: center; gap: 10px; }
.workspace .guide-secret > span { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.workspace .guide-secret > button { flex: 0 0 auto; min-height: 30px; padding: 3px 10px; white-space: nowrap; }
.workspace .product-test-workspace > .panel { min-width: 0; }
.workspace .product-test-result-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace .product-test-decisions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workspace .product-test-decisions > button { min-width: 0; }

.workspace .notification-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.workspace .notification-form > label:first-child { flex: 1 1 240px; min-width: 0; }
.workspace .notification-form > fieldset { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }
.workspace .notification-form > div { display: flex; flex-wrap: wrap; gap: 8px; }
.workspace .notification-form button { white-space: nowrap; min-height: 40px; }
.workspace .settings-section-head { flex-wrap: wrap; }
.workspace .webhook-settings > form { display: flex; flex-wrap: wrap; align-items: flex-end; }
.workspace .webhook-settings > form > div { flex: 1 1 180px; min-width: 0; }
.workspace .webhook-settings > form > label { flex: 1 1 150px; min-width: 0; }
.workspace .webhook-settings > form > .switch-label { flex: 0 0 auto; }
.workspace .webhook-settings > form > button { flex: 0 0 auto; white-space: nowrap; }

@media (min-width: 761px) {
  .workspace .inventory-table th[data-column="sales"],
  .workspace .inventory-table th[data-column="more"],
  .workspace .product-info-table th[data-column="more"] {
    text-align: center;
  }
  .workspace .top-sku-table th:nth-child(2) { text-align: center; }

  .workspace .po-table th:nth-child(n+8),
  .workspace .po-table td:nth-child(n+8),
  .workspace .po-item-table th:nth-child(n+3),
  .workspace .po-item-table td:nth-child(n+3) {
    text-align: center;
  }

  .workspace .view .sales-record-filters {
    /* The former fixed grid is important in the base stylesheet. */
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
  }
  .workspace .sales-record-filters > label { min-width: 0; }
  .workspace .sales-record-filters > label:has(input[type="date"]) {
    flex: 0 0 138px;
    width: 138px;
  }
  .workspace .sales-record-filters input[type="date"] {
    width: 100%;
    min-width: 0;
  }
  .workspace .sales-record-filters > label:has(#sales-record-status) { flex: 0 0 118px; }
  .workspace .sales-record-filters > label:has(#sales-record-page-size) { flex: 0 0 105px; }
  .workspace .sales-record-filters > .search-field { flex: 1 1 260px; }
  .workspace.compact :is(.sales-record-filters, .sales-filters) .date-presets {
    flex: 0 0 auto;
    padding: 0;
    min-height: 36px;
    height: 36px;
  }
  .workspace.compact :is(.sales-record-filters, .sales-filters) .date-presets button {
    height: 36px;
    min-height: 36px;
  }

  .workspace.compact #finance-report-view #finance-reset,
  .workspace.compact #returns-view .returns-filter-actions > button {
    height: 36px;
    min-height: 36px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .workspace #customer-accounts-view > .filterbar,
  .workspace #customer-audit-view > .filterbar { margin-bottom: 16px; }
  .workspace #customer-accounts-view .customer-table :is(th, td):last-child { text-align: center; }
  .workspace #customer-audit-view .customer-table :is(th, td):first-child { width: 220px; }
  .workspace #customer-audit-view .customer-table td:first-child { white-space: nowrap; }
  .workspace #po-sync-note { margin: 12px 0; }
  .workspace #cargo-losses-view .loss-filters :is(input, select, button) {
    height: 40px;
    min-height: 40px;
  }
  .workspace #overseas-history-content { padding: 16px 20px 20px; }
  .workspace .po-table td[colspan],
  .workspace .loss-table td[colspan] {
    text-align: center;
    padding-top: 28px;
    padding-bottom: 28px;
    color: var(--muted, #66768f);
  }
}

@media (max-width: 760px) {
  .workspace .product-test-workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace .view .sales-record-filters { display: flex !important; flex-wrap: wrap; gap: 10px; }
  .workspace .sales-record-filters > label { flex: 1 1 128px; min-width: 0; width: auto; }
  .workspace .sales-record-filters > .search-field { flex-basis: 100%; }
  .workspace .sales-record-filters .date-presets { display: flex; flex-wrap: wrap; flex-basis: 100%; min-width: 0; height: auto; }
  .workspace .sales-record-filters :is(input, select) { min-width: 0; width: 100%; }
  .workspace .notification-settings { min-width: 0; padding: 16px; }
  .workspace .notification-status { grid-template-columns: minmax(0, 1fr); }
  .workspace .notification-row { grid-template-columns: minmax(0, 1fr) auto; }
  .workspace .notification-row > small { grid-column: 1 / -1; }
}

@media(min-width:761px){
.workspace .competition-table thead th[data-column="product"],.workspace .overseas-inventory-table thead th:first-child,.workspace .repricing-table thead th:first-child{text-align:center}
.workspace .product-label-select-heading{display:grid;grid-template-columns:18px minmax(0,1fr) 18px;align-items:center;gap:8px;width:100%}
.workspace .product-label-select-heading>span{text-align:center}
}
