/* ============================================================
 * 生产管理 —— 裁床/裁剪单登记
 * 设计取自「服装厂裁剪房裁剪单登记」原型：
 *   卡片式分节 + 分版配色配码矩阵（横＝尺码按版分组，竖＝颜色/缸号/米数）
 *   左侧固定列、版头改版名与调序、尺码增删调序、首列自动填充、
 *   与首列不一致标橙、颜色面板点选填当前行、焦点行 ▶、A4 横版打印。
 * 作用域限定在 .cut-scope，配色变量在本模块内覆盖系统主色，
 * 不影响后台其他页面。
 * ============================================================ */
.cut-scope{
  --primary:#14539a; --primary-dark:#0e3d75; --primary-soft:#eef2f8;
  --border:#d8dee8; --border2:#c3d0e4; --text:#1f2937; --muted:#6b7280;
  --ok:#0f7b4f; --warn:#b45309; --danger:#b91c1c;
  --amber:#f59e0b;
  color:var(--text);
}
.cut-page{max-width:1460px;margin:0 auto;padding:4px 0 20px}
.cut-scope .crumb-tip{font-size:12px;color:var(--warn);font-weight:400}

/* ---------- 卡片 ---------- */
.cut-scope .card{background:#fff;border:1px solid var(--border);border-radius:6px;margin-bottom:14px;overflow:hidden}
.cut-scope .card>h2{margin:0;font-size:14px;font-weight:700;padding:10px 14px;background:var(--primary-soft);
  border-bottom:1px solid var(--border);color:var(--primary-dark);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cut-scope .card>h2 .tip{font-weight:400;font-size:12px;color:var(--warn)}
.cut-scope .card>h2 .sum{margin-left:auto;font-size:12px;color:var(--muted);font-weight:400}
.cut-scope .card .body{padding:14px}

/* ---------- 表单字段 ---------- */
.cut-scope .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px 16px;white-space:normal}
.cut-scope .f{display:flex;flex-direction:column;gap:4px}
.cut-scope .f label{font-size:12px;color:var(--muted)}
.cut-scope .f label .must{color:var(--danger)}
.cut-scope .f input,.cut-scope .f select,.cut-scope .f textarea{
  font-family:inherit;font-size:14px;padding:7px 9px;border:1px solid var(--border);border-radius:4px;
  background:#fff;color:var(--text);width:100%;height:auto;outline:none}
.cut-scope .f input:focus,.cut-scope .f select:focus,.cut-scope .f textarea:focus{
  border-color:var(--primary);box-shadow:0 0 0 2px rgba(20,83,154,.12)}
.cut-scope .f input[readonly]{background:#f5f7fa;color:var(--primary);font-weight:600}
.cut-scope .f textarea{resize:vertical;min-height:52px}
.cut-scope .f.wide{grid-column:1/-1}
.cut-scope .f .withbtn{display:flex;gap:6px}
.cut-scope .f .withbtn select{flex:1}

/* ---------- 按钮（模块内覆盖系统风格） ---------- */
.cut-scope .btn{border-radius:4px;height:34px;padding:0 14px;font-size:13px;border-color:var(--border);color:var(--text)}
.cut-scope .btn:hover{border-color:var(--primary);color:var(--primary)}
.cut-scope .btn.primary{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:600}
.cut-scope .btn.primary:hover{background:var(--primary-dark);color:#fff}
.cut-scope .btn.big{height:40px;padding:0 26px}
.cut-scope .btn.mid{height:40px;padding:0 20px}
.cut-scope .mini{padding:1px 6px;font-size:11px;line-height:1.5;border-radius:3px;border:1px solid var(--border);
  background:#fff;color:var(--text);cursor:pointer;font-family:inherit;transition:.15s}
.cut-scope .mini:hover{border-color:var(--primary);color:var(--primary)}
.cut-scope .mini.danger{color:var(--danger);border-color:#e5b7b7}
.cut-scope .mini.danger:hover{background:#fef2f2;border-color:var(--danger)}
.cut-scope .confirming{background:var(--danger) !important;border-color:var(--danger) !important;
  color:#fff !important;font-weight:700;animation:cutPulse .8s infinite}
@keyframes cutPulse{0%,100%{opacity:1}50%{opacity:.65}}

/* ---------- 统计卡 ---------- */
.cut-scope .stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:14px}
.cut-scope .stat{background:#fff;border:1px solid var(--border);border-radius:6px;padding:12px 14px}
.cut-scope .stat .n{font-size:21px;font-weight:700;color:var(--primary);line-height:1.2;font-variant-numeric:tabular-nums}
.cut-scope .stat .t{font-size:12px;color:var(--muted);margin-top:2px}

/* ---------- 工具条 ---------- */
.cut-scope .toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:10px}
.cut-scope .toolbar input,.cut-scope .toolbar select{font-family:inherit;font-size:13px;padding:7px 10px;
  border:1px solid var(--border);border-radius:4px;background:#fff;color:var(--text);height:auto}
.cut-scope .toolbar input:focus,.cut-scope .toolbar select:focus{outline:none;border-color:var(--primary)}
.cut-scope .toolbar .lb{font-size:12px;color:var(--muted)}
.cut-scope .hint{font-size:12px;color:var(--muted);line-height:1.75}
.cut-scope .hint b{color:var(--primary-dark)}
.cut-scope .empty{text-align:center;padding:34px 0;color:var(--muted)}

/* ---------- 状态标签 ---------- */
.cut-scope .tag{display:inline-block;padding:2px 8px;border-radius:10px;font-size:12px;
  background:var(--primary-soft);color:var(--primary-dark)}
.cut-scope .tag.s1{background:#fff4e5;color:var(--warn)}
.cut-scope .tag.s2{background:#e3f0ff;color:var(--primary)}
.cut-scope .tag.s3{background:#e7f6ee;color:var(--ok)}
.cut-scope .tag.s4{background:#eceff3;color:var(--muted)}

/* ---------- 颜色面板 ---------- */
.cut-scope .cpanel{display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding:10px 12px;margin-bottom:10px;
  border:1px dashed var(--border2);border-radius:5px;background:#f8fafd;min-height:48px}
.cut-scope .cpanel .lb{font-size:12px;color:var(--muted)}
.cut-scope .chip{border:1px solid var(--primary);background:#fff;color:var(--primary);border-radius:14px;
  padding:5px 14px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:.15s}
.cut-scope .chip:hover{background:var(--primary);color:#fff}
.cut-scope .focustip{font-size:12px;color:var(--primary-dark);background:#eaf2ff;border:1px solid var(--border2);
  border-radius:4px;padding:3px 8px}
.cut-scope .difftip{font-size:12px;color:#92400e;background:#fff7e6;border:1px solid #fcd9a0;
  border-radius:4px;padding:3px 8px;margin-left:8px}
.cut-scope .difftip.act{background:var(--amber);color:#fff;border-color:var(--amber)}

/* 尺码点选面板（选组 → 点选加列） */
.cut-scope .sizepick{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:9px 12px;margin:-2px 0 10px;
  border:1px dashed var(--border2);border-radius:5px;background:#fbfcfe;min-height:42px}
.cut-scope .sizepick .lb{font-size:12px;color:var(--muted)}
.cut-scope .chip.sp{border-color:var(--border2);color:var(--text);background:#fff;font-weight:500;padding:4px 13px}
.cut-scope .chip.sp:hover{background:var(--primary);border-color:var(--primary);color:#fff}
.cut-scope .chip.sp.has{background:#e7f0fa;border-color:var(--primary);color:var(--primary-dark)}

/* ---------- 分版矩阵 ---------- */
.cut-scope .mx-wrap{overflow:auto;max-height:560px;border:1px solid var(--border);border-radius:4px;background:#fff}
table.cut-mx{border-collapse:collapse;min-width:820px;font-size:13px}
.cut-scope table.cut-mx th,.cut-scope table.cut-mx td{border:1px solid var(--border);padding:4px 5px;
  text-align:center;font-size:13px;vertical-align:middle}
.cut-scope table.cut-mx th{background:var(--primary-soft);font-weight:600;color:var(--primary-dark);white-space:nowrap}
.cut-scope table.cut-mx td input,.cut-scope table.cut-mx td select{width:100%;border:none;padding:4px 3px;
  text-align:center;font-family:inherit;font-size:13px;background:transparent;color:var(--text)}
.cut-scope table.cut-mx td input:focus{outline:2px solid var(--primary);background:#fff}
.cut-scope table.cut-mx td input.t-l{text-align:left}
.cut-scope table.cut-mx thead th.grp{background:#dfe8f5;border-bottom:1px solid #b9c7dd;padding:3px 4px}
.cut-scope table.cut-mx thead th.grp .bn{width:46px;text-align:center;font-weight:700;font-size:14px;
  border:1px solid var(--border2);border-radius:3px;padding:2px;background:#fff;color:var(--primary-dark)}
.cut-scope table.cut-mx thead th.grp .bop{display:flex;gap:2px;justify-content:center;margin-top:3px}
.cut-scope table.cut-mx thead th.sz{background:#f4f7fb;font-size:13px}
.cut-scope table.cut-mx thead th.sz .szname{display:block;font-weight:700}
.cut-scope table.cut-mx thead th.sz .szop{display:flex;gap:2px;justify-content:center;margin-top:2px}
.cut-scope table.cut-mx thead th.sz.fst{background:#e7f0fa}
.cut-scope table.cut-mx td.cell{padding:2px}
.cut-scope table.cut-mx td.cell input{min-width:52px;width:56px;padding:4px 2px}
.cut-scope table.cut-mx td.cell.fst input{background:#f3f8ff}
.cut-scope table.cut-mx td.cell.diff input{background:var(--amber) !important;font-weight:700;
  box-shadow:inset 0 0 0 2px var(--amber);border-radius:2px}
.cut-scope table.cut-mx td.cell.fst.diff input{background:#fff !important}
.cut-scope table.cut-mx td.cell.dsel{background:#dbeafe !important}
.cut-scope table.cut-mx td.cell.dsel input{outline:3px solid var(--primary);outline-offset:-1px}
.cut-scope table.cut-mx td.cell.dsel.diff input{background:var(--amber) !important}
.cut-scope table.cut-mx td.sub{background:#f7f9fc;font-weight:700;color:var(--primary-dark)}
.cut-scope table.cut-mx td.idx{background:#f4f7fb;color:var(--muted);font-weight:600;width:44px}
.cut-scope table.cut-mx tfoot td{background:var(--primary-soft);font-weight:700}
.cut-scope table.cut-mx tfoot td.g{background:#dfe8f5}
.cut-scope table.cut-mx tfoot td.num{color:var(--primary-dark)}
.cut-scope table.cut-mx .stk{position:sticky;z-index:5;background:#fff}
.cut-scope table.cut-mx thead .stk{background:var(--primary-soft);z-index:8}
.cut-scope table.cut-mx thead th.grp .bdiff{background:var(--amber) !important;border-color:var(--amber) !important;
  color:#fff !important;font-weight:700}
.cut-scope table.cut-mx .c0{left:0;min-width:44px}
.cut-scope table.cut-mx .c1p{left:44px;min-width:112px}
.cut-scope table.cut-mx .c2p{left:156px;min-width:84px}
.cut-scope table.cut-mx .c3p{left:240px;min-width:66px}
.cut-scope table.cut-mx td.stk{background:#fff}
.cut-scope table.cut-mx input.err{outline:2px solid var(--danger);background:#fff1f1}
.cut-scope table.cut-mx tr.focus{outline:2px solid var(--primary);outline-offset:-2px}
.cut-scope table.cut-mx tr.focus td{background:#eaf2ff !important}
.cut-scope table.cut-mx tr.focus td.idx{background:var(--primary);color:#fff}
.cut-scope table.cut-mx tr.focus td.idx::after{content:' ▶'}
.cut-scope table.cut-mx .rowop{display:flex;gap:2px;justify-content:center}

/* ---------- 台账表格 ---------- */
.cut-scope .list-wrap{overflow-x:auto}
table.cut-list{border-collapse:collapse;width:100%;font-size:13px}
.cut-scope table.cut-list th,.cut-scope table.cut-list td{border:1px solid var(--border);padding:6px 8px;
  text-align:center;vertical-align:middle}
.cut-scope table.cut-list th{background:var(--primary-soft);font-weight:600;color:var(--primary-dark);white-space:nowrap}
.cut-scope table.cut-list td.l,.cut-scope table.cut-list th.l{text-align:left}
.cut-scope table.cut-list tbody tr:hover td{background:#f6f9fd}
.cut-scope .code-tag{display:inline-block;padding:1px 7px;border-radius:4px;background:var(--primary-soft);
  color:var(--primary-dark);font-weight:600;font-size:12px;white-space:nowrap}
.cut-scope td .cut-chip{display:inline-block;padding:1px 7px;margin:1px 3px 1px 0;border-radius:99px;font-size:12px;
  background:#f1f5f9;border:1px solid var(--border);color:#475569;white-space:nowrap}

/* ---------- 弹窗内小表格（该款 SKU 一览） ---------- */
.cut-scope .lib-tb{width:100%;border-collapse:collapse;margin-bottom:12px}
.cut-scope .lib-tb td,.cut-scope .lib-tb th{border:1px solid var(--border);font-size:12px;padding:5px 6px;text-align:center}
.cut-scope .lib-tb th{background:var(--primary-soft);color:var(--primary-dark);font-weight:600}
.cut-scope .lib-tb td.l,.cut-scope .lib-tb th.l{text-align:left}
.cut-scope .lib-empty{padding:22px;text-align:center;color:var(--muted);font-size:13px;
  border:1px dashed var(--border);border-radius:5px;margin-bottom:12px}

/* ---------- A4 横版打印 ----------
   打印走独立 iframe 文档（见 cutting.js 的 printHtml），
   不在本表声明 @page / @media print —— 全局 print.css 已把 @page 定死为
   240×140mm 凭证纸，若在此覆盖会连带破坏报销单打印。 */

/* 页内标签 + 少量补充 */
.cut-scope .cut-tabs{display:flex;gap:8px;margin-bottom:14px;border-bottom:1px solid var(--border);padding-bottom:10px}
.cut-scope .cut-tabs .btn{border-radius:4px 4px 0 0;border-bottom:3px solid transparent;background:transparent;color:var(--muted);font-size:14px;height:34px;padding:0 20px}
.cut-scope .cut-tabs .btn.primary{background:transparent;border-color:transparent;color:var(--primary);font-weight:700;border-bottom-color:var(--primary)}
.cut-scope .cut-tabs .btn:hover{color:var(--primary);background:transparent}
.cut-scope .req-line{display:flex;align-items:center;gap:4px}
.cut-scope .cut-sizebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:0 0 10px}
.cut-scope .cut-sizebar:empty{display:none}
.cut-scope .cut-size-lab{font-size:12px;color:var(--muted);margin-right:2px}
.cut-scope .cut-size-item{display:inline-flex;align-items:baseline;gap:5px;padding:3px 10px;border-radius:99px;
  background:#e3f0ff;border:1px solid #c3d8f5;font-size:12px}
.cut-scope .cut-size-item em{font-style:normal;color:var(--muted)}
.cut-scope .cut-size-item b{color:var(--primary-dark);font-variant-numeric:tabular-nums}

/* 单据信息：裁剪单号（只读）缩窄，款号加宽占两列 */
.cut-scope .f-no{max-width:200px}
.cut-scope .f-style{grid-column:span 2}
.cut-scope .f-style select{min-height:34px}
