/* ============ Apple UI 主题变量 ============ */
:root, [data-theme="classic"] {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f5f5f7;
  --border: #e8e8ed; --border-strong: #d2d2d7;
  --text: #1d1d1f; --text-2: #47474c; --muted: #74747c;
  --primary: #0071e3; --primary-dark: #005bb5; --primary-soft: #eef5ff;
  --teal: #0d9488; --green: #34a853; --green-soft: #e9f7ef;
  --orange: #e8820c; --orange-soft: #fff6e9; --red: #d93025; --red-soft: #fceceb;
  --purple: #8b5cf6; --purple-soft: #f2ecff;
  --sidebar-bg: #fbfbfd; --hover-bg: #efeff4; --active-soft: #eaf3ff;
  --primary-rgb: 0,113,227; --primary-border: #dbe9ff;
  --brand-a: #0a84ff; --brand-b: #0071e3; --brand-c: #005bb5;
  --welcome-grad: linear-gradient(115deg, #0a84ff 0%, #0071e3 48%, #005bb5 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.16); --radius: 16px;
}

/* ---- 8 套个性化色调（覆盖 :root 变量，data-theme 写在 <html> 上） ---- */
[data-theme="forest"] {
  --bg: #f4f8f5; --surface: #ffffff; --surface-2: #f1f7f3;
  --border: #e3eee7; --border-strong: #cfe2d5;
  --text: #16241c; --text-2: #3d5144; --muted: #7a8c80;
  --primary: #12805c; --primary-dark: #0b6247; --primary-soft: #e7f5ee;
  --teal: #0f766e; --green: #16a34a; --green-soft: #e9f7ef;
  --sidebar-bg: #f7fbf8; --hover-bg: #eaf4ee; --active-soft: #e7f5ee;
  --primary-rgb: 18,128,92; --primary-border: #cfeadd;
  --brand-a: #1aa87a; --brand-b: #12805c; --brand-c: #0b6247;
  --welcome-grad: linear-gradient(115deg, #1aa87a 0%, #12805c 48%, #0b6247 100%);
}
[data-theme="violet"] {
  --bg: #f7f5fb; --surface: #ffffff; --surface-2: #f3effa;
  --border: #eae4f3; --border-strong: #d9cfe9;
  --text: #211b2e; --text-2: #4b4360; --muted: #857c98;
  --primary: #7b4ede; --primary-dark: #6338bd; --primary-soft: #f1ebfd;
  --teal: #0d9488; --green: #34a853; --green-soft: #e9f7ef;
  --sidebar-bg: #fbf9fe; --hover-bg: #f0ebfa; --active-soft: #f1ebfd;
  --primary-rgb: 123,78,222; --primary-border: #e2d6f8;
  --brand-a: #9a73f0; --brand-b: #7b4ede; --brand-c: #6338bd;
  --welcome-grad: linear-gradient(115deg, #9a73f0 0%, #7b4ede 48%, #6338bd 100%);
}
[data-theme="sunset"] {
  --bg: #fbf7f4; --surface: #ffffff; --surface-2: #fbf2ea;
  --border: #f2e7dd; --border-strong: #e8d8c8;
  --text: #2b211a; --text-2: #5c4a3c; --muted: #9b8878;
  --primary: #d2691e; --primary-dark: #ab4f11; --primary-soft: #fdf0e5;
  --teal: #0d9488; --green: #34a853; --green-soft: #e9f7ef;
  --sidebar-bg: #fdfaf7; --hover-bg: #f9efe5; --active-soft: #fdf0e5;
  --primary-rgb: 210,105,30; --primary-border: #f7ddc5;
  --brand-a: #f09455; --brand-b: #d2691e; --brand-c: #ab4f11;
  --welcome-grad: linear-gradient(115deg, #f09455 0%, #d2691e 48%, #ab4f11 100%);
}
[data-theme="rose"] {
  --bg: #fbf5f7; --surface: #ffffff; --surface-2: #fbeef2;
  --border: #f3e4e9; --border-strong: #ebd0d9;
  --text: #2c1c22; --text-2: #5c414b; --muted: #9b7f89;
  --primary: #d63464; --primary-dark: #ad234d; --primary-soft: #fceaf0;
  --teal: #0d9488; --green: #34a853; --green-soft: #e9f7ef;
  --sidebar-bg: #fdf9fb; --hover-bg: #f9ebf0; --active-soft: #fceaf0;
  --primary-rgb: 214,52,100; --primary-border: #f6cfdd;
  --brand-a: #ee6e96; --brand-b: #d63464; --brand-c: #ad234d;
  --welcome-grad: linear-gradient(115deg, #ee6e96 0%, #d63464 48%, #ad234d 100%);
}
[data-theme="ocean"] {
  --bg: #f3f8fa; --surface: #ffffff; --surface-2: #eaf4f8;
  --border: #e0edf2; --border-strong: #c9dfe8;
  --text: #172630; --text-2: #3e5561; --muted: #7b909b;
  --primary: #0e7c9b; --primary-dark: #0a6079; --primary-soft: #e6f3f8;
  --teal: #0d9488; --green: #34a853; --green-soft: #e9f7ef;
  --sidebar-bg: #f7fbfd; --hover-bg: #e7f2f7; --active-soft: #e6f3f8;
  --primary-rgb: 14,124,155; --primary-border: #cbe6f0;
  --brand-a: #22a8cf; --brand-b: #0e7c9b; --brand-c: #0a6079;
  --welcome-grad: linear-gradient(115deg, #22a8cf 0%, #0e7c9b 48%, #0a6079 100%);
}
/* 夜间黑（真正的深色模式：背景/前景整体反转，主色用较亮的蓝保证对比度） */
[data-theme="dark"] {
  --bg: #121317; --surface: #1c1e24; --surface-2: #252830;
  --border: #343842; --border-strong: #474c58;
  --text: #f2f3f7; --text-2: #c9cdd6; --muted: #979da9;
  --primary: #4d9fff; --primary-dark: #7dbaff; --primary-soft: #1b2c42;
  --teal: #35c6b4; --green: #4cd07f; --green-soft: #1b3328;
  --orange: #f0a742; --orange-soft: #3a2d1a; --red: #ff6259; --red-soft: #3d2322;
  --purple: #c4a6ff; --purple-soft: rgba(139,92,246,.2);
  --sidebar-bg: #17191e; --hover-bg: #282c35; --active-soft: #1b2c42;
  --primary-rgb: 77,159,255; --primary-border: #2f4b6b;
  --brand-a: #4d9fff; --brand-b: #2f80ed; --brand-c: #1f5fb0;
  --welcome-grad: linear-gradient(115deg, #2b3a52 0%, #1f2b3d 48%, #161d29 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.26);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}
/* 琥珀金（暖黄商务色，与暖阳橙区分） */
[data-theme="amber"] {
  --bg: #faf8f3; --surface: #ffffff; --surface-2: #f5f0e6;
  --border: #eee7d8; --border-strong: #ded2b8;
  --text: #2c2517; --text-2: #554936; --muted: #8d8069;
  --primary: #a8760b; --primary-dark: #835c05; --primary-soft: #faf2df;
  --teal: #0d9488; --green: #34a853; --green-soft: #e9f7ef;
  --orange: #d9820c; --orange-soft: #fff4e5; --red: #d93025; --red-soft: #fceceb;
  --sidebar-bg: #fdfbf6; --hover-bg: #f6f0e3; --active-soft: #faf2df;
  --primary-rgb: 168,118,11; --primary-border: #ebdcb8;
  --brand-a: #e0aa3c; --brand-b: #a8760b; --brand-c: #835c05;
  --welcome-grad: linear-gradient(115deg, #e0aa3c 0%, #a8760b 48%, #835c05 100%);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; letter-spacing: .01em; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
::selection { background: rgba(var(--primary-rgb),.18); }

/* ============ 布局 ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex-shrink: 0; background: var(--sidebar-bg); border-right: 1px solid var(--border); color: var(--text-2); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px; border-bottom: 1px solid var(--border); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; overflow: hidden; background: transparent; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { color: var(--text); font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 10px; color: var(--muted); letter-spacing: 1.4px; margin-top: 3px; }
.nav-label { padding: 22px 22px 8px; font-size: 11px; color: var(--muted); letter-spacing: .8px; font-weight: 600; }
.side-nav { padding: 0 12px; flex: 1; overflow-y: auto; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 3px 0; background: transparent; color: var(--text-2); border: 0; border-radius: 10px; font-size: 13.5px; text-align: left; transition: background .16s, color .16s; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; transition: color .16s; }
.nav-item:not(.disabled):not(.active):hover { background: var(--hover-bg); color: var(--text); }
.nav-item:not(.disabled):not(.active):hover svg { color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; box-shadow: inset 0 0 0 1px var(--primary-border); }
.nav-item.active svg { color: var(--primary); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 2px; background: var(--primary); }
.nav-item.disabled { opacity: .42; }
.nav-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item small { font-size: 10px; background: #eeeef3; color: var(--muted); padding: 2px 7px; border-radius: 5px; }

/* ---- 分组菜单（伸缩） ---- */
.sidebar-toggle { width: 26px; height: 26px; margin-left: auto; flex-shrink: 0; display: grid; place-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--muted); transition: .16s; }
.sidebar-toggle svg { width: 16px; height: 16px; transition: transform .24s ease; }
.sidebar-toggle:hover { background: var(--hover-bg); color: var(--text); }
.nav-group { margin: 8px 0 2px; }
.nav-group-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: transparent; border: 0; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 600; letter-spacing: .4px; text-align: left; transition: .16s; }
.nav-group-head:hover { background: var(--hover-bg); color: var(--text); }
.ng-icon { width: 18px; height: 18px; display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.ng-icon svg { width: 17px; height: 17px; }
.nav-group-head:hover .ng-icon, .nav-group.has-active .ng-icon { color: var(--primary); }
.ng-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ng-caret { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); transition: transform .24s ease; }
.nav-group:not(.collapsed) > .nav-group-head .ng-caret { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-head { color: var(--primary); }
.ng-soon { font-size: 9.5px; font-weight: 500; color: var(--muted); background: #eeeef3; padding: 2px 6px; border-radius: 5px; }
.ng-badge { margin-right: 2px; }
.nav-group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .26s cubic-bezier(.4,0,.2,1); }
.nav-group.collapsed .nav-group-body { grid-template-rows: 0fr; }
.nav-group-inner { overflow: hidden; padding-left: 12px; margin-left: 15px; border-left: 1px solid var(--border); }
.nav-group-inner .nav-item { font-size: 13.5px; padding: 8px 12px; }
.nav-group-inner .nav-item.active::before { left: -16px; height: 16px; }

/* 侧栏整体收起（图标态） */
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed + .sidebar-mask + .main-area { margin-left: 72px; }
.main-area { transition: margin-left .24s ease; }
.sidebar.collapsed .brand { padding: 18px 0; justify-content: center; }
.sidebar.collapsed .brand-text { display: none; }
.sidebar.collapsed .sidebar-toggle { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); margin: 0; background: var(--hover-bg); width: 30px; height: 22px; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .nav-label { text-align: center; font-size: 0; padding: 44px 0 6px; }
.sidebar.collapsed .nav-item, .sidebar.collapsed .nav-group-head { justify-content: center; padding: 11px 0; }
.sidebar.collapsed .nav-item span, .sidebar.collapsed .nav-item small,
.sidebar.collapsed .nav-item .nav-badge, .sidebar.collapsed .nav-item .nav-cake-badge, .sidebar.collapsed .ng-label, .sidebar.collapsed .ng-caret,
.sidebar.collapsed .ng-soon, .sidebar.collapsed .ng-badge { display: none !important; }
.sidebar.collapsed .nav-item.active::before { display: none; }
.sidebar.collapsed .nav-group-inner { padding-left: 0; margin-left: 0; border-left: 0; }
.sidebar.collapsed .nav-group { margin-bottom: 6px; }
.sidebar.collapsed .sidebar-bottom { padding: 12px 0; display: grid; place-items: center; }
.sidebar.collapsed .role-card { background: transparent; border: 0; padding: 0; }
.sidebar.collapsed .role-card p { display: none; }
.sidebar.collapsed .role-badge { width: 38px; height: 38px; min-width: 38px; padding: 0; justify-content: center; font-size: 0; border-radius: 50%; box-shadow: var(--shadow); }
.sidebar.collapsed .role-badge::after { content: attr(data-short); font-size: 16px; font-weight: 600; line-height: 1; }
.sidebar.collapsed .nav-item[data-tip]:hover::after, .sidebar.collapsed .nav-group-head[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: #1d1d1f; color: #fff; font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 7px; z-index: 60; pointer-events: none; box-shadow: var(--shadow-lg); }
.nav-item[data-tip], .nav-group-head[data-tip] { position: relative; }

.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); }
.tip-card { display: flex; gap: 9px; background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 11px; padding: 11px; }
.tip-card svg { color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.tip-card p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--text-2); }
.tip-card strong { color: var(--primary-dark); }
.sidebar-mask { display: none; }
.main-area { flex: 1; margin-left: 260px; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 28px; gap: 14px; position: sticky; top: 0; z-index: 20; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.breadcrumb b { color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding-left: 14px; margin-left: 6px; border-left: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.menu-btn { display: none !important; }
.content { padding: 30px 32px 44px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.page-head p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-heading h1 { font-size: 28px; margin: 0 0 6px; font-weight: 700; letter-spacing: -.02em; }
.page-heading p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.date-chip { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 13px; font-size: 12px; color: var(--text-2); box-shadow: var(--shadow); }

/* ============ 统计卡片 ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
/* 仓储中心五态统计卡：固定一行展示，窄屏横向滚动 */
#whGzStats, #whFsStats, #whRecordsStats {
  grid-template-columns: repeat(5, minmax(148px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}
#whGzStats .stat-card, #whFsStats .stat-card, #whRecordsStats .stat-card { padding: 15px 16px; gap: 10px; min-width: 0; }
#whGzStats .stat-info strong, #whFsStats .stat-info strong, #whRecordsStats .stat-info strong { font-size: 24px; }
#whGzStats .stat-card::after, #whFsStats .stat-card::after, #whRecordsStats .stat-card::after { width: 66px; height: 66px; right: -18px; top: -18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -24px; top: -24px; width: 88px; height: 88px; border-radius: 50%; opacity: .6; }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.stat-info { display: flex; flex-direction: column; line-height: 1.25; }
.stat-info span { font-size: 12.5px; color: var(--text-2); }
.stat-info strong { font-size: 28px; font-weight: 700; color: var(--text); margin: 3px 0; letter-spacing: -.02em; }
.stat-info small { font-size: 11px; color: var(--muted); }
.stat-blue .stat-icon { background: var(--primary-soft); color: var(--primary); } .stat-blue::after { background: var(--primary-soft); }
.stat-teal .stat-icon { background: #e6faf7; color: #0d9488; } .stat-teal::after { background: #e6faf7; }
.stat-green .stat-icon { background: var(--green-soft); color: var(--green); } .stat-green::after { background: var(--green-soft); }
.stat-orange .stat-icon { background: var(--orange-soft); color: var(--orange); } .stat-orange::after { background: var(--orange-soft); }

/* ============ 工作区 ============ */
.workspace { display: grid; grid-template-columns: 268px 1fr; gap: 18px; align-items: start; }
.dept-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px; border-bottom: 1px solid var(--border); }
.panel-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.panel-title svg { color: var(--primary); }
.dept-search { display: flex; align-items: center; gap: 8px; margin: 12px; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.dept-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 12.5px; color: var(--text); }
.tree-scroll { max-height: 560px; overflow-y: auto; padding: 0 8px 12px; }
.tree-node { display: flex; align-items: center; gap: 5px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); position: relative; transition: .14s; }
.tree-node:hover { background: var(--surface-2); }
.tree-node.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.tree-toggle { width: 16px; height: 16px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); padding: 0; flex-shrink: 0; }
.tree-toggle.placeholder { pointer-events: none; }
.tree-icon { color: var(--muted); flex-shrink: 0; }
.tree-node.active .tree-icon { color: var(--primary); }
.tree-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-count { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); padding: 0 7px; border-radius: 10px; min-width: 22px; text-align: center; }
.tree-node.active .tree-count { background: #fff; border-color: #cfe2ff; color: var(--primary); }
.tree-actions { display: none; gap: 1px; }
.tree-node:hover .tree-actions { display: flex; }
.tree-actions button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 5px; padding: 0; }
.tree-actions button:hover { background: #eeeef3; color: var(--text); }
.tree-actions button.del:hover { background: var(--red-soft); color: var(--red); }
.all-node { border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 6px; padding-bottom: 10px; }
.tree-divider { font-size: 10.5px; color: var(--muted); letter-spacing: .5px; padding: 4px 8px 6px; }
.tree-drag-tip { font-size: 10px; color: var(--muted); padding: 0 8px 6px; line-height: 1.4; }
.tree-node[draggable="true"] { cursor: grab; }
.tree-node.dragging { opacity: .4; }
.tree-drag { width: 12px; flex-shrink: 0; color: #c4c9d4; font-size: 12px; letter-spacing: -3px; cursor: grab; user-select: none; }
.tree-node:hover .tree-drag { color: var(--primary); }
.tree-node.drop-before::before, .tree-node.drop-after::after { content: ''; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--primary); border-radius: 2px; z-index: 2; }
.tree-node.drop-before::before { top: -1px; }
.tree-node.drop-after::after { bottom: -1px; }
.tree-node.drop-into { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.tree-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0; }
.dept-panel-foot { display: flex; align-items: center; gap: 6px; padding: 11px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* 人员列表 */
.emp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.emp-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 16px; gap: 12px; flex-wrap: wrap; }
.emp-title { display: flex; align-items: center; gap: 9px; }
.emp-title svg { color: var(--primary); }
.emp-title h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.emp-subcount { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 3px 9px; border-radius: 10px; font-weight: 600; }
.emp-desc { margin: 6px 0 0 29px; font-size: 12px; color: var(--muted); }
.emp-head-actions { display: flex; gap: 8px; }
.emp-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 22px 16px; gap: 12px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 9px 12px; color: var(--muted); width: 380px; max-width: 100%; background: var(--surface); transition: .16s; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.12); }
.search-box input { border: 0; outline: none; flex: 1; font-size: 12.5px; color: var(--text); min-width: 0; }
.search-box button { border: 0; background: transparent; color: var(--muted); padding: 0; display: grid; place-items: center; }
.status-tabs { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.status-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); transition: .15s; }
.status-tabs button.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.data-table th { text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 11.5px; border-bottom: 1px solid var(--border); }
.data-table th:first-child, .data-table td:first-child { padding-left: 22px; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f0f0f4; color: var(--text-2); }
.data-table tbody tr { transition: background .14s; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.th-right { text-align: right !important; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--text-2); }
.cell-person { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 0; text-align: left; }
.person-meta { display: flex; flex-direction: column; line-height: 1.3; }
.person-meta b { color: var(--text); font-size: 13px; }
.person-meta small { color: var(--muted); font-size: 10.5px; }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); color: #fff; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.avatar.female { background: linear-gradient(135deg, #ff7eb0, #e8508c); }
.avatar.sm { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.dept-tag { background: var(--primary-soft); color: var(--primary-dark); padding: 3px 9px; border-radius: 6px; font-size: 11.5px; }
.level-tag { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.在职 { background: var(--green-soft); color: var(--green); }
.status-badge.试用 { background: var(--primary-soft); color: var(--primary); }
.status-badge.离职 { background: var(--surface-2); color: var(--muted); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 7px; transition: .14s; }
.row-actions button:hover { background: var(--primary-soft); color: var(--primary); }
.row-actions button.del:hover { background: var(--red-soft); color: var(--red); }
/* 仓储中心表格操作列：文字按钮不被通用 icon-btn 样式压缩 */
.wh-table .row-actions { gap: 6px; flex-wrap: wrap; }
.wh-table .row-actions button.btn { width: auto; height: auto; display: inline-flex; padding: 5px 10px; font-size: 11.5px; white-space: nowrap; }
.wh-table td .muted { font-size: 11px; color: var(--muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 0; color: var(--muted); }
.empty-state p { margin: 0; font-size: 13px; }

/* ---- 分页（重新设计：当前页 / 普通页 / 禁用态三级区分） ---- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.pagination b { color: var(--text); font-weight: 600; }
.page-btns { display: flex; gap: 6px; }
.page-btns button { min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 8px; font-size: 12.5px; font-weight: 500; display: grid; place-items: center; transition: all .16s ease; }
.page-btns button:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.page-btns button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(var(--primary-rgb),.25); }
.page-btns button:disabled { color: #a9a9b0; border-color: #f0f0f4; background: #fafafa; opacity: 1; }

/* ============ 按钮 ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 17px; border-radius: 9px; border: 1px solid transparent; font-size: 13px; font-weight: 600; transition: all .16s ease; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(var(--primary-rgb),.22); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--primary-rgb),.28); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b3261e; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-2); border-radius: 8px; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.primary { background: var(--primary-soft); color: var(--primary); }
.icon-btn.primary:hover { background: var(--primary-border); }

/* ============ 弹窗 ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.36); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fade .18s ease; }
.modal { width: 100%; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.8,.3,1); max-height: 90vh; display: flex; flex-direction: column; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { transform: translateY(10px) scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal-header p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.optpl-autosave-hint { margin-right: auto; align-self: center; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.optpl-autosave-hint::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.optpl-autosave-hint.saving { color: var(--primary); }
.optpl-autosave-hint.saved { color: var(--green); }
.optpl-autosave-hint.error { color: var(--red); }
.optpl-autosave-hint.pending { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: span 2; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-label em { color: var(--red); font-style: normal; margin-left: 3px; }
.input { width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 7px; font-size: 13px; color: var(--text); background: var(--surface); outline: none; transition: .16s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.14); }
.input::placeholder { color: #8e8e95; }
.input:hover:not(:focus) { border-color: var(--primary-border, var(--primary)); }
select.input { cursor: pointer; }
/* textarea 最少两行、随内容增高（JS 自适应）；PDF 模板源码编辑框固定高度不参与 */
textarea.input { resize: vertical; min-height: calc(2 * 1.45em + 16px); line-height: 1.45; overflow-y: hidden; transition: border-color .16s, box-shadow .16s; }
textarea.input.pt-html-editor { min-height: 340px !important; overflow-y: auto; }
.form-grid { gap: 18px 18px; }
.field-label { letter-spacing: .01em; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.detail-profile { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.detail-profile h2 { margin: 0; font-size: 20px; }
.detail-profile p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.detail-profile .status-badge { margin-left: auto; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; margin-top: 18px; }
.detail-item { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.detail-item.full { grid-column: span 2; }
.detail-key { font-size: 11px; color: var(--muted); }
.detail-val { font-size: 13px; color: var(--text); font-weight: 500; }
.confirm-body { display: flex; gap: 15px; align-items: flex-start; }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.confirm-icon.danger { background: var(--red-soft); color: var(--red); }
.confirm-body p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.7; white-space: pre-line; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: rgba(29,29,31,.94); backdrop-filter: blur(10px); color: #fff; padding: 11px 20px; border-radius: 12px; display: flex; align-items: center; gap: 9px; font-size: 13px; box-shadow: var(--shadow-lg); z-index: 200; animation: toastIn .25s ease; }
.toast.error { background: rgba(180,38,30,.95); }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }

/* ============ 响应式 ============ */
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-mask.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.36); z-index: 35; }
  .main-area, .sidebar.collapsed + .sidebar-mask + .main-area { margin-left: 0; }
  .sidebar.collapsed { width: 260px; }
  .sidebar.collapsed .brand { padding: 22px 20px; justify-content: flex-start; }
  .sidebar.collapsed .brand-text, .sidebar.collapsed .ng-label, .sidebar.collapsed .ng-caret,
  .sidebar.collapsed .ng-soon, .sidebar.collapsed .ng-badge, .sidebar.collapsed .nav-item span { display: initial; }
  .sidebar.collapsed .brand-text { display: flex; }
  .sidebar.collapsed .sidebar-toggle { display: none; }
  .sidebar.collapsed .nav-item, .sidebar.collapsed .nav-group-head { justify-content: flex-start; padding: 10px 12px; }
  .sidebar.collapsed .nav-group-inner { padding-left: 12px; margin-left: 15px; border-left: 1px solid var(--border); }
  .menu-btn { display: grid !important; }
  .workspace { grid-template-columns: 1fr; }
  .dept-panel { order: -1; }
  .tree-scroll { max-height: 240px; }
}
@media (max-width: 600px) {
  .content { padding: 20px 14px 30px; }
  .topbar { padding: 0 14px; }
  .user-name { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 42px; height: 42px; }
  .stat-info strong { font-size: 23px; }
  .page-heading h1 { font-size: 23px; }
  .page-head h1 { font-size: 23px; }
  .page-head { margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: span 1; }
  .emp-head, .emp-toolbar { padding-left: 14px; padding-right: 14px; }
  .search-box { width: 100%; }
  .date-chip { display: none; }
}

/* ============================================================
   登录权限 + 头像功能 新增样式
   ============================================================ */

/* ---- 顶栏用户下拉菜单 ---- */
.user-menu { position: relative; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding: 5px 8px 5px 14px; margin-left: 6px; border-left: 1px solid var(--border); background: transparent; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 9px; color: var(--text-2); transition: .15s; }
.topbar-user:hover { background: var(--surface-2); }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-meta b { font-size: 13px; color: var(--text); }
.user-meta small { font-size: 10.5px; color: var(--muted); }
.user-caret { color: var(--muted); transition: transform .18s; }
.user-menu.open .user-caret { transform: rotate(180deg); }
.user-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s; z-index: 60; }
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: none; }
.ud-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.ud-head b { display: block; font-size: 13.5px; color: var(--text); }
.ud-head small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ud-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; font-size: 12.5px; color: var(--text-2); text-align: left; transition: .14s; }
.ud-item svg { width: 16px; height: 16px; color: var(--muted); }
.ud-item:hover { background: var(--surface-2); color: var(--text); }
.ud-item:hover svg { color: var(--primary); }
.ud-item.danger:hover { background: var(--red-soft); color: var(--red); }
.ud-item.danger:hover svg { color: var(--red); }
.ud-divider { height: 1px; background: var(--border); margin: 5px 4px; }

/* 头像为图片时：圆形/方形裁剪填充 */
img.avatar { object-fit: cover; display: grid; }

/* ---- 侧边栏角色卡 ---- */
.role-card { background: linear-gradient(135deg, var(--primary-soft), var(--green-soft)); border: 1px solid var(--primary-border); border-radius: 12px; padding: 12px; }
.role-card-top { margin-bottom: 6px; }
.role-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: rgba(var(--primary-rgb),.12); color: var(--primary-dark); border: 1px solid rgba(var(--primary-rgb),.18); }
.role-card p { margin: 0; font-size: 11px; line-height: 1.6; color: var(--text-2); }

/* ---- 页面视图切换 ---- */
.view-section { animation: fade .22s ease; }

/* ---- 角色概览 ---- */
.role-manage-wrap { margin: 4px 0 20px; scroll-margin-top: 16px; }
.account-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.account-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.account-head .emp-title h2 { font-size: 16px; }
.role-badge.role-admin { background: #f3eaff; color: #7c3aed; border-color: #e9d9ff; }
.role-badge.role-hr { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary-border); }
.role-badge.role-manager { background: #e6faf7; color: #0d9488; border-color: #cdf0ea; }
.role-badge.role-employee { background: var(--orange-soft); color: var(--orange); border-color: #ffe6c7; }

/* ---- 个人资料 ---- */
.profile-hero { display: flex; align-items: center; gap: 16px; }
.profile-hero h2 { margin: 0; font-size: 21px; }
.profile-hero p { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.profile-role { display: inline-flex; padding: 3px 11px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--primary-soft); color: var(--primary-dark); }
.avatar.xl { width: 68px; height: 68px; border-radius: 18px; font-size: 26px; }

/* ---- 头像编辑器 ---- */
.avatar-editor { display: flex; gap: 22px; align-items: center; }
.avatar-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.avatar-preview { width: 140px; height: 140px; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); display: grid; place-items: center; color: #fff; font-size: 52px; font-weight: 600; border: 3px solid var(--surface); box-shadow: var(--shadow-lg); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview-label { font-size: 11px; color: var(--muted); }
.avatar-editor-controls { flex: 1; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.avatar-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 0; }
.avatar-file-btn { position: relative; cursor: pointer; }
.detail-avatar-edit { margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); color: var(--primary); border-radius: 9px; transition: .14s; }
.detail-avatar-edit:hover { background: var(--primary-soft); }

@media (max-width: 1100px) { .role-legend { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .user-meta { display: none; }
  .avatar-editor { flex-direction: column; }
  .role-legend { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* 确保 HTML hidden 属性优先于组件 display 样式 */
[hidden] { display: none !important; }

/* ============================================================
   入职建账号 + 角色权限配置 新增样式
   ============================================================ */

/* 员工表单分区标题 */
.form-section-title { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px dashed var(--border-strong); font-size: 13.5px; font-weight: 700; color: var(--primary-dark); }
.form-section-title small { font-size: 11px; font-weight: 400; color: var(--muted); }

/* 角色权限配置面板 */
.perm-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); flex-wrap: wrap; }
.perm-head .emp-title h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.perm-head .emp-title h2::before { content: ''; width: 4px; height: 16px; border-radius: 3px; background: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.10); }
.perm-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.perm-head-right .search-box.sm { width: 300px; }
.perm-no-match { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; margin-bottom: 16px; }
.perm-body { padding: 16px 20px 20px; }
.perm-role-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.perm-role-desc b { color: var(--primary-dark); }
.perm-group { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-title { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(var(--primary-rgb),.10), rgba(var(--primary-rgb),.02)); }
.perm-group-index { display: inline-grid; place-items: center; min-width: 24px; height: 20px; border-radius: 6px; background: var(--surface); border: 1px solid var(--primary-border); color: var(--primary); font-size: 10px; font-weight: 700; }
.perm-group-title b { font-size: 12.5px; color: var(--text); }
.perm-group-title em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); }
.perm-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding: 10px; }
.perm-item { display: flex; align-items: center; gap: 9px; min-height: 56px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); cursor: pointer; transition: .14s; }
.perm-item:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.perm-item.is-checked { border-color: rgba(13,148,136,.38); background: rgba(13,148,136,.10); }
.perm-item input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.perm-item-text { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; }
.perm-item-text b { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.35; word-break: break-word; overflow-wrap: anywhere; }
.perm-sub { font-style: normal; font-size: 10px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 5px; padding: 1px 5px; white-space: nowrap; }
.perm-item code { flex: 0 1 auto; max-width: 52%; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; }
.perm-item.locked { opacity: .68; cursor: not-allowed; border-style: dashed; background: transparent; }
.perm-item.locked input { cursor: not-allowed; }
.perm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.perm-auto-hint { color: var(--teal); font-weight: 600; transition: color .16s; }
.perm-hint { font-size: 11.5px; color: var(--muted); }
.perm-foot .btn { min-width: 110px; }

/* 角色概览区标题 */
.role-legend-head { display: flex; align-items: center; gap: 9px; margin: 2px 0 10px; font-size: 11.5px; color: var(--muted); }
.role-legend-head b { font-size: 12.5px; color: var(--text); font-weight: 700; }
.role-legend-head b::before { content: ''; display: inline-block; width: 3px; height: 12px; margin-right: 7px; border-radius: 2px; background: var(--primary); vertical-align: -1px; }
.role-legend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.legend-item { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 76px; background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px 11px 15px; box-shadow: var(--shadow); cursor: pointer; transition: .16s; }
.legend-item::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); opacity: .5; }
.legend-admin::before { background: #7c3aed; } .legend-hr::before { background: #0071e3; }
.legend-manager::before { background: #0d9488; } .legend-employee::before { background: #e8820c; }
.legend-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.legend-item.active { border-color: var(--primary); background: linear-gradient(135deg, var(--primary-soft), var(--surface)); box-shadow: 0 5px 16px rgba(var(--primary-rgb),.12); }
.legend-item.active::before { opacity: 1; }
.legend-drag { flex-shrink: 0; color: var(--muted); font-size: 14px; line-height: 1; letter-spacing: -2px; cursor: grab; padding: 4px 2px; user-select: none; }
.legend-drag:active { cursor: grabbing; }
.legend-item.dragging { opacity: .45; }
.legend-item.drag-before::after, .legend-item.drag-after::after { content: ''; position: absolute; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--primary); }
.legend-item.drag-before::after { left: -3px; }
.legend-item.drag-after::after { right: -3px; }
.legend-text { min-width: 0; flex: 1 1 auto; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-text b { display: block; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-text small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item em { margin-left: auto; flex-shrink: 0; min-width: 26px; text-align: center; padding: 3px 7px; border-radius: 8px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--primary-dark); background: var(--primary-soft); border: 1px solid var(--primary-border); letter-spacing: -.02em; }

@media (max-width: 1450px) {
  .role-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .role-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .perm-head { flex-direction: column; align-items: flex-start; }
  .role-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perm-group-items { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .role-legend { grid-template-columns: 1fr; }
}

/* ============================================================
   角色可增删改名 + 账号弹窗简化 新增样式
   ============================================================ */
.perm-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--primary); background: transparent; color: var(--primary); border-radius: 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn-outline:hover { background: var(--primary-soft); }

.perm-role-bar { display: flex; align-items: center; gap: 14px; padding: 12px 15px; margin-bottom: 16px; background: linear-gradient(90deg, var(--primary-soft), var(--surface)); border: 1px solid var(--primary-border); border-left: 4px solid var(--primary); border-radius: 12px; flex-wrap: wrap; }
.perm-role-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.perm-role-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: rgba(var(--primary-rgb),.14); border: 1px solid rgba(var(--primary-rgb),.22); color: var(--primary-dark); font-size: 14px; font-weight: 700; }
.perm-role-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-role-info b { font-size: 14px; color: var(--text); }
.perm-role-info small { font-size: 10.5px; color: var(--muted); }
.perm-role-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-right: auto; }
.role-scope-tag, .role-built-tag, .perm-role-users { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 11px; font-weight: 600; border: 1px solid var(--border); }
.role-scope-tag { color: var(--primary-dark); background: rgba(var(--primary-rgb),.10); border-color: rgba(var(--primary-rgb),.18); }
.role-built-tag { color: var(--text-2); background: var(--surface); }
.perm-role-users { color: var(--muted); background: var(--surface); }
.perm-role-users b { color: var(--primary-dark); margin: 0 2px; }
.perm-role-bar .row-actions { display: inline-flex; align-items: center; gap: 6px; }
.perm-role-bar .row-actions button { display: inline-flex; align-items: center; gap: 5px; width: auto; padding: 6px 10px; font-size: 12px; }
.perm-role-bar .row-actions button svg { width: 13px; height: 13px; }

.form-note { margin: 14px 0 0; padding: 11px 13px; font-size: 11.5px; line-height: 1.7; color: var(--text-2); background: var(--primary-soft); border-radius: 9px; border-left: 3px solid var(--primary); }
.form-note b { color: var(--primary-dark); }
.autosave-hint { transition: color .2s, border-color .2s, background .2s; }
.autosave-hint.autosave-ok { color: var(--green); background: var(--green-soft); border-left-color: var(--green); }
.autosave-hint.autosave-err { color: var(--orange); background: var(--orange-soft); border-left-color: var(--orange); }

@media (max-width: 700px) {
  .perm-head-right { width: 100%; justify-content: space-between; }
}

/* ============================================================
   工作台首页（Welcome / 待办 / 通知 / 常用菜单）
   ============================================================ */
.avatar.home-avatar { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; border: 3px solid rgba(255,255,255,.7); box-shadow: 0 4px 14px rgba(0,0,0,.1); }

.welcome-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; min-height: 168px; padding: 30px 34px; margin-bottom: 22px; border-radius: 20px; color: #fff; background: var(--welcome-grad); box-shadow: 0 10px 30px rgba(var(--primary-rgb),.22); }
.welcome-left { position: relative; z-index: 2; display: flex; align-items: center; gap: 20px; }
.welcome-avatar-wrap { flex-shrink: 0; }
.welcome-text { display: flex; flex-direction: column; gap: 6px; }
.welcome-greeting { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.welcome-desc { font-size: 13.5px; opacity: .92; }
.welcome-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.welcome-tag { font-size: 11.5px; padding: 4px 11px; border-radius: 20px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.welcome-illustration { position: absolute; right: 8px; bottom: 0; width: 240px; height: 150px; opacity: .9; pointer-events: none; }
.welcome-illustration svg { width: 100%; height: 100%; }

/* 首页欢迎横幅：一键打卡 + 每日激励语 */
.welcome-punch { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; margin-left: auto; margin-right: 260px; text-align: right; }
.wp-motto { font-size: 15px; font-weight: 600; line-height: 1.5; letter-spacing: .01em; text-shadow: 0 1px 6px rgba(0,60,140,.25); max-width: 360px; }
.wp-motto::before { content: '✦'; margin-right: 7px; opacity: .85; }
.wp-action { display: flex; align-items: center; gap: 12px; }
.wp-status { font-size: 11.5px; opacity: .9; white-space: nowrap; }
.wp-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: 0; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--primary); background: #fff; box-shadow: 0 6px 18px rgba(0,50,120,.22); cursor: pointer; transition: .18s; white-space: nowrap; }
.wp-btn svg { width: 16px; height: 16px; }
.wp-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,50,120,.3); }
.wp-btn:active:not(:disabled) { transform: translateY(0); }
.wp-btn:disabled { cursor: default; color: #0a7a4a; background: rgba(255,255,255,.92); box-shadow: none; }

/* 中等宽度：欢迎横幅保持单行，避免把下方板块顶得太低 */
@media (min-width: 981px) and (max-width: 1240px) {
  .welcome-card { min-height: auto; padding: 22px 26px; }
  .welcome-illustration { width: 170px; opacity: .42; }
  .welcome-punch { margin-right: 140px; }
  .wp-motto { font-size: 13px; max-width: 260px; }
}

/* 弹性并列：可见的并列卡自动等分整行；缺一张时其余卡平分，不留白 */
.home-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.home-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; box-sizing: border-box; }
/* 三张并列卡（待办/通知/生日）：等分剩余空间；[hidden] 由浏览器 display:none 自动退出布局 */
.home-grid > .home-card:not(.full-width) { flex: 1 1 0; min-width: 280px; }
.home-grid > .home-card.full-width { flex: 0 0 100%; width: 100%; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.home-card-title { display: flex; align-items: center; gap: 10px; }
.home-card-title h2 { font-size: 15px; margin: 0; font-weight: 650; color: var(--text); }
.home-card-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.home-card-ic svg { width: 17px; height: 17px; }
.ic-orange { background: var(--orange-soft); color: var(--orange); }
.ic-blue { background: var(--primary-soft); color: var(--primary); }
.ic-teal { background: #e6f7f4; color: var(--teal); }
.home-card-count { font-size: 12px; font-weight: 600; color: var(--orange); background: var(--orange-soft); min-width: 26px; height: 24px; padding: 0 8px; border-radius: 20px; display: grid; place-items: center; }
.home-card-more { font-size: 11.5px; color: var(--muted); }

.home-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; background: transparent; border: 0; border-bottom: 1px solid var(--border); text-align: left; transition: .15s; }
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { padding-left: 8px; }
.todo-item:hover .todo-label { color: var(--primary); }
.todo-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.todo-label { flex: 1; font-size: 13px; color: var(--text); font-weight: 500; transition: .15s; }
.todo-count { font-size: 15px; font-weight: 700; }
.todo-item > svg { width: 14px; height: 14px; color: var(--muted); }
.tone-orange { color: var(--orange); background: var(--orange-soft); }
.tone-blue { color: var(--primary); background: var(--primary-soft); }
.tone-teal { color: var(--teal); background: #e6f7f4; }
.tone-gray { color: var(--text-2); background: var(--surface-2); }
.tone-purple { color: #8b5cf6; background: #f2ecff; }
.tone-pink { color: #e8508c; background: #fceef4; }
.todo-count.tone-orange, .todo-count.tone-blue, .todo-count.tone-teal, .todo-count.tone-gray { background: transparent; }

.notice-item { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.notice-item:last-child { border-bottom: 0; }
.notice-tag { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.notice-title { flex: 1; font-size: 12.5px; color: var(--text); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-date { font-size: 11px; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.home-notice { display: flex; flex-direction: column; }
.home-notice .home-list { flex: 1; align-content: start; }
.home-card-foot-link { align-self: flex-end; margin-top: 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--primary); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.home-card-foot-link:hover { border-color: var(--primary); background: var(--primary-soft); }

.home-quick { padding: 12px 14px 10px; }
.home-quick .home-card-head { padding-bottom: 8px; margin-bottom: 2px; }
.quick-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; padding-top: 6px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 3px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; transition: .18s; text-align: center; }
.quick-item:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 5px 14px rgba(var(--primary-rgb),.12); }
.quick-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.quick-ic svg { width: 15px; height: 15px; }
.quick-label { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; }
.quick-desc { font-size: 9.5px; color: var(--muted); line-height: 1.2; min-height: 12px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* 工作台业务前十：颁奖台（2026-12-01 立体舞台改版） */
.home-ranking { position: relative; overflow: hidden; padding: 12px 20px 14px; background: linear-gradient(160deg,#fffdf7 0%,var(--surface) 58%); }
.home-ranking::before { content: ''; position: absolute; top: -100px; right: -30px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle,rgba(244,183,62,.14),transparent 70%); pointer-events: none; }
.home-ranking .home-card-head { position: relative; padding-bottom: 8px; margin-bottom: 6px; }
.home-rank-title-ic { background: linear-gradient(135deg,#fff0c9,#ffe0a0); color: #c78b16; box-shadow: 0 3px 10px rgba(210,150,30,.16); }
.home-rank-tag { margin-left: 8px; padding: 2px 8px; border-radius: 20px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: #b8801a; background: linear-gradient(90deg,#fff3d4,#ffe6b0); border: 1px solid #f4d99b; }
.home-rank-month { margin-left: 8px; padding: 2px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 700; color: #2f7d6b; background: #e7f6f1; border: 1px solid #c9e9df; white-space: nowrap; }
.hr-head-right { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.hr-mode-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); }
.hr-mode-tag { border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; padding: 4px 10px; border-radius: 16px; cursor: pointer; transition: .15s; white-space: nowrap; }
.hr-mode-tag:hover { color: var(--primary); }
.hr-mode-tag.active { color: #fff; background: linear-gradient(90deg,#e8ae38,#f2c764); box-shadow: 0 2px 6px rgba(200,140,20,.22); }
@media (max-width: 1200px) {
  .home-ranking .home-card-title { gap: 6px; min-width: 0; }
  .home-ranking .home-card-title h2 { font-size: 13px; white-space: nowrap; }
  .home-ranking .home-rank-tag, .home-ranking .home-rank-month { margin-left: 0; padding: 2px 7px; font-size: 9.5px; flex: none; }
}
.hr-sub { margin-left: 3px; font-size: 10.5px; }
.hr-count b.hr-money { font-size: 14px; color: var(--teal); }
.hr-slot-1 .hr-count b.hr-money { color: #b87908; }
.hr-count b.hr-money.neg, .hr-rest-count.neg { color: var(--red) !important; }
.hr-stage { position: relative; display: flex; justify-content: center; padding-top: 8px; }
.hr-stage::before { content: ''; position: absolute; left: 50%; bottom: 0; width: min(720px,90%); height: 78px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at 50% 100%,rgba(240,180,60,.2),transparent 70%); pointer-events: none; }
.hr-stage::after { content: ''; position: absolute; left: 50%; bottom: 0; width: min(780px,94%); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg,transparent,rgba(210,160,60,.38),transparent); }
.hr-spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #f3c75d; box-shadow: 0 0 8px #f3c75d; opacity: .75; pointer-events: none; }
.hr-spark-a { left: 16%; top: 10px; }
.hr-spark-b { left: 29%; top: 46px; width: 3px; height: 3px; }
.hr-spark-c { right: 18%; top: 16px; }
.hr-spark-d { right: 31%; top: 52px; width: 3px; height: 3px; background: #cfa6ff; box-shadow: 0 0 8px #cfa6ff; }
.hr-podium { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; align-items: end; width: min(780px,100%); margin: 0 auto; }
.hr-slot { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.hr-person { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-height: 126px; padding: 8px 8px 12px; border: 1px solid var(--border); border-bottom: 0; border-radius: 14px 14px 0 0; background: linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.92)); }
.hr-slot-1 .hr-person { min-height: 136px; background: linear-gradient(180deg,#fff8e6,#fffdf8); border-color: #f3d79a; box-shadow: inset 0 -8px 24px rgba(240,180,60,.1); }
.hr-slot-2 .hr-person { background: linear-gradient(180deg,#f3f6fa,#fbfcfe); }
.hr-slot-3 .hr-person { background: linear-gradient(180deg,#fdf1e8,#fffaf6); }
.hr-medal { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: linear-gradient(135deg,#b7c2cd,#8b9aa9); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.hr-medal svg { width: 15px; height: 15px; }
.hr-medal-1 { width: 28px; height: 28px; background: linear-gradient(135deg,#f6c445,#e09b12); box-shadow: 0 0 0 3px #fff3cf,0 4px 12px rgba(224,155,18,.32); }
.hr-medal-1 svg { width: 18px; height: 18px; }
.hr-medal-3 { background: linear-gradient(135deg,#d79a6d,#bb7042); }
.hr-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 800; color: var(--primary); background: linear-gradient(135deg,#eaf3ff,#d9e9ff); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(40,90,160,.14); }
.hr-slot-1 .hr-avatar { width: 50px; height: 50px; font-size: 21px; color: #b57a08; background: linear-gradient(135deg,#fff2cf,#ffdd93); box-shadow: 0 0 0 2px #f5cf7c,0 6px 16px rgba(210,150,30,.26); }
.hr-name { font-size: 13px; font-weight: 750; color: var(--text); white-space: nowrap; }
.hr-dept { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hr-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hr-count b { font-size: 16px; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; }
.hr-slot-1 .hr-count b { color: #d18d0c; }
.hr-count i { font-style: normal; margin: 0 2px; color: #d5d9de; }
.hr-stand { position: relative; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border-radius: 0 0 10px 10px; border: 1px solid rgba(255,255,255,.55); background: linear-gradient(180deg,#aeb9c5,#96a4b2); box-shadow: 0 6px 14px rgba(30,50,80,.14); }
.hr-stand::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: rgba(255,255,255,.35); }
.hr-stand-no { position: absolute; right: 8px; top: 2px; font-size: 26px; font-weight: 800; line-height: 1; color: rgba(255,255,255,.2); }
.hr-stand-label { position: relative; z-index: 1; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.hr-slot-1 .hr-stand { height: 60px; background: linear-gradient(180deg,#f4c25c,#dc9612); }
.hr-slot-1 .hr-stand-label { font-size: 14px; }
.hr-slot-3 .hr-stand { height: 36px; background: linear-gradient(180deg,#ce926b,#ae6b3f); }
.hr-rest { position: relative; display: grid; grid-template-columns: auto repeat(7,minmax(0,1fr)); gap: 8px; align-items: center; padding-top: 10px; margin-top: 8px; border-top: 1px dashed var(--border); }
.hr-rest-label { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; padding-left: 2px; }
.hr-rest-item { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; transition: .15s; }
.hr-rest-item:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.hr-rest-rank { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 800; color: var(--muted); background: var(--surface); border: 1px solid var(--border); }
.hr-rest-name { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-rest-count { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.hr-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .hr-podium { gap: 6px; }
  .hr-person { min-height: 112px; padding: 6px 3px; }
  .hr-slot-1 .hr-person { min-height: 120px; }
  .hr-avatar { width: 36px; height: 36px; font-size: 15px; }
  .hr-slot-1 .hr-avatar { width: 42px; height: 42px; font-size: 18px; }
  .hr-stand-label { font-size: 10px; }
  .hr-slot-1 .hr-stand { height: 52px; }
  .hr-slot-3 .hr-stand { height: 30px; }
}

/* ==================== 公司信息 ==================== */
/* 工作台卡片：紧凑横排，标签与内容同一行 */
.home-company { padding: 14px 18px 10px; }
.home-company .home-card-head { padding-bottom: 9px; margin-bottom: 2px; }
.company-home-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 22px; padding: 2px 0 0; }
.company-home-item { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding: 7px 2px; border-bottom: 1px dashed var(--border); }
.company-home-item:last-child { border-bottom: 0; }
.company-home-label { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }
.company-home-label::after { content: '：'; }
.company-home-value { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.company-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.company-panel-head h2 { margin: 0; font-size: 16px; color: var(--text); }
.company-panel-head p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.company-value-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-show-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-family: inherit; line-height: 1.5; }
.company-show-tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .6; }
.company-show-tag.on { background: var(--green-soft); color: var(--green); border-color: transparent; }
button.company-show-tag { cursor: pointer; transition: .15s; }
button.company-show-tag:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.09); border-color: var(--primary); color: var(--primary); }
button.company-show-tag:disabled { opacity: .6; cursor: wait; }
.company-sort-btns { display: flex; gap: 4px; }
.company-sort-btns button { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 6px; cursor: pointer; padding: 0; }
.company-sort-btns button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.company-sort-btns button:disabled { opacity: .35; cursor: not-allowed; }
.company-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.company-check-line { grid-column: 1/-1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.company-check-line input { width: 15px; height: 15px; accent-color: var(--primary); }
/* 公司信息附件展示 */
.company-type-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.company-tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; background: var(--primary-soft); color: var(--primary); border: 1px solid var(--border); white-space: nowrap; }
.company-attach-img { display: inline-flex; width: 46px; height: 34px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; vertical-align: middle; background: var(--surface-2); }
.company-attach-img img { width: 100%; height: 100%; object-fit: cover; }
.company-attach-link { display: inline-flex; align-items: center; gap: 3px; max-width: 220px; font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.company-attach-link:hover { text-decoration: underline; }
.company-attach-size, .company-attach-note { margin-left: 6px; font-size: 10.5px; color: var(--muted); }
.company-home-file { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.company-current-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.company-remove-line { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; cursor: pointer; font-size: 11.5px; }
.company-remove-line input { width: 14px; height: 14px; accent-color: var(--red); }

@media (max-width: 1100px) { .quick-grid { grid-template-columns: repeat(6, 1fr); } .hr-rest { grid-template-columns: auto repeat(4, minmax(0, 1fr)); } .home-grid > .home-card:not(.full-width) { min-width: calc(50% - 10px); } }
@media (max-width: 860px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } .hr-rest { grid-template-columns: auto repeat(2, minmax(0, 1fr)); } .home-grid > .home-card:not(.full-width) { min-width: 100%; } }
@media (max-width: 980px) {
  .welcome-card { flex-wrap: wrap; }
  .welcome-punch { width: 100%; margin: 18px 0 0; align-items: flex-start; text-align: left; }
  .welcome-illustration { opacity: .28; }
}
@media (max-width: 600px) {
  .welcome-card { padding: 22px; min-height: auto; }
  .welcome-left { gap: 14px; }
  .welcome-greeting { font-size: 21px; }
  .welcome-illustration { opacity: .4; width: 160px; }
  .wp-motto { font-size: 13.5px; max-width: none; }
  .wp-action { flex-wrap: wrap; gap: 8px; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .hr-podium { gap: 6px; }
  .hr-person { min-height: 92px; padding: 8px 4px; }
  .hr-slot-1 .hr-person { min-height: 112px; }
  .hr-slot-2 .hr-person { min-height: 100px; }
  .hr-base { font-size: 10px; }
}

/* 修改密码 */
.tone-indigo { color: #6366f1; background: #eef0ff; }
.pwd-account-hint { display: flex; align-items: center; gap: 9px; padding: 12px 14px; background: var(--primary-soft); border: 1px solid #dceaff; border-radius: 10px; font-size: 12.5px; color: var(--text-2); }
.pwd-account-hint svg { width: 17px; height: 17px; color: var(--primary); flex-shrink: 0; }
.pwd-account-hint b { color: var(--text); }

/* ==================== 考勤管理 + 请假审批 ==================== */
/* 今日打卡条 */
.punch-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, var(--primary-soft) 0%, var(--green-soft) 100%); border: 1px solid var(--primary-border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.punch-info { display: flex; align-items: center; gap: 14px; }
.punch-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(var(--primary-rgb),.1); }
.punch-info div { display: flex; flex-direction: column; line-height: 1.35; }
.punch-info b { font-size: 15.5px; color: var(--text); }
.punch-info small { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.punch-actions { display: flex; gap: 9px; }
.punch-actions .btn:disabled { opacity: .5; }
.att-stats-grid { margin-bottom: 20px; }

/* Tab 切换 */
.att-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 11px; margin-bottom: 18px; width: fit-content; }
.att-tab { border: 0; background: transparent; padding: 8px 20px; border-radius: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; transition: .15s; display: inline-flex; align-items: center; gap: 7px; }
.att-tab:hover { color: var(--text); }
.att-tab.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.tab-badge { background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; line-height: 1.5; }
.att-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* 工具栏 */
.att-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.att-toolbar-left, .att-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.month-input { width: 150px; padding: 8px 10px; }
.att-toolbar .input { padding: 8px 11px; font-size: 12.5px; }
.search-box.sm { width: 300px; padding: 7px 11px; }
.approve-hint { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* 考勤表格 */
.att-table td { vertical-align: middle; }
.muted { color: var(--muted); }
.muted-dash { color: var(--muted); font-size: 13px; }
.att-badge, .leave-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.att-badge.tone-green, .leave-badge.tone-green { background: var(--green-soft); color: var(--green); }
.att-badge.tone-orange, .leave-badge.tone-orange { background: var(--orange-soft); color: var(--orange); }
.att-badge.tone-blue, .leave-badge.tone-blue { background: var(--primary-soft); color: var(--primary); }
.att-badge.tone-purple { background: #f2ecff; color: #8b5cf6; }
.att-badge.tone-red, .leave-badge.tone-red { background: var(--red-soft); color: var(--red); }
.att-badge.tone-gray, .leave-badge.tone-gray { background: var(--surface-2); color: var(--text-2); }
.source-tag { font-size: 10.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 5px; }
.source-tag.src-punch { color: var(--teal); background: #e6f7f4; border-color: transparent; }

/* 请假统计条 */
.leave-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.leave-summary-item { background: transparent; border: 0; border-right: 1px solid var(--border); padding: 3px 18px; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.leave-summary-item:last-child { border-right: 0; }
.leave-summary-item span { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.leave-summary-item b { font-size: 19px; font-weight: 700; background: transparent !important; font-variant-numeric: tabular-nums; }
.leave-summary-item b.tone-orange { color: var(--orange); }
.leave-summary-item b.tone-green { color: var(--green); }
.leave-summary-item b.tone-red { color: var(--red); }
.leave-summary-item b.tone-blue { color: var(--primary); }

/* 请假卡片列表 */
.leave-list { padding: 18px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.leave-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.03); transition: .16s; }
.leave-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); border-color: var(--primary-border); }
.leave-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.leave-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.leave-who .avatar { flex-shrink: 0; }
.leave-who div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.leave-who b { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leave-who small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leave-card-body { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 9px; }
.leave-type { background: var(--primary-soft); color: var(--primary-dark); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.leave-date { font-size: 12px; color: var(--text-2); }
.leave-days { font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 5px; }
.leave-reason { margin: 0 0 12px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); padding: 9px 11px; border-radius: 8px; line-height: 1.5; }
.leave-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.leave-card-foot span:first-child { flex: 1; }
.leave-comment { margin-top: 10px; font-size: 11.5px; color: var(--text-2); background: var(--primary-soft); border-left: 3px solid var(--primary); padding: 7px 11px; border-radius: 0 7px 7px 0; }
.approve-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.approve-comment { flex: 1; min-width: 120px; padding: 7px 10px; font-size: 12px; }
.btn-xs { padding: 5px 10px; font-size: 11.5px; }
.confirm-icon.info { background: var(--primary-soft); color: var(--primary); }

@media (max-width: 900px) {
  .leave-summary { grid-template-columns: repeat(2, 1fr); row-gap: 8px; }
  .leave-summary-item:nth-child(2) { border-right: 0; }
  .punch-bar { flex-direction: column; align-items: flex-start; }
}

/* ==================== 月度考勤汇总（方格卡片 + 月历弹窗） ==================== */
.sum-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 13px 22px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.sum-legend-title { font-size: 12.5px; font-weight: 700; color: var(--text); padding-right: 13px; border-right: 1px solid var(--border); }
.sum-legend .lg-item { font-size: 11.5px; color: var(--text-2); }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lg-green { background: var(--green); }
.lg-blue { background: var(--primary); }
.lg-orange { background: var(--orange); }
.lg-red { background: var(--red); }
.lg-purple { background: #8b5cf6; }
.lg-gray { background: var(--muted); }
.sum-legend .lg-tip { margin-left: auto; font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.sum-legend .lg-tip::before { content: '✦'; color: var(--primary); }

.sum-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 15px; padding: 20px 22px 24px; align-content: start; }
.sum-empty { grid-column: 1 / -1; }
.sum-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 16px; min-height: 148px; padding: 16px 17px 15px; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; overflow: hidden; }
.sum-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--green); opacity: .75; }
.sum-card.tone-green::before { background: var(--green); }
.sum-card.tone-blue::before { background: var(--primary); }
.sum-card.tone-orange::before { background: var(--orange); }
.sum-card.tone-red::before { background: var(--red); }
.sum-card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(0,0,0,.1); border-color: var(--primary-border); }
.sc-corner { position: absolute; top: 13px; right: 14px; color: var(--muted); opacity: .4; }
.sc-corner svg { width: 14px; height: 14px; }
.sc-person { display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 12px; }
.sc-person .avatar { flex-shrink: 0; width: 36px; height: 36px; font-size: 14px; }
.sc-person-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sc-person-meta b { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-person-meta small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sc-rate { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sc-ring { --c: var(--green); width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.tone-green .sc-ring { --c: var(--green); }
.tone-blue .sc-ring { --c: var(--primary); }
.tone-orange .sc-ring { --c: var(--orange); }
.tone-red .sc-ring { --c: var(--red); }
.sc-ring-in { width: 54px; height: 54px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 3px rgba(0,0,0,.06); }
.sc-ring-in b { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.sc-ring-in i { font-size: 9px; font-style: normal; color: var(--muted); margin-left: 1px; }
.sc-rate-label { font-size: 11px; color: var(--muted); }

/* 月历弹窗 */
.cal-modal { --cell-gap: 4px; }
.cal-identity { display: flex; align-items: center; gap: 12px; padding: 0 4px 10px; border-bottom: 1px solid var(--border); }
.cal-identity .avatar { width: 42px; height: 42px; font-size: 16px; flex-shrink: 0; }
.cal-id-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.cal-id-meta b { font-size: 15px; color: var(--text); }
.cal-id-meta small { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cal-rate-badge { margin-left: auto; display: flex; flex-direction: column; align-items: center; padding: 6px 16px; border-radius: 12px; background: var(--green-soft); }
.cal-rate-badge b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--green); }
.cal-rate-badge small { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }
.cal-rate-badge.tone-green { background: var(--green-soft); } .cal-rate-badge.tone-green b { color: var(--green); }
.cal-rate-badge.tone-blue { background: var(--primary-soft); } .cal-rate-badge.tone-blue b { color: var(--primary); }
.cal-rate-badge.tone-orange { background: var(--orange-soft); } .cal-rate-badge.tone-orange b { color: var(--orange); }
.cal-rate-badge.tone-red { background: var(--red-soft); } .cal-rate-badge.tone-red b { color: var(--red); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 11px 4px 9px; }
.cal-legend .lg-item { font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--cell-gap); }
.cal-week { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 3px 0 5px; }
.cal-week:nth-child(7), .cal-week:nth-child(6) { color: var(--orange); }
.cal-cell { position: relative; min-height: 52px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); transition: background .15s; }
.cal-cell.cal-blank { background: transparent; border-color: transparent; }
.cal-cell.cal-off { background: var(--surface-2); opacity: .72; }
.cal-num { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-cell.cal-off .cal-num { color: var(--muted); }
.cal-badge { display: inline-block; font-size: 10px; font-weight: 700; line-height: 1.5; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.cal-sub { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.cal-cell.cal-green { background: var(--green-soft); } .cal-cell.cal-green .cal-badge { color: var(--green); background: rgba(52,168,83,.14); }
.cal-cell.cal-orange { background: var(--orange-soft); } .cal-cell.cal-orange .cal-badge { color: var(--orange); background: rgba(232,130,12,.14); }
.cal-cell.cal-blue { background: var(--primary-soft); } .cal-cell.cal-blue .cal-badge { color: var(--primary); background: rgba(0,113,227,.12); }
.cal-cell.cal-purple { background: #f2ecff; } .cal-cell.cal-purple .cal-badge { color: #8b5cf6; background: rgba(139,92,246,.14); }
.cal-cell.cal-red { background: var(--red-soft); } .cal-cell.cal-red .cal-badge { color: var(--red); background: rgba(217,48,37,.12); }
.cal-cell.cal-gray .cal-badge { color: var(--muted); background: var(--surface-2); }

.cal-summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 14px 0 9px; padding-top: 12px; border-top: 1px dashed var(--border); }
.cal-summary-head b { font-size: 13.5px; color: var(--text); }
.cal-summary-head span { font-size: 11.5px; color: var(--muted); }
.cal-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cal-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.cal-stat span { font-size: 11px; color: var(--text-2); }
.cal-stat b { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cal-stat.tone-green b { color: var(--green); }
.cal-stat.tone-blue b { color: var(--primary); }
.cal-stat.tone-orange b { color: var(--orange); }
.cal-stat.tone-purple b { color: #8b5cf6; }
.cal-stat.tone-red b { color: var(--red); }
.cal-stat.tone-gray b { color: var(--muted); }
.cal-stat-rate { background: linear-gradient(135deg, var(--primary-soft), var(--green-soft)); border-color: var(--primary-border); grid-column: span 1; }

@media (max-width: 720px) {
  .sum-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 16px; gap: 12px; }
  .cal-summary { grid-template-columns: repeat(3, 1fr); }
  .cal-cell { min-height: 54px; padding: 5px; }
  .cal-badge { font-size: 9px; padding: 1px 4px; }
  .cal-sub { display: none; }
  .sum-legend { gap: 10px; padding: 12px 16px; }
  .sum-legend .lg-tip { margin-left: 0; }
}
[data-theme="dark"] .sc-ring-in { box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
[data-theme="dark"] .cal-cell.cal-purple { background: #2a2340; }

/* ==================== 公司 IP 白名单 ==================== */
.ip-info-card { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, var(--primary-soft) 0%, var(--green-soft) 100%); border: 1px solid var(--primary-border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.ip-info-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(var(--primary-rgb),.1); flex-shrink: 0; }
.ip-info-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ip-info-body b { font-size: 14px; color: var(--text); }
.ip-info-body .mono { font-size: 13px; color: var(--primary-dark); font-weight: 700; margin-left: 4px; }
.ip-info-body span { font-size: 12px; color: var(--text-2); }
.ip-info-body span.ip-ok { color: var(--green); font-weight: 600; }
.ip-info-body span.ip-warn { color: var(--orange); font-weight: 600; }
.ip-table .ip-rule { font-weight: 600; color: var(--text); }
.ip-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.ip-status.on { background: var(--green-soft); color: var(--green); }
.ip-status.off { background: var(--surface-2); color: var(--muted); }
.ip-form-tip { margin-top: 8px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; line-height: 1.5; }
/* 考勤记录表打卡 IP */
.ip-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ip-tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.ip-tag.ip-in { background: var(--green-soft); color: var(--green); }
.ip-tag.ip-out { background: var(--orange-soft); color: var(--orange); }
.ip-tag.ip-unknown { background: var(--surface-2); color: var(--muted); }

/* ==================== 企业通知 ==================== */
/* 侧边栏未读徽标 */
.nav-badge { font-style: normal; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 1px 4px rgba(217,48,37,.32); }
/* 员工生日：当天有寿星时用蛋糕图标提醒（替代数字徽标），轻微跳动更醒目 */
.nav-cake-badge { font-style: normal; font-size: 16px; line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; animation: cakeBob 1.8s ease-in-out infinite; }
.nav-cake-badge[hidden] { display: none; }
@keyframes cakeBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-8deg); } }
/* 顶栏铃铛 */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.bell-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; transition: .16s; }
.bell-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.bell-btn svg { width: 19px; height: 19px; }
.bell-badge { position: absolute; top: -5px; right: -5px; font-style: normal; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }
/* 首页通知未读 */
.home-more-btn { border: 0; background: transparent; cursor: pointer; padding: 0; }
.home-more-btn:hover { color: var(--primary); }
.notice-unread-count { color: var(--red); font-weight: 600; }
.home-notice-list .notice-item { width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px; gap: 8px; }
.home-notice-list .notice-item:hover { background: var(--surface-2); }
.home-notice-list .notice-item.unread .notice-title { font-weight: 600; color: var(--text); }
.notice-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
/* 通知页统计卡 */
.notice-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
/* 通知页 Tab */
.notice-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 11px; }
/* 通知卡片列表 */
.notice-list { padding: 8px 12px; min-height: 120px; }
.notice-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 12px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 10px; transition: .15s; }
.notice-card:last-child { border-bottom: 0; }
.notice-card:hover { background: var(--surface-2); }
.notice-card.unread { background: linear-gradient(90deg, var(--primary-soft) 0%, transparent 55%); }
.notice-card-main { flex: 1; min-width: 0; }
.notice-card-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-card-title { font-size: 13.5px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-card.unread .notice-card-title { font-weight: 700; }
.notice-top-tag { font-size: 10px; font-weight: 700; color: var(--orange); background: var(--orange-soft); padding: 2px 7px; border-radius: 5px; flex-shrink: 0; }
.notice-draft-tag { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 5px; flex-shrink: 0; }
.notice-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.notice-card-right { display: flex; align-items: center; gap: 10px; color: var(--muted); flex-shrink: 0; }
.notice-card-actions { display: flex; gap: 3px; }
.icon-btn.sm { width: 28px; height: 28px; padding: 0; font-size: 13px; }
.icon-btn.sm.del { color: var(--red); }
/* 通知详情弹窗 */
.notice-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.notice-detail-title { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.4; margin: 0 0 12px; }
.notice-detail-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.notice-detail-content { margin-top: 18px; font-size: 14px; line-height: 1.9; color: var(--text-2); white-space: normal; }
@media (max-width: 900px) {
  .notice-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   公司任务模块
   ============================================================ */
.task-stats-grid { margin-bottom: 20px; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card { display: flex; align-items: flex-start; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); transition: .16s; }
.task-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); border-color: var(--primary-border); }
.task-card.done { border-left: 3px solid var(--green); }
.task-card.pending { border-left: 3px solid var(--orange); }
.task-card.closed { border-left: 3px solid var(--muted); opacity: .84; }
.task-card-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.task-card-ic svg { width: 20px; height: 20px; }
.task-card-ic.ic-orange { background: var(--orange-soft); color: var(--orange); }
.task-card-ic.ic-green { background: var(--green-soft); color: var(--green); }
.task-card-ic.ic-gray { background: var(--surface-2); color: var(--muted); }
.task-card-main { flex: 1; min-width: 0; }
.task-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-card-top b { font-size: 14.5px; color: var(--text); }
.task-card-main p { margin: 6px 0 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.task-card-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.task-chip { display: inline-flex; align-items: center; font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 7px; }
.task-chip.due { color: var(--orange); background: var(--orange-soft); border-color: #ffe6c7; }
.task-chip.done { color: var(--green); background: var(--green-soft); border-color: #cdebd8; }
.task-status { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.task-status.done { color: var(--green); background: var(--green-soft); }
.task-status.pending { color: var(--orange); background: var(--orange-soft); }
.task-status.closed { color: var(--muted); background: var(--surface-2); }
.task-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; min-width: 130px; }
.task-progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.task-progress-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.task-progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--teal)); border-radius: 4px; }
.task-progress span { font-size: 11px; color: var(--muted); white-space: nowrap; }

.task-subhead { font-size: 13px; font-weight: 600; color: var(--text); margin: 6px 0 12px; }
/* 任务管理内容区统一左右缩进：标题、模板卡片、表格左边缘对齐，不贴容器边 */
#taskPanelManage .task-tpl-section { margin-bottom: 26px; padding-left: 26px; padding-right: 26px; }
.task-tpl-card { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
.task-tpl-card.paused { opacity: .7; }
.task-tpl-main { flex: 1; min-width: 0; }
.task-tpl-main p { margin: 6px 0 10px; font-size: 12.5px; color: var(--text-2); }
.task-tpl-actions { display: flex; gap: 4px; }
.icon-btn.danger { color: var(--red); }
/* 表格缩进由父级 .task-tpl-section 统一控制，此处仅保留上下间距 */
#viewTask .table-wrap { padding: 0 0 16px; }
.task-manage-table .cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* 防止长部门名在窄屏撑破单元格顶到相邻列 */
.task-dept-cell { font-size: 12px; color: var(--text-2); max-width: 200px; overflow: hidden; }
.dept-ellipsis { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-cell { text-align: center; color: var(--muted); padding: 20px !important; }

/* 模板配置弹窗 */
.tpl-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl-due-box { display: contents; }
.field-hint { grid-column: 1 / -1; margin: -4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.tpl-section { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.tpl-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.link-btn { border: 0; background: transparent; color: var(--primary); font-size: 12px; padding: 0; }
.task-dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; max-height: 150px; overflow-y: auto; padding: 10px; background: var(--surface-2); border-radius: 9px; }
.task-dept-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.tpl-field-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-field-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.tpl-field-grip { color: var(--muted); cursor: grab; font-size: 14px; }
.tpl-field-fields { flex: 1; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr auto; gap: 6px; align-items: center; }
.tpl-field-fields .input { padding: 7px 9px; font-size: 12px; }
.f-required { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* 填写弹窗 */
.task-fill-info { background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.task-fill-info p { margin: 8px 0; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.task-fill-info .task-progress { margin-top: 10px; }
.task-fill-form { display: grid; grid-template-columns: 1fr; gap: 14px; }
.task-ans-field { display: flex; flex-direction: column; gap: 6px; }
.task-options { display: flex; gap: 8px; flex-wrap: wrap; }
.task-option { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px; color: var(--text-2); cursor: pointer; transition: .14s; }
.task-option:hover { border-color: var(--primary); color: var(--primary); }
.task-closed-tip { margin-top: 12px; font-size: 12px; color: var(--orange); background: var(--orange-soft); padding: 10px 12px; border-radius: 8px; }

@media (max-width: 900px) {
  .task-card-side { min-width: 100px; }
  .tpl-form .form-grid { grid-template-columns: 1fr; }
  .task-dept-grid { grid-template-columns: 1fr 1fr; }
  .tpl-field-fields { grid-template-columns: 1fr 1fr; }
}

/* ============ 文件中心模块 ============ */
.file-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.file-cats { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.file-cats-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--text); }
.cat-manage-btn { width: 26px; height: 26px; }
.cat-manage-btn svg { width: 15px; height: 15px; color: var(--muted); }
.cat-manage-btn:hover svg { color: var(--primary); }
.file-cats-list { padding: 8px; }
.file-cat { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; font-size: 13px; color: var(--text-2); text-align: left; transition: .14s; }
.file-cat:hover { background: var(--surface-2); }
.file-cat.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.file-cat .fc-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-cat .fc-count { font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 8px; }
.file-cat.active .fc-count { background: #fff; color: var(--primary); }
.file-cats-empty { padding: 12px; font-size: 12px; color: var(--muted); text-align: center; }

.file-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.file-search-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 0 11px; color: var(--muted); }
.file-search-wrap svg { width: 15px; height: 15px; flex-shrink: 0; }
.file-search-wrap input { border: 0; background: transparent; outline: none; padding: 8px 0; font-size: 12.5px; color: var(--text); width: 360px; max-width: 100%; }

.file-list { padding: 6px 0; min-height: 200px; }
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #f0f0f4; transition: background .14s; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #fafbff; }
.file-row.is-disabled { opacity: .55; }
.fr-icon { width: 46px; height: 52px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; position: relative; }
.fr-ext { font-size: 8px; font-weight: 700; letter-spacing: .03em; margin-top: -2px; }
.fr-icon.tone-red { background: #fdecea; } .fr-icon.tone-blue { background: #e8f1ff; }
.fr-icon.tone-green { background: var(--green-soft); } .fr-icon.tone-orange { background: var(--orange-soft); }
.fr-icon.tone-purple { background: #f1ecff; } .fr-icon.tone-teal { background: #e6faf7; }
.fr-icon.tone-gray { background: var(--surface-2); }
.fr-main { flex: 1; min-width: 0; }
.fr-main .fr-title { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-off { font-size: 10px; font-weight: 500; color: var(--red); background: var(--red-soft); padding: 1px 6px; border-radius: 6px; margin-left: 4px; vertical-align: middle; }
.fr-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.fr-meta i { font-style: normal; color: #c7c7cf; }
.fr-desc { font-size: 11.5px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.file-cat-tag { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.vis-badge { font-size: 10.5px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.vis-all { color: var(--teal); background: #e6faf7; }
.vis-dept { color: var(--orange); background: var(--orange-soft); }
.fr-actions { display: flex; gap: 2px; flex-shrink: 0; }
.fr-actions .icon-btn { width: 30px; height: 30px; }
.fr-actions .icon-btn svg { width: 15px; height: 15px; color: var(--muted); }
.fr-actions .icon-btn:hover svg { color: var(--primary); }
.fr-actions .icon-btn.danger:hover svg { color: var(--red); }

.file-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 70px 20px; color: var(--muted); grid-column: 1 / -1; }
.file-empty .fe-ico { font-size: 46px; margin-bottom: 12px; opacity: .7; }
.file-empty p { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.file-empty span { font-size: 12.5px; }

/* 弹窗内：部门勾选 / 分类管理 */
.dept-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 180px; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.dept-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.dept-check:hover { background: #fff; }
.dept-check input { accent-color: var(--primary); }
.cat-manage-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cm-item { display: flex; align-items: center; gap: 8px; }
.cm-item .cm-name { flex: 1; }
.cm-item .cm-del svg { width: 15px; height: 15px; color: var(--muted); }
.cm-item .cm-del:hover svg { color: var(--red); }
.cm-add-row { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.cm-add-row .input { flex: 1; }
.field-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }

@media (max-width: 1000px) {
  .file-layout { grid-template-columns: 1fr; }
  .file-cats-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .file-cat { width: auto; }
  .fr-tags { display: none; }
}

/* ============ 费用报销模块 ============ */
.expense-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.expense-panel .att-toolbar { gap: 10px; }
.expense-panel .file-search-wrap input { width: 320px; }
/* 业务单检索字段多，单独加长输入框 */
#orderKeyword { width: 500px; }
.expense-list { padding: 4px 0; min-height: 180px; }
/* 费用列表时间范围检索 */
.exp-date-range { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.exp-date-range .input[type=date] { width: 140px; padding: 7px 8px; font-size: 12px; }
.exp-date-range > span { font-size: 12px; color: var(--muted); }
/* 费用金额汇总条 */
.expense-amount-summary { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 0; padding: 12px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.eas-title { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: 1px; padding-right: 18px; border-right: 1px solid var(--border); }
.eas-item { display: inline-flex; align-items: baseline; gap: 8px; }
.eas-item em { font-size: 12px; font-style: normal; color: var(--muted); }
.eas-item b { font-size: 18px; font-weight: 800; letter-spacing: .3px; }
.fin-paid-tag { font-size: 11px; font-weight: 600; color: var(--green); }
.eas-orange b { color: var(--orange); }
.eas-blue b { color: var(--primary); }
.eas-green b { color: var(--green); }
.exp-row { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid #f0f0f4; transition: background .14s; }
.exp-row:last-child { border-bottom: 0; }
.exp-row:hover { background: #fafbff; }
.exp-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.exp-icon span { font-size: 8px; font-weight: 700; margin-top: -2px; }
.exp-icon.blue { background: var(--primary-soft); } .exp-icon.purple { background: #f1ecff; }
.exp-main { flex: 1; min-width: 0; }
.exp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exp-title b { font-size: 13px; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.exp-cat-tag { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; }
.exp-lock-tag { font-size: 11px; font-weight: 600; color: #a32d2d; background: #fcebeb; border: 1px solid #f09595; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
[data-theme="dark"] .exp-lock-tag { color: #f7c1c1; background: #501313; border-color: #a32d2d; }
.exp-reason { font-size: 12.5px; color: var(--text); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.exp-meta i { font-style: normal; color: #c7c7cf; }
.exp-amount { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 110px; text-align: right; }
.exp-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.exp-status { font-size: 10.5px; border-radius: 6px; padding: 2px 8px; white-space: nowrap; font-weight: 600; }
.exp-orange { color: var(--orange); background: var(--orange-soft); }
.exp-blue { color: var(--primary); background: var(--primary-soft); }

/* 业务订单「状态」展开面板：复用操作台 opc 节点/财务进度版式（只读） */
.order-status-panel { padding: 2px 20px 14px 80px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.order-status-panel[hidden] { display: none; }
.order-status-grid { display: flex; flex-direction: column; gap: 10px; }
.order-status-grid .opc-block { margin-bottom: 0; }
.order-status-grid .opc-node { cursor: default; }
.order-status-grid .opc-node:hover { border-color: var(--border); transform: none; }
.order-status-error { font-size: 12px; color: var(--red); padding: 6px 0; }
.order-complete-checks { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 5px 9px; border: 1px solid rgba(224,134,25,.25); border-radius: 6px; background: rgba(224,134,25,.08); font-size: 10.5px; color: #a9610d; }
.order-complete-checks span { font-weight: 600; white-space: nowrap; }
.order-complete-checks b { font-weight: 500; }
.order-complete-checks.ok { border-color: rgba(47,158,99,.25); background: rgba(47,158,99,.08); color: #2f9e63; }

/* ===== 应收应付结算单卡片：明细勾选 + 状态条 + 类型强区分 ===== */
.set-card { border-bottom: 1px solid var(--border); border-left: 4px solid transparent; transition: background .14s, box-shadow .14s; }
.set-card:last-child { border-bottom: 0; }
.set-card.ar { border-left-color: #2f9e63; background: linear-gradient(90deg, rgba(47,158,99,.05), transparent 40%); }
.set-card.ap { border-left-color: #e08619; background: linear-gradient(90deg, rgba(224,134,25,.05), transparent 40%); }
.set-card:hover { box-shadow: inset 0 0 0 1px var(--border); }
.set-row { border-bottom: 0; }
.exp-icon.green { background: rgba(47,158,99,.12); color: #2f9e63; }
.exp-icon.orange { background: rgba(224,134,25,.12); color: #e08619; }
/* 每张结算单的五阶段状态条（每工作号每类型唯一一张，进度稳定） */
.set-stages { display: flex; align-items: center; gap: 2px; margin-top: 7px; flex-wrap: wrap; }
.set-stage { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.set-stage i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; }
.set-stage.done { color: #2f9e63; }
.set-stage.done i { background: #2f9e63; color: #fff; }
.set-stage.current { font-weight: 700; }
.set-card.ar .set-stage.current { color: #2f9e63; }
.set-card.ap .set-stage.current { color: #e08619; }
.set-stage-arrow { width: 12px; height: 1px; background: var(--border); margin: 0 2px; }
/* 明细展开区：按往来对象分区，费用表 + 资金按钮 + 核销记录 */
.set-items-panel { padding: 4px 18px 10px 76px; background: var(--surface-2); }
.set-items { display: flex; flex-direction: column; gap: 8px; }
.set-summary-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 11px; color: var(--muted); }
.set-summary-strip b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.set-summary-strip .set-cash-open b { color: var(--primary); }
/* 公司名悬停：客户开票资料浮层 */
.cust-invoice-pop { position: fixed; z-index: 9999; max-width: 360px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 26px rgba(0,0,0,.16); font-size: 11.5px; color: var(--text); line-height: 1.55; }
.cust-invoice-pop[hidden] { display: none; }
.cip-title { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 700; }
.cip-title span { font-size: 10px; font-weight: 400; color: var(--primary); }
.cip-info { padding: 6px 8px; border-radius: 5px; background: var(--surface-2); white-space: pre-wrap; word-break: break-all; }
.cip-meta { margin-top: 4px; color: var(--muted); word-break: break-all; }
.cip-loading, .cip-empty { color: var(--muted); padding: 4px 0; }
/* 多往来单位：卡片顶部逐家公司分别显示已结/未结 */
.exp-meta-parties { flex-wrap: wrap; gap: 4px 7px; align-items: center; }
.party-chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); font-size: 10px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.party-chip b { font-weight: 600; color: var(--text); }
.party-chip em { font-style: normal; }
.party-chip em.open { color: #e08619; font-weight: 600; }
.set-card.ar .party-chip { border-color: rgba(47,158,99,.28); }
.set-card.ap .party-chip { border-color: rgba(224,134,25,.28); }
.party-owner-op { font-size: 10px; color: var(--muted); }
/* 对象分区卡 */
.set-party-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.set-party-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.set-party-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.set-party-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-party-name[data-cust-name] { color: var(--primary); cursor: help; }
.set-party-title small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.set-party-metrics { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-party-metrics b { color: var(--text); }
.set-party-metrics .set-party-open b { color: var(--primary); }
.set-party-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.set-party-acts .btn { border: 0; color: #fff; }
.set-party-acts .btn:hover { color: #fff; filter: brightness(.92); }
.set-btn-register { background: var(--primary); }
.set-btn-allocate { background: var(--teal); }
.set-btn-monthly { background: var(--orange); }
.monthly-quick-tip { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.7; }
/* 与操作台「费用明细」一致的紧凑表格：表头按内容类型对齐，列宽由 colgroup 固定 */
.set-recon-scroll { overflow-x: auto; background: var(--surface); }
.set-recon-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.set-recon-table th,
.set-recon-table td { padding: 4px 8px; border-right: 1px solid var(--border); font-size: 10.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-recon-table th:last-child,
.set-recon-table td:last-child { border-right: 0; }
.set-recon-table thead th { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border-strong); font-size: 10px; font-weight: 600; color: var(--muted); }
.set-recon-table tbody td { border-bottom: 1px solid var(--border); color: var(--text-2); }
.set-recon-table tbody tr:last-child td { border-bottom: 0; }
.set-recon-table tbody tr:hover td { background: var(--surface-2); }
.set-recon-table .set-col-text,
.set-recon-table td.set-name,
.set-recon-table td.set-note { text-align: left; }
.set-recon-table .set-col-num,
.set-recon-table td.set-num { text-align: right; font-variant-numeric: tabular-nums; }
.set-recon-table .set-col-center,
.set-recon-table td.set-currency { text-align: center; }
.set-recon-table td.set-name { color: var(--text); font-weight: 600; }
.set-recon-table td.set-note { color: var(--muted); }
.set-recon-table .is-settle-positive { color: var(--green, #34a853); font-weight: 700; }
.set-recon-table .is-settle-negative { color: var(--red, #d93025); font-weight: 700; }
/* 逐笔核销记录 */
.set-allocs { border-top: 1px dashed var(--border); padding: 5px 10px 7px; }
.set-allocs-head { margin-bottom: 3px; font-size: 10px; font-weight: 600; color: var(--muted); }
.set-alloc-row { display: flex; align-items: center; gap: 10px; min-height: 24px; padding: 2px 4px; border-bottom: 1px solid var(--border); font-size: 10.5px; }
.set-alloc-row:last-child { border-bottom: 0; }
.set-alloc-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.set-alloc-main b { color: var(--text); }
.set-alloc-main small, .set-alloc-op { color: var(--muted); font-size: 10px; white-space: nowrap; }
.set-alloc-no { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.set-alloc-no:hover { color: var(--primary); filter: brightness(1.08); }
.set-alloc-monthly { display:inline-flex; align-items:center; padding:0 5px; border-radius:4px; background:rgba(139,92,246,.12); border:1px solid rgba(139,92,246,.35); color:#7c4dff; font-size:9px; font-weight:700; line-height:15px; white-space:nowrap; }
[data-theme="dark"] .set-alloc-monthly { color:#c4a6ff; background:rgba(139,92,246,.18); }
.set-alloc-amt { color: var(--primary); font-variant-numeric: tabular-nums; }
.set-alloc-empty { padding: 2px 4px; font-size: 10.5px; color: var(--muted); }
/* 资金流水详情弹窗 */
.cash-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.cash-detail-grid > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cash-detail-grid span { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.cash-detail-grid b { font-size: 11.5px; color: var(--text); font-weight: 600; word-break: break-all; }
.cash-detail-grid .set-num { font-variant-numeric: tabular-nums; }
.cash-detail-section { margin-top: 12px; }
.cash-detail-section h4 { margin: 0 0 6px; font-size: 11.5px; color: var(--text); }
.cash-detail-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.cash-detail-table th, .cash-detail-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cash-detail-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.cash-detail-table .set-num { text-align: right; font-variant-numeric: tabular-nums; }
.set-items-empty { font-size: 11.5px; color: var(--muted); padding: 6px 0; }
.exp-green { color: var(--green); background: var(--green-soft); }
.exp-red { color: var(--red); background: var(--red-soft); }
.exp-gray { color: var(--muted); background: var(--surface-2); }

/* ============ 费用单票据样式（模拟纸质票据：撕口/存根/印章/虚线/金额大写/签字栏） ============ */
#expenseList, #financeList { padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.exp-ticket { display: flex; min-height: 168px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.05); position: relative; overflow: hidden; transition: box-shadow .16s, transform .16s; }
.exp-ticket:hover { box-shadow: 0 8px 22px rgba(0,0,0,.10); transform: translateY(-1px); }
/* 左右撕口半圆（用主题背景色挖孔） */
.exp-ticket::before, .exp-ticket::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border-strong); transform: translateY(-50%); z-index: 2; }
.exp-ticket::before { left: -10px; }
.exp-ticket::after { right: -10px; }
/* 左侧存根联 */
.exp-ticket-stub { width: 46px; flex: 0 0 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--surface-2); border-right: 2px dashed var(--border-strong); padding: 10px 0; }
.exp-stub-vertical { writing-mode: vertical-rl; letter-spacing: 2px; font-size: 11px; font-weight: 700; color: var(--text-2); }
.exp-stub-no { writing-mode: vertical-rl; font-size: 8px; color: var(--muted); font-variant-numeric: tabular-nums; max-height: 76px; overflow: hidden; }
/* 票面主体 */
.exp-ticket-body { flex: 1; min-width: 0; padding: 12px 14px; }
.exp-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.exp-ticket-brand { display: flex; align-items: center; gap: 8px; }
.exp-ticket-mark { width: 30px; height: 30px; flex: 0 0 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; }
.exp-ticket-brand b { display: block; font-size: 13px; color: var(--text); }
.exp-ticket-brand small { display: block; font-size: 8px; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }
/* 状态印章（旋转红/蓝/绿章效果，随 tone 变色） */
.exp-ticket-seal { border: 2px solid currentColor; border-radius: 6px; padding: 2px 7px; font-size: 11px; font-weight: 800; letter-spacing: 1px; transform: rotate(-7deg); white-space: nowrap; opacity: .82; }
.exp-ticket.tone-orange .exp-ticket-seal { color: var(--orange); }
.exp-ticket.tone-blue .exp-ticket-seal { color: var(--primary); }
.exp-ticket.tone-green .exp-ticket-seal { color: var(--green); }
.exp-ticket.tone-red .exp-ticket-seal { color: var(--red); }
.exp-ticket.tone-gray .exp-ticket-seal { color: var(--muted); }
.exp-ticket.tone-orange .exp-ticket-mark { background: var(--orange); }
.exp-ticket.tone-green .exp-ticket-mark { background: var(--green); }
.exp-ticket.tone-red .exp-ticket-mark { background: var(--red); }
/* 虚线分隔 */
.exp-ticket-dash { height: 0; border-top: 1px dashed var(--border-strong); margin: 11px 0; }
/* 票据信息网格 */
.exp-ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
.exp-ticket-grid > div { display: flex; gap: 7px; align-items: baseline; min-width: 0; }
.exp-ticket-grid span { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.exp-ticket-grid b { font-size: 12px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 事由 */
.exp-ticket-reason { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 12.5px; }
.exp-ticket-reason > span { color: var(--muted); flex: 0 0 auto; }
.exp-ticket-reason > div { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 金额栏 */
.exp-ticket-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.exp-ticket-amount-cn { font-size: 11.5px; color: var(--muted); }
.exp-ticket-amount-cn b { color: var(--text-2); font-size: 12.5px; margin-left: 4px; }
.exp-ticket-amount-num { font-size: 21px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
/* 底部签字栏 + 操作 */
.exp-ticket-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.exp-ticket-foot .exp-actions { max-width: 190px; }
.exp-ticket-sign { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.exp-sign-label { font-size: 10px; color: var(--muted); flex: 0 0 auto; }
.exp-sign-item { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; max-width: 72px; }
.exp-sign-item img { height: 22px; max-width: 60px; object-fit: contain; border-bottom: 1px solid var(--border-strong); background: transparent; mix-blend-mode: multiply; }
.exp-sign-item img.img-missing { height: auto; max-width: none; border: none; background: none; mix-blend-mode: normal; filter: none; color: var(--muted); font-size: 9px; }
/* 深色主题：签名反色后用 screen 混合，去掉白底且墨迹清晰（兼容旧的白底签名文件） */
[data-theme="dark"] .exp-sign-item img:not(.img-missing) { filter: invert(1); mix-blend-mode: screen; }
.exp-sign-item em { font-size: 9px; font-style: normal; color: var(--muted); line-height: 1.3; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.exp-sign-empty { font-size: 10px; color: var(--muted); }
/* 三列布局在窗口变窄时依次回落为两列、一列，保证票面字段可读 */
@media (max-width: 1360px) {
  #expenseList, #financeList { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  #expenseList, #financeList { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .exp-ticket-brand small { display: none; }
}

/* 详情弹窗 */
.exp-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.exp-detail-no { font-size: 17px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.exp-detail-type { display: flex; gap: 6px; margin-top: 8px; }
.exp-detail-amount { font-size: 26px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.exp-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.exp-detail-grid > div { display: flex; flex-direction: column; gap: 3px; }
.exp-detail-grid span, .exp-detail-reason > span, .exp-detail-attach > span, .exp-detail-comment > span { font-size: 11.5px; color: var(--muted); }
.exp-detail-grid b { font-size: 13px; color: var(--text); font-weight: 600; }
.exp-detail-reason, .exp-detail-attach, .exp-detail-comment { padding: 14px 0; border-bottom: 1px solid var(--border); }
.exp-detail-reason p, .exp-detail-comment p { margin: 6px 0 0; font-size: 13px; color: var(--text); line-height: 1.6; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }
.exp-detail-attach a { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--primary); text-decoration: none; }
.exp-detail-attach a:hover { text-decoration: underline; }
.exp-timeline-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 12px; }
.exp-timeline { display: flex; flex-direction: column; gap: 0; }
.exp-flow { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.exp-flow:last-child { padding-bottom: 0; }
.exp-flow:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--border); }
.exp-flow-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; position: relative; z-index: 1; }
.exp-flow-dot.tone-blue { background: var(--primary); } .exp-flow-dot.tone-green { background: var(--green); }
.exp-flow-dot.tone-red { background: var(--red); } .exp-flow-dot.tone-teal { background: var(--teal); }
.exp-flow-dot.tone-gray { background: var(--muted); }
.exp-flow-body { flex: 1; }
.exp-flow-top { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.exp-flow-top b { color: var(--text); }
.exp-flow-top span { margin-left: auto; font-size: 11px; color: var(--muted); }
.exp-flow-comment { font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 6px 10px; border-radius: 7px; margin-top: 5px; }
.attach-preview { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.attach-ok { color: var(--green); font-weight: 600; margin-left: 6px; }

@media (max-width: 1000px) {
  .exp-amount { min-width: 90px; font-size: 15px; }
  .exp-actions { max-width: 150px; }
  .expense-panel .file-search-wrap input { width: 220px; }
  #orderKeyword { width: 320px; }
}

/* ============ 费用：多附件 / 手写签名 / 财务支付 ============ */
/* 多附件列表（表单内） */
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }
.attach-chip .attach-ok { color: var(--green); font-weight: 700; }
.attach-rm { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1; }
.attach-rm:hover { color: var(--red); }

/* 详情弹窗附件链接（多张） */
.att-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-link { display: inline-block; font-size: 12.5px; color: var(--primary); background: var(--primary-soft); border-radius: 7px; padding: 5px 10px; text-decoration: none; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-link:hover { text-decoration: underline; }

/* 详情签名图 */
.exp-detail-sign { padding: 14px 0; border-bottom: 1px solid var(--border); }
.exp-detail-sign > span { font-size: 11.5px; color: var(--muted); }
.exp-detail-sign img { display: block; margin-top: 8px; max-width: 220px; max-height: 90px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.exp-flow-sign { margin-top: 6px; }
.exp-flow-sign img { max-width: 180px; max-height: 66px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }

/* 手写签名板 */
.sign-pad-wrap { width: 100%; }
.sign-pad-box { position: relative; border: 1.5px dashed var(--primary); border-radius: 10px; background: #fff; overflow: hidden; }
.sign-pad-box canvas { display: block; width: 100%; height: 180px; cursor: crosshair; touch-action: none; }
.sign-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #c7c7cf; pointer-events: none; }
.sign-pad-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

/* 财务 Tab 徽标 */
.att-tab .nav-badge { margin-left: 6px; vertical-align: middle; }

/* 侧边栏长菜单文案单行省略（费用申请/报销、财务支付管理） */
.nav-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-badge, .nav-item small { flex-shrink: 0; }

/* ============ 费用多级审批链 ============ */
.exp-chain { padding: 14px 0; border-bottom: 1px solid var(--border); }
.chain-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.chain-item:last-child { padding-bottom: 0; }
.chain-item:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--border); }
.chain-dot { width: 21px; height: 21px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; position: relative; z-index: 1; }
.chain-dot.tone-orange { background: var(--orange-soft); color: var(--orange); }
.chain-dot.tone-green { background: var(--green-soft); color: var(--green); }
.chain-dot.tone-red { background: var(--red-soft); color: var(--red); }
.chain-dot.tone-gray { background: var(--surface-2); color: var(--muted); }
.chain-body { flex: 1; padding-top: 1px; }
.chain-top { display: flex; align-items: center; gap: 8px; }
.chain-top b { font-size: 13px; color: var(--text); font-weight: 500; }
.chain-approver { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.chain-comment { font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 5px 9px; border-radius: 6px; margin-top: 5px; }
.chain-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chain-item.is-current .chain-top b { color: var(--primary); }
.chain-inline { color: var(--primary); font-weight: 500; }

/* 发起申请时的审批链预览 */
.flow-preview { grid-column: 1 / -1; margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.fp-title { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 10px; }
.fp-step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.fp-no { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.fp-name { color: var(--text); font-weight: 500; min-width: 96px; }
.fp-person { color: var(--text-2); }
.fp-arrow { margin: 3px 0 3px 9px; color: var(--muted); font-size: 12px; line-height: 1; }

/* 驳回后修改重提提示 */
.resubmit-note { margin: 4px 0 14px; padding: 10px 13px; background: var(--red-soft, #FEF2F2); border: 1px solid var(--red, #EF4444); border-radius: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.leave-foot-actions { display: inline-flex; align-items: center; gap: 6px; }

/* ============ 员工生日 · 福利关怀 ============ */
.bd-hero { display: flex; align-items: center; gap: 18px; padding: 22px 26px; border-radius: var(--radius); margin-bottom: 18px; background: linear-gradient(110deg,#fff0f5 0%,#fef4e9 100%); border: 1px solid #f6d9e4; }
.bd-hero-ic { font-size: 46px; line-height: 1; flex-shrink: 0; }
.bd-hero-txt { flex: 1; min-width: 0; }
.bd-hero-txt h2 { margin: 0 0 5px; font-size: 20px; color: #c0346b; }
.bd-hero-txt p { margin: 0; font-size: 13px; color: var(--text-2); }
.bd-hero-avatars { display: flex; flex-shrink: 0; }
.bd-hero-avatars .avatar { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; margin-left: -10px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.bd-hero-avatars .avatar:first-child { margin-left: 0; }

.bd-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.bd-stat { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.bd-stat-ic { font-size: 26px; line-height: 1; }
.bd-stat b { display: block; font-size: 24px; line-height: 1.1; color: var(--text); }
.bd-stat small { color: var(--muted); font-size: 12px; }
.bd-stat.tone-pink .bd-stat-ic { filter: hue-rotate(-10deg); }

.bd-filter { display: flex; gap: 6px; }
.bd-filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bd-explain { margin: 0 20px 8px; padding: 9px 13px; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--border); font-size: 12px; color: var(--text-2); line-height: 1.65; }
.bd-explain b { color: var(--primary); }

/* 工作台：今日寿星与祝福 */
.home-birthday-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.bw-block { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); min-width: 0; }
.bw-person { display: flex; align-items: center; gap: 11px; }
.bw-person .avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.bw-person-info { flex: 1; min-width: 0; }
.bw-person-info b { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); white-space: nowrap; flex-wrap: wrap; row-gap: 3px; }
.bw-person-info small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.bw-tag { font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 10px; background: #fff6e9; color: #b45309; white-space: nowrap; }
.bw-self { font-size: 12px; color: #c0346b; white-space: nowrap; }
.bw-company { margin-top: 11px; padding: 10px 12px; border-radius: 9px; background: linear-gradient(100deg,#fff0f5,#fef4e9); font-size: 12.5px; color: #8c3359; line-height: 1.65; }
.bw-company b { color: #c0346b; }
.bw-subtitle { margin: 11px 0 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bw-subtitle em { font-style: normal; color: var(--primary); }
.bw-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--border); font-size: 12px; }
.bw-item.mine { background: rgba(46,140,160,.05); }
.bw-who { color: var(--primary); font-weight: 600; white-space: nowrap; }
.bw-text { flex: 1; color: var(--text); word-break: break-word; }
.bw-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 3px; }
.bw-del:hover { color: #d1436c; }
.bw-empty { color: var(--muted); font-size: 12px; padding: 6px 0; }
.wish-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.wish-chip { font-size: 11.5px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12px; padding: 6px 13px; border-radius: 18px; cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.bd-list { padding: 4px 0; }
.bd-row { display: grid; grid-template-columns: 84px 1.4fr 1.1fr 1fr 88px; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.bd-row:last-child { border-bottom: none; }
.bd-row:hover { background: var(--surface-2); }
.bd-row.is-lunar .bd-when { background: #fff6e9; }
.bd-row.is-lunar .bd-when b { color: #b45309; }
.bd-when { text-align: center; background: var(--primary-soft); border-radius: 10px; padding: 7px 0; }
.bd-when b { display: block; color: var(--primary); font-size: 14px; }
.bd-when small { color: var(--muted); font-size: 11px; }
.bd-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-person .avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.bd-person b { display: block; font-size: 13.5px; color: var(--text); }
.bd-person small { display: block; color: var(--muted); font-size: 11.5px; }
.bd-cal-wrap { display: flex; flex-direction: column; gap: 3px; }
.bd-cal { display: inline-block; width: fit-content; font-size: 11.5px; padding: 2px 9px; border-radius: 12px; font-weight: 500; }
.bd-cal.lunar { color: #b45309; background: #fff6e9; }
.bd-cal.solar { color: var(--primary); background: var(--primary-soft); }
.bd-solar { color: var(--muted); font-size: 11px; }
.bd-gift { color: var(--text-2); font-size: 12.5px; }
.bd-gift span { color: #c0346b; }
.bd-count { text-align: right; font-size: 12.5px; color: var(--text-2); }
.bd-count b { color: var(--orange); font-size: 15px; }
.bd-count .bd-today { color: #e8508c; }
.bd-count .bd-soon { color: var(--orange); }
.bd-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .bd-stats { grid-template-columns: repeat(2,1fr); }
  .bd-hero-avatars { display: none; }
  .bd-row { grid-template-columns: 70px 1fr 96px; }
  .bd-gift { display: none; }
  .bd-filters { width: 100%; }
  .home-birthday-list { grid-template-columns: 1fr; }
}

/* ============ 个人备忘 · 提醒 ============ */

/* ---- 备忘新增 / 编辑表单 ---- */
.memo-form { display: flex; flex-direction: column; gap: 18px; }
.memo-f-section { display: flex; flex-direction: column; gap: 8px; }
.memo-f-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.memo-f-label-txt { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.memo-f-label-txt em { color: var(--red); font-style: normal; margin-left: 3px; }
.memo-f-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .15s; }
.memo-f-count.near { color: var(--orange); font-weight: 600; }
.memo-f-textarea { width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 13.5px; line-height: 1.7; resize: vertical; min-height: 106px; outline: none; transition: border-color .16s, box-shadow .16s; }
.memo-f-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14); }
.memo-f-textarea::placeholder { color: #9a9aa2; }

.memo-f-remind { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.memo-f-remind-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.memo-f-remind-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.memo-f-bell { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; font-size: 17px; background: var(--primary-soft); border-radius: 11px; }
.memo-f-remind-title b { display: block; font-size: 13.5px; color: var(--text); }
.memo-f-remind-title small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

/* 提醒开关（滑块） */
.memo-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; cursor: pointer; user-select: none; }
.memo-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.memo-switch-track { position: relative; width: 42px; height: 24px; flex-shrink: 0; border-radius: 12px; background: var(--border-strong); transition: background .2s; }
.memo-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.memo-switch input:checked + .memo-switch-track { background: var(--primary); }
.memo-switch input:checked + .memo-switch-track .memo-switch-thumb { transform: translateX(18px); }
.memo-switch input:focus-visible + .memo-switch-track { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .22); }
.memo-switch-text { font-size: 12px; color: var(--muted); min-width: 24px; }

/* 提醒主体 */
.memo-f-remind-body { display: flex; flex-direction: column; gap: 14px; padding: 2px 16px 16px; }
.memo-f-mini-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.memo-type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.memo-type-opt { position: relative; cursor: pointer; }
.memo-type-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.memo-type-opt > span { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 6px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--text-2); transition: .16s; }
.memo-type-opt:hover > span { border-color: var(--primary); }
.memo-type-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; box-shadow: inset 0 0 0 1px var(--primary); }
.memo-type-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .22); }
.memo-f-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.memo-f-fields .field { gap: 6px; }
.memo-f-fields .field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.memo-f-fields .input { padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px; }
.memo-f-note { margin: 0 16px 16px; }
/* 备忘视图到期横幅 */
.memo-due-hero { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius); margin-bottom: 18px; background: linear-gradient(110deg, #fff5e6, #ffe9ef); border: 1px solid #f6d9a8; }
.memo-due-ic { font-size: 40px; line-height: 1; flex-shrink: 0; }
.memo-due-ic.ok { color: var(--green); }
.memo-due-txt { flex: 1; min-width: 0; }
.memo-due-txt h2 { margin: 0 0 6px; font-size: 18px; color: #b45309; }
.memo-due-txt p { margin: 0; font-size: 13px; color: var(--text-2); }
.memo-due-items { display: flex; flex-wrap: wrap; gap: 6px; }
.memo-due-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; background: #fff; border: 1px solid #f0c987; color: #92580a; padding: 3px 5px 3px 10px; border-radius: 14px; cursor: pointer; }
.memo-due-chip b { font-size: 11px; background: var(--orange); color: #fff; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.memo-due-chip:hover { border-color: var(--orange); }
.memo-due-go { flex-shrink: 0; border: 0; background: var(--orange); color: #fff; font-size: 13px; padding: 9px 15px; border-radius: 9px; }

/* 统计卡 */
.memo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.memo-stat { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px; box-shadow: var(--shadow); }
.memo-stat > span { font-size: 24px; line-height: 1; }
.memo-stat b { display: block; font-size: 22px; line-height: 1.1; color: var(--text); }
.memo-stat small { color: var(--muted); font-size: 12px; }

/* 头部操作 */
.memo-head-actions { display: flex; gap: 10px; align-items: center; }
.memo-filter-sel { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* 备忘便签纸：每条记录一张彩色便签，颜色按 id 稳定分配 */
.memo-list { padding: 20px 20px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px 20px; align-items: stretch; }
.memo-note {
  --note-bg: #fff6bf; --note-ink: #5b4a13; --note-accent: #e3b423;
  position: relative; display: flex; flex-direction: column; gap: 12px;
  min-height: 200px; padding: 27px 18px 14px;
  background: var(--note-bg); color: var(--note-ink);
  border: 1px solid rgba(0,0,0,.05); border-radius: 2px 2px 12px 2px;
  box-shadow: 0 5px 14px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.05);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .18s ease, box-shadow .18s ease;
}
.memo-note::after { content: ''; position: absolute; right: 0; bottom: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 16px 16px; border-color: transparent transparent rgba(0,0,0,.07) transparent; border-bottom-right-radius: 10px; }
.memo-note:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,.16); z-index: 2; }
.memo-tape { position: absolute; top: -9px; left: calc(50% + var(--tape-x, 0px)); transform: translateX(-50%) rotate(-3deg); width: 74px; height: 21px; border-radius: 2px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.62) 0 6px, rgba(255,255,255,.42) 6px 8px); box-shadow: 0 1px 2px rgba(0,0,0,.10); }
.memo-note.tone-0 { --note-bg: #fff6bf; --note-ink: #5b4a13; --note-accent: #e3b423; }
.memo-note.tone-1 { --note-bg: #ffe2e8; --note-ink: #6b2c40; --note-accent: #e2698b; }
.memo-note.tone-2 { --note-bg: #deefff; --note-ink: #23445f; --note-accent: #4f9fd9; }
.memo-note.tone-3 { --note-bg: #daf3e2; --note-ink: #1f5238; --note-accent: #4fb37d; }
.memo-note.tone-4 { --note-bg: #eae2ff; --note-ink: #432e68; --note-accent: #9272d9; }
.memo-note.tone-5 { --note-bg: #ffe8d6; --note-ink: #6a3f1e; --note-accent: #e08c45; }
.memo-note.tone-6 { --note-bg: #d9f2f3; --note-ink: #1d5052; --note-accent: #49aeb2; }
.memo-note.tone-7 { --note-bg: #ffe4f0; --note-ink: #682b4c; --note-accent: #d970a5; }
.memo-note.due { box-shadow: 0 6px 16px rgba(232,130,12,.28), 0 0 0 2px var(--orange); }
.memo-note.done { filter: saturate(.55); }
.memo-note-row { display: flex; align-items: flex-start; gap: 10px; flex: 1; }
.memo-note .memo-check { width: 20px; height: 20px; margin-top: 1px; border: 2px solid var(--note-accent); border-radius: 6px; background: rgba(255,255,255,.75); color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.memo-note .memo-check.checked { background: var(--green); border-color: var(--green); }
.memo-body { flex: 1; min-width: 0; }
.memo-note .memo-content { font-size: 14px; font-weight: 500; color: var(--note-ink); white-space: pre-wrap; word-break: break-word; }
.memo-note.done .memo-content { text-decoration: line-through; opacity: .6; }
.memo-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.memo-tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 11px; }
.memo-note .memo-tag, .memo-note .memo-cycle-done { color: var(--note-ink); background: rgba(255,255,255,.6); }
.memo-when, .memo-next { font-size: 12px; color: var(--muted); }
.memo-note .memo-when, .memo-note .memo-next { color: var(--note-ink); opacity: .72; }
.memo-cycle-done { font-size: 11px; color: var(--green); background: var(--green-soft); padding: 2px 8px; border-radius: 10px; }
.memo-note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 9px; border-top: 1px dashed rgba(0,0,0,.10); }
.memo-foot-left { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.memo-handle { flex-shrink: 0; font-size: 12px; font-weight: 600; color: #fff; background: var(--orange); border: 0; padding: 5px 12px; border-radius: 8px; transition: .15s; }
.memo-handle:hover { background: #c96f08; }
.memo-due-badge { flex-shrink: 0; font-size: 11px; font-weight: 600; color: #fff; background: var(--orange); padding: 3px 10px; border-radius: 12px; }
.memo-ops { display: flex; gap: 2px; flex-shrink: 0; }
.memo-ops button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--note-ink); opacity: .55; border-radius: 7px; font-size: 14px; transition: .15s; }
.memo-ops button:hover { background: rgba(255,255,255,.6); color: var(--note-ink); opacity: 1; }
.memo-ops button.del:hover { background: var(--red-soft); color: var(--red); opacity: 1; }
.memo-empty { grid-column: 1 / -1; padding: 46px 20px; text-align: center; color: var(--muted); font-size: 14px; }
/* 夜间模式：便签改为深色纸张 + 亮色文字，避免亮色块刺眼 */
[data-theme="dark"] .memo-note { border-color: rgba(255,255,255,.08); box-shadow: 0 5px 14px rgba(0,0,0,.42); }
[data-theme="dark"] .memo-note::after { border-bottom-color: rgba(255,255,255,.07); }
[data-theme="dark"] .memo-tape { background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 6px, rgba(255,255,255,.10) 6px 8px); }
[data-theme="dark"] .memo-note.tone-0 { --note-bg: #3b3520; --note-ink: #f2e5ad; }
[data-theme="dark"] .memo-note.tone-1 { --note-bg: #3d2630; --note-ink: #f7c2d2; }
[data-theme="dark"] .memo-note.tone-2 { --note-bg: #203343; --note-ink: #bcdcf5; }
[data-theme="dark"] .memo-note.tone-3 { --note-bg: #20382b; --note-ink: #b9e6c9; }
[data-theme="dark"] .memo-note.tone-4 { --note-bg: #2e2740; --note-ink: #d5c6f7; }
[data-theme="dark"] .memo-note.tone-5 { --note-bg: #3c2e20; --note-ink: #f3d0ab; }
[data-theme="dark"] .memo-note.tone-6 { --note-bg: #1d3536; --note-ink: #b6e2e3; }
[data-theme="dark"] .memo-note.tone-7 { --note-bg: #3a2633; --note-ink: #f2c0d9; }
[data-theme="dark"] .memo-note .memo-tag, [data-theme="dark"] .memo-note .memo-cycle-done,
[data-theme="dark"] .memo-note .memo-check { background: rgba(255,255,255,.13); }
[data-theme="dark"] .memo-note-foot { border-top-color: rgba(255,255,255,.12); }
[data-theme="dark"] .memo-ops button:hover { background: rgba(255,255,255,.13); }
/* 工作台「今日备忘」：与首页卡片同框的便签条（2026-12-01 整合） */
.home-grid > .home-memo-notes-wrap { flex: 0 0 100%; width: 100%; padding: 12px 20px 14px; background: linear-gradient(120deg,#fffdf5,var(--surface) 60%); }
.home-memo-notes-wrap .home-card-head { padding-bottom: 8px; margin-bottom: 4px; }
.home-memo-count { font-size: 11px; font-weight: 700; color: #b8801a; background: #fff3d4; border: 1px solid #f4d99b; padding: 2px 9px; border-radius: 20px; }
.home-memo-notes { padding: 6px 0 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 14px; }
.home-memo-notes .memo-note { width: min(320px,100%); min-height: 0; padding: 20px 14px 9px; gap: 7px; cursor: pointer; }
.home-memo-notes .memo-tape { top: -7px; width: 56px; height: 15px; }
.home-memo-notes .memo-note::after { border-bottom-width: 12px; border-left-width: 12px; }
.home-memo-notes .memo-content { font-size: 13px; line-height: 1.45; }
.home-memo-notes .memo-meta { margin-top: 4px; gap: 6px; }
.home-memo-notes .memo-note-foot { margin-top: 0; padding-top: 6px; }
.home-memo-notes .memo-handle { font-size: 11.5px; padding: 3px 9px; }
.home-memo-notes .memo-ops button { width: 26px; height: 26px; font-size: 13px; }
.home-memo-wait { font-size: 10.5px; color: var(--note-ink); opacity: .7; }
@media (max-width: 900px) { .home-memo-notes .memo-note { width: min(280px,100%); } }

/* ============ 意见箱 ============ */
.home-opinion-banner { display: flex; align-items: center; gap: 16px; padding: 16px 22px; margin-bottom: 18px; border-radius: var(--radius); background: linear-gradient(110deg, #e8f7f4 0%, #eaf2ff 100%); border: 1px solid #b9ded7; box-shadow: 0 2px 10px rgba(13,148,136,.08); }
.home-opinion-banner[hidden] { display: none; }
.hop-ic { font-size: 30px; flex-shrink: 0; }
.hop-main { flex: 1; min-width: 0; }
.hop-title { font-size: 15px; font-weight: 700; color: #0f766e; margin-bottom: 6px; }
.hop-items { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.hop-chip { font-size: 11px; font-weight: 600; color: #fff; background: var(--teal); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.hop-text { font-size: 13px; color: var(--text); }
.hop-go { flex-shrink: 0; border: 0; background: var(--teal); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 9px; }
.hop-go:hover { background: #0b7a70; }

.op-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.op-stat { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px; box-shadow: var(--shadow); }
.op-stat > span { font-size: 24px; line-height: 1; }
.op-stat b { display: block; font-size: 22px; line-height: 1.1; color: var(--text); }
.op-stat small { color: var(--muted); font-size: 12px; }
.op-panel-head { flex-wrap: wrap; gap: 12px; }
.op-tabs { display: flex; gap: 6px; }
.op-tab { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.op-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.op-tab em { font-style: normal; margin-left: 5px; background: var(--red); color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 11px; }
.op-head-actions { display: flex; gap: 8px; margin-left: auto; }
/* 总经理信箱 —— 航空信封卡片墙 */
.op-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; padding: 18px 20px 22px; align-items: start; }
/* 牛皮纸信面 + 红蓝航空斜纹边框 */
.op-row.env { position: relative; padding: 0; border: 6px solid transparent; border-radius: 12px;
  background:
    linear-gradient(158deg, #fffaf0 0%, #f9efd9 55%, #f2e2c2 100%) padding-box,
    repeating-linear-gradient(45deg, #c4402f 0 8px, #f7e8cb 8px 16px, #2f5f9e 16px 24px, #f7e8cb 24px 32px) border-box;
  cursor: pointer; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; overflow: hidden; }
.op-row.env.env-anon-card {
  background:
    linear-gradient(158deg, #fcf7ff 0%, #f2e6fb 55%, #e8d3f4 100%) padding-box,
    repeating-linear-gradient(45deg, #7c3aed 0 8px, #efe0fa 8px 16px, #a855f7 16px 24px, #efe0fa 24px 32px) border-box;
}
.op-row.env:hover { transform: translateY(-4px) rotate(-.3deg); box-shadow: 0 14px 30px rgba(90,62,20,.18); }
.op-row.env.unread { box-shadow: 0 0 0 2px var(--primary), 0 10px 26px rgba(0,0,0,.1); }

/* 信封翻盖：顶部 V 形折线（牛皮纸折片） */
.env-flap { position: relative; height: 48px; background: linear-gradient(180deg, rgba(214,182,128,.5), rgba(214,182,128,.06)); }
.env-flap::before, .env-flap::after { content: ''; position: absolute; top: -1px; width: 51%; height: 100%;
  background: linear-gradient(180deg, #fff7e7, #f0dcb4); border: 1px solid rgba(150,115,60,.32);
  filter: drop-shadow(0 2px 1px rgba(120,85,35,.14)); }
.env-flap::before { left: -1px; border-radius: 10px 0 0 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env-flap::after { right: -1px; border-radius: 0 10px 0 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env-airmail { position: absolute; left: 50%; top: 9px; z-index: 2; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; letter-spacing: 1.6px; white-space: nowrap; color: #a8512f;
  text-shadow: 0 1px 0 rgba(255,255,255,.75); }
.op-row.env.unread .env-flap { background: linear-gradient(180deg, rgba(var(--primary-rgb),.16), transparent); }
[data-theme="dark"] .op-row.env {
  background:
    linear-gradient(158deg, #3b3327 0%, #302a20 55%, #282219 100%) padding-box,
    repeating-linear-gradient(45deg, #a8382b 0 8px, #2c261e 8px 16px, #30558c 16px 24px, #2c261e 24px 32px) border-box;
}
[data-theme="dark"] .op-row.env.env-anon-card {
  background:
    linear-gradient(158deg, #362b42 0%, #2c2338 55%, #251d30 100%) padding-box,
    repeating-linear-gradient(45deg, #7c3aed 0 8px, #2c2338 8px 16px, #a855f7 16px 24px, #2c2338 24px 32px) border-box;
}
[data-theme="dark"] .env-flap::before,
[data-theme="dark"] .env-flap::after { background: linear-gradient(180deg, #493e2e, #3a3125); border-color: rgba(255,255,255,.12); filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
[data-theme="dark"] .env-airmail { color: #e6a884; text-shadow: 0 1px 0 rgba(0,0,0,.5); }

.env-body { padding: 4px 16px 6px; }
.env-top { display: flex; align-items: flex-start; justify-content: space-between; min-height: 40px; }
.env-stamp { display: flex; align-items: center; gap: 2px; transform: rotate(-4deg); transform-origin: left center; }
.env-stamp-img { width: 40px; height: 44px; padding: 3px; background: #fffdf7; border: 1px solid #d9c7a5; box-shadow: 0 2px 4px rgba(120,85,35,.18); position: relative;
  -webkit-mask-image: radial-gradient(circle at 3px 3px, transparent 2.6px, #000 2.9px), radial-gradient(circle at 3px 41px, transparent 2.6px, #000 2.9px), radial-gradient(circle at 37px 3px, transparent 2.6px, #000 2.9px), radial-gradient(circle at 37px 41px, transparent 2.6px, #000 2.9px);
}
.env-stamp-img .avatar { width: 100%; height: 100%; border-radius: 2px; font-size: 14px; }
.env-anon, .env-stamp-img .env-anon { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; font-size: 15px; font-weight: 700; border-radius: 2px; }
.env-stamp-post { display: flex; flex-direction: column; align-items: center; line-height: 1.05; color: var(--red); opacity: .72; padding: 2px 5px; border: 1.5px solid currentColor; border-radius: 50%; transform: rotate(6deg); margin-left: -4px; }
.env-stamp-post b { font-size: 10px; letter-spacing: .3px; }
.env-stamp-post small { font-size: 7px; }
.env-seal { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #e8615a, #c4302b 70%); box-shadow: 0 2px 6px rgba(196,48,43,.4), inset 0 0 0 2px rgba(255,255,255,.35); transform: rotate(-14deg); }
.env-seal svg { width: 18px; height: 18px; }

.env-main { margin-top: 6px; }
.env-row1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.env-name { font-size: 14px; font-weight: 700; color: var(--text); }
.op-row.env.unread .env-name { color: var(--primary-dark); }
.env-text { margin-top: 7px; min-height: 42px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.env-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed rgba(150,115,60,.32); }
.env-to { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%;
  background: rgba(255,255,255,.5); border: 1px solid rgba(150,115,60,.24); border-radius: 4px; padding: 2px 7px; }
.env-tags { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.env-tags .op-tag { display: inline-flex; align-items: center; gap: 3px; }
.env-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.env-actions { position: absolute; right: 10px; top: 10px; z-index: 2; }
.env-del { opacity: .55; }
.op-row.env:hover .env-del { opacity: 1; }
[data-theme="dark"] .env-flap { background: linear-gradient(180deg, rgba(255,255,255,.06), transparent); }
[data-theme="dark"] .env-to { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .env-foot { border-top-color: rgba(255,255,255,.14); }

.op-tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 11px; }
.op-tag.anonymous { background: #f2ecff; color: #7c3aed; }
.op-tag.real { background: var(--primary-soft); color: var(--primary); }
.op-tag.attach { background: var(--orange-soft); color: #b45309; }
.op-tag.reply { background: var(--green-soft); color: #0f766e; }
.op-empty { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.op-empty-env { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); color: var(--primary); }
.op-empty-env svg { width: 30px; height: 30px; }

/* 意见箱表单/详情 */
.op-boss-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 210px; overflow: auto; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.op-boss-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.op-boss-item:hover { background: var(--surface); }
.op-boss-item input { width: 15px; height: 15px; flex-shrink: 0; }
.op-boss-item b { color: var(--text); }
.op-boss-item small { color: var(--muted); margin-left: auto; }
.op-attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.op-attach-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.op-attach-chip button { margin-left: auto; border: 0; background: transparent; color: var(--red); cursor: pointer; }
.op-detail-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.op-detail-name { font-size: 15px; font-weight: 700; color: var(--text); }
.op-detail-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.op-detail-body { margin: 16px 0; padding: 16px; background: var(--surface-2); border-radius: 10px; white-space: pre-wrap; line-height: 1.8; font-size: 14px; color: var(--text); }
.op-detail-section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 14px 0 8px; }
.op-file-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary); background: var(--primary-soft); padding: 6px 10px; border-radius: 8px; margin: 0 6px 6px 0; text-decoration: none; }
.op-reply-item { border-left: 3px solid var(--teal); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: 10px 14px; margin-bottom: 10px; }
.op-reply-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.op-reply-meta b { color: var(--text); font-size: 13px; }
.op-reply-meta .avatar.avatar-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.op-reply-text { margin-top: 6px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.op-reply-box { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.op-reply-hint { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.op-reply-box .btn { margin-top: 10px; }

/* ---- 写信表单（美化合集） ---- */
.op-compose { display: flex; flex-direction: column; gap: 16px; }
.op-boss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.op-boss-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; background: var(--surface); transition: .16s; }
.op-boss-item:hover { border-color: var(--primary); }
.op-boss-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.op-boss-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.op-boss-item:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .22); }
.op-boss-avatar { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 700; }
.op-boss-item:has(input:checked) .op-boss-avatar { background: var(--primary); color: #fff; }
.op-boss-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.op-boss-info b { font-size: 13px; color: var(--text); }
.op-boss-info small { font-size: 11px; color: var(--muted); }
.op-boss-check { margin-left: auto; width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; opacity: 0; transform: scale(.6); transition: .16s; }
.op-boss-item:has(input:checked) .op-boss-check { opacity: 1; transform: scale(1); }
.op-anon-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; }
.op-anon-txt { display: flex; align-items: center; gap: 11px; min-width: 0; }
.op-anon-ic { font-size: 20px; line-height: 1; }
.op-anon-txt > span:last-child { display: flex; flex-direction: column; line-height: 1.4; }
.op-anon-txt b { font-size: 13px; color: var(--text); }
.op-anon-txt small { font-size: 11px; color: var(--muted); }
.op-upload { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 20px; border: 1.5px dashed var(--border-strong); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12.5px; cursor: pointer; transition: .16s; }
.op-upload:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.op-upload-ic { font-size: 18px; line-height: 1; color: var(--primary); }
.op-attach-list:empty { display: none; }

@media (max-width: 900px) {
  .memo-stats { grid-template-columns: repeat(2, 1fr); }
  .memo-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px 14px; padding: 16px 14px 20px; }
  .memo-due-hero { flex-wrap: wrap; }
  .op-stats { grid-template-columns: repeat(2, 1fr); }
  .home-opinion-banner { flex-wrap: wrap; }
  .op-boss-grid { grid-template-columns: 1fr; }
  .op-head-actions { margin-left: 0; }
}

/* ==================== 个性化色调切换器（全员可用） ==================== */
.theme-menu { position: relative; }
.theme-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 9px; transition: .15s; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
/* 顶栏页面刷新：与个性化色调按钮同规格，点击时图标旋转 */
.refresh-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 9px; transition: .15s; }
.refresh-btn svg { width: 18px; height: 18px; }
.refresh-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.refresh-btn:active { transform: scale(.94); }
.refresh-btn.is-loading svg { animation: topbarRefreshSpin .7s linear infinite; }
@keyframes topbarRefreshSpin { to { transform: rotate(360deg); } }
.theme-popover { position: absolute; top: calc(100% + 10px); right: 0; width: 258px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s; z-index: 60; }
.theme-menu.open .theme-popover { opacity: 1; visibility: visible; transform: none; }
.theme-pop-head { font-size: 12px; font-weight: 700; color: var(--text); margin: 2px 4px 10px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 11.5px; text-align: left; transition: .14s; }
.theme-item:hover { background: var(--surface-2); border-color: var(--primary-border); }
.theme-item.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(0,0,0,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.theme-item.active .theme-dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.theme-check { margin-left: auto; width: 14px; height: 14px; color: var(--primary); opacity: 0; }
.theme-item.active .theme-check { opacity: 1; }
.theme-pop-foot { font-size: 10.5px; color: var(--muted); margin: 10px 4px 2px; line-height: 1.5; }
/* 顶栏默认快捷三套（经典蓝 / 夜间黑 / 玫瑰红） */
.theme-quick-label { font-size: 10px; color: var(--muted); margin: 0 4px 6px; font-weight: 600; letter-spacing: .5px; }
.theme-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-quick-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 3px 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 10.5px; transition: .14s; }
.theme-quick-btn:hover { background: var(--surface-2); border-color: var(--primary-border); }
.theme-quick-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.theme-quick-btn .tq-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(0,0,0,.08); }
.theme-quick-btn.active .tq-dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.theme-divider { height: 1px; background: var(--border); margin: 11px 2px 10px; }

@media (max-width: 600px) {
  .theme-popover { right: -56px; }
}

/* ==================== 操作记录（审计日志） ==================== */
.tone-red { color: var(--red); background: var(--red-soft, #fdecec); }
.tone-green { color: var(--green); background: var(--green-soft); }
.oplog-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.oplog-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.oplog-actor { display: flex; flex-direction: column; line-height: 1.35; }
.oplog-actor b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.oplog-actor small { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.oplog-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12px; }
.oplog-table td { vertical-align: middle; }
.oplog-table .file-empty { padding: 20px 0; }
@media (max-width: 900px) {
  .oplog-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== 业务中心 + 财务结算 ==================== */
.tone-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; line-height: 1.5; }
.exp-flow-item { display: flex; gap: 10px; padding: 9px 0; position: relative; }
.exp-flow-item > div { display: flex; flex-direction: column; gap: 2px; }
.exp-flow-item b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.exp-flow-item span:not(.exp-flow-dot) { font-size: 11.5px; color: var(--text-2); }
.exp-flow-item small { font-size: 10.5px; color: var(--muted); }
.exp-flow-dot.tone-purple { background: #8b5cf6; }
.exp-flow-dot.tone-orange { background: var(--orange); }
.stat-purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.stat-purple::after { background: var(--purple-soft); }

/* ==================== 业务记录表（单据版式，按纸质《业务记录表》） ==================== */
.bs-custpicker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 10px; }
.bs-custpicker > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.bs-custpicker .input { max-width: 320px; }
.bs-custpicker .field-hint { font-size: 11px; }
.biz-sheet { background: #fff; color: #1a1a1a; padding: 22px 26px 26px; border: 1px solid #d7d7d7; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.bs-head { text-align: center; margin-bottom: 12px; }
.bs-company { font-size: 19px; font-weight: 700; letter-spacing: 3px; color: #1a1a1a; }
.bs-title-row { position: relative; margin-top: 4px; }
.bs-title-row h3 { font-size: 17px; letter-spacing: 6px; margin: 0; font-weight: 700; }
.bs-no { position: absolute; right: 0; top: -4px; color: #c0392b; font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.bs-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.bs-table td { border: 1px solid #9aa0a6; padding: 5px 7px; vertical-align: middle; min-height: 22px; line-height: 1.5; word-break: break-word; }
.bs-table + .bs-table { border-top: none; }
.bs-table td.bs-l { background: #eef1f4; font-weight: 600; text-align: center; white-space: nowrap; width: 9.5%; }
.bs-table td.bs-strong { font-weight: 700; color: #b3261e; }
.bs-table td.bs-ro { color: #444; font-variant-numeric: tabular-nums; }
.bs-val { display: inline-block; min-width: 12px; min-height: 16px; }
.bs-val.bs-money { font-variant-numeric: tabular-nums; }
.bs-input { width: 100%; border: 1px solid transparent; background: transparent; padding: 3px 5px; font: inherit; color: #1a1a1a; border-radius: 4px; outline: none; }
.bs-input:hover { border-color: #c9d4e0; background: #fff; }
.bs-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .12); }
.bs-input.bs-num { text-align: right; font-variant-numeric: tabular-nums; }
textarea.bs-input { resize: vertical; min-height: 42px; }
.bs-goods td.bs-ck-cell { width: 24%; }
.bs-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bs-ck { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.bs-ck input { accent-color: var(--primary); }
.bs-qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 5px; border-top: 1px dashed #c4c9cf; }
.bs-qty .bs-l { border: none !important; background: transparent !important; width: auto !important; padding: 0 !important; }
.bs-qty td { border: none !important; padding: 0 !important; }
.bs-qty .bs-input { border-bottom: 1px solid #9aa0a6; }
.bs-yn { display: inline-flex; align-items: center; gap: 10px; }
.bs-yn label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.bs-yn input { accent-color: var(--primary); }
.bs-tt { margin-top: 3px; }
.bs-fee td.bs-fee-title { background: #eef1f4; font-weight: 600; text-align: center; writing-mode: vertical-rl; letter-spacing: 4px; }
.bs-fee td.bs-fl { width: 10%; white-space: nowrap; font-weight: 600; }
.bs-fee td.bs-fc { width: 23%; }
.bs-optable td.bs-oplines { padding: 4px 8px; }
.bs-opline { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #d5d9de; }
.bs-opline:last-child { border-bottom: none; }
.bs-opline > span { white-space: nowrap; font-weight: 600; min-width: 68px; }
.bs-opline .bs-input { flex: 1; }
.bs-optable td.bs-pay { width: 20%; padding: 4px; }
.bs-optable td.bs-pay .bs-input { min-height: 92px; }
.bs-signs { display: flex; gap: 10px; margin-top: 16px; }
.bs-sign-cell { flex: 1; display: flex; align-items: center; gap: 6px; }
.bs-sign-label { white-space: nowrap; font-size: 12px; font-weight: 600; }
.bs-sign-box { flex: 1; min-height: 44px; border-bottom: 1px solid #555; display: flex; align-items: flex-end; padding: 2px 4px; }
.bs-sign-img { max-height: 42px; max-width: 100%; object-fit: contain; }
.bs-sign-name { font-family: "KaiTi", "STKaiti", cursive; font-size: 17px; color: #333; }
.bs-sign-btn { border: 1px dashed var(--primary); background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 5px 10px; font-size: 11.5px; cursor: pointer; }
.bs-sign-btn:hover { background: var(--primary); color: #fff; }
.bs-extra { margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--border); }
.bs-extra .exp-detail-head { padding-bottom: 10px; }
.bs-owner-line { display: flex; gap: 24px; font-size: 11.5px; color: var(--muted); padding: 8px 0 12px; }
@media (max-width: 780px) {
  .biz-sheet { padding: 14px; }
  .bs-table { font-size: 11px; }
  .bs-company { font-size: 15px; }
  .bs-signs { flex-direction: column; }
}

/* ---------- 客户表单：历史收货人 / 自定义字段 ---------- */
.cust-auto-status { margin-right: auto; align-self: center; font-size: 11.5px; color: var(--muted); }
.cust-auto-status.ok { color: #2f9e63; }
.cust-auto-status.err { color: var(--red); }
.cust-auto-status.warn { color: #e08619; }
.cust-sub-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
/* 客户信息记录：默认仅展示最新 3 条，更多由按钮展开（hidden 需覆盖 .exp-flow-item 的 display:flex） */
.cust-log-extra[hidden] { display: none; }
.cust-log-more { margin-left: auto; }
.cust-sub-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cust-sub-head b { font-size: 14px; color: var(--text); }
.cust-sub-head span { font-size: 11.5px; color: var(--muted); }
.cust-sub-label, .cust-subrow {
  display: grid; align-items: center; gap: 8px; margin-bottom: 8px;
}
.cust-cons-head, #consigneeRows .cust-subrow { grid-template-columns: 26px 1fr 1fr 1.1fr 0.9fr 1.5fr 30px; }
.cust-extra-head, #extraRows .cust-subrow { grid-template-columns: 26px 1fr 1.6fr 30px; }
.cust-sub-label { font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.cust-subrow .input { width: 100%; padding: 7px 9px; }
.cust-subrow-idx { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; }
.cust-row-del { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 6px; }
.cust-row-del:hover { color: #c0392b; background: #fdecea; }
.cust-ro-cell { display: block; min-height: 20px; padding: 5px 2px; font-size: 12.5px; color: var(--text); word-break: break-word; }
.cust-sub-empty { font-size: 12px; color: var(--muted); padding: 8px 2px; }
@media (max-width: 780px) {
  .cust-cons-head, #consigneeRows .cust-subrow { grid-template-columns: 22px 1fr 1fr 26px; }
  .cust-cons-head span:nth-child(4), #consigneeRows .cust-subrow > :nth-child(4),
  .cust-cons-head span:nth-child(5), #consigneeRows .cust-subrow > :nth-child(5),
  .cust-cons-head span:nth-child(6), #consigneeRows .cust-subrow > :nth-child(6) { display: none; }
  .cust-extra-head, #extraRows .cust-subrow { grid-template-columns: 22px 1fr 1fr 26px; }
}

/* ---------- 客户表单：自定义字段（备注上方，客户名称式） ---------- */
.cust-extra-fields { display: grid; grid-template-columns: 1fr; gap: 14px; grid-column: 1 / -1; }
.cust-extra-field { position: relative; }
.cust-extra-field .cust-extra-name { max-width: 340px; font-weight: 600; color: var(--text); border-color: transparent; background: transparent; padding-left: 0; padding-right: 10px; }
.cust-extra-field .cust-extra-name:hover, .cust-extra-field .cust-extra-name:focus { border-color: var(--border); background: #fff; padding-left: 9px; }
.cust-extra-field .cust-extra-del { position: absolute; top: 0; left: 348px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.cust-extra-field .cust-extra-del:hover { color: #c0392b; }
.cust-add-extra { justify-self: start; grid-column: 1 / -1; margin-top: -4px; }
@media (max-width: 780px) {
  .cust-extra-fields { grid-template-columns: 1fr; }
}

/* ---------- 客户档案表格视图（详情/打印/PDF 共用） ---------- */
.cust-sheet { background:#fff; padding:4px; }
.cs-head { position:relative; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:4px 10px; text-align:center; padding:2px 0 10px; border-bottom:2px solid var(--border); margin-bottom:12px; }
.cs-logo { height:28px; max-width:100px; object-fit:contain; margin:0; }
.cs-company { font-size:15px; font-weight:700; letter-spacing:2px; color:var(--text); }
.cs-title { flex-basis:100%; font-size:14px; margin:2px 0 0; letter-spacing:5px; color:var(--text); font-weight:600; }
.cs-stamp { position:absolute; right:4px; top:2px; transform:rotate(-12deg); border:2px solid var(--red); color:var(--red); background:rgba(255,255,255,.85); border-radius:6px; padding:3px 9px; font-size:15px; font-weight:900; letter-spacing:2px; white-space:nowrap; }
.cs-disabled-reason { color:var(--red) !important; font-weight:600 !important; }
.cs-table { width:100%; border-collapse:collapse; font-size:12.5px; color:var(--text); margin-bottom:14px; table-layout:fixed; }
.cs-table td, .cs-table th { border:1px solid var(--border); padding:8px 10px; vertical-align:middle; word-break:break-word; }
.cs-l { background:var(--primary-soft, #f2f6fb); font-weight:600; width:16%; }
.cs-l .cs-zh { display:block; line-height:1.35; }
.cs-l .cs-en { display:block; font-size:10px; font-weight:500; color:var(--muted); line-height:1.3; white-space:nowrap; }
.cs-c { text-align:center; width:5%; color:var(--muted); }
.cs-empty { text-align:center; color:var(--muted); }
.cs-section { background:var(--primary-soft, #f2f6fb); font-weight:600; text-align:left; }
.cs-cons-head th { background:var(--bg-2, #fafbfc); text-align:center; font-weight:600; }
@media (max-width: 780px) {
  .cs-l { width:22%; }
  .cs-table { font-size:11.5px; }
}

/* ============ 业务单 v3 · 三大业务类（FCL/LCL/AIR） ============ */
/* 列表业务类型标签 */
.biz-type-tag { display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:600; padding:2px 8px; border-radius:20px; margin-left:6px; white-space:nowrap; }
.biz-type-tag.biz-FCL { background:var(--primary-soft, #eef5ff); color:var(--primary, #0071e3); }
.biz-type-tag.biz-LCL { background:var(--green-soft, #e9f7ef); color:var(--green, #34a853); }
.biz-type-tag.biz-AIR { background:var(--orange-soft, #fff6e9); color:var(--orange, #e8820c); }
/* 表单容器 */
.bz-form { display:flex; flex-direction:column; gap:14px; }
.bz-section { border:1px solid var(--border); border-radius:12px; padding:14px 16px; background:var(--surface); }
.bz-sec-title { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:700; color:var(--text); margin-bottom:12px; }
.bz-sec-title em { color:var(--red, #d93025); font-style:normal; }
.bz-sec-no { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:var(--primary, #0071e3); color:#fff; font-size:12px; flex-shrink:0; }
.bz-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.bz-grid .field.full { grid-column:1/-1; }
.bz-grid .field-label { display:block; font-size:12px; color:var(--text-2, #47474c); font-weight:600; margin-bottom:5px; }
/* 业务类型选择卡片 */
.biz-type-select { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.biz-type-card { position:relative; display:flex; flex-direction:column; align-items:center; gap:3px; padding:14px 10px 12px; border:1.5px solid var(--border); border-radius:12px; background:var(--surface); cursor:pointer; transition:all .18s; color:var(--text); }
.biz-type-card:hover { border-color:var(--primary, #0071e3); background:var(--primary-soft, #eef5ff); }
.biz-type-card.active { border-color:var(--primary, #0071e3); background:var(--primary-soft, #eef5ff); box-shadow:0 0 0 2px rgba(var(--primary-rgb, 0,113,227), .12); }
.btc-icon { font-size:26px; line-height:1; }
.btc-name { font-size:14px; font-weight:700; }
.btc-code { position:absolute; top:8px; right:10px; font-size:10px; font-weight:700; color:var(--muted, #74747c); letter-spacing:.5px; }
.biz-type-card.active .btc-code { color:var(--primary, #0071e3); }
.biz-type-card small { font-size:11px; color:var(--muted, #74747c); }
.bz-readonly-type { font-size:14px; }
/* 单号行 */
.bz-no-line { display:flex; align-items:center; gap:12px; padding:10px 16px; border-radius:10px; background:var(--primary-soft, #eef5ff); color:var(--text-2, #47474c); font-size:13px; }
.bz-no-line b { color:var(--primary, #0071e3); font-size:14px; font-family:ui-monospace, Menlo, Consolas, monospace; }
/* 客户联动 */
.bz-cust-link { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:12px; padding-bottom:12px; border-bottom:1px dashed var(--border); }
.bz-cust-link label { font-size:12px; font-weight:600; color:var(--text-2, #47474c); }
.bz-cust-link .input { width:260px; max-width:100%; }
.bz-cust-link .field-hint { flex-basis:100%; font-size:11px; color:var(--muted, #74747c); }
/* 客户检索下拉（仅本人来源客户） */
.bz-cust-combo { position:relative; width:280px; max-width:100%; }
.bz-cust-combo.in-grid { width:100%; }
.bz-cust-combo .input { width:100%; }
.bz-cust-menu { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:60; max-height:260px; overflow-y:auto; background:var(--surface, #fff); border:1px solid var(--border, #d2d2d7); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.12); padding:4px; }
.bz-cust-menu[hidden] { display:none; }
.bz-cust-opt { display:flex; flex-direction:column; gap:2px; width:100%; text-align:left; padding:8px 10px; border:0; border-radius:7px; background:transparent; cursor:pointer; }
.bz-cust-opt:hover, .bz-cust-opt:focus { background:var(--primary-soft, #eef5ff); outline:none; }
.bz-cust-name { font-size:13px; font-weight:600; color:var(--text, #1d1d1f); }
.bz-cust-meta { font-size:11px; color:var(--muted, #74747c); }
/* 入仓单下拉（业务单 LCL/AIR，点击展开，只读） */
.bz-wh-combo { position:relative; width:100%; }
.bz-wh-combo .input { width:100%; padding-right:32px; cursor:pointer; }
.bz-wh-combo::after { content:'▾'; position:absolute; right:12px; top:50%; transform:translateY(-50%); pointer-events:none; color:var(--muted, #74747c); font-size:12px; }
.bz-wh-menu { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:60; max-height:260px; overflow-y:auto; background:var(--surface, #fff); border:1px solid var(--border, #d2d2d7); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.12); padding:4px; }
.bz-wh-menu[hidden] { display:none; }
.bz-wh-menu .bz-cust-opt.active { background:var(--primary-soft, #eef5ff); }
.bz-wh-empty { padding:12px 10px; text-align:center; font-size:12px; color:var(--muted, #74747c); }
/* 业务详情分块 */
.bz-detail-block { margin-top:12px; padding:12px; border-radius:10px; background:var(--surface-2, #f5f5f7); }
.bz-sub-title { font-size:12px; font-weight:700; color:var(--text-2, #47474c); margin-bottom:10px; }
.bz-containers { display:flex; flex-direction:column; gap:8px; }
.bz-ct-row { display:flex; align-items:center; gap:8px; font-size:13px; }
.bz-ct-chk { width:16px; height:16px; accent-color:var(--primary, #0071e3); cursor:pointer; }
.bz-ct-name { width:64px; font-weight:600; }
.bz-ct-qty { width:90px; }
.bz-ct-other { width:130px; }
.bz-ct-unit { color:var(--muted, #74747c); }
/* 自定义字段 */
.bz-extra-add { margin-left:auto; font-size:12px; padding:3px 10px; border:1px solid var(--primary, #0071e3); color:var(--primary, #0071e3); background:transparent; border-radius:6px; cursor:pointer; font-weight:600; }
.bz-extra-add:disabled { opacity:.4; cursor:not-allowed; }
.bz-extra-row { display:grid; grid-template-columns:1fr 1.6fr 30px; gap:8px; margin-bottom:8px; align-items:center; }
.bz-extra-del { width:28px; height:28px; border:none; border-radius:6px; background:var(--red-soft, #fceceb); color:var(--red, #d93025); cursor:pointer; font-size:13px; }
.bz-extra-del:hover { background:var(--red, #d93025); color:#fff; }
.bz-save-hint { font-size:12px; color:var(--muted, #74747c); padding:8px 12px; border-left:3px solid var(--primary, #0071e3); background:var(--surface-2, #f5f5f7); border-radius:0 8px 8px 0; }
/* 只读详情 */
.bz-detail-wrap { padding-bottom:8px; }
.bz-detail { display:flex; flex-direction:column; gap:14px; }
.bz-detail-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding-bottom:12px; border-bottom:2px solid var(--border); }
.bz-dh-main { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bz-dh-no { font-size:13px; font-weight:700; color:var(--red, #d93025); font-family:ui-monospace, Menlo, Consolas, monospace; }
.bz-dh-main h3 { margin:0; font-size:19px; color:var(--text); }
.bz-dh-status { flex-shrink:0; }
.bz-detail-sec h4 { font-size:13px; font-weight:700; color:var(--text); margin:0 0 9px; padding-left:9px; border-left:3px solid var(--primary, #0071e3); }
.bz-detail-sec h4 small { font-weight:400; color:var(--muted, #74747c); margin-left:6px; }
.bz-di-grid { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.bz-di { display:flex; border-bottom:1px solid var(--border); min-height:36px; }
.bz-di:last-child, .bz-di:nth-last-child(2):not(.full) { border-bottom:none; }
.bz-di.full { grid-column:1/-1; }
.bz-di span { width:34%; flex-shrink:0; background:var(--surface-2, #f5f5f7); padding:8px 11px; font-size:12px; color:var(--text-2, #47474c); font-weight:600; border-right:1px solid var(--border); }
.bz-di b { padding:8px 11px; font-size:13px; font-weight:500; color:var(--text); white-space:pre-wrap; word-break:break-word; }
@media (max-width: 720px) {
  .biz-type-select { grid-template-columns:1fr; }
  .bz-grid, .bz-di-grid { grid-template-columns:1fr; }
  .bz-extra-row { grid-template-columns:1fr 1fr 26px; }
}
.bz-remark { padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2, #f5f5f7); font-size:13px; color:var(--text); white-space:pre-wrap; line-height:1.6; }

/* ============ 业务订单列表 & 详情 美化 ============ */
/* 详情顶部公司抬头：紧凑，不占面积 */
.bz-brand { display:flex; align-items:center; gap:8px; padding:0 2px 10px; margin-bottom:2px; border-bottom:1px solid var(--border); }
.bz-brand img { width:26px; height:26px; object-fit:contain; flex-shrink:0; }
.bz-brand-name { font-size:15px; font-weight:800; color:var(--text); letter-spacing:1px; }
.bz-brand-en { font-size:10px; font-weight:600; color:var(--muted); letter-spacing:.6px; padding-left:8px; border-left:1px solid var(--border); }

/* 列表行：卡片式留白 + 层次 */
#orderList.expense-list { padding:8px; display:flex; flex-direction:column; gap:8px; }
#orderList .exp-row { position:relative; align-items:flex-start; gap:14px; padding:14px 16px; border:1px solid var(--border); border-radius:12px; background:var(--surface); box-shadow:var(--shadow); transition:transform .14s, box-shadow .14s, border-color .14s; }
#orderList .exp-row:last-child { border-bottom:1px solid var(--border); }
#orderList .exp-row:hover { background:var(--surface); border-color:var(--primary); transform:translateY(-1px); box-shadow:0 6px 18px rgba(0,0,0,.07); }
/* 左侧业务图标：状态色点 */
#orderList .exp-icon { position:relative; width:48px; height:48px; border-radius:13px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.03); }
#orderList .exp-icon span { font-size:9px; }
#orderList .exp-main { padding-top:1px; }
#orderList .exp-title { gap:7px; }
#orderList .exp-title b { font-size:14px; letter-spacing:.2px; }
#orderList .exp-reason { font-size:12.5px; color:var(--text-2); }
#orderList .exp-meta { gap:8px; font-size:11px; }
#orderList .exp-meta span { display:inline-flex; align-items:center; }
#orderList .exp-actions { align-self:center; gap:6px; max-width:290px; }
#orderList .exp-actions .btn { border-radius:8px; }
/* 状态徽标增强 */
#orderList .tone-tag { padding:3px 10px; border-radius:20px; font-weight:700; }

/* 详情弹窗美化：卡片网格 + 简洁抬头 */
/* 弹窗顶部品牌抬头（位于「业务单详情」标题之上） */
.modal-header .modal-brand { display:flex; align-items:center; gap:8px; margin-bottom:10px; padding-bottom:2px; border-bottom:none; }
.modal-header .modal-brand img { width:26px; height:26px; object-fit:contain; }
.modal-header .modal-brand-name { font-size:14px; font-weight:800; color:var(--text); letter-spacing:.8px; }
.modal-header .modal-brand-en { font-size:9.5px; font-weight:600; color:var(--muted); letter-spacing:.5px; padding-left:8px; border-left:1px solid var(--border); }
.bz-detail-wrap { padding:0; }
.bz-detail-wrap .bz-detail { gap:14px; }
/* 主标题区：无背景无边框，干净排版 */
.bz-detail-wrap .bz-detail-head { position:relative; border:none; border-radius:0; background:transparent; padding:2px 0 0; box-shadow:none; }
.bz-detail-wrap .bz-detail-head::before { display:none; }
.bz-detail-wrap .bz-dh-main { flex-direction:row; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.bz-detail-wrap .bz-dh-no { font-size:12px; letter-spacing:.3px; }
.bz-detail-wrap .bz-dh-main h3 { font-size:21px; font-weight:750; line-height:1.25; }
.bz-detail-wrap .bz-dh-tags { margin-left:auto; }
.bz-detail-wrap .bz-dh-tags .biz-type-tag { margin-left:0; }
.bz-detail-wrap .bz-dh-status { position:static; margin-left:4px; }
/* 分区卡片 */
.bz-detail-wrap .bz-detail-sec { border:1px solid var(--border); border-radius:12px; padding:13px 15px 15px; background:var(--surface); box-shadow:var(--shadow); }
.bz-detail-wrap .bz-detail-sec h4 { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; margin:0 0 12px; padding:0 0 9px; border-left:none; border-bottom:1px solid var(--border); }
.bz-detail-wrap .bz-sec-ico { font-style:normal; display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:7px; background:var(--primary-soft); font-size:13px; flex-shrink:0; }
.bz-detail-wrap .bz-detail-sec h4 small { font-weight:500; color:var(--muted); margin-left:auto; }
/* 字段卡片网格 */
.bz-detail-wrap .bz-di-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; border:none; border-radius:0; overflow:visible; background:transparent; }
.bz-detail-wrap .bz-di { display:flex; flex-direction:column; gap:4px; min-height:auto; border:1px solid var(--border); border-radius:9px; padding:9px 12px; background:var(--surface-2); transition:border-color .14s; }
.bz-detail-wrap .bz-di:hover { border-color:var(--primary); }
.bz-detail-wrap .bz-di.full { grid-column:1/-1; }
.bz-detail-wrap .bz-di-k { width:auto; border:none; background:none; padding:0; font-size:11px; font-weight:600; color:var(--muted); letter-spacing:.2px; }
.bz-detail-wrap .bz-di-v { padding:0; border:none; font-size:13.5px; font-weight:600; color:var(--text); line-height:1.45; word-break:break-word; }
.bz-detail-wrap .bz-di.is-empty .bz-di-v { color:#b5b5bd; font-weight:400; }
/* 备注卡 */
.bz-detail-wrap .bz-remark { border:none; background:var(--surface-2); }
@media (max-width: 1000px) {
  #orderList .exp-actions { max-width:150px; }
}
@media (max-width: 620px) {
  .bz-detail-wrap .bz-di-grid { grid-template-columns:1fr; }
}
/* 业务订单统计：5 张卡片一行 */
#orderStatsGrid { grid-template-columns:repeat(5, minmax(0, 1fr)); gap:12px; }
#orderStatsGrid .stat-card { padding:16px 18px; gap:12px; }
@media (max-width: 1200px) { #orderStatsGrid { grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { #orderStatsGrid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

/* ============ 客户管理：卡片网格（区别于业务订单的列表行） ============ */
.customer-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:14px; padding:4px; }
.cust-card { position:relative; display:flex; flex-direction:column; gap:12px; border:1px solid var(--border); border-radius:14px; background:var(--surface); padding:16px; box-shadow:var(--shadow); transition:transform .16s, box-shadow .16s, border-color .16s; }
.cust-card:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(0,0,0,.08); border-color:var(--primary); }
.cust-card.is-disabled { border-color:rgba(220,38,38,.45); background:linear-gradient(180deg, rgba(220,38,38,.035), transparent 40%), var(--surface); }
.cust-card.is-disabled .cc-head { padding-right:56px; }
.cc-stamp { position:absolute; top:14px; right:12px; transform:rotate(-13deg); border:2px solid var(--red); color:var(--red); background:rgba(255,255,255,.86); border-radius:6px; padding:3px 8px; font-size:16px; font-weight:900; letter-spacing:2px; line-height:1.2; pointer-events:none; z-index:2; box-shadow:0 0 0 2px rgba(255,255,255,.6) inset; }
.cc-disabled-reason b { color:var(--red); white-space:normal; line-height:1.45; }
.cc-top { display:flex; align-items:center; gap:12px; }
.cc-avatar { width:44px; height:44px; border-radius:12px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:19px; font-weight:800; }
.cc-avatar.tone-green { background:var(--green-soft); color:var(--green); }
.cc-avatar.tone-orange { background:var(--orange-soft); color:var(--orange); }
.cc-avatar.tone-purple { background:#f2ecff; color:#7c4dff; }
.cc-avatar.tone-gray { background:var(--surface-2); color:var(--muted); }
.cc-head { min-width:0; flex:1; }
.cc-name { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.cc-name b { font-size:14.5px; color:var(--text); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cc-name .tone-tag { font-size:10px; padding:1px 7px; }
.cc-cat { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cc-cat-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.cc-cat-dot.tone-green { background:var(--green); }
.cc-cat-dot.tone-orange { background:var(--orange); }
.cc-cat-dot.tone-purple { background:#7c4dff; }
.cc-cat-dot.tone-gray { background:var(--muted); }
.cc-info { display:grid; grid-template-columns:1fr 1fr; gap:7px 10px; padding:11px 12px; border-radius:9px; background:var(--surface-2); }
.cc-line { display:flex; flex-direction:column; gap:2px; min-width:0; }
.cc-line.full { grid-column:1/-1; }
.cc-line span { font-size:10.5px; color:var(--muted); font-weight:600; }
.cc-line b { font-size:12.5px; color:var(--text); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cc-actions { display:flex; gap:6px; flex-wrap:wrap; }
.cc-actions .btn { border-radius:8px; flex:1; min-width:56px; }
@media (max-width: 520px) {
  .customer-grid { grid-template-columns:1fr; }
}

/* ============ 入仓记录：收费明细面板（仓库方开具的单一账） ============ */
.wh-fee-panel { margin-top:16px; border:1px solid #d9e6e6; border-radius:10px; padding:14px 16px 16px; background:#fbfdfd; }
.wh-fee-loading { color:#8a8a92; font-size:12px; padding:16px; text-align:center; }
.wh-fee-hd { display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid #e6eeee; padding-bottom:10px; margin-bottom:12px; }
.wh-fee-title { font-size:13px; font-weight:700; letter-spacing:2px; color:#1d1d1f; }
.wh-fee-title span { font-size:11px; font-weight:400; letter-spacing:0; color:#8a8a92; margin-left:8px; }
.wh-fee-stats { display:grid; grid-template-columns:1fr; gap:10px; margin-bottom:12px; }
.wh-fee-stat { border-radius:8px; padding:10px 14px; display:flex; flex-direction:column; gap:2px; }
.wh-fee-stat span { font-size:11px; color:#6e6e76; }
.wh-fee-stat strong { font-size:19px; font-weight:700; }
.wh-fee-stat small { font-size:11px; color:#8a8a92; }
.wh-fee-stat.s-recv { background:#e9f7f2; border:1px solid #bfe6d8; }
.wh-fee-stat.s-recv strong { color:#12805c; }
.wh-fee-stat.s-pay { background:#eef4fb; border:1px solid #cfe0f3; }
.wh-fee-stat.s-pay strong { color:#0e6ba8; }
.wh-fee-empty { color:#9a9aa2; font-size:12px; padding:18px 8px; text-align:center; }
.wh-fee-list { display:flex; flex-direction:column; gap:8px; }
.wh-fee-row { display:flex; align-items:center; gap:10px; border:1px solid #e6eeee; border-radius:8px; padding:9px 10px; background:#fff; }
.wh-fee-type { flex:0 0 44px; text-align:center; font-size:11px; font-weight:700; padding:4px 0; border-radius:5px; }
.wh-fee-type.recv { color:#12805c; background:#e9f7f2; }
.wh-fee-type.pay { color:#0e6ba8; background:#eef4fb; }
.wh-fee-main { flex:1; min-width:0; }
.wh-fee-name { display:flex; align-items:center; gap:8px; font-size:13px; }
.wh-fee-name b { font-weight:600; color:#1d1d1f; }
.wh-fee-meta { font-size:11px; color:#8a8a92; margin-top:3px; word-break:break-word; }
.wh-fee-amt { flex:0 0 92px; text-align:right; font-size:14px; font-weight:700; color:#1d1d1f; }
.wh-fee-ops { flex:0 0 auto; display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-end; }
.wh-fee-suggest { display:flex; gap:6px; flex-wrap:wrap; }
.wh-fee-chip { border:1px solid #cfe0f3; background:#eef4fb; color:#0e6ba8; font-size:12px; padding:4px 10px; border-radius:14px; cursor:pointer; }
.wh-fee-chip:hover { background:#dceaf8; }
@media (max-width: 640px) {
  .wh-fee-stats { grid-template-columns:1fr; }
  .wh-fee-row { flex-wrap:wrap; }
  .wh-fee-amt { flex:1; }
}

/* ============ 夜间黑：覆盖历史遗留的硬编码浅色 ============ */
[data-theme="dark"] .topbar { background: rgba(28,30,36,.86); }
[data-theme="dark"] .nav-item small, [data-theme="dark"] .ng-soon { background: var(--surface-2); color: var(--muted); }
[data-theme="dark"] .tree-node.active .tree-count, [data-theme="dark"] .file-cat.active .fc-count, [data-theme="dark"] .dept-check:hover { background: var(--surface); }
[data-theme="dark"] .tree-actions button:hover { background: var(--hover-bg); }
[data-theme="dark"] .tree-drag { color: var(--muted); }
[data-theme="dark"] .data-table td, [data-theme="dark"] .file-row, [data-theme="dark"] .exp-row { border-bottom-color: var(--border); }
[data-theme="dark"] .data-table tbody tr:hover, [data-theme="dark"] .file-row:hover, [data-theme="dark"] .exp-row:hover { background: var(--hover-bg); }
[data-theme="dark"] .page-btns button:disabled { color: var(--muted); border-color: var(--border); background: var(--surface-2); }
[data-theme="dark"] .input::placeholder, [data-theme="dark"] .memo-f-textarea::placeholder { color: var(--muted); }
[data-theme="dark"] .punch-ic, [data-theme="dark"] .ip-info-ic { background: var(--primary-soft); }
[data-theme="dark"] .tooltip-tip, [data-theme="dark"] .sidebar.collapsed .nav-item[data-tip]:hover::after { background: #000; }
/* 彩色软标签：压暗底色并提亮文字，保证暗背景下可读 */
[data-theme="dark"] .stat-teal .stat-icon, [data-theme="dark"] .stat-teal::after { background: var(--green-soft); }
[data-theme="dark"] .ic-teal, [data-theme="dark"] .tone-teal, [data-theme="dark"] .source-tag.src-punch,
[data-theme="dark"] .vis-all, [data-theme="dark"] .fr-icon.tone-teal, [data-theme="dark"] .wh-fee-stat.s-recv,
[data-theme="dark"] .wh-fee-type.recv { background: var(--green-soft); color: var(--teal); border-color: transparent; }
[data-theme="dark"] .tone-purple, [data-theme="dark"] .att-badge.tone-purple,
[data-theme="dark"] .fr-icon.tone-purple, [data-theme="dark"] .exp-icon.purple { background: rgba(139,92,246,.2); color: #c4a6ff; }
[data-theme="dark"] .tone-pink { background: rgba(232,80,140,.18); color: #f39abf; }
[data-theme="dark"] .tone-indigo { background: rgba(99,102,241,.2); color: #a9adff; }
[data-theme="dark"] .fr-icon.tone-red { background: var(--red-soft); color: var(--red); }
[data-theme="dark"] .fr-icon.tone-blue, [data-theme="dark"] .wh-fee-stat.s-pay,
[data-theme="dark"] .wh-fee-type.pay, [data-theme="dark"] .wh-fee-chip { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
[data-theme="dark"] .fr-icon.tone-blue:hover, [data-theme="dark"] .wh-fee-chip:hover { background: var(--active-soft); }
[data-theme="dark"] .task-chip.due, [data-theme="dark"] .role-badge.role-employee { border-color: var(--orange-soft); }
[data-theme="dark"] .role-badge.role-admin { background: rgba(167,110,246,.2); color: #c4a6ff; border-color: transparent; }
[data-theme="dark"] .role-badge.role-hr { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
[data-theme="dark"] .role-badge.role-manager { background: var(--green-soft); color: var(--teal); border-color: transparent; }
[data-theme="dark"] .role-badge.role-employee { background: var(--orange-soft); color: var(--orange); }
[data-theme="dark"] .legend-manager .legend-dot { background: var(--teal); }
[data-theme="dark"] .legend-employee .legend-dot { background: var(--orange); }
[data-theme="dark"] .wh-fee-row { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .wh-fee-name b, [data-theme="dark"] .wh-fee-amt { color: var(--text); }
[data-theme="dark"] .wh-fee-stat.s-recv strong { color: var(--teal); }
[data-theme="dark"] .wh-fee-stat.s-pay strong { color: var(--primary); }
[data-theme="dark"] .stat-icon { filter: saturate(.95); }
/* 欢迎卡在夜间模式下保持深色渐变 + 白按钮，仅微调阴影 */
[data-theme="dark"] .wp-btn:disabled { color: var(--green); background: rgba(255,255,255,.92); }

/* ============ 操作项模板（业务中心） ============ */
#optplStats .stat-card { padding: 15px 18px; gap: 14px; min-width: 0; }
#optplStats .stat-card::after { width: 66px; height: 66px; right: -18px; top: -18px; }
.optpl-layout { display: grid; grid-template-columns: 208px 1fr; gap: 16px; align-items: start; }
.optpl-cats { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 10px; position: sticky; top: 12px; }
.optpl-cats-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .5px; }
.optpl-cats-list { display: flex; flex-direction: column; gap: 3px; max-height: 62vh; overflow-y: auto; }
.optpl-cat-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 11px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--text-2); font-size: 13px; text-align: left; transition: .15s; }
.optpl-cat-item:hover { background: var(--hover-bg); }
.optpl-cat-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.optpl-cat-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.optpl-cat-item em { font-style: normal; font-size: 11px; min-width: 22px; height: 20px; line-height: 20px; text-align: center; border-radius: 10px; background: var(--surface-2); color: var(--muted); padding: 0 6px; }
.optpl-cat-item.active em { background: var(--primary); color: #fff; }
.optpl-main { min-width: 0; }
.optpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; padding: 16px; }
.optpl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: .15s; border-top: 3px solid var(--teal); }
.optpl-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.optpl-card.is-paused { border-top-color: var(--muted); opacity: .72; }
.optpl-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.optpl-card-title { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; line-height: 1.4; }
.optpl-card-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.optpl-card-status.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.optpl-card-status.off { background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }
.optpl-cat-tag { font-size: 10.5px; padding: 3px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; flex-shrink: 0; }
/* 内置模板标识：不可删除/停用，仅可修改 */
.optpl-card.is-builtin { border-top-color: var(--primary); }
.optpl-builtin-tag { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 2px 7px; border-radius: 5px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 1px 3px rgba(217,119,6,.3); flex-shrink: 0; }
.optpl-builtin-notice { font-size: 12.5px; line-height: 1.6; color: #8a5a00; background: #fff8e6; border: 1px solid #f5d98a; border-radius: 8px; padding: 9px 13px; margin-bottom: 14px; }
[data-theme="dark"] .optpl-builtin-tag { background: linear-gradient(135deg, #f59e0b, #b45309); }
[data-theme="dark"] .optpl-builtin-notice { color: #ffd88a; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
.field-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
/* PDF 导出模板：可点击插入的占位符标签（系统 / 业务单 / 公司信息标签） */
.pt-tag-hints { grid-column: 1 / -1; padding: 10px 12px; background: var(--primary-soft); border: 1px solid var(--border); border-radius: 8px; }
.pt-tag-group + .pt-tag-group { margin-top: 10px; }
.pt-tag-label { display: block; font-size: 11px; color: var(--text-2); line-height: 1.5; margin-bottom: 6px; }
.pt-tag-label code { font-size: 11px; color: var(--primary); }
.pt-tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-tag-chip { font-family: inherit; font-size: 11px; line-height: 1.6; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: transparent; color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.pt-tag-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pt-html-wrap { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pt-html-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.pt-html-head b { font-size: 14px; color: var(--text); }
.pt-html-head span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pt-tag-label code, .pt-html-head code { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 1px 4px; border-radius: 3px; }
textarea.pt-html-editor { display: block; width: 100%; min-height: 340px; border: 0; border-radius: 0; padding: 14px 16px; font: 12.5px/1.65 Consolas, "Courier New", monospace; resize: vertical; background: var(--surface); color: var(--text); tab-size: 2; }
.pt-html-editor:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary-soft); }
/* PDF 导出模板：页头位置选择（主标题上方/下方） */
.pt-header-pos { display: inline-flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--text-2); }
.pt-header-pos .input { width: 130px; }
.opt-switch-line { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; min-height: 34px; }
.opt-switch-line input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.optpl-card-desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; min-height: 38px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.optpl-card-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.optpl-type-chip { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.optpl-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 9px; }
.optpl-card-actions { display: flex; flex-wrap: wrap; gap: 5px; }
/* PDF 模板卡片：操作按钮统一放卡片底部，平分宽度、不换行 */
.pdftpl-card-actions { display: flex; gap: 6px; margin-top: 2px; padding-top: 11px; border-top: 1px dashed var(--border); }
.pdftpl-card-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 5px 4px; }
.pdftpl-card-actions .btn.danger { color: var(--red); border-color: var(--red); }
.pdftpl-card-actions .btn.danger:hover { background: var(--red-soft); }
.optpl-empty { grid-column: 1 / -1; text-align: center; padding: 54px 20px; color: var(--muted); }
.optpl-empty-icon { font-size: 46px; color: var(--border-strong); line-height: 1; margin-bottom: 8px; }
.optpl-empty p { font-size: 15px; font-weight: 700; color: var(--text-2); margin: 0 0 4px; }
.optpl-empty span { font-size: 12.5px; }
/* 分类管理 */
.optpl-cat-addrow { display: flex; gap: 8px; margin-bottom: 14px; }
.optpl-cat-addrow .input:first-child { flex: 1; }
.optpl-cat-rows { display: flex; flex-direction: column; gap: 7px; }
.optpl-cat-row { display: flex; align-items: center; gap: 7px; }
.optpl-cat-row .cname { flex: 1; }
.optpl-cat-count { font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 52px; text-align: right; }
.optpl-cat-none { text-align: center; color: var(--muted); font-size: 12.5px; padding: 22px; }
/* 字段构建器 */
.optpl-form .form-grid { margin-bottom: 18px; }
/* 模板基础信息：两行四列紧凑排列，最大限度压缩高度占比 */
.optpl-form .optpl-meta-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 10px; margin-bottom: 8px; }
.optpl-form .optpl-meta-grid .field { gap: 2px; min-width: 0; }
.optpl-form .optpl-meta-grid .field-label { font-size: 11px; font-weight: 500; line-height: 1.35; }
.optpl-form .optpl-meta-grid .input { padding: 3px 7px; font-size: 12px; min-height: 28px; border-radius: 5px; }
.optpl-form .optpl-meta-grid select.input { height: 28px; }
.optpl-form .optpl-meta-grid .meta-desc { grid-column: span 2; }
.optpl-form .optpl-meta-grid:not(.has-builtin) .meta-desc { grid-column: span 3; }
.optpl-form .optpl-meta-grid .meta-desc textarea.input { min-height: 28px; line-height: 1.3; padding-top: 4px; padding-bottom: 4px; }
.optpl-form .optpl-meta-grid .field-hint { margin: 0; font-size: 10px; line-height: 1.25; }
.optpl-form .optpl-meta-grid .opt-switch-line { min-height: 28px; font-size: 11px; gap: 5px; }
.optpl-form .optpl-meta-grid .opt-switch-line input { width: 14px; height: 14px; }
.opt-field-builder { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.opt-field-builder-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.opt-field-builder-head b { font-size: 14px; color: var(--text); }
.opt-field-builder-head span { font-size: 11.5px; color: var(--muted); margin-left: 10px; }
.opt-field-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; }
.opt-field-row { border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.opt-field-row.tone-teal { border-left-color: var(--teal); }
.opt-field-row.tone-cyan { border-left-color: #0891b2; }
.opt-field-row.tone-purple { border-left-color: #8b5cf6; }
.opt-field-row.tone-orange { border-left-color: var(--orange); }
.opt-field-row.tone-pink { border-left-color: #e8508c; }
.opt-field-row.tone-slate { border-left-color: #475569; }
.opt-field-row.tone-gray { border-left-color: var(--muted); }
.opt-field-row.is-divider .opt-field-body { background: var(--surface-2); border-radius: 7px; padding: 8px 10px; }
.opt-field-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.opt-field-head-tools { display: flex; gap: 6px; flex: none; }
.opt-field-grip { color: var(--border-strong); font-size: 14px; letter-spacing: -2px; cursor: grab; user-select: none; padding: 4px 3px; border-radius: 4px; transition: color .15s, background .15s; }
.opt-field-grip:hover { color: var(--primary); background: var(--primary-soft); }
.opt-field-grip:active { cursor: grabbing; }
.opt-field-select { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.opt-field-row.is-selected { background: var(--primary-soft); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-border, transparent); }
.opt-field-row.is-selected .opt-field-grip { color: var(--primary); }
.opt-field-row.opt-dragging { opacity: .45; border-style: dashed; box-shadow: 0 10px 26px rgba(0,0,0,.14); pointer-events: none; }
.opt-field-idx { font-size: 11px; color: var(--muted); font-weight: 700; min-width: 24px; }
.opt-field-head .f-type { width: 130px; padding: 6px 9px; }
.opt-field-head .f-width { width: 96px; padding: 6px 9px; }
.opt-f-required { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.opt-field-head .remove-field { margin-left: auto; }
.opt-field-body { display: flex; flex-direction: column; gap: 7px; }
.opt-field-body .f-label { font-weight: 500; }
.opt-field-body .f-opts-box, .opt-field-body .f-file-box { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.opt-field-body .f-opts { flex: 1; }
.opt-field-body .f-file-box .f-accept { flex: 1; }
/* 预览 */
.optpl-preview-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.optpl-preview-desc { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); }
/* 字段宽度采用 60 列网格（2/3/4/5 的最小公倍数），支持整行/1/2/1/3/1/4/1/5 精确分栏；
   列间距用字段右内边距实现，避免 59 个 gap 在窄屏撑破容器 */
.optpl-preview-form { display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); column-gap: 0; row-gap: 16px; }
.opt-prev-field.w-full { grid-column: span 60; }
.opt-prev-field.w-half { grid-column: span 30; }
.opt-prev-field.w-third { grid-column: span 20; }
.opt-prev-field.w-quarter { grid-column: span 15; }
.opt-prev-field.w-fifth { grid-column: span 12; }
.optpl-preview-form > .opt-prev-field { padding-right: 16px; }
.opc-form-fields > .opt-prev-field { padding-right: 14px; }
.opt-prev-field .field-label { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.opt-prev-options { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.opt-prev-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.opt-prev-file { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 10px; cursor: pointer; text-align: center; color: var(--primary); font-size: 13px; transition: .15s; }
.opt-prev-file:hover { border-color: var(--primary); background: var(--primary-soft); }
.opt-prev-file input { display: none; }
.opt-prev-file small { color: var(--muted); font-size: 11px; }
/* 分割线分节标题：蓝色圆角标签 + 右侧同色横线（参考图风格） */
.opt-divider { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.opt-divider-label { display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 6px 14px; border-radius: 6px; white-space: nowrap; letter-spacing: .5px; box-shadow: 0 2px 6px rgba(var(--primary-rgb),.25); }
.opt-divider-line { flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--primary) 88%, rgba(var(--primary-rgb),.25)); }
/* 夜间主题适配 */
[data-theme="dark"] .optpl-cat-item.active em { color: #fff; }
[data-theme="dark"] .opt-card, [data-theme="dark"] .optpl-card { border-top-color: var(--primary); }
[data-theme="dark"] .opt-field-row.tone-purple { border-left-color: #c4a6ff; }
[data-theme="dark"] .opt-field-row.tone-pink { border-left-color: #f39abf; }

/* 响应式：小屏分类栏移到顶部横向 */
@media (max-width: 900px) {
  .optpl-layout { grid-template-columns: 1fr; }
  .optpl-cats { position: static; }
  .optpl-cats-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .optpl-cat-item { width: auto; }
  .opt-field-head { flex-wrap: wrap; }
  .opt-prev-field.w-half, .opt-prev-field.w-third, .opt-prev-field.w-quarter, .opt-prev-field.w-fifth { grid-column: span 60; }
}

/* ==================== 操作台（业务单操作环节工作区） ==================== */
.opc-block { margin-bottom: 18px; }
.opc-blk-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-left: 10px; border-left: 4px solid var(--primary); }
.opc-blk-title small { font-size: 11px; font-weight: 400; color: var(--muted); }
.opc-blk-title.red { border-left-color: #e5484d; }
.opc-blk-title.green { border-left-color: #2f9e63; }
.opc-blk-title.yellow { border-left-color: var(--primary); }
.opc-blk-title .btn { margin-left: auto; }
/* 进度概览卡（2026-11-27）：业务进展 + 财务进度合并为一张卡、两行，行内节点最大限度压缩页面占比 */
.opc-overview { padding: 4px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.opc-overview-row { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.opc-overview-row + .opc-overview-row { border-top: 1px dashed var(--border); margin-top: 2px; padding-top: 2px; }
.opc-line-label { flex: 0 0 60px; font-size: 11.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.opc-line-label.red { color: #e5484d; }
.opc-line-label.purple { color: #8b5cf6; }
.opc-blk-title.purple { border-left-color: #8b5cf6; }
/* 业务进展：行内小节点，完成时间紧跟节点名称 */
.opc-nodes { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; padding-bottom: 0; }
.opc-node { flex: 1 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: .15s; }
.opc-node:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); }
.opc-node:disabled { cursor: default; }
.opc-node.done { border-color: #2f9e63; background: rgba(47,158,99,.1); }
.opc-node-idx { display: grid; place-items: center; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 9px; font-weight: 700; }
.opc-node.done .opc-node-idx { background: #2f9e63; color: #fff; }
.opc-node-name { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; }
.opc-node-time { font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
.opc-node:not(.done) .opc-node-time { display: none; }
.opc-node.done .opc-node-time { color: #2f9e63; }
.opc-node-arrow { align-self: center; color: var(--border-strong); font-size: 12px; }
/* 财务进度：应收/应付两行紧凑时间轴，阶段与完成时间行内显示 */
.opc-fin-lines { flex: 1; min-width: 0; }
.opc-fin-line { display: flex; align-items: center; gap: 8px; min-height: 16px; }
.opc-fin-line + .opc-fin-line { border-top: 0; margin: 0; padding: 0; }
.opc-fin-kind { flex: 0 0 76px; display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.opc-fin-kind.ar { color: #c0392b; }
.opc-fin-kind.ap { color: #2f6db3; }
.opc-fin-kind small { display: inline; font-size: 9px; font-weight: 400; color: var(--muted); }
.opc-fin-nodes { display: flex; align-items: center; justify-content: space-between; flex: 1; min-width: 0; overflow-x: auto; }
.opc-fin-node { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px 1px 3px; background: transparent; border: 1px solid transparent; border-radius: 10px; white-space: nowrap; }
.opc-fin-node.done { background: rgba(47,158,99,.08); }
.opc-fin-node.current { border-color: rgba(47,158,99,.45); background: rgba(47,158,99,.12); }
.opc-fin-idx { display: grid; place-items: center; width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 8px; font-weight: 700; line-height: 1; }
.opc-fin-node.done .opc-fin-idx { background: #2f9e63; color: #fff; }
.opc-fin-name { font-size: 10.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.opc-fin-time { font-size: 9px; color: #2f9e63; font-variant-numeric: tabular-nums; }
.opc-fin-arrow { flex: 0 1 22px; min-width: 6px; height: 1px; background: var(--border); align-self: center; }
.opc-fin-arrow.done { background: #2f9e63; }
/* 表单区：表单 */
/* 合并对账页：应收/应付两块上下排列，用分隔线区分，功能与数据仍各自独立 */
.opc-form + .opc-form { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.opc-forms { padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.opc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.opc-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px 8px 0 0; cursor: pointer; transition: .15s; }
.opc-tab:hover { border-color: var(--primary); color: var(--primary); }
.opc-tab.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.opc-badge-builtin { font-size: 9.5px; font-style: normal; padding: 1px 5px; background: #f5a623; color: #fff; border-radius: 4px; }
.second-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.opc-tab-x { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); font-size: 14px; line-height: 1; }
.opc-tab-x:hover { background: #fdecea; color: #c0392b; }
.opc-form-fields { display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); column-gap: 0; row-gap: 6px; }
/* 操作台表单整体压缩：标签与控件间距、输入框高度、分节标题均收紧；
   字段名用主题内的弱化文字色（--muted），与输入框 --text 拉开明显对比，随主题自动变色 */
.opc-form-fields .field-label { margin-bottom: 2px; font-size: 12px; color: var(--muted); }
.opc-form-fields .input { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
/* rows 属性会撑高 textarea，JS 按内容重算高度；最少两行，超长限高后可滚动 */
.opc-form-fields textarea.input { height: auto; min-height: 44px; line-height: 1.35; }
.opc-form-fields .opt-prev-options { gap: 3px 12px; }
.opc-form-fields .opt-divider { margin: 2px 0 0; }
.opc-form-fields .opt-divider-label { padding: 3px 9px; font-size: 11.5px; box-shadow: none; }
.opc-form-fields .opt-divider-line { height: 2px; }
/* 对账区标题合并：分割线行末直接放导出/同步按钮，避免三层重复标题 */
.opc-form[data-recon-area] .opc-form-fields { row-gap: 3px; }
.opc-recon-head .opt-divider { margin: 0 0 4px; }
.opc-recon-head .opt-divider-line { min-width: 12px; }
.opc-recon-head .opc-form-export-tools { flex: 0 0 auto; }
.opc-recon-tools-bar { display: flex; justify-content: flex-end; padding: 0 2px 3px; }
.opc-field { position: relative; }
.opc-field-del { border: none; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.opc-field-del:hover { color: #c0392b; }
/* 系统自动生成的只读字段（托运编号）：整格灰底 + 明确标识，避免误以为漏填 */
.opc-auto-field .field-label { flex-wrap: wrap; }
.opc-auto-tag { margin-left: 6px; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.opc-auto-input { background: var(--surface-2) !important; color: var(--text) !important; font-weight: 600; letter-spacing: .3px; cursor: not-allowed; opacity: 1; }
/* 客户信息：历史收货人联想（三字段强制整行，字段名单独一行展示） */
.opc-addr-wrap { position: relative; min-width: 0; }
.opc-addr-input { cursor: pointer; }
.opc-addr-menu { position: absolute; left: 0; right: 0; top: 100%; margin-top: 5px; z-index: 80; max-height: 420px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; }
.opc-addr-menu::-webkit-scrollbar { width: 6px; }
.opc-addr-menu::-webkit-scrollbar-track { background: transparent; }
.opc-addr-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.opc-addr-menu::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.opc-addr-menu[hidden] { display: none; }
/* 客户联想浮层挂到 body，层级需高于弹窗遮罩（.modal-overlay z-index:100） */
#opcFleetFloat { position: fixed; z-index: 300; right: auto; top: auto; margin-top: 0; }
.opc-addr-head { padding: 5px 8px 7px; font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--border); margin-bottom: 4px; }
.opc-addr-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; transition: .12s; }
.opc-addr-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.opc-addr-item b { font-size: 12.5px; color: var(--text); }
.opc-addr-item span { font-size: 11px; color: var(--muted); }
.opc-addr-empty { padding: 12px 9px; font-size: 12px; color: var(--muted); text-align: center; }
/* 资金流水表单：往来单位 / 支付单位客户档案联想浮层（挂 body，层级高于弹窗） */
.cash-cust-menu { position: fixed; z-index: 300; margin-top: 0; max-height: 300px; overflow-y: auto; scrollbar-width: thin; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 6px; }
.cash-cust-menu::-webkit-scrollbar { width: 6px; }
.cash-cust-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.opc-form-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.opc-form-hint { font-size: 11px; color: var(--muted); }
.opc-addfield { margin-top: 10px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.opc-addfield[hidden] { display: none; }
.opc-addfield-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.opc-addfield-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.opc-addfield-row .input { width: auto; flex: 1 1 140px; }
.opc-addfield-row [id^="oafType_"] { flex: 0 0 110px; }
.opc-addfield-row [id^="oafWidth_"] { flex: 0 0 100px; }
/* 模板选择二级层 */
.second-layer { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.second-mask { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.second-panel { position: relative; width: min(560px, 92vw); max-height: 80vh; overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); }
.second-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.second-head b { font-size: 15px; }
.second-head button { border: none; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.second-body { padding: 14px 18px; }
.opc-picker { display: grid; gap: 8px; }
.opc-picker-item { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; transition: .15s; }
.opc-picker-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.opc-picker-item b { font-size: 13px; color: var(--text); }
.opc-picker-item span { font-size: 11px; color: var(--muted); }
/* ===== 应收应付对账明细表（table 字段）===== */
.opc-recon { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 5px 8px 7px; }
.opc-recon-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.opc-recon-title { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.opc-recon-title small { display: none; } /* 计算说明不再占位，压缩对账区高度 */
.opc-recon-base { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.opc-recon-base b { color: var(--text); font-size: 11px; }
.opc-recon-tools { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.opc-recon-base .input { width: 82px; padding: 3px 5px; font-size: 11px; }
.opc-recon-base .opc-recon-filter { width: 116px; }
.opc-recon-scroll { overflow-x: auto; }
.opc-recon-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 980px; }
.opc-recon-table th { font-size: 10px; font-weight: 600; color: var(--muted); text-align: center; padding: 3px 2px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.opc-recon-table th:nth-child(1) { width: 13%; }
.opc-recon-table th:nth-child(2) { width: 7%; }
.opc-recon-table th:nth-child(3) { width: 6%; }
.opc-recon-table th:nth-child(4), .opc-recon-table th:nth-child(7), .opc-recon-table th:nth-child(8) { width: 9%; }
.opc-recon-table th:nth-child(5), .opc-recon-table th:nth-child(6) { width: 7%; }
.opc-recon-table th:nth-child(9) { width: 14%; }
.opc-recon-table th:nth-child(10) { width: 16%; }
.opc-recon-table th:nth-child(11) { width: 3%; }
.opc-recon-table td { padding: 1px 1px; vertical-align: middle; }
.opc-recon-table td .input { width: 100%; padding: 3px 5px; font-size: 11px; line-height: 1.25; }
.opc-recon-table .opc-recon-num { text-align: right; }
.opc-recon-table .opc-recon-cur { padding: 3px 2px; font-size: 11px; }
.opc-recon-table .opc-recon-calc { background: var(--surface); font-weight: 600; color: var(--primary); }
/* 对账明细所有字段均可人工修改；金额/小计保留蓝色计算列样式但可编辑 */
.opc-recon-table .opc-recon-settle.is-settle-positive { color: var(--green, #34a853) !important; font-weight: 700; }
.opc-recon-table .opc-recon-settle.is-settle-negative { color: var(--red, #d93025) !important; font-weight: 700; }
.opc-recon-act { text-align: center; }
.opc-recon-del { border: none; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 3px; }
.opc-recon-del:hover { color: #c0392b; }
.opc-recon-add { margin-top: 4px; border: 1px dashed var(--primary); background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 3px 9px; font-size: 11px; cursor: pointer; transition: .12s; }
.opc-recon-add:hover { background: var(--primary); color: #fff; }
.opc-recon-sum { display: flex; align-items: flex-start; justify-content: flex-end; gap: 18px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); }
.opc-recon-sum-item { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.opc-recon-sum-item em { font-style: normal; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.opc-recon-sum-item b { font-size: 13px; line-height: 1.4; color: #c0392b; font-weight: 700; }
.opc-recon-sum-note { align-self: flex-end; font-size: 10px; color: var(--muted); white-space: nowrap; }
/* 对账区核销记录：紧凑只读，点击流水号在二级弹层查看详情 */
.opc-recon-alloc { margin-top: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 3px 6px 4px; }
.opc-recon-alloc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text-2); }
.opc-recon-alloc-head span { font-weight: 600; }
.opc-recon-alloc-head small { color: var(--muted); font-size: 12px; font-weight: 600; }
.opc-recon-alloc-list { margin-top: 2px; }
.opc-recon-alloc-row { display: grid; grid-template-columns: 98px 68px minmax(90px, 1fr) 62px 82px; gap: 6px; align-items: center; padding: 2px 0; border-top: 1px dashed var(--border); font-size: 10.5px; white-space: nowrap; }
.opc-recon-alloc-no { border: none; background: transparent; color: var(--primary); padding: 0; font-size: 10.5px; text-align: left; cursor: pointer; }
.opc-recon-alloc-time, .opc-recon-alloc-op { color: var(--muted); }
.opc-recon-alloc-party { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.opc-recon-alloc-row b { text-align: right; color: var(--text-2); font-weight: 700; }
.opc-recon-alloc-empty { padding: 3px 0 1px; color: var(--muted); font-size: 10.5px; }
/* SI补料单多柜明细列宽 */
.opc-ct-table { min-width: 520px; }
.opc-ct-table th:nth-child(1) { width: 40%; }
.opc-ct-table th:nth-child(2) { width: 12%; }
.opc-ct-table th:nth-child(3), .opc-ct-table th:nth-child(4) { width: 20%; }
.opc-ct-table th:nth-child(5) { width: 8%; }
/* 模板编辑态静态示意 */
.opt-recon-demo { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.opt-recon-demo-bar { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 11px; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.opt-recon-demo-bar span { color: var(--muted); }
.opt-recon-demo-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.opt-recon-demo-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; padding: 5px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.opt-recon-demo-table td { padding: 6px 4px; text-align: center; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.opt-recon-demo-foot { padding: 6px 10px; font-size: 10.5px; color: var(--primary); background: var(--surface-2); }
.opt-recon-demo-foot b { color: #c0392b; }
@media (max-width: 900px) {
  .opc-fi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opc-form-fields .opt-prev-field.w-half, .opc-form-fields .opt-prev-field.w-third, .opc-form-fields .opt-prev-field.w-quarter, .opc-form-fields .opt-prev-field.w-fifth { grid-column: span 60; }
}

/* 操作台-基本资料（2026-11-27）：无区块标题，工作号行 + 委托信息行，全部只读展示 */
.opc-basic { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.opc-identity { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 7px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.opc-identity + .opc-identity { margin-top: 6px; }
.opc-id { display: flex; align-items: center; gap: 8px; }
.opc-id-k { font-size: 11px; color: var(--muted); white-space: nowrap; }
.opc-id-v { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.opc-id-note { margin-left: auto; font-size: 10.5px; color: var(--muted); }
@media (max-width: 980px) {
  .opc-identity { gap: 12px; }
}

/* 操作台操作历史（默认最近3条小字，更多展开） */
.opc-history { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.opc-hist-list { display: flex; flex-direction: column; gap: 4px; }
.opc-hist-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.opc-hist-time { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); }
.opc-hist-name { flex: none; font-weight: 600; color: var(--text); }
.opc-hist-act { flex: none; color: var(--primary); }
.opc-hist-detail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opc-hist-empty { font-size: 11px; color: var(--muted); }
.opc-hist-more { margin-top: 8px; padding: 2px 10px; font-size: 11px; color: var(--primary); background: transparent; border: 1px solid var(--border); border-radius: 5px; cursor: pointer; }
.opc-hist-more:hover { border-color: var(--primary); background: var(--primary-soft); }

/* 操作台自动保存状态（位于 footer 左侧） */
.opc-save-state { margin-right: auto; align-self: center; font-size: 12px; color: var(--muted); white-space: nowrap; transition: color .2s; }
.opc-save-state.saved { color: #2f9e63; font-weight: 600; }
.opc-save-state.saving { color: var(--primary); }
.opc-save-state.error { color: #e5484d; font-weight: 600; }

/* ===== 字段库：先设计字段再组成模板（2026-11-23） ===== */
.optpl-tabs { display:flex; gap:4px; margin: 0 0 14px; border-bottom: 1px solid var(--border); }
.optpl-tab { border:0; background:transparent; padding:10px 18px; font-size:14px; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.optpl-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.optpl-tab:hover { color:var(--text); }
.field-card { border-top-color:#0891b2; }
.field-card code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px; color:var(--primary); background:var(--surface-2); padding:1px 6px; border-radius:4px; }
.opt-field-row.is-library { background:var(--surface-2); }
.opt-field-row.is-library .opt-field-body input,
.opt-field-row.is-library .opt-field-body select,
.opt-field-row.is-library .opt-field-head select:not(.f-width) { opacity:.72; cursor:not-allowed; }
/* 宽度是引用级布局属性：库字段仍可在模板中调整，并给出可编辑的视觉提示 */
.opt-field-row.is-library .opt-field-head select.f-width { opacity:1; cursor:pointer; border-color:rgba(8,145,178,.45); background:rgba(8,145,178,.06); }
.opt-lib-tag { font-size:10.5px; font-weight:700; color:#0891b2; background:rgba(8,145,178,.12); border:1px solid rgba(8,145,178,.28); border-radius:10px; padding:2px 7px; white-space:nowrap; }
.optpl-picker { display:flex; flex-direction:column; gap:10px; }
.optpl-picker-search { position:sticky; top:0; z-index:1; }
.optpl-picker-search .input { width:100%; }
.optpl-picker-list { display:flex; flex-direction:column; gap:6px; max-height:52vh; overflow-y:auto; padding-right:4px; }
.optpl-picker-item { display:flex; align-items:center; gap:10px; padding:9px 10px; border:1px solid var(--border); border-radius:9px; background:var(--surface); cursor:pointer; font-size:13px; }
.optpl-picker-item.checked { border-color:var(--primary); background:var(--primary-soft, var(--surface-2)); }
.optpl-picker-item code { font-size:11px; color:var(--muted); }
.optpl-picker-label { font-weight:600; color:var(--text); flex:1; }
.optpl-picker-cat { font-size:11px; color:var(--muted); }
.optpl-picker-tip { font-size:11px; color:var(--muted); }
.optpl-picker-empty { padding:26px; text-align:center; color:var(--muted); font-size:13px; }
.optpl-picker-footer { display:flex; align-items:center; gap:8px; padding-top:10px; border-top:1px solid var(--border); }
.second-layer:has(.optpl-picker) .second-panel { width:min(760px,94vw); }

/* ===== PDF 导出模板设置 ===== */
.of-move { cursor: pointer; color: var(--muted); font-size: 11px; padding: 3px 4px; border-radius: 4px; user-select: none; flex-shrink: 0; }
.of-move:hover { background: var(--surface-2); color: var(--primary); }
.pt-field-row .of-del { cursor: pointer; color: var(--muted); font-size: 14px; padding: 3px 6px; border: none; background: transparent; border-radius: 5px; }
.pt-field-row .of-del:hover { background: #fdecea; color: #c0392b; }
/* PDF 字段行：来自字段库的语义属性只读灰显，宽度仍可编辑 */
.pt-field-row.is-library { background: var(--surface-2); border-radius: 7px; }
.pt-field-row.is-library .f-label,
.pt-field-row.is-library .f-key,
.pt-field-row.is-library .f-type { opacity: .72; cursor: not-allowed; }
.pt-field-row.is-library .f-width { opacity: 1; cursor: pointer; border-color: rgba(8,145,178,.45); background: rgba(8,145,178,.06); }

/* ===== 操作台每个标签独立的导出按钮 ===== */
.opc-form-export-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; padding: 4px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.opc-form-export-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opc-form-tag-name { font-size: 12px; color: var(--muted); }
.opc-form-tag-name b { color: var(--text); font-weight: 700; }
.opc-tag-export { white-space: nowrap; flex-shrink: 0; }

/* ===== 月付结算 ===== */
.monthly-section-title { display:flex; align-items:center; gap:8px; margin:16px 2px 9px; font-size:13px; font-weight:700; color:var(--text-2); }
.monthly-section-title::before { content:''; width:3px; height:14px; border-radius:2px; background:var(--teal); }
.monthly-cust-grid, .monthly-bill-list, .monthly-party-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:12px; align-items:stretch; }
/* 客户名录固定一行四列，卡片同等高度，容器留白 */
#monthlyCustomerList { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; padding:14px 16px 18px; align-items:stretch; }
@media (max-width:1250px) { #monthlyCustomerList { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:950px) { #monthlyCustomerList { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:680px) { #monthlyCustomerList { grid-template-columns:1fr; } }
@media (max-width:900px) { .monthly-cust-grid, .monthly-bill-list, .monthly-party-grid { grid-template-columns:1fr; } }

/* 统计卡：彩色标记 + 图标 + 主数值 + 状态胶囊（与资金流水统计卡同一视觉语言） */
.monthly-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:12px 0 16px; }
@media (max-width:1250px) { .monthly-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) { .monthly-stat-grid { grid-template-columns:1fr; } }
.monthly-stat-card {
  --ms-tone:var(--teal); position:relative; overflow:hidden; padding:13px 16px 12px;
  border:1px solid var(--border); border-radius:12px; background:var(--surface);
  box-shadow:0 2px 10px rgba(16,24,40,.04); transition:transform .18s, box-shadow .18s;
}
.monthly-stat-card:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(16,24,40,.08); }
.monthly-stat-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--ms-tone); }
.monthly-stat-card.tone-teal { --ms-tone:var(--teal); }
.monthly-stat-card.tone-green { --ms-tone:var(--green); }
.monthly-stat-card.tone-orange { --ms-tone:var(--orange); }
.ms-top { display:flex; align-items:center; gap:8px; }
.ms-icon { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:7px; background:var(--surface-2); color:var(--ms-tone); font-size:12px; font-weight:700; }
.ms-label { font-size:12px; color:var(--muted); }
.ms-value { margin-top:9px; font-size:21px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; letter-spacing:.2px; }
.ms-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:8px; }
.ms-pill { max-width:72%; padding:2px 8px; border-radius:10px; background:var(--surface-2); color:var(--ms-tone); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ms-hint { font-size:11px; color:var(--muted); }

.monthly-cust-card, .monthly-bill-card, .monthly-party-card {
  position:relative; padding:14px 16px; border:1px solid var(--border); border-left:3px solid var(--teal);
  border-radius:12px; background:var(--surface); box-shadow:0 2px 10px rgba(16,24,40,.04);
  transition:transform .18s, box-shadow .18s;
}
.monthly-bill-card, .monthly-party-card { display:flex; flex-direction:column; }
.monthly-bill-card:hover, .monthly-party-card:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(16,24,40,.08); }
/* 客户名录卡：月付台账风格（与客户档案卡区分）——顶部标识条 + 横向账目清单 + 额度突出 */
.monthly-cust-card {
  display:flex; flex-direction:column; gap:10px; min-height:230px; height:100%;
  border:1px solid rgba(14,124,155,.16); border-radius:12px; overflow:hidden;
  background:linear-gradient(180deg, rgba(14,124,155,.05), rgba(14,124,155,0) 42%), var(--surface);
  box-shadow:0 2px 12px rgba(14,124,155,.06);
}
.monthly-cust-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(14,124,155,.14); border-color:rgba(14,124,155,.4); }
.monthly-cust-card.is-off { opacity:.64; filter:grayscale(.3); }
.mcc-ribbon { display:flex; align-items:center; gap:8px; margin:-14px -16px 2px; padding:7px 16px; background:linear-gradient(90deg, rgba(14,124,155,.16), rgba(14,124,155,.04)); border-bottom:1px solid rgba(14,124,155,.18); color:#0e7c9b; }
.mcc-ribbon span { font-size:10.5px; font-weight:800; letter-spacing:.6px; white-space:nowrap; }
.mcc-ribbon i { flex:1; height:1px; background:linear-gradient(90deg, rgba(14,124,155,.35), transparent); }
.mcc-ribbon em { font-size:9px; font-style:normal; letter-spacing:1.4px; opacity:.5; }
.mcc-top { display:flex; align-items:center; gap:11px; }
.mcc-avatar { width:38px; height:38px; border-radius:9px; flex:none; display:inline-flex; align-items:center; justify-content:center; font-size:17px; font-weight:800; background:#eaf6fa; color:#0e7c9b; border:1px solid rgba(14,124,155,.22); }
.mcc-avatar.tone-orange { background:#fff4e8; color:#c26f12; border-color:rgba(224,134,25,.24); }
.mcc-avatar.tone-purple { background:#f2ecff; color:#7c4dff; border-color:rgba(124,77,255,.22); }
.mcc-avatar.tone-gray { background:var(--surface-2); color:var(--muted); border-color:var(--border); }
.mcc-idtag { min-width:0; flex:1; }
.mcc-name { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.mcc-name b { font-size:14.5px; color:var(--text); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mcc-name .tone-tag { font-size:10px; padding:1px 7px; }
.mcc-cat { display:flex; align-items:center; gap:5px; margin-top:4px; font-size:11px; color:#0e7c9b; opacity:.85; }
.mcc-info { display:flex; flex-direction:column; gap:0; padding:2px 0; background:transparent; border-top:1px dashed rgba(14,124,155,.25); border-bottom:1px dashed rgba(14,124,155,.25); }
.mcc-line { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; padding:5px 0; border-bottom:1px dotted var(--border); }
.mcc-line:last-child { border-bottom:0; }
.mcc-line > span { font-size:11px; color:var(--muted); font-weight:500; white-space:nowrap; }
.mcc-line > b { font-size:12.5px; color:var(--text); font-weight:600; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mcc-line.mcc-credit > b { font-size:15px; color:#0e7c9b; font-weight:800; letter-spacing:-.01em; }
.mcc-remark { padding:5px 9px; border-radius:6px; background:rgba(14,124,155,.06); border-left:2px solid rgba(14,124,155,.4); font-size:11px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mbc-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.mbc-head b { font-size:14px; color:var(--text); font-weight:700; }
.mbc-info { display:flex; flex-wrap:wrap; gap:5px 14px; margin-top:8px; font-size:12px; color:var(--muted); }
.mbc-info b { color:var(--text-2); font-weight:600; }
.mcc-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:auto; padding-top:8px; font-size:10.5px; color:var(--muted); }
.mcc-acts { display:inline-flex; gap:6px; }
.mcc-acts .btn { border-radius:6px; }
[data-theme="dark"] .mcc-ribbon { color:#7dbaff; border-bottom-color:rgba(125,186,255,.2); }
[data-theme="dark"] .mcc-info { border-color:rgba(125,186,255,.2); }
[data-theme="dark"] .mcc-line.mcc-credit > b, [data-theme="dark"] .mcc-cat { color:#7dbaff; }
.mbc-month { margin-left:auto; font-size:11px; color:var(--muted); }
.mbc-amounts { display:flex; flex-wrap:wrap; gap:5px 16px; margin-top:10px; padding-top:9px; border-top:1px solid var(--border); font-size:12px; color:var(--muted); }
.mbc-amounts b { color:var(--text); font-size:13px; font-variant-numeric:tabular-nums; }
.mbc-progress, .mpp-progress { display:flex; align-items:center; gap:8px; margin-top:9px; }
.mbc-track { flex:1; height:6px; border-radius:4px; background:var(--surface-2); overflow:hidden; }
.mbc-track i { display:block; height:100%; border-radius:4px; background:var(--teal); }
.mbc-progress em { min-width:32px; text-align:right; font-size:11px; font-style:normal; color:var(--muted); }
.mbc-actions { display:flex; gap:7px; margin-top:10px; }
.monthly-amount-open { color:var(--orange) !important; font-weight:700; }
.monthly-party-card b { display:block; font-size:13px; color:var(--text); }
.monthly-party-card > span { display:block; margin:3px 0 7px; font-size:11px; color:var(--muted); }
.monthly-party-card > div { font-size:12px; color:var(--muted); }
.monthly-party-card > div b { display:inline; font-size:12px; font-variant-numeric:tabular-nums; }
.monthly-table { width:100%; font-size:12px; }
.monthly-table th { background:var(--surface-2); color:var(--muted); font-weight:600; text-align:left; padding:8px 10px; border-bottom:1px solid var(--border); }
.monthly-table td { padding:8px 10px; border-bottom:1px solid var(--border); }
.monthly-table tbody tr:hover { background:var(--surface-2); }
.monthly-table .num, .monthly-table th.num { text-align:right; font-variant-numeric:tabular-nums; }
.monthly-alloc-input { width:110px; padding:4px 8px; text-align:right; }
.monthly-alloc-meta { margin:12px 0 4px; }

/* 月结明细（只读）：记录卡 + 费用明细 + 核销流水 */
.monthly-hint { font-size:11px; color:var(--muted); }
#monthlyDetailRows { padding:14px 16px 18px; }
/* 对账单预览：弹窗内可横向滚动查看 A4 横向版式 */
.monthly-preview-wrap { max-height:62vh; overflow:auto; padding:12px; background:#e9eef4; border-radius:10px; }
.monthly-preview-wrap .ms-sheet { margin:0 auto; box-shadow:0 3px 16px rgba(15,23,42,.16); }
.monthly-detail-card {
  position:relative; margin:0 0 12px; padding:14px 16px; border:1px solid var(--border);
  border-left:3px solid var(--teal); border-radius:12px; background:var(--surface);
  box-shadow:0 2px 10px rgba(16,24,40,.04);
}
.monthly-detail-card.ap { border-left-color:var(--orange); }
.mdc-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.mdc-head b { font-size:13px; color:var(--text); font-weight:700; }
.mdc-party { font-size:12px; color:var(--text-2); font-weight:600; }
.mdc-no { font-size:11px; color:var(--muted); }
.mdc-amount { margin-left:auto; font-size:16px; font-weight:700; color:var(--teal); font-variant-numeric:tabular-nums; }
.monthly-detail-card.ap .mdc-amount { color:var(--orange); }
.mdc-sub { margin:12px 0 6px; font-size:12px; font-weight:700; color:var(--text-2); }
.mdc-sub::before { content:''; display:inline-block; width:3px; height:12px; margin-right:7px; border-radius:2px; background:var(--teal); vertical-align:-1px; }
.monthly-detail-card.ap .mdc-sub::before { background:var(--orange); }
.monthly-detail-total {
  display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px 26px;
  margin-top:14px; padding:14px 18px; border:1px solid var(--border); border-radius:12px;
  background:var(--surface-2); font-size:13px; color:var(--muted);
}
.monthly-detail-total b { font-size:16px; font-variant-numeric:tabular-nums; }
.monthly-detail-total b.ar { color:var(--teal); }
.monthly-detail-total b.ap { color:var(--orange); }
.monthly-detail-total .mdt-sum { padding-left:20px; border-left:1px solid var(--border); }
.monthly-detail-total .mdt-sum b { color:var(--text); }
@media (max-width:900px) {
  .monthly-detail-total { justify-content:flex-start; }
  .monthly-detail-total .mdt-sum { padding-left:0; border-left:0; }
}

/* 月结明细单据式卡片：抬头 + To:对象 + 四列表格（费用项目 / 业务单号·发生时间 / 核销流水 / 金额总计） */
.msd-card { padding:0; overflow:hidden; border-radius:10px; }
.msd-letterhead {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 16px; border-bottom:1px solid var(--border);
  background:linear-gradient(90deg, rgba(15,157,120,.08), rgba(15,157,120,0));
}
.msd-card.ap .msd-letterhead { background:linear-gradient(90deg, rgba(224,122,24,.10), rgba(224,122,24,0)); }
.msd-lh-main { min-width:0; }
.msd-lh-title { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; color:var(--muted); letter-spacing:1px; }
.msd-to { margin-top:5px; font-size:14px; color:var(--text-2); }
.msd-to b { font-size:15px; color:var(--text); font-weight:750; }
.msd-letterhead .msd-amount { margin-left:auto; font-size:19px; font-weight:750; color:var(--teal); font-variant-numeric:tabular-nums; }
.msd-card.ap .msd-letterhead .msd-amount { color:var(--orange); }
.msd-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.msd-table th {
  padding:8px 12px; text-align:left; font-weight:600; color:var(--muted); background:var(--surface-2);
  border-bottom:1px solid var(--border); border-right:1px solid var(--border);
}
.msd-table td {
  padding:10px 12px; vertical-align:top; color:var(--text);
  border-bottom:1px solid var(--border); border-right:1px solid var(--border);
}
.msd-table th:last-child, .msd-table td:last-child { border-right:0; }
.msd-table tbody tr:last-child td { border-bottom:0; }
.msd-table th:nth-child(1) { width:26%; }
.msd-table th:nth-child(2) { width:22%; }
.msd-table th:nth-child(3) { width:36%; }
.msd-table th:nth-child(4) { width:16%; }
.msd-fee b { font-size:13px; font-weight:700; color:var(--text); }
.msd-fee-meta { margin-top:4px; font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
.msd-fee-note { margin-top:3px; font-size:11px; color:var(--text-2); }
.msd-biz b { font-size:12px; color:var(--text); }
.msd-alloc { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; padding:2px 0; font-variant-numeric:tabular-nums; }
.msd-alloc + .msd-alloc { border-top:1px dashed var(--border); padding-top:6px; margin-top:4px; }
.msd-alloc-amt { font-size:13px; font-weight:700; color:var(--teal); }
.msd-card.ap .msd-alloc-amt { color:var(--orange); }
.msd-alloc-time { font-size:11px; color:var(--text-2); }
.msd-alloc-no { font-size:10px; color:var(--muted); }
.msd-none { font-size:11px; color:var(--muted); }
.msd-table .msd-total { text-align:right; font-size:15px; font-weight:750; color:var(--teal); font-variant-numeric:tabular-nums; white-space:nowrap; }
.msd-card.ap .msd-total { color:var(--orange); }
@media (max-width:900px) {
  .msd-table th:nth-child(1) { width:30%; }
  .msd-table th:nth-child(2) { width:24%; }
  .msd-table th:nth-child(3) { width:30%; }
  .msd-table th:nth-child(4) { width:16%; }
}

/* ===== 资金流水与核销 ===== */
.toolbar-sep { font-size:12px; color:var(--muted); padding:0 2px; }
/* 顶部统计：彩色标记 + 主数值 + 状态胶囊 */
#cashStatsGrid { gap:12px; margin-bottom:14px; }
#cashStatsGrid .cash-stat-card {
  position:relative; overflow:hidden; padding:13px 16px 12px;
  border:1px solid var(--border); border-radius:12px; background:var(--surface);
  box-shadow:0 2px 10px rgba(16,24,40,.04); transition:box-shadow .18s, transform .18s;
}
#cashStatsGrid .cash-stat-card:hover { box-shadow:0 6px 18px rgba(16,24,40,.09); transform:translateY(-1px); }
#cashStatsGrid .cash-stat-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--tone); }
#cashStatsGrid .cash-stat-card.tone-green { --tone:var(--green); }
#cashStatsGrid .cash-stat-card.tone-teal { --tone:var(--teal); }
#cashStatsGrid .cash-stat-card.tone-orange { --tone:var(--orange); }
#cashStatsGrid .cash-stat-card.tone-purple { --tone:#8b5cf6; }
[data-theme="dark"] #cashStatsGrid .cash-stat-card.tone-purple { --tone:#c4a6ff; }
.cash-stat-top { display:flex; align-items:center; gap:8px; }
.cash-stat-icon { width:24px; height:24px; flex:none; display:inline-flex; align-items:center; justify-content:center; border-radius:7px; background:var(--surface-2); color:var(--tone); font-size:12px; font-weight:700; }
.cash-stat-label { font-size:12px; font-weight:600; color:var(--text-2); }
.cash-stat-hint { margin-left:auto; font-size:11px; color:var(--muted); }
.cash-stat-value { margin:9px 0 7px; font-size:21px; font-weight:750; letter-spacing:-.02em; line-height:1.25; color:var(--text); font-variant-numeric:tabular-nums; }
.cash-stat-foot { min-height:20px; }
.cash-stat-pill { display:inline-flex; align-items:center; padding:2px 9px; border-radius:999px; background:var(--surface-2); color:var(--tone); font-size:11px; font-weight:600; }
/* 流水卡片：账本条目式（左侧日期存根 + 右侧账目），一行四列，窄屏逐级回退 */
#cashList { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:stretch; padding:14px 16px 18px; }
#cashList > .file-empty { grid-column:1 / -1; }
@media (max-width:1250px) { #cashList { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:950px) { #cashList { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:680px) { #cashList { grid-template-columns:1fr; } }
#cashList .cash-card { padding:0; border-radius:12px; box-shadow:0 2px 10px rgba(16,24,40,.035); transition:box-shadow .18s, transform .18s; overflow:hidden; display:flex; min-height:100%; }
#cashList .cash-card:hover { box-shadow:0 8px 22px rgba(16,24,40,.10); transform:translateY(-2px); }
.cash-ledger { border:1px solid var(--border); background:var(--surface); }
.cash-ledger .cl-stub {
  flex:0 0 62px; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:6px;
  padding:14px 6px; background:var(--surface-2); border-right:1px dashed var(--border);
}
.cl-day { font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; letter-spacing:.02em; }
.cl-dir { width:28px; height:28px; flex:none; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; font-size:14px; font-weight:800; background:rgba(16,185,129,.14); color:var(--green); }
.cash-card.ap .cl-dir { background:rgba(224,122,24,.14); color:var(--orange); }
.cl-stamp { margin-top:auto; padding:2px 5px; border:1.5px solid #8b5cf6; color:#8b5cf6; border-radius:5px; font-size:10px; font-weight:800; letter-spacing:1px; transform:rotate(-10deg); background:rgba(139,92,246,.06); }
[data-theme="dark"] .cl-stamp { color:#c4a6ff; border-color:#c4a6ff; }
.cash-ledger.is-monthly { border-color:rgba(139,92,246,.45); }
.cash-ledger .cl-main { flex:1; min-width:0; padding:12px 14px; display:flex; flex-direction:column; }
.cl-head { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.cl-no { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; }
.cl-no > b { font-size:12.5px; color:var(--text); font-weight:700; }
.cl-monthly-chip { display:inline-flex; align-items:center; padding:1px 7px; border-radius:5px; background:rgba(139,92,246,.12); color:#7c4dff; font-size:10px; font-weight:700; border:1px solid rgba(139,92,246,.3); }
[data-theme="dark"] .cl-monthly-chip { color:#c4a6ff; }
.cl-amount-line { display:flex; align-items:center; gap:10px; }
.cl-amount-line .tone-tag { flex:none; }
.cl-amount { font-size:20px; font-weight:800; color:var(--green); white-space:nowrap; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.cash-card.ap .cl-amount { color:var(--orange); }
.cl-lines { margin-top:9px; padding:8px 10px; background:var(--surface-2); border-radius:8px; }
.cl-line { display:flex; gap:8px; font-size:11.5px; line-height:1.75; }
.cl-line > span { flex:0 0 54px; color:var(--muted); }
.cl-line > b { color:var(--text-2); font-weight:600; min-width:0; word-break:break-all; }
.cl-progress { margin-top:auto; padding-top:10px; }
.cl-bar-row { display:flex; align-items:center; gap:8px; }
.cl-bar { flex:1; min-width:0; height:6px; border-radius:6px; background:var(--surface-2); overflow:hidden; }
.cl-bar i { display:block; height:100%; border-radius:6px; background:var(--teal); transition:width .25s; }
.cash-card.ap .cl-bar i { background:var(--orange); }
.cl-pct { flex:none; min-width:34px; text-align:right; font-size:10px; font-style:normal; line-height:1; color:var(--muted); font-variant-numeric:tabular-nums; }
.cl-progress > span { display:block; margin-top:6px; font-size:11px; color:var(--muted); }
.cash-remaining { color:var(--orange); font-weight:600; }
.cash-actions { display:flex; gap:7px; margin-top:10px; }
.cash-remark { margin-top:6px; font-size:12px; color:var(--muted); }
.btn-xs { padding:2px 7px; font-size:11px; }
.btn-danger-ghost { border-color:rgba(217,48,37,.3); color:var(--red); background:transparent; }
.btn-danger-ghost:hover { background:var(--red-soft); }
.cash-details { margin-top:9px; border-top:1px dashed var(--border); padding-top:7px; }
.cash-details summary { cursor:pointer; font-size:12px; color:var(--muted); list-style:none; }
.cash-details summary::-webkit-details-marker { display:none; }
.cash-details summary::before { content:'▸ '; }
.cash-details[open] summary::before { content:'▾ '; }
.cash-alloc-row { display:flex; align-items:center; gap:10px; padding:6px 0 6px 14px; font-size:12px; border-bottom:1px solid var(--border); }
.cash-alloc-row:last-child { border-bottom:0; }
.cash-alloc-row b { margin-left:auto; }
.cash-alloc-row small { color:var(--muted); }
.alloc-info { display:flex; flex-wrap:wrap; gap:8px 16px; padding:10px 12px; background:var(--surface-2); border-radius:8px; font-size:13px; }
.alloc-info span { color:var(--muted); }
.alloc-head, .alloc-row { display:grid; grid-template-columns:1fr 130px 140px; gap:10px; align-items:center; }
.alloc-head { padding:10px 4px 6px; font-size:11px; color:var(--muted); }
.alloc-list { max-height:46vh; overflow-y:auto; border:1px solid var(--border); border-radius:8px; }
.alloc-row { padding:8px 10px; border-bottom:1px solid var(--border); cursor:pointer; }
.alloc-row:last-child { border-bottom:0; }
.alloc-row:hover { background:var(--surface-2); }
.alloc-name { display:flex; flex-direction:column; gap:2px; font-size:12px; }
.alloc-name small { color:var(--muted); font-size:11px; }
.alloc-room { text-align:right; font-size:12px; color:var(--teal); }
.alloc-amount { width:100%; padding:6px 8px; text-align:right; }
.alloc-empty { padding:26px; text-align:center; color:var(--muted); font-size:13px; }
.alloc-total { padding-top:10px; font-size:13px; text-align:right; }
.alloc-total b { color:var(--teal); font-size:15px; }
.alloc-total b.over { color:var(--red); }

/* ===== 利润看板 ===== */
.profit-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.profit-period-label { font-size:12px; color:var(--muted); }
.profit-toolbar-divider { width:1px; height:18px; margin:0 4px; background:var(--border); }
.profit-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; margin-bottom:14px; align-items:stretch; }
.profit-panel-title { padding:11px 14px; font-size:13px; font-weight:700; border-bottom:1px solid var(--border); }
.profit-panel-title small { margin-left:8px; font-weight:400; font-size:11px; color:var(--muted); }
.profit-trend, .profit-ranking { padding:10px 14px; }
.profit-details { padding:10px 14px; }
.profit-trend-row { display:grid; grid-template-columns:120px 1fr 100px; gap:10px; align-items:center; padding:7px 0; font-size:12px; }
.pt-bar { height:8px; border-radius:8px; background:var(--surface-2); overflow:hidden; }
.pt-bar i { display:block; height:100%; border-radius:8px; background:var(--teal); }
.pt-bar i.neg { background:var(--red); }
.profit-trend-row b { text-align:right; }
.profit-trend-row b.neg, .profit-table .neg { color:var(--red); }
.profit-table { width:100%; min-width:0; table-layout:fixed; border-collapse:collapse; font-size:12px; }
.profit-table th { background:var(--surface-2); text-align:left; padding:9px 10px; color:var(--muted); font-weight:600; border-bottom:1px solid var(--border); white-space:nowrap; }
.profit-table th.num { text-align:right; }
.profit-table td { padding:9px 10px; border-bottom:1px solid var(--border); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profit-table td.num { text-align:right; font-variant-numeric:tabular-nums; }
@media (max-width:1200px) { .profit-grid { grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:900px) { .profit-grid { grid-template-columns:1fr; } }

/* 利润看板改版：指标卡 + 可视化排行 + 期次趋势 */
#profitStatsGrid { grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; align-items:stretch; }
#profitStatsGrid .expense-stat-card {
  position:relative; min-height:132px; padding:16px 18px 14px; display:flex; flex-direction:column; gap:10px;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); overflow:hidden;
}
#profitStatsGrid .expense-stat-card::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--ps-color);
}
#profitStatsGrid .expense-stat-card::after {
  content:''; position:absolute; right:-28px; top:-32px; width:104px; height:104px; border-radius:50%;
  background:var(--ps-soft); opacity:.55; pointer-events:none;
}
#profitStatsGrid .ps-top { position:relative; z-index:1; display:flex; align-items:center; gap:9px; }
#profitStatsGrid .ps-icon {
  width:31px; height:31px; border-radius:9px; display:grid; place-items:center; flex:none;
  background:var(--ps-soft); color:var(--ps-color);
}
#profitStatsGrid .ps-icon svg { width:17px; height:17px; }
#profitStatsGrid .ps-label { font-size:12.5px; font-weight:600; color:var(--text-2); }
#profitStatsGrid .ps-key {
  margin-left:auto; padding:2px 8px; border-radius:9px; font-size:10px; font-weight:700;
  color:var(--ps-color); background:var(--ps-soft);
}
#profitStatsGrid .ps-value {
  position:relative; z-index:1; font-size:24px; font-weight:750; line-height:1.15; letter-spacing:-.02em;
  color:var(--text); font-variant-numeric:tabular-nums; word-break:break-all;
}
#profitStatsGrid .ps-compact .ps-value { font-size:19px; line-height:1.35; }
#profitStatsGrid .ps-foot { position:relative; z-index:1; margin-top:auto; }
#profitStatsGrid .ps-pill {
  display:inline-block; max-width:100%; padding:4px 10px; border-radius:20px; font-size:11px;
  color:var(--ps-color); background:var(--ps-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ps-purple { --ps-color:#8b5cf6; --ps-soft:#f2ecff; }
.ps-green  { --ps-color:var(--green); --ps-soft:var(--green-soft); }
.ps-orange { --ps-color:var(--orange); --ps-soft:var(--orange-soft); }
.ps-teal   { --ps-color:var(--teal); --ps-soft:#e6f7f4; }
.ps-amber  { --ps-color:#d98a00; --ps-soft:#fff3d9; }
.ps-blue   { --ps-color:var(--primary); --ps-soft:var(--primary-soft); }

.profit-grid .expense-panel { border-radius:14px; overflow:hidden; display:flex; flex-direction:column; min-width:0; }
.profit-grid .expense-panel .profit-panel-title {
  display:flex; align-items:center; gap:9px; padding:13px 16px; font-size:13.5px; font-weight:700;
  background:var(--surface-2); border-bottom:1px solid var(--border);
}
.profit-grid .expense-panel .profit-panel-title::before {
  content:''; width:4px; height:15px; border-radius:2px; background:var(--primary); flex:none;
}
.profit-grid .expense-panel:last-child .profit-panel-title::before { background:var(--teal); }
.profit-grid .expense-panel:nth-child(2) .profit-panel-title::before { background:var(--orange); }
.profit-grid .expense-panel .profit-panel-title small { margin-left:0; font-weight:500; }
.profit-trend, .profit-ranking { flex:1; padding:12px 16px 16px; }
.profit-details { padding:6px 14px 14px; }

.pt-list, .pr-list { display:flex; flex-direction:column; gap:7px; }
.pt-row {
  display:grid; grid-template-columns:96px minmax(60px,1fr) 100px 108px; gap:10px; align-items:center;
  padding:8px 6px; border-bottom:1px dashed var(--border); border-radius:8px;
}
.pt-row:last-child { border-bottom:0; }
.pt-row:hover, .pt-row.active { background:var(--surface-2); }
.pt-row.active .pt-name { color:var(--primary); font-weight:700; }
.pt-name { font-size:12px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pt-track { height:9px; border-radius:9px; background:var(--surface-2); overflow:hidden; }
.pt-track i { display:block; height:100%; border-radius:9px; background:linear-gradient(90deg,var(--teal),#4cc9ad); }
.pt-track i.neg { background:linear-gradient(90deg,var(--red),#ff8a80); }
.pt-val { text-align:right; font-size:12.5px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }
.pt-cash { text-align:right; font-size:11px; color:var(--muted); white-space:nowrap; }
.pt-val.neg, .pr-metrics b.neg, .profit-table .neg { color:var(--red); }

.pr-row {
  position:relative; display:grid; grid-template-columns:22px 30px minmax(80px,1fr) minmax(160px,1.1fr);
  gap:10px; align-items:center; padding:9px 10px 12px; border:1px solid var(--border);
  border-radius:11px; background:var(--surface); overflow:hidden;
}
.pr-row.pr-top { border-color:var(--primary-border); background:linear-gradient(90deg,var(--primary-soft),var(--surface) 70%); }
.pr-rank {
  width:22px; height:22px; border-radius:7px; display:grid; place-items:center; flex:none;
  font-size:11px; font-weight:800; color:var(--muted); background:var(--surface-2);
}
.pr-rank.r1 { background:#f5b301; color:#fff; }
.pr-rank.r2 { background:#9aa7b4; color:#fff; }
.pr-rank.r3 { background:#c98250; color:#fff; }
.pr-avatar {
  width:30px; height:30px; border-radius:50%; display:grid; place-items:center; flex:none;
  font-size:12px; font-weight:700; color:var(--primary); background:var(--primary-soft);
  border:1px solid var(--primary-border);
}
.pr-who { min-width:0; display:flex; flex-direction:column; line-height:1.3; }
.pr-who b { font-size:12.5px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pr-who small { font-size:10.5px; color:var(--muted); }
.pr-metrics { display:flex; justify-content:flex-end; gap:16px; text-align:right; }
.pr-metrics span { display:block; font-size:10px; color:var(--muted); }
.pr-metrics b { display:block; font-size:13px; color:var(--text); font-variant-numeric:tabular-nums; }
.pr-metrics b.pr-count { color:var(--primary); font-size:15px; }
.pr-metrics b.pr-count i { font-size:10px; font-style:normal; font-weight:600; }
.pr-bar { position:absolute; left:0; bottom:0; height:3px; border-radius:0 3px 3px 0; background:var(--primary); max-width:100%; }
.pr-row.pr-me { border-color:var(--primary); background:var(--primary-soft); box-shadow:inset 0 0 0 1px var(--primary-border); }
.pr-who em { display:inline-block; margin-left:6px; padding:1px 5px; border-radius:5px; font-size:9.5px; font-style:normal; font-weight:700; color:var(--primary); background:var(--surface); border:1px solid var(--primary-border); }
.pr-gap { display:flex; align-items:center; gap:8px; padding:5px 10px; color:var(--muted); font-size:10.5px; }
.pr-gap::before, .pr-gap::after { content:''; flex:1; height:1px; background:var(--border); }
/* 全员排名底部操作栏：展开全部 / 导出 Excel（个人查看不显示） */
.pr-footer {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-top:10px; padding-top:10px; border-top:1px dashed var(--border);
}
.pr-footer-count { font-size:11px; color:var(--muted); white-space:nowrap; }
.pr-footer-actions { display:flex; align-items:center; gap:8px; }
.pr-footer-actions .btn { padding:5px 12px; font-size:11.5px; line-height:1.4; }

.profit-table th { padding:10px 10px; background:var(--surface-2); }
.profit-table td { padding:10px 10px; }
.profit-table tbody tr:hover { background:var(--surface-2); }
.profit-table .pt-date { color:var(--muted); font-variant-numeric:tabular-nums; }
.profit-table tfoot td {
  position:sticky; bottom:0; font-weight:700; color:var(--text); background:var(--surface-2);
  border-top:2px solid var(--border); border-bottom:0;
}
/* 一行三列时收紧趋势/排名行距与列宽，避免金额折行 */
@media (min-width:1201px) {
  .profit-grid .pt-row { grid-template-columns:82px minmax(40px,1fr) 90px 94px; gap:7px; padding:7px 3px; }
  .profit-grid .pt-cash { font-size:10px; }
  .profit-grid .pr-row { grid-template-columns:20px 27px minmax(52px,1fr) minmax(120px,1.2fr); gap:7px; padding:8px 8px 11px; }
  .profit-grid .pr-metrics { gap:9px; }
  .profit-grid .pr-metrics b { font-size:12px; }
  .profit-grid .pr-avatar { width:27px; height:27px; font-size:11px; }
  .profit-grid .pr-rank { width:20px; height:20px; }
  .profit-grid .pr-footer-actions { gap:6px; }
  .profit-grid .pr-footer-actions .btn { padding:5px 8px; font-size:11px; }
}
@media (max-width:1200px) { #profitStatsGrid { grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:900px) {
  .pt-row { grid-template-columns:80px minmax(60px,1fr) 96px; }
  .pt-cash { display:none; }
  .pr-row { grid-template-columns:22px 30px minmax(70px,1fr); }
  .pr-metrics { grid-column:2 / -1; justify-content:flex-start; }
}
@media (max-width:620px) { #profitStatsGrid { grid-template-columns:1fr; } }

/* 利润看板指标区：统计范围 + 权责/现金公式链（2026-12-01） */
#profitStatsGrid { grid-template-columns:minmax(220px,.85fr) minmax(360px,1.4fr) minmax(360px,1.4fr); align-items:stretch; gap:14px; }
.pf-card {
  --pf-accent:var(--primary); --pf-soft:var(--primary-soft); --pf-out:var(--orange); --pf-profit:var(--primary);
  position:relative; min-height:184px; padding:16px 18px; display:flex; flex-direction:column; gap:12px;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); overflow:hidden;
}
.pf-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--pf-accent); }
.pf-scope { --pf-accent:#8b5cf6; --pf-soft:#f2ecff; }
.pf-accrual { --pf-accent:var(--teal); --pf-soft:#e6f7f4; --pf-out:var(--orange); --pf-profit:var(--teal); }
.pf-cash { --pf-accent:var(--primary); --pf-soft:var(--primary-soft); --pf-out:#93b4d8; --pf-profit:var(--primary); }
.pf-icon { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; flex:none; background:var(--pf-soft); color:var(--pf-accent); }
.pf-icon svg { width:17px; height:17px; }
.pf-scope-head { display:flex; align-items:center; gap:9px; font-size:13px; font-weight:600; color:var(--text); }
.pf-scope-main { display:flex; align-items:baseline; gap:7px; }
.pf-scope-main b { font-size:40px; line-height:1; color:var(--pf-accent); font-variant-numeric:tabular-nums; }
.pf-scope-main span { font-size:13px; color:var(--muted); }
.pf-scope-desc { font-size:12px; color:var(--muted); line-height:1.7; }
.pf-scope-rule { margin-top:auto; padding:10px 11px; border-radius:10px; background:var(--pf-soft); display:flex; flex-direction:column; gap:3px; }
.pf-scope-rule span { font-size:11px; color:var(--pf-accent); }
.pf-scope-rule b { font-size:11.5px; font-weight:600; color:var(--text); line-height:1.5; }
.pf-chain-head { display:flex; align-items:center; gap:9px; }
.pf-chain-head > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.pf-chain-head b { font-size:13.5px; font-weight:700; color:var(--text); }
.pf-chain-head small { font-size:11px; color:var(--muted); }
.pf-chain-head em { margin-left:auto; padding:3px 8px; border-radius:9px; font-size:10.5px; font-style:normal; color:var(--pf-accent); background:var(--pf-soft); white-space:nowrap; max-width:45%; overflow:hidden; text-overflow:ellipsis; }
.pf-formula { display:grid; grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1.25fr); gap:6px; align-items:stretch; }
.pf-step { min-width:0; padding:9px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); }
.pf-step-result { background:var(--pf-soft); border-color:var(--pf-accent); }
.pf-step-label { display:flex; align-items:center; justify-content:space-between; gap:4px; font-size:11px; color:var(--muted); }
.pf-step-label em { padding:1px 5px; border-radius:6px; font-size:9.5px; font-style:normal; color:var(--pf-accent); background:var(--surface); border:1px solid var(--pf-accent); }
.pf-step-value { margin-top:7px; font-size:16px; font-weight:700; line-height:1.2; color:var(--text); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pf-step-value.pf-long { font-size:13px; letter-spacing:-0.2px; }
.pf-step-result .pf-step-value { color:var(--pf-accent); font-size:17px; }
.pf-step-result .pf-step-value.pf-long { font-size:15px; }
.pf-step-sub { margin-top:5px; font-size:10.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pf-op { align-self:center; display:grid; place-items:center; width:22px; height:22px; border-radius:50%; border:1px solid var(--border); background:var(--surface); color:var(--muted); font-size:13px; font-weight:700; }
.pf-op-eq { color:var(--pf-accent); border-color:var(--pf-accent); background:var(--pf-soft); }
.pf-chain-split { margin-top:auto; }
.pf-split-bar { display:flex; height:8px; border-radius:6px; overflow:hidden; background:var(--surface-2); border:1px solid var(--border); }
.pf-split-bar i { display:block; height:100%; }
.pf-split-out { background:var(--pf-out); }
.pf-split-profit { background:var(--pf-profit); }
.pf-split-legend { display:flex; justify-content:space-between; gap:10px; margin-top:6px; font-size:10.5px; color:var(--muted); }
.pf-split-legend b { color:var(--text); font-weight:600; font-variant-numeric:tabular-nums; }
.pf-chain-note { font-size:10.5px; color:var(--muted); line-height:1.5; }
@media (max-width:1200px) {
  #profitStatsGrid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pf-scope { grid-column:1/-1; min-height:auto; }
  .pf-formula { grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr); }
  .pf-formula .pf-op-eq { grid-column:1/-1; justify-self:center; }
  .pf-formula .pf-step-result { grid-column:1/-1; }
}
@media (max-width:900px) {
  #profitStatsGrid { grid-template-columns:1fr; }
  .pf-scope { grid-column:auto; }
}
/* 结算卡资金口径 + 直接登记/核销（2026-11-26） */
.exp-amount-main { text-align:right; font-weight:600; }
.exp-amount-sub { margin-top:4px; font-size:11px; color:var(--muted); text-align:right; white-space:nowrap; }
.set-cash-strip { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; padding:8px 12px; margin:0 0 8px; background:var(--surface-2); border-radius:8px; font-size:12px; color:var(--muted); }
.set-cash-strip b { color:var(--text); font-weight:600; }
.set-cash-strip .set-cash-open b { color:var(--teal); }
.set-cash-strip .set-cash-acts { margin-left:auto; display:flex; gap:6px; }
.set-cash-strip .set-cash-count { font-size:11px; padding:1px 6px; border-radius:8px; background:var(--surface); }
.cash-modal-tabs { display:flex; gap:6px; margin:10px 0 14px; }
.cash-modal-tabs .att-tab { padding:7px 16px; }
.cash-tab-pane[hidden] { display:none; }
.cash-tab-pane .form-grid { margin-bottom:6px; }
@media (max-width:900px) { .set-cash-strip .set-cash-acts { margin-left:0; } }

/* ===== 应收应付结算：单据式卡片（抬头 / 业务信息 / 结算进度三段式） ===== */
#settlementList { padding:10px 14px 12px; display:flex; flex-direction:column; gap:8px; }
#settlementList .set-card { border:1px solid var(--border); border-left:5px solid transparent; border-radius:12px; background:var(--surface); box-shadow:0 2px 8px rgba(16,24,40,.04); overflow:hidden; transition:transform .15s, box-shadow .15s, border-color .15s; }
#settlementList .set-card.ar { border-left-color:#2f9e63; }
#settlementList .set-card.ap { border-left-color:#e08619; }
#settlementList .set-card:hover { transform:translateY(-1px); box-shadow:0 8px 22px rgba(16,24,40,.09); }
#settlementList .set-doc-top { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:6px 12px 5px; border-bottom:1px solid var(--border); }
/* 应收=绿色系、应付=橙色系：整条抬头底色区分，一眼识别单据类型 */
#settlementList .set-card.ar .set-doc-top { background:linear-gradient(90deg, rgba(47,158,99,.15), rgba(47,158,99,.05) 62%, rgba(47,158,99,.02)); border-bottom-color:rgba(47,158,99,.26); }
#settlementList .set-card.ap .set-doc-top { background:linear-gradient(90deg, rgba(224,134,25,.15), rgba(224,134,25,.05) 62%, rgba(224,134,25,.02)); border-bottom-color:rgba(224,134,25,.26); }
#settlementList .set-kind-badge { display:inline-flex; align-items:center; gap:5px; padding:3px 8px; border-radius:6px; font-size:11px; font-weight:700; white-space:nowrap; }
#settlementList .set-card.ar .set-kind-badge { background:#2f9e63; color:#fff; box-shadow:0 1px 3px rgba(47,158,99,.28); }
#settlementList .set-card.ap .set-kind-badge { background:#e08619; color:#fff; box-shadow:0 1px 3px rgba(224,134,25,.28); }
#settlementList .set-kind-ico { font-size:13px; line-height:1; }
#settlementList .exp-title b { font-size:14px; letter-spacing:.2px; }
/* 工作号标签框内的业务单状态：仅字体着色，沿用标签底色 */
#settlementList .exp-cat-tag .os-text { font-style:normal; font-weight:600; margin-left:7px; padding-left:7px; border-left:1px solid var(--border); }
#settlementList .exp-cat-tag .os-green { color:#258054; }
#settlementList .exp-cat-tag .os-blue { color:#2b6cb0; }
#settlementList .exp-cat-tag .os-orange { color:#c26f12; }
#settlementList .exp-cat-tag .os-red { color:#c0392b; }
#settlementList .exp-cat-tag .os-gray { color:var(--text-2); }
#settlementList .set-doc-amount { margin-left:auto; text-align:right; min-width:140px; }
#settlementList .exp-amount-main { font-size:18px; font-weight:800; letter-spacing:-.02em; }
#settlementList .exp-amount-sub { font-size:10px; }
#settlementList .set-card.ar .exp-amount-main { color:#258054; }
#settlementList .set-card.ap .exp-amount-main { color:#c26f12; }
#settlementList .set-doc-body { padding:5px 12px 4px; }
#settlementList .set-doc-reason { font-size:12px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#settlementList .set-doc-body .exp-meta { margin-top:4px; }
#settlementList .party-chip { padding:3px 9px; border-radius:6px; font-size:11px; }
#settlementList .set-doc-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:5px 12px 6px; border-top:1px dashed var(--border); }
#settlementList .set-stages { margin-top:0; }
#settlementList .exp-actions { max-width:none; }
#settlementList .exp-actions .btn { border-radius:7px; padding:4px 10px; font-size:11.5px; }
/* 展开明细：指标条 + 对象分区两行头部 */
#settlementList .set-items-panel { padding:8px 14px 10px; background:var(--surface-2); border-top:1px solid var(--border); }
#settlementList .set-items { gap:6px; }
#settlementList .set-summary-strip { gap:8px; padding:5px 9px; margin-bottom:6px; font-size:11px; }
#settlementList .set-card.ar .set-summary-strip { background:rgba(47,158,99,.06); border-color:rgba(47,158,99,.2); }
#settlementList .set-card.ap .set-summary-strip { background:rgba(224,134,25,.06); border-color:rgba(224,134,25,.2); }
#settlementList .set-summary-strip > span { padding:3px 8px; border-radius:6px; background:var(--surface); border:1px solid var(--border); }
#settlementList .set-summary-strip b { font-size:11.5px; }
/* 对象分区卡：标题栏统一浅蓝底 + 左侧色条，与费用表表头（更浅蓝）分层；应收/应付类型由单据抬头绿/橙标识 */
#settlementList .set-party-card { border-radius:10px; border-color:rgba(14,124,155,.22); }
#settlementList .set-party-head { position:relative; display:flex; flex-direction:column; align-items:stretch; gap:4px; padding:5px 10px 5px 13px; border-bottom:1px solid rgba(14,124,155,.22); background:linear-gradient(90deg, rgba(14,124,155,.14), rgba(14,124,155,.04)); }
#settlementList .set-party-head::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; border-radius:10px 0 0 0; background:#0e7c9b; }
#settlementList .set-party-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#settlementList .set-party-line-acts { justify-content:flex-end; }
#settlementList .set-party-name { font-size:13.5px; font-weight:700; color:#0e7c9b; }
#settlementList .set-party-title small { padding:1px 6px; border-radius:8px; background:var(--surface); border:1px solid var(--border); }
#settlementList .set-party-metrics { margin-left:auto; gap:4px 12px; font-size:10.5px; }
#settlementList .set-party-metrics b { font-size:11px; }
#settlementList .set-recon-table th, #settlementList .set-recon-table td { padding:3px 8px; font-size:11.5px; line-height:1.25; }
/* 费用表表头用更浅的蓝色，与对象标题栏的浅蓝深浅区分；斑马纹同色系 */
#settlementList .set-recon-table thead th { background:rgba(14,124,155,.07); color:#0e7c9b; }
#settlementList .set-recon-table tbody tr:nth-child(even) td { background:rgba(14,124,155,.022); }
#settlementList .set-allocs { padding:5px 10px 6px; background:var(--surface); }
#settlementList .set-allocs-head { margin-bottom:3px; font-size:10.5px; font-weight:700; padding:2px 7px; border-left:3px solid #0e7c9b; background:var(--surface-2); border-radius:0 4px 4px 0; }
#settlementList .set-alloc-row { min-height:21px; padding:1px 4px; font-size:11px; }
[data-theme="dark"] #settlementList .set-card.ar .exp-amount-main { color:#6fd6a9; }
[data-theme="dark"] #settlementList .set-card.ap .exp-amount-main { color:#f2b264; }
[data-theme="dark"] #settlementList .set-party-head { background:linear-gradient(90deg, rgba(77,159,255,.16), rgba(77,159,255,.05)); border-bottom-color:rgba(77,159,255,.25); }
[data-theme="dark"] #settlementList .set-party-head::before { background:#7dbaff; }
[data-theme="dark"] #settlementList .set-party-name { color:#7dbaff; }
[data-theme="dark"] #settlementList .set-recon-table thead th { background:rgba(77,159,255,.10); color:#7dbaff; }
@media (max-width:900px) {
  #settlementList { padding:10px; }
  #settlementList .set-doc-amount { min-width:0; }
  #settlementList .set-doc-foot { flex-direction:column; align-items:flex-start; }
  #settlementList .exp-actions { justify-content:flex-start; }
  #settlementList .set-party-metrics { margin-left:0; }
}

/* 菜单数字提醒：点击徽标弹出的待办速览 */
.badge-popover { position:fixed; z-index:3000; background:var(--surface); border:1px solid var(--border); border-radius:12px; box-shadow:0 14px 40px rgba(12,86,112,.20); overflow:hidden; font-size:12px; }
.badge-popover[hidden] { display:none; }
.bp-head { display:flex; align-items:center; gap:6px; padding:9px 10px; background:linear-gradient(135deg,#eaf7fa,#f2fbf9); border-bottom:1px solid var(--border); }
[data-theme="dark"] .bp-head { background:linear-gradient(135deg,rgba(35,100,120,.38),rgba(30,90,90,.22)); }
.bp-title { flex:1; min-width:0; display:flex; align-items:center; gap:7px; font-weight:700; color:var(--text); }
.bp-count { font-style:normal; min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:#0e7c9b; color:#fff; font-size:11px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.bp-close, .bp-back { width:24px; height:24px; border:0; border-radius:6px; background:transparent; color:var(--muted); cursor:pointer; font-size:18px; line-height:1; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.bp-back { font-size:22px; }
.bp-close:hover, .bp-back:hover { background:rgba(14,124,155,.10); color:#0e7c9b; }
.bp-body { max-height:min(420px,56vh); overflow-y:auto; padding:6px; }
.bp-loading, .bp-empty { padding:24px 10px; text-align:center; color:var(--muted); }
.bp-groups, .bp-items { display:flex; flex-direction:column; gap:3px; }
.bp-group, .bp-item { width:100%; display:flex; align-items:center; gap:9px; text-align:left; border:0; border-radius:8px; background:transparent; color:var(--text); padding:8px 9px; cursor:pointer; font:inherit; }
.bp-group:hover, .bp-item:hover { background:rgba(14,124,155,.07); }
.bp-group-label { flex:1; font-weight:600; }
.bp-group em { font-style:normal; min-width:20px; height:20px; padding:0 5px; border-radius:10px; background:var(--red); color:#fff; font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.bp-group svg, .bp-arrow { width:14px; height:14px; color:var(--muted); flex-shrink:0; }
.bp-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; background:var(--muted); }
.bp-dot.bp-blue { background:#4d9fff; } .bp-dot.bp-green { background:#20a46a; }
.bp-dot.bp-orange { background:#e08b20; } .bp-dot.bp-red { background:var(--red); }
.bp-dot.bp-teal { background:#0e9b9b; } .bp-dot.bp-gray { background:#9aa7b2; }
.bp-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.bp-main b { font-size:12px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bp-main small { font-size:10.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bp-meta { font-size:10.5px; color:var(--muted); white-space:nowrap; flex-shrink:0; }
.bp-handle { border:0; border-radius:5px; padding:3px 7px; background:#0e7c9b; color:#fff; font-size:10.5px; white-space:nowrap; }
.bp-handle:hover { background:#0a6683; }
.bp-foot { padding:7px 11px; border-top:1px solid var(--border); background:var(--surface-2); color:var(--muted); font-size:10.5px; }
.bp-focus { outline:2px solid #0e7c9b !important; outline-offset:2px; box-shadow:0 0 0 5px rgba(14,124,155,.14) !important; }

/* ============ 侧栏层次美化 ============ */
.sidebar { background:linear-gradient(180deg, var(--sidebar-bg) 0%, var(--surface) 100%); }
/* 品牌区：淡渐变底 + 有容器的 Logo */
.sidebar .brand { padding:20px 18px; background:linear-gradient(135deg, rgba(var(--primary-rgb),.06), rgba(var(--primary-rgb),.015) 55%, transparent); }
.sidebar .brand-logo { width:40px; height:40px; border-radius:12px; background:var(--surface); border:1px solid rgba(var(--primary-rgb),.12); box-shadow:0 3px 10px rgba(var(--primary-rgb),.12); }
.sidebar .brand-text b { font-size:15.5px; font-weight:700; letter-spacing:.3px; }
.sidebar .brand-text span { font-size:9.5px; letter-spacing:1.3px; color:var(--primary); opacity:.72; }
/* 工作模块：小标题 + 渐隐分隔线 */
.sidebar .nav-label { display:flex; align-items:center; gap:9px; padding:18px 22px 8px; font-size:10.5px; font-weight:700; letter-spacing:1.3px; text-transform:uppercase; }
.sidebar .nav-label::after { content:''; flex:1; height:1px; background:linear-gradient(90deg, var(--border-strong), transparent); }
/* 菜单项：选中态渐变 + 发光色条 */
.sidebar .nav-item { padding:9px 11px; gap:11px; border-radius:9px; }
.sidebar .nav-item svg { width:17px; height:17px; }
/* 顶层菜单图标统一为 26px 容器，与分组头左对齐 */
.sidebar .side-nav > .nav-item { padding-left:10px; gap:10px; }
.sidebar .side-nav > .nav-item > svg { box-sizing:border-box; width:26px; height:26px; padding:5px; border-radius:8px; background:var(--surface); border:1px solid var(--border); box-shadow:0 1px 3px rgba(0,0,0,.04); color:var(--muted); }
.sidebar .side-nav > .nav-item:not(.active):hover > svg { color:var(--primary); }
.sidebar .side-nav > .nav-item.active > svg { background:rgba(var(--primary-rgb),.09); border-color:rgba(var(--primary-rgb),.18); color:var(--primary); }
.sidebar .nav-item.active { background:linear-gradient(90deg, rgba(var(--primary-rgb),.14), rgba(var(--primary-rgb),.045)); box-shadow:inset 0 0 0 1px rgba(var(--primary-rgb),.15), 0 1px 3px rgba(var(--primary-rgb),.06); }
.sidebar .nav-item.active::before { left:-12px; height:20px; width:3px; box-shadow:0 0 8px rgba(var(--primary-rgb),.4); }
/* 分组头：图标容器 + 展开淡底 */
.sidebar .nav-group { margin:13px 0 3px; }
.sidebar .nav-group-head { padding:7px 10px; font-size:13.5px; font-weight:700; letter-spacing:.5px; border-radius:10px; }
.sidebar .nav-group:not(.collapsed) > .nav-group-head { background:linear-gradient(90deg, rgba(var(--primary-rgb),.055), transparent 88%); }
.sidebar .ng-icon { width:26px; height:26px; border-radius:8px; background:var(--surface); border:1px solid var(--border); box-shadow:0 1px 3px rgba(0,0,0,.04); }
.sidebar .ng-icon svg { width:15px; height:15px; }
.sidebar .nav-group.has-active .ng-icon, .sidebar .nav-group:not(.collapsed) > .nav-group-head .ng-icon { background:rgba(var(--primary-rgb),.09); border-color:rgba(var(--primary-rgb),.18); color:var(--primary); }
.sidebar .ng-caret { opacity:.6; }
/* 子项：虚线树形连接 */
.sidebar .nav-group-inner { margin-left:23px; padding-left:8px; border-left:1px dashed rgba(var(--primary-rgb),.26); }
.sidebar .nav-group-inner .nav-item.active::before { left:-10px; height:18px; }
/* 徽标：立体微阴影 */
.sidebar .nav-badge { box-shadow:0 2px 5px rgba(217,48,37,.26), inset 0 1px 0 rgba(255,255,255,.25); }
/* 滚动条精致化 */
.sidebar .side-nav::-webkit-scrollbar { width:5px; }
.sidebar .side-nav::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:4px; }
.sidebar .side-nav::-webkit-scrollbar-thumb:hover { background:var(--muted); }
.sidebar .side-nav::-webkit-scrollbar-track { background:transparent; }
/* 底部角色卡：轻微浮起 */
.sidebar .sidebar-bottom { padding:12px; background:linear-gradient(0deg, rgba(var(--primary-rgb),.025), transparent); }
.sidebar .role-card { border-radius:12px; box-shadow:0 2px 8px rgba(var(--primary-rgb),.06); }
/* 收起态兼容 */
.sidebar.collapsed .brand-logo { width:38px; height:38px; }
.sidebar.collapsed .ng-icon { width:18px; height:18px; border-radius:6px; }
.sidebar.collapsed .side-nav > .nav-item > svg { width:18px; height:18px; padding:3px; border-radius:6px; }
.sidebar.collapsed .nav-item.active::before, .sidebar.collapsed .nav-label::after { display:none; }
/* 移动端兼容 */
@media (max-width:900px) {
  .sidebar .nav-item { padding:10px 12px; }
  .sidebar .nav-group-head { padding:9px 12px; }
  .sidebar .nav-group-inner { margin-left:15px; padding-left:12px; }
}

/* ============ 财务全景 ============ */
#viewFinoverview .profit-toolbar { flex-wrap:wrap; gap:10px; padding:10px 12px; background:var(--surface); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); }
.fo-status { margin-left:4px; }
.fo-status-pill { display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:11px; font-size:11.5px; font-weight:600; color:var(--primary); background:rgba(var(--primary-rgb),.09); border:1px solid rgba(var(--primary-rgb),.16); }
.fo-status-pill.locked { color:var(--orange); background:var(--orange-soft); border-color:rgba(224,134,25,.24); }
.fo-hint { font-size:12px; color:var(--muted); }

/* 净额主视觉 */
.fo-hero { position:relative; display:grid; grid-template-columns:minmax(300px,1.05fr) minmax(340px,.95fr); gap:24px; margin-bottom:12px; padding:20px 24px; border-radius:16px; border:1px solid rgba(var(--primary-rgb),.18); background:linear-gradient(120deg, rgba(var(--primary-rgb),.13), rgba(13,148,136,.07) 58%, var(--surface) 100%); box-shadow:0 6px 20px rgba(var(--primary-rgb),.08); overflow:hidden; }
.fo-hero::before { content:''; position:absolute; width:180px; height:180px; border-radius:50%; right:-52px; top:-76px; background:rgba(var(--primary-rgb),.09); }
.fo-hero::after { content:''; position:absolute; width:120px; height:120px; border-radius:50%; left:-46px; bottom:-70px; background:rgba(13,148,136,.08); }
.fo-hero-main, .fo-hero-meter { position:relative; z-index:1; min-width:0; }
.fo-hero-eyebrow { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:600; color:var(--text-2); }
.fo-hero-eyebrow em { font-style:normal; font-size:10.5px; font-weight:500; color:var(--primary); padding:2px 7px; border-radius:8px; background:rgba(var(--primary-rgb),.1); }
.fo-hero-icon { width:24px; height:24px; display:grid; place-items:center; border-radius:8px; color:#fff; background:linear-gradient(135deg, var(--primary), rgba(var(--primary-rgb),.65)); font-size:11px; }
.fo-hero-label { margin-top:14px; font-size:12px; color:var(--muted); letter-spacing:.5px; }
.fo-hero-main > strong { display:block; margin-top:2px; font-size:38px; line-height:1.15; font-weight:750; letter-spacing:-1px; color:var(--green); }
.fo-hero-main > strong.negative { color:var(--orange); }
.fo-hero-formula { display:flex; align-items:center; gap:10px; margin-top:8px; font-size:11.5px; color:var(--text-2); }
.fo-hero-formula i { font-style:normal; color:var(--muted); }
.fo-hero-meter { align-self:center; padding:12px 14px; border-radius:12px; background:rgba(255,255,255,.48); border:1px solid rgba(var(--primary-rgb),.12); }
[data-theme="dark"] .fo-hero-meter { background:rgba(255,255,255,.03); }
.fo-meter-head { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--text-2); }
.fo-meter-head b { font-size:12.5px; color:var(--green); }
.fo-meter-head b.negative { color:var(--orange); }
.fo-meter-track { position:relative; height:10px; margin:12px 0 9px; border-radius:8px; background:var(--hover-bg); overflow:visible; }
.fo-meter-track i { display:block; height:100%; border-radius:8px; background:linear-gradient(90deg, rgba(224,134,25,.85), rgba(224,134,25,.35)); }
.fo-meter-track u { position:absolute; top:-4px; width:2px; height:18px; background:var(--primary); border-radius:2px; box-shadow:0 0 0 3px rgba(var(--primary-rgb),.12); }
.fo-meter-legend { display:flex; justify-content:space-between; gap:10px; font-size:11px; color:var(--muted); }
.fo-meter-legend i { display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; }
.fo-meter-legend i.in { background:var(--primary); }
.fo-meter-legend i.out { background:var(--orange); }
.fo-meter-foot { margin-top:9px; padding-top:8px; border-top:1px dashed var(--border); font-size:10.5px; color:var(--muted); }
.fo-hero-stamp { position:absolute; right:22px; bottom:16px; z-index:1; padding:3px 9px; border:2px solid rgba(var(--primary-rgb),.34); border-radius:6px; color:rgba(var(--primary-rgb),.55); font-size:10px; font-weight:800; letter-spacing:1.5px; transform:rotate(-8deg); }

/* 财务全景各模块之间留出呼吸间距 */
#viewFinoverview > .expense-panel + .expense-panel { margin-top:14px; }

/* KPI 卡组：收入 / 支出分组，每组三列一行 */
#finovStats { grid-template-columns:repeat(3, 1fr); gap:10px; margin-bottom:10px; }
.fo-kpi-group { grid-column:1 / -1; display:flex; align-items:center; gap:9px; padding:6px 11px; border-radius:8px; border-left:3px solid var(--green); background:linear-gradient(90deg, var(--green-soft), transparent 70%); }
.fo-group-mark { width:22px; height:22px; flex-shrink:0; display:grid; place-items:center; border-radius:6px; color:#fff; font-size:11px; font-weight:700; background:var(--green); }
.fo-kpi-group b { font-size:13px; font-weight:700; color:var(--green); }
.fo-kpi-group em { font-style:normal; font-size:10.5px; font-weight:600; letter-spacing:1px; color:var(--muted); }
.fo-group-line { flex:1; height:1px; background:linear-gradient(90deg, var(--green-soft), transparent); }
.fo-kpi-group.fo-group-orange { border-left-color:var(--orange); background:linear-gradient(90deg, var(--orange-soft), transparent 70%); }
.fo-kpi-group.fo-group-orange .fo-group-mark { background:var(--orange); }
.fo-kpi-group.fo-group-orange b { color:var(--orange); }
.fo-kpi-group.fo-group-orange .fo-group-line { background:linear-gradient(90deg, var(--orange-soft), transparent); }
[data-theme="dark"] .fo-kpi-group.fo-group-green .fo-group-mark { background:#2f9e63; }
[data-theme="dark"] .fo-kpi-group.fo-group-orange .fo-group-mark { background:#d88619; }
.fo-kpi { position:relative; min-width:0; display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:12px; border:1px solid var(--border); background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
.fo-kpi::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--primary); }
.fo-kpi::after { content:''; position:absolute; right:-18px; top:-18px; width:64px; height:64px; border-radius:50%; background:rgba(var(--primary-rgb),.08); }
.fo-kpi-mark { width:36px; height:36px; flex-shrink:0; display:grid; place-items:center; border-radius:10px; font-size:13px; font-weight:700; color:var(--primary); background:rgba(var(--primary-rgb),.1); }
.fo-kpi-body { position:relative; z-index:1; min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.fo-kpi-body > span { font-size:11.5px; color:var(--text-2); }
.fo-kpi-body strong { margin:2px 0; font-size:24px; font-weight:700; color:var(--text); letter-spacing:-.02em; }
.fo-kpi-body small { font-size:10.5px; color:var(--muted); }
.fo-kpi.green::before { background:var(--green); } .fo-kpi.green .fo-kpi-mark { color:var(--green); background:var(--green-soft); } .fo-kpi.green::after { background:var(--green-soft); }
.fo-kpi.teal::before { background:#0d9488; } .fo-kpi.teal .fo-kpi-mark { color:#0d9488; background:#e6faf7; } .fo-kpi.teal::after { background:#e6faf7; }
.fo-kpi.orange::before { background:var(--orange); } .fo-kpi.orange .fo-kpi-mark { color:var(--orange); background:var(--orange-soft); } .fo-kpi.orange::after { background:var(--orange-soft); }
[data-theme="dark"] .fo-kpi.teal .fo-kpi-mark { color:#5fd4c3; background:rgba(95,212,195,.12); }

.fo-note-strip { display:flex; flex-wrap:wrap; gap:8px 20px; margin:0 0 12px; padding:0 2px; font-size:11px; color:var(--muted); }
.fo-note-strip span { display:inline-flex; align-items:center; gap:6px; }
.fo-dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.fo-dot.platform { background:var(--primary); }
.fo-dot.custom { background:var(--green); }
.fo-dot.lock { background:var(--orange); }

/* 收支构成 */
.fo-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.fo-composition { padding:14px 18px 16px; }
.fo-flow { padding-top:4px; }
.fo-composition-box { display:flex; align-items:center; gap:20px; }
.fo-donut { position:relative; width:124px; height:124px; flex-shrink:0; display:grid; place-items:center; border-radius:50%; background:conic-gradient(var(--c1) 0 var(--p), var(--c2) var(--p) 100%); box-shadow:0 3px 12px rgba(0,0,0,.06); }
.fo-donut::before { content:''; position:absolute; inset:13px; border-radius:50%; background:var(--surface); box-shadow:inset 0 1px 4px rgba(0,0,0,.05); }
.fo-donut-center { position:relative; z-index:1; width:96px; max-width:96px; text-align:center; line-height:1.25; overflow:hidden; }
.fo-donut-center span { display:block; font-size:10.5px; color:var(--muted); }
.fo-donut-center strong { display:block; margin:2px 0; font-size:13px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; }
.fo-donut-center small { display:block; font-size:9px; color:var(--muted); }
.fo-legend { flex:1; min-width:0; display:grid; gap:12px; }
.fo-legend-row { display:grid; grid-template-columns:9px minmax(0,1fr) auto; align-items:center; gap:9px; }
.fo-legend-dot { width:9px; height:9px; border-radius:3px; }
.fo-legend-main { min-width:0; }
.fo-legend-main span { display:block; font-size:12px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fo-legend-main small { display:block; font-size:10px; color:var(--muted); }
.fo-legend-val { text-align:right; }
.fo-legend-val b { display:block; font-size:14px; color:var(--text); }
.fo-legend-val b.fo-negative { color:var(--orange); }
.fo-legend-val em { display:block; font-style:normal; font-size:10px; color:var(--muted); }
.fo-empty { padding:18px 12px; text-align:center; color:var(--muted); font-size:11.5px; }
#finovItems .fo-empty { margin:8px 10px 10px; border:1px dashed var(--border); border-radius:10px; background:var(--surface-2); }

/* 自定义收支项目汇总条 */
.fo-items-summary { display:flex; align-items:center; gap:8px 18px; padding:8px 14px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.fo-summary-chip { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--text-2); }
.fo-summary-chip i { width:7px; height:7px; border-radius:50%; background:var(--green); }
.fo-summary-chip b { font-size:12px; color:var(--text); }
.fo-summary-chip em { font-style:normal; font-weight:700; color:var(--green); font-variant-numeric:tabular-nums; }
.fo-summary-chip.out i { background:var(--orange); }
.fo-summary-chip.out em { color:var(--orange); }
.fo-summary-note { margin-left:auto; font-size:10.5px; color:var(--muted); }

/* 明细表 */
#finovItems:not(:empty) { padding:8px 10px 10px; }
.fo-scroll { max-height:260px; overflow:auto; }
.fo-mini { width:100%; border-collapse:separate; border-spacing:0; font-size:11.5px; }
.fo-mini th, .fo-mini td { padding:6px 9px; line-height:1.3; border-bottom:1px solid var(--border); text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fo-mini th { position:sticky; top:0; z-index:2; background:var(--surface-2); color:var(--primary); font-weight:600; box-shadow:inset 0 -1px 0 var(--border); }
.fo-mini th.num, .fo-mini td.num { text-align:right; font-variant-numeric:tabular-nums; }
.fo-mini tbody tr:nth-child(even) td { background:rgba(var(--primary-rgb),.025); }
.fo-mini tbody tr:hover td { background:var(--hover-bg); }
.fo-mini tbody tr:last-child td { border-bottom:0; }
.fo-items-table th:first-child, .fo-items-table td:first-child { width:72px; }
.fo-item-name { font-weight:600; color:var(--text); }
.fo-item-date, .fo-item-remark { color:var(--text-2); }
.fo-acts { display:inline-flex; gap:4px; }
.fo-dir { display:inline-flex; padding:2px 7px; border-radius:8px; font-size:10.5px; font-weight:600; }
.fo-dir.in { color:var(--green); background:var(--green-soft); }
.fo-dir.out { color:var(--orange); background:var(--orange-soft); }
.fo-in-amt { color:var(--green); font-weight:600; }
.fo-out-amt { color:var(--orange); font-weight:600; }
.fo-muted { color:var(--muted); }

/* 平台取数：双来源子卡片 */
.fo-source-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; align-items:stretch; }
#viewFinoverview .expense-panel > .fo-source-grid { padding:10px; }
.fo-source { min-width:0; display:flex; flex-direction:column; border:1px solid var(--border); border-radius:10px; background:var(--surface); overflow:hidden; }
.fo-source h4 { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0; padding:8px 11px; font-size:12px; color:var(--text); font-weight:600; background:rgba(var(--primary-rgb),.06); border-bottom:1px solid var(--border); }
.fo-source-cash h4 { border-left:3px solid var(--green); }
.fo-source-paid h4 { border-left:3px solid var(--orange); }
.fo-source-title { display:inline-flex; align-items:center; gap:8px; min-width:0; }
.fo-source-title i { width:20px; height:20px; flex-shrink:0; display:grid; place-items:center; border-radius:6px; font-style:normal; font-size:10px; font-weight:700; color:#fff; background:var(--green); }
.fo-source-paid .fo-source-title i { background:var(--orange); }
.fo-source-count { flex-shrink:0; font-style:normal; font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:9px; color:var(--primary); background:rgba(var(--primary-rgb),.09); }
.fo-source-body { flex:1; min-height:0; }
.fo-source-body .fo-scroll { max-height:230px; }
.fo-source-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:auto; padding:7px 12px; border-top:1px dashed var(--border); background:var(--surface-2); font-size:10.5px; color:var(--muted); }
.fo-source-foot b { font-size:13px; font-weight:700; color:var(--green); font-variant-numeric:tabular-nums; }
.fo-source-paid .fo-source-foot b { color:var(--orange); }
@media (max-width:1480px) {
  .fo-source-grid { grid-template-columns:1fr; }
}
@media (max-width:1400px) {
  .fo-summary-note { display:none; }
}
@media (max-width:1200px) {
  .fo-grid, .fo-source-grid, .fo-hero { grid-template-columns:1fr; }
  #finovStats { grid-template-columns:repeat(2, 1fr); }
}
@media (max-width:760px) {
  #finovStats { grid-template-columns:1fr; }
  .fo-items-summary { flex-wrap:wrap; gap:6px 12px; }
  .fo-composition-box { flex-direction:column; align-items:stretch; }
  .fo-donut { margin:0 auto; }
}

/* ==================== 移动端集中优化（2026-12-03） ==================== */
/* 说明：统一收敛手机端的壳层、统计卡、筛选栏、弹窗与高频视图排版。
   仅使用已有主题变量，不新增 :root 颜色定义；追加在末尾以安全覆盖历史分散断点。 */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  body { min-width: 0; }

  /* 顶栏：只保留当前模块名，避免面包屑逐字竖排 */
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .breadcrumb { flex: 1; min-width: 0; gap: 0; }
  .breadcrumb > span, .breadcrumb > svg { display: none; }
  .breadcrumb b { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
  .topbar-right { gap: 6px; flex: none; }
  .topbar .icon-btn, .refresh-btn, .theme-btn, .bell-btn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
  .user-caret { display: none; }
  .topbar-user { padding: 4px; }
  .topbar-user .avatar-sm { width: 34px; height: 34px; }

  /* 内容区 */
  .content { padding: 12px 10px 28px; }
  .page-heading, .page-head { gap: 6px; margin-bottom: 12px; }
  .page-heading h1, .page-head h1 { font-size: 20px; line-height: 1.3; }
  .page-heading p, .page-head p { font-size: 12px; line-height: 1.5; }

  /* 统计卡：四列紧凑网格；卡内标签与数字竖向排列，图标缩为角标，副标题在小屏隐藏 */
  .stats-grid, [id$="StatsGrid"], .monthly-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important; margin-bottom: 12px !important;
  }
  .stat-card {
    display: grid !important; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto; align-content: center;
    padding: 8px 9px !important; min-height: 58px; gap: 2px; border-radius: 10px;
  }
  .stat-card::after { display: none; }
  .stat-icon {
    position: absolute; top: 7px; right: 7px;
    width: 18px !important; height: 18px !important; flex-basis: 18px !important;
    border-radius: 6px; font-size: 11px !important; opacity: .8;
  }
  .stat-icon svg { width: 12px !important; height: 12px !important; }
  .stat-info { display: contents; }
  .stat-info span {
    grid-column: 1; grid-row: 1; font-size: 10.5px; line-height: 1.25;
    padding-right: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .stat-info strong {
    grid-column: 1; grid-row: 2; font-size: 17px !important; line-height: 1.2; margin: 0 !important;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .stat-info small { display: none; }
  /* 资金流水卡字段多：同样四列，隐藏提示语并压小字号 */
  #cashStatsGrid .cash-stat-card { padding: 7px 8px; border-radius: 10px; }
  #cashStatsGrid .cash-stat-top { gap: 3px; }
  #cashStatsGrid .cash-stat-icon { width: 14px; height: 14px; flex: 0 0 14px; font-size: 9px; }
  #cashStatsGrid .cash-stat-label { font-size: 9.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #cashStatsGrid .cash-stat-hint { display: none; }
  #cashStatsGrid .cash-stat-value { margin: 3px 0 4px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #cashStatsGrid .cash-stat-pill { font-size: 9px; padding: 2px 4px; white-space: normal; line-height: 1.25; }
  /* 月付明细统计：三张卡排一行，内部同样压缩，避免标签逐字换行 */
  .monthly-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
  .monthly-stat-card { padding: 7px 8px; min-height: 0; border-radius: 10px; }
  .monthly-stat-card .ms-top { gap: 3px; }
  .monthly-stat-card .ms-icon { width: 14px; height: 14px; font-size: 9px; }
  .monthly-stat-card .ms-label { font-size: 9.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .monthly-stat-card .ms-value { margin: 3px 0 4px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .monthly-stat-card .ms-foot { flex-wrap: wrap; gap: 2px; }
  .monthly-stat-card .ms-pill, .monthly-stat-card .ms-hint { font-size: 9px; padding: 2px 4px; }
  /* 创收看板是自定义流程卡，保留单列；财务全景 KPI 两列、分组标题整行 */
  #profitStatsGrid { grid-template-columns: 1fr !important; gap: 10px !important; }
  #finovStats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  #finovStats .fo-kpi-group { grid-column: 1 / -1; }
  #finovStats .fo-kpi { padding: 8px 10px; }
  #finovStats .fo-kpi-body strong { font-size: 17px !important; }
  #finovStats .fo-kpi-body small { display: none; }

  /* 标签栏：等宽铺满，不再把「待审批」挤成两行 */
  .status-tabs, .att-tabs {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    width: 100%; gap: 4px; padding: 4px; margin-bottom: 12px;
  }
  .status-tabs button, .att-tab {
    width: 100%; min-height: 32px; padding: 6px 4px; font-size: 11.5px;
    white-space: nowrap; text-align: center; justify-content: center;
  }

  /* 筛选工具栏：控件整行铺开，搜索框不再被固定宽度截断 */
  .att-toolbar, .emp-toolbar { padding: 10px !important; gap: 8px; }
  .att-toolbar-left, .att-toolbar-right { width: 100%; min-width: 0; gap: 8px; }
  .att-toolbar .input, .file-search-wrap, .emp-toolbar .input { flex: 1 1 100%; min-width: 0; width: 100% !important; max-width: 100%; }
  /* 日期区间保留「起 — 至 — 止」一行，不要被整行规则拆成三行 */
  .att-toolbar-left > input[type=date] { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
  .att-toolbar-left > .toolbar-sep { flex: 0 0 auto; }
  .file-search-wrap input { width: 100% !important; }
  #orderKeyword, #expenseKeyword, #financeKeyword, #settlementKeyword, #fileKeyword,
  #cashKeyword, #profitKeyword, #customerKeyword, #optplKeyword, #oplogKeyword,
  #noticeKeyword, #monthlyCustKeyword, #whGzKeyword, #whFsKeyword, #whRecordsKeyword {
    width: 100% !important; min-width: 0; max-width: 100%;
  }
  #monthlyDetailCustomer, #monthlyDetailMonth, #finovPeriod {
    width: 100% !important; min-width: 0 !important; max-width: 100%;
  }
  .exp-date-range { width: 100%; flex-wrap: nowrap; }
  .exp-date-range .input[type=date] { flex: 1 1 0; width: auto !important; min-width: 0; padding: 8px 6px; font-size: 13px; }
  .exp-date-range > span { font-size: 11px; flex: none; }
  .form-grid { grid-template-columns: 1fr !important; gap: 9px; }
  .form-grid > .field, .form-grid > label { grid-column: 1 / -1 !important; }
  .form-grid .input, .att-toolbar .input, .search-box input, .file-search-wrap input,
  #opcBody .opc-form-fields .opt-prev-field > .input {
    font-size: 14px; min-height: 34px; padding: 7px 10px;
  }
  .form-grid .field > label, .form-grid > label { font-size: 12px; margin-bottom: 3px; }
  .search-box { width: 100%; }
  .btn { min-height: 34px; font-size: 13px; }
  .att-toolbar .btn, .expense-panel .btn { min-height: 34px; }

  /* 弹窗 / 二级层：改成底部抽屉，压缩内边距并避开刘海安全区 */
  .modal-overlay, .second-layer { padding: 0; align-items: flex-end; }
  .modal[style] { max-width: 100% !important; width: 100%; max-height: 90vh; max-height: 94dvh; border-radius: 16px 16px 0 0; }
  .modal-header { padding: 12px 14px 10px; }
  .modal-body { padding: 10px 14px; -webkit-overflow-scrolling: touch; }
  .modal-footer { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 8px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; min-height: 34px; }
  .second-panel { width: 100% !important; max-width: 100% !important; max-height: 88vh; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .second-body { -webkit-overflow-scrolling: touch; }

  /* 表格：统一横向滚动，长文本允许换行 */
  .table-wrap, .set-recon-scroll, .opc-recon-scroll, .fo-scroll, .cash-detail-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .company-value-cell, .oplog-detail { max-width: 100% !important; white-space: normal !important; }
  .home-ranking .home-card-title h2, .hr-name, .hr-count, .hr-rest-label, .hr-rest-count { white-space: normal !important; }
  .msd-table { table-layout: auto !important; font-size: 11px; }
  .msd-table th, .msd-table td { padding: 5px 6px; white-space: normal; }
  .msd-table .msd-total { font-size: 13px; white-space: normal !important; }
  .fo-mini th, .fo-mini td { white-space: normal; }

  /* 文件中心：文件行改为「信息一行 + 操作一行」 */
  .file-row { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .fr-icon { width: 40px; height: 46px; }
  .fr-main { flex: 1 1 calc(100% - 52px); }
  .fr-actions { width: 100%; justify-content: flex-end; gap: 6px; margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--border); }
  .fr-actions .icon-btn { width: 38px; height: 38px; }
  .fr-actions .icon-btn svg { width: 17px; height: 17px; }

  /* 应收应付：抬头金额与对象卡压缩留白，明细表保持横向滚动 */
  #settlementList { padding: 8px 10px; }
  #settlementList .set-doc-top { padding: 7px 10px; }
  #settlementList .set-doc-amount { min-width: 0; }
  #settlementList .exp-amount-main { font-size: 16px; }
  #settlementList .set-recon-table { min-width: 640px; }

  /* 资金流水账本卡：存根收窄，内容优先 */
  .cash-ledger .cl-stub { flex-basis: 52px; padding: 10px 4px; }
  .cl-lines { grid-template-columns: 1fr !important; }

  /* 操作台：标签横滑、字段单列、输入触控友好 */
  #opcBody .opc-forms { padding: 10px; }
  #opcBody .opc-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #opcBody .opc-tab { flex: 0 0 auto; }
  #opcBody .opc-form-fields { grid-template-columns: minmax(0, 1fr) !important; row-gap: 10px; }
  #opcBody .opc-form-fields > .opt-prev-field { grid-column: 1 / -1 !important; padding-right: 0; }
  #opcBody .opc-form-fields .opt-prev-field > .input { font-size: 14px; padding: 7px 10px; min-height: 34px; }
  #opcBody .opc-identity { flex-direction: column; align-items: stretch; gap: 8px; }
  #opcBody .opc-id-note { margin-left: 0; }
  #opcBody .opc-fi-grid { grid-template-columns: 1fr !important; }
  #opcBody .opc-recon-base, #opcBody .opc-recon-sum, #opcBody .opc-recon-tools { flex-wrap: wrap; }
  #opcBody .opc-recon-sum { justify-content: flex-start; gap: 10px; }
  #opcBody .opc-recon-table { min-width: 760px; }

  /* 角色权限：头部控件整行，底部按钮等宽 */
  .perm-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .perm-head-right { width: 100%; justify-content: space-between; }
  .perm-foot .btn { min-width: 0; flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .stats-grid, [id$="StatsGrid"], .monthly-stat-grid { gap: 6px !important; }
  .stat-card { padding: 7px 8px !important; min-height: 54px; }
  .stat-icon { top: 6px; right: 6px; width: 16px !important; height: 16px !important; flex-basis: 16px !important; font-size: 10px !important; }
  .stat-icon svg { width: 11px !important; height: 11px !important; }
  .stat-info span { font-size: 10px; padding-right: 16px; }
  .stat-info strong { font-size: 15px !important; }
  #cashStatsGrid .cash-stat-value { font-size: 14px; }
  .topbar .icon-btn, .refresh-btn, .theme-btn, .bell-btn { width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
  .status-tabs button, .att-tab { min-height: 30px; padding: 5px 3px; font-size: 11px; }
}

