#factoryProduction .section-head { flex-wrap: wrap; }
#factoryProduction .factory-export { flex: none; white-space: nowrap; }
.factory-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  padding: 14px;
  margin: 12px 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.factory-filters label { display: grid; gap: 5px; width: min(100%, 155px); }
.factory-filters .factory-code-filter { width: min(100%, 220px); }
.factory-filters input,
.factory-filters select { width: 100%; min-width: 0; }
.factory-order-code { font-weight: 750; font-variant-numeric: tabular-nums; }
.factory-check { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; }
.factory-check input { width: auto; margin: 0; }
.factory-results small,
#ordersList .factory-risk { display: block; margin-top: 4px; }
.factory-results .factory-product { max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.factory-results .factory-material { max-width: 210px; white-space: normal; overflow-wrap: anywhere; }
.factory-risk { display: inline-block; padding: 2px 7px; border-radius: 4px; font-weight: 700; }
.factory-risk.orange { background: #fff0db; color: #8a4203; }
#ordersList .order-urgent-row td:first-child { color: #991b25; }
.factory-risk.red { background: #fce8e8; color: #991b25; }
.factory-dialog {
  width: min(440px, calc(100vw - 36px));
  max-width: 100%;
  max-height: calc(100vh - 36px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}
.factory-dialog::backdrop { background: rgba(14, 26, 43, .48); }
.factory-dialog-order { color: var(--muted); overflow-wrap: anywhere; }

.factory-results .factory-completion-action {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 112px;
  background: var(--surface);
  box-shadow: -1px 0 var(--line);
}
.factory-results th.factory-completion-action { background: #edf1f5; }
.factory-results .factory-waiting { max-width: 115px; color: var(--warning); white-space: normal; }
.factory-filters .sourcing-filter { width: min(100%, 120px); }
