/* ============================================================
   顺意 ERP 系统 - 设计系统与全局样式
   ============================================================ */
:root {
  --primary: #3b5bdb;
  --primary-hover: #3450c4;
  --primary-light: #eef1fd;
  --sidebar-bg: #101a2e;
  --sidebar-text: #9aa8c4;
  --sidebar-active: #ffffff;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --border: #e5e9f2;
  --text-main: #1f2b43;
  --text-sub: #6b7a99;
  --text-light: #9aa8c4;
  --success: #16a34a;
  --success-bg: #e8f7ee;
  --warning: #d97706;
  --warning-bg: #fdf3e3;
  --danger: #dc2626;
  --danger-bg: #fdeaea;
  --info: #0284c7;
  --info-bg: #e5f4fc;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 26, 46, .06), 0 4px 16px rgba(16, 26, 46, .06);
  --shadow-lg: 0 8px 32px rgba(16, 26, 46, .14);
  --sidebar-w: 232px;
  --topbar-h: 58px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text-main); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 应用布局 ---------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.view { flex: 1; overflow-y: auto; padding: 22px 26px; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; flex-shrink: 0; transition: width .2s;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo .logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f6ef7, #3b5bdb);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 2px 8px rgba(79,110,247,.45);
}
.sidebar-logo .logo-text { font-size: 16px; font-weight: 600; color: #fff; letter-spacing: 1px; white-space: nowrap; }
.sidebar-logo .logo-text small { display: block; font-size: 10px; font-weight: 400; color: var(--sidebar-text); letter-spacing: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }
.nav-group-title { font-size: 11px; color: #55648a; padding: 14px 10px 6px; letter-spacing: 1px; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  border-radius: 9px; cursor: pointer; color: var(--sidebar-text);
  font-size: 13.5px; white-space: nowrap; transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #d7deee; }
.nav-item.active { background: linear-gradient(90deg, #4f6ef7, #3b5bdb); color: #fff; box-shadow: 0 2px 10px rgba(79,110,247,.4); }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item .nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h); background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 26px; gap: 16px; flex-shrink: 0;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 8px; border-radius: 9px; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.user-chip .u-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--text-sub); }

/* ---------- 通用卡片 ---------- */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; }
.card-title .title-extra { margin-left: auto; font-weight: 400; font-size: 12.5px; }
/* 【布局统一】系统设置页（角色/员工/模块）：卡片内边距 16px、区块间距 20px */
#sys-body > .card { padding: 16px; }
#sys-body > .card + .card { margin-top: 20px; }

/* 【商品表单】颜色管理 / 三码配置 / 备注 三区独立成行，各带小标题 */
.form-sec { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fbfdff; }
.form-sec-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.form-sec + .form-sec { margin-top: 12px; }

/* ---------- 页面头部 ---------- */
.page-head { display: flex; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; font-weight: 700; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9px;
  border: 1px solid transparent; font-size: 13.5px; cursor: pointer; font-family: inherit;
  transition: all .15s; white-space: nowrap; line-height: 1.4;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 3px 10px rgba(59,91,219,.35); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-plain { background: transparent; color: var(--primary); padding: 4px 8px; }
.btn-plain:hover { background: var(--primary-light); }
.btn-plain.danger { color: var(--danger); }
.btn-plain.danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 4px 6px; font-family: inherit; }
.btn-link.danger { color: var(--danger); }
.btn-link:hover { text-decoration: underline; }
/* 禁用态按钮（如内置默认账号 admin 的「删除」按钮）：置灰且不显示手型光标，避免误点 */
.btn-link:disabled, .btn-link[disabled] { color: var(--c-sub, #9aa3b2); cursor: not-allowed; }
.btn-link:disabled:hover, .btn-link[disabled]:hover { text-decoration: none; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.span2 { grid-column: span 2; }
.form-item label { font-size: 12.5px; color: var(--text-sub); font-weight: 500; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.chk-line { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.chk-line label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-main); }
.chk-line input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.input, select.input, textarea.input {
  height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 11px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text-main);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,.12); }
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-bar .input { width: 200px; }
.search-bar select.input { width: 140px; }
/* 【布局统一】列表页筛选栏：输入框/下拉/按钮统一 32px 高，纵向对齐同一基线 */
.search-bar .input, .search-bar select.input, .search-bar input[type=date] {
  height: 32px; padding: 0 9px; font-size: 13px;
}
.search-bar .btn { height: 32px; padding: 0 14px; font-size: 13px; line-height: 30px; }
.search-bar .btn.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 10px 18px; font-size: 13.5px; color: var(--text-sub); cursor: pointer;
  border-radius: 9px 9px 0 0; margin-bottom: -2px; border-bottom: 2px solid transparent;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); background: #f6f8ff; }
.tab .t-badge { display: inline-block; margin-left: 5px; font-size: 11px; background: var(--danger-bg); color: var(--danger); border-radius: 9px; padding: 0 6px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.data-table th {
  background: #f8fafd; color: var(--text-sub); font-weight: 600; text-align: left;
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--primary); }
.data-table th .sort-arrow { font-size: 10px; margin-left: 3px; color: var(--primary); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #eef1f7; color: var(--text-main); }
.data-table tbody tr:nth-child(even) { background: #fafbfe; }
.data-table tbody tr:hover { background: var(--primary-light); }
/* 【整行选择】所有弹出层列表统一：整行点击选中时高亮（选品/选S/N设备/选设备S/N等弹窗共用） */
.data-table tr.row-selected, .data-table tr.row-selected td { background: #e8f0fe !important; }
.data-table .cell-main { font-weight: 600; }
.data-table .cell-sub { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.data-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.data-table .actions { white-space: nowrap; }
/* 【第27步】批量操作：行首复选框列（全选/单选） */
.data-table .ck-cell { width: 34px; padding-left: 12px; padding-right: 4px; text-align: center; }
.data-table .ck-cell input { cursor: pointer; width: 14px; height: 14px; accent-color: var(--primary); }
.btn-batch:disabled { opacity: .5; cursor: not-allowed; }

/* 【第25步】销售单明细表：固定列宽 + 紧凑内边距，保证「数量」列输入框始终完整可见 */
.items-table { table-layout: fixed; min-width: 820px; }
.items-table th, .items-table td { padding: 8px 7px; }
.items-table .input { height: 30px; padding: 3px 6px; font-size: 12.5px; }
.items-table input[name=qty] { width: 100%; min-width: 64px; font-variant-numeric: tabular-nums; }
.items-table input[name=price], .items-table input[name=sn], .items-table input[name=imei] { width: 100%; }
.items-table .it-sub-cell { line-height: 1.35; }
.items-table .sub-sum { font-size: 12px; color: var(--text-light); cursor: pointer; word-break: break-all; }
.items-table .sub-sum.has { color: var(--primary); font-weight: 600; }
.items-table .it-ops { white-space: nowrap; text-align: right; }
.items-table .it-remark-btn { font-size: 13px; opacity: .55; }
/* 【布局统一】明细行备注编辑按钮图标 20px，点击区域同步放大 */
.items-table .it-remark-btn .ic { width: 20px; height: 20px; }
.items-table .it-remark-btn { padding: 2px 4px; }
.items-table .it-remark-btn.has-remark { opacity: 1; }
.items-table .sub-wrap .input { height: 30px; }
.empty-tip { text-align: center; padding: 44px 0; color: var(--text-light); }
.empty-tip .empty-icon { font-size: 38px; margin-bottom: 10px; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gray { background: #eef1f6; color: var(--text-sub); }
.badge.primary { background: var(--primary-light); color: var(--primary); }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 4px 2px; font-size: 13px; color: var(--text-sub); }
.pagination button {
  min-width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: var(--text-main); font-family: inherit;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .page-size { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; }
.pagination .page-size input { width: 62px; height: 30px; padding: 0 6px; text-align: center; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 11px 20px; border-radius: 10px; color: #fff; font-size: 13.5px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px; animation: toastIn .25s ease; max-width: 480px;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #334155; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 26, 46, .45); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px 30px;
  animation: fadeIn .18s ease; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 560px; max-width: 96vw;
  animation: modalIn .22s cubic-bezier(.2,.9,.3,1.2); max-height: calc(100vh - 90px); display: flex; flex-direction: column;
}
.modal.lg { width: 860px; }
.modal.xl { width: 1080px; }
.modal-head { display: flex; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-close { margin-left: auto; border: none; background: none; font-size: 19px; color: var(--text-light); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text-main); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* ---------- 登录页（顺意 ERP 系统）：简约现代背景（PC 优先）+ 可向下滚动查看功能介绍 ----------
   背景为纯 CSS 实现（无外部图片依赖，断网/离线也不会白屏），三层结构：
   ① 底色层：深空底 + 左上新主光 / 右下辅光 / 中部一点青绿点缀，形成对角线光感；
   ② 纹理层：64px 细网格，中心可见、四周淡出（避免整屏网格的廉价感）；
   ③ 动效层：极光扫光缓慢漂移 + 两处柔光呼吸浮动，含蓄不抢焦点。 */
.login-page {
  height: 100vh; overflow-y: auto; overflow-x: hidden; position: relative;
  background: #070c18;
  scroll-behavior: smooth;
}
/* 背景固定层：内容滚动时背景不动 */
.login-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 540px at 13% -8%, rgba(86,124,255,.34), transparent 62%),
    radial-gradient(840px 540px at 97% 106%, rgba(120,72,235,.28), transparent 64%),
    radial-gradient(620px 420px at 76% 16%, rgba(34,176,125,.13), transparent 68%),
    linear-gradient(155deg, #070c18 0%, #0d1730 52%, #080d1c 100%);
}
/* 细网格纹理（中心可见 + 四周渐隐） */
.login-bg .bg-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 76% 60% at 50% 42%, #000 4%, transparent 78%);
  mask-image: radial-gradient(ellipse 76% 60% at 50% 42%, #000 4%, transparent 78%);
}
/* 极光扫光（缓慢漂移 + 轻微旋转） */
.login-bg::before {
  content: ''; position: absolute; left: -18%; top: -26%; width: 138%; height: 92%;
  background: conic-gradient(from 205deg at 50% 50%,
    transparent 0deg, rgba(86,124,255,.20) 58deg, rgba(124,58,237,.16) 138deg, transparent 226deg);
  filter: blur(64px); opacity: .8;
  animation: auroraDrift 28s ease-in-out infinite alternate;
}
/* 顶部渐隐亮线（简约高级感细节） */
.login-bg::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(120,160,255,.5) 22%, rgba(160,120,255,.45) 62%, transparent);
}
@keyframes auroraDrift {
  from { transform: translate3d(-2%, -1%, 0) rotate(-4deg); }
  to   { transform: translate3d(3%, 2%, 0) rotate(6deg); }
}
/* 柔光光斑（沿用原 .bg-blob / .b1~.b3 结构，重定义为低饱和柔光，不再是高饱和模糊球） */
.login-bg .bg-blob { position: absolute; border-radius: 50%; filter: blur(92px); opacity: .5; }
.login-bg .b1 { width: 620px; height: 620px; background: radial-gradient(circle, rgba(86,124,255,.42), transparent 62%); top: -220px; left: -180px; animation: glowFloat1 22s ease-in-out infinite; }
.login-bg .b2 { width: 700px; height: 700px; background: radial-gradient(circle, rgba(124,58,237,.32), transparent 62%); bottom: -280px; right: -200px; animation: glowFloat2 26s ease-in-out infinite; }
.login-bg .b3 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(34,176,125,.24), transparent 64%); top: 34%; left: 52%; animation: glowFloat3 30s ease-in-out infinite; }
@keyframes glowFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(46px,38px) scale(1.1); } }
@keyframes glowFloat2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-52px,-34px) scale(1.08); } }
@keyframes glowFloat3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-34px,-28px) scale(1.12); } }
/* 无障碍：用户系统设置「减少动态效果」时关闭全部装饰动画 */
@media (prefers-reduced-motion: reduce) {
  .login-bg::before, .login-bg .bg-blob, .scroll-hint { animation: none !important; }
}
.login-hero {
  position: relative; z-index: 1; min-height: 100vh; padding: 44px 40px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.scroll-hint { position: relative; z-index: 1; margin-top: 44px; color: #aab7dd; font-size: 13px; letter-spacing: 1px; animation: hintBob 2s ease-in-out infinite; }
@keyframes hintBob { 0%,100% { transform: translateY(0); opacity: .72; } 50% { transform: translateY(7px); opacity: 1; } }
.login-grid { position: relative; z-index: 1; display: flex; gap: 72px; align-items: center; max-width: 1060px; width: 100%; }
/* PC 窄窗口（<980px）：左右分栏改为上下堆叠，保证登录卡片始终完整可见可操作 */
@media (max-width: 980px) {
  .login-hero { padding: 32px 20px 14px; }
  .login-grid { flex-direction: column; gap: 32px; }
  .login-card { width: min(400px, 100%); }
}
.login-brand { color: #fff; flex: 1; }
.login-brand .brand-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand .brand-logo .logo-mark {
  width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
  box-shadow: 0 6px 22px rgba(79,110,247,.55);
}
/* 【第24步】网页内品牌 logo：站点配置上传图片后由 site.js 注入 <img>，铺满图标容器并保持比例 */
.logo-mark .site-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
/* 【第25步】上传 Logo 后容器背景透明（避免深色侧边栏/登录页出现白底或渐变方框）；未上传时保留"顺"字渐变底 */
.logo-mark[data-logo-src] { background: transparent !important; box-shadow: none !important; }
.login-brand h1 { font-size: 34px; letter-spacing: 2px; font-weight: 700; }
.login-brand .brand-sub { font-size: 15px; color: #aab7dd; letter-spacing: 5px; margin-top: 6px; }
.login-features { margin-top: 34px; display: flex; flex-direction: column; gap: 14px; }
.login-features .feat { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #c6d0ec; }
.login-features .feat .f-ico {
  width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.09);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.login-card {
  width: 400px; background: rgba(255,255,255,.97); border-radius: 20px; padding: 38px 36px 32px;
  box-shadow: 0 30px 72px rgba(3,8,24,.62), 0 0 0 1px rgba(255,255,255,.07) inset;
  position: relative; backdrop-filter: blur(6px);
}
.login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-card .login-tip { font-size: 12.5px; color: var(--text-light); margin-bottom: 26px; }
.login-card .form-item { margin-bottom: 16px; }
.login-card .input { height: 44px; font-size: 14px; }
.login-btn { width: 100%; height: 46px; font-size: 15px; justify-content: center; margin-top: 6px; border-radius: 10px; }
.login-foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-light); }
.login-error { background: var(--danger-bg); color: var(--danger); font-size: 12.5px; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; display: flex; gap: 6px; align-items: center; }

/* 登录页下滑区：功能介绍 / 功能预览图文 */
.login-about { position: relative; z-index: 1; padding: 64px 24px 48px; background: rgba(8,14,32,.6); border-top: 1px solid rgba(255,255,255,.08); }
.about-head { max-width: 1020px; margin: 0 auto 30px; color: #fff; }
.about-head h2 { font-size: 26px; letter-spacing: 1px; }
.about-head p { margin-top: 12px; color: #b6c2e0; font-size: 14px; line-height: 1.9; max-width: 840px; }
.about-grid { max-width: 1020px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.about-card { background: rgba(255,255,255,.96); border-radius: 14px; overflow: hidden; box-shadow: 0 14px 34px rgba(3,8,24,.45); transition: transform .2s, box-shadow .2s; }
.about-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(3,8,24,.6); }
.about-preview { height: 110px; background: #eef2f8; border-bottom: 1px solid #e2e8f0; }
.about-preview svg { width: 100%; height: 100%; display: block; }
.about-body { padding: 16px 18px 18px; }
.about-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #1e293b; }
.about-ico { font-size: 17px; }
.about-desc { margin-top: 8px; color: #64748b; font-size: 12.8px; line-height: 1.85; }
.about-more { max-width: 1020px; margin: 24px auto 0; color: #b6c2e0; font-size: 13px; line-height: 2; }
.about-more b { color: #fff; }
.about-foot { max-width: 1020px; margin: 28px auto 0; text-align: center; color: #7d8bb5; font-size: 12px; letter-spacing: 1px; }

/* ---------- 仪表盘 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .s-ico {
  width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-card .s-label { font-size: 12.5px; color: var(--text-sub); }
.stat-card .s-value { font-size: 23px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat-card .s-extra { font-size: 11.5px; margin-top: 3px; color: var(--text-light); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card + .dash-grid { margin-top: 18px; }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-col > .card + .card { margin-top: 0; }
/* 6大业务统计：模块卡按固定列数排布，避免 auto-fill 造成末行留大片空白 */
.biz-cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.biz-charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.chart-empty {
  display: flex; align-items: center; justify-content: center; height: 118px;
  background: #f8fafd; border-radius: 8px; color: var(--text-light); font-size: 12.5px;
}
.chart-empty.sm { height: 74px; }
/* 近7天销售趋势：柱状图固定轨道高度，数值标签不再溢出卡片 */
.trend-bars { display: flex; align-items: flex-end; gap: 14px; padding: 2px 4px 0; }
.trend-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trend-val { font-size: 10.5px; color: var(--text-sub); white-space: nowrap; }
.trend-track { width: 100%; max-width: 56px; height: 122px; background: #f1f4f9; border-radius: 6px; display: flex; align-items: flex-end; }
.trend-fill { width: 100%; min-height: 4px; background: linear-gradient(180deg, #5b7bf7, #3b5bdb); border-radius: 5px; transition: height .4s; }
.trend-day { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }
.chart-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
@media (min-width: 1680px) { .biz-cards-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .biz-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-charts-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) { .biz-cards-grid { grid-template-columns: minmax(0, 1fr); } }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px dashed var(--border); }
.todo-item:last-child { border-bottom: none; }
.todo-item .t-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.todo-item .t-main { flex: 1; min-width: 0; }
.todo-item .t-title { font-size: 13.5px; font-weight: 500; }
.todo-item .t-sub { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.todo-item .t-count { font-size: 20px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.todo-item .t-count.warn { color: var(--danger); }

/* ---------- 模块开关 ---------- */
.switch { position: relative; display: inline-block; width: 42px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 20px; cursor: pointer; transition: .2s;
}
.switch .slider::before {
  content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(19px); }
.switch input:disabled + .slider { opacity: .55; cursor: not-allowed; }

/* ---------- 打印预览 ---------- */
.print-preview { background: #fff; border: 1px solid var(--border); padding: 32px 40px; min-height: 420px; box-shadow: var(--shadow); }
.print-preview h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.print-preview .p-sub { text-align: center; color: var(--text-sub); font-size: 12px; margin-bottom: 18px; }
.print-meta { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 12.5px; margin-bottom: 12px; }
@media print {
  .sidebar, .topbar, .toast-wrap, .modal-head, .modal-foot, .no-print { display: none !important; }
  .modal-mask { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; width: 100%; max-height: none; }
  .modal-body { overflow: visible; padding: 0; }
}

/* ---------- 辅助 ---------- */
.flex { display: flex; align-items: center; gap: 8px; }
.flex1 { flex: 1; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.text-sub { color: var(--text-sub); font-size: 12.5px; }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.loading-block { text-align: center; padding: 60px 0; color: var(--text-light); font-size: 13px; }
.loading-block::before {
  content: ''; display: block; width: 30px; height: 30px; margin: 0 auto 12px;
  border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tag-id { display: inline-block; background: #f1f5f9; color: var(--text-sub); border-radius: 6px; padding: 1px 7px; font-size: 11.5px; }
.money { font-variant-numeric: tabular-nums; }

/* ============ 组织架构树形图（员工管理弹窗） ============ */
.org-tree { max-height: 62vh; overflow: auto; padding: 6px 2px; }
.org-ul, .org-tree ul { list-style: none; margin: 0; padding-left: 22px; position: relative; }
.org-tree > .org-ul { padding-left: 0; }
.org-ul li { position: relative; padding: 3px 0 3px 16px; }
.org-ul li::before { content: ''; position: absolute; left: 4px; top: -6px; bottom: 0; width: 1px; background: #d8dce8; }
.org-ul li::after { content: ''; position: absolute; left: 4px; top: 22px; width: 12px; height: 1px; background: #d8dce8; }
.org-ul > li:first-child::before { top: 22px; }
.org-node { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; margin: 2px 0;
  background: #fff; border: 1px solid #e3e6f0; border-radius: 8px; cursor: grab; user-select: none;
  box-shadow: 0 1px 2px rgba(30,40,90,.05); transition: border-color .15s, box-shadow .15s; }
.org-node:hover { border-color: #7c9bff; box-shadow: 0 2px 8px rgba(59,91,219,.15); }
.org-node.off { opacity: .55; }
.org-node .org-lv { flex: none; font-size: 11px; font-weight: 700; color: #fff; background: #3b5bdb;
  border-radius: 6px; padding: 2px 6px; }
.org-node .cell-sub { font-size: 12px; color: #8a90a8; }
.org-node.drag-over { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.modal-lg { width: min(920px, 94vw); }

/* ============ 权限 Toggle 开关 ============ */
.tg { display: inline-flex; align-items: center; width: 40px; height: 21px; border-radius: 21px;
  background: #c9cede; cursor: pointer; position: relative; transition: background .18s; flex: none; }
.tg::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .18s; }
.tg.on { background: #16a34a; }
.tg.on::after { left: 21px; }
.tg.disabled { opacity: .45; cursor: not-allowed; }

/* 表头全选开关与文字垂直居中对齐 */
.data-table th .th-inline { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; white-space: nowrap; }
.data-table th .tg { vertical-align: middle; }

/* 侧边栏底部版本号 */
.sidebar-ver { margin-top: auto; padding: 10px 18px 6px; font-size: 10.5px; color: rgba(255,255,255,.35); letter-spacing: .4px; }
.sidebar { display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; overflow-y: auto; }

/* ============ 系统公告悬浮组件（右下角可折叠 + 未读红点） ============ */
.announce-widget { position: fixed; right: 22px; bottom: 22px; z-index: 900; }
.announce-fab { position: relative; width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #4f6ef7, #3450c4); color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 6px 20px rgba(59,91,219,.4); display: flex; align-items: center; justify-content: center;
  transition: transform .18s, box-shadow .18s; }
.announce-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(59,91,219,.5); }
.announce-fab .announce-bell { display: block; pointer-events: none; }
.announce-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px #fff; font-weight: 600; }
.announce-fab.has-unread { animation: announce-pulse 1.8s ease-in-out infinite; }
@keyframes announce-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(59,91,219,.4); }
  50% { box-shadow: 0 6px 22px rgba(239,68,68,.55); }
}
.announce-panel { position: absolute; right: 0; bottom: 64px; width: 380px; max-width: 88vw;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column; animation: announce-in .16s ease-out; }
@keyframes announce-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.announce-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px;
  background: linear-gradient(135deg, #eef1fd, #f7f9ff); border-bottom: 1px solid var(--border); }
.announce-head-title { font-weight: 700; font-size: 14px; color: var(--text-main); }
.announce-head-sub { font-size: 11.5px; color: var(--text-sub); flex: 1; }
.announce-close { border: none; background: transparent; cursor: pointer; color: var(--text-light); font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.announce-close:hover { background: #e5e9f2; color: var(--text-main); }
.announce-tools { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.announce-list { max-height: 52vh; overflow-y: auto; padding: 6px 10px; }
.announce-item { border: 1px solid var(--border); border-left: 3px solid #cbd5e1; border-radius: 10px;
  padding: 10px 12px; margin: 8px 2px; background: #fff; transition: box-shadow .15s, border-color .15s; cursor: pointer; }
.announce-item:hover { box-shadow: var(--shadow); border-color: #cfd6ea; }
.announce-item.unread { border-left-color: var(--primary); background: #fbfcff; }
.announce-item-head { display: flex; align-items: center; gap: 6px; }
.announce-title { font-weight: 600; font-size: 13.5px; color: var(--text-main); flex: 1; }
.announce-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; flex: none; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.announce-meta { font-size: 11.5px; color: var(--text-light); margin-top: 3px; }
.announce-content { font-size: 12.5px; color: var(--text-sub); margin-top: 6px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.announce-actions { display: flex; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.announce-pop-tip { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
.announce-pop-list { max-height: 56vh; overflow-y: auto; }
.announce-pop-item { border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fbfcff; }
.announce-pop-title { font-weight: 600; font-size: 13.5px; }
.announce-pop-content { font-size: 12.5px; color: var(--text-sub); margin-top: 6px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }

/* ---------- 密码可视（眼睛按钮：明文/密文切换） ---------- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > .input { width: 100%; padding-right: 40px; box-sizing: border-box; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-light); cursor: pointer;
}
.pw-toggle:hover { color: var(--text-main); background: rgba(148,163,184,.16); }
.pw-toggle svg { display: block; }
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle.on .pw-eye { display: none; }
.pw-toggle.on .pw-eye-off { display: block; }

/* ---------- 内联 SVG 图标（替代 emoji，不依赖系统 emoji 字体） ---------- */
.ic{width:1em;height:1em;vertical-align:-0.125em;display:inline-block;flex-shrink:0}
.ic.lg{width:1.25em;height:1.25em}
.ic.xl{width:2em;height:2em}

/* ---------- 页面头部公告条（每页 page-head 上方，最新公告自动滚动轮播） ---------- */
.announce-topbar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 7px 14px;
  border: 1px solid #dbe4f0; border-left: 4px solid var(--primary);
  border-radius: 10px; background: linear-gradient(90deg, #f6f9ff, #fbfcff);
  cursor: pointer; overflow: hidden; min-height: 34px; box-sizing: border-box;
}
.announce-topbar:hover { border-color: var(--primary); background: #f0f5ff; }
.announce-topbar .atb-label {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700; color: var(--primary); white-space: nowrap;
}
.announce-topbar .atb-track { flex: 1; overflow: hidden; min-width: 0; position: relative; height: 1.6em; }
.announce-topbar .atb-run {
  position: absolute; top: 50%; left: 0; white-space: nowrap; display: inline-flex;
  transform: translateY(-50%); will-change: transform;
}
.announce-topbar .atb-text { flex: 0 0 auto; padding-right: 48px; font-size: 13px; color: var(--text-main); }
.announce-topbar .atb-run.marquee {
  /* 无缝轮播：两份内容各占 50%，位移 -50% 循环，无论内容长短始终滚动可见（30s 舒缓速度） */
  animation: announce-marquee 30s linear infinite;
}
.announce-topbar .atb-run.marquee:hover { animation-play-state: paused; }
@keyframes announce-marquee {
  0% { transform: translateY(-50%) translateX(0); }
  100% { transform: translateY(-50%) translateX(-50%); }
}

/* ---------- 列表保存/操作后行高亮定位 ---------- */
@keyframes rowFlash { 0% { background-color: #fff3bf; } 100% { background-color: transparent; } }
.row-flash { animation: rowFlash 2.8s ease-out; }

/* ---------- 备注列：过长截断，hover 显示全文（title） ---------- */
.remark-td {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
