/* ============================================================
   生产运营页样式：分组导航 / 设备矩阵 / 质量画像 / 标签 / 能耗 / 生命周期
   ============================================================ */

/* 侧栏分组 */
.nav-group {
  margin: 14px 0 4px; padding: 0 16px;
  font-size: 10.5px; letter-spacing: 2px; color: var(--dim); font-weight: 600;
}
.nav-group:first-child { margin-top: 6px; }
#nav a { padding: 7px 16px; }
#nav a i { width: 18px; font-style: normal; font-size: 13px; }

/* KPI 补充 */
.kpi-note { margin-top: 8px; font-size: 10.5px; color: var(--dim); line-height: 1.4; }

/* 方仓卡片补充信息 */
.rt-grade {
  margin-left: auto; font-style: normal; font-size: 11px; padding: 0 6px;
  border: 1px solid currentColor; border-radius: 5px; line-height: 16px;
}
.rt-sub span { margin-right: 8px; }
.rt-tags {
  display: flex; gap: 6px; padding: 0 10px 8px; font-size: 10.5px; color: var(--dim);
}
.rt-tags span { background: rgba(16, 56, 46, .04); border-radius: 4px; padding: 0 5px; }
.rt-risk.lv1 { color: #e05252; }
.rt-risk.lv2 { color: #d98514; }
.room-tile.busy { box-shadow: inset 0 0 0 1px rgba(47, 128, 237, .35), 0 6px 18px rgba(47, 128, 237, .12); }
.room-tile.busy .rt-foot span:last-child { color: #2f80ed; font-weight: 600; }

/* 设备控制矩阵 */
.ctrl-table td.ch-cell { padding: 5px 6px; white-space: nowrap; }
.ch-chip {
  display: inline-block; margin: 1px 2px; padding: 2px 7px; border-radius: 5px;
  font-size: 10.5px; line-height: 15px; cursor: pointer;
  border: 1px solid rgba(16, 56, 46, .12); color: var(--dim); background: #fbfdfc;
  transition: .15s;
}
.ch-chip:hover { border-color: rgba(15, 155, 142, .5); color: var(--accent); }
.ch-chip.on {
  background: linear-gradient(180deg, #e8fbf5, #dcf6ee); color: #0b7d6e;
  border-color: rgba(15, 155, 142, .45); font-weight: 600;
  box-shadow: 0 0 0 1px rgba(15, 155, 142, .12);
}
.ch-chip.link {
  background: linear-gradient(180deg, #e8f1ff, #dce9ff); color: #1f5fd0;
  border-color: rgba(47, 128, 237, .5); animation: chipPulse 1.6s infinite;
}
.ch-chip.fault {
  background: linear-gradient(180deg, #fdecec, #fbdada); color: #c0302b;
  border-color: rgba(192, 48, 43, .55); font-weight: 600;
}
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 128, 237, .40); }
  50% { box-shadow: 0 0 0 4px rgba(47, 128, 237, .05); }
}
.ctrl-table tbody tr.sel { background: rgba(15, 155, 142, .06); }
.ctrl-table td.rc em { display: block; font-style: normal; margin-top: 3px; }
.sched-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px 16px; }
.sched-form select, .sched-form input { padding: 7px 9px; font-size: 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; }
.sched-form input { width: 92px; }
.sched-form input#sc-target { flex: 1; min-width: 160px; }

/* 单仓迷你表 */
.mini-table { width: 100%; font-size: 11.5px; color: var(--muted); border-collapse: collapse; }
.mini-table td { padding: 5px 4px; border-bottom: 1px dashed var(--line); }
.mini-table td.num { font-variant-numeric: tabular-nums; color: var(--text); }

/* 数据检索 */
.cell-sub { display: block; font-style: normal; font-size: 10.5px; color: var(--dim); }
.chart-box.tall { height: 320px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.kv b { color: var(--text); font-weight: 600; }
.dq-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tag-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px;
  background: rgba(15, 155, 142, .07); color: #0b7d6e; border: 1px solid rgba(15, 155, 142, .18);
}
.chip.big { padding: 5px 12px; font-size: 12px; }
.chip i { margin-left: 6px; font-style: normal; color: var(--dim); font-size: 10.5px; }
.dq-actions { display: flex; gap: 8px; margin-top: 14px; }
.dq-actions .btn-ghost { display: inline-block; }

/* 质量分析 */
.q-grid { grid-template-columns: 1.1fr 1fr 1fr; }
.q-grid2 { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.grade-flex { display: flex; gap: 16px; align-items: center; }
.grade-donut canvas { width: 132px; height: 132px; }
.grade-legend { flex: 1; display: grid; gap: 7px; }
.gl { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.gl i { width: 8px; height: 8px; border-radius: 50%; }
.gl b { margin-left: auto; color: var(--text); }
.gl em { font-style: normal; color: var(--dim); width: 34px; text-align: right; }
.radar-svg { width: 100%; max-width: 240px; height: 210px; }
.radar-flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.radar-legend { flex: 1; min-width: 130px; display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 62px 1fr 34px; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.bar-row i { height: 6px; border-radius: 4px; background: linear-gradient(90deg, #2ec4b0, #0f9b8e); }
.bar-row b { text-align: right; color: var(--text); font-weight: 600; }
.rank-list { display: grid; gap: 7px; }
.rank-item { display: flex; align-items: center; gap: 9px; font-size: 11.5px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.rank-item em { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10.5px; background: rgba(15, 155, 142, .10); color: var(--accent); }
.rank-item div b { display: block; color: var(--text); }
.rank-item div span { color: var(--dim); font-size: 10.5px; }
.rank-score { font-size: 16px; font-weight: 600; margin-left: auto; }
.hbar { display: grid; grid-template-columns: 84px 1fr 30px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 9px; }
.hbar i { height: 8px; border-radius: 4px; opacity: .85; }
.hbar b { text-align: right; color: var(--text); }

/* 菌苗标签 */
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.label-card {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff, #f8fcfa); cursor: pointer;
}
.lc-qr { width: 132px; height: 132px; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--line); align-self: center; }
.lc-qr img { width: 100%; height: 100%; display: block; }
.lc-code { font-family: "Bahnschrift", Consolas, monospace; font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.lc-meta { font-size: 10.5px; color: var(--dim); margin: 2px 0 6px; }
.lc-foot { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.lc-age { font-size: 10.5px; color: var(--dim); }
.lc-actions { display: flex; gap: 8px; width: 100%; margin-top: 2px; }
.lc-btn { flex: 1; text-align: center; padding: 7px 8px; font-size: 11.5px; }

/* 能耗 */
.e-grid { grid-template-columns: 1.55fr 1fr; }
.mix-list { display: grid; gap: 10px; }
.mix-row { display: grid; grid-template-columns: 52px 1fr 74px 34px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.mix-row i { height: 7px; border-radius: 4px; background: linear-gradient(90deg, #2f80ed, #0f9b8e); }
.mix-row b { text-align: right; color: var(--text); font-size: 11px; }
.mix-row em { font-style: normal; text-align: right; color: var(--dim); }
.mini-bar { height: 6px; border-radius: 4px; background: rgba(16, 56, 46, .08); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1aa06d, #2ec4b0); }
.save-block { display: grid; grid-template-columns: 1fr 64px; gap: 8px; align-items: center; }
.save-block i { display: block; height: 10px; border-radius: 4px; background: linear-gradient(90deg, #1aa06d, #2ec4b0); }
.save-block b { text-align: right; color: #0b7a4b; font-size: 11.5px; }

/* 生命周期 */
.life-steps { display: flex; list-style: none; margin: 0; padding: 6px 0 0; gap: 0; }
.life-steps li { flex: 1; position: relative; padding-top: 16px; text-align: center; font-size: 11px; color: var(--dim); }
.life-steps li .dot { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 9px; height: 9px; border-radius: 50%; background: #cfdcd8; }
.life-steps li::before { content: ""; position: absolute; top: 8px; left: 0; right: 50%; height: 1px; background: var(--line-strong); }
.life-steps li:first-child::before { display: none; }
.life-steps li.done .dot { background: #1aa06d; }
.life-steps li.done b { color: var(--text); }
.life-steps li.cur .dot { background: #0f9b8e; box-shadow: 0 0 0 4px rgba(15, 155, 142, .18); }
.life-steps li.cur b { color: #0b7d6e; }
.life-steps li b { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.life-steps li small, .life-steps li em { display: block; font-style: normal; font-size: 10px; color: var(--dim); }
.life-note { margin-top: 14px; font-size: 11.5px; color: var(--muted); }

/* 打印：只输出标签纸 */
@media print {
  .sidenav, .topbar, .nav-group, .panel-head, .panel-note, .side-foot { display: none !important; }
  body, html { background: #fff !important; }
  .shell, .main, .view { display: block !important; margin: 0 !important; padding: 0 !important; height: auto !important; }
  .panel { border: none !important; box-shadow: none !important; margin: 0 !important; }
  .panel-body { padding: 0 !important; }
  .view > .panel:not(:first-child), .kpi-row, .screen-grid { display: none !important; }
  .label-sheet { grid-template-columns: repeat(4, 1fr); gap: 8mm; }
  .label-card { break-inside: avoid; }
}

/* KPI 行自适应数量（5 项时不出现空列） */
.kpi-row { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.advice-box {
  font-size: 12px; line-height: 1.9; color: var(--text);
  background: linear-gradient(180deg, #f4fcf9, #fbfefd);
  border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 12px 14px;
}
