.erp-section {
  margin-top: 22px;
}
.erp-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.erp-filters > input {
  flex: 1 1 240px;
  width: auto;
}
.erp-filters > select {
  flex: 0 1 180px;
  width: auto;
}
.erp-filters > .btn {
  flex: 0 0 auto;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  white-space: normal;
}
.checkbox-label input {
  width: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
}
.production-stage-bar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
}
.production-stage-bar > span {
  display: block;
  padding: 14px 8px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 12px;
}
.production-stage-bar b {
  display: block;
  font-size: 24px;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.text-danger {
  color: var(--bad);
}
.erp-dialog {
  width: min(1000px, calc(100vw - 24px));
}
.erp-dialog .metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.erp-dialog .metric strong {
  font-size: 24px;
}
.erp-dialog details summary {
  font-weight: 650;
  cursor: pointer;
}
.erp-dialog table {
  min-width: 620px;
}
#productionWorkspace table,
#materialsWorkspace table,
#financeWorkspace table {
  min-width: 760px;
}
#productionWorkspace .table-wrap,
#materialsWorkspace .table-wrap,
#financeWorkspace .table-wrap {
  max-width: 100%;
}
#printStatement {
  display: none;
}
@media (max-width: 900px) {
  .production-stage-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .production-stage-bar {
    gap: 6px;
  }
  .production-stage-bar > span {
    padding: 12px 4px;
    font-size: 11px;
  }
  .production-stage-bar b {
    font-size: 21px;
  }
  .erp-filters > select {
    flex: 1 1 160px;
  }
  .erp-filters > .btn {
    flex: 1 1 100px;
  }
  .erp-filters > input {
    flex-basis: 100%;
  }
  .erp-dialog .dialog-footer {
    position: static;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  #printStatement {
    display: block !important;
    color: #111;
    background: #fff;
    padding: 16px;
    font-size: 12px;
  }
  #printStatement table {
    width: 100%;
    border-collapse: collapse;
  }
  #printStatement th,
  #printStatement td {
    padding: 7px;
    border: 1px solid #999;
    color: #111;
    background: #fff;
  }
}

#crmWorkspace table {
  min-width: 720px;
}
.crm-content {
  white-space: normal !important;
  min-width: 200px;
  max-width: 340px;
  overflow-wrap: anywhere;
}
.crm-history {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.crm-note,
.crm-report {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.crm-report {
  font: inherit;
  padding: 18px;
  background: var(--soft);
  border-radius: 8px;
}
.crm-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crm-dialog h3 {
  margin-top: 24px;
}

.workspace-tabs button {
  padding: 9px 13px;
  font-size: 13px;
}
.op-wrap {
  white-space: normal !important;
  overflow-wrap: anywhere;
  max-width: 320px;
}
.order-advanced {
  grid-column: 1/-1;
  font-size: 12px;
  color: var(--muted);
}
.order-advanced summary {
  cursor: pointer;
  padding: 3px 0;
}
.order-advanced .grid2 {
  margin-top: 10px;
}
.order-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.order-action-bar {
  flex-wrap: wrap;
  padding-bottom: 12px;
}
.payment-paid {
  color: var(--ok) !important;
}
.payment-unpaid,
.payment-partial {
  color: var(--warn) !important;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px 16px;
}
#catalogWorkspace table,
#outsourcingWorkspace table,
#performanceWorkspace table,
#permissionWorkspace table,
#businessImportPreview table {
  min-width: 760px;
}
.file-select {
  position: relative;
  cursor: pointer;
}
.file-select input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.import-result {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.import-result .production-stage-bar {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)) !important;
}
.operations-dialog .row > input {
  flex: 1 1 200px;
  min-width: 0;
}
.order-table {
  min-width: 1180px;
}

[hidden] {
  display: none !important;
}

.business-dialog .dialog-heading [data-close] {
  flex-shrink: 0;
  white-space: nowrap;
}
.business-dialog .dialog-heading h2 {
  min-width: 0;
}
.finance-range-filters,
.statement-range {
  align-items: end;
  margin-bottom: 8px;
}
.finance-range-filters .field,
.statement-range .field {
  margin-bottom: 0;
}
.finance-range-filters + .help-text {
  margin-block: 8px 0;
}
.business-dialog .dialog-heading {
  flex-wrap: wrap;
}
.business-dialog .dialog-heading > h2,
.business-dialog .dialog-heading > div {
  flex: 1 1 min(100%, 180px);
  min-width: 0;
}
.business-dialog .dialog-heading [data-close] {
  margin-left: auto;
}
