:root {
    --wms-primary: #2563eb;
    --wms-primary-dark: #1d4ed8;
    --wms-primary-050: #eff6ff;
    --wms-primary-100: #dbeafe;
    --wms-accent: #0d9488;
    --wms-danger: #dc2626;
    --wms-warn: #ea580c;
    --wms-ok: #16a34a;
    --wms-ink: #1f2937;
    --wms-muted: #6b7280;
    --wms-border: #e5e7eb;
    --wms-bg: #f4f6f9;
}

html, body { height: 100%; margin: 0; font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; background: var(--wms-bg); color: var(--wms-ink); }

/* 统一主色按钮 */
.btn-primary { background: var(--wms-primary); border-color: var(--wms-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--wms-primary-dark); border-color: var(--wms-primary-dark); }
.btn-outline-primary { color: var(--wms-primary); border-color: var(--wms-primary); }
.btn-outline-primary:hover { background: var(--wms-primary); border-color: var(--wms-primary); }
a { color: var(--wms-primary); }

/* ---- shell ---- */
.wms-shell { display: flex; min-height: 100vh; }
.wms-sidebar { width: 220px; background: #1f2937; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.wms-brand { font-size: 1.05rem; font-weight: 700; color: #fff; padding: 18px 16px; border-bottom: 1px solid #374151; }
.wms-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wms-topbar { height: 54px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.wms-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.wms-hamburger { display: none; background: none; border: none; font-size: 1.5rem; color: #374151; cursor: pointer; padding: 2px 8px; line-height: 1; }
.wms-backdrop { display: none; }

/* ---- 桌面端侧栏折叠：点顶栏按钮隐藏/显示左侧导航，内容区全宽 ---- */
.wms-navtoggle { background: none; border: none; font-size: 1.25rem; color: #475569; cursor: pointer; padding: 2px 8px; line-height: 1; border-radius: 8px; }
.wms-navtoggle:hover { background: #f1f5f9; color: #1d4ed8; }
@media (min-width: 769px) {
    .wms-shell.nav-collapsed .wms-sidebar { display: none; }
}
@media (max-width: 768px) {
    /* 移动端用抽屉汉堡，折叠按钮隐藏 */
    .wms-navtoggle { display: none; }
}
.wms-username { color: #374151; font-size: .9rem; }
.wms-content { padding: 20px 24px; flex: 1; overflow: auto; }

/* ---- nav（可折叠一级/二级 + 统一图标）---- */
.wms-nav { padding: 6px 0; }
.wms-nav-group { display: flex; align-items: center; gap: 10px; cursor: pointer; color: #94a3b8; padding: 10px 16px; font-size: .82rem; font-weight: 600; user-select: none; transition: background .12s, color .12s; }
.wms-nav-group:hover { background: #273244; color: #e2e8f0; }
.wms-gico { font-size: 1rem; width: 20px; text-align: center; color: #64d1c9; }
.wms-gtext { flex: 1; letter-spacing: .02em; }
.wms-chev { font-size: .75rem; opacity: .55; transition: transform .18s; }
.wms-nav-group.open .wms-chev { transform: rotate(180deg); }
.wms-nav-sub { padding-bottom: 4px; }
.wms-nav-link { display: flex; align-items: center; gap: 10px; color: #cbd5e1; text-decoration: none; padding: 8px 16px 8px 30px; font-size: .9rem; transition: background .12s, color .12s; }
.wms-nav-link:hover { background: #374151; color: #fff; }
.wms-nav-link.active { background: var(--wms-primary); color: #fff; }
.wms-ico { font-size: .95rem; width: 18px; text-align: center; opacity: .8; }
.wms-nav-link:hover .wms-ico, .wms-nav-link.active .wms-ico { opacity: 1; }

/* ---- 单级模块导航（一级在侧栏，二级进 /module/{key} 图标页）---- */
.wms-nav-top { display: flex; align-items: center; gap: 10px; color: #cbd5e1; text-decoration: none; padding: 11px 16px; font-size: .92rem; font-weight: 500; user-select: none; border-left: 3px solid transparent; transition: background .12s, color .12s; }
.wms-nav-top:hover { background: #273244; color: #fff; }
.wms-nav-top.active { background: var(--wms-primary); color: #fff; border-left-color: #64d1c9; }
.wms-nav-top.active .wms-gico { color: #fff; }

/* ---- 模块启动页：二级功能图标宫格 ---- */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; margin-top: 6px; }
.mod-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px 16px; background: #fff; border: 1px solid var(--wms-border); border-radius: 12px; text-decoration: none; color: #1f2937; transition: box-shadow .15s, transform .15s, border-color .15s; }
.mod-tile:hover { border-color: var(--wms-primary); box-shadow: 0 8px 20px rgba(37,99,235,.12); transform: translateY(-2px); color: var(--wms-primary); }
.mt-ico { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; }
.mt-text { font-size: .88rem; font-weight: 500; text-align: center; }
/* 图标底色循环：同一模块内相邻功能颜色错开，方便肉眼定位 */
.mt-c0 { background: linear-gradient(135deg,#2563eb,#3b82f6); }
.mt-c1 { background: linear-gradient(135deg,#0d9488,#14b8a6); }
.mt-c2 { background: linear-gradient(135deg,#d97706,#f59e0b); }
.mt-c3 { background: linear-gradient(135deg,#7c3aed,#8b5cf6); }
.mt-c4 { background: linear-gradient(135deg,#db2777,#ec4899); }
.mt-c5 { background: linear-gradient(135deg,#475569,#64748b); }

/* ---- 「已打开页面」页签栏：顶栏下独立一行 ---- */
.page-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 6px 12px 0; background: #f8fafc; border-bottom: 1px solid #e5e7eb; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.ptab { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: .84rem; color: #64748b; background: #eef2f7; border: 1px solid #e2e8f0; border-bottom: none; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; user-select: none; transition: background .12s, color .12s; }
.ptab:hover { background: #e2e8f0; color: #1f2937; }
.ptab.active { background: #fff; color: var(--wms-primary); font-weight: 600; border-color: #e5e7eb; position: relative; }
.ptab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #fff; }
.ptab.active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--wms-primary); border-radius: 2px 2px 0 0; }
.ptab-x { font-size: .95rem; opacity: .5; border-radius: 50%; }
.ptab-x:hover { opacity: 1; background: #cbd5e1; color: #dc2626; }
.ptab-pin { font-size: .78rem; color: var(--wms-primary); }

/* ---- 商品详情：图片宫格 + 放大预览 ---- */
.prod-img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.prod-img-cell { position: relative; width: 108px; height: 108px; border: 1px solid var(--wms-border); border-radius: 8px; overflow: hidden; background: #f8fafc; }
.prod-img-cell.is-main { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.prod-img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-main-tag { position: absolute; left: 4px; top: 4px; background: #f59e0b; color: #fff; font-size: .68rem; padding: 1px 6px; border-radius: 4px; }
.img-viewer { position: fixed; inset: 0; z-index: 1400; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; }
.img-viewer > img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.iv-close { position: absolute; top: 18px; right: 22px; background: rgba(255,255,255,.14); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.iv-close:hover { background: rgba(255,255,255,.28); }
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.14); color: #fff; border: none; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.iv-nav:hover { background: rgba(255,255,255,.28); }
.iv-prev { left: 20px; } .iv-next { right: 20px; }
.iv-cap { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #e5e7eb; font-size: .85rem; }

/* ---- 商品页：窄分类栏 + 可折叠树 ---- */
.cat-col { flex: 0 0 200px; max-width: 200px; padding: 0 calc(var(--bs-gutter-x, 1rem) * .5); }
.cat-main { flex: 1 1 0; min-width: 0; padding: 0 calc(var(--bs-gutter-x, 1rem) * .5); }
@media (max-width: 768px) { .cat-col { flex-basis: 100%; max-width: 100%; } }
.tree-caret { display: inline-block; width: 14px; text-align: center; color: #94a3b8; font-size: .7rem; cursor: pointer; }
.tree-caret:hover { color: var(--wms-primary); }
.tree-caret-ph { display: inline-block; width: 14px; }

/* ---- 商品列表右侧图片栏 ---- */
.prod-img-side { flex: 0 0 200px; max-width: 200px; align-self: stretch; }
.pis-main { width: 100%; height: 200px; object-fit: contain; background: #f8fafc; border-radius: 8px; border: 1px solid var(--wms-border); display: block; }
.pis-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pis-thumb { width: 44px; height: 44px; object-fit: contain; background: #f8fafc; border-radius: 6px; border: 1px solid var(--wms-border); cursor: pointer; }
.pis-thumb.is-main { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.pis-thumb:hover { border-color: var(--wms-primary); }
@media (max-width: 992px) { .prod-img-side { display: none; } }

/* ---- 商品列表「字段设置」下拉面板 ---- */
.col-backdrop { position: fixed; inset: 0; z-index: 1040; }
.col-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1041; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px 14px; min-width: 180px; max-height: 60vh; overflow: auto; }
.col-panel .form-check { margin-bottom: 2px; white-space: nowrap; }

/* ---- 数据字典左侧类型分组标题 ---- */
.dict-group-title { font-size: .74rem; font-weight: 600; color: #94a3b8; letter-spacing: .05em; padding: 10px 6px 4px; border-bottom: 1px solid #f1f5f9; margin-bottom: 2px; }
.dict-group-title:first-child { padding-top: 2px; }

/* ---- 页签右键菜单 ---- */
.ctx-backdrop { position: fixed; inset: 0; z-index: 1050; }
.ctx-menu { position: fixed; z-index: 1051; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; min-width: 140px; }
.ctx-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: .86rem; color: #374151; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ctx-item:hover { background: #f1f5f9; color: var(--wms-primary); }
.ctx-item .bi { font-size: .8rem; opacity: .7; }

/* ---- login ---- */
.wms-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1e3a8a,#2563eb); }
.wms-login-card { width: 360px; background: #fff; border-radius: 12px; box-shadow: 0 20px 45px rgba(0,0,0,.25); padding: 32px 28px; }
.wms-login-title { text-align: center; font-size: 1.3rem; font-weight: 700; color: #1f2937; margin-bottom: 6px; }
.wms-login-sub { text-align: center; color: #6b7280; font-size: .85rem; margin-bottom: 22px; }

/* ---- page bits ---- */
.wms-page-title { font-size: 1.25rem; font-weight: 700; color: #1f2937; margin: 0 0 16px; }
.wms-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.card-surface { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.table-sm td, .table-sm th { vertical-align: middle; }
.wms-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1050; }
.wms-modal { width: 520px; max-width: 94vw; background: #fff; border-radius: 10px; box-shadow: 0 20px 45px rgba(0,0,0,.3); max-height: 92vh; overflow: auto; }
.wms-modal-head { padding: 14px 18px; border-bottom: 1px solid #eee; font-weight: 700; }
.wms-modal-body { padding: 18px; }
.wms-modal-foot { padding: 12px 18px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; }

/* ---- dashboard KPI ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.kpi:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.kpi-num { font-size: 1.7rem; font-weight: 700; color: var(--wms-ink); line-height: 1.1; }
.kpi-label { color: var(--wms-muted); font-size: .85rem; margin-top: 4px; }
.kpi-warn .kpi-num { color: var(--wms-danger); }

/* 带图标的 KPI 卡（首页） */
.kpi-ico { display: flex; align-items: center; gap: 12px; }
.kpi-ico-badge { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.kpi-ico-badge.c-blue { background: var(--wms-primary-100); color: var(--wms-primary); }
.kpi-ico-badge.c-teal { background: #ccfbf1; color: #0d9488; }
.kpi-ico-badge.c-amber { background: #ffedd5; color: #ea580c; }
.kpi-ico-badge.c-red { background: #fee2e2; color: #dc2626; }
.kpi-ico-badge.c-green { background: #dcfce7; color: #16a34a; }
.kpi-ico-badge.c-violet { background: #ede9fe; color: #7c3aed; }

/* 提醒卡 */
.alert-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.alert-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--wms-border); border-left: 4px solid var(--wms-primary); border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.alert-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.alert-card.warn { border-left-color: var(--wms-warn); }
.alert-card.danger { border-left-color: var(--wms-danger); }
.alert-card.ok { border-left-color: var(--wms-ok); }
.alert-card .ac-ico { font-size: 1.5rem; }
.alert-card .ac-num { font-size: 1.35rem; font-weight: 700; line-height: 1; }
.alert-card .ac-label { color: var(--wms-muted); font-size: .82rem; margin-top: 3px; }

/* ---- 表格增强：表头吸顶 + 斑马纹 ---- */
.card-surface { position: relative; }
.card-surface > table.table thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; box-shadow: inset 0 -1px 0 var(--wms-border); }
.table-hover > tbody > tr:hover > * { background: var(--wms-primary-050); }
.table > tbody > tr:nth-child(even) > * { background: #fbfcfe; }
.table > tbody > tr:nth-child(even):hover > * { background: var(--wms-primary-050); }

/* ---- 分页条 ---- */
.wms-pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.wms-pager .pg-info { color: var(--wms-muted); font-size: .85rem; }
.wms-pager .pg-spacer { margin-left: auto; }
.wms-pager .form-select-sm { width: auto; }

/* ---- 加载：转圈 + 骨架屏 ---- */
.wms-spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid var(--wms-primary-100); border-top-color: var(--wms-primary); border-radius: 50%; animation: wms-spin .7s linear infinite; vertical-align: middle; }
.wms-loading { display: flex; align-items: center; gap: 10px; color: var(--wms-muted); padding: 8px 0; }
@keyframes wms-spin { to { transform: rotate(360deg); } }
.wms-skel-row { height: 38px; border-radius: 6px; margin-bottom: 8px; background: linear-gradient(90deg,#eef1f5 25%,#f6f8fb 37%,#eef1f5 63%); background-size: 400% 100%; animation: wms-shimmer 1.3s ease infinite; }
@keyframes wms-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---- 空状态 ---- */
.wms-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; color: var(--wms-muted); text-align: center; }
.wms-empty i { font-size: 2.6rem; opacity: .35; margin-bottom: 10px; }
.wms-empty .we-text { font-size: .95rem; }
.wms-empty .we-sub { font-size: .82rem; opacity: .8; margin-top: 4px; }

/* ================= 手机 / 窄屏适配（≤768px）================= */
@media (max-width: 768px) {
    /* 顶栏显示汉堡按钮 */
    .wms-hamburger { display: inline-flex; align-items: center; }
    .wms-topbar { padding: 0 12px; }

    /* 侧边栏改为可滑出的抽屉，默认隐藏在屏幕左外侧 */
    .wms-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        z-index: 1200; width: 78vw; max-width: 300px;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: 2px 0 14px rgba(0, 0, 0, .3); overflow-y: auto;
    }
    .wms-sidebar.open { transform: translateX(0); }

    /* 抽屉打开时的半透明遮罩，点击可关闭 */
    .wms-backdrop.show {
        display: block; position: fixed; inset: 0;
        background: rgba(0, 0, 0, .45); z-index: 1100;
    }

    /* 正文更贴边、标题略小 */
    .wms-content { padding: 12px; }
    .wms-page-title { font-size: 1.1rem; margin-bottom: 12px; }

    /* 关键：表格在卡片内横向滚动，不再撑破屏幕 */
    .card-surface { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .card-surface > table { white-space: nowrap; }

    /* 工具栏：搜索框占满一行，按钮自然换行 */
    .wms-toolbar { gap: 8px; }
    .wms-toolbar .form-control,
    .wms-toolbar .form-select { max-width: none !important; flex: 1 1 100%; }
    .wms-toolbar .ms-auto { margin-left: 0 !important; }

    /* 登录卡片与弹窗自适应窄屏 */
    .wms-login-card { width: auto; max-width: 92vw; }
    .wms-modal { width: 96vw; }

    /* 手机屏太窄放不下页签栏，走底部标签导航 */
    .page-tabs { display: none; }
    /* 模块图标宫格：一行多塞几个 */
    .mod-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
    .mt-ico { width: 46px; height: 46px; font-size: 1.3rem; }
}

/* ================= 移动端底部标签栏 + 我的页 ================= */
.mobile-tabbar { display: none; }
.mine-header { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; padding: 26px 20px; display: flex; align-items: center; gap: 14px; border-radius: 12px; }
.mine-avatar i { font-size: 3rem; opacity: .95; }
.mine-name { font-size: 1.3rem; font-weight: 700; }
.mine-role { color: #cbd5e1; font-size: .85rem; margin-top: 2px; }
.mine-menu { background: #fff; margin: 12px 0; border: 1px solid #eef2f7; border-radius: 12px; overflow: hidden; }
.mine-item { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; color: #1f2937; cursor: pointer; }
.mine-item:last-child { border-bottom: none; }
.mine-item:active { background: #f8fafc; }
.mine-item > i:first-child { font-size: 1.2rem; color: #2563eb; width: 24px; text-align: center; }
.mine-arrow { margin-left: auto; color: #cbd5e1; font-size: .9rem; }
.mine-logout { color: #dc2626; justify-content: center; font-weight: 600; }
.mine-logout > i:first-child { color: #dc2626; }

@media (max-width: 768px) {
    .mobile-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 56px; background: #fff; border-top: 1px solid #e5e7eb; z-index: 1300; box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
    .mtab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #94a3b8; text-decoration: none; font-size: .68rem; }
    .mtab i { font-size: 1.35rem; }
    .mtab.active { color: #2563eb; }
    /* 正文底部留出标签栏高度 */
    .wms-content { padding-bottom: 70px !important; }
}



/* ---- 手机卡片式列表（≤768px 显示卡片、隐藏横滚表格）---- */
.m-cards { display: none; }
.m-card { border: 1px solid var(--wms-border); border-left: 4px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.m-card:active { background: #f8fafc; transform: scale(.995); }
.m-card.m-ok { border-left-color: #2563eb; }      /* 已审核：蓝色条 */
.m-card.m-warn { border-left-color: #f59e0b; }    /* 待审核：橙色条 */
.m-card .m-amt { font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; }
.m-card .btn { border-radius: 8px; }
@media (max-width: 768px) {
    .m-cards { display: block; }
    .m-hide-sm { display: none !important; }
}

/* ---- 单据页响应式：编辑弹窗右侧联动区 / 左侧分类树 ---- */
.doc-side-panel { flex: 0 0 460px; width: 460px; }
@media (max-width: 992px) { .doc-side-panel { display: none; } }   /* 平板/手机：屏幕放不下右栏，隐藏（点品名规格看图可去商品信息页） */
.doc-tree { flex: 0 0 200px; max-width: 200px; }
@media (max-width: 768px) { .doc-tree { display: none; } }         /* 手机：树隐藏，筛选用查询条/状态徽章/日期快捷键 */

/* ================= 打印报表框架 ================= */
/* 打印专用块在屏幕上隐藏 */
.print-only { display: none; }

@media print {
    /* 隐藏所有屏幕 UI（导航/顶栏/工具栏/按钮/标记了 no-print 的） */
    .wms-sidebar, .wms-topbar, .wms-hamburger, .wms-backdrop, .wms-toolbar, .btn, .no-print, .mobile-tabbar { display: none !important; }
    /* 打印时正文不要给底部标签栏留白 */
    .wms-content { padding-bottom: 0 !important; }
    html, body, .wms-shell, .wms-main, .wms-content { background: #fff !important; margin: 0 !important; padding: 0 !important; display: block !important; }
    .wms-content { padding: 0 !important; overflow: visible !important; }
    .print-only { display: block !important; }
    @page { size: A4; margin: 1.4cm; }

    /* ---- 单表报表（列表页）：抬头 + 规范表格 ---- */
    .print-report-head { display: block !important; text-align: center; margin-bottom: 12px; }
    .print-report-head .prh-title { font-size: 18pt; font-weight: bold; letter-spacing: 2px; }
    .print-report-head .prh-sub { font-size: 10pt; color: #333; margin-top: 4px; }
    .wms-page-title { display: none !important; }
    .card-surface { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }
    /* 横向滚动容器在打印时会把宽表格右侧裁掉，这里放开 */
    .table-responsive { overflow: visible !important; }
    table.table { width: 100% !important; border-collapse: collapse !important; font-size: 10pt !important; }
    table.table th, table.table td { border: 1px solid #333 !important; padding: 4px 6px !important; color: #000 !important; }
    table.table thead th { background: #eee !important; position: static !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .table > tbody > tr:nth-child(even) > * { background: #fff !important; }

    /* ---- 主从单据报表 ---- */
    .print-doc { font-family: "SimSun", "宋体", serif; color: #000; font-size: 10.5pt; }
    .pd-company { text-align: center; font-size: 15pt; font-weight: bold; }
    .pd-title { text-align: center; font-size: 20pt; font-weight: bold; letter-spacing: 6px; margin: 2px 0 12px; }
    .pd-meta { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
    .pd-meta td { padding: 4px 8px; vertical-align: top; }
    .pd-meta .pd-mlabel { color: #333; width: 78px; white-space: nowrap; }
    .pd-table { width: 100%; border-collapse: collapse; }
    .pd-table th, .pd-table td { border: 1px solid #000; padding: 5px 7px; }
    .pd-table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; text-align: center; }
    .pd-table .pd-num { text-align: right; }
    .pd-table tfoot td { font-weight: bold; }
    .pd-sign { display: flex; justify-content: space-between; margin-top: 26px; padding: 0 4px; }
    .pd-foot-time { text-align: right; margin-top: 10px; font-size: 9pt; color: #555; }
}


/* ---- 列表「操作」列：多语言下按钮永远排一行 ----
   中文「编辑/复制/删除」两字一个，英文/意大利文变成 Modifica/Copia/Elimina 长 3~4 倍，
   原来靠 th 的固定 width 撑，切语言后按钮就折成两三行、参差不齐。
   这里让含按钮的单元格不换行、列宽随内容走（表格外层本来就有 .table-responsive 可横向滚动），
   一条规则覆盖全站 31 处操作列，不必逐页改。 */
.wms-act { white-space: nowrap !important; width: 1%; }
.wms-act > .btn + .btn { margin-left: 4px; }
.wms-act > .btn-group { flex-wrap: nowrap; }

/* ---- 商品分类树 ---- */
.wms-tree { font-size: 13px; max-height: 70vh; overflow-y: auto; }
/* 树上方的「增/改/删」紧凑按钮组：侧栏只有 240px，意语 Aggiungi/Modifica/Elimina 放不下，
   统一用图标 + tooltip（三种语言都一行、宽度一致）。 */
.wms-tree-ops { white-space: nowrap; }
.wms-tree-ops .btn { padding: 2px 0; font-size: .95rem; line-height: 1.35; }
.wms-tree-node { padding: 5px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wms-tree-node:hover { background: rgba(47,111,237,.08); }
.wms-tree-node.active { background: rgba(47,111,237,.16); font-weight: 600; }
.wms-tree-node .bi { margin-right: 4px; color: #2f6fed; }

/* ---- 打印页屏幕预览（.pd-* 屏幕上也可读；打印时由 @media print 覆盖）---- */
.print-preview { max-width: 800px; margin: 0 auto; padding: 24px; background: #fff; }
/* 横向 A4 的宽表格报表：屏幕预览别再压到 800px，否则十来列全挤在一起 */
.print-preview-wide { max-width: 1240px; }
.print-preview-wide table.table { font-size: 13px; }
.print-preview-wide table.table th, .print-preview-wide table.table td { padding: 4px 6px; }
.print-preview .print-doc { font-family: "SimSun","宋体",serif; color: #000; }
.print-preview .pd-company { text-align: center; font-size: 18px; font-weight: bold; }
.print-preview .pd-title { text-align: center; font-size: 24px; font-weight: bold; letter-spacing: 6px; margin: 4px 0 14px; }
.print-preview .pd-meta { width: 100%; margin-bottom: 8px; }
.print-preview .pd-meta td { padding: 4px 8px; }
.print-preview .pd-meta .pd-mlabel { color: #555; width: 84px; }
.print-preview .pd-table { width: 100%; border-collapse: collapse; }
.print-preview .pd-table th, .print-preview .pd-table td { border: 1px solid #333; padding: 5px 7px; }
.print-preview .pd-table thead th { background: #eee; text-align: center; }
.print-preview .pd-table .pd-num { text-align: right; }
.print-preview .pd-table tfoot td { font-weight: bold; }
.print-preview .pd-sign { display: flex; justify-content: space-between; margin-top: 26px; }
.print-preview .pd-foot-time { text-align: right; margin-top: 10px; font-size: 12px; color: #777; }

/* ================= 精致表单（客户等编辑窗体） ================= */
.wms-form-modal { max-width: 1080px; width: 94vw; }

/* 大单据弹窗（销售/发票/采购）：固定统一高度，表头表尾常驻、明细区内部滚动。
   让不同单据无论字段多少、明细几行，打开时大小一致。 */
.wms-doc-modal { height: 88vh; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.wms-doc-modal .wms-form-head { flex: 0 0 auto; }
.wms-doc-modal .wms-form-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.wms-doc-modal .wms-modal-foot { flex: 0 0 auto; }
.wms-form-head { display:flex; align-items:center; gap:12px; padding:13px 24px;
    background:linear-gradient(135deg,#2f6fed,#4a86f7); color:#fff; border-radius:14px 14px 0 0; }
.wms-form-head .fh-ico { width:36px; height:36px; border-radius:10px; background:rgba(255,255,255,.2);
    display:flex; align-items:center; justify-content:center; font-size:18px; }
.wms-form-head .fh-title { font-size:16px; font-weight:600; line-height:1.2; }
.wms-form-head .fh-sub { font-size:12px; opacity:.85; }
.wms-form-body { padding:14px 24px 6px; }
.wms-fsec { display:flex; align-items:center; gap:8px; font-weight:600; color:#2758af; font-size:13.5px;
    margin:4px 0 10px; padding-left:10px; border-left:3px solid #2f6fed; }
.wms-fsec .bi { color:#2f6fed; }
.wms-field { margin-bottom:11px; }
.wms-field > label { display:block; font-size:12px; color:#5a6472; margin-bottom:3px; font-weight:500; }
.wms-field .req { color:#e03131; margin-left:2px; }
.wms-field .form-control, .wms-field .form-select { height:38px; border-radius:8px; border-color:#dfe4ec; font-size:14px; }
.wms-field textarea.form-control { height:auto; }
.wms-field .form-control:focus, .wms-field .form-select:focus { border-color:#2f6fed; box-shadow:0 0 0 3px rgba(47,111,237,.12); }
/* 精致筛选栏 */
.wms-filter { background:#fff; border:1px solid #eceff4; border-radius:12px; padding:14px 16px; margin-bottom:14px; }
.wms-filter .ff-label { font-size:12px; color:#6b7280; margin-bottom:4px; display:block; }
.wms-filter .form-control, .wms-filter .form-select { height:38px; border-radius:8px; font-size:13.5px; }

/* 筛选栏：单行弹性等分 */
.wms-filter .wf-item { flex:1 1 130px; min-width:112px; }
.wms-filter .wf-btns { flex:0 0 auto; }

/* 单据窗体：wms-form-body 内的表头表单输入自动精致化（不影响明细表 form-control-sm） */
.wms-form-body .form-label { font-size:12px; color:#5a6472; margin-bottom:3px; font-weight:500; }
.wms-form-body .form-control:not(.form-control-sm),
.wms-form-body .form-select:not(.form-select-sm) { border-radius:8px; border-color:#dfe4ec; }
.wms-form-body .form-control:not(.form-control-sm):focus,
.wms-form-body .form-select:not(.form-select-sm):focus { border-color:#2f6fed; box-shadow:0 0 0 3px rgba(47,111,237,.12); }
.wms-form-body hr { margin:14px 0 10px; border-color:#eef1f6; }

/* ================= Toast 提示 ================= */
#wms-toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.wms-toast { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 12px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.18); font-size: 14px; font-weight: 500; opacity: 0; transform: translateY(-12px); transition: opacity .25s, transform .25s; border-left: 4px solid #16a34a; }
.wms-toast.show { opacity: 1; transform: translateY(0); }
.wms-toast .wt-ico { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; background: #16a34a; }
.wms-toast.error { border-left-color: #dc2626; } .wms-toast.error .wt-ico { background: #dc2626; }
.wms-toast.warn { border-left-color: #ea580c; } .wms-toast.warn .wt-ico { background: #ea580c; }

/* ================= 看板图表 ================= */
.dash-dot { display:inline-block; width:11px; height:11px; border-radius:3px; margin-right:3px; vertical-align:middle; }
.dash-chart { display:flex; align-items:flex-end; gap:18px; height:230px; padding-top:10px; }
.dash-col { flex:1; display:flex; flex-direction:column; align-items:center; }
.dash-bars { display:flex; align-items:flex-end; justify-content:center; gap:6px; height:185px; width:100%; }
.dash-bar { width:26px; border-radius:4px 4px 0 0; position:relative; min-height:2px; transition:height .4s ease; display:flex; justify-content:center; }
.dash-bar .dash-val { position:absolute; top:-16px; font-size:10px; color:#555; white-space:nowrap; }
.kpi.text-decoration-none:hover { text-decoration:none; }

/* ================= 登录页 v2 ================= */
.login2-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg,#1e3a8a 0%,#2563eb 55%,#3b82f6 100%); position:relative; overflow:hidden; }
.login2-wrap::before, .login2-wrap::after { content:""; position:absolute; border-radius:50%; background:rgba(255,255,255,.08); }
.login2-wrap::before { width:420px; height:420px; top:-120px; right:-80px; }
.login2-wrap::after { width:300px; height:300px; bottom:-100px; left:-60px; }
.login2-card { position:relative; z-index:1; width:380px; max-width:92vw; background:#fff; border-radius:16px;
    box-shadow:0 24px 60px rgba(0,0,0,.28); padding:36px 32px 28px; }
.login2-brand { text-align:center; margin-bottom:26px; }
.login2-logo { width:64px; height:64px; margin:0 auto 14px; border-radius:16px;
    background:linear-gradient(135deg,#2563eb,#4a86f7); color:#fff; font-size:30px;
    display:flex; align-items:center; justify-content:center; box-shadow:0 8px 20px rgba(37,99,235,.35); }
.login2-title { font-size:20px; font-weight:700; color:#1f2937; }
.login2-sub { font-size:12.5px; color:#8b93a1; margin-top:4px; }
.login2-field { position:relative; margin-bottom:16px; }
.login2-field > i { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:#9aa3b2; font-size:16px; z-index:2; }
.login2-field .form-control { height:46px; border-radius:10px; padding-left:40px; border-color:#e2e6ee; font-size:14px; }
.login2-field .form-control:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.14); }
.login2-btn { width:100%; height:46px; border:none; border-radius:10px; color:#fff; font-size:15px; font-weight:600; letter-spacing:2px;
    background:linear-gradient(135deg,#2563eb,#4a86f7); transition:filter .15s, transform .05s; }
.login2-btn:hover:not(:disabled) { filter:brightness(1.06); }
.login2-btn:active:not(:disabled) { transform:translateY(1px); }
.login2-btn:disabled { opacity:.7; }
.login2-foot { text-align:center; color:#9aa3b2; font-size:12px; margin-top:18px; }
.login2-lang { position:absolute; top:18px; right:18px; z-index:2; }
.login2-lang .lang-btn { background:rgba(255,255,255,.16); border-color:rgba(255,255,255,.35); color:#fff; }
.login2-lang .lang-btn:hover { background:rgba(255,255,255,.26); }

/* 语言切换器 */
.lang-switch { position:relative; }
.lang-btn { display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 10px;
  background:#fff; border:1px solid var(--wms-border); border-radius:8px; color:#374151;
  font-size:.85rem; cursor:pointer; transition:border-color .15s, background .15s; }
.lang-btn:hover { border-color:var(--wms-primary); color:var(--wms-primary); }
.lang-btn .lang-cur { font-weight:600; }
.lang-btn .lang-caret { font-size:.7rem; opacity:.6; }
.lang-backdrop { position:fixed; inset:0; z-index:1050; }
.lang-menu { position:absolute; right:0; top:38px; z-index:1051; min-width:150px;
  background:#fff; border:1px solid #e5e7eb; border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.14); padding:4px; }
.lang-item { display:flex; align-items:center; gap:8px; padding:8px 12px; font-size:.88rem;
  color:#374151; border-radius:6px; cursor:pointer; white-space:nowrap; }
.lang-item:hover { background:#f1f5f9; color:var(--wms-primary); }
.lang-item .lang-check { visibility:hidden; font-size:.9rem; color:var(--wms-primary); }
.lang-item.active { color:var(--wms-primary); font-weight:600; }
.lang-item.active .lang-check { visibility:visible; }

/* 全局错误兜底卡片（ErrorBoundary） */
.wms-errbox { max-width:420px; margin:64px auto; text-align:center; padding:32px 24px;
  background:var(--wms-card,#fff); border:1px solid #eef0f4; border-radius:14px;
  box-shadow:0 6px 24px rgba(30,41,59,.06); }
.wms-errbox > .bi { font-size:40px; color:#f59e0b; }
.wms-errtitle { font-size:17px; font-weight:600; color:#334155; margin-top:10px; }
.wms-errsub { font-size:13px; color:#94a3b8; margin:6px 0 18px; }

/* 商品可搜索选择器 ProductPicker（结果在流内展开，避免被弹窗滚动容器裁剪） */
.wms-picker { position:relative; flex:1 1 auto; min-width:260px; max-width:460px; }
/* 下拉浮层：绝对定位覆盖在下方内容之上，不再把明细表往下顶 */
.wms-picker-menu { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:1200;
  background:#fff; border:1px solid #e5e8ef; border-radius:10px; box-shadow:0 6px 18px rgba(30,41,59,.10);
  max-height:300px; overflow-y:auto; }
.wms-picker-hint { padding:10px 14px; color:#94a3b8; font-size:13px; }
.wms-picker-item { padding:8px 14px; cursor:pointer; display:flex; flex-direction:column; gap:1px; border-bottom:1px solid #f4f6fa; }
.wms-picker-item:last-child { border-bottom:0; }
.wms-picker-item:hover, .wms-picker-item.hi { background:#eef4ff; }
.wms-picker-item.hi { box-shadow:inset 3px 0 0 var(--wms-primary); }
.wms-picker-item .pk-spec { font-weight:600; color:#334155; font-size:14px; }
.wms-picker-item .pk-sub { color:#94a3b8; font-size:12px; }
