:root {
  --brand-1: #07C160;
  --brand-2: #1AAD19;
  --brand-grad: linear-gradient(135deg, #07C160 0%, #1AAD19 100%);
  --bg: #f2f4f7;
  --card: #ffffff;
  --ink: #1f2329;
  --ink-2: #646a73;
  --ink-3: #8f959e;
  --line: #e5e6eb;
  --danger: #f53f3f;
  --warn: #ff7d00;
  --ok: #00b42a;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- 顶部品牌栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.25);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; line-height: 1.2; }
.brand-sub { font-size: 11px; opacity: 0.85; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.role-label { font-size: 13px; opacity: 0.9; }
.topbar-right select {
  border: none; border-radius: 8px; padding: 6px 12px;
  background: #fff; color: var(--ink); font-weight: 600; cursor: pointer;
  outline: none; transition: box-shadow 0.2s;
}
.topbar-right select:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5); }
.wecom-badge { font-size: 12px; background: rgba(255,255,255,0.18); padding: 3px 10px; border-radius: 12px; }
.hidden { display: none !important; }

/* ---------- 布局：左栏 + 主区 ---------- */
.layout {
  display: flex;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 60px;
  align-items: flex-start;
}
.sidebar {
  flex: 0 0 230px;
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.side-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; margin-bottom: 10px;
}
.side-title::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--brand-grad); }
.side-empty { color: var(--ink-3); font-size: 13px; padding: 6px 0; }
.side-notify-item {
  padding: 7px 8px; border-radius: 8px; font-size: 12px; cursor: pointer;
  display: flex; gap: 6px; align-items: flex-start; transition: background 0.15s;
}
.side-notify-item:hover { background: #f2f8f4; }
.side-notify-item .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; }
.side-notify-item.lv-overdue .dot { background: var(--danger); }
.side-notify-item.lv-soon .dot { background: var(--warn); }
.side-notify-item.lv-delayed-done .dot { background: #ff9a2e; }
.side-notify-item .msg { color: var(--ink-2); line-height: 1.4; }
.side-more { margin-top: 6px; text-align: center; font-size: 12px; color: var(--brand-2); cursor: pointer; }

.flow-overview { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.flow-overview li {
  counter-increment: step;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; font-size: 13px; color: var(--ink-2);
}
.flow-overview li::before {
  content: counter(step);
  flex: 0 0 22px; height: 22px; border-radius: 7px;
  background: #e8f8ee; color: var(--brand-2);
  font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}

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

/* ---------- 页签胶囊 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 600;
  color: var(--ink-2); transition: all 0.2s;
}
.tab:hover { background: #e9f8ef; color: var(--brand-2); }
.tab.active { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow); }

/* ---------- 逾期横幅 ---------- */
.overdue-banner {
  background: #fdecec; color: var(--ink);
  border-radius: var(--radius); padding: 12px 18px;
  margin-bottom: 14px; font-weight: 600; box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}
.overdue-banner b { color: var(--danger); font-size: 16px; }

/* ---------- 区块头 ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.page-title { font-size: 18px; font-weight: 700; margin: 0; }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 筛选行 ---------- */
.filter-row {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.filter-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-label { font-size: 13px; color: var(--ink-2); }
.pill {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 16px; padding: 5px 14px; cursor: pointer; font-size: 13px;
  transition: all 0.2s;
}
.pill:hover { border-color: var(--brand-1); color: var(--brand-2); }
.pill.active { background: var(--brand-grad); color: #fff; border-color: transparent; }

/* ---------- 主按钮 ---------- */
.btn {
  border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all 0.2s; background: #f2f3f5; color: var(--ink);
}
.btn:hover { filter: brightness(0.96); }
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.3); }
.btn-primary { background: var(--brand-grad); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- 订单卡片 ---------- */
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.order-card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); transition: transform 0.18s, box-shadow 0.18s;
  display: flex; flex-direction: column;
}
.order-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1); }
.oc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.oc-code { font-weight: 700; font-size: 15px; color: #165dff; }
.oc-line { font-size: 13px; color: var(--ink-2); padding: 2px 0; }
.oc-line b { color: var(--ink); font-weight: 600; }
.oc-ship-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 2px 0; }
.oc-ship-row .plan-ship.over { color: var(--danger); font-weight: 700; }
.overdue-badge {
  background: #fdecec; color: var(--danger); font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 1px 8px; white-space: nowrap;
}
.oc-progress { height: 6px; border-radius: 3px; background: #eef0f3; margin: 10px 0 12px; overflow: hidden; }
.oc-progress .bar { height: 100%; border-radius: 3px; background: var(--brand-grad); transition: width 0.4s ease; }
.oc-view {
  width: 100%; border: none; border-radius: 8px; padding: 9px 0; cursor: pointer;
  background: #f2f3f5; color: var(--ink); font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.oc-view:hover { background: #e8f8ee; color: var(--brand-2); }
.oc-actions { display: flex; gap: 8px; }
.oc-quick {
  flex: 1; border: none; border-radius: 8px; padding: 9px 0; cursor: pointer;
  background: var(--brand-grad); color: #fff; font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.oc-quick:hover { filter: brightness(1.05); box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3); }
.oc-quick.danger { background: linear-gradient(135deg, #ff7a45, #f53f3f); }
.oc-actions .oc-view { flex: 1; }

/* 状态标签 */
.status-tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.st-DRAFT { background: #f2f3f5; color: #4e5969; }
.st-REVIEWING { background: #e8f3ff; color: #165dff; }
.st-PENDING_START { background: #fff7e8; color: #d25f00; }
.st-PROCUREMENT_ORDER, .st-PROCUREMENT_CONTRACT { background: #f0f5ff; color: #4080ff; }
.st-MATERIAL_IN_TRANSIT { background: #e8fffb; color: #0fc6c2; }
.st-MATERIAL_ARRIVED { background: #fff4e6; color: #ff7d00; }
.st-SAMPLE_CONFIRMED { background: #fef3ff; color: #c246d8; }
.st-PRODUCING { background: #fff1f0; color: #f53f3f; }
.st-FINAL_QC { background: #fffbe8; color: #d48806; }
.st-READY_FOR_SHIPMENT { background: #e8ffea; color: #00b42a; }
.st-SHIPPED { background: #e8ffea; color: #009a29; }
.st-FAILED { background: #fff0f0; color: #cb2634; }
.st-TERMINATED { background: #f2f3f5; color: #86909c; text-decoration: line-through; }

/* ---------- 客户卡片 ---------- */
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.customer-card {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border-left: 4px solid var(--brand-1);
}
.customer-card h3 { margin: 0 0 4px; font-size: 15px; }
.customer-card .cc-code { color: var(--ink-3); font-size: 12px; }
.customer-card .cc-contact { color: var(--ink-2); font-size: 13px; margin: 8px 0; white-space: pre-wrap; }
.cc-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 760px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2); animation: popIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes popIn { from { transform: scale(0.9) translateY(12px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-close { border: none; background: transparent; font-size: 22px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.modal-body { padding: 18px 20px; }
/* 流程图弹窗 */
.fc-modal { max-width: 1040px; }
.fc-scroll { overflow: auto; max-height: 80vh; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; }
.fc-scroll svg { display: block; width: 100%; height: auto; min-width: 760px; }
.fc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #55607a; margin-bottom: 12px; align-items: center; }
.fc-legend span { display: inline-flex; align-items: center; }
.fc-legend i { width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; display: inline-block; }
.fc-legend i.lg-node { background: #fff; border: 2px solid #5b6675; }
.fc-legend i.lg-dia { background: #fff7e6; border: 2px solid #d48806; transform: rotate(45deg); width: 11px; height: 11px; }
.fc-legend i.lg-bad { background: #fff1f0; border: 2px solid #ff7875; }
.fc-legend i.lg-con { background: #f9f0ff; border: 2px solid #b37feb; }
.fc-legend i.lg-fail { background: #fff1f0; border: 2px solid #f53f3f; }

/* 状态横幅（详情）——按状态分组配色 */
.status-banner {
  color: #fff; border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 14px;
  background: var(--brand-grad);
}
.status-banner.bn-blue { background: linear-gradient(135deg, #4080ff, #165dff); }
.status-banner.bn-amber { background: linear-gradient(135deg, #ffc53d, #d48806); }
.status-banner.bn-red { background: linear-gradient(135deg, #ff7a45, #f53f3f); }
.status-banner.bn-gray { background: linear-gradient(135deg, #a9b0b8, #6c7480); }
.status-banner .sb-cap { font-size: 12px; opacity: 0.9; margin-bottom: 2px; }
.status-banner .sb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-banner .sb-status { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.dept-pill {
  background: rgba(255, 255, 255, 0.28); border-radius: 12px; padding: 3px 12px; font-size: 12px; font-weight: 600;
}

/* 信息表——灰底圆角小卡 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.info-item {
  background: #f7f8fa; border-radius: 10px; padding: 10px 14px;
  display: flex; flex-direction: column;
}
.info-item .label { color: var(--ink-3); font-size: 12px; }
.info-item .value { font-weight: 600; margin-top: 2px; }
.info-item .value.over { color: var(--danger); }

/* 区块标题 */
.section-title {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px;
  margin: 18px 0 10px;
}
.section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--brand-grad); }
.ms-sub { font-weight: 400; font-size: 12px; color: var(--ink-3); }

/* 计划里程碑 + 倒计时 */
.milestone-box, #milestoneBox { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ms-card {
  border: 1px solid #e6eef0; border-radius: 12px; padding: 12px 14px; background: #fff;
  box-shadow: 0 2px 8px rgba(20, 40, 40, 0.05); transition: all 0.3s;
}
.ms-top { display: flex; align-items: center; justify-content: space-between; }
.ms-label { font-weight: 700; font-size: 14px; color: var(--ink-1); }
.ms-dept { font-size: 11px; color: #fff; background: linear-gradient(135deg, #07C160, #1AAD19); padding: 2px 8px; border-radius: 10px; }
.ms-date { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.ms-date b { color: var(--ink-1); font-size: 13px; }
.ms-count { margin-top: 8px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.ms-count.running { color: #07C160; }
.ms-count.soon { color: #e8920c; }
.ms-count.overdue { color: var(--danger); }
.ms-count.done { color: #1a7fd6; }
.ms-actual { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.ms-actual.late { color: var(--danger); }
.ms-actual.ontime { color: #07C160; }
.ms-actual.soon { color: #e8920c; }
.ms-hint { font-size: 12px; color: var(--ink-3); background: #f4f8f9; border: 1px dashed #d3e3e3; border-radius: 10px; padding: 10px 12px; }
.ms-exempt { color: #1f7a44; background: #eafaf0; border-color: #bfe8cd; font-weight: 600; }

/* 不适用 / 不涉及 / 不需要 徽标 */
.dec-exempt { color: var(--ok); font-weight: 600; background: #eafaf0; border: 1px solid #bfe8cd; border-radius: 999px; padding: 2px 10px; display: inline-block; }
.rc-na { color: #1f7a44; font-weight: 600; background: #eafaf0; border: 1px dashed #bfe8cd; border-radius: 10px; padding: 8px 10px; font-size: 12px; }

/* 已完成流程区块折叠 */
.collapse-opt { margin: 8px 0 2px; }
.col-opt { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.col-opt input { accent-color: var(--brand-2); }
.col-sec { border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; overflow: hidden; background: var(--card); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; background: #fafbfc; border-bottom: 1px solid transparent; }
.col-head:hover { background: #f2f4f7; }
.col-ico { color: var(--ink-3); font-size: 12px; width: 14px; text-align: center; flex: none; }
.col-title { flex: 1; font-weight: 600; color: var(--ink); }
.col-badge { font-size: 11px; color: var(--ok); background: #eafaf0; border: 1px solid #bfe8cd; border-radius: 999px; padding: 1px 8px; flex: none; }
.col-toggle { font-size: 12px; color: var(--brand-2); flex: none; }
.col-body { padding: 4px 14px 14px; }
.col-sec.is-collapsed .col-body { display: none; }
.col-sec.is-collapsed .col-head { border-bottom: none; }

@media (max-width: 640px) { .milestone-box, #milestoneBox { grid-template-columns: 1fr; } }

/* 动作区 */
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.action-btn {
  border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600; font-size: 13px;
  background: var(--brand-grad); color: #fff; transition: all 0.2s;
}
.action-btn:hover { filter: brightness(1.05); box-shadow: 0 4px 12px rgba(7,193,96,0.3); }
.action-btn.danger { background: linear-gradient(135deg, #ff7a45, #f53f3f); }
.action-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.35); }
.action-note { color: var(--ink-3); font-size: 13px; }

/* 自定义确认弹窗（替代原生 confirm，避免被浏览器拦截后"点了没反应"） */
.confirm-overlay { z-index: 1000; }
.confirm-modal {
  background: #fff; border-radius: 14px; padding: 22px 22px 18px; width: 340px; max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18); animation: pop 0.18s ease;
}
.confirm-msg { font-size: 14px; color: var(--ink-1); line-height: 1.6; margin-bottom: 18px; }
.confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* 轻提示 toast（替代原生 alert） */
.toast {
  position: fixed; left: 50%; top: 22px; transform: translate(-50%, -16px);
  background: #2b2f33; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); opacity: 0; transition: opacity 0.25s, transform 0.25s;
  z-index: 1100; max-width: 80vw; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #f53f3f; }

/* 行内表单 */
.inline-form { margin-top: 12px; background: #f7f8fa; border-radius: 10px; padding: 14px; border: 1px solid var(--line); }
.inline-form label { display: block; font-size: 13px; color: var(--ink-2); margin: 8px 0 4px; }
.inline-form input, .inline-form select, .inline-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s; font-family: inherit;
  box-sizing: border-box; line-height: 20px;
}
.inline-form input, .inline-form select { min-height: 36px; }
.inline-form input:focus, .inline-form select:focus, .inline-form textarea:focus {
  border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.15);
}
.inline-form .form-row { display: flex; gap: 12px; }
.inline-form .form-row > div { flex: 1; }
.form-btns { display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end; }
.link-btn {
  border: none; background: transparent; color: var(--brand-2); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 0;
}
.link-btn:hover { text-decoration: underline; }
.sub-form { border: 1px dashed #b7ebcf; }

/* ---------- 流程图（编号圆点） ---------- */
.flow { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 16px; }
.flow-step {
  flex: 0 0 auto; min-width: 96px; text-align: center; position: relative; padding-top: 4px;
}
.flow-step .dot {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 8px;
  background: #eef0f3; color: var(--ink-3);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed #d8dce3; transition: all 0.3s; position: relative; z-index: 1;
}
.flow-step .name { font-size: 11px; color: var(--ink-3); line-height: 1.25; }
.flow-step::before {
  content: ""; position: absolute; top: 18px; left: -50%; width: 100%;
  border-top: 2px dashed #d8dce3; z-index: 0;
}
.flow-step:first-child::before { display: none; }
.flow-step.done .dot { background: var(--brand-1); color: #fff; border: 2px solid var(--brand-1); }
.flow-step.done::before { border-top-color: var(--brand-1); }
.flow-step.done .name { color: var(--ink-2); }
.flow-step.current .dot {
  background: #ffc53d; color: #7a4d00; border: 2px solid #d48806;
  transform: scale(1.18); box-shadow: 0 0 0 5px rgba(255, 197, 61, 0.25);
}
.flow-step.current .name { color: #d48806; font-weight: 700; }
.flow-step.current::before { border-top-color: var(--brand-1); }

/* ---------- 评审卡 ---------- */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.review-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbfc; }
.review-card .rc-dept { font-weight: 700; }
.review-card .rc-role { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.review-card .rc-dec { font-size: 12px; margin-top: 6px; }
.dec-pass { color: var(--ok); font-weight: 600; }
.dec-reject { color: var(--danger); font-weight: 600; }
.dec-pending { color: var(--warn); font-weight: 600; }
.rc-days { color: var(--ink-2); font-size: 12px; margin-top: 4px; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 6px 0; }
.tl-item .tl-dot { position: absolute; left: -16px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-1); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand-1); }
.tl-time { font-size: 12px; color: var(--ink-3); }
.tl-text { font-size: 13px; }

/* ---------- 提醒中心 ---------- */
.reminder-list { display: flex; flex-direction: column; gap: 10px; }
.reminder-item {
  background: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow);
  border-left: 4px solid var(--ink-3); display: flex; gap: 10px; align-items: flex-start;
}
.reminder-item.lv-overdue { border-left-color: var(--danger); background: #fff5f5; }
.reminder-item.lv-soon { border-left-color: var(--warn); background: #fffaf0; }
.reminder-item.lv-delayed-done { border-left-color: #ff9a2e; background: #fff8f0; }
.reminder-item .ni-icon { font-size: 18px; }
.reminder-item .ni-msg { font-weight: 600; }
.reminder-item .ni-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.reminder-item .ni-link { margin-left: auto; }

/* ---------- 通知 ---------- */
.notify-item {
  background: #fff; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  border-left: 4px solid var(--ink-3); display: flex; gap: 10px; align-items: flex-start;
}
.notify-item.lv-overdue { border-left-color: var(--danger); background: #fff5f5; }
.notify-item.lv-soon { border-left-color: var(--warn); background: #fffaf0; }
.notify-item.lv-delayed-done { border-left-color: #ff9a2e; background: #fff8f0; }
.notify-item .ni-icon { font-size: 18px; }
.notify-item .ni-msg { font-weight: 600; }
.notify-item .ni-sub { font-size: 12px; color: var(--ink-3); }

.empty { text-align: center; color: var(--ink-3); padding: 40px 0; }
.hidden { display: none !important; }

/* 客户收货地址 */
.cc-address { color: var(--ink-2); font-size: 12px; margin: 6px 0; background: #f2f8f4; border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; }

/* 评审截止倒计时徽标 */
.review-deadline {
  margin: 10px 0 4px; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px;
  background: #e8f3ff; color: #165dff; border: 1px solid #bcd6ff;
}
.review-deadline.soon { background: #fff7e8; color: #d25f00; border-color: #ffd591; }
.review-deadline.over { background: #fdecec; color: var(--danger); border-color: #ffb4b4; }

/* 文件导入 */
#importFile { display: none; }

/* 多产品明细录入表 */
.prod-table { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 6px; }
.prod-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr 0.7fr 0.7fr 0.9fr 28px;
  gap: 6px; align-items: center;
  background: #f7faf8; border: 1px solid var(--line); border-radius: 10px; padding: 8px;
}
.prod-row input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 13px; outline: none; font-family: inherit; box-sizing: border-box; line-height: 20px; min-height: 36px; }
.prod-row .pp_del { border: none; background: #fdecec; color: var(--danger); border-radius: 8px; height: 36px; cursor: pointer; font-size: 16px; line-height: 1; }
.prod-row .pp_del:hover { background: #ffd6d6; }

/* 订单列表中的各产品进度摘要 */
.oc-products { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.oc-prod { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 4px 8px; background: #f7faf8; border-radius: 8px; }
.oc-prod-name { color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-tag.sm { font-size: 11px; padding: 1px 8px; }

/* 详情中各产品卡片分隔 */
.prod-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0; background: #fff; }
.prod-card .section-title { margin-top: 14px; }

/* ---------- 一级 EO 弹窗：客户代码 / 规格型号列表 ---------- */
.eo-cust { font-size: 13px; font-weight: 500; color: var(--ink-2); background: #eef6f0; border: 1px solid #cfe9d6; padding: 2px 10px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.spec-toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; }
.spec-list { display: flex; flex-direction: column; gap: 8px; }
.spec-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: box-shadow .15s, transform .15s, border-color .15s; }
.spec-row:hover { box-shadow: var(--shadow); border-color: #bfe3c8; }
.spec-main { flex: 1 1 auto; cursor: pointer; min-width: 0; }
.spec-title { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.spec-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-status { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.spec-pfc { font-size: 11.5px; color: var(--brand-2); background: #eef6f0; border-radius: 6px; padding: 1px 7px; }
.spec-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.back-order { margin-bottom: 10px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.btn-sm { line-height: 1.3; }
.btn.danger { background: linear-gradient(135deg, #ff7a45, #f53f3f); color: #fff; border-color: transparent; }
.spec-open { font-weight: 600; }

/* ---------- 数据备份与恢复 ---------- */
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.backup-list-title { font-weight: 600; margin: 10px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.backup-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line, #ededed); border-radius: 10px; background: #fafafa; }
.backup-meta { display: flex; flex-direction: column; gap: 2px; }
.backup-label { font-weight: 600; font-size: 13px; }
.backup-at { font-size: 12px; color: var(--ink-2, #888); }
.backup-size { font-size: 11px; color: var(--ink-3, #aaa); }
.backup-btns { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------- 二级规格型号弹窗 ---------- */
.product-modal .modal-body { }
.product-modal .status-banner { margin-top: 4px; }


/* 小屏适配 */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; flex: none; width: 100%; flex-direction: row; }
  .side-card { flex: 1; }
  .prod-row { grid-template-columns: 1fr 1fr; }
}

/* 部门密码管理 */
.pwd-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.pwd-row { display: flex; align-items: center; gap: 10px; }
.pwd-label { width: 88px; flex: none; font-weight: 600; color: var(--ink); }
.pwd-input { flex: 1; min-width: 0; }
.pwd-save { flex: none; }
.pwd-status { flex: none; font-size: 13px; color: var(--ok); min-width: 56px; }

/* 已取消订单：看板卡片置灰 + 删除线 */
.order-card.cancelled { opacity: 0.62; filter: grayscale(0.7); background: #f5f6f8; }
.order-card.cancelled .oc-code { text-decoration: line-through; }
.order-card.cancelled .oc-prod { background: #eef0f2; }

/* 详情内取消提示 */
.cancel-note {
  margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px;
  background: #fff3f3; border: 1px solid #ffd6d6; color: #d4380d; font-size: 13px;
}
.cancel-note b { color: #cf1322; }

/* 已取消状态标签配色 */
.status-tag.st-CANCELLED { background: #f0f1f3; color: #6b7280; border: 1px solid #d9dce1; }

/* 已存档订单：看板卡片置灰 + 对勾 */
.order-card.archived { opacity: 0.66; filter: grayscale(0.6); background: #f5f6f8; }
.order-card.archived .oc-code::after { content: ' ✓'; color: #07C160; font-weight: 700; }
.order-card.archiving { border-left: 4px solid #fa8c16; }

/* 详情内文件存档提示 */
.archive-note {
  margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
}
.archive-note.pending { background: #fff7e6; border: 1px solid #ffd591; color: #ad6800; }
.archive-note.done { background: #f0fbf4; border: 1px solid #b7ebc8; color: #137333; }
.archive-note b { color: #ad6800; }

/* 待存档状态标签配色 */
.status-tag.st-ARCHIVING { background: #fff7e6; color: #ad6800; border: 1px solid #ffd591; }
.status-tag.st-ARCHIVED { background: #f0fbf4; color: #137333; border: 1px solid #b7ebc8; }

/* 生产文件整理归档 / 生产文件输出 状态标签 */
.status-tag.st-PROD_FILE_CONSOLIDATE { background: #fff7e6; color: #ad6800; border: 1px solid #ffd591; }
.status-tag.st-PRODUCTION_FILE_OUTPUT { background: #fff7e6; color: #ad6800; border: 1px solid #ffd591; }

/* 订单卡片：技术要求徽标 */
.oc-badge { display: inline-block; margin: 6px 0 0; padding: 3px 8px; border-radius: 8px; font-size: 12px; }
.techreq-badge { background: #e6f4ff; color: #0958d9; border: 1px solid #91caff; }
.pfc-badge { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }

/* 客户技术要求列表 */
.techreq-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; }
.techreq-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: #f5f8ff; border: 1px solid #d6e4ff; flex-wrap: wrap; }
.techreq-item .tr-idx { color: #888; font-size: 12px; }
.techreq-item .tr-name { color: #0958d9; text-decoration: none; font-weight: 600; }
.techreq-item .tr-name:hover { text-decoration: underline; }
.techreq-item .tr-meta { color: #888; font-size: 12px; margin-left: auto; }
.techreq-item .tr-remark { flex-basis: 100%; color: #614700; font-size: 12px; background: #fffbe6; border-left: 3px solid #faad14; padding: 4px 8px; border-radius: 4px; word-break: break-all; }
.techreq-upload { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.tr-remark-input { flex: 1 1 280px; min-width: 200px; padding: 6px 10px; border: 1px solid #d6e4ff; border-radius: 8px; font-size: 13px; }
.tr-remark-input:focus { outline: none; border-color: #4096ff; box-shadow: 0 0 0 2px rgba(64,150,255,.15); }

/* 物料明细表（评审/展示） */
.mt-display { border-collapse: collapse; width: 100%; margin: 6px 0; }
.mt-display th, .mt-display td { border: 1px solid #e3e6eb; padding: 6px 8px; font-size: 13px; text-align: left; }
.mt-display th { background: #f2f6fb; color: #333; }
.mt-table { border-collapse: collapse; width: 100%; margin: 4px 0; }
.mt-table th, .mt-table td { border: 1px solid #e3e6eb; padding: 0; }
.mt-table input.mt-head, .mt-table input.mt-cell { width: 100%; border: none; padding: 6px 8px; font-size: 13px; box-sizing: border-box; background: transparent; }
.mt-table input:focus { outline: 2px solid #07C160; outline-offset: -2px; }
.mt-table th { background: #f2f6fb; }
.mt-actions { display: flex; gap: 8px; margin-top: 6px; }

/* 生产文件输出 */
.proddocs { display: flex; flex-direction: column; gap: 12px; margin: 6px 0; }
.pd-block { border: 1px solid #e3e6eb; border-radius: 10px; padding: 10px; background: #fbfdff; }
.pd-name { font-weight: 600; color: #1aad19; margin-bottom: 6px; }
.pd-name-text { width: 100%; padding: 6px 8px; border: 1px solid #d9dce1; border-radius: 8px; font-weight: 600; margin-bottom: 6px; box-sizing: border-box; }
.pd-content { width: 100%; border: 1px solid #d9dce1; border-radius: 8px; padding: 8px; font-size: 13px; box-sizing: border-box; resize: vertical; }
.pd-content.ro { background: #f6f7f9; white-space: pre-wrap; min-height: 36px; }

/* 生产文件完成确认（三方确认 · 快速勾选） */
.pfc { display: flex; flex-direction: column; gap: 10px; margin: 6px 0; }
.pfc-card { border: 1px solid #e3e6eb; border-radius: 10px; padding: 10px 12px; background: #fbfdff; }
.pfc-card.done { background: #f1fbf2; border-color: #b7e3bb; }
.pfc-card.pending { background: #fffdf5; border-color: #ffe2a8; }
.pfc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pfc-dept { font-weight: 700; color: #333; }
.pfc-status.ok { color: #1aad19; font-size: 12px; }
.pfc-status.wait { color: #d48806; font-size: 12px; }
.pfc-files { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 4px 0 8px; }
.pfc-file { font-size: 13px; color: #444; display: flex; align-items: center; gap: 6px; }
.pfc-all { font-size: 12px; color: #0958d9; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.pfc-note { font-size: 12px; color: #666; margin-top: 4px; }
.pfc-note.hl { color: #d4380d; font-weight: 700; background: #fff1f0; border-radius: 6px; padding: 3px 6px; display: inline-block; }
.pfc-note-in { width: 100%; padding: 6px 8px; border: 1px solid #d9dce1; border-radius: 8px; box-sizing: border-box; margin: 4px 0 6px; }

/* 警示提醒文字 */
.rc-days.warn { color: #cf1322; background: #fff3f3; border: 1px solid #ffccc7; padding: 8px 10px; border-radius: 8px; }
.rc-days.warn strong { color: #cf1322; }

/* ============ 左侧流程概览：每步执行部门 ============ */
.flow-overview { list-style: none; margin: 0; padding: 0; }
.flow-overview li {
  display: flex; flex-direction: column; gap: 5px;
  padding: 9px 10px; margin-bottom: 7px;
  background: #fff; border: 1px solid #eef0f3; border-left: 3px solid #c9ced6;
  border-radius: 8px;
}
.flow-overview li .fo-name { font-size: 13px; font-weight: 700; color: #2b2f36; }
.flow-overview li .fo-depts { display: flex; flex-wrap: wrap; gap: 4px; }
.fo-dept {
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 1px 8px; border-radius: 10px; line-height: 1.5;
}

/* ============ 产品卡：来料检 / 让步放行 提示 ============ */
.line-note { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; }
.iqc-note, .concession-note {
  font-size: 12.5px; font-weight: 600; padding: 6px 9px; border-radius: 8px; line-height: 1.4;
}
.iqc-note.ok { color: #095c2b; background: #eafaf0; border: 1px solid #b7e6c6; }
.iqc-note.ex { color: #0958a3; background: #eaf4ff; border: 1px solid #b6d8f5; }
.iqc-note.bad { color: #a8071a; background: #fff2f0; border: 1px solid #ffc9c2; }
.concession-note.ok { color: #095c2b; background: #eafaf0; border: 1px solid #b7e6c6; }
.concession-note.bad { color: #a8071a; background: #fff2f0; border: 1px solid #ffc9c2; }
.concession-note.wait { color: #ad6800; background: #fff7e6; border: 1px solid #ffd98a; }

/* ============ 下一步评估部门 · 高亮横幅（详情页） ============ */
.next-actor-banner {
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 0; padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7e6 0%, #fff1d6 100%);
  border: 2px solid #ffb938;
  box-shadow: 0 2px 10px rgba(255, 153, 0, 0.18);
}
.nab-left { display: flex; align-items: center; gap: 8px; }
.nab-icon { font-size: 20px; line-height: 1; }
.nab-cap { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #ad6800; }
.nab-body { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 16px; }
.nab-wait { font-weight: 700; color: #8a4b00; }
.nab-title { font-weight: 600; color: #5c3a00; }
.nab-chip {
  display: inline-flex; align-items: center; font-size: 15px; font-weight: 800;
  color: #fff; padding: 4px 12px; border-radius: 20px; line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.nab-chip.sm { font-size: 12px; padding: 2px 9px; }

/* ============ 下一步评估部门 · 卡片小条（看板） ============ */
.oc-next {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 2px; padding: 7px 10px;
  background: #fff7e6; border: 1.5px solid #ffc861; border-radius: 10px;
}
.oc-next-cap { font-size: 13px; font-weight: 800; color: #ad6800; }
.oc-next-title { font-size: 12.5px; font-weight: 600; color: #6b4a00; flex: 1 1 auto; min-width: 60px; }

/* ============ 采购逐行交期填写表 ============ */
.mt-table.mt-lead .mt-ro { background: #f3f4f6; color: #555; font-weight: 600; }
.mt-table.mt-lead .mt-lead-col { background: #fff7e6; }
.mt-table.mt-lead .mt-lead-col th { background: #ffe7ba; color: #ad6800; }
.mt-lead-input { width: 150px; padding: 4px 8px; border: 1.5px solid #ffc861; border-radius: 6px; font-size: 13px; text-align: center; }

/* ============ 部门配色（芯片 / 徽标统一用） ============ */
.rc-marketing  { background: #2f54eb; }
.rc-rnd        { background: #722ed1; }
.rc-purchasing { background: #fa8c16; }
.rc-production { background: #13a052; }
.rc-qa         { background: #eb2f96; }
.rc-doc_ctrl   { background: #08979c; }
.rc-admin      { background: #595959; }
