.erp-list-page,
.erp-detail-page {
  min-width: 0;
  color: #16243d;
}

.erp-query-toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(132px, 170px) minmax(132px, 170px) minmax(132px, 1fr) minmax(118px, 0.9fr) minmax(135px, 1.25fr) auto auto;
  align-items: end;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid #dbe6f1;
  border-radius: 12px;
  background: #fff;
}

.erp-filter-field {
  min-width: 0;
}

.erp-filter-field label {
  display: block;
  margin-bottom: 8px;
  color: #45556f;
  font-size: 13px;
  font-weight: 700;
}

.erp-filter-field input,
.erp-filter-field select,
.erp-pagination select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #fff;
  color: #263751;
  font: inherit;
  outline: none;
}

.erp-filter-field input:focus,
.erp-filter-field select:focus,
.erp-pagination select:focus {
  border-color: #2f7de9;
  box-shadow: 0 0 0 3px rgba(47, 125, 233, 0.12);
}

.erp-query-submit,
.erp-query-reset {
  min-width: 88px;
  height: 42px;
  margin: 0;
  border-radius: 8px;
}

.erp-result-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 12px 4px;
}

.erp-result-total {
  padding-right: 22px;
  border-right: 1px solid #dfe7f0;
  color: #52647d;
  font-size: 14px;
}

.erp-result-total strong {
  color: #1970dd;
  font-size: 18px;
}

.erp-quick-filter-groups {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 22px;
}

.erp-quick-filter-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.erp-quick-filter-group > span {
  flex: 0 0 auto;
  color: #6a7a90;
  font-size: 12px;
  font-weight: 750;
}

.erp-status-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-status-filters button {
  min-width: 94px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  color: #53647b;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.erp-status-filters button b {
  margin-left: 4px;
  color: #394b63;
  font-weight: 700;
}

.erp-status-filters button.is-active {
  border-color: #73aaf3;
  background: #f4f8ff;
  color: #176fdc;
  box-shadow: 0 0 0 2px rgba(47, 125, 233, 0.08);
}

.erp-status-filters button.is-approved {
  color: #149354;
}

.erp-status-filters button.is-pending {
  color: #ea5a23;
}

.erp-status-filters button.is-not-stored {
  color: #d97706;
}

.erp-status-filters button.is-stored {
  color: #087f8c;
}

.erp-status-filters button.is-shipped {
  color: #176fdc;
}

.erp-wide-table-wrap {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #dce6f0;
  border-radius: 12px;
  background: #fff;
  scrollbar-color: #9fadc0 #edf2f7;
  scrollbar-width: thin;
}

.erp-wide-table-wrap:focus {
  outline: 3px solid rgba(47, 125, 233, 0.12);
  outline-offset: 2px;
}

.erp-wide-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.erp-wide-table-wrap::-webkit-scrollbar-track {
  background: #edf2f7;
}

.erp-wide-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #edf2f7;
  border-radius: 999px;
  background: #9fadc0;
}

.erp-wide-table {
  width: 100%;
  min-width: 1560px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #26364e;
}

.erp-wide-table th,
.erp-wide-table td {
  overflow: hidden;
  padding: 0 14px;
  border-bottom: 1px solid #e6edf5;
  background: #fff;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-wide-table th {
  height: 46px;
  color: #42546d;
  font-weight: 750;
}

.erp-wide-table td {
  height: 60px;
}

.erp-wide-table tbody tr:last-child td {
  border-bottom: 0;
}

.erp-wide-table tbody tr:hover td {
  background: #f8fbff;
}

.erp-wide-table .erp-table-groups th {
  height: 42px;
  border-bottom: 1px solid #dfe8f2;
  background: #f8fafc;
  color: #34465f;
  font-size: 13px;
  text-align: center;
}

.erp-wide-table .erp-table-groups th:not(:last-child) {
  border-right: 1px solid #dfe8f2;
}

.erp-wide-table thead tr:nth-child(2) th:nth-child(4),
.erp-wide-table tbody td:nth-child(4),
.erp-wide-table thead tr:nth-child(2) th:nth-child(10),
.erp-wide-table tbody td:nth-child(10) {
  border-right: 1px solid #dfe8f2;
}

.erp-wide-table col:nth-child(1) { width: 125px; }
.erp-wide-table col:nth-child(2) { width: 125px; }
.erp-wide-table col:nth-child(3) { width: 170px; }
.erp-wide-table col:nth-child(4) { width: 95px; }
.erp-wide-table col:nth-child(5) { width: 115px; }
.erp-wide-table col:nth-child(6) { width: 85px; }
.erp-wide-table col:nth-child(7) { width: 105px; }
.erp-wide-table col:nth-child(8) { width: 85px; }
.erp-wide-table col:nth-child(9) { width: 80px; }
.erp-wide-table col:nth-child(10) { width: 60px; }
.erp-wide-table col:nth-child(11) { width: 95px; }
.erp-wide-table col:nth-child(12),
.erp-wide-table col:nth-child(13),
.erp-wide-table col:nth-child(14) { width: 105px; }
.erp-wide-table col:nth-child(15) { width: 105px; }

.erp-wide-table .erp-sticky-id {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 1px 0 0 #dfe8f2;
}

.erp-wide-table thead .erp-sticky-id {
  z-index: 4;
  background: #fff;
}

.erp-wide-table td strong {
  color: #263c5a;
  font-weight: 750;
}

.erp-wide-table .is-number,
.erp-wide-table .is-date,
.erp-wide-table th:nth-child(n+9):nth-child(-n+14) {
  text-align: center;
}

.erp-audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.erp-audit-status.is-approved {
  background: #ecfbf2;
  color: #10934d;
}

.erp-audit-status.is-pending {
  background: #fff5ed;
  color: #ed5d21;
}

.erp-audit-status.is-other {
  background: #edf5ff;
  color: #1671e8;
}

.erp-row-action {
  text-align: center !important;
}

.erp-row-action button,
.erp-back-button {
  border: 0;
  background: transparent;
  color: #1671e8;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.erp-row-action button:hover,
.erp-back-button:hover {
  color: #075bbb;
  text-decoration: underline;
}

.erp-table-state {
  display: flex;
  min-height: 210px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #75859a;
  text-align: center;
}

.erp-table-state.is-loading {
  color: #256fcb;
}

.erp-table-state.is-error {
  flex-direction: column;
  color: #c23c42;
}

.erp-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
}

.erp-pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #d9e3ee;
  border-radius: 7px;
  background: #fff;
  color: #52627a;
  cursor: pointer;
  font: inherit;
}

.erp-pagination button.is-active {
  border-color: #1671e8;
  background: #1671e8;
  color: #fff;
}

.erp-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.erp-pagination span {
  color: #64748b;
}

.erp-pagination select {
  width: 104px;
  height: 34px;
  margin-left: 6px;
  padding: 0 9px;
  font-size: 12px;
}

.erp-detail-page {
  max-width: 1480px;
  margin: 0 auto;
}

.erp-back-button {
  margin: 0 0 14px;
  padding: 0;
}

.erp-detail-title {
  margin-bottom: 18px;
}

.erp-detail-title p {
  margin: 0 0 8px;
  color: #1d2d47;
  font-size: 20px;
  font-weight: 800;
}

.erp-detail-title > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.erp-detail-title h3 {
  margin: 0;
  color: #10254a;
  font-size: 34px;
  letter-spacing: 0.03em;
}

.erp-detail-title small {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 14px;
}

.erp-detail-section {
  margin-top: 12px;
  padding: 20px 22px;
  border: 1px solid #dce6f0;
  border-radius: 12px;
  background: #fff;
}

.erp-detail-section h4 {
  margin: 0 0 16px;
  color: #172944;
  font-size: 17px;
}

.erp-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 46px;
  margin: 0;
}

.erp-detail-fields.is-three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.erp-detail-fields div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: baseline;
  min-width: 0;
}

.erp-detail-fields dt {
  color: #718096;
  font-size: 13px;
}

.erp-detail-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #263751;
  font-size: 14px;
  font-weight: 700;
}

.erp-related-note,
.erp-status-note,
.erp-readonly-note {
  margin: 14px 0 0;
  color: #7a899d;
  font-size: 12px;
}

.erp-detail-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.erp-detail-status-grid > div {
  padding: 15px 16px;
  border: 1px solid #dfe7f0;
  border-left: 4px solid #aab7c6;
  border-radius: 9px;
  background: #fbfcfe;
}

.erp-detail-status-grid span,
.erp-detail-status-grid strong {
  display: block;
}

.erp-detail-status-grid span {
  color: #40516a;
  font-size: 13px;
  font-weight: 750;
}

.erp-detail-status-grid strong {
  margin-top: 5px;
  color: #8090a3;
  font-size: 13px;
}

.erp-detail-status-grid > div.is-done {
  border-color: #c8ead6;
  border-left-color: #10a652;
  background: #f4fcf7;
}

.erp-detail-status-grid > div.is-done strong {
  color: #10934d;
}

.erp-detail-status-message {
  padding: 24px;
  border: 1px dashed #cfdbe8;
  border-radius: 9px;
  background: #f8fbff;
  color: #5d718b;
  text-align: center;
}

.erp-detail-status-message.is-error {
  border-color: #efc7c9;
  background: #fff8f8;
  color: #b73740;
}

.erp-readonly-note {
  padding: 0 4px 18px;
}

@media (max-width: 1380px) {
  .erp-query-toolbar {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .erp-filter-field.is-order-id {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .erp-query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }

  .erp-filter-field.is-order-id {
    grid-column: 1 / -1;
  }

  .erp-query-submit,
  .erp-query-reset {
    width: 100%;
  }

  .erp-result-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .erp-result-total {
    border-right: 0;
  }

  .erp-quick-filter-groups {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .erp-quick-filter-group,
  .erp-status-filters {
    width: 100%;
  }

  .erp-status-filters {
    overflow-x: auto;
  }

  .erp-detail-fields,
  .erp-detail-fields.is-three-column,
  .erp-detail-status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .erp-query-toolbar {
    grid-template-columns: 1fr;
  }

  .erp-filter-field.is-order-id {
    grid-column: auto;
  }

  .erp-detail-title h3 {
    font-size: 27px;
  }

  .erp-detail-fields div {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}
