/* 客户管理：外联页两栏，不覆盖客户档案 .crm-layout */
.center-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 960px) {
  .center-split { grid-template-columns: 1fr; }
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.task-list {
  display: grid;
  gap: 10px;
}
.task-card {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.task-card .task-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.funnel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.funnel span {
  font-size: 12px;
  background: var(--chip, #f3f4f6);
  border-radius: 999px;
  padding: 2px 8px;
}
.bl-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}
.job-row { cursor: pointer; }
.job-row:hover { background: var(--hover); }
.crm-pager, .crm-sub-pager {
  flex-wrap: wrap;
  gap: 6px;
}
.crm-sub-pager {
  padding: 8px 10px 12px;
  border-top: 1px solid var(--line, #e5e7eb);
  justify-content: flex-end;
}
.crm-sub-pager .kb-pager-meta,
.crm-pager .kb-pager-meta {
  margin-right: auto;
  color: var(--muted, #6b7280);
  font-size: 12px;
}
.crm-sub-pager select,
.crm-pager select { min-width: 7.5rem; }
.crm-sub-pager .btn,
.crm-pager .btn { min-width: 2.25rem; }
.sms-wizard { display: grid; gap: 14px; }
.sms-wizard > .panel { margin-top: 0; }
.sms-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand, #059669);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: -1px;
}
.sms-tpl-pick {
  display: grid;
  gap: 4px;
  padding: 12px 16px 14px;
}
.sms-tpl-pick select { max-width: 40rem; }
.sms-tpl-pick > .hint { padding: 6px 0 0; }
.sms-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.sms-pick {
  display: flex;
  gap: 8px;
}
.sms-pick input { flex: 1; }
.sms-hits {
  display: grid;
  gap: 4px;
  margin: 6px 0;
}
.sms-hits button {
  text-align: left;
  border: 1px solid var(--line, #e5e7eb);
  background: var(--panel);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}
.sms-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 8px;
}
.sms-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: var(--chip, #f3f4f6);
  border-radius: 999px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
}
.sms-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted, #6b7280);
}
.sms-confirm-block {
  padding: 14px 16px 16px;
}
.sms-confirm-block + .sms-confirm-block {
  border-top: 1px solid var(--line, #e5e7eb);
  background: var(--chip, #f8fafc);
}
.sms-confirm-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.sms-confirm-h strong {
  font-size: var(--fs-md, 14px);
  font-weight: var(--fw-bd, 700);
}
.sms-confirm-h .toolbar { margin-left: auto; }
.sms-confirm-block > .hint { padding: 0 0 10px; }
.sms-var-map > .hint { padding: 0; }
.sms-confirm-block .funnel { margin: 0 0 10px; }
.sms-confirm-block .funnel:empty { display: none; margin: 0; }
.sms-confirm-block .table-wrap {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  background: var(--panel);
}
.sms-var-map { display: grid; gap: 8px; }
.sms-var-head,
.sms-var-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(10rem, 16rem) minmax(12rem, 20rem);
  gap: 8px 12px;
  align-items: center;
}
.sms-var-head {
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 600;
}
.sms-var-key {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  font-weight: 650;
  background: var(--panel);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 6px;
  padding: 4px 8px;
  word-break: break-all;
}
.sms-var-row select,
.sms-var-row input { margin: 0; }
.sms-var-lab {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.sms-preview-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--ink-2, #4b5563);
  font-size: 13px;
  line-height: 1.5;
  background: var(--panel);
  border: 1px dashed var(--line, #d1d5db);
  border-radius: 8px;
}
.sms-preview-empty[hidden] { display: none; }
#smsPreviewMsg.is-stale,
#mailPreviewMsg.is-stale { color: var(--warn, #b45309); font-weight: 600; }
@media (max-width: 720px) {
  .sms-var-head { display: none; }
  .sms-var-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 8px;
    background: var(--panel);
  }
  .sms-var-lab {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted, #6b7280);
  }
}
.sms-job-row { cursor: pointer; }
.panel-h .toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
#smsTplList .hint { margin: 2px 0 0; font-size: 12px; }
.ov-kpi a, a.ov-kpi {
  color: inherit;
  text-decoration: none;
  display: block;
}
.ov-kpi a:hover .v, a.ov-kpi:hover .v { color: var(--brand, #059669); }
.ov-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}
.auto-actions { display: grid; gap: 10px; }
.auto-act {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  padding: 8px;
}
@media (max-width: 720px) {
  .auto-act { grid-template-columns: 1fr; }
}
#smsJobDetail .table-wrap { max-height: 48vh; overflow: auto; }
#jobDetail pre {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.crm-queues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}
.crm-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.crm-hero strong { font-size: 16px; }
.crm-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.crm-hero-actions { padding: 8px 14px; }
.crm-complete {
  min-width: 76px;
  text-align: center;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--brand-soft);
}
.crm-complete.is-low { background: var(--danger-soft); }
.crm-complete span { display: block; font-size: 18px; font-weight: 700; }
.crm-complete em { font-style: normal; color: var(--muted, #6b7280); font-size: 11px; }
.crm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line, #e5e7eb);
  padding: 0 8px;
}
.crm-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--muted, #6b7280);
  border-bottom: 2px solid transparent;
}
.crm-tabs button.is-on {
  color: var(--brand, #059669);
  border-bottom-color: var(--brand, #059669);
  font-weight: 600;
}
.crm-tab-pane { min-height: 240px; }
.crm-timeline { max-height: 58vh; }
.crm-next-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crm-next-quick input { flex: 1 1 160px; }
.crm-name { font-weight: 600; }
.crm-overdue, tr.is-overdue td.crm-overdue { color: var(--danger-ink); font-weight: 600; }
.crm-table-panel table { min-width: 1000px; }
.crm-table-panel td .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.crm-chats { max-height: 52vh; }
.crm-layout-list {
  grid-template-columns: 1fr;
}
.crm-act {
  color: var(--brand, #059669);
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.crm-act:hover { text-decoration: underline; }
a.crm-follow {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.crm-follow:hover { background: rgba(0,0,0,.03); }

.modal-box.crm-detail-box {
  width: min(1080px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
#crmDetailModal #crmDetail:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.crm-detail-box .crm-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px 8px;
  border-bottom: 0;
}
.crm-detail-box .crm-hero {
  flex: 1;
  padding: 0;
  border: 0;
}
.crm-modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.crm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 10px;
}
.crm-kpi {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg);
}
.crm-kpi em {
  display: block;
  font-style: normal;
  color: var(--muted, #6b7280);
  font-size: 11px;
}
.crm-kpi strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  word-break: break-all;
}
.crm-kpi.is-overdue strong { color: var(--danger-ink); }
.crm-complete small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted, #6b7280);
  line-height: 1.3;
}
.crm-detail-scroll {
  overflow: auto;
  flex: 1;
  min-height: 240px;
}
.crm-detail-box .crm-hero-actions { padding: 8px 18px; }
.crm-detail-box .crm-tabs { padding: 0 12px; }
.crm-detail-box .crm-profile { padding: 12px 18px 20px; border-bottom: 0; }
.crm-detail-box .crm-follows,
.crm-detail-box .crm-timeline { max-height: none; }
.crm-detail-box .crm-chats { max-height: 42vh; }
.crm-detail-loading { padding: 48px 18px; }
@media (max-width: 860px) {
  .crm-kpis { grid-template-columns: 1fr 1fr; }
  .crm-modal-head { flex-direction: column; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.page-head-text { min-width: 0; }
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.page-tabs[hidden] { display: none; }
#groupTabs {
  flex: 1 0 100%;
}
#groupTabs[hidden] { display: none !important; }
.page-tab {
  border: 1px solid var(--line, #e5e7eb);
  background: var(--panel, #fff);
  color: var(--muted, #6b7280);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: var(--fw-md, 500);
  line-height: 1.3;
}
.page-tab:hover {
  color: var(--ink, #0f172a);
  border-color: var(--brand, #059669);
}
.page-tab.is-on {
  background: var(--brand-soft, #ecfdf5);
  color: var(--brand, #059669);
  border-color: transparent;
  font-weight: var(--fw-sb, 600);
}
.imp-modes { margin: 0 0 12px; }
.db-map {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}
.db-map-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  align-items: center;
}
.db-map-row label { margin: 0; }
@media (max-width: 720px) {
  .db-map-row { grid-template-columns: 1fr; }
}

/* 今日待办落地页（CRM-E-P0-1 / P0-2 · 2026-09 深度优化） */
.crm-todo {
  display: grid;
  gap: 12px;
}
.todo-greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.todo-greet-text { min-width: 0; display: grid; gap: 2px; }
.todo-greet-text strong { font-size: 15px; }
.todo-greet-text .hint { margin: 0; }
.crm-todo .crm-chips { margin: 8px 0 0; }
.crm-todo-list {
  display: grid;
  gap: 6px;
}
/* 池指标卡：点击进入对应客户池 */
.crm-todo-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.crm-kpi-card {
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: var(--panel, #fff);
  cursor: pointer;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.crm-kpi-card:hover {
  border-color: var(--brand, #059669);
  box-shadow: 0 4px 14px rgba(5, 150, 105, .10);
  transform: translateY(-1px);
}
.crm-kpi-card em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted, #6b7280);
}
.crm-kpi-card strong {
  font-size: 24px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.crm-kpi-card .hint { margin: 0; font-size: 11px; }
.crm-kpi-card.is-warn strong { color: var(--danger-ink); }
.crm-kpi-card.is-warn { border-color: #fecaca; }
@media (max-width: 960px) {
  .crm-todo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .crm-todo-kpis { grid-template-columns: 1fr; }
}
/* 待办行 */
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition: opacity .2s ease;
}
.todo-item:hover { border-color: var(--brand, #059669); }
.todo-item.is-overdue { border-left: 3px solid #b91c1c; }
.todo-item.is-done { opacity: .45; }
.todo-main { min-width: 0; flex: 1; }
.todo-main strong { font-size: 13px; }
.todo-main .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-main em.is-overdue { color: var(--danger-ink); font-style: normal; font-weight: 600; }
.todo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
/* 池列表页：返回待办 + 当前池名 */
.todo-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}
.todo-back-row .hint { margin: 0; }
@media (max-width: 720px) {
  .todo-item { flex-direction: column; align-items: stretch; }
  .todo-back-row { flex-wrap: wrap; }
}
/* 销售分组内页签（咨询客户 / 咨询商机 / 客户导入） */
#groupTabs .vs-tabs { justify-content: flex-start; }
/* 新建客户即时查重提示（CRM-E-P0-3） */
#newContactDup {
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
#newContactDup.hidden { display: none; }
/* 列表行内操作（CRM-E-P0-2 / P0-5） */
.crm-row-actions { display: inline-flex; gap: 10px; white-space: nowrap; }
/* 渠道身份（CRM-E-P1-2） */
.crm-identity .btn { margin-top: 4px; }
/* 跟进快捷短语（CRM-E-P1-5） */
.crm-follow-phrases { margin: 0 0 8px; }
.crm-follow-phrases .crm-chip { margin: 0; }
/* 保存的筛选视图（CRM-E-P2-3） */
.crm-view-chip { display: inline-flex; align-items: stretch; gap: 0; }
.crm-view-chip .crm-chip { border-radius: 0; }
.crm-view-chip .crm-chip:first-child { border-radius: 999px 0 0 999px; }
.crm-view-chip .crm-chip:last-child { border-radius: 0 999px 999px 0; }

.crm-list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.crm-dupes {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.crm-dupes.hidden, .crm-peers.hidden { display: none; }
.crm-peers { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#view-analytics > .row2 {
  gap: 16px;
  margin: 0 0 18px;
  align-items: stretch;
}
#view-analytics > .row2 .panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.crm-bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  flex: 1;
}
.crm-bar {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.crm-bar > span:first-child {
  color: var(--muted, #6b7280);
  white-space: nowrap;
}
.crm-bar-track {
  display: block;
  height: 10px;
  background: var(--hover, #f3f4f6);
  border-radius: 99px;
  overflow: hidden;
  min-width: 0;
}
.crm-bar-track i {
  display: block;
  height: 100%;
  background: var(--accent, #0f766e);
  border-radius: 99px;
  min-width: 0;
}
.crm-bar em {
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 2.25rem;
}
#anFollowMetrics > .hint,
#anDealReport > .hint {
  padding-bottom: 8px;
}
.crm-stat-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.crm-stat-dl div { padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.crm-stat-dl dt { font-size: 12px; color: var(--muted, #6b7280); }
.crm-stat-dl dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; }

.mail-tpl-box { width: min(920px, 100%); }
.mail-ai-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}
.mail-ai-row select {
  min-width: 7.5rem;
}
.mail-preview-frame {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  margin: 0 0 12px;
}
.mail-preview-frame iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
  background: var(--panel);
}
.mail-style-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.mail-style-card {
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--line, #e5e7eb);
  background: var(--panel);
  border-radius: 10px;
  padding: 6px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.mail-style-card:hover,
.mail-style-card.is-on {
  border-color: var(--brand, #0f766e);
}
.mail-style-card img {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}
.mail-style-card strong {
  font-size: 13px;
}
.mail-style-card span {
  font-size: 12px;
  color: var(--muted, #6b7280);
}
.care-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.care-card {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  background: var(--panel, #fff);
}
.care-card-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.care-card-h span,
.care-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #6b7280);
  line-height: 1.5;
}
.care-card.is-national {
  border-color: #f0b4b4;
  background: #fff7f7;
}
.care-card.is-today {
  box-shadow: 0 0 0 1px #dc2626 inset;
}
.care-card.is-off {
  opacity: 0.55;
}






