/* =============================================
   ShopBot — Composants
   ============================================= */

/* ---- KPI Card ---- */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
  animation: fadeUp 0.4s both;
}
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
.kpi-card:hover { border-color: var(--border2); }

.kpi-label {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.kpi-value {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}
.kpi-delta {
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  gap: 4px;
}
.delta-up   { color: var(--green); }
.delta-down { color: var(--accent3); }

.kpi-sparkline {
  margin-top: 12px;
  height: 28px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.spark-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.kpi-card:hover .spark-bar { opacity: 0.9; }

/* ---- Module card ---- */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.module-card:hover  { border-color: var(--border2); transform: translateY(-2px); }
.module-card.active { border-color: rgba(108,92,231,0.4); background: rgba(108,92,231,0.06); }
.module-icon  { font-size: 20px; margin-bottom: 10px; display: block; }
.module-name  { font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.module-stat  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text3); }

/* ---- Bar chart ---- */
.chart-container { height: 140px; display: flex; align-items: flex-end; gap: 6px; padding: 0 4px; }
.chart-col   { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: opacity 0.2s;
  cursor: pointer;
}
.chart-bar:hover { opacity: 0.8; }
.chart-label { font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; }

/* ---- Conversation list ---- */
.conv-list { display: flex; flex-direction: column; gap: 1px; }
.conv-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  margin: 0 -20px;
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--surface2); }

.conv-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  font-weight: 600; color: var(--text2);
}
.conv-info    { flex: 1; min-width: 0; }
.conv-name    { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.conv-preview { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta    { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conv-time    { font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace; }

/* ---- Leads table ---- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.08em;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 10px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.table td:first-child { color: var(--text); font-weight: 500; }
.table tr:last-child td { border-bottom: none; }
.score { display: inline-flex; align-items: center; gap: 3px; font-family: 'DM Mono', monospace; font-size: 11px; }
.score-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ---- Chat preview ---- */
.chat-preview {
  background: var(--surface2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.chat-header {
  background: var(--accent);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.chat-avatar-bot {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.chat-bot-name   { font-size: 13px; font-weight: 600; color: white; }
.chat-bot-status { font-size: 11px; color: rgba(255,255,255,0.7); }
.chat-messages   { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.msg-bot  { background: var(--surface3); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input-bar {
  display: flex; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.chat-input {
  flex: 1;
  background: var(--surface3);
  border: none; border-radius: 20px;
  padding: 7px 14px;
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
}
.chat-send {
  width: 30px; height: 30px;
  background: var(--accent);
  border: none; border-radius: 50%;
  color: white; font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
