/* 管理后台专用：趋势图与表格补充样式 */
.tchart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 118px;
  padding: 6px 0 0;
}
.tbar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tfill {
  width: 72%;
  max-width: 26px;
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #6e8fff, #2b5cff);
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.tfill.zero { background: #eef1f7; }
.tlabels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  border-top: 1px solid #f1f4f9;
  padding-top: 6px;
}
.tlabels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  background: var(--brand);
}
.legend i.gray { background: #cbd5e1; }

.score-cell { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.score-cell .star { color: #f59e0b; font-size: 12px; }
.score-cell .na { color: #b6c0cf; font-size: 12px; }

.tag-mini {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-2);
  white-space: nowrap;
}

.drawer-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 40px 0; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.pager button { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text-2); font-size: 12.5px; }
.pager button:disabled { opacity: 0.45; cursor: not-allowed; }

/* FAQ 表单 */
.faq-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.faq-form .field { display: flex; flex-direction: column; gap: 5px; }
.faq-form .span2 { grid-column: span 2; }
.faq-form label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.faq-form input,
.faq-form textarea,
.faq-form select {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
.faq-form textarea { resize: vertical; line-height: 1.6; }
.faq-form input:focus,
.faq-form textarea:focus,
.faq-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 92, 255, 0.1);
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 12.5px;
  padding: 0 4px;
}
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

/* 知识缺口 */
.gap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid #f1f4f9;
}
.gap-row:last-child { border-bottom: none; }
.gap-q { flex: 1; font-size: 13px; color: var(--text); word-break: break-word; }
.gap-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.gap-badge {
  min-width: 34px;
  text-align: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gap-badge.low { background: var(--panel-soft); color: var(--muted); }

@media (max-width: 860px) {
  .tlabels span { font-size: 0; }
  .tlabels span:nth-child(odd) { font-size: 9px; }
  .faq-form { grid-template-columns: 1fr; }
  .faq-form .span2 { grid-column: span 1; }
}

/* 工单队列 */
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }

.qrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #f1f4f9;
}
.qrow:last-child { border-bottom: none; }
.qrow.overdue { background: #fff8f7; }
.qid { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; width: 46px; flex: 0 0 auto; }
.qmain { flex: 1; min-width: 0; }
.qmain .line1 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.qmain .who { font-size: 13px; font-weight: 550; color: var(--text); }
.qmain .last { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qwait { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }
.qwait.warn { color: var(--warn); font-weight: 600; }
.qwait.danger { color: var(--danger); font-weight: 600; }
.qactions { display: flex; gap: 6px; flex: 0 0 auto; }
.qempty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

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

/* 会话摘要 */
.dmsg.summary-block { margin-bottom: 16px; }
.dmsg.summary-block .text {
  background: #f4f7ff;
  border: 1px solid rgba(43, 92, 255, 0.18);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}

/* =============================================================================
   阶段5 · 数据分析看板（纯追加样式，不复用/覆盖原有类）
   ============================================================================= */
.cs-dashboard { margin-top: 16px; }
.cs-hidden { display: none !important; }

.cs-chart { min-height: 220px; }
.cs-chart-empty {
  padding: 30px 0;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}
.cs-svg { width: 100%; height: auto; display: block; }
.cs-axis { font-size: 10px; fill: #94a3b8; }

.cs-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
}
.cs-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.cs-legend-range { margin-left: auto; color: #94a3b8; font-size: 11.5px; }

.cs-foot { margin-top: 10px; color: #64748b; font-size: 12px; line-height: 1.6; }

/* 环形图 */
.cs-pie-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cs-pie-canvas { width: 200px; flex: 0 0 auto; }
.cs-donut { max-width: 200px; }
.cs-donut-num { font-size: 26px; font-weight: 700; fill: #0f172a; }
.cs-donut-label { font-size: 11px; fill: #94a3b8; }
.cs-pie-side { flex: 1 1 180px; min-width: 160px; }
.cs-pie-legend { list-style: none; margin: 0 0 4px; padding: 0; }
.cs-pie-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 4px 0;
  color: #334155;
}
.cs-pie-legend i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.cs-pie-legend .name { flex: 1; }
.cs-pie-legend .num { color: #0f172a; font-weight: 600; }
.cs-pie-legend .pct { color: #94a3b8; width: 46px; text-align: right; }

/* 坐席绩效表 */
.cs-table-wrap { overflow-x: auto; }
.cs-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cs-table th {
  text-align: left;
  color: #94a3b8;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f6;
  white-space: nowrap;
}
.cs-table td { padding: 10px; border-bottom: 1px solid #f5f7fb; color: #334155; vertical-align: middle; }
.cs-table tr:last-child td { border-bottom: none; }
.cs-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-agent-name { font-weight: 600; color: #0f172a; }
.cs-rate { display: inline-flex; align-items: center; gap: 8px; }
.cs-rate-track {
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: #eef1f6;
  overflow: hidden;
  display: inline-block;
}
.cs-rate-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2b5cff, #7aa0ff);
  border-radius: 3px;
}
.cs-rate-num { font-size: 11.5px; color: #64748b; font-variant-numeric: tabular-nums; }

/* 知识缺口 Top */
.cs-gap-list { display: flex; flex-direction: column; gap: 2px; }
.cs-gap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid #f5f7fb;
}
.cs-gap-row:last-child { border-bottom: none; }
.cs-gap-rank { width: 18px; color: #cbd5e1; font-size: 12px; }
.cs-gap-badge {
  background: #fff7ed;
  color: #b45309;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  white-space: nowrap;
}
.cs-gap-q {
  flex: 1;
  color: #0f172a;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-gap-meta { color: #94a3b8; font-size: 11.5px; white-space: nowrap; }
.cs-link { color: #2b5cff; text-decoration: none; font-size: 12px; }
.cs-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .cs-pie-wrap { flex-direction: column; align-items: flex-start; }
  .cs-gap-meta { display: none; }
}
