/* ============ 生产全流程协同工作台 ============ */
:root {
  --brand: #2563eb; --brand-d: #1d4ed8; --brand-l: #dbeafe;
  --cyan: #0891b2; --cyan-l: #cffafe;
  --ok: #059669; --ok-l: #d1fae5;
  --warn: #d97706; --warn-l: #fef3c7; --danger: #dc2626; --danger-l: #fee2e2;
  --purple: #7c3aed; --purple-l: #ede9fe; --pink: #db2777; --pink-l: #fce7f3;
  --side: #16213a; --side-2: #1e2b4a; --side-tx: #a7b4cd; --side-ac: #3b82f6;
  --bg: #f1f5f9; --card: #fff; --bd: #e2e8f0; --bd-2: #cbd5e1;
  --tx: #0f172a; --tx-2: #475569; --tx-3: #94a3b8;
  --r: 8px; --r-s: 6px; --sd: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --sd-l: 0 10px 30px rgba(15,23,42,.14);
  --side-w: 208px; --head-h: 54px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录（浅色 · 白色玻璃体） ---------- */
.login-wrap {
  position: relative; overflow: hidden;
  min-height: 100vh; display: grid; place-items: center end; padding: 20px 8vw 20px 20px;
  /* 背景换为公司图片（FULLLINK 标志，白底居中），缩放为屏宽 75%；相对路径，兼容 /workbench/ 子路径部署 */
  background: #fff url('../logo-bg.png') center / 75% auto no-repeat;
}
/* 背景柔光球，营造玻璃折射 */
.login-wrap::before, .login-wrap::after {
  content: ''; position: absolute; border-radius: 50%;
  pointer-events: none; filter: blur(74px); opacity: .60;
}
/* 背景已换为公司图片，原渐变柔光球停用（避免彩色光斑污染公司图片背景） */
.login-wrap::before, .login-wrap::after { display: none; }
@keyframes glassGlow {
  from { opacity: .48; transform: scale(1); }
  to { opacity: .66; transform: scale(1.05); }
}
.login-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 300px; border-radius: 20px; padding: 34px 26px;
  background: rgba(255,255,255,.52);
  -webkit-backdrop-filter: blur(28px) saturate(220%);
  backdrop-filter: blur(28px) saturate(220%);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow:
    0 24px 70px rgba(15,30,58,.10),
    0 10px 28px rgba(15,30,58,.06),
    inset 0 1px 1px rgba(255,255,255,.95);
  overflow: hidden;
}
/* 卡片顶部白色高光条，强化玻璃边缘 */
.login-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  pointer-events: none;
}
/* 浏览器不支持毛玻璃时提高不透明度兜底 */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .login-box { background: rgba(255,255,255,.94); }
}
.login-box h1 { font-size: 21px; margin-bottom: 4px; }
.login-box .sub { color: var(--tx-2); font-size: 13px; margin-bottom: 22px; }
.login-box .mark { box-shadow: 0 6px 18px rgba(37,99,235,.32); }
/* 登录框公司 Logo 芯片（与工作台导航栏小图标同款：白底圆角 + 图片 contain） */
.login-mark { width:38px; height:38px; border-radius:10px; background:#fff; padding:3px; box-sizing:border-box;
  display:grid; place-items:center; flex-shrink:0; box-shadow:0 2px 10px rgba(15,30,58,.10); }
.login-mark img { width:100%; height:100%; object-fit:contain; display:block; }
.login-box .field > label { color: var(--tx-2); }
.login-box .inp, .login-box select.inp {
  background: rgba(255,255,255,.45);
  border-color: rgba(148,163,184,.42);
}
.login-box .inp::placeholder { color: #95a3b9; }
.login-box .inp:hover { background: rgba(255,255,255,.60); border-color: rgba(125,143,168,.55); }
/* 登录密码可见切换（眼睛按钮内嵌输入框右侧） */
.pwd-wrap { position: relative; }
.pwd-wrap .inp { width: 100%; padding-right: 40px; box-sizing: border-box; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  border: none; background: none; cursor: pointer; padding: 0;
  color: #7c8aa0; border-radius: 7px; line-height: 0;
}
.pwd-eye:hover { color: var(--brand); background: rgba(37,99,235,.08); }
.login-box .inp:focus {
  background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
.login-box .btn.pri { box-shadow: 0 6px 18px rgba(37,99,235,.28); }
.login-box .btn.pri:hover { box-shadow: 0 8px 22px rgba(37,99,235,.36); }
.login-box .alert { background: rgba(254,243,199,.75); }
.login-box .hint { color: var(--tx-2); }
.login-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid rgba(148,163,184,.34); }
.login-tabs button {
  flex: 1; padding: 9px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--tx-2); cursor: pointer; font-weight: 500;
}
.login-tabs button.on { color: var(--brand); border-color: var(--brand); }
.login-demo {
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(148,163,184,.46);
  font-size: 12px; color: var(--tx-2);
}
.login-demo b { color: var(--tx); }
.demo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo-chips span {
  padding: 3px 8px; background: rgba(255,255,255,.55); border: 1px solid rgba(148,163,184,.40);
  border-radius: 20px; color: var(--tx-2);
  cursor: pointer; transition: .15s;
}
.demo-chips span:hover {
  background: rgba(255,255,255,.90); border-color: var(--brand); color: var(--brand-d);
  box-shadow: 0 2px 8px rgba(37,99,235,.15);
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: var(--app-vh, 100vh); }
.sidebar {
  width: var(--side-w); background: var(--side); color: var(--side-tx);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
  transition: transform .22s;
}
.logo {
  height: var(--head-h); display: flex; align-items: center; gap: 9px; padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.07); color: #fff; flex-shrink: 0;
}
.logo .mark {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: #fff; padding: 2px; box-sizing: border-box;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.logo .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo b { font-size: 13px; letter-spacing: 0; white-space: nowrap; }
.logo > div:nth-of-type(2) { display: flex; flex-direction: column-reverse; } /* 文字上下互换：副标题在上、标题在下（仅显示位置对调，样式不变） */
.logo small { display: block; font-size: 10px; color: var(--side-tx); font-weight: 400; }
.nav { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-s);
  cursor: pointer; margin-bottom: 2px; font-size: 13.5px; transition: .14s; position: relative;
}
.nav-item:hover { background: var(--side-2); color: #e2e8f0; }
.nav-item.on { background: var(--brand); color: #fff; font-weight: 500; }
.nav-item.on .ico { opacity: 1; }
.nav-item .ico { width: 17px; height: 17px; opacity: .75; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10px;
  padding: 1px 6px; border-radius: 9px; font-weight: 600; min-width: 18px; text-align: center;
}
.nav-item.on .badge { background: rgba(255,255,255,.28); }
.nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 11px; }
/* 二级导航（如仓库出库 → 电缆/连接器/塑料件/五金件出库） */
.nav-item.has-child { padding-right: 8px; }
.nav-arrow { margin-left: auto; font-size: 10px; line-height: 1; opacity: .6; transition: transform .15s; flex-shrink: 0; }
.nav-item.has-child.open .nav-arrow { transform: rotate(180deg); }
.nav-sub { display: none; margin: 2px 0 4px 18px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); }
.nav-sub.open { display: block; }
.nav-sub-item {
  display: flex; align-items: center; padding: 7px 10px; border-radius: var(--r-s);
  cursor: pointer; margin-bottom: 1px; font-size: 13px; color: var(--side-tx); transition: .14s;
}
.nav-sub-item:hover { background: var(--side-2); color: #e2e8f0; }
.nav-sub-item.on { background: var(--brand); color: #fff; font-weight: 500; }
.nav-sub-item.on::before { content: ''; width: 3px; height: 13px; background: #fff; border-radius: 2px; margin-left: -7px; margin-right: 4px; }
.side-foot { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #64748b; }

/* 深色主题（外观切换为「深色」后由 body.theme-dark 触发；侧边栏保持原深色调不动） */
body.theme-dark {
  --bg: #0b1220;
  --card: #111a2e;
  --bd: #1f2a44;
  --bd-2: #2c3a5a;
  --tx: #e6ecf5;
  --tx-2: #aab7cf;
  --tx-3: #6e7e9b;
  --brand-l: #1e2b4a;
  --cyan-l: #0c2d3a;
  --ok-l: #134e3a;
  --warn-l: #4a3719;
  --danger-l: #4a1e22;
  --purple-l: #2a1d4a;
  --pink-l: #3a1232;
  --sd: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.35);
  --sd-l: 0 10px 30px rgba(0,0,0,.5);
}
body.theme-dark .topbar { background: var(--card); }
body.theme-dark ::-webkit-scrollbar-thumb { background: #2c3a5a; }
body.theme-dark ::-webkit-scrollbar-thumb:hover { background: #3b4d77; }

/* 护眼绿主题（外观切换为「护眼」后由 body.theme-green 触发；只调整配色变量，内容与布局不变） */
body.theme-green {
  --bg: #cfe8d2;   /* 经典护眼豆沙绿页面底色 */
  --card: #f6fbf6; /* 卡片微绿白，柔和不刺眼 */
  --bd: #b9d6c0;
  --bd-2: #9fc4aa;
  --tx: #1c2b22;
  --tx-2: #48594e;
  --tx-3: #7d9486;
  /* 导航栏（侧边栏）同步护眼绿调：深绿底 + 浅绿文字，保持柔和 */
  --side: #2c5d41; --side-2: #3a7350; --side-tx: #cde7d4; --side-ac: #7fcf9d;
  --brand-l: #d9ecdb;
  --cyan-l: #d5ecdf;
  --ok-l: #d7f0dc;
  --warn-l: #f2ecd2;
  --danger-l: #f2ddd9;
  --purple-l: #e7e3f3;
  --pink-l: #f4e1eb;
  --sd: 0 1px 3px rgba(28,60,40,.10), 0 1px 2px rgba(28,60,40,.06);
  --sd-l: 0 10px 30px rgba(28,60,40,.18);
}
body.theme-green ::-webkit-scrollbar-thumb { background: #9dbfa6; }
body.theme-green ::-webkit-scrollbar-thumb:hover { background: #85ac90; }
/* 护眼主题下侧边栏原本适配深色硬编码的白边/白字改绿调（仅配色，结构不动） */
body.theme-green .logo { border-bottom-color: rgba(255,255,255,.12); color: #eef7f0; }
body.theme-green .logo small { color: var(--side-tx); }
body.theme-green .nav-item:hover,
body.theme-green .nav-sub-item:hover { color: #eef7f0; }
body.theme-green .nav-sep { background: rgba(255,255,255,.14); }
body.theme-green .nav-sub { border-left-color: rgba(255,255,255,.18); }
body.theme-green .side-foot { color: rgba(255,255,255,.55); border-top-color: rgba(255,255,255,.12); }
body.theme-green .side-theme { border-top-color: rgba(255,255,255,.14); }
body.theme-green .side-theme .st-seg { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); }
body.theme-green .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
/* 护眼主题下个别硬编码纯白的悬浮/选中底色改用微绿白，避免与卡片色断层 */
body.theme-green .su-tbl tr:hover td,
body.theme-green .su-tbl tr:hover .su-idx,
body.theme-green .su-tbl tr:hover .acts { background: var(--brand-l); }
/* 侧边栏外观切换控件（浅色 / 深色 分段按钮） */
.side-theme {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 14px; border-top: 1px solid rgba(255,255,255,.07);
}
.side-theme .st-lbl { display: inline-flex; align-items: center; gap: 6px; color: var(--side-tx); font-size: 12px; }
.side-theme .st-ico {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(#fbbf24, #f472b6, #818cf8, #34d399, #fbbf24);
  flex-shrink: 0;
}
.side-theme .st-seg {
  display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10); flex-shrink: 0;
}
.side-theme .st-seg button {
  border: none; background: transparent; color: var(--side-tx);
  padding: 4px 12px; font-size: 12px; border-radius: 999px; cursor: pointer; transition: .14s;
}
.side-theme .st-seg button:hover { color: #e2e8f0; }
.side-theme .st-seg button.on { background: #fff; color: var(--side); box-shadow: 0 1px 2px rgba(0,0,0,.25); font-weight: 600; }
/* 收起状态：侧边栏收缩为图标栏 */
.nav-collapsed .sidebar { width: 56px; }
.nav-collapsed .main { margin-left: 56px; }
.nav-collapsed .logo { justify-content: center; padding: 0 8px; }
.nav-collapsed .logo b,
.nav-collapsed .logo small { display: none; }
.nav-collapsed .nav-item { justify-content: center; padding: 9px 8px; }
.nav-collapsed .nav-item span:not(.ico):not(.badge):not(.nav-arrow) { display: none; }
.nav-collapsed .nav-arrow { display: none; }
.nav-collapsed .nav-sub { display: none; }
.nav-collapsed .side-foot { padding: 10px 8px; display: flex; justify-content: center; }
.nav-collapsed .side-foot .foot-tx { display: none; }

/* 收起状态悬浮展开（JS 加 body.nav-hover 触发；不用 :hover，避免点击收起后鼠标未移开立即弹回展开） */
.nav-collapsed.nav-hover .sidebar { width: var(--side-w); box-shadow: var(--sd-l); z-index: 70; }
.nav-collapsed.nav-hover .sidebar .logo { justify-content: flex-start; padding: 0 16px; }
.nav-collapsed.nav-hover .sidebar .logo b,
.nav-collapsed.nav-hover .sidebar .logo small { display: block; }
.nav-collapsed.nav-hover .sidebar .nav-item { justify-content: flex-start; padding: 9px 11px; }
.nav-collapsed.nav-hover .sidebar .nav-item span:not(.ico):not(.badge) { display: inline; }
.nav-collapsed.nav-hover .sidebar .nav-arrow { display: inline-block; }
.nav-collapsed.nav-hover .sidebar .nav-sub.open { display: block; margin: 2px 0 4px 18px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); }
.nav-collapsed.nav-hover .sidebar .side-foot { padding: 10px 14px; justify-content: space-between; }
.nav-collapsed.nav-hover .sidebar .side-foot .foot-tx { display: inline; }
.nav-collapsed.nav-hover .sidebar .side-theme { justify-content: space-between; padding: 8px 14px; }
.nav-collapsed.nav-hover .sidebar .side-theme .st-lbl,
.nav-collapsed.nav-hover .sidebar .side-theme .st-seg { display: inline-flex; }
.nav-collapsed.nav-hover .sidebar .side-theme .st-lbl { font-size: 12px; }
/* 收起态：外观控件只保留彩色圆点图标（文字/分段按钮无空间，避免溢出与分页器重叠） */
.nav-collapsed .side-theme { justify-content: center; padding: 8px 8px; }
.nav-collapsed .side-theme .st-seg { display: none; }
.nav-collapsed .side-theme .st-lbl { font-size: 0; gap: 0; }

.nav-toggle {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 7px; border: none;
  background: rgba(255,255,255,.08); color: var(--side-tx);
  display: grid; place-items: center; cursor: pointer; transition: .15s; font-size: 14px; line-height: 1;
}
.nav-toggle:hover { background: rgba(255,255,255,.18); color: #fff; }

.main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0;
  /* 页面高度锁定为一屏：顶栏+页签+筛选+表头固定，数据行在表格内部滚动（全员统一） */
  /* 高度走 --app-vh（由缩放逻辑按视口/缩放比写入）：任何缩放比例下都精确铺满显示器 */
  height: var(--app-vh, 100vh); overflow: hidden; }
.topbar {
  height: var(--head-h); background: var(--card); border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 16px; font-weight: 600; }
.topbar .crumb { color: var(--tx-3); font-size: 12px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.zoom-bar { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--bd); border-radius: var(--r-s); padding: 2px; }
.zoom-bar .icon-btn { width: 28px; height: 28px; font-size: 13px; }
.zoom-bar #zoomReset { width: auto; padding: 0 8px; font-size: 12px; }
.zoom-inp {
  width: 50px; text-align: center; padding: 3px 4px; font-size: 12px;
  border: 1px solid var(--bd); border-radius: 5px; background: var(--card); outline: none;
}
.zoom-inp:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37,99,235,.10); }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-s); border: 1px solid var(--bd);
  background: var(--card); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--tx-2);
}
.icon-btn:hover { background: var(--bg); border-color: var(--bd-2); }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff;
  font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid;
  place-items: center; padding: 0 4px; font-weight: 600; border: 2px solid var(--card);
}
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 20px; cursor: pointer; border: 1px solid var(--bd);
}
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.user-chip .nm { font-size: 13px; font-weight: 500; line-height: 1.15; }
.user-chip .rl { font-size: 10.5px; color: var(--tx-3); }
.menu-toggle { display: none; }
/* 页面边框紧贴显示器边框：内容区零留白，出血卡片取消圆角直贴屏幕边缘 */
.content { padding: 0 0 24px; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.content > .card, .content > #modBody > .card { border-radius: 0; }
/* 锁定页不产生整页滚动：页签卡片固定高度不被压缩，剩余高度全部给列表卡片 */
.content > .card { flex-shrink: 0; }
/* 子模块主体容器：在 .content 的 flex 列中占满剩余高度，使内部 list-card 能真正撑满显示器 */
.content > #modBody {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* R99：现场任务列表（未申请/已申请）为「子页签卡片 + #onsiteBody 列表」两层结构，
   #onsiteBody 默认 .mt14（block、不占剩余高度）会截断高度链，导致列表被压在顶部、
   下方留大段空白、底部滚动条/合计条不贴视口下边框。
   修复：子页签卡片固定高度不收缩，剩余高度全部交给 #onsiteBody（flex 列），
   内部 list-card(flex:1) 方能真正撑满，使 .tbl-wrap 内固定底部滚动条 + 吸底合计条
   与订单/合同列表完全一致。 */
.content > #modBody > #onsiteBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.content > #modBody > .onsite-tabs { flex-shrink: 0; }

/* ---------- 首页总览（dashboard）自适应满屏 ---------- */
/* 整页作为 flex 列铺满 .content 高度：上方 KPI 固定，下方四块分析卡片等比伸展占满剩余空间 */
.dash { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 14px; }
.dash-top { flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.dash-body { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 14px; }
/* dashboard 用容器 gap 控制间距，避免叠加 .card+.card 的 margin */
.dash-body .card + .card { margin-top: 0; }
/* 每块卡片自身在 .dash-body 中伸展，卡片头固定、卡片体占满并让图表/表格填满 */
.dash-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dash-card > .card-h { flex-shrink: 0; }
.dash-card > .card-b { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 图表填满卡片体（覆盖 .chart 固定 280px），高度随视口/缩放自适应 */
.dash-card .chart { flex: 1; width: 100%; height: auto; min-height: 0; }
/* 「加高一倍」：在 .dash-body 的 flex 列中占 2 份额（其余卡片占 1 份额）并保底高度，避免被长列表挤压坍塌 */
.dash-card.tall { flex: 2; min-height: 300px; }
/* 「各工序产能负荷」加高保底：20 个工序的堆叠柱图需要更高空间，避免压缩/截断；视口充足时仍按 flex 比例伸展 */
.dash-card.load-tall { min-height: 420px; }

/* R: 首页备案号底部常驻条（管局要求必须可点击跳转工信部备案系统） */
#siteFoot { position: fixed; left: var(--side-w); right: 0; bottom: 0; height: 24px; line-height: 24px;
  text-align: center; font-size: 12px; color: #94a3b8; background: var(--bg);
  border-top: 1px solid var(--bd); z-index: 55; }
#siteFoot a { color: #94a3b8; text-decoration: none; }
#siteFoot a:hover { color: var(--brand); text-decoration: underline; }
.nav-collapsed #siteFoot { left: 56px; }
/* 「7天内交期预警」按内容自增高：卡片不拉伸、表格随行数自然撑开（高度根据内容自动调整） */
.dash-card.auto-h { flex: 0 0 auto; }
.dash-card.auto-h > .card-b { flex: 0 0 auto; }
.dash-card.auto-h .tbl-wrap { flex: 0 0 auto; overflow: visible; max-height: none; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--sd); }
.card + .card { margin-top: 14px; }
/* 列表卡片：占满内容区高度；表头（thead）吸顶为锁定边界，数据行在 .tbl-wrap 内滚动，
   横向/纵向滚动条始终位于表格区域底部边框处（不论行数多少都可见） */
.list-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.card-h {
  padding: 11px 15px; border-bottom: 1px solid var(--bd); display: flex;
  align-items: center; gap: 10px; flex-wrap: wrap;
  flex-shrink: 0; /* R100：列表卡片标题栏（标题+按钮行）在弹性列中绝不收缩，
                     与列头吸顶(thead sticky)、子页签卡片(flex-shrink:0)共同构成「始终可见的表头区域」 */
}
.card-h h3 { font-size: 14px; font-weight: 600; }
.card-h .sub { font-size: 12px; color: var(--tx-3); }
.card-h .right { margin-left: auto; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 15px; }
.card-b.p0 { padding: 0; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.col-span-2 { grid-column: span 2; }

/* 统计卡 */
.kpi {
  background: var(--card); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 13px 15px; box-shadow: var(--sd); position: relative; overflow: hidden;
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.kpi.ok::before { background: var(--ok); } .kpi.warn::before { background: var(--warn); }
.kpi.danger::before { background: var(--danger); } .kpi.cyan::before { background: var(--cyan); }
.kpi.purple::before { background: var(--purple); } .kpi.pink::before { background: var(--pink); }
.kpi .lbl { font-size: 12px; color: var(--tx-2); display: flex; align-items: center; gap: 5px; }
.kpi .val { font-size: 25px; font-weight: 700; line-height: 1.25; margin-top: 3px; letter-spacing: -.5px; }
.kpi .val small { font-size: 13px; font-weight: 500; color: var(--tx-3); margin-left: 2px; }
.kpi .ext { font-size: 11.5px; color: var(--tx-3); margin-top: 3px; }
.kpi .ext b { color: var(--tx-2); }
.kpi.clickable { cursor: pointer; transition: .15s; }
.kpi.clickable:hover { transform: translateY(-1px); box-shadow: var(--sd-l); border-color: var(--bd-2); }

/* 按钮 */
.btn {
  padding: 6.5px 13px; border-radius: var(--r-s); border: 1px solid var(--bd); background: var(--card);
  cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 5px;
  transition: .14s; white-space: nowrap; color: var(--tx);
}
.btn:hover { background: var(--bg); border-color: var(--bd-2); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(.93); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.93); }
.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.purple:hover { filter: brightness(.93); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.warn:hover { filter: brightness(.93); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); padding: 4px 7px; }
.btn.ghost:hover { background: var(--brand-l); }
/* 生产订单管理：编辑按钮改淡蓝、批量编辑按钮深蓝 */
.btn.ltblue { background: #e8f1ff; border-color: #bcd6ff; color: #1d4ed8; }
.btn.ltblue:hover { background: #d8e8ff; border-color: #9fc1ff; }
.btn.dkblue { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.btn.dkblue:hover { filter: brightness(.96); }
.btn.sm { padding: 3.5px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 批量编辑弹窗：左批改项、右批改为内容 两列布局 */
.batch-edit { display: flex; gap: 20px; flex-wrap: wrap; }
.batch-edit .be-col { flex: 1; min-width: 240px; }
.batch-edit label { display: block; font-size: 12px; color: var(--muted, #64748b); margin-bottom: 6px; font-weight: 600; }
.be-tip { margin-top: 14px; font-size: 12px; color: var(--muted, #64748b); }

/* 表单 */
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12.5px; color: var(--tx-2); margin-bottom: 5px; font-weight: 500; }
.field > label .req { color: var(--danger); }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 7.5px 11px; border: 1px solid var(--bd-2); border-radius: var(--r-s);
  background: var(--card); outline: none; transition: .14s;
}
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
.inp:disabled, .inp[readonly] { background: var(--bg); color: var(--tx-2); }
textarea.inp { min-height: 72px; resize: vertical; }
select.inp { cursor: pointer; }
.inp-group { display: flex; align-items: center; gap: 6px; }
.inp-group .inp { flex: 1 1 auto; min-width: 0; }
.inp-group .inp[type="date"] { flex: 2 1 auto; width: auto; min-width: 118px; }
.inp-group select.inp { flex: 0 0 auto; width: 64px; min-width: 64px; }
.inp-group .sep { color: var(--tx-3); font-size: 13px; padding: 0 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* 订单录入：工艺路线实时预览 */
.route-preview {
  border: 1px dashed var(--brand); background: var(--brand-l); border-radius: 9px;
  padding: 10px 13px; margin-bottom: 14px;
}
.route-preview .rp-h { font-size: 12.5px; font-weight: 600; color: var(--tx-1); margin-bottom: 7px; }
/* 批量新增顶部：横向工艺路线预览 */
.batch-route { border: 1px dashed var(--brand); background: var(--brand-l); border-radius: 9px; padding: 10px 13px; margin: 10px 0; }
.batch-route .br-h { font-size: 12.5px; font-weight: 600; color: var(--tx-1); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.batch-route .br-h select { font-weight: 500; }
/* 现场安装 - 现场管理：进行中现场的 editable 表单 */
.site-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.site-form .sf { display: flex; flex-direction: column; gap: 3px; }
.site-form .sf label { font-size: 11.5px; color: var(--tx-3); }
.site-form .sf.site-acts { flex-direction: row; align-items: flex-end; gap: 8px; grid-column: 1 / -1; }
.route-preview .rp-type {
  display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 20px;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 500;
}
.rp-steps { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 2px 8px; }
.rp-step {
  display: flex; flex-direction: column; min-width: 120px; flex: 0 0 auto;
  background: var(--card); border: 1px solid var(--bd); border-top: 3px solid var(--tx-3); border-radius: 8px; padding: 8px 10px; text-align: center; color: var(--tx-1);
}
.rp-step.done { border-top-color: var(--ok); background: var(--ok-l); }
.rp-step.doing { border-top-color: var(--brand); background: var(--brand-l); }
.rp-step.rework { border-top-color: var(--danger); background: var(--danger-l); }
.rp-step.paused { border-top-color: var(--warn); background: var(--warn-l); }
.rp-step.preview { opacity: .72; border-top-color: var(--bd); }
.rp-seq { font-size: 11px; font-weight: 700; color: var(--brand); line-height: 1.3; }
.rp-name { font-size: 12.5px; font-weight: 600; margin: 2px 0; line-height: 1.3; }
.rp-role { font-size: 11px; color: var(--tx-3); line-height: 1.3; }
.rp-status { margin-top: 5px; }
.rp-date { font-size: 10.5px; color: var(--tx-3); margin-top: 2px; line-height: 1.3; }
.rp-act { margin-top: 7px; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.rp-arrow { align-self: center; color: var(--tx-3); margin: 0 4px; flex: 0 0 auto; font-size: 14px; }
/* 每道工序的进度状态阶梯（横向工艺路线矩阵内） */
.rp-ladder { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; justify-content: center; }
.rp-ls { font-size: 10px; line-height: 1.3; padding: 1px 5px; border-radius: 4px; color: var(--tx-3); background: var(--bg); border: 1px solid var(--bd); word-break: break-all; }
.rp-ls.on { color: #fff; background: var(--brand); border-color: var(--brand); font-weight: 600; }
/* 设置-工艺路线：按 Excel 样式横向排列（工序为列） */
.rt-list { display: flex; flex-direction: column; gap: 14px; }
.rt-strip { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 10px; overflow-x: auto; padding: 6px 2px 12px; }
.rt-col {
  flex: 0 0 auto; width: 158px; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  background: var(--card); border: 1px solid var(--bd); border-top: 3px solid var(--brand); border-radius: 8px; padding: 8px 9px; text-align: center; color: var(--tx-1);
}
.rt-col .inp { width: 100%; }
.rt-seq { font-size: 11px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.rt-top { display: flex; align-items: center; justify-content: space-between; }
.rt-grip { cursor: grab; color: var(--tx-3); font-size: 14px; line-height: 1; user-select: none; padding: 0 2px; }
.rt-grip:hover { color: var(--brand); }
.rt-grip:active { cursor: grabbing; }
.rt-col.dragging { opacity: .45; }
.rt-col.drag-over { outline: 2px dashed var(--brand); outline-offset: 2px; }
.rt-col .step-sel { font-weight: 600; font-size: 12.5px; }
.rt-row { margin-top: 4px; }
.rt-row label { font-size: 10.5px; color: var(--tx-3); }
.rt-col .rp-ladder { margin-top: 2px; }
.rt-empty { font-size: 11px; padding: 2px 0; }
.rt-acts { margin-top: auto; padding-top: 6px; display: flex; gap: 4px; justify-content: center; }
.rt-add-col { justify-content: center; align-items: center; border-style: dashed; border-top-style: dashed; background: var(--bg); color: var(--brand); cursor: pointer; min-height: 150px; }
.rt-add-col span { font-size: 11px; display: block; margin-top: 4px; }
/* 工艺路线分组（仓库出库 → 4 类物料子类） */
.rt-group {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 0;
  background: var(--card); border: 1px solid var(--bd); border-top: 3px solid var(--brand-2, #7c3aed); border-radius: 8px; padding: 0 9px 9px;
}
.rt-group.dragging { opacity: .45; }
.rt-group.drag-over { outline: 2px dashed var(--brand); outline-offset: 2px; }
.rt-group-head { display: flex; align-items: center; gap: 6px; padding: 8px 0 6px; border-bottom: 1px dashed var(--bd); margin-bottom: 8px; flex-wrap: wrap; }
.rt-group-name { font-weight: 700; font-size: 13px; color: var(--tx-1); }
.rt-group-head .muted { font-size: 10.5px; }
.rt-group-head .rt-acts { margin-left: auto; }
.rt-group-children { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 10px; }
.rt-col.rt-child { width: 150px; border-top-color: var(--brand-2, #7c3aed); }
.rt-group .rt-add-col { min-height: auto; padding: 28px 10px; width: 60px; }
/* 三级子件（子件级）：二级节点（管线包线束）下嵌套的子件块 */
.rt-col.rt-subgroup { width: auto; min-width: 180px; border-top-color: var(--brand-3, #0891b2); background: var(--brand-l); }
.rt-subgroup-name { font-weight: 700; font-size: 12.5px; color: var(--brand-3, #0891b2); text-align: left; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--bd); }
.rt-subgroup-name .muted { font-weight: 400; font-size: 10px; color: var(--tx-3); }
.rt-subgroup-children { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; }
.rt-col.rt-third { width: 132px; flex: 0 0 auto; border-top-color: var(--brand-3, #0891b2); background: var(--card); }
.rt-third-name { font-weight: 600; font-size: 12px; text-align: center; }
.rt-subgroup .rt-add-col { min-height: auto; padding: 10px; width: 56px; align-self: stretch; }
.rt-subgroup .rt-empty { padding: 8px 4px; }

/* 出库类别标签 */
.tag.cat { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--brand-l); color: var(--brand); font-size: 12px; font-weight: 600; }
/* 完工状态（可编辑） */
.rt-status { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; align-items: stretch; }
.rt-status-chip { display: flex; align-items: center; gap: 3px; }
.rt-status-inp { flex: 1 1 auto; min-width: 0; font-size: 11px; padding: 2px 4px; height: 22px; }
.rt-status-del { flex: 0 0 auto; width: 18px; height: 18px; line-height: 16px; padding: 0; border: 1px solid var(--bd); border-radius: 4px; background: var(--card); color: var(--danger); cursor: pointer; font-size: 12px; }
.rt-status-del:hover { background: var(--danger-l); }
.rt-status-add { align-self: center; margin-top: 2px; font-size: 10.5px; padding: 2px 8px; border: 1px dashed var(--bd); border-radius: 4px; background: var(--bg); color: var(--brand); cursor: pointer; }
.rt-status-add:hover { background: #eef2ff; }

/* 工艺路线页：左侧产品类型 + 右侧工艺管理 */
.rt-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rt-title-wrap h3 { font-size: 15px; line-height: 1.3; }
.rt-title-wrap .sub { color: var(--tx-3); font-size: 12px; }
.rt-type-rename { font-size: 14px; font-weight: 700; color: var(--tx); padding: 3px 7px; height: auto; min-width: 120px; max-width: 220px; }
.rt-card .card-h { align-items: flex-start; }
.rt-card .card-h .right { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: flex-start; }
.rt-layout { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.rt-side { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rt-side .card { margin: 0; }
@media (max-width: 860px) { .rt-side { grid-template-columns: 1fr; } }
.rt-step-lib { padding: 8px; }
.rt-step-idx { flex: 0 0 18px; text-align: center; font-size: 11px; color: var(--tx-3); }
.rt-step-name { flex: 1 1 auto; min-width: 60px; }
.rt-step-foot { padding: 8px 12px; border-top: 1px solid var(--bd); }
.rt-step-tag { flex: 0 0 auto; font-size: 10px; color: var(--brand); background: var(--brand-l); padding: 1px 5px; border-radius: 3px; white-space: nowrap; }

/* 工艺管理：一级 / 二级工艺 两列表格（工序底色由「完工状态管理」带出） */
.rt-step-table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.rt-step-table th { position: sticky; top: 0; background: var(--bg); padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--tx-2); text-align: left; border-bottom: 1px solid var(--bd); z-index: 1; }
.rt-step-table td { padding: 4px 8px; border-bottom: 1px solid var(--bd); border-top: 1px solid var(--bd); vertical-align: middle; }
.rt-step-table tr:first-child td { border-top: none; }
.rt-step-table tr:hover td { background: var(--bg); }
.rt-step-row { display: table-row; }
.rt-step-l1 { width: 42%; }
.rt-step-l2 { width: 58%; }
.rt-step-l1-cell, .rt-step-cell { display: flex; align-items: center; gap: 6px; }
.rt-step-cell { flex-wrap: wrap; }
.rt-step-tag { flex: 0 0 auto; font-size: 10px; color: var(--brand); background: var(--brand-l); padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.rt-step-table .rt-step-idx { flex: 0 0 20px; text-align: center; }
.rt-step-table .rt-step-name { flex: 1 1 120px; min-width: 90px; }
/* 工艺管理：一级分组浅蓝色底框（横向包裹一级+二级工序），独立工序无底色 */
.rt-step-group { background: var(--brand-l); outline: 1px solid var(--bd-2); outline-offset: -1px; position: relative; }
.rt-step-group-solo { background: transparent; outline: none; }
.rt-step-group.dragging { opacity: 0.65; }
.rt-step-group.drag-over::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--brand); z-index: 2; pointer-events: none; }
.rt-step-group.drag-over-top::before { content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--brand); z-index: 2; pointer-events: none; }
.rt-group-grip { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 18px; color: var(--tx-3); cursor: grab; font-size: 10px; line-height: 1; user-select: none; margin-right: 2px; }
.rt-group-grip:active { cursor: grabbing; color: var(--brand); }

/* 完工状态管理：每道工序的状态阶梯编辑 */
.rt-batch-color { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px dashed var(--bd); background: var(--bg); }
.rt-batch-color > b { font-size: 12px; color: var(--ink); }
.rt-batch-color select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--bd); border-radius: 6px; background: var(--card); }
.rt-batch-color .muted { font-size: 12px; }
.rt-status-lib { padding: 6px 8px 2px; }
.rt-status-row { padding: 6px 0; border-bottom: 1px dashed var(--bd); }
.rt-status-row:last-child { border-bottom: none; }
.rt-status-row-h { font-size: 12px; font-weight: 600; color: var(--tx-2); margin-bottom: 4px; }
.rt-status-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rt-status-chip2 { display: inline-flex; align-items: center; gap: 2px; background: var(--bg); border: 1px solid var(--bd); border-radius: 6px; padding: 1px 2px 1px 4px; }
.rt-status-chip2 .inp { min-width: 0; padding: 3px 5px; font-size: 12px; width: 92px; }
.rt-st-del2 { flex: 0 0 auto; border: none; background: transparent; color: var(--tx-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; }
.rt-st-del2:hover { color: var(--danger); }
.rt-st-add2 { border: 1px dashed var(--bd); background: var(--card); color: var(--tx-2); border-radius: 6px; cursor: pointer; font-size: 12px; padding: 2px 7px; }
.rt-st-add2:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-l); }
.rt-st-grip { cursor: grab; color: var(--tx-3); font-size: 13px; line-height: 1; user-select: none; padding: 0 1px; }
.rt-st-grip:hover { color: var(--brand); }
.rt-st-grip:active { cursor: grabbing; }
.rt-status-chip2.dragging { opacity: .45; }
.rt-status-chip2.drag-over { outline: 2px dashed var(--brand); outline-offset: 1px; }
/* 完工状态底色选择器 */
.rt-st-color, .rt-st-color2 { width: 22px; height: 22px; padding: 0; border: 1px solid var(--bd); border-radius: 4px; background: none; cursor: pointer; flex: 0 0 auto; }

/* 工艺管理及完工状态管理：三列表格（一级工艺 | 二级工艺 | 完工状态） */
.rt-pm-card .card-b { padding: 0; }
.rt-pm-list { padding: 6px 8px 2px; overflow-x: auto; }
.rt-pm-table { width: auto; min-width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.rt-pm-table thead th { position: sticky; top: 0; background: var(--bg); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--tx-2); text-align: left; border-bottom: 1px solid var(--bd); z-index: 1; }
.rt-pm-table thead th:first-child { text-align: center; }
.rt-pm-resizer { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 4; touch-action: none; }
.rt-pm-resizer::after { content: ''; position: absolute; top: 22%; bottom: 22%; left: 4px; width: 2px; background: var(--bd); border-radius: 2px; }
.rt-pm-resizer:hover::after, .rt-pm-resizer.active::after { background: var(--brand); }
.rt-pm-table tbody { position: relative; }
.rt-pm-table tbody:not(.rt-pm-solo) { background: var(--brand-l); }
.rt-pm-table tbody.rt-pm-solo { background: var(--card); }
.rt-pm-table tbody.dragging { opacity: .65; }
.rt-pm-table tbody.drag-over::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--brand); z-index: 2; pointer-events: none; }
.rt-pm-table tbody.drag-over-top::before { content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--brand); z-index: 2; pointer-events: none; }
.rt-pm-table td { padding: 5px 8px; border-bottom: 1px dashed var(--bd); vertical-align: middle; }
.rt-pm-table tbody:last-child tr:last-child td { border-bottom: none; }
.rt-pm-l1 { text-align: center; vertical-align: middle; border-right: 1px dashed var(--bd-2); padding: 6px; }
.rt-pm-l1-inner { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.rt-pm-l1 .inp { width: 100%; min-width: 0; }
.rt-pm-solo .rt-pm-l1 { border-right-color: var(--bd); }
.rt-pm-grip { cursor: grab; color: var(--tx-3); font-size: 14px; line-height: 1; user-select: none; align-self: center; }
.rt-pm-grip:active { cursor: grabbing; color: var(--brand); }
.rt-pm-name { font-weight: 600; min-width: 0; width: 100%; text-align: center; padding: 2px 0; background: transparent; border: 1px dashed transparent; }
.rt-pm-name:hover, .rt-pm-name:focus { border-color: var(--brand); background: var(--card); }
.rt-pm-tag { font-size: 10px; color: var(--brand); background: var(--brand-l); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.rt-pm-l1-del { border: none; background: transparent; color: var(--tx-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px; }
.rt-pm-l1-del:hover { color: var(--danger); }
.rt-pm-l2 { display: flex; align-items: center; gap: 3px; }
.rt-pm-l2 .inp { flex: 1 1 auto; min-width: 0; width: auto; font-size: 12px; padding: 3px 5px; }
.rt-pm-l2-del { border: none; background: transparent; color: var(--tx-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.rt-pm-l2-del:hover { color: var(--danger); }
.rt-pm-sts { vertical-align: middle; }
.rt-pm-st-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rt-pm-st { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--bd); background: var(--bg); font-size: 12px; }
.rt-pm-st.has-color { border-color: var(--bd-2); }
.rt-pm-st .inp { width: 84px; min-width: 0; padding: 2px 4px; font-size: 12px; text-align: center; }
.rt-pm-st-color { width: 18px; height: 18px; padding: 0; border: none; background: none; cursor: pointer; flex: 0 0 auto; }
.rt-pm-st-del { flex: 0 0 auto; width: 16px; height: 16px; line-height: 14px; padding: 0; border: 1px solid var(--bd); border-radius: 4px; background: var(--card); color: var(--danger); cursor: pointer; font-size: 11px; }
.rt-pm-st-del:hover { background: var(--danger-l); }
.rt-pm-st-add { font-size: 10.5px; padding: 2px 7px; border: 1px dashed var(--bd); border-radius: 4px; background: var(--bg); color: var(--brand); cursor: pointer; }
.rt-pm-st-add:hover { background: #eef2ff; }
.rt-pm-st-name { font-size: 12px; padding: 0 2px; }
/* 拖拽手柄：一级分组 / 二级工艺 / 完工状态 */
.rt-pm-sub-grip { cursor: grab; color: var(--tx-3); font-size: 14px; line-height: 1; user-select: none; margin-right: 2px; }
.rt-pm-sub-grip:active { cursor: grabbing; color: var(--brand); }
.rt-pm-st-grip { cursor: grab; color: var(--tx-3); font-size: 13px; line-height: 1; user-select: none; padding: 0 1px; }
.rt-pm-st-grip:active { cursor: grabbing; color: var(--brand); }
.rt-pm-row.sub-dragging { opacity: .55; }
.rt-pm-row.sub-drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.rt-pm-st.st-dragging { opacity: .5; }
.rt-pm-st.st-drag-over { outline: 2px dashed var(--brand); outline-offset: 1px; }
.rt-pm-foot { padding: 8px 12px; border-top: 1px solid var(--bd); display: flex; justify-content: flex-end; }
.rt-st-color2 { width: 20px; height: 20px; }
.rt-st-clear, .rt-st-clear2 { flex: 0 0 auto; border: none; background: transparent; color: var(--tx-3); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.rt-st-clear:hover, .rt-st-clear2:hover { color: var(--danger); }
.rt-st-color2 + .rt-st-clear2 { margin-left: -2px; }
.rt-sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.12); vertical-align: middle; }
/* 路由工序列内的状态底色选择器 */
.rt-status-chip { display: inline-flex; align-items: center; gap: 3px; }
.rt-status-chip .rt-st-color { width: 20px; height: 20px; }

/* 筛选栏 */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 11px 15px; border-bottom: 1px solid var(--bd); background: var(--card);
}
.filters .inp { width: auto; min-width: 130px; padding: 6px 10px; font-size: 13px; }
.filters .search { min-width: 240px; flex: 1 1 260px; }
.seg { display: inline-flex; border: 1px solid var(--bd-2); border-radius: var(--r-s); overflow: hidden; }
.seg button {
  padding: 5.5px 12px; border: none; background: var(--card); cursor: pointer; font-size: 12.5px;
  border-right: 1px solid var(--bd); color: var(--tx-2);
}
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 500; }

/* 增行录入保存栏（表头上方）：有新增行时显示，勾选行统一保存/取消 */
.inline-save-bar {
  display: none; align-items: center; gap: 10px;
  padding: 8px 15px; border-bottom: 1px solid var(--bd); background: var(--brand-l, #eff6ff);
}
.inline-save-bar .inb-hint { font-size: 12.5px; color: var(--tx-2); }
.inline-save-bar .inb-count { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.inline-save-bar .right { margin-left: auto; display: flex; gap: 8px; }
/* 增行保存时命中重复的行：高亮提示，确认后随下次「保存」一并录入 */
.tbl tr.inline-add-row.dup-row > td { background: var(--warn-l); }
body.theme-dark .inline-save-bar { background: rgba(37, 99, 235, .12); }

/* 批量新增表格 */
.batch-table-wrap { max-height: 55vh; overflow: auto; border: 1px solid var(--bd); border-radius: var(--r); }
.batch-tbl { margin: 0; }
.batch-tbl th { position: sticky; top: 0; background: var(--bg); z-index: 1; white-space: nowrap; font-size: 12px; padding-right: 26px; }
.batch-tbl th .th-resizer { background: linear-gradient(var(--bd), var(--bd)) center / 1px 60% no-repeat; }
.batch-col-del { position: absolute; top: 3px; right: 11px; width: 16px; height: 16px; line-height: 14px; text-align: center; padding: 0; font-size: 11px; border: none; background: transparent; color: var(--tx-3); border-radius: 4px; cursor: pointer; z-index: 5; }
.batch-col-del:hover { background: var(--danger-l); color: var(--danger); }
.batch-tbl td { padding: 6px 8px; }
.batch-tbl .inp { width: 100%; min-width: 80px; padding: 5px 7px; font-size: 12.5px; }
.batch-tbl .batch-sel { width: 100%; min-width: 90px; }
.batch-tbl .batch-ta { width: 100%; min-width: 170px; max-width: 360px; resize: vertical; font-size: 12.5px; padding: 5px 7px; line-height: 1.4; font-family: inherit; }
.batch-img-cell { text-align: center; vertical-align: middle; }
.batch-img { position: relative; display: inline-block; }
.batch-img img { max-width: 80px; max-height: 50px; border-radius: 4px; border: 1px solid var(--bd); }
.batch-img button { position: absolute; top: -6px; right: -6px; padding: 1px 5px; font-size: 11px; line-height: 1; border-radius: 10px; }
.batch-ocr { position: static; margin-top: 3px; font-size: 11px; padding: 1px 6px; display: inline-block; }
.batch-ocr-st { font-size: 10px; color: var(--tx-3); margin-top: 2px; line-height: 1.3; word-break: break-all; max-width: 110px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tx-2); cursor: pointer; user-select: none; }
.batch-paste-zone { border: 1px dashed var(--bd); border-radius: var(--r); background: var(--bg); padding: 12px 16px; margin-bottom: 12px; transition: .15s; }
.batch-paste-zone.drag { border-color: var(--brand); background: var(--brand-l); }
.bpz-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bpz-ico { font-size: 26px; line-height: 1; }
.bpz-txt { flex: 1 1 300px; min-width: 260px; }
.bpz-txt .lk { color: var(--brand); cursor: pointer; font-size: 14px; }
/* 单元格内可点击链接（如仓库出库任务列表的二级类别列）：整格可点，hover 高亮 */
.lk { cursor: pointer; color: var(--brand); border-bottom: 1px dashed transparent; transition: .12s; display: inline-block; }
.lk:hover { border-bottom-color: var(--brand); }
.lk .muted { color: var(--muted); }
.bpz-prev { display: flex; align-items: center; gap: 8px; }
.bpz-prev img { max-width: 130px; max-height: 72px; border-radius: 4px; border: 1px solid var(--bd); }

/* 表格 */
/* 纵向 flex：行数少时分页条(margin-top:auto)仍钉在滚动区底边；行数多时数据行正常滚动 */
.tbl-wrap { flex: 1; min-height: 0; overflow-x: scroll; overflow-y: auto; }
/* 横向滚动条轨道恒可见（即无横向溢出也显示轨道）：紧贴分页条上方，用户随时可见 */
.tbl-wrap::-webkit-scrollbar-track { background: #eef2f7; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #c3ccd8; }
/* 弹性内层：撑满滚动区。R51：表格恢复从顶部开始——表头必须「紧贴上方固定」
   （用户反馈：行数少的列表表头悬在页面中间、上方一大段空白）。
   合计行贴底改由 core.js 的 fitTableFill 填充行实现：矮列表时在 tbody 末尾
   追加一条透明填充行撑起空白，使 tfoot 合计行贴到滚动区底边；行数多时填充行
   自动移除，表头/合计行靠各自 sticky（top:0 / bottom:0）吸顶吸底。 */
.tbl-inner { min-height: 100%; display: flex; flex-direction: column; align-items: stretch; }
.tbl-inner > table.tbl { flex: 0 0 auto; }
/* 合计吸底行：位于横向滚动条上方、分页条下方，始终可见 */
/* R50 ①：合计行是主表内的 <tfoot>（与数据行同表、共用 colgroup），不再单独放一张 sum-tbl。
   —— 旧方案「主表 + 合计表两套 table 各自布局」，列宽靠 JS 克隆同步，只要测量时机/缩放/横向滚动
   有一点偏差，合计值就会落到相邻列下面（用户看到的「合计错位」）；同表 tfoot 由浏览器统一排版，
   列位置天然严格对齐，横向滚动时也与数据列一起平移。
   sticky bottom 使其在滚动区内恒贴底边；touch-action:pan-x 让触屏在该行起手只横向滚表格。 */
.sum-row { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -3px 8px -6px rgba(15,23,42,.28); touch-action: pan-x; user-select: none; font-size: 12.5px; }
.sum-row td {
  background: #fdf3e3; border-top: 1px solid #f0dcb8; border-bottom: none;
  font-weight: 600; color: #8a5a00; padding-top: 3px; padding-bottom: 3px;
  white-space: nowrap; overflow: hidden;
  /* border-collapse:collapse 下 sticky 单元格的边框会被浏览器丢弃，用 inset 阴影补一条顶边，
     保证合计行上沿始终可见（否则吸底后会与最后一行数据糊在一起） */
  box-shadow: inset 0 1px 0 #f0dcb8;
}
.sum-row td.tsum-label { letter-spacing: 2px; }
.sum-row td.tsum-cell:empty::before { content: '-'; color: #c9b08a; }
body.theme-dark .sum-row td { background: #2a3552; border-top-color: #3d4c73; color: #e8c98a; box-shadow: inset 0 1px 0 #3d4c73; }
/* R51：tbody 末尾的透明填充行（fitTableFill 动态插入）——撑起矮列表的空白，使合计行贴滚动区底边；
   自身不可见、不可选中、不参与 hover 高亮与行框线 */
.tbl tbody tr.tbl-fill td,
.tbl tbody tr.tbl-fill:hover td { border-top: none !important; border-bottom: none !important; background: transparent !important; padding: 0; }
.tbl tbody tr.tbl-fill { pointer-events: none; }
.tbl tbody tr.tbl-fill:hover { background: transparent !important; box-shadow: none; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: center; padding: 9px 12px; background: var(--bg); color: var(--tx-2);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--bd);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--brand); }
.tbl td { padding: 8.5px 12px; border-bottom: 1px solid var(--bd); vertical-align: middle; text-align: center; }
/* 细行框线：每行上下各一条 1px 浅灰线，相邻合并为一条，形成清晰的行框便于查看 */
.tbl tbody td { border-top: 1px solid var(--bd); }
.tbl tbody tr:first-child td { border-top: none; }
/* 鼠标所指行高亮：使用背景变量自动适配深浅主题 */
.tbl tbody tr:hover { background: var(--bg); }
.tbl tbody tr:hover td { border-top-color: var(--bd-2); border-bottom-color: var(--bd-2); }
.tbl tbody tr.clickable { cursor: pointer; }
/* 行勾选后高亮底色（含程序自动勾选），方便查看行信息；同时兼容旧的 .sel 类名 */
.tbl tbody tr.sel,
.tbl tbody tr:has(.row-sel:checked) { background: var(--brand-l); box-shadow: inset 3px 0 0 var(--brand); }
.tbl tbody tr.sel:hover,
.tbl tbody tr:has(.row-sel:checked):hover { background: rgba(37,99,235,.18); }
/* 编辑表（tbl-edit）hover 默认透明，需单独覆盖勾选高亮，否则会被优先级更高的规则盖掉 */
table.tbl-edit tbody tr:has(.row-sel:checked),
table.tbl-edit tbody tr.sel { background: var(--brand-l); box-shadow: inset 3px 0 0 var(--brand); }
.tbl .num { text-align: center; font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.tbl .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.tbl .acts { white-space: nowrap; text-align: center; }
/* R131o：序号勾选列（首列 row-head）横向冻结在最左——所有列表页横向滚动时序号/勾选框始终可见。
   层级：表头(5) > 合计行(4) > 数据行首列(3)；底色跟随行状态（默认卡片底/hover 行底/勾选高亮），避免透出下方列。 */
.tbl th.row-head, .tbl td.row-head { position: sticky; left: 0; }
.tbl th.row-head { z-index: 5; }
.tbl td.row-head { z-index: 3; background: var(--card); }
.tbl tbody tr:hover td.row-head { background: var(--bg); }
.tbl tbody tr.sel td.row-head,
.tbl tbody tr:has(.row-sel:checked) td.row-head { background: var(--brand-l); }
.tbl tfoot td.row-head { z-index: 4; background: var(--bg); }
/* 增行/填充行不冻结（避免空白首列钉在左侧遮挡） */
.tbl tr.inline-add-row td.row-head, .tbl tr.tbl-fill td.row-head { position: static; background: transparent; }
.tbl-empty { padding: 46px 20px; text-align: center; color: var(--tx-3); }
.tbl-empty .big { font-size: 34px; opacity: .3; margin-bottom: 8px; }
.tbl .ctr { text-align: center; }
/* 列表单元格内联日期编辑：融入栏式表格，宽度适配列宽 */
.cell-date {
  width: 100%; max-width: 168px; box-sizing: border-box;
  border: 1px solid var(--bd); border-radius: 5px; background: var(--card); color: var(--tx);
  padding: 5px 7px; font-size: 12.5px; text-align: center; font-family: inherit;
}
.cell-date:hover { border-color: var(--bd-2); }
.cell-date:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37,99,235,.12); outline: none; }
/* 列宽可拖拽调整 */
/* 关键：表格宽度=各列固定宽度之和（max-content），不再用 min-width:100% 把多出的空间
   按列宽比例补给各列。否则拖宽 A 列后浏览器会按比例重新分配其余列，造成「调 A 列 B 列变窄、
   调 B 列 A 列回弹」的联动现象。去掉补位后，每列宽度独立、互不影响、互不回弹。 */
/* 所有可拉伸表格统一 fixed 布局：去掉宽度补位，每列独立、互不影响、互不回弹 */
table.tbl-resizable { table-layout: fixed; width: max-content; }
table.tbl-resizable col { width: auto; }
.tbl th { position: sticky; }
.th-resizer {
  position: absolute; top: 0; right: 0; width: 12px; height: 100%;
  cursor: col-resize; z-index: 5; user-select: none; touch-action: none;
  background: linear-gradient(var(--bd), var(--bd)) center / 2px 62% no-repeat;
}
/* 整列右边缘都给 col-resize 光标，手柄更易抓 */
table.tbl-resizable th { cursor: default; }
table.tbl-resizable th .th-resizer { cursor: col-resize; }
.th-resizer:hover { background: var(--brand); opacity: .4; }
.th-resizer:active { background: var(--brand); opacity: .7; }

/* 表头漏斗筛选图标 */
.th-filter {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; width: 17px; height: 17px; border-radius: 4px;
  font-size: 12px; line-height: 1; color: var(--tx-3); cursor: pointer; user-select: none;
  vertical-align: -2px; transition: .12s;
}
.th-filter:hover { background: var(--brand-l); color: var(--brand); }
.th-filter.on { color: var(--brand); background: var(--brand-l); }

/* 表头漏斗筛选弹出层 */
.hdr-filter-pop {
  display: none; position: fixed; z-index: 1200; top: 0; left: 0;
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 10px 12px; font-size: 13px;
}
body.theme-dark .hdr-filter-pop { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.hdr-filter-pop .hf-title { font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.hdr-filter-pop .hf-opts { max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.hdr-filter-pop .hf-opt { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 6px; cursor: pointer; }
.hdr-filter-pop .hf-opt.hidden { display: none; }   /* 搜索关键字实时过滤：不匹配项隐藏 */
.hdr-filter-pop .hf-opt:hover { background: var(--bg); }
.hdr-filter-pop .hf-total { margin-right: auto; font-size: 12px; color: var(--muted, #64748b); font-variant-numeric: tabular-nums; }
.hdr-filter-pop .hf-range { display: flex; align-items: center; gap: 6px; }
.hdr-filter-pop .hf-range input { flex: 1; min-width: 0; }
.hdr-filter-pop .hf-text { width: 100%; }
.hdr-filter-pop .hf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ===== 考勤月视图表格 ===== */
.att-scroll { overflow-x: auto; }
table.att-tbl { width: auto; min-width: 100%; font-size: 12.5px; }
.att-tbl th, .att-tbl td { text-align: center; padding: 6px 0; min-width: 30px; }
.att-tbl th .d { font-size: 12.5px; font-weight: 600; color: var(--tx); }
.att-tbl th .w { font-size: 10.5px; color: var(--tx-3); font-weight: 400; }
.att-tbl th.we .w { color: var(--warn); }
.att-tbl td { border-right: 1px solid var(--bg); }
.att-tbl td.we { background: var(--bg); }
.att-tbl td.on { background: var(--ok-l); }
.att-tbl td.on .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.att-tbl td.cnt { font-weight: 600; color: var(--tx-2); min-width: 38px; }
.att-tbl th.sticky-l, .att-tbl td.sticky-l {
  position: sticky; left: 0; z-index: 3; background: var(--bg); text-align: left; padding: 6px 12px;
  min-width: 84px; box-shadow: 1px 0 0 var(--bd);
}
.att-tbl td.sticky-name { font-weight: 600; }
.att-tbl thead th.sticky-l { z-index: 4; }
/* Round 31：颜色加深——表头行/姓名列/周末列；法定节假日列（红系）；现场同步「出差+客户」单元格 */
.att-tbl thead th { background: #b9cff2; }
.att-tbl thead th.we { background: #a5c0ec; }
.att-tbl thead th.hol { background: #f1baba; }
.att-tbl thead th.hol .w { color: #b91c1c; font-weight: 600; }
.att-tbl thead th.sticky-l { background: #b0c8ee; }
.att-tbl th.sticky-l, .att-tbl td.sticky-l { background: #e3eaf5; }
.att-tbl thead th.sticky-l { background: #b0c8ee; }
.att-tbl td.we { background: #e2eaf8; }
.att-tbl td.hol { background: #fbe4e4; }
.att-tbl.has-info th, .att-tbl.has-info td { min-width: 76px; }
.att-tbl.has-info th.sticky-l, .att-tbl.has-info td.sticky-l { min-width: 92px; }
.att-tbl.has-info td.on { background: #d3e6fb; }
.att-tbl .att-st { font-size: 12px; font-weight: 600; color: #1d4ed8; line-height: 1.35; }
.att-tbl .att-note { font-size: 10.5px; color: #475569; line-height: 1.3; }
/* 考勤月视图：序号列（勾选框+序号）与勾选高亮 */
.att-tbl th.att-idx-th, .att-tbl td.att-idx { min-width: 48px; width: 48px; padding: 4px 2px; }
.att-ck-lb { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; user-select: none; }
.att-ck-lb input { margin: 0; cursor: pointer; accent-color: #2563eb; }
.att-ck-lb span { font-size: 11.5px; color: var(--tx-3); min-width: 14px; text-align: center; }
.att-tbl tbody tr.hl td { background: #fdeeb3 !important; }
.att-tbl tbody tr.hl td.sticky-l { background: #fae6a6 !important; }
.att-tbl tbody tr.hl td.cnt { color: #92400e; }
/* 人员管理（renderStaffPage）：序号列 + 全表内容居中 */
table.tbl.staff-tbl th, table.tbl.staff-tbl td { text-align: center; }
.staff-tbl td.sf-idx { color: var(--tx-3); font-size: 12.5px; }
.staff-tbl td .inp { text-align: center; }
.staff-tbl td select.inp { text-align: center; text-align-last: center; }

/* ===== 表格批量编辑（账号管理等） ===== */
.inp.xs, select.inp.xs {
  padding: 4.5px 7px; font-size: 12.5px; width: 100%; min-width: 0; border-radius: 5px;
}
table.tbl-edit td { padding: 5px 7px; }
table.tbl-edit th { padding: 8px 7px; }
table.tbl-edit tbody tr:hover { background: transparent; }
table.tbl-edit input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }

/* 表格内编辑输入框：去掉方框格，改成仅行分隔线样式 */
table.tbl td { border-left: none; border-right: none; }
table.tbl-edit .inp,
.tbl .inline-add-row .inp,
.tbl .inline-add-row select,
.tbl .inline-add-row textarea {
  width: 100%; min-width: 0; padding: 7px 10px;
  border: none; border-bottom: 1px solid transparent; border-radius: 0;
  background: transparent; box-shadow: none; outline: none;
  transition: .12s;
}
table.tbl-edit .inp:hover,
.tbl .inline-add-row .inp:hover,
.tbl .inline-add-row select:hover,
.tbl .inline-add-row textarea:hover { border-bottom-color: #cbd5e1; background: rgba(241,245,249,.35); }
table.tbl-edit .inp:focus,
.tbl .inline-add-row .inp:focus,
.tbl .inline-add-row select:focus,
.tbl .inline-add-row textarea:focus { border-bottom-color: var(--brand); background: rgba(239,246,255,.45); box-shadow: none; }

/* 批量新增弹窗表格也统一为栏式 */
.batch-tbl td { border-left: none; border-right: none; }
.batch-tbl .inp,
.batch-tbl select,
.batch-tbl textarea {
  border: none; border-bottom: 1px solid transparent; border-radius: 0;
  background: transparent; box-shadow: none; outline: none;
}
.batch-tbl .inp:hover,
.batch-tbl select:hover,
.batch-tbl textarea:hover { border-bottom-color: #cbd5e1; background: rgba(241,245,249,.35); }
.batch-tbl .inp:focus,
.batch-tbl select:focus,
.batch-tbl textarea:focus { border-bottom-color: var(--brand); background: rgba(239,246,255,.45); box-shadow: none; }

/* 新增行 / 已改行 / 已改单元格 的视觉标记 */
tr.row-new > td { background: var(--ok-l); }
tr.row-new > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.row-chg > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
td.cell-chg { background: var(--warn-l); }
td.cell-chg .inp { border-color: var(--warn); }
.badge-new {
  display: inline-block; padding: 1.5px 7px; border-radius: 20px; font-size: 11px;
  background: var(--ok); color: #fff; white-space: nowrap;
}
.warn-tx { color: #b45309; }

/* 批量操作条 */
.batchbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 9px 15px; background: var(--brand-l); border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd); font-size: 13px;
}
.batchbar b { color: var(--brand); white-space: nowrap; }
.batchbar .inp.xs { width: auto; min-width: 124px; }

/* 跨班组添加人员：候选清单 */
.join-list {
  max-height: 340px; overflow-y: auto; border: 1px solid var(--bd);
  border-radius: var(--r-s); padding: 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px;
}
.join-item {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.join-item:hover { background: var(--brand-l); }
.join-item input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.join-item .muted { margin-left: auto; font-size: 11.5px; }
.col-mv { display: inline-flex; gap: 2px; }
.col-mv .btn { min-width: 24px; padding: 1px 6px; font-size: 12px; line-height: 1.5; }

/* ===== 列管理：统一字段清单 ===== */
.col-set-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.col-set-bar .col-search { flex: 1; min-width: 0; }
.col-set-bar .col-only { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: var(--tx-2); cursor: pointer; }
.col-set-bar .col-only input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.col-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--bd); border-radius: var(--r-s); background: var(--card); padding: 4px; }
.col-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-bottom: 1px solid var(--bd); cursor: move; }
.col-no { flex: 0 0 24px; text-align: right; color: var(--tx-3); font-size: 12px; font-variant-numeric: tabular-nums; user-select: none; }
/* subbar 内右侧按钮组：靠右对齐（现场管理详情等 subbar 无 card-h 上下文，.right 默认不右浮） */
.subbar .right { margin-left: auto; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.col-row:last-child { border-bottom: 0; }
.col-row.off { opacity: .55; }
.col-row.dragging { opacity: .35; background: var(--brand-l); }
.col-row.over { background: var(--brand-l); border: 1px dashed var(--brand); }
.col-drag { color: var(--tx-3); cursor: grab; user-select: none; font-size: 13px; letter-spacing: -1px; }
.col-row.dragging .col-drag { cursor: grabbing; }
.col-sh { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: var(--tx-2); }
.col-sh input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.col-name { flex: 1; min-width: 0; }
.col-mv { display: inline-flex; gap: 2px; }
.col-mv .btn { min-width: 24px; padding: 1px 6px; font-size: 12px; line-height: 1.5; }


/* ===== 报工：作业人员勾选器 ===== */
.wk-count { float: right; font-weight: 400; color: var(--tx-2); font-size: 12px; }
.wk-count b { color: var(--brand); }
.wk-bar { display: flex; gap: 6px; margin-bottom: 7px; }
.wk-bar .inp.xs { flex: 1; min-width: 0; }
.wk-list {
  max-height: 210px; overflow-y: auto; border: 1px solid var(--bd);
  border-radius: var(--r-s); padding: 6px; background: var(--card);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 4px;
}
.wk-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  font-size: 13px; user-select: none; transition: all .15s;
}
.wk-item:hover { background: var(--brand-l); }
.wk-item.on { background: var(--brand-l); border-color: var(--brand); font-weight: 600; }
.wk-item input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex: none; }
.wk-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-item .wk-lead {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 400;
  background: var(--purple, #7c3aed); color: #fff; padding: 1px 5px; border-radius: 8px; flex: none;
}
.mt6 { margin-top: 6px; }
/* 质量检验完工照片：列表缩略图 + 弹窗上传组件 */
.qc-thumb {
  width: 34px; height: 34px; object-fit: cover; border-radius: 5px;
  border: 1px solid var(--bd); cursor: zoom-in; vertical-align: middle; margin-right: 3px;
}
.qc-thumb:hover { border-color: var(--brand); }
.ph-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ph-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-list:empty { display: none; }
/* 照片栏框：点击添加 / Ctrl+V 粘贴 / 拖拽图片入框 */
.ph-drop {
  border: 1.5px dashed var(--bd); border-radius: 8px; padding: 10px 12px;
  min-height: 64px; background: var(--bg-soft, #fafbfc); transition: border-color .15s, background .15s;
}
.ph-drop:focus-visible, .ph-drop.dragover { border-color: var(--brand); background: #eef4ff; }
.ph-drop.dragover { border-style: solid; }
.ph-item { position: relative; display: inline-block; }
.ph-item img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--bd); cursor: zoom-in; display: block;
}
.ph-item .ph-del {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; line-height: 16px;
  text-align: center; border-radius: 50%; background: #ef4444; color: #fff;
  font-size: 13px; cursor: pointer; display: none; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.ph-item:hover .ph-del { display: block; }
/* 计划发货日期预警：逾期=粉底红字 / 当日=黄底红字 / 次日=蓝底红字 */
.ship-warn {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  color: #e02020; font-weight: 600; white-space: nowrap;
}
.ship-warn.sw-late { background: #ffd9e2; }
.ship-warn.sw-today { background: #ffe58f; }
.ship-warn.sw-tmr { background: #d4e7ff; }
/* 任务列表上方：待完工总数 / 今日完工总数 / 今日在岗人员 */
.duty-bar { margin-bottom: 10px; }
.duty-bar .kpi { padding: 6px 10px; }
.duty-bar .kpi .val { font-size: 20px; line-height: 1.15; margin-top: 1px; }
.duty-bar .kpi .ext { min-height: auto; margin-top: 1px; font-size: 11.5px; }
.duty-bar .kpi .ext .btn { float: right; margin-top: -2px; }
@media (max-width: 640px) {
  .wk-list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 190px; }
}

.pager {
  display: flex; align-items: center; gap: 5px; padding: 1px 10px;
  border-top: 1px solid var(--bd); font-size: 11px; color: var(--tx-2); flex-wrap: wrap;
  /* 钉底双保险：即使整页出现滚动，分页栏也始终贴着视口底部，不被滚出显示器 */
  position: sticky; bottom: 0; background: var(--card); z-index: 4;
}
.pager .pgs { margin-left: auto; display: flex; gap: 3px; align-items: center; }
.pager button {
  min-width: 20px; height: 19px; border: 1px solid var(--bd); background: var(--card);
  border-radius: var(--r-s); cursor: pointer; padding: 0 4px; font-size: 11px; line-height: 1;
}
/* 每页条数下拉：与按钮同高，压低底栏总高度，给表格多让出一行空间 */
.pager select.inp { width: auto; height: 19px; padding: 1px 4px; font-size: 11px; }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 12px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; line-height: 1.55;
  background: var(--bg); color: var(--tx-2); border: 1px solid transparent;
}
.tag.blue { background: var(--brand-l); color: var(--brand-d); }
.tag.green { background: var(--ok-l); color: #047857; }
.tag.orange { background: var(--warn-l); color: #b45309; }
.tag.red { background: var(--danger-l); color: #b91c1c; }
.tag.cyan { background: #cffafe; color: #0e7490; }
.tag.purple { background: #ede9fe; color: #6d28d9; }
.tag.pink { background: #fce7f3; color: #be185d; }
.tag.gray { background: var(--bg); color: var(--tx-2); }
.tag.dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.mini-up { padding: 1px 7px; font-size: 11px; margin: 1px 2px 1px 0; }

/* 工序任务列表：前序工序「每工序一列」状态区（二级工序直接显示） */
.tbl th.up-col, .tbl td.up-col { border-left: 1px dashed var(--bd); }
.tbl th.up-col { font-size: 11px; font-weight: 600; color: var(--tx-2); background: var(--brand-l); }
.tbl td.up-col { background: var(--bg); }
.up-col .tag { font-size: 11px; padding: 1px 7px; }

/* 进度条 */
.prog { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; min-width: 56px; }
.prog i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s; }
.prog i.ok { background: var(--ok); } .prog i.warn { background: var(--warn); } .prog i.danger { background: var(--danger); }
.prog-txt { display: flex; align-items: center; gap: 7px; }
.prog-txt span { font-size: 11.5px; color: var(--tx-2); min-width: 30px; font-variant-numeric: tabular-nums; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
  overflow-y: auto; backdrop-filter: blur(2px);
}
.modal {
  background: var(--card); border-radius: 12px; width: 100%; max-width: 620px;
  box-shadow: var(--sd-l); animation: pop .18s ease-out;
}
.modal.lg { max-width: 900px; } .modal.xl { max-width: 1140px; } .modal.sm { max-width: 420px; }
.modal.md { max-width: 620px; }
.modal.xxl { max-width: 1500px; }
.modal.full { width: calc(100vw / var(--app-zs, 1)); height: var(--app-vh, 100vh); max-width: none; border-radius: 0; display: flex; flex-direction: column; }
/* 全屏弹窗遮罩：清掉默认内边距，弹窗真实铺满显示器 */
.mask.mask-full { padding: 0; align-items: stretch; }
.modal.full .modal-b { flex: 1; display: flex; flex-direction: column; max-height: none; overflow: hidden; padding: 18px 22px; }
.modal.full .batch-table-wrap { flex: 1; max-height: none; overflow: auto; min-height: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
.modal-h {
  padding: 14px 18px; border-bottom: 1px solid var(--bd); display: flex;
  align-items: center; gap: 10px;
}
.modal-h h3 { font-size: 15px; font-weight: 600; }
.modal-h .x {
  margin-left: auto; cursor: pointer; color: var(--tx-3); font-size: 21px;
  line-height: 1; padding: 0 4px; background: none; border: none;
}
.modal-h .x:hover { color: var(--danger); }
.modal-b { padding: 18px; max-height: calc(var(--app-vh, 100vh) - 220px); overflow-y: auto; }
.modal-f {
  padding: 12px 18px; border-top: 1px solid var(--bd); display: flex;
  justify-content: flex-end; gap: 9px; background: var(--bg); border-radius: 0 0 12px 12px;
}
/* R128 弹窗标题栏可拖动：按住标题栏移动窗口位置 */
.modal.draggable .modal-h { cursor: move; user-select: none; }
.modal.draggable .modal-h h3 { cursor: move; }
body.wb-modal-dragging, body.wb-modal-dragging * { cursor: move !important; user-select: none !important; }

/* 图表 */
.chart { width: 100%; height: 280px; }
.chart.sm { height: 220px; } .chart.lg { height: 360px; }

/* 看板 */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 250px; flex: 1; background: var(--bg); border-radius: var(--r); border: 1px solid var(--bd); }
.kanban-col > h4 {
  padding: 10px 13px; font-size: 13px; border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; gap: 7px;
}
.kanban-col > h4 .n {
  margin-left: auto; background: var(--card); border: 1px solid var(--bd); padding: 0 7px;
  border-radius: 10px; font-size: 11px; color: var(--tx-2);
}
.kanban-body { padding: 9px; display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.k-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: var(--r-s);
  padding: 10px 11px; cursor: pointer; transition: .14s; border-left: 3px solid var(--brand);
}
.k-card:hover { box-shadow: var(--sd); transform: translateX(1px); }
.k-card.urgent { border-left-color: var(--danger); }
.k-card.warn { border-left-color: var(--warn); }
.k-card.done { border-left-color: var(--ok); opacity: .85; }
.k-card .t { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.k-card .m { font-size: 11.5px; color: var(--tx-3); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: var(--bd); }
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--bd-2);
}
.tl-item.done::before { background: var(--ok); border-color: var(--ok); }
.tl-item.doing::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.tl-item.rework::before { background: var(--danger); border-color: var(--danger); }
.tl-item .th { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; flex-wrap: wrap; }
.tl-item .td { font-size: 12px; color: var(--tx-2); margin-top: 3px; line-height: 1.7; }

/* 描述列表 */
.desc { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--bd); border: 1px solid var(--bd); border-radius: var(--r-s); overflow: hidden; }
.desc > div { background: var(--card); padding: 9px 12px; }
.desc dt { font-size: 11.5px; color: var(--tx-3); margin-bottom: 2px; }
.desc dd { font-size: 13px; font-weight: 500; word-break: break-all; }

/* 提醒抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; background: var(--card);
  z-index: 210; box-shadow: -6px 0 30px rgba(15,23,42,.16); display: flex; flex-direction: column;
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(100%); } }
.drawer-h { padding: 14px 16px; border-bottom: 1px solid var(--bd); display: flex; align-items: center; gap: 10px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 10px; }
.noti {
  padding: 10px 12px; border: 1px solid var(--bd); border-radius: var(--r-s);
  margin-bottom: 8px; border-left: 3px solid var(--tx-3); background: var(--card); cursor: pointer;
}
.noti:hover { background: var(--bg); }
.noti.unread { background: var(--brand-l); border-left-color: var(--brand); }
.noti.紧急 { border-left-color: var(--danger); }
.noti.重要 { border-left-color: var(--warn); }
.noti .t { font-weight: 600; font-size: 12.8px; margin-bottom: 3px; }
.noti .c { font-size: 12px; color: var(--tx-2); line-height: 1.55; }
.noti .m { font-size: 11px; color: var(--tx-3); margin-top: 5px; display: flex; gap: 8px; }

/* 权限矩阵 */
.perm-tbl { width: auto; border-collapse: collapse; font-size: 12.5px; }
.perm-tbl th, .perm-tbl td { border: 1px solid var(--bd); padding: 7px 9px; text-align: center; }
.perm-tbl th:first-child, .perm-tbl td:first-child { text-align: left; white-space: nowrap; background: var(--bg); font-weight: 500; }
.perm-tbl thead th { background: var(--bg); }
.perm-tbl input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
/* 角色权限编辑态：权限点切换小块 + 角色名输入框 */
.perm-t { display: inline-block; min-width: 20px; margin: 0 2px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--bd); background: var(--bg); color: var(--muted); font-size: 12px;
  cursor: pointer; user-select: none; line-height: 18px; transition: all .12s; }
.perm-t:hover { border-color: var(--brand); color: var(--brand); }
.perm-t.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.perm-self { display: inline-block; min-width: 20px; margin-left: 4px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--bd); background: var(--bg); color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; line-height: 18px; transition: all .12s; }
.perm-self:hover { border-color: #e0a500; color: #e0a500; }
.perm-self.on { background: #e0a500; border-color: #e0a500; color: #fff; font-weight: 600; }
.role-name-inp { min-width: 90px; text-align: center; }

/* 提示条 */
.alert {
  padding: 10px 13px; border-radius: var(--r-s); font-size: 13px; display: block;
  margin-bottom: 13px; line-height: 1.6;
}
.alert.info { background: var(--brand-l); color: #1e40af; }
.alert.warn { background: var(--warn-l); color: #92400e; }
.alert.danger { background: var(--danger-l); color: #991b1b; }
.alert.ok { background: var(--ok-l); color: #065f46; }

/* Toast */
#toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 18px; border-radius: 20px; color: #fff; font-size: 13px;
  box-shadow: var(--sd-l); animation: pop .16s; background: var(--tx);
}
.toast.ok { background: var(--ok); } .toast.err { background: var(--danger); } .toast.warn { background: var(--warn); }

.loading { padding: 50px; text-align: center; color: var(--tx-3); }
.spin {
  width: 26px; height: 26px; border: 2.5px solid var(--bd); border-top-color: var(--brand);
  border-radius: 50%; animation: sp .7s linear infinite; margin: 0 auto 10px;
}
@keyframes sp { to { transform: rotate(360deg); } }

.mini-bar { display: flex; align-items: center; gap: 7px; }
.mini-bar .bar { flex: 1; height: 15px; background: var(--brand-l); border-radius: 3px; position: relative; min-width: 34px; }
.mini-bar .bar i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 3px; }
.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rank-item .no {
  width: 20px; height: 20px; border-radius: 4px; background: var(--bg); color: var(--tx-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.rank-item:nth-child(1) .no { background: var(--warn-l); color: var(--warn); }
.rank-item:nth-child(2) .no { background: var(--bg); color: var(--tx-2); }
.rank-item:nth-child(3) .no { background: var(--warn-l); color: var(--warn); }
.rank-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .vl { font-weight: 600; font-variant-numeric: tabular-nums; }

.hint { font-size: 11.5px; color: var(--tx-3); margin-top: 4px; }
.split { display: flex; gap: 14px; align-items: flex-start; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mb10 { margin-bottom: 10px; }
.muted { color: var(--tx-3); } .strong { font-weight: 600; }
.txt-r { text-align: right; } .txt-c { text-align: center; }
.hide { display: none !important; }

/* 子页签：台账 / 数据分析 */
.subbar { display: flex; align-items: center; gap: 10px; padding: 12px 15px 12px; flex-wrap: wrap; }
.subtabs { display: inline-flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 9px; }
.subtabs button {
  border: none; background: none; padding: 6px 16px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--tx-2); font-weight: 500; transition: .14s;
}
.subtabs button:hover { color: var(--brand); }
.subtabs button.on { background: var(--card); color: var(--brand); box-shadow: var(--sd); }
.subtabs button .ic { margin-right: 5px; }
/* R82：列表子页签计数徽标（已发货/未发货订单数） */
.subtabs button .badge {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px; border-radius: 10px;
  background: var(--bg); color: var(--tx-2); font-size: 11px; font-weight: 600; line-height: 16px; text-align: center;
}
.subtabs button.on .badge { background: var(--brand); color: #fff; }
/* 产品类型二级页签（如生产订单按类型拆分的任务列表） */
.subtabs.type-tabs button { padding: 5px 12px; font-size: 12.5px; }
/* 列表首列：勾选框 + 序号 */
.tbl th.row-head, .tbl td.row-head { width: 72px; min-width: 72px; text-align: center; white-space: nowrap; user-select: none; }
.tbl td.row-head { color: var(--tx-2); font-size: 12.5px; }
.row-sel-label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; margin: 0; }
.row-sel-label input[type="checkbox"] { cursor: pointer; }
.row-no { display: inline-block; min-width: 18px; text-align: right; }
.tile { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sd); }
.tile h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.tile .big { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.tile .sub { font-size: 12px; color: var(--tx-3); margin-top: 2px; }

/* ---------- 响应式：手机端 ---------- */
@media (max-width: 1200px) {
  .g6 { grid-template-columns: repeat(3, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--sd-l); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .content { padding: 12px 11px 70px; }
  .g2, .g3, .g4, .g5, .g6, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .desc { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 11px; gap: 8px; }
  .topbar h2 { font-size: 15px; }
  .topbar .crumb { display: none; }
  .user-chip .nm, .user-chip .rl { display: none; }
  .user-chip { padding: 3px; border: none; }
  .modal-b { max-height: calc(var(--app-vh, 100vh) - 170px); }
  .mask { padding: 12px 10px; }
  .drawer { width: 100%; }
  .kpi .val { font-size: 21px; }
  .filters { padding: 9px 11px; }
  .filters .inp, .filters .search { min-width: 0; flex: 1 1 130px; }
  .chart { height: 240px; }
  .card-h { padding: 10px 12px; }
  .card-b { padding: 12px; }
  /* 手机端表格：横向滚动 + 收窄 */
  .tbl th, .tbl td { padding: 7px 9px; font-size: 12.5px; }
  .mobile-hide { display: none !important; }
  .backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; }
  /* 手机端清除「导航收起态」残留：主内容不留白（侧边栏已移出屏幕）；抽屉打开时恢复完整宽度与文字 */
  .nav-collapsed .main { margin-left: 0; }
  .nav-collapsed .sidebar { width: var(--side-w); }
  .nav-collapsed .logo { justify-content: flex-start; padding: 0 16px; }
  .nav-collapsed .logo b, .nav-collapsed .logo small { display: block; }
  .nav-collapsed .nav-item { justify-content: flex-start; padding: 9px 11px; }
  .nav-collapsed .nav-item span:not(.ico):not(.badge):not(.nav-arrow) { display: inline; }
  .nav-collapsed .nav-arrow { display: inline-block; }
  .nav-collapsed .nav-sub.open { display: block; margin: 2px 0 4px 18px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); }
  .nav-collapsed .side-foot { padding: 10px 14px; justify-content: space-between; }
  .nav-collapsed .side-foot .foot-tx { display: inline; }
  .nav-collapsed .side-theme { justify-content: space-between; padding: 8px 14px; }
  .nav-collapsed .side-theme .st-lbl, .nav-collapsed .side-theme .st-seg { display: inline-flex; }
  .nav-collapsed .side-theme .st-lbl { font-size: 12px; }
}
@media (max-width: 560px) {
  .desc { grid-template-columns: 1fr; }
  .g2.keep2, .g4.keep2 { grid-template-columns: 1fr 1fr; }
}
@media print {
  .sidebar, .topbar, .filters, .pager, .btn { display: none !important; }
  .main { margin: 0; } .content { padding: 0; }
}

/* 工艺路线编辑 */
.bar { display: flex; align-items: center; gap: 8px; }
.bar .right { margin-left: auto; }
.route-tbl td, .route-tbl th { padding: 6px 8px; vertical-align: middle; }
.route-tbl .step-sel, .route-tbl .role-sel { min-width: 110px; }

/* ---------- 深色模式补充覆盖：修正少量无法直接用变量替换的硬编码浅色/强调色 ---------- */
body.theme-dark table.tbl-edit .inp:hover,
body.theme-dark .tbl .inline-add-row .inp:hover,
body.theme-dark .tbl .inline-add-row select:hover,
body.theme-dark .tbl .inline-add-row textarea:hover,
body.theme-dark .batch-tbl .inp:hover,
body.theme-dark .batch-tbl select:hover,
body.theme-dark .batch-tbl textarea:hover { border-bottom-color: var(--bd-2); background: rgba(255,255,255,.05); }

body.theme-dark table.tbl-edit .inp:focus,
body.theme-dark .tbl .inline-add-row .inp:focus,
body.theme-dark .tbl .inline-add-row select:focus,
body.theme-dark .tbl .inline-add-row textarea:focus,
body.theme-dark .batch-tbl .inp:focus,
body.theme-dark .batch-tbl select:focus,
body.theme-dark .batch-tbl textarea:focus { background: rgba(37,99,235,.12); }

body.theme-dark .tag.blue { color: #60a5fa; }
body.theme-dark .tag.green { color: #34d399; }
body.theme-dark .tag.orange { color: #fbbf24; }
body.theme-dark .tag.red { color: #f87171; }
body.theme-dark .tag.cyan { color: #22d3ee; }
body.theme-dark .tag.purple { color: #a78bfa; }
body.theme-dark .tag.pink { color: #f472b6; }

body.theme-dark .alert.info { color: #93c5fd; }
body.theme-dark .alert.warn { color: #fcd34d; }
body.theme-dark .alert.danger { color: #fca5a5; }
body.theme-dark .alert.ok { color: #6ee7b7; }
body.theme-dark .warn-tx { color: #fbbf24; }

/* 表单多选勾选组（如售后-责任部门） */
.form-grid .checks { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 6px 0 2px; }
.form-grid .chk-item { display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid var(--bd); border-radius: 999px; padding: 3px 11px 3px 8px; font-size: 12.5px;
  background: var(--card, #fff); user-select: none; line-height: 1.5; }
.form-grid .chk-item:hover { border-color: var(--brand); }
.form-grid .chk-item input { accent-color: var(--brand); margin: 0; cursor: pointer; }
.form-grid .chk-item:has(input:checked) { background: var(--brand-l, #eff6ff); border-color: var(--brand); color: var(--brand-d, #1d4ed8); font-weight: 600; }

/* 管线包组装「全部」列表内联编辑控件（机器人品牌/型号/功能应用/管线包尺寸/管线包形式） */
.cell-edit { width: 100%; box-sizing: border-box; padding: 2px 5px; font-size: 12px; line-height: 1.5;
  border: 1px solid var(--bd, #e5e7eb); border-radius: 4px; background: #fff; color: var(--text, #1f2937); }
.cell-edit:hover { border-color: var(--brand, #2563eb); }
.cell-edit:focus { outline: none; border-color: var(--brand, #2563eb); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
td .cell-edit { min-width: 70px; }

/* ==================== 现场管理：单个现场总览卡片 ==================== */
.sov-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
@media (max-width: 1500px) { .sov-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 950px) { .sov-wrap { grid-template-columns: 1fr; } }
.sov-card { cursor: pointer; border: 1.5px solid var(--brand); border-radius: 10px; padding: 16px 18px 16px;
  transition: box-shadow .15s, transform .15s; }
.sov-card:hover { box-shadow: 0 6px 18px rgba(37, 99, 235, .18); transform: translateY(-2px); }
/* 顶部：客户名称(蓝) 左 + 现场作业地址 右 */
.sov-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px dashed var(--bd); }
.sov-cust { font-size: 16px; font-weight: 700; color: var(--brand); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.sov-addr { font-size: 12px; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 0 1 auto; text-align: right; }
/* 字段网格：固定行高，每张卡片行数与行高完全一致 → 卡片等高；行间距加大且均匀 */
.sov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 16px;
  grid-auto-rows: minmax(38px, auto); align-items: center; }
.sov-it { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; min-width: 0; line-height: 1.4; }
.sov-it.sov-span2 { grid-column: span 2; }
.sov-cell { min-width: 0; }
.sov-l { color: var(--tx); white-space: nowrap; flex: 0 0 auto; }
.sov-v { font-weight: 600; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 指定配色：昨日/累计=绿 / 今日预计/预计完工日期=黄 / 剩余未完工/未闭环=红 / 异常工单=蓝 */
.sov-v.sov-c-green { color: var(--ok); }
.sov-v.sov-c-red { color: var(--danger); }
.sov-v.sov-c-yellow { color: var(--warn); }
.sov-v.sov-c-blue { color: var(--brand); }
.sov-days { justify-self: center; border: 2px solid var(--danger); color: var(--tx);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sov-days b { font-size: 15px; margin: 0 2px; color: var(--danger); }
.sov-detail-title { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; font-size: 14px; }
.site-tip { margin-top: 10px; font-size: 12px; color: var(--tx-3); background: var(--brand-l);
  border-radius: 6px; padding: 8px 12px; }
/* R90：销售申请单头表单（现场作业申请弹窗顶部） */
.apply-head { border: 1px solid var(--bd, #e3e8ef); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; background: #fafbfc; }
.apply-head .ah-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.apply-head .ah-row > label { width: 84px; flex: 0 0 auto; color: #444; font-size: 13px; text-align: right; }
.apply-head .ah-row > label .req, .apply-head .req { color: #e23; margin-left: 2px; }
/* R142：必填项缺失高亮（确认提交前校验未过） */
.req-miss { border: 2px solid #e23 !important; background: #fffafa !important; box-shadow: 0 0 0 2px rgba(226,51,51,.12); }
.apply-head .req-miss { border: 2px solid #e23 !important; border-radius: 6px; padding: 6px; background: #fffafa !important; }
.apply-head .inp { flex: 1 1 150px; min-width: 140px; }
.apply-head .ah-flex { align-items: flex-start; }
.apply-head .ah-block { flex: 1 1 220px; }
.apply-head .ah-block > label { display: block; color: #444; font-size: 13px; margin-bottom: 4px; }
.apply-head .ah-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.apply-head .ah-checks .ck { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.apply-head select.inp { flex: 0 1 120px; }
/* R110：手机端弹窗布局调整——作业名义收窄、作业总数量加宽、作业地址 textarea 自适应高度 */
.apply-head select.inp.ah-jt { flex: 0 1 96px; min-width: 84px; }
.apply-head .inp.ah-qty { flex: 0 1 220px; min-width: 150px; }
.apply-head .inp.ah-date { flex: 0 1 150px; min-width: 130px; }
.apply-head textarea.inp { resize: none; line-height: 1.5; }
.apply-head .ah-block.ms-box { border: 1px solid var(--bd, #e3e8ef); border-radius: 8px; padding: 8px 10px; background: #fff; margin-bottom: 8px; }
.apply-head .ah-row > label, .apply-head .ah-block > label { font-weight: 600; }
/* R110：手机端（≤640px）申请弹窗布局——字段纵向堆叠、作业地址自适应、作业名义/时间要求保持一行 */
@media (max-width: 640px) {
  .apply-head .ah-row { gap: 7px 10px; }
  .apply-head .ah-row > label { width: auto; text-align: left; }
  .apply-head .ah-row:not(.ah-jobtitle):not(.ah-timereq):not(.ah-flex):not(.ah-people) { flex-direction: column; align-items: stretch; }
  .apply-head .ah-row:not(.ah-jobtitle):not(.ah-timereq):not(.ah-flex):not(.ah-people) > label { width: auto; text-align: left; }
  .apply-head .ah-row:not(.ah-jobtitle):not(.ah-timereq):not(.ah-flex):not(.ah-people) .inp,
  .apply-head .ah-row:not(.ah-jobtitle):not(.ah-timereq):not(.ah-flex):not(.ah-people) textarea.inp { width: 100%; flex: 1 1 auto; min-width: 0; }
  /* R120：手机端「销售 / 助理 / 技术人员」三字段横排并列——三列网格，标签在上、输入框在下（与其它字段样式一致） */
  .apply-head .ah-row.ah-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; align-items: center; }
  .apply-head .ah-row.ah-people > label { width: auto; flex: none; text-align: left; white-space: nowrap; }
  .apply-head .ah-row.ah-people > label:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .apply-head .ah-row.ah-people > .inp[data-ah="sales"] { grid-column: 1; grid-row: 2; }
  .apply-head .ah-row.ah-people > label:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .apply-head .ah-row.ah-people > .inp[data-ah="assistant"] { grid-column: 2; grid-row: 2; }
  .apply-head .ah-row.ah-people > label:nth-of-type(3) { grid-column: 3; grid-row: 1; }
  .apply-head .ah-row.ah-people > .inp[data-ah="technician"] { grid-column: 3; grid-row: 2; }
  .apply-head .ah-row.ah-people .inp { width: 100%; min-width: 0; flex: none; padding-left: 6px; padding-right: 6px; }
  .apply-head .ah-row.ah-flex { flex-direction: column; align-items: stretch; }
  .apply-head .ah-row.ah-flex > label { width: auto; text-align: left; }
  .apply-head .ah-row.ah-flex .ah-block { flex: 1 1 auto; }
  .apply-head .ah-row.ah-flex .ah-qty { width: 100%; flex: 1 1 auto; }
  .apply-head .ah-row.ah-jobtitle, .apply-head .ah-row.ah-timereq { flex-wrap: nowrap; gap: 8px; }
  .apply-head .ah-jobtitle > label, .apply-head .ah-timereq > label { width: auto; white-space: nowrap; }
  .apply-head .ah-jobtitle .inp[data-ah="job_title_other"] { flex: 1 1 120px; min-width: 80px; }
  .apply-head textarea.inp { min-height: 60px; }
}
tr.lg-done td { color: var(--tx-3); }

/* ==================== 现场管理：顶部 5 个总览 KPI 一横排（宽度平均） ==================== */
.sov-kpi5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
@media (max-width: 1100px) {
  .sov-kpi5 .kpi { padding: 10px 12px; }
  .sov-kpi5 .kpi .lbl { font-size: 11px; }
  .sov-kpi5 .kpi .val { font-size: 21px; }
}

/* ==================== 现场管理：今日现场在岗人员 增减管理弹窗 ==================== */
.sw-edit { display: flex; flex-direction: column; gap: 12px; }
.sw-summary { font-size: 13px; color: var(--tx-2); background: var(--brand-l);
  border-radius: 6px; padding: 9px 12px; }
.sw-summary b { color: var(--brand); font-size: 15px; }
.sw-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  max-height: 56vh; overflow: auto; padding: 2px; }
.sw-site { border: 1px solid var(--bd); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.sw-site-h { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding-bottom: 7px; margin-bottom: 7px; border-bottom: 1px dashed var(--bd-2); }
.sw-site-name { font-weight: 700; font-size: 13.5px; color: var(--tx); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.sw-site-cnt { flex: 0 0 auto; font-size: 12px; color: var(--tx-2);
  background: var(--brand-l); border-radius: 999px; padding: 2px 9px; }
.sw-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 8px; }
.sw-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
  border: 1px solid var(--bd-2); border-radius: 6px; padding: 4px 9px; cursor: pointer;
  user-select: none; transition: .12s; background: #fff; }
.sw-item.on { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, #fff); }
.sw-item.off { border-color: var(--bd-2); background: var(--bg); color: var(--tx-3);
  text-decoration: line-through; opacity: .7; }
.sw-item input { accent-color: var(--ok); margin: 0; }
.sw-add { display: flex; gap: 7px; margin-top: 9px; }
.sw-add .inp { flex: 1; }
.sw-tip { font-size: 12px; color: var(--tx-3); }
@media (max-width: 700px) { .sw-wrap { grid-template-columns: 1fr; max-height: 60vh; } }

/* ==================== 现场管理列表（按套分行） ==================== */
.su-summary { font-size: 13px; color: var(--tx-2); background: var(--brand-l);
  border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.su-summary b { color: var(--brand); font-size: 15px; }
.su-summary .su-g { color: var(--ok); }
.su-summary .su-r { color: var(--danger); }
.su-wrap { overflow-x: scroll; overflow-y: auto; border: 1px solid var(--bd); border-radius: 8px;
  /* 滚动区高度由 flex 布局撑满（.su-detail-card 内 flex:1）：横向滚动条恒钉在滚动区底边（容器边框处）
     始终可见、紧贴显示器下缘，不必滚到表格底部；overflow-x 用 scroll 让滚动条轨道恒渲染 */
  min-height: 220px; }
/* 现场管理详情卡片：同任务列表（list-card）撑满内容区高度，表格滚动区占满剩余高度，
   顶栏/摘要/保存栏/提示行固定不压缩，底边（合计行+横向滚动条）贴合显示器下缘恒可见 */
.su-detail-card .subbar, .su-detail-card .su-summary,
.su-detail-card .inline-save-bar, .su-detail-card .site-tip { flex-shrink: 0; }
.su-detail-card .su-wrap { flex: 1 1 auto; min-height: 220px; }
.su-tbl { min-width: 3000px; border-collapse: collapse; }
.su-tbl th, .su-tbl td { padding: 7px 9px; vertical-align: middle; white-space: nowrap; font-size: 12.5px; }
.su-tbl thead th { position: sticky; top: 0; background: var(--bg); z-index: 2; }
.su-tbl .su-idx { position: sticky; left: 0; background: var(--bg); z-index: 3; text-align: center;
  min-width: 48px; box-shadow: 1px 0 0 var(--bd); }
.su-tbl thead .su-idx { z-index: 4; }
.su-tbl .acts { position: sticky; right: 0; background: var(--bg); z-index: 3; }
.su-tbl thead .acts { z-index: 4; }
.su-tbl .su-unit { background: color-mix(in srgb, var(--brand) 4%, #fff); font-weight: 600; color: var(--brand-d); }
/* R131p：列表内直接编辑控件在 .su-unit 着色列 / 行高亮 / 已转入底色上不再露出白块——背景透出单元格底色 */
.su-tbl .cell-edit { background: transparent; border-color: var(--bd, #e5e7eb); }
.su-tbl .cell-edit:hover { border-color: var(--brand, #2563eb); }
.su-tbl .cell-edit:focus { outline: none; border-color: var(--brand, #2563eb); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.su-tbl .su-done td { background: color-mix(in srgb, var(--ok) 8%, #fff); }
.su-tbl .su-done .su-idx, .su-tbl .su-done .acts { background: color-mix(in srgb, var(--ok) 12%, #fff); }
.su-tbl tr:hover td { background: var(--brand-l); }
.su-tbl tr:hover .su-idx, .su-tbl tr:hover .acts { background: var(--brand-l); }
.su-tbl tr.su-done:hover td { background: color-mix(in srgb, var(--ok) 14%, #fff); }
/* 序号勾选：勾选行高亮（含已转入行的底色覆盖），吸底合计行随横向滚动与数据列对齐 */
.su-tbl tr:has(.su-sel:checked) td { background: color-mix(in srgb, var(--brand) 12%, #fff); }
.su-tbl tr:has(.su-sel:checked) .su-idx, .su-tbl tr:has(.su-sel:checked) .acts { background: color-mix(in srgb, var(--brand) 16%, #fff); }
.su-tbl tr:has(.su-sel:checked):hover td { background: color-mix(in srgb, var(--brand) 18%, #fff); }
.su-tbl .row-sel-label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.su-tbl .row-sel-label input { accent-color: var(--brand); margin: 0; }
.su-selinfo { color: var(--brand); }
.su-selinfo b { color: var(--brand); font-size: 15px; }
/* R50：合计行已并入 .su-tbl 的 tfoot，此处只需保证吸底行不透明盖住滚动内容 */
.su-tbl tfoot.sum-row td { background: #fdf3e3; }

/* ==================== 安装工单：打印预览 ==================== */
#printArea { max-height: 62vh; overflow: auto; padding: 4px 2px; }
.print-note { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.print-order { border: 1px solid #333; border-radius: 6px; margin-bottom: 14px; overflow: hidden; }
.print-order-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 12px; background: #eef2ff; border-bottom: 1px solid #333; }
.po-cust { font-size: 16px; font-weight: 700; }
.po-meta { font-size: 12px; color: #444; }
.print-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-tbl td { border: 1px solid #ccc; padding: 4px 8px; vertical-align: top; }
.print-tbl .pl { width: 22%; background: #f6f7f9; font-weight: 600; white-space: nowrap; }
.print-tbl .pv { color: #111; }

/* ==================== 手机端适配（≤700px，电脑端不受影响） ==================== */
@media (max-width: 700px) {
  /* 页签（模块页签/分类页签）：横滑不折行，杜绝文字竖排 */
  .subbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 9px 10px; gap: 8px; scrollbar-width: none; }
  .subbar::-webkit-scrollbar { display: none; }
  .subtabs { flex-wrap: nowrap; width: max-content; max-width: none; }
  .subtabs button { white-space: nowrap; flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; }
  /* 顶栏：标题不折行，手机端隐藏缩放控件 */
  .topbar h2 { white-space: nowrap; max-width: 36vw; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
  .topbar .zoom-bar { display: none; }
  .topbar { gap: 6px; }
  /* KPI 卡片改两列，避免单列过长 */
  .g2, .g3, .g4, .g5, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .kpi { padding: 9px 11px; }
  .kpi .val { font-size: 19px; }
  .kpi .ext { font-size: 10.5px; }
  /* 表格：横向顺滑滚动 + 单行不折行，内容列可完整横滑查看 */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: max-content; }
  .tbl th, .tbl td { white-space: nowrap; }
  /* 工具条按钮允许换行排布 */
  .toolbar, .list-tools { flex-wrap: wrap; }
  /* ---- 底部不留白：内容区紧贴屏幕底边（合计/分页吸底仍可见），预留更多订单行 ---- */
  .content { padding: 6px 8px 0; }
  .card + .card { margin-top: 8px; }
  .grid { gap: 8px; }
  /* ---- 顶部固定区高度压缩到最小 ---- */
  /* 页签：单行更矮 */
  .subbar { padding: 4px 8px; gap: 5px; }
  .subtabs { padding: 2px; }
  .subtabs button { padding: 4px 10px; font-size: 12px; }
  /* 筛选行：更矮 */
  .filters { padding: 5px 8px; gap: 6px; }
  .filters .inp { padding: 4px 8px; font-size: 12.5px; }
  /* 卡片头（工具按钮行）：更矮 */
  .card-h { padding: 5px 9px; gap: 6px; }
  .card-h h3 { font-size: 13px; }
  .btn { padding: 4.5px 10px; font-size: 12.5px; }
  /* KPI 统计卡改横排单行：数值直接跟在文字后面 */
  .kpi { padding: 5px 10px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 8px; }
  .kpi .lbl { font-size: 12px; }
  .kpi .val { font-size: 15px; margin-top: 0; letter-spacing: 0; }
  .kpi .ext { margin-top: 0; flex-basis: 100%; font-size: 10.5px; }
  /* 在岗人员条同样横排压缩（覆盖 .duty-bar .kpi 的通用压缩样式） */
  .duty-bar .kpi { padding: 5px 10px; }
  .duty-bar .kpi .val { font-size: 15px; line-height: 1.2; margin-top: 0; }
  .duty-bar .kpi .ext { min-height: auto; margin-top: 0; flex-basis: 100%; font-size: 10.5px; }
  /* 表格行距收窄：一屏可见更多订单行 */
  .tbl th, .tbl td { padding: 5px 8px; font-size: 12px; }
  /* ---- 满屏贴合：dvh 随 iOS/安卓浏览器地址栏收放实时变化，底部不再留白 ----
     （!important 覆盖 bindZoomBar 写入的内联 height/min-height，旧浏览器不支持时自动沿用原方案） */
  html { min-height: 100dvh !important; background: var(--bg); }
  .app { min-height: 100dvh !important; }
  .main { height: 100dvh !important; }
  /* ---- 列表卡片头：按钮缩小并与列表名称并排一行 ---- */
  .card-h { gap: 3px 6px; padding: 4px 8px; }
  .card-h h3 { font-size: 12.5px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .card-h .sub { display: none; }
  .card-h .right { gap: 4px; margin-left: auto; }
  .card-h .right .btn { padding: 2.5px 6px; font-size: 11px; gap: 3px; }
  .card-h .right .btn svg, .card-h .right .btn .ico { width: 11px; height: 11px; }
}

/* ============ 现场管理详情：行内编辑 + 全列筛选（v142） ============ */
/* 表头漏斗图标与筛选弹窗复用全局 .th-filter / .hdr-filter-pop 样式 */
/* 批量编辑弹窗（加大版）：字段标签行 = 字段名 + 「清空」勾选 */
.sf-lrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.be-clear { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--tx-3); cursor: pointer; white-space: nowrap; }
.be-clear input { margin: 0; }
.be-grid .sf textarea.inp { resize: vertical; }
/* 批量编辑弹窗：栏框按行分组（v158）：每行并排显示指定字段，作业人员行加宽放勾选名单 */
.be-rows { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.be-row { display: grid; gap: 8px 14px; min-width: 0; }
.be-row .sf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.be-row .sf > label { font-size: 11.5px; color: var(--tx-3); }
/* R131c③：弹窗 textarea 栏（作业内容说明/其他要求补充）基线高度与单行 input 栏一致；禁用拖拽改由 JS 按内容自动调高 */
.be-row .sf textarea.inp { min-height: 38px; resize: none; overflow: hidden; }
/* R131d②：批量编辑栏框底色——关键可编辑栏（出行方式/出发日期/出发时间/安装日期/要求完工日期/要求返程日期/现场负责人/同行作业人员）
   按外观主题匹配填充色：浅色外观=蓝(--brand-l)、护眼绿=绿(--bg)、深色外观=白底黑字；
   其余栏框（含只读展示栏 工单编号/期望出行日期/期望完工日期）保持主题输入栏底色 var(--card)，仅显边框、无额外填充 */
.be-rows .bg-hl { background: var(--brand-l); }
body.theme-green .be-rows .bg-hl { background: var(--bg); }
body.theme-dark .be-rows .bg-hl { background: #fff; color: #000; }
.be-rows .inp[readonly] { background: var(--card); }
.be-row .wk-list { max-height: 132px; }
/* 字段差异提示（勾选多行且值不一致时显示在输入框下方） */
.be-diff { margin-top: 2px; font-size: 11px; color: #b45309; line-height: 1.3; }
/* R131：批量编辑栏框必填标记（申请单必填字段带 *）；「出发时间」小时+分钟双下拉 */
.be-row .sf-lrow .req { color: #e23; margin-left: 2px; font-style: normal; }
.be-time { display: flex; align-items: center; gap: 4px; }
.be-time select.inp { flex: 1; min-width: 0; padding-left: 6px; padding-right: 4px; }
.be-time .be-time-colon { color: var(--tx-3, #94a3b8); font-weight: 600; }
/* R131b：人员选择栏框——已选姓名以标签显示在框内（点 × 移除），搜索框内联 */
.pk-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border: 1px solid var(--bd-2, #cbd5e1); border-radius: 6px; padding: 4px 6px; min-height: 34px; background: var(--card, #fff); cursor: text; }
.pk-box:focus-within { border-color: var(--brand); }
.pk-tag { display: inline-flex; align-items: center; gap: 3px; background: var(--brand-l); border: 1px solid var(--brand); color: var(--brand-d, var(--brand)); border-radius: 5px; padding: 1px 4px 1px 7px; font-size: 12px; line-height: 18px; font-weight: 600; }
.pk-tag .pk-x { cursor: pointer; font-style: normal; font-size: 14px; line-height: 14px; padding: 0 2px; opacity: .65; }
.pk-tag .pk-x:hover { opacity: 1; color: #e23; }
.pk-box .pk-search { flex: 1; min-width: 80px; border: none; outline: none; background: transparent; font-size: 12.5px; color: var(--tx); padding: 3px 2px; }
.pk-box .pk-search::placeholder { color: var(--tx-3, #94a3b8); }
/* 现场管理详情：套级「作业人员」= 输入框 + ▾ 勾选弹层（v159） */
.su-wk { display: flex; gap: 4px; align-items: center; }
.su-wk input.cell-edit { flex: 1; min-width: 60px; }
.su-wk .btn { padding: 2px 6px; }
/* 行内编辑输入框（套级/现场级）：沿用全局 .cell-edit */
.su-tbl .cell-edit { min-width: 60px; }

/* ============ R54 钉钉审批 ============ */
/* 加班对比时间线：打卡点标记 + 审批时段横条 */
.dt-tl { position: relative; margin: 12px 0 6px; }
.dt-tl-axis { position: relative; height: 18px; margin-left: 64px; border-bottom: 1px solid var(--bd); }
.dt-tl-axis span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 10.5px; color: var(--tx-2); white-space: nowrap; }
.dt-tl-row { position: relative; display: flex; align-items: center; height: 30px; }
.dt-tl-lbl { flex: 0 0 64px; font-size: 12px; color: var(--tx-2); }
.dt-tl-track { position: relative; flex: 1; height: 100%; background: repeating-linear-gradient(90deg, transparent 0 calc(100%/12 - 1px), var(--bd) calc(100%/12 - 1px) calc(100%/12)); }
.dt-pt { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.15); cursor: help; }
.dt-bar { position: absolute; top: 50%; height: 12px; transform: translateY(-50%); background: linear-gradient(180deg, #60a5fa, #3b82f6); border-radius: 6px; min-width: 4px; }
.dt-legend { display: flex; gap: 14px; margin: 6px 0 0 64px; font-size: 11.5px; color: var(--tx-2); flex-wrap: wrap; }
.dt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
/* 打卡记录小表 */
.dt-rec-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dt-rec-tbl th, .dt-rec-tbl td { border-bottom: 1px solid var(--bd); padding: 6px 8px; text-align: left; vertical-align: top; }
.dt-rec-tbl th { color: var(--tx-2); font-weight: 500; background: var(--bg2, #f6f7f9); white-space: nowrap; }
.dt-rec-tbl tbody tr:hover td { background: transparent; }

/* 「生成异常工单」弹窗：按需求 6 行并排布局（每行字段数不同，窄屏自动换行） */
.ex-form .ex-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; margin-bottom: 10px; }
.ex-form .ex-f { flex: 1 1 130px; min-width: 108px; display: flex; flex-direction: column; }
.ex-form .ex-f label { display: block; font-size: 12.5px; color: var(--tx-2); margin-bottom: 5px; font-weight: 500; white-space: nowrap; }
.ex-form .ex-f .inp { width: 100%; }
.ex-form .ex-f.ex-grow { flex: 3 1 280px; }
.ex-form .ex-f textarea.inp { min-height: 64px; }
.ex-form .ex-f input[type="date"].inp { min-width: 128px; }
/* 紧急等级/处理状态：栏框宽度减半（不再与右侧 grow 字段等比拉伸） */
.ex-form .ex-f.ex-half { flex: 0 1 150px; min-width: 96px; }
/* 弹窗内嵌图片栏（异常情况图片/处理方式图片） */
.ex-form .ex-f .field.full { margin: 8px 0 0; width: 100%; }
.ex-form .ex-f .field.full > label { margin-bottom: 5px; }
/* 异常情况图片/处理方式图片：与等级/描述、状态/方式同行，作为第三列横排并列 */
.ex-form .ex-f.ex-img-col { flex: 2 1 230px; min-width: 200px; }
.ex-form .ex-img-col .field.full { margin: 0; }
/* 列宽有限：隐藏标签后的行内提示（拖拽框内已有同样提示），避免文字截断 */
.ex-form .ex-img-col .field.full > label .hint { display: none !important; }
/* 多行勾选时的「选定明细」表格：逐行带出产品信息，异常数量可编辑 */
.ex-form .ex-row-block { margin-bottom: 10px; }
.ex-form .ex-detail-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--bd, #e5e7eb); border-radius: 8px; background: #fafbfc; }
.ex-form table.ex-detail { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.ex-form table.ex-detail th, .ex-form table.ex-detail td { padding: 7px 10px; border-bottom: 1px solid var(--bd, #eef0f3); text-align: left; white-space: nowrap; }
.ex-form table.ex-detail thead th { background: #f1f5f9; color: var(--tx-2, #64748b); font-weight: 600; position: sticky; top: 0; }
.ex-form table.ex-detail tbody tr:nth-child(even) { background: #f6f8fa; }
.ex-form table.ex-detail td.num, .ex-form table.ex-detail th.num { text-align: right; }
.ex-form table.ex-detail td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ex-form table.ex-detail td .inp.ex-exc { width: 96px; padding: 4px 6px; }
/* 异常列表描述/方式列：超长省略，悬浮显示全文（R62 表头与编辑窗口字段对应） */
.ex-clip { display: inline-block; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
@media (max-width: 640px) {
  .ex-form table.ex-detail { min-width: 560px; font-size: 12px; }
}

/* 实际返程时间（R65）：日期 + 小时 + 分钟 复合控件（现场管理详情列表行内编辑 / 编辑现场信息表单） */
.ar-ctl { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ar-ctl .ar-date { width: 126px; min-width: 126px; }
.ar-ctl select.ar-hm { width: 56px; min-width: 56px; padding: 3px 2px; }
.su-tbl .ar-ctl .ar-date { width: 118px; min-width: 118px; padding: 3px 4px; }

/* R92：现场作业申请弹窗——时间范围选择器 / 多选子字段 / 审批流设置多选下拉 */
.apply-head .tr-pick { display: inline-flex; align-items: center; gap: 3px; }
.apply-head .tr-pick .inp.tr-sel { flex: 0 0 auto; width: 48px; min-width: 44px; padding: 4px 3px; }
.apply-head .tr-pick .tr-dash { color: #888; }
/* R133：二级子项改为实线边框小盒（不再虚线挤压、内部不折行）——“补充内容/落位高度”等标签与输入框恒在一行；必填子项带红* */
.apply-head .ah-checks .ck .ms-sub { display: inline-flex; flex-wrap: nowrap; gap: 8px; align-items: center; margin-left: 8px; padding: 3px 8px; background: #fff; border: 1px solid var(--bd, #e3e8ef); border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.apply-head .ah-checks .ck .ms-sub-i { display: inline-flex; align-items: center; gap: 4px; font-style: normal; color: #555; font-size: 12px; white-space: nowrap; }
.apply-head .ah-checks .ck .ms-sub-i em { font-style: normal; white-space: nowrap; }
.apply-head .ah-checks .ck .ms-sub .inp.sm { width: 110px; min-width: 90px; padding: 2px 6px; }
/* R133b：必填二级子项红框高亮；复选框级必填提示红*（如 机器人已落位*） */
.apply-head .ah-checks .ck .ms-sub-i.req .inp { border-color: #e8a3a3; background: #fffafa; }
.apply-head .ah-checks .ck > .req { font-style: normal; font-weight: 600; }
/* 手机端：子项小盒整体作为一个单元换行（内部不折行），输入框略窄防溢出 */
@media (max-width: 640px) {
  .apply-head .ah-checks .ck { flex-wrap: nowrap; }
  .apply-head .ah-checks .ck .ms-sub { margin-left: 4px; padding: 2px 6px; gap: 6px; }
  .apply-head .ah-checks .ck .ms-sub .inp.sm { width: 92px; min-width: 72px; }
}
.apply-head .ah-checks .ck input[type=checkbox] { accent-color: var(--brand); margin: 0 3px 0 0; }
/* 审批流设置：多选下拉 */
.msel { position: relative; }
.msel-btn { width: 100%; text-align: left; cursor: pointer; min-height: 34px; color: #333; }
.msel-panel { position: absolute; z-index: 50; top: calc(100% + 2px); left: 0; right: 0; max-height: 220px; overflow: auto; background: #fff; border: 1px solid var(--bd, #e3e8ef); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.msel-panel[hidden] { display: none; }
.msel-panel .ck { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.msel-panel .ck input { accent-color: var(--brand); margin: 0; }
.form-grid .fld.span2 { grid-column: 1 / -1; }
