/* 工厂分支按行展示，方便逐个浏览和进入详情。 */
.npd-branch-choice-list {
  grid-template-columns: 1fr;
  gap: .55rem;
}

/* 新品开发工作台：概览、工厂选择和样品线按同一阅读路径排列。 */
.npd-branch-workspace {
  overflow: hidden;
  border-radius: 10px;
}

.npd-branch-overview {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: .9rem 1.4rem;
}

.npd-branch-overview h3 {
  font-size: 1rem;
  white-space: nowrap;
}

.npd-branch-overview > p,
.npd-branch-workspace aside > header p {
  display: none;
}

.npd-branch-overview dl {
  justify-self: end;
  gap: 1.4rem;
  margin: 0;
}

.npd-branch-overview dl div {
  min-width: 4.5rem;
}

.npd-branch-overview dt {
  font-size: 1.1rem;
}

.npd-branch-workspace aside > header {
  align-items: center;
  padding: .8rem 1.4rem;
}

.npd-branch-workspace aside > header h3 {
  font-size: .95rem;
}

.npd-branch-choice-list {
  padding: .65rem 1.4rem .85rem;
}

.npd-branch-choice {
  grid-template-columns: 3.8rem minmax(0, 1fr);
  align-items: center;
  gap: .15rem .65rem;
  padding: .7rem .85rem;
}

.npd-inline-branch-head {
  display: block;
  padding: 1rem 1.4rem .8rem;
}

.npd-inline-branch-head h3 {
  margin: .2rem 0 .7rem;
  font-size: 1.2rem;
}

.npd-inline-branch-head dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 10rem));
  width: fit-content;
  max-width: 100%;
}

.npd-inline-branch-head dl div,
.npd-inline-branch-head dl div + div {
  min-width: 0;
  padding: .55rem .9rem .25rem;
}

.npd-inline-branch-head dl div:first-child {
  padding-left: 0;
}

.npd-inline-branch-toolbar {
  padding: .65rem 1.4rem;
}

.npd-inline-branch-table {
  padding: .6rem 1.4rem 1.25rem;
}

.npd-sample-table {
  width: 100%;
  table-layout: fixed;
}

.npd-sample-table th,
.npd-sample-table td {
  vertical-align: middle;
}

.npd-sample-table th:nth-child(1),
.npd-sample-table td:nth-child(1) { width: 25%; }
.npd-sample-table th:nth-child(2),
.npd-sample-table td:nth-child(2) { width: 16%; }
.npd-sample-table th:nth-child(3),
.npd-sample-table td:nth-child(3) { width: 16%; }
.npd-sample-table th:nth-child(4),
.npd-sample-table td:nth-child(4) { width: 12%; }

.npd-sample-table th:last-child,
.npd-sample-table td:last-child {
  width: 15rem;
  min-width: 15rem;
}

.npd-sample-table th:nth-child(1),
.npd-sample-table td:nth-child(1) {
  width: 24%;
}

.npd-sample-table th:nth-child(2),
.npd-sample-table td:nth-child(2) {
  width: auto;
}

.npd-sample-timeline-cell {
  padding-right: 1.25rem;
}

.npd-sample-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: relative;
  gap: .35rem;
}

.npd-sample-timeline::before {
  content: "";
  position: absolute;
  top: .72rem;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: #d9e5de;
}

.npd-timeline-stage {
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr);
  position: relative;
  z-index: 1;
  align-items: start;
  gap: .45rem;
  min-width: 0;
  padding: .18rem .35rem .18rem 0;
  border: 0;
  background: transparent;
  color: #6d8276;
  text-align: left;
  cursor: pointer;
}

.npd-timeline-dot {
  width: 1.45rem;
  height: 1.45rem;
  box-sizing: border-box;
  border: 1px solid #c9d9cf;
  border-radius: 50%;
  background: #fff;
}

.npd-timeline-copy {
  display: grid;
  gap: .14rem;
  min-width: 0;
}

.npd-timeline-copy b {
  color: inherit;
  font-size: .78rem;
  line-height: 1.35;
}

.npd-timeline-copy small {
  overflow: hidden;
  color: inherit;
  font-size: .71rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npd-timeline-stage.is-complete,
.npd-timeline-stage.is-current {
  color: #14724f;
}

.npd-timeline-stage.is-complete .npd-timeline-dot {
  border-color: #14724f;
  background: #14724f;
  box-shadow: inset 0 0 0 4px #fff;
}

.npd-timeline-stage.is-current .npd-timeline-dot {
  border: 5px solid #14724f;
  background: #eff8f3;
}

.npd-timeline-stage.is-attention {
  color: #b05c22;
}

.npd-timeline-stage.is-attention .npd-timeline-dot {
  border-color: #d78a4a;
  background: #fff7ef;
}

.npd-timeline-stage.is-pending {
  color: #82948a;
  cursor: default;
}

.npd-timeline-stage.is-pending .npd-timeline-dot {
  border-color: #cfdcd5;
  background: #f7faf8;
}

.npd-timeline-stage:not(:disabled):hover .npd-timeline-copy b {
  text-decoration: underline;
  text-underline-offset: .18rem;
}

.npd-timeline-stage:focus-visible {
  outline: 2px solid #14724f;
  outline-offset: 2px;
  border-radius: 3px;
}

/* 样品线操作按照流程从左至右呈现，避免在窄操作列里上下跳动。 */
.npd-sample-table th:last-child,
.npd-sample-table td:last-child {
  width: 25rem;
  min-width: 25rem;
}

.npd-sample-table th:last-child {
  text-align: right;
}

.npd-sample-table th:last-child::after {
  content: "操作";
}

.npd-sample-actions {
  display: grid;
  grid-template-columns: repeat(2, 6.8rem);
  align-items: center;
  justify-content: end;
  gap: .5rem;
  min-height: 0;
}

.npd-sample-actions > :first-child {
  grid-column: auto;
  justify-self: auto;
}

.npd-sample-actions .npd-link-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.8rem;
  min-width: 0;
  min-height: 2.1rem;
  box-sizing: border-box;
  padding: .42rem .72rem;
  border: 1px solid #d6e1da;
  border-radius: 3px;
  background: #fff;
  color: #1d4433;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.npd-sample-actions .btn {
  width: 6.8rem;
  min-width: 0;
  margin: 0;
}

.npd-sample-actions .npd-link-action:hover {
  border-color: #75aa8e;
  background: #f3faf6;
}

.npd-sample-record-dialog .npd-record-actions {
  display: grid;
  grid-template-columns: repeat(2, 6.8rem);
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.npd-sample-record-dialog .npd-record-actions [data-npd-sample-record] {
  display: none;
}

.npd-sample-record-dialog .npd-record-actions .npd-link-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.8rem;
  min-width: 0;
  min-height: 2.1rem;
  box-sizing: border-box;
  padding: .42rem .72rem;
  border: 1px solid #d6e1da;
  border-radius: 3px;
  background: #fff;
  color: #1d4433;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.npd-sample-record-dialog .npd-record-actions .btn {
  width: 6.8rem;
  min-width: 0;
  margin: 0;
}

.npd-sample-record-dialog .npd-record-actions .npd-link-action:hover {
  border-color: #75aa8e;
  background: #f3faf6;
}

.npd-sample-record-dialog {
  width: min(1000px, calc(100vw - 3rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #173e2d;
  box-shadow: 0 1.25rem 3.5rem rgba(21, 57, 41, .26);
}

.npd-sample-record-dialog::backdrop {
  background: rgba(22, 53, 40, .42);
}

.npd-sample-record-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem 1.1rem;
  border-bottom: 1px solid #dce9e1;
  background: #fbfdfc;
}

.npd-sample-record-dialog h3 {
  margin: .45rem 0 .3rem;
  font-size: 1.35rem;
}

.npd-sample-record-dialog header p {
  margin: 0;
  color: #60786b;
  font-size: .82rem;
}

.npd-sample-record-dialog .npd-record-body {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem 1.75rem 1.7rem;
}

.npd-sample-record-dialog .npd-record-body > section {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid #e2eee7;
}

.npd-sample-record-dialog .npd-record-body > section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.npd-sample-record-dialog .npd-record-body h4 {
  margin: 0 0 .75rem;
  font-size: .95rem;
}

@media (max-width: 720px) {
  .npd-branch-overview {
    grid-template-columns: 1fr;
    gap: .6rem;
  }

  .npd-branch-overview dl {
    justify-self: start;
  }

  .npd-inline-branch-head dl {
    grid-template-columns: repeat(3, minmax(5rem, 1fr));
    width: 100%;
  }

  .npd-sample-table th:last-child,
  .npd-sample-table td:last-child {
    min-width: 0;
  }

  .npd-inline-branch-table {
    overflow-x: auto;
  }

  .npd-sample-table {
    min-width: 48rem;
  }

  .npd-sample-actions,
  .npd-sample-record-dialog .npd-record-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .npd-sample-actions .npd-link-action,
  .npd-sample-actions .btn,
  .npd-sample-record-dialog .npd-record-actions .npd-link-action,
  .npd-sample-record-dialog .npd-record-actions .btn {
    width: 100%;
  }

  .npd-sample-record-dialog {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
  }

  .npd-sample-record-dialog > header {
    flex-direction: column;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .npd-sample-record-dialog .npd-record-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
