/* ============================================
   生产综合管理系统 - 全局样式
   MES + WMS + ERP 统一界面
   视觉规范：SAP Fiori 3 / Quartz Light（紧凑密度）
   ============================================ */

:root {
  /* SAP 品牌色 */
  --sap-brand: #0a6ed1;
  --sap-brand-dark: #0854a0;
  --sap-brand-light: #d1e8ff;
  --sap-brand-hover: #f5faff;
  /* Shell（顶栏） */
  --sap-shell: #354a5f;
  --sap-shell-dark: #2b3a4a;
  --sap-shell-text: #ffffff;
  /* 中性色 */
  --sap-bg: #f5f6f7;
  --sap-tile: #ffffff;
  --sap-border: #d9d9d9;
  --sap-border-strong: #b7bcc2;
  --sap-border-light: #e5e5e5;
  --sap-text: #32363a;
  --sap-text-muted: #6a6d70;
  --sap-text-faint: #a4a8ab;
  /* 语义色 */
  --sap-success: #107e3e;
  --sap-success-bg: #e7f4ea;
  --sap-warning: #e9730c;
  --sap-warning-bg: #fef0e0;
  --sap-error: #bb0000;
  --sap-error-bg: #ffebeb;
  --sap-info: #0a6ed1;
  --sap-info-bg: #e8f1f8;
  --sap-neutral: #6a6d70;
  --sap-neutral-bg: #f2f2f2;

  /* 兼容旧变量名（其他模块仍有引用） */
  --color-primary: #32363a;
  --color-primary-light: #0a6ed1;
  --color-accent: #0a6ed1;
  --color-accent-dark: #0854a0;
  --color-success: #107e3e;
  --color-danger: #bb0000;
  --color-warning: #e9730c;
  --color-info: #0a6ed1;
  --color-bg: #f5f6f7;
  --color-card: #ffffff;
  --color-surface: #ffffff;
  --color-text: #32363a;
  --color-text-muted: #6a6d70;
  --color-border: #d9d9d9;
  --color-border-light: #e5e5e5;

  --shadow-sm: 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.18);

  --radius: 4px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  --font-sans: "72", "72full", "Segoe UI", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Consolas", "Menlo", "Courier New", monospace;
  --topbar-h: 44px;
  /* 电脑版左栏：图标 + 小字竖排，左右两栏各自独立滚动
     2026-10-24 v56：78px → 100px。78px 时第三层（检验批/退货单…）文字被挤成 9px + 省略号，
     用户反馈「看不清、点不到」，加宽后第三层可以和第二层一样做成整行按钮。 */
  --sidebar-w: 100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--sap-bg);
  color: var(--sap-text);
  font-size: 13px;
  line-height: 1.42857;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--sap-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ============================================ 登录页 ============================================ */
/* v69 公仔主题：电脑 = 左侧公仔插画 + 右侧登录卡；手机 = 上方公仔图 + 下方登录卡 */
/* 登录态给 body 铺深色：某些浏览器 100dvh 与实际可视高不一致时，底部不会露出灰白条 */
body.login-mode { background: #0f1a24; }
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 26px 20px;
  background:
    radial-gradient(900px 520px at 10% 6%, rgba(10,110,209,.38), transparent 62%),
    radial-gradient(720px 460px at 90% 94%, rgba(0,186,178,.26), transparent 64%),
    linear-gradient(155deg, #223247 0%, #182634 56%, #0f1a24 100%);
}
.login-stage {
  display: flex; width: 100%; max-width: 1000px; min-height: 584px;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 26px 70px rgba(0,0,0,.44);
}
.login-art {
  position: relative; flex: 0 0 47%; min-width: 0;
  display: flex; align-items: flex-end; justify-content: center;
  background: #121d2a;
  overflow: hidden;
}
/* 电脑端用星空公仔图：竖版 4:5 已经按容器比例裁好，按底对齐，公仔不会被裁到 */
.login-art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; }
.login-art-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #e6f1ff 58%, #cfe4ff 100%);
}
.login-art.no-art .login-art-fallback { display: flex; }
.login-art.no-art .login-art-img { display: none; }
/* 图上的品牌小标签：左上角玻璃胶囊，不压底部公仔 */
.login-art-cap {
  position: absolute; left: 16px; top: 16px; z-index: 2;
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 13px; border-radius: 999px;
  color: #fff; pointer-events: none;
  background: rgba(12,22,33,.46);
  border: 1px solid rgba(255,255,255,.20);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.login-art-cap b { font-size: 12px; letter-spacing: .3px; }
.login-art-cap span { font-size: 10.5px; opacity: .82; }
.login-card {
  flex: 1 1 auto; min-width: 0;
  background: #fff;
  padding: 42px 44px;
  display: flex; flex-direction: column; justify-content: center;
  border-top: 0;
  width: auto; max-width: none;
  box-shadow: none;
  position: relative;
}
/* 卡片底部小字：版本号 + 安装提示，压住下方留白 */
.login-foot {
  position: absolute; left: 0; right: 0; bottom: 16px;
  text-align: center; font-size: 11px; line-height: 1.7;
  color: var(--sap-text-muted); opacity: .8; padding: 0 20px;
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo h1 { color: var(--sap-text); font-size: 21px; font-weight: 600; margin-bottom: 6px; letter-spacing: .5px; }
.login-logo h1 span { color: var(--sap-brand); margin-left: 5px; letter-spacing: 1px; }
.login-logo p { color: var(--sap-text-muted); font-size: 12px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input {
  border: 1px solid var(--sap-border-strong);
  border-radius: var(--radius);
  padding: 0 11px;
  font-size: 14px;
  color: var(--sap-text);
  height: 38px;
}
.login-form input:focus { outline: none; border-color: var(--sap-brand); box-shadow: inset 0 0 0 1px var(--sap-brand); }
.login-form button {
  background: var(--sap-brand); color: #fff;
  border: 1px solid var(--sap-brand); border-radius: var(--radius);
  padding: 0 16px; height: 38px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.login-form button:hover { background: var(--sap-brand-dark); border-color: var(--sap-brand-dark); }
.login-form button:disabled { opacity: .5; cursor: not-allowed; }
.login-tip { background: var(--sap-info-bg); border-left: 3px solid var(--sap-brand); padding: 10px 12px; font-size: 12px; color: var(--sap-text-muted); border-radius: 2px; line-height: 1.7; }
.login-tip b { color: var(--sap-text); }
.login-err { background: var(--sap-error-bg); border-left: 3px solid var(--sap-error); padding: 8px 10px; font-size: 12px; color: var(--sap-error); border-radius: 2px; }
.login-switch { text-align: center; font-size: 12px; color: var(--sap-text-muted); }
.login-switch a { color: var(--sap-brand); cursor: pointer; }

/* ============================================ 主框架 ============================================ */
/* 登录后：整页不滚，顶栏固定，左栏与右侧内容区各自独立滚动（互不带动） */
body.app-shell { height: 100%; overflow: hidden; }
.app-layout { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }

/* Shell Bar */
.topbar {
  background: var(--sap-shell);
  color: var(--sap-shell-text);
  height: var(--topbar-h);
  padding: 0 12px 0 6px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--sap-shell-dark);
}
.topbar-logo { font-size: 14px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.topbar-logo span { color: #a9c7e8; font-weight: 400; margin-left: 6px; }
.topbar-right { display: flex; align-items: center; gap: var(--space-2); }
.topbar-user { font-size: 12px; color: #d5dadd; display: flex; align-items: center; gap: 6px; }
.topbar-user b { color: #fff; font-weight: 600; }
.topbar-user .role-tag {
  background: rgba(255,255,255,.16); color: #fff;
  padding: 1px 7px; border-radius: 2px; font-size: 10px; font-weight: 600; letter-spacing: .3px;
}
.topbar-logout {
  background: transparent; color: #d5dadd; border: 1px solid #5b7387;
  padding: 0 10px; border-radius: var(--radius); cursor: pointer; font-size: 12px;
  height: 26px;
}
.topbar-logout:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #8aa4b8; }

/* 主体 */
.main { display: flex; flex: 1; min-height: 0; overflow: hidden; }

/* 侧边导航（SAP Side Navigation）—— 窄栏：图标在上、文字在下 */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--sap-border);
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 16px;
  flex-shrink: 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar-group { margin-bottom: 2px; }
.sidebar-group-title {
  padding: 9px 2px 4px;
  font-size: 10px;
  color: #8f979e;
  letter-spacing: 0;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 3px;
  text-align: center;
  color: var(--sap-text);
  cursor: pointer;
  font-size: 10.5px;
  line-height: 1.2;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.sidebar-item:hover { background: var(--sap-brand-hover); }
.sidebar-item.active { background: var(--sap-info-bg); color: var(--sap-brand); border-left-color: var(--sap-brand); font-weight: 600; }
.sidebar-item-icon { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; color: #4a4d50; display: inline-flex; }
.sidebar-item-icon svg { width: 100%; height: 100%; }
.sidebar-item.active .sidebar-item-icon { opacity: 1; color: var(--sap-brand); }
.sidebar-item-text {
  display: block;
  font-size: 10.5px;
  line-height: 1.25;
  white-space: normal;
  word-break: break-all;
  max-width: 100%;
}

/* ---- 侧边栏两级导航：第一层分组按钮（ERP 业务 / MES 生产 / WMS 仓储 …） ---- */
.nav-root { padding: 2px 0; }
.nav-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 2px;
  margin: 3px 4px;
  border-radius: 5px;
  background: #f3f6f8;
  border: 1px solid #e5eaee;
  color: var(--sap-text);
  font-size: 10px; line-height: 1.2;
  cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.nav-tile:hover { background: var(--sap-brand-hover); border-color: #cfe4f7; color: var(--sap-brand); }
.nav-tile:hover .nav-tile-icon { color: var(--sap-brand); opacity: 1; }
.nav-tile.active { background: var(--sap-info-bg); border-color: #b8d9f5; color: var(--sap-brand); font-weight: 600; }
.nav-tile.active .nav-tile-icon { color: var(--sap-brand); opacity: 1; }
.nav-tile-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: .9; color: #4a4d50;
}
.nav-tile-icon svg { width: 100%; height: 100%; }
.nav-tile-name { display: block; text-align: center; white-space: normal; word-break: break-word; }
.nav-tile-group .nav-tile-name { font-weight: 600; }
.nav-tile.has-active { background: #f0f7fe; border-color: #b8d9f5; color: var(--sap-brand); }
.nav-tile.has-active .nav-tile-icon { color: var(--sap-brand); opacity: 1; }
.nav-tile-chev {
  position: absolute; top: 50%; right: 2px;
  transform: translateY(-50%);
  font-size: 13px; line-height: 1; color: #96a1aa; font-weight: 700;
}

/* ---- 第二层：返回 + 组内细项 ---- */
.nav-sub { padding: 2px 0; }
.nav-back {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; margin: 4px 4px 3px;
  border-radius: 5px;
  background: #eef2f4; color: #55636d;
  font-size: 10.5px; font-weight: 600;
  cursor: pointer; user-select: none;
  white-space: nowrap; overflow: hidden;
  transition: background .12s, color .12s;
}
.nav-back:hover { background: #e2eaef; color: var(--sap-brand); }
.nav-back span { font-size: 16px; line-height: 1; margin-top: -2px; }
.nav-sub .sidebar-group-title { padding-top: 6px; }

/* 内容区：独立滚动 */
.content {
  flex: 1; min-width: 0; height: 100%;
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--sap-bg);
}
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: var(--space-3); flex-wrap: wrap; gap: var(--space-2);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sap-border-light);
}
.page-title { font-size: 20px; color: var(--sap-text); font-weight: 400; line-height: 1.2; }
.page-subtitle { font-size: 12px; color: var(--sap-text-muted); margin-top: 4px; }

/* ============================================ 通用组件 ============================================ */
.panel {
  background: var(--sap-tile);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--sap-border-light);
  margin-bottom: var(--space-3);
}
.panel-title {
  font-size: 14px; color: var(--sap-text); font-weight: 600;
  margin-bottom: var(--space-3);
  padding-bottom: 8px; border-bottom: 1px solid var(--sap-border-light);
  display: flex; justify-content: space-between; align-items: center;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); align-items: center; }
/* 产品主数据专用的 SKU 操作条（v84）：独立于表格「列设置」栏，永不随列表重绘消失 */
.sku-acts-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 var(--space-3); padding: 6px 8px;
  background: #fff; border: 1px solid var(--sap-border); border-left: 3px solid var(--sap-brand);
  border-radius: 6px;
}
.sku-acts-bar .btn { height: 28px; }
.sku-acts-tip { font-size: 11.5px; color: var(--sap-text-muted); margin-left: 2px; }

.page-header .toolbar { margin-bottom: 0; justify-content: flex-end; }

/* SAP 按钮：Default（描边） / Emphasized（实心） / Transparent */
.btn {
  background: #fff; color: var(--sap-brand);
  border: 1px solid var(--sap-brand); padding: 0 12px; height: 28px;
  border-radius: var(--radius);
  cursor: pointer; font-size: 13px; transition: background .12s, border-color .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  white-space: nowrap; font-weight: 400;
}
.btn:hover:not(:disabled) { background: var(--sap-brand-hover); box-shadow: inset 0 0 0 1px var(--sap-brand); }
.btn:active:not(:disabled) { background: var(--sap-brand-light); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
/* Emphasized（主操作） */
.btn.orange { background: var(--sap-brand); color: #fff; border-color: var(--sap-brand); font-weight: 600; }
.btn.orange:hover:not(:disabled) { background: var(--sap-brand-dark); border-color: var(--sap-brand-dark); box-shadow: none; }
/* Transparent / 中性 */
.btn.gray { background: #fff; color: var(--sap-text); border-color: var(--sap-border-strong); }
.btn.gray:hover:not(:disabled) { background: #f5f5f5; border-color: var(--sap-text-muted); box-shadow: none; }
.btn.blue { background: #fff; color: var(--sap-brand); border-color: var(--sap-brand); }
.btn.blue:hover:not(:disabled) { background: var(--sap-brand-hover); }
/* Accept（SAP Positive：描边绿，避免与主操作抢焦点） */
.btn.green { background: #fff; color: var(--sap-success); border-color: #7fb58f; }
.btn.green:hover:not(:disabled) { background: var(--sap-success-bg); border-color: var(--sap-success); box-shadow: none; }
/* Reject */
.btn.red { background: #fff; color: var(--sap-error); border-color: #d9a3a3; }
.btn.red:hover:not(:disabled) { background: var(--sap-error-bg); border-color: var(--sap-error); box-shadow: none; }
/* Attention */
.btn.purple { background: #fff; color: var(--sap-warning); border-color: #f0b27a; }
.btn.purple:hover:not(:disabled) { background: var(--sap-warning-bg); border-color: var(--sap-warning); box-shadow: none; }
.btn.sm { height: 24px; padding: 0 9px; font-size: 12px; }
.btn.lg { height: 36px; padding: 0 20px; font-size: 14px; }

.input, .select, .textarea {
  border: 1px solid var(--sap-border-strong);
  border-radius: var(--radius);
  padding: 0 9px;
  height: 28px;
  font-size: 13px;
  color: var(--sap-text);
  background: #fff;
  min-width: 100px;
}
.input::placeholder, .textarea::placeholder { color: var(--sap-text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--sap-brand);
  box-shadow: inset 0 0 0 1px var(--sap-brand);
}
.textarea { height: auto; min-height: 62px; padding: 6px 9px; resize: vertical; }
.input.sm, .select.sm { height: 24px; padding: 0 6px; font-size: 12px; }
select.select { padding-right: 22px; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  align-items: center;
  background: #fff;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
  border: 1px solid var(--sap-border-light);
}
.filter-bar label { font-size: 12px; color: var(--sap-text-muted); white-space: nowrap; }

/* 表格（SAP Responsive Table） */
.table-wrap { overflow: auto; border: 1px solid var(--sap-border); border-radius: var(--radius); background: #fff; position: relative; }
.content .table-wrap { max-height: calc(100vh - 250px); overflow: auto; }
.content .table-wrap table { min-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { border-bottom: 1px solid var(--sap-border-light); padding: 6px 10px; text-align: left; white-space: nowrap; }
th {
  background: #f2f2f2; color: var(--sap-text); font-weight: 600;
  font-size: 11px; letter-spacing: .2px; height: 32px;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--sap-border);
}
/* 报表表头固定：滚动容器内表头始终贴顶不动。
   Chrome 下 border-collapse: collapse 会让 sticky 表头的底色/边框失效（下面的行会透出来），
   因此滚动容器内的表格改用 separate + 单元格各自描边。 */
.table-wrap table { border-collapse: separate; border-spacing: 0; }
.table-wrap thead th {
  position: sticky; top: 0; z-index: 4;
  background: #f2f2f2; background-clip: padding-box;
  box-shadow: inset 0 -1px 0 var(--sap-border), 0 2px 6px rgba(31, 42, 54, .07);
}
tbody tr { background: #fff; }
tbody tr:hover { background: var(--sap-brand-hover); }
tbody tr.is-selected, tbody tr.selected { background: var(--sap-info-bg); }
td .input, td .select { width: 100%; min-width: 60px; }
.empty { text-align: center; color: var(--sap-text-faint); padding: 44px; font-size: 13px; }

/* 表格增强：列设置 / 列宽拖拽 / 上传模板 */
.grid-box { margin-bottom: var(--space-3); }
.grid-tools {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px 8px; background: #fafafa;
  border: 1px solid var(--sap-border-light); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0; position: relative;
}
.grid-box .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
/* 工具条归位（2026-10-24）：表格工具条整体搬进页面标题右侧，与「新建/刷新/导出」并成一行。
   搬过去后去掉自己的灰底和边框，避免出现第二个按钮带。 */
.page-header .toolbar .grid-tools {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 0; background: none; border: none; border-radius: 0;
  position: relative;
}
.page-header .toolbar .grid-tools::before {
  content: ''; width: 1px; height: 18px; background: var(--sap-border); margin: 0 2px;
}
/* 表格被搬空工具条后，圆角由 .table-wrap 自己给，不用再抠上圆角 */
.grid-box > .table-wrap { border-radius: var(--radius); }
.page-header .toolbar .col-menu { left: auto; right: 0; top: calc(100% + 6px); max-height: 320px; overflow: auto; }
.col-resizer { position: absolute; right: 0; top: 0; height: 100%; width: 6px; cursor: col-resize; z-index: 3; }
.col-resizer:hover { background: var(--sap-brand-light); }
/* 销售订单号标签（2026-10-24）：全链路单据上统一用这个蓝标 */
.tag-so {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  background: #e8f1f8; color: #0854a0; border: 1px solid #c9e0f5;
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  font-family: var(--font-mono);
}
/* 生产看板卡片上的销售单号 */
.pb-so {
  margin-left: 6px; padding: 0 5px; border-radius: 3px;
  background: #e8f1f8; color: #0854a0; font-size: 10.5px; font-family: var(--font-mono);
  white-space: nowrap;
}

/* 列宽可自由压窄（2026-10-24，v165 起不设最小宽度）：
   内容超出不撑列，用省略号；鼠标悬停由 js/ux.js 自动挂 title 显示全文。
   表格由 ux.js 在拖拽 / 双击自适应时切成 fixed 布局，宽度完全按用户拖的值来；
   双击分隔线 = 按这一列的内容自动匹配宽度（Excel 口径）。 */
.table-wrap th, .table-wrap td,
.po-table-wrap th, .po-table-wrap td { overflow: hidden; text-overflow: ellipsis; }
.table-wrap table.rsz-fixed,
.po-table-wrap table.rsz-fixed { table-layout: fixed; min-width: 0; }
/* v165：拖过列宽的表格不再被容器撑满（撑满会把多余宽度摊回各列，看起来像"有最小宽度"） */
.content .table-wrap table.rsz-fixed { min-width: 0; }
/* 列设置栏里的「重置列宽」 */
.grid-tools .btn[data-colreset] { opacity: .85; }
.col-hidden { display: none !important; }
.col-menu {
  position: absolute; top: 100%; left: 0; z-index: 50; background: #fff;
  border: 1px solid var(--sap-border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px 10px; display: flex; flex-direction: column;
  gap: 4px; max-height: 340px; overflow: auto; min-width: 180px;
}
.col-opt { font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--sap-text); }
.col-opt input { cursor: pointer; accent-color: var(--sap-brand); }

/* 状态标签（SAP Object Status 风格：浅底 + 深色字） */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 2px;
  font-size: 11px; font-weight: 600; line-height: 18px;
  letter-spacing: .2px;
}
.tag-draft { background: var(--sap-neutral-bg); color: var(--sap-neutral); }
.tag-confirmed, .tag-released, .tag-open { background: var(--sap-info-bg); color: #0854a0; }
.tag-partial, .tag-in_progress { background: var(--sap-warning-bg); color: #b95100; }
.tag-shipped, .tag-completed, .tag-closed, .tag-received { background: var(--sap-success-bg); color: var(--sap-success); }
.tag-cancelled { background: var(--sap-error-bg); color: var(--sap-error); }
/* 退单（销售订单下推出来的单只能退单，不能删）—— 灰底删线，和「已取消」区分开 */
.tag-returned { background: #eef0f2; color: #5b6770; text-decoration: line-through; }
.tag-overdue { background: var(--sap-error-bg); color: var(--sap-error); animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* 统计卡片（KPI Tile） */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.stat-card {
  background: #fff; border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--sap-border-light);
  border-left: 3px solid var(--sap-brand);
}
.stat-card.primary { border-left-color: var(--sap-brand); }
.stat-card.success { border-left-color: var(--sap-success); }
.stat-card.danger { border-left-color: var(--sap-error); }
.stat-card.warning { border-left-color: var(--sap-warning); }
.stat-label { font-size: 11px; color: var(--sap-text-muted); letter-spacing: .3px; margin-bottom: 6px; }
.stat-value { font-size: 22px; color: var(--sap-text); font-weight: 600; line-height: 1.15; }
.stat-sub { font-size: 11px; color: var(--sap-text-muted); margin-top: 6px; }

/* 模态框（SAP Dialog） */
.modal-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(31,42,54,.55); z-index: 2000;
  justify-content: center; align-items: center;
  padding: var(--space-4);
}
.modal-mask.show { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius-lg);
  padding: 0; max-width: 90vw; max-height: 90vh;
  overflow: auto; box-shadow: var(--shadow-lg);
  position: relative; width: 100%;
}
.modal-box.sm { max-width: 440px; }
.modal-box.md { max-width: 660px; }
.modal-box.lg { max-width: 960px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0; padding: 12px 20px;
  border-bottom: 1px solid var(--sap-border-light);
  position: sticky; top: 0; background: #fff; z-index: 5;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { font-size: 17px; color: var(--sap-text); font-weight: 400; }
.modal-close {
  background: transparent; border: none; color: var(--sap-text-muted);
  font-size: 20px; cursor: pointer; line-height: 1; width: 28px; height: 28px;
  border-radius: var(--radius);
}
.modal-close:hover { background: #f2f2f2; color: var(--sap-text); }
.modal-body { padding: 16px 20px; }
.modal-body .form-row { display: flex; gap: var(--space-3); margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.modal-body .form-row label { font-size: 12px; color: var(--sap-text-muted); min-width: 82px; }
.modal-body .form-row .input, .modal-body .form-row .select, .modal-body .form-row .textarea { flex: 1 1 220px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--sap-border-light);
  position: sticky; bottom: 0; background: #fff; z-index: 5;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   v125 统一确认弹窗（自绘 confirm / prompt，替代浏览器原生弹窗）
   原生弹窗标题栏会顶出「xxx.workbuddy.host 显示」，且无法美化 → 全部改为站内弹窗
   ============================================================ */
.cf-mask {
  position: fixed; inset: 0; z-index: 3200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(22, 33, 46, .46);
  -webkit-backdrop-filter: blur(2.5px); backdrop-filter: blur(2.5px);
  animation: cfMaskIn .16s ease both;          /* 用 keyframes 进场：不依赖 requestAnimationFrame */
}
.cf-mask:not(.show) { opacity: 0; pointer-events: none; transition: opacity .16s ease; }  /* 关掉时淡出，且不再吃点击 */
.cf-card {
  width: 100%; max-width: 412px; background: #fff;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 64px -16px rgba(14, 30, 46, .42), 0 2px 8px rgba(14, 30, 46, .08);
  animation: cfCardIn .22s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes cfMaskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfCardIn {
  from { opacity: 0; transform: translateY(10px) scale(.975); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-mask, .cf-card { animation: none; }
}

.cf-head { display: flex; align-items: center; gap: 11px; padding: 20px 20px 0; }
.cf-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.cf-ico.danger { background: #fdecea; color: #c0392b; }
.cf-ico.warn   { background: #fdf1e2; color: #b4600b; }
.cf-ico.info   { background: #e9f2fd; color: #0a6ed1; }
.cf-ico.ok     { background: #e8f5ec; color: #107e3e; }
.cf-tt { font-size: 16.5px; font-weight: 600; color: #1d2124; line-height: 1.35; letter-spacing: .2px; }

.cf-body { padding: 12px 20px 2px; max-height: 46vh; overflow: auto; }
.cf-p {
  margin: 0 0 8px; font-size: 13.5px; line-height: 1.68;
  color: #4a5055; word-break: break-word;
}
.cf-p:last-child { margin-bottom: 0; }
.cf-ul {
  list-style: none; margin: 2px 0 10px; padding: 5px 0;
  background: #f7f9fb; border-radius: 9px; border-left: 3px solid #dbe4ee;
}
.cf-ul:last-child { margin-bottom: 0; }
.cf-ul li {
  position: relative; padding: 3px 14px 3px 21px;
  font-size: 13px; line-height: 1.6; color: #4a5055; word-break: break-word;
}
.cf-ul li::before {
  content: ''; position: absolute; left: 11px; top: 11px;
  width: 4px; height: 4px; border-radius: 50%; background: #9db0c4;
}
.cf-card.is-danger .cf-ul { background: #fdf7f6; border-left-color: #f2cfca; }
.cf-card.is-danger .cf-ul li::before { background: #d99b93; }

.cf-input {
  width: 100%; height: 38px; margin-top: 2px; padding: 0 12px;
  border: 1px solid #d7dce1; border-radius: 9px;
  font-size: 13.5px; color: #1d2124; background: #fff;
  transition: border-color .14s, box-shadow .14s;
}
.cf-input:focus {
  outline: none; border-color: #0a6ed1;
  box-shadow: 0 0 0 3px rgba(10, 110, 209, .14);
}

.cf-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 10px 20px 18px;
}
.cf-btn {
  height: 36px; min-width: 86px; padding: 0 18px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .06s;
  display: inline-flex; align-items: center; justify-content: center;
}
.cf-btn:active { transform: translateY(1px); }
.cf-btn.ghost { background: #fff; border-color: #d7dce1; color: #4a5055; }
.cf-btn.ghost:hover { background: #f4f6f8; border-color: #b9c0c7; color: #1d2124; }
.cf-btn.primary { background: #0a6ed1; color: #fff; box-shadow: 0 2px 7px rgba(10, 110, 209, .3); }
.cf-btn.primary:hover { background: #085eb5; box-shadow: 0 3px 10px rgba(10, 110, 209, .34); }
.cf-btn.primary.danger { background: #c0392b; box-shadow: 0 2px 7px rgba(192, 57, 43, .3); }
.cf-btn.primary.danger:hover { background: #a93226; box-shadow: 0 3px 10px rgba(192, 57, 43, .34); }
.cf-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(10, 110, 209, .2); }
.cf-btn.primary:focus-visible { box-shadow: 0 2px 7px rgba(10, 110, 209, .26), 0 0 0 3px rgba(10, 110, 209, .2); }
.cf-btn.primary.danger:focus-visible { box-shadow: 0 2px 7px rgba(192, 57, 43, .28), 0 0 0 3px rgba(192, 57, 43, .18); }

@media (max-width: 480px) {
  .cf-mask { padding: 14px; }
  .cf-card { max-width: 100%; border-radius: 14px; }
  .cf-head { padding: 17px 16px 0; gap: 10px; }
  .cf-body { padding: 10px 16px 2px; max-height: 52vh; }
  .cf-tt { font-size: 15.5px; }
  .cf-foot { padding: 8px 16px 16px; gap: 8px; }
  .cf-btn { flex: 1 1 0; min-width: 0; height: 40px; }
}
@media print {
  .cf-mask { display: none !important; }
}

/* Toast（SAP MessageToast） */
#toast {
  position: fixed; top: 56px; right: 20px; z-index: 9999;
  background: var(--sap-shell); color: #fff;
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; display: none;
  box-shadow: var(--shadow-md); max-width: 380px;
  border-left: 4px solid #8fa6ba;
}
#toast.show { display: block; animation: slidein .18s; }
#toast.success { background: #1d3527; border-left-color: #3ec06a; }
#toast.error { background: #3d1a1a; border-left-color: #ef6b6b; }
#toast.warning { background: #3d2e16; border-left-color: #f0a63c; }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 加载 */
.loading { display: flex; align-items: center; justify-content: center; padding: 44px; color: var(--sap-text-muted); font-size: 13px; }
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--sap-border);
  border-top-color: var(--sap-brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block; margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 分页 */
.pager { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: var(--space-3); font-size: 12px; color: var(--sap-text-muted); flex-wrap: wrap; }
.pager button {
  background: #fff; border: 1px solid var(--sap-border-strong); color: var(--sap-text);
  padding: 0 9px; height: 26px; border-radius: var(--radius); cursor: pointer; font-size: 12px;
}
.pager button:hover:not(:disabled) { border-color: var(--sap-brand); color: var(--sap-brand); background: var(--sap-brand-hover); }
.pager button.active { background: var(--sap-brand); color: #fff; border-color: var(--sap-brand); font-weight: 600; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* Tab */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--sap-border); margin-bottom: var(--space-3); flex-wrap: wrap; }
.tabs button {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--sap-text-muted);
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--sap-brand); }
.tabs button.active { color: var(--sap-brand); font-weight: 600; border-bottom-color: var(--sap-brand); }

/* 进度条 */
.progress { background: #e9e9e9; border-radius: 2px; overflow: hidden; height: 6px; }
.progress-bar { background: var(--sap-brand); height: 100%; transition: width .3s; }
.progress-bar.success { background: var(--sap-success); }
.progress-bar.warning { background: var(--sap-warning); }
.progress-bar.danger { background: var(--sap-error); }

/* ===== 功能导航中心 ===== */
.nav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.nav-card { background: #fff; border: 1px solid var(--sap-border-light); border-radius: var(--radius-md); overflow: hidden; }
.nav-card-title { background: #f2f2f2; color: var(--sap-text); padding: 9px 14px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--sap-border-light); }
.nav-card-items { padding: 4px; }
.nav-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; transition: background .12s; }
.nav-link:hover { background: var(--sap-brand-hover); }
.nav-link-name { font-weight: 600; font-size: 13px; color: var(--sap-brand); min-width: 86px; }
.nav-link-desc { font-size: 11px; color: var(--sap-text-muted); flex: 1; }
.nav-link-arrow { color: var(--sap-border-strong); font-size: 15px; }

/* ===== 分层图总览 ===== */
.ov-menu { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-3); margin-top: var(--space-3); align-items: start; }
.ov-menu-panel, .ov-flow-panel { margin: 0; }
.ov-layer { background: #fff; border: 1px solid var(--sap-border-light); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; }
.ov-layer-head { color: #fff; padding: 9px 14px; display: flex; align-items: baseline; gap: 12px; }
.ov-layer-title { font-weight: 600; font-size: 14px; letter-spacing: .3px; }
.ov-layer-sub { font-size: 11px; opacity: .85; }
.ov-layer-body { padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px; }
.ov-flow { text-align: center; font-size: 16px; line-height: 1; padding: 6px 0; font-weight: 600; color: var(--sap-text-faint); }
.flow-node { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--sap-border-light); border-radius: var(--radius); background: #fff; cursor: pointer; transition: all .12s; margin-bottom: 0; }
.flow-node:hover { border-color: var(--sap-brand); background: var(--sap-brand-hover); }
.flow-seq { width: 22px; height: 22px; border-radius: 50%; background: var(--sap-brand); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.flow-info { display: flex; flex-direction: column; line-height: 1.3; }
.flow-info b { font-size: 13px; color: var(--sap-text); font-weight: 600; }
.flow-info span { font-size: 11px; color: var(--sap-text-muted); }
.flow-arrow { text-align: center; color: var(--sap-text-faint); font-size: 14px; line-height: 1.4; font-weight: 600; }

/* 行内录入表（工序报工） */
.row-editor { width: 100%; border-collapse: collapse; }
.row-editor th { background: #f2f2f2; font-size: 11px; padding: 6px 4px; border: 1px solid var(--sap-border-light); position: sticky; top: 0; }
.row-editor td { border: 1px solid var(--sap-border-light); padding: 1px; }
.row-editor .input, .row-editor .select { width: 100%; border: none; height: 26px; padding: 0 6px; font-size: 12px; background: transparent; border-radius: 0; }
.row-editor .input:focus, .row-editor .select:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--sap-brand); }
.row-editor tr.new-row { background: #fbfdff; }
/* v171：生产订单下推出来的「待报工」行排在上方录入区，用左侧红条 + 浅橙底标明（可直接改、保存即更新） */
.row-editor tr.rep-pending { background: #fffaf6; }
.row-editor tr.rep-pending > td:first-child { box-shadow: inset 3px 0 0 #e9730c; }
/* v174（2026-11-04 用户口径）：录入表最左侧「勾选退单」列 + 单号右侧「销售订单」列 */
.row-editor th.th-chk, .row-editor td.td-chk { padding: 0 2px; text-align: center; }
.row-editor td.td-chk input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; vertical-align: middle; }
.row-editor tr.chk-on { background: #fff3e0; }
.row-editor .so-cell, .row-editor .so-cell[readonly] { color: #0a6ed1; cursor: default; }
/* 2026-11-05 需求 3：产品型号 / 物料品名两列是只读展示（由左边 SKU 自动带出） */
.row-editor td.ro-cell {
  max-width: 118px; padding: 0 6px; font-size: 12px; color: #4a5056;
  background: #f7f9fb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pending-bar {
  margin: 0 0 6px; padding: 6px 10px; border-radius: 3px;
  background: #fdf6ec; border: 1px solid #f0d9b5; border-left: 3px solid #e9730c;
  color: #8a5a1a; font-size: 11.5px; line-height: 1.65;
}
.pending-bar b { color: #b95100; }

/* ============================================ 人力资源（考勤） ============================================ */
.tab-bar {
  display: flex; flex-wrap: nowrap; gap: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--sap-border);
  margin-bottom: var(--space-4); padding-bottom: 0;
}
.tab-bar .tab-item {
  flex: 0 0 auto; padding: 9px 16px;
  font-size: 13px; color: var(--sap-text-muted);
  cursor: pointer; white-space: nowrap; user-select: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s, background .12s;
}
.tab-bar .tab-item:hover { color: var(--sap-brand); background: var(--sap-brand-hover); }
.tab-bar .tab-item.active {
  color: var(--sap-brand); font-weight: 600;
  border-bottom-color: var(--sap-brand);
}

/* 功能说明段落 */
.section-note { font-size: 12px; color: var(--sap-text-muted); margin-bottom: var(--space-3); line-height: 1.7; }
.section-note code { background: #f2f2f2; padding: 1px 5px; border-radius: 2px; font-family: var(--font-mono); color: #354a5f; font-size: 11px; }

/* 排班日历 */
.cal-table { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.cal-table th { background: #f2f2f2; color: var(--sap-text); font-weight: 600; font-size: 11px; padding: 6px 0; border-radius: 2px; text-align: center; }
.cal-cell { vertical-align: top; padding: 6px; min-height: 70px; border: 1px solid var(--sap-border-light); border-radius: 2px; background: #fff; }
.cal-cell .cal-day { font-size: 13px; font-weight: 600; color: var(--sap-text); }
.cal-cell select { font-size: 11px; padding: 2px 4px; margin-top: 5px; width: 100%; height: 22px; }

/* 扫码相机浮层 */
.scan-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(20,26,33,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.scan-overlay video { width: 100%; max-width: 460px; border-radius: var(--radius); background: #000; }
.scan-overlay .scan-tip { color: #fff; font-size: 13px; margin: 14px 0; text-align: center; }
.scan-overlay .scan-close { position: absolute; top: 14px; right: 14px; background: #fff; color: var(--sap-text); border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 19px; cursor: pointer; line-height: 1; }
.scan-frame { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-58%); width: 70%; max-width: 300px; height: 170px; border: 2px solid var(--sap-brand-light); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none; }

/* ===== 扫码报工登记面板（手机全屏长窗，关闭即回正常界面） ===== */
body.rb-lock { overflow: hidden !important; }
.rb-sheet {
  position: fixed; inset: 0; z-index: 2900;
  height: 100dvh;                 /* 软键盘弹出时跟动态视口，底部按钮不被挡住 */
  display: flex; flex-direction: column;
  background: #f1f4f6;
  animation: rbSheetIn .16s ease-out;
}
@keyframes rbSheetIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rb-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: #354a5f; color: #fff;
}
.rb-head-main { flex: 1 1 auto; min-width: 0; }
.rb-head-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.rb-head-sub {
  font-size: 11px; opacity: .85; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rb-hbtn {
  flex: none; height: 32px; padding: 0 11px; border-radius: 4px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.38);
  font-size: 12px; cursor: pointer;
}
.rb-hbtn:hover { background: rgba(255,255,255,.26); }
.rb-hbtn-close { background: rgba(255,255,255,.92); color: #354a5f; border-color: transparent; font-weight: 600; }
.rb-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 10px 10px 14px;
}
.rb-card {
  background: #fff; border: 1px solid var(--sap-border); border-radius: 6px;
  margin-bottom: 9px; overflow: hidden;
}
.rb-sum-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid #f1f3f5;
  font-size: 13px; line-height: 1.4;
}
.rb-sum-row:last-child { border-bottom: none; }
.rb-sum-row > span { flex: none; width: 72px; font-size: 12px; color: #6a6d70; }
.rb-sum-row > b { min-width: 0; font-weight: 600; color: var(--sap-text); word-break: break-all; }
.rb-sum-row b em { font-style: normal; color: var(--sap-brand); font-family: var(--font-mono); margin-left: 4px; }
.rb-sum-row b em.rb-dim { color: #6a6d70; font-family: var(--font-sans); font-size: 11.5px; }
/* 工序切换 chips */
.rb-chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 1px 2px 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.rb-chips::-webkit-scrollbar { display: none; }
.rb-chip {
  flex: none; height: 34px; padding: 0 12px; border-radius: 17px;
  border: 1px solid var(--sap-border-strong); background: #fff;
  color: var(--sap-text); font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.rb-chip small { opacity: .6; margin-left: 3px; font-family: var(--font-mono); }
.rb-chip.on { background: var(--sap-brand); border-color: var(--sap-brand); color: #fff; font-weight: 600; }
.rb-chip.on small { opacity: .85; }
/* 标 / 非标 分段选择（2026-10-24）：放在摘要卡与工序 chips 之间 */
.rb-seg {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--sap-border-light); border-radius: 8px;
}
.rb-seg-label { font-size: 12.5px; color: #4a4d50; flex: none; }
.rb-seg-btn {
  flex: none; height: 30px; min-width: 56px; padding: 0 14px;
  border-radius: 15px; border: 1px solid var(--sap-border-strong);
  background: #fff; color: var(--sap-text); font-size: 12.5px; cursor: pointer;
}
.rb-seg-btn.on { background: var(--sap-brand); border-color: var(--sap-brand); color: #fff; font-weight: 600; }
.rb-seg-btn.on[data-std="非标"] { background: var(--sap-warning); border-color: var(--sap-warning); }
.rb-seg-tip { margin-left: auto; font-size: 11px; color: var(--sap-text-muted); }
/* 字段行 */
.rb-field {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid #f1f3f5;
}
.rb-field:last-child { border-bottom: none; }
.rb-field > label { flex: none; width: 76px; font-size: 12.5px; color: #4a4d50; }
.rb-field > label i { font-style: normal; color: #bb0000; }
.rb-field input, .rb-field select {
  flex: 1 1 auto; min-width: 0; height: 40px;
  padding: 0 10px; font-size: 15px; color: var(--sap-text);
  border: 1px solid var(--sap-border-strong); border-radius: 5px; background: #fff;
}
.rb-field input:focus, .rb-field select:focus {
  outline: none; border-color: var(--sap-brand);
  box-shadow: 0 0 0 3px rgba(10,110,209,.14);
}
.rb-qty { padding: 10px 12px; }
.rb-qty input {
  height: 54px; font-size: 26px; font-weight: 700; text-align: center;
  letter-spacing: .5px; font-family: var(--font-mono);
}
/* 计时提示（选择计时时出现：数量非必填） */
.rb-mode-tip {
  padding: 8px 12px 10px; font-size: 11.5px; line-height: 1.5; color: #8a6d3b;
  background: #fffaf0;
}
/* ============================================================
   build 209：扫码面板里的「规格分项」（合并单下来的一批）
     上面填「本次总量」→ 按顺序逐款填满下面的分项；改单款则合计自动跟着变
   ============================================================ */
.rb-spec-card { margin-top: -2px; }
.rb-specs-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid #f1f3f5;
  font-size: 12.5px; color: #4a4d50;
}
.rb-specs-head b { color: var(--sap-brand); font-size: 13px; }
.rb-specs-head em { margin-left: auto; font-style: normal; font-size: 11.5px; color: #8a9299; }
.rb-spec-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-bottom: 1px solid #f5f7f8;
}
.rb-spec-item:last-child { border-bottom: none; }
.rb-spec-sp { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.rb-spec-sp i { font-style: normal; color: #a8b0b8; font-size: 11px; min-width: 14px; text-align: right; }
.rb-spec-sp b {
  color: var(--sap-brand); font-family: var(--font-mono); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rb-spec-sp em { font-style: normal; font-size: 11px; color: #8a9299; white-space: nowrap; }
.rb-spec-item input {
  flex: none; width: 96px; height: 44px; text-align: center;
  font-size: 19px; font-weight: 700; font-family: var(--font-mono);
  border: 1px solid var(--sap-border-strong); border-radius: 5px; background: #fff;
  color: var(--sap-text); padding: 0 6px;
}
.rb-spec-item input:focus {
  outline: none; border-color: var(--sap-brand);
  box-shadow: 0 0 0 3px rgba(10,110,209,.14);
}
/* build 223：规格分项每行的「单价」—— 放在数量框左边（原黑圈位置）。
   同一工序合并了不同物料时单价各不同，合并单 / 单行面板 / 扫码面板共用。 */
.rb-spec-item .rb-unit {
  flex: none; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; color: #0a6ed1;
  font-family: var(--font-mono); letter-spacing: .2px;
}
.rb-sheet.rb-worker .rb-unit,
.rb-sheet.rb-worker .rb-wage-line { display: none; }
.rb-specs-sum {
  display: flex; align-items: baseline; gap: 6px;
  padding: 8px 12px 9px; font-size: 12.5px; color: #5b636a;
  background: #fafbfc; border-top: 1px solid #f1f3f5;
}
.rb-specs-sum b { color: #d14900; font-size: 17px; font-family: var(--font-mono); }
.rb-specs-sum em { font-style: normal; color: #c0392b; font-size: 11px; }
/* build 210：手机合并单面板 —— 第二层按「订单 · 工序」分段 */
.rb-grp-sec {
  margin: 8px 0 3px; padding: 4px 8px; background: #eef4fb; border-radius: 3px;
  font-size: 11.5px; font-weight: 600; color: #2c5c8f;
}
.rb-spec-sp u { text-decoration: none; font-size: 10.5px; color: #8a9299; margin-left: 6px; white-space: nowrap; }
.rb-grp-tip { margin: 8px 2px 2px; font-size: 11px; color: #8a9299; line-height: 1.7; }
/* build 211：手机合并单面板 —— 第一层压缩成一行（省屏幕），
   规格 / 销售订单 / 物料品号全部下沉到第二层各行 */
.rb-sum-compact {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 12px; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--sap-border); border-radius: 6px;
  font-size: 12.5px; color: #4a4d50;
}
.rb-sum-compact > span { flex: none; font-size: 11.5px; color: #6a6d70; }
.rb-sum-compact > b { min-width: 0; font-weight: 600; color: var(--sap-text); word-break: break-all; }
.rb-spec-lines { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rb-spec-lines .rb-spec-sp { flex: none; }
.rb-spec-sub {
  font-size: 11px; color: #8a9299; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rb-spec-sub .rb-so { color: #2c5c8f; font-weight: 600; }
.rb-spec-sub u { text-decoration: none; color: #e9730c; font-family: var(--font-mono); font-size: 10.5px; }
/* 更多（折叠） */
.rb-more {
  background: #fff; border: 1px solid var(--sap-border); border-radius: 6px;
  margin-bottom: 9px; overflow: hidden;
}
.rb-more > summary {
  padding: 10px 12px; font-size: 12.5px; color: var(--sap-brand);
  cursor: pointer; list-style: none;
}
.rb-more > summary::-webkit-details-marker { display: none; }
.rb-more > summary::after { content: '⌄'; float: right; color: #8a9299; }
.rb-more[open] > summary { border-bottom: 1px solid #f1f3f5; }
.rb-more[open] > summary::after { content: '⌃'; }
/* 工资预览 */
.rb-wage {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #fff;
  border: 1px solid var(--sap-border); border-radius: 6px;
  font-size: 12.5px; color: #6a6d70;
}
.rb-wage b { color: #d14900; font-size: 18px; font-family: var(--font-mono); }
.rb-wage span:last-child { margin-left: auto; font-size: 11px; color: #8a9299; text-align: right; }
/* 底部操作条 */
.rb-foot {
  flex: none; display: flex; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--sap-border);
}
.rb-foot .btn { flex: 1 1 0; height: 44px; font-size: 15px; }
.rb-foot .btn.rb-primary { flex: 2 1 0; font-weight: 600; }
.rb-foot .btn[disabled] { opacity: .6; }
/* 桌面（>768px）：居中卡片，避免全屏太夸张 */
@media (min-width: 769px) {
  .rb-sheet {
    inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 520px; height: auto; max-height: 88vh;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.28);
    animation: none;
  }
  .rb-body { padding: 12px; }
}

/* ===== 扫码入库面板（外壳复用上面的 rb-sheet，仅明细区单独排版） ===== */
.ib-lines-hd {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid #f1f3f5;
  font-size: 12.5px; font-weight: 600; color: var(--sap-text);
}
.ib-lines-hd span { margin-left: auto; font-size: 11px; font-weight: 400; color: #8a9299; }
.ib-line { padding: 9px 12px; border-bottom: 1px solid #f1f3f5; }
.ib-line:last-of-type { border-bottom: none; }
.ib-line-hd { display: flex; align-items: center; gap: 8px; }
.ib-line-hd b { font-size: 14px; font-family: var(--font-mono); color: var(--sap-text); }
.ib-line-sub { margin-top: 2px; font-size: 11.5px; line-height: 1.45; color: #6a6d70; word-break: break-all; }
.ib-line-ft { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.ib-avail { flex: none; font-size: 11.5px; color: var(--sap-brand); }
.ib-qty {
  flex: 1 1 auto; min-width: 0; height: 44px; text-align: center;
  font-size: 20px; font-weight: 700; font-family: var(--font-mono);
  color: var(--sap-text); background: #fff;
  border: 1px solid var(--sap-border-strong); border-radius: 5px;
}
.ib-qty:focus { outline: none; border-color: var(--sap-brand); box-shadow: 0 0 0 3px rgba(10,110,209,.14); }
/* build 234：手机采购入库「扫物料」—— 明细里的物料输入框（点一下扫物料条码） */
.ib-scanrow { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #f1f3f5; }
.ib-scan-in {
  height: 44px; font-size: 15px; text-align: center;
  color: var(--sap-brand); background: #f5faff;
  border: 1px dashed var(--sap-brand); border-radius: 5px;
  cursor: pointer;
}
.ib-scan-in::placeholder { color: #5a8fbe; }
.ib-scanrow .ib-mat-pick { height: 36px; font-size: 13px; }
.ib-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: #8a9299; }
.ib-line-x {
  margin-left: auto; width: 26px; height: 26px; line-height: 1; padding: 0;
  font-size: 16px; color: #98a2ad; background: transparent;
  border: 1px solid #e3e8ed; border-radius: 50%; cursor: pointer;
}
.ib-line-x:hover { color: #bb0000; border-color: #f0c2c2; background: #fff7f7; }

.ib-tip { padding: 8px 12px 10px; font-size: 11px; line-height: 1.6; color: #8a6d3b; background: #fffaf0; }

/* 打印预览 */
.print-sheet { background: #fff; padding: 24px; max-width: 780px; margin: 0 auto; color: #000; }
.print-title { display: flex; flex-wrap: wrap; gap: 16px 32px; margin-bottom: 12px; font-size: 13px; }
.print-title b { color: #000; }
.print-group { margin-bottom: 22px; page-break-inside: avoid; }
.print-group h3 { margin: 0 0 6px; font-size: 14px; border-bottom: 2px solid #333; padding-bottom: 4px; font-weight: 600; }

/* ============================================================
   勾选打印条（采购订单 / 入库 / 出库 / 质检单据共用）
   注意：类名刻意不用 .toolbar —— TableOps 会把 .toolbar 里的按钮搬进
   「列设置」栏，打印按钮就又被藏起来了，用户找不到。
   ============================================================ */
.print-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 7px 10px; margin: 0 0 8px;
  background: #eef6fd; border: 1px solid #cfe3f6; border-radius: 4px;
  font-size: 12px; color: #40505e;
}
.print-bar .pb-count { font-weight: 600; color: var(--sap-brand); }
.print-bar .pb-count b { font-size: 14px; }
.print-bar .pb-hint { margin-left: auto; font-size: 11px; color: #7b8794; }
.print-bar .btn { height: 28px; }

/* 单据选择器（build 176 · 入库/出库「退单」）：搜索 + 勾选 + 确认 */
.doc-pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.doc-pick-bar .input { flex: 1 1 220px; max-width: 320px; height: 30px; }
.doc-pick-cnt { font-size: 12px; color: #5a6b7b; }
.doc-pick-hint { font-size: 11.5px; color: #7b8794; line-height: 1.6; margin-bottom: 8px; }
.doc-pick-wrap { max-height: 56vh; overflow: auto; border: 1px solid #e3e8ee; border-radius: 4px; }
.doc-pick-wrap thead th { position: sticky; top: 0; z-index: 1; background: #f5f7f9; }
.doc-pick-wrap tbody tr { cursor: pointer; }
.doc-pick-wrap tbody tr.pick-on { background: #fff5f5; box-shadow: inset 3px 0 0 #bb0000; }
.doc-pick-wrap tbody tr:hover { background: #f7fbff; }
.doc-pick-wrap tbody tr.pick-on:hover { background: #ffecec; }
.doc-pick-wrap input.pick-chk { width: 16px; height: 16px; cursor: pointer; }
.doc-pick-sel { margin-right: auto; font-size: 12px; font-weight: 600; color: #bb0000; }

/* 打印纸内的两层表格 */
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid #222; padding-bottom: 6px; margin-bottom: 8px; }
.ps-head .ps-h1 { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ps-head .ps-qr { text-align: center; font-size: 9px; color: #333; line-height: 1.1; }
/* build 242：给二维码留静白边（quiet zone）。qrcodejs 画出来是满幅无留白的，
   边缘贴着表格线和文字，手机识别率会明显下降 */
.ps-head .ps-qr .pqr { display: inline-block; background: #fff; padding: 5px; }
.ps-head .ps-qr > div:last-child { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px auto 0; }
.ps-head .ps-qr div[title] { margin: 0 auto; }
.ps-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px 10px; font-size: 11px; margin-bottom: 8px; }
.ps-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-meta b { font-weight: 600; }
.ps-doc { border: 1px solid #000; border-collapse: collapse; width: 100%; font-size: 11px; margin-bottom: 10px; }
.ps-doc th, .ps-doc td { border: 1px solid #000; padding: 3px 5px; }
.ps-doc th { background: #f0f0f0; font-weight: 600; white-space: nowrap; }
.ps-doc td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* build 203 · 处置单（退货 / 报废 / 返工）打印表：横向一行一张单，绿色细框
   对应需求 2 给的排版样式 —— 项目 / 单号 / 日期 / 销售订单 / 产品 SKU / 产品名称 /
   数量 / 不合格原因 / 处理要求 / 状态 */
.ps-doc.ps-disp { border: 1.5px solid #0f7b5a; table-layout: fixed; }
.ps-doc.ps-disp th, .ps-doc.ps-disp td { border: 1px solid #0f7b5a; padding: 3px 4px; font-size: 10.5px; }
.ps-doc.ps-disp th { background: #eef5f2; color: #0d3b2c; font-weight: 600; text-align: center; }
.ps-doc.ps-disp td:first-child { text-align: center; }
.ps-sub { font-size: 11px; font-weight: 600; margin: 8px 0 4px; }
.ps-sign { display: flex; justify-content: space-between; font-size: 11px; margin-top: 18px; }

/* 按供应商分页的打印页头：把供应商信息集中放在最上面，采购拿这张纸就能下单 */
.ps-sup { border: 1.5px solid #222; border-radius: 2px; padding: 6px 9px 7px; margin-bottom: 8px; background: #fbfbfb; }
.ps-sup-t { font-size: 10px; letter-spacing: 3px; color: #555; }
.ps-sup-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; margin: 1px 0 4px; }
.ps-sup-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 12px; font-size: 10.5px; }
.ps-sup-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-sup-meta b { font-weight: 600; }
/* 该页的表格紧贴供应商框，看起来是一整块「给这家供应商的订单」 */
.ps-sup + .ps-head { margin-top: 2px; }
/* 按供应商分页的表格有 12 列，固定列宽 + 小一号字，保证 A4 纸内不出界 */
.ps-wide .ps-doc { table-layout: fixed; font-size: 9.5px; }
.ps-wide .ps-doc th, .ps-wide .ps-doc td { padding: 2px 3px; white-space: normal; word-break: break-all; }
/* 采购订单按供应商打印：14 列（销售订单 / 物料型号 / 下单时间 / 预计到货全要显示）
   → 用 A4 横向；屏幕上预览也按横向宽度显示，所见即所打 */
@page pswide { size: A4 landscape; margin: 8mm; }
.print-sheet.ps-land { max-width: 1060px; }
.ps-land .ps-doc { font-size: 10px; }
.ps-doc td { word-break: break-all; }

/* 表格里就地改日期（下单时间 / 预计到货） */
.date-inline { width: 100%; max-width: 108px; box-sizing: border-box; font: inherit; font-size: 11.5px; padding: 1px 2px;
  border: 1px solid transparent; border-radius: 2px; background: transparent; color: inherit; }
.date-inline:hover { border-color: #d5dadd; background: #fff; }
.date-inline:focus { outline: none; border-color: var(--sap-brand); background: #fff; }
.date-inline:disabled { color: inherit; opacity: .9; }
.spec-wrap { display: inline-flex; gap: 3px; align-items: center; }
.spec-wrap .spec-in { width: 58px; min-width: 0; }

/* 退单确认弹窗 */
.ret-sum { font-size: 13px; line-height: 1.6; padding: 8px 10px; background: #f5f6f7; border-left: 3px solid var(--sap-error); border-radius: 2px; }
.ret-hint { font-size: 11.5px; color: #6a6d70; line-height: 1.65; margin-top: 8px; }

@media print {
  .app-layout, .topbar, .sidebar, .toolbar, .pager, .no-print { display: none !important; }
  .modal-mask { position: static !important; inset: auto !important; background: #fff !important; overflow: visible !important; padding: 0 !important; display: block !important; }
  .modal-box { position: static !important; max-height: none !important; overflow: visible !important; box-shadow: none !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; border-radius: 0 !important; }
  .modal-header, .modal-footer { display: none !important; }
  .print-sheet { box-shadow: none; max-width: 100%; padding: 0; }
  /* 打印预览区：去掉弹窗内边距，避免横向纸被挤窄 */
  .print-area { padding: 0 !important; }
  /* 一家供应商 / 一张单据独占一页（按供应商分页就靠这条） */
  .print-sheet { page-break-inside: avoid; break-inside: avoid; page-break-after: always; break-after: page; }
  .print-sheet:last-child { page-break-after: auto !important; break-after: auto !important; }
  /* 采购订单按供应商：切到命名页（A4 横向），14 列才排得开 */
  .print-sheet.ps-land { page: pswide; max-width: 100%; padding: 0; }
}

/* 采购进度分区 */
.prog-section { margin-bottom: 16px; }
.prog-h { font-weight: 600; color: var(--sap-text); margin-bottom: 8px; padding: 7px 10px; background: #f2f2f2; border-left: 3px solid var(--sap-warning); border-radius: 2px; font-size: 13px; }

/* ============================================
   SKU 搜索选择器
   ============================================ */
.sku-picker { border: 1px solid var(--sap-border-light); border-radius: var(--radius); background: #fff; }
.sku-picker-bar { display: flex; gap: 6px; align-items: center; padding: 8px; background: #fafafa; border-bottom: 1px solid var(--sap-border-light); flex-wrap: wrap; }
.sku-picker-bar .input { flex: 1 1 200px; }
.sku-picker-bar .select { flex: 0 0 150px; }
.sku-picker-tip { font-size: 11px; color: var(--sap-text-muted); }
.sku-picker-sel { padding: 7px 10px; border-bottom: 1px solid var(--sap-border-light); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.sku-none { color: var(--sap-text-faint); font-size: 12px; }
.sku-picked b { color: var(--sap-text); }
.sku-list { max-height: 260px; overflow: auto; }
/* 候选列表的类别小标题：未指定类型时按类别分组，确保每个类别都能露头 */
.sku-group { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center;
  padding: 3px 10px; background: #f2f4f5; border-bottom: 1px solid var(--sap-border-light);
  font-size: 11px; font-weight: 600; color: #515559; letter-spacing: .3px; }
.sku-group span { font-weight: 400; color: var(--sap-text-muted); }
.sku-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--sap-border-light); cursor: pointer; font-size: 12px; }
.sku-item:hover { background: var(--sap-brand-hover); }
.sku-item.sel { background: var(--sap-info-bg); box-shadow: inset 3px 0 0 var(--sap-brand); }
.sku-item-main { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.sku-item-main b { color: var(--sap-text); font-family: var(--font-mono); font-weight: 600; }
.sku-item-name { color: var(--sap-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.sku-item-side { display: flex; gap: 6px; align-items: center; flex: none; }
.sku-item-model, .sku-item-spec { font-size: 11px; color: var(--sap-text-muted); }
.sku-empty { padding: 18px; text-align: center; color: var(--sap-text-faint); font-size: 12px; }
.sku-hint { font-size: 11px; color: var(--sap-text-muted); margin-top: 8px; }

/* ============================================
   BOM 流程设计录入（物料层 + 工艺层1~5 + 成品层）
   ============================================ */
.bom-sec { margin-top: 14px; }
.bom-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.bom-sec-h .t { font-size: 13px; font-weight: 600; color: var(--sap-text); border-left: 3px solid var(--sap-brand); padding-left: 8px; }
.bom-sec-h .t small { font-weight: normal; color: var(--sap-text-muted); margin-left: 6px; font-size: 11px; }
.bom-mat-table { width: 100%; }
.bom-mat-table th { font-size: 11px; }
.bom-chain-row > td { background: #f7fafd !important; padding: 0 0 10px 0 !important; white-space: normal; }
.chain-box { padding: 10px 12px; border-left: 3px solid var(--sap-brand); margin: 0 0 0 10px; }
.chain-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.chain-h .t { font-size: 12px; font-weight: 600; color: var(--sap-text); }
.chain-none { font-size: 12px; color: var(--sap-text-faint); padding: 6px 0; }
.chain-table { width: 100%; background: #fff; }
.chain-table th { background: #f2f2f2; font-size: 11px; }
.chain-table td { padding: 3px 5px; }
.chain-table .input, .chain-table .select { height: 24px; padding: 0 6px; font-size: 11px; }
/* build 184：工艺链「上道完成 SKU / 上道物料名称」——本道工序的输入（只读，链式推导） */
.chain-table td.chain-in { background: #f4f7fb; vertical-align: middle; }
.chain-table td.chain-in .ci-sku {
  display: inline-block; font-family: Consolas, ui-monospace, monospace; font-weight: 700;
  color: #0a4f8a; font-size: 11px; letter-spacing: 0.2px; white-space: nowrap;
}
.chain-table td.chain-in .ci-name { display: block; font-size: 11px; color: var(--sap-text-muted); line-height: 1.25; }
.chain-table td.chain-in .ci-arrow { font-style: normal; color: #8a949e; font-size: 11px; margin-left: 4px; }
.chain-table tr + tr td.chain-in .ci-sku { color: #0a6ed1; }
.multi-box { margin-top: 6px; padding: 8px 10px; background: #fafafa; border: 1px solid var(--sap-border); border-radius: var(--radius); }
.multi-box .mrow { display: grid; grid-template-columns: 1.3fr 1.4fr 0.9fr 80px 28px; gap: 6px; margin-bottom: 5px; align-items: center; }
.multi-h { font-size: 11px; color: var(--sap-text); font-weight: 600; margin-bottom: 6px; }
.bom-sum { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 12px; padding: 10px 12px; background: #fafafa; border: 1px solid var(--sap-border-light); border-radius: var(--radius); font-size: 12px; }
.bom-sum b { color: var(--sap-text); }
.bom-sum .money { color: var(--sap-brand); font-size: 15px; font-weight: 600; }
.bom-state { font-size: 11px; padding: 1px 8px; border-radius: 2px; font-weight: 600; }
.bom-state.ok { background: var(--sap-success-bg); color: var(--sap-success); }
.bom-state.no { background: var(--sap-warning-bg); color: #b95100; }
.layer-pill { display: inline-block; min-width: 40px; text-align: center; padding: 1px 6px; border-radius: 2px; background: var(--sap-info-bg); color: #0854a0; font-size: 11px; font-weight: 600; }
.layer-pill.final { background: #f2f2f2; color: var(--sap-text); }
.multi-link { background: #fff; color: var(--sap-brand); border: 1px solid var(--sap-brand); border-radius: var(--radius); padding: 1px 8px; font-size: 11px; font-weight: 600; cursor: pointer; height: 22px; }
.multi-link:hover { background: var(--sap-brand-hover); }

/* 超宽弹窗 */
.modal-box.xl { max-width: 1240px; }
@media (max-width: 1280px) { .modal-box.xl { max-width: 96vw; } }

/* ============================================
   采购订单明细（需求数量 / 各库位现有量 / 实际下单数量）
   + 出库「按生产订单批量领用」
   ============================================ */
.po-hint { font-size: 11px; color: var(--sap-text-muted); margin-top: 3px; line-height: 1.5; }
.po-table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--sap-border); border-radius: var(--radius); }
.po-table { width: 100%; min-width: 1040px; }
.po-table th { font-size: 11px; line-height: 1.3; background: #f2f2f2; white-space: nowrap; height: 34px; }
.po-table td { padding: 4px 6px; vertical-align: middle; white-space: nowrap; }
.po-table .input, .po-table .select { height: 26px; padding: 0 6px; font-size: 12px; }
/* 入库明细「仓位 + 库位」两级下拉（v90） */
.ib-whloc { display: flex; gap: 4px; align-items: center; }
.ib-whloc .ib-wh  { width: 78px; flex: 0 0 78px; }
.ib-whloc .ib-loc { flex: 1 1 auto; min-width: 96px; }
/* 需检行的小提示：默认落待入库仓，但仍可逐行改（2026-11-05 需求 5） */
.ib-qc-tip { margin-top: 2px; font-size: 10.5px; color: #b95100; line-height: 1.3; }
.po-table .po-order-qty { font-weight: 600; color: var(--sap-text); background: #fffdf3; }
.po-loc { display: flex; flex-direction: column; gap: 2px; font-size: 11px; line-height: 1.4; }
.po-loc-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.6; }
.po-loc-wh { background: var(--sap-info-bg); color: #0854a0; border-radius: 2px; padding: 0 4px; font-size: 10px; }
.po-loc-code { color: var(--sap-text-muted); font-family: var(--font-mono); }
.po-loc-row b { color: var(--sap-success); margin-left: auto; padding-left: 6px; }
.po-loc-none { font-size: 11px; color: var(--sap-text-faint); }

/* 工艺路线「标 / 非标」：BOM 生成的工序只读（固定标），手工新增的可切换 */
.std-badge { display: inline-block; min-width: 34px; text-align: center; padding: 1px 7px; border-radius: 2px; font-size: 11px; font-weight: 600; line-height: 1.6; cursor: default; }
.std-badge.std { background: var(--sap-info-bg); color: #0854a0; }
.std-badge.nonstd { background: #fdf3e0; color: #b95100; }

/* 单据「销售订单SKU / 销售订单产品名称」快照：一个 SKU 一行，两列逐行对齐 */
.cell-line { font-size: 11.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* 采购列表「一个 SKU 一行」（2026-10-24 三次修订，对齐 WMS 入库管理）
   每一行都是完整独立行：勾选框可见可点、单据信息全显示、操作按钮都在。
   同一张采购单的多行用同一种底色，相邻两张单交替，这样既能看出「这几行是一张单」，
   又不影响逐行勾选 / 逐行打印。 */
tbody tr.po-grp-a > td { background: #ffffff; }
tbody tr.po-grp-b > td { background: #f6f9fb; }
tbody tr.po-grp-a.pop-hover > td,
tbody tr.po-grp-b.pop-hover > td { background: #eaf3fd; }
tbody tr.po-grp-a > td:first-child, tbody tr.po-grp-b > td:first-child { border-left: 3px solid transparent; }
tbody tr.po-grp-b > td:first-child { border-left-color: #cfdbe4; }
/* 兼容旧类名（防止其它模块残留样式失效） */
tbody tr.row-grp-cont > td { background: #f6f9fb; }
.row-sub { font-size: 10.5px; color: var(--sap-text-faint); font-weight: 400; line-height: 1.4; }
.row-cont { color: var(--sap-text-faint); font-size: 13px; padding-left: 2px; }
.pk-h { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sap-text); margin-bottom: 6px; }
.pk-h b { color: var(--sap-text); font-weight: 600; }

/* 按生产订单批量领用：状态条 / 提示胶囊 */
.pk-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 8px; font-size: 12px; color: var(--sap-text-muted);
  background: #f5f8fb; border: 1px solid var(--sap-border); border-radius: var(--radius);
}
.pk-bar b { color: var(--sap-text); font-weight: 600; }
.pk-bar-chk { margin-left: auto; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.pk-chip {
  display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; line-height: 16px;
  background: var(--sap-neutral-bg); color: var(--sap-neutral); white-space: nowrap;
}
.pk-chip-warn { background: #fff3d9; color: #8a5b00; }
.pk-chip-err { background: var(--sap-error-bg); color: var(--sap-error); }
.tag-nogroup { background: #f2f2f2; color: #6a6d70; border: 1px solid #e2e2e2; }

/* 采购明细：产品列（直接引用 SKU + 品名，不用下拉） */
.po-prod { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.po-prod-main { min-width: 0; flex: 1; line-height: 1.28; }
.po-prod-sku { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--sap-text); }
.po-prod-name { font-size: 11px; color: var(--sap-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.po-prod-none { color: var(--sap-warning); font-family: var(--font-sans); font-weight: 400; }
.po-prod-swap {
  flex: none; background: #fff; border: 1px solid var(--sap-border-strong); color: var(--sap-text-muted);
  border-radius: var(--radius); font-size: 11px; height: 22px; padding: 0 7px; cursor: pointer; opacity: .65;
}
.po-prod:hover .po-prod-swap { opacity: 1; }
.po-prod-swap:hover { border-color: var(--sap-brand); color: var(--sap-brand); background: var(--sap-brand-hover); }

/* 采购明细：产品名称 / 颜色 / 单位（按产品主数据带出，只读展示） */
.modal-box.full { max-width: min(1560px, 97vw); }
@media (max-width: 1600px) { .modal-box.full { max-width: 97vw; } }
.po-table.po-table-wide { min-width: 1360px; }
.po-name-cell { font-size: 12px; color: var(--sap-text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.po-dim-cell { font-size: 12px; color: var(--sap-text-muted); }
.po-table td.po-name-cell, .po-table td.po-dim-cell { white-space: nowrap; }
.po-loc-total { border-top: 1px dashed var(--sap-border); margin-top: 2px; padding-top: 2px; color: var(--sap-text-muted); }
.po-loc-total b { color: var(--sap-text); }

/* ============================================
   安全库存补货（补货物料报表）
   ============================================ */
.repl-badge {
  display: none; margin-left: 6px; background: #fff; color: #bb0000; font-size: 11px; font-weight: 700;
  border-radius: 9px; padding: 0 6px; line-height: 16px; vertical-align: middle;
}
.repl-note {
  font-size: 11px; color: var(--sap-text-muted); line-height: 1.7; background: var(--sap-info-bg, #f5faff);
  border: 1px solid #d8e8f7; border-radius: var(--radius); padding: 7px 10px; margin-bottom: 8px;
}
.repl-note b { color: #0854a0; }
.repl-note-sub { margin-left: 6px; color: var(--sap-text-faint, #999); }
.repl-filter { margin-bottom: 8px; }
.repl-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--sap-text-muted); }
.repl-filter-row label { display: inline-flex; align-items: center; gap: 5px; }
.repl-filter-row .select, .repl-filter-row .input { height: 28px; font-size: 12px; }
.repl-filter-row .input { width: 220px; }
.repl-filter-row .rp-chk { cursor: pointer; }
.repl-stat { margin-left: auto; font-size: 12px; color: var(--sap-text-muted); }
.repl-table { min-width: 1280px; }
.repl-table tr.rp-on td { background: #f2f9f2; }
.repl-table .rp-qty { width: 88px; font-weight: 600; background: #fffdf3; }
.repl-table .rp-price { width: 76px; }
.repl-foot { display: flex; align-items: center; gap: 10px; }
.repl-sum { margin-right: auto; font-size: 12px; color: var(--sap-text-muted); }
.repl-sum b { color: var(--sap-text); }

/* ============================================
   生产订单看板（在制进度 / 工序时间轴 / 打印时间）
   ============================================ */
.pb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.pb-kpi { background: #fff; border: 1px solid var(--sap-border, #e5e5e5); border-left: 3px solid #0a6ed1; border-radius: 4px; padding: 8px 12px; }
.pb-kpi-l { font-size: 11px; color: #6a6d70; }
.pb-kpi-v { font-size: 21px; font-weight: 700; color: #32363a; line-height: 1.35; }
.pb-kpi-s { font-size: 11px; color: #8a8d90; line-height: 1.4; }

.pb-head, .pb-main { display: grid; grid-template-columns: 1.7fr 1.5fr .85fr .85fr .95fr .6fr; gap: 10px; align-items: center; }
.pb-head { padding: 6px 10px; background: #f2f2f2; border-bottom: 1px solid #d9d9d9; font-size: 11px; font-weight: 600; color: #6a6d70; }
.pb-row { border-bottom: 1px solid #ededed; background: #fff; }
.pb-row:hover { background: #f7fbff; }
.pb-row.overdue { border-left: 3px solid #bb0000; }
.pb-row.open { background: #fcfdff; }
.pb-main { padding: 7px 10px; cursor: pointer; font-size: 12px; }
.pb-c1 { min-width: 0; }
.pb-caret { display: inline-block; width: 12px; color: #6a6d70; font-size: 10px; }
.pb-no { font-weight: 700; color: #32363a; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pb-prod { display: block; margin-left: 12px; color: #6a6d70; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-bar { display: inline-block; width: 78px; height: 8px; background: #e9edf0; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.pb-bar i { display: block; height: 100%; border-radius: 4px; transition: width .3s; }
.pb-qty { margin-left: 6px; font-size: 12px; color: #32363a; }
.pb-pct { margin-left: 4px; font-size: 11px; color: #6a6d70; }
.pb-none { color: #a4a8ab; font-size: 11px; }
.pb-st { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11px; line-height: 1.6; }
.pb-times { font-size: 10px; color: #6a6d70; }
.pb-meta { margin-left: auto; font-size: 11px; color: #6a6d70; }
.pb-auto { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #32363a; cursor: pointer; }

.pb-detail { padding: 4px 12px 12px 24px; background: #fbfcfd; border-top: 1px dashed #e5e5e5; }
.pb-gantt { padding: 8px 0 4px; }
.pb-g-title { font-size: 11px; font-weight: 600; color: #6a6d70; margin-bottom: 4px; }
.pb-g-row { display: grid; grid-template-columns: 130px 1fr 150px; gap: 8px; align-items: center; margin-bottom: 3px; }
.pb-g-name { font-size: 11px; color: #32363a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-g-track { position: relative; height: 14px; background: #f2f4f5; border-radius: 2px; }
.pb-g-track i { position: absolute; top: 0; height: 100%; border-radius: 2px; opacity: .85; }
.pb-g-txt { font-size: 11px; color: #6a6d70; }
.pb-g-none { font-size: 11px; color: #a4a8ab; grid-column: 2 / span 2; }

.pb-table { width: 100%; min-width: 900px; margin-top: 6px; }
.pb-table th { font-size: 11px; background: #eef2f5; white-space: nowrap; }
.pb-table td { padding: 4px 6px; font-size: 12px; }
.pb-num { color: #8a8d90; text-align: center; }
.pb-r { text-align: right; }
.pb-foot { margin-top: 6px; font-size: 11px; color: #6a6d70; }

@media (max-width: 900px) {
  .pb-kpis { grid-template-columns: repeat(2, 1fr); }
  .pb-head { display: none; }
  .pb-main { grid-template-columns: 1fr 1fr; gap: 6px; }
  .pb-c3, .pb-c4 { font-size: 11px; }
  .pb-g-row { grid-template-columns: 90px 1fr 110px; }
}

/* 花名册：状态分栏按钮组 / 日期列宽度 */
#emp-st-tabs .btn.sm { margin-right: 4px; }
#emp-st-tabs .btn.sm:last-child { margin-right: 0; }
#emp-list td input.df { min-width: 118px; }

/* ============================================
   工序库：关联 SKU 多选（标签 + 手工补录）
   ============================================ */
.sku-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 5px 1px 8px; border: 1px solid #cdd5dd; border-radius: 12px;
  background: #f5f7f9; font-size: 12px; line-height: 1.8; max-width: 100%;
}
.sku-chip b { font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); color: #32363a; font-weight: 600; }
.sku-chip i { font-style: normal; font-size: 10px; color: #6a6d70; padding-left: 2px; }
.sku-chip-x { border: none; background: none; cursor: pointer; color: #8a8d90; font-size: 13px; line-height: 1; padding: 0 3px; }
.sku-chip-x:hover { color: #bb0000; }
.ns-picked-view { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; background: #f5f6f7; border: 1px dashed #e5e5e5; border-radius: 4px; min-height: 32px; }
.sku-mtag {
  display: inline-block; margin: 1px 4px 1px 0; padding: 0 5px;
  font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 11px; line-height: 1.7; background: #eef2f5; color: #32363a;
  border: 1px solid #dfe4e8; border-radius: 3px;
}

/* ============================================
   生产订单打印：页头「工作组扫码」二维码
   ============================================ */
.p-pgqr { flex: none; width: 118px; text-align: center; }
.p-pgqr .pqr { width: 100%; min-height: 76px; display: flex; align-items: center; justify-content: center; background: #fff; }
.p-pgqr .pqr img, .p-pgqr .pqr canvas { display: block; max-width: 100%; }
.p-pgqr-cap { font-size: 10px; color: #444; margin-top: 2px; letter-spacing: 1px; }
.p-pgqr-code { font-size: 9px; color: #333; font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); word-break: break-all; line-height: 1.25; }
.pqr-txt { font-size: 10px; font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); color: #000; border: 1px dashed #999; padding: 2px 3px; word-break: break-all; }

/* 打印行内条码：不写死宽高，SVG 拉满所在框（宽度跟列宽、高度跟框高，随纸张一起缩放） */
.bc-box { width: 100%; height: 34px; line-height: 0; overflow: hidden; }
.bc-box svg, .bc-box img, .bc-box canvas { width: 100% !important; height: 100% !important; display: block; }

/* ============================================
   工序库：工序编码徽标 + 翻倍区间档位编辑表
   ============================================ */
.code-tag {
  display: inline-block; padding: 0 5px; font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 11px; line-height: 1.7; color: #0a6ed1; background: #eef4fb;
  border: 1px solid #d3e2f3; border-radius: 3px; white-space: nowrap;
}
.ns-tier-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ns-tier-table th {
  background: #f5f6f7; color: #32363a; font-weight: 600; font-size: 11px;
  text-align: left; padding: 4px 6px; border: 1px solid #e5e5e5; white-space: nowrap;
}
.ns-tier-table td { padding: 3px 4px; border: 1px solid #e5e5e5; }
.ns-tier-table .input { width: 100%; padding: 3px 6px; height: 26px; font-size: 12px; }

/* ============================================
   报表入口卡片（SAP Fiori Launchpad 瓦片风格）
   —— 考勤管理 / 宿舍管理 等模块的报表入口统一用这种卡片；
      当前选中的入口用 SAP 通用蓝（--sap-brand #0a6ed1）高亮
   ============================================ */
/* 需求（2026-10-24 #1）：入口卡片高度压缩到「图标 + 文字」刚好放得下，不再留大片空白 */
.entry-tiles {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--space-3);
}
.entry-tile {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px;
  min-height: 30px; height: 30px; padding: 0 10px;
  background: var(--sap-tile); border: 1px solid var(--sap-border-light); border-radius: 5px;
  color: var(--sap-text); font-size: 12px; line-height: 1; text-align: center; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.entry-tile .et-ico { width: 15px; height: 15px; display: block; opacity: .8; flex: none; }
.entry-tile .et-ico svg { width: 100%; height: 100%; display: block; }
.entry-tile .et-label { font-weight: 500; }
.entry-tile .et-sub { font-size: 10px; color: var(--sap-text-faint); }
.entry-tile:hover { border-color: var(--sap-brand); background: var(--sap-brand-hover); color: var(--sap-brand); }
.entry-tile:hover .et-ico { opacity: 1; }
.entry-tile.active {
  background: var(--sap-brand); border-color: var(--sap-brand); color: #fff;
  box-shadow: 0 2px 8px rgba(10,110,209,.28);
}
.entry-tile.active .et-ico { opacity: 1; }
.entry-tile.active .et-sub { color: rgba(255,255,255,.82); }

@media (max-width: 768px) {
  .entry-tiles { gap: 5px; }
  .entry-tile { height: 28px; min-height: 28px; padding: 0 8px; font-size: 11.5px; gap: 4px; }
  .entry-tile .et-ico { width: 13px; height: 13px; }
}

/* ============================================
   排班月表：横向 1 号 → 月末，纵向按员工
   ============================================ */
.sch-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--sap-border); border-radius: 4px; background: #fff; }
.sch-table { border-collapse: separate; border-spacing: 0; font-size: 11px; width: max-content; }
.sch-table th, .sch-table td { border-right: 1px solid var(--sap-border-light); border-bottom: 1px solid var(--sap-border-light); padding: 0; }
.sch-table thead th {
  position: sticky; top: 0; z-index: 3; background: #f2f2f2; color: var(--sap-text);
  font-weight: 600; height: 40px; padding: 2px 0; text-align: center; white-space: nowrap;
}
.sch-table thead th.wk-rest { color: var(--sap-error); }
.sch-table thead th .d { display: block; font-size: 12px; font-weight: 700; line-height: 1.2; }
.sch-table thead th .w { display: block; font-size: 10px; color: var(--sap-text-muted); line-height: 1.2; }
.sch-table thead th.wk-rest .w { color: var(--sap-error); }
.sch-table .col-emp { position: sticky; left: 0; z-index: 2; background: #fff; }
.sch-table thead th.col-emp { z-index: 4; background: #f2f2f2; text-align: left; padding-left: 8px; }
.sch-table td.col-emp { width: 140px; min-width: 140px; padding: 3px 6px; }
.sch-table td.col-emp .nm { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sch-table td.col-emp .dp { font-size: 10px; color: var(--sap-text-muted); }
.sch-table td.col-emp select { width: 100%; height: 22px; font-size: 11px; margin-top: 2px; }
.sch-cell { width: 36px; min-width: 36px; height: 36px; text-align: center; cursor: pointer; user-select: none; padding: 0; }
.sch-cell:hover { box-shadow: inset 0 0 0 1px var(--sap-brand); }
.sch-cell .t { display: block; font-size: 12px; font-weight: 600; line-height: 1.25; }
.sch-cell .s {
  display: block; font-size: 8.5px; line-height: 1.05; opacity: .85;
  padding: 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sch-cell.w { background: #e8f5ec; color: #107e3e; }
.sch-cell.r { background: #f2f2f2; color: #6a6d70; }
.sch-cell.sp { background: #e8f1f8; color: var(--sap-brand); }
.sch-cell.h { background: #fdecea; color: #bb0000; }          /* 法定日 */
.sch-cell.h .t { font-size: 11px; letter-spacing: -0.5px; }
.sch-cell.d { background: #fff4e5; color: #b95100; position: relative; }   /* v124 值班：不算班，出勤工时进「超出勤」 */
.sch-cell.d::after {
  content: ''; position: absolute; inset: 0; border: 1px dashed #e6a23c; border-radius: 2px; pointer-events: none;
}
/* v126 节假日安排出勤：格子仍显示「班」，第二行显示「法出 / 休出」，底色按节假日走 */
.sch-cell.hw { background: #fdecea; color: #107e3e; }   /* 法定日出勤 → 进「法定日出勤」 */
.sch-cell.rw { background: #efeee9; color: #107e3e; }   /* 集体休息日出勤 → 进「超出勤」 */
.sch-cell.hw { box-shadow: inset 0 0 0 1px #d99a93; }
.sch-cell.rw { box-shadow: inset 0 0 0 1px #b8b2a3; }
.sch-cell.hw .s, .sch-cell.rw .s { font-weight: 600; }
.sch-cell.hw .s { color: #bb0000; }
.sch-cell.rw .s { color: #7d7666; }
.sch-table tbody tr.off td { opacity: .55; }

/* v126：排班浮层里的节假日提示 */
.sc-pop-tip {
  margin: 6px 8px; padding: 6px 8px; font-size: 11px; line-height: 1.65;
  background: #fdf6ec; border: 1px solid #f0d9b5; border-radius: 4px; color: #8a5a1a;
}

/* 排班：当日班次选择浮层 */
.sc-pop {
  position: fixed; z-index: 2600; width: 210px; max-height: 330px; overflow: auto;
  background: #fff; border: 1px solid var(--sap-border); border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18); font-size: 12px;
}
.sc-pop-hd {
  position: sticky; top: 0; z-index: 1;
  padding: 7px 10px; font-weight: 600; background: #f5f6f7;
  border-bottom: 1px solid var(--sap-border-light); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sc-pop-sec { padding: 7px 10px 2px; font-size: 10px; color: #8a8d90; letter-spacing: .3px; }
.sc-pop-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; cursor: pointer; }
.sc-pop-item:hover { background: var(--sap-brand-hover); }
.sc-pop-item.on { background: var(--sap-info-bg); color: var(--sap-brand); font-weight: 600; }
.sc-pop-seg { font-size: 10px; color: #8a8d90; font-weight: 400; white-space: nowrap; }
.sc-pop-item.on .sc-pop-seg { color: var(--sap-brand); }
.sc-pop-empty { padding: 4px 10px 8px; color: #a4a8ab; font-size: 11px; line-height: 1.5; }
.sc-pop-foot { border-top: 1px solid var(--sap-border-light); padding: 6px 10px; text-align: right; }

/* ============================================================
   全局交互增强（js/ux.js）
   ① 可输入模糊下拉（combobox）——原生 select 隐藏，输入框可视化
   ② 表头拖拽调宽（.col-resizer 常显 + 拖拽态）
   ============================================================ */
.cbx-sel { display: none !important; }
.cbx {
  position: relative; display: inline-flex; align-items: center;
  width: 100%; min-width: 0; vertical-align: middle;
}
.form-row .cbx, td .cbx, .filter-bar .cbx { width: 100%; }
.cbx > .cbx-in {
  width: 100%; min-width: 0; padding-right: 22px;
  cursor: text; background: #fff;
}
.cbx > .cbx-in::placeholder { color: #a4a8ab; }
.cbx > .cbx-btn {
  position: absolute; right: 0; top: 0; bottom: 0; width: 20px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: #6a6d70;
  font-size: 10px; cursor: pointer; padding: 0; line-height: 1;
}
.cbx > .cbx-btn:hover { color: var(--sap-brand); }
.cbx.open > .cbx-btn { color: var(--sap-brand); }
.cbx.open > .cbx-in { border-color: var(--sap-brand); box-shadow: 0 0 0 1px var(--sap-brand) inset; }
.cbx-pop {
  position: fixed; z-index: 3200;
  min-width: 180px; overflow: auto; max-height: 260px;
  background: #fff; border: 1px solid var(--sap-border); border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16); padding: 2px 0;
  font-size: 12px;
}
.cbx-pop[hidden] { display: none !important; }
.cbx-item {
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; line-height: 1.5;
}
.cbx-item:hover { background: var(--sap-brand-hover); }
.cbx-item.on { background: var(--sap-info-bg); color: var(--sap-brand); font-weight: 600; }
.cbx-item.cbx-blank { color: #8a8d90; font-style: italic; }
.cbx-empty, .cbx-more {
  padding: 8px 10px; color: #8a8d90; font-size: 11px; line-height: 1.6; white-space: normal;
}
/* 表格行内下拉：跟随表格紧凑高度 */
td .cbx > .cbx-in { height: 24px; font-size: 11px; padding: 0 20px 0 6px; }
.sch-table td.col-emp .cbx > .cbx-in { height: 22px; font-size: 11px; padding: 0 18px 0 4px; }
.sch-table td.col-emp .cbx > .cbx-btn { width: 16px; font-size: 9px; }

/* 表头拖拽：常显细线，hover 高亮；拖动时禁止选中文字 */
/* right 由 -3px 改为 0：th 现在 overflow:hidden，超出表格框的部分会被裁掉，热区只剩 4px */
.col-resizer { width: 7px; right: 0; }
.col-resizer::after {
  content: ''; position: absolute; left: 3px; top: 6px; bottom: 6px;
  width: 1px; background: #d6d9dc;
}
.col-resizer:hover::after { background: var(--sap-brand); width: 2px; left: 2px; }
body.col-resizing { user-select: none; cursor: col-resize; }
body.col-resizing * { cursor: col-resize !important; }

/* SKU 选择器：类别下拉被升格为 combobox 后仍保持窄宽度；收起模式隐藏候选列表 */
.sku-picker-bar .cbx { flex: 0 0 118px; }
.sku-list[hidden] { display: none !important; }
.sku-picker.sku-collapsed .sku-list { display: none; }

/* 生产看板：全流程节点链（采购下单 → … → 出库） */
.pb-flow {
  display: flex; align-items: stretch; gap: 2px; flex-wrap: wrap;
  padding: 5px 10px 7px 22px; background: #fafcfd; border-top: 1px dashed #edf0f2;
  font-size: 11px;
}
.pb-node {
  display: inline-flex; flex-direction: column; gap: 0;
  min-width: 84px; padding: 3px 8px; border-radius: 3px;
  background: #f4f5f6; border: 1px solid #e6e8ea; color: #8a8d90; line-height: 1.45;
  max-width: 190px;
}
.pb-node b { font-size: 11px; font-weight: 600; white-space: nowrap; }
.pb-node em { font-style: normal; font-size: 11px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pb-node i { font-style: normal; font-size: 10px; color: #8a8d90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-node.done { background: #eef7f0; border-color: #c6e2ce; color: #107e3e; }
.pb-node.done i { color: #2d7a4a; }
.pb-node.doing { background: #fff6ea; border-color: #f3d8b3; color: #b95100; }
.pb-node.doing i { color: #a76b2a; }
.pb-node.bad { background: #fdecea; border-color: #f3c4c0; color: #bb0000; }
.pb-node.wait { background: #f7f8f9; border-color: #e9ebec; color: #a4a8ab; }
.pb-arrow { color: #c4c8cc; font-size: 12px; align-self: center; padding: 0 1px; }
.pb-stage-wrap { margin: 6px 0 4px; }
.pb-stage-wrap .pb-table { min-width: 820px; }
@media (max-width: 720px) {
  .pb-flow { padding-left: 8px; }
  .pb-node { min-width: 72px; max-width: 120px; padding: 2px 6px; }
  .pb-node b { font-size: 10px; }
  .pb-node i { display: none; }
}

/* 排班表：姓名与部门同行（以「·」相隔）；下方两个下拉与姓名行等宽（需求5） */
.sch-table td.col-emp { width: 158px; min-width: 158px; }
.sch-table td.col-emp .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-table td.col-emp .nm .dp-inline { font-size: 10px; color: var(--sap-text-muted); font-weight: 400; }
.sch-table td.col-emp .cbx { display: flex; width: 100%; margin-top: 2px; }
.sch-table td.col-emp .cbx > .cbx-in { width: 100%; }

/* 上传进度浮层（需求9：打卡记录上传进度） */
/* 上传进度：浮标形式（2026-10-26 需求 5）
   以前是 inset:0 的全屏遮罩 + 半透明底，上传打卡记录时把整个系统挡住，操作员干不了别的。
   现在改成右下角的小浮标：不拦截点击（pointer-events:none），随时能看到进度，也不影响继续操作。 */
.att-prog {
  position: fixed; right: 18px; bottom: 18px; left: auto; top: auto; z-index: 4000;
  display: none; align-items: flex-end; justify-content: flex-end;
  background: transparent; pointer-events: none;
}
.att-prog.show { display: flex; }
.att-prog-box {
  width: 268px; max-width: 76vw; background: #fff; border-radius: 8px;
  border: 1px solid var(--sap-border-light, #dbe2e8);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16); padding: 10px 12px 9px;
  pointer-events: none; animation: attprogin .18s ease-out;
}
@keyframes attprogin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.att-prog-hd { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--sap-text); }
.att-prog-spin {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid #d7dde3; border-top-color: var(--sap-brand);
  animation: attspin .8s linear infinite;
}
@keyframes attspin { to { transform: rotate(360deg); } }
.att-prog-bar { height: 6px; background: #eaeef1; border-radius: 4px; margin: 9px 0 5px; overflow: hidden; }
.att-prog-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0a6ed1, #2f8ce8); border-radius: 4px; transition: width .18s; }
.att-prog-ft { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--sap-text-muted); font-variant-numeric: tabular-nums; }

/* v117：全站上传进度浮窗沿用上面这套样式，另外两种状态 */
/*   .is-indet：还不知道总数（解析 / 校验阶段）→ 一道流动的条，别装成 0% 卡住 */
.att-prog-bar.is-indet i { width: 34% !important; animation: attindet 1.05s ease-in-out infinite; }
@keyframes attindet { from { margin-left: -34%; } to { margin-left: 100%; } }
/*   .is-fail：失败 → 整条变红，停 5 秒让人看清 */
.att-prog.is-fail .att-prog-bar i { background: linear-gradient(90deg, #bb0000, #e35d5d); }
.att-prog.is-fail .att-prog-hd { color: #bb0000; }
.att-prog.is-fail .att-prog-spin { border-top-color: #bb0000; }
.att-prog.is-fail .att-prog-box { border-color: #e8b4b4; }

.po-loc-more { font-size: 10px; color: var(--sap-text-faint, #999); }

/* ============================================================
   侧边栏第三层：原「页面上方入口条」（报表中心 / 考勤 / QMS / 盘点 …）
   2026-10-24 v56 重做：用户反馈「第三层看不清、点不到」。
   旧版 9px + 缩进 + 省略号，实际只有 20 多像素宽，手指/鼠标都点不准。
   现在改成与第二层同级的「整行按钮」：占满栏宽、30px 高、11px 字号、
   文字换行不截断、选中态用 SAP 品牌蓝实心（一眼看得到当前在哪一项）。
   ============================================================ */
.nav-depth3 {
  margin: 2px 4px 7px;
  padding: 3px;
  border-left: none;
  border-radius: 5px;
  background: #f2f7fb;
  box-shadow: inset 0 0 0 1px #e2ebf2;
  display: flex; flex-direction: column; gap: 1px;
}
.nav-depth3-item {
  display: flex; align-items: center; justify-content: center;
  min-height: 30px;
  padding: 6px 4px;
  border-radius: 3px;
  font-size: 11px; line-height: 1.25;
  color: #45505a;
  text-align: center;
  white-space: normal; word-break: break-all;
  overflow: visible; text-overflow: clip;
  letter-spacing: 0;
  cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
}
.nav-depth3-item:hover { background: #dfeefb; color: var(--sap-brand); }
.nav-depth3-item.active {
  background: var(--sap-brand); color: #fff; font-weight: 600;
  box-shadow: none;
}
.nav-depth3-item.active:hover { background: var(--sap-brand-dark); color: #fff; }

/* ============================================================
   通用扫码浮层（js/scan.js）：报工扫码 / 盘点扫码共用
   ============================================================ */
body.scn-lock { overflow: hidden; }
.scn-overlay {
  position: fixed; inset: 0; z-index: 3200;
  background: #0f151b; color: #fff; overflow: hidden;
  /* 用 grid 分高度：取景区吃掉剩余空间，底部按钮永远留在屏幕内（flex 在部分机型上会被挤出去） */
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif);
}
.scn-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.scn-title { font-size: 14px; font-weight: 600; letter-spacing: .3px; }
.scn-x {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.15); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer;
}
.scn-x:active { background: rgba(255,255,255,.3); }
.scn-stage { position: relative; min-height: 0; background: #000; overflow: hidden; }
.scn-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scn-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 74%; max-width: 360px; height: 40%; max-height: 280px;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.42);
  pointer-events: none;
}
.scn-corner { position: absolute; width: 22px; height: 22px; border: 0 solid #57b6ff; }
.scn-corner.tl { top: -2px; left: -2px; border-top-width: 3px; border-left-width: 3px; border-radius: 8px 0 0 0; }
.scn-corner.tr { top: -2px; right: -2px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 8px 0 0; }
.scn-corner.bl { bottom: -2px; left: -2px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 8px; }
.scn-corner.br { bottom: -2px; right: -2px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 8px 0; }
.scn-laser {
  position: absolute; left: 16%; right: 16%; height: 2px; top: 32%;
  background: linear-gradient(90deg, transparent, #57b6ff, transparent);
  animation: scnScan 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scnScan { 0% { top: 32%; opacity: .2; } 50% { top: 66%; opacity: 1; } 100% { top: 32%; opacity: .2; } }
.scn-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scn-flash.on { opacity: .55; transition: none; }
.scn-tip { flex: none; padding: 8px 16px 0; font-size: 12.5px; color: #cfd8e0; text-align: center; }
.scn-tip.ok { color: #7ee0a1; font-weight: 600; }
.scn-tip.warn { color: #ffcf7a; }
.scn-dbg { flex: none; padding: 2px 16px 6px; font-size: 10.5px; color: #7b8894; text-align: center; font-variant-numeric: tabular-nums; }
.scn-manual { flex: none; display: flex; gap: 6px; padding: 0 14px 6px; }
.scn-manual[hidden] { display: none; }
.scn-input {
  flex: 1 1 auto; height: 38px; padding: 0 10px; border-radius: 6px;
  border: 1px solid #33404c; background: #1b242d; color: #fff; font-size: 14px;
}
.scn-input:focus { outline: none; border-color: #57b6ff; }
.scn-actions { flex: none; display: flex; gap: 8px; padding: 2px 14px 16px; flex-wrap: wrap; }
.scn-btn {
  flex: 1 1 0; min-width: 64px; height: 40px; border-radius: 6px; cursor: pointer;
  border: 1px solid #3d4d5c; background: #223039; color: #e7eef4; font-size: 12.5px;
}
.scn-btn:active { background: #253140; }
.scn-btn.on { background: #0a6ed1; border-color: #0a6ed1; color: #fff; }
.scn-btn.primary { flex: 0 0 88px; background: #0a6ed1; border-color: #0a6ed1; color: #fff; font-weight: 600; }

/* ============================================================
   手机盘点面板（_stocktake_count.js）：一行一屏，扫码核对库位 / SKU
   ============================================================ */
body.cnt-lock { overflow: hidden; }
.cnt-sheet {
  position: fixed; inset: 0; z-index: 3100; background: #f2f5f7;
  display: flex; flex-direction: column;
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif);
}
.cnt-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #354a5f; color: #fff;
}
.cnt-progress { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cnt-progress em { font-style: normal; font-size: 10.5px; font-weight: 400; opacity: .85; display: block; }
.cnt-head-mid { flex: 1 1 auto; min-width: 0; text-align: center; }
.cnt-head-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt-head-sub { font-size: 10px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt-x {
  width: 32px; height: 32px; border-radius: 50%; border: none; flex: none;
  background: rgba(255,255,255,.16); color: #fff; font-size: 19px; line-height: 1; cursor: pointer;
}
.cnt-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px; -webkit-overflow-scrolling: touch; }
.cnt-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(35,52,68,.08); padding: 10px 12px; margin-bottom: 10px; }
.cnt-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #eef1f4; }
.cnt-row:last-child { border-bottom: none; }
.cnt-row > label { flex: 0 0 58px; font-size: 12px; color: #6a737b; }
.cnt-row .cnt-val { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: #23282d; word-break: break-all; }
.cnt-row .cnt-val small { font-size: 11px; font-weight: 400; color: #6a737b; display: block; }
.cnt-scanbox {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 30px; min-width: 62px; padding: 0 8px;
  border: 1px dashed #9db4c7; border-radius: 5px; background: #f7fafc;
  color: #0a6ed1; font-size: 11.5px; cursor: pointer;
}
.cnt-scanbox:active { background: #eaf4fe; }
.cnt-scanbox.ok { border-style: solid; border-color: #107e3e; background: #eefaf1; color: #107e3e; font-weight: 600; }
.cnt-scanbox.err { border-style: solid; border-color: #bb0000; background: #fdeeee; color: #bb0000; }
.cnt-qty { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; }
.cnt-qty input {
  flex: 1 1 0; width: 100%; min-width: 0; height: 46px; font-size: 22px; font-weight: 700; text-align: right;
  border: 1px solid #d6dee5; border-radius: 6px; padding: 0 12px; color: #23282d;
  font-variant-numeric: tabular-nums; background: #fff;
}
.cnt-qty input:focus { outline: none; border-color: #0a6ed1; box-shadow: 0 0 0 2px rgba(10,110,209,.12); }
.cnt-qty .cnt-unit { flex: none; font-size: 12px; color: #6a737b; }
.cnt-diff { font-size: 12px; padding: 2px 0 0; }
.cnt-note { font-size: 11px; color: #8a929a; line-height: 1.6; }
.cnt-foot { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e3e9ee; }
.cnt-foot-row { display: flex; gap: 6px; }
.cnt-foot .btn { height: 42px; font-size: 13px; flex: 1 1 0; }
.cnt-foot .btn.primary { flex: 1 1 100%; }
.cnt-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #b95100; }
.cnt-empty { padding: 40px 16px; text-align: center; color: #6a737b; font-size: 13px; }
.cnt-chip { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10.5px; background: #eef2f5; color: #55636d; }
.cnt-done-badge { background: #107e3e; color: #fff; }

/* 关闭/提交确认：贴在面板内的三选一 */
.cnt-confirm {
  position: absolute; inset: 0; z-index: 2; background: rgba(20,28,36,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cnt-confirm-box { width: 100%; max-width: 320px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.cnt-confirm-tt { padding: 16px 16px 6px; font-size: 14px; font-weight: 600; color: #23282d; }
.cnt-confirm-tx { padding: 0 16px 14px; font-size: 12px; color: #6a737b; line-height: 1.7; }
.cnt-confirm-acts { display: flex; flex-direction: column; }
.cnt-confirm-acts .btn { height: 42px; border-radius: 0; border-left: none; border-right: none; border-bottom: 1px solid #eef1f4; font-size: 13.5px; }
.cnt-confirm-acts .btn:last-child { border-bottom: none; }

/* ============================================
   全站表格操作规范化（第四批需求 1 / 2）
   列设置栏统一收纳：页面按钮 + 行操作按钮 + 列设置/模板/导入
   ============================================ */
.grid-tools .gt-pageacts,
.grid-tools .gt-rowacts,
.grid-tools .gt-selacts { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.grid-tools .gt-selacts { font-size: 12px; color: #40505e; }
.grid-tools .gt-selacts .pb-count { font-weight: 600; color: var(--sap-brand); }
.grid-tools .gt-selacts .pb-count b { font-size: 13px; }
.grid-tools .gt-selacts .btn { height: 26px; }
/* 页面按钮（新建 / 刷新 / 导出 / SKU 编码设置…）与列设置栏其它按钮同高，避免把这一行撑高 */
.grid-tools .gt-pageacts .btn { height: 26px; font-size: 12px; padding: 0 10px; }
/* 勾选条合并进列设置栏后，长提示语不再占一行（挂在整组的 title 上悬停可见） */
.grid-tools .gt-selacts .pb-hint { display: none; }
.grid-tools .gt-sep { width: 1px; height: 18px; background: #cfd6dd; margin: 0 4px; flex: 0 0 auto; }
.grid-tools .col-gear { margin-left: auto; }
.grid-tools .btn[disabled] { opacity: .38; }

/* 「操作」右边那一栏：点内容即查看 */
td.cell-link { cursor: pointer; }
td.cell-link:hover { background: var(--sap-brand-hover); }
td.cell-link:hover > b,
td.cell-link:hover > span:first-child { text-decoration: underline; text-underline-offset: 2px; }
tr.row-active > td { background: #e8f2fd !important; }
tr.row-active > td:first-child { box-shadow: inset 2px 0 0 var(--sap-brand); }

/* 产品主数据「条形码」列：等宽字体，一眼分清是码不是普通文本 */
td .bc-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; letter-spacing: .3px; color: #33414f; }

/* 第 1 层 → 第 2 层折叠明细 */
td.cell-exp { cursor: pointer; }
.gd-caret { display: inline-block; width: 0; height: 0; margin-right: 5px; vertical-align: middle; font-size: 0; line-height: 0;
  border-left: 5px solid var(--sap-brand); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s ease; }
td.cell-exp.open .gd-caret { transform: rotate(90deg); }
tr.gd-row > td { padding: 0 !important; background: #f7f9fb; border-top: 1px solid #e6eaee; }
.gd-wrap { padding: 8px 12px 10px; }
.gd-title { font-size: 11px; color: #6a737b; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.gd-title b { color: #32363a; font-size: 11.5px; }
.sub-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; background: #fff; }
.sub-tbl th {
  background: #eef2f6; color: #4a5560; font-weight: 600; text-align: left;
  padding: 4px 8px; border-bottom: 1px solid #dfe4e9; white-space: nowrap; font-size: 11px;
}
.sub-tbl td { padding: 4px 8px; border-bottom: 1px solid #f0f3f6; vertical-align: middle; }
.sub-tbl tr:last-child td { border-bottom: none; }
.sub-tbl tr:hover td { background: #fafcfe; }
.sub-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.sub-tbl input.spec-in { height: 20px; padding: 0 4px; font-size: 11px; width: 120px; border: 1px dashed var(--sap-warning); border-radius: 2px; }
.sub-tbl .spec-save { height: 20px; line-height: 1; padding: 0 6px; font-size: 10.5px; }

/* 手写表格补出来的列设置栏：与下方表格贴合（去掉顶部圆角重复） */
.grid-tools[data-ops-made="1"] + .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }

/* 没有表格的页面（生产订单看板这类）单独建的列设置栏：自成一条完整的按钮带 */
.grid-tools.gt-standalone {
  border-bottom: 1px solid var(--sap-border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

/* ============================================================
   采购物料清单（purchase.js 视图②）
   ① 选生产领料单  ② 按 BOM 生成清单  ③ 批量填供应商/规格  ④ 生成采购订单
   ============================================================ */
.req-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.req-card-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 12px; background: #f7f9fb; border-bottom: 1px solid var(--color-border); }
.req-card-h b { font-size: 13px; color: #32363a; }
.req-card-h span { font-size: 11.5px; color: #6a737b; }

/* build 220：清单工具栏（原「搜索区」4 行 flex 全堆左边 → 自适应栅格铺满）
   ① 字段区：标签在上、控件等宽，「应用」按钮贴在输入框右侧当后缀
   ② 操作区：批量按钮靠左，占用汇总靠右
   ③ 统计条：数字用小胶囊分隔，不再是一长串「未完结 x 项 需采购 …」 */
.req-tools { padding: 10px 12px 9px; border-bottom: 1px solid var(--color-border); background: #fcfdfe; display: flex; flex-direction: column; gap: 9px; }
.req-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); gap: 9px 14px; align-items: end; }
.req-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.req-f-lb { font-size: 11.5px; color: #5b6a78; font-weight: 600; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-f-ctl { display: flex; align-items: center; gap: 0; min-width: 0; }
.req-f-ctl .input, .req-f-ctl .select { height: 30px; padding: 0 9px; font-size: 12.5px; width: 100%; min-width: 0; box-sizing: border-box; }
.req-f-ctl .input.df { padding-right: 24px; }
.req-f-ctl .req-f-apply { height: 30px; padding: 0 9px; margin-left: 6px; flex: 0 0 auto; white-space: nowrap; }
.req-f-tip { font-size: 10.5px; color: #9aa5ae; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-tools .req-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #4a5560; height: 26px; white-space: nowrap; }
.req-tools .req-chk input { width: 15px; height: 15px; }
.req-tools-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px dashed #e6eaee; padding-top: 8px; }
.req-tools-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req-tools-sep { width: 1px; height: 16px; background: #dfe4e9; margin: 0 3px; }
.req-tools-bar .req-resv-sum { margin-left: auto; font-size: 12px; color: #32363a; background: #f1f5f9; border: 1px solid #e2e8ee; border-radius: 12px; padding: 2px 10px; white-space: nowrap; }
.req-tools-bar .req-resv-sum b { color: #0a6ed1; }
.req-tools-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: #5b6a78; }
.req-foot-i { background: #f4f7fa; border: 1px solid #e6ebf0; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.req-foot-i b { color: #0a6ed1; font-weight: 600; }
.req-foot-tip { margin-left: auto; color: #9aa5ae; }

/* 清单行内输入：不要撑高表格 */
td .req-in { height: 26px; padding: 0 6px; font-size: 12px; width: 100%; min-width: 56px; }
td .req-in[data-reqf="supplier_text"] { min-width: 150px; }
td .req-in[data-reqf="spec"] { min-width: 100px; }

/* v73：弹窗选生产订单 / 库存查询 */
.req-pick-tip { margin-top: 10px; font-size: 11.5px; line-height: 1.6; color: #6a737b; }
.req-src { margin-left: auto; font-size: 11.5px; color: #0a6ed1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stock-sum { margin-bottom: 8px; padding: 8px 10px; background: #f4f8fd; border: 1px solid #dce9f8; border-radius: 5px; font-size: 12px; color: #32363a; }
.stock-sum b { color: #0a6ed1; }
.cell-sub { font-size: 11px; color: #8a929a; margin-top: 1px; }
.req-stock { color: #32363a; }

/* v193：采购物料清单分两段（需额外采购 / 库存满足）+ 每行「占用」 */
.req-sec { border-top: 1px solid var(--color-border); }
.req-sec-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #fafbfc; border-bottom: 1px solid var(--color-border); }
.req-sec-h b { font-size: 12.5px; color: #32363a; }
.req-sec-h span { font-size: 11.5px; color: #6a737b; }
.req-sec-no { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #0a6ed1; color: #fff; font-size: 11px; font-weight: 700; }
.req-sec-no.ok { background: #107e3e; }
.req-rsv { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #32363a; cursor: pointer; user-select: none; }
.req-rsv input { width: 15px; height: 15px; cursor: pointer; }
.req-rsv.off { color: #a4a8ab; cursor: default; }
.req-rsv-sub { color: #0a6ed1; word-break: break-all; line-height: 1.4; }
.req-resv-sum { font-size: 11.5px; color: #32363a; }
.req-resv-sum b { color: #0a6ed1; }

/* v194：清单合成一张表 —— 行状态标签 / 顶部提示条 / 汇总行 */
.req-st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; line-height: 18px; white-space: nowrap; }
.req-tip { margin: 0 12px 8px; padding: 8px 10px; border-radius: 5px; font-size: 12px; line-height: 1.7; }
.req-tip.warn { background: #fff8e6; border: 1px solid #ffe0a3; color: #8a5a00; }
.req-tip.ok { background: #e9f6ee; border: 1px solid #b7e0c6; color: #0d6b34; }
.req-sum-row { padding-top: 4px; border-top: 1px dashed var(--color-border); font-size: 12px; color: #32363a; }
.req-sum-row b { color: #0a6ed1; }

/* v73：从销售订单下推 —— 选单 / 选明细弹窗 */
.so-pick-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.so-pick-bar .input { height: 28px; padding: 0 8px; font-size: 12px; width: 240px; }
.so-count { font-size: 12px; color: #0a6ed1; margin-left: auto; }
.so-orders { max-height: 54vh; overflow: auto; border: 1px solid var(--color-border); border-radius: 5px; }
.so-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.so-table th { position: sticky; top: 0; background: #f6f8fa; z-index: 1; border-bottom: 1px solid #e2e6ea; padding: 6px 8px; text-align: left; font-weight: 600; color: #4a5560; white-space: nowrap; }
.so-table td { border-bottom: 1px solid #eef1f4; padding: 6px 8px; }
.so-row-dis { color: #a4a8ab; background: #fbfbfc; }
.so-block { border: 1px solid var(--color-border); border-radius: 6px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.so-block-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px; background: #f7f9fb; border-bottom: 1px solid var(--color-border); font-size: 12.5px; }
.so-block-h span { color: #6a737b; font-size: 11.5px; }
.so-block-r { margin-left: auto; color: #0a6ed1 !important; }
.so-lines { max-height: 34vh; overflow: auto; }
@media (max-width: 560px) {
  .so-pick-bar .input { width: 100%; }
  .so-count { margin-left: 0; }
  .so-orders { max-height: 46vh; }
  .so-table th, .so-table td { padding: 5px 6px; }
}

@media (max-width: 560px) {
  .req-tools-grid { grid-template-columns: 1fr; }
  .req-tools-bar .req-resv-sum { margin-left: 0; }
  .req-foot-tip { display: none; }
  td .req-in[data-reqf="supplier_text"] { min-width: 120px; }
}

/* ============================================================
   撤销条（2026-10-26 需求 1）：删除 / 退回确认后 10 秒内可撤销
   ============================================================ */
#undo-host {
  position: fixed; right: 18px; bottom: 18px; z-index: 10060;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.undo-bar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  background: #23313d; color: #fff;
  border-left: 4px solid #f0a63c;
  padding: 9px 12px; border-radius: 6px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.28);
  max-width: 420px;
  animation: undoin .18s ease-out;
}
.undo-bar.undo-out { opacity: 0; transform: translateY(6px); transition: all .18s; }
.undo-ico { color: #3ec06a; font-weight: bold; }
.undo-txt { line-height: 1.35; }
.undo-cd {
  min-width: 22px; text-align: center; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.14); border-radius: 10px; padding: 1px 6px; font-size: 12px;
}
.undo-btn {
  margin-left: auto; flex: none;
  background: #f0a63c; color: #23313d; border: 0; border-radius: 4px;
  padding: 4px 12px; font-size: 12.5px; font-weight: bold; cursor: pointer;
}
.undo-btn:hover { background: #ffbe5c; }
@keyframes undoin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 待删除 / 待退回的行：确认后 10 秒内先置灰，撤销后恢复 */
tr.undo-pending > td { opacity: .42; text-decoration: line-through; text-decoration-color: #ef6b6b; }

/* 库位条码（需求 4） */
.loc-code-cell { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: bold; letter-spacing: .4px; }
.bar-code-box { display: inline-block; padding: 6px; background: #fff; border: 1px solid #e2e6ea; border-radius: 4px; }
.bar-code-box canvas { display: block; }

/* ============================================================
   2026-10-26 需求 2：全站检索栏 / 检索下拉精简显示
   （只压高度和宽度，字号不动到看不清；下拉选项仍然完整）
   ============================================================ */
.filter-bar {
  padding: 6px 9px;
  gap: 6px 10px;
  margin-bottom: 8px;
}
.filter-bar .filter-group { display: flex; align-items: center; gap: 4px; min-width: 0; }
.filter-bar label { font-size: 11.5px; color: #6a6d70; }
.filter-bar .input,
.filter-bar .select {
  height: 26px; line-height: 24px;
  font-size: 12px; padding: 0 6px;
  min-width: 82px; max-width: 150px;
}
.filter-bar .input.df { max-width: 132px; }
.filter-bar .select { padding-right: 18px; }
.filter-bar .btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.filter-bar .cbx { width: 130px; }
.filter-bar .pb-auto { font-size: 11.5px; }

/* ============================================================
   2026-10-26 需求 1：生产看板右侧抽屉（全流程节点）+ 甘特图视图
   ============================================================ */
.pb-view { display: inline-flex; border: 1px solid #d9dee2; border-radius: 4px; overflow: hidden; }
.pb-view button {
  border: 0; background: #fff; color: #32363a; font-size: 12px;
  padding: 3px 10px; cursor: pointer;
}
.pb-view button + button { border-left: 1px solid #e3e7ea; }
.pb-view button.on { background: #0a6ed1; color: #fff; }

.pb-no { cursor: pointer; }
.pb-no:hover { color: #0a6ed1; text-decoration: underline; }

.pb-drawer-host { position: fixed; inset: 0; z-index: 10050; }
.pb-drawer-mask { position: absolute; inset: 0; background: rgba(15, 23, 32, .34); opacity: 0; transition: opacity .18s; }
.pb-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 33.33vw; min-width: 380px; max-width: 960px;
  background: #fff; box-shadow: -8px 0 28px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease-out;
}
.pb-drawer-host.on .pb-drawer-mask { opacity: 1; }
.pb-drawer-host.on .pb-drawer { transform: none; }
.pb-drawer-hd {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #e5e8ea; background: #f7f9fa;
}
.pb-drawer-t { font-size: 14px; font-weight: 700; color: #32363a; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pb-drawer-s { font-size: 11.5px; color: #6a6d70; margin-top: 2px; }
.pb-drawer-x {
  margin-left: auto; flex: none; border: 0; background: transparent;
  font-size: 20px; line-height: 1; color: #6a6d70; cursor: pointer; padding: 0 2px;
}
.pb-drawer-x:hover { color: #bb0000; }
.pb-drawer-bd { flex: 1; overflow: auto; padding: 10px 14px 18px; }
.pb-drawer-bd .pb-table { min-width: 0; }
.pb-drawer-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin-top: 10px; }
.pb-drawer-kv div { background: #f7f9fa; border: 1px solid #eceff1; border-radius: 4px; padding: 6px 8px; font-size: 12px; color: #32363a; }
.pb-drawer-kv span { display: block; font-size: 11px; color: #8a8d90; }
@media (max-width: 900px) { .pb-drawer { width: 100vw; min-width: 0; } }

/* 甘特图视图（v166）：一张生产订单一组，组内 6 个流程节点画在同一条时间轴
   左侧 = 订单 / 节点名，右侧 = 月份（或日期）刻度；条形位置 = 节点发生时间 */
.pb-gv2 { --pb-lab: 152px; border: 1px solid #e5e8ea; border-radius: 4px; background: #fff; overflow: hidden; }
.pb-gv2-hd { display: grid; grid-template-columns: var(--pb-lab) 1fr; background: #e8eff7; border-bottom: 1px solid #d3dee8; }
.pb-gv2-hlab {
  padding: 3px 10px; font-size: 11px; font-weight: 700; color: #2b5478; line-height: 13px;
  border-right: 1px solid #d3dee8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pb-gv2-hlab em { display: block; font-style: normal; font-weight: 500; font-size: 10px; color: #5f83a3; line-height: 12px; }
.pb-gv2-axis { position: relative; height: 30px; }
.pb-gv2-tick {
  position: absolute; top: 0; bottom: 0; padding-left: 6px; line-height: 30px; box-sizing: border-box;
  font-size: 11px; font-weight: 600; color: #2b5478; white-space: nowrap;
  border-left: 1px solid #c9d6e3;
}
.pb-gv2-tick.first { border-left: 0; padding-left: 8px; }
.pb-gv2-tick.end { border-left: 1px solid #c9d6e3; padding: 0; }
.pb-gv2-bd { position: relative; }
.pb-gv2-cols { position: absolute; top: 0; right: 0; bottom: 0; left: var(--pb-lab); pointer-events: none; }
.pb-gv2-seg { position: absolute; top: 0; bottom: 0; }
.pb-gv2-seg.alt { background: #f7fafc; }
.pb-gv2-seg::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: #eef1f4; }
.pb-gv2-grp { position: relative; z-index: 1; border-bottom: 1px solid #e9edf1; }
.pb-gv2-grp:last-child { border-bottom: 0; }
.pb-gv2-gh { display: grid; grid-template-columns: var(--pb-lab) 1fr; border-bottom: 1px dashed #e7ebef; background: rgba(250, 251, 252, .72); }
.pb-gv2-ghn { padding: 4px 10px; min-width: 0; border-right: 1px solid #eef1f4; }
.pb-gv2-ghn b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #32363a; cursor: pointer; }
.pb-gv2-ghn b:hover { color: #0a6ed1; text-decoration: underline; }
.pb-gv2-ghn em { display: block; font-style: normal; font-size: 10.5px; color: #8a8d90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-gv2-ght { position: relative; height: 30px; }
.pb-gv2-plan {
  position: absolute; top: 7px; height: 16px; line-height: 14px; box-sizing: border-box;
  padding: 0 6px; border: 1px dashed #c9d2da; border-radius: 3px; background: rgba(244, 247, 249, .92);
  font-size: 10px; color: #6a6d70; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pb-gv2-plan.none { border: 0; background: transparent; color: #b3b7ba; padding-left: 8px; }
.pb-gv2-lane { display: grid; grid-template-columns: var(--pb-lab) 1fr; }
.pb-gv2-lane:hover { background: rgba(236, 245, 253, .5); }
.pb-gv2-ln {
  padding: 0 10px 0 12px; font-size: 11px; color: #4a4f53; line-height: 22px;
  border-right: 1px solid #eef1f4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pb-gv2-ln i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 6px; vertical-align: 2px; }
/* build 191：两层分段 —— 大类可展开小类（采购/入库/质检按类别、派工按工作组） */
.pb-gv2-ln.fold { cursor: pointer; user-select: none; }
.pb-gv2-ln.fold:hover { background: #f2f7fc; color: #0a6ed1; }
.pb-gv2-caret { display: inline-block; width: 12px; color: #8a8d90; font-size: 10px; }
.pb-gv2-lane.sub .pb-gv2-ln { padding-left: 26px; color: #6a6d70; background: #fafbfc; }
.pb-gv2-lane.sub .pb-gv2-tr { background: #fafbfc; }
.pb-fold-caret { display: inline-block; width: 14px; color: #0a6ed1; cursor: pointer; user-select: none; font-size: 10px; }
.pb-fold-caret:hover { color: #185fa5; }
/* 2026-11-09：甘特图两层收放 —— 第一层（▾/▸ 收放钮 + 销售订单 + 生产订单）、第二层（产品型号 + 流程节点） */
.pb-gv2-ghn1 { display: flex; align-items: center; gap: 1px; min-width: 0; }
.pb-gv2-ghn1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-gv2-ghn2 { line-height: 15px; padding-top: 1px; white-space: nowrap; overflow: hidden; }
.pb-gv2-gcaret {
  display: inline-block; width: 14px; flex: none;
  color: #0a6ed1; font-size: 10px; cursor: pointer; user-select: none;
}
.pb-gv2-gcaret:hover { color: #185fa5; }
.pb-gv2-g2.off { display: none; }
.pb-gv2-prod {
  padding: 2px 12px; background: #f4f8fc; border-bottom: 1px dashed #e7ebef;
  font-size: 11px; color: #4a4f53; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pb-gv2-prod b { font-family: var(--font-mono); color: #32363a; }
.pb-gv2-pl {
  display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 3px;
  background: #e3edf6; color: #2b5478; font-size: 10px; font-weight: 600; line-height: 16px;
}
tr.pb-subrow td { background: #fafbfc; border-top: 1px dashed #eef1f4; }
.pb-gv2-tr { position: relative; height: 22px; }
.pb-gv-bar {
  position: absolute; top: 3px; height: 16px; line-height: 16px; box-sizing: border-box;
  padding: 0 6px; border-radius: 4px; color: #fff; font-size: 10px; font-weight: 600; z-index: 2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.pb-gv-bar:hover { filter: brightness(1.08); }
.pb-gv-bar.doing { opacity: .88; }
.pb-gv-bar.bad { background: #bb0000 !important; }
.pb-gv-tag {
  position: absolute; top: 3px; height: 16px; line-height: 16px; padding: 0 2px;
  font-size: 10px; color: #4a4f53; white-space: nowrap; z-index: 2; pointer-events: none;
}
.pb-gv2-none { position: absolute; left: 8px; top: 3px; font-size: 10.5px; color: #c2c6c9; line-height: 16px; }
.pb-gv-today { position: absolute; top: 0; bottom: 0; width: 1px; background: #bb0000; opacity: .5; z-index: 5; }
.pb-gv2-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px;
  padding: 7px 10px; border-top: 1px solid #eef1f4; background: #fbfcfd;
}
.pb-gv2-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #32363a; }
.pb-gv2-legend i { width: 16px; height: 9px; border-radius: 3px; background: #c9d2da; }
.pb-gv2-legend i.plan { background: #eef1f5; box-shadow: inset 0 0 0 1px #c9d2da; }
.pb-gv2-legend i.today { width: 2px; height: 11px; border-radius: 0; background: #bb0000; }
.pb-gv2-legend em { flex-basis: 100%; font-style: normal; font-size: 11px; color: #8a8d90; }
@media (max-width: 900px) {
  .pb-gv2 { --pb-lab: 106px; }
  .pb-gv2-hlab, .pb-gv2-ghn { padding-left: 6px; padding-right: 6px; }
  .pb-gv2-ln { padding-left: 6px; }
  .pb-gv2-legend em { display: none; }
}

/* 装车单（需求 3）：员工 chips */
.lw-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.lw-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef4fb; border: 1px solid #cfe0f2; color: #0854a0;
  border-radius: 11px; padding: 1px 8px; font-size: 12px;
}
.lw-chip b { cursor: pointer; color: #8fb4d8; font-weight: 700; }
.lw-chip b:hover { color: #bb0000; }
.lw-empty { font-size: 11.5px; color: #a4a8ab; }
.lw-box { background: #f7f9fa; border: 1px solid #e5e8ea; border-radius: 4px; padding: 8px 10px; margin-top: 6px; }
.lw-box .row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12px; }
.lw-fee { margin-left: auto; font-size: 13px; color: #32363a; }
.lw-fee b { color: #bb0000; font-size: 15px; }

/* 需求 2（续）：其它页面自己拼的检索行（.toolbar 里的输入框 / 下拉）同样精简，
   包括行内写了 max-width 的（用 !important 盖住，统一到一档宽度） */
.toolbar label { font-size: 11.5px; color: #6a6d70; }
.toolbar .input,
.toolbar .select {
  height: 26px; line-height: 24px;
  font-size: 12px; padding: 0 6px;
  max-width: 180px !important;
}
.toolbar .select { max-width: 150px !important; padding-right: 18px; }
.toolbar .input.df { max-width: 132px !important; }
.toolbar .btn { height: 26px; padding: 0 10px; font-size: 12px; }

/* ============================================================
   宿舍水电费（build 118）：午休 / 常住差异分摊
   ============================================================ */
.dorm-warn {
  margin: 0 0 10px; padding: 9px 12px; font-size: 12px; line-height: 1.7;
  background: #fff8e6; border: 1px solid #f0d48a; border-left: 3px solid #e0a300;
  border-radius: var(--radius); color: #6b4b00;
}
.dorm-warn code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }
.dorm-tip { font-size: 11.5px; color: var(--sap-text-muted); line-height: 1.6; }
.dorm-tag {
  display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; line-height: 1.6;
  background: #eef2f6; color: #44586b; white-space: nowrap;
}
.dorm-tag.nap { background: #fff3e0; color: #a15c00; }
.dorm-tag.ok { background: #e8f5ec; color: #1a7f37; }
.dorm-preview { font-size: 12px; line-height: 1.8; color: var(--sap-text); }
.dorm-ratio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sap-text-muted); }
.dorm-split { width: 100%; border-collapse: collapse; font-size: 12px; }
.dorm-split th, .dorm-split td { border-bottom: 1px solid var(--sap-border-light); padding: 6px 8px; }
.dorm-split th { background: #fafafa; font-weight: 600; text-align: left; white-space: nowrap; }
.dorm-split tbody tr:hover { background: #fbfdff; }

/* 本月水电费登记网格 */
.util-entry { width: 100%; border-collapse: collapse; font-size: 12px; }
.util-entry th, .util-entry td { border-bottom: 1px solid var(--sap-border-light); padding: 4px 6px; }
.util-entry th { background: #fafafa; font-weight: 600; white-space: nowrap; text-align: left; }
.util-entry .input.sm { width: 78px; }
.util-preview { font-size: 11.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }

/* v144：水电费登记月份（可补录历史月份） */
.dorm-monthbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 7px 10px;
  background: #f6f9fc; border: 1px solid var(--sap-border-light);
  border-left: 3px solid #4a90d9; border-radius: var(--radius);
}
.dorm-monthbar .dorm-monthlabel { font-size: 12px; font-weight: 600; color: var(--sap-text); }
.dorm-monthbar #util-month { width: 152px; height: 26px; padding: 0 6px; font-size: 12px; }
.dorm-monthbar .dorm-tip { flex: 1 1 260px; min-width: 180px; }

/* ============================================
   build 147：受控日期 / 月份输入（js/date-field.js）
   原生 date/month 的年份段能打到 6 位（202026），换成年份锁 4 位的文本框 +
   右侧日历图标（点图标走原生 showPicker）。这里只管长相，逻辑在 date-field.js。
   ============================================ */
input.df, input.df:hover, input.df:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a6d70' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 13px 13px;
  padding-right: 24px !important;
  cursor: text;
}
input.df::placeholder { color: #b9bdc0; }
input.df[readonly], input.df:disabled { cursor: default; }
/* 年份打超位 / 日期不存在：闪一下红框，值不变（用户能立刻感到「打不进去」） */
input.df.df-bad {
  border-color: #e34d59 !important;
  box-shadow: inset 0 0 0 1px #e34d59 !important;
  background-color: #fff7f7;
  transition: background-color .2s;
}
/* 表格内联的日期框：格子小，图标缩到 11px、留 15px */
.date-inline.df, .date-inline.df:hover, .date-inline.df:focus {
  padding-right: 15px !important;
  background-size: 11px 11px;
  background-position: right 2px center;
}
/* 宿舍月份条：原来 padding: 0 6px 会把图标压掉 */
.dorm-monthbar #util-month { padding-right: 24px !important; }
/* 原生 picker 的隐藏载体（1px，不可见但仍在渲染树里，showPicker 才认） */
.df-native {
  position: fixed; top: 50%; left: 50%;
  width: 1px; height: 1px; opacity: 0;
  padding: 0; border: 0; pointer-events: none;
}

/* build 147：水电费历史记录「按月收纳」—— 每月一行汇总，点「查看明细」钻进该月 */
.util-hist-groups { display: flex; flex-direction: column; gap: 4px; }
.util-hist-group {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid #e3e7ea;
  border-left: 3px solid #c9ced3; border-radius: var(--radius);
  background: #fafbfc; font-size: 12.5px;
}
.util-hist-group:hover { background: #f3f7fb; border-left-color: var(--sap-brand); }
.util-hist-group.cur { border-left-color: #2e7d32; background: #f6fbf6; }
.util-hist-group .util-hist-m { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 140px; }
.util-hist-group .util-hist-n { color: #6a6d70; min-width: 52px; }
.util-hist-group .util-hist-f { color: #4a4d50; }
.util-hist-group .util-hist-w { color: #b26a00; }
.util-hist-group .btn { margin-left: auto; }
/* 登记网格的页头：保存按钮跟标题一行 */
.util-entry-head { row-gap: 4px; }
.util-entry-head .dorm-tip { flex: 1 1 340px; min-width: 220px; }

/* ============================================
   build 148：排班浮层两页签（按天排班 / 按周期排班）
   钉钉式：点某人某天 → 浮层顶部切换「按天 / 按周期」，
   按周期时给「开始~结束」两个日期框，点班次整段覆盖。
   ============================================ */
.sc-pop-wide { width: 306px; max-height: min(566px, 82vh); }
.sc-pop-wide .sc-pop-hd { position: sticky; top: 0; }
.sc-pop-tabs {
  position: sticky; top: 31px; z-index: 2;
  display: flex; background: #fff;
  border-bottom: 1px solid var(--sap-border-light);
}
.sc-pop-tab {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 7px 0; font-size: 12px; color: #4a4d50;
  border-bottom: 2px solid transparent;
}
.sc-pop-tab:hover { background: var(--sap-brand-hover); }
.sc-pop-tab.on { color: var(--sap-brand); font-weight: 600; border-bottom-color: var(--sap-brand); }
.sc-pop-pane[hidden] { display: none; }
.sc-cycle { display: flex; align-items: center; gap: 5px; padding: 2px 10px 3px; }
.sc-cycle .input.df { width: 120px; padding: 3px 20px 3px 6px; font-size: 12px; }
.sc-cycle-sep { color: #8a8d90; }
.sc-cycle-n { padding: 0 10px 4px; font-size: 11px; color: #107e3e; }
.sc-cycle-n.bad { color: #bb0000; }
.sc-pop-wide .sc-pop-foot { position: sticky; bottom: 0; background: #fff; }

/* v170：采购订单列表的「作废单已隐藏」提示条（退单/取消不再跟新下推的单据一起显示） */
.po-void-tip {
  margin: 8px 0 6px; padding: 6px 10px; border-left: 3px solid #d1d3d6;
  background: #f7f8f9; color: #5b636a; font-size: 11.5px; line-height: 1.7; border-radius: 3px;
}
.po-void-tip b { color: #32363a; }
.po-void-tip a { color: #0a6ed1; text-decoration: none; margin-left: 4px; white-space: nowrap; }
.po-void-tip a:hover { text-decoration: underline; }

/* v172：报工页录入区的按钮栏（.grid-tools）紧贴录入表头，视觉上当一条完整表带 */
#entry.entry-box > #entry-tools { border-bottom: none; }
#entry.entry-box > #entry-table > .table-wrap {
  border-top-left-radius: 0; border-top-right-radius: 0;
}
#entry.entry-box .pending-bar + #entry-tools { margin-top: 6px; }
/* 手机端点整行开面板：只读格子看起来仍是普通格子，但整行给出可点提示 */
.row-editor tr.rep-taprow { cursor: pointer; }
.row-editor tr.rep-taprow input.ro-on-phone { cursor: pointer; }

/* ============================================================
   build 209：合并报工下来的「一张工序单」在录入区只占一行
     · 抬头（销售订单 / 生产订单 / 工序 / 物料 / N 款 · 共 M 套）
     · 录入条（日期 / 操作员 / 工价 / 计划·已报·余量 / 本次总量）
     · 规格分项表（每款一行：规格 · 计划 · 已报 · 本次数量）
   一行 = 一批，别再拆成一款一行（用户 2026-11-08 口径）。
   ============================================================ */
.row-editor tr.rep-group > td { padding: 3px 6px; vertical-align: middle; background: #fffaf6; }
.row-editor tr.rep-group { background: #fffaf6; }
.row-editor tr.rep-group > td:first-child {
  box-shadow: inset 3px 0 0 #e9730c;
  vertical-align: middle;
}
/* build 211：第一层各项数据直接落「表头对应的列」 */
.row-editor tr.rep-group > td.grp-cell { font-size: 12px; color: #41474d; word-break: break-all; line-height: 1.5; }
.row-editor tr.rep-group > td.grp-so { color: #2c5c8f; }
.row-editor tr.rep-group > td.grp-spec-cell { color: #0a6ed1; font-weight: 600; }
.grp-mat-code { color: #e9730c; font-weight: 600; font-family: ui-monospace, monospace; }
.grp-mat-name { color: #8a929a; font-size: 11px; }
.grp-qty input {
  width: 112px; height: 26px; text-align: right; padding: 0 6px; font-size: 12.5px; font-weight: 700;
  border: 1px solid #d6dbe0; border-radius: 2px; background: #fff; color: #b95100;
}
.grp-qty input:focus { outline: none; border-color: #0a6ed1; box-shadow: 0 0 0 1px #0a6ed1; }
.grp-qty small { display: block; margin-top: 2px; color: #8a929a; font-size: 10.5px; white-space: nowrap; }
.grp-qty small b { color: #b95100; font-family: ui-monospace, monospace; }
.grp-l2 { margin: 0; }
.grp-badge {
  display: inline-block; margin-left: 2px; padding: 1px 7px; border-radius: 9px;
  background: #fdeee0; border: 1px solid #f6d6b8; color: #b95100; font-size: 11px; white-space: nowrap;
}
.grp-acts { display: flex; gap: 5px; flex: 0 0 auto; align-items: center; white-space: nowrap; }
.grp-specs { width: 100%; border-collapse: collapse; font-size: 12px; }
.grp-specs th {
  background: #f5f7f9; color: #41474d; font-weight: 600; padding: 4px 7px;
  border: 1px solid #e4e8eb; text-align: left; font-size: 11px; white-space: nowrap;
}
.grp-specs td { padding: 2px 7px; border: 1px solid #eceff2; color: #41474d; }
.grp-specs th.num, .grp-specs td.num { text-align: right; }
.grp-specs td .sp { color: #0a6ed1; font-weight: 600; }
.grp-specs td.grp-so { color: #2c5c8f; font-size: 11.5px; }
.grp-specs input {
  width: 82px; height: 26px; text-align: right; padding: 0 6px; font-size: 12.5px;
  border: 1px solid #d6dbe0; border-radius: 2px; background: #fff;
}
.grp-specs input:focus { outline: none; border-color: #0a6ed1; box-shadow: 0 0 0 1px #0a6ed1; }
.grp-specs tfoot td { background: #fafbfc; font-weight: 600; }
/* build 210：第二层分段行（每个订单 · 每个工序） */
.grp-specs tbody tr.grp-sec td {
  background: #eef4fb; color: #2c5c8f; font-size: 11.5px; font-weight: 600; padding: 4px 8px;
  border: 1px solid #d9e6f4;
}
.grp-tip { margin-top: 6px; font-size: 11px; color: #8a929a; line-height: 1.7; }
/* build 211：第二层挂表格行下（默认收起） */
.row-editor tr.grp-l2-row > td {
  background: #fff; padding: 7px 10px 9px; border-top: 1px dashed #e2b98a; vertical-align: top;
}
.row-editor tr.grp-l2-row[hidden] { display: none; }
/* 手机上合并单：分项表横向可滑（不把页面撑宽） */
@media (max-width: 768px) {
  .grp-specs { display: block; overflow-x: auto; white-space: nowrap; }
  .grp-tip { font-size: 10.5px; }
  .grp-acts { flex-wrap: wrap; }
}

/* ============================================================
   build 212
     · 工序报工录入表：行首三角展开第二层（原来「展开明细」按钮在操作列）
     · 表头上方横向滚动条（22 列太宽，不用滚到底部去拖）
   ============================================================ */
.row-editor th.th-fold, .row-editor td.td-fold { padding: 0; text-align: center; vertical-align: middle; }
.grp-fold {
  width: 22px; height: 22px; line-height: 20px; padding: 0;
  border: 1px solid #d6dbe0; border-radius: 3px; background: #fff;
  color: #b95100; font-size: 13px; cursor: pointer;
  font-family: ui-monospace, monospace;
}
.grp-fold:hover { background: #fff3e0; border-color: #f0b27a; }
.grp-fold[aria-expanded="true"] { background: #fff3e0; border-color: #f0b27a; }
.entry-hscroll {
  height: 15px; overflow-x: auto; overflow-y: hidden;
  background: #f4f6f8; border: 1px solid #dfe3e6; border-bottom: none;
  border-radius: 3px 3px 0 0; margin: 0;
}
.entry-hscroll-inner { height: 1px; }
.entry-hscroll::-webkit-scrollbar { height: 9px; }
.entry-hscroll::-webkit-scrollbar-thumb { background: #c3cad1; border-radius: 5px; }

/* ============================================================
   build 232：工序名称输入的下拉（只能选工序库里的工序）
     · 浮层挂在 body 上：表格 / 弹窗都是 overflow:auto，放在行内会被裁掉
     · 层级在弹窗（2000）之上、toast（9999）之下
   ============================================================ */
.proc-ac {
  position: fixed; z-index: 2600;
  background: #fff; border: 1px solid #c8ced4; border-radius: 5px;
  box-shadow: 0 10px 28px rgba(31, 42, 54, .18);
  max-height: 252px; overflow: auto; font-size: 12px; padding: 3px 0;
}
.proc-ac .pa-item {
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
  color: #1f2a36; line-height: 1.4;
}
.proc-ac .pa-item.on, .proc-ac .pa-item:hover { background: #e8f1f8; }
.proc-ac .pa-item b { color: #0a6ed1; font-weight: 700; }
.proc-ac .pa-empty { padding: 8px 10px; color: #8a929a; line-height: 1.5; }
.proc-ac .pa-tip { padding: 5px 10px 3px; color: #8a929a; font-size: 11px; border-top: 1px solid #eef1f3; margin-top: 2px; }
/* 老数据里存了工序库已经没有的工序名 → 红框提示（保存时也会拦一次） */
.input.proc-invalid { border-color: #bb0000 !important; background: #fff7f7; }
