/**
 * ZenAgent — Module ZenLists CSS
 * Reprend les variables et classes natives de app.zenbaia.com/zenlists/
 * Les variables --zl-* sont injectées par zenlists-theme.js (chargé depuis zenbaia.com)
 * Fallback sur les variables ZenAgent --zen-* si zenlists-theme.js n'est pas encore chargé.
 */

/* ─── Fallback variables — preset zensuite de ZenListsTheme ─────────────────
   Reproduit exactement les valeurs du preset 'zensuite' dans zenlists-theme.js.
   Écrasées par ZenListsTheme.apply('zensuite') dès que le script est chargé. */
#za-zl-home, #za-zl-detail {
  --zl-primary:       #6366f1;
  --zl-primary-alt:   #6366f1;
  --zl-primary-fg:    #fdfdfd;
  --zl-primary-soft:  rgba(99,102,241,.10);
  --zl-primary-softer:rgba(99,102,241,.06);
  --zl-primary-line:  rgba(99,102,241,.22);
  --zl-primary-hover: color-mix(in oklab, #6366f1 88%, black);
  --zl-header-bg:     #030617;
  --zl-header-fg:     #f7f8fc;
  --zl-action-bg:     #6366f1;
  --zl-action-fg:     #fdfdfd;
  --zl-topbar-bg:     #030617;
  --zl-ink:           #030617;
  --zl-ink-fg:        #f7f8fc;
  --zl-bg:            #ffffff;
  --zl-surface:       #ffffff;
  --zl-surface-2:     #f8fafc;
  --zl-surface-3:     #f1f5f9;
  --zl-fg:            #091123;
  --zl-fg-muted:      #5b6375;
  --zl-fg-subtle:     color-mix(in oklab, #5b6375 70%, transparent);
  --zl-border:        #e1e5eb;
  --zl-border-strong: color-mix(in oklab, #e1e5eb 70%, black);
  --zl-success:       #218041;
  --zl-success-soft:  rgba(33,128,65,.10);
  --zl-success-line:  rgba(33,128,65,.25);
  --zl-warning:       #e99b2a;
  --zl-warning-soft:  rgba(233,155,42,.10);
  --zl-danger:        #ee0f1f;
  --zl-danger-soft:   rgba(238,15,31,.10);
  --zl-info:          #6366f1;
  --zl-info-soft:     rgba(99,102,241,.10);
  --zl-info-line:     rgba(99,102,241,.25);
  --zl-font-sans:     'Inter', ui-sans-serif, system-ui, sans-serif;
  --zl-font-display:  'DM Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --zl-radius:        12px;
  --zl-shadow-card:   0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* ─── Layout panneau ─────────────────────────────────────────────────────────── */
#za-zl-home, #za-zl-detail {
  font-family: var(--zl-font-sans);
  background: var(--zl-bg);
}
#za-zl-home-content {
  padding: 20px 24px;
}
#za-zl-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#za-zl-container > * {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ─── Header home avec barre de filtres ──────────────────────────────────────── */
.za-zl-home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.za-zl-home-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--zl-fg);
  margin: 0;
}
.za-zl-home-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Grille des listes (reprend .wl-lists-grid) ────────────────────────────── */
.wl-lists-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}
@media (max-width: 900px) { .wl-lists-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .wl-lists-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Cards (reprend .wl-list-card) ─────────────────────────────────────────── */
.wl-list-card {
  background: white;
  border: 1.5px solid var(--zl-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.wl-list-card:hover {
  border-color: var(--zl-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45,212,168,0.12);
}
.wl-list-icon { font-size: 24px; margin-bottom: 8px; display: block; }
.wl-list-name { font-size: 14px; font-weight: 600; color: var(--zl-fg); margin-bottom: 4px; }
.wl-list-count { font-size: 12px; color: var(--zl-fg-muted); }
.wl-tags-preview { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.wl-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* Carte nouvelle liste — indigo/lavande cohérent avec zenlists.pro */
.wl-list-new {
  background: #f5f3ff;
  border: 1.5px dashed #c4b5fd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #6366f1;
  gap: 4px;
}
.wl-list-new:hover {
  border-color: #6366f1;
  background: #ede9fe;
  color: #4338ca;
}

/* Carte partagée avec moi */
.wl-list-card.shared-other {
  border-color: var(--zl-warning) !important;
  box-shadow: 0 0 0 2px rgba(245,158,11,.15);
  background: var(--zl-warning-soft) !important;
}
/* Carte partagée par moi */
.wl-list-card.shared-mine {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 2px rgba(139,92,246,.12);
}

/* Bannière partagée (reprend .wl-shared-banner) */
.wl-shared-banner {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--zl-warning);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 3px 10px;
  border-radius: 6px 6px 0 0;
  margin: -16px -16px 12px -16px;
}

/* Bouton menu ⋯ au hover */
.wl-list-menu-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--zl-border);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--zl-fg-muted);
  transition: all .15s;
  z-index: 2;
}
.wl-list-card:hover .wl-list-menu-btn { display: flex; }
.wl-list-menu-btn:hover {
  background: var(--zl-surface-3);
  color: var(--zl-fg);
}

/* ─── Tri et filtres (reprend .wl-filters-bar) ───────────────────────────────── */
.wl-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wl-filter-tags { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.wl-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid;
  transition: all .15s;
}
.wl-filter-tag.active { color: white; }
.wl-filter-right { display: flex; gap: 8px; align-items: center; }
.wl-sort-select {
  padding: 6px 10px;
  border: 1.5px solid var(--zl-border);
  border-radius: 8px;
  font-size: 12px;
  background: white;
  color: var(--zl-fg);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

/* ─── Breadcrumb vue détail ──────────────────────────────────────────────────── */
.za-zl-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--zl-border);
  background: white;
  flex-shrink: 0;
}
.za-zl-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: white;
  border: 1.5px solid var(--zl-border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zl-fg-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.za-zl-back-btn:hover {
  border-color: var(--zl-primary);
  color: var(--zl-primary-hover);
  background: var(--zl-primary-soft);
}

/* ─── Boutons ────────────────────────────────────────────────────────────────── */
.wl-btn-primary {
  background: var(--zl-header-bg);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  font-family: inherit;
}
.wl-btn-primary:hover { opacity: .88; }

/* ─── États ──────────────────────────────────────────────────────────────────── */
.wl-loading {
  font-size: 13px;
  color: var(--zl-fg-subtle);
  padding: 20px 0;
}
.za-zl-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--zl-fg-muted);
  font-size: 13px;
  grid-column: 1 / -1;
}
.za-zl-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--zl-fg-muted);
  font-size: 13px;
  grid-column: 1 / -1;
  text-align: center;
}
.za-zl-retry-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--zl-border);
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  color: var(--zl-fg-muted);
  transition: all .15s;
}
.za-zl-retry-btn:hover { border-color: var(--zl-primary); color: var(--zl-primary-hover); }
.za-zl-empty-hint {
  font-size: 13px;
  color: var(--zl-fg-subtle);
  padding: 20px 0;
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════════════
   ZenFormz — Sidebar nav embarquée
   ═══════════════════════════════════════════════════════════════════ */

/* Layout flex horizontal : sidebar | contenu */
.za-module-panel[data-module="zf_forms"],
.za-module-panel[data-module="campaigns"] {
  flex-direction: row !important;
}

/* Sidebar */
.za-zf-nav {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  font-family: var(--zen-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

.za-zf-nav-top {
  padding: 12px 10px 10px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.za-zf-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.za-zf-nav-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}
.za-zf-nav-btn.active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
}

/* Funnel sidebar — CSS natif de index.php (ciblage par id natif) */
.za-zf-funnel { padding: 0; flex: 1; }
#funnel-sidebar { padding: 0; flex: 1; }
#funnel-sidebar ul { list-style: none; margin: 0; padding: 0 10px; }
#funnel-sidebar li.zf-fn-step {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 6px 8px; border-radius: 8px; margin-bottom: 1px;
  cursor: default; transition: background .12s; font-family: inherit;
}
#funnel-sidebar li.zf-fn-step.nav { cursor: pointer; }
#funnel-sidebar li.zf-fn-step.nav:hover { background: #f8fafc; }
#funnel-sidebar li.zf-fn-step.active { background: #f8fafc; box-shadow: inset 2px 0 0 #0f172a; }
#funnel-sidebar .zf-fn-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #94a3b8;
  transition: background .15s, color .15s; margin-top: 2px;
}
#funnel-sidebar li.active .zf-fn-num { background: #0f172a; color: #fff; }
#funnel-sidebar li.done   .zf-fn-num { background: #00cfc8; color: #fff; }
#funnel-sidebar .zf-fn-label { font-size: 12px; font-weight: 600; color: #94a3b8; line-height: 1.35; padding-top: 2px; display: block; }
#funnel-sidebar li.active .zf-fn-label { color: #0f172a; }
#funnel-sidebar li.done   .zf-fn-label { color: #475569; }
#funnel-sidebar .zf-fn-sub { font-size: 11px; color: #94a3b8; display: block; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
#funnel-sidebar li.active .zf-fn-sub { color: #64748b; }
#funnel-sidebar .zf-fn-connector { width: 1px; height: 10px; background: #e2e8f0; margin: 0 0 0 17px; list-style: none; }
#funnel-sidebar .zf-fn-title { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #94a3b8; padding: 0 18px 8px; }
#funnel-sidebar [data-fn="new-form"] {
  width: calc(100% - 20px); margin: 0 10px 8px; padding: 7px 10px;
  background: linear-gradient(90deg, #00cfc8, #26abff);
  color: #fff; border: none; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

@media (max-width: 640px) {
  .za-zf-nav { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   Module Contenus — Layout split : liste gauche + chat droit
   ═══════════════════════════════════════════════════════════════════ */

/* Panneau liste gauche */
.za-content-list {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--zen-border, #e1e5eb);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.za-content-list-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
}
.za-content-list-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--zen-text-muted, #94a3b8);
}
.za-content-cards {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
}

/* Cards d'agents */
.za-content-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  background: none;
  border: 1.5px solid transparent;
}
.za-content-card:hover {
  background: var(--card-bg, #f0f4ff);
  border-color: color-mix(in oklab, var(--card-color, #6366f1) 25%, transparent);
}
.za-content-card.active {
  background: var(--card-bg, #f0f4ff);
  border-color: var(--card-color, #6366f1);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--card-color, #6366f1) 15%, transparent);
}
.za-content-card-emoji {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--card-bg, #f0f4ff);
}
.za-content-card-body { flex: 1; min-width: 0; }
.za-content-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--zen-text, #091123);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.za-content-card-desc {
  font-size: 11px;
  color: var(--zen-text-muted, #94a3b8);
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Panneau chat droit */
.za-content-chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
}
.za-content-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--zen-text-muted, #94a3b8);
  font-size: 14px;
}
.za-content-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
  font-size: 14px;
}

/* Messages */
.za-content-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.za-content-msg { display: flex; }
.za-content-msg-user  { justify-content: flex-end; }
.za-content-msg-agent { justify-content: flex-start; }
.za-content-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.za-content-msg-agent .za-content-bubble {
  background: #fff;
  border: 1px solid var(--zen-border, #e1e5eb);
  border-bottom-left-radius: 4px;
  color: var(--zen-text, #091123);
}
.za-content-msg-user .za-content-bubble {
  background: #6366f1;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Indicateur de frappe */
.za-content-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-items: center;
}
.za-content-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: za-blink 1.2s infinite;
}
.za-content-typing span:nth-child(2) { animation-delay: .2s; }
.za-content-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes za-blink { 0%,60%,100%{opacity:.3} 30%{opacity:1} }

/* Zone de saisie */
.za-content-input-zone {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
  align-items: flex-end;
}
.za-content-textarea {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 10px;
  outline: none;
  resize: none;
  line-height: 1.45;
  transition: border-color .15s;
  color: var(--zen-text, #091123);
}
.za-content-textarea:focus { border-color: #6366f1; }
.za-content-send-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: none;
  background: #6366f1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.za-content-send-btn:hover { opacity: .85; }

/* ─── Toggle Chat / App ───────────────────────────────────────────────────── */
.za-content-mode-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.za-content-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.za-content-mode-btn.active {
  background: #fff;
  color: #6366f1;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.za-content-mode-btn:hover:not(.active) { color: #374151; }

/* ─── Zone app iframe ─────────────────────────────────────────────────────── */
.za-content-app-zone {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.za-content-app-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.za-content-iframe {
  width: 100%;
  flex: 1;
  border: none;
  min-height: 0;
}

/* ─── Bouton copier dans le chat principal ────────────────────────────────── */
.za-content-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 1px solid #e1e5eb;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  margin-left: 6px;
  margin-top: 4px;
  vertical-align: middle;
  transition: all .15s;
  flex-shrink: 0;
}
.za-content-copy-btn:hover {
  background: #f0f4ff;
  border-color: #6366f1;
  color: #6366f1;
}

/* ═══════════════════════════════════════════════════════════════════
   Panneau générique agents Zenbaia (za-zb-*)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Vue grille ── */
.za-zb-grid-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: var(--zen-bg, #f8fafc);
}
.za-zb-grid-header {
  margin-bottom: 18px;
}
.za-zb-grid-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--zen-text, #091123);
}
.za-zb-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.za-zb-grid-card {
  background: white;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 14px;
  padding: 20px 16px 16px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.za-zb-grid-card:hover {
  border-color: var(--zb-color, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in oklab, var(--zb-color, #6366f1) 12%, transparent);
  background: var(--zb-bg, #f0f4ff);
}
.za-zb-grid-emoji {
  font-size: 28px;
  margin-bottom: 4px;
  line-height: 1;
}
.za-zb-grid-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--zen-text, #091123);
}
.za-zb-grid-desc {
  font-size: 12px;
  color: var(--zen-text-muted, #94a3b8);
  line-height: 1.45;
}
.za-zb-grid-arrow {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 16px;
  color: var(--zb-color, #6366f1);
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
.za-zb-grid-card:hover .za-zb-grid-arrow { opacity: 1; transform: translateX(3px); }

/* ── Vue split : sidebar + main ── */
.za-zb-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--zen-border, #e1e5eb);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.za-zb-sidebar-header {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
}
.za-zb-back-btn {
  background: none;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zen-text-secondary, #5b6375);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  width: 100%;
  text-align: left;
}
.za-zb-back-btn:hover {
  border-color: #6366f1;
  color: #4338ca;
  background: #f5f3ff;
}
.za-zb-sidebar-agents {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
}
.za-zb-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  border: 1.5px solid transparent;
}
.za-zb-sidebar-item:hover { background: #f8fafc; }
.za-zb-sidebar-item.active {
  background: #f5f3ff;
  border-color: #c4b5fd;
}
.za-zb-sidebar-emoji { font-size: 16px; flex-shrink: 0; }
.za-zb-sidebar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--zen-text, #091123);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.za-zb-sidebar-item.active .za-zb-sidebar-label { color: #4338ca; font-weight: 600; }

/* ── Zone principale ── */
.za-zb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.za-zb-main-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
}
.za-zb-main-emoji { font-size: 18px; }
.za-zb-main-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--zen-text, #091123);
}
.za-zb-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .za-zb-sidebar { display: none; }
  .za-zb-grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Module Analytics
   ═══════════════════════════════════════════════════════════════════ */

/* ── Onglets internes ── */
.za-an-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 16px 0;
  background: white;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
}
.za-an-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--zen-text-muted, #5b6375);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: all .15s;
}
.za-an-tab:hover { color: var(--zen-text, #091123); }
.za-an-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  font-weight: 600;
}
.za-an-badge {
  background: #6366f1;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}
.za-an-view { flex: 1; }

/* ── Grille sources ── */
.za-an-sources-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.za-an-source-card {
  background: white;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .15s;
}
.za-an-source-card.connected { border-color: #6366f1; }
.za-an-source-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.za-an-source-emoji {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.za-an-source-info { flex: 1; min-width: 0; }
.za-an-source-name { font-size: 13.5px; font-weight: 600; color: var(--zen-text, #091123); }
.za-an-source-desc { font-size: 12px; color: var(--zen-text-muted, #94a3b8); margin-top: 2px; }
.za-an-source-status {
  font-size: 11px; font-weight: 600;
  color: var(--zen-text-muted, #94a3b8);
  white-space: nowrap; flex-shrink: 0;
}
.za-an-source-status.ok { color: #218041; }

/* ── Formulaire config ── */
.za-an-source-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--zen-border, #e1e5eb); }
.za-an-field { margin-bottom: 8px; }
.za-an-label { display: block; font-size: 11px; font-weight: 600; color: var(--zen-text-muted, #5b6375); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.za-an-input {
  width: 100%; padding: 7px 10px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 7px; font-size: 13px;
  font-family: inherit; outline: none;
  color: var(--zen-text, #091123);
  transition: border-color .15s;
}
.za-an-input:focus { border-color: #6366f1; }
.za-an-form-actions { display: flex; gap: 8px; margin-top: 10px; }
.za-an-toggle-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #6366f1; font-weight: 600;
  padding: 4px 0; margin-top: 8px; font-family: inherit;
}
.za-an-toggle-btn:hover { color: #4338ca; }

/* ── Boutons ── */
.za-an-btn-primary {
  padding: 7px 14px; border: none; border-radius: 7px;
  background: #6366f1; color: white; font-size: 12.5px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: opacity .15s;
}
.za-an-btn-primary:hover { opacity: .85; }
.za-an-btn-secondary {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 7px; background: white;
  color: var(--zen-text-muted, #5b6375); font-size: 12px;
  font-weight: 500; cursor: pointer; font-family: inherit; transition: all .15s;
}
.za-an-btn-secondary:hover { border-color: #6366f1; color: #6366f1; }
.za-an-btn-danger {
  padding: 7px 14px; border: 1.5px solid #fee2e2; border-radius: 7px;
  background: #fef2f2; color: #ee0f1f; font-size: 12.5px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s;
}
.za-an-btn-danger:hover { background: #fee2e2; }

/* ── Dashboard ── */
.za-an-dashboard { display: flex; flex-direction: column; gap: 16px; }
.za-an-dash-header { display: flex; align-items: center; justify-content: space-between; }
.za-an-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.za-an-kpi-card {
  background: white;
  border: 1.5px solid color-mix(in oklab, var(--an-color, #6366f1) 20%, transparent);
  border-radius: 10px;
  padding: 14px;
}
.za-an-kpi-source { font-size: 12px; color: var(--zen-text-muted, #94a3b8); margin-bottom: 6px; }
.za-an-kpi-value { font-size: 26px; font-weight: 700; color: var(--zen-text, #091123); line-height: 1; }
.za-an-kpi-label { font-size: 11px; color: var(--zen-text-muted, #94a3b8); margin-top: 4px; }
.za-an-chart-area {
  background: white;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.za-an-chart-placeholder { text-align: center; }
.za-an-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 40px 20px; text-align: center;
  color: var(--zen-text-muted, #94a3b8); font-size: 14px;
}
