/* ===== 全屋整装 ERP · 若依风格主题 ===== */
:root {
    --sidebar-bg: #304156;
    --sidebar-sub-bg: #1f2d3d;
    --sidebar-hover: #263445;
    --sidebar-text: #bfcbd9;
    --sidebar-active: #409eff;
    --logo-bg: #2b2f3a;
    --primary: #409eff;
    --success: #67c23a;
    --warning: #e6a23c;
    --danger: #f56c6c;
    --info: #909399;
    --border: #dfe4ed;
    --border-light: #ebeef5;
    --text-main: #303133;
    --text-regular: #606266;
    --text-secondary: #909399;
    --bg-page: #f0f2f5;
    --navbar-h: 50px;
    --sidebar-w: 210px;
    --sidebar-w-collapsed: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-page);
}

body.modal-open { overflow: hidden; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width .25s;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #4a5b70; border-radius: 3px; }

.layout.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.layout.collapsed .logo-text { display: none; }
.layout.collapsed .menu-text,
.layout.collapsed .menu-arrow,
.layout.collapsed .submenu { display: none !important; }
.layout.collapsed .menu-item { justify-content: center; padding: 0; }

.logo {
    height: var(--navbar-h);
    background: var(--logo-bg);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    color: #fff;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}
.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: var(--primary);
    border-radius: 5px;
    font-weight: 700;
    flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 600; letter-spacing: .5px; }

.menu { padding: 6px 0; flex: 1; }
.menu-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 44px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    white-space: nowrap;
}
.menu-group-title:hover { background: var(--sidebar-hover); }
.menu-group.open > .menu-group-title { color: #fff; }
.menu-arrow { margin-left: auto; font-size: 11px; transition: transform .2s; }
.menu-group.open .menu-arrow { transform: rotate(90deg); }
.menu-icon { width: 16px; text-align: center; flex-shrink: 0; }

.submenu { display: none; background: var(--sidebar-sub-bg); }
.menu-group.open .submenu { display: block; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 16px 0 40px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    border-left: 3px solid transparent;
}
.menu-item:hover { background: var(--sidebar-hover); color: #fff; }
.menu-item.active {
    color: var(--sidebar-active);
    background: #1d2b3a;
    border-left-color: var(--sidebar-active);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.navbar {
    height: var(--navbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
}
.navbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hamburger { cursor: pointer; font-size: 18px; color: var(--text-regular); user-select: none; }
.hamburger:hover { color: var(--primary); }
.breadcrumb { color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.breadcrumb .crumb-current { color: var(--text-main); font-weight: 600; }
.navbar-right { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--text-regular); text-decoration: none; font-size: 13px; }
.nav-link:hover { color: var(--primary); }
.nav-user { color: var(--text-regular); font-size: 13px; }

/* ---------- 右上角账号下拉 ---------- */
.nav-user-box { display: flex; align-items: center; }
.user-menu-wrap { position: relative; }
.user-trigger {
    display: flex; align-items: center; gap: 8px;
    background: none; border: 1px solid transparent; border-radius: 4px;
    padding: 3px 8px; cursor: pointer; font: inherit; color: var(--text-regular);
    transition: background .15s, border-color .15s;
}
.user-trigger:hover, .user-trigger[aria-expanded="true"] { background: #f2f6fc; border-color: var(--border-light); }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #409eff, #1f6fd6); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; user-select: none;
}
.user-avatar.lg { width: 40px; height: 40px; font-size: 17px; }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; min-width: 0; }
.user-meta b {
    font-size: 13px; font-weight: 600; color: var(--text-main);
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-meta i { font-style: normal; font-size: 11px; color: var(--text-secondary); }
.user-caret { font-size: 11px; color: var(--text-secondary); }
.user-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 3000;
    min-width: 226px; background: #fff; border: 1px solid var(--border-light);
    border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 21, 41, .14);
    display: none; overflow: hidden;
}
.user-menu.open { display: block; animation: userMenuIn .14s ease-out; }
@keyframes userMenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.user-menu-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: #f7f9fc; border-bottom: 1px solid var(--border-light);
}
.user-menu-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-menu-info b { font-size: 14px; color: var(--text-main); }
.user-menu-info span { font-size: 12px; color: var(--text-secondary); }
.user-menu-body, .user-menu-foot { padding: 4px 0; }
.user-menu-foot { border-top: 1px solid var(--border-light); }
.user-menu-item {
    display: flex; align-items: center; gap: 8px; padding: 9px 14px;
    font-size: 13px; color: var(--text-regular); cursor: pointer; text-decoration: none;
}
.user-menu-item:hover { background: #f2f6fc; color: var(--primary); }
.user-menu-item.danger:hover { background: #fef0f0; color: var(--danger); }
.umi-ico { width: 16px; text-align: center; }

.content { flex: 1; overflow: auto; padding: 14px 16px 20px; }
.footer {
    flex-shrink: 0;
    height: 34px;
    line-height: 34px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    background: #fff;
    border-top: 1px solid var(--border-light);
}

/* ---------- 卡片 / 表单 ---------- */
.card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    padding-left: 9px;
    border-left: 3px solid var(--primary);
    margin-bottom: 12px;
}

.form-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.form-item { display: flex; align-items: center; gap: 6px; }
.form-item > label { color: var(--text-regular); white-space: nowrap; font-size: 13px; }
.form-item .req::before { content: "*"; color: var(--danger); margin-right: 2px; }

input[type=text], input[type=number], input[type=date], input[type=password], select, textarea {
    height: 32px;
    line-height: 32px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    background: #fff;
    transition: border-color .2s;
}
textarea { height: auto; min-height: 66px; padding: 6px 9px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[readonly] { background: #f5f7fa; color: var(--text-secondary); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text-regular);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all .15s;
}
.btn:hover { color: var(--primary); border-color: #c6e2ff; background: #ecf5ff; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #ebb563; border-color: #ebb563; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-light); border-radius: 4px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.grid th, table.grid td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    white-space: nowrap;
}
table.grid th { background: #f8f8f9; color: var(--text-main); font-weight: 600; }
table.grid tbody tr:hover { background: #f5f7fa; }
table.grid tbody tr.selected { background: #ecf5ff; }
table.grid tbody tr.ctx-target { background: #d9ecff; }
table.grid td .ops { display: flex; gap: 6px; }
.link-btn { color: var(--primary); cursor: pointer; background: none; border: none; padding: 0; font-size: 13px; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.empty-row { text-align: center; color: var(--text-secondary); padding: 34px 0 !important; }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 12px 2px 2px; font-size: 13px; flex-wrap: wrap; }
.pager .total { color: var(--text-regular); margin-right: auto; }
.pager button {
    min-width: 30px; height: 30px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: 3px; background: #fff;
    color: var(--text-regular); cursor: pointer; font-size: 13px; font-family: inherit;
}
.pager button:hover:not([disabled]) { color: var(--primary); border-color: var(--primary); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button[disabled] { opacity: .5; cursor: not-allowed; }
.pager select { height: 30px; line-height: 30px; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 18px; border: 1px solid; }
.tag-primary { color: var(--primary); border-color: #b3d8ff; background: #ecf5ff; }
.tag-success { color: var(--success); border-color: #c2e7b0; background: #f0f9eb; }
.tag-warning { color: var(--warning); border-color: #f5dab1; background: #fdf6ec; }
.tag-danger { color: var(--danger); border-color: #fbc4c4; background: #fef0f0; }
.tag-info { color: var(--info); border-color: #d3d4d6; background: #f4f4f5; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 2000; padding: 60px 16px 30px; overflow: auto;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff; border-radius: 5px; width: 720px; max-width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .2); display: flex; flex-direction: column;
    animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { width: 940px; }
.modal.narrow { width: 520px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
    border: none; background: none; font-size: 22px; line-height: 1;
    color: var(--text-secondary); cursor: pointer; padding: 0 4px; font-family: inherit;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 18px; max-height: 66vh; overflow: auto; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--border-light);
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .span2 { grid-column: span 2; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field > label { color: var(--text-regular); font-size: 13px; }
.form-field > label .star { color: var(--danger); margin-right: 2px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; }
.form-hint { color: var(--text-secondary); font-size: 12px; }
.ini-pick {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #f4f8ff; border: 1px dashed #b3d8ff; border-radius: 4px;
    padding: 8px 12px; grid-column: span 2;
}
.ini-pick .ini-hint { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.section-title {
    grid-column: span 2; font-size: 13px; font-weight: 700; color: var(--text-main);
    border-left: 3px solid var(--primary); padding-left: 8px; margin-top: 4px;
}

/* ---------- 上传 ---------- */
.uploader { border: 1px dashed var(--border); border-radius: 4px; padding: 8px; background: #fafcff; }
.uploader .file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.uploader .file-list:empty { margin-bottom: 0; }
.file-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #ecf5ff; border: 1px solid #b3d8ff; color: #409eff;
    border-radius: 3px; padding: 2px 7px; font-size: 12px; max-width: 100%;
}
.file-chip .fname { color: #409eff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.file-chip .fop { color: var(--primary); cursor: pointer; text-decoration: none; white-space: nowrap; border-left: 1px solid #b3d8ff; padding-left: 6px; }
.file-chip .fop:hover { text-decoration: underline; }
.file-chip .rm { cursor: pointer; color: var(--danger); font-weight: 700; }
.upload-btn { font-size: 12px; height: 28px; padding: 0 10px; }
.uploader-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb {
    width: 84px; height: 84px; border: 1px solid var(--border); border-radius: 4px;
    overflow: hidden; position: relative; background: #f5f7fa; cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm {
    position: absolute; top: 0; right: 0; background: rgba(245, 108, 108, .92);
    color: #fff; width: 18px; height: 18px; line-height: 18px; text-align: center;
    font-size: 12px; cursor: pointer;
}
.thumb .dl {
    position: absolute; left: 0; bottom: 0; background: rgba(64, 158, 255, .92);
    color: #fff; width: 18px; height: 18px; line-height: 18px; text-align: center;
    font-size: 12px; cursor: pointer;
}
.thumb .dl:hover { background: rgba(64, 158, 255, 1); }
.mat-thumb {
    width: 100%; height: 130px; border-radius: 4px; overflow: hidden; background: #f5f7fa;
    display: flex; align-items: center; justify-content: center;
}
.mat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mat-thumb .ph { color: #c0c4cc; font-size: 12px; }

/* ---------- Toast ---------- */
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 4000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
    padding: 9px 18px; border-radius: 4px; font-size: 13px; box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
    background: #fff; border: 1px solid var(--border-light); animation: toastIn .2s;
    max-width: 70vw;
}
.toast.success { background: #f0f9eb; border-color: #c2e7b0; color: #529b2e; }
.toast.error { background: #fef0f0; border-color: #fbc4c4; color: #c45656; }
.toast.warn { background: #fdf6ec; border-color: #f5dab1; color: #b88230; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat-card {
    background: #fff; border-radius: 4px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    border-left: 3px solid var(--primary); cursor: pointer; transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.stat-card .num { font-size: 22px; font-weight: 700; color: var(--text-main); }
.stat-card .lab { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ---------- 标签预览 ---------- */
.label-preview {
    background: #eef1f6; padding: 16px; border-radius: 4px; text-align: center; overflow: auto;
}
.label-preview img { max-width: 100%; border: 1px solid var(--border); background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.label-preview .cap { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

.split-box { border: 1px solid var(--border-light); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.split-box .hd { background: #f8f8f9; padding: 8px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }

.badge-count { display: inline-block; min-width: 18px; padding: 0 5px; height: 18px; line-height: 18px; text-align: center; background: var(--primary); color: #fff; border-radius: 9px; font-size: 12px; }

.ctx-hint { color: var(--text-secondary); font-size: 12px; }

/* 拆单数据来源提示条 */
.src-box {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 8px 12px; border-radius: 4px; font-size: 13px;
    background: #f4f6f9; border-left: 3px solid #c0c4cc; color: var(--text-secondary);
}
.src-box.ok { background: #f0f9eb; border-left-color: #67c23a; color: #529b2e; }
.src-box.warn { background: #fdf6ec; border-left-color: #e6a23c; color: #b88230; }
.src-box b { color: inherit; }
.src-box .ctx-hint { color: inherit; opacity: .75; }
.src-box .link-btn { margin-left: auto; }
.mono { font-family: Consolas, Monaco, monospace; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt8 { margin-top: 8px; }
.mb8 { margin-bottom: 8px; }

/* ---------- 右键菜单 ---------- */
.ctx-menu {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
    min-width: 150px;
    padding: 4px 0;
    z-index: 3000;
    font-size: 13px;
}
.ctx-item { padding: 7px 14px; cursor: pointer; color: var(--text-regular); white-space: nowrap; }
.ctx-item:hover { background: #ecf5ff; color: var(--primary); }


/* 扫码结果提示（防重复扫码反馈） */
.scan-tip {
    display: inline-block;
    max-width: 620px;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scan-tip.ok { color: #529b2e; background: #f0f9eb; border: 1px solid #c2e7b0; }
.scan-tip.error { color: #c45656; background: #fef0f0; border: 1px solid #fbc4c4; font-weight: 600; }

/* 扫码工作台：三栏（未扫码 / 本包已扫 / 本单已扫） */
.scan-board {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    gap: 12px;
    align-items: stretch;
}
@media (max-width: 1360px) {
    .scan-board { grid-template-columns: 1fr; }
}
.scan-col {
    border: 1px solid #ebeef5;
    border-radius: 4px;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.scan-col-head {
    padding: 7px 10px;
    background: #fafafa;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
}
.scan-col-head .cnt { font-weight: 400; font-size: 12px; color: #909399; }
.scan-col-body { flex: 1 1 auto; max-height: 462px; overflow: auto; }
.scan-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-bottom: 1px dashed #f2f2f2;
    font-size: 12px;
    min-width: 0;
}
.scan-row:last-child { border-bottom: none; }
.scan-row:hover { background: #f5f7fa; }
.scan-row .code {
    font-family: Consolas, Menlo, monospace;
    color: #409eff;
    white-space: nowrap;
    flex: none;
    width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scan-row .nm {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #303133;
}
.scan-row .sp { color: #909399; white-space: nowrap; flex: none; }
.scan-row .box-tag {
    display: inline-block;
    padding: 0 6px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    font-size: 11px;
    background: #ecf5ff;
    color: #409eff;
    border: 1px solid #d9ecff;
    white-space: nowrap;
    flex: none;
}
.scan-row .act { flex: none; }
.scan-group {
    padding: 4px 10px;
    background: #f5f7fa;
    font-size: 12px;
    color: #606266;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #ebeef5;
}
.scan-empty { padding: 22px 10px; text-align: center; color: #909399; font-size: 12px; }
/* 已包装 / 本单已包满的板件：整行灰显，明确不可重复扫码 */
.scan-row.done-row { background: #fafafa; }
.scan-row.done-row .code { color: #a8abb2; }
.scan-row.done-row .nm { color: #a8abb2; }

/* ---------- 左右排列的键值行（标签在左、值在右） ---------- */
.kv-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 32px; }
.kv-row { display: flex; align-items: baseline; min-width: 0; }
.kv-row .k { flex: 0 0 158px; color: var(--text-regular); font-size: 13px; }
.kv-row .v { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-main); word-break: break-all; }
@media (max-width: 900px) { .kv-rows { grid-template-columns: 1fr; } }

/* ============================================================
 *  权限系统：登录界面 / 权限勾选面板 / 账户管理
 * ============================================================ */

/* ---------- 登录界面 ---------- */
.login-mask {
    position: fixed; inset: 0; z-index: 3000; display: none;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #304156 0%, #1f2d3d 60%, #263445 100%);
}
.login-wrap { width: 100%; display: flex; justify-content: center; }
.login-card {
    width: 380px; background: #fff; border-radius: 10px; padding: 30px 32px 26px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .logo-icon {
    width: 42px; height: 42px; border-radius: 8px; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.login-title { font-size: 16px; font-weight: 700; color: var(--text-main); }
.login-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 13px; color: var(--text-regular); margin-bottom: 6px; }
.login-field input {
    width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border);
    border-radius: 4px; font-size: 14px; font-family: inherit; outline: none;
}
.login-field input:focus { border-color: var(--primary); }
.login-row {
    display: flex; align-items: center; gap: 6px; margin: -2px 0 12px;
    font-size: 13px; color: var(--text-regular); user-select: none;
}
.login-row-chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-row input[type=checkbox] {
    width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--primary); flex: none;
}
.login-clear { font-size: 12px; color: var(--primary); cursor: pointer; }
.login-clear:hover { text-decoration: underline; }
.login-row-tip { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-secondary); }
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; line-height: 18px; margin-bottom: 4px; }
.login-btn { width: 100%; height: 38px; font-size: 15px; letter-spacing: 4px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-secondary); line-height: 1.7; text-align: center; }
.login-tip b { color: var(--primary); }
.menu-empty { padding: 16px 14px; font-size: 12px; color: var(--sidebar-text); line-height: 1.8; }

/* ---------- 权限勾选面板 ---------- */
.perm-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.perm-role { font-size: 13px; color: var(--text-regular); }
.perm-stat { font-size: 12px; color: var(--primary); }
.perm-spacer { flex: 1; }
.perm-group { border: 1px solid var(--border-light); border-radius: 6px; margin-bottom: 12px; overflow: hidden; }
.perm-group-title {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px;
    background: #f7f8fa; font-size: 13px; font-weight: 600; color: var(--text-main);
}
.perm-mini {
    font-size: 12px; font-weight: 400; color: var(--primary); cursor: pointer;
    padding: 1px 6px; border: 1px solid #b3d8ff; border-radius: 3px; background: #ecf5ff;
}
.perm-mini:hover { background: #d9ecff; }
.perm-page { padding: 9px 12px; border-top: 1px dashed var(--border-light); }
.perm-page:hover { background: #fafcff; }
.perm-line { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.perm-line input { margin: 0; }
.perm-code { font-size: 11px; color: var(--text-secondary); font-family: Consolas, Monaco, monospace; }
.perm-btns { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 8px 0 0 22px; }
.perm-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; font-size: 12px;
    border: 1px solid var(--border); border-radius: 12px; color: var(--text-regular);
    cursor: pointer; background: #fff; user-select: none;
}
.perm-chip.on { color: var(--primary); border-color: #b3d8ff; background: #ecf5ff; }
.perm-chip input { margin: 0; }

/* ---------- 账户管理 ---------- */
.acct-head {
    padding: 9px 12px; margin-bottom: 14px; border-radius: 4px;
    background: #f7f8fa; font-size: 13px; color: var(--text-regular);
}
.acct-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }

/* ============================================================
 *  标签打印设计（模板设计器）
 * ============================================================ */

.ld-wrap { display: flex; gap: 10px; align-items: flex-start; }
.ld-side { flex: 0 0 252px; width: 252px; padding: 10px 10px 12px; }
.ld-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ld-props { flex: 0 0 322px; width: 322px; padding: 12px; max-height: calc(100vh - 120px); overflow: auto; }

.ld-side-sec { margin-bottom: 12px; }
.ld-side-sec:last-child { margin-bottom: 0; }
.ld-side-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.ld-side-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- 模板列表 ---------- */
.ld-tpl-list { border: 1px solid var(--border-light); border-radius: 4px; max-height: 190px; overflow: auto; }
.ld-tpl { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border-light); }
.ld-tpl:last-child { border-bottom: none; }
.ld-tpl:hover { background: #f5f7fa; }
.ld-tpl.on { background: #ecf5ff; box-shadow: inset 3px 0 0 var(--primary); }
.ld-tpl .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 元素库 ---------- */
.ld-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ld-pal { border: 1px dashed var(--border); border-radius: 4px; padding: 6px 7px; cursor: pointer; background: #fafcff; }
.ld-pal:hover { border-color: var(--primary); background: #ecf5ff; }
.ld-pal b { display: block; font-size: 12px; color: var(--text-main); font-weight: 600; }
.ld-pal span { display: block; font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin-top: 2px; }

/* ---------- 元素列表 ---------- */
.ld-el-list { border: 1px solid var(--border-light); border-radius: 4px; max-height: 260px; overflow: auto; }
.ld-lrow { display: flex; align-items: center; gap: 6px; padding: 4px 7px; font-size: 12px; cursor: pointer; border-bottom: 1px solid var(--border-light); }
.ld-lrow:last-child { border-bottom: none; }
.ld-lrow:hover { background: #f5f7fa; }
.ld-lrow.on { background: #ecf5ff; }
.ld-lrow .ix { width: 16px; color: var(--text-secondary); text-align: right; }
.ld-lrow .ty { color: var(--primary); }
.ld-lrow .sub { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-lrow .ops a { color: var(--primary); cursor: pointer; margin-left: 5px; text-decoration: none; }
.ld-lrow .ops a.danger { color: var(--danger); }

/* ---------- 工具条 ---------- */
.ld-toolbar { padding: 8px 10px; }
.ld-tb-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ld-tb-row + .ld-tb-row { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border-light); }
.ld-tb-label { font-size: 12px; color: var(--text-secondary); }
.ld-in { height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-family: inherit; outline: none; }
.ld-in:focus { border-color: var(--primary); }
.ld-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.ld-zoom { font-size: 12px; color: var(--text-regular); min-width: 40px; text-align: center; }

/* ---------- 画布 ---------- */
.ld-stage-wrap { padding: 16px; display: flex; flex-direction: column; align-items: center; }
.ld-stage { position: relative; background: #fff; box-shadow: 0 0 0 1px #dcdfe6, 0 2px 10px rgba(0, 0, 0, .08); overflow: visible; }
.ld-bg { position: absolute; left: 0; top: 0; pointer-events: none; }
.ld-grid { position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(to right, #eef1f6 1px, transparent 1px), linear-gradient(to bottom, #eef1f6 1px, transparent 1px); }
.ld-els { position: absolute; inset: 0; }
.ld-el { position: absolute; box-sizing: border-box; border: 1px dashed rgba(64, 158, 255, .35); cursor: move; }
.ld-el:hover { border-color: rgba(64, 158, 255, .85); }
.ld-el.sel { border: 1px solid var(--primary); box-shadow: 0 0 0 1px rgba(64, 158, 255, .35); }
.ld-el > * { pointer-events: none; }
.ld-badge { position: absolute; left: -1px; top: -15px; font-size: 10px; line-height: 14px; padding: 0 4px;
    background: var(--primary); color: #fff; border-radius: 2px; display: none; white-space: nowrap; }
.ld-el:hover > .ld-badge, .ld-el.sel > .ld-badge { display: block; }
.ld-h { position: absolute; width: 7px; height: 7px; background: #fff; border: 1px solid var(--primary); display: none; }
.ld-el.sel > .ld-h { display: block; }
.ld-h.dl { left: -4px; top: 50%; margin-top: -3px; cursor: w-resize; }
.ld-h.dr { right: -4px; top: 50%; margin-top: -3px; cursor: e-resize; }
.ld-h.db { left: 50%; bottom: -4px; margin-left: -3px; cursor: s-resize; }
.ld-h.dbr { right: -4px; bottom: -4px; cursor: se-resize; }
.ld-el-text { width: 100%; height: 100%; overflow: hidden; line-height: 1.15; white-space: pre-wrap; }
.ld-gray { color: #787878; }
.ld-el-bar { width: 100%; height: 100%; background: repeating-linear-gradient(90deg, #333 0 2px, #fff 2px 4px, #333 4px 5px, #fff 5px 8px); }
.ld-el-bctext { overflow: hidden; white-space: nowrap; }
.ld-el-table { width: 100%; padding: 0; overflow: hidden; }
.ld-el-th, .ld-el-tr { display: flex; align-items: center; padding: 0 2px; overflow: hidden; }
.ld-el-th { background: #e8ecf1; font-weight: 600; }
.ld-el-th span, .ld-el-tr span { flex: 1 1 auto; overflow: hidden; white-space: nowrap; }
.ld-el-img { width: 100%; height: 100%; object-fit: contain; }
.ld-stage-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px;
    width: 100%; margin-top: 10px; font-size: 12px; color: var(--text-secondary); }
.ld-stage-foot .ld-dirty { color: var(--warning); }
.ld-hint { color: var(--text-secondary); }

/* ---------- 属性面板 ---------- */
.ld-props-title { font-size: 13px; font-weight: 600; color: var(--text-main); padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border-light); }
.ld-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ld-f { margin-bottom: 9px; }
.ld-f > label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.ld-f input[type=text], .ld-f input[type=number], .ld-f select, .ld-f textarea {
    width: 100%; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px;
    font-size: 13px; font-family: inherit; outline: none; }
.ld-f input:focus, .ld-f select:focus, .ld-f textarea:focus { border-color: var(--primary); }
.ld-f textarea { resize: vertical; }
.ld-ck { display: flex !important; align-items: center; gap: 5px; font-size: 13px; color: var(--text-regular);
    height: 30px; margin: 0 !important; }
.ld-ck input { margin: 0; }
.ld-color { display: flex; gap: 6px; align-items: center; }
.ld-color input[type=color] { width: 34px; height: 30px; padding: 1px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.ld-color .ld-hex { flex: 1; }
.ld-note { font-size: 11px; color: var(--text-secondary); line-height: 1.7; background: #f7f8fa;
    border-radius: 4px; padding: 6px 8px; margin-bottom: 9px; }
.ld-cols { border: 1px solid var(--border-light); border-radius: 4px; overflow: hidden; margin-bottom: 9px; }
.ld-cols-head, .ld-cols-row { display: grid; grid-template-columns: 1fr 74px 46px 52px 18px; gap: 4px; align-items: center; padding: 4px 6px; }
.ld-cols-head { background: #f7f8fa; font-size: 11px; color: var(--text-secondary); }
.ld-cols-row { border-top: 1px solid var(--border-light); }
.ld-cols-row input, .ld-cols-row select { height: 24px; padding: 0 4px; border: 1px solid var(--border); border-radius: 3px; font-size: 12px; font-family: inherit; width: 100%; }
.ld-cols-row a.danger { color: var(--danger); cursor: pointer; text-align: center; }
.ld-foot { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.btn-danger-o { color: var(--danger); border-color: #fbc4c4; background: #fef0f0; }
.btn-danger-o:hover { color: var(--danger); border-color: var(--danger); background: #fef0f0; }

@media (max-width: 1400px) {
    .ld-props { flex: 0 0 286px; width: 286px; }
    .ld-side { flex: 0 0 224px; width: 224px; }
}

/* ============================================================
 *  门板下单（主信息 + 子信息 + 五金） / 门板基础库
 * ============================================================ */

.door-sum {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.door-sum-cell {
    flex: 1 1 120px; min-width: 110px; padding: 8px 12px; border-radius: 5px;
    background: #f7f8fa; border: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 3px;
}
.door-sum-cell .k { font-size: 12px; color: var(--text-secondary); }
.door-sum-cell .v { font-size: 15px; font-weight: 600; color: var(--text-main); }
.door-sum-cell.em { background: #fef0f0; border-color: #fbc4c4; }
.door-sum-cell.em .v { color: var(--danger); }

.door-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 8px 10px; margin-bottom: 10px; border-radius: 4px; background: #fafcff;
    border: 1px solid var(--border-light); font-size: 13px; color: var(--text-regular);
}
.door-toolbar .sep { color: var(--border); margin: 0 4px; }
.door-toolbar .toolbar-left { flex-wrap: wrap; }

/* 工艺多选 */
.craft-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.craft-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 12px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer;
    color: var(--text-regular); user-select: none; margin: 0;
}
.craft-chip:hover { border-color: var(--primary); }
.craft-chip.on { color: var(--primary); border-color: #b3d8ff; background: #ecf5ff; }
.craft-chip b { color: #e6a23c; font-weight: 600; }
.craft-chip input { margin: 0; }

/* 颜色色块 */
.color-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-regular); }
.color-chip i {
    width: 14px; height: 14px; border-radius: 3px; border: 1px solid #dcdfe6;
    display: inline-block; vertical-align: -2px;
}

/* ---------- 材料信息页：右侧分类导航栏 ---------- */
.cat-layout {
    display: flex; align-items: flex-start; gap: 12px;
}
.cat-main { flex: 1 1 auto; min-width: 0; }
.cat-nav {
    flex: 0 0 218px; width: 218px; background: #fff; border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 21, 41, .08); position: sticky; top: 12px;
    overflow: hidden; font-size: 13px;
}
.cat-nav-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 12px; font-weight: 600; color: var(--text-main);
    border-bottom: 1px solid var(--border-light); background: #fafcff;
}
.cat-nav-head .cat-nav-total { font-style: normal; font-weight: 400; font-size: 12px; color: var(--text-secondary); }
.cat-nav-body { max-height: 62vh; overflow-y: auto; padding: 6px 0; }
.cat-nav-item {
    display: flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer;
    color: var(--text-regular); line-height: 1.4; border-left: 3px solid transparent;
}
.cat-nav-item:hover { background: #f5f7fa; color: var(--primary); }
.cat-nav-item.on {
    background: #ecf5ff; color: var(--primary); border-left-color: var(--primary); font-weight: 600;
}
.cat-nav-item.sub { padding-left: 30px; font-size: 12.5px; }
.cat-nav-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-nav-count {
    flex: none; font-style: normal; font-size: 11px; color: var(--text-secondary);
    background: var(--bg-page); border-radius: 9px; padding: 1px 7px; line-height: 16px;
}
.cat-nav-item.on .cat-nav-count { background: #d9ecff; color: var(--primary); }
.cat-nav-arrow { flex: none; width: 10px; font-size: 10px; color: var(--text-secondary); }
.cat-nav-foot {
    padding: 9px 12px; border-top: 1px solid var(--border-light); background: #fafcff;
    font-size: 11.5px; color: var(--text-secondary); line-height: 1.7;
}
.cat-filter-tip { color: var(--primary); font-size: 12px; }
@media (max-width: 1100px) {
    .cat-layout { flex-direction: column; }
    .cat-nav { width: 100%; flex: none; position: static; order: -1; }
    .cat-nav-body { max-height: 260px; }
}

/* ---------- 采购管理（供应商 / 采购信息） ---------- */
.pu-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 8px 10px; margin-bottom: 10px; border-radius: 4px; background: #fafcff;
    border: 1px solid var(--border-light); font-size: 13px; color: var(--text-regular);
}
.pu-toolbar .sep { color: var(--border); margin: 0 4px; }
.pu-toolbar .toolbar-left { flex-wrap: wrap; }
.pu-empty-tip {
    padding: 20px; text-align: center; color: var(--text-secondary); font-size: 13px;
    border: 1px dashed var(--border-light); border-radius: 4px; background: #fafafa;
}
.pu-sup-pick { color: var(--text-regular); font-size: 13px; }

/* 采购单表单内嵌明细（手工录入，行内可编辑） */
.pu-items { margin-top: 2px; }
.pu-items-hd {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 10px; margin-bottom: 6px; border-radius: 4px; flex-wrap: wrap;
    background: #f5f8ff; border: 1px solid var(--border-light);
    font-size: 13px; color: var(--text-regular);
}
.pu-items-hd .pu-total { color: #f56c6c; font-size: 14px; }
table.grid.pu-item-edit { font-size: 13px; }
.pu-item-edit th { padding: 6px; white-space: nowrap; }
.pu-item-edit td { padding: 3px 5px; }
.pu-item-edit input, .pu-item-edit select {
    width: 100%; box-sizing: border-box; padding: 3px 5px; font-size: 13px;
    border: 1px solid var(--border-light); border-radius: 3px; background: #fff;
}
.pu-item-edit input:focus, .pu-item-edit select:focus { border-color: var(--primary); outline: none; }
.pu-item-edit td select[data-f="materialName"] { min-width: 200px; }
#puItemMatSel { width: 100%; }
.pu-item-edit .pu-amt { text-align: right; font-weight: 600; color: #f56c6c; white-space: nowrap; }
.pu-items-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.pu-items-tip { color: var(--text-secondary); font-size: 12px; }

/* 报价单表单内嵌明细（复用采购明细样式，名称列可输入 + 候选） */
.qt-item-edit td input[data-f="name"] { min-width: 210px; }
.qt-item-edit .qt-amt { text-align: right; font-weight: 600; color: #f56c6c; white-space: nowrap; }
.qt-item-edit tr[data-plan="1"] td input[data-f="name"] { font-weight: 600; }
.pu-ex-head {
    padding: 10px 12px; margin-bottom: 10px; border-radius: 4px;
    background: #fafcff; border: 1px solid var(--border-light);
}
.pu-ex-head .form-row { margin-bottom: 4px; }

/* 拆单库导入：同步选项与结果汇总 */
.imp-chk { display: flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }
.imp-chk input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; }
.imp-res { display: flex; flex-wrap: wrap; gap: 10px; }
.imp-res-item {
    flex: 1 1 130px; min-width: 118px; padding: 10px 12px; border-radius: 6px;
    background: #f5f8ff; border: 1px solid var(--border-light); text-align: center;
}
.imp-res-item span { display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 4px; }
.imp-res-item b { font-size: 18px; color: var(--primary); }
.imp-warn {
    margin-top: 10px; padding: 8px 10px; border-radius: 4px; font-size: 13px;
    color: #e6a23c; background: #fdf6ec; border: 1px solid #f5dab1;
}

/* 报价管理：表单内联确认条（单弹窗系统下替代 confirmDialog） */
.qt-inline-confirm {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 9px 12px; margin-bottom: 10px; border-radius: 4px;
    background: #fdf6ec; border: 1px solid #f5dab1; color: #e6a23c; font-size: 13px;
}
.qt-inline-confirm > span { flex: 1 1 320px; }
.qt-inline-confirm .btn { padding: 4px 12px; font-size: 13px; }

/* ============================================================
   环节 4/5/6/8/12 新增模块样式（收款 / 排产 / 优化 / 入库 / 发货）
   ============================================================ */

/* 统计卡片行 */
.stat-row {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.stat-row .stat-card { flex: 1 1 200px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: var(--text-main); margin-top: 4px; }
.stat-card .stat-sub { font-size: 12px; color: #a8abb2; margin-top: 4px; }
.stat-card.stat-primary { border-left: 3px solid #409eff; }
.stat-card.stat-success { border-left: 3px solid #67c23a; }
.stat-card.stat-danger { border-left: 3px solid #f56c6c; }

/* 详情键值网格 */
.kv-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 16px; padding: 4px 2px;
}
.kv-item { display: flex; font-size: 13px; line-height: 2; border-bottom: 1px dashed #f0f2f5; }
.kv-item .kv-k { color: var(--text-secondary); width: 92px; flex: 0 0 92px; }
.kv-item .kv-v { color: var(--text-main); flex: 1; word-break: break-all; }

/* 工序进度条 */
.wo-prog { display: flex; align-items: center; gap: 8px; }
.wo-prog-bar {
    flex: 1; height: 8px; background: #ebeef5; border-radius: 4px; overflow: hidden; min-width: 60px;
}
.wo-prog-bar > i { display: block; height: 100%; background: #409eff; transition: width .3s; }
.wo-prog-txt { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* 弹窗内 checkbox 不拉伸 */
.op-chk input[type=checkbox] { width: auto; margin-top: 8px; }

/* 排版图 */
.op-boards { display: flex; flex-wrap: wrap; gap: 14px; }
.op-board { border: 1px solid #ebeef5; border-radius: 4px; padding: 8px; background: #fff; }
.op-board-hd { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.op-svg { display: block; }

/* 入库明细行 */
.si-item-edit td select[data-f="materialId"] { min-width: 190px; }
.si-item-edit .si-cell-spec,
.si-item-edit .si-cell-dims,
.si-item-edit .si-cell-attrs { white-space: nowrap; color: var(--text-secondary); }
.si-item-edit .si-cell-dims { font-variant-numeric: tabular-nums; }
.si-items .pu-items-hd { margin-top: 12px; }
.si-items .pu-items-tip { margin-left: 10px; font-size: 12px; color: var(--text-secondary); }

/* 门板下单 · 引用订单登记信息条 */
.do-ref {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: var(--bg-hover, #fafafa);
}
.do-ref-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: 12px;
    line-height: 1.8;
}
.do-ref-kv { color: var(--text-regular, #606266); white-space: nowrap; }
.do-ref-kv b { color: var(--text-secondary); font-weight: normal; margin-right: 4px; }
.do-ref-empty { color: var(--text-secondary); font-size: 12px; }
.do-ref-ok { color: var(--success); font-size: 12px; font-weight: 600; }
.do-ref-warn { color: var(--warning); font-size: 12px; }
.do-ref .btn { flex: none; }

/* ===== 拆单数据页：点合同号就地展开分类明细 ===== */
.sd-no { color: var(--primary); cursor: pointer; font-weight: 600; }
.sd-no:hover { text-decoration: underline; }
.sd-no-on { color: var(--danger); }
.sd-no-none { color: var(--text-secondary); }
.sd-detail-empty { padding: 0; }
.sd-empty { padding: 18px 12px; text-align: center; color: var(--text-secondary); font-size: 12px; }

.sd-detail-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light); margin-bottom: 12px;
}
.sd-detail-title { font-size: 14px; font-weight: 600; }
.sd-detail-title b { color: var(--primary); }
.sd-detail-mother { margin-left: 10px; font-size: 12px; font-weight: normal; color: var(--text-secondary); }
.sd-detail-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-chip {
    font-size: 12px; color: var(--text-secondary); background: #f5f7fa;
    border-radius: 12px; padding: 3px 10px;
}
.sd-chip b { color: var(--text-main); }
.sd-chip-total { background: #fef0f0; color: var(--danger); font-weight: 600; }
.sd-chip-total b { color: var(--danger); }

.sd-sec { margin-top: 12px; border: 1px solid var(--border-light); border-radius: 4px; overflow: hidden; }
.sd-sec-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 7px 12px; background: #fafbfc; border-bottom: 1px solid var(--border-light);
}
.sd-sec-title { font-size: 13px; font-weight: 600; }
.sd-sec-count { margin-left: 8px; font-size: 12px; font-weight: normal; color: var(--text-secondary); }
.sd-sec-ops .link-btn { font-size: 12px; }

.sd-grp { border-top: 1px dashed var(--border-light); }
.sd-grp:first-child { border-top: none; }
.sd-grp-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 6px 12px; background: #fcfdfe; font-size: 12px;
}
.sd-grp-name { font-weight: 600; color: var(--text-main); }
.sd-grp-sum { color: var(--danger); }

.sd-detail .table-wrap { border: none; border-radius: 0; }
.sd-detail .grid th, .sd-detail .grid td { padding: 6px 8px; font-size: 12px; }
.sd-sum-row td { background: #fafbfc; font-weight: 600; }

/* ============================================================
 *  员工微信绑定（小程序扫码报工免密登录）
 * ============================================================ */

.wx-head {
    padding: 9px 12px; margin-bottom: 12px; border-radius: 4px;
    background: #f7f8fa; font-size: 13px; color: var(--text-regular);
}
.wx-state {
    padding: 8px 12px; margin-bottom: 12px; border-radius: 4px; font-size: 13px;
    background: #fdf6ec; color: #b88230; border: 1px solid #f5dab1;
}
.wx-state-on { background: #f0f9eb; color: #529b2e; border-color: #c2e7b0; }
.wx-qr-box { text-align: center; padding: 6px 0 2px; }
.wx-qr {
    width: 220px; height: 220px; display: block; margin: 0 auto 10px;
    border: 1px solid var(--border-light); border-radius: 6px; background: #fff; padding: 6px;
}
.wx-code { font-size: 13px; color: var(--text-regular); margin-bottom: 6px; }
.wx-code b { letter-spacing: 2px; font-family: Consolas, Monaco, monospace; font-size: 16px; color: var(--primary); }
.wx-tip { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.wx-steps {
    margin-top: 12px; padding: 10px 12px; border-radius: 4px;
    background: #f7f8fa; font-size: 12px; color: var(--text-regular); line-height: 1.9;
}
.wx-steps-title { font-weight: 600; margin-bottom: 2px; color: var(--text-main); }
