* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --sidebar:#2e2a26; --sidebar-active:#403a34; --topbar:#17181c;
  --accent:#2d8cf0; --accent-dark:#1f74d0; --warn:#f7a54a; --danger:#ed5565;
  --success:#1d9e75; --bg:#f0f2f5; --card:#fff; --border:#e6e6e6;
  --text:#333; --muted:#888; --tag-dark:#33475f;
}
/* 主题皮肤（右上角齿轮菜单切换） */
body[data-theme="green"]  { --accent:#1d9e75; --accent-dark:#16855f; --sidebar:#21332c; --sidebar-active:#2c453a; --topbar:#14201b; }
body[data-theme="purple"] { --accent:#7048c8; --accent-dark:#5a39a8; --sidebar:#2a2536; --sidebar-active:#3b344c; --topbar:#191622; }
body[data-theme="orange"] { --accent:#e8762d; --accent-dark:#c9611e; --sidebar:#33291f; --sidebar-active:#47382a; --topbar:#1d1812; }
body[data-theme="red"]    { --accent:#d6404e; --accent-dark:#b32e3b; --sidebar:#322428; --sidebar-active:#46333a; --topbar:#1c1416; }
body { font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif; font-size:13px; color:var(--text); background:var(--bg); }
.hidden { display:none !important; }
a { color:var(--accent); text-decoration:none; }
button { font-family:inherit; }

/* ===== 登录页 ===== */
#login-page { position:fixed; inset:0; background:linear-gradient(135deg,#243b55 0%,#141e30 100%); display:flex; align-items:center; justify-content:center; }
.login-box { width:360px; background:#fff; border-radius:8px; padding:34px 36px 28px; }
.login-title { font-size:22px; font-weight:600; text-align:center; color:#333; }
.login-sub { text-align:center; color:var(--muted); margin:6px 0 22px; font-size:12px; }
.login-form label { display:block; font-size:12px; color:#666; margin:12px 0 5px; }
.login-form input, .login-form select { width:100%; height:36px; border:1px solid #d9d9d9; border-radius:4px; padding:0 10px; font-size:13px; }
.captcha-row { display:flex; gap:8px; }
.captcha-row input { flex:1; }
#captcha-img { flex:0 0 110px; height:36px; border:1px solid #d9d9d9; border-radius:4px; display:flex; align-items:center; justify-content:center; font-family:Georgia,serif; font-style:italic; font-size:20px; letter-spacing:5px; color:#555; background:#f5f5f5; user-select:none; cursor:pointer; }
.btn-block { width:100%; margin-top:20px; height:38px; font-size:14px; }
.login-tip { margin-top:14px; font-size:12px; color:var(--muted); text-align:center; }

/* ===== 布局 ===== */
#app { display:flex; min-height:100vh; }
#sidebar { width:170px; background:var(--sidebar); flex:0 0 170px; padding-top:52px; }
/* #main 撑满视口并纵向 flex；顶部留出固定顶栏高度，内容区上下留白对称 */
#main { flex:1; min-width:0; display:flex; flex-direction:column; min-height:100vh; padding-top:52px; }

/* 侧边栏 */
.menu-item { display:flex; align-items:center; gap:8px; padding:11px 16px; color:#cfc9c2; font-size:13px; cursor:pointer; border-left:3px solid transparent; white-space:nowrap; }
.menu-item .mi-ico { flex:none; opacity:.85; }
.menu-item:hover .mi-ico, .menu-item.active .mi-ico { opacity:1; }
.menu-item:hover { background:#3a342e; color:#fff; }
.menu-item.active { background:var(--sidebar-active); color:#fff; border-left-color:#c9a676; }
.menu-item .mi-badge { display:inline-block; min-width:16px; height:16px; line-height:16px; text-align:center; background:var(--danger); color:#fff; border-radius:8px; font-size:11px; margin-left:6px; padding:0 4px; }

/* 顶栏 */
#topbar { position:fixed; left:0; right:0; top:0; height:52px; background:var(--topbar); display:flex; align-items:center; justify-content:space-between; padding:0 16px; z-index:100; }
.tb-left { display:flex; align-items:center; gap:10px; color:#fff; }
.tb-company { font-size:15px; font-weight:600; }
.tb-sep { color:#555; }
.tb-logo { font-size:18px; font-weight:700; color:#e0a85f; }
.tb-role { font-size:12px; color:#aaa; }
.tb-right { display:flex; align-items:center; gap:10px; }
.tb-user { color:#fff; font-weight:600; }
.tb-logout { color:#aaa; font-size:12px; }
/* 顶栏齿轮设置菜单 */
.gear-wrap { position:relative; margin-left:4px; }
.gear-btn { display:flex; align-items:center; justify-content:center; }
.gear-btn:hover { transform:rotate(30deg); }
#gear-menu { position:absolute; right:0; top:40px; width:250px; background:#fff; border:1px solid var(--border); border-radius:6px; box-shadow:0 6px 20px rgba(0,0,0,.18); padding:12px 14px; z-index:300; color:var(--text); }
#gear-menu.hidden { display:none; }
.gm-title { font-size:13px; font-weight:600; padding-bottom:8px; border-bottom:1px solid var(--border); margin-bottom:8px; }
.gm-row { display:flex; align-items:center; justify-content:space-between; padding:7px 0; }
.gm-row.gm-col { flex-direction:column; align-items:flex-start; gap:8px; }
.gm-label { font-size:13px; color:var(--text); }
.gm-themes { display:flex; gap:8px; }
.theme-dot { width:24px; height:24px; border-radius:50%; cursor:pointer; border:2px solid #fff; box-shadow:0 0 0 1px var(--border); position:relative; }
.theme-dot.active { box-shadow:0 0 0 2px var(--accent); }
.theme-dot.active::after { content:'✓'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:12px; font-weight:700; }
.gm-sep { border-top:1px solid var(--border); margin:6px 0; }
.gm-link { display:block; text-align:center; color:var(--accent); font-size:13px; padding:7px 0; cursor:pointer; }
.gm-link:hover { font-weight:600; }
.gm-logout { display:block; text-align:center; color:var(--danger); font-size:13px; padding:7px 0 2px; cursor:pointer; }
.gm-logout:hover { font-weight:600; }
.gm-hint { font-size:11px; color:var(--muted); margin-top:4px; line-height:1.5; }
.badge { display:inline-block; min-width:15px; height:15px; line-height:15px; text-align:center; background:var(--danger); color:#fff; border-radius:8px; font-size:10px; margin-left:4px; padding:0 4px; }
/* 顶栏手机号精确搜索 */
.tb-search-wrap { position:relative; }
.tb-icon-btn { width:30px; height:30px; border:1px solid #666; background:rgba(255,255,255,.08); color:#fff; border-radius:4px; cursor:pointer; font-size:14px; line-height:1; }
.tb-icon-btn:hover { background:var(--accent); border-color:var(--accent); }
#topSearch { position:absolute; right:0; top:38px; background:#fff; border:1px solid var(--border); border-radius:4px; box-shadow:0 4px 14px rgba(0,0,0,.18); padding:8px; display:flex; gap:6px; z-index:200; }
#topSearch.hidden { display:none; }
#topSearchInput { width:180px; height:28px; border:1px solid var(--accent); border-radius:3px; padding:0 8px; font-size:12px; outline:none; }

/* ===== 内容区 ===== */
/* 内容区：白色页面卡片上下各留 20px 灰底，形成对称留白 */
#content { padding:20px 14px; display:flex; flex-direction:column; flex:1; }
#content.screen-mode { padding:0; background:#0a1a4a; }
.page { background:var(--card); border-radius:4px; box-shadow:0 1px 2px rgba(0,0,0,.05); padding:12px 14px; min-height:400px; flex:1; }
.page-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.page-title { font-size:15px; font-weight:600; }
.list-count { color:var(--muted); font-size:12px; }
.list-count b { color:var(--danger); }

/* tabs */
.tabs { display:flex; flex-wrap:wrap; border-bottom:2px solid var(--accent); margin-bottom:12px; }
.tab { padding:9px 18px; cursor:pointer; color:#555; font-size:13px; background:#f7f7f7; border:1px solid var(--border); border-bottom:none; margin-right:4px; border-radius:3px 3px 0 0; position:relative; top:2px; }
.tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.tab .t-badge { color:var(--danger); margin-left:2px; }
.tab .t-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--danger); margin-left:4px; vertical-align:middle; }
.b-pending.on { box-shadow:inset 0 0 0 2px var(--accent); }
.tab.active .t-badge { color:#ffe0e0; }

/* 筛选栏 */
.filter-bar { display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center; padding:10px 0; }
.filter-bar .f-item { display:flex; align-items:center; gap:5px; }
.filter-bar label { color:#666; font-size:12px; white-space:nowrap; }
input.i, select.i { height:30px; border:1px solid #d9d9d9; border-radius:3px; padding:0 8px; font-size:12px; background:#fff; outline:none; }
input.i:focus, select.i:focus { border-color:var(--accent); }
input.i { width:150px; }
select.i { min-width:110px; }

/* 按钮 */
.btn { display:inline-block; height:30px; padding:0 14px; border:none; border-radius:3px; font-size:12px; cursor:pointer; line-height:30px; }
.btn-sm { height:26px; line-height:26px; padding:0 10px; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-dark); }
.btn-warn { background:var(--warn); color:#fff; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-plain { background:#fff; border:1px solid #d9d9d9; color:#555; }
.btn-plain:hover { border-color:var(--accent); color:var(--accent); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.op-link { cursor:pointer; margin-right:6px; font-size:12px; white-space:nowrap; }
.op-link:last-child { margin-right:0; }
.op-red { color:var(--danger); }

/* 表格 */
.table-wrap { overflow-x:auto; }
table.tbl { width:100%; border-collapse:collapse; font-size:12px; }
.tbl th { background:#f2f2f2; color:#555; font-weight:600; padding:9px 8px; border:1px solid #e8e8e8; white-space:nowrap; text-align:center; }
.tbl td { padding:8px; border:1px solid #eee; color:#555; white-space:nowrap; text-align:center; }
/* 备注类长文本列：超宽省略号 */
.tbl .td-note { max-width:170px; overflow:hidden; text-overflow:ellipsis; }
/* 客户管理表：固定列宽（colgroup + table-layout:fixed），选择表头筛选后列宽不再跳动 */
table.tbl-fixed { table-layout:fixed; }
.tbl-fixed th { overflow:hidden; }
/* 筛选列表头不能裁剪：下拉菜单绝对定位于 th 内向下弹出，overflow:hidden 会把菜单整个裁没（点表头看似无反应） */
.tbl-fixed .th-sort { overflow:visible; }
.tbl-fixed .th-chip { display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; vertical-align:bottom; }
.tbl-fixed td { overflow:hidden; text-overflow:ellipsis; }
.tbl tbody tr:hover td { background:#f5faff; }
.tbl tbody tr.selected td { background:#e8f3fc; }
.empty-row td { text-align:center; color:#999; padding:26px 0; background:#f7f7f7; }

/* 标签 */
.tag { display:inline-block; padding:2px 8px; border-radius:2px; font-size:11px; color:#fff; }
.tag-dark { background:var(--tag-dark); }
.tag-blue { background:var(--accent); }
.tag-green { background:var(--success); }
.tag-purple { background:#8468d8; }
.tag-red { background:var(--danger); }
.tag-gray { background:#bbb; }
.tag-orange { background:var(--warn); }
.stars { color:#f7ba2a; letter-spacing:1px; }
.stars .off { color:#ddd; }
.stars .plus { color:#f7ba2a; font-weight:700; margin:0 1px; }

/* 分页 */
.pager { display:flex; align-items:center; justify-content:center; gap:6px; padding:12px 0 2px; font-size:12px; color:#666; }
.pager button { min-width:26px; height:26px; border:1px solid #d9d9d9; background:#fff; border-radius:2px; cursor:pointer; font-size:12px; }
.pager button.cur { background:var(--accent); border-color:var(--accent); color:#fff; }
.pager button:disabled { color:#ccc; cursor:not-allowed; }
.pager select { height:26px; font-size:12px; padding:0 2px; }
.pager .pg-jump { width:56px; height:26px; text-align:center; padding:0 4px; font-size:12px; }
/* 隐藏 number 输入框的上下箭头，更接近参考样式 */
.pager .pg-jump::-webkit-outer-spin-button, .pager .pg-jump::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

/* 统计卡片（工作简报） */
.brief-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.brief-card { border:1px solid var(--border); border-radius:4px; }
.brief-card h3 { text-align:center; font-size:14px; padding:10px 0; background:#fafafa; border-bottom:1px solid var(--border); border-radius:4px 4px 0 0; }
.brief-row { display:grid; grid-template-columns:repeat(3,1fr); border-bottom:1px solid #f0f0f0; }
.brief-row.brief-row-2 { grid-template-columns:1fr 1fr; }
.brief-row:last-child { border-bottom:none; }
.brief-cell { padding:10px 6px; text-align:center; border-right:1px solid #f0f0f0; }
.brief-cell:last-child { border-right:none; }
.brief-cell .bc-label { color:#666; font-size:12px; margin-bottom:6px; }
.brief-cell .bc-val { font-size:18px; color:var(--accent); font-weight:600; }
.brief-cell .bc-link { cursor:pointer; text-decoration:underline; text-underline-offset:4px; text-decoration-color:#bcd7f5; }
.brief-cell .bc-link:hover { color:#0f6ac2; }

/* 喜报烟花 */
.gg-wrap { position:fixed; inset:0; z-index:900; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.gg-fire { position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.gg-fire i { position:absolute; width:8px; height:8px; border-radius:50%; opacity:0; animation:gg-pop var(--d) ease-out .15s forwards; }
@keyframes gg-pop {
  0%   { opacity:1; transform:translate(0,0) scale(1); }
  70%  { opacity:1; }
  100% { opacity:0; transform:translate(var(--dx), var(--dy)) scale(.4); }
}
.gg-card { position:relative; background:linear-gradient(160deg,#fff8ec,#ffe9e2); border:2px solid #f0b25a; border-radius:12px; padding:26px 48px; text-align:center; box-shadow:0 10px 40px rgba(240,120,60,.35); animation:gg-in .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes gg-in { from { transform:scale(.4); opacity:0; } to { transform:scale(1); opacity:1; } }
.gg-card .gg-title { font-size:26px; font-weight:800; color:#d8452b; letter-spacing:4px; margin-bottom:12px; }
.gg-card .gg-text { font-size:16px; color:#7a4a20; font-weight:600; }
.gg-card .gg-sub { margin-top:10px; font-size:12px; color:#b48c66; }

/* 撞库标记 */
.hit-flag { display:inline-block; margin-left:4px; padding:0 3px; font-size:10px; line-height:14px; color:#fff; background:var(--danger); border-radius:2px; vertical-align:super; }

/* 日期范围与统计条右侧 */
.f-date { width:118px; padding:0 6px; }
.f-sep-d { font-style:normal; color:#999; }
.st-right { margin-left:auto; color:#666; }
.st-right b { color:var(--accent); }

/* 拨号 / 手机号搜索弹窗 */
.dial-val, .sc-val { font-size:14px; color:#333; padding:6px 8px; background:#f7f9fc; border-radius:4px; }
.search-cust .form-item, .dial-info .form-item { margin-bottom:8px; }

/* 通知条 */
.hint-bar { background:#fdf6ec; border:1px solid #f5dab1; color:#b88230; border-radius:3px; padding:8px 12px; margin-bottom:10px; font-size:12px; line-height:1.7; }

/* 客户导入导出 */
.imp-filter { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.imp-filter .f-item { display:flex; align-items:center; gap:5px; font-size:12px; color:#666; }
.imp-filter .i { width:140px; }
.imp-filter .if-tS, .imp-filter .if-tE { width:130px; }
.imp-count { margin-left:auto; color:var(--muted); font-size:12px; }
.imp-count b { color:var(--danger); }
.imp-red { color:var(--danger); font-size:12px; margin-bottom:8px; }
/* 导入弹窗分区 */
.ia-box { background:#f7f9fc; border:1px solid var(--border); border-radius:4px; padding:10px 12px; font-size:12px; color:#666; line-height:1.8; margin-bottom:12px; }
.ia-sec { margin-bottom:14px; }
.ia-sec > b { display:block; font-size:12px; color:#333; margin-bottom:4px; }
.ia-tip { font-size:11px; color:#999; line-height:1.7; margin-bottom:6px; }
.ia-tip i { color:var(--danger); font-style:normal; }
.ia-tip-inline { font-size:11px; color:#999; margin-left:8px; }
.ia-tpl { color:var(--accent); cursor:pointer; font-size:12px; }
.ia-tpl:hover { text-decoration:underline; }
.ia-filerow { display:flex; align-items:center; gap:8px; font-size:12px; color:#555; flex-wrap:wrap; }
.ia-filerow #ia-show { width:200px; background:#fafafa; }
/* 导入进度条 */
.ij-prog { position:relative; width:110px; height:14px; background:#eef1f6; border-radius:7px; overflow:hidden; }
.ij-prog .ij-bar { height:100%; background:linear-gradient(90deg,#4a9eff,#2f7ce0); border-radius:7px; transition:width .35s; min-width:0; }
.ij-prog .ij-ptxt { position:absolute; inset:0; text-align:center; font-size:10px; line-height:14px; color:#345; }

/* 弹窗 */
.modal-mask { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:200; display:flex; align-items:center; justify-content:center; }
.modal { background:#fff; border-radius:6px; width:560px; max-width:94vw; max-height:86vh; display:flex; flex-direction:column; }
.modal-lg { width:760px; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--border); }
.modal-head h3 { font-size:14px; }
.modal-close { cursor:pointer; color:#999; font-size:18px; line-height:1; padding:2px 6px; }
.modal-body { padding:16px; overflow-y:auto; }
.modal-foot { padding:10px 16px; border-top:1px solid var(--border); text-align:right; }
.modal-foot .btn { margin-left:8px; }

/* 表单 */
.form-row { display:flex; gap:14px; margin-bottom:12px; }
.form-item { flex:1; }
.form-item label { display:block; font-size:12px; color:#666; margin-bottom:5px; }
.form-item input, .form-item select, .form-item textarea { width:100%; border:1px solid #d9d9d9; border-radius:3px; padding:7px 9px; font-size:13px; font-family:inherit; outline:none; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color:var(--accent); }
.detail-dl { display:grid; grid-template-columns:1fr 1fr; gap:0; border:1px solid var(--border); }
.detail-dl div { padding:8px 12px; border-bottom:1px solid #f0f0f0; font-size:12px; }
.detail-dl div:nth-child(odd) { border-right:1px solid #f0f0f0; }
.detail-dl b { color:#999; font-weight:400; margin-right:8px; }

/* 开关 */
.switch { position:relative; display:inline-block; width:38px; height:20px; vertical-align:middle; }
.switch input { opacity:0; width:0; height:0; }
.switch .sl { position:absolute; inset:0; background:#ccc; border-radius:10px; transition:.2s; cursor:pointer; }
.switch .sl:before { content:""; position:absolute; width:16px; height:16px; left:2px; top:2px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + .sl { background:var(--accent); }
.switch input:checked + .sl:before { transform:translateX(18px); }

/* toast */
#toast-root { position:fixed; top:64px; left:50%; transform:translateX(-50%); z-index:300; }
.toast { background:#fff; border-left:3px solid var(--success); box-shadow:0 2px 8px rgba(0,0,0,.15); padding:9px 18px; border-radius:3px; margin-bottom:8px; font-size:13px; animation:tIn .2s; }
.toast.err { border-left-color:var(--danger); }
.toast.warn { border-left-color:var(--warn); }
@keyframes tIn { from { opacity:0; transform:translateY(-8px);} to { opacity:1; transform:none;} }

/* 业绩大屏 */
.screen { background:#0a1a4a; background-image:radial-gradient(circle at 50% 55%, #10307a 0%, #0a1a4a 55%, #071233 100%); min-height:calc(100vh - 52px); padding:18px 20px; color:#cfe3ff; }
#content.screen-mode { padding:52px 0 0; }
.screen h1 { text-align:center; font-size:22px; letter-spacing:6px; color:#eaf3ff; padding:8px 0 18px; font-weight:600; }
.screen-grid { display:grid; grid-template-columns:1fr 1.15fr 1fr; grid-template-rows:auto auto; gap:14px; }
.screen-card { border:1px solid #1f4fa8; background:rgba(16,42,102,.55); border-radius:4px; padding:10px 12px; min-height:150px; }
.screen-card h3 { text-align:center; font-size:13px; color:#8fc1ff; font-weight:400; margin-bottom:10px; }
.screen-num { text-align:center; font-size:30px; color:#f7d24b; font-family:Consolas,monospace; padding:16px 0 4px; }
.screen-num small { display:block; font-size:12px; color:#8fc1ff; margin-top:6px; font-family:inherit; }
.rank-row { display:flex; justify-content:space-between; padding:6px 4px; border-bottom:1px dashed #1f4fa8; font-size:12px; }
.rank-row .rk { color:#f7d24b; margin-right:8px; }

/* 内嵌小 tab（页内二级） */
.subtabs { display:inline-flex; border:1px solid var(--accent); border-radius:3px; overflow:hidden; margin-bottom:12px; }
.subtabs span { padding:6px 16px; cursor:pointer; font-size:12px; color:var(--accent); background:#fff; }
.subtabs span.active { background:var(--accent); color:#fff; }

/* 分配设置 */
.quota-input { width:90px; height:28px; border:1px solid #d9d9d9; border-radius:3px; padding:0 6px; text-align:center; }
.sw-off { background:#ccc; }
.hint-inline { color:#999; font-size:12px; margin-left:8px; }

/* 客户详情页（整页） */
.star-txt { color:#e6a23c; font-weight:600; }
.cd-top { display:flex; align-items:center; margin-bottom:12px; }
.cd-top .tabs { margin-bottom:0; }
.cd-top-r { margin-left:auto; display:flex; align-items:center; font-size:13px; color:#666; }
.cd-top-r .btn { margin-left:8px; }
.cd-body { display:grid; grid-template-columns:1.55fr 1fr; gap:14px; align-items:stretch; }
.cd-box { background:#fff; border:1px solid var(--border); border-radius:4px; padding:12px 14px; margin-bottom:12px; }
.cd-box-t { font-size:13px; color:#333; font-weight:600; margin-bottom:10px; }
/* 个人客户详细信息：一行五项，标签在左 */
.cd-grid5 { display:grid; grid-template-columns:1.25fr 1fr 0.95fr 0.7fr 1.3fr; gap:10px 14px; }
.cd-fi { display:flex; align-items:center; gap:8px; min-width:0; }
/* 客户详情：文字整体加大一档 */
.cd-fi label { font-size:13px; color:#777; flex:none; white-space:nowrap; }
.cd-fi input, .cd-fi select, .cd-fi textarea { flex:1; width:100%; min-width:0; box-sizing:border-box; border:1px solid #d9d9d9; border-radius:3px; padding:6px 8px; font-size:13px; }
.cd-fi textarea { resize:vertical; }
.cd-radios { display:flex; gap:10px; font-size:13px; color:#555; white-space:nowrap; }
/* radio 固定原生尺寸：覆盖 .cd-fi input 的 width:100%，否则单选框被拉满把文字挤出标签造成重叠 */
.cd-rd input { width:auto; flex:none; margin-right:2px; vertical-align:middle; }
/* 单选组过窄时允许换行，避免「未婚/离异」「已婚」文字重叠 */
.cd-fi .cd-radios { flex-wrap:wrap; row-gap:3px; min-width:0; }
.cd-rd { white-space:nowrap; flex:none; }
/* 快捷录入：属性两列 + 左小右大的行式布局 */
.cd-attrs2 { display:grid; grid-template-columns:1fr 1fr; gap:8px 28px; margin-bottom:12px; }
.cd-attr-g { display:flex; align-items:center; gap:6px; }
.cd-attr-n { width:62px; font-size:12px; color:#555; text-align:right; flex:none; }
.cd-tg { border:1px solid #d9d9d9; background:#fff; border-radius:3px; font-size:12px; padding:4px 10px; cursor:pointer; color:#888; }
.cd-tg.on.sel { background:var(--accent); border-color:var(--accent); color:#fff; }
.cd-tg.off.sel { background:#e8eaee; border-color:#c9ced8; color:#555; }
.cd-fr { display:flex; gap:14px; margin-top:12px; padding-top:12px; border-top:1px dashed #eee; }
.cd-fr:first-of-type { border-top:none; margin-top:0; padding-top:0; }
.cd-fr-l { width:210px; flex:none; }
.cd-fr-l .cd-fi select { max-width:130px; }
.cd-fr-r { flex:1; min-width:0; }
.cd-fi-top textarea { flex:1; }
.cd-fi-plain { margin-top:14px; }
.cd-fi-plain label { color:#777; }
/* 「跟进备注 / 客户备注 / 计划内容」标签与右侧输入框顶部平齐 */
.cd-fi-top { align-items:flex-start; }
.cd-fi-top > label { padding-top:7px; }
/* 客户星级悬停说明（? 紧跟「客户星级」标签文字；气泡加宽保证每条说明不折行） */
.cd-tip { position:relative; flex:none; display:inline-block; vertical-align:middle; margin-left:5px; width:15px; height:15px; line-height:14px; border:1px solid #cfd8e3; border-radius:50%; background:#f2f6fb; color:#8a97a8; font-size:11px; text-align:center; cursor:help; user-select:none; }
.cd-tip:hover { background:var(--accent); border-color:var(--accent); color:#fff; }
.cd-tip:hover::after { content:attr(data-tip); position:absolute; left:22px; top:-8px; z-index:80; width:300px; background:#333f50; color:#fff; font-size:12px; line-height:1.8; padding:8px 12px; border-radius:4px; white-space:pre-line; text-align:left; box-shadow:0 3px 12px rgba(0,0,0,.25); }
.cd-chsrc { font-size:12px; color:#666; }
/* 快捷标签条（跟进备注/计划内容/提醒时间） */
.cd-tagbar { margin-top:6px; font-size:12px; color:#999; line-height:2; }
.cd-tb-pre { color:#888; }
.cd-qk, .cd-qk-time { font-style:normal; color:var(--accent); cursor:pointer; margin-left:8px; }
.cd-qk:hover, .cd-qk-time:hover { text-decoration:underline; }
.cd-tb-time { margin-top:8px; }
/* 提醒计划快捷时间：小字一行排开不换行 */
.cd-tb-time .cd-qk-time { font-size:11px; margin-left:6px; white-space:nowrap; }
/* 上一客户/下一客户的客户名：主题色便于识别 */
.cd-nav { color:var(--accent); }
/* 详情页只读字段（客户名称/联系电话/贷款金额/贷款目的） */
.cd-ro { background:#f7f8fa; color:#666; cursor:not-allowed; }
/* 跟进备注/计划内容：输入框与快捷标签同框，快捷在输入框下方小字 */
.cd-note-wrap { flex:1; min-width:0; border:1px solid #d9d9d9; border-radius:3px; background:#fff; }
.cd-note-wrap textarea { display:block; width:100%; box-sizing:border-box; border:none; outline:none; resize:vertical; padding:7px 9px; font-size:12px; font-family:inherit; background:transparent; }
.cd-note-tags { border-top:1px solid #f0f2f5; padding:4px 9px; font-size:11px; color:#999; line-height:1.9; }
.cd-note-tags .cd-qk { font-size:11px; margin-left:8px; }
/* 右栏跟进记录：外框 + 按类型分色卡片（通话蓝/微信绿/上门橙/短信灰） */
.cd-rec { border:1px solid #e3ebf5; border-radius:4px; background:#f7f9fc; margin:0 8px 8px; padding:2px 2px 4px; }
.cd-rec-item { background:#fff; border:1px solid #eef1f5; border-left:3px solid #c0c8d2; border-radius:4px; margin:8px 10px; padding:7px 10px; }
.cd-rec-item.f-call { border-left-color:var(--accent); background:#f3f9ff; }
.cd-rec-item.f-wechat { border-left-color:var(--success); background:#f0faf5; }
.cd-rec-item.f-visit { border-left-color:var(--warn); background:#fdf6ec; }
.cd-rec-item.f-sms { border-left-color:#a0a6ad; background:#f8f9fa; }
/* 主管点评：紫色突出显示，与普通跟进卡片明显区分 */
.cd-rec-item.f-comment { border-left-color:#8468d8; background:#f6f3ff; }
.cd-rec-item.f-comment .tag-purple { font-weight:600; }
.cd-empty { background:#eceef1; margin:10px; border-radius:3px; }
/* 系统设置：功能分组框（同一功能的开关收纳一框） */
.set-group { border:1px solid #dfe6ef; border-radius:8px; background:#fbfdff; padding:14px 16px 12px; margin-bottom:14px; }
.set-group-t { font-weight:600; font-size:13px; color:#2b3a4d; margin-bottom:10px; padding-bottom:8px; border-bottom:1px solid #eef2f7; }
/* 自建日期选择器弹层（蓝色主题） */
.dp-pop { position:fixed; z-index:1200; width:244px; background:#fff; border:1px solid #cfe0f5; border-radius:8px; box-shadow:0 6px 24px rgba(30,80,160,.18); padding:10px; user-select:none; }
.dp-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.dp-title { font-weight:600; font-size:13px; color:#2b3a4d; }
.dp-btn { cursor:pointer; color:#4a7bc0; font-size:16px; line-height:1; padding:2px 8px; border-radius:4px; }
.dp-btn:hover { background:#e8f1fc; }
.dp-week { display:grid; grid-template-columns:repeat(7,1fr); font-size:11px; color:#8a97a8; text-align:center; margin-bottom:2px; }
.dp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; }
.dp-day { text-align:center; font-size:12px; line-height:26px; cursor:pointer; border-radius:4px; color:#333f50; }
.dp-day:hover { background:#e8f1fc; }
.dp-day.dim { color:#c3cbd6; cursor:default; }
.dp-day.dim:hover { background:none; }
.dp-day.today { box-shadow:inset 0 0 0 1px var(--accent); }
.dp-day.sel { background:var(--accent); color:#fff; font-weight:600; }
.dp-foot { display:flex; justify-content:space-between; margin-top:6px; padding-top:6px; border-top:1px solid #eef2f7; }
.dp-act { color:var(--accent); cursor:pointer; font-size:12px; }
.dp-act:hover { text-decoration:underline; }
/* 日期+时间：日历内的时分秒输入 */
.dp-time { display:flex; align-items:center; gap:3px; margin-top:6px; padding-top:6px; border-top:1px solid #eef2f7; font-size:12px; color:#5b6b80; }
.dp-time-l { color:#8a97a8; margin-right:2px; }
.dp-time input { width:34px; height:24px; text-align:center; border:1px solid #d9e3f0; border-radius:4px; font-size:12px; color:#2b3a4d; background:#fff; -moz-appearance:textfield; }
.dp-time input::-webkit-outer-spin-button, .dp-time input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.dp-time input:focus { border-color:var(--accent); outline:none; }
.dp-time em { font-style:normal; color:#98a6b8; }
/* 下拉多选组件（进件/放款银行） */
.msel { position:relative; }
.msel-box { display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:36px; border:1px solid #d9d9d9; border-radius:3px; padding:3px 8px; cursor:pointer; background:#fff; flex-wrap:wrap; }
.msel-box:hover { border-color:var(--accent); }
.msel-vals { display:flex; flex-wrap:wrap; gap:4px; }
.msel-tag { background:#e8f3fc; color:var(--accent); border-radius:2px; padding:1px 6px; font-size:12px; }
.msel-ph { color:#bbb; font-size:12px; }
.msel-caret { color:#999; font-weight:normal; font-style:normal; }
.msel-menu { position:absolute; z-index:60; top:100%; left:0; right:0; max-height:220px; overflow-y:auto; background:#fff; border:1px solid #d9d9d9; border-radius:3px; box-shadow:0 3px 10px rgba(0,0,0,.15); padding:2px 0; }
/* 双类名提高特异性：覆盖 .form-item label 的 display:block + margin（否则选项内 checkbox 被挤到单独一行） */
.msel .msel-opt, .form-item .msel-opt { display:flex; align-items:center; gap:6px; padding:4px 10px; font-size:12px; line-height:1.4; cursor:pointer; font-weight:normal; margin:0; }
.msel .msel-opt input, .form-item .msel-opt input { margin:0; flex:none; }
.msel .msel-opt:hover, .form-item .msel-opt:hover { background:#f5f7fa; }
/* 分组行：组名 + 是/否 勾选，紧凑单行 */
.msel-grp { display:flex; align-items:center; gap:2px; padding:3px 8px; }
.msel-grp:hover { background:#f5f7fa; }
.msel-grp b { font-size:12px; color:#8a97a6; font-weight:600; flex:none; margin-right:8px; min-width:4em; }
.msel-grp .msel-opt { padding:2px 8px; flex:none; }
.cd-right { background:#fff; border:1px solid var(--border); border-radius:4px; display:flex; flex-direction:column; }
.cd-right-h { display:flex; align-items:center; padding:8px 10px; border-bottom:1px solid var(--border); }
.cd-right-h .subtabs { margin-bottom:0; }
.cd-rec { padding:6px 12px 12px; flex:1; overflow-y:auto; font-size:13px; }
.cd-rec-item { padding:8px 0; border-bottom:1px dashed #eee; line-height:1.7; }
.cd-time { color:#999; }
.cd-empty { color:#999; padding:20px 0; text-align:center; }

/* 客户管理第二筛选行 + 统计条 + 表头下拉 */
.filter-row2 { margin-top:8px; }
.qk-btn { border:1px solid #d9d9d9; background:#fff; color:#555; border-radius:3px; font-size:12px; padding:5px 12px; cursor:pointer; }
.qk-btn:hover { border-color:var(--accent); color:var(--accent); }
.qk-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.qk-btn.big { padding:5px 16px; }
.f-sep { width:1px; height:18px; background:#e5e5e5; margin:0 4px; align-self:center; }
.stat-bar { background:#f7f9fc; border:1px solid var(--border); border-radius:3px; padding:8px 12px; margin-bottom:10px; font-size:12px; color:#555; display:flex; flex-wrap:wrap; gap:6px 18px; line-height:1.8; }
.stat-bar .st-num, .stat-bar .st-red { color:var(--accent); font-weight:600; cursor:pointer; }
.stat-bar .st-red { color:#e05a4e; }
.th-sort { cursor:pointer; position:relative; user-select:none; }
.th-sort .th-chip { display:inline-flex; align-items:center; gap:5px; border:1px solid #d9d9d9; background:#fff; border-radius:3px; padding:3px 9px; font-size:12px; font-weight:normal; color:#555; line-height:1.5; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.th-sort .th-caret { font-size:10px; color:#999; }
.th-sort:hover .th-chip { border-color:var(--accent); color:var(--accent); }
.th-sort:hover .th-caret { color:var(--accent); }
.th-sort.f-on .th-chip { border-color:var(--accent); background:#eef6ff; color:var(--accent); }
.th-sort.f-on .th-caret { color:var(--accent); }
.th-caret { font-size:10px; margin-left:3px; color:#aaa; }
.th-menu { position:absolute; z-index:50; top:100%; left:0; min-width:110px; max-height:260px; overflow-y:auto; background:#fff; border:1px solid #d9d9d9; border-radius:3px; box-shadow:0 3px 10px rgba(0,0,0,.15); text-align:left; }
.th-opt { display:block; padding:6px 12px; font-size:12px; color:#555; cursor:pointer; white-space:nowrap; }
.th-opt:hover { background:#f5f7fa; color:var(--accent); }
.th-opt.cur { color:var(--accent); font-weight:600; }
.table-wrap.menu-open { overflow:visible; }
/* 时间列排序表头 */
.th-time { cursor:pointer; user-select:none; }
.th-time:hover { color:var(--accent); }
.sort-ic { display:inline-block; margin-left:4px; font-size:10px; color:#bbb; font-weight:normal; }
.sort-ic.on { color:var(--accent); }
/* 业绩排行筛选条：贴着表格右上 */
/* 业绩排行：切换标签一行、筛选条下一行，均靠左对齐 */
.rk-head { margin-bottom:0; }
.rank-bar { padding-top:0; padding-right:2px; }
.rk-tip { color:#999; font-size:12px; margin-left:2px; white-space:nowrap; }
/* ---------------- 顶栏公告（姓名·角色右侧，逐条淡入淡出轮播） ---------------- */
#tb-notice { flex:1; min-width:0; margin-left:20px; display:flex; align-items:center; gap:8px; height:52px; font-size:12px; line-height:1.4; }
#tb-notice.hidden { display:none; }
/* 左侧小喇叭（轻微摇铃提示有公告） */
#tb-notice .nb-horn { flex:none; font-size:13px; line-height:1; animation:nb-horn 2.4s ease-in-out infinite; transform-origin:50% 70%; }
@keyframes nb-horn { 0%,60%,100% { transform:rotate(0deg); } 70% { transform:rotate(-12deg); } 80% { transform:rotate(10deg); } 90% { transform:rotate(-6deg); } }
/* 公告文字：超长在原位左右滑动查看（隐藏滚动条，滚轮/拖动均可用） */
#tb-notice .nb-txt { flex:1; min-width:0; overflow-x:auto; overflow-y:hidden; white-space:nowrap; scrollbar-width:none; -ms-overflow-style:none; cursor:default; }
#tb-notice .nb-txt::-webkit-scrollbar { display:none; }
#tb-notice .nb-unit { display:inline-block; padding-right:40px; }
/* 淡入淡出切换 */
#tb-notice .nb-horn, #tb-notice .nb-txt { opacity:1; transition:opacity .3s ease; }
#tb-notice.nb-fading .nb-horn, #tb-notice.nb-fading .nb-txt { opacity:0; }
/* ---------------- 右下角消息提醒 ---------------- */
#corner-box { position:fixed; right:18px; bottom:18px; z-index:1300; display:flex; flex-direction:column; gap:10px; max-width:360px; }
.corner-msg { background:#fff; border:1px solid var(--border); border-left:4px solid var(--warn); border-radius:8px; box-shadow:0 6px 24px rgba(0,0,0,.14); padding:12px 34px 12px 14px; font-size:13px; line-height:1.6; position:relative; animation:cm-in .25s ease; }
.corner-msg .cm-txt { color:#333; }
.corner-msg .cm-x { position:absolute; right:10px; top:8px; color:#aaa; cursor:pointer; font-size:16px; line-height:1; }
.corner-msg .cm-x:hover { color:#666; }
@keyframes cm-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

/* ---------------- 角色管理（左层级树 + 右权限面板） ---------------- */
.role-wrap { display:flex; gap:18px; align-items:flex-start; }
.role-tree { width:210px; flex:none; background:#fff; border:1px solid var(--border); border-radius:6px; padding:14px 12px 18px; }
.rt-title { font-size:13px; color:#666; margin-bottom:12px; padding-left:4px; }
.rt-node { position:relative; display:flex; align-items:center; gap:8px; padding:9px 10px; border-radius:6px; cursor:pointer; border:1px solid transparent; }
.rt-node:hover { background:#f5f8fd; }
.rt-node.active { background:#eaf3fe; border-color:#bcd9fb; }
.rt-dot { width:9px; height:9px; border-radius:50%; background:var(--accent); flex:none; }
.rt-node.locked .rt-dot { background:#bbb; }
.rt-node.locked { color:#888; cursor:not-allowed; }
.rt-name { font-size:13px; flex:1; }
.rt-cnt { font-size:11px; color:#999; }
.rt-lock { font-size:10px; color:#fff; background:#bbb; border-radius:8px; padding:1px 5px; }
.rt-line { width:2px; height:14px; background:#e2e8f0; margin-left:14px; }
.role-perm { flex:1; min-width:0; }
.rp-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.rp-head b { font-size:16px; }
.rp-sub { font-size:12px; color:#888; }
.rp-block { background:#fff; border:1px solid var(--border); border-radius:6px; padding:14px 16px; margin-bottom:12px; }
.rp-label { font-size:13px; font-weight:600; margin-bottom:10px; }
.rp-count { font-weight:400; color:#999; font-size:12px; margin-left:6px; }
.rp-scope { display:flex; gap:10px; flex-wrap:wrap; }
.rp-sc { padding:6px 16px; border:1px solid var(--border); border-radius:16px; font-size:12px; color:#555; cursor:pointer; }
.rp-sc:hover { border-color:#bcd9fb; color:var(--accent); }
.rp-sc.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.rp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:6px 24px; }
.rp-item { display:flex; align-items:center; justify-content:flex-start; gap:10px; padding:6px 2px; font-size:13px; border-bottom:1px dashed #f0f0f0; white-space:nowrap; }
.rp-item .switch { flex:none; }
.rp-tip { margin-top:8px; font-size:11px; color:#999; line-height:1.7; }
.rp-foot { font-size:12px; color:#888; }
/* 二级页面权限：按菜单分组的小开关 */
.rp-subwrap { display:flex; flex-direction:column; gap:8px; }
.rp-subgroup { display:flex; align-items:flex-start; gap:10px; padding:7px 10px; border:1px dashed var(--border); border-radius:4px; background:#fbfcfd; }
.rp-subgroup.off { opacity:.45; }
.rp-subname { width:96px; flex:none; font-size:12px; color:#555; padding-top:2px; }
.rp-subs { display:flex; flex-wrap:wrap; gap:6px 16px; min-width:0; }
.rp-subitem { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:#444; cursor:pointer; white-space:nowrap; }
.rp-subitem input { margin:0; cursor:pointer; }
/* 角色权限保存栏 */
.rp-savebar { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:4px; padding-top:12px; border-top:1px solid var(--border); }
.rp-dirty { font-size:12px; color:var(--warn); margin-right:auto; opacity:0; transition:.2s; }
.rp-dirty.on { opacity:1; }
/* 部门管理 */
.dept-bar { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.dp-tip { font-size:12px; color:#999; }
.dp-total { font-size:12px; color:#666; margin-left:auto; }
.dp-total b { color:var(--accent); }
.tbl-dept th, .tbl-dept td { padding:11px 12px; }
.tbl-dept th:nth-child(1), .tbl-dept td:nth-child(1),
.tbl-dept th:nth-child(2), .tbl-dept td:nth-child(2),
.tbl-dept th:nth-child(4), .tbl-dept td:nth-child(4),
.tbl-dept th:nth-child(5), .tbl-dept td:nth-child(5) { text-align:left; }
.tbl-dept td.dp-name { font-weight:600; color:var(--accent); }
.tbl-dept td.dp-count { font-weight:600; color:#555; }
.dp-lead { font-weight:600; color:var(--accent); margin-right:10px; }
.dp-setlead { margin-left:8px; }
.dp-none { color:#bbb; }
.dp-chip { display:inline-block; padding:1px 9px; margin:2px 6px 2px 0; background:#f2f7f4; border-radius:10px; font-size:12px; color:#555; white-space:nowrap; }
.tbl-dept .dp-more { font-size:12px; color:#999; }
.dept-hint { font-size:11px; color:#999; margin-top:5px; line-height:1.5; }
.dm-list { max-height:260px; overflow:auto; border:1px solid var(--border); border-radius:6px; }
.dm-row { display:flex; align-items:center; gap:12px; padding:8px 12px; border-bottom:1px dashed #f0f0f0; font-size:13px; }
.dm-row:last-child { border-bottom:none; }
.dm-name { font-weight:600; width:76px; flex:none; }
.dm-meta { flex:1; color:#888; font-size:12px; }
.dm-empty { padding:18px; text-align:center; color:#999; font-size:12px; }
.dm-add-bar { display:flex; gap:10px; margin-top:12px; align-items:center; }
