/* Purchase orders */
.purchase-order-modal {
  width: min(1560px, calc(100vw - 24px));
  height: min(900px, 94vh);
  max-height: 94vh;
}

.purchase-order-modal-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 14px;
}

.purchase-order-modal-heading h2 {
  flex: 0 0 auto;
}

.purchase-order-modal-status {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-modal-status.is-saving { color: var(--blue); }
.purchase-order-modal-status.is-saved { color: var(--accent); }
.purchase-order-modal-status.is-error { color: var(--red); }

.purchase-order-modal-body {
  display: flex;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.purchase-order-editor {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
}

.purchase-order-source-note {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1.58fr);
  align-items: center;
  gap: 18px;
  padding: 11px 14px;
  border: 1px solid #b8cde6;
  border-left: 5px solid var(--accent);
  border-radius: 7px;
  background: #f1f6fc;
}

.purchase-order-source-note > div {
  display: grid;
  gap: 2px;
}

.purchase-order-source-note strong {
  font-size: 18px;
}

.purchase-order-source-note p {
  margin: 0;
  color: #294d73;
  line-height: 1.4;
}

.purchase-order-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) minmax(180px, 0.65fr) minmax(220px, 0.75fr);
  gap: 8px;
}

.purchase-order-controls > label,
.purchase-order-catalog-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-order-status-control .check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
}

.purchase-order-status-control input,
.purchase-order-item-check {
  width: 18px;
  height: 18px;
}

.purchase-order-controls select,
.purchase-order-controls input[type="date"],
.purchase-order-catalog-toolbar input,
.purchase-order-planning-controls select,
.purchase-order-planning-controls input,
.purchase-order-days-control > input {
  min-height: 34px;
  padding: 5px 8px;
}

.purchase-order-workspace-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border: 1px solid #a9c8d5;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  background: #f1f8fb;
}

.purchase-order-workspace-draft > div {
  display: grid;
  gap: 2px;
}

.purchase-order-workspace-draft strong {
  color: var(--ink);
  font-size: 13px;
}

.purchase-order-workspace-draft span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-order-workspace-draft.is-error {
  border-color: #d99a9f;
  border-left-color: var(--red);
  background: #fff1f2;
}

.purchase-order-workspace-draft.is-error span {
  color: #7f1d2d;
  font-weight: 700;
}

.purchase-order-workspace-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.purchase-order-workspace-review span {
  line-height: 1.35;
}

.purchase-order-editor .notice.error {
  padding: 10px 12px;
  border: 1px solid #d99a9f;
  border-left: 5px solid var(--red);
  border-radius: 7px;
  background: #fff1f2;
  color: #7f1d2d;
  font-weight: 750;
}

.purchase-order-empty-state,
.purchase-order-editor > .loading-state {
  display: grid;
  flex: 1;
  place-content: center;
  gap: 6px;
  min-height: 240px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.purchase-order-empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.purchase-order-catalog-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
}

.purchase-order-catalog-toolbar label {
  flex: 1;
}

.purchase-order-catalog-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.purchase-order-catalog-mode button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.purchase-order-catalog-mode button.active {
  border-color: #79b5a8;
  background: #ffffff;
  color: var(--accent);
}

.purchase-order-planning-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(235px, 1.08fr) minmax(235px, 1.08fr) minmax(100px, 0.46fr) minmax(250px, 0.95fr) minmax(145px, 0.56fr);
  gap: 7px;
  align-items: end;
  padding: 7px;
  border: 1px solid #c7dce4;
  border-radius: 7px;
  background: #f7fbfc;
}

.purchase-order-planning-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-order-yoy-controls {
  display: grid;
  grid-template-columns: minmax(124px, 1fr) minmax(96px, 0.76fr);
  gap: 7px;
  align-items: end;
  min-width: 0;
}

.purchase-order-yoy-controls label {
  min-width: 0;
}

.purchase-order-planning-controls .purchase-order-yoy-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding-bottom: 1px;
  color: var(--ink);
}

.purchase-order-yoy-toggle input {
  margin: 0;
}

.purchase-order-yoy-toggle span {
  line-height: 1.1;
}

.purchase-order-days-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.purchase-order-days-field:has([data-purchase-order-days-target="history"]),
.purchase-order-days-field:has([data-purchase-order-days-target="coverage"]) {
  padding: 0 7px 7px;
  border: 1px solid var(--purchase-order-days-border, var(--line));
  border-inline-start: 3px solid var(--purchase-order-days-accent, var(--line-strong));
  border-radius: 7px;
  background: var(--purchase-order-days-surface, var(--panel-soft));
}

.purchase-order-days-field:has([data-purchase-order-days-target="history"]) {
  --purchase-order-days-accent: var(--blue);
  --purchase-order-days-border: color-mix(in srgb, var(--blue) 32%, var(--line));
  --purchase-order-days-surface: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.purchase-order-days-field:has([data-purchase-order-days-target="coverage"]) {
  --purchase-order-days-accent: var(--accent);
  --purchase-order-days-border: color-mix(in srgb, var(--accent) 32%, var(--line));
  --purchase-order-days-surface: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.purchase-order-days-field legend {
  margin: 0 0 5px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-order-days-control {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.purchase-order-days-control > input {
  min-width: 0;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.purchase-order-day-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(34px, 1fr));
  gap: 4px;
}

.purchase-order-day-preset {
  min-width: 0;
  min-height: 30px;
  padding: 3px 5px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.purchase-order-day-preset.is-active {
  border-color: #79b5a8;
  background: #e8f5f1;
  color: var(--accent);
}

.purchase-order-days-field:has([data-purchase-order-days-target="history"])
  .purchase-order-day-preset:is(.is-active, [aria-pressed="true"]) {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--panel);
}

.purchase-order-days-field:has([data-purchase-order-days-target="coverage"])
  .purchase-order-day-preset:is(.is-active, [aria-pressed="true"]) {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--panel);
}

.purchase-order-days-field:has([data-purchase-order-days-target="history"])
  .purchase-order-day-preset:not([aria-pressed="true"]):hover {
  border-color: var(--blue);
  color: var(--blue);
}

.purchase-order-days-field:has([data-purchase-order-days-target="coverage"])
  .purchase-order-day-preset:not([aria-pressed="true"]):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.purchase-order-day-preset:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.purchase-order-days-field:has([data-purchase-order-days-target="history"])
  .purchase-order-days-control > input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent);
}

.purchase-order-days-field:has([data-purchase-order-days-target="coverage"])
  .purchase-order-days-control > input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.purchase-order-planning-controls button {
  min-height: 34px;
}

.purchase-order-selected-planning {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(180px, 230px) max-content max-content;
  align-items: end;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.purchase-order-selected-planning > div,
.purchase-order-selected-planning label {
  display: grid;
  gap: 3px;
}

.purchase-order-selected-planning > div > span,
.purchase-order-selected-planning label > span {
  color: var(--muted);
  font-size: 11px;
}

.purchase-order-selected-planning label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.purchase-order-catalog-scroll {
  flex: 1;
  min-height: 200px;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.purchase-order-catalog-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.purchase-order-catalog-table .po-col-add { width: 34px; }
.purchase-order-catalog-table .po-col-item { width: 20%; }
.purchase-order-catalog-table .po-col-vendor { width: 8%; }
.purchase-order-catalog-table .po-col-sold { width: 52px; }
.purchase-order-catalog-table .po-col-on-hand { width: 62px; }
.purchase-order-catalog-table .po-col-due { width: 52px; }
.purchase-order-catalog-table .po-col-unit { width: 66px; }
.purchase-order-catalog-table .po-col-cost { width: 104px; }
.purchase-order-catalog-table .po-col-plan { width: 104px; }
.purchase-order-catalog-table .po-col-suggested { width: 92px; }
.purchase-order-catalog-table .po-col-order { width: 142px; }
.purchase-order-catalog-table .po-col-history { width: 38px; }

.purchase-order-catalog-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  padding: 5px 4px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-catalog-table .select-column {
  width: 34px;
  text-align: center;
}

.purchase-order-catalog-table td {
  min-width: 0;
  padding: 4px;
  overflow: hidden;
  vertical-align: middle;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-catalog-table tbody tr {
  height: 44px;
}

.purchase-order-item-cell {
  white-space: normal !important;
}

.purchase-order-item-cell > button,
.purchase-order-item-cell > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-vendor-cell {
  vertical-align: top !important;
  padding-top: 6px !important;
}

.purchase-order-item-cell > span {
  color: var(--muted);
  font-size: 11px;
}

.purchase-order-unit-cell,
.purchase-order-cost-cell,
.purchase-order-suggested-summary {
  white-space: nowrap;
}

.purchase-order-cost-cell > span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
}

.purchase-order-catalog-table tr.needs-review td {
  background: #fff8e8;
}

.purchase-order-catalog-table tr.needs-review .purchase-order-qty-helper {
  color: #775515;
  font-weight: 700;
}

.purchase-order-catalog-table .link-button[disabled] {
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
  text-decoration: none;
}

.purchase-order-catalog-table button.compact {
  min-height: 30px;
  padding: 3px 6px;
}

.purchase-order-stock-summary,
.purchase-order-suggested-summary {
  display: grid;
  gap: 2px;
  min-width: 92px;
}

.purchase-order-stock-summary small,
.purchase-order-stock-summary span,
.purchase-order-suggested-summary small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.purchase-order-details-button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 30px !important;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  line-height: 1.15;
  text-align: left;
}

.purchase-order-details-button span,
.purchase-order-details-button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.purchase-order-details-button span {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.purchase-order-history-button {
  width: 30px;
  min-width: 30px;
  padding: 2px !important;
  font-size: 16px;
}

.purchase-order-suggestion-status:empty {
  display: none;
}

.purchase-order-suggestion-status .notice {
  margin: 0;
  padding: 8px 10px;
}

.purchase-order-suggestion-progress,
.purchase-order-suggestion-complete {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #b9cfdf;
  border-radius: 6px;
  background: #f3f8fc;
  color: #24445f;
  font-size: 12px;
}

.purchase-order-suggestion-progress > div:not(.purchase-order-suggestion-progress-bar) {
  display: grid;
  gap: 1px;
}

.purchase-order-suggestion-progress strong {
  color: #173b5c;
}

.purchase-order-suggestion-progress-bar {
  position: relative;
  flex: 0 0 82px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8e5ef;
}

.purchase-order-suggestion-progress-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  border-radius: inherit;
  background: var(--accent);
  animation: purchase-order-suggestion-progress 1.1s ease-in-out infinite;
}

.purchase-order-suggestion-elapsed {
  margin-left: auto;
  color: #526d84;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.purchase-order-suggestion-complete {
  min-height: 30px;
  border-color: #bdd9c8;
  background: #f3faf5;
  color: #376348;
}

@keyframes purchase-order-suggestion-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(230%); }
}

.purchase-order-line-planning-panel {
  flex: 0 0 auto;
  max-height: min(420px, 55vh);
  overflow: auto;
  border: 1px solid #b8cde6;
  border-left: 5px solid var(--accent);
  border-radius: 7px;
  background: #f7faff;
}

.purchase-order-line-planning-panel[hidden] {
  display: none;
}

.purchase-order-line-planning-form {
  display: grid;
  gap: 10px;
  padding: 11px 13px;
}

.purchase-order-line-planning-heading,
.purchase-order-line-planning-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.purchase-order-line-planning-heading h4 {
  margin: 1px 0 0;
  font-size: 15px;
}

.purchase-order-line-planning-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.purchase-order-line-planning-content {
  display: grid;
  grid-template-columns: minmax(270px, 0.7fr) minmax(0, 1.5fr);
  align-items: start;
  gap: 14px;
}

.purchase-order-line-days-editors,
.purchase-order-line-days-editor {
  display: grid;
  gap: 6px;
}

.purchase-order-line-days-editor > small,
.purchase-order-line-inheritance small {
  color: var(--muted);
  line-height: 1.3;
}

.purchase-order-line-days-editor .purchase-order-days-field {
  padding: 0 7px 7px;
  border: 1px solid var(--purchase-order-days-border, var(--line));
  border-inline-start: 3px solid var(--purchase-order-days-accent, var(--line-strong));
  border-radius: 7px;
  background: var(--purchase-order-days-surface, var(--panel-soft));
}

.purchase-order-line-history-editor {
  --purchase-order-days-accent: var(--blue);
  --purchase-order-days-border: color-mix(in srgb, var(--blue) 32%, var(--line));
  --purchase-order-days-surface: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.purchase-order-line-coverage-editor {
  --purchase-order-days-accent: var(--accent-dark);
  --purchase-order-days-border: color-mix(in srgb, var(--accent-dark) 32%, var(--line));
  --purchase-order-days-surface: color-mix(in srgb, var(--accent-dark) 8%, var(--panel));
}

.purchase-order-line-history-editor .purchase-order-day-preset:is(.is-active, [aria-pressed="true"]) {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--panel);
}

.purchase-order-line-coverage-editor .purchase-order-day-preset:is(.is-active, [aria-pressed="true"]) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: var(--panel);
}

.purchase-order-line-history-editor .purchase-order-days-control > input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent);
}

.purchase-order-line-coverage-editor .purchase-order-days-control > input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-dark) 20%, transparent);
}

.purchase-order-line-inheritance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.purchase-order-calculation-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr));
  gap: 5px;
  margin: 0;
}

.purchase-order-calculation-breakdown > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.purchase-order-calculation-breakdown > div.is-result {
  border-color: #9abbe2;
  background: #edf4fd;
}

.purchase-order-calculation-breakdown dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.purchase-order-calculation-breakdown dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.purchase-order-calculation-breakdown dd small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.purchase-order-line-planning-message {
  margin: 0;
}

.purchase-order-line-warnings {
  margin: 0;
  padding-left: 20px;
  color: #775515;
  font-size: 11px;
}

.purchase-order-line-planning-actions {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.purchase-order-line-planning-actions > span {
  color: var(--muted);
  font-size: 11px;
}

.purchase-order-qty {
  width: 56px;
  min-width: 56px;
}

.purchase-order-qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.purchase-order-unit-select {
  width: 70px;
  min-width: 70px;
}

.purchase-order-qty-control input,
.purchase-order-qty-control select {
  min-height: 30px;
  padding: 3px 4px;
  font-size: 12px;
}

.purchase-order-qty-helper {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #775515;
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-preparation-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.purchase-order-preparation-context > div {
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
}

.purchase-order-preparation-context > div:last-child {
  border-right: 0;
}

.purchase-order-prepared-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 11px;
  border: 1px solid #c7d7ea;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #f7faff;
}

.purchase-order-prepared-guidance span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-order-catalog-table tr.is-disabled {
  color: var(--muted);
  background: #f7f8fa;
}

.purchase-order-item-history .item-history-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 4px;
}

.purchase-order-history-presets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 2px;
}

.purchase-order-history-presets button {
  min-height: 36px;
  padding: 7px 10px;
}

.purchase-order-history-presets button.active {
  border-color: var(--accent);
  background: #eaf2fc;
  color: #124f98;
}

.purchase-order-history-date-range {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) max-content;
  align-items: end;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
}

.purchase-order-history-date-range label {
  gap: 4px;
  font-size: 11px;
}

.purchase-order-history-date-range input,
.purchase-order-history-date-range button {
  min-height: 36px;
  padding: 7px 9px;
}

.purchase-order-history-modal {
  width: min(960px, 94vw);
}

.purchase-order-history-modal .item-report-modal-body {
  gap: 10px;
  padding: 14px;
}

.purchase-order-history-modal .section-title-row h4 {
  margin: 0;
}

.purchase-order-history-modal .item-history-summary {
  gap: 5px;
}

.purchase-order-history-modal .purchase-order-history-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.purchase-order-history-modal .purchase-order-history-summary strong {
  overflow: visible;
  text-overflow: clip;
}

.purchase-order-history-modal .item-history-summary > div {
  padding: 7px 8px;
}

.grid.two.purchase-order-history-columns {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: start;
  gap: 12px;
}

.purchase-order-history-columns > section {
  min-width: 0;
}

.purchase-order-history-columns .item-report-table-wrap {
  width: 100%;
  overflow-x: hidden;
}

.purchase-order-history-columns table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.purchase-order-history-columns th,
.purchase-order-history-columns td {
  overflow: hidden;
  padding: 9px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-history-columns .link-button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.purchase-order-sales-history-table col:nth-child(1) { width: 20%; }
.purchase-order-sales-history-table col:nth-child(2) { width: 21%; }
.purchase-order-sales-history-table col:nth-child(3) { width: 34%; }
.purchase-order-sales-history-table col:nth-child(4) { width: 10%; }
.purchase-order-sales-history-table col:nth-child(5) { width: 15%; }

.purchase-order-purchase-history-table col:nth-child(1) { width: 20%; }
.purchase-order-purchase-history-table col:nth-child(2) { width: 21%; }
.purchase-order-purchase-history-table col:nth-child(3) { width: 34%; }
.purchase-order-purchase-history-table col:nth-child(4) { width: 10%; }
.purchase-order-purchase-history-table col:nth-child(5) { width: 15%; }

.purchase-order-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.purchase-order-footer-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.purchase-order-footer-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.purchase-order-footer-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-order-footer-total strong {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .purchase-order-catalog-scroll { overflow-x: auto; }
  .purchase-order-catalog-table { min-width: 1060px; }
}

@media (max-width: 1100px) {
  .purchase-order-planning-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-order-planning-controls > button {
    grid-column: 1 / -1;
  }

  .purchase-order-yoy-controls {
    grid-column: 1 / -1;
  }

  .purchase-order-selected-planning {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-order-line-planning-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .purchase-order-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .purchase-order-modal-body {
    overflow-y: auto;
  }

  .purchase-order-editor {
    flex: 0 0 auto;
    width: 100%;
    min-height: 100%;
  }

  .purchase-order-catalog-scroll {
    flex: 0 0 auto;
    max-height: 55vh;
  }

  .purchase-order-source-note,
  .purchase-order-controls,
  .purchase-order-planning-controls,
  .purchase-order-preparation-context {
    grid-template-columns: 1fr;
  }

  .purchase-order-yoy-controls {
    grid-template-columns: 1fr;
  }

  .purchase-order-footer-total {
    padding-left: 0;
    border-left: 0;
  }

  .purchase-order-workspace-draft {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-order-workspace-review {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-order-selected-planning {
    grid-template-columns: 1fr;
  }

  .purchase-order-workspace-draft > button {
    align-self: flex-start;
  }

  .purchase-order-days-control {
    grid-template-columns: minmax(70px, 0.35fr) minmax(0, 1.65fr);
  }

  .purchase-order-calculation-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-order-line-planning-heading,
  .purchase-order-line-planning-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-order-line-inheritance {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-order-preparation-context > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .purchase-order-preparation-context > div:last-child {
    border-bottom: 0;
  }

  .purchase-order-prepared-guidance {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-order-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-order-history-date-range,
  .grid.two.purchase-order-history-columns {
    grid-template-columns: 1fr;
  }

  .purchase-order-item-history .item-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Scheduled vendor ordering and daily PO queue */
.purchase-order-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding: 4px 2px 10px;
}

.purchase-orders-workspace {
  display: grid;
  gap: var(--space-3);
}

.purchase-orders-workspace .workspace-layout {
  grid-template-columns: minmax(0, 1fr) minmax(255px, 0.26fr);
}

.purchase-orders-workspace .purchase-order-workspace-header {
  margin: 0;
  padding: var(--space-1) 2px 0;
}

.purchase-orders-workspace .purchase-order-workspace-tabs {
  gap: var(--space-4);
  margin: 0;
}

.purchase-orders-workspace .purchase-order-workspace-tabs button {
  min-height: var(--control-height);
}

.purchase-orders-list-panel,
.purchase-order-detail-panel {
  overflow: hidden;
}

.purchase-orders-list-panel .panel-body {
  padding: var(--space-3);
}

.purchase-order-filter-bar {
  grid-template-columns: minmax(220px, 1.7fr) minmax(130px, 0.7fr) minmax(140px, 0.72fr) minmax(140px, 0.72fr) auto;
}

.purchase-order-filter-bar label {
  display: grid;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.purchase-order-filter-bar input,
.purchase-order-filter-bar select {
  min-width: 0;
}

.purchase-order-filter-bar .ghost {
  align-self: end;
  white-space: nowrap;
}

.purchase-orders-list-panel .table-wrap {
  max-height: calc(100vh - 366px);
}

.purchase-orders-list-panel table {
  table-layout: fixed;
}

.purchase-orders-list-panel th,
.purchase-orders-list-panel td {
  white-space: nowrap;
}

.purchase-orders-list-panel th:nth-child(1) { width: 118px; }
.purchase-orders-list-panel th:nth-child(2) { width: 28%; }
.purchase-orders-list-panel th:nth-child(3) { width: 132px; }
.purchase-orders-list-panel th:nth-child(4) { width: 124px; }
.purchase-orders-list-panel th:nth-child(5) { width: 104px; }
.purchase-orders-list-panel th:nth-child(6) { width: 62px; }
.purchase-orders-list-panel th:nth-child(7) { width: 100px; }

.po-list-po,
.po-list-expected,
.po-list-action {
  white-space: nowrap;
}

.po-list-vendor {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-order-detail-panel {
  align-self: start;
  min-height: 0;
}

.purchase-order-detail-panel .panel-body {
  padding: var(--space-3);
}

.purchase-order-detail-summary {
  gap: var(--space-3);
}

.purchase-order-detail-keyline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.purchase-order-detail-keyline > div {
  min-width: 0;
}

.purchase-order-detail-keyline span:first-child,
.purchase-order-detail-note > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchase-order-detail-keyline strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
}

.purchase-order-detail-keyline .status {
  flex: 0 0 auto;
}

.purchase-order-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
}

.purchase-order-detail-fields .kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.purchase-order-detail-fields .kv-wide {
  grid-column: 1 / -1;
}

.purchase-order-detail-fields .kv strong,
.purchase-order-detail-note strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.purchase-order-detail-note {
  display: grid;
  gap: 3px;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--blue);
  background: var(--panel-soft);
  font-size: 13px;
}

.purchase-order-detail-summary .inline-actions {
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.purchase-order-detail-summary .purchase-order-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.purchase-order-detail-actions .purchase-order-detail-action {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  justify-content: center;
}

.purchase-order-workspace-header h2,
.vendor-order-schedule-heading h3 {
  margin: 2px 0 0;
  color: #10243e;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.purchase-order-workspace-header p,
.vendor-order-schedule-heading p {
  margin: 3px 0 0;
  color: #627087;
  font-size: 13px;
}

.purchase-order-header-back {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.purchase-order-header-back > button {
  min-width: 38px;
  padding: 7px;
  font-size: 20px;
}

.purchase-order-workspace-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 10px;
  border-bottom: 1px solid #d6dee8;
}

.purchase-order-workspace-tabs button {
  min-height: 38px;
  padding: 7px 2px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #516078;
  font-weight: 750;
}

.purchase-order-workspace-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent-dark);
}

.purchase-order-master-detail {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  align-items: start;
}

.po-queue-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.po-queue-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #d6dee8;
  border-left: 3px solid #8ea1b7;
  border-radius: 6px;
  background: #ffffff;
}

.po-queue-metric span {
  color: #53637a;
  font-size: 12px;
  font-weight: 750;
}

.po-queue-metric strong {
  color: #10243e;
  font-size: 22px;
}

.po-queue-metric.due { border-left-color: var(--accent); }
.po-queue-metric.overdue,
.po-queue-metric.exceptions { border-left-color: #c83b48; }
.po-queue-metric.snoozed { border-left-color: #c27a08; }
.po-queue-metric.drafts { border-left-color: #29915d; }

.po-schedule-setup-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 930px;
}

.po-schedule-setup-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) max-content max-content;
}

.po-queue-table.po-schedule-setup-table {
  table-layout: fixed;
}

.po-queue-table.po-schedule-setup-table th:nth-child(1) { width: 26%; }
.po-queue-table.po-schedule-setup-table th:nth-child(2) { width: 10%; }
.po-queue-table.po-schedule-setup-table th:nth-child(3) { width: 14%; }
.po-queue-table.po-schedule-setup-table th:nth-child(4) { width: 15%; }
.po-queue-table.po-schedule-setup-table th:nth-child(5) { width: 14%; }
.po-queue-table.po-schedule-setup-table th:nth-child(6) { width: 12%; }
.po-queue-table.po-schedule-setup-table th:nth-child(7) { width: 11%; }
.po-queue-table.po-schedule-setup-table th:nth-child(8) { width: 12%; }

.po-queue-table.po-schedule-setup-table th {
  background: #edf5ff;
  color: #1c456f;
}

.po-queue-table.po-schedule-setup-table tbody tr {
  border-left: 3px solid transparent;
  background: #ffffff;
}

.po-queue-table.po-schedule-setup-table tbody tr:hover {
  background: #f6faff;
}

.po-schedule-setup-table td:nth-child(2),
.po-schedule-setup-table td:nth-child(3),
.po-schedule-setup-table td:nth-child(4),
.po-schedule-setup-table td:nth-child(5),
.po-schedule-setup-table td:nth-child(6) {
  color: #354b64;
  font-weight: 650;
}

.po-queue-table.po-schedule-setup-table tr.po-schedule-missing {
  border-left-color: #c27a08;
  background: #fffdf8;
}

.po-queue-table.po-schedule-setup-table tr.po-schedule-missing:hover {
  background: #fff8e9;
}

.po-schedule-setup-table button.compact {
  min-height: 29px;
  padding: 4px 7px;
  font-size: 11px;
}

.po-queue-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.po-queue-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) max-content max-content;
  align-items: end;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid #d6dee8;
  background: #f8fafc;
}

.po-queue-toolbar label {
  display: grid;
  gap: 4px;
  color: #52637a;
  font-size: 11px;
  font-weight: 800;
}

.po-queue-toolbar input,
.po-queue-toolbar select {
  min-height: 38px;
}

.po-queue-toolbar .po-queue-history-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  color: #263a54;
  white-space: nowrap;
}

.po-queue-history-check input {
  min-height: auto;
  width: 17px;
  height: 17px;
}

.po-queue-generated {
  align-self: center;
  color: #6a788c;
  font-size: 12px;
}

.po-queue-panel > .notice {
  margin: 10px 12px 0;
}

.po-queue-table-wrap {
  max-height: calc(100vh - 390px);
  overflow: auto;
}

.po-queue-table {
  width: 100%;
  table-layout: fixed;
}

.po-queue-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2f6;
  color: #263a54;
}

.po-queue-table th:nth-child(1) { width: 42px; }
.po-queue-table th:nth-child(2) { width: 18%; }
.po-queue-table th:nth-child(3) { width: 10%; }
.po-queue-table th:nth-child(4) { width: 13%; }
.po-queue-table th:nth-child(5) { width: 12%; }
.po-queue-table th:nth-child(6) { width: 13%; }
.po-queue-table th:nth-child(7) { width: 11%; }
.po-queue-table th:nth-child(8) { width: 23%; }

.po-queue-table th,
.po-queue-table td {
  padding: 8px 9px;
  vertical-align: middle;
}

.po-queue-table tbody tr {
  border-left: 3px solid transparent;
}

.po-queue-table tbody tr:hover {
  background: #f7faff;
}

.po-queue-table tbody tr.selected {
  border-left-color: var(--accent);
  background: #edf5ff;
}

.po-queue-table tbody tr.is-overdue {
  border-left-color: #c83b48;
}

.po-queue-table td strong,
.po-queue-table td small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.po-queue-table td small {
  margin-top: 2px;
  color: #69788c;
  font-size: 11px;
  line-height: 1.25;
}

.po-queue-table .po-queue-error {
  color: #a52231;
  white-space: normal;
}

.po-queue-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.po-queue-row-actions button.compact {
  min-height: 29px;
  padding: 4px 7px;
  font-size: 11px;
}

.po-queue-empty {
  height: 150px;
  color: #68778b;
  text-align: center;
}

.po-queue-empty strong,
.po-queue-empty span {
  display: block;
  margin: 3px;
}

.po-queue-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-top: 1px solid #d6dee8;
  background: #f8fafc;
}

.po-queue-selection-bar.is-active {
  background: #eef5fd;
}

.po-queue-selection-bar > div:first-child {
  display: grid;
  gap: 2px;
}

.po-queue-selection-bar span {
  color: #65758b;
  font-size: 12px;
}

.vendor-order-schedule-workspace {
  display: grid;
  gap: 10px;
}

.vendor-order-schedule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vendor-order-schedule-heading h3 {
  font-size: 18px;
}

.vendor-order-schedule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vendor-order-schedule-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #d3dce7;
  border-radius: 6px;
  background: #ffffff;
}

.vendor-order-schedule-card.inactive {
  background: #f8fafc;
  opacity: 0.76;
}

.vendor-order-schedule-card-header,
.vendor-order-schedule-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vendor-order-schedule-card-header h4 {
  margin: 0;
  color: #12263f;
  font-size: 15px;
}

.vendor-order-schedule-card-header > div > span {
  color: #66758a;
  font-size: 11px;
}

.vendor-order-schedule-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #e0e6ed;
}

.vendor-order-schedule-facts div {
  min-width: 0;
  padding: 8px 6px 7px 0;
  border-bottom: 1px solid #e0e6ed;
}

.vendor-order-schedule-facts dt {
  color: #68788d;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.vendor-order-schedule-facts dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: #203650;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-order-schedule-card-note {
  margin: 0;
  color: #5e6e82;
  font-size: 12px;
}

.vendor-order-schedule-card-actions {
  justify-content: flex-end;
}

.vendor-order-schedule-empty {
  display: grid;
  grid-column: 1 / -1;
  place-content: center;
  gap: 4px;
  min-height: 170px;
  border: 1px dashed #bdc8d5;
  border-radius: 6px;
  color: #66768b;
  text-align: center;
}

.vendor-order-schedule-empty strong {
  color: #263a54;
}

.vendor-order-schedule-note,
.vendor-order-action-explanation {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f1f6fc;
  color: #52637a;
  font-size: 12px;
}

.vendor-order-schedule-note strong,
.vendor-order-action-explanation strong {
  color: #183755;
}

/* Vendor scheduling and exceptions use the shared Corporate Minimal workspace. */
.vendor-order-schedule-workspace {
  gap: var(--space-3);
}

.vendor-order-schedule-heading {
  min-height: 58px;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.vendor-order-schedule-heading h3 {
  margin: 2px 0 0;
  color: var(--text-primary);
}

.vendor-order-schedule-heading p {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

.vendor-order-schedule-card {
  gap: var(--space-3);
  padding: var(--space-3);
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.vendor-order-schedule-card-header h4,
.vendor-order-schedule-facts dd,
.vendor-order-schedule-note strong,
.vendor-order-action-explanation strong {
  color: var(--text-primary);
}

.vendor-order-schedule-card-header > div > span,
.vendor-order-schedule-facts dt,
.vendor-order-schedule-card-note,
.vendor-order-dialog-intro span,
.vendor-order-form label,
.vendor-order-fieldset label {
  color: var(--text-secondary);
}

.vendor-order-schedule-note {
  padding: var(--space-3);
  border-left-color: var(--accent);
  background: var(--surface-subtle);
}

.vendor-order-schedule-empty {
  min-height: 160px;
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.vendor-order-dialog .modal-header {
  border-bottom-color: var(--line);
}

.vendor-order-dialog-intro,
.vendor-order-dialog-footer {
  border-color: var(--line);
}

.vendor-order-fieldset {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.vendor-order-fieldset legend {
  color: var(--text-primary);
}

.vendor-order-form input:focus,
.vendor-order-form select:focus,
.vendor-order-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.vendor-order-dialog-overlay {
  z-index: 92;
}

.vendor-order-dialog {
  width: min(900px, 96vw);
}

.vendor-order-dialog .modal-body {
  overflow: auto;
  padding: 15px 16px;
}

.vendor-order-form {
  display: grid;
  gap: 12px;
}

.vendor-order-dialog-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d9e0e9;
}

.vendor-order-dialog-intro span {
  color: #66758a;
  font-size: 12px;
}

.vendor-order-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.vendor-order-form label,
.vendor-order-fieldset label {
  display: grid;
  gap: 4px;
  color: #53637a;
  font-size: 11px;
  font-weight: 800;
}

.vendor-order-form .span-all {
  grid-column: 1 / -1;
}

.vendor-order-fieldset {
  display: grid;
  grid-column: span 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #d5dee8;
  border-radius: 6px;
  background: #f9fbfd;
}

.vendor-order-fieldset legend {
  padding: 0 5px;
  color: #21364f;
  font-size: 12px;
  font-weight: 850;
}

.vendor-order-fieldset .vendor-order-active-check {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 7px;
  min-height: 38px;
}

.vendor-order-active-check input {
  width: 17px;
  height: 17px;
}

.vendor-order-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid #d9e0e9;
}

.vendor-order-action-explanation.is-dismiss {
  border-left-color: var(--accent);
  background: #edf4fd;
}

.purchase-order-closeout-dialog {
  gap: 14px;
}

.purchase-order-closeout-dialog .vendor-order-dialog-intro {
  padding: 12px;
  border: 1px solid #d3dfec;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f7faff;
}

.background-operation-tray {
  border-color: #b8cde6;
  border-top: 3px solid var(--accent);
}

.background-operation-tray {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 65;
  width: min(500px, calc(100vw - 32px));
  padding: 13px 14px;
  border: 1px solid #b8c7d8;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(18, 41, 67, 0.23);
}

.background-operation-tray.hidden {
  display: none;
}

.background-operation-header,
.background-operation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.background-operation-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.background-operation-header span {
  color: #5f7086;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.background-operation-header strong {
  overflow: hidden;
  color: #152b45;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.background-operation-progress {
  height: 7px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #dfe7ef;
}

.background-operation-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.background-operation-meta {
  justify-content: flex-start;
  color: #607188;
  font-size: 11px;
}

.background-operation-meta strong {
  margin-right: auto;
  color: #154f96;
  font-size: 13px;
}

.background-operation-details {
  display: none;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid #dce3eb;
  margin-top: 10px;
}

.background-operation-tray.expanded .background-operation-details {
  display: grid;
}

.background-operation-item-list {
  display: grid;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #d9e1ea;
  border-radius: 5px;
}

.background-operation-item-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 4px 10px;
  padding: 7px 8px;
  border-bottom: 1px solid #e2e7ed;
  font-size: 12px;
}

.background-operation-item-list > div:last-child {
  border-bottom: 0;
}

.background-operation-item-list small {
  grid-column: 1 / -1;
  color: #a52231;
}

@media (max-width: 1366px) {
  .po-queue-table th,
  .po-queue-table td {
    padding: 7px 6px;
    font-size: 11px;
  }

  .po-queue-table th:nth-child(8) { width: 21%; }
  .po-queue-row-actions button.compact { padding: 4px 5px; }
}

@media (max-width: 980px) {
  .purchase-order-workspace-header,
  .vendor-order-schedule-heading,
  .po-queue-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-order-master-detail,
  .vendor-order-schedule-list,
  .vendor-order-form-grid,
  .vendor-order-fieldset {
    grid-template-columns: 1fr;
  }

  .purchase-order-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .po-queue-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .po-queue-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .po-queue-table th:nth-child(3),
  .po-queue-table td:nth-child(3) {
    display: none;
  }

  .vendor-order-fieldset {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  .po-queue-summary,
  .po-queue-toolbar,
  .vendor-order-schedule-facts {
    grid-template-columns: 1fr;
  }

  .purchase-order-filter-bar {
    grid-template-columns: 1fr;
  }

  .po-queue-table th:nth-child(5),
  .po-queue-table td:nth-child(5),
  .po-queue-table th:nth-child(6),
  .po-queue-table td:nth-child(6) {
    display: none;
  }

  .vendor-order-dialog-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .background-operation-tray {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}
