.rework-management-page {
  background: #eef1f6;
}

.rework-main {
  padding: 12px 20px 18px;
}

.rework-card {
  min-height: calc(100vh - 92px);
  border-radius: 5px;
  background: #fff;
}

.rework-tabs {
  height: 40px;
  padding: 0 20px;
}

.rework-tabs .module-tab {
  margin-right: 28px;
  padding-top: 12px;
  padding-bottom: 10px;
  font-size: 16px;
}

.rework-card__body {
  padding: 16px 20px 20px;
}

.rework-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: #f3f3f3;
}

.rework-filterbar__left,
.rework-filterbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3b455b;
  font-size: 14px;
}

.filter-label__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #7a8294;
  transform: rotate(180deg);
}

.link-action {
  padding: 2px 0;
  color: #1d63ff;
  font-size: 14px;
}

.link-action + .link-action {
  margin-left: 4px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range__label,
.date-range__split {
  color: #3d4658;
  font-size: 14px;
  white-space: nowrap;
}

.date-range input {
  width: 194px;
  min-height: 32px;
  padding: 6px 10px;
  border-color: #dde2ec;
  border-radius: 4px;
  color: #5b6476;
  background: #fff;
}

.rework-select {
  width: 116px;
}

.rework-select select {
  min-height: 32px;
  padding: 6px 28px 6px 10px;
  border-color: #dde2ec;
  border-radius: 4px;
  color: #3f485a;
}

.rework-search {
  width: 208px;
  min-width: 208px;
}

.rework-search input {
  min-height: 32px;
  border-color: #dde2ec;
  border-radius: 4px;
  background: #fff;
}

.rework-table-shell {
  height: calc(100vh - 210px);
  min-height: 520px;
  border-color: #e0e5ee;
  border-radius: 0;
}

.rework-table {
  min-width: 1180px;
}

.rework-table thead th {
  height: 38px;
  padding: 9px 12px;
  background: #d8deea;
  color: #172035;
  font-size: 16px;
  font-weight: 500;
  border-right: 1px solid #cfd6e3;
}

.rework-table tbody td {
  height: 41px;
  padding: 8px 12px;
  border-right: 1px solid #e3e7ef;
  border-bottom: 1px solid #e3e7ef;
  color: #07152b;
  font-size: 15px;
  vertical-align: middle;
}

.rework-table tbody tr {
  cursor: default;
}

.rework-table tbody tr.is-active {
  background: #e1f6ff;
}

.rework-table thead th:nth-child(1),
.rework-table tbody td:nth-child(1) {
  width: 58px;
  text-align: right;
  padding-right: 10px;
}

.rework-table thead th:nth-child(2) {
  width: 210px;
}

.rework-table thead th:nth-child(3) {
  width: 300px;
}

.rework-table thead th:nth-child(4) {
  width: 300px;
}

.rework-table thead th:nth-child(5),
.rework-table thead th:nth-child(6) {
  width: 300px;
}

.rework-table thead th:nth-child(7) {
  width: 300px;
}

.process-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f3f0ff;
  color: #7a67ff;
  font-size: 14px;
  line-height: 1;
}

.process-chip span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #907cff;
}

.rework-strategy-modal__panel {
  width: min(1280px, calc(100vw - 36px));
  margin-top: 5vh;
  border-radius: 10px;
}

.rework-strategy-body {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  height: min(680px, calc(100vh - 190px));
  min-height: 520px;
  background: #f6f8fc;
}

.strategy-station-panel,
.strategy-detail-panel {
  min-height: 0;
  border: 1px solid #e1e6f0;
  border-radius: 8px;
  background: #fff;
}

.strategy-station-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.strategy-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 14px;
}

.strategy-panel-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.strategy-panel-head h4 {
  margin: 0;
  color: #28334a;
  font-size: 15px;
  font-weight: 700;
}

.mini-action-button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
}

.strategy-empty {
  padding: 14px;
  border-radius: 8px;
  background: #f7f9fd;
  color: var(--color-text-faint);
  font-size: 13px;
}

.strategy-station-search {
  min-width: 0;
}

.strategy-station-search input {
  min-height: 32px;
}

.strategy-station-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.strategy-station-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #e2e7f0;
  border-radius: 8px;
  background: #fbfcff;
  text-align: left;
}

.strategy-station-card.is-active {
  border-color: rgba(85, 118, 255, 0.72);
  background: #eef3ff;
}

.strategy-station-card__name {
  min-width: 0;
  color: #2e3851;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-station-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.strategy-station-card__delete {
  color: var(--color-danger);
  font-size: 12px;
}

.strategy-reason-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-right: 6px;
  overflow: auto;
}

.strategy-reason-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e1e6f0;
  border-radius: 8px;
  background: #fff;
}

.strategy-reason-card__head {
  display: block;
}

.strategy-reason-name {
  color: #202a3f;
  font-weight: 700;
}

.strategy-field {
  display: grid;
  gap: 7px;
}

.strategy-field span,
.part-config__head span {
  color: #556079;
  font-size: 13px;
  font-weight: 700;
}

.strategy-field textarea {
  min-height: 68px;
  border-radius: 6px;
  line-height: 1.6;
}

.part-config {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f9fd;
}

.part-config__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.part-table-shell {
  overflow: auto;
}

.part-table {
  min-width: 520px;
}

.part-table th {
  padding: 8px 10px;
  border-bottom: 1px solid #e0e5ee;
  color: #556079;
  font-size: 13px;
  font-weight: 700;
}

.part-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #edf1f7;
}

.part-table th:nth-child(2),
.part-table td:nth-child(2) {
  width: 150px;
}

.part-table th:nth-child(3),
.part-table td:nth-child(3) {
  width: 72px;
  text-align: center;
}

.part-table input {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 6px;
}

.part-table input.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(223, 94, 94, 0.12);
}

.mini-link-button {
  color: var(--color-primary);
  font-size: 13px;
}

.part-empty {
  margin: 0;
  color: var(--color-text-faint);
  font-size: 13px;
}

.rework-strategy-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.strategy-station-picker-panel {
  width: min(620px, calc(100vw - 32px));
  border-radius: 10px;
}

.station-picker-search {
  display: block;
  margin-bottom: 12px;
}

.station-picker-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.station-picker-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fbfcff;
}

.station-picker-card:hover {
  border-color: rgba(85, 118, 255, 0.5);
  background: #f4f7ff;
}

.station-picker-card input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
}

.station-picker-card__text {
  color: #2d3851;
  font-size: 14px;
}

@media (max-width: 1180px) {
  .rework-management-page .primary-nav {
    overflow: auto;
  }

  .rework-strategy-body {
    grid-template-columns: 1fr;
    height: auto;
    max-height: calc(100vh - 190px);
    overflow: auto;
  }

  .strategy-station-panel,
  .strategy-detail-panel {
    min-height: 260px;
  }

  .rework-filterbar {
    align-items: stretch;
    flex-direction: column;
  }

  .rework-filterbar__right {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .rework-card__body {
    padding-inline: 12px;
  }

  .date-range input,
  .rework-select,
  .rework-search {
    width: 100%;
    min-width: 0;
  }

  .date-range {
    width: 100%;
    flex-wrap: wrap;
  }
}
