/* shared-views.css — Styles des vues partagées (préfixe sv-) */

.sv-loading, .sv-empty { padding: 30px; text-align: center; color: #757575; font-size: 0.9em; }
.sv-empty-modern {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; color: #757575;
}
.sv-empty-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #fff0f7 0%, #f7f7f8 100%);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: #ff84c7;
}
.sv-empty-icon svg { width: 28px; height: 28px; }
.sv-empty-modern h4 {
  font-size: 0.98em; font-weight: 600; color: #191919;
  margin: 0 0 6px 0; letter-spacing: -0.01em;
}
.sv-empty-modern p {
  font-size: 0.84em; color: #757575; margin: 0;
  max-width: 320px; line-height: 1.5;
}
.sv-muted { color: #757575; }
.sv-sm { font-size: 0.82em; }

/* Stats */
.sv-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.sv-stat {
  background: #fff;
  border: 1px solid #ececef;
  border-radius: 14px;
  padding: 18px; text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.sv-stat:hover {
  border-color: #d5d5d5;
  box-shadow: 0 4px 12px rgba(25,25,25,0.05);
}
.sv-stat-val { font-size: 2em; font-weight: 700; color: #ff84c7; letter-spacing: -0.02em; }
.sv-stat-val-sm { font-size: 1.2em; }
.sv-stat-lbl { font-size: 0.72em; color: #757575; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; font-weight: 500; }
.sv-quota-bar { width: 100%; height: 6px; background: #efefef; border-radius: 3px; margin: 6px 0 4px; overflow: hidden; }
.sv-quota-bar > div { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* Dashboard grid */
.sv-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .sv-dashboard-grid { grid-template-columns: 1fr; } }

/* Summary grid (vue Dashboard résumé) */
.sv-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.sv-card-clickable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.sv-card-clickable:hover { transform: translateY(-2px); border-color: #ff84c7; box-shadow: 0 6px 18px rgba(255,132,199,0.18); }
.sv-summary-val { font-size: 2em; font-weight: 700; color: #191919; letter-spacing: -0.02em; line-height: 1.1; }
.sv-summary-q { font-size: 0.92em; font-weight: 600; color: #191919; margin-bottom: 4px; }
.sv-bars-mini { height: 40px; gap: 2px; padding-top: 0; }
.sv-bars-mini .sv-bar { max-width: 100%; }

.sv-card-wide { grid-column: 1 / -1; }
.sv-recent-conv {
  padding: 10px 12px; border: 1px solid #ececef; border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.sv-recent-conv:last-child { margin-bottom: 0; }
.sv-recent-conv:hover { border-color: #ff84c7; background: #fff8fc; }
.sv-recent-q { font-size: 0.9em; color: #191919; margin-bottom: 4px; }
@media (max-width: 768px) {
  .sv-msg { padding: 8px 12px; font-size: 0.86em; }
  .sv-msg-row { max-width: 92%; }
  .sv-msg-avatar { width: 24px; height: 24px; }
}

.sv-card {
  background: #fff; border: 1px solid #ececef; border-radius: 14px;
  padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.sv-card h4 { font-size: 0.92em; font-weight: 600; margin: 0 0 10px 0; color: #616161; }
.sv-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.sv-card-head h4 { margin: 0; font-size: 0.95em; font-weight: 600; }

/* Chart bars */
.sv-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.sv-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.sv-bar { width: 100%; max-width: 36px; background: #ff84c7; border-radius: 4px 4px 0 0; min-height: 2px; }
.sv-bar-val { font-size: 0.7em; font-weight: 600; color: #191919; }
.sv-bar-label { font-size: 0.65em; color: #757575; writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); max-height: 50px; overflow: hidden; }
.sv-bar-line { height: 8px; border-radius: 4px; background: #efefef; overflow: hidden; }
.sv-bar-line > div { height: 100%; border-radius: 4px; transition: width 0.3s; }
.sv-fb-val { font-size: 2em; font-weight: 700; }

/* Top questions */
.sv-tq-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #efefef; flex-wrap: wrap; }
.sv-tq-item:last-child { border-bottom: none; }
.sv-tq-count { background: #ff84c7; color: #fff; font-weight: 700; font-size: 0.78em; min-width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sv-tq-text { font-size: 0.9em; color: #191919; flex: 1; min-width: 150px; }
.sv-tq-row .sv-tq-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-left: auto; }

/* Custom answers */
.sv-ca-item {
  padding: 12px; border: 1px solid #efefef; border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.sv-ca-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sv-ca-q { font-size: 0.88em; min-width: 0; flex: 1; }
.sv-ca-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-left: auto; flex-wrap: wrap; }
.sv-ca-answer { font-size: 0.82em; color: #757575; margin: 6px 0 0 0; white-space: pre-wrap; max-height: 80px; overflow: hidden; }
.sv-trigs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sv-trig { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7em; padding: 2px 6px; border-radius: 4px; }

/* Boutons */
.sv-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid #d5d5d5;
  background: #fff; color: #191919; border-radius: 100px;
  font-family: inherit; font-size: 0.82em; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sv-btn:hover { background: #f7f7f8; }
.sv-btn-primary { background: #ff84c7; color: #fff; border-color: #ff84c7; }
.sv-btn-primary:hover { background: #e76eb1; border-color: #e76eb1; }
.sv-btn-secondary { background: #fff; color: #191919; border-color: #191919; }
.sv-btn-secondary:hover { background: #191919; color: #fff; }
.sv-btn-danger { background: #c62828; color: #fff; border-color: #c62828; }
.sv-btn-ghost { background: transparent; color: #616161; border-color: #d5d5d5; }
.sv-btn-sm { padding: 3px 10px; font-size: 0.72em; }
.sv-btn-sq { padding: 3px 8px; }

/* Conversations */
.sv-conv-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.sv-conv-header h3 { font-size: 1.05em; font-weight: 700; letter-spacing: -0.01em; }
.sv-conv-toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.sv-conv-toolbar .sv-date-filters { margin-bottom: 0; }
.sv-conv-search {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 200px;
  background: #f4f4f5;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  color: #757575;
  transition: background 0.15s, border-color 0.15s;
}
.sv-conv-search:focus-within {
  background: #fff;
  border-color: #d5d5d5;
}
.sv-conv-search input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 0.86em;
  color: #191919;
}
.sv-conv-search input::placeholder { color: #9494a0; }
.sv-date-filters { display: inline-flex; gap: 2px; background: #f4f4f5; border-radius: 999px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.sv-date-btn { padding: 6px 14px; font-size: 0.78em; border: none; background: transparent; border-radius: 999px; cursor: pointer; color: #616161; font-family: inherit; transition: color 0.15s, background 0.15s; }
.sv-date-btn:hover { color: #191919; }
.sv-date-btn.active { background: #fff; color: #191919; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 0.5px rgba(0,0,0,0.04); }
.sv-conv-list { display: flex; flex-direction: column; gap: 6px; }
.sv-conv-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #ececef;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.sv-conv-item:hover {
  border-color: #d5d5d5;
  box-shadow: 0 4px 12px rgba(25,25,25,0.06);
  transform: translateY(-1px);
}
.sv-conv-item::before {
  content: '';
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: #fff0f7;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff84c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  transition: background-color 0.15s;
}
.sv-conv-item:hover::before { background-color: #ffe4f1; }
.sv-conv-item-deleted { background: #fafafa; opacity: 0.75; }
.sv-conv-item-deleted:hover { box-shadow: 0 2px 6px rgba(25,25,25,0.04); transform: none; }
.sv-conv-item-deleted::before {
  background-color: #f0f0f0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 5 6 21 6'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6M14 11v6'/></svg>");
}
.sv-conv-item-deleted:hover::before { background-color: #f0f0f0; }
.sv-conv-item-deleted .sv-conv-preview { color: #888; font-weight: 500; }
.sv-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sv-conv-preview { font-weight: 600; font-size: 0.92em; color: #191919; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.005em; }

/* Snippets & API key */
.sv-section { margin-bottom: 28px; }
.sv-section > h3 { font-size: 1.05em; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #efefef; }
.sv-api-key-box {
  display: flex; align-items: center; gap: 10px;
  background: #f7f7f8; border: 2px solid #d5d5d5; border-radius: 10px;
  padding: 12px 14px; font-family: 'SF Mono', Monaco, monospace; font-size: 0.82em; word-break: break-all;
}
.sv-api-key-box > span { flex: 1; min-width: 0; }
.sv-snippet {
  background: #191919; color: #e0e0e0; padding: 18px 20px; border-radius: 10px;
  font-family: 'SF Mono', Monaco, monospace; font-size: 0.78em; overflow-x: auto;
  line-height: 1.7; position: relative; white-space: pre;
}
.sv-snippet .sv-tag { color: #ff84c7; }
.sv-snippet .sv-attr { color: #7ec8e3; }
.sv-snippet .sv-val { color: #ffd700; }
.sv-copy-snippet {
  position: absolute; top: 10px; right: 10px;
  background: #616161; color: #fff; border: none; border-radius: 6px;
  padding: 3px 10px; font-size: 0.85em; cursor: pointer;
}
.sv-copy-snippet:hover { background: #ff84c7; }

/* Modal */
.sv-modal-overlay {
  position: fixed; inset: 0; background: rgba(25,25,25,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 1500; opacity: 0; transition: opacity 0.2s;
}
.sv-modal-overlay.sv-open { opacity: 1; }
.sv-modal {
  background: #fff; border: 2px solid #191919; border-radius: 20px;
  box-shadow: 6px 6px 0 #191919;
  padding: 28px; width: 100%; max-width: 560px; max-height: 80vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sv-modal-tall { max-width: 620px; }
.sv-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sv-modal-head h2 { font-size: 1.1em; font-weight: 700; }

.sv-dismissed-list { display: flex; flex-direction: column; gap: 8px; }
.sv-dismissed-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f7f7f8; border-radius: 10px; flex-wrap: wrap; }
.sv-dismissed-q { flex: 1; min-width: 200px; font-size: 0.88em; }

.sv-conv-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-height: 60vh; padding: 4px 2px; }
.sv-msg {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 0;
  padding: 7px 12px;
  border-radius: 16px;
  font-size: 0.9em;
  line-height: 1.4;
  max-width: 100%;
  width: fit-content;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  letter-spacing: -0.005em;
}
.sv-msg-text { white-space: pre-wrap; min-width: 0; }
.sv-msg-user {
  background: linear-gradient(135deg, #ffe4f1 0%, #fff0f7 100%);
  color: #191919;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 1px 2px rgba(255,132,199,0.15);
}
.sv-msg-assistant {
  background: #fff;
  color: #191919;
  align-self: flex-start;
  border: 1px solid #ececef;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.sv-msg-time { font-size: 0.62em; opacity: 0.55; font-weight: 500; flex: 0 0 100%; white-space: nowrap; margin-top: 1px; }
.sv-msg-user .sv-msg-time { text-align: right; }
.sv-msg-assistant .sv-msg-time { text-align: left; }

/* Conv rows : avatar + bubble. width: fit-content pour que la row se dimensionne sur son contenu. */
.sv-msg-row { display: flex; gap: 8px; align-items: flex-end; width: fit-content; max-width: 85%; min-width: 0; }
.sv-msg-row-user { flex-direction: row-reverse; align-self: flex-end; }
.sv-msg-row-assistant { align-self: flex-start; }
.sv-msg-row .sv-msg { max-width: 100%; flex: 0 1 auto; min-width: 0; }

.sv-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72em; font-weight: 700;
  flex-shrink: 0;
}
.sv-msg-avatar-user {
  background: linear-gradient(135deg, #ffe4f1 0%, #fff0f7 100%);
  color: #ff84c7;
}
.sv-msg-avatar-assistant {
  background: #f7f7f8;
  color: #616161;
  border: 1px solid #ececef;
}

/* "Voir la réflexion de l'IA" — admin uniquement, regroupe les appels d'outils sous le message bot */
.sv-reflect-wrap { align-self: flex-start; max-width: 85%; margin: -2px 0 6px 36px; }
.sv-reflect-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f6f5fb; color: #6b5fa8;
  border: 1px dashed #d4cdee; border-radius: 14px;
  padding: 4px 10px; font-size: 0.72em; font-weight: 600;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.sv-reflect-toggle:hover { background: #ece8f7; border-color: #b8acdf; }
.sv-reflect-ico { opacity: 0.7; }
.sv-reflect-count { color: #8a82b3; font-weight: 500; }
.sv-reflect-chev { transition: transform 0.18s; opacity: 0.6; }
.sv-reflect-wrap.is-open .sv-reflect-chev { transform: rotate(180deg); }
.sv-reflect-panel {
  margin-top: 6px; background: #fafaff; border: 1px solid #ece8f7; border-radius: 10px;
  padding: 10px 12px; font-size: 0.78em; color: #2d2d3a;
}
.sv-reflect-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-reflect-item { padding: 8px 10px; background: #fff; border: 1px solid #ece8f7; border-radius: 8px; }
.sv-reflect-head { font-weight: 600; margin-bottom: 6px; }
.sv-reflect-name { color: #5b4ea0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.94em; }
.sv-reflect-row { display: flex; gap: 8px; margin: 4px 0; align-items: flex-start; }
.sv-reflect-lbl { flex: 0 0 60px; font-weight: 600; color: #6b6b80; font-size: 0.92em; }
.sv-reflect-val { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.sv-reflect-kv { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.sv-reflect-k { color: #8a82b3; }
.sv-reflect-v { color: #2d2d3a; }
.sv-reflect-muted { color: #9b9bb0; font-style: italic; font-size: 0.92em; }
.sv-reflect-raw {
  margin: 0; padding: 6px 8px; background: #f4f4f8; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
  color: #3a3a4a;
}

/* Day separators */
.sv-day-sep { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; align-self: stretch; }
.sv-day-sep::before, .sv-day-sep::after { content: ''; flex: 1; height: 1px; background: #ececef; }
.sv-day-sep span {
  font-size: 0.72em; font-weight: 600; color: #757575;
  text-transform: capitalize; letter-spacing: 0.02em;
}

/* Skeleton */
@keyframes sv-sk-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.sv-conv-skeleton { display: flex; flex-direction: column; gap: 12px; padding: 8px 4px; }
.sv-sk {
  height: 38px; border-radius: 18px;
  background: linear-gradient(90deg, #f4f4f5 0%, #ececef 50%, #f4f4f5 100%);
  background-size: 800px 100%;
  animation: sv-sk-shimmer 1.4s linear infinite;
}
.sv-sk-user { align-self: flex-end; width: 60%; }
.sv-sk-assistant { align-self: flex-start; width: 70%; }

.sv-sk-list-item {
  height: 64px; border-radius: 14px;
  background: linear-gradient(90deg, #f4f4f5 0%, #ececef 50%, #f4f4f5 100%);
  background-size: 800px 100%;
  animation: sv-sk-shimmer 1.4s linear infinite;
}
.sv-sk-list { display: flex; flex-direction: column; gap: 6px; }

/* ============ STATS SHELL (sous-onglets, période, insights) ============ */
.stats-shell { display: flex; flex-direction: column; gap: 16px; }
.stats-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.stats-period { display: flex; align-items: center; gap: 12px; }
.stats-period-lbl {
  font-size: 0.72em; color: #757575;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.stats-period-group {
  display: inline-flex; background: #f4f4f5;
  border-radius: 10px; padding: 3px;
}
.stats-period-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 7px 14px; font-size: 0.85em; font-weight: 500;
  color: #616161; border-radius: 7px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.stats-period-btn:hover { color: #191919; }
.stats-period-btn.active {
  background: #fff; color: #191919; font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stats-actions { display: flex; gap: 8px; }

/* Insights bandeau */
.stats-insights { display: flex; flex-direction: column; gap: 8px; }
.stats-insight {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px; font-size: 0.9em;
  border: 1px solid; line-height: 1.5;
}
.stats-insight-icon { font-size: 1.2em; flex-shrink: 0; }
.stats-insight-text { flex: 1; color: #191919; }
.stats-insight-text strong { font-weight: 700; }
.stats-insight-text a { color: inherit; text-decoration: underline; font-weight: 600; }
.stats-insight-good { background: #f0fdf4; border-color: #bbf7d0; }
.stats-insight-good .stats-insight-text { color: #14532d; }
.stats-insight-warn { background: #fff7ed; border-color: #fed7aa; }
.stats-insight-warn .stats-insight-text { color: #7c2d12; }
.stats-insight-info { background: #eff6ff; border-color: #bfdbfe; }
.stats-insight-info .stats-insight-text { color: #1e3a8a; }

/* Sous-onglets */
.stats-subtabs {
  display: flex; gap: 2px; border-bottom: 1px solid #ececef;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.stats-subtab {
  border: none; background: transparent; cursor: pointer;
  padding: 12px 18px; font-size: 0.92em; font-weight: 500; color: #757575;
  position: relative; white-space: nowrap;
  transition: color 0.15s;
}
.stats-subtab:hover { color: #191919; }
.stats-subtab.active { color: #191919; font-weight: 600; }
.stats-subtab.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: #ff84c7; border-radius: 2px 2px 0 0;
}

/* KPI grid avec deltas */
.stats-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-top: 16px;
}
.stats-kpi {
  background: #fff; border: 1px solid #ececef; border-radius: 14px;
  padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.stats-kpi-lbl {
  font-size: 0.72em; color: #757575;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
  margin-bottom: 8px;
}
.stats-kpi-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stats-kpi-val {
  font-size: 1.8em; font-weight: 700;
  color: #191919; letter-spacing: -0.02em; line-height: 1;
}
.stats-delta {
  font-size: 0.75em; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  white-space: nowrap;
}
.stats-delta-up { background: #dcfce7; color: #14532d; }
.stats-delta-down { background: #fee2e2; color: #7f1d1d; }
.stats-delta-flat { background: #f4f4f5; color: #616161; }

/* Funnel */
.stats-funnel { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.stats-funnel-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 12px; align-items: center;
}
.stats-funnel-lbl { font-size: 0.85em; color: #616161; font-weight: 500; }
.stats-funnel-bar {
  height: 32px; background: #f4f4f5; border-radius: 8px; overflow: hidden;
  position: relative;
}
.stats-funnel-bar > div {
  height: 100%; border-radius: 8px;
  transition: width 0.4s ease; min-width: 40px;
  display: flex; align-items: center; padding: 0 12px;
}
.stats-funnel-bar > div > span {
  color: #fff; font-weight: 700; font-size: 0.9em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15); font-variant-numeric: tabular-nums;
}
.stats-funnel-note {
  margin-top: 12px; font-size: 0.85em; color: #616161;
  padding-top: 12px; border-top: 1px solid #f4f4f5;
}
@media (max-width: 600px) {
  .stats-funnel-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Device split */
.stats-device { display: flex; flex-direction: column; gap: 10px; }
.stats-device-row {
  display: grid; grid-template-columns: 140px 1fr 120px;
  align-items: center; gap: 12px;
}
.stats-device-lbl { font-size: 0.88em; font-weight: 500; }
.stats-device-bar {
  height: 8px; background: #f4f4f5; border-radius: 4px; overflow: hidden;
}
.stats-device-bar > div { height: 100%; border-radius: 4px; transition: width 0.3s; }
.stats-device-val { font-size: 0.88em; text-align: right; }
@media (max-width: 600px) {
  .stats-device-row { grid-template-columns: 100px 1fr 90px; }
}

/* Line chart */
.stats-linechart { width: 100%; height: auto; max-height: 240px; }

/* ============ Doc Elementor (Integration) ============ */
.sv-elementor {
  background: linear-gradient(135deg, #fff 0%, #fdf4ff 100%);
  border: 1px solid #e9d5ff;
}
.sv-elementor-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.sv-elementor-head h3 { margin: 0; }
.sv-tag-info {
  font-size: 0.7em; font-weight: 600;
  background: #ede9fe; color: #6b21a8;
  padding: 3px 9px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.sv-steps {
  margin: 14px 0; padding-left: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.sv-steps > li { font-size: 0.92em; line-height: 1.6; }
.sv-steps ul { margin: 6px 0 0 0; padding-left: 18px; }
.sv-steps ul li { font-size: 0.9em; line-height: 1.7; }
.sv-steps code {
  background: #f4f4f5; padding: 2px 7px; border-radius: 5px;
  font-size: 0.85em; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  color: #6b21a8;
}
.sv-snippet-mini {
  display: inline-flex; align-items: center; gap: 8px;
  background: #faf5ff; border: 1px solid #e9d5ff;
  border-radius: 8px; padding: 6px 10px;
  margin-top: 4px; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.82em; color: #581c87;
  position: relative;
}
.sv-snippet-mini code {
  background: transparent; padding: 0; color: inherit;
  font-size: inherit; word-break: break-all;
}
.sv-snippet-mini .sv-copy-snippet {
  background: #fff; border: 1px solid #e9d5ff;
  border-radius: 5px; padding: 3px 8px;
  font-size: 0.82em; cursor: pointer;
  color: #6b21a8; font-weight: 500;
  transition: background 0.12s, border-color 0.12s;
  flex-shrink: 0; margin-left: auto;
  position: static; top: auto; right: auto;
}
.sv-snippet-mini .sv-copy-snippet:hover {
  background: #ede9fe; border-color: #c4b5fd;
}
.sv-elementor-test {
  margin-top: 14px; padding: 12px 14px;
  background: #ecfdf5; border: 1px solid #a7f3d0;
  border-radius: 10px; font-size: 0.9em; color: #065f46;
  line-height: 1.6;
}
.sv-elementor-test em { font-style: normal; font-weight: 600; }
