.erp-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.erp-toolbar .form-input {
  width: auto;
  min-width: 120px;
}
.erp-search {
  flex: 1;
  min-width: 170px !important;
}
.erp-tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
  margin: 0 0 16px;
  padding: 2px 0;
}
.erp-tabs button {
  white-space: nowrap;
}
.erp-tabs button[aria-current="true"] {
  background: var(--navy);
  color: #fff;
}
.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.erp-table th {
  font-weight: 700;
  color: #827352;
  text-align: left;
  background: #f2ebd9;
  white-space: nowrap;
}
.erp-table td,
.erp-table th {
  padding: 12px 14px;
  border-bottom: 1px solid #e9e2d3;
  vertical-align: middle;
}
.erp-table td.num,
.erp-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.erp-table tbody tr:last-child td {
  border-bottom: 0;
}
.erp-table tbody tr[data-click] {
  cursor: pointer;
}
.erp-table tbody tr[data-click]:hover {
  background: #f7f1e5;
}
.erp-table .sub {
  display: block;
  color: #8a8b87;
  font-size: 10px;
  margin-top: 3px;
}
.erp-table .erp-title {
  font-weight: 750;
  color: var(--navy);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.erp-empty {
  padding: 30px 20px;
  color: #8a8a80;
  text-align: center;
  font-size: 12px;
}
.erp-kpis {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.erp-kpis span {
  border: 1px solid #e3dac7;
  border-radius: 9px;
  background: #fffdf7;
  padding: 10px 12px;
  color: #737b80;
  font-size: 11px;
}
.erp-kpis strong {
  color: var(--navy);
  margin-left: 7px;
}
.erp-note {
  font-size: 11px;
  color: #847e70;
  line-height: 1.6;
  margin: 10px 0;
}
.erp-error {
  padding: 11px;
  background: #fff0e9;
  color: #943e2d;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.erp-dialog {
  width: min(calc(100% - 24px), 960px);
  max-height: 92dvh;
  border: 1px solid #ddd1b7;
  border-radius: 15px;
  padding: 0;
  background: #fffdf7;
  color: #43515d;
  box-shadow: 0 20px 70px #10223944;
}
.erp-dialog::backdrop {
  background: #10223966;
}
.erp-dialog.small {
  width: min(calc(100% - 24px), 540px);
}
.erp-dialog > .modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fffdf7;
  border-bottom: 1px solid #e6ddca;
}
.erp-dialog h2 {
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  color: var(--navy);
}
.erp-body {
  padding: 18px;
}
.erp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.erp-grid .full {
  grid-column: 1/-1;
}
.erp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}
.erp-field label {
  font-weight: 700;
  color: #68717a;
}
.erp-field .form-input {
  width: 100%;
  font-size: 12px;
}
.erp-field textarea {
  min-height: 65px;
  padding: 9px;
}
.erp-dialog input[readonly] {
  background: #f2eee4;
  color: #7c7f80;
}
.erp-lines {
  margin: 16px 0;
  display: grid;
  gap: 8px;
}
.erp-line {
  display: grid;
  grid-template-columns: 90px minmax(140px, 2fr) 76px 76px 102px 70px 32px;
  gap: 6px;
  align-items: end;
  padding: 10px;
  background: #f5f0e4;
  border-radius: 9px;
}
.erp-line .form-input {
  height: 36px;
  min-width: 0;
  padding: 0 7px;
}
.erp-line label {
  font-size: 9px;
  color: #8b806a;
  display: block;
  margin-bottom: 4px;
}
.erp-line .line-extra {
  grid-column: 2/-2;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  color: #8b806a;
}
.erp-line .line-extra input {
  width: 62px;
  height: 28px;
}
.erp-line .line-description {
  grid-column: 1/-1;
  font-size: 11px;
  color: #796e5a;
  overflow-wrap: anywhere;
}
.erp-line-remove {
  width: 30px;
  height: 36px;
  border: 0;
  background: none;
  color: #a26352;
  font-size: 20px;
  cursor: pointer;
}
.erp-total {
  font-size: 13px;
  color: var(--navy);
  font-weight: 750;
  text-align: right;
  padding: 8px 0;
  line-height: 1.8;
}
.erp-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 17px;
}
.erp-actions .form-button {
  margin: 0;
}
.erp-detail-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  color: #8a806c;
  font-size: 11px;
}
.erp-detail-meta span {
  padding: 7px 9px;
  background: #f2ecdd;
  border-radius: 6px;
}
.erp-detail-section {
  font-size: 12px;
  color: var(--navy);
  margin: 19px 0 10px;
}
.erp-status {
  display: inline-block;
  font-size: 10px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #e9efe9;
  color: #4c715e;
  white-space: nowrap;
}
.erp-status.draft {
  background: #f6ead1;
  color: #8f733d;
}
.erp-status.void {
  background: #f8e7df;
  color: #a66050;
}
.erp-pager {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
  font-size: 11px;
  color: #8a816d;
}
.erp-home {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.erp-home button {
  text-align: left;
  padding: 20px;
  background: #fffdf7;
  border: 1px solid #e4dbc6;
  border-radius: 12px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}
.erp-home button small {
  display: block;
  font-size: 11px;
  color: #8a8375;
  font-weight: 400;
  margin-top: 6px;
}
.erp-mapping {
  width: 100%;
  min-width: 200px;
}
.erp-file-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 15px 0;
}
.erp-file-list button {
  text-align: left;
}
.erp-dialog .table-scroll {
  border: 1px solid #e5ddcd;
  border-radius: 10px;
}
.erp-sticky-actions {
  position: sticky;
  bottom: 0;
  background: #fffdf7;
  padding: 12px 0 0;
}
.erp-alert-dot {
  color: #ae6b3e;
}
.erp-account-link {
  background: none;
  border: 0;
  color: var(--navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.erp-check {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: #766e5e;
}
.erp-check input {
  accent-color: var(--navy);
}
.erp-loading {
  padding: 30px;
  text-align: center;
  color: #8a816e;
  font-size: 12px;
}
@media (max-width: 760px) {
  .erp-home {
    grid-template-columns: repeat(2, 1fr);
  }
  .erp-home button {
    padding: 15px;
    font-size: 12px;
  }
  .erp-grid {
    grid-template-columns: 1fr;
  }
  .erp-grid .full {
    grid-column: auto;
  }
  .erp-line {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px;
    gap: 8px;
  }
  .erp-line > .erp-field:first-child {
    grid-column: 1;
  }
  .erp-line > .erp-field:nth-child(2) {
    grid-column: 2/-1;
  }
  .erp-line > .erp-field:nth-child(5) {
    grid-column: 3;
  }
  .erp-line > .erp-field:nth-child(6) {
    grid-column: 4;
  }
  .erp-line .line-extra {
    grid-column: 1/-2;
    flex-wrap: wrap;
  }
  .erp-line-remove {
    grid-column: 4;
    justify-self: end;
  }
  .erp-dialog {
    max-height: 94dvh;
  }
  .erp-body {
    padding: 13px;
  }
  .erp-table td,
  .erp-table th {
    padding: 11px 10px;
  }
  .erp-toolbar .form-input {
    min-width: 100px;
  }
  .erp-toolbar .erp-search {
    width: 100%;
  }
  .erp-dialog .modal-head {
    padding: 14px;
  }
  .erp-dialog .modal-head h2 {
    font-size: 14px;
  }
  .erp-kpis span {
    padding: 8px 10px;
  }
}

.erp-line.production {
  grid-template-columns: 75px minmax(150px, 1fr) 100px 90px 32px;
}
.erp-line.production .line-extra {
  display: none;
}
@media (max-width: 760px) {
  .erp-line.production {
    grid-template-columns: 70px minmax(0, 1fr) 32px;
  }
  .erp-line.production > .erp-field:nth-child(2) {
    grid-column: 2/-1;
  }
  .erp-line.production > .erp-field:nth-child(3) {
    grid-column: 1;
  }
  .erp-line.production > .erp-field:nth-child(4) {
    grid-column: 2;
  }
  .erp-line.production > .erp-line-remove {
    grid-column: 3;
  }
}
