:root {
  --bg: #F6F3FA;
  --card: #FFFFFF;
  --line: #E7DFF0;
  --ink: #332B43;
  --ink2: #7A7090;
  --pri: #7C5CBF;
  --pri2: #5B3FA3;
  --pink: #E35D8F;
  --teal: #1D9E75;
  --amber: #C98A1B;
  --red: #C0392B;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(80, 60, 120, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px; line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--pri); cursor: pointer; }
.serif { font-family: Georgia, "STZhongsong", "Songti SC", "SimSun", serif; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(90deg, #4A3578, #7C5CBF 55%, #B06AB3);
  color: #fff; padding: 10px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(50, 30, 90, .25);
}
.topbar .brand { font-size: 17px; font-weight: 500; letter-spacing: 1px; }
.topbar .brand small { opacity: .8; font-size: 11px; margin-left: 8px; letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.chip {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 3px 12px; font-size: 12.5px; display: inline-flex;
  align-items: center; gap: 6px; cursor: pointer;
}
.chip b { font-weight: 500; }
/* 顶栏联机状态小标：联机=青绿意，断线=暖红；顶栏是紫底白字，故用半透明底 + 亮描边保证白字可读 */
.chip.online { background: rgba(52, 199, 123, .28); border-color: rgba(150, 255, 200, .6); }
.chip.offline { background: rgba(231, 76, 60, .26); border-color: rgba(255, 180, 166, .6); }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--pri2);
  border-radius: 8px; padding: 6px 14px; font-size: 13px;
}
.btn:hover { border-color: var(--pri); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.6); color: #fff; }
.btn.danger { border-color: #E8B9B4; color: var(--red); }
.btn.sm { padding: 2px 9px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 登录 ---------- */
.login-wrap {
  max-width: 560px; margin: 9vh auto 0; padding: 0 18px;
}
.login-card {
  background: var(--card); border-radius: 16px; padding: 26px 28px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.login-card h1 { margin: 0 0 4px; font-size: 21px; color: var(--pri2); }
.login-card .sub { color: var(--ink2); font-size: 13px; margin-bottom: 18px; }
.acc-row {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; cursor: pointer;
}
.acc-row:hover { border-color: var(--pri); background: #FBF9FE; }
.acc-row .avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.acc-row .who { flex: 1; }
.acc-row .who b { display: block; font-weight: 500; }
.acc-row .who span { color: var(--ink2); font-size: 12px; }
.badge {
  display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 11px;
}
.badge.admin { background: #F1E9FF; color: var(--pri2); }
.badge.member { background: #E2F5EF; color: var(--teal); }
.rule-note {
  background: #FBF6FF; border: 1px dashed #D8C6F2; border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: #5E5480; margin-top: 14px;
}
/* ---------- 登录表单(账号+密码) ---------- */
.lg-form { margin: 6px 0 4px; }
.lg-form .formline { margin-bottom: 12px; }
.lg-form .formline input { flex: 1; min-width: 180px; padding: 9px 12px; font-size: 14px; }
.lg-form .formline button { width: 100%; padding: 10px 0; font-size: 15px; letter-spacing: 4px; }
.lg-err { background: #FCEBEB; border: 1px solid #F3C9C9; border-radius: 8px; padding: 7px 12px; margin-bottom: 12px; font-size: 13px; }
.lg-name {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  background: #F4F1FA; color: #4B3F72; border-radius: 5px; padding: 1px 7px;
}
.pw-mask { letter-spacing: 2px; color: var(--ink2); font-size: 12px; }

/* ---------- 外呼（阶段1） ---------- */
.btn.call { background: #E2F5EF; color: #0F6E56; border-color: #BFE5D5; }
.btn.call:hover { background: #CFEEDE; }
/* 客户档案 · 手机号下方的一键外呼 */
.dos-form .phone-cell { min-width: 210px; }
.call-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.call-row .btn.call { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.btn.call.off { background: #F6F6F8; color: #9A9AA5; border-color: #E7E7ED; }
.btn.call.off:hover { background: #EFEFF3; }
.call-hint { font-size: 12px; line-height: 1.45; }
.call-hint.ok { color: #0F6E56; }
.call-hint.warn { color: #A32D2D; }
/* 中继对接面板（VOS：只给 IP + 端口） */
.trunk-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.trunk-box.trunk-ok { background: #E2F5EF; border-color: #BFE5D5; }
.trunk-box.trunk-bad { background: #FDF0EF; border-color: #F3D2CE; }
.trunk-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.trunk-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.trunk-step { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.trunk-step .ts-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #E2F5EF; color: #0F6E56; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.trunk-step .ts-l { color: var(--ink2); min-width: 160px; }
.trunk-step .ts-v { color: #2C2C2A; font-weight: 500; }
.call-dlg .call-status { font-size: 18px; color: var(--pri2); padding: 14px 0 6px; text-align: center; }
.call-dlg .call-meta { text-align: center; font-size: 12px; }
.dlg select { width: 100%; padding: 7px 10px; }
.dlg textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 13px; resize: vertical; }

/* ---------- 主体布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 18px 60px; }
.navtab {
  display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.navtab .tab {
  border: none; background: none; padding: 9px 15px; font-size: 14px;
  color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.navtab .tab.on { color: var(--pri2); border-bottom-color: var(--pri); font-weight: 500; }
.sectitle { font-size: 15px; margin: 6px 0 12px; color: var(--pri2); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; box-shadow: var(--shadow);
}
.card .k { color: var(--ink2); font-size: 12px; }
.card .v { font-size: 24px; font-weight: 500; margin-top: 2px; }
.card .v small { font-size: 12px; color: var(--ink2); font-weight: 400; }
.card.warn { border-left: 3px solid var(--amber); }
.card.acc { border-left: 3px solid var(--pink); }
.card.ok { border-left: 3px solid var(--teal); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 12px; font-size: 14px; color: var(--pri2); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; min-width: 880px; }
.tbl th { text-align: left; color: var(--ink2); font-weight: 500; border-bottom: 1px solid var(--line); padding: 7px 8px; white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 1; }
.tbl td { border-bottom: 1px solid #F2EDF7; padding: 7px 8px; vertical-align: middle; word-break: break-all; overflow-wrap: anywhere; }
.tbl tr:hover td { background: #FCFAFE; }
.st-badge { border-radius: 6px; padding: 1px 8px; font-size: 12px; }
.st-active { background: #EAF3FB; color: #185FA5; }
.st-won { background: #E2F5EF; color: #0F6E56; }
.st-auto { background: #F1E9FF; color: #534AB7; }
.st-manual { background: #FBEAF0; color: #993556; }
.st-self { background: #FAEEDA; color: #854F0B; }
.st-seed { background: #EEEDFE; color: #3C3489; }
.st-abandon { background: #F1EFE8; color: #5F5E5A; }
.muted { color: var(--ink2); font-size: 12px; }
.okt { color: var(--teal); }
.warnt { color: var(--amber); }
.errt { color: var(--red); }
.formline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.formline label { color: var(--ink2); font-size: 13px; min-width: 120px; }
input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--pri); }
.evrow td:first-child { color: var(--ink2); font-size: 12px; white-space: nowrap; }
.evtype { font-size: 11px; border-radius: 5px; padding: 1px 6px; margin-right: 6px; }
.ev-auto_issue { background: #E2F5EF; color: #0F6E56; }
.ev-auto_check { background: #F1EFE8; color: #5F5E5A; }
.ev-abandon_reward { background: #FAEEDA; color: #854F0B; }
.ev-abandon_plain { background: #F1EFE8; color: #5F5E5A; }
.ev-claim { background: #EAF3FB; color: #185FA5; }
.ev-claim_fail { background: #FCEBEB; color: #A32D2D; }
.ev-win { background: #E2F5EF; color: #0F6E56; }
.ev-acc_new { background: #EEEDFE; color: #3C3489; }
.ev-follow_note { background: #EAF3FB; color: #185FA5; }
.ev-seed_import { background: #EEEDFE; color: #3C3489; }
.ev-deal_new { background: #EEEDFE; color: #3C3489; }
.ev-deal_win { background: #E2F5EF; color: #0F6E56; }
.ev-deal_lost { background: #FCEBEB; color: #A32D2D; }
.ev-lost_pool { background: #FAEEDA; color: #854F0B; }

/* ---------- 客户档案弹层 ---------- */
.dos {
  background: #fff; border-radius: 14px; width: min(900px, calc(100% - 30px));
  max-height: 88vh; overflow: auto; margin-top: 4vh; box-shadow: 0 12px 46px rgba(35,20,65,.35);
}
.dos-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px 10px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2;
}
.dos-head .avatar { width: 44px; height: 44px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.dos-title { font-size: 18px; font-weight: 500; color: var(--pri2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dos-owner { font-size: 12px; color: #5B3DB5; background: #F4EFFF; border: 1px solid #E4DAF5; border-radius: 6px; padding: 3px 10px; margin-top: 6px; display: inline-block; }
.dos-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dos-meta .meta-chip { font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid; display: inline-block; line-height: 1.4; }
.dos-meta .meta-chip.primary { background: #F4EFFF; border-color: #E4DAF5; color: #5B3DB5; }
.dos-meta .meta-chip.normal { background: #F8F5FC; border-color: #ECE5F5; color: var(--ink); }
.dos-meta .meta-chip.muted { background: #FAFAFB; border-color: #EEE; color: var(--ink2); }
.dos-form .hi { background: #FAF7FF; border-left: 3px solid #7C5CBF; padding: 6px 8px; border-radius: 4px; }
.dos-form .hi label { color: #5B3DB5 !important; font-weight: 500; }
.dos-form .hi input { border-color: #C4B0E8; background: #fff; }
.dos-sec { padding: 12px 20px; border-bottom: 1px solid #F2EDF7; }
.dos-label { font-size: 13px; color: var(--pri2); font-weight: 500; margin-bottom: 8px; }
.dos-form { display: flex; gap: 14px; flex-wrap: wrap; }
.dos-form label { display: block; color: var(--ink2); font-size: 12px; margin-bottom: 3px; }
.dos-form input, .dos-form select { width: 100%; }
.dos-form > div { min-width: 150px; flex: 1; }
.dos-op { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: none !important; width: 100%; }
.dos-tl { position: relative; padding-left: 4px; }
.dos-tl-item { display: flex; gap: 10px; padding: 6px 0; position: relative; }
.dos-tl-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; }
.dos-note { padding: 8px 20px 4px; font-size: 13px; min-height: 26px; }

/* ---------- 商机信息(档案内) ---------- */
.deal-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.deal-card { border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px; padding: 8px 12px; background: #fff; }
.deal-card.open { border-left-color: #7C5CBF; background: #FCFAFE; }
.deal-card.won { border-left-color: #1D9E75; background: #F7FCF9; }
.deal-card.lost { border-left-color: #C0392B; background: #FDF8F8; }
.deal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.deal-stage { font-size: 11px; border-radius: 5px; padding: 1px 8px; flex: none; }
.deal-stage.open { background: #EEEDFE; color: #3C3489; }
.deal-stage.won { background: #E2F5EF; color: #0F6E56; }
.deal-stage.lost { background: #FCEBEB; color: #A32D2D; }
.deal-amt { color: #0F6E56; }
.deal-body { font-size: 12px; color: var(--ink2); margin-top: 5px; line-height: 1.8; }
.deal-form { border: 1px dashed #C9B8E8; background: #FBF9FF; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.deal-form-title { font-size: 13px; font-weight: 500; color: #5B3DB5; margin-bottom: 8px; }
.deal-form .op-body { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.deal-form .op-body .col { display: flex; flex-direction: column; gap: 3px; }
.deal-form .op-body .col.col-grow { flex: 1; min-width: 200px; }
.deal-form .op-body .col.col-fix { flex: none; }
.deal-form .op-body .col span { font-size: 12px; color: var(--ink2); }
.deal-form .op-body .col input, .deal-form .op-body .col select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; }
.deal-form .op-foot { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deal-form .op-foot .hint { font-size: 12px; color: var(--ink2); }
.deal-mini { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.deal-mini .dm { font-size: 11px; border-radius: 4px; padding: 0 5px; }
.deal-mini .dm.open { background: #EEEDFE; color: #3C3489; }
.deal-mini .dm.won { background: #E2F5EF; color: #0F6E56; }
.deal-mini .dm.lost { background: #FCEBEB; color: #A32D2D; }

/* ---------- 我的操作：三段独立分组 ---------- */
.dos-op-block { padding: 10px 12px; border-radius: 8px; border: 1px solid; margin-bottom: 10px; }
.dos-op-block:last-child { margin-bottom: 0; }
.dos-op-block .op-head { font-size: 13px; font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.dos-op-block .op-head .ico { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; flex: none; }
.dos-op-block .op-body { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dos-op-block .op-body .col { display: flex; flex-direction: column; gap: 3px; }
.dos-op-block .op-body .col.col-grow { flex: 1; min-width: 200px; }
.dos-op-block .op-body .col.col-fix { flex: none; }
.dos-op-block .op-body .col label { font-size: 12px; color: var(--ink2); }
.dos-op-block .op-body .col input, .dos-op-block .op-body .col select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; }
.dos-op-block .op-foot { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.dos-op-block .op-foot .hint { font-size: 12px; color: var(--ink2); }
.dos-op-block.follow { background: #FAF7FF; border-color: #E4DAF5; }
.dos-op-block.follow .op-head { color: #5B3DB5; }
.dos-op-block.follow .op-head .ico { background: #7C5CBF; }
.dos-op-block.win { background: #F1F8F4; border-color: #C9E5D5; }
.dos-op-block.win .op-head { color: #0F6E56; }
.dos-op-block.win .op-head .ico { background: #1D9E75; }
.dos-op-block.drop { background: #FDF4F4; border-color: #F2D2D2; }
.dos-op-block.drop .op-head { color: #A32D2D; }
.dos-op-block.drop .op-head .ico { background: #C0392B; }

/* ---------- 其他标签/条 ---------- */
.due-badge { background: #FCEBEB; color: #A32D2D; }
.next-badge { background: #E2F5EF; color: #0F6E56; }
.st-badge.cdue { background: #FDF1E3; color: #B45309; }
/* 合同到期提醒卡 */
.card.due { border-left: 3px solid #D97706; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.card.due:hover { box-shadow: 0 3px 12px rgba(124,92,191,.18); transform: translateY(-1px); }
.card .due-more { float: right; font-size: 11.5px; color: var(--pri); }
.card .due-empty { font-size: 11.5px; color: var(--ink2); margin-top: 5px; }
.due-row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 4px; }
.due-row .due-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.due-row .due-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.due-row .due-days { flex: 0 0 auto; font-size: 11.5px; font-weight: 500; }


/* ---------- 弹窗 ---------- */
.ovl {
  position: fixed; inset: 0; background: rgba(35, 25, 55, .45);
  display: flex; align-items: center; justify-content: center; z-index: 99;
}
.dlg {
  background: #fff; border-radius: 14px; max-width: 460px; width: calc(100% - 40px);
  padding: 20px 22px; box-shadow: 0 10px 40px rgba(40, 20, 70, .3);
}
.dlg h3 { margin: 0 0 10px; font-size: 15px; }
.dlg .body { font-size: 13.5px; color: var(--ink); max-height: 60vh; overflow: auto; }
.dlg .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dlg .foot .btn { padding: 7px 16px; }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #332B43; color: #fff; border-radius: 999px; padding: 8px 18px;
  font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 80vw;
}
.toast.ok { background: #17785A; }
.toast.warn { background: #B26A00; }
.toast.err { background: #B23A2E; }

/* ---------- 话术库 ---------- */
.sc-cat { display: inline-block; font-size: 11.5px; background: #F1EEF8; color: #5B4A87; border-radius: 5px; padding: 1px 7px; }
.sc-brief { cursor: pointer; color: var(--ink); border-bottom: 1px dashed transparent; }
.sc-brief:hover { border-bottom-color: #B9A9E0; color: var(--pri2); }
label.ck { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12.5px; }
label.ck input { margin: 0; }
.dl-scripts {
  display: flex; flex-direction: column; gap: 4px; max-height: 24vh; overflow: auto;
  border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; background: #FCFAFE;
}
.dl-sc-item { font-size: 12.5px; }

/* ---------- 通话话术提示器 HUD（半透明 / 可拖动） ---------- */
.hud {
  position: fixed; right: 18px; top: 92px; width: 320px; z-index: 110;
  background: #FFFDF7; border: 1px solid #E4D9F5; border-radius: 12px;
  box-shadow: 0 12px 36px rgba(50, 25, 90, .28);
  display: flex; flex-direction: column; max-height: 70vh;
}
.hud-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-bottom: 1px solid #EFE7FA; cursor: move; user-select: none;
  background: linear-gradient(180deg, #F8F3FF, #F3ECFD); border-radius: 12px 12px 0 0;
}
.hud-tt { font-size: 12.5px; font-weight: 600; color: #4B3F72; }
.hud-tools { display: flex; align-items: center; gap: 6px; }
.hud-op { font-size: 11px; color: var(--ink2); display: inline-flex; align-items: center; gap: 4px; }
.hud-op input[type=range] { width: 62px; }
.hud-btn {
  border: 1px solid #DED1F0; background: #fff; color: #5B4A87; border-radius: 6px;
  width: 22px; height: 22px; line-height: 1; cursor: pointer; font-size: 13px; padding: 0;
}
.hud-btn:hover { background: #F3ECFD; }
.hud-body { padding: 8px 10px 10px; overflow: auto; }
.hud-hint { font-size: 11px; color: var(--ink2); margin-bottom: 6px; }
.hud-item { border: 1px solid #EFE7FA; border-radius: 9px; margin-bottom: 7px; background: #fff; overflow: hidden; }
.hud-item-h { padding: 7px 9px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; cursor: pointer; flex-wrap: wrap; }
.hud-item-h:hover { background: #FAF6FF; }
.hud-item-b {
  display: none; padding: 0 10px 9px; font-size: 12.5px; line-height: 1.75;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.hud-item.open .hud-item-b { display: block; }
.hud.min .hud-body { display: none; }

/* ---------- 流程审批 ---------- */
.fl-node {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: #FCFAFE; flex-wrap: wrap;
}
.fl-idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: #EEEDFE; color: #3C3489;
  font-size: 12px; font-weight: 600; flex: none;
}
.fl-node input[type=text] { width: 130px; }
.fl-node select { width: 104px; }
.fl-node label.ck { font-size: 12px; }
.tl { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.tl-item { position: relative; padding: 4px 0 12px; }
.tl-dot {
  position: absolute; left: -21px; top: 8px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
.link { color: var(--pri2); text-decoration: underline; cursor: pointer; }

/* ---------- 经营报表（管理层驾驶舱） ---------- */
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-head h3 { margin: 0 0 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn {
  border: none; background: #fff; color: var(--ink2); padding: 6px 14px; font-size: 12.5px;
  cursor: pointer; border-right: 1px solid var(--line);
}
.seg-btn:last-child { border-right: none; }
.seg-btn.on { background: var(--pri2); color: #fff; }
.rpt-kpi { gap: 12px; }
.rpt-kpi .card { flex: 1; min-width: 150px; }
.rpt-cmp { font-size: 11.5px; color: var(--ink2); margin-top: 4px; }
.delta { font-weight: 600; margin-left: 4px; }
.delta.up { color: #C0392B; }       /* 涨=红（中国习惯） */
.delta.down { color: #1E8449; }     /* 跌=绿 */
.delta.flat { color: var(--ink2); }
/* 卡片第二行对比：与「部门内最强」横向对标（只给结论，不展示对标人姓名/数值） */
.rpt-cmp.rpt-ceil { margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--line); }
.rpt-row { display: flex; gap: 12px; flex-wrap: wrap; }
.rpt-row .panel { flex: 1; min-width: 340px; }
.ax { font-size: 10px; fill: var(--ink2); }
.legend { margin-top: 6px; font-size: 11.5px; color: var(--ink2); display: flex; gap: 14px; }
.legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.lg-v { color: #7C5CBF; }
.lg-a { color: #C0392B; }
.lg-p { color: #B9A6D6; }
.lost-list { display: flex; flex-direction: column; gap: 8px; }
.lost-row { display: flex; align-items: center; gap: 10px; }
.lost-label { width: 150px; flex: none; font-size: 12.5px; color: var(--ink); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lost-bar { flex: 1; height: 18px; background: #F1EDF7; border-radius: 4px; overflow: hidden; }
.lost-fill { height: 100%; background: linear-gradient(90deg, #C0392B, #E06B5E); border-radius: 4px; }
.lost-num { width: 110px; flex: none; font-size: 12.5px; color: var(--ink); }
.lost-num small { color: var(--ink2); }

/* ---------- 导航未读红点（data-badge + content，不污染 textContent） ---------- */
.navtab .tab[data-badge] { position: relative; }
.navtab .tab[data-badge]::after {
  content: attr(data-badge);
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
  margin-left: 5px; padding: 0 4px; border-radius: 9px;
  background: #E23D5A; color: #fff; font-size: 10px; font-weight: 600;
  text-align: center; vertical-align: 1px;
}

/* ---------- 今日待办：目标进度条 ---------- */
.prog-wrap { margin: 10px 0 14px; }
.prog-top { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.prog-top .prog-label { font-weight: 600; color: var(--ink); min-width: 96px; }
.prog-top .prog-num { color: var(--ink2); flex: 1; }
.prog-top .prog-num b { color: var(--pri2); font-size: 14px; }
.prog-top .prog-pct { font-weight: 600; color: var(--pri2); font-size: 14px; }
.prog { height: 16px; margin-top: 6px; background: #F1EDF7; border-radius: 8px; overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #7C5CBF, #B06AB3); transition: width .3s ease; }
.prog.warn > i { background: linear-gradient(90deg, #C98A1B, #E0B45C); }
.prog.ok > i { background: linear-gradient(90deg, #1D9E75, #4CC79B); }
.prog-sub { font-size: 11.5px; color: var(--ink2); margin-top: 4px; }
.prog-sub b { color: var(--ink); }

/* ---------- 消息中心 ---------- */
.msg-list { display: flex; flex-direction: column; }
.msg { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: none; }
.msg.unread { background: #FBF8FF; }
.msg-tag { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 4px; background: #EFE9F8; color: var(--pri2); white-space: nowrap; }
.msg-tag.t-approval { background: #EDE4FA; color: #5B3FA3; }
.msg-tag.t-contract { background: #FDF1DC; color: #A9761B; }
.msg-tag.t-follow_due { background: #FBE3E0; color: #B03A2E; }
.msg-tag.t-stale_warn { background: #FDEBD8; color: #B7791F; }
.msg-tag.t-recycle { background: #F2E2E8; color: #A2375A; }
.msg-tag.t-transfer_in { background: #DFF3EC; color: #16795A; }
.msg-tag.t-transfer_out { background: #EAEAF2; color: #5A5A78; }
.msg-main { flex: 1; min-width: 0; }
.msg-title { font-weight: 600; font-size: 13px; }
.msg-body { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.msg-at { flex: none; font-size: 11px; color: var(--ink2); white-space: nowrap; }
.newdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #E23D5A; margin-left: 5px; vertical-align: 1px; }

/* ---------- 报表：成员排比 ---------- */
.rpt-scope { font-size: 12px; color: var(--pri2); background: #EFE9F8; border-radius: 4px; padding: 1px 8px; vertical-align: 2px; }
.bar { height: 14px; background: #F1EDF7; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #7C5CBF, #B06AB3); border-radius: 4px; }

/* ---------- 商机：阶段进度条（卡片内） ---------- */
.stg-wrap { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.stg-bar { display: flex; gap: 3px; flex: none; }
.stg-bar > i { display: block; width: 26px; height: 5px; border-radius: 3px; background: #EDE7F6; }
.stg-bar > i.on { background: linear-gradient(90deg, #7C5CBF, #B06AB3); }
.stg-name { font-size: 11.5px; color: var(--pri2); background: #F1ECFA; border-radius: 4px; padding: 1px 7px; }

/* ---------- 报表：本月达成预测（加权预测） ---------- */
.rpt-fc .fc-nums { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.rpt-fc .fc-nums > div { display: flex; flex-direction: column; gap: 2px; min-width: 92px; }
.rpt-fc .fc-nums span { font-size: 11.5px; color: var(--ink2); }
.rpt-fc .fc-nums b { font-size: 17px; font-weight: 600; }
.rpt-fc .fc-nums b.ok { color: var(--teal); }
.rpt-fc .fc-nums b.fcv { color: var(--pri2); }
.rpt-fc .fc-nums b.warnt { color: var(--amber); }
.fc-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: #F1EDF7; }
.fc-bar > i { display: block; height: 100%; }
.fc-bar .seg-won { background: #1D9E75; }
.fc-bar .seg-fc { background: #9CC5EC; }
.fc-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink2); margin-top: 6px; }
.fc-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.fc-legend .dot.won { background: #1D9E75; }
.fc-legend .dot.fc { background: #9CC5EC; }
.fc-legend .dot.gap { background: #F1EDF7; border: 1px solid var(--line); }
.fc-tip { margin-top: 8px; font-size: 12px; color: var(--ink2); background: #FBF7EF; border-left: 3px solid var(--amber); border-radius: 4px; padding: 6px 10px; }

/* ---------- 报表：转化漏斗 ---------- */
.fn-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fn-lb { flex: none; width: 96px; font-size: 12.5px; color: var(--ink); }
.fn-track { flex: 1; height: 18px; background: #F6F3FA; border-radius: 4px; overflow: hidden; min-width: 110px; }
.fn-track > i { display: block; height: 100%; border-radius: 4px; }
.fn-row .fn-1 { background: linear-gradient(90deg, #5B3FA3, #7C5CBF); }
.fn-row .fn-2 { background: linear-gradient(90deg, #7C5CBF, #9B6FD1); }
.fn-row .fn-3 { background: linear-gradient(90deg, #B06AB3, #D48FBF); }
.fn-row .fn-4 { background: linear-gradient(90deg, #1D9E75, #4CB894); }
.fn-val { flex: none; width: 48px; text-align: right; font-size: 12.5px; font-weight: 600; }
.fn-rate { flex: none; width: 60px; text-align: right; font-size: 11.5px; color: var(--ink2); }

/* ---------- 参数页：商机阶段配置输入 ---------- */
.stg-in { border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; font-size: 12.5px; font-family: inherit; color: var(--ink); }
.stg-in:focus { outline: none; border-color: var(--pri); }
