:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-raised: #eef5ff;
  --fg: #172033;
  --muted: #667085;
  --subtle: #8a94a6;
  --border: #d8e0ea;
  --border-soft: #e8edf4;
  --accent: #0082ef;
  --accent-strong: #006fd0;
  --accent-soft: #e6f3ff;
  --success: #18a058;
  --success-soft: #e9f8ef;
  --warning: #d98218;
  --warning-soft: #fff4df;
  --danger: #d92d20;
  --danger-soft: #fff0ed;
  --blocked: #6f5bd6;
  --blocked-soft: #f1efff;
  --nav: #102542;
  --nav-fg: #f5f8ff;
  --shadow: 0 14px 36px rgba(16, 37, 66, 0.08);
  --radius: 10px;
  --font-display: "Avenir Next", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font: 14px/1.55 var(--font-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.workbench {
  min-height: 100vh;
}

.app-top {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 62px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.02);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 232px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: var(--surface);
  font: 700 12px/1 var(--font-mono);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0;
}

.top-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-tabs::-webkit-scrollbar {
  display: none;
}

.top-tabs a,
.top-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 560;
  white-space: nowrap;
}

.top-tabs a:hover,
.top-tabs a.active,
.top-tabs button:hover,
.top-tabs button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.top-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.top-tools .btn,
.top-tools .user-pill {
  white-space: nowrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

.avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 650;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 40px;
}

.page.compact {
  max-width: 1180px;
}

.crumb {
  color: var(--subtle);
  font-size: 12px;
}

.crumb .linkish {
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.empty-state > .btn {
  margin-bottom: 12px;
}

.page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
  margin: 10px 0 18px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--fg);
}

h1 {
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.actions,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-switcher .todo-count {
  display: inline-block;
  min-width: 1.15em;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 580;
  letter-spacing: 0.02em;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.72;
}

.btn.primary[disabled],
.btn.primary[aria-disabled="true"] {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.btn.loading {
  cursor: progress;
}

.btn.sent,
.btn.sent:hover {
  border-color: var(--success);
  background: var(--success);
  color: var(--surface);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.layout-grid {
  display: grid;
  gap: 14px;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-body {
  padding: 16px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.metric .value {
  margin-top: 5px;
  font: 700 28px/1 var(--font-display);
  letter-spacing: 0;
}

.metric .hint {
  margin-top: 7px;
  color: var(--subtle);
  font-size: 12px;
}

.metric.warn {
  background: linear-gradient(180deg, var(--surface), var(--warning-soft));
}

.metric.danger {
  background: linear-gradient(180deg, var(--surface), var(--danger-soft));
}

.metric.blocked {
  background: linear-gradient(180deg, var(--surface), var(--blocked-soft));
}

.metric.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 10px;
}

.department-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  padding: 14px 16px;
}

.department-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.department-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.department-pills,
.template-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.search {
  min-width: 260px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.segmented button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(23, 32, 51, 0.12);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 590;
  white-space: nowrap;
}

.chip.blue {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.chip.green {
  color: var(--success);
  background: var(--success-soft);
}

.chip.orange {
  color: var(--warning);
  background: var(--warning-soft);
}

.chip.red {
  color: var(--danger);
  background: var(--danger-soft);
}

.chip.purple {
  color: var(--blocked);
  background: var(--blocked-soft);
}

.muted {
  color: var(--muted);
}

.subtle {
  color: var(--subtle);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: visible;
}

.data-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tr:hover td {
  background: var(--surface-soft);
}

.data-table tr.node-select-row {
  cursor: pointer;
}

.data-table tr.node-select-row.selected td {
  background: var(--accent-soft);
}

.data-table tr.node-select-row.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.node-name-link {
  color: var(--accent-strong);
}

.node-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.node-title-line .node-name-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-note-indicator {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid #f2d38a;
  border-radius: 999px;
  background: #fff8e8;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.list-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

.list-kicker {
  color: var(--accent-strong);
  font: 700 12px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 650;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.row-no {
  width: 52px;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 12px;
}

.group-grid {
  display: grid;
  gap: 12px;
}

.group-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.node-table-wrap {
  overflow-x: hidden;
}

.node-detail-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.node-detail-table .node-col-seq {
  width: 52px;
}

.node-detail-table .node-col-name {
  width: 220px;
}

.node-detail-table .node-col-owner {
  width: 80px;
}

.node-detail-table .node-col-predecessor {
  width: 90px;
}

.node-detail-table .node-col-date {
  width: 82px;
}

.node-detail-table .node-col-status {
  width: 160px;
}

.node-detail-table .node-date-cell {
  white-space: nowrap;
  overflow-wrap: normal;
}

.node-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.group-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
}

button.group-head {
  cursor: pointer;
}

button.group-head:hover,
.group-head.active {
  background: var(--surface-raised);
}

.group-head.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.group-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.group-name strong {
  font-size: 15px;
}

.group-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.name-cell {
  display: grid;
  gap: 2px;
}

.image-col {
  width: 108px;
}

.owner-col {
  width: 150px;
}

.project-col {
  width: 240px;
}

.action-col {
  width: 92px;
}

.board-project-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  color: inherit;
}

.board-project-actions {
  display: flex;
  justify-content: flex-end;
}

.board-list-panel {
  overflow-x: auto;
}

.dashboard-table {
  min-width: 1260px;
}

.board-project-link .name-cell {
  min-width: 0;
}

.board-project-link .project-code,
.board-project-link .name-cell .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

.project-thumb {
  width: 84px;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 0;
  color: inherit;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.project-thumb.empty span {
  color: var(--subtle);
  font-size: 11px;
}

.owner-display {
  font-weight: 600;
}

.updated-cell {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.project-list-row.editing td {
  border-bottom-color: transparent;
  background: #f5f9fe;
}

.project-list-row.editing td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.project-list-row.last-viewed td {
  background: #dce9f5;
  border-bottom-color: #bfd2e4;
}

.project-list-row.last-viewed:hover td {
  background: #d5e4f1;
}

.project-list-row.last-viewed td:first-child {
  box-shadow: inset 4px 0 0 #173f68;
}

.project-list-row.last-viewed .project-code {
  color: #123f6b;
}

.edit-active-label {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 650;
}

.project-edit-row:hover td,
.project-edit-row td {
  padding: 0;
  background: #f5f9fe;
}

.project-edit-row.dirty td {
  background: #f8fbff;
}

.project-row-editor {
  display: grid;
  gap: 14px;
  padding: 14px 20px 18px 68px;
  border-top: 1px solid #dce9f7;
  animation: project-editor-in 180ms ease-out;
}

.project-row-editor-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.project-edit-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.project-edit-heading strong {
  font-size: 14px;
}

.project-edit-heading span {
  color: var(--muted);
  font-size: 12px;
}

.project-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 1px;
}

@keyframes project-editor-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress {
  width: 120px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-soft);
}

.progress span {
  display: block;
  width: var(--value, 50%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.gantt-board {
  overflow: visible;
  padding: 0;
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 12px;
}

.gantt-read-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
}

.gantt-read-guide article {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.gantt-read-guide strong {
  font-size: 14px;
  letter-spacing: 0;
}

.gantt-read-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.guide-step {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
}

.gantt-risk-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.legend-dot.done::before {
  background: var(--success);
}

.legend-dot.confirm::before {
  background: var(--warning);
}

.legend-dot.blocked::before {
  background: var(--blocked);
}

.gantt-axis,
.gantt-row {
  display: grid;
  grid-template-columns: 224px 1fr 148px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
}

.gantt-axis {
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
}

.month-axis {
  display: grid;
  grid-template-columns: repeat(var(--months, 5), 1fr);
  text-align: center;
  font-family: var(--font-mono);
}

.gantt-row {
  min-height: 152px;
  border-bottom: 1px solid var(--border-soft);
}

.gantt-row.last-viewed {
  background: #dce9f5;
  box-shadow: inset 4px 0 0 #173f68;
}

.gantt-row.last-viewed .gantt-project {
  min-height: 86px;
  align-content: center;
  padding: 12px;
  border-radius: 7px;
  color: #123f6b;
}

.gantt-row.last-viewed .gantt-project .muted {
  color: #526b83;
}

.gantt-row:last-child {
  border-bottom: 0;
}

.gantt-project {
  display: grid;
  gap: 4px;
}

.gantt-project strong {
  font-size: 15px;
}

.timeline {
  position: relative;
  height: 126px;
  overflow: visible;
  isolation: isolate;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(216, 224, 234, 0.75) 30px 31px),
    repeating-linear-gradient(90deg, var(--surface-soft) 0 20%, var(--border-soft) calc(20% - 1px) 20%);
}

.timeline-lanes {
  position: absolute;
  inset: 7px auto 7px 8px;
  z-index: 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 3px;
  width: 58px;
  pointer-events: none;
}

.lane-name {
  display: inline-flex;
  align-items: center;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.today-line {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: var(--today-x, 0%);
  width: 2px;
  background: var(--danger);
  z-index: 2;
}

.today-line::after {
  content: "今日";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--danger);
  font-size: 11px;
  white-space: nowrap;
}

.timeline.today-out .today-line {
  display: none;
}

.gantt-bar {
  position: absolute;
  top: var(--bar-top, 17px);
  height: 12px;
  left: var(--start, 0%);
  width: var(--width, 20%);
  border-radius: 999px;
  background: var(--accent);
  z-index: 1;
}

.gantt-bar.plan {
  top: var(--plan-top, 13px);
  height: 22px;
  opacity: 0.16;
}

.gantt-bar.actual {
  top: var(--actual-top, 20px);
  height: 8px;
}

.gantt-bar.warn {
  background: var(--warning);
}

.gantt-bar.danger {
  background: var(--danger);
}

.gantt-bar.blocked {
  background: var(--blocked);
}

.gantt-node {
  position: absolute;
  top: var(--node-top, 10px);
  left: var(--x, 0%);
  transform: translateX(-50%);
  z-index: 4;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.gantt-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.node-dot {
  width: 13px;
  height: 13px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--border);
}

.gantt-node.done .node-dot {
  background: var(--success);
}

.gantt-node.confirm .node-dot {
  background: var(--warning);
}

.gantt-node.blocked .node-dot {
  background: var(--blocked);
}

.gantt-node.danger .node-dot {
  background: var(--danger);
}

.node-label {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  max-width: 98px;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid rgba(216, 224, 234, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  text-overflow: ellipsis;
  font-size: 10px;
  box-shadow: 0 6px 16px rgba(16, 37, 66, 0.08);
  opacity: 0;
}

.gantt-node.confirm .node-label,
.gantt-node.blocked .node-label,
.gantt-node.danger .node-label,
.gantt-node:hover .node-label,
.gantt-node:focus-visible .node-label {
  opacity: 1;
}

.gantt-node.edge-end .node-label {
  right: 18px;
  left: auto;
}

.node-tooltip {
  position: absolute;
  bottom: 26px;
  left: 50%;
  width: 250px;
  transform: translate(-50%, 8px);
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 18px 36px rgba(16, 37, 66, 0.16);
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 8;
}

.gantt-node.edge-start .node-tooltip {
  left: 0;
  transform: translate(0, 8px);
}

.gantt-node.edge-end .node-tooltip {
  left: auto;
  right: 0;
  transform: translate(0, 8px);
}

.node-tooltip strong {
  font-size: 12px;
}

.node-tooltip span {
  color: var(--muted);
  font-size: 11px;
}

.gantt-node:hover .node-tooltip,
.gantt-node:focus-visible .node-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.gantt-node.edge-start:hover .node-tooltip,
.gantt-node.edge-start:focus-visible .node-tooltip,
.gantt-node.edge-end:hover .node-tooltip,
.gantt-node.edge-end:focus-visible .node-tooltip {
  transform: translate(0, 0);
}

.dept-admin-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
}

.member-template-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
}

.department-select-card {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.department-select-card.locked {
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
}

.department-select-card label {
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.department-select {
  width: 100%;
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
}

.department-select:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.native-select {
  position: fixed !important;
  left: -100vw !important;
  top: -100vh !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.combo-control {
  position: relative;
  width: 100%;
}

.top-tools .combo-control {
  min-width: 126px;
}

.combo-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font-weight: 560;
  text-align: left;
}

.combo-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-button i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.8;
}

.combo-control.open .combo-button {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 130, 239, 0.12);
}

.combo-control.open .combo-button i {
  transform: translateY(2px) rotate(225deg);
}

.combo-control.disabled .combo-button,
.combo-button:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.combo-menu {
  position: fixed;
  z-index: 1200;
  top: 0;
  left: 0;
  display: none;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.combo-control.open .combo-menu {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 2px;
}

.combo-search {
  width: 100%;
  min-height: 34px;
  margin-bottom: 4px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--fg);
}

.combo-search[hidden] {
  display: none;
}

.combo-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 2px;
}

.combo-menu button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.combo-menu button:hover,
.combo-menu button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.combo-menu button:disabled {
  color: var(--subtle);
  cursor: not-allowed;
}

.combo-menu .combo-clear {
  margin-top: 4px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
}

.date-entry {
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.date-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  height: 38px;
  border-radius: 8px;
}

.date-control.compact {
  width: 184px;
  min-width: 184px;
}

.date-control .date-entry {
  min-width: 0;
  width: 100%;
  height: 38px;
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.date-control .date-entry:focus-visible,
.date-control .date-button:focus-visible {
  outline: 0;
}

.date-button {
  min-width: 58px;
  height: 38px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.date-control:focus-within .date-entry,
.date-control:focus-within .date-button,
.date-control.open .date-entry,
.date-control.open .date-button {
  border-color: var(--accent);
}

.date-control.disabled .date-button,
.date-button:disabled {
  color: var(--subtle);
  cursor: not-allowed;
}

.date-menu {
  position: fixed;
  z-index: 1210;
  top: 0;
  left: 0;
  display: none;
  width: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.date-control.open .date-menu {
  display: grid;
  gap: 8px;
}

.date-menu-head,
.date-menu-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.date-menu-head strong {
  text-align: center;
}

.date-menu-head button,
.date-menu-foot button,
.date-days button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg);
}

.date-menu-head button:hover,
.date-menu-foot button:hover,
.date-days button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.date-week,
.date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.date-week span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.date-days button.off {
  color: var(--subtle);
}

.date-days button.active {
  background: var(--accent);
  color: var(--surface);
}

.date-menu-foot {
  grid-template-columns: 1fr 1fr;
}

.selector-current {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.leader-panel {
  overflow: hidden;
}

.leader-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  padding: 14px;
  background: var(--surface-soft);
}

.leader-row,
.identity-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.leader-row.selected,
.identity-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.leader-person {
  min-width: 0;
}

.leader-person strong,
.leader-person small {
  display: block;
}

.leader-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-person small {
  color: var(--muted);
  font-size: 12px;
}

.leader-badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.leader-row input {
  width: 20px;
  min-height: 20px;
}

.selector-current strong {
  font-size: 20px;
  letter-spacing: 0;
}

.no-access-panel .panel-body {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.no-access-panel .empty-state {
  justify-items: center;
  text-align: center;
}

.empty-state {
  width: min(560px, 100%);
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.empty-state h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.permission-block-strip {
  border-color: var(--warning);
}

.access-block-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 14px;
  align-items: stretch;
}

.access-primary-card,
.access-request-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.access-request-card {
  background: var(--surface);
}

.access-title-row,
.request-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.access-title-row h3,
.request-card-head h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.blocked-capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.blocked-capability {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.blocked-capability-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blocked-capability strong {
  font-size: 22px;
  letter-spacing: 0;
}

.blocked-capability p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.no-leak-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  background: var(--warning-soft);
}

.no-leak-note span {
  color: var(--muted);
}

.permission-timeline {
  counter-reset: permission-step;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.permission-timeline li {
  counter-increment: permission-step;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 2px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.permission-timeline li::before {
  content: counter(permission-step, decimal-leading-zero);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
}

.permission-timeline strong {
  font-size: 14px;
}

.permission-timeline span {
  color: var(--muted);
  font-size: 13px;
}

.access-request-result {
  grid-template-columns: auto 1fr;
  border-color: var(--success);
  background: var(--success-soft);
}

.access-request-result:focus-visible {
  outline-color: var(--success);
}

.access-request-error {
  grid-template-columns: auto 1fr auto;
  border-color: var(--danger);
  background: var(--danger-soft);
}

.access-request-error:focus-visible {
  outline-color: var(--danger);
}

.template-flow {
  display: grid;
  gap: 9px;
}

.template-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.notice-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  background: var(--warning-soft);
}

.info-strip {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.step {
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.step.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.step:disabled {
  color: var(--subtle);
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: 0.72;
}

.step small {
  display: block;
  color: var(--muted);
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
}

.template-workspace {
  display: grid;
  gap: 14px;
}

.template-mode-switch {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.template-mode-switch button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  color: var(--muted);
  background: transparent;
  font-weight: 620;
}

.template-mode-switch button.active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.04);
}

.template-mode-panel {
  display: grid;
  gap: 14px;
}

.template-upload-card,
.template-editor-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.template-upload-card h3,
.template-editor-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.upload-drop {
  display: grid;
  place-items: center;
  min-width: 300px;
  min-height: 118px;
  padding: 16px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  text-align: center;
  cursor: pointer;
}

.upload-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.template-groups {
  display: grid;
  gap: 10px;
}

.template-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.template-group summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  background: var(--surface-soft);
  cursor: pointer;
}

.template-group summary::marker {
  color: var(--accent);
}

.template-group summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.template-group-tools {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.template-group-tools label {
  display: grid;
  gap: 4px;
}

.template-group-tools label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.template-group-tools input,
.template-group-tools select {
  min-height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 3px);
  background: var(--surface);
}

.template-node-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.2fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.template-node-row.confirm-row {
  background: var(--warning-soft);
}

.template-node-row input,
.template-node-row select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 3px);
  background: var(--surface);
  padding: 0 10px;
}

.template-node-name,
.template-node-predecessor {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.template-node-name > span,
.template-node-predecessor > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.template-node-tools {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.row-handle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
  cursor: grab;
}

.row-handle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.node-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: end;
}

.node-action-btn.btn {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: var(--border-soft);
  background: var(--surface-soft);
  font-size: 17px;
  font-weight: 700;
}

.node-action-btn.btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.node-delete-btn.btn {
  min-height: 32px;
  padding: 0 8px;
}

.template-node-kind {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.template-node-kind.material {
  min-width: 54px;
  padding: 4px 8px;
  border: 1px solid #a7d9bd;
  border-radius: 6px;
  background: var(--success-soft);
  color: #08783a;
  text-align: center;
}

.template-node-row.dragging {
  opacity: 0.55;
  background: var(--accent-soft);
}

.template-node-row.row-moved {
  animation: rowMoved 360ms ease;
}

.template-node-row.row-flash {
  animation: rowFlash 680ms ease;
}

.btn.ghost.danger {
  color: var(--danger);
}

@keyframes rowMoved {
  0% {
    transform: translateY(-4px);
    background: var(--accent-soft);
  }
  100% {
    transform: translateY(0);
    background: var(--surface);
  }
}

@keyframes rowFlash {
  0% {
    box-shadow: inset 3px 0 0 var(--accent);
    background: var(--accent-soft);
  }
  100% {
    box-shadow: inset 0 0 0 transparent;
    background: var(--surface);
  }
}

.assign-groups {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.assign-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.assign-group-head {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
}

.assign-group-head > div,
.assign-group-head > label {
  display: grid;
  gap: 4px;
}

.assign-group-head label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  max-width: 1040px;
}

.project-meta-fields {
  display: grid;
  gap: 16px;
}

.project-data-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.project-time-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.project-time-heading strong {
  font-size: 13px;
}

.project-time-heading span {
  color: var(--subtle);
  font-size: 12px;
}

.project-meta-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.dirty .save-state {
  color: var(--warning);
}

.dirty .save-state::before {
  background: var(--warning);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field-hint {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
}

.executor-picker {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.executor-picker:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 130, 239, 0.1);
}

.executor-picker.disabled {
  background: var(--surface-soft);
}

.executor-picker-values {
  min-width: 0;
  flex: 1 1 160px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.executor-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 5px 0 8px;
  border: 1px solid #bfdcf8;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 650;
}

.executor-chip button {
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
}

.executor-chip button:hover {
  background: rgba(0, 130, 239, 0.15);
}

.executor-empty {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.executor-add-btn {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.schedule-choice {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.schedule-choice > div:first-of-type {
  display: grid;
  gap: 3px;
}

.schedule-choice > div:first-of-type strong {
  font-size: 14px;
}

.schedule-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-choice-option {
  min-height: 76px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  text-align: left;
}

.schedule-choice-option strong {
  font-size: 14px;
}

.schedule-choice-option small {
  color: var(--muted);
  line-height: 1.4;
}

.schedule-choice-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.schedule-relay-note {
  min-height: 56px;
}

.field input[disabled],
.field select[disabled] {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.field textarea {
  min-height: 84px;
  padding: 9px 10px;
  resize: vertical;
}

.project-image-field {
  min-width: 0;
}

.image-picker {
  width: 100%;
  display: grid;
  gap: 7px;
}

.image-picker.compact {
  width: 180px;
}

.image-picker.uploading .image-preview {
  pointer-events: none;
  opacity: 0.68;
}

.image-picker.uploading .image-preview::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-strong);
  content: "上传中";
  font-size: 12px;
  font-weight: 700;
}

.image-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.image-preview.empty {
  border-style: dashed;
}

.image-preview:hover,
.image-preview:focus-within,
.image-preview.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(0, 130, 239, 0.1);
  outline: 0;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-zoom-trigger,
.image-empty-trigger {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.image-zoom-trigger {
  cursor: zoom-in;
}

.image-empty-trigger {
  cursor: pointer;
}

.image-placeholder {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.image-placeholder-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.image-placeholder strong {
  font-size: 12px;
  font-weight: 650;
}

.image-change-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(23, 32, 51, 0.82);
  color: white;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 150ms ease, background 150ms ease;
}

.image-preview:hover .image-change-label,
.image-change-label:hover {
  opacity: 1;
  background: rgba(23, 32, 51, 0.94);
}

.image-picker-footer {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--subtle);
  font-size: 11px;
}

.image-remove.btn {
  min-height: 26px;
  padding: 0 5px;
  color: var(--danger);
  font-size: 11px;
}

.image-picker.compact .image-placeholder-mark {
  width: 27px;
  height: 27px;
  font-size: 19px;
}

.image-picker.compact .image-picker-footer {
  align-items: flex-start;
}

.image-picker.compact .image-remove.btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.image-picker.disabled .image-preview {
  background: var(--surface-soft);
}

.image-lightbox {
  width: min(94vw, 1180px);
  max-width: none;
  height: min(90vh, 820px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #0d1118;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.image-lightbox::backdrop {
  background: rgba(12, 18, 28, 0.72);
  backdrop-filter: blur(3px);
}

.image-lightbox-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 42px;
}

.image-lightbox img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.image-lightbox-close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(13, 17, 24, 0.74);
  color: white;
  font-size: 22px;
  line-height: 1;
}

.image-file-input {
  display: none;
}

.task-image-shell { display: flex; flex-direction: column; height: 100%; color: #fff; }
.task-image-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.task-image-toolbar strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.task-image-toolbar button { flex-shrink: 0; min-height: 36px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 6px; background: transparent; color: #fff; cursor: pointer; }
.task-image-toolbar [data-close-task-image] { width: 36px; padding: 0; font-size: 24px; }
.task-image-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; overflow: auto; }
.task-image-body img { min-height: 0; }
.task-image-body p { margin: 0; color: #e1e7ef; text-align: center; }

@media (max-width: 640px) {
  .task-image-dialog { height: 84dvh; }
  .task-image-toolbar { gap: 8px; padding: 10px; }
  .task-image-body { padding: 8px; }
}

.node-stack {
  display: grid;
  gap: 8px;
}

.node-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.node-card.group {
  background: var(--surface-soft);
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
  align-items: start;
}

.drawer {
  position: sticky;
  top: 12px;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.drawer .panel-head {
  flex: 0 0 auto;
}

.drawer .drawer-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dep-flow {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
}

.dep {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 580;
  cursor: pointer;
}

.dep:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.dep.current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.task-workspace .data-table {
  min-width: 0;
}

.cell-input {
  width: 118px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
}

.message-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.message-card p {
  margin: 0;
}

.message-meta {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.node-audit {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.node-audit h3 {
  margin: 0;
  font-size: 15px;
}

.node-timeline {
  display: grid;
  gap: 8px;
}

.node-timeline.empty {
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.timeline-item {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.timeline-item div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.timeline-item time,
.timeline-item small {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: none;
  min-width: 220px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--nav);
  color: var(--nav-fg);
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.node-form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #b42318;
  font-size: 13px;
  line-height: 1.5;
}

.node-form-error[hidden] {
  display: none;
}

.linkish {
  border: 0;
  background: transparent;
  text-align: left;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
}

.check-field input {
  width: auto;
  min-height: auto;
}

.sync-dialog {
  width: min(980px, 94vw);
  height: min(760px, 86vh);
  max-height: 86vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(16, 37, 66, 0.22);
}

.sync-dialog::backdrop {
  background: rgba(16, 37, 66, 0.45);
}

.sync-form {
  margin: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.sync-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.sync-dept-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  overflow: auto;
  border-right: 1px solid var(--border-soft);
  background: var(--surface-soft);
}

.sync-dept-tree {
  display: grid;
  gap: 6px;
}

.sync-dept-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0 10px 0 calc(10px + var(--depth, 0) * 16px);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  text-align: left;
}

.sync-dept-item:hover,
.sync-dept-item.active {
  border-color: var(--border);
  background: var(--surface);
}

.sync-dept-item.active {
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(0, 130, 239, 0.08);
}

.sync-dept-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 720;
}

.sync-dept-item small {
  color: var(--muted);
  font-weight: 700;
}

.sync-member-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--surface);
}

.sync-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sync-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sync-search span {
  color: var(--muted);
  font-weight: 800;
}

.sync-search input {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.sync-footer {
  padding: 12px;
  background: var(--surface);
}

.sync-footer .btn {
  width: 100%;
}

.sync-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: none;
  overflow: auto;
  padding: 0 2px 2px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sync-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(160px, max-content);
  gap: 10px;
  align-items: center;
  margin: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.sync-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sync-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.sync-person {
  min-width: 0;
}

.sync-person strong,
.sync-row small {
  display: block;
}

.sync-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-row small {
  color: var(--muted);
}

.sync-row.exists {
  background: var(--surface-soft);
}

.sync-state {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-role-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.sync-row input {
  width: 20px;
  min-height: 20px;
}

.role-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.role-pill input {
  width: 16px;
  min-height: 16px;
}

.role-empty {
  font-size: 12px;
  white-space: nowrap;
}

/* Node editing lane */
.group-add-bar { padding: 10px 12px; border-top: 1px solid var(--border-soft); }
.node-add-form, .node-form-section { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--border-soft); background: var(--surface-soft); }
.node-add-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.node-add-heading > div { display: grid; gap: 2px; }
.node-add-heading small { color: var(--muted); }
.node-form-section-head { color: var(--fg); font-weight: 720; }
.node-predecessor-field { grid-column: 1 / -1; min-width: 0; }
.node-predecessor-field .combo-control { min-width: 0; }
.drawer .node-date-field,
.drawer .node-plan-lock-hint { grid-column: 1 / -1; }
.node-time-summary { display: grid; gap: 3px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 7px; background: var(--surface-soft); }
.node-time-summary strong { font-size: 13px; }
.node-time-summary span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.node-time-summary.warning { border-color: #f2c078; background: var(--warning-soft); }
.node-time-summary.danger { border-color: #efaaaa; background: var(--danger-soft); }
.node-lock-reasons { display: grid; gap: 4px; color: var(--warning); font-size: 12px; }
.node-lock-reasons span::before { content: "• "; }
.node-drawer-title { display: flex; min-width: 0; align-items: center; gap: 8px; }
.node-drawer-title h2 { min-width: 0; }
.node-kind-badge { display: inline-flex; align-items: center; min-height: 22px; margin-left: 7px; padding: 2px 7px; border: 1px solid #a7d9bd; border-radius: 6px; background: var(--success-soft); color: #08783a; font-size: 11px; font-weight: 750; white-space: nowrap; vertical-align: middle; }
.node-gate-badge { border-color: #f0c36a; background: #fff7e8; color: #8a5a00; }
.npi-gate-panel { margin-top: 12px; padding: 12px; border: 1px solid #f0c36a; border-radius: 8px; background: #fffaf0; display: grid; gap: 10px; }
.npi-gate-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.npi-gate-meta, .npi-evidence-list, .npi-grant-list { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.npi-evidence-list a { color: var(--accent-strong); }
.npi-gate-actions, .npi-ack-manage, .npi-grant-box { display: grid; gap: 8px; }
.npi-rate { height: 8px; border-radius: 99px; background: #f1e4c8; overflow: hidden; }
.npi-rate span { display: block; height: 100%; background: #d29a1d; }
.npi-role-chip { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px 2px 0; padding: 2px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; }
.npi-role-chip.done { border-color: #a7d9bd; background: var(--success-soft); }
.npi-role-chip.rejected { border-color: #f0b4b4; background: #fff1f1; }
.npi-ack-table { max-height: 360px; overflow: auto; }
.node-added-badge { border-color: #b3d4f5; background: var(--accent-soft); color: var(--accent-strong); }
.node-drag-handle { display: inline-block; margin-right: 4px; color: var(--subtle); font-size: 11px; letter-spacing: -1px; cursor: grab; user-select: none; }
.node-select-row.node-draggable { cursor: default; }
.node-select-row.dragging { opacity: 0.45; }
.node-select-row.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.node-select-row.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.reorder-dialog .reorder-time-edit { display: flex; align-items: center; gap: 6px; }
.reorder-dialog .reorder-time-edit input { width: 118px; }
.reorder-dialog .reorder-time-edit span { color: var(--muted); }
.reorder-dialog .reorder-reason textarea { width: 100%; min-height: 64px; }
.node-action-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.material-ledger { margin-top: 12px; border-top: 1px solid var(--border-soft); }
.material-ledger-primary { padding: 12px; border: 1px solid #b9dcc8; border-radius: 8px; background: #f6fcf8; }
.material-ledger-toggle { width: 100%; min-height: 42px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: var(--fg); font-weight: 720; text-align: left; }
.material-ledger-toggle > span:first-child { display: grid; gap: 2px; }
.material-ledger-toggle small { color: var(--muted); font-weight: 500; }
.material-ledger-body { display: grid; gap: 8px; }
.material-ledger-grid { display: grid; gap: 6px; min-width: 0; }
.material-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 30px; gap: 8px; align-items: start; min-width: 0; padding: 10px 8px; border: 1px solid #d7eadf; border-radius: 7px; background: var(--surface); }
.material-row input { min-width: 0; width: 100%; min-height: 34px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.material-ledger-head { display: none; color: var(--muted); font-size: 12px; }
.material-cell { grid-column: 2; display: grid; gap: 3px; min-width: 0; }
.material-cell small { color: var(--muted); font-size: 11px; font-weight: 650; }
.material-seq { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--success-soft); color: #08783a; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 750; }
.material-remove { grid-column: 3; grid-row: 1; width: 30px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--danger); }
.material-add-btn { justify-self: start; }
.node-danger-zone { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.delete-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--danger); border-radius: 6px; color: var(--danger); }


.node-type-dialog {
  width: min(620px, calc(100vw - 28px));
  max-width: 620px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 70px rgba(16, 37, 66, 0.22);
}

.schedule-impact-dialog {
  width: min(820px, calc(100vw - 28px));
  max-width: 820px;
  max-height: min(82vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 70px rgba(16, 37, 66, 0.22);
}

.schedule-impact-dialog::backdrop {
  background: rgba(16, 37, 66, 0.44);
}

.schedule-impact-head,
.schedule-impact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.schedule-impact-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-soft);
}

.schedule-impact-head h2,
.schedule-impact-head p {
  margin: 0;
}

.schedule-impact-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.schedule-impact-body {
  max-height: calc(min(82vh, 760px) - 142px);
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px 20px;
}

.schedule-impact-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #a9d5ff;
  border-radius: 8px;
  background: var(--accent-soft);
}

.schedule-impact-source > span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.schedule-impact-source strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-impact-source > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-impact-source b { color: var(--accent-strong); }
.schedule-impact-section { display: grid; gap: 8px; }
.schedule-impact-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-impact-section-head span { color: var(--muted); font-size: 12px; }
.schedule-impact-table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 8px; }
.schedule-impact-table { width: 100%; min-width: 660px; border-collapse: collapse; font-size: 12px; }
.schedule-impact-table th,
.schedule-impact-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); text-align: left; white-space: nowrap; }
.schedule-impact-table th { color: var(--muted); background: var(--surface-soft); font-weight: 700; }
.schedule-impact-table tbody tr:last-child td { border-bottom: 0; }
.schedule-impact-table td:first-child { min-width: 170px; white-space: normal; }
.schedule-impact-table td:first-child small { display: block; margin-top: 3px; color: var(--muted); }
.schedule-impact-empty { margin: 0; padding: 11px 12px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); background: var(--surface-soft); font-size: 13px; }
.schedule-impact-skipped { padding: 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-soft); }
.schedule-impact-skipped ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.schedule-impact-skipped li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.schedule-impact-skipped li strong { color: var(--fg); font-weight: 650; }
.schedule-impact-skipped li.schedule-impact-more { display: block; padding-top: 7px; border-top: 1px solid var(--border-soft); color: var(--subtle); }
.schedule-impact-actions { justify-content: flex-end; border-top: 1px solid var(--border-soft); }

.node-type-dialog::backdrop {
  background: rgba(16, 37, 66, 0.44);
}

.node-type-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.node-type-dialog-head h2,
.node-type-dialog-head p {
  margin: 0;
}

.node-type-dialog-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.icon-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-close:hover {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--fg);
}

.node-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 20px;
}

.node-type-option {
  min-height: 124px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  text-align: left;
}

.node-type-option:hover,
.node-type-option:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.node-type-option.material:hover,
.node-type-option.material:focus-visible {
  border-color: var(--success);
  background: var(--success-soft);
}

.node-type-option > span:last-child {
  display: grid;
  gap: 6px;
}

.node-type-option strong {
  font-size: 16px;
}

.node-type-option small {
  color: var(--muted);
  line-height: 1.55;
}

.node-type-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.node-type-icon.material {
  background: var(--success-soft);
  color: #08783a;
}

.executor-dialog {
  width: min(680px, calc(100vw - 28px));
  max-width: 680px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 70px rgba(16, 37, 66, 0.22);
}

.executor-dialog::backdrop {
  background: rgba(16, 37, 66, 0.44);
}

.executor-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.executor-dialog-head h2,
.executor-dialog-head p {
  margin: 0;
}

.executor-dialog-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.executor-dialog-body {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
}

.executor-search-input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--fg);
}

.executor-member-list {
  max-height: min(52vh, 420px);
  overflow: auto;
  display: grid;
  gap: 6px;
}

.executor-member-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.executor-member-row:has(input:checked) {
  border-color: #a9d5ff;
  background: var(--accent-soft);
}

.executor-member-row input {
  width: 17px;
  height: 17px;
}

.executor-member-row > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.executor-member-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.executor-member-row small {
  color: var(--muted);
  font-size: 12px;
}

.executor-dialog-foot,
.template-delete-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-soft);
}

.template-delete-body {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}

.template-delete-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.template-delete-actions {
  justify-content: flex-end;
}

/* 协作任务 */
.task-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}

.task-badge.issued { background: var(--warning-soft); color: var(--warning); border-color: #f2ddb4; }
.task-badge.active { background: var(--accent-soft); color: var(--accent-strong); border-color: #bfdcff; }
.task-badge.verify { background: var(--blocked-soft); color: var(--blocked); border-color: #dcd5ff; }
.task-badge.done { background: var(--success-soft); color: var(--success); border-color: #bfe8cf; }
.task-badge.stopped { background: var(--danger-soft); color: var(--danger); border-color: #f2c4bd; }
.task-badge.add { background: var(--surface); color: var(--subtle); border-color: var(--border); opacity: 0; transition: opacity 0.12s; }
tr.node-select-row:hover .task-badge.add,
tr.node-select-row.selected .task-badge.add { opacity: 1; }

.node-task-section {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.node-task-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.node-task-head .node-task-create { margin-left: auto; padding: 3px 12px; font-size: 12px; }
.node-task-empty { font-size: 12px; }
.task-row-list { display: flex; flex-direction: column; gap: 6px; }

.task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
}

.task-row:hover { background: var(--surface-raised); }
.task-row-no { color: var(--subtle); font-size: 11px; }
.task-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-assignee { flex-shrink: 0; }

tr.task-open-row { cursor: pointer; }
tr.task-open-row:hover td { background: var(--surface-soft); }
.task-no-cell { font-size: 11px; }
.task-sampling-meta { display: block; margin-top: 4px; color: var(--accent-strong); font-size: 11px; font-weight: 600; }

.task-mask { position: fixed; inset: 0; z-index: 95; background: rgba(16, 37, 66, 0.35); }

.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 96;
  display: flex;
  flex-direction: column;
  width: 480px;
  max-width: 94vw;
  background: var(--surface);
  box-shadow: -18px 0 44px rgba(16, 37, 66, 0.2);
}

.task-drawer-head { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.task-drawer-head h3 { margin: 0; font-size: 15px; }
.task-drawer-head .icon-close { margin-left: auto; }
.task-drawer-sub { margin-top: 2px; color: var(--muted); font-size: 12px; }
.task-drawer-body { flex: 1; overflow: auto; padding: 14px 18px; }
.task-drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-soft); }
.task-drawer-actions .delete-confirm { font-size: 12px; }
.sampling-delete-block { align-self: center; font-size: 12px; }

.task-sec { margin: 16px 0 6px; color: var(--subtle); font-size: 12px; font-weight: 650; }
.task-sec:first-child { margin-top: 0; }
.task-kv { display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; font-size: 13px; }
.task-kv .k { color: var(--subtle); }
.task-empty { padding: 6px 0; font-size: 12px; }
.task-sampling-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-sampling-origin { padding: 2px 7px; border-radius: 999px; background: var(--surface-raised); color: var(--accent-strong); font-size: 10px; font-weight: 650; }
.task-sampling-note { margin-bottom: 6px; padding: 7px 9px; border-radius: 7px; background: var(--warning-soft, #fff7df); color: var(--warning-strong, #805700); font-size: 11px; }
.task-sampling-items { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 8px; }
.task-sampling-item { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); background: var(--surface); }
.task-sampling-item:last-child { border-bottom: none; }
.task-sampling-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.task-sampling-item-head span { flex-shrink: 0; color: var(--accent-strong); font-weight: 700; }
.task-sampling-item-meta { margin-top: 3px; color: var(--subtle); font-size: 11px; }
.task-sampling-item-desc { margin-top: 4px; color: var(--muted); font-size: 12px; }
.task-sampling-order-note { margin-top: 6px; color: var(--muted); font-size: 12px; }
.task-sampling-order-note span { margin-right: 6px; color: var(--subtle); }

.task-files { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); }
.task-drawer .task-files { max-height: 240px; overflow-y: auto; }
.task-file-group { padding: 5px 10px; border-bottom: 1px solid var(--border-soft); background: var(--surface-soft); color: var(--subtle); font-size: 11px; font-weight: 650; }
.task-file-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.task-file-row:last-child { border-bottom: none; }
.task-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.task-file-preview { padding: 0; border: none; background: none; color: var(--accent-strong); font: inherit; font-weight: 600; text-align: left; cursor: zoom-in; }
.task-file-preview:hover { text-decoration: underline; }
.task-file-size { flex-shrink: 0; color: var(--subtle); font-size: 11px; }
.task-file-act { flex-shrink: 0; padding: 0; border: none; background: none; color: var(--accent-strong); font-size: 12px; font-weight: 600; cursor: pointer; }
.task-file-act:hover { text-decoration: underline; }

.task-tl { margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--border-soft); list-style: none; }
.task-tl li { position: relative; padding: 0 0 12px 12px; font-size: 12px; }
.task-tl li::before { content: ""; position: absolute; left: -17px; top: 4px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--surface); background: var(--accent); box-shadow: 0 0 0 1px var(--border); }
.task-tl-time { color: var(--subtle); font-size: 11px; }
.task-tl-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.task-tl-attachment { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding-right: 8px; }
.task-tl-attachment .task-tl-file { min-width: 0; }
.task-tl-file { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 8px; border: none; border-radius: 6px; background: var(--surface-raised); color: var(--accent-strong); font-size: 11px; cursor: pointer; }
.task-tl-file:hover { text-decoration: underline; }

.task-dialog {
  width: min(620px, calc(100vw - 28px));
  max-width: 620px;
  max-height: min(84vh, 720px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 70px rgba(16, 37, 66, 0.22);
}

.task-dialog::backdrop { background: rgba(16, 37, 66, 0.44); }
.task-dialog-form { padding: 14px 20px 16px; }
.task-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.task-form-grid .full { grid-column: 1 / -1; }
.task-form-grid input,
.task-form-grid select,
.task-form-grid textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--fg); font: inherit; }
.task-form-grid textarea { min-height: 60px; resize: vertical; }
.task-file-add { margin-top: 6px; font-size: 12px; }
.task-form-error { margin-top: 10px; color: var(--danger); font-size: 12px; }
.task-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }

.task-dialog-wide {
  width: min(1080px, calc(100vw - 28px));
  max-width: 1080px;
}

.task-kind-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--surface-soft);
}

.task-kind-switch button {
  min-width: 112px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.task-kind-switch button.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 1px 4px rgba(16, 37, 66, 0.12);
}

.task-shared-files { margin-top: 14px; }
[data-task-sampling-only] { grid-column: 1 / -1; }

.task-file-kind {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.task-file-kind.recognized { background: var(--success-soft); color: #08783a; }
.task-file-kind.attachment { background: var(--surface-raised); color: var(--muted); }
.task-file-kind.extracted { background: var(--accent-soft); color: var(--accent-strong); }

.smp-ai-assist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 11px 12px;
  border: 1px solid #b8d9f8;
  border-radius: 9px;
  background: #f5faff;
}

.smp-ai-assist-copy strong,
.smp-ai-assist-copy span { display: block; }
.smp-ai-assist-copy strong { color: var(--accent-strong); font-size: 13px; }
.smp-ai-assist-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.smp-ai-button { white-space: nowrap; }
.smp-ai-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 8px; padding-top: 7px; border-top: 1px solid rgba(0, 130, 239, 0.14); color: var(--muted); font-size: 11px; }
.smp-ai-status strong { color: var(--fg); }
.smp-ai-status.success strong { color: var(--success); }
.smp-ai-status.warning strong { color: var(--warning); }
.smp-ai-status.error strong { color: var(--danger); }
.smp-ai-status.loading { color: var(--accent-strong); }

.smp-batch-wrap {
  margin-top: 14px;
  max-height: min(52vh, 620px);
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.smp-batch-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
}

.smp-batch-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  padding: 8px 8px 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
}

.smp-batch-table td {
  padding: 6px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.smp-batch-table tr:last-child td { border-bottom: 0; }

.smp-batch-table input,
.smp-batch-table select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}

.smp-batch-table td:nth-child(1) { min-width: 120px; }
.smp-batch-table td:nth-child(2) { min-width: 150px; }
.smp-batch-table td:nth-child(3) { min-width: 120px; }
.smp-batch-table td:nth-child(4) { min-width: 180px; }
.smp-batch-table td:nth-child(5) { min-width: 100px; }
.smp-batch-table td:nth-child(6) { min-width: 130px; }
.smp-batch-table td:nth-child(7),
.smp-batch-table td:nth-child(8) { min-width: 165px; }

.smp-item-file-note { display: block; margin-top: 3px; color: var(--accent-strong); font-size: 10px; white-space: nowrap; }

.smp-batch-table td:last-child {
  width: 36px;
  text-align: center;
}

.smp-row-del {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.smp-row-del:hover {
  background: var(--surface-raised);
  color: var(--danger);
}

.smp-batch-add { margin-top: 10px; font-size: 12px; }

.sampling-row.row-flash { animation: rowFlash 1200ms ease; }

@media (max-width: 1080px) {
  .app-top {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
  }

  .top-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .top-tools {
    width: 100%;
    justify-self: stretch;
    flex-wrap: wrap;
  }

  .page {
    padding: 18px 16px 34px;
  }

  .page-head,
  .cols-2,
  .cols-3,
  .cols-4,
  .cols-5,
  .detail-grid,
  .dept-admin-grid,
  .member-template-grid,
  .project-meta-grid,
  .project-row-editor-body,
  .project-data-fields,
  .access-block-layout,
  .blocked-capability-grid,
  .gantt-read-guide,
  .template-upload-card,
  .template-editor-head,
  .template-group-tools,
  .assign-group-head {
    grid-template-columns: 1fr;
  }

  .template-node-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
  }

  .template-node-row .row-handle {
    grid-column: 1;
    grid-row: 1;
  }

  .template-node-name {
    grid-column: 2;
    grid-row: 1;
  }

  .template-node-predecessor,
  .template-node-tools {
    grid-column: 1 / -1;
  }

  .template-node-tools {
    justify-self: end;
  }

  .upload-drop {
    min-width: 0;
  }

  .toolbar,
  .notice-strip {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .drawer {
    position: static;
    width: 100%;
    max-height: min(70vh, 720px) !important;
  }

  .sync-layout {
    grid-template-columns: 1fr;
  }

  .sync-dept-panel {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
}

@media (max-width: 620px) {
  .page {
    padding: 14px 12px 28px;
  }

  .stepper,
  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 32px;
  }

  .top-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .top-tabs a,
  .top-tabs button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 0 6px;
  }

  .btn {
    min-height: 44px;
  }

  .node-action-bar { position: sticky; bottom: 0; z-index: 4; margin-inline: -12px; padding: 10px 12px; background: var(--surface); box-shadow: 0 -4px 12px rgba(16, 37, 66, .08); }
  .material-ledger-grid { gap: 8px; }
  .material-row { padding: 10px; }
  .material-row input { min-height: 44px; }
  .material-remove { min-height: 44px; }
  .node-type-options { grid-template-columns: 1fr; }
  .node-add-heading { grid-template-columns: auto minmax(0, 1fr); }
  .node-add-heading .btn { grid-column: 1 / -1; }

  .sync-dialog {
    width: 96vw;
  }

  .sync-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sync-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .leader-row,
  .identity-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sync-row {
    gap: 8px;
  }

  .leader-badges,
  .leader-row input {
    grid-column: 2;
    justify-self: start;
  }

  .sync-state,
  .sync-role-actions,
  .role-pill,
  .role-empty,
  .sync-row input {
    grid-column: 2;
  }
}

/* ========== 打样 V6：打样单列表 → 单据详情 → 物料抽屉 ========== */
.smp-v6-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.smp-v6-kpis .metric { min-width: 0; }
.smp-v6-notice { margin: 0 0 14px; }
.smp-v6-toolbar { margin-top: 0; }
.smp-order-list-panel { margin-top: 14px; overflow-x: auto; }
.smp-order-table { min-width: 1120px; table-layout: auto; }
.smp-order-table th:first-child { min-width: 235px; }
.smp-order-table th:nth-child(4) { min-width: 120px; }
.smp-order-table th:nth-child(5) { min-width: 120px; }
.smp-order-table th:last-child { width: 78px; }
.smp-order-table th:last-child,
.smp-order-table td:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); }
.smp-order-row { cursor: pointer; }
.smp-order-row:hover td { background: var(--surface-soft); }

.smp-v6-order-name {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.smp-v6-order-name > span:last-child { min-width: 0; }
.smp-v6-order-name small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--subtle);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smp-model-link {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.smp-model-link:hover { text-decoration: underline; }
.smp-v6-source {
  display: inline-flex;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  vertical-align: 1px;
}

.smp-v6-flow { display: inline-flex; align-items: center; gap: 4px; }
.smp-v6-flow i {
  width: 17px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
}
.smp-v6-flow i.done { background: var(--success); }
.smp-v6-flow i.now { background: var(--accent); }

.smp-v6-material-mini { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.smp-v6-material-mini progress { width: 76px; height: 8px; accent-color: var(--success); }
.smp-v6-material-mini i { width: 9px; height: 9px; border-radius: 3px; background: var(--border); }
.smp-v6-material-mini i.ok { background: var(--success); }
.smp-v6-material-mini i.late { background: var(--danger); }
.smp-v6-material-mini i.run { background: var(--accent); }
.smp-v6-material-mini em { margin-left: 4px; color: var(--muted); font-size: 11px; font-style: normal; }
.smp-v6-late-text { color: var(--danger); font-weight: 650; }

.smp-v6-back { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.smp-v6-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.smp-v6-detail-head > div:first-child { min-width: 0; }
.smp-v6-detail-head .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.smp-v6-detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.smp-v6-detail-title .smp-model-link,
.smp-v6-detail-title > span:nth-child(2) { color: var(--fg); font-family: var(--font-display); font-size: 27px; font-weight: 700; line-height: 1.2; }

.smp-v6-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 14px;
  align-items: start;
}
.smp-v6-detail-main { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.smp-v6-side { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.smp-v6-card-head {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.smp-v6-card-head h2 { margin: 0; font-family: var(--font-body); font-size: 15px; }
.smp-v6-card-head .smp-v6-material-mini { margin-left: auto; }
.smp-v6-view-toggle { margin-left: 8px; }
.smp-v6-record-card .task-tl { margin: 16px 20px 8px 30px; }

.smp-v6-wait,
.smp-v6-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 16px;
  padding: 13px 14px;
  border: 1px solid var(--warning);
  border-radius: 9px;
  background: var(--warning-soft);
}
.smp-v6-wait.ready,
.smp-v6-alert.good { border-color: var(--success); background: var(--success-soft); }
.smp-v6-alert.bad { border-color: var(--danger); background: var(--danger-soft); }
.smp-v6-wait strong,
.smp-v6-alert strong { display: block; margin-bottom: 2px; font-size: 13px; }
.smp-v6-wait span,
.smp-v6-alert span { color: var(--muted); font-size: 12px; }

.smp-v6-material-head,
.smp-v6-material-row {
  display: grid;
  grid-template-columns: 14px minmax(150px, 1.5fr) 60px 80px 80px 100px 112px 15px;
  gap: 10px;
  align-items: center;
}
.smp-v6-material-scroll { max-height: min(65vh, 760px); overflow: auto; scroll-padding-top: 34px; }
.smp-v6-material-scroll .smp-v6-material-head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.smp-v6-material-head { padding: 8px 16px; border-bottom: 1px solid var(--border-soft); color: var(--subtle); font-size: 11px; }
.smp-v6-material-row { min-height: 58px; padding: 8px 16px; border-bottom: 1px solid var(--border-soft); font-size: 12px; cursor: pointer; }
.smp-v6-material-row:last-child { border-bottom: 0; }
.smp-v6-material-row:hover { background: var(--surface-soft); }
.smp-v6-material-row .name { min-width: 0; }
.smp-v6-material-row .name strong,
.smp-v6-material-row .name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smp-v6-material-row .name small { margin-top: 2px; color: var(--subtle); font-size: 11px; }
.smp-v6-material-row > span small { display: block; margin-top: 2px; font-size: 10px; }
.smp-v6-state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.smp-v6-state-dot.green { background: var(--success); }
.smp-v6-state-dot.red { background: var(--danger); }
.smp-v6-state-dot.orange { background: var(--warning); }

.smp-todo-group-hint { padding: 0 16px 12px; }
.smp-todo-group-row td { vertical-align: top; }
.smp-buyer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
}
.smp-buyer-toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.smp-buyer-toolbar .date-control { width: 196px; min-width: 196px; }
.smp-buyer-toolbar .muted { flex: 1 1 180px; font-size: 12.5px; }
.smp-buyer-check-all { font-weight: 600; color: var(--fg); }
.smp-v6-material-head.smp-buyer-head,
.smp-v6-material-row.smp-buyer-row {
  grid-template-columns: 28px minmax(0, 0.9fr) minmax(0, 1.4fr) 56px 80px 176px 176px 96px 168px;
  gap: 10px 12px;
  align-items: center;
  cursor: default;
}
.smp-v6-material-head.smp-buyer-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.smp-buyer-head > span,
.smp-buyer-row > span,
.smp-buyer-row > label { min-width: 0; }
.smp-buyer-row:hover { background: var(--surface-soft); }
.smp-buyer-row { font-size: 13px; }
.smp-buyer-row > span,
.smp-buyer-row > label { padding-top: 10px; padding-bottom: 10px; }
.smp-buyer-check { display: flex; align-items: center; justify-content: center; min-height: 34px; }
.smp-buyer-row > .name small { font-size: 12px; }
.smp-buyer-qty,
.smp-buyer-need,
.smp-buyer-status { text-align: center; }
.smp-buyer-ops { text-align: right; }
.smp-buyer-plan,
.smp-buyer-return { text-align: left; }
.smp-buyer-row > span:has(.date-control) { min-width: 0; overflow: visible; }
.smp-buyer-row .date-control,
.smp-buyer-row .date-control.compact {
  width: 100%;
  min-width: 0;
  height: 34px;
}
.smp-buyer-row .date-control .date-entry {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
}
.smp-buyer-row .date-button {
  min-width: 40px;
  width: 40px;
  flex: 0 0 40px;
  height: 34px;
  padding: 0;
  font-size: 12px;
}
.smp-buyer-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.smp-buyer-row-actions .btn { padding: 4px 10px; font-size: 13px; }
.smp-buyer-others-label {
  padding: 10px 8px 4px;
  border-top: 1px dashed var(--border-soft);
  font-size: 13px;
}
.smp-buyer-other-row { align-items: start; cursor: pointer; }
.smp-buyer-other-row .smp-buyer-ops {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.smp-buyer-other-row .smp-buyer-desc {
  padding-top: 2px;
  padding-bottom: 2px;
}
.smp-buyer-drawer { width: min(1280px, 98vw); font-size: 13px; }
.smp-buyer-drawer .task-drawer-head h3 { font-size: 16px; }
.smp-buyer-drawer .task-drawer-sub { font-size: 13px; }
.smp-buyer-drawer .task-drawer-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.smp-buyer-drawer .smp-v6-material-scroll {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-bottom: 16px;
}
.smp-buyer-workbench-lead { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.smp-buyer-order-files { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-soft); font-size: 13px; }
.smp-buyer-order-files .task-sec { margin: 0 0 8px; font-size: 13px; }
.smp-buyer-extra {
  grid-column: 1 / -1;
  padding: 0 8px 8px 40px;
}
.smp-buyer-desc-col,
.smp-buyer-desc { padding-left: 2px; }
.smp-buyer-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
}
.smp-buyer-spec {
  display: block;
  white-space: pre-line;
  word-break: break-word;
}
.smp-buyer-issue { color: var(--warning); }
.smp-buyer-files .task-files { margin: 0; }
.smp-v6-material-card .smp-v6-material-scroll { overflow-x: auto; }

.smp-v6-time-list { padding: 15px 16px 18px; }
.smp-v6-time-row { display: grid; grid-template-columns: 150px minmax(180px, 1fr) 110px; gap: 12px; align-items: center; min-height: 38px; font-size: 12px; cursor: pointer; }
.smp-v6-time-row:hover strong { color: var(--accent-strong); }
.smp-v6-time-track { position: relative; height: 14px; border-radius: 999px; background: var(--surface-raised); }
.smp-v6-time-track i { position: absolute; top: 5px; height: 4px; border-radius: 999px; background: var(--accent); }
.smp-v6-time-track i.green { background: var(--success); }
.smp-v6-time-track i.red { background: var(--danger); }
.smp-v6-time-track b { position: absolute; top: 2px; width: 9px; height: 9px; transform: translateX(-50%); border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.smp-v6-time-track b.end.green { border-color: var(--success); }
.smp-v6-time-track b.end.red { border-color: var(--danger); }
.smp-v6-time-axis { display: flex; justify-content: space-between; margin: 6px 110px 0 162px; color: var(--subtle); font-size: 10px; }
.smp-v6-empty-inline { padding: 20px; }

.smp-v6-side-hero { padding: 16px; }
.smp-v6-side-hero > span,
.smp-v6-side-hero > small { display: block; color: var(--subtle); font-size: 11px; }
.smp-v6-side-hero > strong { display: block; margin: 5px 0 2px; color: var(--success); font-size: 24px; }
.smp-v6-side-hero > strong.late { color: var(--danger); }
.smp-v6-side-card { padding: 15px 16px; }
.smp-v6-side-card h3 { margin: 0 0 12px; font-size: 13px; }
.smp-v6-side-card dl { display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; margin: 0; font-size: 12px; }
.smp-v6-side-card dt { color: var(--subtle); }
.smp-v6-side-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.smp-v6-side-card > p { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; line-height: 1.6; }
.smp-v6-order-files { margin-top: 12px; }
.smp-v6-progress { padding-left: 3px; }
.smp-v6-progress > div { position: relative; min-height: 45px; padding: 0 0 12px 22px; }
.smp-v6-progress > div::before { position: absolute; top: 2px; left: 0; width: 10px; height: 10px; border: 2px solid var(--border); border-radius: 50%; background: var(--surface); content: ""; }
.smp-v6-progress > div::after { position: absolute; top: 14px; bottom: -2px; left: 5px; width: 1px; background: var(--border-soft); content: ""; }
.smp-v6-progress > div:last-child::after { display: none; }
.smp-v6-progress > div.done::before { border-color: var(--success); background: var(--success); }
.smp-v6-progress > div.now::before { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.smp-v6-progress strong,
.smp-v6-progress small { display: block; }
.smp-v6-progress strong { font-size: 12px; }
.smp-v6-progress small { margin-top: 2px; color: var(--subtle); font-size: 10.5px; }

.smp-model-mask { position: fixed; inset: 0; z-index: 95; background: rgba(16, 37, 66, 0.35); }
.smp-model-drawer { position: fixed; z-index: 96; top: 0; right: 0; bottom: 0; display: flex; width: 520px; max-width: 94vw; flex-direction: column; background: var(--surface); box-shadow: -18px 0 44px rgba(16, 37, 66, 0.2); }
.smp-v6-overview-card { display: block; width: 100%; margin-bottom: 8px; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); color: var(--fg); text-align: left; cursor: pointer; }
.smp-v6-overview-card:hover { border-color: var(--accent); background: var(--surface-soft); }
.smp-v6-overview-card strong,
.smp-v6-overview-card span { display: block; }
.smp-v6-overview-card span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.smp-v6-catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.smp-v6-catalog > span { padding: 8px 10px; border-radius: 7px; background: var(--surface-soft); }
.smp-v6-catalog strong,
.smp-v6-catalog small { display: block; }
.smp-v6-catalog small { margin-top: 2px; color: var(--subtle); font-size: 10px; }
.smp-mobile-material-meta { display: none !important; }

.smp-v6-dialog-note { margin: 0 0 14px; }
.smp-order-item-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.smp-order-item-count { margin-left: auto; color: var(--accent-strong); font-size: 13px; white-space: nowrap; }
.smp-order-item-edit-table th:nth-child(2) { min-width: 150px; }
.smp-order-item-edit-table th:nth-child(4) { min-width: 180px; }
.smp-order-item-edit-table th:nth-child(6) { min-width: 130px; }
.smp-order-item-edit-table th:nth-child(7),
.smp-order-item-edit-table th:nth-child(8) { min-width: 170px; }

@media (max-width: 1180px) {
  .smp-v6-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smp-v6-detail-grid { grid-template-columns: 1fr; }
  .smp-v6-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .task-dialog,
  .task-dialog-wide { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
  .task-dialog-form { padding: 12px; }
  .task-form-grid { grid-template-columns: 1fr; }
  .task-form-grid .full,
  [data-task-sampling-only] { grid-column: 1; }
  .task-kind-switch { display: grid; width: 100%; }
  .task-kind-switch button { min-height: 42px; min-width: 0; }
  .smp-ai-assist { grid-template-columns: 1fr; }
  .smp-ai-button { width: 100%; }
  .smp-ai-status { grid-column: 1; }
  .smp-order-item-tools { align-items: stretch; flex-direction: column; }
  .smp-order-item-tools .btn { width: 100%; }
  .smp-v6-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smp-v6-detail-head { flex-direction: column; }
  .smp-v6-side { grid-template-columns: 1fr; }
  .smp-v6-material-head { display: none; }
  .smp-v6-material-row { grid-template-columns: 12px minmax(130px, 1fr) 78px 14px; }
  .smp-v6-material-row > span:nth-child(3),
  .smp-v6-material-row > span:nth-child(4),
  .smp-v6-material-row > span:nth-child(5),
  .smp-v6-material-row > span:nth-child(6) { display: none; }
  .smp-buyer-head { display: none; }
  .smp-buyer-row { grid-template-columns: 28px minmax(130px, 1fr); }
  .smp-buyer-row > span:nth-child(4),
  .smp-buyer-row > span:nth-child(5),
  .smp-buyer-row > span:nth-child(8) { display: none; }
  .smp-buyer-row > .smp-buyer-desc,
  .smp-buyer-row > span:nth-child(6),
  .smp-buyer-row > span:nth-child(7) {
    display: flex;
    grid-column: 1 / -1;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
  }
  .smp-buyer-row > span:nth-child(6)::before { content: "预计"; color: var(--muted); font-size: 11px; }
  .smp-buyer-row > span:nth-child(7)::before { content: "回样"; color: var(--muted); font-size: 11px; }
  .smp-buyer-row .date-control { min-width: 0; }
  .smp-buyer-row-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 4px; }
  .smp-buyer-toolbar { flex-direction: column; align-items: stretch; }
  .smp-buyer-toolbar .btn,
  .smp-buyer-toolbar .date-control { width: 100%; min-width: 0; }
  .smp-buyer-extra { padding-left: 28px; }
  .smp-mobile-material-meta { display: block !important; margin-top: 3px; color: var(--accent-strong) !important; }
  .smp-v6-time-row { grid-template-columns: 110px minmax(120px, 1fr); }
  .smp-v6-time-row > span { display: none; }
  .smp-v6-time-axis { margin-left: 122px; margin-right: 0; }
}

/* ========== 打样看板 ========== */

/* KPI 行（设计稿 V2） */
.smp-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.smp-tile {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.smp-tile .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.smp-tile .value {
  margin: 6px 0 2px;
  font-size: 34px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.smp-tile .value small {
  margin-left: 2px;
  font-size: 16px;
  font-weight: 600;
  color: var(--subtle);
}

.smp-tile .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--subtle);
}

.smp-delta {
  font-size: 12px;
  font-weight: 650;
}

.smp-delta.good {
  color: var(--success);
}

.smp-delta.bad {
  color: var(--danger);
}

.smp-delta.flat {
  color: var(--subtle);
}

.smp-tile .flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--danger);
}

.smp-tile .flag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

.smp-tile svg.spark {
  position: absolute;
  right: 14px;
  bottom: 12px;
}

/* 卡片与网格 */
.smp-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.smp-grid.cols-32 {
  grid-template-columns: 2fr 1fr;
}

.smp-grid.cols-22 {
  grid-template-columns: 1fr 1fr;
}

.smp-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.smp-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.smp-card-head h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 650;
}

.smp-card-head .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--subtle);
}

.smp-card-body {
  padding: 14px 20px 18px;
}

.smp-card-foot {
  padding: 10px 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
}

.smp-card-foot a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.smp-grid.cols-32 .smp-card:first-child .smp-card-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* 堆叠柱与 tooltip */
.smp-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.smp-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

.smp-chart-wrap {
  position: relative;
}

.smp-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--fg);
  color: #fff;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  transform: translate(-50%, -100%);
}

.smp-tooltip b {
  font-size: 13px;
}

.smp-tooltip .k {
  display: inline-block;
  width: 10px;
  height: 3px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: 2px;
}

/* 需要关注 */
.smp-watch {
  margin: 0;
  padding: 0;
  list-style: none;
}

.smp-watch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

.smp-watch-row:last-child {
  border-bottom: none;
}

.smp-watch-row:hover .who strong {
  color: var(--accent-strong);
}

.smp-watch .who {
  flex: 1;
  min-width: 0;
}

.smp-watch .who strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smp-watch .who span {
  font-size: 12px;
  color: var(--subtle);
}

.smp-watch-empty {
  padding: 11px 0;
}

.smp-chip {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.smp-chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.smp-chip.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

/* 供应商表现（单数横条 + 按时率量表） */
.smp-rank {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.smp-rank td {
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.smp-rank tr:last-child td {
  border-bottom: none;
}

.smp-rank .name {
  width: 88px;
  padding-right: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smp-rank .barcell {
  padding-right: 14px;
}

.smp-rank .bar-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: transparent;
}

.smp-rank .bar-fill {
  height: 8px;
  min-width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.smp-rank .num {
  width: 44px;
  padding-right: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.smp-rank .meter {
  width: 120px;
}

.smp-rank .m-track {
  height: 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  overflow: hidden;
}

.smp-rank .m-fill {
  height: 8px;
  border-radius: 4px 0 0 4px;
  background: var(--accent);
}

.smp-rank .m-fill.low {
  background: var(--warning);
}

.smp-rank .m-fill.bad {
  background: var(--danger);
}

.smp-rank .rate {
  width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 12.5px;
}

/* 责任人在途（从简：点行筛选明细） */
.smp-owner-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  cursor: pointer;
}

.smp-owner-row:last-child {
  border-bottom: none;
}

.smp-owner-row:hover strong {
  color: var(--accent-strong);
}

.smp-owner-row .muted {
  font-size: 12px;
}

.smp-owner-overdue {
  font-size: 12px;
  font-weight: 650;
  color: var(--danger);
}

/* 空状态引导卡 */
.smp-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 40px 20px 34px;
  text-align: center;
}

.smp-empty h2 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 650;
}

.smp-empty p {
  margin: 0 0 10px;
}

/* 筛选条：搜索框弹性，其余固定宽度，窄屏整组换行 */
.sampling-toolbar {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.sampling-toolbar .search {
  flex: 1 1 240px;
  min-width: 200px;
  min-height: 38px;
}

.sampling-toolbar .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.sampling-toolbar .combo-control {
  width: 190px;
}

.sampling-toolbar .combo-button {
  min-height: 38px;
}

.sampling-toolbar .date-control {
  width: 150px;
}

.sampling-date {
  width: 100%;
}

.date-control .date-entry {
  padding: 0 10px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--surface);
  color: var(--fg);
}

.sampling-table .sampling-row {
  cursor: pointer;
}

.sampling-table .sampling-row:hover td {
  background: var(--surface-soft);
}

/* 固定布局下按列分配宽度：日期/数量窄列，文本列吃剩余空间 */
.sampling-table th:nth-child(1) { width: 12%; }
.sampling-table th:nth-child(2) { width: 11%; }
.sampling-table th:nth-child(3) { width: 12%; }
.sampling-table th:nth-child(4) { width: 9%; }
.sampling-table th:nth-child(5) { width: 13%; }
.sampling-table th:nth-child(6) { width: 5%; }
.sampling-table th:nth-child(7),
.sampling-table th:nth-child(8),
.sampling-table th:nth-child(9),
.sampling-table th:nth-child(10) { width: 6%; }
.sampling-table th:nth-child(11),
.sampling-table th:nth-child(12) { width: 5.5%; }
.sampling-table th:nth-child(13) { width: 8%; }

.sampling-clip,
.sampling-desc {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sampling-overdue {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.sampling-round {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sampling-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--border-soft);
}

.sampling-drawer .task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sampling-drawer .task-form-grid .field.full {
  grid-column: 1 / -1;
}

.sampling-tl .sampling-tl-tag {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
}

.sampling-project-link {
  color: var(--accent-strong);
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  cursor: pointer;
}

.activity-toolbar {
  flex-wrap: wrap;
  align-items: center;
}

.activity-toolbar select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.activity-date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.activity-date-range .date-entry {
  width: 132px;
}

.activity-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
  margin-top: 4px;
}

.activity-rank-table td:last-child {
  width: 88px;
}

.activity-bar {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: var(--border-soft);
  overflow: hidden;
}

.activity-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.activity-row {
  cursor: pointer;
}

.activity-summary {
  max-width: 52ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
}

.activity-page-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.activity-page-nums {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.activity-page-nums .btn {
  min-width: 36px;
  padding: 0 8px;
}

.activity-page-nums .btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.activity-page-gap {
  padding: 0 4px;
}

.activity-pager select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 1080px) {
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .smp-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .smp-grid.cols-32,
  .smp-grid.cols-22 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .smp-kpis {
    grid-template-columns: 1fr;
  }

  .sampling-drawer .task-form-grid {
    grid-template-columns: 1fr;
  }
}

.instruction-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.instruction-list {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 108px);
  overflow: hidden;
}

.instruction-list-body {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.instruction-list-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}

.instruction-list-row:hover,
.instruction-list-row.active {
  background: var(--accent-soft);
}

.instruction-list-row > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.instruction-list-row > span:last-child {
  align-items: flex-end;
}

.instruction-list-row small,
.instruction-detail-head small,
.instruction-files small,
.instruction-node small,
.instruction-events small {
  display: block;
  color: var(--muted);
}

.instruction-detail {
  overflow: hidden;
}

.instruction-detail-head {
  align-items: flex-start;
  padding: 20px;
}

.instruction-detail-head h2,
.instruction-detail-head p {
  margin: 3px 0 0;
}

.instruction-detail-head > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.instruction-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-block: 1px solid var(--border);
}

.instruction-meta-grid > span {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
}

.instruction-meta-grid small {
  color: var(--muted);
}

.instruction-section,
.instruction-node-editor,
.instruction-review {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

.instruction-section > h3,
.instruction-node-editor h3,
.instruction-review h3 {
  margin: 0 0 12px;
}

.instruction-files {
  display: grid;
  gap: 8px;
}

.instruction-files a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}

.instruction-primary-action,
.instruction-review,
.instruction-return-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border-top: 1px solid var(--border);
}

.instruction-primary-action > div,
.instruction-return-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.instruction-return-notice {
  align-items: flex-start;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.instruction-node-form {
  display: grid;
  grid-template-columns: 30px minmax(180px, 1fr) minmax(180px, 0.8fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.instruction-node-form input,
.instruction-node-form select {
  width: 100%;
  min-height: 40px;
}

.instruction-node-seq {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.instruction-node-editor .actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.instruction-nodes {
  display: grid;
  gap: 8px;
}

.instruction-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.instruction-node.done {
  background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

.instruction-node p,
.instruction-review p,
.instruction-events p {
  margin: 5px 0 0;
  color: var(--muted);
}

.instruction-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.instruction-events li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
}

.instruction-events li > span {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 900px) {
  .instruction-layout {
    grid-template-columns: 1fr;
  }

  .instruction-list {
    position: static;
    max-height: none;
  }

  .instruction-list-body {
    max-height: 280px;
  }

  .instruction-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .instruction-meta-grid,
  .instruction-node-form {
    grid-template-columns: 1fr;
  }

  .instruction-node-seq {
    display: none;
  }

  .instruction-primary-action,
  .instruction-review {
    align-items: stretch;
    flex-direction: column;
  }
}
