/* 交易管道 */
.deal-switch { margin-bottom: 16px; }

.deal-header {
  display: grid;
  grid-template-columns: 176px 1fr;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.deal-header .thumb {
  width: 176px;
  min-height: 168px;
  height: 100%;
  border-radius: 0;
}
.deal-main {
  min-width: 0;
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deal-title h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.deal-meta b { color: var(--ink); font-weight: 600; }

.deal-kpis {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr auto;
  gap: 16px;
  align-items: start;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.deal-kpis > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.deal-kpis small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.deal-kpis strong { font-size: 17px; font-weight: 800; white-space: nowrap; }
.deal-kpis span { font-size: 11px; color: var(--ink-2); }
.deal-progress { align-items: center; text-align: center; }
.risk-danger { color: var(--danger); }
.risk-wake { color: #9A6613; }
.risk-alive { color: var(--alive); }

.deal-cols { grid-template-columns: 1fr 320px; align-items: start; }
.deal-work { grid-template-columns: 1.15fr 1fr 1fr; align-items: start; }
.deal-bottom { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; }

/* stage gates — warehouse doors */
.gate-rail {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0;
}
.gate {
  position: relative;
  flex: 1;
  min-width: 108px;
  border-radius: var(--r-m);
  border: 1px solid var(--border);
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: doorSlide 450ms var(--ease-door) both;
  background: var(--surface-warm);
}
.gate strong { font-size: 12.5px; }
.gate small { font-size: 10.5px; color: var(--ink-3); }
.gate-note { color: #9A6613 !important; }
.gate-badge {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  margin-bottom: 4px;
  background: var(--idle-bg);
  color: var(--ink-2);
}
.gate-pct {
  position: absolute;
  left: 10px; right: 10px; bottom: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.gate-pct i { display: block; height: 100%; border-radius: 999px; background: var(--idle); }

.gate-done { background: var(--alive-bg); border-color: #CBE3D4; }
.gate-done .gate-badge { background: var(--alive); color: #fff; }
.gate-done .gate-pct i { background: var(--alive); }
.gate-done strong { color: #2E6B44; }

.gate-current {
  background: var(--wake-bg);
  border: 1.5px solid var(--wake);
  flex: 1.35;
  box-shadow: 0 4px 14px rgba(217, 150, 46, 0.18);
}
.gate-current .gate-badge { background: var(--brand-grad); color: #fff; }
.gate-current .gate-pct i { background: var(--brand-grad); }
.gate-current strong { color: #9A6613; font-size: 13.5px; }

.gate-todo { opacity: 0.72; }
.gate-blocked { border-color: var(--danger); }
.gate-block-tag {
  position: absolute;
  top: -8px; right: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
}

.gate-link {
  flex: 0 0 18px;
  align-self: center;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}

.gate-meta {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 9px 12px;
  background: var(--surface-warm);
  border-radius: var(--r-s);
  font-size: 12px;
  color: var(--ink-2);
}
.gate-meta b { color: #9A6613; }

/* tasks */
.task-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.task-row:last-child { border-bottom: 0; }
.task-name { flex: 1; }
.task-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.task-done .task-dot { background: var(--alive); }
.task-done .task-name { color: var(--ink-3); text-decoration: line-through; }
.task-doing .task-dot { background: var(--wake); box-shadow: 0 0 0 3px var(--wake-bg); }
.task-todo .task-dot { background: var(--idle-bg); border: 1.5px solid var(--idle); }

/* next action */
.next-action { background: linear-gradient(180deg, var(--wake-bg), var(--surface) 42%); border-color: #F0DDBB; }
.na-body strong { font-size: 13px; display: block; margin-bottom: 6px; }
.na-body p { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.next-action .btn { margin-top: 10px; }

/* compliance rail */
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.check-name { flex: 1; font-weight: 600; }
.check-ico { width: 20px; text-align: center; }
.check-pass .check-ico { color: var(--alive); }
.check-partial .check-ico { color: var(--wake); }
.check-blocked .check-ico { color: var(--danger); }
.check-na { opacity: 0.6; }

.block-card {
  margin-top: 14px;
  background: var(--danger-bg);
  border: 1px solid #EFC9C2;
  border-radius: var(--r-m);
  padding: 14px;
  font-size: 12px;
}
.block-card strong { font-size: 13px; color: #A03327; display: flex; align-items: center; gap: 6px; }
.block-cite { margin-top: 8px; font-size: 11px; color: #A03327; background: rgba(255, 255, 255, 0.65); border-radius: var(--r-s); padding: 6px 9px; }
.block-sec { margin-top: 8px; }
.block-sec small { font-weight: 700; color: #A03327; }
.block-sec p { color: var(--ink-2); margin-top: 2px; }
.block-reg {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.75);
  border-left: 3px solid var(--danger);
  padding: 8px 10px;
  border-radius: var(--r-s);
  color: var(--ink-2);
  font-size: 11.5px;
}

.clean-note {
  margin-top: 14px;
  background: var(--alive-bg);
  color: #2E6B44;
  border-radius: var(--r-s);
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

@media (max-width: 1440px) {
  .deal-work, .deal-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 1360px) {
  .deal-cols { grid-template-columns: 1fr; }
  .deal-header { grid-template-columns: 1fr; }
  .deal-header .thumb { width: 100%; height: 160px; min-height: 160px; }
  .deal-kpis { grid-template-columns: 1fr 1fr; }
}
