/* ============================================================
   原有基础样式
   ============================================================ */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, '仿宋', 'FangSong', '华文仿宋', STFangsong, sans-serif;
    font-size: 17px;
}

/* 禁止页面级横向滚动/横向滑动把离屏内容（如闭合状态移动抽屉的深色面板）边缘滑进视口；
   宽表格已由各自 .mud-table-container(overflow-x:auto) 内部滚动，不受此规则影响 */
html, body {
    overflow-x: hidden;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

/* ============================================================
   表格基础样式 - 全局单行截断 + 横向滚动
   ============================================================
   关键说明：
   - table-layout: fixed 是让 text-overflow: ellipsis
     在 <td>/<th> 上生效的前提条件（display:table-cell 本身
     不支持 overflow/ellipsis）。
   - 各列宽度由 MudBlazor 按内容比例分配，列数过多时
     mud-table-container（overflow-x:auto）自动出现横向滚动条。
   ============================================================ */

.mud-table-container {
    overflow-x: auto !important;
    max-width: 100%;
}

/* 编辑页表格容器：列宽总和超出视口时横向滚动（配合 MudTable min-width 使列宽严格生效） */
.table-scroll {
    overflow-x: auto !important;
}

.mud-table {
    width: 100%;
    table-layout: fixed;
}

.mud-table-cell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.875rem !important;
}

/* 全局表头统一字重 600 + 左对齐 */
th.mud-table-cell,
.auto-table th {
    font-weight: 600 !important;
    text-align: left !important;
}

/* ============================================================
   表格内联编辑样式 - 无边框
   ============================================================ */

.mud-table .mud-input-outlined .mud-input-outlined-border {
    border-color: transparent !important;
    transition: border-color 0.2s ease;
}

.mud-table .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.mud-table .mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: transparent !important;
}

/* 用 box-shadow 替代边框作为焦点指示，避免边框线在单元格间产生视觉延申 */
.mud-table .mud-input-outlined:focus-within {
    box-shadow: inset 0 0 0 1px var(--mud-palette-primary) !important;
}

/* MudSelect input-slot */

/* ============================================================
   输入框字体和高度统一 - 全局生效（不限表格内）
   所有文本输入框统一 32px 高度、14px 字体
   ============================================================ */

.mud-input.mud-input-text {
    font-size: 0.875rem !important;
    font-family: inherit !important;
}

.mud-input.mud-input-text,
.mud-select,
.mud-numeric-field,
.mud-input-control.mud-input-text {
    height: 32px !important;
    min-height: 32px !important;
}

.mud-input.mud-input-text input,
.mud-select input,
.mud-numeric-field input,
.mud-input-slot {
    height: 32px !important;
    padding: 0 0 0 8px !important;
    line-height: 32px !important;
    box-sizing: border-box !important;
}

/* MudSelect 文本区域（div.mud-input-slot）也有 MudBlazor 默认 padding，导致和箭头不在同一水平线 */
.mud-select .mud-input-slot.mud-input-root-outlined {
    padding: 0 0 0 8px !important;
    line-height: 32px !important;
    height: 32px !important;
}

/* ============================================================
   隐藏数值输入框上下箭头 - 强制生效
   ============================================================ */

/* 方法1：通过 MudBlazor 类名 */
.mud-numeric-field .mud-input-adornment {
    display: none !important;
}

/* 方法2：直接作用于 input 元素 */
.mud-numeric-field input {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.mud-numeric-field input::-webkit-outer-spin-button,
.mud-numeric-field input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* 方法3：全局强制隐藏所有 number 类型输入框的箭头 */
input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* ============================================================
   下拉选择框样式
   ============================================================ */

.mud-table .mud-select {
    min-width: 80px !important;
}

.mud-select .mud-input {
    padding-right: 24px !important;
}

.mud-select .mud-select-arrow {
    right: 4px !important;
}

.mud-select .mud-input-adornment-end {
    height: 32px !important;
    max-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mud-select .mud-input input {
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.mud-select-item {
    white-space: normal !important;
    word-break: break-word !important;
}

/* 操作工/检验员多选下拉：表格内单元格空间有限，弹层加宽避免人员名被截断 */
.operator-select-popover {
    min-width: 260px !important;
}

/* 操作工/检验员多选下拉：选项行高压缩、勾选框（mud-list-item-icon）与姓名间距压缩，人员名更紧凑 */
.operator-select-popover .mud-list-item {
    min-height: 32px !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
}
.operator-select-popover .mud-list-item-icon {
    min-width: 24px !important;
    margin-right: 0 !important;
}
.operator-select-popover .mud-list-item-text {
    white-space: nowrap !important;
}

/* 员工管理多选（生产工段/工序组/靠工岗位）：表格单元格内弹层窄导致中文选项文字被截断——
   加宽弹层让选项完整可见 + 压缩勾选框（mud-list-item-icon）与文字之间的占位间距 */
.cell-multi-select-popover {
    min-width: 340px !important;
    max-width: 480px !important;
}
.cell-multi-select-popover .mud-list-item {
    min-height: 32px !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
}
.cell-multi-select-popover .mud-list-item-icon {
    min-width: 20px !important;
    margin-right: 0 !important;
}
.cell-multi-select-popover .mud-list-item-text {
    white-space: normal !important;
    word-break: break-word !important;
}

/* 操作工/检验员多选输入框：突破 compact-input 130px 上限，加宽让多人姓名可见；压缩姓名与边框/箭头间距 */
.operator-input.compact-input {
    max-width: 190px !important;
}
.operator-input .mud-input-slot.mud-input-root-outlined {
    padding: 0 4px 0 8px !important;
}

/* 下拉选项键盘导航高亮 - JS 侧添加 .mud-selected-item 但 MudBlazor 自身 CSS 未定义该类的可见样式 */
.mud-popover-open .mud-list-item.mud-selected-item {
    background-color: var(--mud-palette-action-default-hover) !important;
}
.mud-popover-open .mud-list-item.mud-selected-item:hover {
    background-color: var(--mud-palette-primary-hover, rgba(89, 74, 226, 0.12)) !important;
}

/* ============================================================
   复选框居中
   ============================================================ */

.mud-table .mud-checkbox {
    padding: 0 !important;
    margin: 0 !important;
}

.mud-table .mud-checkbox .mud-icon-button {
    width: 32px !important;
    height: 32px !important;
    padding: 4px !important;
}

/* ============================================================
   操作按钮
   ============================================================ */

.mud-table .mud-icon-button {
    width: 32px !important;
    height: 32px !important;
    padding: 4px !important;
}

/* ============================================================
   表单验证样式 - 红色边框和错误提示
   ============================================================ */

/* 无效输入框的红色边框 */
.mud-input-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
    border-width: 1px !important;
}

.mud-input-error.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
    border-width: 2px !important;
}

/* 必填字段的星号标记 */
.mud-input-required .mud-input-label::after {
    content: " *";
    color: var(--mud-palette-error);
}

/* 错误提示文字样式 */
.mud-helper-text.mud-invalid {
    color: var(--mud-palette-error) !important;
    font-size: 0.7rem;
    margin-top: 2px;
}

/* ============================================================
   顶部导航栏样式
   ============================================================ */

/* MudMenu 下拉菜单按钮的文字颜色 */
.mud-menu .mud-button-text {
    color: inherit !important;
}

/* ============================================================
   下拉菜单容器样式 - 深色主题，与导航栏一致
   ============================================================ */

/* 下拉面板背景 */
.mud-menu .mud-paper {
    background-color: #1a1a2e !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    margin-top: 4px !important;
    min-width: 140px !important;
    overflow: visible !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

/* 菜单项基础样式 */
.mud-menu .mud-list-item {
    color: #ccc !important;
    font-size: 0.875rem !important;
    padding: 8px 16px !important;
    transition: all 0.15s ease !important;
    border-radius: 4px !important;
    margin: 2px 4px !important;
}

/* 菜单项悬停 */
.mud-menu .mud-list-item:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* 表格内联编辑的验证样式 */
.mud-table .mud-input-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

/* ============================================================
   紧凑表格样式 - 极小内边距，适配20+列密集表格
   ============================================================ */

.compact-table.mud-table {
    width: auto;
}

.compact-table.mud-table .mud-table-cell {
    padding: 1px 1px !important;
}

/* 默认表格布局：列宽由 <th Style="width:xx"> 决定（偏好宽度，非强制）
   未设宽度的列由内容撑开（如操作按钮），不会消失。
   总宽超容器时 mud-table-container(overflow-x:auto) 自动滚动。 */
.compact-table .mud-table-root {
    width: 100%;
}

/* 数据值左对齐（仅数据行） */
.compact-table.mud-table tbody .mud-table-cell {
    text-align: left !important;
}

/* 数值类单元格居中（覆盖 compact-table 的 left !important，特异性更高） */
.compact-table.mud-table tbody .mud-table-cell.text-center {
    text-align: center !important;
}

/* 数值类单元格右对齐（覆盖 compact-table 的 left !important，特异性更高） */
.compact-table.mud-table tbody .mud-table-cell.text-right {
    text-align: right !important;
}

/* 数值/金额类数据格居中通用兜底（2026-09-08 全系统「文本居左、数值居中」）：
   供无 compact-table 作用域的表（auto-table / 其它）直接生效；compact-table 仍走上方更高特异性规则 */
.mud-table-cell.text-center {
    text-align: center !important;
}

/* 定尺联通视图 - 关键数值单元格强调（2026-09-08）：实切支数=蓝字加粗；需求总支/现有效产支=琥珀底加粗（供需对比对） */
.auto-table td.mud-table-cell.flwo-emph-actual {
    color: #1565C0 !important;
    font-weight: 700 !important;
}
.auto-table td.mud-table-cell.flwo-emph-compare {
    color: #B26A00 !important;
    font-weight: 700 !important;
    background: #FFF3E0 !important;
}

/* 输入框填满所在单元格宽度 */
.compact-table .mud-input {
    width: 100%;
}

.compact-table.mud-table .mud-input input,
.compact-table.mud-table .mud-select input {
    padding: 0 0 0 1px !important;
}

/* MudSelect 内层输入容器预留下拉图标空间 */
.compact-table.mud-table .mud-select .mud-input {
    padding-right: 16px !important;
}

/* 下拉选择框验证样式 */
.mud-select.mud-input-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

/* 数值输入框验证样式 */
.mud-numeric-field.mud-input-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

/* 日期选择器验证样式 */
.mud-datepicker.mud-input-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

/* 表头文字与筛选框之间的间距 */
.mud-table .mud-th {
    vertical-align: top;
    padding: 4px 6px !important;
}

/* 表头列名文字 */
.mud-table .th-label {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 1px;
}

/* 更新修改模式：原项次主号只读样式 */
.readonly-field .mud-input-input {
    background-color: #f0f0f0 !important;
    cursor: default !important;
    color: #666 !important;
}
.readonly-field .mud-input .mud-input-outlined-border {
    border-color: #e0e0e0 !important;
}

/* ============================================================
   可排序列头样式 - 简洁美观，不遮蔽字段文字
   ============================================================ */

.sortable-header {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
    white-space: nowrap;
}

.sortable-header:hover {
    color: var(--mud-palette-primary);
}

.sort-arrow {
    font-size: 9px;
    line-height: 1;
    color: var(--mud-palette-primary);
    flex-shrink: 0;
}

/* ============================================================
   统一表格行高 - 查看模式与编辑模式行高一致
   编辑模式下输入框 height:32px + padding:2px*2 = 36px，设为 38px 留有余地
   查看模式下仅有文本，通过 height 拉伸至与编辑模式一致

   注意：
   - table-layout:fixed 下浏览器对 td height 解释不一致，
     因此同时设置 height + min-height + line-height:normal
     三重兜底（min-height 虽 CSS spec 不适用于 table-cell，
     但实际浏览器大多支持；line-height:normal 防止被继承）。
   ============================================================ */

.auto-table td.mud-table-cell,
.auto-table td,
.compact-table.mud-table .mud-table-cell,
.mud-table-dense .mud-table-row .mud-table-cell {
    height: 38px !important;
    min-height: 38px;
    line-height: normal;
}

/* ============================================================
   全局列表自动压缩样式 - 列多时自动压缩，不出现横向滚动条
   ============================================================ */

.auto-table {
    width: 100%;
}

/* 订单交期预估小表可点击单元格（联动筛选订单列表） */
.estimate-cell {
    transition: background-color 0.15s;
    user-select: none;
}
.estimate-cell:hover {
    background-color: #e3f2fd;
}

.auto-table td.mud-table-cell,
.auto-table th.mud-table-cell {
    padding: 2px 4px !important;
}

.auto-table .mud-input,
.auto-table .mud-select,
.auto-table .mud-numeric-field {
    margin: 0 !important;
}

.auto-table .mud-input {
    width: 100%;
    min-width: 0;
}

.auto-table th.mud-table-cell {
    white-space: nowrap !important;
    font-size: 0.875rem !important;
}

.auto-table th {
    font-size: 0.875rem !important;
}

/* 单行表单 MudSimpleTable 的 <th>/<td> 表头截断 */
.auto-table th,
.auto-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   列分组样式 - 用于多列列表页的分组视觉呈现
   ============================================================ */

/* 列表页统一工具栏（列显隐 + 记录数 + 操作按钮，置于表/分组字段上方，紧凑 28px） */
.list-toolbar {
    display: flex;
    align-items: center;
    padding: 2px 0;
    min-height: 28px;
}

/* 分组标题栏 - 独立于 MudTable 的 flex 行，由 JS 测量列宽对齐 */
.col-group-header-scroll {
    overflow: hidden;
    border-bottom: 2px solid #e0e0e0;
    background: #fff;
}

.col-group-header-bar {
    display: flex;
    height: 28px;
}

.col-group-header-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-right: 1px solid #e0e0e0;
    /* 关键：content-box 时 item 实际占位 = 设置宽 + padding + border（多出 5px/项），
       与表格列宽（th.offsetWidth / col.Width）错位累积。border-box 后占位精确 = 设置宽，
       组标题栏与列宽（屏幕 offsetWidth、打印 col.Width）逐列对齐。 */
    box-sizing: border-box;
}

.col-group-header-item:last-child {
    border-right: none;
}

/* 数据居中 */
#workorder-execution-list-table .mud-table-cell {
    text-align: center !important;
}

#workorder-execution-list-table .col-header-cell {
    justify-content: center !important;
}

/* 分组列通用 - 居左排列，不换行 */
.col-header-cell {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* 分组标签徽章 - 紧凑小字 */
.col-group-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0 4px;
    margin-right: 2px;
    border-radius: 2px;
    line-height: 1.6;
    white-space: nowrap;
}


/* G1: 基础数据 - 无色调 */
.col-g1 .col-group-badge { color: #455A64; background: #ECEFF1; }

/* G2: 用料计划 - 蓝色系 */
.col-g2 { background: #F5F9FF !important; }
.col-g2 .col-group-badge { color: #1565C0; background: #BBDEFB; }
.col-g2-cell { background: #F5F9FF !important; }

/* ② 往来信息表头分组强调色（2026-09-14）：
   待发货(整单/非整单)、待收货 = 暖橙；待在产(整单未入库/扣除部分入库)、委外未回收 = 冷紫。
   四处入口：报表总览「客户往来数据」/「供应商往来数据」/「委外单位往来数据」三卡（纯 HTML 表格走内联样式）
   + 源列表页 /customers、/suppliers、/outsource-vendors（MudTable 走 th-accent-* 类，见各页 GetTradeAccentCss）。
   必须置于上方 .col-g2 之后（同特异度，靠源码顺序覆盖其 !important 底色） */
th.th-accent-stock { background: #FFF3E0 !important; color: #E65100 !important; border-bottom: 2px solid #FFB74D !important; font-weight: 700; }
th.th-accent-wip { background: #F3E5F5 !important; color: #6A1B9A !important; border-bottom: 2px solid #CE93D8 !important; font-weight: 700; }

/* G3: 投料数据 - 绿色系 */
.col-g3 { background: #F4FAF5 !important; }
.col-g3 .col-group-badge { color: #2E7D32; background: #C8E6C9; }
.col-g3-cell { background: #F4FAF5 !important; }

/* G4: 有效数据 - 橙色系 */
.col-g4 { background: #FFF8F0 !important; }
.col-g4 .col-group-badge { color: #E65100; background: #FFE0B2; }
.col-g4-cell { background: #FFF8F0 !important; }

/* G5: 物料执行 - 紫色系 */
.col-g5 { background: #F8F4FC !important; }
.col-g5 .col-group-badge { color: #6A1B9A; background: #E1BEE7; }
.col-g5-cell { background: #F8F4FC !important; }

/* G6: 返整执行 - 青色系 */
.col-g6 { background: #E0F7FA !important; }
.col-g6 .col-group-badge { color: #00695C; background: #B2DFDB; }
.col-g6-cell { background: #E0F7FA !important; }

/* G7: 有效流转 - 石灰系 */
.col-g7 { background: #FFF3E0 !important; }
.col-g7 .col-group-badge { color: #E65100; background: #FFE0B2; }
.col-g7-cell { background: #FFF3E0 !important; }

/* G8: 过程不合格 - 红粉系 */
.col-g8 { background: #FFEBEE !important; }
.col-g8 .col-group-badge { color: #C62828; background: #FFCDD2; }
.col-g8-cell { background: #FFEBEE !important; }

/* G9: 成检不合格 - 深橙系 */
.col-g9 { background: #FFF3E0 !important; }
.col-g9 .col-group-badge { color: #E65100; background: #FFE0B2; }
.col-g9-cell { background: #FFF3E0 !important; }

/* G10: 汇总不合格 - 棕灰系 */
.col-g10 { background: #EFEBE9 !important; }
.col-g10 .col-group-badge { color: #4E342E; background: #D7CCC8; }
.col-g10-cell { background: #EFEBE9 !important; }

/* G11: 成品入库 — 青绿系 */
.col-g11 { background: #E8F5E9 !important; }
.col-g11 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
.col-g11-cell { background: #E8F5E9 !important; }

.col-g12 { background: #FFF8E1 !important; }
.col-g12 .col-group-badge { color: #F57F17; background: #FFECB3; }
.col-g12-cell { background: #FFF8E1 !important; }

/* G7: 有效流转 — 青绿系 */
.col-g7 { background: #E0F2F1 !important; }
.col-g7 .col-group-badge { color: #00695C; background: #B2DFDB; }
.col-g7-cell { background: #E0F2F1 !important; }

.col-g13 { background: #F3E5F5 !important; }
.col-g13 .col-group-badge { color: #7B1FA2; background: #E1BEE7; }
.col-g13-cell { background: #F3E5F5 !important; }

.col-g14 { background: #E0F2F1 !important; }
.col-g14 .col-group-badge { color: #00695C; background: #B2DFDB; }
.col-g14-cell { background: #E0F2F1 !important; }
.col-g15 { background: #FFF3E0 !important; }
.col-g15 .col-group-badge { color: #E65100; background: #FFCC80; }
.col-g15-cell { background: #FFF3E0 !important; }

/* G16: 荒管采购 */
.col-g16 { background: #E8EAF6 !important; }
.col-g16 .col-group-badge { color: #283593; background: #C5CAE9; }
.col-g16-cell { background: #E8EAF6 !important; }

/* G17: 成品采购 */
.col-g17 { background: #FCE4EC !important; }
.col-g17 .col-group-badge { color: #AD1457; background: #F48FB1; }
.col-g17-cell { background: #FCE4EC !important; }

/* G18: 库存使用 */
.col-g18 { background: #E0F7FA !important; }
.col-g18 .col-group-badge { color: #00695C; background: #80DEEA; }
.col-g18-cell { background: #E0F7FA !important; }

/* ============================================================
   WorkOrderExecution 分组底色统一（仅本页生效）
   - 实时关注（组 3，整体汇整）：粉色系（突出总览，置于明细之前）
   - 用料计划及执行实况（组 4~12）：绿色系（4 为 5~12 的汇整，同色）
   - 实际生产总流转（组 13~15）：琥珀色系（13 为 14~15 的汇整；14 原始投料有效流转 / 15 返整执行）
   - 次品总量（组 16）：红色系（次品/缺陷语义，与 13~15 区分）
   - 成品入库（组 17）：蓝色系
   作用域限定 #workorder-execution-list-table，不影响其他页面
   ============================================================ */
#workorder-execution-list-table .col-g3 { background: #FCE4EC !important; }
#workorder-execution-list-table .col-g3 .col-group-badge { color: #AD1457; background: #F48FB1; }
#workorder-execution-list-table .col-g3-cell { background: #FCE4EC !important; }
#workorder-execution-list-table .col-g4 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g4 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g4-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g5 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g5 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g5-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g6 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g6 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g6-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g7 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g7 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g7-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g8 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g8 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g8-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g9 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g9 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g9-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g10 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g10 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g10-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g11 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g11 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g11-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g12 { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g12 .col-group-badge { color: #1B5E20; background: #A5D6A7; }
#workorder-execution-list-table .col-g12-cell { background: #E8F5E9 !important; }
#workorder-execution-list-table .col-g13 { background: #FFF8E1 !important; }
#workorder-execution-list-table .col-g13 .col-group-badge { color: #F57F17; background: #FFECB3; }
#workorder-execution-list-table .col-g13-cell { background: #FFF8E1 !important; }
#workorder-execution-list-table .col-g14 { background: #FFF8E1 !important; }
#workorder-execution-list-table .col-g14 .col-group-badge { color: #F57F17; background: #FFECB3; }
#workorder-execution-list-table .col-g14-cell { background: #FFF8E1 !important; }
#workorder-execution-list-table .col-g15 { background: #FFF8E1 !important; }
#workorder-execution-list-table .col-g15 .col-group-badge { color: #F57F17; background: #FFECB3; }
#workorder-execution-list-table .col-g15-cell { background: #FFF8E1 !important; }
#workorder-execution-list-table .col-g16 { background: #FFEBEE !important; }
#workorder-execution-list-table .col-g16 .col-group-badge { color: #C62828; background: #EF9A9A; }
#workorder-execution-list-table .col-g16-cell { background: #FFEBEE !important; }
#workorder-execution-list-table .col-g17 { background: #E8EAF6 !important; }
#workorder-execution-list-table .col-g17 .col-group-badge { color: #283593; background: #C5CAE9; }
#workorder-execution-list-table .col-g17-cell { background: #E8EAF6 !important; }

/* G15 内联编辑控件紧凑样式 */
.compact-select {
    font-size: 0.8rem;
    padding: 0 4px;
    min-height: 28px;
    margin: 0;
}

/* 分组起始列 - 左侧竖线分隔 */
.col-group-start { border-left: 2px solid #BDBDBD !important; }
.col-group-start-cell { border-left: 2px solid #E0E0E0 !important; }

/* ========== 成检到料列表分组（G1=检验到料实体, G2=批次自动填充） ========== */
#material-checks-list-table .col-g1 { background: #F5F9FF !important; }
#material-checks-list-table .col-g1 .col-group-badge { color: #1565C0; background: #BBDEFB; }
#material-checks-list-table .col-g1-cell { background: #F5F9FF !important; }
#material-checks-list-table .col-g2 { background: #F4FAF5 !important; }
#material-checks-list-table .col-g2 .col-group-badge { color: #2E7D32; background: #C8E6C9; }
#material-checks-list-table .col-g2-cell { background: #F4FAF5 !important; }

/* 页脚汇总行样式 */
.col-footer-cell {
    border-top: 2px solid #BDBDBD !important;
    font-weight: 600 !important;
    background: #FAFAFA !important;
}
.col-footer-sum {
    color: #1565C0;
    white-space: nowrap;
    font-size: 0.8125rem;
}

/* 工单执行状况 - 全部数据居中显示 */
#workorder-execution-list-table .mud-table-cell {
    text-align: center !important;
}
#workorder-execution-list-table .col-header-cell {
    justify-content: center;
}

/* ============================================================
   批次新建页面 - 上下结构表单样式
   ============================================================ */

.batch-create-table {
    width: 100%;
}

.batch-create-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    padding: 4px 8px 2px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    white-space: nowrap;
}

.batch-create-table tbody td {
    padding: 2px 8px 6px 8px;
    vertical-align: top;
    font-size: 0.875rem;
}

.batch-create-table .mud-input-outlined .mud-input-outlined-border {
    border-color: transparent !important;
    transition: border-color 0.2s ease;
}

.batch-create-table .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.batch-create-table .mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: transparent !important;
}

/* batch-create-table 用 box-shadow 替代边框作为焦点指示，与表格内联编辑一致 */
.batch-create-table .mud-input-outlined:focus-within {
    box-shadow: inset 0 0 0 1px var(--mud-palette-primary) !important;
}

/* ============================================================
   状态标签（MudChip）统一字体尺寸
   所有 Size="Size.Small" 的 MudChip 统一为 0.875rem（与表格文字一致）
   ============================================================ */

.mud-chip.mud-chip-size-small {
    font-size: 0.875rem !important;
}

/* 用料计划状态"超量"：深色底白字 Chip */
.chip-dark {
    background-color: #37474f !important;
    color: #fff !important;
    font-weight: 500;
}

/* 批次表格内禁止 MudNumericField 箭头 (MudTextField 替代方案) */
.batch-create-table input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.batch-create-table input[type="number"]::-webkit-inner-spin-button,
.batch-create-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* ============================================================
   单行表单规范全局样式
   ============================================================ */

/* 输入框文字使用默认色，禁止浅色弱化 */
.auto-table input,
.auto-table .mud-input input {
    color: var(--mud-palette-text-primary) !important;
}

/* 表格行内编辑紧凑输入框 */
.compact-input {
    min-width: 0 !important;
    max-width: 130px !important;
}
.compact-input .mud-input.mud-input-text {
    font-size: 0.75rem !important;
    margin-top: 0 !important;
}
.compact-input .mud-input-outlined-border {
    border-width: 1px !important;
}

/* 必填字段红色星号标记（用于表头） */
.required-star {
    color: var(--mud-palette-error);
    font-weight: bold;
    margin-left: 1px;
}

/* 卡片标题与内容间距缩短 */
.compact-card.mud-card .mud-card-header {
    padding-bottom: 4px;
}

.compact-card.mud-card .mud-card-content {
    padding-top: 0;
}

/* 确保表头不裁剪筛选弹窗 */
.mud-table-head {
    overflow: visible;
}

/* ============================================================
   移动端响应式样式 — 叠加在桌面样式之上
   ============================================================ */
@media (max-width: 960px) {
    /* 表格横向滚动 */
    .mud-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 触摸目标 44px 规范 */
    .mud-button-root,
    .mud-icon-button {
        min-height: 44px !important;
    }

    /* 卡片边距调整 */
    .mud-card {
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid #e0e0e0;
    }

    /* 容器全宽 */
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

@media (max-width: 600px) {
    /* 小屏表格字体缩小 */
    .mud-table .mud-table-cell {
        font-size: 0.75rem !important;
        padding: 2px 4px !important;
    }
}

/* ============================================================
   全站手机壳（mh-shell）— 手机竖屏下所有非首页页面的统一收敛
   ------------------------------------------------------------
   背景：全仓 160+ 页面在手机上渲染的都是同一套桌面布局（只有首页有 IsMobile 手机分支），
   竖屏表现为「页头按钮挤成一团 / 筛选工具栏控件平铺溢出 / 宽表只能左右拖 / 内容贴边」。
   2026-09-14 用户拍板「竖屏也要可用」（放宽 2026-09-06「除首页+扫码流外一律横屏查看」），
   故用一层全局 CSS 统一收敛，**不动 160+ 个页面结构**。
   （例外：同日为关掉 MudTable 的手机端竖排「列名—值」布局，各列表页 `<MudTable>` 逐个加了
     `Breakpoint="Breakpoint.None"` 参数 —— 见下面第 4 组注释；那只是加参数、不改页面结构。）

   ⚠️ 钩子是 MobileLayout 里真实渲染出的 `<div class="mh-shell">`，不是「祖先容器 + 后代
      选择器」的推断链 —— 2026-09-14 真机样式失效的根因正是钩子挂 `.mh-container` 未命中
      （F12 模拟命中、真机不命中，整批规则静默回落桌面值）。
   ⚠️ 只有 MobileLayout 渲染的页面带这个类，桌面版（MainLayout）零影响。
   ⚠️ 本文件由 nginx `location /css/` 下发 max-age=1 年 immutable —— 改完必须同提交抬
      index.html 的 `css/app.css?v=` 串，否则真机一年内不重取（见 index.html 顶部注释）。
   ============================================================ */

/* ---- 1. 页头按钮组：标题占一行、按钮组独占下一行并换行左对齐 ---- */
.mh-shell .mud-card-header {
    flex-wrap: wrap;
    padding: 10px 12px;
    row-gap: 8px;
}

.mh-shell .mud-card-header .mud-card-header-actions {
    width: 100%;
    margin: 0;
    align-self: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mh-shell .mud-card-header-actions .mud-button-root {
    flex: 0 0 auto;
}

/* ---- 2. 筛选工具栏 / 表单：MudGrid 子项逐行全宽堆叠 ---- */
/* MudGrid 是 flex 容器（不是 CSS grid），列宽由 `.mud-grid-item-{断点}-{n}` 类的
   flex-basis / max-width 百分比决定 → 窄屏一律覆盖为 100%，即逐行堆叠。 */
.mh-shell .mud-grid > .mud-grid-item {
    flex-basis: 100% !important;
    max-width: 100% !important;
}

/* 横屏放宽（2026-09-14）：删除 ResponsiveLayout 的「横屏例外」后，手机横屏（innerWidth 700~932）
   也走手机壳，而横屏的可用高度通常不足 400px —— 筛选网格若仍逐行全宽，光筛选区就能占满整屏。
   故横屏时把**含输入控件**的网格项放宽为每行 2 列（800px 屏 → 每项约 400px，够放一个输入框）。
   ⚠️ 只匹配 `:has(.mud-input-control)`：全仓 454 个 MudItem 中 426 个是 `xs="12"` 的内容块
      （表格 / 卡片 / 进度树），一律改 50% 会把它们也压成半宽 → 故仅让表单字段配对，内容块保持整宽。
   ⚠️ 特异性 (0,4,0)（`:has()` 计入内部选择器）压过上面第 2 组的 (0,3,0)，与书写顺序无关。
   ⚠️ 不支持 `:has()` 的旧 WebView 会整条丢弃本规则 → 静默回落「逐行全宽」（即第 2 组行为），不报错。 */
@media (orientation: landscape) {
    .mh-shell .mud-grid > .mud-grid-item:has(.mud-input-control) {
        flex-basis: 50% !important;
        max-width: 50% !important;
    }
}

/* 行内工具栏（d-flex + 多个控件 / MudSpacer）允许换行，避免按钮被挤出屏幕 */
.mh-shell .d-flex {
    flex-wrap: wrap;
    row-gap: 6px;
}

/* ---- 3. 留白与密度：恢复卡片观感、收紧内边距 ---- */
.mh-shell .mud-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 8px !important;
}

.mh-shell .mud-card-content {
    padding: 10px 12px;
}

.mh-shell .mud-card-actions {
    padding: 6px 12px;
}

/* ---- 4. 宽表：粘性表头（不冻结任何列） ---- */
/* 背景（2026-09-14 用户拍板）：行主体是宽表时「只要能够看」，接受大量左右移动，因此不隐藏任何列。
   ⚠️ 2026-09-14 V138 再拍板：**不冻结任何列**（原「粘性首列 + 勾选框场景粘第 2 列」已删除，
      手机端横向拖动时列随内容一起走）——只保留**粘性表头**（解决纵向滚动时不知看的是哪一列）。
   ⚠️⚠️ 前置条件（2026-09-14 二次拍板补，是本组规则能否生效的前提）：
      MudTable 的 `Breakpoint` **默认 = Breakpoint.Xs**（MudBlazor 6.19 `MudTableBase.cs`），
      窄于 Xs 断点（即手机竖屏）时外层 div 会带 `mud-xs-table` 类，而 MudBlazor.min.css 的
      `@media(max-width:600px)` 下：
        .mud-xs-table .mud-table-root .mud-table-head { display:none }        ← 表头整条隐藏
        .mud-xs-table .mud-table-cell { display:flex; justify-content:space-between; … }
        .mud-xs-table .mud-table-cell:before { content:attr(data-label); … }  ← 每格前面补列名
      → 手机竖屏下每**一条记录**会被拆成「列名 — 值」的 N 行竖排（仓库 20 列 = 20 行），
        表头消失，本组 sticky 规则全部落空（无 thead 可粘）。
      **修法 = 各列表页 `<MudTable>` 显式加 `Breakpoint="Breakpoint.None"`**（>600px 本就不堆叠，
      故对桌面/横屏零影响）；全仓已按此批改列表型页面（2026-09-14，共 127 处，
      含 ServerData/分页的主列表页与只读展示表；**编辑型表（`edit-table`）与出库操作表有意保留堆叠**，
      手机端「列名—值」竖排反而利于录入）。
   ⚠️ 横向滚动本身是既定机制、无需新增：`.mud-table-container{overflow-x:auto!important}`（§6.29）
      + `table-layout:auto`（MudBlazor 6.19 全文未声明 table-layout；app.css 第 137 行那条
      `.mud-table{table-layout:fixed}` 作用在 MudBlazor 的**外层 div**（该 div 有 background-color/
      border-radius）上，对 <table> 无效，是死规则）→ 列不会被压缩、文字不会被省略号吃掉。 */
@media screen {
    /* 表头 sticky 需要一个「有界高度 + 纵向可滚」的容器，否则页面滚动会把表头带走
       （overflow-x:auto 已使 overflow-y 计算为 auto，但不限高就没有纵向滚动量）。
       高度取「视口 - 顶栏 64px - 页头/筛选余量 76px」，下限 260px 防小屏被压没；
       第二行为 dvh 版本（移动端动态工具栏下 100vh 会大于可见高度），不支持的浏览器自动沿用上一行。 */
    .mh-shell .mud-table-container {
        overflow-x: auto !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain; /* 横滑到边界不带动页面/浏览器返回手势 */
        max-height: max(260px, calc(100vh - 140px));
        max-height: max(260px, calc(100dvh - 140px));
    }

    /* 全仓无任何规则给 .mud-table-root 设 border-collapse，浏览器默认即 separate
       （MudBlazor 只声明了 border-spacing:0），此处显式声明以防被未来样式改成 collapse：
       collapse 下粘性单元格自己的底边框不随固定元素一起绘制（表头底线会消失）。 */
    .mh-shell .mud-table-root {
        border-collapse: separate;
        border-spacing: 0;
    }

    /* 只让表头「最后一行」sticky：两行分组表头（col-g1/col-g2）时保留带列名的那一行，
       且避免两行都钉在 top:0 互相重叠。普通单行表头 last == 唯一行，行为一致。 */
    .mh-shell .mud-table-head tr:last-child th {
        position: sticky;
        top: 0;
        z-index: 5;
        background-color: var(--mud-palette-surface, #fff);
    }

    /* ⚠️ 不冻结任何列（2026-09-14 V138 用户拍板）——原「首列 sticky（left:0）」与
       「首列是批量勾选框时把第 2 列也粘住（left:40px）」两条规则**已删除**。
       用户原话：「移动时没必要冻住字段。例如：仓库的列表中，现在是仓库的批次号冻住的。
       其它的所有列表，在手机端也是如此，没必要冻住任何一列或几列。」
       故手机端横向拖动时**列随内容一起走**，只有表头（纵向）保持 sticky。
       ⚠️ 若将来要恢复列冻结，记得同步恢复 `border-collapse: separate`（上方已保留，
          它是为表头 sticky 而设，与列冻结无关）。 */
}

/* ---- 5. 列表页工具栏（.list-toolbar，56 页共用）：窄屏允许换行 ---- */
/* 结构为「左：列显隐 + 重置 / 右：打印 + 计数」，右侧靠 margin-left:auto 顶到行尾；
   窄屏若不许换行会把控件挤扁或溢出，故允许换行（换行后右组仍靠右）。 */
.mh-shell .list-toolbar {
    flex-wrap: wrap;
    row-gap: 6px;
}

/* ---- 6. 工资结算密集网格（考勤 / 津贴处罚 / 月工资 / 月工资津贴汇总，4 页）：手机端同样不冻结任何列 ---- */
/* 2026-09-14 V139 用户拍板「一并去掉」。这 4 页的 `.sticky-left`（工号/姓名/岗位类别/岗位）
   与 `.sticky-right`（出勤天数 / 总小时 / 本月合计）是**页面级显式冻结**（定义在下方「考勤网格」段），
   不属第 4 组的通用表格规则，故此处单独覆盖。
   ⚠️ 覆盖的是 `position:sticky` 与 `left/right`：`.attendance-grid .sticky-left`(0,2,0) 与
      `.attendance-grid .sticky-right`(0,2,0) 被本组 (0,3,0) 压过；`thead th.sticky-left/right`(0,3,1)
      只声明 z-index，static 后 z-index 不适用、无需覆盖。表头 `thead th{position:sticky;top:0}` 不受影响
      （那是**纵向**冻结，仍保留）。
   ⚠️ **仅限手机壳内**：桌面 1920px 下「岗位 4 列 + 31 天 + 合计 2 列」约 1900px 仍会横向滚动，
      冻结仍有价值 → 桌面 `MainLayout` 不带 `.mh-shell`，故桌面行为不变。 */
.mh-shell .attendance-grid .sticky-left,
.mh-shell .attendance-grid .sticky-right {
    position: static;
    left: auto;
    right: auto;
    z-index: auto;
}

/* 同上第 6 组：**「月工资津贴汇总」（MonthlySummary）手机端放开横向滚动**。
   该页额外带 `.monthly-summary-grid`，把基类的 `min-width:max-content` 覆盖成
   `width:100%; min-width:0; table-layout:fixed`（设计目标＝桌面 18 列 ≈1478px 在 1900px 容器内
   正好放得下、整表免横滚）。但手机 360px 下 fixed + 100% 会把 18 列**等比压到屏宽**（每列约 20px），
   既看不清也不会横滚 → 手机壳内改回「列按内容撑开 + 横向滚动」，与其它 3 页口径一致。
   ⚠️ 特异性 (0,3,0) 压过原 `.attendance-grid.monthly-summary-grid` (0,2,0)。
   ⚠️ 仅限手机壳内；桌面无 `.mh-shell` → 维持「免横滚」原状。 */
.mh-shell .attendance-grid.monthly-summary-grid {
    width: auto;
    min-width: max-content;
    table-layout: auto;
}

/* 移动端导航分组样式 */
.mobile-nav-group .mud-expand-panel-header {
    padding: 12px 16px !important;
    border-bottom: 1px solid #333;
}

.mobile-nav-group .mud-expand-panel-content {
    background-color: #16213e;
}

/* ============================================================
   扫码摄像头全屏覆盖
   ============================================================ */
.camera-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    flex-direction: column;
}

.camera-video {
    flex: 1;
    width: 100%;
    object-fit: cover;
    background: #000;
}

.camera-footer {
    padding: 16px;
    background: rgba(0, 0, 0, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== 列表页表格横向滚动（B34）========== */
/* compact-table: width:max-content + table-layout:fixed
   - 列宽总和 ≤ 视口 → 无滚动条，列宽按设定显示
   - 列宽总和 > 视口 → mud-table-container(overflow-x:auto) 自动滚动
   未设宽度的列由内容决定宽度（如操作列按钮）。
   详见 04_开发规范.md §6.29 */

/* ========== 表头语义层级标色（主号级青色 / 订单级橙色）========== */
/* 主号级：单个表头强化——深青底 + 加粗 + 青色粗下边框（单元格不着色，避免与组色块混淆） */
th.col-level-mainno,
#workorder-execution-list-table th.col-level-mainno {
    background: #B2EBF2 !important;
    font-weight: 600 !important;
    border-bottom: 3px solid #00ACC1 !important;
}
th.col-level-order,
#workorder-execution-list-table th.col-level-order { background: #FFE0B2 !important; }

/* ========== 表头高亮（特殊多档判定列，如"到料实投一致性"）========== */
/* 琥珀底 + 加粗 + 深琥珀粗下边框，与内容 Chip（红/橙/蓝/绿/灰）呼应 */
th.col-header-consistency,
#workorder-execution-list-table th.col-header-consistency { background: #FFECB3 !important; font-weight: 700 !important; border-bottom: 3px solid #FFA000 !important; }

/* ========== 操作列整列高亮（G15 执行/预算投料日，原地编辑控件列）========== */
/* 表头靛蓝深底 + 加粗 + 靛蓝粗下边框；单元格淡靛蓝底，覆盖组色块使整列与数据列区分 */
th.col-edit-actions { background: #C5CAE9 !important; font-weight: 700 !important; border-bottom: 3px solid #3F51B5 !important; }
td.col-edit-actions { background: #E8EAF6 !important; }

/* ============================================================
   样式统一语义类（2026-08-20 前端样式统一）
   消灭内联硬编码颜色：卡片/背景/文字/表头统一走语义类
   ============================================================ */

/* 折叠汇总卡：浅底 + 细边框 + 圆角 */
.summary-card {
    background: #FAFBFC;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
}

/* 普通表单卡：细边框 + 圆角 */
.form-card {
    border: 1px solid #E0E0E0;
    border-radius: 8px;
}

/* 扫码/提示卡：蓝左边框 + 浅蓝底 */
.notice-card {
    border-left: 4px solid #1976D2;
    background: #E3F2FD;
}

/* 成功提示卡：绿左边框 + 浅绿底 */
.notice-card-success {
    border-left: 4px solid #4CAF50;
    background: #E8F5E9;
}

/* 蓝左边框卡（无底色） */
.card-accent-left {
    border-left: 4px solid #1976D2;
}

/* 浅蓝背景条 */
.bg-soft-blue {
    background-color: #F0F7FF;
}

/* 浅灰背景 */
.bg-soft-gray {
    background-color: #F5F5F5;
}

/* 极浅灰背景 */
.bg-subtle {
    background-color: #FAFAFA;
}

/* 品牌蓝文字 */
.text-brand {
    color: #1565C0;
}

/* 警示橙文字 */
.text-warning-orange {
    color: #E65100;
}

/* 辅助灰文字（统一 #757575） */
.text-hint {
    color: #757575;
}

/* 链接样文字 */
.text-link {
    color: #1976D2;
    cursor: pointer;
}

/* 小节标题深灰蓝 */
.text-title {
    color: #37474F;
}

/* ============================================================
   报表分类标题（着色 + 左侧 4px 色条）
   物料执行 4 类：荒管(1)/成品(2)/圆钢(3)/供应商往来(4)
   生产执行 5 类：冷轧拔近日排程(1)/段落流转分析(2)/生产量(3)/委外类(4)/委外单位往来(5)
   跨 Tab 复用同色类名无冲突（各 Tab 内仅需互异即可）
   ============================================================ */
.report-tt {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    vertical-align: middle;
}
.report-tt::before {
    content: "";
    width: 4px;
    height: 1.05em;
    border-radius: 2px;
    margin-right: 8px;
    background: currentColor;
    flex-shrink: 0;
}
.report-tt-1 { color: #1976D2; }
.report-tt-2 { color: #43A047; }
.report-tt-3 { color: #8E24AA; }
.report-tt-4 { color: #FB8C00; }
.report-tt-5 { color: #00897B; }

/* 报表往来数据卡：可排序身份列 th（点击排序，无 ▲/▼ 箭头文字） */
.report-th-sort {
    text-align: left;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.report-th-sort.report-th-sorted {
    background: #e3f2fd;
    border-color: #90caf9;
    font-weight: 700;
}

/* ============================================================
   考勤表（月视图网格）
   ============================================================ */

.attendance-scroll {
    /* 考勤表竖向+横向滚动都发生在该容器内，sticky 表头才能相对容器锁定 */
    overflow: auto;
    max-height: calc(100vh - 200px);
}

.attendance-grid {
    border-collapse: collapse;
    min-width: max-content;
    font-size: 0.875rem;
}

.attendance-grid th,
.attendance-grid td {
    border: 1px solid #E0E0E0;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
}

.attendance-grid thead th {
    background: #E3F2FD;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.attendance-grid .sticky-left {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    min-width: 56px;
}

.attendance-grid .sticky-right {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 1;
    min-width: 64px;
    font-weight: 600;
}

.attendance-grid thead th.sticky-left,
.attendance-grid thead th.sticky-right {
    z-index: 3;
}

.attendance-grid .attendance-day {
    min-width: 44px;
    color: #546E7A;
}

.attendance-grid .attendance-cell-td {
    padding: 0;
}

/* 考勤格子原生输入框（替代 MudNumericField，密集网格性能优化） */
.attendance-grid .attendance-cell-input {
    width: 44px;
    min-width: 44px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 4px 0;
    box-sizing: border-box;
}

.attendance-grid .attendance-cell-input:hover {
    background: #F5F5F5;
}

.attendance-grid .attendance-cell-input:focus {
    outline: 2px solid #2196F3;
    outline-offset: -1px;
    background: #fff;
}

.attendance-grid .attendance-total-td {
    background: #F5F5F5;
}

.attendance-grid .attendance-foot td {
    background: #ECEFF1;
    font-weight: 600;
    color: #37474F;
}

/* 「津贴与处罚」月度网格：已停用员工的当月历史行灰显（仍可编辑） */
.attendance-grid tr.allowance-inactive-row {
    background-color: #FAFAFA;
}

.attendance-grid tr.allowance-inactive-row td.sticky-left {
    color: #9E9E9E;
}

/* 「月工资津贴汇总」只读汇总网格：压缩列宽整表免横向滚动
   （列宽由 thead th 行内 style 定义 + fixed 布局撑满容器；金额列表头允许多行换行） */
.attendance-grid.monthly-summary-grid {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.8125rem;
}
.monthly-summary-grid th,
.monthly-summary-grid td {
    padding: 2px 3px;
}
.monthly-summary-grid thead th {
    white-space: normal;
    line-height: 1.2;
    vertical-align: middle;
}
.monthly-summary-grid thead th.sticky-left {
    white-space: nowrap;
}
.monthly-summary-grid tfoot td {
    padding: 3px;
}

/* 考勤表头可点击排序（工号/姓名/岗位类别/岗位） */
.attendance-grid .sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.attendance-grid .sortable-th:hover {
    background: #E3F2FD;
}

/* 表格表头蓝底 */
.table-head-blue {
    background: #E3F2FD;
}

/* ===== 生产计件类别编辑页：维度档分区块 ===== */
.dim-block {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 12px;
    background: #fff;
}

.dim-block-warning {
    border-color: #f44336;
    background: #fff8f8;
}

.dim-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.tier-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.tier-editor-row:first-of-type {
    border-top: none;
}

.dim-ratio-input {
    width: 110px;
    flex: none;
}

.dim-hint {
    flex: none;
    max-width: 120px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-all;
}

/* ============================================================
   首页看板（Index.razor 桌面/手机两分支共用）
   常用入口磁贴 + 订单负荷阶段药丸
   ============================================================ */

/* 桌面端两卡：上下堆叠，各占约半屏宽并水平居中（2026-09-14 由左右等宽 md=6 改为上下） */
.home-stack {
    gap: 16px;
}

.home-stack-card {
    width: 50%;
    margin: 0 auto;
}

/* ⚠️ 窄屏兜底（2026-09-14）：`.home-stack-card` 的 50% 是桌面版布局值，一旦**真机被判成桌面布局**
   （横屏 innerWidth≥700 回落电脑版、或国产浏览器「电脑模式」剥掉 UA/触屏特征），卡片就只剩半屏宽、
   磁贴被压成 2 列 —— 用户实测「手机端比 F12 模拟挤」的主因之一。此处按与 ResponsiveLayout
   判定阈值一致的 960px 收口：窄屏一律整宽，与手机分支观感对齐。 */
@media (max-width: 959px) {
    .home-stack-card {
        width: 100%;
    }
}

/* ---- 首页「订单进度查询 / 生产批次进度查询」卡（2026-09-14）----
   查询条（输入框 + 查询按钮）+ 卡内结果区。结果区限高纵向滚动：两卡内容（四层进度树 / 工段流程图）
   高度不可控，不限高会把首页撑得很长；手机端卡本就随页面纵向滚动，故不放限高。
   ⚠️ 本文件由 nginx `location /css/` 下发 max-age=1 年 immutable —— 改完必须同提交抬
      index.html 的 `css/app.css?v=` 串，否则老浏览器一年内不重取（见 index.html 顶部注释）。 */
.home-query-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* 输入框吃满剩余宽度（min-width:0 防 flex 子项被内容撑破）；手机端改纵向排列后无剩余空间，不会误拉伸高度 */
.home-query-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* 「查询 / 清除」成组，手机端纵向排列时两按钮仍并排，不被逐个撑满整行 */
.home-query-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-query-result {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

/* 手机端查询卡：钩子同样用卡自身的 `.mh-card`（不依赖 `.mh-container` 祖先，理由见下方手机看板段） */
.mh-card .home-query-bar {
    flex-direction: column;
    align-items: stretch;
}

.mh-card .home-query-actions {
    justify-content: flex-end;
}

.mh-card .home-query-result {
    max-height: none;
    padding-right: 0;
}

/* 常用入口：等宽磁贴自动换行（图标 + 名称），比原文字按钮横排更整齐、更易点 */
.shortcut-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shortcut-tile {
    flex: 1 1 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    text-decoration: none;
    color: #37474F;
    font-size: 16px;   /* 2026-09-14：桌面端放大 1 号（14 → 16），手机端另在下方收小 */
    font-weight: 500;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.shortcut-tile:hover {
    border-color: #1976D2;
    background-color: #F5F9FF;
    color: #0D47A1;
}

/* ============================================================
   首页手机看板（mh-*，仅 Index.razor 的 IsMobile 手机分支使用；
   桌面端首页不引用这些类，颜色归口本文件、不内联硬编码）
   ============================================================ */

/* 手机容器：与 64px AppBar 紧凑衔接，取消大上边距 */
.mh-container {
    padding-top: 0;
    padding-bottom: 16px;
}

/* 看板块卡：白底 + 细边 + 圆角（手机上去掉桌面大纸卡的粗放观感） */
.mh-card {
    border: 1px solid #ECEFF1;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 10px;
    overflow: hidden;
}
.mh-card:last-child {
    margin-bottom: 0;
}

/* ---- 常用入口：手机窄屏下收成三列紧凑磁贴，桌面磁贴样式不变 ----
   ⚠️ 钩子用 `.mh-card`（组件自身 Class）而**不是** `.mh-container` 祖先：2026-09-14 用户实测，
   真机上 `.mh-container .shortcut-tile` 未命中 → 落到桌面回退值 `flex: 1 1 160px` → 窄屏只挤 2 列
   （F12 模拟恰好命中，故「看模拟是三列、真机不是」）。挂到卡自身的类上，链路不再依赖容器祖先。 */
.mh-card .shortcut-grid {
    gap: 6px;
}

/* 手机磁贴改「图标在上、文字在下」：每格宽度只有 ~80-95px，图标与文字同行会让
   「不合格反馈扫码」这类 6 字长名被迫换行；上下结构下文字独占整格宽度，一行放得下。 */
.mh-card .shortcut-tile {
    flex: 1 1 28%;
    flex-direction: column;
    gap: 2px;
    padding: 8px 2px;
    font-size: 12px;
    line-height: 1.2;
}

.mh-card .shortcut-tile span {
    text-align: center;
    word-break: keep-all;   /* 中文长名不逐字断行，整词换行 */
}

/* ============================================================
   横屏提示条（rotate-hint-banner，仅手机端竖屏宽表页顶部显示；
   左边框浅蓝底复用 notice-card，文案色归口本文件）
   ============================================================ */
.rotate-hint-banner {
    margin: 8px 12px 0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #0D47A1;
}

/* ============================================================
   批次执行进度卡片（Shared/BatchProgressCard.razor 共用）
   原为 Pages/Batches/BatchDetail.razor.css 的 scoped 样式，因 Blazor scoped CSS
   无法跨组件复用（会带 [b-xxxx] 属性选择器），上提为全局。
   复用方：① 批次详情页区块三 ② 批次计划/成检计划「生产编号」弹窗(BatchProgressDialog)
   ============================================================ */

/* 空状态/提示文字 */
.detail-empty {
    color: #999 !important;
}

/* 跟踪可视化进度条容器 */
.detail-progress-track {
    width: 200px;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    overflow: hidden;
    flex-shrink: 0;
}

/* 跟踪可视化进度条填充 */
.detail-progress-fill {
    height: 100%;
    background: var(--mud-palette-success);
    border-radius: 4px;
    transition: width 0.3s;
}

/* 跟踪可视化摘要条 */
.detail-summary-bar {
    gap: 4px 20px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* 跟踪可视化当前工段文字 */
.detail-current-section {
    font-weight: 600;
}

/* 跟踪可视化当前工段名称 */
.detail-current-name {
    color: #1976d2;
}

/* 跟踪可视化委外状态 */
.detail-outsource-status {
    color: #e65100;
}

/* 跟踪可视化下一工段 */
.detail-next-section {
    color: #7b1fa2;
}

/* 工段卡片容器——水平滚动 */
.detail-section-scroll {
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 0;
}

/* 工段卡片——工序组容器 */
.detail-group-card {
    display: inline-flex;
    flex-direction: column;
    min-width: 150px;
    margin-right: 14px;
    vertical-align: top;
}

/* 工段卡片——组标题 */
.detail-group-header {
    text-align: center;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 6px 6px 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid #bbdefb;
    border-bottom: none;
}

/* 工段卡片——组计数 */
.detail-group-count {
    font-weight: 400;
    color: #666;
}

/* 工段卡片——工段列表 */
.detail-section-list {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 3px;
}

/* 工段卡片——单个工段 */
.detail-section-item {
    border-radius: 4px;
    margin: 2px 0;
    padding: 4px 6px;
    gap: 6px;
}

/* 工段卡片——工段图标 */
.detail-section-icon {
    font-size: 0.75rem;
    min-width: 18px;
    text-align: center;
}

/* 工段卡片——工段名称 */
.detail-section-name {
    font-size: 0.8125rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 工段卡片——名称+meta 信息竖排区 */
.detail-section-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: normal;
}

/* 工段卡片——meta 明细行（小字） */
.detail-meta-line {
    font-size: 0.65rem;
    line-height: 1.4;
    color: #666;
    white-space: normal;
    word-break: break-all;
}

/* 成品检验组标题——浅绿底与生产组区分 */
.detail-final-header {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

/* 工段卡片——委外套签 */
.detail-outsource-chip {
    font-size: 0.6875rem;
}

/* ============================================================
   可点击单元格链接（列表页把某列文本渲染成"可点开弹窗"的样式）
   用法：@RenderCell 内 <span class="cell-link" title="...">文本</span>
   ============================================================ */
.cell-link {
    cursor: pointer;
    color: #1976d2;
    text-decoration: none;
}

.cell-link:hover {
    text-decoration: underline;
}

/* ============================================================
   问题照片缩略图（不合格反馈 录入/编辑页 与 查看弹窗 共用）
   ============================================================ */
.attachment-thumb {
    position: relative;
    width: 120px;
    height: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
}

.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
}

/* 查看弹窗内缩略图：点击放大 */
.view-thumb {
    cursor: zoom-in;
}
