/* 统一坐席台 — Chatwoot 核心域迁入创作优选 */
.cs-desk-layout {
  display: grid;
  grid-template-columns: 220px 320px 1fr;
  gap: 12px;
  min-height: 68vh;
  align-items: stretch;
}
.cs-desk-thread-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: 68vh;
}
.cs-desk-thread-wrap.has-sidebar {
  grid-template-columns: 1fr 260px;
}
.cs-desk-customer-sidebar {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  font-size: 13px;
}
.cs-desk-customer-sidebar h4 { margin: 0 0 8px; font-size: 14px; }
.cs-desk-customer-sidebar .meta { margin: 4px 0; }
.cs-desk-customer-dup { padding: 6px; background: #fef3c7; border-radius: 6px; margin-top: 8px; font-size: 12px; }
.cs-desk-sidebar,
.cs-desk-list,
.cs-desk-thread {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
}
.cs-desk-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
  font-size: 14px;
}
.cs-desk-stat:hover,
.cs-desk-stat.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.cs-desk-stat strong { color: #1d4ed8; }
.cs-desk-conv {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 8px;
  cursor: pointer;
}
.cs-desk-conv:hover,
.cs-desk-conv.active {
  border-color: #3b82f6;
  background: #f8fafc;
}
.cs-desk-conv-title { font-weight: 600; font-size: 14px; }
.cs-desk-conv-meta { font-size: 12px; color: #64748b; margin-top: 4px; }
.cs-desk-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  margin-right: 4px;
}
.cs-desk-messages {
  max-height: 42vh;
  overflow: auto;
  padding: 8px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 12px;
}
.cs-desk-msg {
  margin-bottom: 10px;
  max-width: 85%;
}
.cs-desk-msg.user { margin-right: auto; }
.cs-desk-msg.assistant,
.cs-desk-msg.agent { margin-left: auto; text-align: right; }
.cs-desk-msg.private {
  margin: 8px auto;
  max-width: 95%;
  text-align: center;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: 8px;
  padding: 6px 10px;
}
.cs-desk-msg-bubble {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.cs-desk-msg.agent .cs-desk-msg-bubble { background: #dbeafe; border-color: #93c5fd; }
.cs-desk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}
.cs-desk-toolbar select,
.cs-desk-toolbar input { min-width: 120px; }
@media (max-width: 1100px) {
  .cs-desk-layout { grid-template-columns: 1fr; }
}
.cs-desk-msg-bubble img.cs-desk-media-img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  display: block;
  margin-bottom: 6px;
}
.cs-desk-media-audio,
.cs-desk-media-video {
  max-width: 100%;
  margin-bottom: 6px;
}
.cs-desk-advice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  font-size: 14px;
}
.cs-desk-sla-breach {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
}
.cs-desk-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.cs-desk-set-tab.active {
  background: #dbeafe;
  border-color: #3b82f6;
}
.cs-desk-set-panel label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}
.cs-desk-set-panel input[type="text"],
.cs-desk-set-panel input[type="number"],
.cs-desk-set-panel textarea,
.cs-desk-set-panel select {
  width: 100%;
  margin-top: 4px;
}
.cs-desk-reports h4 { margin: 16px 0 8px; font-size: 14px; }
.cs-desk-reports-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cs-desk-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.cs-desk-kpi { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; text-align: center; font-size: 12px; }
.cs-desk-kpi strong { display: block; font-size: 18px; color: #1d4ed8; margin-top: 4px; }
.cs-desk-chart { display: flex; align-items: flex-end; gap: 6px; min-height: 100px; padding: 8px 0; overflow-x: auto; }
.cs-desk-chart-bar { flex: 1; min-width: 28px; text-align: center; }
.cs-desk-chart-bars { display: flex; gap: 2px; align-items: flex-end; justify-content: center; height: 80px; }
.cs-desk-chart-created { width: 10px; background: #3b82f6; border-radius: 2px 2px 0 0; min-height: 2px; }
.cs-desk-chart-resolved { width: 10px; background: #22c55e; border-radius: 2px 2px 0 0; min-height: 2px; }
.cs-desk-chart-label { font-size: 10px; color: #64748b; }
.cs-desk-csat-row, .cs-desk-agent-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.cs-desk-csat-bar, .cs-desk-agent-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.cs-desk-csat-bar i, .cs-desk-agent-bar i { display: block; height: 100%; background: #f59e0b; border-radius: 4px; }
.cs-desk-agent-bar i { background: #3b82f6; }
.cs-desk-agent-head { flex: 1; min-width: 0; }
.cs-desk-agent-chart .cs-desk-agent-row { flex-direction: column; align-items: stretch; }
.cs-desk-auto-fieldset { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; margin: 10px 0; }
.cs-desk-auto-fieldset legend { font-size: 13px; padding: 0 6px; }
.cs-desk-auto-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.cs-desk-auto-row select, .cs-desk-auto-row input { flex: 1; min-width: 100px; font-size: 13px; }
.cs-desk-auto-item { margin-bottom: 6px; }
.cs-desk-copilot { margin: 8px 0; padding: 10px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; }
.cs-desk-copilot-chip { display: block; width: 100%; text-align: left; margin-top: 6px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.cs-desk-copilot-chip:hover { border-color: #3b82f6; background: #eff6ff; }
