/* ==========================================================================
   cockpit.css — 驾驶舱五视图：全景 / 问题 / 机会 / 推演 / 执行
   ========================================================================== */

/* ---------- 通用图表容器 ---------- */

.chart-box {
  position: relative;
  width: 100%;
  height: 190px;
}

.chart-box--sm {
  height: 150px;
}

.chart-box--lg {
  height: 220px;
}

.chart-box--donut {
  height: 138px;
  width: 138px;
  margin: 0 auto;
}

.chart-fallback {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-3);
  font-size: 11px;
  text-align: center;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  line-height: 1.6;
}

.chart-note {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.5;
  margin-top: 4px;
}

/* ---------- 视图头 ---------- */

.view-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
}

.view-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.view-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.view-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.5;
}

.view-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- 经营全景：企业画像 ---------- */

.ov-profile .card-body {
  padding: 12px 14px;
}

.ov-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ov-logo {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  background: linear-gradient(160deg, #efdfbd, var(--gold));
  border: 1px solid rgba(200, 161, 90, 0.6);
}

.ov-name {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.3;
}

.ov-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ov-tags .chip {
  font-size: 10px;
  padding: 0 5px;
}

.ov-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 560px) {
  .ov-profile-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.ov-profile-grid .kv {
  grid-template-columns: 66px minmax(0, 1fr);
}

/* 完整性环 */
.comp-card .card-body {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.comp-ring-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
}

.comp-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.comp-center b {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.comp-center span {
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.comp-side {
  min-width: 0;
  flex: 1 1 auto;
}

.comp-side-head {
  font-size: 10.5px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.comp-counts {
  display: flex;
  gap: 10px;
  margin-bottom: 7px;
}

.comp-counts div {
  line-height: 1.25;
}

.comp-counts b {
  display: block;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.comp-counts span {
  font-size: 9.5px;
  color: var(--text-3);
}

.missing-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 92px;
  overflow-y: auto;
}

.missing-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.missing-item .icon {
  width: 11px;
  height: 11px;
  color: var(--warn);
  flex: 0 0 auto;
  transform: translateY(1px);
}

.missing-item b {
  font-weight: 550;
  color: var(--text);
}

.missing-item span {
  color: var(--text-3);
}

/* ---------- KPI ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 8px;
}

.kpi {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  min-width: 0;
}

.kpi:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.kpi[aria-expanded="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-wash);
}

.kpi-label {
  font-size: 10.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-label .icon {
  width: 11px;
  height: 11px;
  color: var(--gold-strong);
}

.kpi-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.kpi-value small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 2px;
  letter-spacing: 0;
}

.kpi-value.value-missing {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  padding-top: 3px;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  flex-wrap: wrap;
}

.kpi-foot .chip {
  font-size: 9.5px;
  padding: 0 5px;
  line-height: 1.55;
}

.kpi-arrow {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 11px;
  height: 11px;
  color: var(--text-3);
  opacity: 0.65;
}

.kpi-detail {
  grid-column: 1 / -1;
  border: 1px solid var(--gold);
  border-radius: 9px;
  background: #fffdf8;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  box-shadow: var(--shadow-1);
}

.kpi-detail-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 650;
  font-size: 12px;
}

.kpi-detail .kv {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 4px 10px;
}

.kpi-detail-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.formula {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--surface-3);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-2);
  display: inline-block;
  overflow-wrap: anywhere;
}

/* ---------- 关键问题 / 风险列表 ---------- */

.risk-list,
.issue-list {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.5;
  width: 100%;
  text-align: left;
  transition: background var(--dur-1) var(--ease);
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row:hover {
  background: var(--surface-2);
}

.mini-row .sev {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  flex: 0 0 auto;
  margin: 1px 0;
  background: var(--line-strong);
}

.mini-row .sev[data-level="high"] {
  background: var(--danger);
}

.mini-row .sev[data-level="medium"] {
  background: var(--warn);
}

.mini-row .sev[data-level="low"] {
  background: var(--info);
}

.mini-row-main {
  min-width: 0;
  flex: 1 1 auto;
}

.mini-row-title {
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

.mini-row-sub {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
  line-height: 1.45;
}

.mini-row .chip {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* 维度覆盖 */
.dim-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dim-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.dim-name {
  color: var(--text-2);
  white-space: nowrap;
}

.dim-row .bar {
  height: 7px;
}

.dim-count {
  text-align: right;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.dim-row[data-tone="weak"] .dim-name {
  color: var(--warn);
  font-weight: 550;
}

/* ---------- 问题与证据 ---------- */

.iss-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 640px) {
  .iss-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-tile {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.stat-tile b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.stat-tile span {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.stat-tile[data-tone="danger"] b {
  color: var(--danger);
}

.stat-tile[data-tone="warn"] b {
  color: var(--warn);
}

.stat-tile[data-tone="success"] b {
  color: var(--success);
}

.tree {
  font-size: 11.5px;
}

.tree details {
  border-bottom: 1px solid var(--line);
}

.tree details:last-child {
  border-bottom: 0;
}

.tree summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 12px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.5;
  transition: background var(--dur-1) var(--ease);
}

.tree summary::-webkit-details-marker {
  display: none;
}

.tree summary:hover {
  background: var(--surface-2);
}

.tree summary .chev {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--text-3);
  transition: transform var(--dur-1) var(--ease);
}

.tree details[open] > summary .chev {
  transform: rotate(90deg);
}

.tree summary .leaf-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: 0 0 auto;
  margin: 7px 3px 0;
}

.tree .children {
  padding: 0 12px 6px 26px;
}

.tree .children .node {
  padding: 4px 0 4px 0;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.5;
  border-top: 1px dashed var(--line);
}

.tree .children .node:first-child {
  border-top: 0;
}

.tree .children .node .leaf-dot {
  margin-top: 6px;
}

.node-main {
  min-width: 0;
  flex: 1 1 auto;
}

.node-title {
  color: var(--text);
}

.node-sub {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
}

.legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 7px 12px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--text-3);
}

.conflict-banner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 12px;
  background: var(--danger-soft);
  border-bottom: 1px solid rgba(180, 69, 60, 0.2);
  font-size: 11px;
  color: #7d2b25;
  line-height: 1.55;
}

.conflict-banner .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.conflict-banner b {
  color: #671f1a;
}

.iss-facts .tbl td {
  vertical-align: top;
}

.fact-val {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  color: var(--navy);
}

.fact-val.missing {
  color: var(--text-3);
  font-weight: 450;
}

.fact-key {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
}

/* ---------- 战略机会 ---------- */

.op-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color var(--dur-1) var(--ease);
}

.op-card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-wash), var(--shadow-1);
}

.op-card.is-deferred {
  opacity: 0.72;
}

.op-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.op-card.is-selected .op-card-head {
  background: #fffaf0;
}

.op-rank {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.op-card.is-selected .op-rank {
  background: var(--gold);
  color: var(--navy);
}

.op-name {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-type {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
}

.op-score {
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
  line-height: 1.2;
}

.op-score b {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.op-score span {
  font-size: 9px;
  color: var(--text-3);
  display: block;
}

.op-card-body {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-desc {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.55;
}

.op-figs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 620px) {
  .op-figs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.op-fig {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: var(--surface-2);
  min-width: 0;
}

.op-fig b {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-fig span {
  display: block;
  font-size: 9px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-res {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.op-res-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: var(--text-3);
}

.op-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}

.op-card-foot .btn {
  margin-left: auto;
}

.deferred-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 11px;
  line-height: 1.5;
}

.deferred-row:last-child {
  border-bottom: 0;
}

.deferred-row .icon {
  width: 12px;
  height: 12px;
  color: var(--warn);
  margin-top: 2px;
  flex: 0 0 auto;
}

/* ---------- 方案推演 ---------- */

.sim-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.sim-summary .kv-row {
  border: 0;
  padding: 0;
  gap: 6px;
  font-size: 11px;
}

.sim-summary .kv-row > span:first-child {
  color: var(--text-3);
}

.sim-summary .kv-row > span:last-child {
  font-weight: 600;
  color: var(--navy);
}

.sim-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 10px;
}

@media (max-width: 1000px) {
  .sim-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 720px) {
  .scenario-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.scenario {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 9px 10px;
  box-shadow: var(--shadow-1);
  border-top: 3px solid var(--line-strong);
}

.scenario[data-kind="optimistic"] {
  border-top-color: var(--success);
}

.scenario[data-kind="base"] {
  border-top-color: var(--info);
}

.scenario[data-kind="stress"] {
  border-top-color: var(--danger);
  background: #fffbfa;
}

.scenario-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.scenario-name {
  font-size: 11.5px;
  font-weight: 650;
}

.scenario-head .chip {
  margin-left: auto;
}

.scenario-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
}

.scenario-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px dashed var(--line);
}

.scenario-row:last-child {
  border-bottom: 0;
}

.scenario-row span {
  color: var(--text-3);
}

.scenario-row b {
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.scenario-row b.neg {
  color: var(--danger);
}

.scenario-note {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.5;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
}

.waterfall-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--text-3);
  padding: 0 12px 9px;
}

.waterfall-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: 0;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 860px) {
  .board-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.board-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--info);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 10px;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.board-card[data-stance="finance"] {
  border-left-color: var(--warn);
}

.board-card[data-stance="opposition"] {
  border-left-color: var(--danger);
}

.board-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-stance {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--text-3);
  text-transform: uppercase;
}

.board-head .chip {
  margin-left: auto;
}

.board-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.45;
}

.board-detail {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.6;
}

.board-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
  flex-wrap: wrap;
}

.board-foot .btn {
  padding: 2px 7px;
  font-size: 10.5px;
}

.board-foot .chip {
  font-size: 9.5px;
}

.board-foot .btn {
  margin-left: auto;
}

.verdict {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf7, #fff);
  border: 1px solid rgba(200, 161, 90, 0.45);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text);
}

.verdict .icon {
  width: 15px;
  height: 15px;
  color: var(--gold-strong);
  flex: 0 0 auto;
  margin-top: 1px;
}

.verdict b {
  color: var(--navy);
}

/* ---------- 执行系统 ---------- */

.gantt {
  font-size: 11px;
}

.gantt-head {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 12px 4px;
  color: var(--text-3);
  font-size: 9.5px;
  border-bottom: 1px solid var(--line);
}

.gantt-scale {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.gantt-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line);
}

.gantt-row:last-child {
  border-bottom: 0;
}

.gantt-label {
  min-width: 0;
  line-height: 1.35;
}

.gantt-label b {
  font-weight: 550;
  font-size: 11px;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-label span {
  font-size: 9px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.gantt-track {
  position: relative;
  height: 16px;
  border-radius: 4px;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 4px;
  background: var(--info);
  opacity: 0.9;
  min-width: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 4px;
  font-size: 8.5px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  transition: filter var(--dur-1) var(--ease);
}

.gantt-bar:hover {
  filter: brightness(1.08);
}

.gantt-bar[data-status="done"] {
  background: var(--success);
}

.gantt-bar[data-status="in_progress"] {
  background: var(--gold-strong);
}

.gantt-bar[data-status="blocked"] {
  background: var(--danger);
}

.gantt-bar[data-kind="milestone"] {
  background: var(--navy);
  border-radius: 3px;
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--danger);
  opacity: 0.65;
}

.gantt-today::before {
  content: "";
  position: absolute;
  top: 1px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
}

.gantt-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 7px 12px;
  font-size: 10px;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.gantt-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}

.ex-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.ex-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  box-shadow: var(--shadow-1);
  border-left: 3px solid var(--success);
}

.ex-kpi[data-tone="warn"] {
  border-left-color: var(--warn);
  background: #fffdf8;
}

.ex-kpi[data-tone="danger"] {
  border-left-color: var(--danger);
  background: #fffbfa;
}

.ex-kpi[data-tone="unknown"] {
  border-left-color: var(--line-strong);
  background: var(--surface-2);
}

.ex-kpi-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.ex-kpi-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  margin-top: 2px;
}

.ex-kpi-val.value-missing {
  font-size: 12.5px;
  font-weight: 500;
}

.ex-kpi-meta {
  font-size: 9.5px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.45;
}

.ex-kpi-meta b {
  color: var(--text-2);
  font-weight: 600;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.review-item {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-2);
}

.review-item .icon {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  flex: 0 0 auto;
  color: var(--success);
}

.review-item[data-kind="trigger"] .icon {
  color: var(--warn);
}

.review-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: var(--text-3);
}

.review-meta b {
  color: var(--text-2);
  font-weight: 600;
}

/* ---------- 小屏适配 ---------- */

@media (max-width: 760px) {
  .view-head {
    flex-direction: column;
    gap: 7px;
  }

  .view-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .comp-card .card-body {
    flex-direction: column;
    align-items: stretch;
  }

  .comp-ring-wrap {
    margin: 0 auto;
  }

  .kpi-value {
    font-size: 17px;
  }

  .gantt-head,
  .gantt-row {
    grid-template-columns: 84px minmax(0, 1fr);
    padding-left: 8px;
    padding-right: 8px;
  }

  .tree .children {
    padding-left: 18px;
  }
}

/* ==========================================================================
   布局补充：全景顶部两列 / 问题树根节点
   ========================================================================== */

.ov-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .ov-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

.iss-root {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfaf6, #fff);
}

.tree summary .node-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tree summary > .chip {
  margin-left: 4px;
  flex: 0 0 auto;
}

.tree .children .node {
  padding-right: 10px;
}

.tree .children .node-title {
  font-weight: 450;
}

/* 机会对比：原生条形（在窄栏里比 canvas 更清晰） */
.op-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 4px;
}

.op-bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--text-2);
  padding: 3px 5px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.op-bar-row[data-action] {
  cursor: pointer;
}

.op-bar-row:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.op-bar-row.is-selected {
  background: #fffaf0;
  border-color: rgba(200, 161, 90, 0.35);
}

.op-bar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.op-bar-row.is-selected .op-bar-label {
  font-weight: 600;
  color: var(--navy);
}

.op-bar-track {
  height: 12px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  display: block;
}

.op-bar-track > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(43, 92, 138, 0.75), var(--info));
}

.op-bar-row.is-selected .op-bar-track > i {
  background: linear-gradient(90deg, var(--gold-strong), var(--gold));
}

.op-bar-value {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.conflict-groups {
  flex: 1;
  min-width: 0;
}

.conflict-group {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-1);
}

.conflict-candidate,
.fact-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.conflict-candidate {
  padding-top: 5px;
}

.conflict-source {
  flex: 1 1 120px;
  min-width: 0;
}

.conflict-source button {
  white-space: normal;
  overflow-wrap: anywhere;
}

.fact-row-actions {
  justify-content: flex-end;
}

.fact-edit-fields {
  display: grid;
  gap: 7px;
}

.fact-edit-fields[hidden] {
  display: none;
}
