
/* ==== app.css ==== */
/* ============ 金格展钣金 · 生产系统（电脑端样式）============ */
:root{
  --pri:#2563eb; --pri-d:#1d4ed8; --pri-l:#eff6ff;
  --ok:#16a34a; --ok-l:#f0fdf4;
  --warn:#f59e0b; --warn-l:#fffbeb;
  --danger:#dc2626; --danger-l:#fef2f2;
  --info:#0891b2; --info-l:#ecfeff;
  --purple:#7c3aed;
  --ink:#0f172a; --ink-2:#334155; --ink-3:#64748b; --ink-4:#94a3b8;
  --line:#e2e8f0; --line-2:#cbd5e1;
  --bg:#f1f5f9; --card:#fff;
  --sd:0 1px 3px rgba(15,23,42,.08),0 1px 2px rgba(15,23,42,.04);
  --sd-lg:0 10px 30px rgba(15,23,42,.14);
  --r:10px; --r-sm:7px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC","Hiragino Sans GB",sans-serif;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{margin:0;font-weight:650;letter-spacing:-.01em}
a{color:var(--pri);text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
[hidden]{display:none!important}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:6px;border:2px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* ---------------- 登录 ---------------- */
.login-mask{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#0f172a 0%,#1e3a8a 55%,#2563eb 100%);z-index:200}
.login-box{width:372px;background:#fff;border-radius:16px;padding:34px 34px 26px;box-shadow:var(--sd-lg);text-align:center}
.login-logo{width:56px;height:56px;margin:0 auto 14px;border-radius:14px;background:var(--pri);color:#fff;
  font-size:28px;font-weight:700;display:flex;align-items:center;justify-content:center}
.login-box h1{font-size:20px;margin-bottom:6px}
.login-sub{color:var(--ink-3);font-size:12.5px;margin:0 0 24px}
.login-box label{display:block;text-align:left;font-size:13px;color:var(--ink-2);margin-bottom:14px;font-weight:600}
.login-box input{width:100%;margin-top:6px;padding:11px 13px;border:1px solid var(--line-2);border-radius:var(--r-sm);
  font-size:15px;font-weight:400;outline:none;transition:.15s}
.login-box input:focus{border-color:var(--pri);box-shadow:0 0 0 3px rgba(37,99,235,.13)}
.login-err{color:var(--danger);font-size:13px;min-height:20px;margin-top:10px}
.login-actions{margin-top:14px;display:flex;justify-content:center;gap:10px}
.login-actions .btn{font-size:13px;padding:7px 16px;border-radius:8px}
.login-box[hidden]{display:none}
.login-tip{margin-top:12px;font-size:11.5px;color:var(--ink-4);line-height:1.7;border-top:1px dashed var(--line);padding-top:12px}

/* ---------------- 布局 ---------------- */
#app{display:flex;height:100vh;overflow:hidden}
.sidebar{width:212px;flex:0 0 212px;background:#0f172a;color:#cbd5e1;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:10px;padding:18px 18px 20px;border-bottom:1px solid #1e293b}
.brand-mark{width:32px;height:32px;border-radius:8px;background:var(--pri);color:#fff;display:flex;
  align-items:center;justify-content:center;font-weight:700;font-size:17px}
.brand-text{font-size:16px;font-weight:650;color:#f8fafc;letter-spacing:.02em}
#nav{flex:1;padding:12px 10px;overflow-y:auto}
#nav a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--r-sm);color:#cbd5e1;
  font-size:14.5px;margin-bottom:3px;cursor:pointer;transition:.13s;font-weight:500}
#nav a::before{content:attr(data-icon);font-size:16px;width:18px;text-align:center;opacity:.85}
#nav a:hover{background:#1e293b;color:#f1f5f9}
#nav a.on{background:var(--pri);color:#fff;font-weight:600;box-shadow:0 3px 10px rgba(37,99,235,.4)}
#nav a.on::before{opacity:1}
.side-foot{padding:12px;border-top:1px solid #1e293b;font-size:12px;color:#94a3b8}
#side-user{margin-bottom:8px;line-height:1.4}
#side-user b{color:#e2e8f0;font-size:13px}
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0}
.topbar{background:#fff;border-bottom:1px solid var(--line);padding:0 22px;height:58px;display:flex;
  align-items:center;justify-content:space-between;gap:16px;flex:0 0 58px}
.topbar h2{font-size:17.5px}
.topbar-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.page{flex:1;overflow-y:auto;padding:20px 22px 60px}

/* ---------------- 按钮 ---------------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 14px;border:1px solid var(--line-2);
  background:#fff;color:var(--ink-2);border-radius:var(--r-sm);cursor:pointer;font-size:13.5px;font-weight:600;
  transition:.13s;white-space:nowrap;line-height:1.3}
.btn:hover{border-color:var(--ink-4);background:#f8fafc}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none}
.btn-primary{background:var(--pri);border-color:var(--pri);color:#fff}
.btn-primary:hover{background:var(--pri-d);border-color:var(--pri-d)}
.btn-ok{background:var(--ok);border-color:var(--ok);color:#fff}
.btn-ok:hover{background:#15803d;border-color:#15803d}
.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn-danger:hover{background:#b91c1c}
.btn-ghost{background:transparent;border-color:transparent;color:var(--ink-3)}
.btn-ghost:hover{background:#f1f5f9;color:var(--ink)}
.sidebar .btn-ghost{color:#94a3b8;border-color:#334155;width:100%}
.sidebar .btn-ghost:hover{background:#1e293b;color:#f1f5f9}
.btn-sm{padding:5px 10px;font-size:12.5px}
.btn-lg{padding:12px 18px;font-size:15px;width:100%}
.btn-xs{padding:3px 8px;font-size:12px;border-radius:5px}

/* ---------------- 卡片 / 表格 ---------------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sd);margin-bottom:16px}
.card-head{padding:13px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-between;gap:12px;flex-wrap:wrap}
.card-head h3{font-size:14.5px}
.card-head .sub{font-size:12.5px;color:var(--ink-3);font-weight:400;margin-left:8px}
.card-body{padding:16px}
.card-body.p0{padding:0}
.grid{display:grid;gap:14px}
.grid.g4{grid-template-columns:1.4fr .8fr 1fr 1fr}
.g2{grid-template-columns:repeat(2,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}
.g5{grid-template-columns:repeat(5,1fr)}
.g6{grid-template-columns:repeat(6,1fr)}
@media(max-width:1400px){.g6{grid-template-columns:repeat(3,1fr)}.g5{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1150px){.g4{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:repeat(2,1fr)}}

table{width:100%;border-collapse:collapse;font-size:13.5px}
/* ★ 表头：浅蓝色底（客户 2026-10-08：要深一点、换成浅蓝色）
   用跟主题蓝 --pri(#2563eb) 同一色系的浅蓝 #dbeafe，字用深蓝 #1e3a8a —— 跟蓝色主题一套 */
th{background:#dbeafe;text-align:left;padding:10px 12px;font-weight:650;color:#1e3a8a;
  border-bottom:1px solid #bfdbfe;white-space:nowrap;font-size:13px}
/* ★ 所有表格：横竖都要分格线，细一点、浅一点（客户 2026-10-08）
   第一版用了 4.5% 的黑 —— 白底上算出来 rgb(244,245,246)，客户说「格子看不清」✗
   现在调到 9~18%：浅但看得见 ✓ */
td{padding:9px 12px;border-bottom:1px solid rgba(15,23,42,.10);vertical-align:middle}
th + th, td + td{border-left:1px solid rgba(15,23,42,.09)}       /* 竖线 */
thead th + th{border-left:1px solid #bfdbfe}                  /* 表头竖线：淡蓝 */
thead th{border-bottom:1px solid #93c5fd}   /* 表头下沿：蓝色，跟底色一套 */
tbody tr td:last-child{border-right:none}
/* ★ 隔行浅灰底（斑马纹）—— 客户 2026-10-10：「隔一行就用浅灰色底色，看起来高级一点」
   顺序很重要：斑马纹写在前面，后面的 :hover / .sel 才盖得住它 ✓ */
tbody tr:nth-child(even){background:#f7f9fc}
tbody tr:hover{background:#eef4fb}
thead tr:hover{background:transparent}
tbody tr:last-child td{border-bottom:none}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
td.mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px}
.tbl-wrap{overflow-x:auto}
/* ================================================================
 * 待外发明细（委外喷涂 → 新建/待外发）：产品名称收窄 + 行高压矮（2026-11-08 老板）
 *   改前：产品名称列没定宽（吃光剩余宽度，老板：「占屏幕近一半」）；行高 ~80px
 *         （td padding 6px + 输入框 padding 5px + 备注换行），一屏只看得见 8 行
 *   改法（照「报工记录」#r-table 那套，只挂 table.cand，别的表一律不碰）：
 *     ① 产品名称定宽 184px，其余列按内容定宽；列数 14 不变，只把「喷涂厂」挪到最左
 *     ② 单行 + 省略号：nowrap / overflow:hidden / text-overflow:ellipsis
 *        被「…」截掉的字挂在 td 的 title 上，鼠标悬停看全文（outsource.js 渲染时写的）
 *     ③ 行高：td padding 3px 6px、输入框 26px、字号 13px / 行高 1.35
 *     ④ 最后一列（操作）不留宽度 → 宽屏时由它吃掉多余空间，产品名称不被拉宽
 *     ⑤ min-width 保持 1060 不动 → 右栏「委外清单合计」的位置跟改前一样，不挤出去
 * ================================================================ */
table.cand{table-layout:fixed;width:100%;min-width:1060px;font-size:13px}
/* ★ 2026-11-08 老板：「列宽要可以自由调整」
   原来的 <colgroup> 去掉了 —— table-layout:fixed 下 <col> 的宽度会压住 th，
   TablePrefs 拖表头边缘改的 th.style.width 就没反应。现在默认宽度按 data-col 写在这里，
   用户拖出来的宽度由 TablePrefs 记在 th 的 inline style 上（优先级更高，刷新后还在）。
   ★ 列 key 跟 outsource.js 的 OO_CAND_COLS 一一对应。 */
table.cand th[data-col="sel"]{width:24px}
table.cand th[data-col="sup"]{width:0}
table.cand.has-split th[data-col="sup"]{width:96px}
table.cand th[data-col="wo"]{width:104px}
table.cand th[data-col="prod"]{width:140px}
table.cand th[data-col="draw"]{width:96px}
/* ★ 2026-11-09 老板「材质要找图纸识别加上去」：材质/板厚两列要能放下
   「Q235 + 自动徽章」「1.5 + 自动徽章」，36/34 太窄会截断 → 72/52。
   加上去以后一行放不下（操作列被挤没、出横向滚动）→ 从产品名称/图号/单价/备注各让一点，
   保证 1680 宽的屏上 15 列全露出来（列设置里还能自己拖）。 */
table.cand th[data-col="mat"]{width:76px}
table.cand th[data-col="color"]{width:66px}
table.cand th[data-col="thk"]{width:60px}
table.cand th[data-col="oqty"]{width:46px}
table.cand th[data-col="qty"]{width:44px}
/* 单件面积 112：输入框 52 + 「缺面积/计算中」三字徽章 ~37，不截断（100 会变成「…」）
   ★ 2026-11-09 老板「小件0.5元」：面积格要多放一个「小件 0.5元/件」徽章（约 66px）
     → 112 放宽到 160；单价格要放「/件」小尾巴 → 58 放宽到 80（列设置里还能自己拖） */
table.cand th[data-col="area"]{width:136px}
table.cand th[data-col="price"]{width:76px}
table.cand th[data-col="amt"]{width:52px}
table.cand th[data-col="rmk"]{width:64px}
/* ops（操作）不给宽度 → 宽屏时由它吃掉多余空间，产品名称不被拉宽 */
table.cand th,table.cand td{padding:3px 6px;line-height:1.35;vertical-align:middle}
table.cand th{font-size:12.5px;padding:5px 6px;white-space:nowrap}
table.cand tbody td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
table.cand td input,table.cand td select{min-width:0;width:100%;height:26px;box-sizing:border-box;
  padding:1px 5px;font-size:12.5px;line-height:1.2}
table.cand td input[type="checkbox"]{width:auto;height:auto;padding:0;margin:0;vertical-align:middle}
/* 数字框的上下小箭头挤掉一半输入宽度 → 去掉（直接敲数字） */
table.cand td input[type="number"]{-moz-appearance:textfield;appearance:textfield}
table.cand td input[type="number"]::-webkit-outer-spin-button,
table.cand td input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
/* 产品名后面的备注：跟名字同一行，小灰字 */
table.cand td .c-rmk{margin-left:5px;font-size:11.5px;color:#94a3b8;font-weight:400}
/* 「已委外 N」跟在订单数量后面，不换行（以前是 <div> → 撑成两行） */
table.cand td .c-out{margin-left:4px;font-size:11px;color:#cbd5e1}
/* ★ 2026-11-08 老板：不拆分就别占「喷涂厂」这一列（正常零件都用顶部默认厂）。
   做法：列宽 0（上面 th[data-col="sup"]），单元格连内边距/边框都去掉；
   出现拆分行才展开（table.cand.has-split）→ 拆分行各自选厂，其它行显示默认厂名（灰字）。
   ★ 表头文字是里面的 <span class="c-sup-txt">（TablePrefs 改列名会用 textContent 覆盖 th，
     直接写 th.textContent 会把「喷涂厂」冲成空 —— 踩过） */
table.cand:not(.has-split) th.c-sup-th,table.cand:not(.has-split) td.c-sup-cell{padding:0;border:0}
table.cand:not(.has-split) th.c-sup-th .col-grip{display:none}
table.cand td.c-sup-cell .c-sup-tag{display:block;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;font-size:12px;color:#94a3b8}
/* 拆出来的行：「拆」小徽章 + 名称后面；行底色淡黄，一眼看出跟普通零件不是一回事 */
.tag.t-split{background:#fef3c7;color:#b45309;border:1px solid #fde68a;margin-left:5px;
  padding:0 6px;font-size:11px;line-height:1.6;border-radius:6px}
table.cand tr.is-split td.c-prod{color:#92400e}
/* 备注列（金额后面、操作前面）：长备注省略 + title 看全文，不撑行高 */
table.cand td.c-rmk-cell input{font-size:12px}
/* 拆单弹窗 */
.sp-orig{display:flex;gap:20px;flex-wrap:wrap;align-items:baseline;background:#f8fafc;
  border:1px solid var(--line);border-radius:10px;padding:9px 14px;font-size:13px;margin:10px 0}
.sp-orig .k{color:#64748b;font-size:12px;margin-right:6px}
.sp-tbl{width:100%;border-collapse:collapse;font-size:13px}
.sp-tbl th{font-size:12.5px;padding:6px;white-space:nowrap}
.sp-tbl td{padding:4px 6px;vertical-align:middle}
.sp-tbl td input,.sp-tbl td select{width:100%;box-sizing:border-box;height:28px;padding:2px 7px;font-size:13px}
.sp-tbl td.sp-idx{text-align:center;font-weight:800;color:#2563eb;font-size:15px;white-space:nowrap}
.sp-tbl td.sp-del{text-align:center}
.sp-foot{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:10px;flex-wrap:wrap}
.sp-sum{font-size:13px;color:#64748b}
.sp-sum.ok b{color:#16a34a}
.sp-sum.bad{color:#dc2626;font-weight:600}
.sp-sum.bad b{color:#dc2626}
/* ★ 2026-11-08 老板：待外发明细加搜索栏 —— 筛不中的行/分组只藏起来（勾选状态还在，清空搜索即恢复） */
table.cand tr.hide{display:none}
/* ★ 2026-11-09 老板：搜索框也能搜客户 → placeholder 变长（「… / 客户」），框宽 220→250 保证完整显示 */
.oo-filter{width:250px;max-width:100%;height:auto;padding:5px 9px;font-size:12.5px}
.oo-filter-info{padding:6px 12px;font-size:12.5px;color:#64748b;background:#f8fafc;
  border-bottom:1px solid var(--line);line-height:1.6}
.oo-filter-info b{color:#2563eb}
.oo-filter-info.warn{background:#fffbeb;color:#92400e}
.oo-filter-info.warn b{color:#b45309}
@media(max-width:760px){.oo-filter{flex:1 1 100%;width:auto;min-width:0}}
.empty{padding:44px 20px;text-align:center;color:var(--ink-4);font-size:13.5px}
.empty b{display:block;font-size:15px;color:var(--ink-3);margin-bottom:6px}

/* ---------------- 标签 / 状态 ---------------- */
.tag{display:inline-flex;align-items:center;padding:2px 9px;border-radius:20px;font-size:12px;
  font-weight:650;white-space:nowrap;line-height:1.7}
.t-gray{background:#f1f5f9;color:var(--ink-3)}
.t-blue{background:var(--pri-l);color:var(--pri-d)}
.t-ok{background:var(--ok-l);color:#15803d}
.t-warn{background:var(--warn-l);color:#b45309}
.t-danger{background:var(--danger-l);color:#b91c1c}
.t-info{background:var(--info-l);color:#0e7490}
.t-purple{background:#f5f3ff;color:#6d28d9}
.tag-mach{background:#ecfeff;color:#0e7490;border:1px solid #a5f3fc;font-weight:600}

/* ---------- 内置 AI 助手 ---------- */
#ai-fab{position:fixed;right:22px;bottom:22px;z-index:900;width:54px;height:54px;border-radius:50%;
  border:none;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-size:24px;cursor:pointer;
  box-shadow:0 6px 20px rgba(37,99,235,.38);transition:transform .18s,box-shadow .18s}
#ai-fab:hover{transform:scale(1.08);box-shadow:0 8px 26px rgba(37,99,235,.5)}
#ai-fab.on{background:linear-gradient(135deg,#475569,#334155)}
/* ★ 面板放大 2 倍（客户 2026-10-10：「AI对话框太小了，放大2倍」）
   430×600 → 860×min(1100, 视口高-90)
   小屏幕上还是铺满可用空间，不会跑出去 ✓ */
.ai-panel{position:fixed;right:22px;bottom:88px;z-index:901;width:860px;max-width:calc(100vw - 44px);
  height:1100px;max-height:calc(100vh - 106px);background:#fff;border-radius:14px;display:none;
  flex-direction:column;box-shadow:0 14px 50px rgba(15,23,42,.22);border:1px solid #e2e8f0;overflow:hidden}
/* 窄屏（笔记本）自动缩到能放下 */
@media (max-width:1500px){.ai-panel{width:calc(100vw - 60px);right:30px}}
/* 正文和输入框也可以大一点，不然后面全是空白 */
.ai-panel .ai-body{font-size:14.5px}
.ai-panel.on{display:flex}
.ai-head{display:flex;align-items:center;gap:8px;padding:11px 14px;border-bottom:1px solid #e2e8f0;
  background:linear-gradient(135deg,#eff6ff,#f5f3ff)}
.ai-head b{font-size:16px}
.ai-model{font-size:11.5px;color:#64748b;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:1px 8px}
.ai-ico{border:none;background:transparent;font-size:15px;cursor:pointer;color:#64748b;padding:2px 6px;border-radius:6px}
.ai-ico:hover{background:#e2e8f0}
.ai-body{flex:1;overflow-y:auto;padding:18px;background:#f8fafc;font-size:14.5px;line-height:1.7}
.ai-msg{max-width:88%;padding:11px 16px;border-radius:13px;margin-bottom:12px;white-space:normal;word-break:break-word}
.ai-msg.me{background:#2563eb;color:#fff;margin-left:auto;border-bottom-right-radius:3px}
.ai-msg.bot{background:#fff;border:1px solid #e2e8f0;border-bottom-left-radius:3px}
.ai-msg.bot code{background:#f1f5f9;padding:1px 5px;border-radius:4px;font-size:12.5px}
.ai-tbl{width:100%;border-collapse:collapse;margin:7px 0;font-size:12.5px}
.ai-tbl th,.ai-tbl td{border:1px solid #e2e8f0;padding:4px 7px;text-align:left}
.ai-tbl th{background:#f1f5f9;font-weight:600}
.ai-steps{margin-top:8px;padding-top:7px;border-top:1px dashed #cbd5e1;font-size:11.5px;color:#7c3aed}
.ai-dots{color:#94a3b8}
.ai-foot{display:flex;gap:8px;padding:10px 12px;border-top:1px solid #e2e8f0;background:#fff;align-items:flex-end}
.ai-foot textarea{flex:1;resize:none;border:1px solid #e2e8f0;border-radius:10px;padding:11px 14px;font-size:14.5px;
  font-size:13.5px;font-family:inherit;line-height:1.5;max-height:120px;outline:none}
.ai-foot textarea:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.ai-hint{padding:0 12px 8px;font-size:11px;color:#94a3b8;background:#fff}
.ai-previews{display:none;gap:8px;padding:9px 12px 0;background:#fff;flex-wrap:wrap;border-top:1px solid #e2e8f0}
.ai-thumb{position:relative;width:62px;height:62px;border-radius:8px;overflow:hidden;border:1px solid #e2e8f0}
.ai-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ai-thumb button{position:absolute;right:2px;top:2px;width:17px;height:17px;border-radius:50%;border:none;
  background:rgba(15,23,42,.72);color:#fff;font-size:11px;line-height:1;cursor:pointer;padding:0}
.ai-warn{margin-top:8px;padding:6px 9px;background:#fffbeb;border:1px solid #fde68a;border-radius:7px;
  font-size:12px;color:#92400e}

/* ---------- 看板进度条 ---------- */
.pbar-wrap{display:flex;align-items:center;gap:8px}
.pbar{position:relative;flex:1;height:11px;background:#eef2f7;border-radius:6px;overflow:hidden;min-width:64px}
.pbar i{position:absolute;left:0;top:0;height:100%;border-radius:6px;transition:width .3s}
.pbar u{position:absolute;top:0;height:100%;background:rgba(22,163,74,.85);
  box-shadow:0 0 0 1px rgba(255,255,255,.6) inset}
.pbar-txt{font-size:11.5px;color:#64748b;white-space:nowrap;min-width:46px;text-align:right}

/* ---------- 可调列宽的表头 ---------- */
table.fixable thead th{position:relative;user-select:none}
table.fixable thead th .col-grip{position:absolute;top:0;right:-6px;width:14px;height:100%;
  cursor:col-resize;z-index:9;display:block;background:transparent;transition:background .12s}
table.fixable thead th .col-grip::after{content:'';position:absolute;left:6px;top:22%;height:56%;width:2px;
  background:rgba(30,58,138,.18);border-radius:2px;transition:background .12s}
table.fixable thead th .col-grip:hover::after,
body.col-resizing table.fixable thead th .col-grip::after{background:#2563eb;width:3px;left:5px}
table.fixable thead th .col-grip:hover,body.col-resizing table.fixable thead th .col-grip{background:rgba(37,99,235,.10)}
body.col-resizing{cursor:col-resize;user-select:none}
table.fixable tbody td{overflow:hidden}

/* ---------- 列设置弹窗 ---------- */
.col-row{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 10px;border:1px solid var(--line);border-radius:8px;margin-bottom:7px;background:#fff}
.col-row:hover{border-color:var(--pri);background:#f8fafc}
.col-chk{display:flex;align-items:center;gap:9px;font-size:13.5px;font-weight:600;color:var(--ink-2);cursor:pointer;flex:1}
.col-chk input{width:16px;height:16px;accent-color:var(--pri);cursor:pointer}
.col-mv{display:flex;gap:5px}
.col-mv .btn{padding:2px 8px;line-height:1.4}
.col-mv .btn[disabled]{opacity:.35;cursor:not-allowed}
.st-pending{background:#f1f5f9;color:#475569}
.st-dispatched{background:var(--pri-l);color:#1d4ed8}
.st-working{background:var(--warn-l);color:#b45309}
.st-outsource{background:#f5f3ff;color:#6d28d9}
.st-done{background:var(--ok-l);color:#15803d}
.st-cancelled,.st-skipped{background:#f1f5f9;color:#94a3b8;text-decoration:line-through}
.st-draft{background:#f1f5f9;color:#475569}
.st-issued{background:var(--pri-l);color:#1d4ed8}
.st-partial{background:var(--warn-l);color:#b45309}
.st-received{background:var(--ok-l);color:#15803d}
.st-settled{background:var(--info-l);color:#0e7490}
.pri-普通{background:#f1f5f9;color:#475569}
.pri-加急{background:var(--warn-l);color:#b45309}
.pri-特急{background:var(--danger-l);color:#b91c1c;font-weight:700}

/* ---------------- 统计卡 ---------------- */
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;box-shadow:var(--sd)}
.stat .k{font-size:12.5px;color:var(--ink-3);font-weight:600;display:flex;align-items:center;gap:6px}
.stat .v{font-size:27px;font-weight:700;margin-top:5px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.stat .u{font-size:13px;color:var(--ink-4);font-weight:500;margin-left:3px}
.stat.b{border-left:3px solid var(--pri)} .stat.b .v{color:var(--pri)}
.stat.o{border-left:3px solid var(--ok)} .stat.o .v{color:var(--ok)}
.stat.w{border-left:3px solid var(--warn)} .stat.w .v{color:var(--warn)}
.stat.d{border-left:3px solid var(--danger)} .stat.d .v{color:var(--danger)}
.stat.p{border-left:3px solid var(--purple)} .stat.p .v{color:var(--purple)}

/* ---------------- 进度 ---------------- */
.bar{height:6px;background:#e2e8f0;border-radius:4px;overflow:hidden;min-width:70px}
.bar>i{display:block;height:100%;background:var(--pri);border-radius:4px;transition:width .3s}
.bar.ok>i{background:var(--ok)}
.bar.warn>i{background:var(--warn)}
.prog-cell{display:flex;align-items:center;gap:8px;min-width:130px}
.prog-cell span{font-size:12px;color:var(--ink-3);font-variant-numeric:tabular-nums;white-space:nowrap}

/* ---------------- 表单 ---------------- */
.field{display:block;margin-bottom:13px}
.field>label{display:block;font-size:12.5px;font-weight:650;color:var(--ink-2);margin-bottom:5px}
.field .hint{font-size:11.5px;color:var(--ink-4);font-weight:400;margin-left:5px}
input[type=text],input[type=number],input[type=date],input[type=password],input[type=tel],select,textarea{
  width:100%;padding:8px 11px;border:1px solid var(--line-2);border-radius:var(--r-sm);background:#fff;
  outline:none;transition:.14s;font-size:13.5px}
input:focus,select:focus,textarea:focus{border-color:var(--pri);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
input:disabled,select:disabled{background:#f8fafc;color:var(--ink-4)}
textarea{resize:vertical;min-height:66px}
.row{display:flex;gap:12px}
.row>*{flex:1;min-width:0}
.chk{display:inline-flex;align-items:center;gap:7px;cursor:pointer;font-size:13.5px;user-select:none}
.chk input{width:16px;height:16px;accent-color:var(--pri);cursor:pointer}
.filters{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.filters .field{margin-bottom:0;min-width:150px}
.filters .field.grow{flex:1;min-width:220px}

/* ---------------- 弹窗 ---------------- */
.mask{position:fixed;inset:0;background:rgba(15,23,42,.5);display:flex;align-items:center;justify-content:center;
  z-index:150;padding:24px;backdrop-filter:blur(2px)}
.modal{background:#fff;border-radius:12px;box-shadow:var(--sd-lg);width:640px;max-width:100%;
  max-height:calc(100vh - 48px);display:flex;flex-direction:column;animation:pop .16s ease-out}
@keyframes pop{from{transform:scale(.97) translateY(6px);opacity:0}to{transform:none;opacity:1}}
.modal.w720{width:720px}.modal.w900{width:900px}.modal.w1100{width:1100px}.modal.w480{width:480px}.modal.w520{width:520px}
.modal-head{padding:15px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-between;gap:12px;flex:0 0 auto}
.modal-head h3{font-size:16px}
.modal-head .x{border:none;background:transparent;font-size:22px;line-height:1;color:var(--ink-4);cursor:pointer;
  padding:0 4px;border-radius:5px}
.modal-head .x:hover{color:var(--danger);background:var(--danger-l)}
.modal-body{padding:18px 20px;overflow-y:auto;flex:1}
.modal-foot{padding:13px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;
  gap:9px;flex:0 0 auto;background:#f8fafc;border-radius:0 0 12px 12px;flex-wrap:wrap}
.modal-foot .left{margin-right:auto;display:flex;gap:9px;align-items:center}

/* ---------------- 提示 ---------------- */
#toast-root{position:fixed;top:16px;right:16px;z-index:300;display:flex;flex-direction:column;gap:8px}
.toast{padding:11px 16px;border-radius:9px;background:#0f172a;color:#fff;box-shadow:var(--sd-lg);
  font-size:13.5px;font-weight:500;max-width:420px;animation:slide .2s ease-out;display:flex;gap:9px;align-items:flex-start}
@keyframes slide{from{transform:translateX(24px);opacity:0}to{transform:none;opacity:1}}
.toast.ok{background:#15803d}.toast.err{background:#b91c1c}.toast.warn{background:#b45309}

/* ---------------- 工序时间轴 ---------------- */
.flow{display:flex;flex-direction:column;gap:0}
.flow-item{display:flex;gap:14px;position:relative;padding-bottom:6px}
.flow-item::before{content:'';position:absolute;left:13px;top:30px;bottom:-4px;width:2px;background:var(--line);z-index:0}
.flow-item:last-child::before{display:none}
.flow-dot{width:28px;height:28px;flex:0 0 28px;border-radius:50%;background:#fff;border:2px solid var(--line-2);
  display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:var(--ink-4);
  z-index:1;font-variant-numeric:tabular-nums}
.flow-item.done .flow-dot{background:var(--ok);border-color:var(--ok);color:#fff}
.flow-item.working .flow-dot{background:var(--warn);border-color:var(--warn);color:#fff;animation:pulse 1.6s infinite}
.flow-item.outsource .flow-dot{background:var(--purple);border-color:var(--purple);color:#fff}
.flow-item.dispatched .flow-dot{background:var(--pri);border-color:var(--pri);color:#fff}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.5)}50%{box-shadow:0 0 0 7px rgba(245,158,11,0)}}
.flow-body{flex:1;background:#fff;border:1px solid var(--line);border-radius:var(--r-sm);padding:10px 13px;
  margin-bottom:9px;min-width:0}
.flow-line1{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.flow-line1 b{font-size:14px}
.flow-meta{font-size:12.5px;color:var(--ink-3);margin-top:5px;display:flex;gap:14px;flex-wrap:wrap}
.flow-meta .ph{color:var(--pri)}
.flow-ops{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}

/* ---------------- 缩略图 ---------------- */
.thumbs{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.thumbs img{width:62px;height:62px;object-fit:cover;border-radius:6px;border:1px solid var(--line);cursor:zoom-in;
  transition:.15s;background:#f1f5f9}
.thumbs img:hover{transform:scale(1.06);box-shadow:var(--sd)}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:400;display:flex;align-items:center;
  justify-content:center;cursor:zoom-out;padding:30px}
.lightbox img{max-width:100%;max-height:100%;border-radius:6px}
.lightbox .nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.15);color:#fff;
  border:none;font-size:30px;width:48px;height:48px;border-radius:50%;cursor:pointer;line-height:1}
.lightbox .nav:hover{background:rgba(255,255,255,.3)}
.lightbox .prev{left:24px}.lightbox .next{right:24px}
.lightbox .cnt{position:absolute;bottom:22px;color:#cbd5e1;font-size:14px}

/* ---------------- 明细行编辑 ---------------- */
.items-tbl{font-size:13px}
.items-tbl th{padding:7px 8px;font-size:12.5px}
.items-tbl td{padding:5px 6px}
.items-tbl input,.items-tbl select{padding:6px 8px;font-size:13px}
.items-tbl .del{color:var(--danger);cursor:pointer;border:none;background:transparent;font-size:17px;padding:0 4px}
.items-tbl .del:hover{background:var(--danger-l);border-radius:5px}
.picker{position:relative}
.picker-list{position:absolute;left:0;right:0;top:100%;background:#fff;border:1px solid var(--line-2);
  border-radius:var(--r-sm);box-shadow:var(--sd-lg);max-height:230px;overflow-y:auto;z-index:20;margin-top:2px}
.picker-list div{padding:8px 11px;cursor:pointer;font-size:13px;border-bottom:1px solid #f8fafc}
.picker-list div:hover{background:var(--pri-l)}
.picker-list div small{color:var(--ink-4);margin-left:7px}

/* ---------------- 工序流程选择 ---------------- */
.chips{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.chip{padding:5px 11px;border:1px solid var(--line-2);border-radius:20px;font-size:12.5px;cursor:pointer;
  background:#fff;font-weight:600;color:var(--ink-3);transition:.13s;user-select:none}
.chip:hover{border-color:var(--pri);color:var(--pri)}
.chip.on{background:var(--pri);border-color:var(--pri);color:#fff}
.chip.out.on{background:var(--purple);border-color:var(--purple)}
.chip .rm{margin-left:5px;opacity:.6}
.chip .rm:hover{opacity:1}

/* ---------------- 看板 ---------------- */
.board-wrap{display:flex;gap:11px;overflow-x:auto;padding-bottom:6px}
.board-col{flex:0 0 158px;background:#f8fafc;border:1px solid var(--line);border-radius:var(--r-sm);padding:10px}
.board-col h4{font-size:13px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}
.board-col h4 em{font-style:normal;font-size:11.5px;background:#e2e8f0;color:var(--ink-3);
  padding:1px 7px;border-radius:10px;font-weight:650}
.bc-row{background:#fff;border:1px solid var(--line);border-radius:5px;padding:6px 8px;margin-bottom:6px;font-size:12px}
.bc-row b{display:block;font-size:12.5px;font-variant-numeric:tabular-nums}
.bc-row span{color:var(--ink-4);font-size:11.5px}
.bc-row .q{color:var(--pri);font-weight:650}

.list-row{display:flex;align-items:center;gap:11px;padding:9px 0;border-bottom:1px solid #f1f5f9;font-size:13px}
.list-row:last-child{border-bottom:none}
.list-row .c{flex:1;min-width:0}
.list-row .c b{font-size:13.5px}
.list-row .c div{color:var(--ink-3);font-size:12px}
.days{font-variant-numeric:tabular-nums;font-weight:700;font-size:13px;white-space:nowrap}
.days.over{color:var(--danger)}.days.soon{color:var(--warn)}.days.ok{color:var(--ok)}

/* ---------------- 打印预览按钮组 ---------------- */
.print-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.qr-mini{width:74px;height:74px;border:1px solid var(--line);border-radius:5px;padding:3px;background:#fff}
.qr-mini svg{width:100%;height:100%;display:block}

.notice{display:block;background:var(--pri-l);border:1px solid #bfdbfe;color:#1e40af;padding:10px 13px;
  border-radius:var(--r-sm);font-size:13px;margin-bottom:14px;line-height:1.75}
.notice.warn{background:var(--warn-l);border-color:#fde68a;color:#92400e}
.notice.danger{background:var(--danger-l);border-color:#fecaca;color:#991b1b}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13.5px}
.kv dt{color:var(--ink-3);font-weight:600}
.kv dd{margin:0;font-weight:500}
.sum{display:flex;gap:24px;flex-wrap:wrap;background:#f8fafc;border:1px solid var(--line);
  border-radius:var(--r-sm);padding:12px 16px;margin-top:12px}
.sum div{font-size:13px;color:var(--ink-3);font-weight:600}
.sum div b{display:block;font-size:19px;color:var(--ink);font-variant-numeric:tabular-nums;margin-top:2px}
.sum div b.pri{color:var(--pri)}
.split{display:grid;grid-template-columns:1fr 340px;gap:16px;align-items:start}
@media(max-width:1250px){.split{grid-template-columns:1fr}}
.sticky{position:sticky;top:0}
.tag-list{display:flex;gap:7px;flex-wrap:wrap}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:16px}
.tabs button{padding:9px 15px;border:none;background:transparent;cursor:pointer;font-size:13.5px;font-weight:600;
  color:var(--ink-3);border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs button.on{color:var(--pri);border-bottom-color:var(--pri)}
.tabs button:hover{color:var(--ink)}

/* ---------- 工单列表：客户标签页 + 状态 chips + 进度条 ---------- */
.cust-tabs{display:flex;gap:6px;flex-wrap:wrap;padding-bottom:10px;border-bottom:1px solid #e2e8f0;margin-bottom:10px}
.ctab{display:inline-flex;align-items:center;gap:6px;border:1px solid #e2e8f0;background:#fff;color:#334155;
  border-radius:8px;padding:6px 13px;font-size:13.5px;cursor:pointer;transition:all .14s;white-space:nowrap}
.ctab:hover{background:#f8fafc;border-color:#cbd5e1}
.ctab.on{background:#2563eb;border-color:#2563eb;color:#fff;font-weight:600;box-shadow:0 2px 8px rgba(37,99,235,.25)}
.ctab span{font-size:11.5px;background:#f1f5f9;color:#64748b;border-radius:9px;padding:0 7px;line-height:17px}
.ctab.on span{background:rgba(255,255,255,.25);color:#fff}

.st-chips{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.schip{display:inline-flex;align-items:center;gap:6px;border:1px solid #e2e8f0;background:#fff;color:#475569;
  border-radius:20px;padding:5px 14px;font-size:13px;cursor:pointer;transition:all .14s}
.schip:hover{background:#f8fafc}
.schip.on{background:#0f172a;border-color:#0f172a;color:#fff;font-weight:600}
.schip b{font-size:12px;color:#94a3b8;font-weight:700}
.schip.on b{color:#fff}
.chip-search{border:1px solid #e2e8f0;border-radius:8px;padding:6px 12px;font-size:13.5px;width:210px;outline:none}
.chip-search:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.12)}

.bulk-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px 14px;
  background:#fffbeb;border-bottom:1px solid #fde68a}
.bulk-bar:not(.has) .btn:not([data-act="wo-sel-all"]):not([data-act="wo-sel-none"]):not([data-act="wo-bulk-print"]){opacity:.45}
.bulk-bar .bk-cnt{font-size:13.5px;color:#92400e;font-weight:600;margin-right:4px}
.bulk-bar .bk-cnt b{font-size:15px}

.wprog{display:flex;flex-wrap:wrap;gap:4px}
.wp{position:relative;display:inline-flex;align-items:center;gap:4px;border:1px solid #e2e8f0;
  border-radius:6px;padding:2px 7px 2px 6px;font-size:11.5px;background:#fff;overflow:hidden;white-space:nowrap}
.wp i{position:absolute;left:0;top:0;height:100%;background:#e2e8f0;z-index:0;transition:width .3s}
.wp em{position:relative;z-index:1;font-style:normal;font-weight:700;color:#64748b}
.wp u{position:relative;z-index:1;text-decoration:none;color:#334155}
.wp.run i{background:#fde68a}
.wp.run em{color:#a16207}
.wp.ok i{background:#bbf7d0}
.wp.ok em{color:#15803d}
/* ---------- 工单列表第一列：序号 ⇄ 勾选框 ---------- */
.seq-cell{position:relative;text-align:center;padding:6px 4px !important}
.seq-cell .seq-no{display:block;color:#94a3b8;font-size:12.5px;line-height:18px;user-select:none}
.seq-cell .wo-ck{display:none;margin:0 auto;width:15px;height:15px;cursor:pointer}
tbody tr:hover .seq-cell .seq-no{display:none}
tbody tr:hover .seq-cell .wo-ck{display:block}
tbody tr.sel .seq-cell .seq-no{display:none}
tbody tr.sel .seq-cell .wo-ck{display:block}
tbody tr.sel,tbody tr:nth-child(even).sel{background:#e0edff}
tbody tr.sel:hover,tbody tr:nth-child(even).sel:hover{background:#dbeafe}
/* ---------- 图号列：多个图号全部显示，一个一行 ---------- */
.draw-list{display:flex;flex-direction:column;gap:1px;line-height:1.5;font-size:12.5px;white-space:nowrap}
.draw-list span{color:#334155}
td[data-col="draw"],th[data-col="draw"]{min-width:120px}
/* ---------- 工单详情：从列表点进来的那个零件 ---------- */
.card.focus-item{border:2px solid #2563eb;box-shadow:0 4px 16px rgba(37,99,235,.13)}
.card.focus-item .card-head{background:#eff6ff;border-bottom:1px solid #bfdbfe}
.card.focus-item .card-head h3{color:#1d4ed8}
tbody tr.hl-row{background:#fffbeb !important;box-shadow:inset 3px 0 0 #f59e0b}
tbody tr.hl-row td{font-weight:600}
tr[data-item]{transition:background .12s}
tr[data-item]:hover{background:#f8fafc}
/* ---------- 零件详情页 ---------- */
.part-qr{display:inline-block;background:#fff;padding:8px;border:1px solid #e2e8f0;border-radius:10px;line-height:0}
.part-qr svg{width:150px;height:150px;display:block}
.mini-inp{width:100%;max-width:96px;padding:3px 6px;border:1px solid #d7dfea;border-radius:6px;
  font-size:12.5px;text-align:center;font-family:inherit;box-sizing:border-box}
select.mini-inp{max-width:120px;text-align:left}
.mini-inp:focus{border-color:#2563eb;outline:none;box-shadow:0 0 0 2px rgba(37,99,235,.13)}
.ph-box{position:relative;width:96px}
.ph-box img{width:96px;height:96px;object-fit:cover;border-radius:9px;border:1px solid #e2e8f0;cursor:zoom-in;display:block}
.ph-del{position:absolute;top:-6px;right:-6px;width:24px;height:24px;border-radius:50%;border:2px solid #fff;
  background:#dc2626;color:#fff;font-size:15px;line-height:1;cursor:pointer;padding:0}
.ph-del:hover{background:#b91c1c}
.ph-time{font-size:11px;color:#94a3b8;text-align:center;margin-top:3px}
.rep-box{border-bottom:1px solid #f1f5f9;padding:10px 0}
.rep-box:last-child{border-bottom:none}
.rep-qty{display:flex;align-items:center;gap:7px;margin-top:7px;font-size:12.5px;color:#64748b}
.rep-qty .mini-inp{max-width:64px}
/* 看板明细页：图号点一下去零件详情 */
.part-link{display:inline-flex;align-items:center;gap:8px;text-decoration:none;
  padding:3px 10px;margin:-3px -10px;border-radius:9px;transition:background .15s}
.part-link:hover{background:#eff6ff}
.part-link .pl-go{font-size:12px;font-weight:400;color:#2563eb;opacity:.75}
/* ---------- 报工记录：产品 / 图号点进去 = 零件详情（2026-11-03） ---------- */
.part-jump{color:#1d4ed8;font-weight:600;text-decoration:none;cursor:pointer;
  border-bottom:1px dashed rgba(29,78,216,.45)}
.part-jump:hover{color:#1e40af;background:#eff6ff;border-bottom:1px solid #1e40af}
.part-qty{color:#64748b;font-size:11.5px;font-weight:400;margin-left:4px}
.part-lines{display:flex;flex-direction:column;gap:2px;line-height:1.6;font-size:12.5px}
.part-link:hover .pl-go{opacity:1;text-decoration:underline}
/* ---------- 表头：拖动换位置 + 双击改名 ---------- */
thead th[data-col]{position:relative;cursor:grab;-webkit-user-select:none;user-select:none}
thead th[data-col]:active{cursor:grabbing}
thead th[data-col]:hover{background:#f1f5f9}
thead th.col-dragging{opacity:.4}
thead th.col-over{box-shadow:inset 3px 0 0 0 #2563eb;background:#dbeafe}
thead th.col-renamed::after{content:'✎';font-size:9px;color:#94a3b8;margin-left:4px;vertical-align:super}
thead th.col-renaming{padding:2px !important}
.col-rename{width:100%;box-sizing:border-box;border:2px solid #2563eb;border-radius:5px;
  padding:3px 6px;font:inherit;font-size:12.5px;font-weight:600;color:#1e293b;background:#fff;outline:none}
.col-rename::placeholder{color:#cbd5e1;font-weight:400}
/* ---------- 整行可点（点行进下一级详情） ---------- */
tr.row-go{cursor:pointer}
tr.row-go:hover{background:#eff6ff !important}
tr.row-go:hover td{background:transparent}
tr.row-go .row-go-tip{display:none;margin-left:8px;font-size:11.5px;font-weight:400;color:#2563eb}
tr.row-go:hover .row-go-tip{display:inline}
/* ---------- 提醒（侧栏小红点 + 列表） ---------- */
.nav-badge{display:inline-block;min-width:17px;height:17px;line-height:17px;padding:0 5px;
  margin-left:6px;border-radius:9px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;
  text-align:center;vertical-align:middle}
tr.pre-row{background:#fffbeb}
tr.pre-row:hover{background:#fef3c7 !important}
/* ---------- AI 助手：快捷提问 ---------- */
.ai-quick{padding:8px 12px 4px;border-top:1px solid #eef2f7}
.ai-quick-h{font-size:12px;color:#94a3b8;margin-bottom:6px}
.ai-quick-list{display:flex;flex-wrap:wrap;gap:6px}
.ai-quick-list button{background:#f1f5f9;color:#334155;border:1px solid #e2e8f0;border-radius:14px;
  padding:4px 11px;font-size:12.5px;font-family:inherit;cursor:pointer;white-space:nowrap}
.ai-quick-list button:hover{background:#e0e7ff;border-color:#c7d2fe;color:#3730a3}
/* ---------- 公司 Logo ---------- */
/* 登录页/注册页：方形 logo */
.login-logo-img{display:block;width:76px;height:auto;margin:0 auto 10px}
/* 侧边栏：小方形 logo */
.brand-mark-img{width:22px;height:22px;object-fit:contain;flex:0 0 22px}
.brand{gap:9px}

/* ================================================================
 * 侧边栏「客户订单」折叠菜单
 *   点父项展开/收起，点客户名进那家的订单表
 * ================================================================ */
#nav a .nav-caret{margin-left:auto;font-size:11px;opacity:.6;transition:transform .15s}
#nav a.open .nav-caret{transform:rotate(90deg)}
.nav-sub{display:flex;flex-direction:column;gap:1px;padding:2px 0 4px 0}
.nav-sub[hidden]{display:none}
.nav-sub a{display:block;padding:6px 12px 6px 40px !important;border-radius:var(--r-sm);
  font-size:13px;color:#94a3b8 !important;background:none !important;box-shadow:none !important}
.nav-sub a::before{content:none !important}
.nav-sub a:hover{background:#1e293b !important;color:#f1f5f9 !important}
.nav-sub a.on{background:#1e293b !important;color:#fff !important;font-weight:600}
.nav-sub .ns-all{color:#cbd5e1 !important;font-weight:600}
.nav-sub .ns-empty{padding:6px 12px 6px 40px;font-size:12.5px;color:#64748b}

/* ================================================================
 * 客户订单：客户卡片墙
 * ================================================================ */
.cust-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.cust-card{display:block;background:#fff;border:1px solid var(--line);border-radius:var(--r);
  padding:14px 16px;text-decoration:none;color:inherit;transition:box-shadow .15s,border-color .15s}
.cust-card:hover{border-color:var(--pri);box-shadow:0 4px 14px rgba(37,99,235,.12)}
.cc-name{font-size:15px;font-weight:700;color:var(--ink);margin-bottom:10px}
.cc-nums{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:#64748b}
.cc-nums b{color:var(--pri);font-size:14px;margin-right:2px}
.cc-foot{margin-top:10px;font-size:12px;color:#94a3b8;border-top:1px dashed var(--line);padding-top:8px}

/* ================================================================
 * 客户订单菜单：底部「管理」入口 + 管理弹窗
 * ================================================================ */
.nav-sub .ns-mgr{margin-top:4px;border-top:1px dashed #334155;padding-top:7px !important;
  font-size:12px !important;color:#64748b !important}
.nav-sub .ns-mgr:hover{color:#93c5fd !important}
.cm-list{max-height:52vh;overflow:auto;border:1px solid var(--line);border-radius:var(--r-sm)}
.cm-item{display:flex;align-items:center;gap:10px;padding:8px 12px;cursor:pointer;border-bottom:1px solid #f1f5f9}
.cm-item:last-child{border-bottom:none}
.cm-item:hover{background:#f8fafc}
.cm-item input{width:16px;height:16px;flex:none}
.cm-sn{font-weight:600;min-width:76px}
.cm-full{font-size:12px;color:#94a3b8}

/* ================================================================
 * 列设置：自定义插入的列
 * ================================================================ */
.col-row-custom{background:#fefce8;border-left:3px solid #eab308}
.col-row-custom .col-chk{font-weight:600}
th.col-custom{background:#fef9c3 !important;color:#854d0e}
td.col-custom{background:#fffef5}

/* 客户菜单管理：每行右边的 ↑↓ */
.cm-item .cm-mv{margin-left:auto;display:flex;gap:4px}
.cm-item .cm-full{flex:1}

/* ================================================================
 * ★ 表格滚动时表头固定（客户 2026-10-08：「页面向下滚动表头要固定」）
 *
 *   坑：.tbl-wrap 有 overflow-x:auto —— 它自己就是滚动容器，
 *       外面再滚也带不动里面的 sticky 表头 ✗
 *   解法：让 .tbl-wrap 变成**纵向滚动容器**（高度由 JS 量好设 maxHeight），
 *       表头 sticky 到它的顶部 ✓ —— 行在表内滚，表头不动 ✓
 * ================================================================ */
.tbl-wrap{overflow:auto}
.tbl-wrap table thead th{position:sticky;top:0;z-index:6}
/* sticky 的表头必须有不透明底色，不然行会从下面透出来 */
.tbl-wrap table thead th{background:#dbeafe}
/* 表头下面那条蓝线在滚动时也要跟着（用 box-shadow 模拟，border 会跟着掉） */
.tbl-wrap table thead th{box-shadow:inset 0 -1px 0 #93c5fd}

/* ================================================================
 * AI 助手：主动建议的按钮
 * ================================================================ */
.ai-sug{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.ai-sug-btn{display:block;width:100%;text-align:left;background:#fff;border:1px solid #bfdbfe;
  border-radius:8px;padding:8px 11px;cursor:pointer;font:inherit;transition:.12s}
.ai-sug-btn:hover{background:#eff6ff;border-color:#60a5fa;transform:translateX(2px)}
.ai-sug-btn b{display:block;font-size:13px;color:#1e3a8a;font-weight:600}
.ai-sug-btn i{display:block;font-size:11.5px;color:#64748b;font-style:normal;margin-top:2px}

/* PDF 小标签（AI 面板） */
.ai-pdf-list{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px}
.ai-pdf-list:empty{display:none}
.ai-pdf-chip{display:inline-flex;align-items:center;gap:6px;background:#eff6ff;border:1px solid #bfdbfe;
  border-radius:7px;padding:4px 9px;font-size:12px;color:#1e3a8a;max-width:100%}
.ai-pdf-chip b{cursor:pointer;color:#94a3b8;font-weight:400}
.ai-pdf-chip b:hover{color:#dc2626}

/* 零件详情弹窗 */
.pd-head{border-bottom:1px solid #eef2f7;padding-bottom:10px}
.pd-title{font-size:17px;font-weight:650;color:#0f172a}
.pd-sub{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:5px;font-size:12.5px;color:#64748b}
.pd-kv{background:#f8fafc;border:1px solid #eef2f7;border-radius:8px;padding:8px 11px}
.pd-kv label{display:block;font-size:11.5px;color:#94a3b8;margin-bottom:2px}
.pd-kv b{font-size:15px}
.pd-sec{margin-top:14px;border-top:1px dashed #e2e8f0;padding-top:12px}
.pd-sec > b{font-size:13.5px;color:#334155;display:block;margin-bottom:8px}
.pd-proc{display:flex;align-items:center;gap:10px;padding:5px 0}
.pd-proc .pd-name{width:80px;font-size:13px;color:#334155}
.pd-proc .pd-bar{flex:1;height:8px;background:#e2e8f0;border-radius:5px;overflow:hidden}
.pd-proc .pd-bar i{display:block;height:100%;background:linear-gradient(90deg,#60a5fa,#2563eb);border-radius:5px}
.pd-proc .pd-num{width:110px;text-align:right;font-size:12.5px;color:#64748b}
.pd-proc .pd-num b{color:#1e3a8a}

/* ---------- 表头点击排序（2026-10-20） ----------
   点一次升序 ▲ / 再点降序 ▼ / 第三下回默认。
   箭头用 ::after 画（不是文字），列设置里改列名不会把箭头弄没。
   高亮用底色 + 深蓝字，跟表头原本的浅蓝底一套。 */
th[data-col].sortable{cursor:pointer}
th[data-col].sortable:hover{background:#cfe1fd}
th[data-col].sort-asc,th[data-col].sort-desc{background:#93c5fd;color:#0b2a6b;box-shadow:inset 0 -3px 0 #1d4ed8}
th[data-col].sort-asc::after,th[data-col].sort-desc::after{
  display:inline-block;margin-left:5px;font-size:10px;line-height:1;vertical-align:1px;opacity:.95}

/* ================================================================
 * 报工记录：工序 × 日期 汇总表（2026-11-01 老板要求）
 *   行 = 工序，列 = 日期，格子 = 合格件数（0 留空），不良在格子下面红字
 *   第一列「工序」横向滚动时钉住，滚多远都知道看的是哪一行
 * ================================================================ */
.sum-wrap{overflow:auto}
.sum-tbl{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
.sum-tbl th,.sum-tbl td{padding:6px 7px;text-align:right;white-space:nowrap;
  border-bottom:1px solid rgba(15,23,42,.09);border-left:1px solid rgba(15,23,42,.07)}
.sum-tbl thead th{background:#dbeafe;color:#1e3a8a;font-size:12.5px;font-weight:650;
  text-align:center;box-shadow:inset 0 -1px 0 #93c5fd;position:sticky;top:0;z-index:3}
.sum-tbl tbody th{text-align:left;background:#f8fafc;font-weight:650;white-space:nowrap}
.sum-k{position:sticky;left:0;z-index:2;background:#f8fafc !important;text-align:left;min-width:84px;color:#1e3a8a}
.sum-tbl thead .sum-k{z-index:5;background:#dbeafe !important}
.sum-c{min-width:42px;font-variant-numeric:tabular-nums;font-weight:600;color:#0f172a}
.sum-c.sum-on{cursor:pointer;background:#f3f8ff}
.sum-c.sum-on:hover{background:#e0efff;box-shadow:inset 0 0 0 2px #93c5fd}
.sum-c.sum-sel{background:#dbeafe !important;box-shadow:inset 0 0 0 2px #2563eb}
.sum-ng{display:block;font-size:11px;line-height:1.35;font-weight:600;color:#dc2626}
/* 「合计」列钉在右边：31 列的日子横着滚，合计也一直看得见 */
.sum-tot{position:sticky;right:0;z-index:2;background:#f1f5f9 !important;font-weight:700;color:#1e3a8a;text-align:right}
.sum-tbl thead .sum-tot{z-index:5;background:#dbeafe !important;box-shadow:inset 0 -1px 0 #93c5fd}
.sum-tbl tr.sum-day th,.sum-tbl tr.sum-day td{background:#eff6ff}
.sum-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;vertical-align:0}

/* ================================================================
 * 报工明细：按工序分组（组标题行可点折叠）
 * ================================================================ */
tr.rpt-grp td{background:#f8fafc;padding:8px 12px;font-size:13px;cursor:pointer;user-select:none;
  border-top:1px solid #dbeafe}
tr.rpt-grp:hover td{background:#eef4fb}
tr.rpt-grp .grp-caret{display:inline-block;width:15px;color:#64748b;font-size:11px}
tr.rpt-grp .grp-meta{margin-left:10px;font-size:12.5px;font-weight:400;color:#64748b}
th[data-col].sort-asc::after{content:'▲'}
th[data-col].sort-desc::after{content:'▼'}

/* ================================================================
 * 计件单价库 → 查看图纸（2026-11-04）
 * ================================================================ */
.rdv-btn{margin-left:5px;padding:1px 7px;font-size:11.5px;vertical-align:1px}
.rdv-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:10px}
.rdv-name{font-size:16px;font-weight:700;line-height:1.5;color:var(--ink)}
.rdv-sub{font-size:12.5px;color:var(--ink-3);margin-top:2px}
.rdv-pick{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ink-3);flex-wrap:nowrap;flex:1 1 auto;justify-content:flex-end;min-width:0}
.rdv-pick select{height:30px;max-width:320px;min-width:0;flex:1 1 auto;border:1px solid var(--line);border-radius:var(--r-sm);padding:0 8px;background:#fff;font-size:12.5px}
.rdv-pick .btn{flex:0 0 auto}
/* 一张单有好几个图号 → 标题下面的「图号」下拉（2026-11-04，工单管理那几个页面用） */
.rdv-codebar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:9px;padding:6px 10px;background:#f1f5f9;border:1px solid var(--line);border-radius:8px;font-size:12.5px;color:var(--ink-2)}
.rdv-codebar label{flex:0 0 auto;font-weight:650;color:var(--ink-2)}
.rdv-codebar select{height:30px;min-width:220px;max-width:520px;flex:0 1 auto;border:1px solid var(--line);border-radius:var(--r-sm);padding:0 8px;background:#fff;font-size:12.5px;font-weight:600}
.rdv-codebar-t{font-size:11.5px;color:var(--ink-4)}
.rdv-stage{height:min(68vh,720px);min-height:320px;background:#eef2f7;border:1px solid var(--line);border-radius:9px;overflow:auto;position:relative}
.rdv-stage.dragging{cursor:grabbing}
.rdv-frame{display:block;width:100%;height:100%;border:0;background:#fff}
.rdv-imgwrap{display:flex;align-items:flex-start;justify-content:flex-start;min-width:100%;min-height:100%;padding:10px}
.rdv-img{display:block;flex:0 0 auto;width:100%;max-width:none;height:auto;margin:0 auto;background:#fff;box-shadow:0 2px 12px rgba(15,23,42,.14);user-select:none;cursor:grab}
.rdv-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:8px;min-height:28px}
.rdv-tip{font-size:12px;color:var(--ink-3);line-height:1.7}
.rdv-zoom{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--ink-2)}
.rdv-zoom b{min-width:42px;text-align:center;font-variant-numeric:tabular-nums}
.rdv-src{font-size:12px;color:var(--ink-4);max-width:560px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}
.rdv-cad{margin-top:10px;border:1px dashed var(--line-2);border-radius:8px;padding:9px 11px;background:#f8fafc}
.rdv-cad-t{font-size:12px;color:var(--ink-3);margin-bottom:4px}
.rdv-cad-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12.5px;padding:2px 0}
.rdv-cad-type{font-size:11px;color:var(--ink-4)}
.rdv-none{text-align:center;padding:24px 10px 6px}
.rdv-none-ico{font-size:44px;line-height:1}
.rdv-none-t{font-size:18px;font-weight:700;margin:10px 0 4px;color:var(--ink)}
.rdv-none-s{font-size:13px;color:var(--ink-3)}

/* ================================================================
 * 报工记录页：上方压缩（2026-11-07 老板：「这个上面部分太占地方了，能不能改小一点窄一点」）
 *   追问选 B：尽量窄 —— 统计卡压成一行小字，省 50%+ 高度，明细多显示几行
 *   改的三段（全部只挂这一页的 .rpt-top / #r-sum-card / .filters-tight，别的页面一律不碰）：
 *     ① 筛选条：控件 39px → 32px，「标签 + 控件」同一行（原来标签占一整行），卡片内边距 16 → 7
 *     ② 4 张统计卡（每张 ~96px）→ 汇总表标题右边一行 12.5px 小字（颜色沿用原来的蓝/绿/红/橙）
 *     ③ 汇总表：行高 33px → 18px，字号 13 → 12.5，表头 12.5 → 11.5
 * ================================================================ */
/* ---- ① 筛选条 ---- */
.rpt-top{margin-bottom:7px}
.rpt-top .card-body{padding:6px 12px}
.filters.filters-tight{gap:7px 10px;align-items:flex-end}
.filters.filters-tight .field{display:flex;align-items:center;gap:6px;margin-bottom:0;min-width:0}
.filters.filters-tight .field>label{margin-bottom:0;font-size:12px;font-weight:650;color:var(--ink-3);
  white-space:nowrap;flex:0 0 auto}
.filters.filters-tight .field>input,.filters.filters-tight .field>select{height:32px;padding:3px 9px;
  font-size:13px;line-height:1.2;border-radius:6px}
.filters.filters-tight .field.grow{flex:1 1 240px;min-width:170px}
.filters.filters-tight .field>input[type=date]{width:126px;flex:0 0 auto;padding:3px 5px}
.filters.filters-tight .btn{height:32px;padding:0 13px;font-size:13px}
/* ---- ② 统计：一行小字（替掉 4 张卡） ---- */
.rpt-stats{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 9px;font-size:12.5px;
  color:var(--ink-3);font-weight:600;line-height:1.35}
.rpt-stats .rs{display:inline-flex;align-items:baseline;gap:3px;white-space:nowrap}
.rpt-stats .rs + .rs::before{content:'·';margin-right:6px;color:#cbd5e1;font-weight:700}
.rpt-stats .rs b{font-size:13px;font-weight:750;font-variant-numeric:tabular-nums}
.rpt-stats .rs i{font-style:normal;font-size:11px;color:var(--ink-4);font-weight:600}
.rpt-stats .rs-n b{color:var(--pri)}
.rpt-stats .rs-ok b{color:var(--ok)}
.rpt-stats .rs-ng b{color:var(--danger)}
.rpt-stats .rs-rate b{color:var(--warn)}
/* ---- ③ 汇总表 + 汇总卡标题（统计小字就放在这个标题的右边） ---- */
#r-sum-card{margin-bottom:7px}
#r-sum-card .card-head{padding:3px 12px;gap:8px}
#r-sum-card .card-head h3{font-size:13.5px;line-height:1.35}
#r-sum-card .card-head .sub{font-size:11.5px;margin-left:7px}
#r-sum-card .print-bar{gap:8px}
#r-sum-card .sum-wrap::-webkit-scrollbar{height:8px}
#r-sum-card .sum-wrap::-webkit-scrollbar-thumb{border-width:1px}
#r-sum-card .sum-tbl th,#r-sum-card .sum-tbl td{padding:2px 6px;font-size:12.5px;line-height:1.15}
#r-sum-card .sum-tbl thead th{padding:1px 6px;font-size:11.5px;line-height:1.25}
#r-sum-card .sum-k{padding-left:9px}
#r-sum-card .sum-ng{font-size:10.5px;line-height:1.15}
#r-sum-card .sum-dot{width:7px;height:7px;margin-right:5px}
/* 窄屏（老板也会用手机看）：统计小字允许折行，行首不要留「·」，免得一列点 */
@media(max-width:900px){
  #r-sum-card .card-head{align-items:flex-start}
  .rpt-stats{font-size:12px;gap:1px 14px}
  .rpt-stats .rs + .rs::before{content:'';margin:0}
}

/* ================================================================
 * 报工记录明细表：行高压矮（2026-11-08 老板：「明细表行高压矮」）
 *   改前：合作报工 164px/行（报工人列 64px，姓名 + 合作那行挤成 6 行），
 *         普通行 76.6px（工单号列 73px，WO-261023-001 被断成 3 行），一屏只看得见 3~4 行
 *   根因：15 列平分宽度 → 字多的列太窄；文字一折行，整行跟着长高
 *   改法（只挂 #r-table，别的页面一律不碰）：
 *     ① 列宽重新分配（15 列、顺序不变）：工单号/报工人/产品/图号加宽，其余按内容收窄
 *     ② 所有格子单行：white-space:nowrap + overflow:hidden + text-overflow:ellipsis
 *        被「…」截掉的文字挂在 td 的 title 上，鼠标悬停看全文（dispatch.js 渲染时写的）
 *     ③ 合作报工压成一行：姓名（黑粗）+「· 与搭档 60%」（紫色小字）；比例没丢，完整明细在 title 里
 *     ④ 行高：padding 4px 8px / line-height 1.35 / 字号 13px；表头 10px 12px → 5px 8px、13px → 12.5px
 *   列数还是 15：列设置 / 拖动换位 / 双击改名 / 拖边缘改宽 全部照旧（都靠 th[data-col]）
 * ================================================================ */
#r-table{font-size:13px;table-layout:fixed;width:100%;min-width:1242px}
#r-table th,#r-table td{padding:4px 8px;line-height:1.35;vertical-align:middle}
#r-table th{font-size:12.5px;padding:5px 8px;white-space:nowrap}
#r-table tbody td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#r-table td.mono{font-size:12px}
/* ---- 列宽（15 列：时间 / 工单号 / 客户 / 机台号 / 产品 / 图号 / 工序 / 类型 / 合格 / 刀数 / 不良 / 不良原因 / 报工人 / 照片 / IP） ---- */
#r-table th[data-col="time"]{width:110px}   /* 11-07 18:12:13 = 14 字符，单行刚好 */
#r-table th[data-col="code"]{width:110px}   /* WO-261023-001 = 13 字符，不再断成 3 行 */
#r-table th[data-col="cust"]{width:56px}    /* 台一 / 德昌誉（简称，全称在 title） */
#r-table th[data-col="mach"]{width:54px}    /* 机台号（现在多数为空，只留表头宽） */
#r-table th[data-col="prod"]{width:128px}   /* 产品名最长 27 字 → 截断，title 看全 */
#r-table th[data-col="draw"]{width:172px}   /* 图号最长 19 字符 + ×数量，整行显示不截断 */
#r-table th[data-col="proc"]{width:50px}
#r-table th[data-col="type"]{width:60px}
#r-table th[data-col="ok"]{width:56px}
#r-table th[data-col="bend"]{width:50px}
#r-table th[data-col="ng"]{width:46px}
#r-table th[data-col="ngr"]{width:66px}     /* 不良原因（现在都空，但列和位置不许丢） */
#r-table th[data-col="who"]{width:152px}    /* 姓名 + 「· 与搭档 61.5%」要在同一行放下 */
#r-table th[data-col="photo"]{width:52px}
#r-table th[data-col="ip"]{width:80px}      /* IPv4/IPv6 都截断，title 看全 */
/* 列设置插进来的自定义列：固定布局里给个宽度，别被挤成 0 */
#r-table th[data-custom],#r-table td[data-custom]{width:110px}
/* ---- 合作报工：一行显示，主次用颜色分（姓名黑粗 / 合作信息紫小） ---- */
#r-table td[data-col="who"]{font-weight:600;color:#0f172a}
#r-table .coop-inline{margin-left:5px;font-size:11.5px;font-weight:500;color:#7c3aed}
/* ---- 一个报工带多个图号/产品：还是一行一个（不折叠、不截断，这类行允许比别人高） ---- */
#r-table .part-lines,#r-table .draw-list{display:block;line-height:1.3;font-size:12px;white-space:nowrap}
#r-table .part-lines>span,#r-table .draw-list>span{display:block}
#r-table .part-qty{font-size:11px;margin-left:3px}

/* ================================================================
 * 工单管理 + 客户订单：列表压扁（2026-11-08 老板）
 *   老板原话：「都要把列高尽量减少，下面显示的内容太少了。按今天改的报工页面一样改。」
 *              客户订单「这里也是 一起改」
 *
 *   改前（1440×900 实测）：
 *     工单管理  行高 126px，顶部筛选卡 326px，一屏只看得见 2 行
 *     客户订单  行高 126~228px（备注 3 行 + 4 个进度小标签竖着排），一屏 4 行
 *   根因：15~17 列平分宽度 → 工单编号/图号/状态 一折行，整行跟着长高；
 *         每格里面还有一行小字（源自订单 / 本单 N 项 / 在做：X），把行撑成 2~6 行
 *
 *   改法（照「报工记录」#r-table 那套，只挂 .wocut / #wo-table / .socut / #so-table，
 *         别的页面一律不碰；类名全部带 cut 前缀，跟老样式隔开）：
 *     ① 列宽按内容重分配（一列没删、顺序没动，还是靠 th[data-col]）
 *     ② 所有格子单行：white-space:nowrap + overflow:hidden + text-overflow:ellipsis
 *        被「…」截掉的文字 → core.js cutTitles() 挂在 td 的 title 上，鼠标悬停看全文
 *     ③ 格子里那行小字改成同一行的小号灰字（wo-sub / wo-cur），不再单独占一行
 *     ④ 工单进度 4 个小标签不换行（flex-wrap:nowrap）+ 缩小到 10px，一行排开
 *     ⑤ 顶部三块压薄：客户标签/状态 chips/搜索框/派工日期行全部 12px + 小内边距
 * ================================================================ */

/* ---------------- ① 工单管理：顶部三块 ---------------- */
.wocut > .card{margin-bottom:8px}
.wocut .card-body:not(.p0){padding:6px 10px}
.wocut .cust-tabs{gap:3px 4px;padding-bottom:5px;margin-bottom:5px}
.wocut .ctab{padding:2px 7px;font-size:12px;border-radius:6px;gap:5px;line-height:1.5}
.wocut .ctab span{font-size:10.5px;padding:0 5px;line-height:15px;border-radius:8px}
.wocut .st-chips{gap:4px}
.wocut .schip{padding:2px 7px;font-size:12px;line-height:1.5;border-radius:12px;gap:4px}
.wocut .schip b{font-size:10.5px}
.wocut #f-q{width:250px;height:26px;padding:2px 9px;font-size:12.5px;border-radius:6px}
.wocut .wocut-st .btn{height:26px;padding:0 11px;font-size:12.5px;border-radius:6px}
.wocut .wo-datebar{margin-top:5px;padding-top:5px;border-top:1px dashed #e2e8f0}
.wocut .wo-datebar .dlabel{font-size:12px;font-weight:650;color:#0f172a;margin-right:2px}
.wocut .wo-datebar #f-dispatch-from,.wocut .wo-datebar #f-dispatch-to{width:124px;height:26px;
  flex:0 0 auto;padding:1px 5px;font-size:12px;border-radius:6px;border:1px solid #e2e8f0;
  color:#334155;background:#fff;outline:none}
.wocut .wo-datebar .btn{height:26px;padding:0 9px;font-size:12px;border-radius:6px}
.wocut .wo-datebar .dbar-hint{font-size:11.5px;color:#94a3b8}
/* 选中的「派工日期」快捷按钮：原来写在 style 里的蓝底，挪到这里（模板里不再写内联样式） */
.wocut .wo-datebar .schip.on{background:#2563eb;border-color:#2563eb;color:#fff;
  font-weight:600;box-shadow:0 2px 8px rgba(37,99,235,.25)}
/* 卡片标题行 + 批量操作条也跟着压（不压这两条，表头还是被顶到屏幕中间） */
.wocut .card-head{padding:5px 12px;gap:8px}
.wocut .card-head h3{font-size:13.5px;line-height:1.4}
.wocut .card-head .sub{font-size:11.5px;margin-left:6px}
.wocut .card-head .btn-sm{padding:3px 9px;font-size:12px}
.wocut .bulk-bar{padding:3px 10px;gap:6px}
.wocut .bulk-bar .bk-cnt{font-size:12px}
.wocut .bulk-bar .bk-cnt b{font-size:13px}
.wocut .bulk-bar .btn-xs{padding:1px 6px;font-size:11px}

/* ================================================================
 * 新建喷涂单（按厂拆分）页：顶部压缩（2026-11-09 老板：「上面太占空间，最上面的字不要了」+「其他内容改小」）
 *   ① 顶部那段 3 行说明整块删掉（HTML 删的，见 web/js/outsource.js）—— 小件 0.5 元/件、✂ 拆分
 *      这些规则本来就已经在行内徽章 / 按钮上，不用顶上再解释一遍
 *   ② 默认喷涂厂 / 外协工序 / 发出日期 / 预计回厂 / 运费 / 税率 / 备注 这一块压矮：
 *      控件 39 → 32px、卡片内边距 16 → 6px、标签字号 13 → 12px（跟报工记录 .rpt-top 同一套写法）
 *   ③ 只挂这一页的 .oo-top —— 下面的「待外发明细」表格（已经压过的）和别的页面一律不碰
 * ================================================================ */
.oo-top{margin-bottom:8px}
.oo-top .card-body{padding:6px 10px}
.oo-top .grid{gap:8px 10px}
.oo-top .field{margin-bottom:0}
.oo-top .field>label{font-size:12px;line-height:1.35;margin-bottom:3px}
.oo-top .field .hint{font-size:11px;margin-left:4px}
.oo-top .field input,.oo-top .field select{height:32px;padding:2px 9px;font-size:13px;line-height:1.2;border-radius:6px}
.oo-top .btn{height:32px;padding:0 10px;font-size:12.5px;border-radius:6px}

/* ---------------- ② 工单列表 #wo-table（17 列，顺序不变） ---------------- */
#wo-table{table-layout:fixed;width:100%;min-width:1380px;font-size:12.5px}
#wo-table th,#wo-table td{padding:4px 6px;line-height:1.3;vertical-align:middle}
#wo-table th{font-size:12px;padding:4px 6px;white-space:nowrap}
#wo-table tbody td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#wo-table td.mono{font-size:11.5px}
#wo-table .tag{padding:0 6px;font-size:11px;line-height:1.65;border-radius:9px}
#wo-table .btn-xs{padding:1px 6px;font-size:11px;border-radius:4px}
#wo-table td[data-col="ops"] .btn{padding:1px 4px}
#wo-table td[data-col="drw"] .btn{padding:1px 3px;font-size:10.5px}
#wo-table td[data-col="due"] .days{font-size:10px;margin-left:2px;font-weight:700}
#wo-table td .wo-sub{font-size:10.5px;color:#94a3b8;font-weight:400;margin-left:4px}
#wo-table td .wo-cur{font-size:10.5px;color:#2563eb;margin-left:5px}
#wo-table td[data-col="mark"] input{width:100%;height:21px;min-width:0;padding:0 3px;font-size:11px;
  text-align:center;text-transform:uppercase;border-radius:4px;box-sizing:border-box}
/* 工单进度：4 个小标签一行排开（改前是 flex-wrap:wrap，一窄就竖着堆成 4 行） */
#wo-table .wprog{display:flex;flex-wrap:nowrap;gap:1px;overflow:hidden}
#wo-table .wp{padding:0 2px;font-size:10px;line-height:1.75;gap:2px;border-radius:4px;flex:0 0 auto}
/* 列宽（17 列：勾选 / 工单编号 / 计划结束 / 派工日期 / 图号 / 折弯刀数 / 打标 / 产品名称 /
   优先级 / 状态 / 计划数 / 客户 / 机台号 / 图片 / 图纸 / 工单进度 / 操作） */
#wo-table th[data-col="ck"]{width:36px}
#wo-table th[data-col="code"]{width:118px}
#wo-table th[data-col="due"]{width:126px}
#wo-table th[data-col="dispatch"]{width:86px}
#wo-table th[data-col="draw"]{width:126px}
#wo-table th[data-col="bend"]{width:50px}
#wo-table th[data-col="mark"]{width:46px}
#wo-table th[data-col="prod"]{width:132px}
#wo-table th[data-col="pri"]{width:50px}
#wo-table th[data-col="status"]{width:84px}
#wo-table th[data-col="qty"]{width:44px}
#wo-table th[data-col="cust"]{width:56px}
#wo-table th[data-col="mach"]{width:46px}
#wo-table th[data-col="pic"]{width:34px}
#wo-table th[data-col="drw"]{width:62px}
#wo-table th[data-col="prog"]{width:204px}
#wo-table th[data-col="ops"]{width:80px}
/* 列设置里勾出来的可选列（默认藏）：给个合理宽度，别挤成一条缝 */
#wo-table th[data-col="order"]{width:120px}
#wo-table th[data-col="created"]{width:84px}
#wo-table th[data-col="by"]{width:64px}
#wo-table th[data-col="route"]{width:96px}
#wo-table th[data-col="total"]{width:56px}
#wo-table th[data-col="mat"]{width:56px}
#wo-table th[data-col="thk"]{width:48px}
#wo-table th[data-col="area"]{width:60px}
#wo-table th[data-col="color"]{width:72px}
#wo-table th[data-col="iremark"]{width:130px}
#wo-table th[data-col="wremark"]{width:130px}
/* 列设置插进来的自定义列：固定布局里给个宽度，别被挤成 0 */
#wo-table th[data-custom],#wo-table td[data-custom]{width:110px}

/* ---------------- ③ 客户订单：顶部那一条 + 搜索条 ---------------- */
.socut > .card{margin-bottom:8px}
.socut .so-top .card-body{padding:6px 12px}
.socut .so-top-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.socut .so-cust{font-size:14px}
.socut .so-top .tag{padding:0 8px;font-size:11.5px;line-height:1.75}
.socut .so-top .btn-sm{padding:3px 9px;font-size:12px}
.socut .card-head{padding:5px 12px;gap:8px}
.socut .card-head h3{font-size:13.5px;line-height:1.4}
.socut .card-head .sub{font-size:11.5px;margin-left:6px}
.socut .card-head .btn-sm{padding:3px 9px;font-size:12px}
.socut .so-find{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:5px 12px;
  background:#f8fafc;border-bottom:1px solid var(--line)}
.socut .so-find-ico{font-size:12px;color:#64748b}
.socut .so-find-cnt{font-size:12px;color:#64748b}
.socut .so-find-none{font-size:12px;color:#dc2626}
.socut #so-find{width:320px;height:26px;padding:2px 9px;font-size:12.5px;border-radius:6px}
.socut .so-find .btn-sm{padding:3px 9px;font-size:12px}

/* ---------------- ④ 客户订单列表 #so-table（14 列，顺序不变） ---------------- */
#so-table{table-layout:fixed;width:100%;min-width:1324px;font-size:12.5px}
#so-table th,#so-table td{padding:4px 6px;line-height:1.3;vertical-align:middle}
#so-table th{font-size:12px;padding:4px 6px;white-space:nowrap}
#so-table tbody td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#so-table td.mono{font-size:11.5px}
#so-table .tag{padding:0 6px;font-size:11px;line-height:1.65;border-radius:9px}
#so-table .btn-xs{padding:1px 6px;font-size:11px;border-radius:4px}
#so-table td[data-col="ops"] .btn{padding:1px 5px}
#so-table td[data-col="ops"]{white-space:nowrap}
/* 工单进度：4 个小标签一行排开（改前是竖着堆 4 行，行高就是这么起来的） */
#so-table .wprog{display:flex;flex-wrap:nowrap;gap:1px;overflow:hidden}
#so-table .wp{padding:0 2px;font-size:10px;line-height:1.75;gap:2px;border-radius:4px;flex:0 0 auto}
/* 列宽（14 列：序号 / 合同号 / 内部单号 / 下单日期 / 交货日期 / 明细行数 / 订单数量 /
   合同金额 / 已派工 / 工单进度 / 状态 / 已发货 / 备注 / 操作） */
#so-table th[data-col="seq"]{width:38px}
#so-table th[data-col="contract"]{width:108px}
#so-table th[data-col="code"]{width:104px}
#so-table th[data-col="odate"]{width:84px}
#so-table th[data-col="ddate"]{width:84px}
#so-table th[data-col="items"]{width:52px}
#so-table th[data-col="qty"]{width:52px}
#so-table th[data-col="amount"]{width:74px}
#so-table th[data-col="disp"]{width:56px}
#so-table th[data-col="prog"]{width:204px}
#so-table th[data-col="status"]{width:68px}
#so-table th[data-col="ship"]{width:68px}
#so-table th[data-col="remark"]{width:200px}
#so-table th[data-col="ops"]{width:130px}
#so-table th[data-custom],#so-table td[data-custom]{width:110px}

/* ---------------- ⑤ 窄屏（手机 390 也要看）：顶部长名字允许折行，别把页面撑出横向滚动 ----
   表格照旧在 .tbl-wrap 里自己横滚（overflow-x:auto），页面本身不许横向溢出 */
@media(max-width:900px){
  /* 客户标签：一行横着滑（不要再让每个长名字折成 4 行，那样顶部比表格还高） */
  .wocut .cust-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding-bottom:6px}
  .wocut .ctab{white-space:nowrap;max-width:none;flex:0 0 auto}
  .socut .ctab{white-space:normal;word-break:break-word;max-width:100%}
  .wocut #f-q{width:100%;min-width:0}
  .wocut .card-head,.socut .card-head{flex-wrap:wrap}
  .wocut .wo-datebar .dlabel{margin-right:0}
  .socut .so-top-row{gap:8px}
  .socut #so-find{width:100%}
}

/* ============ 喷涂面积汇总页（spray_ledger 总表）============ */
.sl-kpi{display:flex;gap:20px;flex-wrap:wrap;align-items:flex-end;padding:10px 2px 2px;border-top:1px solid var(--line);margin-top:10px}
.sl-kpi-item{display:flex;flex-direction:column;line-height:1.25}
.sl-kpi-item b{font-size:19px;font-variant-numeric:tabular-nums;color:var(--ink)}
.sl-kpi-item i{font-style:normal;font-size:11.5px;color:var(--ink-4);white-space:nowrap}
.sl-kpi-item.hl b{color:#b45309}
.sl-kpi-item.dim b{font-size:15px;color:var(--ink-3)}
.sl-tbl{font-size:12.5px}
.sl-tbl tbody tr:hover{background:#f8fafc}
.sl-tbl tfoot td{background:#f8fafc;border-top:1px solid var(--line)}
.sl-tbl td.b,.sl-tbl th.b{font-weight:700;color:#0f172a}
.sl-sum-row{cursor:pointer}
.sl-wrow{background:#fffbeb}
.sl-note{padding:8px 16px 12px;font-size:11.5px;color:var(--ink-4);line-height:1.65}
.dim{color:var(--ink-4)}

/* ============ 喷涂厂月度对账单（spray_recon）============ */
.rc-tbl tbody tr.rc-doc{cursor:pointer}
.rc-tbl tbody tr.rc-doc:hover{background:#f0f7ff}
.rc-tbl tbody tr.rc-doc.rc-open{background:#eff6ff}
.rc-tbl tbody tr.rc-doc.rc-open .rc-caret{color:var(--pri)}
/* 合计行钉在表格底部：单子多的时候滚到哪都能看见合计（对账要看这个数） */
.rc-tbl tfoot td{position:sticky;bottom:0;z-index:5;background:#eef2f7;border-top:1px solid var(--line);box-shadow:0 -1px 0 #dbe3ee}
.rc-tbl tbody tr.rc-doc td{white-space:nowrap}
.rc-caret{color:var(--ink-4);font-size:11px;margin-right:2px}
.rc-tbl tbody tr.rc-det>td{padding:0;background:#f8fafc;border-bottom:1px solid var(--line)}
.rc-det-in{padding:10px 14px 14px}
.rc-det-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12.5px;color:var(--ink-2);padding:2px 0 8px}
.rc-det-head b{font-size:13px}
.rc-det-head .btn{margin-left:auto}
.rc-det-tbl{width:100%;border-collapse:collapse;font-size:12px;background:#fff}
.rc-det-tbl th{background:#e8eef7;color:var(--ink-2);font-weight:650;font-size:11.5px;padding:5px 8px;text-align:left;border:1px solid #dbe3ee}
.rc-det-tbl td{padding:4px 8px;border:1px solid #e5ebf3;white-space:nowrap}
.rc-det-tbl td.num,.rc-det-tbl th.num{text-align:right;font-variant-numeric:tabular-nums}
.rc-det-tbl td.b{font-weight:700}
.rc-more{color:var(--ink-4);font-size:11.5px;white-space:nowrap}
.rc-tbl .dim a{text-decoration:none}
@media(max-width:900px){
  .rc-det-tbl{font-size:11px}
  .rc-det-in{padding:8px 6px 10px}
}
/* 工单管理「操作」列：一键完工 / 🗑 / 详情 / 编辑 四个按钮，别被列宽压没了（2026-11-12 老板要的） */
#wo-table th[data-col="ops"], #wo-table td[data-col="ops"]{min-width:200px !important;white-space:nowrap}


/* ICP 备案号（工信部要求挂底部，2026-11-14） */
.site-foot{text-align:center;font-size:12px;color:#94a3b8;padding:8px 0 18px}
.site-foot a{color:#94a3b8;text-decoration:none}
.site-foot a:hover{color:#64748b;text-decoration:underline}
