:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --bg: #f4f6fb;
  --card: #ffffff;
  --soft: #eff6ff;
  --text: #1f2937;
  --heading: #1f2a44;
  --muted: #8a94a6;
  --border: #e6e9f0;
  --radius: 8px;
  --radius-card: 12px;
  --shadow: 0 1px 3px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; background: #fff; color: var(--text); font-family: inherit;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-outline { border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 6px; font-family: inherit; }
.link-btn:hover { background: var(--soft); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: #fdecec; }

/* ===== 布局：左侧竖排导航 ===== */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #4f83ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}
.side-logo h1 { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--heading); }
.side-logo .sub { font-size: 12px; color: var(--muted); }
.side-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
/* 侧边栏折叠切换按钮 */
.side-toggle {
  margin-left: auto; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.side-toggle:hover { background: var(--soft); color: var(--primary); border-color: var(--soft); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius);
  color: var(--muted); font-weight: 500; cursor: pointer;
  border: none; background: none; font-size: 14px; font-family: inherit; text-align: left;
  transition: all .15s;
}
.nav-item:hover { background: #f2f5fa; color: var(--text); }
.nav-item.active { background: var(--soft); color: var(--primary); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.op-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--soft); color: #1e3a8a; border-radius: var(--radius);
  padding: 8px 12px; font-weight: 600; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.op-chip .avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.side-logout {
  border: none; background: none; color: var(--muted); font-size: 13px;
  cursor: pointer; padding: 6px 8px; border-radius: 6px; text-align: left; font-family: inherit;
}
.side-logout:hover { color: var(--red); background: #fdecec; }
.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; padding: 8px 6px; font-size: 13px; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 2px 8px; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa4b2; flex-shrink: 0; }
.conn.on { color: var(--green); }
.conn.on .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.conn.off .dot { background: var(--red); }

/* ===== 侧边栏折叠态（仅桌面端 ≥901px；窄屏横排布局不受影响） ===== */
@media (min-width: 901px) {
  .sidebar.collapsed { width: 64px; }
  .sidebar.collapsed .side-logo { flex-direction: column; gap: 8px; padding: 12px 8px 8px; }
  .sidebar.collapsed .side-logo-txt { display: none; }
  .sidebar.collapsed .side-toggle { margin-left: 0; }
  .sidebar.collapsed .side-nav { padding: 8px; align-items: stretch; }
  .sidebar.collapsed .nav-item { justify-content: center; gap: 0; padding: 11px 0; position: relative; }
  .sidebar.collapsed .nav-txt { display: none; }
  .sidebar.collapsed .nav-badge { position: absolute; top: 2px; right: 4px; margin-left: 0; }
  .sidebar.collapsed .side-foot { padding: 12px 8px; align-items: center; }
  .sidebar.collapsed .conn { padding: 2px 0; justify-content: center; }
  .sidebar.collapsed #connText { display: none; }
  .sidebar.collapsed .side-actions { flex-direction: column; width: 100%; }
  .sidebar.collapsed .side-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0; padding: 8px 0; }
  .sidebar.collapsed .side-actions .btn-txt { display: none; }
  .sidebar.collapsed .leader-chip { display: none; }
  /* 员工端 side-foot 专属：操作人 chip 只留头像、退出按钮只留图标 */
  .sidebar.collapsed .op-chip { flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; justify-content: center; }
  .sidebar.collapsed .op-chip .op-name,
  .sidebar.collapsed .op-chip .op-grp,
  .sidebar.collapsed .op-chip .op-level { display: none; }
  .sidebar.collapsed .side-logout { display: inline-flex; align-items: center; justify-content: center; gap: 0; width: 100%; padding: 8px 0; font-size: 0; }
  .sidebar.collapsed .side-logout .btn-txt { display: none; }
}

/* 主内容区：跟随窗口自适应，宽屏铺满（不再限制 1280px 导致右侧留白） */
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 20px; font-weight: 600; color: var(--heading); }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== 登录/注册 卡片 ===== */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(16,24,40,.08); padding: 32px 28px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand h1 { font-size: 18px; font-weight: 700; }
.auth-brand .sub { font-size: 12px; color: var(--muted); }
.auth-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.auth-tab {
  background: none; border: none; padding: 4px 2px 12px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; font-family: inherit;
}
.auth-tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.auth-panel { display: none; flex-direction: column; gap: 16px; }
.auth-panel.on { display: flex; }
.auth-hint { font-size: 12px; color: var(--muted); }

/* ===== 表单 ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.form-card { padding: 26px 24px; max-width: 560px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 13px; color: #374151; }
.req { color: var(--red); }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 13px; font-size: 14px; font-family: inherit; color: var(--text);
  background: #fbfcfe; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field textarea { resize: vertical; min-height: 90px; }
.field select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 34px 11px 13px; font-size: 14px; font-family: inherit; color: var(--text);
  background: #fbfcfe; transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.field select:focus {
  outline: none; border-color: var(--primary); background-color: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
/* 多选字段：选项块一排可点选多个，选中高亮 */
.msel { display: flex; flex-wrap: wrap; gap: 8px; }
.msel-opt {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: #fbfcfe; cursor: pointer; font-size: 13px; font-family: inherit; color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.msel-opt:hover { border-color: var(--primary); color: var(--primary); }
.msel-opt.on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
/* 员工端：逐行填写块（☐ 选项 + 每项各自的输入框，勾选或填值即为投保） */
.msel-block { display: block; }
.msel-hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; line-height: 1.6; }
.msel-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fbfcfe; transition: border-color .15s, background .15s;
}
.msel-row.on { border-color: var(--primary); background: #f2f7ff; }
.msel-chk { display: inline-flex; align-items: center; gap: 8px; min-width: 104px; font-size: 14px; color: var(--text); cursor: pointer; margin: 0; }
.msel-chk input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.msel-num {
  flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13px; background: #fff; font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.msel-num:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 11px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: #fbfcfe; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: all .15s; font-family: inherit;
}
.seg-btn.active[data-v="1"] { background: var(--green); border-color: var(--green); color: #fff; }
.seg-btn.active[data-v="0"] { background: #9aa4b2; border-color: #9aa4b2; color: #fff; }

/* ===== 统计卡片 ===== */
/* 有几张卡就均分几份（可选字段隐藏后自动铺满整行，不留空列） */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
/* 顶部一行：统计卡 + 按险种单量（窄屏自动换行） */
.top-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px; margin-bottom: 14px; }
.top-row .stats-grid { display: flex; flex: 1 1 280px; gap: 14px; margin-bottom: 0; min-width: 0; }
.top-row .stat-card { flex: 1 1 128px; min-width: 118px; }
/* 右侧竖排两行的总客户数卡：窄一点也要让两组计数有位置 */
.top-row .stat-card.st-with-split { flex: 1 1 168px; min-width: 152px; }
.top-row .dash-plan-card { flex: 1.4 1 360px; min-width: 300px; }
.top-row .dash-time-card { flex: 1.6 1 420px; min-width: 320px; margin-bottom: 0; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: 13px; color: var(--muted); }
.stat-card .stat-num { font-size: 30px; font-weight: 600; margin-top: 6px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
/* 总客户数卡内：百万医疗 / 其它 移到卡片右侧竖排两行（左列数字，右列两组计数） */
.stat-card.st-with-split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stat-card .stat-main { min-width: 0; }
.stat-card .stat-split { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.stat-card .stat-split.hidden { display: none; }
.stat-card .sp { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: help; white-space: nowrap; }
.stat-card .sp i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.stat-card .sp b { font-size: 14px; font-weight: 800; color: var(--text); }
.stat-card.hl { background: linear-gradient(135deg, #2563eb, #4f83ff); color: #fff; border-color: transparent; }
.stat-card.hl .stat-label, .stat-card.hl .stat-sub { color: rgba(255,255,255,.85); }
.bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: #fff; border-radius: 3px; transition: width .3s; }

/* ===== 筛选栏 ===== */
.filter-bar { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 18px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; }
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-group .glabel { font-size: 13px; color: var(--muted); margin-right: 2px; }
/* 下拉菜单式筛选 */
.fmenu { position: relative; }
.fmenu-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fbfcfe; padding: 7px 12px; cursor: pointer;
  font-size: 13px; color: var(--text); font-family: inherit; line-height: 1;
  transition: border-color .15s, box-shadow .15s, background .15s; white-space: nowrap;
}
.fmenu-btn:hover { border-color: #c9d4e5; background: #fff; }
.fmenu-btn .mlabel { color: var(--muted); font-weight: 500; }
.fmenu-btn .mval { font-weight: 700; }
.fmenu-btn .mchev { color: #9aa4b2; display: inline-flex; transition: transform .18s; }
.fmenu-btn.has { border-color: #b9cffb; background: #eef3ff; }
.fmenu-btn.has .mval { color: var(--primary); }
.fmenu.open .fmenu-btn { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.fmenu.open .fmenu-btn .mchev { transform: rotate(180deg); }
.fmenu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 150px; z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16,24,40,.14), 0 2px 8px rgba(16,24,40,.06);
  padding: 6px; display: none;
}
.fmenu.open .fmenu-pop { display: block; animation: popIn .16s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.fitem {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; border: none; background: none; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; color: #374151; cursor: pointer;
  font-family: inherit; text-align: left; transition: background .12s;
}
.fitem:hover { background: #f2f5fa; }
.fitem.on { color: var(--primary); background: var(--soft); font-weight: 700; }
.fitem .cnt { font-size: 12px; color: #9aa4b2; font-weight: 400; }
.fitem.on .cnt { color: var(--primary); opacity: .65; }
.filter-select { border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font-size: 13px; background: #fbfcfe; cursor: pointer; font-family: inherit; color: var(--text); max-width: 160px; }
/* 险种筛选标记（点险种行后出现在筛选栏，可一键清除） */
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #b9cffb; border-radius: 10px; background: #eef3ff; color: var(--primary);
  padding: 7px 10px; font-size: 13px; font-family: inherit; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.fchip:hover { background: #e3ecff; border-color: var(--primary); }
.fchip.hidden { display: none; }
.fchip .fchip-lab { color: var(--muted); font-weight: 500; }
.fchip .fchip-val { font-weight: 700; }
.search-input { flex: 1; min-width: 170px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; background: #fbfcfe; font-family: inherit; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ===== 搜索框（筛选栏内） ===== */
.search-box {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fbfcfe; padding: 7px 10px; min-width: 220px; flex: 1 1 220px;
  color: var(--muted); transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-box svg { flex: none; }
.search-box input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 13px; font-family: inherit; color: var(--text); }
.search-box .search-x {
  border: none; background: #e8ebf0; color: #6b7280; width: 18px; height: 18px; border-radius: 50%;
  font-size: 13px; line-height: 1; cursor: pointer; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.search-box .search-x:hover { background: #d7dbe2; color: var(--text); }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ===== 仪表盘报表（只统计单量） ===== */
.dash-card { padding: 16px 18px; }
.dash-time-card { margin-bottom: 14px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-title { font-size: 14px; font-weight: 700; }
.dash-sub { font-size: 12px; color: var(--muted); }
.dash-empty { text-align: center; color: #9ca3af; font-size: 13px; padding: 34px 0; }

/* 按险种单量：名 / 横条 / 单量 / 占比（+ 平均年化保费，仅配置了绑定字段时出现） */
.dash-plan { display: flex; flex-direction: column; gap: 6px; max-height: 268px; overflow-y: auto; }
.dplan-row {
  display: grid; grid-template-columns: 88px minmax(24px, 1fr) 52px 42px; align-items: center; gap: 10px;
  border: 1px solid transparent; background: none; border-radius: 8px;
  padding: 6px 8px; cursor: pointer; font-family: inherit; text-align: left;
  transition: background .12s, border-color .12s;
}
.dplan-row:hover { background: #f6f9ff; }
.dplan-row.on { background: var(--soft); border-color: #b9cffb; }
.dplan-row.static { cursor: default; }
.dplan-row.static:hover { background: none; }
/* 「其它」聚合行：灰底 + 灰条，跟上面的明细行区分开 */
.dplan-row.agg { background: #f6f7f9; margin-top: 2px; }
.dplan-row.agg:hover { background: #eef2f9; }
.dplan-row.agg.on { background: var(--soft); border-color: #b9cffb; }
.dplan-row.agg .dplan-name { color: #4b5563; }
.dplan-row.agg .dplan-bar > i { background: #94a3b8; }
.dplan-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dplan-bar { height: 8px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.dplan-bar > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.dplan-num { font-size: 13px; font-weight: 700; color: var(--text); text-align: right; white-space: nowrap; }
.dplan-pct { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
/* 平均年化保费列（险种卡） */
.dash-plan.has-avg .dplan-row { grid-template-columns: 80px minmax(20px, 1fr) 46px 36px 82px; gap: 8px; }
.dplan-avg {
  font-size: 12.5px; font-weight: 700; color: var(--text); text-align: right;
  white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.2px;
}
.dplan-avg i { font-style: normal; font-size: 10px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.dplan-avg.none { color: #c2c8d2; font-weight: 400; }

/* 险种卡整卡热区：点行筛选 / 点行外空白取消选择 */
.dash-head-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash-clear {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  border: 1px solid #b9cffb; background: var(--soft); color: var(--primary);
  font-size: 11.5px; font-weight: 600; font-family: inherit; line-height: 1;
  padding: 4px 9px; border-radius: 999px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.dash-clear:hover { background: #e2ecff; border-color: #9cbbf8; }
.dash-plan-card.plan-on { border-color: #b9cffb; box-shadow: 0 0 0 3px rgba(37,99,235,.07), var(--shadow); }

/* 按时间单量：纯 CSS 柱状图 */
.dash-tabs { display: inline-flex; gap: 4px; background: #f2f4f8; border-radius: 8px; padding: 3px; }
.dash-tab {
  border: none; background: none; padding: 5px 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit;
}
.dash-tab.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.dash-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 200px; padding-top: 4px; }
.dchart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.dchart-val { height: 16px; line-height: 16px; font-size: 11.5px; font-weight: 700; color: var(--text); }
.dchart-track { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; background: #f2f4f8; border-radius: 6px 6px 0 0; overflow: hidden; }
.dchart-track > i { display: block; width: 100%; background: linear-gradient(180deg, #4f83ff, #2563eb); border-radius: 6px 6px 0 0; transition: height .3s; }
/* 按险种堆叠分色：column-reverse → DOM 里第一个险种画在最底层，各柱顺序一致 */
.dchart-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; }
.dseg { display: block; width: 100%; border: none; padding: 0; cursor: pointer; transition: opacity .15s, filter .15s; }
.dseg + .dseg { box-shadow: inset 0 -1px 0 rgba(255,255,255,.6); }
.dseg:hover { filter: brightness(1.08); }
.dseg.dim { opacity: .2; }
.dchart-col.dim { opacity: .32; }
.dchart-lab { margin-top: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
/* 管理端「按员工单量」：柱数随员工数变化，标签过长时省略，避免挤出容器 */
#repTime .dchart-lab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* 柱子按人数均分但不过分拉伸：人少时居中成组，人多时自动收窄 */
#repTime { justify-content: center; gap: 16px; }
#repTime .dchart-col { flex: 0 1 78px; }
#repTime .dchart-track { max-width: 72px; }
/* 图例：颜色 → 险种对照（可点击筛选） */
.dchart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.dchart-legend:empty { display: none; }
.dleg {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fbfcfe; border-radius: 999px;
  padding: 4px 10px; font-size: 12.5px; font-family: inherit; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dleg:hover { border-color: #c9d4e5; background: #fff; }
.dleg.on { border-color: #b9cffb; background: var(--soft); color: var(--primary); font-weight: 700; }
.dleg > i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dleg .dleg-n { color: var(--muted); font-weight: 400; }
.dleg.on .dleg-n { color: var(--primary); opacity: .7; }
.dleg-hint { font-size: 12.5px; color: var(--muted); }
/* 单独一行的时间单量：加高、加宽柱子，撑满整行 */
.dash-chart-wide { height: 216px; }
.dash-chart-wide .dchart-track { max-width: 64px; }
.dash-chart-wide .dchart-lab { font-size: 11.5px; }

/* ===== 数据报表：员工 × 时间 对比矩阵（管理端） ===== */
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rep-title { font-size: 15px; font-weight: 700; }
.rep-card { padding: 16px 18px; margin-bottom: 14px; }
.rep-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
/* 报表自定义时间区间 */
.rep-custom { background: #f8fafd; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; margin: 0 0 14px; }
.rep-custom[hidden] { display: none; }
.rc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-lab { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rc-date { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; font-size: 13px; background: #fff; color: var(--text); font-family: inherit; }
.rc-date:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.rc-sep { color: var(--muted); font-size: 13px; }
.rc-btn { padding: 7px 14px; font-size: 13px; }
.rc-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rc-chip { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.rc-chip:hover { border-color: var(--primary); color: var(--primary); }
.rc-chip.on { background: var(--soft); border-color: #b9cffb; color: var(--primary); font-weight: 600; }
.rc-hint { margin-left: auto; font-size: 12px; color: var(--muted); }
.rep-scroll { overflow-x: auto; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table thead th {
  padding: 8px 10px; text-align: center; white-space: nowrap;
  background: #f8fafd; color: var(--muted); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.rep-table thead th.lft { text-align: left; }
.rep-table tbody td { padding: 7px 10px; text-align: center; white-space: nowrap; border-bottom: 1px solid #f0f2f7; font-variant-numeric: tabular-nums; }
.rep-table tbody td.lft { text-align: left; font-weight: 600; }
.rep-table tbody tr { cursor: pointer; }
.rep-table tbody tr:hover { background: #f8fafd; }
.rep-table tbody tr.on td { background: var(--soft); }
.rep-table tbody tr.total { cursor: default; font-weight: 700; background: #f8fafd; }
.rep-table tbody tr.total:hover { background: #f8fafd; }
.rep-table tbody tr:last-child td { border-bottom: none; }
.rep-name { display: inline-flex; align-items: center; gap: 7px; }
.rep-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.rep-zero { color: #ccd2dd; }
.rep-sum { font-weight: 700; }
.rep-pct { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ===== 表格 ===== */
.table-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 12px 14px; background: #f8fafd; color: var(--muted);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--primary); }
thead th.sorted-asc::after { content: " ▲"; color: var(--primary); font-size: 11px; }
thead th.sorted-desc::after { content: " ▼"; color: var(--primary); font-size: 11px; }
tbody td { padding: 11px 14px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafd; }
td.note-cell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #374151; }
td.time-cell { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
td.ip-cell { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }

/* ===== 客户记录：表格高度上限（超过 30 行出垂直滚动条，表头吸顶） + 分页栏 ===== */
/* 上限的精确值由 JS 量出真实行高后写 inline style；这里是视图隐藏时/量不到时的兜底估算值 */
.table-cap { overflow: auto; max-height: calc(45px + 43px * 30 + 2px); }
.table-cap thead th { position: sticky; top: 0; z-index: 3; }
.table-cap::-webkit-scrollbar { width: 10px; height: 10px; }
.table-cap::-webkit-scrollbar-thumb { background: #d3d9e3; border-radius: 6px; border: 2px solid #fff; }
.table-cap::-webkit-scrollbar-thumb:hover { background: #bcc5d3; }
.table-cap::-webkit-scrollbar-track { background: #fff; }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 14px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--border); background: #fcfdff;
}
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-info b { color: var(--text); font-weight: 600; }
.pager-ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-btn {
  border: 1px solid var(--border); background: #fff; color: #4b5563;
  font-size: 12.5px; padding: 5px 11px; border-radius: 8px; cursor: pointer;
  font-family: inherit; transition: border-color .12s, color .12s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-btn:disabled { opacity: .42; cursor: not-allowed; }
.pg-nums { display: flex; align-items: center; gap: 4px; }
.pg-num {
  min-width: 29px; height: 28px; padding: 0 7px; border: 1px solid var(--border);
  background: #fff; border-radius: 8px; font-size: 12.5px; color: #4b5563;
  cursor: pointer; font-family: inherit; transition: border-color .12s, color .12s, background .12s;
}
.pg-num:hover { border-color: var(--primary); color: var(--primary); }
.pg-num.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pg-dot { color: #b6bdc9; font-size: 12.5px; padding: 0 1px; }
.pg-size, .pg-jump { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.pg-size select, .pg-jump input {
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 7px;
  font-size: 12.5px; background: #fff; font-family: inherit; color: #374151;
}
.pg-jump input { width: 46px; text-align: center; }
.pg-size select:focus, .pg-jump input:focus { outline: none; border-color: var(--primary); }
@media (max-width: 720px) {
  .pager { justify-content: center; }
  .pager-info { width: 100%; text-align: center; }
}

/* ===== 标签/徽章 ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-yes { background: #e8f7ee; color: var(--green); }
.badge-no { background: #f1f2f4; color: var(--muted); }
.newb { background: var(--primary); color: #fff; border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.status-select { border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; font-size: 13px; cursor: pointer; background: #fff; font-family: inherit; }
.status-select.st-wait { color: var(--amber); border-color: #f0d9a8; background: #fdf8ee; }
.status-select.st-contact { color: var(--primary); border-color: #c6d6ff; background: #eef3ff; }
.status-select.st-done { color: var(--green); border-color: #bfe6cb; background: #ecf9f1; }
.status-select.st-giveup { color: var(--muted); border-color: var(--border); background: #f6f7f9; }
.status-tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-tag.st-wait { background: #fdf8ee; color: var(--amber); }
.status-tag.st-contact { background: #eef3ff; color: var(--primary); }
.status-tag.st-done { background: #ecf9f1; color: var(--green); }
.status-tag.st-giveup { background: #f6f7f9; color: var(--muted); }
.status-tag.st-early { background: #f4f1fb; color: #7b5cd6; }
/* 员工在线状态点 */
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c6ccd6; margin-right: 6px; vertical-align: 1px; }
.online-dot.on { background: #16a34a; box-shadow: 0 0 4px rgba(22, 163, 74, .5); }
/* 导出按钮 */
.export-btn { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
/* 新增行（字段编辑器复用） */
.st-add-row input, .fld-row input[type="text"], .fld-row select {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px;
  font-size: 13px; background: #fbfcfe; font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.st-add-row input:focus, .fld-row input[type="text"]:focus, .fld-row select:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.st-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.st-add-row input { flex: 1; margin: 0; }
/* 表单字段管理行（管理端自定义员工端收集的信息） */
.fld-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.fld-row .fld-label { flex: 1.1; min-width: 88px; }
.fld-row .fld-type {
  width: 100px; flex-shrink: 0; cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.fld-row .fld-opts { flex: 1.2; min-width: 120px; }
.fld-req { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; margin: 0; }
.fld-req input { width: auto; margin: 0; accent-color: var(--primary); }
.fld-row .link-btn { flex-shrink: 0; }
.fld-acts { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
/* 字段编辑器：「每项一行」/「随…逐行填」标记 */
.fld-flag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer; white-space: nowrap; margin: 0;
  padding: 5px 9px; border: 1px dashed var(--border); border-radius: var(--radius); background: #fbfcfe;
}
.fld-flag input { width: auto; margin: 0; accent-color: var(--primary); cursor: pointer; }
/* 同一次提交拆出的多行 = 一个批次：同批同色，相邻批次自动换色（3 色循环），
   批次首行加重竖条 + 上边虚线，一眼分清「哪几行是一批、批与批从哪分开」 */
tr.row-batch.bc0 td { background: #eef4ff; }
tr.row-batch.bc1 td { background: #f4f0fe; }
tr.row-batch.bc2 td { background: #edf9f3; }
tr.row-batch.bc0 td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
tr.row-batch.bc1 td:first-child { box-shadow: inset 3px 0 0 #7c3aed; }
tr.row-batch.bc2 td:first-child { box-shadow: inset 3px 0 0 #0f9d76; }
/* 批次起始行：竖条加粗到 5px（像分组括号的起点），并用虚线把它与上一批分开 */
tr.row-batch.b-start td { border-top: 1px dashed #cbd5e1; }
tr.row-batch.bc0.b-start td:first-child { box-shadow: inset 5px 0 0 #1d4ed8; }
tr.row-batch.bc1.b-start td:first-child { box-shadow: inset 5px 0 0 #6d28d9; }
tr.row-batch.bc2.b-start td:first-child { box-shadow: inset 5px 0 0 #0b7f61; }
tr.row-batch.bc0:hover td { background: #e3ecff; }
tr.row-batch.bc1:hover td { background: #ece5fc; }
tr.row-batch.bc2:hover td { background: #e1f5ec; }
/* 员工端：意向徽章可点切换 */
.badge-toggle { cursor: pointer; border: none; font-family: inherit; padding: 3px 10px; }
.badge-toggle:hover { filter: brightness(.92); }

@keyframes rowFlash { 0% { background: #eaf1ff; } 100% { background: transparent; } }
tr.row-new td { animation: rowFlash 2.2s ease-out; }

/* ===== 弹窗 ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: center;
  justify-content: center; padding: 20px; z-index: 100;
}
.modal { background: var(--card); border-radius: 16px; padding: 28px; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal h2 { font-size: 18px; font-weight: 600; color: var(--heading); margin-bottom: 4px; }
.modal .m-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.modal .err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.modal .field { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; margin-top: 6px; }
.modal .actions .btn { flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: #1f2937; color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* ===== 待办提醒 ===== */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  display: none; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-badge.show { display: inline-flex; }
.todo-form { padding: 16px 18px; margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.todo-form input {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 13px; font-size: 14px; font-family: inherit; color: var(--text);
  background: #fbfcfe; transition: border-color .15s, box-shadow .15s;
}
.todo-form input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.todo-form .tf-content { flex: 1; min-width: 220px; }
.todo-form .tf-time { width: 200px; flex-shrink: 0; }
.todo-form .btn { flex-shrink: 0; }

/* ===== 右下角提醒气泡 ===== */
.bubble-wrap {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: flex; flex-direction: column-reverse; gap: 10px;
  pointer-events: none; max-width: 340px;
}
.bubble {
  pointer-events: auto; position: relative;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 12px; padding: 14px 40px 13px 16px; width: 320px; max-width: 90vw;
  box-shadow: 0 14px 44px rgba(16,24,40,.18), 0 3px 10px rgba(16,24,40,.07);
  animation: bubbleIn .3s cubic-bezier(.21,1.02,.73,1);
}
@keyframes bubbleIn { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
.bubble.bubble-out { animation: bubbleOut .22s ease-in forwards; }
@keyframes bubbleOut { to { opacity: 0; transform: translateX(30px) scale(.96); } }
.bubble .b-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.bubble .b-head svg { flex-shrink: 0; }
.bubble .b-time { color: var(--muted); font-weight: 500; margin-left: 2px; }
.bubble .b-content { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; word-break: break-word; margin-bottom: 11px; }
.bubble .b-actions { display: flex; gap: 8px; }
.bubble .b-actions .btn { flex: 1; padding: 7px 8px; font-size: 12.5px; }
.bubble .b-close {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: #9aa4b2; cursor: pointer;
  border-radius: 6px; transition: color .12s, background .12s;
}
.bubble .b-close:hover { color: var(--text); background: #f2f5fa; }
/* 气泡超时变色：5分钟琥珀 / 15分钟橙红 / 30分钟红色 */
.bubble .b-over { margin-left: auto; font-weight: 700; font-size: 11.5px; color: var(--muted); }
.bubble.ov5 { border-left-color: #d97706; }
.bubble.ov5 .b-head, .bubble.ov5 .b-over { color: #d97706; }
.bubble.ov15 { border-left-color: #ea580c; }
.bubble.ov15 .b-head, .bubble.ov15 .b-over { color: #ea580c; }
.bubble.ov30 { border-left-color: #dc2626; }
.bubble.ov30 .b-head, .bubble.ov30 .b-over { color: #dc2626; }
.bubble.ov30 .b-content { color: #991b1b; }

.hidden { display: none !important; }

/* ===== 响应式 ===== */
@media (max-width: 820px) {
  .top-row { flex-direction: column; }
  .top-row .dash-plan-card { min-width: 0; }
}
/* 宽屏（≥1600 / ≥2100）：铺满后给内容更多留白，柱子相应加宽，避免"针尖插在大空地里" */
@media (min-width: 1600px) {
  .main { padding: 30px 40px 70px; }
  .dash-chart { gap: 10px; }
  .dash-chart-wide .dchart-track { max-width: 88px; }
}
@media (min-width: 2100px) {
  .main { padding: 32px 56px 80px; }
  .dash-chart { gap: 14px; }
  .dash-chart-wide .dchart-track { max-width: 104px; }
  .stats-grid { gap: 18px; }
  .top-row { gap: 18px; }
}
.cfg-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text); }
/* ===== 消息与资料 ===== */
.share-grid { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(380px, 7fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .share-grid { grid-template-columns: 1fr; } }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-card);
  padding: 26px 18px; text-align: center; color: var(--muted);
  cursor: pointer; transition: all .15s; background: #fafbfd;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--primary); background: var(--soft); color: var(--primary); }
.drop-zone .dz-icon { font-size: 28px; margin-bottom: 6px; }
.drop-zone .dz-hint { font-size: 12px; margin-top: 4px; color: var(--muted); }
.up-progress { height: 6px; background: var(--border); border-radius: 3px; margin-top: 12px; overflow: hidden; display: none; }
.up-progress.show { display: block; }
.up-progress i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }

.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: none; }
.file-ico {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; color: #fff; background: var(--muted);
}
.fi-pdf { background: #dc2626; }
.fi-ppt, .fi-pptx { background: #d97706; }
.fi-xls, .fi-xlsx { background: #16a34a; }
.fi-doc, .fi-docx { background: #7c3aed; }
.fi-png, .fi-jpg, .fi-jpeg, .fi-gif, .fi-webp, .fi-svg { background: #2563eb; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info { font-size: 12px; color: var(--muted); margin-top: 2px; }
.file-info .ok { color: var(--green); }

.msg-row { display: flex; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.msg-row:last-child { border-bottom: none; }
.msg-body { flex: 1; min-width: 0; }
.msg-title { font-weight: 600; font-size: 13.5px; }
.msg-text { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
.msg-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; }
.msg-meta .ok { color: var(--green); }

/* 员工端收件箱卡片 */
.m-card { background: #fff; border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 14px 15px; margin-bottom: 12px; position: relative; }
.m-card.unread::before { content: ''; position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.m-type { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--soft); display: inline-block; padding: 2px 9px; border-radius: 10px; margin-bottom: 7px; }
.m-type.file { color: #d97706; background: #fef3e2; }
.m-title { font-weight: 700; font-size: 14.5px; word-break: break-all; }
.m-text { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.m-time { font-size: 11.5px; color: #9ca3af; margin-top: 8px; }
.m-acts { display: flex; gap: 8px; margin-top: 10px; }
.m-acts .dl-btn {
  flex: 1; border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: var(--radius); padding: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.m-acts .dl-btn:hover { background: var(--soft); }
.m-acts .dl-btn.solid { background: var(--primary); color: #fff; }
.m-acts .dl-btn.solid:hover { background: var(--primary-dark); }
.m-acts .del-btn { border: 1px solid var(--border); color: var(--muted); background: #fff; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }

/* 消息引用块（双端共用） */
.m-quote { font-size: 12px; color: var(--muted); background: #f6f7f9; border-left: 3px solid var(--border); border-radius: 6px; padding: 6px 9px; margin-top: 6px; white-space: pre-wrap; word-break: break-all; }
/* 员工端回复框 */
.reply-box { margin-top: 10px; }
.reply-box textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; font-family: inherit; background: #fbfcfe; resize: vertical; }
.reply-box textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.reply-box .rb-acts { display: flex; gap: 8px; margin-top: 8px; }
/* “我的回复”徽标 */
.m-type.mine { color: var(--muted); background: #f1f2f4; }
/* 管理端发消息引用条 */
.quote-bar { display: flex; align-items: center; gap: 8px; background: #f6f7f9; border-left: 3px solid var(--primary); border-radius: 6px; padding: 7px 10px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }
.quote-bar .qb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-bar .qb-x { border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; font-family: inherit; }
.quote-bar .qb-x:hover { color: var(--primary); }

/* ===== 聊天会话界面（QQ/微信式） ===== */
.share-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.share-tab { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 10px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.share-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.chat-wrap { display: flex; overflow: hidden; height: calc(100vh - 240px); min-height: 440px; padding: 0; }
.chat-side { width: 220px; flex: none; border-right: 1px solid var(--border); background: #fbfcfe; display: flex; flex-direction: column; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.chat-side-head .link-btn { font-size: 12px; padding: 2px 6px; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.chat-item:hover { background: var(--soft); }
.chat-item.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--primary); }
.ci-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.ci-badge { background: #ef4444; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.ci-preview { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-sender { font-size: 11px; color: var(--muted); margin-bottom: 3px; }

/* 群组管理 */
.grp-manage-btn { border: none; border-top: 1px solid var(--border); background: #fff; padding: 11px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-family: inherit; }
.grp-manage-btn:hover { color: var(--primary); background: var(--soft); }
.grp-modal { position: fixed; inset: 0; background: rgba(15,23,42,.35); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.grp-panel { width: 480px; max-width: 100%; max-height: 85vh; overflow-y: auto; padding: 18px; }
/* 注意：弹窗标题不能叫 .grp-head —— 会与报表矩阵的 tr.grp-head（组小计行）撞名，
   display:flex 会把整行踢出表格列布局，导致组小计与日期列错位。 */
.grp-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 15px; }
.grp-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.grp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grp-info span { font-size: 12px; color: var(--muted); }
.grp-form { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 14px; }
.grp-form-title { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.grp-form input[type="text"] { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; font-size: 13.5px; font-family: inherit; margin-bottom: 10px; box-sizing: border-box; }
.grp-members { display: flex; flex-wrap: wrap; gap: 8px 14px; max-height: 240px; overflow-y: auto; margin-bottom: 12px; }
/* 群组管理弹窗：成员勾选按「员工小组」分块。前缀刻意用 gmem-
   （不要复用 grp-*，那群名字已被弹窗自身占用，撞过一次名导致表格错位）。 */
.gmem-group { flex: 0 0 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fbfcfe; }
.gmem-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.gmem-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; cursor: pointer; margin: 0; }
.gmem-all input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.gmem-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.gmem-cnt { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.gmem-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.grp-mem { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 13px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14.5px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 18px; background: #f7f8fa; }
.chat-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

.b-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 14px; }
.b-row.mine { align-items: flex-end; }
.bubble { max-width: 72%; background: #fff; border: 1px solid var(--border); border-radius: 12px; border-top-left-radius: 4px; padding: 9px 12px; font-size: 13.5px; line-height: 1.55; }
.bubble.mine { background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 12px; border-top-right-radius: 4px; }
.b-text { white-space: pre-wrap; word-break: break-word; }
.bubble .m-quote { margin: 0 0 6px; }
.bubble.mine .m-quote { background: rgba(255,255,255,.16); border-left-color: rgba(255,255,255,.55); color: rgba(255,255,255,.92); }
.b-sub { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.b-act { border: none; background: none; color: var(--muted); font-size: 11px; cursor: pointer; padding: 0; font-family: inherit; }
.b-act:hover { color: var(--primary); }
.b-act.danger:hover { color: var(--red); }
.bubble .b-text.unread { font-weight: 700; }

/* ---------- 管理端：系统设置 ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 4px 0; }
.set-row + .set-row { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 16px; }
.set-name { font-weight: 600; font-size: 14px; }
.set-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; max-width: 440px; }

/* ===== 一键清除（危险操作） ===== */
.danger-card { border-color: #f3cccc; background: #fffafa; }
.danger-name { font-weight: 600; font-size: 14px; color: var(--red); }
.danger-card .set-desc { max-width: none; }
.danger-stats { margin: 12px 0; padding: 10px 12px; border: 1px dashed #f0c4c4; border-radius: var(--radius); background: #fff5f5; font-size: 12.5px; color: #a8342e; line-height: 1.7; }
.danger-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.danger-pw { flex: 1 1 220px; min-width: 160px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: inherit; background: #fff; color: var(--text); }
.danger-pw:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .1); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.danger-card .err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.danger-title { color: var(--red); }
.clear-list { margin: 10px 0 6px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.clear-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.clear-item:last-child { border-bottom: none; }
.clear-item b { color: var(--red); font-size: 13.5px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d7dbe2; border-radius: 24px; transition: background .18s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

.chat-input { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input textarea { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-family: inherit; resize: none; background: #fbfcfe; }
.chat-input textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.chat-input textarea:disabled { background: #f2f4f7; color: var(--muted); cursor: not-allowed; }
.chat-input .btn { flex: none; }
.chat-wrap .quote-bar { margin: 8px 14px 0; }
.m-acts .del-btn:hover { color: var(--red); border-color: var(--red); }
.inbox-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 16px 2px 8px; letter-spacing: .5px; }
.inbox-empty { text-align: center; color: #9ca3af; font-size: 13px; padding: 36px 0; }

/* ===== 员工单量走势（点矩阵整行打开的折线图弹层） ===== */
.modal-trend { max-width: 880px; padding: 22px 24px 20px; }
.trend-head { display: flex; align-items: flex-start; gap: 12px; }
.trend-head-l { flex: 1; min-width: 0; }
.trend-head h2 { font-size: 17px; font-weight: 600; color: var(--heading); }
.trend-head .m-sub { margin: 2px 0 0; }
.trend-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.trend-x:hover { color: var(--red); border-color: #f5c9c9; background: #fdf4f4; }
.trend-chart { margin: 14px 0 0; background: #fbfcfe; border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px 0; }
.trend-svg { width: 100%; height: auto; display: block; }
.trend-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); }
.trend-legend .tlg { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend .tl-i { width: 15px; height: 3px; border-radius: 2px; }
.trend-legend .tl-i.dash { border-radius: 0; height: 3px; }
.trend-legend .tl-i.dot { width: 9px; height: 9px; border-radius: 50%; }
.trend-legend .tl-hint { color: #9ca3af; }
.modal-trend .actions { justify-content: flex-end; margin-top: 16px; }
.modal-trend .actions .btn { flex: 0 0 auto; min-width: 118px; }
.rep-trend-ico { opacity: .32; flex: none; transition: opacity .15s; }
.rep-table tbody tr:hover .rep-trend-ico { opacity: .9; }

/* 矩阵时间格：可点 → 看该月/该周每天的单量走势 */
.rep-table tbody td.rep-cell { cursor: zoom-in; }
.rep-table tbody td.rep-cell:hover { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .45); }
.rep-table tbody tr.total td.rep-cell { cursor: default; }

/* ===== 小按钮 ===== */
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; font-weight: 600; }

/* ===== 可折叠面板通用（小组管理 / 小组汇总） ===== */
.eg-toggle {
  display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
  text-align: left; color: var(--text);
}
.eg-chev { flex: none; color: var(--muted); transition: transform .18s; }
.eg-toggle[aria-expanded="true"] .eg-chev { transform: rotate(90deg); }
.eg-title { font-size: 15px; font-weight: 700; }
.eg-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* 小组管理（员工账号页） */
.eg-card { padding: 14px 18px; margin-bottom: 16px; }
.eg-head { display: flex; align-items: center; gap: 12px; }
.eg-actions { display: flex; gap: 8px; flex: none; }
.eg-body { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--border); }
.eg-body.hidden { display: none; }
.eg-new { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.eg-new.hidden { display: none; }
.eg-new input {
  flex: 1; max-width: 260px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13.5px; font-family: inherit; color: var(--text);
}
.eg-new input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.eg-list { display: flex; flex-direction: column; gap: 7px; }
.eg-empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.eg-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: #fbfcfe;
}
.eg-row.drag { opacity: .45; }
.eg-row.over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.eg-handle { flex: none; color: #b6bfcc; cursor: grab; user-select: none; display: inline-flex; }
.eg-handle:active { cursor: grabbing; }
.eg-row-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-row-name input {
  width: 100%; max-width: 220px; padding: 5px 9px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13.5px; font-family: inherit; font-weight: 600; color: var(--text);
}
.eg-row-name input:focus { outline: none; border-color: var(--primary); }
.eg-count { flex: none; font-size: 12px; color: var(--muted); background: #eef2f8; border-radius: 20px; padding: 2px 10px; }
.eg-ops { flex: none; display: flex; gap: 2px; }
.eg-btn { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; color: var(--primary); padding: 4px 8px; border-radius: 6px; }
.eg-btn:hover { background: var(--soft); }
.eg-btn.danger { color: var(--red); }
.eg-btn.danger:hover { background: #fdecec; }
.eg-hint { margin-top: 11px; font-size: 12px; color: #9aa4b2; line-height: 1.7; }

/* 员工表格：勾选列 + 批量设组条 */
.ck-col { width: 38px; text-align: center; }
.ck-col input { cursor: pointer; }
.eg-batch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.eg-batch.hidden { display: none; }
.eg-batch-text b { color: var(--primary); font-size: 14px; }
.eg-batch select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text); min-width: 140px;
}
.grp-sel { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; font-family: inherit; background: #fff; color: var(--text); max-width: 150px; }
.grp-sel.none { color: var(--muted); }
/* 职级（员工账号表下拉，即选即存） */
.lv-sel { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; font-family: inherit; background: #fff; color: var(--text); max-width: 130px; }
.lv-sel.none { color: var(--muted); }
.lv-sel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.lv-sel:disabled { opacity: .6; }
.role-sel { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; font-family: inherit; background: #fff; color: var(--text); max-width: 110px; }
.role-sel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.role-sel:disabled { opacity: .6; }

/* ===== 小组汇总卡（客户记录页） ===== */
.gsum-card { padding: 14px 18px; margin-bottom: 14px; }
.gsum-card.hidden { display: none; }
/* 组长模式：隐藏「小组汇总」卡（组长只看本组，无需再按组汇总） */
body.leader-mode #gsumCard { display: none !important; }
.gsum-head { display: flex; align-items: center; gap: 12px; }
.gsum-body { margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--border); }
.gsum-body.hidden { display: none; }
.gsum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.gsum-item {
  border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe;
  padding: 12px 14px; cursor: pointer; transition: all .15s; text-align: left;
}
.gsum-item:hover { border-color: #bfd3f7; background: #f7faff; }
.gsum-item.on { border-color: var(--primary); background: var(--soft); box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.gs-top { display: flex; align-items: center; gap: 7px; }
.gs-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.gs-name { font-size: 13.5px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-people { font-size: 11.5px; color: var(--muted); flex: none; }
.gs-trend {
  flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: all .15s;
}
.gs-trend:hover { color: var(--primary); border-color: #bfd3f7; background: var(--soft); }
.gs-num { display: block; font-size: 24px; font-weight: 800; line-height: 1.15; margin-top: 7px; }
.gs-num em { font-size: 12px; font-weight: 600; color: var(--muted); font-style: normal; margin-left: 3px; }
.gs-pct { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.gs-split { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); }
.gs-split span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.gs-split span i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.gs-split span b { font-size: 12.5px; color: var(--text); }

/* ===== 矩阵里的分组块 ===== */
.rep-card-tools { display: flex; align-items: center; gap: 12px; }
.rep-card-tools .link-btn { font-size: 12.5px; }
/* 必须显式声明 display:table-row：组小计行是表格行，一旦被别的规则（如撞名的 .grp-head{display:flex}）
   改成 flex/block，整行就会脱离列布局，组小计数据与日期列错位。 */
.rep-table tbody tr.grp-head { cursor: pointer; background: #f4f7fd; display: table-row; }
.rep-table tbody tr.grp-head:hover { background: #eef3fc; }
.rep-table tbody tr.grp-head td { font-weight: 700; border-bottom: 1px solid #e3e9f5; padding: 8px 10px; }
.grp-name { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.grp-chev { color: #8794a8; transition: transform .18s; flex: none; }
.rep-table tr.grp-head.open .grp-chev { transform: rotate(90deg); }
.grp-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.grp-people { font-size: 11.5px; font-weight: 500; color: var(--muted); background: #e8eef9; border-radius: 20px; padding: 1px 8px; }
.grp-trend {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 5px; color: #97a3b6; cursor: pointer; transition: all .15s; flex: none;
}
.grp-trend:hover { color: var(--primary); background: #e6efff; }
.rep-table tbody tr.grp-body td.lft { padding-left: 26px; }
.rep-table tbody tr.grp-body.folded { display: none; }

/* 员工端顶部：本人所属小组 / 职级小标签 */
.op-grp { font-size: 11.5px; color: #4b5563; background: #eef2f8; border-radius: 20px; padding: 1px 8px; margin-left: 4px; }
.op-level { font-size: 11.5px; color: #92400e; background: #fef3c7; border-radius: 20px; padding: 1px 8px; margin-left: 4px; }

/* ===== 员工端：个人信息页 ===== */
.profile-card { padding: 22px 24px; }
.profile-top { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.profile-avatar {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #2563eb, #4f83ff); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}
.profile-name { font-size: 19px; font-weight: 700; color: var(--text); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.pf-tag { font-size: 12px; border-radius: 20px; padding: 2px 10px; background: #eef2f8; color: #4b5563; }
.pf-tag.grp { background: #e8eef9; color: #1e3a8a; }
.pf-tag.lv { background: #fef3c7; color: #92400e; }
.pf-tag.lv.none { background: #f1f3f7; color: #9aa3b2; }
/* 职级徽标（方案 A · 胶囊）：默认灰蓝，有职级色时由行内 style 覆盖 */
.lv-badge { display: inline-block; font-size: 11.5px; line-height: 1.5; border-radius: 20px; padding: 0 8px; background: #eef2f8; color: #4b5563; border: 1px solid transparent; white-space: nowrap; }
/* 报表：职级徽标移到名字右上角、缩小 */
.rep-name-txt { position: relative; display: inline-block; padding-right: 6px; }
/* 报表：职级徽标放在名字右侧空白处（行内、顶部对齐），不压字；星色按职级区分 */
.lv-badge.lv-sup { display: inline-block; margin-left: 7px; vertical-align: top; font-size: 11px; line-height: 1; padding: 0; letter-spacing: 1px; font-weight: 700; white-space: nowrap; }
.lv-badge.lv-sup--lead { background: #fff; border-radius: 7px; padding: 1px 5px; box-shadow: 0 1px 3px rgba(212,175,55,.35); }
/* 组长：名字垫一层金卡背景，一眼可辨 */
.rep-name-txt.rep-name--lead { background: linear-gradient(135deg, #fff7e2, #fdecc9); border: 1px solid rgba(212,175,55,.55); border-radius: 7px; padding: 1px 8px 1px 7px; box-shadow: 0 1px 3px rgba(212,175,55,.22); color: #8a6d1e; font-weight: 600; }
.rep-name--lead .rep-dot { background: #d4af37 !important; }
/* 通讯录/会话列表里的小徽标 */
.ci-lv { margin-left: 6px; font-size: 11px; padding: 0 6px; }
/* 账号表里的「组长」标记 */
.role-badge { font-size: 11px; padding: 0 6px; background: #fef3c7; color: #92400e; }
/* 小组管理行内「组长」下拉 */
.eg-leader { flex: none; }
.ld-sel { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; font-family: inherit; background: #fff; color: var(--text); max-width: 130px; }
.ld-sel.none { color: var(--muted); }
.ld-sel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ld-sel:disabled { opacity: .6; }
/* 只读状态文字（组长模式：客户记录状态不可改） */
.status-txt { display: inline-block; font-size: 12.5px; padding: 2px 9px; border-radius: 20px; background: #eef2f8; color: #4b5563; }
.status-txt.st-wait { background: #fef3c7; color: #92400e; }
.status-txt.st-contact { background: #dbeafe; color: #1e40af; }
.status-txt.st-done { background: #dcfce7; color: #166534; }
.status-txt.st-giveup { background: #f1f3f7; color: #6b7280; }
/* 组长身份标签（左下角） */
.leader-chip { font-size: 12px; color: #92400e; background: #fef3c7; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
/* ===== 组长模式：隐藏管理端专属元素，界面本身与管理员一致 ===== */
body.leader-mode .eg-card { display: none; }
body.leader-mode #viewAccounts th.ck-col, body.leader-mode #viewAccounts td.ck-col,
body.leader-mode #viewAccounts th.ops-col, body.leader-mode #viewAccounts td.ops-col { display: none; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 26px; margin-top: 6px; }
.pf-row { display: flex; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.pf-k { width: 76px; flex: none; color: var(--muted); font-size: 13px; }
.pf-v { font-weight: 600; color: var(--text); font-size: 13.5px; }
.pf-extra { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 8px; }
.pf-mute { font-weight: 500; color: #9aa3b2; }
.profile-note {
  margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7;
  background: #fff; border: 1px dashed var(--border); border-radius: var(--radius-card); padding: 12px 16px;
}

/* ===== 本组数据（员工端 · 仅组长可见） ===== */
.team-grp { font-size: 12.5px; font-weight: 500; color: var(--primary); background: var(--soft); border-radius: 20px; padding: 2px 10px; margin-left: 8px; }
.team-tabs { margin-bottom: 14px; }
.team-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.team-board { padding: 16px 18px; margin-bottom: 14px; }
.team-rank { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.team-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; border-radius: 8px; padding: 7px 10px;
  font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer; transition: all .15s; }
.team-row:hover { background: #f7f9fc; border-color: var(--border); }
.team-row.on { background: var(--soft); border-color: #bfdbfe; }
.team-name { flex: none; width: 156px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.team-me { font-style: normal; font-size: 11px; color: var(--primary); background: #fff; border: 1px solid #bfdbfe; border-radius: 20px; padding: 0 6px; }
.team-bar { flex: 1; min-width: 40px; height: 8px; background: #eef2f8; border-radius: 20px; overflow: hidden; }
.team-bar i { display: block; height: 100%; background: var(--primary); border-radius: 20px; }
.team-num { flex: none; width: 38px; text-align: right; font-weight: 600; }
.team-detail { padding: 16px 18px; }
.team-dhead { margin-bottom: 12px; }
.team-trend { background: #f7f9fc; border-radius: 8px; padding: 10px 12px 6px; margin-bottom: 14px; }
.team-trend svg { display: block; width: 100%; height: 118px; }
.team-trend-labs { display: flex; font-size: 11px; color: var(--muted); margin-top: 4px; }
.team-trend-labs span { flex: 1; text-align: center; white-space: nowrap; }
.team-trend-empty { padding: 24px 0; }
@media (max-width: 560px) {
  .team-kpi { grid-template-columns: 1fr; }
  .team-name { width: 100px; }
}

/* 职级人员面板（点击职级行弹出） */
#lvList .eg-row { cursor: pointer; }
.lv-modal-mask { position: fixed; inset: 0; background: rgba(20,28,46,.42); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 80; }
.lv-modal { width: 100%; max-width: 440px; background: #fff; border-radius: 14px; box-shadow: 0 16px 48px rgba(20,30,50,.22); overflow: hidden; font-family: inherit; }
.lv-modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 0.5px solid var(--border); }
.lv-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.lv-modal-title { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.lv-modal-close { font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.lv-modal-close:hover { color: var(--text); }
.lv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px 0 6px; }
.lv-stat { background: var(--soft); border-radius: 8px; padding: 10px 12px; text-align: center; }
.lv-stat-num { font-size: 22px; font-weight: 500; color: var(--text); }
.lv-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.lv-modal-body { padding: 4px 18px 18px; max-height: 56vh; overflow-y: auto; }
.lv-grp-title { font-size: 12px; font-weight: 500; color: var(--muted); margin: 12px 0 8px; }
.lv-person { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0.5px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.lv-person-name { flex: 1; font-size: 13px; color: var(--text); }
.lv-empty { padding: 28px 0; text-align: center; color: var(--muted); font-size: 13px; }
/* 点选职级面板：左全量导航 + 右明细（方案 A） */
.lv-modal-wide { max-width: 680px; }
.lv-modal-cols { display: flex; min-height: 360px; }
.lv-nav { width: 216px; flex: none; border-right: 0.5px solid var(--border); padding: 8px; overflow-y: auto; max-height: 62vh; }
.lv-nav-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; border-left: 3px solid transparent; transition: background .12s; }
.lv-nav-item:hover { background: #f7f9fc; }
.lv-nav-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lv-nav-name { flex: 1; font-size: 13px; color: var(--text); }
.lv-nav-cnt { font-size: 12px; color: var(--muted); }
.lv-detail { flex: 1; padding: 16px 18px; overflow-y: auto; max-height: 62vh; }
.lv-detail-body { margin-top: 2px; }
#repTbody .lv-badge { cursor: pointer; }

/* ============================================================
   手机端适配（≤900px）：电脑端（>900px）样式完全不动，仅在此媒体查询内新增一层
   核心：隐藏侧栏 → 底部 Tab 栏；数据看板 / 记录列表 两种模式；
        表格转卡片（data-label）；聊天全屏切换；更多聚合菜单
   ============================================================ */
#mobileTabBar { display: none; }
.more-menu { display: none; }
.chat-back { display: none; }

@media (max-width: 900px) {
  /* 隐藏桌面侧栏，主区给底部留位（仅管理端；员工端无底部 Tab，保持原布局） */
  body[data-page="admin"] .sidebar { display: none !important; }
  body[data-page="admin"] .main { padding: 14px 12px 76px; max-width: 100%; }

  /* 底部 Tab 栏（固定） */
  #mobileTabBar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px;
    background: var(--card); border-top: 1px solid var(--border); z-index: 300;
    align-items: stretch; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mtab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: none; color: var(--muted); font-size: 11px; font-family: inherit;
    cursor: pointer; padding: 4px 0;
  }
  .mtab svg { width: 22px; height: 22px; }
  .mtab.active { color: var(--primary); }

  /* 记录页：数据看板 / 列表 两种模式，互相隐藏对方区块 */
  #viewRecords.mobile-dash .page-head,
  #viewRecords.mobile-dash .rep-head,
  #viewRecords.mobile-dash .rep-custom,
  #viewRecords.mobile-dash .gsum-card,
  #viewRecords.mobile-dash .filter-bar,
  #viewRecords.mobile-dash .table-card,
  #viewRecords.mobile-list .stats-grid,
  #viewRecords.mobile-list .rep-head,
  #viewRecords.mobile-list .rep-custom,
  #viewRecords.mobile-list .gsum-card,
  #viewRecords.mobile-list .rep-card,
  #viewRecords.mobile-list .top-row { display: none !important; }

  /* 数据看板：统计卡 2×2；险种 / 员工业绩竖向堆叠 */
  #viewRecords.mobile-dash .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  #viewRecords.mobile-dash .stat-card { margin: 0; }
  #viewRecords.mobile-dash .stat-num { font-size: 26px; }
  #viewRecords.mobile-dash .top-row { flex-direction: column; }
  #viewRecords.mobile-dash .top-row .dash-plan-card,
  #viewRecords.mobile-dash .top-row .dash-time-card { width: 100%; min-width: 0; }

  /* 员工×时间矩阵：横向滑动 + 首列吸住 */
  #viewRecords.mobile-dash .rep-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #viewRecords.mobile-dash .rep-table th.lft,
  #viewRecords.mobile-dash .rep-table td.lft { position: sticky; left: 0; background: var(--card); z-index: 2; }

  /* 记录列表：筛选栏换行 + 搜索/导出占满 */
  #viewRecords.mobile-list .filter-bar { flex-wrap: wrap; gap: 8px; }
  #viewRecords.mobile-list .search-input { min-width: 100%; order: 5; }
  #viewRecords.mobile-list .export-btn { width: 100%; }
  #viewRecords.mobile-list .table-cap { max-height: none !important; overflow: visible !important; }

  /* 表格 → 卡片（记录表 + 账号表） */
  #viewRecords.mobile-list .table-card,
  #viewAccounts .table-card { background: transparent; border: none; box-shadow: none; padding: 0; }
  #viewRecords.mobile-list table, #viewAccounts table { width: 100%; }
  #viewRecords.mobile-list thead, #viewAccounts thead { display: none; }
  #viewRecords.mobile-list tbody, #viewAccounts tbody,
  #viewRecords.mobile-list tr, #viewAccounts tr,
  #viewRecords.mobile-list td, #viewAccounts td { display: block; width: 100%; box-sizing: border-box; }
  #viewRecords.mobile-list tbody tr, #viewAccounts tbody tr {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 12px; margin-bottom: 10px; box-shadow: var(--shadow);
  }
  #viewRecords.mobile-list tbody td, #viewAccounts tbody td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 5px 0; border: none; text-align: right; white-space: normal; font-size: 13.5px;
  }
  #viewRecords.mobile-list tbody td::before, #viewAccounts tbody td::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600;
    text-align: left; flex: none; margin-right: auto;
  }
  #viewRecords.mobile-list tbody td.ck-col, #viewAccounts tbody td.ck-col { justify-content: flex-start; }
  #viewRecords.mobile-list tbody td.ops-col, #viewAccounts tbody td.ops-col { flex-direction: column; align-items: stretch; }
  #viewRecords.mobile-list tbody td.ops-col .link-btn,
  #viewAccounts tbody td.ops-col .link-btn {
    display: block; text-align: center; padding: 9px; border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 6px; font-size: 14px;
  }
  #viewRecords.mobile-list tbody td.ops-col .link-btn:last-child,
  #viewAccounts tbody td.ops-col .link-btn:last-child { margin-bottom: 0; }

  /* 更多聚合菜单 */
  #viewMore .more-menu { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
  .more-item {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; font-size: 15px; color: var(--text); box-shadow: var(--shadow);
    cursor: pointer; font-family: inherit;
  }
  .more-item .mi-ico { font-size: 18px; width: 24px; text-align: center; }
  .more-item.danger { color: var(--red); }
  .more-item:active { background: #f4f7fc; }

  /* 聊天：全屏切换式（先列表，点开进对话）——仅管理端（员工端 #panelChat 是自己的聊天布局） */
  body[data-page="admin"] #panelChat { flex-direction: column; height: calc(100vh - 150px); min-height: 380px; }
  body[data-page="admin"] #panelChat .chat-side { width: 100%; flex: none; height: 100%; }
  body[data-page="admin"] #panelChat .chat-main { display: none; flex: 1; min-height: 0; }
  body[data-page="admin"] #panelChat.mobile-open .chat-side { display: none; }
  body[data-page="admin"] #panelChat.mobile-open .chat-main { display: flex; }
  .chat-back {
    display: inline-flex; align-items: center; margin-right: 8px; font-size: 14px;
    color: var(--primary); background: none; border: none; font-family: inherit; cursor: pointer;
  }
  body[data-page="admin"] #chatHead { display: flex; align-items: center; }

  /* 弹层在手机上全屏，便于填写（仅管理端） */
  body[data-page="admin"] .overlay { align-items: stretch; padding: 0; }
  body[data-page="admin"] .modal { max-width: 100% !important; border-radius: 0; min-height: 100vh; padding: 22px 18px; }
  body[data-page="admin"] .grp-panel { max-width: 100% !important; border-radius: 0; max-height: 100vh; }
}

