/* =========================================================
   QMS 业务样式扩展
   配色/基础体系沿用 admin.css；此处补充业务专用组件样式：
   8D 步骤卡、看板条形图、检验明细录入、元信息头、状态时间轴等。
   ========================================================= */

/* ---------- 详情页通用：元信息头 ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 18px; padding: 4px 2px; }
.meta-item .k { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.meta-item .v { font-size: 14px; color: var(--text); word-break: break-all; }
.meta-item.full { grid-column: 1 / -1; }

/* ---------- 明细录入表 ---------- */
.inspect-items { margin-top: 4px; }
.inspect-items .grid td, .inspect-items .grid th { padding: 10px 12px; }
.inspect-items .measured { width: 120px; }
.inspect-items select.qual { width: 104px; padding: 0 8px; }
.inspect-items input, .inspect-items select {
  height: 34px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px;
  padding: 0 10px; background: #fff; font-family: inherit;
}
.inspect-items input:focus, .inspect-items select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.spec-text { font-size: 12px; color: var(--muted); }
.key-flag { display: inline-block; background: #fee2e2; color: #b91c1c; border-radius: 6px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

/* ---------- 8D 步骤卡 ---------- */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.step-pill {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.step-pill.done { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.step-pill.current { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 10px rgba(79,70,229,.28); }
.step-pill.locked { opacity: .55; }
.d-cards { display: flex; flex-direction: column; gap: 16px; }
.d-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.d-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.d-card-head .t { font-weight: 700; font-size: 15px; }
.d-card-head .flag { font-size: 12px; }
.d-card-body { padding: 16px 18px; }
.d-card-body .static-text { white-space: pre-wrap; line-height: 1.7; color: #374151; }
.d-card textarea {
  width: 100%; min-height: 130px; border: 1px solid #d1d5db; border-radius: 9px;
  padding: 12px; font-size: 13.5px; font-family: inherit; line-height: 1.7; resize: vertical;
}
.d-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.d-card.locked .d-card-body { background: #fafbfe; }
.d-card.editing { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ---------- 看板条形图 ---------- */
.board-section { margin-bottom: 22px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 110px; gap: 12px; align-items: center; padding: 6px 0; }
.bar-row .name { font-size: 13px; color: #475067; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .num { font-size: 12.5px; color: var(--muted); text-align: right; }
.bar-track { background: #eef1f8; border-radius: 999px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #4f46e5); min-width: 2px; transition: width .4s; }
.bar-fill.green { background: linear-gradient(90deg, #34d399, #10b981); }
.bar-fill.amber { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.bar-fill.red { background: linear-gradient(90deg, #f87171, #ef4444); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-box .k { font-size: 12.5px; color: var(--muted); }
.kpi-box .v { font-size: 26px; font-weight: 700; margin-top: 4px; }

/* ---------- 追溯路径 ---------- */
.trace-node {
  border-left: 3px solid var(--accent); background: #fff; border-radius: 0 10px 10px 0;
  padding: 14px 18px; margin-bottom: 14px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.trace-node h4 { font-size: 14.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.trace-node .badge { margin-right: 6px; }

/* ---------- 8D actions / 操作步骤 ---------- */
.mini-table td, .mini-table th { padding: 10px 12px; }

/* ---------- 工作台快速待办 ---------- */
.todo-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); }
.todo-row:last-child { border-bottom: none; }
.todo-row .no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #475067; }
.todo-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-row .meta { font-size: 12px; color: var(--muted); }

/* ---------- 状态时间轴/徽标增强 ---------- */
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.off { background: #f1f5f9; color: #475569; }

/* 表单内两列并排（适用于检验录入头信息等） */
.form-row.cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.form-card.wide .form-row textarea { width: 100%; max-width: 100%; }
.form-row.cols .row-item label { font-weight: 500; font-size: 13px; color: #475067; display: block; margin-bottom: 6px; }
.form-row.cols .row-item input[type=text], .form-row.cols .row-item input[type=number],
.form-row.cols .row-item input[type=date], .form-row.cols .row-item select {
  width: 100%; height: 40px; border: 1px solid #d1d5db; border-radius: 9px; padding: 0 12px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.form-row.cols .row-item select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-row.cols .row-item input:focus, .form-row.cols .row-item select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
