/* ==========================================================================
   SCM 流程图 / SOP 视图
   --------------------------------------------------------------------------
   配色纪律（这是这套界面唯一需要记住的规则）：
     · 默认全灰 —— 90% 的元素是 #64748b / #0f172a，不抢戏
     · 琥珀 #d97706 —— 接近标准时长，还没超
     · 红   #dc2626 —— 已超时
     · 阶段色       —— 只用在阶段编号与选中态，不参与警示
   刻意不做的事：不用 emoji（与侧栏线性 SVG 图标语言冲突）、
   不把每个节点都塞一颗实心红按钮（红色一多就不红了）、
   不用整块红底表达瓶颈（那会让整页失去重点）。
   ========================================================================== */

.sop-wrap { padding-bottom: 8px; }

/* ============ 页头 ============ */
.sop-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.sop-head h2 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 4px; letter-spacing: -.2px; }
.sop-head .sub { font-size: 12.5px; color: #64748b; line-height: 1.6; }
.sop-head .sub b { color: #334155; font-weight: 600; }

/* ============ 汇总条 ============ */
.sop-sum {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: nowrap;
  margin-bottom: 14px;
}
.sop-chip {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid #e8edf5;
}
.sop-chip .sc-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  display: flex; align-items: center; justify-content: center;
  background: #f4f7fc; color: #64748b;
}
.sop-chip .sc-ico svg { width: 17px; height: 17px; }
.sop-chip .sc-body { min-width: 0; }
.sop-chip .sc-k { font-size: 11px; color: #8794a8; letter-spacing: .3px; white-space: nowrap; }
.sop-chip .sc-v {
  font-size: 17px; font-weight: 700; color: #0f172a; line-height: 1.25;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sop-chip .sc-v small { font-size: 11px; font-weight: 500; color: #8794a8; margin-left: 2px; }
.sop-chip.is-warn { border-color: #fde5c4; background: #fffdf8; }
.sop-chip.is-warn .sc-ico { background: #fff5e6; color: #d97706; }
.sop-chip.is-warn .sc-v { color: #b45309; }
.sop-chip.is-danger { border-color: #fbd9d9; background: #fffafa; }
.sop-chip.is-danger .sc-ico { background: #fdeeee; color: #dc2626; }
.sop-chip.is-danger .sc-v { color: #b91c1c; }
.sop-chip.is-mute .sc-v { color: #475569; }

/* ============ 阶段轨 ============ */
.sop-stages {
  display: flex; gap: 8px; flex-wrap: nowrap;
  margin-bottom: 12px;
}
.sop-stage {
  flex: 1 1 0; min-width: 0;
  position: relative; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #e8edf5; border-radius: 10px;
  padding: 10px 11px 9px;
  transition: border-color .16s, box-shadow .16s, transform .16s;
  font: inherit;
}
.sop-stage:hover { border-color: #c7d2e3; box-shadow: 0 2px 10px rgba(15, 23, 42, .06); }
.sop-stage.is-active {
  border-color: var(--sc, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc, #2563eb) 12%, transparent);
}
.sop-stage.is-active::after {
  content: ''; position: absolute; left: 11px; right: 11px; bottom: -1px; height: 2px;
  background: var(--sc, #2563eb); border-radius: 2px 2px 0 0;
}
.sop-stage .ss-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sop-stage .ss-idx {
  width: 16px; height: 16px; border-radius: 5px; flex: 0 0 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; background: var(--sc, #2563eb);
  opacity: .85;
}
.sop-stage .ss-name {
  font-size: 12.5px; font-weight: 600; color: #0f172a; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sop-stage .ss-num {
  font-size: 20px; font-weight: 700; color: #0f172a; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sop-stage .ss-num span { font-size: 11px; font-weight: 500; color: #94a3b8; margin-left: 2px; }
.sop-stage .ss-meta {
  font-size: 10.5px; color: #94a3b8; margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sop-stage .ss-meta b { color: #d97706; font-weight: 600; }
.sop-stage .ss-meta b.hot { color: #dc2626; }
.sop-stage .ss-bar {
  height: 3px; border-radius: 2px; background: #eef2f8; margin-top: 7px; overflow: hidden;
}
.sop-stage .ss-bar i { display: block; height: 100%; border-radius: 2px; background: #16a34a; transition: width .3s; }
.sop-stage[data-level="warn"] .ss-bar i { background: #d97706; }
.sop-stage[data-level="danger"] .ss-bar i { background: #dc2626; }
.sop-stage[data-level="idle"] .ss-bar i { background: #cbd5e1; }

/* ============ 节点面板 ============ */
.sop-panel {
  background: #fff; border: 1px solid #e8edf5; border-radius: 12px;
  padding: 14px 16px 13px; margin-bottom: 12px;
}
.sop-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.sop-panel-head .ph-l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sop-panel-head .ph-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.sop-panel-head .ph-desc { font-size: 12px; color: #8794a8; }
.sop-legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #94a3b8; flex-wrap: wrap; }
.sop-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.sop-nodes { display: flex; gap: 10px; flex-wrap: nowrap; }
.sop-nodes.is-many .sop-node { min-width: 0; }

/* 节点卡 */
.sop-node {
  flex: 1 1 0; min-width: 0;
  position: relative; cursor: pointer;
  background: #fff; border: 1px solid #e8edf5; border-radius: 10px;
  padding: 11px 12px 10px;
  transition: border-color .16s, box-shadow .16s;
}
.sop-node:hover { border-color: #bcc9dd; box-shadow: 0 3px 12px rgba(15, 23, 42, .07); }
.sop-node[data-level="danger"] { border-color: #f3d4d4; }
.sop-node[data-level="warn"] { border-color: #f7e3c8; }
/* 瓶颈只用一条左侧竖条表达，不整块染色 */
.sop-node.is-bottleneck::before {
  content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 3px; background: #dc2626;
}
.sn-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sn-ico { flex: 0 0 16px; color: #64748b; display: flex; }
.sn-ico svg { width: 16px; height: 16px; }
.sn-name {
  font-size: 12.5px; font-weight: 600; color: #0f172a; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto;
}
.sn-bell {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 1px;
  color: #b6c2d4; font-size: 10px; font-weight: 600;
}
.sn-bell svg { width: 13px; height: 13px; }
.sn-bell.on { color: #2563eb; }
.sn-bell.fail { color: #dc2626; }

.sn-main { display: flex; align-items: baseline; gap: 4px; }
.sn-main b {
  font-size: 22px; font-weight: 700; line-height: 1.1; color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.sn-main b.warn { color: #b45309; }
.sn-main b.danger { color: #b91c1c; }
.sn-main b.idle { color: #b6c2d4; }
.sn-main span { font-size: 10.5px; color: #94a3b8; }
.sn-meta {
  font-size: 10.5px; color: #94a3b8; margin-top: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sn-meta .hot { color: #dc2626; font-weight: 600; }
.sn-meta .stale { color: #a8b3c4; }

/* 三段判定条 */
.sn-flow { margin-top: 8px; }
.sf-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: #eef2f8; }
.sf-bar i { display: block; height: 100%; }
.sf-bar .sf-pass { background: #34d399; }
.sf-bar .sf-rej { background: #fca5a5; }
.sf-bar .sf-open { background: #c7d5ea; }
.sf-legend {
  display: flex; gap: 8px; margin-top: 4px; font-size: 10px; color: #94a3b8;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.sf-legend em { font-style: normal; color: #475569; font-weight: 600; }
.sf-legend .lg-pass { color: #059669; }
.sf-legend .lg-rej { color: #dc2626; }

.sn-sla {
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed #eef2f8;
  font-size: 10px; color: #a8b3c4; display: flex; justify-content: space-between; gap: 6px;
}
.sn-sla b { color: #64748b; font-weight: 600; }

/* ============ 底部：口径与通道 ============ */
.sop-foot {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px;
}
.sop-note {
  background: #fbfcfe; border: 1px solid #eef2f8; border-radius: 10px;
  padding: 11px 13px;
}
.sop-note .nt-t { font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.sop-note ul { margin: 0; padding-left: 16px; }
.sop-note li { font-size: 11.5px; color: #64748b; line-height: 1.8; }
.sop-note li b { color: #334155; font-weight: 600; }

.sop-chan { background: #fff; border: 1px solid #e8edf5; border-radius: 10px; padding: 11px 13px; }
.sop-chan .nt-t { font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 8px; }
.chan-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 0; border-bottom: 1px dashed #f1f5f9; font-size: 11.5px;
}
.chan-row:last-child { border-bottom: 0; }
.chan-row .cr-l { display: flex; align-items: center; gap: 6px; color: #475569; }
.chan-row .cr-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.chan-row .cr-dot.on { background: #16a34a; }
.chan-row .cr-dot.off { background: #cbd5e1; }
.chan-row .cr-r { font-variant-numeric: tabular-nums; color: #64748b; }
.chan-row .cr-r b { color: #0f172a; }
.chan-row .cr-r em { font-style: normal; color: #dc2626; }

/* ============ 抽屉：SOP 卡 ============ */
.sop-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .28);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 218;
}
.sop-mask.open { opacity: 1; pointer-events: auto; }
.sop-drw {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 94vw;
  background: #fff; box-shadow: -8px 0 32px rgba(15, 23, 42, .14);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.3, .8, .3, 1);
  z-index: 220; display: flex; flex-direction: column;
}
.sop-drw.open { transform: translateX(0); }
.sdrw-head {
  padding: 16px 20px 13px; border-bottom: 1px solid #eef2f8;
  display: flex; align-items: flex-start; gap: 12px;
}
.sdrw-head .dh-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px;
  display: flex; align-items: center; justify-content: center;
  background: #f4f7fc; color: #2563eb;
}
.sdrw-head .dh-ico svg { width: 20px; height: 20px; }
.sdrw-head h3 { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0 0 3px; }
.sdrw-head .dh-sub { font-size: 11.5px; color: #8794a8; }
.sdrw-head .dh-x {
  margin-left: auto; cursor: pointer; border: 0; background: none;
  color: #94a3b8; font-size: 20px; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.sdrw-head .dh-x:hover { background: #f1f5f9; color: #334155; }
.sdrw-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 20px 24px; }

.sdrw-kpis { display: flex; gap: 8px; margin-bottom: 14px; }
.sdrw-kpi {
  flex: 1 1 0; min-width: 0; padding: 9px 11px;
  background: #fbfcfe; border: 1px solid #eef2f8; border-radius: 9px;
}
.sdrw-kpi .sk-k { font-size: 10.5px; color: #94a3b8; }
.sdrw-kpi .sk-v {
  font-size: 17px; font-weight: 700; color: #0f172a; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.sdrw-kpi .sk-v small { font-size: 10.5px; font-weight: 500; color: #94a3b8; }
.sdrw-kpi.is-danger { background: #fffafa; border-color: #fbd9d9; }
.sdrw-kpi.is-danger .sk-v { color: #b91c1c; }
.sdrw-kpi.is-warn { background: #fffdf8; border-color: #fde5c4; }
.sdrw-kpi.is-warn .sk-v { color: #b45309; }

.sdrw-sec { margin-bottom: 16px; }
.sdrw-sec > h4 {
  font-size: 12px; font-weight: 700; color: #334155; margin: 0 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.sdrw-sec > h4::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px; background: #2563eb;
}
.sdrw-sec > h4 span { font-weight: 400; color: #94a3b8; font-size: 11px; }

/* SOP 卡表格 */
.sop-tbl { width: 100%; border-collapse: collapse; }
.sop-tbl th, .sop-tbl td {
  text-align: left; vertical-align: top; padding: 7px 8px;
  font-size: 12px; line-height: 1.65; border-bottom: 1px solid #f4f7fb;
}
.sop-tbl th {
  width: 74px; color: #8794a8; font-weight: 500; white-space: nowrap;
  background: #fbfcfe;
}
.sop-tbl td { color: #334155; }
.sop-tbl td b { color: #0f172a; }
.sop-tbl tr:last-child th, .sop-tbl tr:last-child td { border-bottom: 0; }

/* 判定三段（大号） */
.sdrw-flow { display: flex; gap: 10px; align-items: center; }
.sdrw-flow .df-bar { flex: 1 1 auto; height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: #eef2f8; }
.sdrw-flow .df-bar i { display: block; height: 100%; }
.sdrw-flow .df-n { font-size: 11.5px; color: #64748b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sdrw-flow .df-n b { font-weight: 700; }
.sdrw-flow .df-n .p { color: #059669; }
.sdrw-flow .df-n .r { color: #dc2626; }

/* 趋势 */
.sop-trend { display: flex; align-items: flex-end; gap: 3px; height: 54px; }
.sop-trend .td {
  flex: 1 1 0; background: #dbe6f5; border-radius: 3px 3px 0 0; position: relative;
  min-height: 2px; transition: background .15s;
}
.sop-trend .td.hot { background: #fca5a5; }
.sop-trend .td:hover { background: #2563eb; }
.sop-trend-x { display: flex; gap: 3px; margin-top: 4px; }
.sop-trend-x span { flex: 1 1 0; font-size: 9px; color: #b6c2d4; text-align: center; }

/* 样本表 */
.sop-samples { width: 100%; border-collapse: collapse; }
.sop-samples th {
  font-size: 11px; color: #8794a8; font-weight: 500; text-align: left;
  padding: 5px 6px; border-bottom: 1px solid #eef2f8; white-space: nowrap;
}
.sop-samples td {
  font-size: 11.5px; color: #334155; padding: 5px 6px; border-bottom: 1px solid #f6f8fc;
}
.sop-samples tr:last-child td { border-bottom: 0; }
.sop-samples .num { text-align: right; font-variant-numeric: tabular-nums; }
.sop-samples .hot { color: #dc2626; font-weight: 600; }

/* 通知配置 */
.rule-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed #f1f5f9; font-size: 11.5px; flex-wrap: wrap;
}
.rule-row:last-child { border-bottom: 0; }
.rule-row .rr-ev {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: #eef2f8; color: #475569; font-weight: 600;
}
.rule-row .rr-ev.overdue { background: #fef1f1; color: #b91c1c; }
.rule-row .rr-ch { color: #64748b; }
.rule-row .rr-roles { color: #334155; }
.rule-row .rr-th { margin-left: auto; color: #94a3b8; font-variant-numeric: tabular-nums; }

.log-row {
  display: flex; gap: 8px; padding: 5px 0; font-size: 11px; color: #64748b;
  border-bottom: 1px dashed #f6f8fc;
}
.log-row:last-child { border-bottom: 0; }
.log-row .lr-t { color: #a8b3c4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-row .lr-ok { color: #059669; }
.log-row .lr-fail { color: #dc2626; }

.sdrw-foot {
  padding: 12px 20px; border-top: 1px solid #eef2f8; display: flex; gap: 8px;
  align-items: center; background: #fbfcfe;
}
.sdrw-foot .sp { flex: 1 1 auto; }

/* 空态 */
.sop-empty {
  padding: 26px 0; text-align: center; color: #94a3b8; font-size: 12px;
}

/* ============ 工作台嵌入版（紧凑） ============ */
.sop-mini { margin-bottom: 16px; }
.sop-mini-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.sop-mini-head .sm-l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sop-mini-head .sm-t { font-size: 14px; font-weight: 700; color: #0f172a; }
.sop-mini-head .sm-s { font-size: 11.5px; color: #8794a8; }
.sop-mini-flow { display: flex; align-items: stretch; gap: 0; }
.sop-mini-step {
  flex: 1 1 0; min-width: 0; position: relative; cursor: pointer;
  padding: 9px 10px; border: 1px solid #e8edf5; border-radius: 8px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.sop-mini-step:hover { border-color: #c7d2e3; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
.sop-mini-step + .sop-mini-step { margin-left: 14px; }
.sop-mini-step + .sop-mini-step::before {
  content: ''; position: absolute; left: -12px; top: 50%; width: 8px; height: 1px; background: #d9e2ef;
}
.sop-mini-step + .sop-mini-step::after {
  content: ''; position: absolute; left: -6px; top: calc(50% - 2.5px);
  border-left: 4px solid #d9e2ef; border-top: 2.5px solid transparent; border-bottom: 2.5px solid transparent;
}
.sop-mini-step .ms-top { display: flex; align-items: center; gap: 5px; }
.sop-mini-step .ms-i {
  width: 13px; height: 13px; border-radius: 3px; flex: 0 0 13px;
  font-size: 9px; font-weight: 700; color: #fff; display: flex;
  align-items: center; justify-content: center; background: var(--sc, #2563eb); opacity: .8;
}
.sop-mini-step .ms-n {
  font-size: 11px; color: #475569; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sop-mini-step .ms-v {
  font-size: 17px; font-weight: 700; color: #0f172a; line-height: 1.2; margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.sop-mini-step .ms-v small { font-size: 10px; font-weight: 500; color: #94a3b8; margin-left: 1px; }
.sop-mini-step .ms-v.hot { color: #b91c1c; }
.sop-mini-step .ms-m { font-size: 10px; color: #94a3b8; margin-top: 1px; white-space: nowrap; }
.sop-mini-step .ms-m b { color: #d97706; font-weight: 600; }
.sop-mini .sm-note {
  margin-top: 8px; font-size: 10.5px; line-height: 1.5; color: #94a3b8;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 6px; padding: 5px 9px;
}
.sop-mini .sm-note b { color: #64748b; font-weight: 600; }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .sop-sum { flex-wrap: wrap; }
  .sop-chip { flex: 1 1 calc(50% - 5px); }
  .sop-foot { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sop-stages { overflow-x: auto; padding-bottom: 4px; }
  .sop-stage { flex: 0 0 132px; }
  .sop-nodes { overflow-x: auto; padding-bottom: 4px; }
  .sop-node { flex: 0 0 156px; }
  .sop-mini-flow { overflow-x: auto; padding-bottom: 4px; }
  .sop-mini-step { flex: 0 0 118px; }
  .sdrw-kpis { flex-wrap: wrap; }
  .sdrw-kpi { flex: 1 1 calc(50% - 4px); }
}

/* ==========================================================================
   通用小件（需求计划 / 生产协同 / 数据集成 三个页面共用）
   与 SCM 既有卡片语言保持一致：白底、1px 描边、不加阴影、不加渐变
   ========================================================================== */
.mod-sub { font-size: 11.5px; font-weight: 400; color: #94a3b8; margin-left: 8px; }
/* 表格里的「议题」小字：单独一行，不能跟结论挤在同一行里 */
.mod-sub-line { display: block; font-size: 12px; color: #94a3b8; line-height: 1.5; margin-bottom: 3px; }
.mod-dim { font-size: 11px; color: #94a3b8; line-height: 1.5; }
.mod-hot { color: #b91c1c; font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.sp { flex: 1 1 auto; }

.mod-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mod-kv { font-size: 11.5px; color: #64748b; white-space: nowrap; }
.mod-kv b { color: #0f172a; font-weight: 700; font-variant-numeric: tabular-nums; }

.mod-hint {
  margin-top: 10px; padding: 8px 11px; border-radius: 8px;
  background: #f8fafd; border: 1px dashed #e2e9f3;
  font-size: 11.5px; color: #64748b; line-height: 1.75;
}
.mod-hint b { color: #334155; font-weight: 600; }
.mod-hint code { font-size: 11px; background: #eef2f8; padding: 1px 5px; border-radius: 4px; color: #334155; }

.mod-select {
  height: 30px; border: 1px solid #e2e9f3; border-radius: 8px; background: #fff;
  padding: 0 8px; font-size: 12px; color: #334155; font-family: inherit; cursor: pointer;
}
.mod-select:focus { outline: none; border-color: #2563eb; }
.mod-select.sm { height: 26px; font-size: 11.5px; padding: 0 6px; }
.mod-input {
  height: 28px; border: 1px solid #e2e9f3; border-radius: 7px; background: #fff;
  padding: 0 8px; font-size: 12px; color: #0f172a; font-family: inherit;
  font-variant-numeric: tabular-nums; text-align: right; width: 92px;
}
.mod-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

.mod-pill {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 10.5px;
  font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: #eef2f8; color: #475569; margin-left: 4px;
}
.mod-pill:first-child { margin-left: 0; }
.mod-pill.ok { background: #ecfdf5; color: #047857; }
.mod-pill.warn { background: #fffbeb; color: #b45309; }
.mod-pill.bad { background: #fef2f2; color: #b91c1c; }
.mod-pill.mute { background: #f4f7fb; color: #8794a8; }

.mod-bar { height: 5px; border-radius: 3px; background: #eef2f8; overflow: hidden; margin-bottom: 3px; }
.mod-bar i { display: block; height: 100%; border-radius: 3px; background: #3b82f6; transition: width .3s; }
.mod-bar i.ok { background: #16a34a; }
.mod-bar i.warn { background: #d97706; }
.mod-bar i.bad { background: #dc2626; }

.mod-tbl th, .mod-tbl td { font-size: 12px; }
.mod-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mod-tbl tr.mod-row-hot td { background: #fffafa; }

.mod-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mod-cat {
  font-size: 11px; color: #64748b; background: #f8fafd; border: 1px solid #eef2f8;
  border-radius: 7px; padding: 4px 9px;
}
.mod-cat b { color: #334155; font-weight: 600; }

/* 预测准确率柱状图（纯 CSS，不引 ECharts） */
.mod-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 6px 2px 0; }
.mod-chart-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.mod-chart-v { font-size: 11px; color: #475569; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.mod-chart-bar { width: 100%; max-width: 42px; flex: 1 1 auto; background: #f1f5fa; border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; }
.mod-chart-bar i { display: block; width: 100%; background: #93c5fd; border-radius: 4px 4px 0 0; transition: height .3s; }
.mod-chart-bar i.warn { background: #fcd34d; }
.mod-chart-bar i.bad { background: #fca5a5; }
.mod-chart-x { font-size: 10px; color: #94a3b8; margin-top: 5px; }

.mod-verdict {
  padding: 9px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  background: #f8fafd; color: #334155; border: 1px solid #eef2f8; line-height: 1.6;
}
.mod-verdict.ok { background: #f2fdf7; border-color: #d6f2e2; color: #047857; }
.mod-verdict.warn { background: #fffdf5; border-color: #fbe8c8; color: #b45309; }
.mod-verdict.bad { background: #fffafa; border-color: #fbd9d9; color: #b91c1c; }

@media (max-width: 720px) {
  .mod-chart { height: 120px; }
  .mod-input { width: 72px; }
}

/* ============ 全链路速览（6 列 × N 行） ============ */
.sop-chain {
  background: #fff; border: 1px solid #e8edf5; border-radius: 12px;
  padding: 14px 16px 12px; margin-top: 12px;
}
.sop-chain-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.sop-chain-head .ch-t { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.sop-chain-head .ch-s { font-size: 11.5px; color: #8794a8; margin-top: 2px; }
.sop-chain-head .ch-l { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #94a3b8; }
.sop-chain-head .ch-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.sop-chain-head .ch-dot.ok { background: #16a34a; margin-left: 8px; }
.sop-chain-head .ch-dot.warn { background: #d97706; margin-left: 8px; }
.sop-chain-head .ch-dot.danger { background: #dc2626; margin-left: 8px; }

.sop-chain-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.sop-chain-col { min-width: 0; }
.cc-head {
  display: flex; align-items: center; gap: 5px; padding-bottom: 7px; margin-bottom: 4px;
  border-bottom: 1px solid #eef2f8; position: relative;
}
.cc-head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px;
  background: var(--sc, #2563eb); opacity: .55;
}
.cc-head .cc-i {
  width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; background: var(--sc, #2563eb);
}
.cc-head .cc-t {
  font-size: 11.5px; font-weight: 600; color: #334155; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cc-head .cc-s { margin-left: auto; font-size: 10px; color: #94a3b8; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cc-node {
  display: flex; align-items: center; gap: 5px; padding: 4px 5px;
  border-radius: 6px; cursor: pointer; font-size: 11px; color: #475569;
  transition: background .14s;
}
.cc-node:hover { background: #f6f9fe; }
.cc-node .cc-dot { width: 5px; height: 5px; border-radius: 50%; flex: 0 0 5px; background: #cbd5e1; }
.cc-node[data-level="ok"] .cc-dot { background: #16a34a; }
.cc-node[data-level="warn"] .cc-dot { background: #d97706; }
.cc-node[data-level="danger"] .cc-dot { background: #dc2626; }
.cc-node[data-level="idle"] .cc-dot { background: #d5dde9; }
.cc-node .cc-n {
  flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cc-node .cc-v {
  flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; color: #0f172a;
  display: flex; align-items: baseline; gap: 3px;
}
.cc-node .cc-v em {
  font-style: normal; font-size: 9.5px; font-weight: 600; color: #dc2626;
  background: #fef2f2; border-radius: 3px; padding: 0 3px;
}
.cc-node[data-level="idle"] .cc-v { color: #b6c2d4; }

/* 工作台紧凑条：超时率细条 */
.sop-mini-step .ms-bar { height: 3px; border-radius: 2px; background: #eef2f8; margin-top: 6px; overflow: hidden; }
.sop-mini-step .ms-bar i { display: block; height: 100%; border-radius: 2px; }

@media (max-width: 1180px) {
  .sop-chain-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .sop-chain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 生产协同 · MES 工单联动（2026-12-01） ---------- */
.mes-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px; font-size: 12.5px; margin-bottom: 12px;
  border: 1px solid #dcfce7; background: #f0fdf4; color: #166534; }
.mes-bar.bad { border-color: #fee2e2; background: #fef2f2; color: #b91c1c; }
.mes-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; flex: none; }
.mes-bar.bad .mes-dot { background: #dc2626; }
.mes-bar-r { margin-left: auto; display: flex; gap: 8px; }
.mes-bar span:not(.mes-dot):not(.mes-bar-r) { color: #475569; }
.mod-kpi { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mod-kpi > div { border: 1px solid #eef2f7; background: #fafbfd; border-radius: 10px; padding: 10px 12px; }
.mod-kpi span { display: block; font-size: 11.5px; color: #94a3b8; }
.mod-kpi b { display: block; font-size: 19px; font-weight: 800; color: #0f172a; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.mod-kpi b.bad { color: #dc2626; }
@media (max-width: 1180px) { .mod-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
