/* ==========================================================================
   铂诗玥 · 客户管理作战台
   轻量企业级控制台样式 —— 无外部字体 / 无外部依赖
   ========================================================================== */

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #e3e8ef;
  --line-strong: #cfd8e3;
  --ink: #1f2937;
  --ink-2: #475569;
  --ink-3: #64748b;
  --ink-4: #94a3b8;

  --accent: #0d7d84;
  --accent-dark: #0a6167;
  --accent-soft: #e6f4f5;
  --accent-2: #2563eb;
  --accent-2-soft: #eaf0fe;

  --p0: #dc2626;
  --p0-soft: #fdeceb;
  --p1: #d97706;
  --p1-soft: #fdf3e3;
  --p2: #2563eb;
  --p2-soft: #eaf0fe;

  --doctor: #6d28d9;
  --doctor-soft: #f3eefe;

  --ok: #15803d;
  --ok-soft: #e9f6ee;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
          "Noto Sans CJK SC", "WenQuanYi Micro Hei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ 布局 */

.app {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #0f2c30;
  color: #cfe3e5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #fff; font-size: 13px; letter-spacing: .2px; }
.brand-text span { color: #7ea9ad; font-size: 11px; }

.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: #b8d3d6;
  text-align: left;
  font-size: 13px;
  transition: background .14s, color .14s;
}
.nav-item svg { flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item.active svg { opacity: 1; }

.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.health-pill {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .06);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: #cfe3e5;
}
.health-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-idle { background: #94a3b8; }
.dot-ok { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.dot-bad { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }
.side-note { margin-top: 8px; font-size: 10.5px; color: #7ea9ad; line-height: 1.5; }

.main { min-width: 0; padding: 0 20px 40px; }

.view { display: none; }
.view.active { display: block; }

/* ------------------------------------------------------------- 页头/控件 */

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}
.vh-title h1 { font-size: 19px; letter-spacing: -.2px; }
.vh-title .sub { color: var(--ink-3); font-size: 12px; margin-top: 3px; }

.head-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.tilde { color: var(--ink-4); padding-bottom: 8px; }

.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > span { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.field-grow { flex: 1 1 180px; }

.input {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  outline: none;
  min-width: 0;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 125, 132, .12); }
select.input { padding-right: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s;
}
.btn:hover { background: #f1f5f9; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: #eef2f6; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.switch { display: inline-flex; align-items: center; gap: 7px; padding-bottom: 5px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 34px; height: 19px; border-radius: 999px;
  background: #cbd5e1; position: relative; transition: background .16s; flex: none;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; transition: transform .16s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(15px); }
.switch-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }

/* ---------------------------------------------------------------- 卡片 */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.card-head h2 { font-size: 14px; }
.card-head .hint { font-size: 11.5px; color: var(--ink-4); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid-2 > .card { margin-bottom: 14px; }

.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr) minmax(0, 1.2fr);
  gap: 14px;
}
.grid-3 > .card { margin-bottom: 14px; }

/* ------------------------------------------------------- 环形图（SVG） */

.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut-svg { flex: none; width: 140px; height: 140px; }
.donut-center { font-size: 21px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.donut-center-sub { font-size: 10px; fill: var(--ink-4); }
.donut-legend { display: flex; flex-direction: column; gap: 5px; min-width: 128px; flex: 1 1 128px; }
.donut-leg { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto auto; gap: 7px; align-items: center; }
.donut-swatch { width: 9px; height: 9px; border-radius: 2px; }
.donut-leg-name { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-leg-val { font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.donut-leg-pct { font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------------------------------------------------------------- KPI */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-accent, var(--line-strong));
}
.kpi-label { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.kpi-value { font-size: 20px; font-weight: 650; letter-spacing: -.4px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 11px; font-weight: 500; color: var(--ink-4); margin-left: 2px; }
.kpi-sub { font-size: 10.5px; color: var(--ink-4); }
.kpi.tone-p0 { --kpi-accent: var(--p0); }
.kpi.tone-p1 { --kpi-accent: var(--p1); }
.kpi.tone-accent { --kpi-accent: var(--accent); }
.kpi.tone-accent2 { --kpi-accent: var(--accent-2); }
.kpi.tone-ok { --kpi-accent: var(--ok); }
.kpi.tone-mute { --kpi-accent: var(--ink-4); }

/* ------------------------------------------------------- 图表（手写） */

.chart-hours {
  display: flex; align-items: flex-end; gap: 6px;
  height: 150px; padding-top: 18px;
}
.hour-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; height: 100%; }
.hour-count { font-size: 11px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hour-bar {
  width: 100%; max-width: 38px;
  background: linear-gradient(180deg, #17a2ab, var(--accent));
  border-radius: 4px 4px 2px 2px;
  min-height: 3px;
  transition: height .3s ease;
}
.hour-label { font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

.load-wrap { display: flex; flex-direction: column; gap: 12px; }
.load-group > h3 {
  font-size: 11.5px; color: var(--ink-3); font-weight: 600;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.load-group > h3::before { content: ""; width: 3px; height: 11px; background: var(--accent); border-radius: 2px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 42px; align-items: center; gap: 8px; margin-bottom: 4px; }
.bar-name { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; background: #eef2f6; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: var(--accent); transition: width .3s ease; }
.bar-fill.alt { background: var(--accent-2); }
.bar-fill.warm { background: var(--p1); }
.bar-val { font-size: 11.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.dist-wrap { display: flex; flex-direction: column; gap: 14px; }
.dist-block h3 { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.dist-empty { font-size: 11.5px; color: var(--ink-4); }

/* -------------------------------------------------------------- 过滤器 */

.filters {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.filters .field { min-width: 122px; }

/* -------------------------------------------------------------- 名单 */

.roster { display: flex; flex-direction: column; gap: 8px; }

.roster-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: border-color .14s, box-shadow .14s;
}
.roster-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.roster-item.open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 125, 132, .09); }
.roster-item.cancelled .rr-name { color: var(--ink-4); text-decoration: line-through; }

.roster-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto 22px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
}
.roster-row:hover { background: #fbfcfd; }

.rr-time { display: flex; flex-direction: column; line-height: 1.25; }
.rr-time b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.rr-time i { font-style: normal; font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

.rr-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rr-line1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rr-name {
  font-size: 14px; font-weight: 650; color: var(--ink);
  cursor: pointer; border-bottom: 1px dashed transparent;
}
.rr-name:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rr-projects { font-size: 12px; color: var(--ink-3); }
.rr-line2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rr-line2 .meta { font-size: 11.5px; color: var(--ink-3); }
.rr-line2 .meta i { font-style: normal; color: var(--ink-4); margin-right: 3px; }
.rr-objective {
  font-size: 12px; color: var(--ink-2);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 4px 8px;
  margin-top: 2px;
}
.rr-flags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rr-chev { color: var(--ink-4); transition: transform .18s; font-size: 11px; text-align: center; }
.roster-item.open .rr-chev { transform: rotate(180deg); }

.roster-detail {
  border-top: 1px dashed var(--line);
  padding: 14px;
  background: #fcfdfe;
}

/* -------------------------------------------------------------- 徽章 */

.tier-badge, .chip, .pstatus, .prio, .tag {
  display: inline-flex; align-items: center;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  padding: 1px 8px;
  white-space: nowrap;
  line-height: 1.7;
}
.tier-badge { color: #fff; background: var(--tier-color, var(--ink-4)); }
.chip { background: #eef2f6; color: var(--ink-2); font-weight: 500; }
.chip-vt { background: var(--accent-2-soft); color: var(--accent-2); }
.chip-quiet { background: transparent; color: var(--ink-4); border: 1px solid var(--line); }

.pstatus { font-weight: 600; }
.pstatus-arrived { background: var(--ok-soft); color: var(--ok); }
.pstatus-booked { background: var(--p2-soft); color: var(--p2); }
.pstatus-confirmed { background: #eef2ff; color: #4338ca; }
.pstatus-cancelled { background: #f1f5f9; color: var(--ink-3); }
.pstatus-other { background: #f1f5f9; color: var(--ink-3); }

.prio { color: #fff; }
.prio-P0 { background: var(--p0); }
.prio-P1 { background: var(--p1); }
.prio-P2 { background: var(--p2); }

.tag { background: #eef2f6; color: var(--ink-2); }
.tag-purpose { background: var(--accent); color: #fff; }

/* --------------------------------------------------------- 门店徽章
   多门店：湖西店 = teal（与 --accent 同族）、湖东店 = amber（与 --p1 同族），
   未知门店走中性灰。配色在这里统一，前端任何位置都复用 .store-badge。 */

.store-badge {
  display: inline-flex; align-items: center;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px;
  line-height: 1.45;
  white-space: nowrap;
  border: 1px solid transparent;
}
.store-huxi { background: var(--accent-soft); color: var(--accent-dark); border-color: #cbe7e9; }
.store-hudong { background: var(--p1-soft); color: #9a5b09; border-color: #f0dcb8; }
/* 通用色位：新增门店按 key 稳定分配，保证同一家店在 6 个视图里颜色一致 */
.store-t0 { background: var(--accent-soft); color: var(--accent-dark); border-color: #cbe7e9; }
.store-t1 { background: var(--p1-soft); color: #9a5b09; border-color: #f0dcb8; }
.store-t2 { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.store-t3 { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.store-t4 { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.store-t5 { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.store-other { background: #eef2f6; color: var(--ink-2); border-color: var(--line); }

.store-join { color: var(--ink-4); font-size: 10px; margin: 0 2px; }

/* 跨店：虚线描边 + ⇄ 图标，让「同一天跑两家店」一眼可见 */
.store-cross {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 1px 5px 1px 3px;
  border: 1px dashed #e0b880;
  border-radius: 999px;
  background: #fffaf1;
}
.store-cross .store-badge { border-color: transparent; }
.store-cross-icon { font-size: 10px; color: var(--p1); margin-right: 2px; }

/* 名单行内的跨店行程摘要 */
.rr-trip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-2);
}
.rr-trip .trip-key {
  background: var(--p1-soft); color: #9a5b09;
  border-radius: 3px; padding: 0 5px;
  font-size: 10.5px; font-weight: 700;
}
.rr-trip .trip-arrow { color: var(--ink-4); }

/* KPI 条内的门店分布 */
.kpi-sep { color: var(--ink-4); margin: 0 6px; }

/* 作战卡：门店与责任人 / 跨店到院行程 */
.store-lines { display: flex; flex-direction: column; gap: 6px; }
.store-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.store-line-ico { font-size: 12px; }
.store-line-meta { color: var(--ink-2); }
.store-line-meta b { font-weight: 650; }
.store-line-meta i { font-style: normal; color: var(--ink-4); margin: 0 6px; }
.store-src { color: var(--ink-4); font-size: 11px; margin-left: 4px; }

.visit-trip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 8px 10px;
}
.trip-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 650; color: var(--ink-2);
  margin-bottom: 6px;
}
.trip-flag {
  background: var(--p1-soft); color: #9a5b09;
  border-radius: 3px; padding: 0 5px;
  font-size: 10.5px; font-weight: 700;
}
.trip-list { display: flex; flex-direction: column; gap: 4px; }
.trip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.trip-time { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 38px; }
.trip-type { color: var(--ink-2); }
.trip-projects { color: var(--ink-2); }
.trip-expert { color: var(--ink-3); }

/* 客户 360：门店贡献 / 到院史 */
.store-head-badges {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 8px; font-size: 11.5px; color: var(--ink-3);
}
.store-table tr.store-sum td {
  font-weight: 650;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
}
.store-caveat {
  margin-top: 8px;
  font-size: 11.5px; color: var(--ink-3); line-height: 1.7;
  background: var(--panel-2);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 4px 4px 0;
  padding: 6px 9px;
}
.visit-hist { display: flex; flex-direction: column; gap: 8px; }
.vh-day { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.vh-day.vh-cross { border-color: #e8cfa6; box-shadow: 0 0 0 2px rgba(217, 119, 6, .07); }
.vh-date {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: var(--panel-2);
  font-size: 11.5px; font-weight: 650; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.vh-day.vh-cross .vh-date { background: var(--p1-soft); color: #9a5b09; }
.vh-flag {
  background: #fff; border: 1px dashed #e0b880; color: #9a5b09;
  border-radius: 3px; padding: 0 5px;
  font-size: 10.5px; font-weight: 700;
}
.vh-rows { display: flex; flex-direction: column; }
.vh-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px; font-size: 12.5px;
}
.vh-row + .vh-row { border-top: 1px dashed var(--line); }
.vh-time { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 38px; }
.vh-projects { color: var(--ink-2); }
.vh-expert { color: var(--ink-3); }

/* 企微预览：门店行 / 跨店行着色，便于在长简报里定位 */
.wc-p.wc-store { color: var(--accent-dark); font-weight: 600; }
.wc-p.wc-cross { color: #9a5b09; font-weight: 600; }

/* --------------------------------------------------- 作战卡（核心） */

.bc { display: flex; flex-direction: column; gap: 12px; }

.bc-sec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.bc-sec > h3 {
  font-size: 12px; font-weight: 650;
  padding: 7px 10px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-2);
}
.bc-sec > h3 .n {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--ink-4);
  width: 15px; height: 15px; border-radius: 4px; display: grid; place-items: center; flex: none;
}
.bc-sec-body { padding: 10px; }
.bc-sec-body > * + * { margin-top: 8px; }

.bc-objective {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(180deg, #f0fbfb, #eaf6f7);
  border: 1px solid #bfe3e5;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 11px 13px;
}
.bc-objective .lbl {
  font-size: 10.5px; font-weight: 700; color: var(--accent-dark);
  background: #fff; border: 1px solid #bfe3e5; border-radius: 4px;
  padding: 2px 6px; flex: none; letter-spacing: .4px;
}
.bc-objective .txt { font-size: 14px; font-weight: 600; line-height: 1.65; color: #10484c; }

/* 目的 */
.purpose-text { font-size: 14px; font-weight: 600; line-height: 1.6; }
.purpose-focus { font-size: 12.5px; color: var(--ink-2); }
.purpose-focus b { color: var(--accent-dark); }
.bullet { display: flex; flex-direction: column; gap: 3px; }
.bullet li { font-size: 12.5px; color: var(--ink-2); padding-left: 13px; position: relative; line-height: 1.6; }
.bullet li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); }

/* 咨询师 / 医生 双栏 */
.script-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.script-panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.script-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 11px;
  font-size: 12.5px; font-weight: 700; color: #fff;
  letter-spacing: .3px;
}
.script-head .who { font-size: 10.5px; font-weight: 500; opacity: .85; margin-left: auto; }
.script-body { padding: 9px 10px; display: flex; flex-direction: column; gap: 7px; background: #fff; }

.script-panel.consultant { border-color: #b6dfe1; }
.script-panel.consultant .script-head { background: linear-gradient(180deg, #128e96, var(--accent)); }
.script-panel.consultant .script-item { background: #f2fafb; border-left-color: var(--accent); }
.script-panel.consultant .script-chip { background: var(--accent); }

.script-panel.doctor { border-color: #cdbdf2; }
.script-panel.doctor .script-head { background: linear-gradient(180deg, #7c3aed, var(--doctor)); }
.script-panel.doctor .script-item { background: #f8f5ff; border-left-color: var(--doctor); }
.script-panel.doctor .script-chip { background: var(--doctor); }

.script-item {
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 7px 10px;
}
.script-chip {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; color: #fff;
  border-radius: 3px; padding: 1px 6px; margin-bottom: 4px;
  letter-spacing: .3px;
}
.script-text {
  font-size: 13.5px;
  line-height: 1.85;
  color: #14343a;
  letter-spacing: .1px;
}
.script-panel.doctor .script-text { color: #33235c; }

/* 必做动作 */
.checklist { display: flex; flex-direction: column; gap: 6px; counter-reset: ck; }
.checklist li {
  display: flex; gap: 8px;
  font-size: 12.5px; line-height: 1.65; color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
}
.checklist li::before {
  counter-increment: ck; content: counter(ck);
  flex: none;
  width: 16px; height: 16px; margin-top: 2px;
  border-radius: 4px; background: var(--ink-3); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}

/* 升单机会 */
.upsell-list { display: flex; flex-direction: column; gap: 8px; }
.upsell-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: #fff;
}
.upsell-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; }
.upsell-project { font-size: 13.5px; font-weight: 650; }
.upsell-reason { font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.talk {
  display: flex; gap: 8px;
  margin-top: 7px;
  background: #fffdf5;
  border: 1px solid #f3e2b8;
  border-left: 3px solid var(--p1);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 11px;
}
.talk .q { font-size: 10.5px; font-weight: 700; color: var(--p1); flex: none; letter-spacing: .5px; padding-top: 2px; }
.talk .t {
  font-size: 13.5px; line-height: 1.9; color: #4a3a12;
  font-style: normal;
}

/* 风险 */
.risk-list { display: flex; flex-direction: column; gap: 7px; }
.risk-item {
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-left-width: 4px;
}
.risk-item .rt { font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.risk-item .ra { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.6; }
.risk-item .rf { font-size: 10.5px; color: var(--ink-4); margin-top: 3px; }
.risk-high { background: var(--p0-soft); border-color: #f6c9c5; border-left-color: var(--p0); }
.risk-high .rt { color: #991b1b; }
.risk-medium { background: var(--p1-soft); border-color: #f2ddb4; border-left-color: var(--p1); }
.risk-medium .rt { color: #92400e; }
.risk-low { background: #f8fafc; border-color: var(--line); border-left-color: var(--ink-4); }
.risk-low .rt { color: var(--ink-2); }

/* 画像 */
.profile-groups { display: flex; flex-direction: column; gap: 8px; }
.profile-group { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 9px; align-items: start; }
.profile-group > .gl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; padding-top: 2px; }
.profile-values { display: flex; flex-wrap: wrap; gap: 5px; }
.pv { font-size: 11.5px; padding: 1px 8px; border-radius: 4px; background: #eef2f6; color: var(--ink-2); }
.pv-conflict { background: var(--p0-soft); color: #991b1b; border: 1px solid #f6c9c5; }
.pv-label { font-size: 10.5px; color: var(--ink-4); margin-right: 3px; }

/* 已做 */
.done-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.dstat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 9px; }
.dstat .dl { font-size: 10.5px; color: var(--ink-3); }
.dstat .dv { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.dstat .dv.money { font-size: 14px; }

.pkg-table { width: 100%; border-collapse: collapse; }
.pkg-table th {
  font-size: 10.5px; color: var(--ink-3); font-weight: 600; text-align: left;
  padding: 5px 7px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  white-space: nowrap;
}
.pkg-table td { padding: 6px 7px; border-bottom: 1px solid #f1f5f9; font-size: 12px; vertical-align: middle; }
.pkg-table tr:last-child td { border-bottom: 0; }
.pkg-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pkg-name { font-weight: 600; color: var(--ink); }
.pkg-progress { display: flex; align-items: center; gap: 7px; min-width: 120px; }
.pkg-track { flex: 1; height: 7px; background: #eef2f6; border-radius: 4px; overflow: hidden; min-width: 52px; }
.pkg-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.pkg-fill.warn { background: var(--p1); }
.pkg-fill.danger { background: var(--p0); }
.pkg-note { font-size: 10.5px; color: var(--ink-4); white-space: nowrap; }
.pkg-note.warn { color: var(--p1); font-weight: 600; }
.pkg-note.danger { color: var(--p0); font-weight: 600; }

.row-warn { background: #fffdf7; }
.row-danger { background: #fff8f8; }
/* 作废单/退单：保留可审计，但视觉上明确"不计入统计"，避免被当成欠费 */
/* 沟通时间轴（客户 360）：把 回访/面诊/工牌 三条通道合成一条连续视图 */
.comm-sources { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.comm-source { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.comm-list { display: flex; flex-direction: column; gap: 2px; }
.comm-item { padding: 10px 0; border-top: 1px solid var(--line); }
.comm-item:first-child { border-top: none; }
.comm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comm-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--ink); }
.comm-meta { font-size: 12.5px; color: var(--ink-3); }
.comm-text { margin-top: 6px; font-size: 13px; line-height: 1.75; color: var(--ink-2); white-space: pre-wrap; }
.comm-body { margin-top: 6px; }
.comm-body > summary { cursor: pointer; font-size: 12.5px; color: var(--accent); user-select: none; }
.comm-body > summary:hover { text-decoration: underline; }
.comm-body .conv { margin-top: 8px; }

.row-voided { background: #fafafa; color: var(--ink-4); }
.row-voided td { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.18); }
.row-voided td:nth-child(8) span.chip, .row-voided td:nth-child(2) { text-decoration: none; }

/* 线索 */
.clue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 9px; }
.clue-cell { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 9px; }
.clue-cell .cl { font-size: 10.5px; color: var(--ink-3); }
.clue-cell .cv { font-size: 12.5px; font-weight: 600; word-break: break-word; }
.clue-summary {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.7;
  background: var(--panel-2); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.intent-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.intent-chip { font-size: 11.5px; background: var(--accent-2-soft); color: var(--accent-2); border-radius: 999px; padding: 1px 9px; font-weight: 600; }

.timeline-mini { display: flex; flex-direction: column; gap: 0; margin-top: 9px; border-left: 2px solid var(--line); padding-left: 0; }
.tl-mini-item { position: relative; padding: 0 0 9px 13px; }
.tl-mini-item::before {
  content: ""; position: absolute; left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
}
.tl-mini-item:last-child { padding-bottom: 0; }
.tl-mini-at { font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.tl-mini-content { font-size: 12px; color: var(--ink-2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.tl-mini-src { font-size: 10.5px; color: var(--ink-4); }

/* 后续动作 */
.horizon-group + .horizon-group { margin-top: 10px; }
.horizon-title {
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.horizon-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.next-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 6px;
  background: #fff;
}
.next-item.p0 { border-left-color: var(--p0); }
.next-item.p1 { border-left-color: var(--p1); }
.next-item.p2 { border-left-color: var(--p2); }
.next-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
.next-action { font-size: 13px; font-weight: 600; line-height: 1.6; }
.next-why { font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.next-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--ink-4); margin-top: 4px; }
.next-evidence { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.ev { font-size: 10.5px; background: #f1f5f9; color: var(--ink-3); border-radius: 3px; padding: 1px 6px; }

/* --------------------------------------------------------- 漏斗 / 表格 */

.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 190px;
  gap: 11px; align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .14s, background .14s;
  text-align: left;
  width: 100%;
}
.funnel-row:hover { border-color: var(--accent); background: #f8fdfd; }
.funnel-row.active { border-color: var(--accent); background: var(--accent-soft); }
.funnel-stage { font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.funnel-stage .seq {
  width: 18px; height: 18px; border-radius: 5px; flex: none;
  background: var(--stage-color, var(--accent)); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.funnel-bar-wrap { min-width: 0; }
.funnel-bar {
  height: 22px; border-radius: 4px;
  background: var(--stage-color, var(--accent));
  min-width: 3px; display: flex; align-items: center;
  transition: width .3s ease;
}
.funnel-bar .fb-count { font-size: 11.5px; font-weight: 700; color: #fff; padding-left: 8px; font-variant-numeric: tabular-nums; }
.funnel-metrics { display: flex; gap: 12px; justify-content: flex-end; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.funnel-metrics .fm { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
.funnel-metrics .fm i { font-style: normal; font-size: 10px; color: var(--ink-4); }
.funnel-metrics .fm b { font-weight: 650; }

.stage-cust { margin-top: 12px; }
.stage-cust-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.stage-cust-head h3 { font-size: 13px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 660px; }
table.data th {
  font-size: 11px; color: var(--ink-3); font-weight: 600; text-align: left;
  padding: 7px 9px; background: var(--panel-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 7px 9px; border-bottom: 1px solid #f1f5f9; font-size: 12.5px; vertical-align: middle; }
table.data tbody tr:hover { background: #fbfcfd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .linkish { color: var(--accent); font-weight: 600; cursor: pointer; }
table.data .linkish:hover { text-decoration: underline; }

.conv-bar { display: flex; align-items: center; gap: 7px; min-width: 132px; }
.conv-track { flex: 1; height: 8px; background: #eef2f6; border-radius: 4px; overflow: hidden; min-width: 46px; }
.conv-fill { height: 100%; border-radius: 4px; background: var(--accent-2); }
.conv-fill.ok { background: var(--ok); }
.conv-val { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; font-weight: 600; }

.empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--ink-4);
  font-size: 12.5px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.empty strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 3px; }

/* -------------------------------------------------------- 客户360 历史 */

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent;
  padding: 7px 12px;
  font-size: 12.5px; color: var(--ink-3); font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab .cnt { font-size: 10.5px; color: var(--ink-4); margin-left: 3px; }

/* 录音对话 */
.conv { display: flex; flex-direction: column; gap: 10px; }
.conv-turn { display: flex; flex-direction: column; max-width: 82%; }
.conv-turn.role-customer { align-self: flex-start; }
.conv-turn.role-consultant { align-self: flex-end; align-items: flex-end; }
.conv-role { font-size: 10.5px; color: var(--ink-4); margin-bottom: 3px; padding: 0 4px; }
.conv-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px; line-height: 1.85;
  white-space: pre-wrap; word-break: break-word;
}
.role-customer .conv-bubble { background: #f1f5f9; color: var(--ink); border: 1px solid var(--line); border-top-left-radius: 3px; }
.role-consultant .conv-bubble { background: var(--accent); color: #fff; border-top-right-radius: 3px; }
.role-other .conv-bubble { background: #fff; border: 1px dashed var(--line-strong); color: var(--ink-3); font-size: 12px; }

/* 生命周期时间轴 */
.life-timeline { display: flex; flex-direction: column; gap: 0; padding-left: 4px; }
.lt-item { display: grid; grid-template-columns: 106px 22px minmax(0, 1fr); gap: 0; align-items: stretch; }
.lt-date { font-size: 11.5px; color: var(--ink-3); padding: 9px 8px 9px 0; text-align: right; font-variant-numeric: tabular-nums; }
.lt-rail { position: relative; display: flex; justify-content: center; }
.lt-rail::before { content: ""; width: 2px; background: var(--line); height: 100%; }
.lt-item:first-child .lt-rail::before { border-radius: 2px 2px 0 0; }
.lt-dot {
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
}
.lt-dot.milestone { background: var(--accent); width: 12px; height: 12px; top: 12px; }
.lt-dot.today { background: var(--p0); border-color: var(--p0); box-shadow: 0 0 0 4px rgba(220, 38, 38, .13); }
.lt-body { padding: 7px 0 11px 12px; min-width: 0; }
.lt-title { font-size: 12.5px; font-weight: 600; }
.lt-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; word-break: break-word; }

/* ---------------------------------------------------------- 资产/边界 */

.asset-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.asset-kpi {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; background: var(--panel-2);
}
.asset-kpi .al { font-size: 11px; color: var(--ink-3); }
.asset-kpi .av { font-size: 22px; font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.asset-kpi .as { font-size: 10.5px; color: var(--ink-4); }

.write-tools { display: flex; flex-direction: column; gap: 8px; }
.write-tool {
  border: 1px solid #f0d9a8; background: #fffcf3;
  border-left: 4px solid var(--p1);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.write-tool .wt-name { font-family: var(--mono); font-size: 12.5px; font-weight: 650; color: #92400e; }
.write-tool .wt-desc { font-size: 12px; color: var(--ink-2); line-height: 1.65; margin-top: 3px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cat-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.cat-head .cn { font-size: 12.5px; font-weight: 650; }
.cat-head .cc { font-size: 11px; color: var(--ink-3); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.cat-names { padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px; max-height: 168px; overflow-y: auto; }
.cat-name { font-size: 11px; background: #f1f5f9; color: var(--ink-2); border-radius: 3px; padding: 1px 6px; }
.cat-name.blank { background: #f8fafc; color: var(--ink-4); font-style: italic; }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.banner .bi { flex: none; font-weight: 700; font-size: 13px; }
.banner-warn { background: var(--p1-soft); border-color: #f2ddb4; color: #7c4a04; }
.banner-warn .bi { color: var(--p1); }
.banner-error { background: var(--p0-soft); border-color: #f6c9c5; color: #8f1d1d; }
.banner-error .bi { color: var(--p0); }
.banner-info { background: var(--accent-2-soft); border-color: #c9d9fb; color: #1e40af; }
.banner-info .bi { color: var(--accent-2); }
.banner code { font-family: var(--mono); font-size: 11.5px; background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 3px; }
.banner ul { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.banner ul li { padding-left: 13px; position: relative; }
.banner ul li::before { content: "·"; position: absolute; left: 4px; font-weight: 700; }

.note-block { display: flex; flex-direction: column; gap: 11px; }
.note-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel-2); }
.note-item h3 { font-size: 12.5px; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.note-item h3 .num {
  width: 17px; height: 17px; border-radius: 5px; background: var(--ink-2); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.note-item p { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.note-item code { font-family: var(--mono); font-size: 11.5px; background: #eef2f6; padding: 1px 5px; border-radius: 3px; }
.note-item ul { margin-top: 5px; display: flex; flex-direction: column; gap: 4px; }
.note-item ul li { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; padding-left: 14px; position: relative; }
.note-item ul li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* ---------------------------------------------------------- 加载/提示 */

.skeleton { display: flex; flex-direction: column; gap: 8px; }
.sk {
  height: 14px; border-radius: 5px;
  background: linear-gradient(90deg, #eef2f6 25%, #e3e8ef 37%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk.h28 { height: 28px; }
.sk.h56 { height: 56px; }
.sk.h90 { height: 90px; }
.sk.w40 { width: 40%; }
.sk.w60 { width: 60%; }
.sk.w80 { width: 80%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner.dark { border-color: rgba(13,125,132,.25); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff;
  padding: 9px 16px; border-radius: 999px;
  font-size: 12.5px; box-shadow: var(--shadow-lg);
  z-index: 999; max-width: 80vw;
}
.toast.err { background: #991b1b; }

.muted { color: var(--ink-4); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------- 执行闭环 / 企微推送 */

.action-bar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.action-note { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; max-width: 560px; padding-bottom: 5px; }
.action-note.busy { color: var(--accent-2); font-weight: 500; }
.action-note.ok { color: var(--ok); font-weight: 500; }
.action-note.err { color: var(--p0); font-weight: 500; }

/* ---- 任务台账 ---- */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
  transition: border-color .14s, box-shadow .14s;
}
.task-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.task-item.open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 125, 132, .08); }

.task-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 148px 104px 18px;
  gap: 10px; align-items: center;
  padding: 9px 11px; cursor: pointer;
}
.task-row:hover { background: #fbfcfd; }
.task-row:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(13, 125, 132, .25); }
.tk-prio { display: flex; justify-content: center; }
.tk-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tk-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-cust { font-size: 13.5px; font-weight: 650; }
.task-list .linkish { color: var(--accent); cursor: pointer; border-bottom: 1px dashed transparent; }
.task-list .linkish:hover { border-bottom-color: var(--accent); }
.tk-action { font-size: 12px; color: var(--ink-2); line-height: 1.6; word-break: break-word; }
.tk-owner { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tk-owner b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-owner i { font-style: normal; font-size: 10.5px; color: var(--ink-4); }
.tk-due { display: flex; flex-direction: column; line-height: 1.3; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tk-due i { font-style: normal; font-size: 10px; color: var(--ink-4); }
.tk-due em { font-style: normal; font-size: 10px; color: var(--ink-4); }
.tk-due.overdue { color: var(--p0); font-weight: 650; }
.tk-chev { color: var(--ink-4); font-size: 11px; text-align: center; transition: transform .18s; }
.task-item.open .tk-chev { transform: rotate(180deg); }

.task-detail { display: none; border-top: 1px dashed var(--line); background: var(--panel-2); }
.task-item.open .task-detail { display: block; }
.task-detail-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.tk-detail-sec > h4 {
  font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px;
  display: flex; align-items: center; gap: 7px;
}
.tk-why { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.tk-ev { display: flex; flex-wrap: wrap; gap: 4px; }
.tk-hint { font-size: 11.5px; line-height: 1.65; }

.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px; margin: 7px 0;
}
.kv-row {
  display: flex; gap: 8px; align-items: baseline;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 11.5px; min-width: 0;
}
.kv-k { flex: none; min-width: 54px; color: var(--ink-4); font-family: var(--mono); }
.kv-v { color: var(--ink); word-break: break-word; }

.vc-box {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: #fff; border-radius: var(--radius-sm);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 6px;
}
.vc-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.vc-at { font-size: 10.5px; color: var(--ink-4); margin-left: auto; }
.vc-detail { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.vc-kind { font-size: 10.5px; color: var(--ink-4); font-weight: 500; }

.tk-form {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.tk-field { display: flex; flex-direction: column; gap: 3px; min-width: 132px; }
.tk-field > span { font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.tk-grow { flex: 1 1 240px; }
.tk-form .input { height: 28px; }
.tk-form-err { font-size: 11.5px; color: var(--p0); margin-top: 5px; font-weight: 500; }

.tstat {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.tstat-pending { background: #eef2f6; color: var(--ink-2); }
.tstat-claimed { background: var(--p1-soft); color: #92400e; }
.tstat-verified { background: var(--ok-soft); color: var(--ok); }
.tstat-failed { background: var(--p0-soft); color: #991b1b; }

.attr-chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 650; border: 1px solid transparent; white-space: nowrap;
}
.attr-strong { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cd; }
.attr-weak { background: var(--p1-soft); color: #92400e; border-color: #f2ddb4; }

.kind-chip {
  font-size: 10.5px; background: #f1f5f9; color: var(--ink-3);
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.kind-manual { background: var(--doctor-soft); color: var(--doctor); }

.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #116632; border-color: #116632; }
.btn-danger { background: var(--p0); border-color: var(--p0); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-outline-danger { background: #fff; border-color: #f6c9c5; color: var(--p0); }
.btn-outline-danger:hover { background: var(--p0-soft); }
table.data td.num.tk-danger { color: var(--p0); font-weight: 650; }

/* 每日趋势（手绘 SVG） */
.trend-wrap { overflow-x: auto; padding-bottom: 4px; }
.trend-svg { display: block; }
.trend-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }

/* ---- 企微推送 ---- */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 10px; }
.fact { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 7px 9px; min-width: 0; }
.fact .fl { font-size: 10.5px; color: var(--ink-3); }
.fact .fv { font-size: 12.5px; font-weight: 650; word-break: break-all; }
.fact .fv.mono { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }

.push-base {
  display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 10px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
}
.push-base .action-note { flex: 1 1 260px; padding-bottom: 5px; }

.push-cfg-table { min-width: 900px; }
.pc-webhook { width: 100%; min-width: 280px; height: 28px; font-family: var(--mono); font-size: 11.5px; }
.pc-role { height: 28px; min-width: 112px; }
.push-cfg-note { margin-top: 10px; }

.push-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; background: #fff; }
.push-card + .push-card { margin-top: 10px; }
.push-card.not-configured { background: #fffdf7; border-color: #f0d9a8; }
.push-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.push-title { font-size: 13.5px; font-weight: 650; }
.push-chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.push-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.push-stats .ps { display: flex; flex-direction: column; line-height: 1.3; }
.push-stats .ps i { font-style: normal; font-size: 10px; color: var(--ink-4); }
.push-stats .ps b { font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 650; }

.push-msg { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fbfcfd; }
.push-msg + .push-msg { margin-top: 8px; }
.push-msg-head {
  display: flex; align-items: center; gap: 8px; padding: 5px 9px;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--ink-3);
}
.pm-title { font-weight: 650; color: var(--ink-2); }
.pm-bytes { font-variant-numeric: tabular-nums; }
.pm-toggle { margin-left: auto; height: 22px; padding: 0 8px; font-size: 11px; }

.wc { padding: 10px 12px; font-size: 12.5px; line-height: 1.75; color: var(--ink); background: #fff; overflow: hidden; position: relative; }
.wc.collapsed { max-height: 200px; }
.wc.collapsed::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
}
.wc-h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 6px; }
.wc-h4 { font-size: 12.5px; font-weight: 650; margin: 9px 0 4px; color: #0f2c30; }
.wc-p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.wc-quote {
  margin: 4px 0; padding: 4px 9px;
  border-left: 3px solid var(--accent); background: var(--accent-soft); color: #10484c;
  border-radius: 0 4px 4px 0; white-space: pre-wrap; word-break: break-word;
}
.wc-ul { margin: 4px 0; display: flex; flex-direction: column; gap: 3px; }
.wc-ul li { padding-left: 14px; position: relative; white-space: pre-wrap; word-break: break-word; }
.wc-ul li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); }
.wc-hr { border: 0; border-top: 1px dashed var(--line-strong); margin: 8px 0; }
.wc-warn { color: var(--p0); font-weight: 650; }
.wc-info { color: var(--accent); font-weight: 650; }
.wc-comment { color: var(--ink-4); font-size: 11.5px; }
.wc-link { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid #c9d9fb; }
.wc-link:hover { text-decoration: underline; }

.unrouted-group + .unrouted-group { margin-top: 9px; }
.unrouted-role { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.unrouted-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.unrouted-chip {
  display: inline-flex; flex-direction: column; gap: 1px;
  border: 1px solid #f2ddb4; background: var(--p1-soft); border-radius: var(--radius-sm);
  padding: 4px 9px; font-size: 12px; font-weight: 600; color: #7c4a04;
}
.unrouted-chip i { font-style: normal; font-size: 10.5px; font-weight: 500; color: #a16207; }

.send-guard { margin: 2px 0 8px; }
.send-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.send-actions .action-note { flex: 1 1 240px; padding-bottom: 0; }
.send-result { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; }
.send-result-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }

@media (max-width: 1400px) {
  .task-row { grid-template-columns: 42px minmax(0, 1fr) 118px 92px 18px; }
}

/* ------------------------------------------------------------ 响应式 */

@media (max-width: 1500px) {
  .kpi-strip, .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 1280px) {
  .app { grid-template-columns: 178px minmax(0, 1fr); }
  .main { padding: 0 14px 32px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi-strip, .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .script-grid { grid-template-columns: minmax(0, 1fr); }
  .funnel-row { grid-template-columns: 108px minmax(0, 1fr); }
  .funnel-metrics { grid-column: 1 / -1; justify-content: flex-start; }
  .profile-group { grid-template-columns: 76px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; }
  .brand { padding: 12px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-item { width: auto; white-space: nowrap; }
  .side-foot { display: none; }
  .kpi-strip, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-row { grid-template-columns: 52px minmax(0, 1fr) 20px; }
  .rr-flags { grid-column: 2 / -1; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .conv-turn { max-width: 94%; }
  .lt-item { grid-template-columns: 78px 18px minmax(0, 1fr); }
  .task-row { grid-template-columns: 40px minmax(0, 1fr) 18px; }
  .tk-owner, .tk-due { grid-column: 2 / 3; flex-direction: row; gap: 9px; align-items: baseline; }
  .push-base .action-note { flex: 1 1 100%; }
  .kv-grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .sidebar, .head-actions, .filters, .rr-chev { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .roster-detail { display: block !important; }
}
