/* ==========================================================================
   MeiRong UI Kit —— 统一视觉规范（商家后台 / 平台后台）
   设计方向：临床美学 · 极简。深玉青主色 + 香槟金点缀，控件等高等宽、栅格对齐。
   本文件在 admin.css 之后加载，覆盖组件级样式，不改动业务脚本。
   ========================================================================== */

:root {
    --mr-brand: #0E7263;
    --mr-brand-dark: #0A5B4F;
    --mr-brand-hover: #0B6558;
    --mr-brand-soft: #E9F3F0;
    --mr-brand-line: #CFE1DC;
    --mr-accent: #BE9A57;
    --mr-ink: #16202C;
    --mr-text: #3C4A5A;
    --mr-muted: #8492A6;
    --mr-bg: #F5F7FA;
    --mr-surface: #FFFFFF;
    --mr-line: #E4E9F0;
    --mr-line-soft: #EEF1F5;
    --mr-radius: 10px;
    --mr-radius-sm: 7px;
    --mr-ctl-h: 34px;
    --mr-ctl-h-sm: 30px;
}

body {
    background: var(--mr-bg);
    color: var(--mr-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 导航外壳 ---------- */
.erp-side { width: 232px; background: var(--mr-surface); border-right: 1px solid var(--mr-line); }
.erp-main { margin-left: 232px; background: var(--mr-bg); }
.erp-brand { background: var(--mr-surface); color: var(--mr-ink); border-bottom: 1px solid var(--mr-line); font-weight: 700; letter-spacing: .01em; }
.erp-brand i { color: var(--mr-brand); }
.erp-nav { padding: 2px 10px 16px; }
.erp-group { color: var(--mr-muted); font-weight: 600; letter-spacing: .12em; opacity: 1; padding: 18px 12px 6px; }
.erp-mod { color: #455261; border-radius: var(--mr-radius-sm); padding: 8px 11px; }
.erp-mod i { color: #7A8798; }
.erp-mod:hover { background: #F3F8F6; color: var(--mr-brand-dark); }
.erp-mod:hover i { color: var(--mr-brand); }
.erp-mod.active { background: var(--mr-brand-soft); color: var(--mr-brand-dark); }
.erp-mod.active i { color: var(--mr-brand); }
.erp-sub { border-left: 1px solid var(--mr-line); }
.erp-subgroup { color: var(--mr-muted); opacity: 1; }
.erp-subitem { color: #5A6778; }
.erp-subitem:hover { background: #F5F9F8; color: var(--mr-brand-dark); }
.erp-subitem.active { background: var(--mr-brand-soft); color: var(--mr-brand-dark); }
.erp-side-foot { border-top: 1px solid var(--mr-line); }
.erp-version { color: var(--mr-muted); opacity: 1; }

.erp-top {
    height: 54px;
    background: var(--mr-surface) !important;
    color: var(--mr-text) !important;
    border-bottom: 1px solid var(--mr-line);
}
.erp-crumb { font-size: 12.5px; }
.erp-crumb i { color: var(--mr-brand); opacity: 1; }
.erp-crumb a { color: var(--mr-muted); opacity: 1; }
.erp-crumb a:hover { color: var(--mr-brand); }
.erp-crumb span { color: #C3CBD6; }
.erp-crumb b { color: var(--mr-ink); }
.erp-user, .erp-logout { color: var(--mr-text); }
.erp-logout:hover { color: var(--mr-brand); }
.erp-top-right .theme-switch { border: 1px solid var(--mr-line); color: var(--mr-text); border-radius: var(--mr-radius-sm); height: 28px; }

.content { padding: 20px 22px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--mr-surface);
    border: 1px solid var(--mr-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(22, 32, 44, .04);
    margin-bottom: 16px;
}
.card-header {
    min-height: 52px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--mr-surface);
    border-bottom: 1px solid var(--mr-line-soft);
    font-size: 14px;
    font-weight: 600;
    color: var(--mr-ink);
    border-radius: 12px 12px 0 0 !important;
}
.card-body { padding: 18px; }
.card-footer { background: var(--mr-surface); border-top: 1px solid var(--mr-line-soft); padding: 12px 18px; }

/* ---------- 表单控件：统一高度与对齐 ---------- */
.form-label { font-size: 12.5px; font-weight: 600; color: #4A5768; margin-bottom: .35rem; }
.form-control, .form-select {
    height: var(--mr-ctl-h);
    padding: .375rem .7rem;
    font-size: 13px;
    line-height: 1.45;
    color: var(--mr-ink);
    background-color: var(--mr-surface);
    border: 1px solid var(--mr-line);
    border-radius: 8px;
    box-shadow: none;
}
.form-control::placeholder { color: #B0BAC6; }
.form-control:focus, .form-select:focus {
    border-color: var(--mr-brand);
    box-shadow: 0 0 0 3px rgba(14, 114, 99, .12);
    color: var(--mr-ink);
}
.form-control-sm, .form-select-sm { height: var(--mr-ctl-h-sm); padding: .2rem .55rem; font-size: 12.5px; border-radius: var(--mr-radius-sm); }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background: #F7F9FB; color: var(--mr-muted); }
textarea.form-control { height: auto; min-height: 76px; resize: vertical; }
.form-text { font-size: 11.5px; color: var(--mr-muted); }
.input-group-text { height: var(--mr-ctl-h); font-size: 12.5px; background: #F7F9FB; border-color: var(--mr-line); color: var(--mr-muted); border-radius: 8px; }
.form-check-input { border-color: var(--mr-line); }
.form-check-input:checked { background-color: var(--mr-brand); border-color: var(--mr-brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(14, 114, 99, .12); border-color: var(--mr-brand); }
.form-switch .form-check-input:checked { background-color: var(--mr-brand); }

/* ---------- 按钮 ---------- */
.btn {
    height: var(--mr-ctl-h);
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: 8px;
    box-shadow: none !important;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-sm { height: var(--mr-ctl-h-sm); padding: 0 10px; font-size: 12px; border-radius: var(--mr-radius-sm); }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-primary { background: var(--mr-brand); border-color: var(--mr-brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--mr-brand-hover); border-color: var(--mr-brand-hover); color: #fff; }
.btn-outline-primary { color: var(--mr-brand); border-color: var(--mr-brand-line); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:active { background: var(--mr-brand-soft); border-color: var(--mr-brand); color: var(--mr-brand-dark); }
.btn-light { background: #F6F8FA; border-color: var(--mr-line); color: var(--mr-text); }
.btn-light:hover { background: #EEF2F5; border-color: var(--mr-line); color: var(--mr-ink); }
.btn-outline-secondary { color: #5A6778; border-color: var(--mr-line); }
.btn-outline-secondary:hover { background: #F4F6F9; border-color: #D5DDE5; color: var(--mr-ink); }
.btn-outline-danger { color: #C0392B; border-color: #F0D2CD; }
.btn-outline-danger:hover { background: #FCF1EF; border-color: #E3B9B2; color: #A93226; }
.btn-link { color: var(--mr-brand); height: auto; padding: 0; }

/* ---------- 表格：表头/行高等高，数字列右对齐 ---------- */
.table {
    margin-bottom: 0;
    font-size: 13px;
    color: var(--mr-text);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #F8FBFA;
}
.table thead th {
    height: 40px;
    padding: .5rem .75rem;
    background: #FAFBFC;
    color: #5B6878;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom: 1px solid var(--mr-line);
}
.table tbody td, .table tbody th {
    height: 46px;
    padding: .55rem .75rem;
    vertical-align: middle;
    border-color: var(--mr-line-soft);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table td .btn { margin: 0 1px; }
.table > :not(caption) > * > * { box-shadow: none; }
.table td.text-end, .table th.text-end { font-variant-numeric: tabular-nums; }
.table-responsive { border-radius: 0 0 12px 12px; }

/* ---------- 统计卡（保留渐变，统一为低饱和高级色） ---------- */
.stat-card { border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 6px rgba(22, 32, 44, .08); }
.stat-card .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-card .lbl { font-size: 12.5px; }
.stat-1 { background: linear-gradient(135deg, #12796B 0%, #0B5B4F 100%); }
.stat-2 { background: linear-gradient(135deg, #3E6B8A 0%, #2C4F68 100%); }
.stat-3 { background: linear-gradient(135deg, #B08D4F 0%, #8F6F35 100%); }
.stat-4 { background: linear-gradient(135deg, #5A5E8C 0%, #413F6B 100%); }

/* ---------- 徽标 / 分页 / 标签页 ---------- */
.badge { font-weight: 500; border-radius: 6px; padding: .32em .55em; }
.text-bg-primary, .badge.bg-primary { background-color: var(--mr-brand) !important; }
.text-primary { color: var(--mr-brand) !important; }
.bg-primary { background-color: var(--mr-brand) !important; }
.page-link { color: var(--mr-text); border-color: var(--mr-line); height: 30px; display: flex; align-items: center; }
.page-link:hover { color: var(--mr-brand); background: var(--mr-brand-soft); border-color: var(--mr-brand-line); }
.page-item.active .page-link { background: var(--mr-brand); border-color: var(--mr-brand); }
.nav-tabs .nav-link { color: var(--mr-muted); border: 0; border-bottom: 2px solid transparent; padding: .55rem .9rem; font-size: 13px; }
.nav-tabs .nav-link.active { color: var(--mr-brand-dark); border-bottom-color: var(--mr-brand); background: transparent; font-weight: 600; }
.dropdown-menu { border: 1px solid var(--mr-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(22, 32, 44, .1); font-size: 13px; }
.dropdown-item { padding: .45rem .85rem; border-radius: 6px; }
.dropdown-item:hover { background: #F4F6F9; color: var(--mr-ink); }

/* ---------- 弹窗 ---------- */
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 24px 64px rgba(22, 32, 44, .18); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--mr-line-soft); }
.modal-title { font-size: 15px; font-weight: 600; color: var(--mr-ink); }
.modal-body { padding: 18px 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--mr-line-soft); gap: 8px; }
.modal-header .btn-close { opacity: .55; }

/* ---------- 标题与辅助文本 ---------- */
h1, h2, h3, h4, h5 { color: var(--mr-ink); font-weight: 600; }
h5 { font-size: 15px; }
.text-muted { color: var(--mr-muted) !important; }
small, .small { font-size: 12px; }
hr { border-color: var(--mr-line); opacity: 1; }
.border { border-color: var(--mr-line) !important; }
.border-top, .border-bottom { border-color: var(--mr-line) !important; }
.shadow-sm { box-shadow: 0 1px 2px rgba(22, 32, 44, .06) !important; }

/* ---------- 页面头：统一标题层级、间距与图标色 ---------- */
.content > .d-flex.justify-content-between.align-items-center.mb-3 {
    margin-bottom: 16px !important;
    min-height: 38px;
    gap: 12px;
    flex-wrap: wrap;
}
.content > .d-flex.justify-content-between.align-items-center.mb-3 h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--mr-ink);
    letter-spacing: .01em;
}
.content > .d-flex.justify-content-between.align-items-center.mb-3 h5 > i { color: var(--mr-brand); font-size: 17px; }
.content > .d-flex.justify-content-between.align-items-center.mb-3 .text-muted.small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.5;
}

/* 页面头右侧筛选条：控件等高、间距一致、宽度收敛 */
.content > .d-flex.justify-content-between.align-items-center.mb-3 form.d-flex { gap: 8px !important; align-items: center; flex-wrap: wrap; }
.content form.d-flex { gap: 8px !important; align-items: center; }
.content form.d-flex > .form-control,
.content form.d-flex > .form-select { height: var(--mr-ctl-h-sm); font-size: 12.5px; }
.content form.d-flex > .form-control[type="text"],
.content form.d-flex > .form-control:not([type]),
.content form.d-flex > .form-control[type="search"],
.content form.d-flex > .form-control[name="keyword"] { width: 180px; }
.content form.d-flex > .form-select { width: 140px; }
.content form.d-flex > input[type="date"] { width: 150px; }

/* 表格内嵌的小控件保持一致高度 */
.table .form-control, .table .form-select { height: var(--mr-ctl-h-sm); font-size: 12.5px; padding: .2rem .5rem; }

/* ---------- 表格：统一表头底色、表体行高与数字排版 ---------- */
.table thead.table-light th,
.table > thead.table-light > tr > th { background: #FAFBFC !important; }
.table tbody td { height: 44px; }
.table tfoot td { height: 42px; font-variant-numeric: tabular-nums; }
.table > tbody > tr > td.text-end,
.table > tbody > tr > th.text-end { font-variant-numeric: tabular-nums; }
.table td > .btn + .btn { margin-left: 2px; }

/* ---------- 低饱和语义色（按钮 / 徽标 / 进度条） ---------- */
.btn-outline-success { color: #2F7A5E; border-color: #CFE3D8; }
.btn-outline-success:hover, .btn-outline-success:active { background: #EAF5EF; border-color: #B7D8C7; color: #22664C; }
.btn-outline-warning { color: #A8763A; border-color: #EDDCC2; }
.btn-outline-warning:hover, .btn-outline-warning:active { background: #FBF3E6; border-color: #E2CBA7; color: #8A5E28; }
.btn-outline-info { color: #3E6B8A; border-color: #D3E0EA; }
.btn-outline-info:hover, .btn-outline-info:active { background: #EDF3F8; border-color: #BDD2E2; color: #2C4F68; }
.btn-outline-danger { color: #B03A2E; border-color: #F0D2CD; }
.btn-outline-danger:hover, .btn-outline-danger:active { background: #FCF1EF; border-color: #E3B9B2; color: #953028; }

.badge.text-bg-primary { background: var(--mr-brand-soft) !important; color: var(--mr-brand-dark) !important; }
.badge.text-bg-success { background: #E4F3EC !important; color: #23795B !important; }
.badge.text-bg-warning { background: #F7EEDC !important; color: #996A2C !important; }
.badge.text-bg-danger { background: #FBE9E7 !important; color: #B03A2E !important; }
.badge.text-bg-info { background: #E8F1F7 !important; color: #31607F !important; }
.badge.text-bg-secondary { background: #EEF1F5 !important; color: #6B7789 !important; }
.badge.text-bg-dark { background: #E8ECF1 !important; color: #334155 !important; }

.progress { background: #EFF2F6; border-radius: 6px; }
.progress-bar { background-color: var(--mr-brand); }

/* ---------- 弹窗表单：标签紧凑、栅格间距一致 ---------- */
.modal-body .form-label { margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #4A5768; }
.modal-body .row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
.modal-body .mb-2 { margin-bottom: 12px !important; }
.modal-body .text-muted.small { color: var(--mr-muted); }

/* ---------- 空状态与提示条 ---------- */
.table td.text-center.text-muted.py-4 { color: var(--mr-muted) !important; }
.alert { border-radius: 10px; border: 1px solid var(--mr-line); font-size: 13px; }

/* ---------- 登录 / 客户端保持独立品牌色，仅统一控件高度 ---------- */
.login-box .form-control { height: 40px; }
.login-box .btn { height: 40px; }

@media (max-width: 992px) {
    .erp-main { margin-left: 0; }
    .content { padding: 16px 14px; }
}

/* ==========================================================================
   V2 精修层（2026-10-29）
   方向：更平的表面、更克制的中性色、统一控件尺度。只覆盖视觉，不改结构。
   ========================================================================== */
:root {
    --mr-bg: #F5F6F7;
    --mr-line: #E3E8EE;
    --mr-line-soft: #EFF2F5;
    --mr-ctl-h: 32px;
    --mr-control-border: #DDE4EA;
}

/* ---------- 表面：去掉卡片阴影，只留发丝描边 ---------- */
.card {
    box-shadow: none;
    border-color: var(--mr-line);
    border-radius: 10px;
}
.card-header { min-height: 46px; padding: 10px 18px; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.card-body { padding: 16px 18px; }
.card-footer { padding: 10px 18px; }
.shadow-sm { box-shadow: none !important; }

/* ---------- 导航：低对比、左侧高亮条 ---------- */
.erp-side { width: 228px; background: #FCFDFD; }
.erp-main { margin-left: 228px; }
.erp-group { font-size: 10.5px; letter-spacing: .16em; padding: 16px 10px 5px; }
.erp-mod { position: relative; font-size: 13px; padding: 9px 10px; gap: 9px; }
.erp-mod.active { background: var(--mr-brand-soft); }
.erp-mod.active::before {
    content: ""; position: absolute; left: 0; top: 7px; bottom: 7px;
    width: 2px; border-radius: 2px; background: var(--mr-brand);
}
.erp-subitem { position: relative; font-size: 12.5px; }
.erp-subitem.active::before {
    content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px;
    width: 2px; border-radius: 2px; background: var(--mr-brand);
}
.erp-top { height: 52px; }

/* ---------- 导航增强：可折叠分组 + 全局功能搜索 ---------- */
.erp-grp { }
.erp-group {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    background: none; border: 0; cursor: pointer; text-align: left;
}
.erp-group i { font-size: 10px; color: #A9B4C0; transition: transform .16s ease; }
.erp-grp.collapsed .erp-group i { transform: rotate(-90deg); }
.erp-grp.collapsed .erp-grp-body { display: none; }
.erp-group:hover { color: var(--mr-brand-dark); }
.erp-group:hover i { color: var(--mr-brand); }

.erp-search { position: relative; margin: 10px 10px 2px; }
.erp-search > i { position: absolute; left: 10px; top: 9px; font-size: 12px; color: #A9B4C0; }
.erp-search input {
    width: 100%; height: 32px; padding: 0 10px 0 30px; font-size: 12px;
    border: 1px solid var(--mr-line); border-radius: var(--mr-radius-sm); background: #fff;
    color: #455261; outline: none;
}
.erp-search input::placeholder { color: #A9B4C0; }
.erp-search input:focus { border-color: var(--mr-brand); box-shadow: 0 0 0 2px rgba(14, 114, 99, .08); }
.erp-search-res {
    display: none; position: absolute; z-index: 30; left: 0; right: 0; top: 36px;
    max-height: 360px; overflow-y: auto; background: #fff;
    border: 1px solid var(--mr-line); border-radius: 10px;
    box-shadow: 0 14px 32px rgba(16, 24, 40, .14);
}
.erp-search-res.show { display: block; }
.erp-sr-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 11px; font-size: 12.5px; color: #455261; cursor: pointer;
}
.erp-sr-item i { font-size: 13px; color: #7A8798; }
.erp-sr-item:hover { background: var(--mr-brand-soft); color: var(--mr-brand-dark); }
.erp-sr-item:hover i { color: var(--mr-brand); }
.erp-sr-item .g { margin-left: auto; font-size: 10.5px; color: #A9B4C0; white-space: nowrap; }

/* ---------- ERP 商品检索（扫码/模糊） ---------- */
.erp-picker { position: relative; }
.erp-picker > i { position: absolute; left: 10px; top: 8px; color: #A9B4C0; font-size: 14px; }
.erp-picker input { padding-left: 32px; }
.erp-picker-res {
    display: none; position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
    max-height: 330px; overflow-y: auto; background: #fff;
    border: 1px solid var(--mr-line); border-radius: 8px; box-shadow: 0 14px 32px rgba(16, 24, 40, .14);
}
.erp-picker-res.show { display: block; }
.erp-pk-item { display: flex; align-items: center; gap: 10px; padding: 7px 11px; font-size: 12.5px; color: #455261; cursor: pointer; }
.erp-pk-item.on, .erp-pk-item:hover { background: var(--mr-brand-soft); color: var(--mr-brand-dark); }
.erp-pk-item .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-pk-item .n em { font-style: normal; color: #8A96A3; font-size: 11.5px; }
.erp-pk-item .c, .erp-pk-item .b { font-size: 11px; color: #98A2B3; white-space: nowrap; }
.erp-pk-empty { padding: 10px 12px; font-size: 12px; color: #98A2B3; }

/* ---------- 页头：标题与右侧操作同一基线，仅一个主按钮 ---------- */
.content > .d-flex.justify-content-between.align-items-center.mb-3 { min-height: 36px; margin-bottom: 14px !important; }
.content > .d-flex.justify-content-between.align-items-center.mb-3 h5 { font-size: 15.5px; gap: 7px; }
.content > .d-flex.justify-content-between.align-items-center.mb-3 h5 > i { font-size: 16px; }
.content > .d-flex.justify-content-between.align-items-center.mb-3 .text-muted.small { margin-top: 2px; font-size: 11.5px; }
.content > .d-flex.justify-content-between.align-items-center.mb-3 > .d-flex > .btn { height: var(--mr-ctl-h-sm); }

/* ---------- 表单：发丝边框、轻聚焦环 ---------- */
.form-control, .form-select { border-color: var(--mr-control-border); }
.form-control:hover:not(:disabled):not(:focus), .form-select:hover:not(:disabled):not(:focus) { border-color: #C8D3DB; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 2px rgba(14, 114, 99, .10); }
.form-select { padding-right: 1.9rem; }
.form-label { letter-spacing: .01em; }

/* ---------- 按钮：扁平 ---------- */
.btn { font-weight: 500; letter-spacing: .01em; }
.btn-primary, .btn-primary:hover, .btn-primary:focus { box-shadow: none; }

/* ---------- 表格：更轻的网格与更稳的节奏 ---------- */
.table thead th { height: 38px; background: #F8FAFB; color: #6B7789; letter-spacing: .02em; }
.table tbody td { height: 42px; border-color: var(--mr-line-soft); }
.table thead th:first-child, .table tbody td:first-child { padding-left: 18px; }
.table thead th:last-child, .table tbody td:last-child { padding-right: 18px; }
.table tbody td .badge { vertical-align: middle; }

/* ---------- 统计卡：白底 + 左侧色条 + 软底图标 ---------- */
.stat-card {
    background: #fff !important;
    color: var(--mr-ink) !important;
    border: 1px solid var(--mr-line);
    box-shadow: none;
    padding: 16px 18px 16px 20px;
}
.stat-card .lbl { color: var(--mr-muted); opacity: 1; font-size: 12.5px; letter-spacing: .02em; }
.stat-card .num { color: var(--mr-ink); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }
.stat-card .small { color: var(--mr-muted); font-size: 11.5px; }
.stat-card > i {
    width: 36px; height: 36px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px !important;
}
.stat-1 { box-shadow: inset 3px 0 0 #0E7263 !important; }
.stat-1 > i { background: #E9F3F0; color: #0E7263; }
.stat-2 { box-shadow: inset 3px 0 0 #3E6B8A !important; }
.stat-2 > i { background: #EAF0F6; color: #3E6B8A; }
.stat-3 { box-shadow: inset 3px 0 0 #A8763A !important; }
.stat-3 > i { background: #F7EFE1; color: #A8763A; }
.stat-4 { box-shadow: inset 3px 0 0 #6B5B95 !important; }
.stat-4 > i { background: #EFEBF4; color: #6B5B95; }

/* ---------- 徽标 / 标签页 / 分页 ---------- */
.badge { font-size: 11.5px; font-weight: 600; }
.nav-tabs .nav-link { padding: .5rem .85rem; }
.page-link { border-color: var(--mr-line); }

/* ---------- 弹窗 ---------- */
.modal-content { border-radius: 12px; box-shadow: 0 18px 48px rgba(16, 24, 40, .14); }
.modal-header { padding: 14px 18px; }
.modal-body { padding: 16px 18px; }
.modal-footer { padding: 10px 18px; }

@media (max-width: 992px) {
    .erp-side { width: 100%; position: static; }
    .erp-main { margin-left: 0; }
}

/* ---------- 套餐编辑弹窗：四页签 / 封面 / 明细行 ---------- */
.pkg-modal-body { padding-top: 12px; }
.pkg-subtitle { color: var(--mr-muted); font-size: 12px; margin-top: 2px; }

.pkg-tabs { border-bottom: 1px solid var(--mr-line); margin-bottom: 16px; }
.pkg-tabs .nav-link {
    color: var(--mr-muted); font-size: 13px; font-weight: 600;
    border: 0; border-bottom: 2px solid transparent; background: transparent;
    border-radius: 0; padding: .55rem .95rem;
}
.pkg-tabs .nav-link:hover { color: var(--mr-ink); border-bottom-color: var(--mr-line); }
.pkg-tabs .nav-link.active { color: var(--mr-brand); border-bottom-color: var(--mr-brand); background: transparent; }
.pkg-count {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
    border-radius: 9px; background: var(--mr-brand-soft); color: var(--mr-brand);
    font-size: 11px; font-weight: 600; text-align: center; line-height: 17px; vertical-align: 1px;
}

.pkg-tabs + .tab-content .tab-pane { padding-top: 2px; }
.pkg-tabs + .tab-content .form-label { margin-bottom: 4px; font-size: 12.5px; color: var(--mr-text); }

/* 客户端展示：封面卡 */
.pkg-cover {
    position: relative; aspect-ratio: 16 / 9; width: 100%;
    border: 1px dashed var(--mr-line); border-radius: var(--mr-radius);
    background: #FAFBFB; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.pkg-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pkg-cover-empty {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: #A6B2BD; font-size: 12px; pointer-events: none;
}
.pkg-cover-empty i { font-size: 26px; }

/* 客户端展示：富文本编辑器 */
.pkg-editor-toolbar { border: 1px solid var(--mr-line); border-bottom: 0; border-radius: var(--mr-radius) var(--mr-radius) 0 0; }
.pkg-editor { height: 268px; border: 1px solid var(--mr-line); border-radius: 0 0 var(--mr-radius) var(--mr-radius); overflow: hidden; }
.pkg-editor .w-e-text-container { height: 240px !important; }
.pkg-editor .w-e-text-placeholder { top: 10px; font-style: normal; }
.pkg-editor-toolbar .w-e-bar { background: #FBFCFC; }

/* 明细行：表头与行共用栅格，保证列对齐 */
.pkg-line-head {
    display: grid; gap: 8px; align-items: center;
    padding: 7px 10px; background: #F7F9F9;
    border: 1px solid var(--mr-line); border-bottom: 0;
    border-radius: var(--mr-radius-sm) var(--mr-radius-sm) 0 0;
    font-size: 12px; font-weight: 600; color: var(--mr-muted);
}
.pkg-line {
    display: grid; gap: 8px; align-items: center;
    padding: 8px 10px; background: #fff;
    border: 1px solid var(--mr-line); border-top: 0;
}
.pkg-line:last-child { border-radius: 0 0 var(--mr-radius-sm) var(--mr-radius-sm); }
.pkg-svc-cols  { grid-template-columns: minmax(0, 1fr) 108px 88px 32px; }
.pkg-prod-cols { grid-template-columns: minmax(0, 1fr) 96px 118px 88px 32px; }
/* 套餐明细（服务+商品合并）：编号/条码 | 名称 | 规格 | 原价 | 数量 | 销售价 | 总额 | 赠送 | 删除 */
.pkg-detail-cols { grid-template-columns: 130px minmax(0, 1fr) 96px 78px 62px 78px 82px 46px 32px; }
/* 商品价格规格表：条码 | 规格 | 成本 | 销售价 */
.pkg-price-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 110px 110px; }
.pkg-line .form-control, .pkg-line .form-select { min-width: 0; }
.pkg-line .form-check { min-height: 0; }
.pkg-line .pkg-line-text { font-size: 12.5px; color: var(--mr-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#itemRows, #prodRows, #pkgDetailRows { max-height: 322px; overflow-y: auto; }

/* 底部开关区 */
.pkg-footer { gap: 10px; background: #FBFCFC; }
.pkg-footer .form-check { margin: 0; }
.pkg-footer .form-check-label { color: var(--mr-text); }

@media (max-width: 768px) {
    .pkg-svc-cols { grid-template-columns: minmax(0, 1fr) 82px 62px 30px; }
    .pkg-prod-cols { grid-template-columns: minmax(0, 1fr) 72px 88px 62px 30px; }
    .pkg-detail-cols { grid-template-columns: 92px minmax(0, 1fr) 70px 58px 48px 58px 62px 40px 28px; gap: 5px; }
    .pkg-price-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 78px 78px; }
    .pkg-editor { height: 220px; }
    .pkg-editor .w-e-text-container { height: 190px !important; }
}

/* ---------- 顾客端：套餐图文介绍（富文本截断展示） ---------- */
.pkg-intro { max-height: 118px; overflow: hidden; line-height: 1.65; }
.pkg-intro p { margin: 0 0 4px; }
.pkg-intro img { max-width: 100%; height: auto; border-radius: 6px; }

/* ---------- 数据字典：左侧分类导航 ---------- */
.dict-type-list { max-height: 68vh; overflow-y: auto; }
.dict-type-list .list-group-item { border: 0; padding: .5rem .85rem; font-size: 13px; color: var(--mr-text); }
.dict-type-list .list-group-item:hover { background: #F5F9F8; color: var(--mr-brand-dark); }
.dict-type-list .list-group-item.active { background: var(--mr-brand-soft); color: var(--mr-brand-dark); font-weight: 600; }

/* ==========================================================================
   导航 6 种布局（商家后台）—— 由 Cookie erp_nav 决定：side / side-dark / rail /
   top-left / top-right / top-sub。全部走主题变量，不写死业务色。
   ========================================================================== */
.erp-shell { min-height: 100vh; }

/* --- 2) 左侧深色 --- */
.erp-shell.nav-side-dark .erp-side { background: #123A36; border-right-color: #0E2F2B; }
.erp-shell.nav-side-dark .erp-brand { background: #123A36; color: #EAF6F3; border-bottom-color: rgba(255,255,255,.10); }
.erp-shell.nav-side-dark .erp-brand .brand-logo { background: #fff; }
.erp-shell.nav-side-dark .erp-brand i { color: #6FD3C2; }
.erp-shell.nav-side-dark .erp-search input { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.16); color: #EDF7F4; }
.erp-shell.nav-side-dark .erp-search input::placeholder { color: #93B5AE; }
.erp-shell.nav-side-dark .erp-search > i { color: #93B5AE; }
.erp-shell.nav-side-dark .erp-group { color: #8FB0AA; }
.erp-shell.nav-side-dark .erp-group:hover { color: #CFEFE8; }
.erp-shell.nav-side-dark .erp-mod { color: #D6E6E2; }
.erp-shell.nav-side-dark .erp-mod i { color: #8FB0AA; }
.erp-shell.nav-side-dark .erp-mod:hover { background: rgba(255,255,255,.08); color: #fff; }
.erp-shell.nav-side-dark .erp-mod:hover i { color: #A9EBDF; }
.erp-shell.nav-side-dark .erp-mod.active { background: rgba(111,211,194,.18); color: #A9EBDF; }
.erp-shell.nav-side-dark .erp-mod.active i { color: #A9EBDF; }
.erp-shell.nav-side-dark .erp-sub { border-left-color: rgba(255,255,255,.14); }
.erp-shell.nav-side-dark .erp-subgroup { color: #8FB0AA; }
.erp-shell.nav-side-dark .erp-subitem { color: #C4DAD5; }
.erp-shell.nav-side-dark .erp-subitem:hover { background: rgba(255,255,255,.08); color: #fff; }
.erp-shell.nav-side-dark .erp-subitem.active { background: rgba(111,211,194,.18); color: #A9EBDF; }
.erp-shell.nav-side-dark .erp-side-foot { border-top-color: rgba(255,255,255,.12); }
.erp-shell.nav-side-dark .erp-version { color: #8FB0AA; }

/* --- 3) 左侧图标窄栏（悬浮展开） --- */
.erp-shell.nav-rail .erp-side { width: 68px; overflow: hidden; transition: width .18s ease; }
.erp-shell.nav-rail .erp-side:hover { width: 236px; box-shadow: 12px 0 28px rgba(22,32,44,.12); }
.erp-shell.nav-rail .erp-main { margin-left: 68px; }
.erp-shell.nav-rail .erp-side:not(:hover) .erp-brand-name,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-search,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-group span,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-group i,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-mod span,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-sub,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-side-foot { display: none !important; }
.erp-shell.nav-rail .erp-side:not(:hover) .erp-brand { justify-content: center; padding: 0; }
.erp-shell.nav-rail .erp-side:not(:hover) .erp-group { padding: 8px 0 2px; height: 10px; }
.erp-shell.nav-rail .erp-side:not(:hover) .erp-grp-body,
.erp-shell.nav-rail .erp-side:not(:hover) .erp-grp.collapsed .erp-grp-body { display: flex !important; flex-direction: column; }
.erp-shell.nav-rail .erp-side:not(:hover) .erp-mod { justify-content: center; padding: 9px 0; }
.erp-shell.nav-rail .erp-side:not(:hover) .erp-mod i { width: auto; font-size: 16px; }

/* --- 4/5/6) 顶部导航 --- */
.erp-shell.nav-top-left .erp-main,
.erp-shell.nav-top-right .erp-main,
.erp-shell.nav-top-sub .erp-main,
.erp-shell.nav-top-side .erp-main { margin-left: 0; }
.erp-shell.nav-top-left .erp-top,
.erp-shell.nav-top-right .erp-top,
.erp-shell.nav-top-sub .erp-top,
.erp-shell.nav-top-side .erp-top { top: 54px; }

.erp-topnav {
    position: sticky; top: 0; z-index: 110; height: 54px; flex-shrink: 0;
    display: flex; align-items: center; gap: 10px; padding: 0 18px;
    background: var(--mr-surface); border-bottom: 1px solid var(--mr-line);
}
.tn-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; color: var(--mr-ink); text-decoration: none; white-space: nowrap; }
.tn-brand i { font-size: 18px; color: var(--mr-brand); }
.tn-brand .brand-logo { height: 26px; border-radius: 6px; }
.tn-menu { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: visible; }
.erp-topnav.menu-right .tn-menu { margin-left: auto; }
.tn-item { position: relative; }
.tn-link { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 8px; color: #455261; font-size: 13px; text-decoration: none; white-space: nowrap; }
.tn-link i { color: #7A8798; font-size: 14px; }
.tn-link:hover { background: #F3F8F6; color: var(--mr-brand-dark); }
.tn-link:hover i { color: var(--mr-brand); }
.tn-item.active .tn-link { background: var(--mr-brand-soft); color: var(--mr-brand-dark); font-weight: 600; }
.tn-item.active .tn-link i { color: var(--mr-brand); }
.tn-drop {
    display: none; position: absolute; left: 0; top: calc(100% + 2px); min-width: 214px; max-height: 68vh; overflow-y: auto;
    background: #fff; border: 1px solid var(--mr-line); border-radius: 10px;
    box-shadow: 0 18px 44px rgba(22,32,44,.14); padding: 8px; z-index: 130;
}
.erp-topnav.menu-right .tn-drop { left: auto; right: 0; }
.tn-item:hover .tn-drop { display: block; }
.tn-grp { padding: 7px 8px 3px; font-size: 11px; color: var(--mr-muted); letter-spacing: .06em; }
.tn-drop .tn-sub { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 6px; color: #5A6778; font-size: 12.5px; text-decoration: none; }
.tn-drop .tn-sub i { width: 14px; text-align: center; color: #7A8798; }
.tn-drop .tn-sub:hover { background: #F5F9F8; color: var(--mr-brand-dark); }
.tn-drop .tn-sub.active { background: var(--mr-brand-soft); color: var(--mr-brand-dark); font-weight: 600; }
.tn-tail { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tn-search { width: 210px; margin: 0; }
.tn-search input { height: 30px; }
.tn-search .erp-search-res { top: 34px; }

/* 6) 顶部一级 + 二级横条 */
.erp-subbar { display: flex; align-items: center; gap: 4px; padding: 7px 22px; background: #fff; border-bottom: 1px solid var(--mr-line); overflow-x: auto; }
.erp-subbar-item { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; font-size: 12.5px; color: #5A6778; text-decoration: none; white-space: nowrap; }
.erp-subbar-item:hover { background: #F5F9F8; color: var(--mr-brand-dark); }
.erp-subbar-item.active { background: var(--mr-brand-soft); color: var(--mr-brand-dark); font-weight: 600; }
.erp-subbar-grp { font-size: 11px; color: var(--mr-muted); padding: 0 6px; white-space: nowrap; }

@media (max-width: 992px) {
    .erp-topnav { overflow-x: auto; }
    .tn-menu { flex-wrap: nowrap; }
    .tn-search { display: none; }
    .erp-shell.nav-rail .erp-main { margin-left: 0; }
    .erp-subside { display: none; }
    .erp-shell.nav-top-side .erp-top,
    .erp-shell.nav-top-side .content { margin-left: 0; }
}

/* --- 7) 顶栏 + 左侧二级栏（子菜单在左，顶栏保留文字） --- */
.erp-shell.nav-top-side .erp-top,
.erp-shell.nav-top-side .content { margin-left: 210px; }
.erp-shell.nav-top-side .tn-menu { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.erp-shell.nav-top-side .tn-menu::-webkit-scrollbar { height: 4px; }
.erp-shell.nav-top-side .tn-menu::-webkit-scrollbar-thumb { background: #D5DEE7; border-radius: 2px; }
.erp-shell.nav-top-side .tn-tail { flex-shrink: 0; }
.erp-subside {
    position: fixed; left: 0; top: 54px; bottom: 0; width: 210px; z-index: 100;
    background: var(--mr-surface); border-right: 1px solid var(--mr-line);
    padding: 8px; overflow-y: auto;
}
.erp-subside-grp { padding: 10px 10px 4px; font-size: 11px; color: var(--mr-muted); letter-spacing: .06em; }
.erp-subside-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: #455261; font-size: 12.5px; text-decoration: none; }
.erp-subside-item i { width: 15px; text-align: center; color: #7A8798; }
.erp-subside-item:hover { background: #F3F8F6; color: var(--mr-brand-dark); }
.erp-subside-item.active { background: var(--mr-brand-soft); color: var(--mr-brand-dark); font-weight: 600; }
.erp-subside-item.active i { color: var(--mr-brand); }

/* 顶栏宽度自适应：不足时图标化，仍不足则横向滚动 */
.tn-icons .tn-link span { display: none; }
.tn-icons .tn-link { padding: 8px 9px; }
.tn-menu.tn-scroll { overflow-x: auto; scrollbar-width: none; }
.tn-menu.tn-scroll::-webkit-scrollbar { display: none; }
.tn-drop.flip { left: auto; right: 0; }
.tn-drop.flip-left { left: 0; right: auto; }

@media (max-width: 992px) {
    .erp-shell.nav-top-side .erp-top,
    .erp-shell.nav-top-side .content { margin-left: 0; }
}
