/* 轻客户端的样式：手机优先，PC 浏览器上自动铺成两栏列表。
   没有构建步骤，所以这里不用预处理器、不用 CSS 变量回退链，只写原生 CSS。 */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --line: #dfe5ec;
  --ink: #17222e;
  --muted: #68758a;
  --brand: #12304f;
  --brand-ink: #ffffff;
  --accent: #1f7ae0;
  --danger: #c0392b;
  --warn-bg: #fff6e5;
  --warn-line: #f0c674;
  /* 状态色板（第四十批 H5 化）：灰 = 还没进入流程、蓝 = 等某个岗位动手、紫 = 维修进行中、
     琥珀 = 出库 / 寄回这类收尾、绿 = 完结。列表状态徽标与卡片共用这套语义。 */
  --tone-gray: #64748b;
  --tone-gray-bg: #edf0f6;
  --tone-blue: #2f6bd8;
  --tone-blue-bg: #eaf1fc;
  --tone-violet: #6d4fc4;
  --tone-violet-bg: #f0ecfb;
  --tone-amber: #b45309;
  --tone-amber-bg: #fff3e4;
  --tone-green: #177f5b;
  --tone-green-bg: #e7f5ee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 35, 55, 0.06), 0 16px 34px -26px rgba(30, 70, 124, 0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  /* 第四十一批：四色淡渐变打底，整屏不再是一色到底（工具栏页与登录页各有自己的底，见各自规则）。 */
  background-image: linear-gradient(168deg, #e9f2fd 0%, #f4f7fc 32%, #f8f2fc 64%, #ebf8f2 100%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.screen { min-height: 100vh; }
.center { display: flex; align-items: center; justify-content: center; padding: 16px; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 8px 0 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 20px; }
.login-card p { margin: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }

input, select, button, textarea {
  font: inherit;
  color: inherit;
}

input[type="text"], input[type="password"], input[type="search"], input[type="date"], input[type="datetime-local"], select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  width: 100%;
}

/* 灰掉不能选的输入（典型是派单时间：没「派单时间修改」权限的账号）。 */
input:disabled, select:disabled {
  background: #f1f3f5;
  color: var(--muted);
  cursor: not-allowed;
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
}

button.primary { background: linear-gradient(135deg, #2f74d8 0%, #1f7ae0 58%, #34a0e8 100%); border-color: #1c6ace; color: var(--brand-ink); box-shadow: 0 8px 16px -12px rgba(31, 122, 224, 0.9); }
button.ghost { background: transparent; }
button:disabled { opacity: 0.55; cursor: default; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  /* 第四十一批：深蓝渐变顶栏 + 底部彩虹细线（见同批次 ::after 规则）。 */
  background: linear-gradient(120deg, #14304e 0%, #1c3f6b 55%, #2a5f9e 100%);
  color: var(--brand-ink);
  box-shadow: 0 2px 14px rgba(18, 42, 74, 0.24);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title { display: flex; flex-direction: column; }
.topbar .muted { color: rgba(255, 255, 255, 0.72); font-size: 12px; }
.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.topbar-actions button { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); color: var(--brand-ink); }
/* 顶栏按钮方案的动态按钮容器（第一百二十九批）：display:contents 让按钮直接参与 .topbar-actions 的
   flex 排布（同样的换行与间距），容器本身不占位。 */
.topbar-scheme-buttons { display: contents; }

/* 顶栏按钮方案编辑器（第一百二十九批）：「已选按钮」那一条——标签 + 前移 / 后移 / 去掉。 */
.topbar-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.topbar-chip button { padding: 0 4px; }

/* 顶栏「更多」下拉（第四十批）：管理类入口收在这，点开才占位置；点面板外 / 选中入口都自动收起。 */
.topbar-more-wrap { position: relative; }
.topbar-more {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  display: grid;
  gap: 6px;
  padding: 8px;
  min-width: 172px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(16, 32, 58, 0.18);
}
.topbar-more button {
  justify-content: flex-start;
  text-align: left;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.topbar-more button:hover { border-color: var(--accent); background: #eef4ff; }
/* 顶栏版本徽标：平时是只读的小字，点了没用；线上发了新外壳时才变成高亮的更新按钮——
   老客户端换不到新文件是这套外壳最常见的坑，让它自己说破，而不是等人猜「我是不是旧版」。 */
.version-chip {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  cursor: default;
}
.version-chip:disabled { opacity: 1; }
.version-chip.stale {
  border-color: rgba(255, 214, 102, 0.75);
  background: rgba(255, 214, 102, 0.18);
  color: #ffe6a7;
  cursor: pointer;
}

/* 登录屏 / 改密屏是白底卡片：同一个徽标换一套浅色配色，居中放。 */
.version-chip.on-light {
  align-self: center;
  color: var(--muted);
}
.version-chip.on-light.stale {
  border-color: rgba(176, 122, 0, 0.55);
  background: rgba(255, 214, 102, 0.28);
  color: #8a5a00;
}

.banner {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.view { padding: 12px 16px 32px; display: flex; flex-direction: column; gap: 12px; }

.filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
}/* 第四十批 H5 化：搜索独占一行、状态横滑页签、其余条件收进「筛选」抽屉、生效条件用 chips 露出来。 */
.filters .filter-search-field,
.filters .status-tabs,
.filters .filter-row,
.filters .filter-actions { grid-column: 1 / -1; }

/* 第五十九批补丁（v83）：状态页签在桌面按窗口宽度自动换行——单行横滑把滚动条藏了，
   鼠标用户不知道能滑，13 个状态会被截掉一截（用户反馈「显示不全」）；手机保持横滑（触屏滑动更省纵向空间）。 */
.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
  flex: 0 0 auto;
  padding: 6px 14px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.status-tab.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
/* 第一百二十六批：「筛选」从常开抽屉改成弹出面板——按钮开合、点面板外自动收起，不再把列表往下推。 */
.filter-more { position: relative; flex: 0 0 auto; }
.filter-more-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px;
  font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe;
  padding: 8px 12px; min-height: 34px; }
.filter-more-toggle::after { content: '▾'; color: var(--muted); font-weight: 400; }
.filter-more.is-open .filter-more-toggle { color: var(--accent); border-color: #c9dcf7;
  background: linear-gradient(180deg, #fbfdff 0%, #f2f7fd 100%); }
.filter-more-body { position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); display: grid; gap: 10px;
  padding: 12px; width: min(760px, calc(100vw - 40px)); max-height: min(72vh, 560px); overflow: auto;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 40px -18px rgba(15, 50, 105, .35); }
@media (min-width: 720px) {
  .filter-more-body { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
}
.filter-customer-combo { position: relative; }
.filter-combo-results { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px);
  display: grid; gap: 2px; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.filter-combo-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; text-align: left; cursor: pointer; }
.filter-combo-row:hover { background: #f2f7ff; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  min-height: 30px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--tone-blue-bg);
  border: 1px solid #c9dcf7;
  color: var(--accent);
}

.list { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 900px) {
  .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.order-card { display: flex; flex-direction: column; gap: 8px; }
.order-card header { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px 8px; }
.order-card .order-no { font-weight: 600; }
.order-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.order-card dt { color: var(--muted); }
.order-card dd { margin: 0; }

/* 工单列表的取数工具条与表格视图。表格不参与 .list 的两栏网格（窄屏单列 / 宽屏两列都是卡片口径），
   所以它自己套一层横向滚动容器，手机上左右滑而不是把列压变形。 */
.list-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.list-tools .export-hint { flex-basis: 100%; margin: 0; font-size: 12px; }
/* 批量编辑（第五十七批）：勾选列 / 工具条 / 展开面板。没有入口码时这些元素整块带 hidden，不占位。 */
.batch-tools { flex-basis: 100%; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; background: #f8fbff; }
.batch-tools input[type="checkbox"], .data-table td.pick input, .card-pick input { width: 18px; height: 18px; accent-color: var(--brand, #1f69c8); }
.data-table td.pick, .data-table th.pick { width: 34px; padding-right: 2px; }
.card-pick { display: inline-flex; align-items: center; margin-right: 2px; }
.batch-panel { display: flex; flex-direction: column; gap: 10px; }
.batch-panel .row { flex-wrap: wrap; }
.batch-results { margin: 0; padding-left: 18px; font-size: 13px; color: #b91c1c; max-height: 220px; overflow: auto; }
.batch-results li { margin: 2px 0; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-switch button { border: 0; border-radius: 0; padding: 8px 14px; min-height: 38px; background: #fff; }
.view-switch button + button { border-left: 1px solid var(--line); }
.view-switch button[aria-pressed="true"] { background: linear-gradient(135deg, #2f74d8, #1e63c0); border-color: #1e63c0; color: var(--brand-ink); box-shadow: 0 6px 14px -10px rgba(31, 105, 200, 0.9); }
.table-wrap {
  /* 横向、纵向都在容器里滚：限高后两条滚动条都贴着视图下方（见 work-orders.js 的 fitTableHeight）。 */
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table-horizontal-proxy {
  position: fixed;
  z-index: 60;
  bottom: 0;
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(31, 105, 200, 0.18);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(245, 249, 255, 0.96);
  box-shadow: 0 -4px 14px rgba(23, 54, 94, 0.12);
  overscroll-behavior-x: contain;
}
.table-horizontal-proxy[hidden] { display: none; }
.table-horizontal-proxy > div { height: 1px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.4; }
.data-table th, .data-table td { height: 36px; padding: 4px 8px; vertical-align: middle; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table thead th { height: 34px; padding: 5px 8px; position: sticky; top: 0; background: linear-gradient(180deg, #f3f8fe 0%, #e8f0fa 100%); box-shadow: inset 0 -1px 0 #dbe6f3; z-index: 1; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f4f8fe; }
/* 数量、金额与机器数这类短值统一居中，避免靠右后在宽列里与列名错位；数字仍用等宽字形便于纵向核对。 */
.data-table td.num, .data-table th.num { text-align: center; font-variant-numeric: tabular-nums; }
.data-table td.wrap { white-space: normal; min-width: 180px; }
/* 派单屏的行内下拉（目标销售 / 目标维修小组）：窄列里给最小宽度，选项文字不至于只剩一个字。 */
.data-table select.row-pick { min-width: 148px; }
.data-table td :is(select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), button:not(.order-link):not(.th-sort):not(.fault-missing)) {
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: middle;
}
.data-table td input[type="datetime-local"] { width: 170px; min-width: 170px; }
.th-sort {
  border: 0;
  background: none;
  border-radius: 4px;
  padding: 2px 4px;
  min-height: 0;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.th-sort.is-active { color: var(--accent); }
.data-table th.column-sort-head,
.data-table th.column-filter-head {
  white-space: nowrap;
  vertical-align: middle;
}
/* 筛选入口放到字段名下一行：横向只按字段名计算，多列列表能明显少出滚动宽度。 */
.data-table th.column-filter-head {
  height: 48px;
  padding-block: 3px 2px;
}
.column-head-title,
.column-head-filter {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.column-head-title {
  position: relative;
  min-height: 18px;
  gap: 2px;
}
.column-head-title.is-sortable { cursor: pointer; }
.column-head-filter {
  min-height: 16px;
  margin-top: 1px;
}
.data-table th.num .column-head-title,
.data-table th.num .column-head-filter { justify-content: center; }
.column-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-left: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #91a0b4;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}
.column-head-title .column-sort-button {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .18;
  transition: opacity .15s ease, background .15s ease;
}
.data-table th.column-filter-head:hover .column-head-title .column-sort-button,
.data-table th.column-filter-head:focus-within .column-head-title .column-sort-button {
  opacity: .9;
}
.column-head-title .column-sort-button:focus-visible { opacity: 1; }
.column-sort-button:hover { background: rgba(31, 122, 224, 0.1); color: var(--accent); }
.column-sort-button.is-active {
  background: var(--tone-blue-bg);
  color: var(--accent);
  opacity: 1;
}
.column-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-left: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #7b8ba1;
  vertical-align: middle;
  opacity: .52;
  transition: opacity .15s ease, background .15s ease;
}
.data-table th.column-filter-head:hover .column-filter-button,
.data-table th.column-filter-head:focus-within .column-filter-button { opacity: 1; }
.column-filter-button:hover { background: rgba(31, 122, 224, 0.1); color: var(--accent); }
.column-filter-button.is-active {
  background: var(--tone-blue-bg);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 224, 0.25);
  opacity: 1;
}
@media (hover: none) {
  .column-head-title .column-sort-button { opacity: .72; }
  .column-filter-button { opacity: .82; }
}
.column-filter-popover {
  position: fixed;
  z-index: 80;
  width: min(340px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px -20px rgba(15, 35, 70, 0.42);
  display: grid;
  gap: 10px;
}
.column-filter-popover-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.column-filter-popover-head strong { font-size: 14px; color: var(--ink); }
.column-filter-popover-head span { font-size: 11px; color: var(--muted); }
.column-filter-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.column-filter-presence > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.column-filter-presence button { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.column-filter-presence button.is-active {
  border-color: rgba(31, 122, 224, 0.35);
  background: var(--tone-blue-bg);
  color: var(--accent);
  font-weight: 600;
}
.column-filter-popover input[type="search"],
.column-filter-popover input[type="date"] { min-height: 36px; padding: 7px 9px; }
.column-filter-date-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.column-filter-date-presets button {
  min-height: 32px;
  padding: 5px 6px;
  font-size: 12px;
  border-radius: 6px;
}
.column-filter-date-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}
.column-filter-date-custom label { min-width: 0; font-size: 12px; }
.column-filter-date-custom span { padding-bottom: 9px; color: var(--muted); font-size: 12px; }
.column-filter-date-hint {
  margin: 0;
  padding: 7px 8px;
  border-radius: 6px;
  background: var(--tone-blue-bg);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.45;
}
.column-filter-date-hint.is-error {
  background: #fff1f0;
  color: #b42318;
}
.column-filter-number-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}
.column-filter-number-range label { min-width: 0; font-size: 12px; }
.column-filter-number-range span { padding-bottom: 9px; color: var(--muted); font-size: 12px; }
.column-filter-popover input[type="number"] {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
}
.column-filter-options {
  display: grid;
  gap: 2px;
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.column-filter-option-search {
  position: relative;
  display: block;
  margin: 0;
}
.column-filter-option-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.column-filter-popover .column-filter-option-search input[type="search"] {
  width: 100%;
  padding-left: 32px;
}
.column-filter-option-empty {
  padding: 14px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.column-filter-option {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.column-filter-option:hover { background: #f3f8ff; }
.column-filter-option input { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.column-filter-option span { overflow-wrap: anywhere; }
.column-filter-option-all {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 32px;
  margin: 0 0 3px;
  padding: 5px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-weight: 600;
  text-align: left;
}
.column-filter-option-all:disabled { cursor: default; opacity: .58; }
.column-filter-popover-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}
.column-filter-popover-foot button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.report-table .th-sort { display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px; width: 100%; white-space: nowrap; }
.report-table th.num .th-sort { justify-content: flex-end; width: 100%; }
.report-table .report-sort-arrow { font-size: 11px; opacity: .55; }
.report-table .th-sort.is-active .report-sort-arrow { opacity: 1; }
.order-link {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.fault-cell {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.fault-missing {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  cursor: pointer;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3f9;
  border: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap;
}

/* 提醒档徽标：缺运单号 / 待补一类的「还没做完」标记，用现有的警示色，不新开色板。 */
.badge-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: #8a5a00;
}
/* 状态徽标色档（第四十批）：语义见 :root 的状态色板注释；列表状态列与卡片共用 data-tone。 */
.badge[data-tone="gray"] { background: var(--tone-gray-bg); border-color: #dde3ec; color: var(--tone-gray); }
.badge[data-tone="blue"] { background: var(--tone-blue-bg); border-color: #c9dcf7; color: var(--tone-blue); }
.badge[data-tone="violet"] { background: var(--tone-violet-bg); border-color: #ddd3f4; color: var(--tone-violet); }
.badge[data-tone="amber"] { background: var(--tone-amber-bg); border-color: #f3d3a8; color: var(--tone-amber); }
.badge[data-tone="green"] { background: var(--tone-green-bg); border-color: #bfe3d2; color: var(--tone-green); }

/* 适配机型（第一百三十四批）：可移除的绑定 chip——徽标里的「×」收敛成贴边的小按钮。 */
.binding-chip { display: inline-flex; align-items: center; gap: 4px; }
.binding-chip button {
  border: 0;
  background: none;
  padding: 0 2px;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

/* 表格里的双行单元格：第一行是主值，第二行是小字补充（客户双名称 + 添加人用）。 */
.cell-main { display: block; }
.cell-sub { display: block; font-size: 12px; }

/* 企业微信聊天工具栏页：宽度只有聊天的侧边栏那么窄，全部按单列排，不出现横向滚动。 */
.toolbar-body { margin: 0; padding: 0; background: #f4f6fa; }
.toolbar-inner { padding: 10px; max-width: 520px; margin: 0 auto; }
.toolbar-shell { display: grid; gap: 10px; }
.toolbar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.toolbar-card { padding: 10px 12px; }
.toolbar-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-card-head h1 { font-size: 16px; margin: 0; }
.toolbar-card-head h2 { font-size: 14px; margin: 0; }
.toolbar-dl { display: grid; grid-template-columns: 76px 1fr; gap: 4px 8px; margin: 8px 0 0; font-size: 13px; }
.toolbar-dl dt { color: var(--muted); }
.toolbar-dl dd { margin: 0; word-break: break-all; }
.toolbar-orders { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.toolbar-orders li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.toolbar-actions button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.toolbar-order-list { display: grid; gap: 8px; margin-top: 8px; }
.toolbar-order-card { padding: 8px 0; border-top: 1px solid var(--line); }
.toolbar-order-card:first-child { border-top: 0; padding-top: 0; }
.toolbar-order-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.toolbar-head-actions { margin-top: 0; justify-content: flex-end; }
.toolbar-group-list { display: grid; gap: 7px; margin-top: 9px; }
.toolbar-group-customer {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.toolbar-group-customer:hover { border-color: var(--accent); background: #f8fbff; }
.toolbar-group-customer-name { font-weight: 600; font-size: 13px; }
.toolbar-group-customer-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; font-size: 12px; }

/* 销售聊天侧边栏的报价单（2026-11-02）：选择已报价工单 → 出 PNG → 直接拖进当前单聊 / 群聊。
   侧边栏很窄，预览图单独放进有高度上限的舞台，按钮换行也不横向溢出。 */
.toolbar-quote-card { border-color: #c9dcf6; background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); }
.toolbar-quote-picker { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.toolbar-quote-picker select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.toolbar-quote-preview { display: grid; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.toolbar-quote-stage {
  max-height: 46vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f6;
}
.toolbar-quote-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: element;
}
.toolbar-quote-image:active { cursor: grabbing; }
.toolbar-quote-image.is-dragging { opacity: .68; }
.toolbar-quote-hint,
.toolbar-quote-notice,
.toolbar-quote-error { margin: 0; font-size: 12px; line-height: 1.5; }
.toolbar-quote-hint { color: var(--muted); }
.toolbar-quote-notice { color: #166534; }
.toolbar-quote-error { margin-top: 7px; color: #b42318; }
.toolbar-quote-actions { margin-top: 0; }

/* 列设置：可选列多起来之后，一个折叠面板比一排复选框更省横向空间（窄屏上尤其明显）。 */
.column-settings { position: relative; font-size: 13px; }
.column-settings > summary {
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  list-style: none;
}
.column-settings > summary::-webkit-details-marker { display: none; }
.column-settings > summary::after { content: ' ▾'; color: var(--muted); }
.column-settings[open] > summary::after { content: ' ▴'; }
.column-settings-body {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  min-width: 320px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 35, 70, 0.12);
  display: grid;
  gap: 6px;
}
.column-settings-title { font-weight: 600; font-size: 13px; }
.column-settings-list { display: grid; gap: 3px; }
.column-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 62px;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  border-radius: 5px;
}
.column-setting-row:hover { background: #f7f9fc; }
.column-setting-row.is-hidden-optional { color: var(--muted); }
.column-setting-toggle { min-width: 0; gap: 6px; }
.column-setting-toggle > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-setting-fixed-dot { width: 13px; height: 13px; border-radius: 50%; background: #dce3ec; flex: 0 0 auto; }
.column-setting-kind { color: var(--muted); font-size: 11px; text-align: right; }
.column-setting-move { display: inline-flex; gap: 2px; }
.column-order-button {
  width: 28px;
  min-width: 28px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}
.column-order-button:disabled { opacity: .35; cursor: default; }

/* 搜索范围：和「列设置」同一套下拉口径。曾经漏了这组样式，展开体落在文档流里，
   一点开就把整行筛选条撑高、把同行字段挤到底部（第三十九批修的线上问题）。 */
.scope-settings { position: relative; font-size: 13px; }
.scope-settings > summary {
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  list-style: none;
}
.scope-settings > summary::-webkit-details-marker { display: none; }
.scope-settings > summary::after { content: ' ▾'; color: var(--muted); }
.scope-settings[open] > summary::after { content: ' ▴'; }
.scope-settings-body {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  width: 260px;
  max-height: 320px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 35, 70, 0.12);
  display: grid;
  gap: 6px;
}

.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row select, .row input[type="date"] { width: auto; }
.grow { flex: 1; }

.empty, .loading { padding: 24px 4px; color: var(--muted); text-align: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #24405f 0%, #16283c 100%);
  color: #fff;
  border: 1px solid rgba(120, 170, 230, 0.35);
  padding: 10px 16px;
  border-radius: 999px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 10px 24px rgba(10, 20, 35, 0.32);
  z-index: 400;
}

/* 发料页底部有吸底操作条（z-index: 30）。提示必须压在它上面并整体上移，否则用户只看到
   操作条里伸出来的一小截文字，既看不清失败原因，也容易误以为系统没有反馈。 */
body:has(.parts-issue-actionbar:not([hidden])) .toast {
  bottom: 96px;
}

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 4px 0 12px; }
.pager-summary { color: var(--muted); font-size: 12.5px; line-height: 1.4; white-space: nowrap; }
.pager-pages { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.pager .pager-page {
  min-width: 32px;
  padding-inline: 8px;
  font-variant-numeric: tabular-nums;
}
.pager .pager-page.is-current {
  color: var(--accent);
  border-color: rgba(31, 122, 224, 0.55);
  background: var(--tone-blue-bg);
  font-weight: 700;
}
.pager-ellipsis { padding: 0 3px; color: var(--muted); line-height: 1; }
.pager #order-page-jump { width: 74px; min-width: 64px; text-align: center; }

/* 工单列表常驻的待办入口：数量徽标不抢眼，但要能在扫列表时一眼看到。 */
.orders-todo-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.orders-todo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.orders-todo-badge[hidden] { display: none; }

.order-todo-modal {
  width: min(760px, 100%);
  max-height: min(82vh, 760px);
}

.order-todo-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 9px;
  min-height: 120px;
  overflow: auto;
  padding: 2px;
}

.order-todo-list .my-todos-card { margin: 0; }
.order-todo-actions { margin-top: 2px; }

@media (max-width: 719px) {
  .order-todo-modal { width: 100%; max-height: 88vh; }
  .pager #order-page-jump { width: 62px; min-width: 56px; }
}

.flash { animation: flash 0.6s ease-out; }

/* 卡片标题行：左边标题、右边计数或状态。回收站与「录错了？」卡片都用它。 */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-head h2 { margin: 0; font-size: 15px; }
/* 第八十五批：设置页卡片展开 / 收起——收起的卡片只留卡头；卡头右侧一撮状态 + 开关。
   第一百零一批补 :not([data-detail-module])：工单详情的模块卡也是 .card，但卡头是 <header> /
   补出来的 .module-head（不是 .card-head）——被这条命中会连卡头带「展开」按钮一起藏掉
   （用户反馈「到货设成默认收起后没有展开按钮」）。详情模块的折叠样式在下面单独一条。 */
.card.is-collapsed:not([data-detail-module]) > :not(.card-head) { display: none; }
.card-head-side { display: inline-flex; align-items: baseline; gap: 8px; }

/* 工单详情：机器卡片与客户端写操作（检测、拣货）。 */
.toolbar { display: flex; align-items: center; gap: 10px; }
/* 派单屏工具栏：状态文案较长时把「关键字」标签挤断行，允许整块换行并禁止标签内部断行。 */
.assign-toolbar { flex-wrap: wrap; }
.assign-toolbar label.inline { white-space: nowrap; }
.assign-toolbar select { width: auto; min-width: 108px; }
.assign-custom-range { display: inline-flex; align-items: center; gap: 6px; }
.assign-custom-range input[type="date"] { width: 148px; min-height: 36px; padding: 6px 8px; }
.assign-custom-range span { color: var(--muted); font-size: 12px; }
.assignment-summary {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border: 1px solid #cfe0f2;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbff 0%, #eef6ff 60%, #f7fbf8 100%);
}
.assignment-summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.assignment-summary-title { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.assignment-summary-title strong { color: var(--brand); font-size: 14px; }
.assignment-summary-title .muted { font-size: 11px; }
.assignment-summary-controls { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.assignment-summary-controls label.inline { white-space: nowrap; font-size: 12px; }
.assignment-summary-controls select {
  width: auto;
  min-width: 108px;
  min-height: 32px;
  padding: 4px 8px;
}
.assignment-summary-items { display: flex; flex: 1 1 520px; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.assignment-summary-total {
  padding: 3px 8px;
  border-radius: 999px;
  background: #173b62;
  color: #fff;
  font-weight: 600;
}
.assignment-summary-total.is-completed { background: #0f766e; }
.assignment-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #d9e5f2;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}
.assignment-summary-chip strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.assignment-summary-completed { color: #0f766e; font-variant-numeric: tabular-nums; }
.machine-card { display: flex; flex-direction: column; gap: 8px; }
.machine-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.machine-card .machine-code { font-weight: 600; }
.machine-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.machine-card dt { color: var(--muted); }
.machine-card dd { margin: 0; }
.machine-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.machine-actions input { flex: 1; min-width: 120px; }
.action-hint { margin: 0; font-size: 12px; color: var(--muted); }
.machine-form { display: flex; flex-direction: column; gap: 8px; }
.machine-form label { font-size: 12px; }
.machine-form textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  width: 100%;
  resize: vertical;
}
.machine-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-hint { margin: 0; font-size: 12px; color: var(--danger); }
.finance-correction-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #efc78f;
  border-left: 4px solid #d97706;
  border-radius: 10px;
  background: #fff8e8;
}
.finance-correction-callout p { flex: 1 1 280px; margin: 0; color: #7c4a03; font-size: 12.5px; line-height: 1.55; }
.finance-correction-callout .primary { flex: 0 0 auto; }
/* 复核驳回：销售在工单详情第一屏就能看到原因和“修改并重提”入口。 */
.pre-repair-rejected-banner,
.finance-rejected-banner {
  border-color: #efc78f;
  border-left: 4px solid #d97706;
  background: #fff8e8;
}
.pre-repair-rejected-banner .action-hint,
.finance-rejected-banner .action-hint { color: #7c4a03; }
.pre-repair-rejected-banner .machine-actions,
.finance-rejected-banner .machine-actions { margin-top: 10px; }
.machine-form summary { cursor: pointer; font-size: 12px; color: var(--muted); }
/* 机器卡片里只读的「维修记录 / 配件明细」：一条一块，手机上竖排也不挤。 */
.machine-form h4 { margin: 10px 0 0; font-size: 12px; color: var(--ink); }
.record-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.record-list li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}
.machine-form input[type="number"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  width: 100%;
}
/* 附件卡片：上传表单 + 按机器分组的缩略图网格。 */
.machine-form input[type="file"] {
  padding: 8px 0;
  font-size: 12px;
  width: 100%;
}
.attachment-error { white-space: pre-wrap; }
/* 附件中心四分区（第八十批；第九十九批瘦身）：到货 / 检测 / 维修 / 出库，每区固定用途；
   每区默认收成一条「折叠条」（标题 + 数量），点开才铺开缩略图与上传区，卡片不再占地方。 */
.attachment-center { display: flex; flex-direction: column; gap: 8px; }
.attachment-head-tools { display: inline-flex; align-items: center; gap: 8px; }
.attachment-head-tools .ghost {
  padding: 2px 10px;
  min-height: 28px;
  font-size: 12px;
}
.attachment-partition {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.attachment-partition-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  background: #f7f9fc;
}
.attachment-partition-bar::-webkit-details-marker { display: none; }
.attachment-partition-bar::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.attachment-partition[open] > .attachment-partition-bar::after { transform: rotate(45deg); }
.attachment-partition-title { font-weight: 600; font-size: 13px; }
.attachment-partition-bar .badge { margin-left: auto; }
.attachment-partition-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.attachment-partition-body .action-hint { margin: 0; }
.attachment-upload-box { border: 1px dashed var(--line); border-radius: 8px; }
.attachment-upload-bar {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}
.attachment-upload-bar::-webkit-details-marker { display: none; }
.attachment-uploads {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding: 8px 10px;
}
.attachment-slot { display: flex; flex-direction: column; gap: 4px; }
.attachment-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.attachment-slot-label { font-size: 12px; color: var(--muted); }
.attachment-pick { flex: 0 0 auto; }
.attachment-slot .machine-actions { margin: 0; }
.attachment-groups { display: flex; flex-direction: column; gap: 10px; }
.attachment-group h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
}
.attachment-group h3 .muted { font-weight: 400; font-size: 11px; }
.attachment-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}
.attachment { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.attachment-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  overflow: hidden;
}
.attachment-frame img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.attachment-file { color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.attachment-inactive .attachment-frame { background: #f1f1f3; opacity: 0.7; }
.attachment figcaption { display: flex; flex-direction: column; gap: 2px; }
.attachment-role { color: var(--brand); font-weight: 600; }
.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment figcaption button {
  align-self: flex-start;
  padding: 2px 8px;
  min-height: 26px;
  font-size: 11px;
}
/* 拍照（第八十一批详情页对话框 → 第八十二批独立扫码屏）：「扫码确认机器 → 连拍」方块，与附件缩略图同一种手感。 */
.capture-hint { color: var(--muted); }
.capture-error { color: #b3261e; }
.capture-tiles {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  margin: 4px 0;
}
.capture-tile { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.capture-tile figcaption { color: var(--muted); }
.capture-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  overflow: hidden;
  cursor: zoom-in;
}
.capture-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.capture-thumb-file { color: var(--muted); font-weight: 600; }
.capture-remove { align-self: flex-start; padding: 2px 8px; min-height: 26px; font-size: 11px; }
.capture-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 20px;
  cursor: pointer;
}
.capture-add span { font-size: 12px; }
/* 拍照扫码屏（第八十二批）：机器卡、候选行、瓦片状态标签。 */
.capture-card { margin-top: 12px; }
.capture-machine { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.capture-machine-code {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 18px;
  font-weight: 700;
}
.capture-machine-code .muted { font-size: 12px; font-weight: 400; }
.capture-candidates { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.capture-candidate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 44px;
  text-align: left;
}
.capture-tile-tag { font-size: 11px; color: var(--muted); }
.capture-tile-failed { color: #b3261e; }
.capture-existing { margin-bottom: 6px; }
/* 到货卡片：记录列表 + 扫码日志（都是只读展示，写操作沿用上面的 .machine-form）。 */
.inbound-records { display: flex; flex-direction: column; gap: 10px; }
.pickup-return-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted, #f8fafc);
}
.pickup-return-inline .action-hint { margin: 4px 0 0; }
.pickup-return-inline button { flex: 0 0 auto; }
.inbound-record {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.inbound-record h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
}
.inbound-record dl { margin: 0; }
/* 到货记录右下角的「修改」入口：靠右放，别把只读信息行挤乱。 */
.inbound-record-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.inbound-scans { display: flex; flex-direction: column; gap: 6px; }
.inbound-scan-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* 到货扫码屏：表单本身是普通卡片；「扫码」按钮在顶部工具条，相机在固定居中的全屏弹层里。 */
.scan-form input[type="number"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  width: 100%;
}
.scan-toolbar { flex-wrap: wrap; }
.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 15, 28, 0.86);
}
.scanner-overlay[hidden] { display: none; }
.scanner-panel {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scanner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scanner-title { color: #f8fafc; font-size: 15px; }
.scanner-panel .action-hint { margin: 0; color: #dbe4f3; }
.scanner-close { color: #f1f5f9; border-color: rgba(241, 245, 249, 0.55); }
.scanner-head .scanner-photo { margin-left: auto; }
.scanner {
  display: flex;
  justify-content: center;
}
.scanner video {
  width: 100%;
  max-width: 520px;
  max-height: 68vh;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 12px;
  object-fit: cover;
}
body.scanner-open { overflow: hidden; }
.scan-result-ok { border-left: 4px solid #2f8f5b; }
.scan-result-attention { border-left: 4px solid #c8811a; }
/* 到货扫码第一步：先识别机器。识别卡只读，确认机器后才在下方展开到货填写区。 */
.scan-preview-card { border-left: 4px solid var(--line); }
.scan-preview-card.is-ready { border-left-color: #2f8f5b; }
.scan-preview-card.is-blocked { border-left-color: #c8811a; }
.scan-preview-card.is-confirmed { background: linear-gradient(180deg, #f4fcf7 0%, #fff 100%); }
.scan-confirmed-strip { padding: 12px 14px; display: grid; gap: 9px; }
.scan-confirmed-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.scan-confirmed-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #def3e6;
  color: #147a4c;
  font-size: 13px;
  font-weight: 800;
}
.scan-confirmed-title { font-size: 15px; font-weight: 700; color: #153b2d; }
.scan-confirmed-reset { margin-left: auto; min-height: 30px; padding: 3px 10px; font-size: 12px; }
.scan-confirmed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  color: #355368;
  font-size: 12px;
}
.scan-confirmed-meta > span { display: inline-flex; align-items: baseline; gap: 4px; }
.scan-confirmed-meta small { color: var(--muted); font-size: 11px; }
.scan-confirmed-meta .person-chip, .scan-confirmed-meta .person-link { font-size: 12px; }
.scan-preview-reason {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.55;
}
.scan-preview-card.is-ready:not(.is-confirmed) .scan-preview-reason { background: #edf9f2; color: #176343; }
.scan-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.scan-preview-meta > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scan-preview-meta span { color: var(--muted); font-size: 11px; }
.scan-preview-meta strong { font-size: 13px; overflow-wrap: anywhere; }
.scan-preview-confirmed-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.scan-preview-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.scan-preview-actions button { min-width: 112px; }
.scan-arrival-card { display: grid; gap: 12px; padding: 14px; }
.scan-step-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 1px 1px 3px;
}
.scan-step-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: #eaf1fc;
  color: #1f62ae;
  font-size: 12px;
  font-weight: 700;
}
.scan-step-copy { min-width: 0; display: grid; gap: 1px; }
.scan-step-copy strong { color: #183b5d; font-size: 13px; }
.scan-step-copy small { color: var(--muted); font-size: 11px; }
.scan-step-of { margin-left: auto; color: #7a8b9f; font-size: 11px; white-space: nowrap; }
.scan-arrival-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}
.scan-arrival-head strong { font-size: 15px; color: #17222e; }
.scan-arrival-head span { color: var(--muted); font-size: 11px; }
.scan-arrival-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 9px; }
.scan-arrival-grid label { min-width: 0; }
.scan-arrival-grid .scan-field-wide { grid-column: 1 / -1; }
.scan-arrival-grid input, .scan-arrival-grid select { min-height: 42px; }
.scan-help-panel {
  border: 1px dashed #cfdae7;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}
.scan-help-panel summary { cursor: pointer; color: #46627e; font-weight: 600; }
.scan-help-panel p { margin: 7px 0 0; line-height: 1.55; }
.scan-damage-panel { padding: 10px; border: 1px solid #f2d39c; border-radius: 9px; background: #fffaf1; }
.scan-damage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.scan-damage-head strong { color: #7a4a09; font-size: 13px; }
.scan-damage-head span { color: #8a6a34; font-size: 11px; }
.scan-confirm-actions { display: grid; gap: 6px; }
.scan-confirm-actions button { width: 100%; min-height: 46px; font-weight: 700; }
.scan-confirm-actions span { text-align: center; color: var(--muted); font-size: 11px; }
@media (max-width: 560px) {
  .scan-preview-meta { grid-template-columns: 1fr 1fr; gap: 7px 10px; }
  .scan-preview-actions button { flex: 1 1 0; min-width: 0; }
  .scan-arrival-grid { gap: 9px 7px; }
  .scan-arrival-grid label { font-size: 12px; }
}
.scan-history { display: flex; flex-direction: column; gap: 6px; }
.scan-history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* 角色权限一屏：左边一列角色、右边权限勾选。窄屏（手机）下两列压成一列，角色列表在上面。 */
.roles-layout { display: grid; grid-template-columns: 260px 1fr; gap: 12px; align-items: start; }
.roles-layout dl { margin: 0 0 8px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.roles-layout dt { color: var(--muted); }
.roles-layout dd { margin: 0; }
.role-item {
  display: grid;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
}
.role-item.is-active { border-color: var(--accent); background: #eef4ff; }
.role-name { font-weight: 600; }
/* 功能面板方案（第八十六批）：左栏方案列表在 260px 侧栏里保持单列（.list 在 ≥900px 会变两栏，套进来会挤）。 */
.scheme-list { display: flex; flex-direction: column; gap: 8px; }
/* 用户授权一屏（第六十一批）：左右两栏各自滚动、互不带走对方——左边账号 50+、右边权限清单也长，
   整页一起滚的时候左边滑下去就看不到人在哪，选账号和改权限对不上号。手机（≤720px）仍是单列整页滚。 */
#user-grants-body .roles-layout > aside,
#user-grants-body .roles-layout > #grants-detail {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* 左栏收进固定宽度的滚动容器后，卡片里的长用户名（如 daisengongchengshi6007_1）默认不断行，
   会把两列网格撑出横向滚动条——只给这一屏的账号卡片开断行，其他列表不受影响。 */
#user-grants-body .roles-layout > aside .role-item .muted { overflow-wrap: anywhere; }
.permission-group { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.permission-group:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; }

/* 功能面板：分类卡片 + 入口按钮。入口是按钮而不是链接，因为要复用顶栏那套点击行为。 */
.panel-summary { margin: 0 0 12px; font-size: 13px; }
.panel-groups { display: flex; flex-direction: column; gap: 12px; }
.panel-hint { margin: 6px 0 10px; font-size: 13px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.panel-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
.panel-entry:hover { border-color: var(--accent); background: #eef4ff; }
.panel-entry-label { font-weight: 600; }
.panel-entry-desc { color: var(--muted); font-size: 12px; line-height: 1.4; }

.permission-item { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; }
.permission-item input { margin-top: 2px; }
.permission-text { display: flex; flex-direction: column; line-height: 1.25; }
.permission-name { font-size: 13px; }
.permission-code { font-size: 11px; color: var(--muted); }

/* 部门挂人的多选清单：超过一屏自己滚动，页面不跟着长。 */
.member-pick-list {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

@media (max-width: 720px) {
  .roles-layout { grid-template-columns: 1fr; }
  /* 第四十批：手机上输入框 16px（iOS 聚焦不触发页面缩放）、按钮加高到 44px 好点；
     页签保持紧凑 36px，并横滑到屏幕边缘。 */
  input[type="text"], input[type="password"], input[type="search"], input[type="date"], select { font-size: 16px; }
  button { min-height: 44px; }
  .status-tab { min-height: 36px; }
  /* 手机：回到单行横滑，滑到屏幕边缘。 */
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  /* 手机顶栏压缩：品牌、人员、版本收成一行，操作按钮单行横滑；不再让六个按钮折成三排。
     目标是把首屏顶栏从约 270px 压到约 80px，给工单列表和卡片留出纵向空间。 */
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    box-shadow: 0 8px 20px -18px rgba(6, 25, 46, 0.85);
  }
  .topbar-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }
  .topbar-title > strong {
    font-size: 15px;
    line-height: 1.15;
    letter-spacing: 0.02em;
  }
  #app-user {
    min-width: 0;
    overflow: hidden;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #app-version {
    align-self: center;
    max-width: 132px;
    margin: 0;
    padding: 2px 6px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.45;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    padding-bottom: 1px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    font-size: 12.2px;
    white-space: nowrap;
  }
  /* 手机分页压缩：分页原先允许换行，两个 select 又按整行宽度撑开，实际会占掉近 170px。
     这里收成单行胶囊工具条；页码和每页条数自身已带“第 N 页 / N 条”，隐藏重复文字。
     320px 级窄屏进一步把上一页 / 下一页换成箭头，保证不折行。 */
  .pager {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px 8px;
    border: 1px solid rgba(117, 142, 172, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px -18px rgba(15, 38, 68, 0.65);
  }
  .pager button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    line-height: 1;
    white-space: nowrap;
  }
  .pager label.inline {
    flex: 0 1 auto;
    min-width: 0;
    gap: 0;
    font-size: 0;
  }
  .pager label.inline select {
    width: auto;
    height: 30px;
    min-height: 30px;
    padding: 2px 22px 2px 8px;
    border-radius: 999px;
    font-size: 12.5px;
    line-height: 1;
  }
  .pager-numbered {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    border-radius: 14px;
  }
  .pager-numbered .pager-summary {
    flex: 1 0 100%;
    text-align: center;
    white-space: normal;
  }
  .pager-numbered .pager-pages { flex-wrap: wrap; }
  #order-page { min-width: 74px; max-width: 92px; }
  #order-page-size { min-width: 67px; max-width: 82px; }
  #order-pager-note { display: none; }
  /* 横向操作条自身是滚动容器；更多菜单改成 fixed，避免被 overflow 裁掉。 */
  .topbar-more {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 76px);
    right: 10px;
    left: auto;
    z-index: 30;
    min-width: 154px;
    max-height: min(58vh, 420px);
    overflow: auto;
  }
  .topbar::after { height: 2px; opacity: 0.72; }
  /* 用户授权：手机上两栏压成一列，恢复整页滚（各自滚动只对桌面两栏有意义）。 */
  #user-grants-body .roles-layout > aside,
  #user-grants-body .roles-layout > #grants-detail { max-height: none; overflow: visible; }
}

@media (max-width: 380px) {
  .pager { gap: 4px; padding: 4px 6px; }
  .pager button {
    width: 32px;
    min-width: 32px;
    padding: 4px 0;
    font-size: 0;
  }
  .pager.pager-numbered button {
    width: auto;
    min-width: 30px;
    padding: 4px 7px;
    font-size: 12px;
  }
  #order-prev::after,
  #order-next::after {
    display: block;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
  }
  #order-prev::after { content: '‹'; }
  #order-next::after { content: '›'; }
  #order-page { min-width: 86px; max-width: 94px; font-size: 12px; }
  #order-page-size { min-width: 73px; max-width: 80px; font-size: 12px; }
}

@keyframes flash { from { background: #fff9d6; } to { background: transparent; } }

@media (display-mode: standalone) {
  .topbar { padding-top: max(8px, env(safe-area-inset-top)); }
}

/* ===== 第四十一批：配色加厚（用户「颜色丰富一些，看起来舒畅」）=====
   语义不变：同一个状态色沿「页签圆点 → 徽标 → 卡片左侧色条 → 表格行左缘」四处出现，配合页面、
   顶栏、表头与主按钮的柔和渐变，把原来一色到底的灰白底换成有层次的一组颜色。 */
[data-tone="gray"] { --tone: var(--tone-gray); --tone-bg: var(--tone-gray-bg); }
[data-tone="blue"] { --tone: var(--tone-blue); --tone-bg: var(--tone-blue-bg); }
[data-tone="violet"] { --tone: var(--tone-violet); --tone-bg: var(--tone-violet-bg); }
[data-tone="amber"] { --tone: var(--tone-amber); --tone-bg: var(--tone-amber-bg); }
[data-tone="green"] { --tone: var(--tone-green); --tone-bg: var(--tone-green-bg); }

/* 顶栏底缘的彩虹细线；顶栏按钮悬停提亮一档。 */
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 28%, #c084fc 52%, #f0abfc 74%, #34d399 100%);
  opacity: 0.9;
  pointer-events: none;
}
.topbar-actions button:hover { background: rgba(255, 255, 255, 0.24); border-color: rgba(255, 255, 255, 0.5); }

/* 登录 / 改密卡片顶缘同一条细线，白卡片也有点颜色。 */
.login-card { position: relative; overflow: hidden; box-shadow: 0 18px 40px -28px rgba(28, 68, 118, 0.65); }
.login-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #f0abfc, #34d399);
}

/* 工单卡片：左侧一条状态色，翻卡片列表时按颜色扫。 */
.order-card[data-tone] { border-left: 4px solid var(--tone, var(--line)); }

/* 表格：每行左缘一条 3px 状态色；悬停整行从状态色淡底渐到白。 */
.data-table tbody tr[data-tone] td:first-child { box-shadow: inset 3px 0 0 var(--tone, transparent); }
.data-table tbody tr[data-tone]:hover td { background: linear-gradient(90deg, var(--tone-bg, #f4f8fe) 0%, #fdfefe 50%); }

/* 状态页签：未选中带状态色小圆点，选中直接用该状态实色，一条横滑就是一组彩色。 */
.status-tab { display: inline-flex; align-items: center; gap: 6px; }
.status-tab::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone, #c3ccd9);
  box-shadow: 0 0 0 2px var(--tone-bg, #eef1f6);
}
.status-tab:hover { border-color: var(--tone, var(--accent)); color: var(--ink); }
.status-tab.is-on {
  background: var(--tone, #1c4f92);
  border-color: var(--tone, #1c4f92);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px -12px rgba(20, 45, 80, 0.9);
}
.status-tab.is-on::before { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }

/* 「筛选」抽屉：淡蓝底，跟白卡片区分开。 */
.filter-more { background: linear-gradient(180deg, #fbfdff 0%, #f2f7fd 100%); border-color: #dbe6f3; }

/* 第四十二批：类别徽标用实色圆角款——用户点名「常规单绿底白字、返修单橙底白字、追加单紫底白字」，
   回收单 / 不修寄回补蓝、灰两档；色值比状态色略亮一档，12px 白字也压得住。 */
.badge.badge-solid { font-weight: 600; color: #fff; border-color: transparent; box-shadow: 0 6px 12px -10px rgba(20, 45, 80, 0.85); }
.badge-solid[data-tone="gray"] { background: #64748b; }
.badge-solid[data-tone="blue"] { background: #2f6bd8; }
.badge-solid[data-tone="violet"] { background: #7c5cd6; }
.badge-solid[data-tone="amber"] { background: #de7b0f; }
.badge-solid[data-tone="green"] { background: #17936a; }

/* ===== 第四十三批：工单详情对齐主面板（用户：状态色与列表一致、运单补录突出、返回按钮上顶栏、
   排版别太空泛）=====
   详情页的所有卡片收进一个响应式栅格：窄屏单列，宽屏（≥980px）两列；工单头部卡片与两列容器
   横跨整行。头部 dl 在宽屏排成「两对一行」，信息密度贴近列表的表格感。 */
.detail-meta { min-height: 18px; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.detail-grid { display: grid; gap: 12px; }
@media (min-width: 980px) {
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .detail-grid > .order-card:first-child,
  .detail-grid > .detail-columns { grid-column: 1 / -1; }
}

/* 第七十七批：详情卡片两列布局。两列各是一个纵向 flex，卡片由 balanceDetailColumns 摆位；
   第一百二十三批起改成固定槽位（左列 客户 / 到货 / 机器 / 派组，右列 报价 / 收款 / 财务 / 出库），
   附件与「录错了？」哪列矮放哪列。窄屏两列容器叠成单列，顺序保持渲染顺序（按业务流程排）。 */
.detail-columns { display: grid; gap: 12px; overflow-anchor: none; }
@media (min-width: 980px) {
  .detail-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.detail-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* 第一百二十三批：机器清单从整行搬进左列（固定布局 ① 客户 ② 到货 ③ 机器 ④ 派组）——
   左列只有半页宽，机器卡再按 .list 的两列网格排（≥900px）就太挤，恒为单列。 */
.detail-columns .machine-list { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .detail-head dl { grid-template-columns: auto 1fr auto 1fr; column-gap: 12px; }
}

/* 「待补录 / 待登记」小旗：详情头上的运单号与客户故障描述按钮缺值时挂一枚，提醒要补。 */
.tracking-flag {
  margin-left: 8px;
  border-radius: 999px;
  background: #de7b0f;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
}

/* ===== 第七十六批：运单号 / 客户故障描述从常驻表单改成对话框 =====
   详情头只留两个入口按钮；点开弹一页对话框（同灯箱那层 fixed 遮罩），保存前再走确认页。
   表单控件沿用 .machine-form / .action-hint 的既有样式，这里只补遮罩与卡片本身。 */
body.work-order-dialog-open { overflow: hidden; }
.work-order-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 22px);
  background: rgba(9, 15, 28, 0.58);
  backdrop-filter: blur(2px);
}
.work-order-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1480px, 100%);
  height: calc(100vh - clamp(16px, 4vw, 44px));
  max-height: 96vh;
  overflow: hidden;
  border: 1px solid rgba(207, 224, 245, 0.95);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 28px 80px rgba(4, 12, 24, 0.46);
}
.work-order-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px 9px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, #f8fbff 0%, #eef5fd 100%);
}
.work-order-dialog-head > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; min-width: 0; }
.work-order-dialog-head strong { font-size: 15px; }
.work-order-dialog-head span { color: var(--muted); font-size: 11px; }
.work-order-dialog-head button { min-height: 32px; padding: 4px 12px; }
.work-order-dialog-body { min-height: 0; overflow: auto; padding: 10px 12px 18px; }
.work-order-dialog-body > .view-inner { display: grid; gap: 10px; min-width: 0; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 15, 28, 0.55);
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(9, 15, 28, 0.35);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-ask { margin: 0; font-size: 13px; line-height: 1.7; }

@media (max-width: 719px) {
  .work-order-dialog-backdrop { padding: 0; }
  .work-order-dialog { width: 100%; height: 100vh; max-height: none; border: 0; border-radius: 0; }
  .work-order-dialog-body { padding: 8px 8px 14px; }
}

/* 客户卡的两个高频动作（补取件信息 / 改备注名）：单独一行，主按钮 + 描边按钮，别藏在角落。 */
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost-accent { border-color: #c9dcf7; background: #f4f9ff; color: #1e63c0; }

/* ===== 第四十四批：详情权限提示收敛 + 工单信息更快读 + 建单页模块化 =====
   ① 没有销售确认 / 出库权限的账号（客服等）不再看到「请让销售或主管来确认」这类提示卡；
   ② 工单信息头部从三行稀疏 dl 改成一排流式「标签 + 值」，把卡片的呼吸感留给真正的动作；
   ③ 建单页两张卡进 .card-grid（宽屏两列）、客户选择改「边输边出」的候选下拉、工单类别带实色底色。 */

.card-grid { display: grid; gap: 12px; }
@media (min-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

.detail-head { padding: 12px 14px; }
.detail-head .detail-facts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; font-size: 13px; }
.detail-head .detail-facts .kv { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.detail-head .detail-facts dt { color: var(--muted); font-size: 12px; }
.detail-head .detail-facts dd { margin: 0; }

/* 建单页的客户候选：贴着输入框的一层，行是「名字 + 6位码 / 编号」两段式；点行即选中。 */
.combo { position: relative; }
.combo-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow: auto;
}
.combo-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}
.combo-row:hover { background: #f2f7ff; }
.combo-row.is-selected { border-color: #c9dcf7; background: #f4f9ff; }
.combo-name { font-weight: 600; }
.combo-meta { color: var(--muted); font-size: 12px; }

/* 工单类别：与列表里的类别徽标同款底色（下拉收起时本身就是一个大徽标）。 */
.select-tone { border-radius: 999px; font-weight: 600; }
.select-tone[data-tone="gray"] { background: #64748b; border-color: #64748b; color: #fff; }
.select-tone[data-tone="blue"] { background: #2f6bd8; border-color: #2f6bd8; color: #fff; }
.select-tone[data-tone="violet"] { background: #7c5cd6; border-color: #7c5cd6; color: #fff; }
.select-tone[data-tone="amber"] { background: #de7b0f; border-color: #de7b0f; color: #fff; }
.select-tone[data-tone="green"] { background: #17936a; border-color: #17936a; color: #fff; }
.select-tone option { color: var(--ink); background: #fff; }

/* 标签打印（第四十六批）：屏幕上是表格，打印出来的是一张一张的标签（每张一页）。
   打印区挂在 body 上、平时 display:none，只在 @media print 里显示——手机上的打印预览是异步的，
   不靠 JS 在打印前后切 class，内容就不会被「切没」。 */
.label-print-area { display: none; page: crm-label; }
.label-code-cell { font-family: Consolas, 'Courier New', monospace; font-weight: 600; letter-spacing: .5px; }
.label-sheet {
  width: 60mm;
  height: 40mm;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  page-break-after: always;
  break-after: page;
}
/* 最后一张不再强制翻页：标签是连续纸，尾页分页会在打印末尾多吐一张空白纸。 */
.label-print-area .label-sheet:last-child {
  page-break-after: auto;
  break-after: auto;
}
/* 标签打印机是 60mm × 40mm 的连续纸。固定纸型 + 0 页边距既让每张标签正好一页，
   也会把 Chrome / Edge 默认的网址、时间、页码页眉页脚挤出纸面。 */
@page crm-label {
  size: 60mm 40mm;
  margin: 0;
}
/* 标签内容块（第四十八批）：位置 / 宽度 / 字号全部来自模板的毫米与 pt 值——打印、预览、编辑器同源。 */
.label-element {
  position: absolute;
  line-height: 1.15;
  white-space: pre-wrap;
  overflow: hidden;
  color: #111;
}
.label-element-qrcode svg { width: 100%; height: 100%; display: block; }

/* 模板编辑器：左边是按毫米等比放大的画布，右边是属性面板；画布上那层透明框负责拖动。 */
.label-editor { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin: 8px 0; }
.label-editor-stage {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .16);
  overflow: hidden;
}
/* transform-origin 必须钉在左上角：默认的 50% 50% 会把缩小后的纸面从框里「甩」出去
   ——倍率越小偏得越多（A4 报价单预览会整页歪到框右下、盖住属性面板）。第一百零一批修。 */
.label-editor-sheet { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.label-editor-overlay { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
/* 拖动吸附时的对齐参考线（第一百零一批）。 */
.label-editor-guide { position: absolute; background: #f97316; opacity: .8; pointer-events: none; z-index: 2; }
.label-editor-guide.is-vertical { top: 0; bottom: 0; width: 1px; }
.label-editor-guide.is-horizontal { left: 0; right: 0; height: 1px; }
.label-editor-box {
  position: absolute;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border: 1px dashed rgba(37, 99, 235, .55);
  background: rgba(59, 130, 246, .08);
  border-radius: 2px;
  cursor: move;
  touch-action: none;
  overflow: hidden;
  font: inherit;
  text-align: left;
}
.label-editor-box > span {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0 2px;
  font-size: 9px;
  line-height: 1.4;
  color: #1d4ed8;
  background: rgba(255, 255, 255, .85);
}
.label-editor-box.is-selected { border-color: #f97316; border-style: solid; background: rgba(249, 115, 22, .12); }
.label-editor-box.is-selected > span { color: #c2410c; }
.label-editor-panel { flex: 1 1 260px; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.label-editor-panel .ghost.is-active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.label-field-list summary { cursor: pointer; }

/* 屏幕上的打印预览（第四十七批）：与打印区同源渲染，先把「打出来长什么样」摆出来再点打印。 */
.label-preview { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px; background: #eef1f6; border-radius: 8px; }
.label-preview .label-sheet { background: #fff; padding: 2mm; box-shadow: 0 1px 4px rgba(15, 23, 42, .18); page-break-after: auto; break-after: auto; }

/* 报价单实际数据预览（第一百零二批）：真实工单出的 PNG 贴在设置页里；白纸加边、宽度跟随面板。 */
.quote-preview-image { display: block; max-width: 100%; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(15, 23, 42, .18); }

/* 报价单预览对话框（第一百零七批）：下载前先看一遍——宽版弹窗 + 可滚动的图舞台，长图也能整张翻。 */
.modal-card-wide { width: min(900px, 100%); }
.quote-preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
  background: #eef1f6;
  border-radius: 8px;
}
.quote-preview-stage .quote-preview-image { max-width: 100%; height: auto; }

/* 打印预览（第四十九批）：在设置页选一条真实队列数据，用当前草稿模板渲染——所见即所打。 */
.label-preview-block { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.label-preview-block h3 { margin: 0 0 6px; font-size: 14px; }

/* 扫码输入行（第七十二批）：扫码按钮跟着输入框走、放在输入框后面——手机上点完直接扫，
   不用滚到屏幕顶再点工具条。 */
.scan-input-row { display: flex; gap: 8px; align-items: stretch; }
.scan-input-row input { flex: 1 1 auto; min-width: 0; }
.scan-inline { flex: 0 0 auto; align-self: stretch; }

/* 故障描述只读块（第七十二批）：客服取件时按客户口述登记，检测 / 销售等环节只看不能改。 */
.fault-readonly {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.fault-readonly-label { font-size: 12px; color: var(--muted); }
.fault-readonly p { margin: 0; white-space: pre-wrap; }

/* 照片瓦片（第七十二批）：一张照片一个缩略图，末端跟着「+」加号瓦片；上传时压缩，
   只有点开看大图才是原图，其余地方都是缩略图。 */
.photo-field { display: flex; flex-direction: column; gap: 6px; }
.photo-field-label { font-size: 13px; font-weight: 600; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-tile {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f1f4f8;
  padding: 0;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-tile[data-tone="failed"] { border-color: #c8452f; }
.photo-tile-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  font-size: 11px;
  color: #fff;
  background: rgba(15, 23, 42, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-tile-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.photo-tile-add {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  cursor: pointer;
}
.photo-tile-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 15, 28, 0.88);
}
.photo-lightbox[hidden] { display: none; }
.photo-lightbox img { max-width: min(920px, calc(100% - 132px)); max-height: 82vh; border-radius: 10px; }
.photo-lightbox video { max-width: min(920px, calc(100% - 132px)); max-height: 82vh; border-radius: 10px; background: #000; }
.lightbox-close { position: absolute; top: 14px; right: 14px; color: #f1f5f9; border-color: rgba(241, 245, 249, 0.55); }
.photo-lightbox .lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-color: rgba(241, 245, 249, 0.55);
  background: rgba(15, 23, 42, 0.58);
  color: #f8fafc;
  font-size: 36px;
  line-height: 1;
}
.photo-lightbox .lightbox-nav:hover:not(:disabled) { background: rgba(30, 64, 175, 0.78); }
.photo-lightbox .lightbox-nav:disabled { opacity: 0.26; cursor: default; }
.photo-lightbox .lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: clamp(6px, 2vw, 28px); }
.lightbox-next { right: clamp(6px, 2vw, 28px); }
.lightbox-caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #dbe4f3;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .photo-lightbox img, .photo-lightbox video { max-width: calc(100% - 76px); }
  .photo-lightbox .lightbox-nav { width: 40px; height: 40px; font-size: 28px; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

@media print {
  #boot, #login-screen, #app-screen, #password-screen, #toast { display: none !important; }
  .label-print-area { display: block; }
}

/* 报价 / 收款（第八十四批）：成交摘要 + 实际收款逐笔（含收款截图与拖拽 / 粘贴上传区）。 */
.deal-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 4px; font-size: 13px; }
.deal-summary .kv { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.deal-summary dt { color: var(--muted); font-size: 12px; }
.deal-summary dd { margin: 0; }
/* 第八十九批：报价 / 收款卡的分区标题与退款折叠。h4 的浏览器默认上下外边距在卡片里就是一块留白，
   这里把标题收紧到卡片自身的行距；退款记录区默认收起，标题行右侧放笔数 / 合计与「展开 / 收起」。 */
.deal-section-title { margin: 0; font-size: 13px; }
.deal-section-head { display: flex; align-items: baseline; gap: 8px; }
.deal-section-head .card-toggle { margin-left: auto; }
.receipt-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.receipt-main { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13px; }
.receipt-shots { display: flex; flex-wrap: wrap; gap: 6px; }
.receipt-shots img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; cursor: zoom-in; }
.receipt-drop {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.receipt-drop:focus-visible, .receipt-drop.is-dragover { border-color: var(--accent); outline: none; background: rgba(31, 122, 224, 0.06); }
.receipt-draft-files { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.receipt-file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.receipt-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.receipt-file-chip small { color: var(--muted); }
.receipt-file-chip.is-ready { border-color: #b8ddc0; background: #f4fbf5; }
.receipt-file-chip button { padding: 0 4px; min-width: 0; line-height: 1; }

/* 配件销售逐行履约：表格保持紧凑，行内只放状态与入口；照片和运单集中在一个小对话框里操作。 */
.parts-sale-line-table { min-width: 960px; }
.parts-sale-line-table th,
.parts-sale-line-table td { height: 32px; padding: 3px 7px; }
.parts-sale-line-table td { font-size: 12.5px; }
.parts-sale-line-table .ps-line-action { min-height: 26px; padding: 2px 9px; font-size: 12px; }
.ps-line-photo-summary { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.ps-line-photo-mini {
  width: 34px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  background: #eef1f5;
  cursor: zoom-in;
}
.parts-sale-line-modal { width: min(720px, 100%); gap: 8px; padding: 14px; }
.ps-line-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  font-size: 12px;
}
.ps-line-mode-field { max-width: 360px; }
.ps-line-readonly {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}
.ps-line-readonly p { margin: 0; }
.ps-line-photo-section {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.ps-line-photo-section.is-locked { background: #f6f7f9; }
.ps-line-photo-grid { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.ps-line-photo-grid > img,
.ps-upload-thumb img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #eef1f5;
  cursor: zoom-in;
}
.ps-upload-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  min-height: 46px;
  padding: 7px 9px;
  cursor: pointer;
}
.ps-upload-zone > span { flex: 1 1 210px; min-width: 0; color: var(--muted); }
.ps-upload-zone.is-disabled {
  cursor: not-allowed;
  border-color: #d9dde3;
  background: #f4f5f7;
  opacity: .78;
}
.ps-upload-thumb {
  display: grid;
  gap: 3px;
  width: 82px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 11px;
}
.ps-upload-thumb img,
.ps-upload-thumb figcaption { width: 100%; }
.ps-upload-thumb figcaption {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-upload-thumb button { min-height: 24px; padding: 1px 6px; font-size: 11px; }

@media (max-width: 720px) {
  .parts-sale-line-modal { padding: 11px; max-height: 92vh; }
  .ps-line-modal-meta { gap: 3px 10px; }
  .ps-upload-zone { align-items: stretch; }
  .ps-upload-zone > span { flex-basis: 100%; }
  .parts-sale-line-table { min-width: 820px; }
}

/* 收款提交前核对：工单号、方式、金额和截图同屏展示，避免「截图传错单」直接落账。 */
.receipt-confirm-card { gap: 12px; }
.receipt-confirm-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f3f8ff;
  color: #1f5f9f;
  font-size: 13px;
}
.receipt-confirm-banner strong { font-size: 18px; letter-spacing: 0.2px; }
.receipt-confirm-context { margin: -4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.receipt-confirm-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.receipt-confirm-facts > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.receipt-confirm-facts dt { color: var(--muted); font-size: 12px; }
.receipt-confirm-facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.receipt-confirm-facts .receipt-confirm-amount { font-size: 18px; font-weight: 700; color: #1a7f37; }
.receipt-confirm-shots { display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-confirm-shot {
  margin: 0;
  width: 116px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.receipt-confirm-shot img,
.receipt-confirm-shot .attachment-file {
  width: 102px;
  height: 102px;
  border-radius: 6px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f4f7;
}
.receipt-confirm-shot figcaption { margin-top: 4px; color: var(--muted); font-size: 11px; text-align: center; }
.receipt-confirm-warning {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid #e6a23c;
  border-radius: 4px;
  background: #fff9ef;
  color: #8a5300;
  font-size: 12px;
  line-height: 1.65;
}
@media (max-width: 560px) {
  .receipt-confirm-facts { grid-template-columns: minmax(0, 1fr); }
}

/* 退款记录（第八十八批）：一笔退款的类型标签、红色负数金额与删除按钮；行的底样式沿用收款行。 */
.refund-row { border-left: 3px solid #e6a23c; }
.refund-row.is-editing { border-left-color: var(--accent); }
.refund-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fdf3e3;
  color: #b26a00;
  font-size: 12px;
  font-weight: 600;
}
.amount-refund { color: var(--danger); }
.amount-pending { color: var(--tone-amber, #b26a00); }
.amount-pending small { color: var(--muted); font-size: 10px; font-weight: 400; }
.channel-correction-section { display: grid; gap: 5px; margin-top: 8px; padding: 7px 9px; border: 1px solid #dce7f4; border-radius: 6px; background: #f7fbff; }
.channel-correction-row { display: grid; gap: 3px; padding: 5px 7px; border-left: 3px solid #8bb8ef; border-radius: 4px; background: #fff; }
.channel-correction-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.channel-correction-head strong { font-size: 12px; }
.channel-correction-lines { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 11px; }
.channel-correction-form { margin-top: 6px; padding: 8px; border: 1px dashed #9fc4ef; border-radius: 5px; background: #f8fbff; }
.channel-correction-form label { margin-bottom: 4px; }
button.btn-danger { border-color: #e6b3ad; background: #fdf0ee; color: var(--danger); }

/* 报价单（第一百批）：报价与收款拆成两张卡——这里补报价的逐行编辑表与只读明细。
   一行是「机器下拉 + 维修方案 + 金额 + 删除」；窄屏折成两行，方案占满整行。 */
.quote-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) minmax(90px, 0.8fr) auto auto;
  gap: 6px;
  align-items: center;
}
.quote-row select, .quote-row input { min-width: 0; }
/* 第一百零四批：报价卡的整单两个手填项（故障详细描述 / 维修工费）与行上的「建议」勾选。 */
.quote-fault-field { display: flex; flex-direction: column; gap: 4px; }
.quote-fault-field > span { font-size: 12px; color: var(--muted); }
.quote-row .quote-recommended { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.quote-row .quote-recommended input { width: 16px; height: 16px; accent-color: var(--brand, #1f69c8); }
.quote-row .quote-flags { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.quote-fee-row { font-size: inherit; color: inherit; }
.quote-fee-row .quote-fee-name { font-weight: 600; color: var(--ink); }
.quote-fee-row .quote-fee-hint { color: var(--muted); font-size: 13px; }
.quote-fee-row input { min-width: 0; }
.inline-check { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.quote-lines .quote-suggested { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #eef4ff; color: #1f69c8; font-size: 12px; font-weight: 600; }
.quote-fault-detail dd { white-space: pre-wrap; }
.quote-total { margin: 0; font-size: 13px; color: var(--muted); text-align: right; }
.quote-total strong { color: var(--ink); font-size: 15px; }
.quote-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.quote-lines li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.quote-lines .quote-machine { font-weight: 600; }
.quote-lines .quote-description { flex: 1 1 auto; min-width: 0; }
.quote-lines .quote-amount { margin-left: auto; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .quote-row { grid-template-columns: 1fr 1fr; }
  .quote-row [data-quote-description] { grid-column: 1 / -1; }
}

/* 成交类型按机器走（第一百零五批）：收款表单里每台机器一行「机器 + 成交类型 + 实际维修故障」；
   deal-type-chip 在成交摘要与机器卡片里共用。 */
.deal-machine-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(140px, 1fr) minmax(200px, 2fr);
  gap: 6px;
  align-items: center;
}
.deal-machine-row select, .deal-machine-row input { min-width: 0; }
.deal-machine-label { font-size: 12px; font-weight: 600; }
.deal-type-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef4ff; color: #1f69c8; font-size: 12px; font-weight: 600; }
@media (max-width: 720px) {
  .deal-machine-row { grid-template-columns: 1fr; }
}

/* 报价联系电话（第一百批）：一个账号一行，名字在左、号码输入在右。 */
.quote-contact-list { display: flex; flex-direction: column; gap: 6px; }
.quote-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.quote-contact-row > input { flex: 1 1 auto; min-width: 0; max-width: 320px; }

/* 第九十六批：列表序号列 + 人员名称小签 + 拖拽多选，以及拣货屏的本组待拣清单。 */

/* 序号列：所有表格列表最前方的「#」，翻页按本页重新 1..N（用户点名全列表都要）。
   窄列、居中、等宽数字，扫一眼就能数到第几条，也不会和相邻短列产生左右偏移。 */
.row-serial { color: var(--muted); font-variant-numeric: tabular-nums; }
.data-table th.row-serial, .data-table td.row-serial {
  width: 46px;
  min-width: 46px;
  padding-right: 4px;
  text-align: center;
  font-size: 12px;
}
/* 手机卡片头部的 #序号：小圆片，跟在勾选框旁边。 */
.row-serial-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--tone-gray-bg);
  color: var(--tone-gray);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 人员 / 组名小签（用户要求：所有出现人名的地方带底色高亮，「谁的单」一眼可见）。 */
.person-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef5ff 0%, #e2eefc 100%);
  border: 1px solid #cfe0f6;
  color: #1d4f9c;
  font-weight: 600;
  line-height: 20px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* 拖拽多选：拖动期间禁止选字，拖过的行给淡蓝底（覆盖 hover 渐变，所以用 !important）。 */
.drag-selecting { user-select: none; -webkit-user-select: none; }
.drag-selecting td.pick { cursor: grabbing; }
.data-table tbody tr.drag-pass > td,
.data-table tbody tr.drag-pass:hover > td { background: var(--tone-blue-bg) !important; }

/* 拣货屏「本组待拣清单」：贴在扫码框下面，报数 + 按派组时间从早到晚的行。 */
.pick-pending-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pick-pending-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--tone-blue-bg);
  color: var(--tone-blue);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pick-pending-filter { margin-bottom: 8px; }
.pick-pending-filter select { flex: 1 1 180px; }
.pick-pending-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 280px; overflow: auto; }
.pick-pending-row {
  display: grid;
  grid-template-columns: 34px auto 1fr;
  grid-template-areas: "no code time" "no meta meta" "no dates dates";
  align-items: center;
  gap: 2px 8px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
}
.pick-pending-row:last-child { border-bottom: 0; }
.pick-pending-row .row-serial { grid-area: no; text-align: center; }
.pick-pending-code { grid-area: code; font-weight: 600; }
.pick-pending-time { grid-area: time; text-align: right; font-size: 12px; }
/* 型号 + 派单销售 + 维修组（第一百一十二批）：内容比原来长（型号与两个人员小签），允许换行显示全。 */
.pick-pending-meta { grid-area: meta; font-size: 12px; line-height: 20px; }
/* 到货 / 成交日期（第一百三十三批）：第三行独立排布，手机上可换行，不挤压机器与销售信息。 */
.pick-pending-dates { grid-area: dates; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; line-height: 18px; }
.pick-pending-category { display: inline-flex; align-items: center; gap: 5px; }
.pick-pending-category .badge { padding: 1px 7px; font-size: 11px; line-height: 16px; }

/* ===== 第九十七批（v126）：状态计数、状态时效三档色板、详情模块默认收起、设置页三张新卡 ===== */
/* 状态页签上的数字：「待维修 8」。选中态反白，色板跟状态色走。 */
.status-tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--tone-bg, #eef1f6);
  color: var(--tone, var(--ink));
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.status-tab.is-on .status-tab-count { background: rgba(255, 255, 255, 0.28); color: #fff; }

/* 状态时效三档固定色板：管理员只配天数阈值，颜色在这里定死（1 黄 / 2 橙 / 3 红）。
   追加在文件末尾，特异性与 .badge[data-tone=...] 相同，靠后者胜出覆盖掉默认状态色。 */
.badge.sla-1 { background: #fbbf24; border-color: #f59e0b; color: #4a3203; }
.badge.sla-2 { background: #f97316; border-color: #ea580c; color: #fff; }
.badge.sla-3 { background: #dc2626; border-color: #b91c1c; color: #fff; font-weight: 600; }

/* 详情模块「默认收起」：卡头（或补出来的 .module-head）留着，其余内容藏起来；开关是卡头里的按钮。 */
[data-detail-module].is-collapsed > :not(header):not(.module-head) { display: none; }
.module-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.module-head h2 { margin: 0; font-size: 15px; }
[data-module-toggle] { margin-left: auto; }

/* 系统设置三张新卡（状态时效 / 状态可见性 / 详情模块）。 */
.status-settings { display: flex; flex-direction: column; gap: 12px; }
.sla-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.sla-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sla-row:last-child { border-bottom: 0; }
.sla-stage input { width: 78px; }
.vis-level { margin-top: 12px; }
.vis-level h3 { margin: 0 0 4px; font-size: 14px; }
.vis-row,
.dm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.vis-target { font-weight: 600; }
.vis-row .scope-settings,
.dm-row .scope-settings { flex: 1 1 220px; min-width: 220px; }
.dm-audience { margin-bottom: 8px; }
.dm-audience strong { display: block; font-size: 13px; margin-bottom: 4px; }
.dm-audience-list { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 180px; overflow: auto; }

/* 出库扫码（第一百一十六批）：多台机器逐台勾选（部分 / 全部出库），已经出库 / 还在修的置灰。 */
.outbound-machines { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.outbound-machine-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.outbound-machine-row.is-blocked { color: var(--muted); background: #f8fafc; }
.outbound-machine-row .muted { font-size: 12px; margin-left: auto; text-align: right; }
.outbound-scope-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.outbound-summary { font-weight: 600; }

/* ===== 第一百二十五批：工单列表工具条压缩 + 快捷筛选 + 批量删除 =====
   筛选抽屉 + 视图开关 + 快捷筛选 + 列设置 / 导出 / 新建 + 搜索框并成一行（.list-bar），
   状态页签与勾选行各占一行——原来两张卡（筛选 + 工具条）合计约 387px，压到约 210px。 */
/* align-items 必须显式压回 stretch（第一百二十六批修回归）：上面的 @media (min-width: 720px)
   `.filters { align-items: end; }` 是给网格版筛选卡用的（标签与输入框底对齐），但它会漏到
   flex 纵排的 .list-bar 上——列方向下 end = 每个孩子收成内容宽再推到右边，宽屏上「状态页签」
   「全选当前列表」整块右移（用户反馈「所有的状态应该是靠左对齐，全选当前列表也是靠左」）。 */
.filters.list-bar { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; align-items: stretch; }
.list-bar .bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-bar .bar-row .filter-more { margin: 0; }
.bar-spacer { flex: 1 1 auto; }
.bar-row .view-switch button { min-height: 34px; padding: 6px 12px; }
.my-pickups-toggle[aria-pressed="true"] {
  background: var(--tone-blue-bg);
  border-color: #c9dcf7;
  color: var(--accent);
  font-weight: 600;
}
.bar-row .primary { min-height: 38px; padding: 8px 16px; }
/* 快捷筛选按钮（按角色下发）：默认空置不占位，点了的条件再点一次可以取消。 */
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ledger-quick-filters { flex: 1 1 100%; min-width: 0; }
.quick-filters-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; min-height: 32px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--tone-blue-bg); border-color: #c9dcf7; color: var(--accent); font-weight: 600; }
/* 台账快捷按钮设置：入口固定在快捷条最右，弹层按按钮位置浮在页面上，不撑高列表。 */
.ledger-quick-filter-settings { margin-left: auto; color: var(--muted); border-style: dashed; }
.ledger-quick-filter-empty { color: var(--muted); font-size: 12px; }
.ledger-quick-settings-popover {
  position: fixed;
  z-index: 96;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(9, 15, 28, 0.22);
}
.ledger-quick-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ledger-quick-settings-head > div { display: grid; gap: 3px; min-width: 0; }
.ledger-quick-settings-head strong { font-size: 14px; color: var(--ink); }
.ledger-quick-settings-head span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.ledger-quick-settings-head button { min-height: 28px; padding: 2px 8px; font-size: 12px; }
.ledger-quick-settings-options { display: grid; gap: 4px; max-height: min(44vh, 320px); overflow: auto; padding: 2px; }
.ledger-quick-settings-options label { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 7px; font-size: 13px; cursor: pointer; }
.ledger-quick-settings-options label:hover { background: #f7faff; border-color: #d8e7fb; }
.ledger-quick-settings-options input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.ledger-quick-settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--line); }
.ledger-quick-settings-actions button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.ledger-quick-settings-actions .primary { margin-left: auto; }
.ledger-quick-settings-status { min-width: 0; color: var(--muted); font-size: 11px; }
.ledger-quick-settings-status.is-error { color: var(--danger); }
@media (max-width: 719px) {
  .ledger-quick-filter-settings { margin-left: 0; }
  .ledger-quick-settings-popover { max-height: min(78vh, 560px); }
}
/* 关键字搜索：一个框带「全库 / 本页」切换，取代原来的搜索框 + 本页过滤两个输入。 */
.bar-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 3px 6px 3px 10px; min-width: 240px; flex: 1 1 280px; max-width: 400px; }
.bar-search svg { flex: 0 0 auto; opacity: .55; }
.bar-search input { border: 0; min-height: 34px; padding: 4px 6px; flex: 1 1 auto; min-width: 0; }
.bar-search input:focus { outline: none; }
.scope-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: 0 0 auto; }
.scope-toggle button { border: 0; border-radius: 0; min-height: 28px; padding: 2px 10px; font-size: 12px; color: var(--muted); background: #fff; }
.scope-toggle button + button { border-left: 1px solid var(--line); }
.scope-toggle button.is-on { background: var(--tone-blue-bg); color: var(--accent); font-weight: 600; }
/* 导出收进「导出 ▾」下拉：复制表格 / 导出 CSV / 导出 Excel（全量），不占工具行宽度。 */
.export-menu { position: relative; font-size: 13px; }
.export-menu > summary { cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; list-style: none; min-height: 38px; display: inline-flex; align-items: center; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > summary::after { content: ' ▾'; color: var(--muted); }
.export-menu[open] > summary::after { content: ' ▴'; }
.export-menu-body { position: absolute; z-index: 30; right: 0; top: calc(100% + 4px); min-width: 210px; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(15,35,70,.12); display: grid; gap: 6px; }
.export-menu-body button { text-align: left; min-height: 34px; }
/* 勾选行（slim）：全选 + 已选 + 清空 + 删除工单；没有删除权的账号整块 hidden。 */
.batch-tools.slim { flex-basis: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px; flex-wrap: wrap; }

.batch-tools.slim button { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.batch-tools.slim label.inline { font-size: 13px; }
.batch-tools.slim label.inline, .batch-tools.slim button { white-space: nowrap; }
.list-bar .filter-chips { min-height: 0; }
.list-bar .batch-results { flex-basis: 100%; }
.list-bar .export-hint { margin: 0; font-size: 12px; }
@media (max-width: 719px) {
  /* 手机：搜索框独占一行（全库 / 本页切换跟着它），其余按钮自然换行。 */
  .bar-search { flex-basis: 100%; max-width: none; }
}

/* ===== 第一百二十六批：快捷筛选重做 + 筛选弹层 + 状态停留天数 ===== */
/* 「筛选」按钮旁的一键清空：只在真的有筛选内容时才出现。 */
#filter-clear-quick { min-height: 34px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
#filter-clear-quick:hover { color: var(--danger); border-color: var(--danger); }
/* 快捷筛选按钮：名称只写一行，条件组合放在 title 悬浮说明里。 */
.quick-filters .chip-btn { white-space: nowrap; }
/* 系统设置 · 快捷筛选编辑器：每个按钮一张小卡（名称 + 条件行 + 可见对象）。 */
.qf-card { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; margin-top: 10px; }
.qf-card .qf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qf-card .qf-list { flex: 0 1 180px; }
.qf-card .qf-list select { min-width: 150px; }
.qf-card .qf-name { flex: 1 1 240px; }
.qf-card .qf-name input { min-width: 200px; }
.qf-card .qf-match { flex: 0 1 180px; }
.qf-conditions { display: grid; gap: 6px; }
.qf-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qf-cond select, .qf-cond input { min-height: 32px; }
.qf-cond .qf-value { flex: 0 1 220px; min-width: 150px; }
.qf-cond .qf-presence-mode { flex: 0 0 130px; }
.qf-cond .qf-date-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.qf-cond .qf-date-range input { flex: 0 1 140px; min-width: 120px; }
.qf-cond .qf-remove-cond { min-height: 30px; padding: 2px 10px; }
.qf-card .qf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ===== 第一百三十一批：维修完成的配件选择器 ===== */
.parts-picker { display: grid; gap: 8px; }
.parts-selected { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.parts-selected-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.parts-selected-name { flex: 1 1 160px; font-size: 14px; }
.parts-selected-row input[type="number"] { width: 72px; min-height: 32px; }
.parts-selected-unit { color: var(--muted); font-size: 13px; }
.parts-pending-tag { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #fff3e0;
  color: #b26a00; font-size: 12px; font-style: normal; }
.parts-tools { gap: 8px; }
.parts-tools input[type="search"] { flex: 1 1 160px; min-height: 34px; }
.parts-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.parts-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px;
  max-height: 260px; overflow: auto; }
.parts-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; }
.parts-row-name { flex: 1 1 140px; font-size: 14px; }
.parts-row-meta { color: var(--muted); font-size: 12px; }
.parts-row-empty { justify-content: center; color: var(--muted); font-size: 13px; }
.parts-unmatched-tag { padding: 0 6px; border-radius: 999px; background: #eef1f5; color: var(--muted);
  font-size: 12px; font-style: normal; }
.parts-manual { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.parts-manual input { min-height: 34px; }
.parts-manual input[data-parts-manual-name] { flex: 1 1 180px; }
.parts-manual input[type="number"] { width: 76px; }

/* ===== 维修配件：使用 / 不使用两态 + 底部选料弹层 ===== */
.parts-mode-head, .parts-summary-head, .parts-sheet-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.parts-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.parts-mode-card { display: grid; gap: 4px; text-align: left; min-height: 76px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); }
.parts-mode-card strong { font-size: 14px; }
.parts-mode-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.parts-mode-card.is-selected { border-color: #2d6cdf; box-shadow: 0 0 0 2px rgba(45,108,223,.13); background: #f5f9ff; }
.parts-mode-card.is-selected strong { color: #1f4e96; }
.parts-summary { display: grid; gap: 7px; padding: 10px 12px; border: 1px solid #cfe0fa; border-radius: 10px; background: #f7fbff; }
.parts-summary.is-empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parts-summary.is-empty > div { display: grid; gap: 3px; }
.parts-summary.is-empty strong { font-size: 13px; }
.parts-summary.is-empty span { color: var(--muted); font-size: 12px; }
.parts-summary-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.parts-summary-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid #cfe0fa; background: #fff; color: #24466f; font-size: 12px; line-height: 1.4; }
.parts-summary-chip button { border: 0; background: transparent; color: #7d8ca1; padding: 0 0 0 2px; cursor: pointer; font-size: 15px; line-height: 1; }
.parts-none-note { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid #bfe7cf; border-radius: 10px; background: #f2fbf5; color: #25623a; }
.parts-none-note strong { font-size: 13px; }
.parts-none-note span { font-size: 12px; }
.parts-sheet-host { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center;
  padding: 12px 0 0; background: rgba(15, 30, 55, .42); }
.parts-sheet-host[hidden] { display: none; }
body.parts-sheet-open { overflow: hidden; }
.parts-sheet { width: min(760px, 100%); max-height: min(92vh, 900px); display: flex; flex-direction: column;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 38px rgba(15,35,70,.22); overflow: hidden; }
.parts-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line); }
.parts-sheet-head h2 { margin: 0; font-size: 18px; }
.parts-sheet-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.parts-sheet-close { min-width: 34px; padding: 2px 9px; font-size: 22px; line-height: 1.1; }
.parts-sheet-body { overflow: auto; padding: 12px 18px 18px; display: grid; gap: 14px; }
.parts-sheet-fault { display: grid; gap: 3px; padding: 9px 11px; border-radius: 9px; background: #fff8e8; border: 1px solid #f0ddb0; }
.parts-sheet-fault span { color: #8a641d; font-size: 11px; }
.parts-sheet-fault strong { color: #5f4513; font-size: 13px; }
.parts-sheet-selected { display: grid; gap: 6px; }
.parts-sheet-catalog { display: grid; gap: 7px; padding-top: 2px; }
.parts-sheet-catalog > input[type="search"] { width: 100%; min-height: 38px; }
.parts-sheet-manual { display: grid; gap: 7px; padding-top: 2px; }
.parts-sheet-section-head { font-size: 13px; }
.parts-sheet-section-head strong { font-size: 13px; }
.parts-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fff; }
.parts-sheet-foot > div { display: flex; align-items: center; gap: 8px; }
.parts-sheet-foot-count { color: var(--muted); font-size: 12px; }
.parts-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.parts-pick-row.is-direct { border-color: #cfe0fa; background: #fbfdff; }
.parts-pick-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.parts-pick-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.parts-pick-meta { color: var(--muted); font-size: 11px; line-height: 1.35; }
.parts-stepper { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.parts-stepper button { min-width: 30px; min-height: 30px; padding: 1px 6px; font-size: 17px; line-height: 1; }
.parts-stepper input { width: 48px; min-height: 30px; padding: 3px 4px; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (max-width: 520px) {
  .parts-mode-grid { grid-template-columns: 1fr; }
  .parts-sheet-host { padding-top: 0; }
  .parts-sheet { max-height: 94vh; border-radius: 14px 14px 0 0; }
  .parts-sheet-head, .parts-sheet-body, .parts-sheet-foot { padding-left: 12px; padding-right: 12px; }
  .parts-sheet-foot { align-items: stretch; flex-direction: column; gap: 8px; }
  .parts-sheet-foot > div { display: grid; grid-template-columns: 1fr 1.6fr; }
  .parts-sheet-foot button { min-height: 40px; }
  .parts-pick-row { align-items: flex-start; }
}

/* ===== 第一百三十二批：库存列表化 + 维修配件智能推荐 ===== */
/* 库存物品与台账的展开行（入库 / 调整 / 停用、冲正）挂在所属行下方，浅底区分。 */
.inventory-open > td { background: #f7faff; }
/* 维修完成的「智能推荐」块：外框区分，行样式与下面全量清单一致。 */
.parts-reco { border: 1px solid #d8e6fb; border-radius: 10px; background: #f4f9ff; padding: 8px 10px; display: grid; gap: 6px; }
.parts-reco-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.parts-reco .parts-reco-title { font-size: 13px; font-weight: 600; color: #1f4e96; }
.parts-reco .parts-list { max-height: none; margin-top: 0; }
.parts-reco .parts-row { border-color: #d8e6fb; background: #fff; }

/* ===== 第一百三十六批：库管按组发料、维修补退换、首次库存导入 ===== */
.parts-issue-filter, .parts-issue-history, .parts-issue-group { margin-bottom: 12px; }
.parts-issue-toolbar { align-items: center; gap: 8px; }
.parts-issue-scan { flex: 1 1 360px; }
.parts-issue-tabs {
  display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 0 0 8px;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.parts-issue-tabs::-webkit-scrollbar { display: none; }
.parts-issue-tabs button {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 5px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: #475569; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.parts-issue-tabs button:hover { background: #f1f6ff; color: #1f4e96; }
.parts-issue-tabs button.is-active { border-color: #b9d2f4; background: #eaf3ff; color: #174a91; }
.parts-issue-tabs button span {
  min-width: 22px; padding: 1px 6px; border-radius: 999px; background: #e2e8f0;
  color: #475569; font-size: 11px; text-align: center;
}
.parts-issue-tabs button.is-active span { background: #1f5fae; color: #fff; }
.parts-issue-filter-row { align-items: flex-end; gap: 8px; }
.parts-issue-filter-row label { flex: 0 1 210px; }
.parts-issue-filter-row .parts-issue-search-label { flex: 1 1 300px; }
.parts-issue-group-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.parts-issue-group-head h2 { margin: 0 8px 0 0; font-size: 16px; display: inline; }
.parts-issue-select-group { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.parts-issue-select-group input,
.parts-issue-machine-select input { width: 16px; height: 16px; margin: 0; }
.parts-issue-machine-select { flex: 0 0 auto; display: flex; align-items: flex-start; padding-top: 4px; }
.parts-issue-aggregate {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0;
  padding: 9px 10px; border: 1px solid #d8e6fb; border-radius: 9px; background: #f4f9ff;
}
.parts-issue-aggregate > strong { flex-basis: 100%; color: #1f4e96; font-size: 13px; }
.parts-issue-empty { margin: 10px 0; }
.parts-issue-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid #d8e6fb; background: #fff; color: #294b78; font-size: 12px; line-height: 1.5;
}
.parts-issue-chip small { color: var(--muted); font-size: 11px; }
.parts-issue-machines { display: grid; gap: 6px; }
.parts-issue-machine { border: 1px solid var(--line); border-radius: 9px; background: #fcfdff; overflow: hidden; }
.parts-issue-machine.is-stale { border-color: #f3b3ae; background: #fffafa; box-shadow: inset 3px 0 0 #dc5a51; }
.parts-issue-machine.has-difference { border-color: #e7b75e; background: #fffcf4; }
.parts-issue-machine.is-located { outline: 3px solid #f4b740; outline-offset: 1px; }
.parts-issue-machine-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.parts-issue-machine-main { flex: 1 1 360px; min-width: 0; display: grid; gap: 3px; }
.parts-issue-machine-main > strong { font-size: 14px; }
.parts-issue-model-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.parts-issue-deal-line { font-size: 12px; line-height: 1.4; }
.parts-issue-preallocation-state {
  display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px;
  background: #f1f5f9; color: #64748b; font-size: 11px;
}
.parts-issue-preallocation-state.is-ready { background: #e8f7ee; color: #237a45; }
.parts-issue-stale-flag { color: #b42318; font-size: 11px; font-weight: 700; }
.parts-issue-difference-flag { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 11px; }
.parts-issue-difference-flag.is-on { background: #fff4db; color: #99610d; font-weight: 600; }
.parts-issue-machine-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.parts-issue-machine-actions button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.parts-issue-photo-link {
  /* 发料核对同一行摆到货 / 检测两类照片；窄屏自动换行，不挤占机型与状态。 */
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 2px 8px 2px 3px;
  border: 1px solid #c6d8f3;
  border-radius: 7px;
  background: #eef5ff;
  color: #1f4e96;
  font-size: 11px;
  line-height: 1.2;
  cursor: zoom-in;
}
.parts-issue-photo-link:hover { border-color: #7da7e2; background: #e4efff; }
.parts-issue-photo-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.parts-issue-photo-link img,
.parts-issue-photo-placeholder {
  width: 25px;
  height: 25px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
  background: #dce9fb;
}
.parts-issue-photo-placeholder { display: grid; place-items: center; font-size: 10px; font-weight: 600; }
.parts-issue-photo-empty { color: var(--muted); font-size: 11px; }
.parts-issue-fault {
  color: #5b4b2f; font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.parts-issue-selected { display: flex; flex-wrap: wrap; gap: 5px; }
.parts-issue-editor { border-top: 1px dashed var(--line); padding: 9px 10px; background: #f8fbff; display: grid; gap: 7px; }
.machine-recycle-dismantle-parts { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px; }
.machine-recycle-dismantle-parts .parts-issue-edit-list { gap: 4px; }
.machine-recycle-dismantle-parts .parts-issue-edit-row { padding: 5px 0; }
.machine-recycle-dismantle-parts .parts-issue-add-row { position: sticky; bottom: 0; padding-top: 7px; background: #f8fbff; }
.parts-issue-editor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.parts-issue-issue-form {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
  align-items: end; gap: 8px 10px; margin: 9px 0; padding: 9px 10px;
  border: 1px solid #e3c98e; border-radius: 9px; background: #fffdf7;
}
.parts-issue-issue-form label { min-width: 0; font-size: 11px; }
.parts-issue-issue-form input { width: 100%; }
.parts-issue-issue-form .parts-issue-difference-flag { align-self: center; justify-self: start; white-space: nowrap; }
.parts-issue-edit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.parts-issue-edit-row {
  display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: 8px;
  padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.parts-issue-edit-row.is-readonly { grid-template-columns: minmax(0, 1fr) auto; background: #f8fafc; }
.parts-issue-readonly-qty { color: #174a91; font-size: 13px; font-weight: 700; white-space: nowrap; }
.parts-issue-edit-name { min-width: 0; display: grid; gap: 1px; }
.parts-issue-edit-name strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parts-issue-edit-name span { font-size: 11px; }
.parts-issue-stepper { display: inline-flex; align-items: center; gap: 3px; }
.parts-issue-stepper button {
  width: 30px; min-width: 30px; min-height: 30px; padding: 0; border-radius: 7px; font-size: 18px; line-height: 1;
}
.parts-issue-stepper input { width: 58px; text-align: center; }
.parts-issue-remove { min-height: 30px; padding: 3px 7px; font-size: 11px; }
.parts-issue-edit-row input, .parts-issue-add-row input, .inventory-bulk-tools input[type="number"] {
  min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
.parts-issue-recommend { display: grid; gap: 4px; padding: 7px 8px; border: 1px solid #d8e6fb; border-radius: 9px; background: #f4f9ff; }
.parts-issue-recommend > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.parts-issue-recommend > header strong { color: #1f4e96; font-size: 12.5px; }
.parts-issue-recommend > header span { font-size: 11px; }
.parts-issue-recommend ul { list-style: none; margin: 0; padding: 0; display: grid; }
.parts-issue-recommend-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 0; border-top: 1px dashed #d8e6fb;
}
.parts-issue-recommend-row:first-child { border-top: 0; }
.parts-issue-recommend-main { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.parts-issue-recommend-main strong { font-size: 12.5px; }
.parts-issue-reason { padding: 1px 6px; border-radius: 999px; background: #e7f0fd; color: #27588e; font-size: 11px; }
.parts-issue-confidence { color: #237a45; font-size: 11px; font-weight: 600; }
.parts-issue-recommend-row button { flex: 0 0 auto; min-height: 29px; padding: 3px 8px; font-size: 11px; }
.parts-issue-add-row { display: grid; grid-template-columns: minmax(220px, 1fr) 88px auto; align-items: end; gap: 7px; }
.parts-issue-add-row label { min-width: 0; font-size: 11px; }
.parts-issue-add-row input { width: 100%; }
.parts-issue-add-button { min-height: 36px; }
.parts-issue-actionbar {
  position: sticky; bottom: 8px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px; margin: 10px 0 14px; padding: 9px 11px;
  border: 1px solid #b9d2f4; border-radius: 11px; background: rgba(247, 251, 255, .96);
  box-shadow: 0 8px 24px -14px rgba(17, 57, 110, .55); backdrop-filter: blur(6px);
}
.parts-issue-action-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; min-width: 0; }
.parts-issue-action-summary strong { color: #174a91; font-size: 13px; }
.parts-issue-action-summary span { color: var(--muted); font-size: 12px; }

/* 发料台账打印（第一百四十三批）：屏幕内可折叠预览，真正打印挂到 body 的独立 A4 纸面。 */
.parts-issue-print { margin-bottom: 12px; }
.parts-issue-print-tools { align-items: flex-end; }
.parts-issue-print-tools label { flex: 0 1 190px; }
.parts-issue-history-table td { vertical-align: middle; }
.parts-issue-history-table tr.is-withdrawn td { color: #7a8494; background: #fafbfc; }
.parts-issue-history-detail { margin: 4px 0; }
.parts-issue-history-detail table {
  width: 100%; border-collapse: collapse; background: #fff; font-size: 12px;
}
.parts-issue-history-detail th, .parts-issue-history-detail td {
  padding: 5px 7px; border-bottom: 1px solid #e4eaf3; text-align: left; white-space: nowrap;
}
.parts-issue-history-detail th { color: var(--muted); background: #f7faff; font-weight: 600; }
.parts-issue-history-detail tr:last-child td { border-bottom: 0; }
.parts-issue-history-detail .num { text-align: center; }

.parts-issue-print-area { display: none; page: crm-report; }
.parts-issue-print-preview {
  margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #e9eef5; max-height: 620px; overflow: auto;
}
.parts-issue-print-preview-window { min-width: 800px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.parts-issue-print-sheet {
  width: 210mm; min-height: 297mm; box-sizing: border-box; padding: 12mm;
  background: #fff; color: #111; font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 12px; line-height: 1.45; box-shadow: 0 5px 22px rgba(15, 23, 42, .18);
}
.parts-issue-print-sheet + .parts-issue-print-sheet { break-before: page; page-break-before: always; }
.parts-issue-print-head { padding-bottom: 7px; border-bottom: 2px solid #111; }
.parts-issue-print-kicker { color: #596579; font-size: 10px; letter-spacing: .22em; text-align: center; }
.parts-issue-print-head h1 { margin: 3px 0 5px; font-size: 24px; line-height: 1.2; text-align: center; letter-spacing: .08em; }
.parts-issue-print-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; font-size: 11px; }
.parts-issue-print-stats {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 7px; padding: 6px 8px;
  background: #f3f6fa; border: 1px solid #dbe3ee; font-size: 11px;
}
.parts-issue-print-stats strong { font-size: 13px; color: #173c6e; }
.parts-issue-print-group { margin-top: 12px; break-inside: avoid; page-break-inside: avoid; }
.parts-issue-print-group.machine-detail { break-inside: auto; page-break-inside: auto; }
.parts-issue-print-group + .parts-issue-print-group {
  break-before: page; page-break-before: always;
}
.parts-issue-print-group-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 3px 12px; padding-bottom: 4px; border-bottom: 1px solid #333;
}
.parts-issue-print-group-head h2 { margin: 0; font-size: 15px; }
.parts-issue-print-group-head span { color: #4b5565; font-size: 10.5px; }
.parts-issue-print-time { margin: 4px 0 5px; color: #4b5565; font-size: 10.5px; }
.parts-issue-print-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.parts-issue-print-machine-table { font-size: 12.5px; }
.parts-issue-print-table th, .parts-issue-print-table td {
  padding: 4px 5px; border: 1px solid #444; text-align: left; vertical-align: middle;
}
.parts-issue-print-table th { background: #eef2f7; font-weight: 600; text-align: center; }
.parts-issue-print-table .num { text-align: right; }
.parts-issue-print-table th.num { text-align: center; }
.parts-issue-print-machine-table th:nth-child(1) { width: 6%; }
.parts-issue-print-machine-table th:nth-child(2) { width: 12%; }
.parts-issue-print-machine-table th:nth-child(3) { width: 12%; }
.parts-issue-print-machine-table th:nth-child(4) { width: 26%; }
.parts-issue-print-machine-table th:nth-child(5) { width: 15%; }
.parts-issue-print-machine-table th:nth-child(6) { width: 7%; }
.parts-issue-print-machine-table th:nth-child(7) { width: 10%; }
.parts-issue-print-machine-table th:nth-child(8) { width: 12%; }
.parts-issue-print-fault { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.parts-issue-print-sign {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 18px;
  margin-top: 8px; padding: 7px 8px; border: 1px dashed #8b95a5; font-size: 10.5px;
  break-inside: avoid; page-break-inside: avoid;
}
.parts-issue-print-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 18px;
  margin-top: 16px; padding-top: 7px; border-top: 1px solid #333; font-size: 10.5px;
}
.parts-issue-print-note { margin: 8px 0 0; color: #596579; font-size: 9.5px; }

@media print {
  .parts-issue-print-area { display: block !important; }
  .parts-issue-print-area .parts-issue-print-sheet {
    width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .parts-issue-print-area .parts-issue-print-sheet + .parts-issue-print-sheet {
    break-before: page; page-break-before: always;
  }
}

.todo-source-group {
  margin-top: 12px;
}

.todo-source-group h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.todo-source-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, rgba(127, 127, 127, 0.04));
}

.todo-source-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 9px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.todo-source-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.todo-source-check > input { flex: 0 0 auto; margin-top: 2px; }
.todo-source-copy { display: grid; gap: 2px; min-width: 0; }
.todo-source-name { font-weight: 600; }
.todo-source-desc { color: var(--muted); font-size: 12px; line-height: 1.45; }

.todo-source-mode {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 86px;
  color: var(--muted);
  font-size: 11px;
}

.todo-source-mode select {
  min-width: 86px;
  padding: 5px 6px;
  font-size: 12px;
}

.todo-digest-schedule {
  display: grid;
  gap: 9px;
  margin: 12px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, rgba(127, 127, 127, 0.04));
}

.todo-digest-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.todo-digest-times {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-digest-time {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.todo-digest-time input { width: 104px; }
.todo-digest-remove { padding: 3px 7px; line-height: 1; }

.todo-role-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.todo-role-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.todo-role-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface-soft, rgba(127, 127, 127, 0.04));
}

.todo-role-name { font-weight: 650; }
.todo-role-code { color: var(--muted); font-size: 12px; }
.todo-role-system,
.todo-role-state {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.todo-role-count {
  margin-left: auto;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.todo-role-body { padding: 10px 12px 12px; }
.todo-role-body > .row:first-child { margin-bottom: 2px; }
.todo-role-save-row { margin-top: 14px; }

@media (max-width: 720px) {
  .todo-source-options { grid-template-columns: 1fr; }
  .todo-role-head { align-items: flex-start; }
  .todo-role-count { margin-left: 0; }
  .todo-source-option { grid-template-columns: 1fr; }
  .todo-source-mode { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .todo-source-mode select { width: 100%; }
}
@page crm-report {
  size: A4 portrait;
  margin: 12mm;
}

.parts-holding {
  display: grid; gap: 4px; margin: 10px 0; padding: 9px 11px; border: 1px solid #cfe1fa;
  border-radius: 9px; background: #f4f9ff; font-size: 13px;
}
.parts-holding-title { color: #1f4e96; font-weight: 600; }
.parts-holding-lines { color: #27466f; }
.parts-holding-pending { color: #a75b00; background: #fff7e8; border-radius: 7px; padding: 4px 7px; }
.parts-request-form, .parts-holdings { display: grid; gap: 9px; margin-top: 12px; }
.parts-request-form h3, .parts-holdings h3 { margin: 0; font-size: 15px; }
.parts-request-history { margin-top: 8px; }
.parts-request-history > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.parts-confirm-queue { margin-top: 12px; }
.parts-confirm-actions { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 6px; min-width: 280px; }
.parts-confirm-actions input { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; }

.inventory-bulk-card { margin-bottom: 12px; }
.inventory-bulk-tools { align-items: stretch; }
.inventory-bulk-tools input[type="search"] { flex: 1 1 190px; min-height: 36px; }
.inventory-bulk-tools input[type="number"] { width: 110px; }
.inventory-bulk-tools .inventory-bulk-reason {
  flex: 1 1 260px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.inventory-bulk-tools input[data-bulk-reason] {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.inventory-bulk-table { max-height: 480px; overflow: auto; }
.inventory-bulk-summary { justify-content: space-between; gap: 6px 14px; margin: 2px 0 8px; }
.inventory-bulk-summary strong { color: var(--accent); font-size: 13px; white-space: nowrap; }
.inventory-bulk-confirm-list { max-height: min(48vh, 420px); overflow: auto; }
.inventory-bulk-confirm-list .data-table { min-width: 560px; }
.modal-actions { justify-content: flex-end; gap: 8px; margin-top: 2px; }

/* 第一百四十四批：台账按列筛选。输入项各自有稳定的最小宽度，窄屏再整行铺开。 */
.inventory-ledger-filter-card { padding: 10px 12px; }
.inventory-ledger-filters { align-items: flex-end; }
/* 出入库台账配件汇总：默认只占一行标题，展开后才显示汇总表。 */
.inventory-ledger-summary { margin: 9px 0; padding: 0; overflow: hidden; }
.inventory-ledger-summary > summary {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
}
.inventory-ledger-summary > summary::-webkit-details-marker { display: none; }
.inventory-ledger-summary > summary strong { color: var(--ink); font-size: 13px; }
.inventory-ledger-summary > summary .muted { font-size: 12px; }
.inventory-ledger-summary-action { margin-left: auto; color: var(--accent); font-size: 12px; }
.inventory-ledger-summary > .action-hint,
.inventory-ledger-summary > .error { margin: 0; padding: 10px 12px 12px; }
.inventory-ledger-summary-table-wrap { max-height: 300px; overflow: auto; border-top: 1px solid var(--line); }
.inventory-ledger-summary-table { min-width: 720px; font-size: 12px; }
.inventory-ledger-summary-table th,
.inventory-ledger-summary-table td { padding: 6px 9px; }
.inventory-filter-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.inventory-filter-field input, .inventory-filter-field select { min-height: 34px; }
.inventory-filter-field input[type="date"] { width: 142px; }
.inventory-filter-field select { width: auto; min-width: 112px; }
.inventory-filter-field input[data-ledger-filter="itemSearch"] { width: 160px; }
.inventory-filter-field input[data-ledger-filter="workOrderSearch"] { width: 210px; }
.inventory-filter-field input[data-ledger-filter="reasonSearch"] { width: 170px; }
.inventory-filter-field input[data-ledger-filter="operatorSearch"] { width: 120px; }

/* 第一百四十六批：台账时间范围弹层。快捷范围与自定义日期共用一块面板，选完即筛选。 */
.inventory-date-filter { position: relative; min-width: 188px; }
.inventory-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.inventory-date-trigger:hover, .inventory-date-filter.is-open .inventory-date-trigger { border-color: var(--accent); }
.inventory-date-caret { color: var(--muted); transition: transform 0.15s ease; }
.inventory-date-filter.is-open .inventory-date-caret { transform: rotate(180deg); }
.inventory-date-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 430px;
  max-width: calc(100vw - 40px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.inventory-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.inventory-date-head strong { font-size: 13px; }
.inventory-date-head .ghost { padding: 4px 8px; border: 0; background: transparent; color: var(--danger); font-size: 12px; }
.inventory-date-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.inventory-date-preset {
  min-height: 32px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.inventory-date-preset:hover { border-color: var(--accent); color: var(--accent); }
.inventory-date-preset.is-active {
  border-color: var(--accent);
  background: var(--tone-blue-bg);
  color: var(--tone-blue);
  font-weight: 600;
}
.inventory-date-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.inventory-date-custom label { font-size: 12px; }
.inventory-date-custom input { min-height: 34px; padding: 6px 8px; font-size: 13px; }
.inventory-date-custom .muted { padding-bottom: 9px; font-size: 12px; }
.inventory-date-error { margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.inventory-date-panel .action-hint { margin: 8px 0 0; }
.inventory-ledger-clear { align-self: flex-end; }

/* 第一百四十七批：库存安全库存与缺货 / 低库存预警。徽标沿用表格里的 .badge，颜色只在这一屏加。 */
.inventory-warning-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.inventory-warning-filter input { width: auto; margin: 0; }
.inventory-warning-badge.inventory-warning-out {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  font-weight: 600;
}
.inventory-warning-badge.inventory-warning-low {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
  font-weight: 600;
}
.inventory-warning-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #f2c27b;
  border-radius: 8px;
  background: #fffaf0;
}
.inventory-warning-toggle { display: flex; align-items: center; gap: 6px; }
.inventory-warning-editor input[type="checkbox"] { width: auto; margin: 0; }

/* 搜索字段：搜索框旁的小下拉，最多 5 项；展开体复用 .scope-settings-body 的浮层口径。 */
.search-field-picker { flex: 0 0 auto; }
.search-field-picker > summary {
  min-height: 30px;
  padding: 3px 8px;
  white-space: nowrap;
  font-size: 12px;
}
.search-field-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--tone-blue-bg);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.search-field-picker-body {
  width: 300px;
  max-width: min(300px, calc(100vw - 48px));
  right: 0;
  left: auto;
  gap: 8px;
}
.search-field-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.search-field-picker-head span { color: var(--muted); font-size: 11px; }
.search-field-order {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.search-field-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--tone-blue-bg);
  color: var(--accent);
  font-size: 11px;
}
.search-field-order-chip b {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
}
.search-field-options {
  display: grid;
  gap: 2px;
  max-height: 250px;
  overflow: auto;
}
.search-field-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.search-field-option:hover { background: #f6f9fd; }
.search-field-option.is-selected { background: #f1f7ff; color: var(--accent); }
.search-field-option input { width: auto; margin: 0; }
.search-field-option-order {
  width: 16px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}
.search-field-option.is-selected .search-field-option-order { color: var(--accent); font-weight: 700; }
.search-field-status { margin: 0; min-height: 16px; color: var(--muted); font-size: 11px; }

/* 台账里把「输入框 + 字段」放在同一行，别让下拉摘要独自占列。 */
.machine-ledger-keyword-row,
.customer-ledger-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.machine-ledger-keyword-row input,
.customer-ledger-search-row input { flex: 1 1 auto; min-width: 0; }

@media (max-width: 719px) {
  .search-field-picker-body { right: 0; left: auto; }
  .machine-ledger-keyword-row,
  .customer-ledger-search-row { flex-wrap: wrap; }
}

/* 方案 B：配件大类 / 使用属性 / 批量分类与库存结构汇总。 */
.inventory-filter-row { align-items: stretch; }
.inventory-filter-row #filter-search { flex: 1 1 220px; min-width: 190px; }
.inventory-filter-row select { min-width: 116px; }
.inventory-batch-config-bar {
  align-items: center;
  gap: 7px 10px;
  margin: 3px 0 9px;
  padding: 8px 10px;
  border: 1px solid #dbe7f6;
  border-radius: 9px;
  background: #f7fbff;
}
.inventory-batch-config-bar strong { color: #1f4e96; font-size: 13px; white-space: nowrap; }
.inventory-batch-config-bar select { min-width: 154px; }
.inventory-warning-summary-card { margin-bottom: 12px; padding: 10px 12px; }
.inventory-warning-summary-card .card-head { margin-bottom: 8px; }
.inventory-warning-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 8px;
}
.inventory-summary-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.inventory-summary-cell span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.inventory-summary-cell strong { color: #0f172a; font-size: 18px; line-height: 1; }
.inventory-summary-cell.tone-blue { border-color: #cfe1fa; background: #f4f9ff; }
.inventory-summary-cell.tone-orange { border-color: #fed7aa; background: #fff7ed; }
.inventory-summary-cell.tone-danger { border-color: #fecaca; background: #fef2f2; }
.inventory-summary-cell.tone-danger strong { color: #b91c1c; }
.inventory-summary-cell.tone-warning { border-color: #fde68a; background: #fffbeb; }
.inventory-summary-cell.tone-warning strong { color: #b45309; }
.inventory-warning-badge.inventory-warning-pending {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
  font-weight: 600;
}
.inventory-negative { color: #be123c; font-weight: 700; }
.inventory-category-dialog { width: min(980px, 100%); }
.inventory-category-dialog .table-wrap { max-height: min(52vh, 460px); overflow: auto; }
.inventory-category-dialog .data-table { min-width: 780px; }
.inventory-category-dialog .data-table input:not([type="checkbox"]) { min-width: 120px; min-height: 32px; }
.inventory-category-create { align-items: stretch; margin: 7px 0; }
.inventory-category-create input { flex: 1 1 150px; min-width: 118px; }

/* 库存列表随浏览器可用宽度伸缩：列宽按容器百分比分配，文字列在窄屏换行，
   数字与操作列保持单行。半屏使用时不再依赖横向滚动才能看完整行。 */
.inventory-items-table,
.inventory-ledger-table {
  width: 100%;
  table-layout: fixed;
}
.inventory-ledger-table { min-width: 1080px; }
.inventory-items-table th,
.inventory-items-table td,
.inventory-ledger-table th,
.inventory-ledger-table td {
  height: auto;
  min-height: 36px;
  padding: 5px clamp(3px, 0.45vw, 8px);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.inventory-items-table th.column-filter-head,
.inventory-items-table th.column-sort-head,
.inventory-ledger-table th.column-filter-head,
.inventory-ledger-table th.column-sort-head {
  white-space: normal;
}
.inventory-items-table td.num,
.inventory-ledger-table td.num,
.inventory-items-table th.row-serial,
.inventory-items-table td.row-serial,
.inventory-ledger-table th.row-serial,
.inventory-ledger-table td.row-serial,
.inventory-items-table th.pick,
.inventory-items-table td.pick,
.inventory-actions-cell,
.inventory-ledger-actions {
  white-space: nowrap;
}
.inventory-items-table th.row-serial,
.inventory-items-table td.row-serial,
.inventory-ledger-table th.row-serial,
.inventory-ledger-table td.row-serial {
  width: 3.5%;
  min-width: 0;
  padding-inline: 2px;
}
.inventory-items-table th.pick,
.inventory-items-table td.pick {
  width: 2.5%;
  min-width: 0;
  padding-inline: 2px;
}
/* 名称是唯一的弹性列；其余列给出固定百分比，避免列宽总和超过 100% 后把「单位」挤成竖排。
   主库完整列固定占 84%，名称留 16%；少显示价格 / 余额列时，名称自动吸收剩余宽度。 */
.inventory-items-table .inventory-col-name { width: auto; }
.inventory-items-table .inventory-col-category { width: 5.5%; }
.inventory-items-table .inventory-col-usage { width: 6.5%; }
.inventory-items-table .inventory-col-sku { width: 9%; }
.inventory-items-table .inventory-col-location { width: 6.5%; }
.inventory-items-table .inventory-col-unit { width: 4.5%; }
.inventory-items-table .inventory-col-price { width: 6%; }
.inventory-items-table .inventory-col-balance,
.inventory-items-table .inventory-col-reserved,
.inventory-items-table .inventory-col-available,
.inventory-items-table .inventory-col-safety { width: 5.5%; }
.inventory-items-table .inventory-col-warning { width: 6.5%; }
.inventory-items-table .inventory-col-updated { width: 7%; }
.inventory-items-table .inventory-col-actions { width: 5%; }
.inventory-items-table .inventory-col-location,
.inventory-items-table .inventory-col-unit,
.inventory-items-table .inventory-location-cell,
.inventory-items-table .inventory-unit-cell {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.inventory-items-table .badge {
  max-width: 100%;
  padding-inline: 5px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}
.inventory-items-table .inventory-name-cell { font-weight: 500; }
.inventory-items-table .inventory-sku-cell { font-size: 12px; }
.inventory-items-table .inventory-updated-cell {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.inventory-actions-cell,
.inventory-ledger-actions { text-align: center; }
.inventory-actions-cell button,
.inventory-ledger-actions button {
  min-height: 28px;
  padding: 2px 4px;
  white-space: nowrap;
}
.inventory-ledger-table .inventory-ledger-col-time { width: 10.5%; }
.inventory-ledger-table .inventory-ledger-col-action { width: 7%; }
.inventory-ledger-table .inventory-ledger-col-quantity { width: 5%; }
.inventory-ledger-table .inventory-ledger-col-item { width: 14%; }
.inventory-ledger-table .inventory-ledger-col-location { width: 6%; }
.inventory-ledger-table .inventory-ledger-col-balance { width: 9%; }
.inventory-ledger-table .inventory-ledger-col-reference { width: 11%; }
.inventory-ledger-table .inventory-ledger-col-reason { width: 18%; }
.inventory-ledger-table .inventory-ledger-col-operator { width: 8%; }
.inventory-ledger-table .inventory-ledger-col-actions { width: 8%; }
.inventory-ledger-table .inventory-ledger-time { color: var(--muted); font-size: 11.5px; }
.inventory-ledger-table .inventory-ledger-reason { min-width: 0; }
.inventory-items-table .column-filter-button,
.inventory-items-table .column-sort-button,
.inventory-ledger-table .column-filter-button,
.inventory-ledger-table .column-sort-button {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-left: 0;
}

@media (max-width: 1100px) {
  .inventory-items-table,
  .inventory-ledger-table { font-size: 12px; }
  .inventory-items-table th,
  .inventory-items-table td,
  .inventory-ledger-table th,
  .inventory-ledger-table td { padding-block: 4px; }
  .inventory-items-table .column-filter-button,
  .inventory-items-table .column-sort-button,
  .inventory-ledger-table .column-filter-button,
  .inventory-ledger-table .column-sort-button {
    width: 14px;
    height: 14px;
    min-height: 14px;
    margin-left: 0;
  }
  .inventory-items-table td.pick input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 1100px) {
  .inventory-warning-summary-grid { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}
@media (max-width: 719px) {
  .inventory-warning-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-summary-cell { min-height: 38px; padding: 6px 8px; }
  .inventory-filter-row select, .inventory-batch-config-bar select { flex: 1 1 138px; min-width: 0; }
}

/* 第一百六十六批：库存操作从行内展开改成紧凑弹窗；参数不再左右铺满整屏。 */
.inventory-action-dialog { width: min(860px, 100%); }
.inventory-action-table { width: 100%; table-layout: auto; }
.inventory-action-table th {
  width: 72px;
  padding: 6px 8px;
  white-space: nowrap;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.inventory-action-table td { padding: 6px 8px; vertical-align: middle; }
.inventory-action-table input { min-height: 34px; padding: 5px 8px; }
.inventory-action-table input[type="checkbox"] { width: auto; min-height: 0; margin: 0; }
.inventory-action-table td:last-child { width: 1%; white-space: nowrap; text-align: right; }
.inventory-action-bindings { padding-top: 10px; border-top: 1px solid var(--line); }
.inventory-action-bindings h4 { margin: 0 0 8px; font-size: 13px; }
.inventory-action-bindings .row { margin-top: 7px; }
.inventory-action-bindings .binding-chip { white-space: normal; }

@media (max-width: 719px) {
  .inventory-action-table { display: block; overflow-x: auto; }
  .inventory-action-table tbody { display: table; width: 100%; min-width: 600px; }
}

/* 功能面板预警卡：有预警时用红橙描边，没预警时保持安静；入口按钮铺满卡宽。 */
.panel-warning-card { margin: 0 0 12px; border-left: 4px solid #94a3b8; }
.panel-warning-card.has-warning {
  border-left-color: #dc2626;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 70%);
}
.panel-warning-entry { width: 100%; }

@media (max-width: 719px) {
  .parts-issue-machine-row { flex-direction: column; }
  .parts-issue-machine-actions { justify-content: flex-start; }
  .parts-issue-filter-row label { flex: 1 1 100%; }
  .parts-issue-select-group { flex: 1 1 100%; }
  .parts-issue-issue-form { grid-template-columns: 1fr; }
  .parts-issue-issue-form .parts-issue-difference-flag { justify-self: stretch; }
  .parts-issue-edit-row { grid-template-columns: minmax(0, 1fr) auto; }
  .parts-issue-edit-name { grid-column: 1; grid-row: 1; }
  .parts-issue-remove { grid-column: 2; grid-row: 1; }
  .parts-issue-stepper { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .parts-issue-add-row { grid-template-columns: minmax(0, 1fr) 82px; }
  .parts-issue-catalog-field { grid-column: 1 / -1; }
  .parts-issue-add-qty-field { grid-column: 1; }
  .parts-issue-add-button { grid-column: 2; }
  .parts-issue-actionbar { align-items: stretch; bottom: 4px; padding: 8px; }
  .parts-issue-actionbar > .row { width: 100%; }
  .parts-issue-actionbar > .row button { flex: 1 1 0; }
  body:has(.parts-issue-actionbar:not([hidden])) .toast { bottom: 150px; }
  .parts-issue-print-tools { align-items: stretch; }
  .parts-issue-print-tools label, .parts-issue-print-tools button { flex: 1 1 100%; }
  .parts-issue-print-preview { padding: 6px; }
  .parts-confirm-actions { min-width: 0; grid-template-columns: 1fr 1fr; }
  .parts-confirm-actions input { grid-column: 1 / -1; }
  .inventory-filter-field { flex: 1 1 calc(50% - 8px); }
  .inventory-filter-field input, .inventory-filter-field select,
  .inventory-filter-field input[type="date"],
  .inventory-filter-field input[data-ledger-filter] { width: 100%; }
  .inventory-date-filter { flex: 1 1 100%; }
  .inventory-date-trigger { width: 100%; }
  .inventory-date-panel { right: 0; width: auto; max-width: none; }
  .inventory-date-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-date-custom { grid-template-columns: 1fr; }
  .inventory-date-custom > .muted { display: none; }
  .inventory-bulk-tools .inventory-bulk-reason { flex: 1 1 100%; }
}

/* 机器台账（第一百六十六批）：一行一台机器。顶部只放汇总与筛选，表格横向滚动，
   序号按筛选结果重排；台账不替代维修派单，只负责把已经离开派单窗口的机器留在视野里。 */
.machine-ledger-toolbar { align-items: flex-start; }
.machine-ledger-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.machine-ledger-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 76%);
}
.machine-ledger-metric span { color: var(--muted); font-size: 12px; }
.machine-ledger-metric strong { color: #173c6e; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.machine-ledger-filter { flex-wrap: wrap; align-items: flex-end; }
.machine-ledger-filter label { flex: 0 1 165px; min-width: 140px; }
.machine-ledger-filter .machine-ledger-keyword { flex: 1 1 310px; min-width: 260px; }
.machine-ledger-table-wrap { max-height: 620px; overflow: auto; }
.machine-ledger-table { min-width: 1640px; }
.machine-ledger-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.machine-ledger-actions button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.machine-ledger-empty { padding: 20px; text-align: center; color: var(--muted); }
.machine-ledger-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.machine-ledger-more button { min-height: 32px; padding: 4px 12px; }

@media (max-width: 719px) {
  .machine-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .machine-ledger-metric { min-height: 52px; padding: 8px 10px; }
  .machine-ledger-metric strong { font-size: 19px; }
  .machine-ledger-filter label,
  .machine-ledger-filter .machine-ledger-keyword { flex: 1 1 100%; min-width: 0; }
  .machine-ledger-table-wrap { max-height: 64vh; }
  .machine-ledger-table { min-width: 1500px; }
  .machine-ledger-actions button { min-height: 34px; }
  .machine-ledger-more { flex-wrap: wrap; }
}

/* 维修前复核：汇总数字作为快速状态筛选；故障列最多两行，完整内容留在 title。 */
.pre-review-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.pre-review-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: left;
}
.pre-review-metric span { color: var(--muted); font-size: 12px; }
.pre-review-metric strong { color: #173c6e; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.pre-review-metric[aria-pressed="true"] { border-color: #9bbce8; background: #f3f8ff; box-shadow: inset 0 0 0 1px #d6e6fb; }
.pre-review-table { min-width: 1740px; table-layout: fixed; }
.pre-review-col-serial { width: 2.8%; }
.pre-review-col-order { width: 9.2%; }
.pre-review-col-sales { width: 8%; }
.pre-review-col-category { width: 5.2%; }
.pre-review-col-model { width: 9.6%; }
.pre-review-col-fault { width: 16.4%; }
.pre-review-col-cost { width: 8.2%; }
.pre-review-col-amount { width: 6%; }
.pre-review-col-profit { width: 5.7%; }
.pre-review-col-round { width: 5.9%; }
.pre-review-col-time { width: 8.3%; }
.pre-review-col-actions { width: 14.7%; }
.pre-review-fault {
  overflow: hidden;
  line-height: 1.45;
}
.pre-review-fault-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  white-space: normal;
}
.pre-review-actions-cell { overflow: visible; }
.pre-review-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  white-space: nowrap;
}
.pre-review-actions button { flex: 0 0 auto; min-height: 30px; padding: 4px 9px; font-size: 12px; }

@media (max-width: 719px) {
  .pre-review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pre-review-metric { min-height: 52px; padding: 8px 10px; }
  .pre-review-metric strong { font-size: 19px; }
  .pre-review-table { min-width: 1600px; }
}

/* 机器回收室（第一百五十二批）：扫码区在上，台账在下。阶段按钮带数量，操作列保持紧凑；
   退回维修是客户改口后的主操作，用主按钮提示出来，但已拆机记录不显示。 */
.machine-recycle-stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.machine-recycle-stage-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}
.machine-recycle-stage-tabs button.is-active {
  border-color: #bcd4f4;
  background: var(--tone-blue-bg);
  color: var(--tone-blue);
  font-weight: 700;
}
.machine-recycle-stage-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--tone-gray-bg);
  color: var(--tone-gray);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.machine-recycle-stage-tabs button.is-active .machine-recycle-stage-count {
  background: #d6e6fb;
  color: var(--tone-blue);
}
.machine-recycle-filter { margin-bottom: 10px; }
.machine-recycle-search { flex: 1 1 340px; min-width: 0; }
.machine-recycle-stage-select { flex: 0 1 150px; }
.machine-recycle-table-wrap { max-height: 520px; overflow: auto; }
.machine-recycle-table { min-width: 1480px; }
.machine-recycle-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.machine-recycle-actions button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}
.machine-recycle-scan-card {
  display: grid;
  gap: 4px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid #cfdff3;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 72%);
}
.machine-recycle-scan-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.machine-recycle-scan-title strong { font-size: 19px; }
.machine-recycle-fault {
  margin-top: 4px;
  padding: 6px 8px;
  border-left: 3px solid #c7d9f0;
  background: #f8fbff;
  color: #334155;
  font-size: 13px;
}
.machine-recycle-empty { margin: 4px 0; }

@media (max-width: 719px) {
  .machine-recycle-stage-tabs button { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .machine-recycle-search, .machine-recycle-stage-select { flex: 1 1 100%; }
  .machine-recycle-table-wrap { max-height: 62vh; }
  .machine-recycle-table { min-width: 1320px; }
  .machine-recycle-actions button { min-height: 34px; }
}

/* 经营报表：筛选、摘要与授权矩阵。 */
.reports-hub { display: grid; gap: 12px; }
.reports-hub-toolbar { flex-wrap: wrap; }
.report-panel { display: grid; gap: 12px; }
.report-filter-card .card-head { align-items: flex-start; flex-wrap: wrap; }
.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}
.report-filter-grid label { min-width: 0; font-size: 12px; }
.report-filter-field { min-width: 0; display: grid; gap: 4px; align-content: end; font-size: 12px; }
.report-filter-grid input,
.report-filter-grid select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.report-multi-select { position: relative; }
.report-multi-select > summary {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-multi-select > summary::-webkit-details-marker { display: none; }
.report-multi-select > summary::after { content: ' ▾'; color: var(--muted); }
.report-multi-select[open] > summary::after { content: ' ▴'; }
.report-multi-options {
  position: absolute;
  z-index: 25;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 35, 63, .16);
}
.report-multi-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.report-multi-options label:hover { background: #f3f8ff; }
.report-multi-options input { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--accent); }
.report-date-presets { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
.report-date-presets button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.report-filter-actions { display: flex; gap: 8px; align-items: center; }
.report-filter-actions button { white-space: nowrap; min-height: 38px; }
.report-status { min-height: 18px; }
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.report-metric {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 72%);
}
.report-metric span { color: var(--muted); font-size: 12px; }
.report-metric strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.report-state {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf7ef;
  color: #26743b;
  font-size: 12px;
  font-weight: 600;
}
.report-state-warning { background: #fff6dc; color: #8a5a00; }
.report-state-danger { background: #ffe9e8; color: #a52b24; }
.sales-bi-filter-card .muted { max-width: 760px; line-height: 1.65; }

/* 账号维护：编辑面板跟在账号行下面展开，避免每次操作都跳到页面顶部。 */
.account-inline-panel-row > td {
  padding: 8px 12px 14px;
  background: #f5f9ff;
  border-top: 1px dashed #cfe0f5;
}
.account-inline-panel > .card {
  margin: 0;
  border-color: #cfe0f5;
  box-shadow: none;
}
.account-inline-panel .card-head { margin-bottom: 8px; }
.sales-bi-table { min-width: 1580px; }
.sales-bi-average {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 88px;
  padding: 2px 7px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.sales-bi-average small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  opacity: .9;
}
.sales-bi-rank-1 { background: #fff1bf; color: #7c4b00; box-shadow: inset 0 0 0 1px #efd27b; }
.sales-bi-rank-2 { background: #eef2f6; color: #455566; box-shadow: inset 0 0 0 1px #cfd8e1; }
.sales-bi-rank-3 { background: #f8e5d8; color: #7c482c; box-shadow: inset 0 0 0 1px #e4bfa5; }
.report-access-actions { justify-content: space-between; margin: 10px 0; }
.report-access-check { text-align: center; }
.report-access-check input { width: 18px; height: 18px; accent-color: var(--brand, #1f69c8); }
.sales-bi-access-head .action-hint { max-width: 980px; line-height: 1.65; margin: 4px 0 0; }
.sales-bi-access-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}
.sales-bi-access-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
}
.sales-bi-access-toolbar select,
.sales-bi-access-toolbar input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.sales-bi-access-toolbar .sales-bi-access-search { min-width: min(320px, 100%); }
.sales-bi-access-toolbar button { min-height: 38px; white-space: nowrap; }
.sales-bi-access-toolbar > .muted { flex: 1 1 220px; align-self: center; }
.sales-bi-access-table { min-width: 820px; }
.sales-bi-access-table td { vertical-align: top; }
.sales-bi-access-table td > select { min-width: 150px; min-height: 34px; }
.sales-bi-access-picker-cell { display: grid; gap: 5px; min-width: 220px; }
.sales-bi-access-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.sales-bi-sales-picker { width: min(760px, 100%); }
.sales-bi-sales-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sales-bi-sales-picker-toolbar input {
  flex: 1 1 220px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sales-bi-sales-picker-toolbar button { min-height: 36px; }
.sales-bi-sales-picker-toolbar .muted { margin-left: auto; }
.sales-bi-sales-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px;
  min-height: 90px;
  max-height: min(50vh, 420px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.sales-bi-sales-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.sales-bi-sales-option:hover { background: #f0f6ff; }
.sales-bi-sales-option input { width: 17px; height: 17px; accent-color: var(--brand, #1f69c8); }
.sales-bi-sales-option small { grid-column: 2; color: var(--muted); }
@media (max-width: 719px) {
  .reports-hub-toolbar { align-items: stretch; }
  .reports-hub-toolbar .view-switch { overflow-x: auto; max-width: 100%; }
  .reports-hub-toolbar .view-switch button { flex: 0 0 auto; }
  .report-filter-grid { grid-template-columns: 1fr 1fr; }
  .report-filter-grid label:first-child,
  .report-filter-actions { grid-column: 1 / -1; }
  .sales-bi-access-toolbar { align-items: stretch; }
  .sales-bi-access-toolbar label,
  .sales-bi-access-toolbar .sales-bi-access-search,
  .sales-bi-access-toolbar > .muted,
  .sales-bi-access-toolbar button { flex: 1 1 100%; }
  .sales-bi-sales-picker-toolbar .muted { margin-left: 0; }
}

/* 操作动态与管理员数据恢复：时间线优先展示“谁、何时、改了什么”，恢复按钮只出现在安全条目上。 */
.activity-list { display: grid; gap: 10px; margin-top: 10px; }
.activity-item { padding: 14px 16px; }
.activity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.activity-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.activity-title strong { font-size: 15px; }
.activity-head time { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.activity-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; font-size: 12px; color: var(--muted); }
.activity-meta a { color: #1e63c0; font-weight: 600; text-decoration: none; }
.activity-summary { margin: 0 0 9px; font-size: 13px; line-height: 1.65; }
.activity-changes { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; }
.activity-change {
  display: grid;
  grid-template-columns: minmax(100px, 170px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 7px 9px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fafcff;
  font-size: 13px;
}
.activity-change dt { color: var(--muted); }
.activity-change dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 0; }
.activity-change.is-readonly { background: #f6f7f9; }
.activity-old { color: #a13b32; text-decoration: line-through; text-decoration-color: rgba(161, 59, 50, 0.45); }
.activity-new { color: #22724d; font-weight: 600; }
.activity-arrow { color: #94a3b8; }
.activity-no-change { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.activity-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.activity-rollback { border-color: #c9dcf7; background: #f4f9ff; color: #1e63c0; }
.activity-blocked { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: right; }
.activity-view .modal-card { width: min(680px, 100%); }
.activity-view textarea { width: 100%; resize: vertical; }
.activity-view .form-error { margin: 0; color: #b42318; font-size: 13px; }

/* 工单详情操作记录（只读弹窗）：头部固定，时间线在弹窗内部滚动，移动端也不把整页撑长。 */
.activity-modal-card {
  width: min(860px, 100%);
  height: min(820px, 88vh);
  overflow: hidden;
}
.activity-modal-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.activity-modal-title > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.activity-modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 4px; }
.activity-modal-body .activity-list { margin-top: 0; }
.activity-modal-body .activity-item { box-shadow: none; }
@media (max-width: 719px) {
  .activity-item { padding: 12px; }
  .activity-head { flex-direction: column; gap: 4px; }
  .activity-change { grid-template-columns: 1fr; gap: 3px; }
  .activity-foot, .activity-blocked { justify-content: flex-start; text-align: left; }
  .activity-rollback { width: 100%; }
  .activity-modal-card { width: 100%; height: 92vh; padding: 12px; }
}

/* 客户台账（2026-11）：客户主档与工单分离。列表在桌面铺开，在手机上保留横向滚动；
   添加人是「姓名 + 各自添加时间」的重复结构，用轻量分组而不是把整行撑成卡片。 */
.customer-ledger-toolbar,
.customer-detail-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.customer-ledger-toolbar > div,
.customer-detail-toolbar > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.customer-ledger-filters {
  margin-top: 2px;
}
.customer-ledger-filters label {
  min-width: 0;
}
.customer-ledger-filter-actions {
  justify-content: flex-start;
  gap: 8px;
}
.customer-ledger-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}
.customer-ledger-card {
  padding: 0;
  overflow: hidden;
}
.customer-ledger-card .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: 64vh;
}
.customer-ledger-table {
  min-width: 1540px;
}
.customer-ledger-table .row-serial {
  width: 46px;
  color: var(--muted);
  text-align: center;
}
.customer-ledger-table td:last-child,
.customer-ledger-table th:last-child {
  min-width: 112px;
}
.customer-ledger-name {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-ledger-original,
.customer-ledger-groups {
  display: block;
  max-width: 210px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}
.customer-ledger-followers {
  display: grid;
  gap: 3px;
  min-width: 174px;
}
.customer-ledger-follower {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
}
.customer-ledger-follower .muted {
  font-size: 11px;
  white-space: nowrap;
}
.customer-ledger-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.customer-ledger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.customer-ledger-actions button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

/* 客户详情：档案页只读；最近工单是摘要，不复制完整工单操作。 */
.customer-detail-hero {
  display: grid;
  gap: 12px;
}
.customer-detail-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.customer-detail-hero-main h2 {
  margin: 3px 0 4px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.customer-detail-hero-main p {
  margin: 0;
}
.customer-detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.customer-detail-hero-actions button {
  min-height: 34px;
  padding: 5px 11px;
}
.customer-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.customer-detail-grid-card .card-head,
.customer-detail-taxonomy .card-head {
  align-items: flex-start;
  flex-wrap: wrap;
}
.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.customer-detail-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e5ebf4;
  border-radius: 8px;
  background: #fafcff;
}
.customer-detail-item > strong {
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.customer-detail-item.is-wide {
  grid-column: 1 / -1;
}
.customer-detail-followers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.customer-detail-follower {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e5ebf4;
  border-radius: 8px;
  background: #fafcff;
}
.customer-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.customer-detail-taxonomy {
  display: grid;
  gap: 10px;
}
.customer-detail-taxonomy-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}
.customer-detail-orders {
  min-width: 560px;
}
.customer-detail-orders th,
.customer-detail-orders td {
  height: 34px;
}

/* 客户主档合并（2026-11）：先搜后勾，保留客户固定在顶部；结果区单独滚动。
   手机上搜索框与操作区纵向排开，避免勾选框和按钮挤在同一行。 */
.customer-merge-dialog {
  width: min(760px, 100%);
  gap: 12px;
}
.customer-merge-head {
  align-items: flex-start;
}
.customer-merge-head h2,
.customer-merge-head p {
  margin: 0;
}
.customer-merge-head p {
  margin-top: 3px;
  line-height: 1.5;
}
.customer-merge-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}
.customer-merge-target {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  padding: 10px 12px;
  border: 1px solid #dbe8f8;
  border-radius: 9px;
  background: #f7fbff;
}
.customer-merge-target > strong {
  font-size: 15px;
}
.customer-merge-target > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eaf3ff;
  color: #1e63c0;
}
.customer-merge-target > span:last-child {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.customer-merge-search-row {
  display: flex;
  gap: 8px;
}
.customer-merge-search-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.customer-merge-search-row button {
  flex: 0 0 auto;
  min-width: 68px;
}
.customer-merge-tip,
.customer-merge-error {
  margin: 0;
  line-height: 1.55;
}
.customer-merge-results {
  display: grid;
  gap: 7px;
  max-height: min(38vh, 350px);
  overflow: auto;
  padding: 1px 3px 1px 1px;
}
.customer-merge-candidate {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid #e1e8f2;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease;
}
.customer-merge-candidate:hover {
  border-color: #b9d2f2;
  background: #f8fbff;
}
.customer-merge-candidate.is-selected {
  border-color: #7eafe8;
  background: #f1f7ff;
  box-shadow: inset 3px 0 0 #2d6fca;
}
.customer-merge-candidate > input {
  margin: 3px 0 0;
}
.customer-merge-candidate-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.customer-merge-candidate-main > span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  min-width: 0;
}
.customer-merge-candidate-main > span > strong {
  overflow-wrap: anywhere;
}
.customer-merge-candidate-main > span > code {
  color: #52657f;
}
.customer-merge-footer {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.customer-merge-reason {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.customer-merge-reason input {
  width: 100%;
  min-width: 0;
}
.customer-merge-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}
.customer-merge-actions > span {
  margin-right: auto;
}

/* 企微客户接入：同步字段开关与数据来源。checkbox 单独占右列，手机上纵向排列。 */
.customer-sync-settings {
  display: grid;
  gap: 10px;
}
.customer-sync-required {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #dbe8f8;
  border-radius: 8px;
  background: #f7fbff;
}
.customer-sync-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 7px;
}
.customer-sync-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #e5ebf4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.customer-sync-field > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.customer-sync-field .muted {
  font-size: 11px;
  line-height: 1.4;
}
.customer-sync-field input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--accent);
}
.customer-sync-providers {
  display: grid;
  gap: 6px;
}
.customer-sync-provider {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e5ebf4;
  border-radius: 8px;
  background: #fafcff;
}
.customer-sync-provider > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.customer-sync-provider .muted {
  margin: 0;
  font-size: 11px;
}
.customer-sync-actions {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 719px) {
  .customer-ledger-toolbar,
  .customer-detail-toolbar {
    align-items: stretch;
  }
  .customer-ledger-toolbar > button,
  .customer-detail-toolbar > button {
    align-self: flex-start;
  }
  .customer-ledger-filters {
    grid-template-columns: 1fr;
  }
  .customer-ledger-filters .filter-search-field,
  .customer-ledger-filter-actions {
    grid-column: auto;
  }
  .customer-ledger-card .table-wrap {
    max-height: 58vh;
  }
  .customer-ledger-table {
    min-width: 1320px;
  }
  .customer-detail-hero-main h2 {
    font-size: 19px;
  }
  .customer-detail-grid,
  .customer-detail-followers {
    grid-template-columns: 1fr;
  }
  .customer-detail-taxonomy-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .customer-merge-search-row,
  .customer-merge-reason {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .customer-merge-search-row button {
    width: 100%;
  }
  .customer-merge-actions {
    align-items: stretch;
  }
  .customer-merge-actions > span {
    flex-basis: 100%;
    margin-right: 0;
  }
  .customer-sync-fields {
    grid-template-columns: 1fr;
  }
  .customer-sync-provider {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 个人待办中心（第一百九十批）：把各模块「该我处理」的事实时汇总到一屏，按钮仍回原模块。 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.my-todos {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.my-todos-hero {
  padding: 18px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 58%, #eef6ff 100%);
}

.my-todos-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.my-todos-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.my-todos-sub {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.my-todos-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.my-todos-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.my-todos-metric span {
  color: var(--muted);
  font-size: 12px;
}

.my-todos-metric strong {
  font-size: 22px;
  line-height: 1;
}

.my-todos-metric[data-tone="amber"] strong { color: var(--tone-amber); }
.my-todos-metric[data-tone="blue"] strong { color: var(--tone-blue); }
.my-todos-metric[data-tone="red"] strong { color: #b42318; }
.my-todos-metric[data-tone="gray"] strong { color: var(--tone-gray); }

.my-todos-category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.my-todos-category-head > span:first-child {
  color: var(--ink);
  font-weight: 600;
}

.my-todos-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.my-todos-category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #d9e2ee;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 13px;
}

.my-todos-category:hover {
  border-color: #a9c4ec;
  background: #fff;
}

.my-todos-category[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 7px rgba(47, 107, 216, 0.2);
}

.my-todos-category span {
  min-width: 21px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(47, 107, 216, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.my-todos-category[aria-selected="true"] span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.my-todos-status {
  min-height: 18px;
  margin: 9px 0 0;
  font-size: 12px;
}

.my-todos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.my-todos-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef2f7;
}

.my-todos-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.my-todos-tab[aria-selected="true"] {
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 35, 55, 0.12);
}

.my-todos-tab span {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(47, 107, 216, 0.1);
  color: inherit;
  font-size: 11px;
  text-align: center;
}

.my-todos-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.my-todos-select-wrap {
  display: block;
}

.my-todos-tools select,
.my-todos-tools input {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.my-todos-tools select { width: auto; min-width: 150px; }
.my-todos-tools input { width: min(280px, 70vw); }

.my-todos-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.my-todos-group-label {
  margin: 3px 2px -1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.my-todos-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--tone-blue);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 35, 55, 0.04);
}

.my-todos-card.urgent { border-left-color: #d92d20; }
.my-todos-card.warning { border-left-color: #e08a18; }
.my-todos-card.normal { border-left-color: var(--tone-blue); }

.my-todos-card-main {
  min-width: 0;
}

.my-todos-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.my-todos-source {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  border: 1px solid #c9dcf7;
  border-radius: 999px;
  background: var(--tone-blue-bg);
  color: var(--tone-blue);
  font-size: 11px;
  font-weight: 600;
}

.my-todos-priority {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.my-todos-priority[data-tone="red"] { background: #fff0ee; color: #b42318; }
.my-todos-priority[data-tone="amber"] { background: var(--tone-amber-bg); color: var(--tone-amber); }
.my-todos-priority[data-tone="blue"] { background: var(--tone-blue-bg); color: var(--tone-blue); }

.my-todos-count {
  color: var(--muted);
  font-size: 11px;
}

.my-todos-card-title {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.my-todos-desc {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.my-todos-reason {
  margin: 7px 0 0;
  padding: 6px 9px;
  border-radius: 7px;
  background: #fff7ea;
  color: #8a4b08;
  font-size: 12px;
  line-height: 1.5;
}

.my-todos-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.my-todos-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.my-todos-card-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 9px;
  min-width: 108px;
}

.my-todos-wait {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.my-todos-action {
  min-height: 34px;
  padding: 5px 14px;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 719px) {
  .my-todos-hero { padding: 15px; }
  .my-todos-hero-head { align-items: flex-start; }
  .my-todos-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-todos-metric { min-height: 48px; padding: 7px 10px; }
  .my-todos-metric strong { font-size: 19px; }
  .my-todos-category-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .my-todos-categories { flex-wrap: nowrap; overflow-x: auto; padding: 1px 1px 4px; }
  .my-todos-category { flex: 0 0 auto; }
  .my-todos-toolbar { align-items: stretch; }
  .my-todos-tabs { width: 100%; }
  .my-todos-tab { flex: 1 1 auto; justify-content: center; }
  .my-todos-tools { width: 100%; }
  .my-todos-tools select,
  .my-todos-tools input { flex: 1 1 140px; width: auto; min-width: 0; }
  .my-todos-card { grid-template-columns: 1fr; gap: 10px; }
  .my-todos-card-side {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    min-width: 0;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }
}

/* 列表宽度自适应：报表、明细与台账先按窗口宽度压缩列宽，只有到达内容最小宽度后才横向滚动。
   页面级为宽表写死的 min-width 由这里的统一规则覆盖，列内容自身的最小宽度仍由浏览器按内容计算。
   库存两张主表继续使用百分比 fixed 布局，避免数量与操作列在窄屏丢失。 */
.table-wrap > table.data-table {
  width: 100%;
  min-width: min-content;
  table-layout: auto;
}
.table-wrap > table.inventory-items-table,
.table-wrap > table.inventory-ledger-table {
  table-layout: fixed;
}
/* ===== 代收款项收回：按月销售台账 + 四次收回登记 =====
   表格列较多，桌面优先；窄屏允许横向滚动，汇总和登记抽屉改为单列。 */
.sf-recovery { display: grid; gap: 12px; min-width: 0; }
.sf-recovery-filter-card { display: grid; gap: 12px; }
.sf-recovery-head { align-items: flex-start; gap: 12px; }
.sf-recovery-head > div:first-child { display: grid; gap: 4px; min-width: 0; }
.sf-recovery-head .muted { max-width: 900px; line-height: 1.6; }
.sf-recovery-head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sf-recovery-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.sf-recovery-filter .field { width: 180px; }
.sf-recovery-filter input[type="month"],
.sf-recovery input[type="number"],
.sf-recovery input[type="date"],
.sf-recovery input[type="text"],
.sf-recovery textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
.sf-recovery textarea { resize: vertical; }
.sf-recovery-summary-card { display: grid; gap: 11px; }
.sf-recovery-summary-grid { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.sf-recovery-summary-grid .report-metric small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.sf-recovery-summary-grid .report-metric.is-warning { border-color: #f1cf94; background: linear-gradient(135deg, #fffaf0, #fff); }
.sf-recovery-summary-grid .report-metric.is-warning strong { color: #a15a06; }
.sf-recovery-summary-grid .report-metric.is-done { border-color: #c7e7d6; background: linear-gradient(135deg, #f4fcf7, #fff); }
.sf-recovery-summary-grid .report-metric.is-done strong { color: #147a58; }
.sf-recovery-progress { height: 5px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.sf-recovery-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6bd8, #1d9b76); transition: width .2s ease; }
.sf-recovery-fee-form { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.sf-recovery-fee-form .compact-field { width: 190px; }
.sf-recovery-fee-form .muted { flex: 1 1 240px; font-size: 11px; }
.sf-recovery-rate-input { display: flex; align-items: center; gap: 6px; }
.sf-recovery-rate-input input { width: 90px !important; }
.sf-recovery-table-wrap { padding: 0; overflow-x: auto; }
.sf-recovery-table { min-width: 1420px; font-size: 12px; }
.sf-recovery-table th,
.sf-recovery-table td { padding: 7px 8px; vertical-align: middle; }
.sf-recovery-table thead th { white-space: nowrap; background: #f7f9fc; }
.sf-recovery-table tfoot th,
.sf-recovery-table tfoot td { border-top: 2px solid var(--line); background: #fbfcfe; font-weight: 700; }
.sf-recovery-table tbody tr:hover { background: #f8fbff; }
.sf-recovery-sales { min-width: 105px; }
.sf-recovery-net { font-weight: 600; }
.sf-recovery-recovered { color: #147a58; }
.sf-recovery-remaining.is-warning { color: #a15a06; font-weight: 700; }
.sf-recovery-remaining.is-done { color: #147a58; }
.sf-recovery-slot {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 93px;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
}
.sf-recovery-slot small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.sf-recovery-slot strong { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sf-recovery-slot.has-value { border-color: #bfe3d2; background: #f3fbf7; color: #147a58; }
.sf-recovery-slot.has-value:hover { border-color: #79c4a4; background: #eaf8f1; }
.sf-recovery-slot.is-empty { border-style: dashed; color: #2f6bd8; background: #f7faff; }
.sf-recovery-slot.is-empty:hover { border-color: #7facf0; background: #eef5ff; }
.sf-recovery-slot.is-placeholder { color: #a7b1bf; background: #fafbfc; }
.sf-recovery-note {
  display: block;
  max-width: 150px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2f6bd8;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-recovery-note:hover { text-decoration: underline; }
.sf-recovery-small-button { min-height: 30px; padding: 4px 9px; white-space: nowrap; }
.sf-recovery-unassigned { background: #fffaf0; }
.sf-recovery-unassigned-chip { display: inline-flex; padding: 2px 7px; border-radius: 999px; background: #fff0d5; color: #9b5c00; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sf-recovery-drawer-scrim { align-items: stretch; justify-content: flex-end; padding: 0; }
.sf-recovery-drawer-card { width: min(470px, 100%); height: 100%; max-height: none; gap: 0; padding: 0; border-radius: 14px 0 0 14px; overflow: hidden; }
.sf-recovery-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.sf-recovery-drawer-head h2 { margin: 3px 0 0; font-size: 18px; }
.sf-recovery-drawer-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.sf-recovery-drawer-body { flex: 1 1 auto; min-height: 0; padding: 14px 16px; overflow: auto; }
.sf-recovery-drawer-foot { display: flex; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); background: #fff; }
.sf-recovery-kicker { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.sf-recovery-close { min-height: 30px; padding: 4px 9px; }
.sf-recovery-drawer-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 13px; }
.sf-recovery-drawer-summary > div { min-width: 0; padding: 8px; border-radius: 7px; background: #f6f8fb; }
.sf-recovery-drawer-summary span { display: block; color: var(--muted); font-size: 9px; white-space: nowrap; }
.sf-recovery-drawer-summary strong { display: block; margin-top: 3px; overflow: hidden; font-size: 12px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.sf-recovery-drawer-summary .is-ok strong { color: #147a58; }
.sf-recovery-drawer-summary .is-warn strong { color: #a15a06; }
.sf-recovery-entry-form,
.sf-recovery-note-form { display: grid; gap: 9px; padding: 11px; border: 1px solid #cfe0f5; border-radius: 9px; background: #f7fbff; }
.sf-recovery-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sf-recovery-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sf-recovery-form-actions .muted { font-size: 10px; }
.sf-recovery-form-error { padding: 7px 9px; border-radius: 7px; background: #fff0ee; color: #a52b24; font-size: 12px; }
.sf-recovery-entry-history { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sf-recovery-entry-history h3,
.sf-recovery-readonly-note h3 { margin: 0 0 8px; font-size: 13px; }
.sf-recovery-entry-list { display: grid; gap: 7px; }
.sf-recovery-entry-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sf-recovery-entry-main { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 8px; align-items: baseline; padding: 0; border: 0; background: transparent; text-align: left; }
.sf-recovery-entry-main span { color: var(--muted); font-size: 10px; }
.sf-recovery-entry-main strong { font-size: 12px; }
.sf-recovery-entry-main small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sf-recovery-entry-item p { grid-column: 1 / 2; margin: 0; color: var(--muted); font-size: 11px; }
.sf-recovery-entry-item .danger-text { grid-column: 2 / 3; grid-row: 1 / 3; min-height: 28px; padding: 3px 7px; }
.sf-recovery-note-form { margin-top: 14px; background: #fbfcfe; border-color: var(--line); }
.sf-recovery-readonly-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sf-recovery-readonly-note p { margin: 0; white-space: pre-wrap; }
.sf-recovery-access-card { width: min(570px, 100%); }
.sf-recovery-access-list { display: grid; gap: 7px; max-height: 340px; overflow: auto; }
.sf-recovery-access-item { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.sf-recovery-access-item.is-checked { border-color: #9fc4f1; background: #f4f9ff; }
.sf-recovery-access-item.is-disabled { opacity: .48; }
.sf-recovery-access-item input { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--accent); }
.sf-recovery-access-person { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.sf-recovery-access-person strong { font-size: 13px; }
.sf-recovery-access-person small { color: var(--muted); font-size: 10px; }
.sf-recovery-required { padding: 2px 7px; border-radius: 999px; background: #eaf2fd; color: #246cc7; font-size: 10px; white-space: nowrap; }
.danger-text { color: var(--danger); }
.compact-empty { padding: 8px; }

@media (max-width: 720px) {
  .sf-recovery-head { flex-direction: column; }
  .sf-recovery-head-actions { width: 100%; justify-content: flex-start; }
  .sf-recovery-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-recovery-drawer-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-recovery-form-row { grid-template-columns: 1fr; }
  .sf-recovery-filter .field { width: 100%; }
}

/* 财务复核台账（第一百八十四批）：工单公用字段 rowspan，机器字段一台一行。 */
.finance-ledger-view { display: grid; gap: 10px; min-width: 0; }
.finance-ledger-view > * { min-width: 0; }
.finance-ledger-toolbar { align-items: flex-start; min-width: 0; }
.finance-ledger-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 7px 10px;
}
.finance-ledger-filter-row label { margin: 0; }
.finance-ledger-search { flex: 1 1 300px; min-width: 220px; }
.finance-ledger-search input { width: 100%; }
.finance-ledger-columns { margin-left: 0; flex: 0 0 auto; }
.finance-ledger-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.finance-ledger-metric {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}
.finance-ledger-metric span { color: var(--muted); font-size: 11px; }
.finance-ledger-metric strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.finance-ledger-metric[aria-pressed="true"] { border-color: #8bb8ef; box-shadow: inset 0 0 0 1px #8bb8ef; background: #f5faff; }
.finance-ledger-metric[data-tone="amber"] strong { color: var(--tone-amber); }
.finance-ledger-metric[data-tone="green"] strong { color: var(--tone-green); }
.finance-ledger-metric[data-tone="blue"] strong { color: var(--tone-blue); }
.finance-ledger-table-wrap { margin-top: 2px; max-width: 100%; min-width: 0; }
.table-wrap > table.finance-ledger-table { width: max-content; min-width: 0; max-width: none; table-layout: auto; }
.finance-ledger-table th,
.finance-ledger-table td { height: auto; padding: 2px 4px; vertical-align: middle; line-height: 1.2; }
.finance-ledger-table thead th { height: auto; padding: 3px 4px; white-space: nowrap; background: #f7f9fc; }
.finance-ledger-table tbody tr:hover td { background: #f8fbff; }
.finance-ledger-row td { border-bottom: 1px solid #edf1f6; }
.finance-ledger-group-start td { border-top: 2px solid #dfe6ef; }
.finance-ledger-group-start:first-child td { border-top: 0; }
.finance-ledger-shared-cell { background: #fcfdff; }
.finance-ledger-machine-cell { background: #fff; }
.finance-ledger-fault { width: clamp(110px, 11vw, 180px); min-width: 110px; max-width: 180px; white-space: normal; }
.finance-ledger-fault-text,
.finance-ledger-note-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  line-height: 1.3;
}
.finance-ledger-note { width: clamp(130px, 12vw, 190px); min-width: 130px; max-width: 190px; white-space: normal; }
.finance-ledger-payment-cell { white-space: nowrap; }
.finance-ledger-payment-summary { display: grid; gap: 2px; justify-items: start; }
.finance-ledger-payment-summary small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.finance-ledger-payment-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.finance-ledger-receipt-cell { width: 1%; min-width: 34px; }
.finance-ledger-receipts { display: flex; flex-wrap: wrap; gap: 2px; }
.finance-ledger-receipts.is-compact { flex-wrap: nowrap; gap: 2px; }
.finance-ledger-receipt {
  display: flex;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f7fa;
  cursor: zoom-in;
}
.finance-ledger-receipt:hover { border-color: #7facf0; background: #eef5ff; }
.finance-ledger-receipt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.finance-ledger-receipt-placeholder { color: var(--muted); font-size: 9px; }
.finance-ledger-receipts.is-compact .finance-ledger-receipt { width: 22px; min-width: 22px; height: 22px; min-height: 22px; }
.finance-ledger-work-note { display: grid; gap: 3px; min-width: 0; }
.finance-ledger-work-note textarea {
  width: 100%;
  min-height: 38px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
  resize: vertical;
}
.finance-ledger-work-note textarea:focus { border-color: #8bb8ef; outline: 2px solid #dcecff; }
.finance-ledger-note-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.finance-ledger-note-footer button { min-height: 22px; padding: 1px 6px; font-size: 10px; white-space: nowrap; }
.finance-ledger-note-state { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.finance-ledger-note-state.is-dirty { color: var(--tone-amber); }
.finance-ledger-actions-cell { width: 1%; white-space: nowrap; }
.finance-ledger-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 3px; }
.finance-ledger-actions button { flex: 0 0 auto; min-height: 24px; padding: 2px 6px; white-space: nowrap; }
.finance-ledger-reject-row td { padding: 10px 12px 13px; border-bottom: 2px solid #dfe6ef; background: #fffaf8; }
.finance-ledger-reject-form { display: grid; gap: 8px; max-width: 780px; }
.finance-ledger-reject-form strong { display: block; margin-bottom: 2px; }
.finance-ledger-reject-form .action-hint { margin: 0; }
.finance-ledger-reject-form label { margin: 0; }
.finance-ledger-reject-form textarea { min-height: 58px; }
.finance-ledger-detail-row > td {
  padding: 0 0 5px;
  border-bottom: 2px solid #d8e4f1;
  background: transparent;
}
.finance-ledger-detail {
  width: min(780px, 100%);
  max-width: 780px;
  margin-left: auto;
  margin-right: 1px;
  padding: 8px 10px 8px;
  border: 1px solid #cfe0f5;
  border-left: 3px solid var(--accent);
  border-radius: 0 0 8px 8px;
  background: linear-gradient(135deg, #f7fbff 0%, #fff 100%);
  box-shadow: 0 7px 18px -14px rgba(15, 52, 96, 0.48);
}
.finance-ledger-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #dce7f4;
}
.finance-ledger-detail-kicker { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.finance-ledger-detail-title { display: block; margin-top: 1px; font-size: 13px; line-height: 1.3; }
.finance-ledger-detail-sub { margin-top: 1px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.finance-ledger-detail-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.finance-ledger-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr);
  gap: 12px;
  padding-top: 6px;
}
.finance-ledger-detail-section { min-width: 0; }
.finance-ledger-detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.finance-ledger-detail-section-head strong { font-size: 11px; }
.finance-ledger-detail-section-head span { color: var(--muted); font-size: 10px; text-align: right; }
.finance-ledger-detail-section.finance-ledger-reconcile { padding-left: 10px; border-left: 1px solid #dce7f4; }
.finance-ledger-timeline { display: grid; gap: 0; }
.finance-ledger-detail-event {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 0;
  border-bottom: 1px dashed #dce7f4;
}
.finance-ledger-detail-event:last-child { border-bottom: 0; }
.finance-ledger-detail-event-mark {
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tone-blue-bg);
  color: var(--tone-blue);
  font-size: 9px;
  font-weight: 600;
}
.finance-ledger-detail-event[data-tone="green"] .finance-ledger-detail-event-mark { background: var(--tone-green-bg); color: var(--tone-green); }
.finance-ledger-detail-event[data-tone="red"] .finance-ledger-detail-event-mark { background: #fdecea; color: var(--danger); }
.finance-ledger-detail-event[data-tone="blue"] .finance-ledger-detail-event-mark { background: #eaf3ff; color: #2f6fbd; }
.finance-ledger-detail-event[data-tone="gray"] .finance-ledger-detail-event-mark { background: #f0f2f5; color: var(--muted); }
.finance-ledger-detail-event-main { display: grid; gap: 1px; min-width: 0; }
.finance-ledger-detail-event-main strong { overflow-wrap: anywhere; font-size: 11px; font-weight: 600; }
.finance-ledger-detail-event-main span { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.4; }
.finance-ledger-detail-event-amount { color: var(--tone-green); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-ledger-detail-event[data-tone="red"] .finance-ledger-detail-event-amount { color: var(--danger); }
.finance-ledger-correction-group { display: grid; gap: 4px; margin-top: 7px; padding-top: 6px; border-top: 1px dashed #cbdced; }
.finance-ledger-detail-event-receipt { justify-self: end; }
.finance-ledger-detail-empty { padding: 14px 0; color: var(--muted); font-size: 11px; }
.finance-ledger-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 20px;
  padding: 1px 0;
  border-bottom: 1px dashed #dce7f4;
  color: var(--muted);
  font-size: 11px;
}
.finance-ledger-calc-row strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-ledger-calc-row.is-total { margin-top: 2px; padding: 3px 5px; border: 0; border-radius: 5px; background: #fff; color: var(--ink); font-weight: 600; }
.finance-ledger-detail-explainer {
  margin: 5px 0 0;
  padding: 4px 6px;
  border-left: 2px solid var(--accent);
  background: var(--tone-blue-bg);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.finance-ledger-detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; padding-top: 5px; border-top: 1px solid #dce7f4; color: var(--muted); font-size: 9px; }
.finance-ledger-detail-footer .row { flex-wrap: nowrap; gap: 5px; }
.finance-ledger-detail-footer button { min-height: 23px; padding: 1px 6px; font-size: 9px; white-space: nowrap; }
.finance-ledger-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  color: var(--muted);
  font-size: 12px;
}
.finance-ledger-empty { padding: 30px 12px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .finance-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-ledger-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .finance-ledger-detail-section.finance-ledger-reconcile { padding: 12px 0 0; border-top: 1px solid #dce7f4; border-left: 0; }
}

@media (max-width: 720px) {
  .finance-ledger-filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .finance-ledger-search { grid-column: 1 / -1; }
  .finance-ledger-columns { width: 100%; grid-column: 1 / -1; }
  .finance-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-ledger-metric { min-height: 58px; }
  .finance-ledger-metric strong { font-size: 19px; }
  .finance-ledger-detail { padding: 12px; }
  .finance-ledger-detail-head { flex-direction: column; gap: 8px; }
  .finance-ledger-detail-badges { justify-content: flex-start; }
  .finance-ledger-detail-event { grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; }
  .finance-ledger-detail-event-receipt { grid-column: 2 / -1; justify-self: start; margin-top: 3px; }
  .finance-ledger-detail-footer { align-items: flex-start; flex-direction: column; }
  .finance-ledger-work-note { width: 100%; min-width: 150px; }
}
