/* ===================== 保险销售 CRM 系统 全局样式 ===================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff4ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #273449;
  --sidebar-active: #2563eb;
  --bg: #f1f4f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* 细腻现代的滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }
/* 键盘可达性：统一的焦点环 */
:focus-visible { outline: 2px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); font-size: 14px; color: var(--text); }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #38bdf8 100%);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 16px; padding: 36px 34px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.login-box .logo { text-align: center; margin-bottom: 8px; }
.login-box .logo .mark {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700;
}
.login-box h1 { text-align: center; font-size: 20px; margin: 0 0 4px; }
.login-box .sub { text-align: center; color: var(--text-2); margin-bottom: 22px; font-size: 13px; }
.tabs { display: flex; background: #f1f4f9; border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.tabs button { flex: 1; border: none; background: transparent; padding: 8px 0; border-radius: 8px; font-size: 14px; color: var(--text-2); }
.tabs button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border .15s, box-shadow .15s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-group .required::after { content: " *"; color: var(--danger); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: var(--radius-sm); padding: 10px 16px; font-size: 14px; font-weight: 600; transition: all .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-link { background: none; border: none; color: var(--primary); padding: 2px 6px; font-size: 13px; }
.btn-link.danger { color: var(--danger); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 6px; min-height: 18px; }

/* ---------- 应用布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: var(--sidebar-bg); color: #cbd5e1;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2563eb, #38bdf8); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sidebar .brand .name { color: #fff; font-weight: 700; font-size: 15px; }
.sidebar .brand .name small { display: block; font-weight: 400; font-size: 11px; color: #94a3b8; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 20px; color: #cbd5e1;
  font-size: 14px; cursor: pointer; transition: background .15s; border-left: 3px solid transparent;
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: rgba(37,99,235,.22); color: #fff; border-left-color: #38bdf8; font-weight: 600; }
.nav a .ico { width: 20px; text-align: center; font-size: 16px; }
.sidebar .user { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .user .u-name { color: #fff; font-weight: 600; font-size: 14px; }
.sidebar .user .u-role { color: #94a3b8; font-size: 12px; }
.sidebar .user .u-actions { margin-top: 8px; display: flex; gap: 6px; }
.sidebar .user .u-actions button { background: rgba(255,255,255,.08); border: none; color: #cbd5e1; padding: 5px 10px; border-radius: 6px; font-size: 12px; }
.sidebar .user .u-actions button:hover { background: rgba(255,255,255,.16); color: #fff; }

.main { flex: 1; margin-left: 232px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 40;
}
.topbar .page-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar .hamburger { display: none; background: none; border: none; font-size: 22px; color: var(--text); }
.topbar .btn-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  padding: 7px 13px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.topbar .btn-refresh:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.topbar .btn-refresh.spin { animation: spin .5s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.content { padding: 20px; flex: 1; }
/* 页面切换/刷新时的轻柔渐入，让内容加载更有层次感 */
.content > * { animation: fadeUp .25s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .card + .grid { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border-top: 3px solid var(--primary); }
.stat-card .s-label { color: var(--text-2); font-size: 13px; }
.stat-card .s-label .tip { color: var(--text-3); font-size: 11px; }
.stat-card .s-row { display: flex; gap: 14px; margin-top: 10px; }
.stat-card .s-item { flex: 1; }
.stat-card .s-item .v { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-card .s-item .v.money { color: var(--warning); }
.stat-card .s-item .k { font-size: 11px; color: var(--text-3); }

.progress-wrap { background: #eef1f6; border-radius: 20px; height: 10px; overflow: hidden; margin: 8px 0 4px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #2563eb, #38bdf8); border-radius: 20px; transition: width .5s; }
.progress-bar.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar.ok { background: linear-gradient(90deg, #16a34a, #4ade80); }
.target-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }

/* 数据看板钻取（点击数据查看明细） */
.stat-card .s-item.drill { cursor: pointer; border-radius: 10px; padding: 5px 7px; margin: -5px -7px; transition: background .15s; }
.stat-card .s-item.drill:hover { background: rgba(37, 99, 235, 0.08); }
.target-click { cursor: pointer; border-radius: 10px; padding: 6px 8px; margin: 0 -8px; transition: background .15s; }
.target-click:hover { background: rgba(37, 99, 235, 0.08); }
.funnel .f-row.drill { cursor: pointer; }
.funnel .f-row.drill:hover { filter: brightness(1.12); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
svg .t-bar, svg .t-cost { cursor: pointer; transition: fill .15s; }
svg .t-bar:hover { fill: #1d4ed8; }
svg .t-cost:hover { fill: #d97706; }
#drillBody .tbl tbody tr { cursor: pointer; }
#drillBody .tbl tbody tr:hover td { background: rgba(37, 99, 235, 0.06); }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.funnel .f-row { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; height: 40px; border-radius: 6px; transition: width .4s; position: relative; min-width: 60px; }
.funnel .f-row .cnt { margin-left: 6px; font-weight: 800; }
.funnel .f-cap { text-align: center; font-size: 12px; color: var(--text-2); }

/* 图表 */
.chart-box { width: 100%; overflow-x: auto; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl tbody td { height: 54px; vertical-align: middle; }
table.tbl th { color: var(--text-2); font-weight: 600; background: #f8fafc; position: sticky; top: 0; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl td.wrap { white-space: normal; min-width: 160px; }
table.tbl .cust-gender, table.tbl .cust-age {
  display: inline-block; min-width: 32px; padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; color: #4338ca; font-size: 12px; text-align: center;
}
table.tbl .cust-age { background: #ecfeff; color: #0e7490; margin-left: 2px; }
table.tbl .muted { color: #94a3b8; }

/* 加载中占位（带旋转指示环） */
.loading-box { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); padding: 30px 8px; font-size: 13px; }
.spin-ring { display: inline-block; width: 18px; height: 18px; border: 2.5px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }

/* 拜访记录表格：固定行高（稍高），长文本省略 */
table.tbl.tbl-visits tbody td { height: 62px; }
.td-clamp { display: block; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-clamp.td-link { color: var(--primary); cursor: pointer; }
.td-clamp.td-link:hover { text-decoration: underline; }
.td-popover {
  position: fixed; z-index: 320; background: #1f2937; color: #fff;
  padding: 10px 14px; border-radius: 8px; max-width: 380px; font-size: 13px;
  line-height: 1.65; word-break: break-word; box-shadow: 0 10px 30px rgba(15,23,42,.3);
  pointer-events: none; animation: fade .12s;
}

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.lv-A { background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #8b5cf6); color: #fff; }
.lv-B { background: #ede9fe; color: #6d28d9; }
.lv-C { background: #dcfce7; color: #15803d; }
.lv-D { background: #fef9c3; color: #a16207; }
.lv-E { background: #e2e8f0; color: #475569; }
.lv-TBD { background: #6b4423; color: #f5e9d9; }
.lv-pending { background: #f1f5f9; color: #64748b; }
.lv-today { background: #dcfce7; color: #15803d; }
.badge-sync { background: #e0edff; color: #1d4ed8; font-size: 11px; padding: 1px 7px; margin-left: 6px; font-weight: 500; vertical-align: 1px; }

/* 表单内提示条（如同步说明） */
.form-hint { padding: 8px 12px; border-radius: var(--radius-sm); background: #eef4ff; color: #1d4ed8; font-size: 12.5px; line-height: 1.6; }

/* 筛选栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; position: relative; z-index: 10; }
.filter-bar .f-item { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .f-item label { font-size: 12px; color: var(--text-2); }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; min-width: 130px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.f-quick .quick-btns { display: flex; gap: 6px; }
.f-quick .qbtn { padding: 7px 10px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text); cursor: pointer; white-space: nowrap; transition: all .12s; }
.f-quick .qbtn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.f-quick .qbtn:active { transform: scale(.96); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 680px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal.wide { max-width: 880px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x { background: none; border: none; font-size: 22px; color: var(--text-3); line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 表单栅格 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* 表单单行（行内 label + 输入控件） */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-1);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.form-row textarea { resize: vertical; min-height: 60px; line-height: 1.6; }
.form-row .hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 目标设定弹窗 */
.goal-modal-tip {
  font-size: 13px; color: var(--text-2); margin-bottom: 14px;
  padding: 10px 12px; background: #f1f5f9; border-left: 3px solid var(--primary); border-radius: 6px;
}
.goal-modal-tip code { background: #e2e8f0; padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, monospace; }
.form-grid .form-group { margin-bottom: 0; }

/* ---------- 选项组（单选 / 多选 pill，高对比） ---------- */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.choice-item {
  border: 1.5px solid var(--border); background: #fff; color: var(--text-2);
  border-radius: 10px; padding: 7px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .12s; line-height: 1.4;
}
.choice-item:hover { border-color: var(--primary); color: var(--primary); background: #f8faff; }
.choice-item.on {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-color: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}

/* ---------- 日期选择器 ---------- */
.dp-wrap { position: relative; display: block; }
.dp-input { padding-right: 38px !important; }
.dp-ico {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; font-size: 16px; cursor: pointer; padding: 4px; line-height: 1;
  filter: grayscale(.15);
}
.dp-ico:hover { filter: none; transform: translateY(-50%) scale(1.12); }
.dp-pop {
  position: fixed; z-index: 10000; left: 0; top: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  padding: 12px; width: 292px; max-width: calc(100vw - 16px);
  animation: dpPopIn .14s ease-out;
}
.dp-pop-down { animation: dpPopInDown .14s ease-out; }
@keyframes dpPopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dpPopInDown { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.dp-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.dp-title { flex: 1; text-align: center; font-weight: 700; font-size: 14px; }
.dp-nav { border: none; background: #f1f4f9; width: 26px; height: 26px; border-radius: 6px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.dp-nav:hover { background: var(--primary-light); color: var(--primary); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; color: var(--text-3); padding: 3px 0; font-weight: 600; }
.dp-blank { }
.dp-day { border: none; background: none; height: 32px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; transition: background .1s; }
.dp-day:hover { background: var(--primary-light); }
.dp-day.today { color: var(--primary); font-weight: 700; }
.dp-day.sel { background: var(--primary); color: #fff; font-weight: 700; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dp-btn { border: none; background: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.dp-btn:hover { background: var(--primary-light); }
/* ---------- 周选择器（周粒度日历，复用 .dp-* 视觉） ---------- */
/* 非周一：置灰不可点，明确「选周 = 选周一」的语义 */
.dp-day.wp-off { color: var(--text-3); opacity: .42; cursor: default; background: none !important; }
/* 周一：略加底色，与其它日期区分出「可选」 */
.dp-day.wp-mon { background: #f6f9ff; font-weight: 600; }
.dp-day.wp-mon:hover { background: var(--primary-light); }
.dp-day.wp-mon.sel { background: var(--primary); color: #fff; }
.dp-day.wp-mon.today:not(.sel) { color: var(--primary); }
.wp-pop .dp-grid { row-gap: 3px; }
/* 必访周摘要（弹窗/详情页展示「本周 9月8日~9月14日」） */
.wp-sum { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.wp-sum b { color: var(--primary); font-weight: 700; }

/* ---------- 客户搜索选择 ---------- */
.combo-wrap { position: relative; display: block; }
.combo-input { }
/* 已锁定关联客户时的「✕ 清除」按钮：让用户想换人时能主动解锁 */
.combo-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; line-height: 1; padding: 0; border: none; border-radius: 50%;
  background: var(--bg-hover, #eef2f8); color: var(--text-3); font-size: 11px; cursor: pointer;
  display: none; align-items: center; justify-content: center; transition: all .15s;
}
.combo-wrap.has-clear .combo-clear { display: flex; }
.combo-clear:hover { background: var(--danger, #dc2626); color: #fff; }
/* 有清除按钮时给输入框右侧留位，避免文字压住按钮 */
.combo-wrap.has-clear .combo-input { padding-right: 34px; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 130;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; display: none;
}
.combo-opt { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.combo-opt:hover, .combo-opt.hl { background: var(--primary-light); color: var(--primary); }
.combo-empty { padding: 12px; font-size: 13px; color: var(--text-3); text-align: center; }

/* 保单险种徽标（Batch A） */
.pt-ins-1 { background: #fde8e8; color: #b91c1c; }  /* 寿险 */
.pt-ins-2 { background: #fdece0; color: #c2410c; }  /* 重疾 */
.pt-ins-3 { background: #fef3c7; color: #b45309; }  /* 年金 */
.pt-ins-4 { background: #dcfce7; color: #15803d; }  /* 医疗 */
.pt-ins-5 { background: #e0f2fe; color: #0369a1; }  /* 意外 */
.pt-ins-6 { background: #ede9fe; color: #6d28d9; }  /* 养老 */
.pt-ins-7 { background: #fce7f3; color: #be185d; }  /* 两全 */
.pt-ins-8 { background: #f1f5f9; color: #475569; }  /* 其他/未知 */

/* 保单缴费状态徽标（Batch A） */
.ps-badge { font-weight: 600; }
.ps-paying { background: #dbeafe; color: #1d4ed8; }
.ps-paidup { background: #dcfce7; color: #15803d; }
.ps-lapsed { background: #fee2e2; color: #b91c1c; }
.ps-none { background: #f1f5f9; color: #64748b; }

/* ===== 第2层（2026-09-13）：客户来源徽标 ===== */
.src-badge { font-weight: 600; }
.src-1 { background: #fef3c7; color: #b45309; }  /* 转介绍 */
.src-2 { background: #e0e7ff; color: #4338ca; }  /* 陌生拜访 */
.src-3 { background: #dbeafe; color: #1d4ed8; }  /* 活动获客 */
.src-4 { background: #cffafe; color: #0e7490; }  /* 线上咨询 */
.src-5 { background: #f3e8ff; color: #7e22ce; }  /* 电话名单 */
.src-6 { background: #dcfce7; color: #15803d; }  /* 老客户加保 */
.src-7 { background: #f1f5f9; color: #64748b; }  /* 其他 */

/* ===== 第2层（2026-09-13）：列表聚合条（保单/续期台账等） ===== */
.agg-strip { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 14px; margin: 0 0 12px; background: var(--bg-2, #f8fafc); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.agg-item { display: inline-flex; align-items: center; gap: 5px; }
.agg-item b { color: var(--text-1, #0f172a); font-weight: 700; }

/* ===== 第2层（2026-09-13）：续期台账 ===== */
.rn-badge { font-weight: 600; }
.rn-overdue { background: #fee2e2; color: #b91c1c; }
.rn-urgent { background: #ffedd5; color: #c2410c; }
.rn-soon   { background: #fef9c3; color: #a16207; }
.rn-normal { background: #dcfce7; color: #15803d; }
.rn-days { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ===== 第2层（2026-09-13）：理赔跟进状态 ===== */
.fu-row-overdue { background: #fff5f5; }
.fu-row-today { background: #fffbeb; }
.fu-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.fu-tag-overdue { background: #fee2e2; color: #b91c1c; }
.fu-tag-today { background: #fef3c7; color: #b45309; }
.fu-tag-noplan { background: #f1f5f9; color: #64748b; }

/* ===== 第2层（2026-09-13）：转介绍统计 ===== */
.ref-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ref-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; }
.ref-item .ref-name { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.ref-item .ref-metrics { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.ref-item .ref-metrics b { color: var(--text-1, #0f172a); }
.ref-bar { height: 6px; border-radius: 3px; background: #e2e8f0; margin-top: 8px; overflow: hidden; }
.ref-bar > i { display: block; height: 100%; background: linear-gradient(90deg,#f59e0b,#f97316); }

/* 抽屉（客户详情） */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 90; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: #fff; z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .25s; }
@keyframes slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.detail-item { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.detail-item .k { width: 96px; color: var(--text-2); flex-shrink: 0; }
.detail-item .v { flex: 1; word-break: break-all; }
/* A4 资料最后更新提示行：轻量协同感知，弱化展示避免抢主信息焦点 */
.detail-item.detail-meta { background: var(--primary-light, #eff4ff); margin: 0 -2px; padding: 6px 8px; border-bottom: none; border-radius: 6px; }
.detail-item.detail-meta .k { color: var(--primary, #2563eb); }
.detail-item.detail-meta .v { color: var(--text-2, #6b7280); font-size: 12px; }
.detail-section { margin-top: 16px; }
.detail-section h4 { margin: 0 0 8px; font-size: 14px; border-left: 3px solid var(--primary); padding-left: 8px; display: flex; align-items: center; justify-content: space-between; }

/* ===================== 附件：列表 + 上传 + 进度 + 预览 ===================== */
.att-list { display: flex; flex-direction: column; gap: 4px; }
.att-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  font-size: 13px;
  background: var(--surface-2, rgba(0,0,0,.02));
  transition: background .12s;
}
.att-row:hover { background: var(--primary-light); }
.att-row .att-icon { font-size: 15px; flex-shrink: 0; }
.att-row .att-name {
  flex: 1; color: var(--primary); cursor: pointer; word-break: break-all;
  text-decoration: none;
}
.att-row .att-name:hover { text-decoration: underline; }
.att-row .att-size { color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.att-row .att-rm { color: var(--text-2); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.att-row .att-rm input { margin: 0; }
.att-empty { color: var(--text-3); font-size: 12px; padding: 6px 0; }

.att-uploader { display: flex; flex-direction: column; gap: 6px; }
.att-uploader .att-input { display: none; }
.att-uploader .att-pick {
  display: inline-block; padding: 8px 16px; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--primary); cursor: pointer; user-select: none;
  text-align: center; font-size: 13px; transition: all .12s;
  background: var(--surface-2, rgba(0,0,0,.02));
}
.att-uploader .att-pick:hover { border-color: var(--primary); background: var(--primary-light); }
.att-uploader .att-tips { font-size: 12px; color: var(--text-3); }

.att-pending { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.att-progress {
  background: var(--surface-2, rgba(0,0,0,.02));
  border-radius: 6px; padding: 8px 10px; font-size: 12px;
}
.att-progress .ap-name { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.att-progress .ap-icon { font-size: 14px; }
.att-progress .ap-pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; }
.att-progress .ap-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.att-progress .ap-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #06b6d4); border-radius: 2px; transition: width .15s; }
.att-progress.done .ap-pct { color: #15803d; }
.att-progress.done .ap-fill { background: #22c55e; }
.att-progress.err { background: #fef2f2; color: #b91c1c; }
.att-progress-total { border: 1px solid var(--primary-light); background: var(--primary-light); }

/* 预览弹窗内容 */
.att-preview-image { text-align: center; background: #0f172a; padding: 12px; border-radius: 6px; max-height: 70vh; overflow: auto; }
.att-preview-image img { max-width: 100%; max-height: 68vh; object-fit: contain; }
.att-preview-pdf { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 6px; background: #525659; }
.att-preview-video { width: 100%; max-height: 70vh; background: #000; border-radius: 6px; }
.att-preview-audio { width: 100%; }
.att-preview-text {
  max-height: 70vh; overflow: auto; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 14px;
}
.att-preview-text pre { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: #1e293b; }
.att-preview-loading { text-align: center; color: var(--text-3); padding: 24px 0; }
.att-preview-empty { text-align: center; color: var(--text-2); padding: 38px 16px; }
.att-preview-foot { margin-top: 10px; display: flex; justify-content: center; gap: 8px; }

/* 拜访计划卡片 */
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cust-chip { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all .12s; }
.cust-chip:hover { border-color: var(--primary); background: var(--primary-light); }
.cust-chip .nm { font-weight: 600; flex: 1; }
.cust-chip .meta { font-size: 12px; color: var(--text-3); }
.empty { text-align: center; color: var(--text-3); padding: 24px 8px; font-size: 13px; }

/* ===================== C1/C2：拜访计划增强（工具栏 + 折叠） ===================== */
.plan-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.plan-toolbar-title { font-size: 18px; font-weight: 800; color: var(--text); }
.plan-title { cursor: pointer; user-select: none; gap: 8px; }
.plan-title:hover { color: var(--primary); }
.plan-caret { display: inline-block; transition: transform .18s ease; color: var(--text-3); font-size: 12px; }
.plan-title.collapsed .plan-caret, .plan-caret.collapsed { transform: rotate(-90deg); }

/* ===================== C1：推荐理由小标签 ===================== */
.reason-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
  white-space: nowrap; cursor: default;
}
.reason-tag.urgent { box-shadow: 0 0 0 1px rgba(220, 38, 38, .4); }

/* ===================== C1：智能应访推荐弹窗 ===================== */
.smart-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; }
.smart-foot-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.smart-foot label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.smart-date-input { width: 130px; }
.smart-selected { font-size: 13px; color: var(--text-2); }
.smart-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--primary-light); border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.smart-stat b { color: var(--primary); font-size: 16px; }
.smart-rule { color: var(--text-2); font-size: 12px; }
.rec-empty { text-align: center; padding: 40px 16px; color: var(--text-2); }
.rec-head, .rec-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13px; }
.rec-head { font-weight: 700; color: var(--text-2); background: #f8fafc; border-radius: 8px 8px 0 0; border-bottom: 1px solid var(--border); }
.rec-list { max-height: 46vh; overflow-y: auto; }
.rec-row { cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.rec-row:last-child { border-bottom: none; }
.rec-row:hover { background: #f8fafc; }
.rec-row.checked { background: var(--primary-light); }
.rec-check { accent-color: var(--primary); width: 16px; height: 16px; }
.rec-all input { accent-color: var(--primary); width: 16px; height: 16px; }
.rec-name { font-weight: 600; flex: 1.4; min-width: 0; display: flex; align-items: center; gap: 6px; }
.rec-phone { width: 132px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-reasons { flex: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.rec-last { flex: 1.4; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.rec-ro-hint { margin-top: 8px; font-size: 12px; color: var(--text-3); background: #f8fafc; padding: 8px 12px; border-radius: 8px; }
@media (max-width: 820px) {
  .rec-head { display: none; }
  .rec-row { flex-wrap: wrap; }
  .rec-name { flex-basis: calc(100% - 26px); }
  .rec-phone { width: auto; flex-basis: 100%; padding-left: 26px; }
  .rec-reasons { flex-basis: 100%; padding-left: 26px; }
  .rec-last { flex-basis: 100%; padding-left: 26px; text-align: left; }
}

/* ===================== C2：快捷批量补录弹窗 ===================== */
.batch-v-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.batch-v-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.batch-v-item input, .batch-v-item select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
.batch-v-item input:focus, .batch-v-item select:focus { border-color: var(--primary); }
.batch-v-pick { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.batch-v-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
#batchPick { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
#batchPick:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.batch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.batch-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 4px 8px 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
}
.batch-chip-x {
  border: none; background: rgba(37, 99, 235, .15); color: var(--primary-dark);
  width: 18px; height: 18px; border-radius: 50%; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.batch-chip-x:hover { background: rgba(220, 38, 38, .2); color: var(--danger); }

/* ===================== C3：保单保额统计卡（看板） ===================== */
.cov-cols { display: flex; align-items: stretch; gap: 6px; }
.cov-col { flex: 1; text-align: center; padding: 6px 4px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cov-col + .cov-col { border-left: 1px solid var(--border); }
.cov-btn {
  border: none; background: none; cursor: pointer; text-align: center;
  font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.1;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 8px;
  transition: background .1s;
}
.cov-btn span { font-size: 11px; font-weight: 500; color: var(--text-3); }
.cov-btn:hover { background: var(--primary-light); }
.cov-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.cov-key { font-size: 11px; color: var(--text-3); }

/* ===================== C3：客户详情保单聚合头 ===================== */
.pol-summary {
  display: flex; gap: 0; margin-bottom: 10px;
  background: var(--primary-light); border-radius: 10px; overflow: hidden;
}
.pol-sum-item { flex: 1; text-align: center; padding: 10px 6px; }
.pol-sum-item + .pol-sum-item { border-left: 1px solid rgba(37, 99, 235, .18); }
.pol-sum-item b { display: block; font-size: 17px; color: var(--primary-dark); line-height: 1.2; }
.pol-sum-item span { font-size: 12px; color: var(--text-2); }

/* ===================== C4：客户详情记录搜索定位高亮 ===================== */
.rec-block { scroll-margin-top: 20px; }
.rec-highlight {
  animation: recHl 2.2s ease forwards;
  border-radius: 8px;
}
.rec-highlight-out { opacity: .25; }
@keyframes recHl {
  0% { background: rgba(245, 158, 11, .45); box-shadow: 0 0 0 2px #f59e0b; }
  70% { background: rgba(245, 158, 11, .3); box-shadow: 0 0 0 2px rgba(245, 158, 11, .6); }
  100% { background: rgba(245, 158, 11, .18); box-shadow: 0 0 0 2px rgba(245, 158, 11, .3); }
}

/* 日历 */
.calendar-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.cal-month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month-head .m { font-size: 17px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { text-align: center; font-size: 12px; color: var(--text-2); padding: 4px 0; font-weight: 600; }
.cal-cell { border: 1px solid var(--border); border-radius: 8px; min-height: 88px; padding: 6px; background: #fff; font-size: 12px; }
.dnum-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; line-height: 1; }
.cal-cell .dnum { font-weight: 700; color: var(--text-2); font-size: 14px; }
.cal-emoji { display: inline-flex; align-items: center; }
.cal-emoji svg { display: block; width: 14px; height: 14px; }
.cal-cell.today { border-color: var(--primary); background: var(--primary-light); }
.cal-cell .ev { display: block; padding: 2px 5px; border-radius: 5px; margin-top: 2px; cursor: pointer; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell .ev:hover { opacity: .8; }
/* 桌面端（宽屏）：格子自适应高度显示全部客户，不显示 +N 按钮 */
.cal-cell .cal-more { display: none; }

/* 拜访日历“查看全部”弹窗 */
.dayvisit-list { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.dayvisit-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.dayvisit-row:hover { background: var(--primary-light); }
.dayvisit-row .lvdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dayvisit-row .dv-name { font-weight: 700; font-size: 14px; }
.dayvisit-row .dv-count { margin-left: auto; color: var(--text-2); font-size: 12px; }

/* ---------- 客养活动（活动日历） ---------- */
/* 事件条：活动名称 + 时段（「已满」按钮内联在名称右侧） */
.cal-cell .ev.care-ev {
  display: flex; align-items: center; gap: 4px;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.cal-cell .ev.care-ev .ev-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 已满态：活动名称颜色变浅（核心视觉需求） */
.cal-cell .ev.care-ev.is-full { background: #f1f5f9; border-color: #e2e8f0; }
.cal-cell .ev.care-ev.is-full .ev-name { color: #9aa4b2; opacity: .7; text-decoration: line-through; }

/* 「已满」小按钮 */
.ev-full-btn {
  flex: none; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 4px;
  border: 1px solid #cbd5e1; background-color: #fff; color: #64748b; cursor: pointer;
  white-space: nowrap; transition: color .12s, border-color .12s, background-color .12s;
}
.ev-full-btn:hover { border-color: #94a3b8; background-color: #f8fafc; color: #334155; }
.ev-full-btn.on { border-color: #94a3b8; background-color: #e2e8f0; color: #475569; }
.ev-full-btn:disabled { opacity: .55; cursor: default; }

/* 日历格子内活动场次角标 */
.cal-cell.care-cell .care-count {
  margin-left: auto; font-size: 10px; color: #2563eb;
  background-color: #eff6ff; border-radius: 6px; padding: 1px 5px;
}

/* 右栏：本月活动一览 */
.care-stats { display: flex; gap: 10px; margin-bottom: 12px; }
.care-stat {
  flex: 1; text-align: center; padding: 10px 6px; border: 1px solid var(--border);
  border-radius: 8px; background-color: #f8fafc;
}
.care-stat b { display: block; font-size: 16px; color: var(--text); line-height: 1.4; }
.care-stat span { font-size: 11px; color: var(--text-3); }
.care-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.care-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background-color: #fff;
}
.care-row:hover { background-color: var(--primary-light); }
.care-row .care-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; background-color: #94a3b8; }
.care-row .care-dot.care-t-普通 { background-color: #3b82f6; }
.care-row .care-dot.care-t-高端 { background-color: #a855f7; }
.care-row .care-dot.care-t-一日 { background-color: #f59e0b; }
.care-row .care-dot.care-t-旅游 { background-color: #10b981; }
.care-row-main { flex: 1; min-width: 0; }
.care-row-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.care-row-name.is-full { color: #9aa4b2; text-decoration: line-through; }
.care-row .care-full-tag {
  font-size: 10px; font-weight: 500; color: #64748b; background-color: #e2e8f0;
  border-radius: 6px; padding: 1px 6px; text-decoration: none;
}
.care-row-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.care-row-remark { font-size: 12px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 备忘录编辑器 */
.memo-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); align-items: center; }
.memo-toolbar button { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; font-size: 13px; color: var(--text); }
.memo-toolbar button:hover, .memo-toolbar button.active { background: var(--primary-light); border-color: var(--primary); }
.memo-toolbar select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }
.memo-toolbar input[type=color] { width: 30px; height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 1px; background: #fff; }
.memo-editor { min-height: 320px; padding: 14px; outline: none; font-size: 14px; line-height: 1.7; word-break: break-word; }
.memo-editor:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.memo-readonly { min-height: 320px; padding: 14px; font-size: 14px; line-height: 1.7; word-break: break-word; color: var(--text); }
.rich-content { line-height: 1.7; word-break: break-word; }

/* 通知 */
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.notif-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-tabs button { padding: 7px 15px; border-radius: 20px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 13px; transition: all .15s; cursor: pointer; }
.notif-tabs button:hover { border-color: var(--primary); color: var(--primary); }
.notif-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.notif-item { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: all .12s; background: #fff; }
.notif-item:hover { border-color: var(--primary); background: var(--primary-light); }
.notif-item .n-ico { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-item .n-body { flex: 1; min-width: 0; }
.notif-item .n-title { font-weight: 600; }
.notif-item .n-desc { font-size: 12px; color: var(--text-2); }
.notif-item .n-time { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.notif-item .n-action { flex-shrink: 0; margin-left: 2px; }
.notif-item .n-read-btn { font-size: 12px; color: var(--primary); white-space: nowrap; }
.notif-item .n-read-badge { font-size: 12px; color: var(--text-3); background: #f1f5f9; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.notif-item.read { opacity: .55; }
.notif-item.read:hover { opacity: .8; }

/* Toast */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: min(86vw, 480px); }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* 富文本编辑区内的字号/颜色由内联样式驱动 */

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .grid-6, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .hamburger { display: block; }
  .mask.show { display: block; }
  .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  /* 移动端：日历格子紧凑，仅显示前 4 个客户，超出用 +N 按钮查看 */
  .cal-cell { min-height: 64px; overflow: hidden; }
  .cal-cell .ev:nth-of-type(n+5) { display: none; }
  .cal-cell .cal-more { display: block; margin-top: 4px; width: 100%; padding: 2px 4px; border: none; border-radius: 5px; background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 600; cursor: pointer; }
  .cal-cell .cal-more:hover { filter: brightness(.95); }
}
@media (max-width: 480px) {
  .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .filter-bar input, .filter-bar select { min-width: 100%; }
  .filter-bar .f-item { width: 100%; }
  .cal-cell { min-height: 64px; }
}

/* ---------- 客户地址四级结构（省/市/区/具体地址） ---------- */
.addr-grid { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr 1.4fr; gap: 8px; }
.addr-grid select, .addr-grid input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; background: #fff; transition: border .15s, box-shadow .15s;
}
.addr-grid select:focus, .addr-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
@media (max-width: 768px) { .addr-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- 手机号拨号链接 ---------- */
.tel-link { color: var(--primary); font-weight: 600; }
.tel-link:hover { text-decoration: underline; }

/* ---------- 拜访日历图案（行内 emoji 风格，卡通手绘，纯装饰） ---------- */
/* 颜色类给 svg 内部使用，本身不渲染背景 */
.cal-cell.bg-red-flower .cal-emoji svg g { filter: drop-shadow(0 0 0.5px rgba(239, 68, 68, .35)); }
.cal-cell.bg-yellow-flower .cal-emoji svg g { filter: drop-shadow(0 0 0.5px rgba(245, 158, 11, .35)); }
.cal-cell.bg-gray-cry .cal-emoji svg circle:first-child { filter: drop-shadow(0 0 0.5px rgba(107, 114, 128, .35)); }
/* 事件礼品小图标（月饼/粽子/生日蛋糕，跟在「客户名·N访」后） */
.cal-cell .ev .ev-gift { display: inline-flex; vertical-align: -2px; margin-left: 3px; }
.cal-cell .ev .ev-gift svg { display: block; width: 12px; height: 12px; }

/* ---------- 客户地图 ---------- */
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.lg-star { width: 16px; height: 16px; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.lg-star-y { background: #fbbf24; }
.lg-star-b { background: #3b82f6; }
.lg-ring { width: 16px; height: 16px; border: 2px solid #c026d3; border-radius: 50%; box-sizing: border-box; }
.lg-dist { gap: 4px; }
.dist-btn { border: 1px solid var(--border); background: var(--card); color: var(--text-2); font-size: 12px; padding: 3px 11px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.dist-btn:hover { border-color: #d946ef; color: #c026d3; }
.dist-btn.active { background: #c026d3; border-color: #c026d3; color: #fff; font-weight: 600; }
.lg-status { margin-left: auto; color: var(--text-3); font-size: 12px; }
.lg-hint { color: var(--text-3); font-size: 12px; padding-left: 8px; border-left: 1px solid var(--border); }
.lg-level { gap: 4px; }
.lg-level select { border: 1px solid var(--border); background-color: var(--card); color: var(--text-2); font-size: 12px; padding: 3px 8px; border-radius: 999px; cursor: pointer; }
.lg-level select:hover, .lg-level select:focus { border-color: #d946ef; outline: none; }
.map-empty { padding: 60px 20px; }
/* 高德 Key 类型/鉴权失败提示面板（2026-09-12）
   根因：Key 平台类型不匹配时 AMap 实例创建成功但底图不渲染 → 白屏且无任何报错。
   此面板把「静默白屏」变成「明确原因 + 就地修复」。 */
.map-keyfix { margin-bottom: 14px; }
.map-keyfix-box { background: #fffbeb; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: var(--radius); padding: 14px 16px; }
.map-keyfix-head { display: flex; align-items: center; gap: 7px; font-weight: 700; color: #92400e; font-size: 14px; margin-bottom: 6px; }
.map-keyfix-icon { font-size: 15px; line-height: 1; }
.map-keyfix-msg { font-size: 12.5px; color: #78350f; line-height: 1.75; }
.map-keyfix-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #fcd34d; }
.map-keyfix-form label { font-size: 12px; color: #78350f; }
.map-keyfix-form input[type="text"] { width: 100%; box-sizing: border-box; }
.map-marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.map-marker .map-star { line-height: 0; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.map-marker .map-label { margin-top: 3px; display: flex; flex-direction: column; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2px 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); white-space: nowrap; }
.map-marker .map-label span { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.3; }
.map-marker .map-label i { font-style: normal; font-size: 10px; color: var(--text-2); line-height: 1.2; }
.map-user-dot { width: 16px; height: 16px; border-radius: 50%; background: #16a34a; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(22, 163, 74, .4), 0 1px 4px rgba(0, 0, 0, .3); }
.map-customer-list { margin-top: 16px; }
.mcli-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mcli-item { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; transition: all .15s; }
.mcli-item:hover { background: #f1f5f9; border-color: #cbd5e1; transform: translateY(-1px); box-shadow: var(--shadow); }
.mcli-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.mcli-name { font-weight: 700; color: var(--text); font-size: 14px; }
.mcli-level { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #e0e7ff; color: #4338ca; }
.mcli-type { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f3f4f6; color: var(--text-2); }
.mcli-sub { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.mcli-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.mcli-badge.exact { background: #dcfce7; color: #15803d; }
.mcli-badge.approx { background: #ffedd5; color: #c2410c; }
.mcli-abnormal .mcli-item { background: #fef2f2; border-color: #fecaca; }
.mcli-abnormal .mcli-item:hover { background: #fee2e2; border-color: #fca5a5; }
.mcli-abnormal .mcli-sub { color: #dc2626; }

/* ===================== 批量导入向导 ===================== */
.import-wizard { display: flex; flex-direction: column; gap: 14px; }
.wiz-steps { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.wiz-step { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.wiz-step .num { width: 22px; height: 22px; border-radius: 50%; background: var(--border); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.wiz-step.on { color: var(--primary); }
.wiz-step.on .num { background: var(--primary); color: #fff; }
.wiz-step + .wiz-step::before { content: ''; width: 32px; height: 1px; background: var(--border); margin-right: 4px; }
.wiz-body { min-height: 280px; padding: 8px 0; }
.wiz-intro p { color: var(--text-2); line-height: 1.7; }
.wiz-uploader { display: flex; flex-direction: column; gap: 12px; }
.wiz-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 16px; text-align: center; cursor: pointer; transition: all .15s; background: #fafbfc; }
.wiz-upload-area:hover, .wiz-upload-area.drag { border-color: var(--primary); background: #f0f9ff; }
.wiz-upload-icon { font-size: 36px; margin-bottom: 8px; }
.wiz-upload-text { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.wiz-upload-hint { font-size: 12px; color: var(--text-3); }
.wiz-progress { background: var(--bg-2); padding: 10px 14px; border-radius: var(--radius-sm); }
.wiz-progress .bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.wiz-progress .fill { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.wiz-progress .lbl { font-size: 12px; color: var(--text-2); }
.wiz-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wiz-summary.compact { grid-template-columns: repeat(3, 1fr); max-width: 480px; }
.wiz-summary .sum-item { background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; text-align: center; }
.wiz-summary .sum-item b { display: block; font-size: 24px; line-height: 1; margin-bottom: 4px; }
.wiz-summary .sum-item span { font-size: 12px; color: var(--text-2); }
.wiz-summary .sum-item.ok { background: #ecfdf5; border-color: #a7f3d0; }
.wiz-summary .sum-item.ok b { color: #047857; }
.wiz-summary .sum-item.err { background: #fef2f2; border-color: #fecaca; }
.wiz-summary .sum-item.err b { color: #b91c1c; }
.wiz-summary .sum-item.warn { background: #fffbeb; border-color: #fde68a; }
.wiz-summary .sum-item.warn b { color: #b45309; }
.wiz-summary .sum-item.total { background: #eff6ff; border-color: #bfdbfe; }
.wiz-summary .sum-item.total b { color: #1d4ed8; }
.wiz-details { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.wiz-details summary { padding: 10px 14px; background: #fafbfc; cursor: pointer; font-weight: 600; font-size: 13px; }
.wiz-list { max-height: 260px; overflow-y: auto; padding: 6px 0; }
.wiz-list .row { display: grid; grid-template-columns: 60px 1fr 130px 2fr; gap: 10px; padding: 6px 14px; font-size: 13px; align-items: center; border-bottom: 1px dashed var(--border); }
.wiz-list .row:last-child { border-bottom: 0; }
.wiz-list .row.err { background: #fef2f2; }
.wiz-list .row.warn { background: #fffbeb; }
.wiz-list .rn { color: var(--text-3); font-size: 12px; font-weight: 600; }
.wiz-list .nm { color: var(--text); font-weight: 500; }
.wiz-list .ph { color: var(--text-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.wiz-list .er { color: var(--text-2); font-size: 12px; }

/* ===================== 数据看板「今日待办」面板 ===================== */
.today-todo-card .today-todo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 1500px) { .today-todo-card .today-todo-grid { grid-template-columns: repeat(8, 1fr); } }
@media (max-width: 1100px) { .today-todo-card .today-todo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .today-todo-card .today-todo-grid { grid-template-columns: repeat(2, 1fr); } }
.today-todo-card .todo-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #fafbfc; cursor: pointer; transition: all .15s; }
.today-todo-card .todo-item:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.today-todo-card .todo-item[data-empty="1"] { opacity: .55; }
.today-todo-card .todo-icon { font-size: 24px; line-height: 1; }
.today-todo-card .todo-num { font-size: 22px; font-weight: 700; line-height: 1; }
.today-todo-card .todo-lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.today-todo-card .todo-item.tone-pink { background: #fff5f7; border-color: #fbcfe8; }
.today-todo-card .todo-item.tone-pink .todo-num { color: #be185d; }
.today-todo-card .todo-item.tone-amber { background: #fffbeb; border-color: #fde68a; }
.today-todo-card .todo-item.tone-amber .todo-num { color: #b45309; }
.today-todo-card .todo-item.tone-red { background: #fef2f2; border-color: #fecaca; }
.today-todo-card .todo-item.tone-red .todo-num { color: #b91c1c; }
.today-todo-card .todo-item.tone-orange { background: #fff7ed; border-color: #fed7aa; }
.today-todo-card .todo-item.tone-orange .todo-num { color: #c2410c; }
.today-todo-card .todo-item.tone-purple { background: #faf5ff; border-color: #e9d5ff; }
.today-todo-card .todo-item.tone-purple .todo-num { color: #7c3aed; }
.today-todo-card .todo-item.tone-gray { background: #f9fafb; border-color: #e5e7eb; }
.today-todo-card .todo-item.tone-gray .todo-num { color: #4b5563; }

/* ===================== 业绩目标模块 ===================== */
.goals-card { padding: 14px 18px 16px; }
.goals-card .card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.goals-card .card-title .goals-title-text { flex: 1; }
.goals-card .goals-actions { display: flex; gap: 8px; align-items: center; }
.goals-card .goals-period-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.goals-card .goals-progress-grid { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 18px; align-items: center; }
.goals-card .goal-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius); }
.goals-card .goal-ring svg { display: block; }
.goals-card .goal-ring .ring-label { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.goals-card .goal-ring .ring-sub { font-size: 11px; color: var(--text-3); }
.goals-card .goal-ring .ring-num { font-size: 22px; font-weight: 700; line-height: 1; }
.goals-card .goal-ring.over .ring-num { color: #16a34a; }
.goals-card .goal-ring.normal .ring-num { color: var(--primary); }
.goals-card .goal-ring.low .ring-num { color: #ea580c; }
.goals-card .goal-ring.empty { opacity: .65; }
.goals-card .goal-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.goals-card .leaderboard { background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.goals-card .leaderboard-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.goals-card .leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.goals-card .leaderboard-table th, .goals-card .leaderboard-table td { padding: 5px 6px; text-align: right; }
.goals-card .leaderboard-table th:first-child, .goals-card .leaderboard-table td:first-child { text-align: left; }
.goals-card .leaderboard-table th { font-size: 11px; color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--border); }
.goals-card .leaderboard-table tr.me { background: #eff6ff; font-weight: 600; }
.goals-card .leaderboard-table tr.me td:first-child::before { content: '📍 '; }
.goals-card .leaderboard-table .rank-1 td:first-child { color: #d97706; font-weight: 700; }
.goals-card .leaderboard-table .rank-2 td:first-child { color: #6b7280; font-weight: 600; }
.goals-card .leaderboard-table .rank-3 td:first-child { color: #92400e; font-weight: 600; }
.goals-card .leaderboard-table .medal-1::before { content: '🥇 '; }
.goals-card .leaderboard-table .medal-2::before { content: '🥈 '; }
.goals-card .leaderboard-table .medal-3::before { content: '🥉 '; }
.goals-card .leaderboard-empty { font-size: 12px; color: var(--text-3); padding: 18px 8px; text-align: center; }
.goals-card .no-goal-hint { background: #fffbeb; border: 1px dashed #fde68a; padding: 10px 14px; border-radius: 8px; font-size: 13px; color: #92400e; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 900px) { .goals-card .goals-progress-grid { grid-template-columns: 1fr 1fr; } .goals-card .leaderboard { grid-column: 1 / -1; } }
@media (max-width: 600px) { .goals-card .goals-progress-grid { grid-template-columns: 1fr; } }

/* ============ 全局搜索（Cmd/Ctrl+K） ============ */
.btn-search-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px; min-width: 200px;
  border: 1px solid var(--border); border-radius: 8px; background: #f5f7fa;
  color: var(--text-2); font-size: 13px; cursor: pointer; outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-search-trigger:hover { background: #eef2f7; border-color: #d1d5db; color: var(--text-1); }
.btn-search-trigger .si-ico { font-size: 14px; }
.btn-search-trigger .si-text { flex: 1; text-align: left; }
.btn-search-trigger .si-kbd {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 11px;
  padding: 2px 6px; border: 1px solid #d1d5db; border-radius: 4px;
  background: #fff; color: var(--text-2);
}
@media (max-width: 700px) { .btn-search-trigger .si-text, .btn-search-trigger .si-kbd { display: none; } .btn-search-trigger { min-width: 0; padding: 6px 10px; } }

.search-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; }
.search-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
.search-panel {
  position: relative; width: min(640px, 92vw); max-height: 70vh;
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.05);
  display: flex; flex-direction: column; overflow: hidden;
  animation: search-panel-in 0.15s ease-out;
}
@keyframes search-panel-in { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.search-input-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); background: #fafbfc;
}
.search-icon { font-size: 18px; color: var(--text-2); }
.search-input-row input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--text-1); padding: 4px 0;
}
.search-input-row input::placeholder { color: var(--text-3); }
.search-hint {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 11px;
  padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; color: var(--text-2);
}

.search-type-chips { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: #fff; overflow-x: auto; }
.search-type-chips .chip {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.search-type-chips .chip:hover { background: #f3f4f6; color: var(--text-1); }
.search-type-chips .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.search-summary { padding: 8px 16px; font-size: 12px; color: var(--text-3); background: #fafbfc; border-bottom: 1px solid var(--border); }
.search-results { flex: 1; overflow-y: auto; min-height: 100px; max-height: 50vh; padding: 6px 0; }
.search-empty { padding: 24px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.search-kbd-hint { font-size: 12px; line-height: 1.6; }
.search-loading { padding: 20px 16px; text-align: center; color: var(--text-2); font-size: 13px; }
.search-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%; vertical-align: -2px; margin-right: 6px; animation: search-spin 0.7s linear infinite; }
@keyframes search-spin { to { transform: rotate(360deg); } }

.search-group-title { padding: 10px 16px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.search-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 16px; cursor: pointer; transition: background 0.1s;
  border-left: 3px solid transparent;
}
.search-row:hover, .search-row.cursor { background: #eff6ff; border-left-color: var(--primary); }
.search-row-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.search-row-icon { font-size: 18px; flex-shrink: 0; }
.search-row-text { flex: 1; min-width: 0; }
.search-row-title { font-size: 14px; color: var(--text-1); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-row-go { color: var(--text-3); font-size: 14px; flex-shrink: 0; }
.search-row.cursor .search-row-go { color: var(--primary); }
.search-row mark { background: #fef3c7; color: inherit; padding: 0 1px; border-radius: 2px; font-weight: 600; }

/* ===================== 客户标签 / 画像 ===================== */
.tag-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag-chips .tag-chip { font-size: 12px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: .2px;
  white-space: nowrap;
  cursor: default;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .12s;
}
.tag-chip.removable { cursor: default; padding-right: 4px; }
.tag-chip.removable:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.tag-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255, 255, 255, .35); border: none; cursor: pointer;
  color: inherit; font-size: 14px; line-height: 1; padding: 0;
  transition: background .12s;
}
.tag-chip-x:hover { background: rgba(255, 255, 255, .6); }

/* 详情抽屉里的标签 chips 和添加行 */
.detail-section .tag-chips { padding: 4px 0 8px; }
.tag-add-row {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px; padding: 12px;
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px;
}
.tag-add-row input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  outline: none; transition: border .12s; font-size: 13px;
}
.tag-add-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.tag-add-suggest { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.tag-add-suggest .tag-chip { cursor: pointer; }
.tag-add-suggest .tag-chip:hover { transform: scale(1.05); }
.tag-suggest-empty { color: var(--text-3, #94a3b8); font-size: 12px; }
/* 详情「添加标签」多选（仅从已有标签勾选，不可新增） */
.tag-add-hint { font-size: 12px; color: var(--text-3, #94a3b8); }
.tag-add-suggest .tag-pick-grid { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.tag-add-suggest .tag-pick {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 12px; border-radius: 15px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; line-height: 1.5;
  border: 2px solid transparent; transition: transform .12s, box-shadow .12s, border-color .12s;
  user-select: none;
}
.tag-add-suggest .tag-pick:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.tag-add-suggest .tag-pick.on {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .25);
}
.tag-add-suggest .tag-pick-empty { color: var(--text-3, #94a3b8); font-size: 12px; }
.tag-chip-dx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 2px;
  border: none; border-radius: 50%; padding: 0;
  background: rgba(255, 255, 255, .4);
  color: inherit; font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer; transition: background .12s, color .12s;
}
.tag-chip-dx:hover { background: rgba(255, 255, 255, .85); color: var(--danger, #dc2626); transform: scale(1.12); }
.tag-add-foot { display: flex; align-items: center; gap: 12px; }
.tag-scope-label { font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.tag-scope-label select {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 13px; outline: none;
}

/* 客户列表的多标签筛选行 */
.tag-filter-row {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tag-filter-row .tfr-label { font-size: 13px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.tag-filter-row .tfr-mode { display: inline-flex; background: #f1f4f9; border-radius: 8px; padding: 3px; gap: 2px; }
.tag-filter-row .mode-btn {
  border: none; background: transparent; padding: 4px 12px; border-radius: 6px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; font-weight: 600;
  transition: all .12s;
}
.tag-filter-row .mode-btn.on { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37, 99, 235, .35); }
.tag-filter-row .mode-btn:not(.on):hover { color: var(--primary); }
.tag-filter-row .tfr-chips {
  display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-width: 280px; align-items: center;
}
.tag-filter-row .tfr-loading { color: var(--text-3); font-size: 12.5px; }
.tag-filter-row .tfr-hint { color: var(--text-3); font-size: 12.5px; padding: 2px 4px; }
.tag-filter-row .tfr-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 14px;
  font-size: 12.5px; font-weight: 600; line-height: 1.55; cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.tag-filter-row .tfr-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.tag-filter-row .tfr-chip.sel { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.tag-filter-row .tfr-chip i {
  font-style: normal; font-size: 12px; line-height: 1;
  width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .35); border-radius: 50%; margin-left: 2px;
}
.tag-filter-row .tfr-clear {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  padding: 4px 12px; border-radius: 6px; font-size: 12.5px; cursor: pointer; flex-shrink: 0;
}
.tag-filter-row .tfr-clear:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }
/* 标签管理操作入口 */
.tag-filter-row .tfr-ops { display: inline-flex; gap: 8px; margin-left: auto; align-items: center; flex-shrink: 0; }
.tag-filter-row .tfr-ops .btn { padding: 5px 12px; font-size: 12.5px; }

/* ===== 新增标签弹窗（2026-09-12 重做：预览 + 颜色 + 角色化范围） ===== */
#modalMask .tg-new-head {
  background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px;
}
#modalMask .tg-new-preview-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#modalMask .tg-new-preview-label { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
#modalMask .tg-new-preview {
  display: inline-flex; align-items: center; padding: 4px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px dashed var(--border);
  background: #fff; color: var(--text-3); transition: all .16s;
}
#modalMask .tg-new-preview.filled { border-style: solid; border-color: transparent; }
#modalMask .tg-new-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-top: 9px; }
/* 纵向字段布局：必须写成 .f-item.tg-new-field（两个 class）才能盖过 1127 行
   的 `#modalMask .f-item { display:flex }` —— 两者同为 #id+1class 特异性时，
   靠后者胜出；而 .f-item 规则在本文件更下方，故这里必须提高一个 class 的特异性。 */
#modalMask .f-item.tg-new-field { display: block; margin-bottom: 16px; }
#modalMask .f-item.tg-new-field > label {
  display: flex; align-items: baseline; gap: 8px;
  min-width: 0; margin-bottom: 7px; font-size: 13px; color: var(--text-2); font-weight: 600;
}
#modalMask .tg-new-count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
#modalMask .f-item.tg-new-field input[type="text"] {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; transition: all .15s;
}
#modalMask .f-item.tg-new-field input[type="text"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
/* 颜色选择 */
#modalMask .tg-color-row { display: flex; gap: 9px; flex-wrap: wrap; }
#modalMask .tg-color-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; transition: transform .14s, box-shadow .14s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}
#modalMask .tg-color-dot:hover { transform: scale(1.12); }
#modalMask .tg-color-dot.on {
  border-color: #fff; transform: scale(1.14);
  box-shadow: 0 0 0 2px var(--primary), 0 2px 6px rgba(0, 0, 0, .2);
}
/* 范围选择（管理员：两个卡片式选项） */
/* 2 个选项→两列；3 个选项（admin 有公共/团队/仅自己）→自动折行，避免最后一个孤零零占半行 */
#modalMask .tg-scope-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
#modalMask .tg-scope-opt {
  text-align: left; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: all .15s;
}
#modalMask .tg-scope-opt b { font-size: 13px; color: var(--text); font-weight: 600; }
#modalMask .tg-scope-opt small { font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
#modalMask .tg-scope-opt:hover { border-color: #c7d7f5; background: #fafbff; }
#modalMask .tg-scope-opt.on {
  border-color: var(--primary); background: #eff5ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
#modalMask .tg-scope-opt.on b { color: var(--primary); }
/* 普通用户：锁定为私有，只展示说明 */
#modalMask .tg-scope-locked {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: #f8fafc; border: 1px solid var(--border);
}
#modalMask .tg-scope-locked .tg-scope-lock-icon { font-size: 15px; line-height: 1.4; flex-shrink: 0; }
#modalMask .tg-scope-locked b { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
#modalMask .tg-scope-locked small { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
/* 管理标签弹窗说明 */
#modalMask .tg-mgr-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.75; margin-bottom: 12px; }
#modalMask .tg-mgr-note {
  font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: var(--radius-sm); padding: 8px 11px; margin-bottom: 12px; line-height: 1.65;
}
/* B5 智能筛选行：与手动标签行同为卡片浮层，用细分隔线 + 浅底区分“系统派生”语义 */
.smart-filter-row {
  margin-top: -4px;
  padding-top: 10px; padding-bottom: 10px;
  border-top: 1px dashed var(--border);
  background: linear-gradient(0deg, rgba(37, 99, 235, .045), rgba(37, 99, 235, .045)), var(--card);
  box-shadow: none;
}
.tag-filter-row .tfr-smart-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.smart-filter-row .tfr-chip { border-color: transparent; background: rgba(37, 99, 235, .08); color: var(--primary, #2563eb); }
.smart-filter-row .tfr-chip:hover { background: rgba(37, 99, 235, .13); }
.smart-filter-row .tfr-chip.sel {
  box-shadow: 0 0 0 1.5px var(--primary, #2563eb), inset 0 0 0 1.5px #fff;
  background: var(--primary-light, #eff4ff);
  color: var(--primary, #2563eb);
}
.smart-filter-row .tfr-chip.sel i { background: var(--primary, #2563eb); color: #fff; }
/* 新增标签 / 管理标签弹窗 */
#modalMask .mt-row { align-items: center; }
#modalMask .mt-scope {
  border: 1px solid var(--border); padding: 1px 6px; border-radius: 10px; font-size: 11px;
}
#modalMask .f-item { display: flex; align-items: center; gap: 8px; }
#modalMask .f-item label { flex-shrink: 0; min-width: 64px; font-size: 13px; color: var(--text-2); }
#modalMask .f-item input, #modalMask .f-item select { flex: 1; }

/* 客户列表表格里的标签列 */
table.tbl .tag-chips { max-width: 240px; }

/* 看板标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 4px; }
.tag-cloud-head { width: 100%; display: flex; justify-content: flex-end; margin-bottom: 4px; }
.tag-cloud-hint { color: var(--text-3, #94a3b8); font-size: 12px; }
.tag-cloud-item {
  display: inline-flex; align-items: center;
  padding: 4px 14px; border-radius: 20px;
  font-weight: 700; line-height: 1.4; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .12s;
  position: relative;
}
.tag-cloud-item sup { font-size: .55em; font-weight: 600; opacity: .9; margin-left: 4px; padding: 1px 5px; background: rgba(255, 255, 255, .35); border-radius: 8px; }
.tag-cloud-item:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.tag-cloud-x {
  margin-left: 6px;
  width: 18px; height: 18px;
  display: none; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  color: inherit;
  cursor: pointer;
  padding: 0;
  transition: background .12s;
}
.tag-cloud-item:hover .tag-cloud-x { display: inline-flex; }
.tag-cloud-x:hover { background: rgba(255, 255, 255, .85); color: var(--danger, #dc2626); }

/* ===================== 路线规划 ===================== */
.route-toolbar { padding: 14px 18px; margin-bottom: 16px; }
.route-tb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.route-tb-row + .route-tb-row { margin-top: 10px; }
.route-tb-label { font-weight: 600; color: var(--text-1); font-size: 14px; }
.route-tb-input { padding: 6px 10px; border: 1px solid var(--border-1); border-radius: 6px; font-size: 14px; background: #fff; }
.route-tb-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.route-tb-check { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--text-1); user-select: none; }
.route-tb-check input { cursor: pointer; }
.route-tb-tip { font-size: 12px; color: var(--text-2); margin-left: auto; }
.route-tb-stat { border-top: 1px dashed var(--border-1); padding-top: 10px; }
.route-tb-icon { font-size: 18px; }
.route-tb-quick { padding: 8px 0 2px; gap: 6px; align-items: center; }
.route-tb-quick-lbl { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.route-qbtn { padding: 4px 12px; border: 1px solid var(--border); background: #fff; border-radius: 16px; font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .15s; }
.route-qbtn:hover { border-color: var(--primary); color: var(--primary); }
.route-qbtn-on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.route-qbtn-on:hover { background: var(--primary); color: #fff; }
.route-tb-divider { width: 1px; height: 16px; background: var(--border); margin: 0 6px; }

.route-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
@media (max-width: 900px) { .route-grid { grid-template-columns: 1fr; } }
.route-list-card { padding: 14px 16px; max-height: 520px; overflow-y: auto; }
.route-list { display: flex; flex-direction: column; gap: 8px; }

.route-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-2); border-radius: 8px; cursor: pointer; transition: background .15s, transform .12s; }
.route-item:hover { background: #eff6ff; transform: translateX(2px); }
.route-seq { flex: 0 0 28px; height: 28px; line-height: 28px; text-align: center; background: #2563eb; color: #fff; border-radius: 50%; font-weight: 700; font-size: 13px; }
.route-item-body { flex: 1; min-width: 0; }
.route-item-name { font-weight: 600; color: var(--text-1); font-size: 14px; }
.route-item-addr { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.route-item-dist { font-size: 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; }

.route-stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg-2); border-radius: 16px; font-size: 12px; color: var(--text-1); margin-right: 6px; }
.route-stat-chip b { color: #2563eb; font-weight: 700; }
.route-stat-warn { background: #fef3c7; color: #92400e; }
.route-stat-warn b { color: #b45309; }

.route-marker { width: 32px; height: 32px; background: #2563eb; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; }
.route-marker-num { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 14px; }
/* 路线起点标记（绿色，区别于客户蓝色标号） */
.route-origin-marker { width: 34px; height: 34px; background: #10b981; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 8px rgba(0, 0, 0, .28); display: flex; align-items: center; justify-content: center; }
.route-origin-marker-num { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 15px; }
.route-origin-marker-label { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(16, 185, 129, .95); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); pointer-events: none; }
.route-origin-marker-label::after { content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); border: 4px solid transparent; border-top-color: rgba(16, 185, 129, .95); border-bottom: 0; }

.route-unresolved { display: flex; flex-direction: column; gap: 6px; }
.route-unr-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #fef3c7; border-radius: 6px; font-size: 13px; }
.route-unr-name { font-weight: 600; color: #92400e; }
.route-unr-name:hover { color: #b45309; text-decoration: underline; }
.route-unr-addr { color: var(--text-2); flex: 1; }

/* ===================== RFM 客户分层 8 宫格 ===================== */
.rfm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 4px 0 8px;
}
.rfm-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  user-select: none;
}
.rfm-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.rfm-icon { font-size: 28px; margin-bottom: 6px; line-height: 1; }
.rfm-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.rfm-count { font-size: 24px; font-weight: 700; line-height: 1.1; }
.rfm-pct { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.rfm-cell[data-count="0"] { opacity: 0.45; }

.rfm-cell.tone-gold     { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.rfm-cell.tone-green    { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.rfm-cell.tone-blue     { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e3a8a; }
.rfm-cell.tone-red      { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; }
.rfm-cell.tone-amber    { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.rfm-cell.tone-cyan     { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); color: #155e75; }
.rfm-cell.tone-gray     { background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); color: #374151; }
.rfm-cell.tone-purple   { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); color: #5b21b6; }

.rfm-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-1, #e5e7eb);
  font-size: 12px;
  color: var(--text-2);
}
.rfm-foot b { color: var(--text-1, #1f2937); font-weight: 600; margin: 0 4px; }

/* RFM「规则说明」折叠区 */
#rfmCard .rfm-rules-toggle { white-space: nowrap; }
.rfm-rules { margin-top: 14px; border-top: 1px dashed var(--border-1, #e5e7eb); padding-top: 12px; }
.rfm-rules-section { margin-bottom: 16px; }
.rfm-rules-h { font-size: 13px; font-weight: 700; color: var(--text-1, #1f2937); margin-bottom: 10px; }
.rfm-rules-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rfm-rule-col { background: var(--bg-1, #f8fafc); border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 10px 12px; }
.rfm-rule-name { font-size: 12px; font-weight: 700; color: var(--text-2, #475569); margin-bottom: 6px; }
.rfm-rule-list { list-style: none; margin: 0; padding: 0; }
.rfm-rule-list li { font-size: 12px; color: var(--text-2, #475569); padding: 3px 0; border-bottom: 1px dashed rgba(0,0,0,.05); }
.rfm-rule-list li:last-child { border-bottom: none; }
.rfm-rule-list li b { color: var(--primary, #2563eb); font-weight: 700; min-width: 34px; display: inline-block; }
.rfm-rules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rfm-rule-cls { background: var(--bg-1, #f8fafc); border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 9px 11px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2, #475569); }
.rfm-rule-cls .rfm-rule-ic { font-size: 16px; line-height: 1; }
.rfm-rule-cls b { color: var(--text-1, #1f2937); }
.rfm-rule-cls code { font-size: 11px; color: var(--primary, #2563eb); background: rgba(37, 99, 235, .08); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, monospace; }
.rfm-rules-note { margin-top: 10px; font-size: 11px; color: var(--text-3, #94a3b8); }
@media (max-width: 900px) {
  .rfm-rules-cols { grid-template-columns: 1fr; }
  .rfm-rules-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 明细弹窗共用表格基底（RFM 明细 / 应访清单共用）：此前 drill-table 无基底样式，
   会退化为浏览器默认表格（双边线/非全宽/表头无底色/无隔行），观感差。此处统一打底。 */
table.drill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.drill-table th,
table.drill-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: middle;
  white-space: nowrap;
}
table.drill-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-2, #475569);
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-1, #f5f7fa);
  border-bottom: 1px solid var(--border-1, #d8dee6);
}
table.drill-table tbody tr { transition: background .12s; }
table.drill-table tbody tr:hover td { background: rgba(37, 99, 235, .05); }
table.drill-table tbody tr:nth-child(even) { background: #fafbfc; }
table.drill-table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.drill-table th.num { text-align: right; }
table.drill-table.rfm-detail th, table.drill-table.rfm-detail td { padding: 8px 10px; }
.rfm-scores { font-family: ui-monospace, SFMono-Regular, monospace; font-weight: 600; color: var(--text-1); }

@media (max-width: 900px) {
  .rfm-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== B6 回访节奏 · 应访提醒（RFM 卡下方横条 + 应访清单弹窗） ===================== */
#cadenceBox { margin-top: 14px; border-top: 1px dashed var(--border-1, #e5e7eb); padding-top: 12px; }
.cadence-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-1, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 14px;
}
.cadence-summary { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-title { font-size: 13px; font-weight: 700; color: var(--text-1, #1f2937); }
.cs-hint { font-size: 11px; color: var(--text-3, #94a3b8); }
.cadence-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cad-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2, #475569);
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  user-select: none;
}
.cad-chip:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transform: translateY(-1px); }
.cad-chip b { font-weight: 800; font-size: 13px; }
.cad-chip.c-red   { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; border-color: #fca5a5; }
.cad-chip.c-orange{ background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); color: #9a3412; border-color: #fdba74; }
.cad-chip.c-amber { background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%); color: #854d0e; border-color: #facc15; }
.cad-chip.c-gray  { background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); color: #374151; border-color: #d1d5db; }
.cadence-open { flex-shrink: 0; }
@media (max-width: 720px) {
  .cadence-strip { flex-direction: column; align-items: flex-start; }
}

/* —— 应访清单弹窗 —— */
.cad-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 12px;
  background: var(--bg-1, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
}
.cad-toolbar .ct-desc { font-size: 12px; line-height: 1.6; color: var(--text-2, #475569); flex: 1 1 260px; min-width: 0; }
.cad-toolbar .ct-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.ct-legend .lg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2, #475569); white-space: nowrap; }
.ct-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cad-count { font-weight: 700; }
.cad-count b { color: var(--primary, #2563eb); }

.cad-list-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; margin-top: 2px; }
table.drill-table.cad-list { border-collapse: separate; border-spacing: 0; table-layout: auto; font-size: 12.5px; }
table.drill-table.cad-list thead th { background: var(--bg-1, #f2f4f8); }
/* 关键列不换行、宽窄分配：客户/操作列稍宽，日期/周期/等级列给最小宽度防压扁 */
table.drill-table.cad-list th, table.drill-table.cad-list td { padding: 7px 9px; white-space: nowrap; }
/* 1客户 2等级 3RFM档位 4回访周期 5最近拜访/建档 6应访日 7状态 8联系方式 9操作 */
table.drill-table.cad-list td:nth-child(1), table.drill-table.cad-list th:nth-child(1) { min-width: 62px; }
table.drill-table.cad-list td:nth-child(2), table.drill-table.cad-list th:nth-child(2) { min-width: 48px; text-align: center; }
table.drill-table.cad-list td:nth-child(3), table.drill-table.cad-list th:nth-child(3) { min-width: 82px; }
table.drill-table.cad-list td:nth-child(4), table.drill-table.cad-list th:nth-child(4) { min-width: 48px; }
table.drill-table.cad-list td:nth-child(5), table.drill-table.cad-list th:nth-child(5) { min-width: 92px; }
table.drill-table.cad-list td:nth-child(6), table.drill-table.cad-list th:nth-child(6) { min-width: 88px; }
table.drill-table.cad-list td:nth-child(7), table.drill-table.cad-list th:nth-child(7) { min-width: 72px; }
table.drill-table.cad-list td:nth-child(8), table.drill-table.cad-list th:nth-child(8) { min-width: 98px; }
table.drill-table.cad-list td:nth-child(9), table.drill-table.cad-list th:nth-child(9) { min-width: 110px; }
table.drill-table.cad-list tbody tr:nth-child(even) { background: #fafbfc; }
table.drill-table.cad-list .cad-ops { text-align: right; }
table.drill-table.cad-list th.cad-th-ops { text-align: right; }
table.drill-table.cad-list .cad-ops .btn {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 7px;
}
table.drill-table.cad-list .cad-ops .btn + .btn { margin-left: 6px; margin-right: 0; }
.cad-list-wrap .cad-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px 16px; color: var(--text-3, #94a3b8); font-size: 13px; }
.cad-list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-2, #475569);
}
.cad-list-foot .clf-tip { color: var(--text-3, #94a3b8); }
.cad-name { font-weight: 600; color: var(--text-1, #1f2937); }
table.drill-table.cad-list a.link.cad-name:hover { color: var(--primary, #2563eb); }
.cad-seg {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.cad-seg.tone-gold   { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.cad-seg.tone-green  { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.cad-seg.tone-blue   { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e3a8a; }
.cad-seg.tone-red    { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; }
.cad-seg.tone-amber  { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.cad-seg.tone-cyan   { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); color: #155e75; }
.cad-seg.tone-gray   { background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); color: #374151; }
.cad-seg.tone-purple { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); color: #5b21b6; }
.cad-interval { color: var(--text-2, #475569); }
.cad-state {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.cad-phone { color: var(--primary, #2563eb); font-weight: 600; text-decoration: none; white-space: nowrap; }
.cad-phone:hover { text-decoration: underline; }
.cad-name-cell { font-weight: 500; }
.cad-base-sub { display: block; font-size: 11px; color: var(--text-3, #94a3b8); margin-top: 1px; font-weight: 400; }

/* ===================== 二次增量：客户详情 家庭/保障/理赔 ===================== */
/* 家庭成员 */
.fam-wrap { display: flex; flex-direction: column; gap: 6px; }
.fam-node { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.fam-node.self { background: var(--primary-light, #eff4ff); border: 1px solid rgba(37, 99, 235, .18); }
.fam-node.other { background: var(--bg-1, #f8fafc); border: 1px solid var(--border, #e5e7eb); }
.fam-node.other:hover { border-color: var(--primary); background: #fff; }
.fam-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.fam-node b { font-weight: 600; }
.fam-rel { display: inline-block; margin-left: 6px; font-size: 11px; border: 1px solid currentColor; border-radius: 20px; padding: 0 7px; line-height: 16px; vertical-align: 1px; }
.fam-del { font-size: 12px; }
.fam-rel-grid { display: flex; flex-wrap: wrap; gap: 6px; }
/* 通用 tag-pick（可点击多选 pill；可被下方 .on 选中态覆盖） */
.tag-pick { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 20px; cursor: pointer; font-size: 13px; user-select: none; background: var(--bg-1, #f1f5f9); color: var(--text-1, #1f2937); border: 1px solid var(--border, #e5e7eb); transition: all .15s; }
.tag-pick:hover { transform: scale(1.03); box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.tag-pick.on { background: var(--primary, #2563eb); color: #fff; border-color: var(--primary, #2563eb); }

/* ===================== 二次增量：今日行动清单（B4） ===================== */
.todo-done-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-2, #4b5563); background: var(--bg-1, #f1f5f9); border: 1px solid var(--border, #e5e7eb); border-radius: 999px; padding: 1px 9px; }
.todo-done-badge.has-done { color: #15803d; background: #ecfdf5; border-color: #a7f3d0; }
.act-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 7px 10px; background: var(--primary-light, #eff6ff); border: 1px dashed rgba(37,99,235,.3); border-radius: 10px; }
.notif-item .act-check { display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.notif-item .act-done-cb { width: 17px; height: 17px; accent-color: #16a34a; cursor: pointer; }
.notif-item.act-done .n-body { text-decoration: line-through; text-decoration-color: rgba(22,163,74,.6); }
.notif-item.act-done .n-title { color: #16a34a; }
.notif-item.act-done { background: #f0fdf4 !important; border-color: #bbf7d0 !important; }

/* ===================== 必访设置（2026-09-13 v3：四周期可叠加） ===================== */
/* 必访周期多选 + 必访周/事由（通知中心 / 拜访日历的必访设置弹窗、客户详情抽屉共用） */
.mv-box { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 10px 12px; background: #f8fafc; }
.mv-switch { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.mv-switch input { width: 17px; height: 17px; accent-color: #dc2626; cursor: pointer; }
.mv-switch .mv-hint { color: var(--text-3, #94a3b8); font-size: 12px; font-weight: 400; }
.mv-switch-label { font-size: 13.5px; font-weight: 600; color: var(--text, #1f2937); }
.mv-switch-label .mv-hint { color: var(--text-3, #94a3b8); font-size: 12px; font-weight: 400; }
/* 四周期多选块 */
.mv-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
@media (max-width: 560px) { .mv-periods { grid-template-columns: 1fr; } }
.mv-period {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer;
  border: 1px solid var(--border, #e5e7eb); border-radius: 9px; background: #fff; transition: all .12s;
}
.mv-period:hover { border-color: #fca5a5; }
.mv-period:has(input:checked) { border-color: #dc2626; background: #fff1f2; box-shadow: 0 0 0 2px rgba(220,38,38,.08); }
.mv-period input { width: 16px; height: 16px; accent-color: #dc2626; cursor: pointer; flex-shrink: 0; }
.mv-period-lab { font-size: 13px; font-weight: 600; color: var(--text, #1f2937); }
.mv-period-tip { font-size: 11.5px; color: var(--text-3, #94a3b8); margin-left: auto; white-space: nowrap; }
.mv-extra { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb); display: flex; flex-direction: column; gap: 8px; }
.mv-extra[hidden] { display: none; }
.mv-row { display: flex; align-items: center; gap: 8px; }
.mv-row .mv-lab { width: 62px; flex-shrink: 0; font-size: 13px; color: var(--text-2, #4b5563); }
.mv-row input[type="week"] { padding: 5px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; font-size: 13px; }
.mv-row input[type="text"] { flex: 1; padding: 6px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; font-size: 13px; }
.mv-row input:disabled { background: #f1f5f9; color: var(--text-3, #94a3b8); cursor: not-allowed; }
.mv-tip { font-size: 12px; color: var(--text-3, #94a3b8); }
/* v4：单一「必访周」+ 系统自动归类预告 */
.mv-auto { font-size: 12.5px; color: var(--text-2, #4b5563); }
.mv-auto-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 4px; vertical-align: middle; }
.mv-auto-tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca;
}
.mv-switch-label .mv-hint, .mv-box .mv-hint { color: var(--text-3, #94a3b8); font-size: 12px; font-weight: 400; }

/* 必访设置弹窗：客户搜索区（需求：点「必访设置」弹窗内可直接搜客户） */
.mv-search-box { position: relative; margin-bottom: 12px; }
.mv-search-box input {
  width: 100%; padding: 8px 32px 8px 12px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 9px; font-size: 13.5px; box-sizing: border-box;
}
.mv-search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.mv-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--text-3, #94a3b8); font-size: 15px;
  cursor: pointer; padding: 4px 6px; line-height: 1; border-radius: 6px;
}
.mv-search-clear:hover { color: var(--text); background: #f1f5f9; }
.mv-search-tip { font-size: 12px; color: var(--text-3, #94a3b8); margin-bottom: 8px; }
.mv-results { max-height: 336px; overflow-y: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 9px; }
.mv-res-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid #f1f5f9; transition: background .1s;
}
.mv-res-item:last-child { border-bottom: none; }
.mv-res-item:hover { background: var(--primary-light, #fef2f2); }
.mv-res-main { flex: 1; min-width: 0; }
.mv-res-name { font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.mv-res-name .mv-res-on { font-size: 11px; font-weight: 700; color: #dc2626; background: #fee2e2; border-radius: 5px; padding: 0 5px; }
.mv-res-sub { font-size: 12px; color: var(--text-3, #94a3b8); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-res-go { font-size: 12px; color: var(--primary); flex-shrink: 0; font-weight: 600; }
.mv-res-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--text-3, #94a3b8); }
/* 已锁定客户时的头信息卡（含「换一个」按钮） */
.mv-picked {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 10px;
  border: 1px solid var(--primary, #dc2626); border-radius: 9px; background: var(--primary-light, #fef2f2);
}
.mv-picked-main { flex: 1; min-width: 0; }

/* 客户详情抽屉：「📌 必访设置」区块 */
.mvd-box { display: flex; flex-direction: column; gap: 8px; }
.mvd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mvd-state { font-size: 13px; color: var(--text-2, #4b5563); display: flex; align-items: center; gap: 6px; }
.mvd-pill {
  font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 8px;
  background: #f1f5f9; color: var(--text-3, #94a3b8);
}
.mvd-pill.on { background: #fee2e2; color: #dc2626; }
.mvd-note { font-size: 12.5px; color: var(--text-2, #4b5563); }
.mvd-note .k { color: var(--text-3, #94a3b8); }
.mvd-form { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.mvd-form[hidden] { display: none; }

/* 看板「必访设置」四张卡片（同色调） */
.today-todo-card .todo-item.tone-rose { background: #fff1f2; border-color: #fecdd3; }
.today-todo-card .todo-item.tone-rose .todo-num { color: #be123c; }

/* 拜访日历右侧「必访设置」面板（四周期页签） */
.mv-panel { margin-top: 14px; }
.mv-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mv-panel-head .mv-week { font-size: 12px; color: var(--text-3, #94a3b8); }
.mv-panel-tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mv-ptab {
  border: 1px solid var(--border, #e5e7eb); background: #fff; color: var(--text-2, #4b5563);
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 4px; transition: all .12s;
}
.mv-ptab b { font-size: 11px; font-weight: 700; color: var(--text-3, #94a3b8); }
.mv-ptab:hover { border-color: #fca5a5; }
.mv-ptab.on { background: #fff1f2; border-color: #dc2626; color: #be123c; }
.mv-ptab.on b { color: #be123c; }
/* 必访周期标签（2026-09-13 修复「标签反了」）：
   .mv-ptag-cur = 当前页签周期（主标签，实心玫红，与页签选中态同色系）；
   .mv-ptag-alt = 同时命中的其它周期（次要标签，浅紫 + 「同时」前缀，仅作提示）。
   旧实现只有一个 .mv-ptag 且只显示「其它周期」→ 在 A 页签看到 B 标签，用户读作「标签互换」。 */
.mv-ptag {
  font-size: 10.5px; font-weight: 700; color: #9333ea; background: #f3e8ff;
  border-radius: 5px; padding: 0 5px; margin-left: 2px;
}
.mv-ptag-cur { color: #be123c; background: #ffe4e6; }
.mv-ptag-alt { color: #7c3aed; background: #f5f3ff; font-weight: 600; }
.mv-progress { font-size: 12px; font-weight: 600; color: var(--text-2, #4b5563); background: #f1f5f9; border: 1px solid var(--border, #e5e7eb); border-radius: 999px; padding: 1px 9px; margin-left: auto; }
.mv-progress.has-done { color: #15803d; background: #ecfdf5; border-color: #a7f3d0; }
.mv-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.mv-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 9px; background: #fff; transition: all .15s; }
.mv-item:hover { border-color: var(--primary, #2563eb); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.mv-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.mv-item.done .mv-name { color: #16a34a; text-decoration: line-through; text-decoration-color: rgba(22,163,74,.6); }
.mv-item .mv-cb { width: 16px; height: 16px; accent-color: #16a34a; cursor: pointer; flex-shrink: 0; }
.mv-lvdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mv-main { flex: 1; min-width: 0; }
.mv-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-sub { font-size: 11.5px; color: var(--text-3, #94a3b8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef2ff; color: #4f46e5; flex-shrink: 0; }
.mv-empty { padding: 22px 8px; text-align: center; color: var(--text-3, #94a3b8); font-size: 13px; }
.mv-panel-foot { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border, #e5e7eb); display: flex; justify-content: flex-end; }


/* ===================== A1 数据质量自查 ===================== */
.btn-xs { padding: 3px 10px; font-size: 12px; }
.dq-scan { display: flex; flex-direction: column; gap: 14px; }
.dq-empty { padding: 28px 8px; text-align: center; color: var(--text-3, #94a3b8); font-size: 13.5px; }
.dq-sec { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 12px 14px; background: #fff; }
.ds-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ds-badge { background: #2563eb; color: #fff; font-size: 11px; font-weight: 700; border-radius: 12px; padding: 1px 9px; }
.ds-desc { font-size: 12px; color: var(--text-2, #6b7280); margin-bottom: 10px; }
.ds-note { font-size: 12.5px; color: var(--text-2, #6b7280); background: #f8fafc; padding: 6px 10px; border-radius: 6px; }
.dq-group { border-top: 1px dashed var(--border, #e5e7eb); padding: 9px 0 6px; }
.dq-group:first-of-type { border-top: none; }
.dg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.dg-head b { font-weight: 600; }
.dg-phone { color: #2563eb; font-weight: 600; }
.dg-ops { margin-left: auto; display: inline-flex; gap: 6px; }
.dg-body { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dq-member { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 4px 10px; background: #f8fafc; font-size: 12.5px; }
.dq-member .m-name a { font-weight: 600; }
.dq-member .m-phone { color: var(--text-2, #6b7280); font-size: 12px; }
.dq-scan .muted { color: var(--text-3, #94a3b8); }
.dq-scan .err,
.dq-merge-modal .err { color: var(--danger, #dc2626); font-size: 12.5px; }
/* 客户列表页头部：标题 + 右侧按钮同排 */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-head .card-title { margin: 0; }

/* ===================== A3 客户列表分页条 ===================== */
.tbl-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
}
.tbl-pager .pager-info { font-size: 12px; color: var(--text-2, #6b7280); }
.tbl-pager .pager-btns { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tbl-pager .pager-btn {
  min-width: 30px;
  padding: 3px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  color: var(--text, #1f2937);
  cursor: pointer;
  transition: all .15s ease;
}
.tbl-pager .pager-btn:hover:not(:disabled):not(.cur) { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); background: var(--primary-light, #eff4ff); }
.tbl-pager .pager-btn.cur { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; font-weight: 600; cursor: default; }
.tbl-pager .pager-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===================== B7 话术库弹窗 ===================== */
.script-hint { font-size: 12.5px; color: var(--text-2, #6b7280); margin: 0 0 10px; }
.script-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.script-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-1, #f8fafc);
}
.script-item:hover { border-color: var(--primary, #2563eb); background: #fff; }
.script-txt { font-size: 13.5px; line-height: 1.7; color: var(--text, #1f2937); flex: 1; white-space: pre-wrap; word-break: break-word; }
.script-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
}
.script-copy:hover { background: var(--primary, #2563eb); color: #fff; }

/* ===================== 客户详情抽屉：同构骨架（2026-09-12） =====================
   目的：点开客户资料时不再先显示一个空白的「加载中」盒子，而是按真实布局铺出
   标题栏 + 字段行 + 分区块的灰底呼吸块，数据到位后原地替换 → 视觉上是「轮廓→填充」，
   消除空壳闪烁感。 */
@keyframes sk-pulse {
  0%   { opacity: 1; }
  50%  { opacity: .42; }
  100% { opacity: 1; }
}
.sk {
  display: inline-block;
  background: var(--bg-1, #eef2f7);
  border-radius: 5px;
  animation: sk-pulse 1.25s ease-in-out infinite;
  vertical-align: middle;
}
.sk-title { width: 118px; height: 18px; border-radius: 6px; }
.sk-k { width: 62px; height: 11px; }
.sk-v { width: 118px; height: 11px; }
.sk-v:nth-child(odd) { width: 92px; }
.sk-h4 { width: 84px; height: 13px; border-radius: 6px; }
.sk-block { display: block; width: 100%; height: 42px; border-radius: 8px; margin-top: 8px; }
.sk-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 18px; }
.sk-fields .detail-item { pointer-events: none; }
.drawer-skeleton .drawer-body { opacity: .95; }
/* 骨架 → 真实内容的轻微淡入，避免生硬跳变 */
.drawer:not(.drawer-skeleton) .drawer-body { animation: sk-fade-in .18s ease-out; }
@keyframes sk-fade-in { from { opacity: .55; } to { opacity: 1; } }

/* ===================== 家庭成员：可打字搜索组合框（2026-09-12） =====================
   替换原先只能下拉滚动查找的 <select>；客户数量多时输入姓名/手机号/身份证号即可快速定位。
   2026-09-12 二次优化：聚焦不再展开全量名单，仅提示输入；结果最多 12 条，带首字头像。 */
.fam-picker { position: relative; }
.fam-picker input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px 9px 36px;
  font-size: 13.5px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 16px 16px;
  color: var(--text, #1f2937);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fam-picker input[type="text"]::placeholder { color: var(--text-3, #94a3b8); }
.fam-picker input[type="text"]:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.fam-picker-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 268px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  z-index: 60;
  padding: 5px;
}
.fam-picker-hint {
  padding: 18px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3, #94a3b8);
  line-height: 1.6;
}
.fam-picker-more {
  padding: 7px 10px 5px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3, #94a3b8);
  border-top: 1px dashed var(--border, #e5e7eb);
  margin-top: 4px;
}
.fam-picker-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--text-3, #94a3b8); }
.fam-picker-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  transition: background .12s;
}
.fam-picker-item.active,
.fam-picker-item:hover { background: var(--primary-light, #eff4ff); }
.fam-picker-item .fp-avatar {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fam-picker-item .fp-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.fam-picker-item .fp-name { font-weight: 600; color: var(--text, #1f2937); line-height: 1.3; }
.fam-picker-item .fp-phone { color: var(--text-2, #6b7280); font-size: 12px; line-height: 1.3; }
.fam-picker-item .fp-level {
  margin-left: auto;
  font-size: 11px;
  color: var(--primary, #2563eb);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 16px;
  flex-shrink: 0;
  white-space: nowrap;
}
.fam-picker-picked { margin-top: 7px; }
.fam-picked-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
}
.fam-picked-x {
  border: none;
  background: transparent;
  color: #15803d;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 50%;
}
.fam-picked-x:hover { background: rgba(21, 128, 61, .14); }

/* ===================== 新闻中心（2026-09-13 新增）===================== */
.news-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.news-date-tabs { display: flex; gap: 8px; }
.news-date-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.news-date-tab:hover { border-color: var(--primary); color: var(--primary); }
.news-date-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
}
.news-date-sub { font-size: 11px; font-weight: 400; opacity: .75; }
.news-head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.news-run-hint { font-size: 12px; color: var(--text-3); }

.news-cat-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.news-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.news-cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.news-cat-tab.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.news-cat-tab .n {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text-2);
  font-size: 11px;
  text-align: center;
}
.news-cat-tab.active .n { background: var(--primary); color: #fff; }

.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: inherit;
  transition: all .15s;
}
a.news-item:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.news-item-main { flex: 1; min-width: 0; }
.news-item-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.news-item-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.4; }
.news-item-summary {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.news-item-meta .dot { opacity: .6; }
.news-item-arrow { color: var(--text-3); font-size: 15px; flex-shrink: 0; }
a.news-item:hover .news-item-arrow { color: var(--primary); }

.news-cat-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.news-cat-badge.c-eco { background: #ecfdf5; color: #047857; }
.news-cat-badge.c-ins { background: #eff6ff; color: #1d4ed8; }
.news-cat-badge.c-pol { background: #fef2f2; color: #b91c1c; }
.news-cat-badge.c-cur { background: #f5f3ff; color: #6d28d9; }

.news-empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.news-empty-ico { font-size: 42px; margin-bottom: 12px; }
.news-empty-t { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.news-empty-s { font-size: 13px; color: var(--text-3); line-height: 1.7; }

@media (max-width: 640px) {
  .news-head-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .news-item-top { flex-direction: column; gap: 4px; }
}

/* ===================== 第3层：商机阶段徽章 / 漏斗 / 情绪 ===================== */
.badge.stg-badge { font-weight: 600; }
.badge.stg-0 { background: var(--bg-2); color: var(--text-3); }
.badge.stg-1 { background: #f1f5f9; color: #475569; }   /* 初步接触 */
.badge.stg-2 { background: #ecfeff; color: #0e7490; }   /* 需求挖掘 */
.badge.stg-3 { background: #eff6ff; color: #1d4ed8; }   /* 方案呈递 */
.badge.stg-4 { background: #fffbeb; color: #b45309; }   /* 异议处理 */
.badge.stg-5 { background: #f5f3ff; color: #6d28d9; }   /* 促成 */
.badge.stg-6 { background: #ecfdf5; color: #047857; }   /* 成交 */
.badge.stg-7 { background: #f8fafc; color: #64748b; }   /* 暂缓 */
.badge.stg-8 { background: #fef2f2; color: #b91c1c; }   /* 流失 */
.badge.stg-stale { background: #fff7ed; color: #c2410c; font-weight: 600; }
.badge.mood-badge { font-weight: 600; }
.badge.mood-hot { background: #fef2f2; color: #dc2626; }
.badge.mood-warm { background: #fffbeb; color: #d97706; }
.badge.mood-cold { background: #eff6ff; color: #2563eb; }

.pl-funnel { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.pl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: var(--bg-2); transition: background .15s;
}
.pl-row:hover { background: var(--bg-3, #eef2f7); }
.pl-label { width: 110px; flex-shrink: 0; }
.pl-bar-wrap { flex: 1; height: 14px; background: var(--bg-1, #fff); border-radius: 7px; overflow: hidden; }
.pl-bar { height: 100%; border-radius: 7px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .3s; }
.pl-nums { width: 260px; flex-shrink: 0; font-size: 13px; }
.pl-pct { width: 44px; text-align: right; font-size: 13px; flex-shrink: 0; }
.pl-out-row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pl-out {
  flex: 1; min-width: 150px; padding: 12px; border-radius: 10px;
  background: var(--bg-2); text-align: center;
}
.pl-out-num { font-size: 18px; margin: 6px 0 2px; }
.pl-out-num b { color: var(--primary); }

@media (max-width: 720px) {
  .pl-row { flex-wrap: wrap; }
  .pl-nums { width: 100%; }
  .pl-pct { width: auto; }
}

/* ===== 第3层：拜访现场速记（移动端友好大按钮） ===== */
.quick-note-box {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px dashed var(--border);
}
.qnb-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.qnb-hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.qnb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.qnb-mood { width: auto; min-width: 150px; }
.qnb-voice-state { font-size: 12px; color: var(--text-3); }
.btn.on { background: #dc2626; color: #fff; border-color: #dc2626; }
.qnb-text {
  width: 100%; box-sizing: border-box; resize: vertical; font-size: 15px; line-height: 1.6;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-bg, #fff); color: var(--text-1); outline: none;
}
.qnb-text:focus { border-color: var(--primary); }
.qnb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; flex-wrap: wrap; }
.qnb-count { font-size: 12px; color: var(--text-3); }
@media (max-width: 720px) {
  .qnb-row .btn { flex: 1; min-height: 40px; }
  .qnb-mood { flex: 1; min-height: 40px; }
}

/* ===== 第3层：通知中心「生日关怀」画像条 ===== */
.n-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.n-meta-bit { display: inline-flex; align-items: center; gap: 3px; }
.care-tag { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.care-tag.care-vip { background: #fee2e2; color: #b91c1c; }
.care-tag.care-plus { background: #fef3c7; color: #b45309; }
.care-tag.care-basic { background: #e0e7ff; color: #4338ca; }
.n-stage-tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }

/* ===== 第4层（2026-09-13）：⑨ 团队活动量看板 ===== */
.ta-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ta-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-2); transition: background .15s;
}
.ta-row:hover { background: var(--bg-3, #eef2f7); }
.ta-rank { width: 34px; flex-shrink: 0; text-align: center; font-size: 15px; }
.ta-name { width: 160px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.ta-bar-wrap { flex: 1; height: 12px; background: var(--bg-1, #fff); border-radius: 6px; overflow: hidden; }
.ta-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #34d399, #059669); transition: width .3s; }
.ta-nums { display: flex; gap: 12px; flex-shrink: 0; font-size: 13px; align-items: center; }
.ta-nums b { color: var(--text-1); }
.ta-score {
  width: 54px; flex-shrink: 0; text-align: right; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--primary);
}
.ta-trend { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding: 8px 4px 0; overflow-x: auto; }
.ta-trend-col { flex: 1 0 26px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.ta-trend-bar { width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #60a5fa, #2563eb); transition: height .3s; }
.ta-trend-lb { font-size: 10px; color: var(--text-3); margin-top: 4px; white-space: nowrap; }
@media (max-width: 720px) {
  .ta-row { flex-wrap: wrap; }
  .ta-name { width: 100%; }
  .ta-bar-wrap { width: 100%; flex-basis: 100%; }
  .ta-nums { width: 100%; justify-content: space-between; }
}

/* ===== 第4层（2026-09-13）：⑩ 团队目标 ===== */
.tg-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tg-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-2);
}
.tg-name { width: 170px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.tg-bar-wrap { flex: 1; height: 12px; background: var(--bg-1, #fff); border-radius: 6px; overflow: hidden; }
.tg-bar { height: 100%; border-radius: 6px; transition: width .3s; background: #94a3b8; }
.tg-row.tg-ok .tg-bar { background: linear-gradient(90deg, #4ade80, #16a34a); }
.tg-row.tg-behind .tg-bar { background: linear-gradient(90deg, #fbbf24, #dc2626); }
.tg-nums { flex-shrink: 0; font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
.tg-nums b { color: var(--text-1); }
.tg-pct { width: 72px; flex-shrink: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tg-pct.tg-ok { color: #16a34a; }
.tg-pct.tg-behind { color: #dc2626; }
.tg-pct.tg-none { color: var(--text-3); font-weight: 500; font-size: 12px; }
.tga-members { display: flex; flex-wrap: wrap; gap: 8px; max-height: 250px; overflow-y: auto; padding: 4px 2px; align-content: flex-start; }
.tga-mem {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer;
  padding: 7px 12px 7px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; transition: all .12s; user-select: none; max-width: 100%;
}
.tga-mem:hover { border-color: #cbd5e1; background: #f8fafc; }
.tga-mem:has(input:checked) { border-color: var(--primary); background: rgba(37,99,235,.06); box-shadow: 0 0 0 1px var(--primary) inset; }
.tga-mem.is-set { border-style: dashed; }
.tga-mem.is-set:has(input:checked) { border-style: solid; }
.tga-mem input[type=checkbox] {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; margin: 0; flex-shrink: 0; cursor: pointer;
  border: 1.5px solid #cbd5e1; border-radius: 5px; background: #fff;
  position: relative; transition: all .14s ease;
}
.tga-mem input[type=checkbox]:hover { border-color: var(--primary); }
.tga-mem input[type=checkbox]:checked {
  background: var(--primary); border-color: var(--primary);
}
.tga-mem input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 4.5px; top: 1.5px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.tga-mem-bd { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tga-mem-nm { font-weight: 600; color: var(--text-1, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tga-mem-meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tga-flag { color: #b45309; }

/* ===== 「统一下发团队目标」弹窗（2026-09-13 优化） ===== */
.tga-grid { display: flex; flex-direction: column; gap: 14px; }
.tga-sec { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: #fff; }
.tga-sec-hd {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--bg-2, #f8fafc); border-bottom: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--text-1, #0f172a);
}
.tga-sec-no {
  display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.tga-sec-tip { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.tga-sec-bd { padding: 14px; }
.tga-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tga-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tga-lb {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  letter-spacing: .2px; display: inline-flex; align-items: center; gap: 4px;
}
.tga-lb::before {
  content: ''; width: 3px; height: 3px; border-radius: 50%;
  background: var(--primary); opacity: .55; flex-shrink: 0;
}

/* ---------- 输入框统一外观（2026-09-13 v2：替换浏览器默认样式） ---------- */
.tga-field .input,
.tga-search,
.tga-note {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e2e6ee;
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--text-1, #0f172a);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .035);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box;
}
.tga-field .input::placeholder,
.tga-search::placeholder,
.tga-note::placeholder { color: #a8b0be; font-weight: 400; }
.tga-field .input:hover:not(:focus),
.tga-search:hover:not(:focus),
.tga-note:hover:not(:focus) { border-color: #cbd5e1; background-color: #fff; }
.tga-field .input:focus,
.tga-search:focus,
.tga-note:focus {
  border-color: var(--primary); background-color: #fff;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .13), inset 0 1px 2px rgba(15, 23, 42, .02);
}
/* 注意：状态规则只能用 background-color 长属性。若写 background 简写，
   会以更高特异性重置 background-image/-repeat/-position/-size，
   导致 select 箭头与搜索放大镜在 hover/focus 时平铺满整个输入框。 */
.tga-field .input:disabled { background-color: #f1f5f9; color: var(--text-3); cursor: not-allowed; }

/* select：自绘下拉箭头 + 右侧留白（特异性须 ≥ .tga-field .input，否则被简写 background 重置） */
.tga-field select.input,
select.tga-select {
  padding-right: 38px;
  text-overflow: ellipsis;
  background-color: #fbfcfe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px 7px;
  cursor: pointer;
}
.tga-field select.input:focus,
select.tga-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%232563eb' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* 数字框：等宽数字 + 去 spinner */
.tga-field .input[inputmode="decimal"],
.tga-field .input[inputmode="numeric"] { font-variant-numeric: tabular-nums; }
.tga-field .input::-webkit-outer-spin-button,
.tga-field .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tga-suffix { position: relative; display: flex; align-items: center; }
.tga-suffix .input { padding-right: 66px; }
.tga-unit {
  position: absolute; right: 13px; font-size: 11.5px; color: var(--text-3);
  font-weight: 500; pointer-events: none; white-space: nowrap;
  padding-left: 9px; border-left: 1px solid #e2e6ee; line-height: 1.1;
}
.tga-suffix .input:focus ~ .tga-unit { color: var(--primary); border-left-color: rgba(37,99,235,.35); }
.tga-preview {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px;
  padding: 9px 12px; border-radius: 9px; font-size: 12.5px;
  background: rgba(37,99,235,.055); border: 1px solid rgba(37,99,235,.18); color: var(--text-2);
}
.tga-preview.is-bad { background: rgba(220,38,38,.06); border-color: rgba(220,38,38,.28); color: #dc2626; }
.tga-prev-lb {
  font-size: 11px; font-weight: 600; letter-spacing: .4px;
  color: var(--primary-dark, #1d4ed8); opacity: .8;
}
.tga-prev-range { color: var(--primary-dark, #1d4ed8); font-variant-numeric: tabular-nums; font-size: 13px; }
.tga-preview.is-bad .tga-prev-lb,
.tga-preview.is-bad .tga-prev-range { color: #dc2626; }
.tga-prev-tag {
  margin-left: auto;
  padding: 2px 9px; border-radius: 20px; background: #fff; border: 1px solid rgba(37,99,235,.28);
  color: var(--primary-dark, #1d4ed8); font-size: 11.5px; font-weight: 600;
}
.tga-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tga-chips-lb { font-size: 11.5px; color: var(--text-3); margin-right: 3px; font-weight: 500; }
.tga-chip {
  padding: 5px 12px; font-size: 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-weight: 500; font-family: var(--font); transition: all .13s ease;
}
.tga-chip:hover {
  border-color: var(--primary); color: var(--primary-dark, #1d4ed8);
  background: rgba(37,99,235,.07); transform: translateY(-1px);
}
.tga-chip:active { transform: translateY(0); }
.tga-chip-sep { width: 1px; height: 14px; background: var(--border); margin: 0 3px; }
.tga-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 11px; }
/* 搜索框：放大镜图标 + 左内边距（后定义于主输入框块，同特异性按顺序胜出） */
.tga-field .tga-search,
input.tga-search {
  flex: 1; min-width: 150px;
  padding-left: 36px;
  background-color: #fbfcfe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
  background-size: 15px 15px;
}
.tga-field .tga-search:hover, input.tga-search:hover { background-color: #fff; }
.tga-field .tga-search:focus,
input.tga-search:focus {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
  background-size: 15px 15px;
}
.tga-selbar {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 12.5px; color: var(--text-2);
}
.tga-selbar b { color: var(--primary-dark, #1d4ed8); font-size: 14px; }
.tga-warn {
  margin-top: 9px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.65;
  background: rgba(220,38,38,.07); border: 1px solid rgba(220,38,38,.3); color: #b91c1c;
}
.tga-warn b { color: #dc2626; }
.tga-foot-sum { flex: 1; font-size: 12.5px; color: var(--text-2); text-align: left; align-self: center; }
.tga-foot-sum.is-bad { color: #dc2626; }

@media (max-width: 720px) {
  .tg-row { flex-wrap: wrap; }
  .tg-name { width: 100%; }
  .tg-bar-wrap { flex-basis: 100%; }
  .tg-nums { width: 100%; }
  .tga-row2 { grid-template-columns: 1fr; }
  .tga-mem { flex: 1 1 100%; }
  .tga-foot-sum { flex-basis: 100%; text-align: center; order: -1; margin-bottom: 4px; }
}

/* ===== 第4层（2026-09-13）：⑪ 早会数据看板 ===== */
.mb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 12px; }
.mb-card { margin: 0; }
.mb-big { font-size: 30px; font-weight: 800; line-height: 1.2; color: var(--primary); font-variant-numeric: tabular-nums; }
.mb-up { color: #16a34a; font-weight: 700; font-size: 12px; }
.mb-down { color: #dc2626; font-weight: 700; font-size: 12px; }
.mb-u-list { display: flex; flex-direction: column; gap: 6px; }
.mb-u-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); }
.mb-u-name { width: 160px; flex-shrink: 0; }
.mb-u-nums { display: flex; gap: 14px; font-size: 13px; }
.mb-u-nums b { color: var(--text-1); }

/* ===== 功能解释（信息图标 + 可展开说明卡，2026-09-13） =====
   用法：模块标题内放
   <span class="fh-wrap"><button class="fh-btn" type="button" aria-label="功能说明">?</button>
     <div class="fh-pop">…说明内容…</div></span>
   交互：**点击** ? 图标展开（触屏/桌面一致），由 pages2.js 统一处理：
     - 展开时用 position:fixed 按视口坐标定位（自动避让右/下边界，彻底消除被后续卡片遮挡）
     - 点击空白处 / 再次点击图标 / 滚动 / 缩放窗口 → 关闭
   ⚠️ 不再使用 :hover 展开 —— hover 经过图标与卡片之间的间隙会闪动，且会被
     相邻 .card 形成的层叠上下文遮挡（2026-09-13 线上反馈）。 */
/* 🔴 2026-09-13 二次修复（说明卡「显示不全 + 被其他板块遮挡」仍复现）：
   根因 = **containing block 陷阱** + **stacking context 囚禁**。
   说明卡此前留在 .fh-wrap（位于 .content > * 卡片内部）中，即使写了 position:fixed，
   只要任一祖先创建了 containing block，fixed 就退化为相对该祖先定位并被其 overflow 裁剪：
     - `.content > * { animation: fadeUp .25s ease both }` → animation-fill-mode:both
       让 `transform: translateY(0)` **长期保留** → 该页面根元素成为 containing block；
     - 各类卡片自身的 `filter`/`transform`/`overflow` 也会叠加裁剪与层叠上下文；
   同时 `z-index:3200` 被囚禁在祖先 stacking context 内，压不过同级/后续卡片 → 被遮挡。
   ✅ 最终方案 = **Portal（传送门）**：点击 ? 时把 .fh-pop 节点**物理移动到 <body> 末尾**，
      使其祖先链只剩 body（无 transform/filter/overflow）→ position:fixed 真正相对视口，
      z-index 也进入根 stacking context → 既不会被裁剪，也不会被任何板块遮挡。
      关闭时再把节点移回 .fh-wrap 原位（保持 DOM 结构整洁、可重复开关）。
   ⚠️ 因为节点会离开 .fh-wrap，CSS 选择器不能再用 `.fh-wrap.is-open .fh-pop` 后代关系，
      改为直接在 .fh-pop 上挂 `.fh-pop.is-open` 类。 */
.fh-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
.fh-btn {
  width: 17px; height: 17px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: #f3f4f6; color: var(--text-2);
  font-size: 11px; font-weight: 700; line-height: 1; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .12s, border-color .12s, color .12s;
}
.fh-wrap.is-open .fh-btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.fh-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.fh-pop {
  display: none;
  padding: 11px 13px; border-radius: 10px; text-align: left;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 12.5px; font-weight: 400; line-height: 1.7; color: var(--text-2);
  white-space: normal; overflow-wrap: anywhere;
  box-sizing: border-box;
}
/* 打开态：由 JS 挂到 <body> 下，position:fixed 才真正相对视口 */
.fh-pop.is-open {
  display: block; position: fixed; top: 0; left: 0;
  z-index: 2147483000;
  width: 380px; max-width: calc(100vw - 24px);
}
.fh-pop .fh-hd { font-weight: 700; color: var(--text); font-size: 13px; margin-bottom: 6px; }
.fh-pop .fh-line { display: block; padding: 2px 0; }
.fh-pop .fh-line b { color: var(--text); font-weight: 600; }
.fh-pop .fh-note { display: block; margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--text-3); }
