/**
 * 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;
}

/* ── Typing indicator pour le message d'accueil ── */
.za-content-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  min-height: 36px;
}
.za-content-typing span {
  width: 6px; height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  display: inline-block;
  animation: za-typing-bounce 1.2s infinite ease-in-out;
}
.za-content-typing span:nth-child(2) { animation-delay: .15s; }
.za-content-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes za-typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ── Vue split : chatZone contient #view-chat déplacé ── */
.za-zb-chatzone { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.za-zb-chatzone #view-chat { flex: 1; min-height: 0; }
.za-zb-chatzone .chat-messages { flex: 1; overflow-y: auto; min-height: 0; }
.za-zb-chatzone .chat-input-area { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   App Runner — Module natif ZenAgent (remplace les iframes)
   ═══════════════════════════════════════════════════════════════════ */

.zar-loading, .zar-error {
  display:flex;align-items:center;justify-content:center;
  flex:1;padding:40px;color:var(--zen-text-muted,#94a3b8);font-size:13px;
}

/* ── Layout global ── */
.zar-wrap { display:flex;flex-direction:row;flex:1;min-height:0;overflow:hidden;background:#f4f5f7; }


/* ── Sidebar gauche compacte ── */
.zar-form-panel {
  width:240px;flex-shrink:0;
  display:flex;flex-direction:column;gap:10px;
  padding:14px 12px;overflow-y:auto;
  border-right:1px solid var(--zen-border,#e1e5eb);
  background:#fafbfc;
}
.zar-app-intro { display: none; } /* remplacé par zar-agent-tagline */
.zar-agent-tagline {
  font-size: 12px;
  color: var(--zen-text-muted, #64748b);
  line-height: 1.5;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #f8f7ff;
  border-radius: 7px;
  border-left: 3px solid #c7d2fe;
  font-style: normal;
}
.zar-agent-tagline:empty { display: none; }
.zar-field { display:flex;flex-direction:column;gap:3px; }
.zar-label {
  font-size:10px;font-weight:700;color:var(--zen-text-muted,#5b6375);
  text-transform:uppercase;letter-spacing:.06em;
}
.zar-field-hint { font-size:10.5px;color:var(--zen-text-muted,#94a3b8);margin:0; }
.zar-textarea {
  width:100%;padding:6px 8px;
  border:1.5px solid var(--zen-border,#e1e5eb);border-radius:7px;
  font-size:12px;font-family:inherit;resize:vertical;
  color:var(--zen-text,#091123);outline:none;
  transition:border-color .15s;min-height:52px;background:white;
  box-sizing:border-box;
}
.zar-textarea:focus { border-color:#6366f1; }
.zar-btn-all {
  display:flex;align-items:center;justify-content:center;gap:5px;
  padding:8px;border:none;border-radius:8px;
  background:#6366f1;color:white;font-size:12px;font-weight:600;
  cursor:pointer;font-family:inherit;transition:opacity .15s;margin-top:4px;
}
.zar-btn-all:hover { opacity:.85; }

/* ── Panneau résultats ── */
.zar-results-panel {
  flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden;
  background:#f0f1ff;position:relative;
}

/* ── Tabs couleur Zenbaia ── */
.zar-tabs {
  display:flex;flex-wrap:wrap;gap:3px;
  padding:10px 12px 0;
  background:white;
  border-bottom:1px solid var(--zen-border,#e1e5eb);
  flex-shrink:0;
}
.zar-tab {
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 12px 8px;border:none;background:transparent;
  font-size:12px;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;border-radius:6px 6px 0 0;
  position:relative;
}
.zar-tab:hover { color:var(--tab-color,#6366f1);background:color-mix(in oklab,var(--tab-color,#6366f1) 6%,transparent); }
.zar-tab.active {
  color:var(--tab-color,#6366f1);
  border-bottom-color:var(--tab-color,#6366f1);
  font-weight:600;
  background: white;
  box-shadow: 0 -1px 0 white, 0 1px 0 white;
}
.zar-tab-pip {
  width:7px;height:7px;border-radius:50%;flex-shrink:0;
  background:var(--tab-color,#6366f1);opacity:.5;
  transition:opacity .15s;
}
.zar-tab.active .zar-tab-pip { opacity:1; }
.zar-tab-label { flex:1; }
.zar-tab-status { font-size:10px;line-height:1; }

/* ── Toolbar ── */
.zar-toolbar {
  position:absolute;top:10px;right:12px;
  display:none;align-items:center;gap:4px;z-index:2;
}
.zar-tool-btn {
  width:28px;height:28px;border:1.5px solid var(--zen-border,#e1e5eb);
  border-radius:7px;background:white;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  color:var(--zen-text-muted,#5b6375);transition:all .15s;
}
.zar-tool-btn:hover { border-color:#6366f1;color:#6366f1;background:#f5f3ff; }

/* ── Zone résultat ── */
.zar-result { flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden; }
.zar-result-empty {
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  flex:1;gap:8px;color:var(--zen-text-muted,#cbd5e1);font-size:12.5px;text-align:center;
}
.zar-result-loading {
  display:flex;align-items:center;justify-content:center;flex:1;
}
.zar-result-content {
  flex:1;overflow-y:auto;
  padding:16px;
}
.zar-result-content > .zar-md,
.zar-result-content > div {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
  min-height: 100px;
}

/* ── Markdown ── */
.zar-md { font-size:13px;line-height:1.75;color:var(--zen-text,#1e293b); }
.zar-md h1 { font-size:17px;font-weight:700;margin:0 0 10px;color:#0f172a; }
.zar-md h2 { font-size:14px;font-weight:700;margin:16px 0 6px;color:#6366f1;border-bottom:1px solid #e0e7ff;padding-bottom:4px; }
.zar-md h3 { font-size:13px;font-weight:600;margin:12px 0 4px;color:#374151; }
.zar-md p  { margin:6px 0; }
.zar-md ul,
.zar-md ol { margin:6px 0 6px 18px;padding:0; }
.zar-md li { margin:3px 0; }
.zar-md hr { border:none;border-top:1px solid var(--zen-border,#e1e5eb);margin:14px 0; }
.zar-md code { background:#f0f4ff;color:#6366f1;padding:1px 5px;border-radius:4px;font-size:11.5px;font-family:monospace; }
.zar-md a { color:#6366f1;text-decoration:none; }
.zar-md a:hover { text-decoration:underline; }
.zar-md strong { color:#0f172a;font-weight:700; }

/* ── Tables ── */
.zar-table { width:100%;border-collapse:collapse;font-size:12px;margin:10px 0; }
.zar-table th { background:#f8f7ff;color:#6366f1;font-weight:700;padding:7px 10px;border:1px solid #e0e7ff;text-align:left;font-size:10.5px;text-transform:uppercase;letter-spacing:.04em; }
.zar-table td { padding:6px 10px;border:1px solid var(--zen-border,#e1e5eb);vertical-align:top; }
.zar-table tr:nth-child(even) td { background:#fafbfc; }
.zar-table tr:hover td { background:#f5f3ff; }

/* ── Sidebar compacte (quand App Runner actif) ── */
.zar-nav-compact .nav-item-name,
.zar-nav-compact .nav-item-info,
.zar-nav-compact .nav-section-title,
.zar-nav-compact .agent-card-info { display:none !important; }
.zar-nav-compact .nav-item { justify-content:center;padding:10px 0; }

/* ═══════════════════════════════════════════════════════════════════
   Sélecteur d'agents compact (chips horizontaux)
   ═══════════════════════════════════════════════════════════════════ */

.za-zb-agent-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: white;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.za-zb-agent-selector::-webkit-scrollbar { display: none; }

.za-zb-back-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 20px; background: white;
  cursor: pointer; color: var(--zen-text-muted, #5b6375);
  font-size: 12px; font-weight: 600; font-family: inherit;
  flex-shrink: 0; transition: all .15s; white-space: nowrap;
}
.za-zb-back-chip:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }

.za-zb-agent-chips { display: flex; gap: 4px; align-items: center; }

.za-zb-agent-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 20px;
  background: white;
  font-size: 12px; font-weight: 500;
  color: var(--zen-text-muted, #5b6375);
  cursor: pointer; font-family: inherit;
  transition: all .15s; white-space: nowrap;
}
.za-zb-agent-chip:hover {
  border-color: var(--zb-color, #6366f1);
  color: var(--zb-color, #6366f1);
  background: color-mix(in oklab, var(--zb-color, #6366f1) 8%, transparent);
}
.za-zb-agent-chip.active {
  border-color: var(--zb-color, #6366f1);
  color: var(--zb-color, #6366f1);
  background: color-mix(in oklab, var(--zb-color, #6366f1) 10%, transparent);
  font-weight: 600;
}

/* Zone main plein écran (sans sidebar) */
.za-zb-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   Action bar fixe en bas (résultats App Runner)
   ═══════════════════════════════════════════════════════════════════ */

.zar-actionbar {
  display: none;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: white;
  border-top: 2px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,.04);
}
.zar-action-btn {
  display: inline-flex;align-items: center;gap: 5px;
  padding: 6px 10px;border: none;background: none;
  font-size: 12px;font-weight: 500;color: var(--zen-text-muted, #64748b);
  cursor: pointer;font-family: inherit;border-radius: 7px;
  transition: all .12s;white-space: nowrap;
}
.zar-action-btn:hover { background: #f1f5f9;color: var(--zen-text, #1e293b); }
.zar-action-btn.active { background: #ede9fe;color: #6366f1; }
.zar-action-sep { width: 1px;height: 20px;background: var(--zen-border,#e1e5eb);margin: 0 4px;flex-shrink:0; }

/* Popup téléchargement */
.zar-dl-wrap { position: relative; }
.zar-dl-trigger { }
.zar-dl-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: white;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,.10);
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  min-width: 140px;
}
.zar-dl-opt {
  display: flex;align-items: center;gap: 8px;
  padding: 8px 10px;border: none;background: none;
  font-size: 12.5px;font-weight: 500;color: var(--zen-text, #1e293b);
  cursor: pointer;font-family: inherit;border-radius: 7px;
  transition: background .1s;width: 100%;text-align: left;
}
.zar-dl-opt:hover { background: #f1f5f9; }

/* Résultat éditable */
.zar-result-content[contenteditable="true"] {
  cursor: text;
}

/* ── Toggle/collapse formulaire ── */
.zar-form-toggle {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
}
.zar-collapse-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 8px; background: white; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--zen-text-muted, #64748b);
  font-family: inherit; transition: all .15s; white-space: nowrap;
  height: auto; align-self: stretch;
}
.zar-collapse-btn:hover { border-color: #6366f1; color: #6366f1; }
.zar-collapse-btn.active { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.zar-btn-all { flex: 1; }

.zar-form-panel { transition: width .2s ease, min-width .2s ease; }
.zar-form-body { display: flex; flex-direction: column; gap: 10px; }
.zar-textarea-intro { min-height: 120px; }

/* ── Images dans les résultats ── */
.zar-img {
  max-width: 100%; border-radius: 8px; margin: 8px 0;
  display: block; box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ── Titre section paramètres ── */
.zar-form-section-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--zen-text-muted, #94a3b8);
  margin-bottom: -2px;
}
.zar-form-section-title span { flex: 1; }

/* ── Mini bouton expand quand panel collapsed ── */
.zar-mini-expand {
  display: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: 0 auto;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 8px; background: white; cursor: pointer;
  color: #6366f1; transition: all .15s;
}
.zar-mini-expand:hover { background: #f5f3ff; }

/* ── Message d'aide initial ── */
.zar-help-box {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px; max-width: 340px; text-align: left;
}
.zar-help-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--zen-text-muted, #64748b); line-height: 1.4;
}
.zar-help-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: #ede9fe; color: #6366f1; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zar-help-run {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: none; border-radius: 8px;
  background: #6366f1; color: white; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: opacity .15s;
}
.zar-help-run:hover { opacity: .85; }

/* ── Resizer drag&drop ── */
.zar-resizer {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--zen-border, #e1e5eb);
  transition: background .15s;
  position: relative;
}
.zar-resizer:hover,
.zar-resizer:active {
  background: #6366f1;
}
.zar-resizer::after {
  content: '';
  position: absolute;
  inset: 0 -4px;  /* zone de clic élargie */
}

/* ── Barre collapsed (remplace le mini bouton) ── */
.zar-collapsed-bar {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  color: #6366f1;
  border-right: 2px solid #e0e7ff;
  background: #f5f3ff;
  transition: background .15s;
  border-radius: 0 6px 6px 0;
  user-select: none;
}
.zar-collapsed-bar:hover { background: #ede9fe; }
.zar-collapsed-bar .ti-settings-2 { font-size: 16px; opacity: .7; }

.zar-collapsed-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #6366f1;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  opacity: .8;
}

/* Panel collapsed : cacher tout sauf la barre */
.zar-form-panel[style*="width: 36px"] .zar-form-toggle,
.zar-form-panel[style*="width: 36px"] .zar-form-section-title { display: none !important; }

/* ── Fix contenu HTML direct (tab type=content/html) — annuler styles globaux ── */
.zar-result-content em,
.zar-result-content i,
.zar-md em,
.zar-md i {
  font-style: normal;
  color: inherit;
}
.zar-result-content,
.zar-result-content p,
.zar-result-content li,
.zar-result-content span,
.zar-result-content strong {
  color: var(--zen-text, #1e293b);
  font-size: 13px;
  line-height: 1.7;
  font-style: normal;
}
.zar-result-content strong,
.zar-md strong { font-weight: 700; color: #0f172a; }

/* ── Bouton pin ── */
.zar-pin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border: none; background: none; cursor: pointer;
  color: var(--zen-text-muted, #c4c9d4);
  transition: all .15s; flex-shrink: 0;
  padding: 0; border-radius: 4px;
  margin-left: auto;
}
.zar-pin-btn:hover { color: #6366f1; }
.zar-pin-btn.active { color: #6366f1; }
.zar-pin-btn.active i { transform: rotate(-45deg); }

/* ── Bouton reset formulaire ── */
.zar-reset-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: auto; align-self: stretch;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 8px; background: white; cursor: pointer;
  color: var(--zen-text-muted, #94a3b8);
  transition: all .15s; flex-shrink: 0;
}
.zar-reset-btn:hover { border-color: #f97316; color: #f97316; }

/* ═══ Barre de contrôle refaite ═══════════════════════════════════════════════ */
.zar-form-toggle {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  flex-shrink: 0;
}
.zar-btn-all { flex: 1; margin: 0; }
.zar-icon-actions { display: flex; align-items: center; gap: 3px; }
.zar-icon-btn {
  width: 30px; height: 30px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 8px; background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--zen-text-muted, #94a3b8);
  font-size: 14px; transition: all .15s; flex-shrink: 0;
}
.zar-icon-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.zar-icon-btn.active { border-color: #6366f1; color: #6366f1; background: #ede9fe; }
.zar-icon-btn--danger:hover { border-color: #f97316; color: #f97316; background: #fff7ed; }

/* ═══ Popup historique ════════════════════════════════════════════════════════ */
.zar-history-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: white;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
  max-height: 320px;
  display: flex; flex-direction: column;
}
.zar-history-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  font-size: 12px; font-weight: 700; color: var(--zen-text, #1e293b);
  background: #f8f9fb; flex-shrink: 0;
}
.zar-history-close {
  border: none; background: none; cursor: pointer;
  color: var(--zen-text-muted, #94a3b8); font-size: 13px;
}
.zar-history-list { overflow-y: auto; padding: 6px; }
.zar-history-item {
  padding: 8px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 8px;
  transition: background .1s;
}
.zar-history-item:hover { background: #f8f9fb; }
.zar-history-meta { font-size: 10px; color: #94a3b8; white-space: nowrap; }
.zar-history-preview { flex: 1; font-size: 12px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zar-history-restore {
  border: 1.5px solid #6366f1; border-radius: 6px; background: none;
  color: #6366f1; font-size: 11px; font-weight: 600;
  padding: 3px 8px; cursor: pointer; white-space: nowrap;
  transition: all .12s;
}
.zar-history-restore:hover { background: #6366f1; color: white; }

/* ── Icônes Unicode (remplace Tabler Icons non chargé) ── */
.zar-icon {
  font-style: normal;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zar-icon-btn .zar-icon { font-size: 14px; }
.zar-btn-all .zar-icon  { font-size: 11px; }
.zar-collapse-btn .zar-icon { font-size: 12px; }

/* ═══ Modal historique ════════════════════════════════════════════════════════ */
.zar-hist-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.zar-hist-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  max-height: 70vh;
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  z-index: 1001;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.zar-hist-modal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  background: #f8f9fb; flex-shrink: 0;
  font-size: 13px; color: var(--zen-text, #1e293b);
}
.zar-hist-modal-header strong { font-size: 14px; font-weight: 700; }
.zar-hist-modal-header span   { flex: 1; }
.zar-hist-close {
  width: 28px; height: 28px; border: none; background: none;
  cursor: pointer; color: #94a3b8; font-size: 14px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.zar-hist-close:hover { background: #f1f5f9; color: #1e293b; }

.zar-hist-list {
  overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.zar-hist-empty {
  padding: 24px; text-align: center;
  font-size: 12.5px; color: #94a3b8; line-height: 1.6;
}

.zar-hist-card {
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 10px; overflow: hidden;
  transition: border-color .12s;
}
.zar-hist-card:hover { border-color: #c7d2fe; }

.zar-hist-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: #f8f9fb;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
}
.zar-hist-date {
  font-size: 11px; font-weight: 600; color: #64748b;
}
.zar-hist-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 11px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .12s; border: 1.5px solid transparent;
}
.zar-hist-btn--primary {
  background: #6366f1; color: white; border-color: #6366f1;
}
.zar-hist-btn--primary:hover { background: #4f46e5; }
.zar-hist-btn--danger {
  background: white; color: #94a3b8; border-color: var(--zen-border, #e1e5eb);
}
.zar-hist-btn--danger:hover { color: #ef4444; border-color: #ef4444; }

.zar-hist-fields {
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.zar-hist-field {
  display: flex; gap: 8px; font-size: 12px;
}
.zar-hist-key {
  font-weight: 600; color: #6366f1; min-width: 70px;
  text-transform: uppercase; font-size: 10px; padding-top: 1px;
}
.zar-hist-val { color: #475569; line-height: 1.4; }

/* ═══ Boutons d'action sous les champs ═══════════════════════════════════════ */
.zar-field-actions {
  display: flex; gap: 4px; margin-top: 3px;
}
.zar-field-btn {
  padding: 3px 8px; border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 6px; background: white; cursor: pointer;
  font-size: 10.5px; font-weight: 500; color: var(--zen-text-muted, #64748b);
  font-family: inherit; transition: all .12s; white-space: nowrap;
}
.zar-field-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }

/* ═══ Picker RAG ══════════════════════════════════════════════════════════════ */
.zar-rag-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px; transition: background .1s;
}
.zar-rag-item:hover { background: #f8f9fb; }
.zar-rag-icon { font-size: 16px; flex-shrink: 0; }
.zar-rag-name { flex: 1; font-size: 13px; color: var(--zen-text, #1e293b); }

/* ── RAG picker navigation ── */
.zar-rag-breadcrumb {
  display: flex; align-items: center; gap: 2px;
  font-size: 11px; color: #64748b; overflow: hidden;
  max-width: 260px; flex-wrap: nowrap;
}
.zar-rag-bc-item {
  cursor: pointer; color: #6366f1; font-weight: 500;
  white-space: nowrap; padding: 1px 3px; border-radius: 3px;
  transition: background .1s;
}
.zar-rag-bc-item:hover { background: #ede9fe; }

.zar-rag-item--dir {
  cursor: pointer;
}
.zar-rag-item--dir:hover { background: #f0f1ff; }
.zar-rag-item--dir .zar-rag-name { font-weight: 600; color: #374151; }

.zar-rag-item--back {
  cursor: pointer; color: #6366f1; opacity: .7;
}
.zar-rag-item--back:hover { opacity: 1; background: #f0f1ff; }

/* ═══ Module Admin ════════════════════════════════════════════════════════════ */

.zma-overlay {
  position: fixed; inset: 0;
  background: rgba(9,17,35,.5);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.zma-modal {
  background: var(--zen-surface, #fff);
  border-radius: 16px;
  width: min(860px, 95vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.18);
  overflow: hidden;
  font-family: var(--zen-font, 'Inter', sans-serif);
  color: var(--zen-text, #091123);
}

/* Header */
.zma-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  background: var(--zen-bg, #f8fafc);
  flex-shrink: 0;
}
.zma-header-emoji { font-size: 24px; }
.zma-header-info  { flex: 1; }
.zma-header-title { font-size: 15px; font-weight: 700; }
.zma-header-sub   { font-size: 12px; color: var(--zen-text-muted, #5b6375); margin-top: 1px; }
.zma-close {
  width: 32px; height: 32px; border: none;
  background: none; cursor: pointer; font-size: 16px;
  color: var(--zen-text-muted, #5b6375);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.zma-close:hover { background: var(--zen-bg-deep, #f0f2f5); }

/* Body */
.zma-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

/* Colonne gauche */
.zma-left {
  width: 240px; flex-shrink: 0;
  border-right: 1px solid var(--zen-border, #e1e5eb);
  display: flex; flex-direction: column; overflow: hidden;
}
.zma-left-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  background: var(--zen-bg, #f8fafc);
  flex-shrink: 0;
}
.zma-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--zen-text-muted, #5b6375);
}
.zma-btn-add {
  padding: 4px 10px;
  border: 1.5px solid var(--zen-primary, #6366f1);
  border-radius: 6px; background: none;
  color: var(--zen-primary, #6366f1);
  font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  position: relative;
  transition: all .12s;
}
.zma-btn-add:hover { background: #f0f1ff; }

.zma-module-list { flex: 1; overflow-y: auto; padding: 6px; }
.zma-mod-item {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px;
  border-radius: 8px; cursor: pointer;
  border: 1.5px solid transparent;
  margin-bottom: 2px;
  transition: all .12s;
}
.zma-mod-item:hover { background: var(--zen-bg, #f8fafc); }
.zma-mod-item.active {
  background: #f0f1ff;
  border-color: var(--zen-primary, #6366f1);
}
.zma-drag-handle { font-size: 14px; color: var(--zen-border, #cbd5e1); width: 14px; }
.zma-mod-label {
  flex: 1; font-size: 13px; font-weight: 500;
  color: var(--zen-text, #091123);
}
.zma-mod-item.active .zma-mod-label { color: var(--zen-primary, #6366f1); font-weight: 700; }
.zma-badge {
  font-size: 9px; background: #e0e7ff;
  color: var(--zen-primary, #6366f1);
  padding: 2px 6px; border-radius: 4px; font-weight: 700;
  letter-spacing: .06em;
}

/* Colonne droite */
.zma-right { flex: 1; overflow-y: auto; padding: 20px; }
.zma-editor-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--zen-text-muted, #94a3b8); font-size: 13px;
}
.zma-ed-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.zma-ed-sub   { font-size: 12px; color: var(--zen-text-muted, #5b6375); margin-bottom: 16px; }
.zma-ed-section { margin-bottom: 16px; }
.zma-label {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--zen-text-muted, #5b6375);
  margin-bottom: 7px;
}
.zma-row  { display: flex; gap: 8px; }
.zma-input {
  width: 100%; padding: 7px 10px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 8px;
  font-size: 13px; font-family: inherit;
  color: var(--zen-text, #091123);
  background: var(--zen-surface, #fff);
  outline: none; box-sizing: border-box;
  transition: border-color .12s;
}
.zma-input:focus { border-color: var(--zen-primary, #6366f1); }

/* Agent rows */
.zma-agent-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.zma-agent-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 9px;
  background: var(--zen-surface, #fff);
}
.zma-agent-emoji { font-size: 18px; flex-shrink: 0; }
.zma-agent-fields { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.zma-agent-default { font-size: 12.5px; font-weight: 600; color: var(--zen-text, #091123); }
.zma-label-input { font-size: 12px; padding: 4px 8px; }
.zma-agent-actions { display: flex; gap: 2px; }

/* Icônes petits boutons */
.zma-icon-btn {
  width: 26px; height: 26px; border: none; background: none;
  cursor: pointer; color: var(--zen-text-muted, #94a3b8);
  font-size: 12px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.zma-icon-btn:hover { background: var(--zen-bg, #f0f2f5); color: var(--zen-text, #091123); }
.zma-icon-btn--danger:hover { background: #fef2f2; color: #ef4444; }

/* Catalogue */
.zma-catalog {
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 9px; overflow: hidden;
  max-height: 220px; overflow-y: auto;
  margin-top: 6px;
}
.zma-catalog-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
}
.zma-catalog-row:last-child { border-bottom: none; }
.zma-catalog-row:hover { background: var(--zen-bg, #f8fafc); }
.zma-catalog-row--active { opacity: .5; cursor: default; }
.zma-catalog-name { flex: 1; font-size: 13px; color: var(--zen-text, #091123); }
.zma-catalog-check { color: var(--zen-primary, #6366f1); font-weight: 700; }

.zma-empty {
  padding: 14px; text-align: center;
  font-size: 12px; color: var(--zen-text-muted, #94a3b8);
}

/* Picker popup onglet */
.zma-picker-popup {
  position: absolute; top: 100%; right: 0;
  background: var(--zen-surface, #fff);
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 10; min-width: 180px; max-height: 240px; overflow-y: auto;
}
.zma-picker-row {
  padding: 8px 12px; cursor: pointer;
  border-radius: 7px; font-size: 12.5px;
  color: var(--zen-text, #091123);
  transition: background .1s;
}
.zma-picker-row:hover { background: var(--zen-bg, #f0f1ff); color: var(--zen-primary, #6366f1); }

/* Footer */
.zma-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--zen-border, #e1e5eb);
  background: var(--zen-bg, #f8fafc);
  flex-shrink: 0;
}
.zma-ed-footer { display: flex; justify-content: flex-end; margin-top: 8px; }

.zma-btn-cancel {
  padding: 8px 16px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 9px; background: var(--zen-surface, #fff);
  cursor: pointer; font-size: 13px; font-weight: 500;
  font-family: inherit; color: var(--zen-text-muted, #5b6375);
  transition: all .12s;
}
.zma-btn-cancel:hover { border-color: var(--zen-text-muted, #94a3b8); }
.zma-btn-save {
  padding: 8px 20px;
  border: none; border-radius: 9px;
  background: var(--zen-primary, #6366f1);
  color: #fff; cursor: pointer;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  transition: opacity .12s;
}
.zma-btn-save:hover { opacity: .85; }
.zma-btn-apply {
  padding: 7px 16px; border: none;
  border-radius: 8px; background: var(--zen-primary, #6366f1);
  color: #fff; cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  font-family: inherit; transition: all .15s;
}
.zma-btn-apply:hover { opacity: .85; }
.zma-btn-sm {
  padding: 3px 9px; border: 1.5px solid var(--zen-primary, #6366f1);
  border-radius: 5px; background: none;
  color: var(--zen-primary, #6366f1);
  font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  white-space: nowrap; transition: all .12s;
}
.zma-btn-sm:hover { background: var(--zen-primary, #6366f1); color: #fff; }

/* ── Bouton gérer les onglets dans la tab bar ── */
.za-tab-manage-btn {
  margin-left: auto;
  padding: 4px 8px;
  border: none; background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--zen-text-muted, #94a3b8);
  border-radius: 6px;
  transition: all .12s;
  opacity: .6;
  align-self: center;
}
.za-tab-manage-btn:hover {
  background: var(--zen-bg-deep, #f0f2f5);
  color: var(--zen-primary, #6366f1);
  opacity: 1;
}

/* ── Filtre catégories dans le catalogue ── */
.zma-cat-bar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  background: var(--zen-bg, #f8fafc);
}
.zma-cat-btn {
  padding: 3px 10px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 20px; background: white;
  cursor: pointer; font-size: 11px; font-weight: 500;
  color: var(--zen-text-muted, #5b6375);
  font-family: inherit; transition: all .12s;
}
.zma-cat-btn:hover { border-color: var(--zen-primary, #6366f1); color: var(--zen-primary, #6366f1); }
.zma-cat-btn.active {
  background: var(--zen-primary, #6366f1);
  border-color: var(--zen-primary, #6366f1);
  color: white; font-weight: 700;
}

/* ═══ Picker catalogue — pills + accordéon ════════════════════════════════════ */
.catalog-cat-bar {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  background: var(--zen-bg, #f8fafc);
  position: sticky; top: 0; z-index: 2;
}
.catalog-cat-btn {
  padding: 4px 11px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 20px; background: white;
  cursor: pointer; font-size: 11.5px; font-weight: 500;
  color: var(--zen-text-muted, #5b6375);
  font-family: inherit; transition: all .12s;
}
.catalog-cat-btn:hover { border-color: var(--zen-primary, #6366f1); color: var(--zen-primary, #6366f1); }
.catalog-cat-btn.active {
  background: var(--zen-primary, #6366f1);
  border-color: var(--zen-primary, #6366f1);
  color: white; font-weight: 700;
}

/* Groupe accordéon */
.catalog-cat-group { border-bottom: 1px solid var(--zen-border, #e1e5eb); }
.catalog-cat-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; cursor: pointer;
  background: var(--zen-bg, #f8fafc);
  transition: background .1s;
  user-select: none;
}
.catalog-cat-header:hover { background: #f0f1ff; }
.catalog-cat-label {
  flex: 1; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--zen-text-muted, #5b6375);
}
.catalog-cat-count {
  font-size: 11px; background: var(--zen-border, #e1e5eb);
  padding: 1px 7px; border-radius: 10px;
  color: var(--zen-text-muted, #5b6375); font-weight: 600;
}
.catalog-cat-arrow { font-size: 10px; color: var(--zen-text-muted, #94a3b8); }
.catalog-cat-items { overflow: hidden; }
.catalog-cat-items.collapsed { display: none; }
.catalog-cat-group.collapsed .catalog-cat-items { display: none; }
.catalog-cat-group.collapsed .catalog-cat-arrow::before { content: '▼'; }

/* Items catalogue — plus compacts */
.catalog-agent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
  transition: background .1s;
}
.catalog-agent-item:hover:not(.already-added) { background: #f5f3ff; }
.catalog-agent-item.already-added { opacity: .5; cursor: default; }
.catalog-agent-info { flex: 1; min-width: 0; }
.catalog-agent-name { font-size: 13.5px; font-weight: 600; color: var(--zen-text, #091123); }
.catalog-agent-id   { font-size: 11px; color: var(--zen-primary, #6366f1); font-family: monospace; margin-top: 1px; }
.catalog-agent-desc { font-size: 11.5px; color: var(--zen-text-muted, #64748b); margin-top: 2px; line-height: 1.4; }
.catalog-agent-tags { font-size: 11px; color: var(--zen-text-muted, #94a3b8); margin-top: 2px; }
.catalog-agent-add {
  padding: 5px 12px; flex-shrink: 0;
  border: 1.5px solid var(--zen-primary, #6366f1);
  border-radius: 7px; background: none;
  color: var(--zen-primary, #6366f1);
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all .12s; white-space: nowrap;
}
.catalog-agent-add:hover { background: var(--zen-primary, #6366f1); color: white; }
.catalog-agent-add:disabled { opacity: .5; cursor: default; border-color: var(--zen-border); color: var(--zen-text-muted); }

/* ── Chips assistants disponibles dans le module admin ── */
.zma-catalog-chips {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0;
}
.zma-avail-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 20px; background: white;
  cursor: pointer; font-size: 12px; font-weight: 500;
  color: var(--zen-text, #1e293b);
  font-family: inherit; transition: all .12s;
}
.zma-avail-chip:hover {
  border-color: var(--zen-primary, #6366f1);
  color: var(--zen-primary, #6366f1);
  background: #f0f1ff;
}
.zma-avail-chip--added {
  background: #f0f1ff;
  border-color: var(--zen-primary, #6366f1);
  color: var(--zen-primary, #6366f1);
  opacity: .6; cursor: default;
}

/* ═══ Catalogue Admin ═════════════════════════════════════════════════════════ */
.zca-btn-primary {
  padding: 8px 16px; border: none; border-radius: 8px;
  background: var(--zen-primary, #6366f1); color: white;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: opacity .12s;
}
.zca-btn-primary:hover { opacity: .85; }

.zca-empty {
  text-align: center; padding: 40px 20px;
  color: var(--zen-text-muted, #94a3b8); font-size: 13px;
}

/* Groupe catégorie */
.zca-group {
  border: 1.5px solid var(--zen-border, #e1e5eb);
  border-radius: 10px; margin-bottom: 10px; overflow: hidden;
}
.zca-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--zen-bg, #f8fafc);
  border-bottom: 1px solid var(--zen-border, #e1e5eb);
}
.zca-cat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cat-color, #6366f1); flex-shrink: 0;
}
.zca-cat-name-input {
  flex: 1; border: none; background: none;
  font-size: 13px; font-weight: 700;
  color: var(--zen-text, #091123);
  font-family: inherit; outline: none; min-width: 0;
}
.zca-cat-name-input:focus { text-decoration: underline; }
.zca-color-input {
  width: 28px; height: 28px; border: 1.5px solid var(--zen-border);
  border-radius: 6px; cursor: pointer; padding: 2px;
}
.zca-group-count { font-size: 11px; color: var(--zen-text-muted); }
.zca-icon-btn--danger {
  border: none; background: none; cursor: pointer;
  color: var(--zen-text-muted, #94a3b8); font-size: 14px;
  padding: 2px 6px; border-radius: 5px; transition: all .12s;
}
.zca-icon-btn--danger:hover { color: #ef4444; background: #fef2f2; }

/* Chips agents dans une catégorie */
.zca-agent-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px;
}
.zca-agent-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: #f0f1ff; color: var(--zen-primary, #6366f1);
  border: 1.5px solid #c7d2fe; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.zca-chip-rm {
  border: none; background: none; cursor: pointer;
  color: var(--zen-text-muted); font-size: 11px;
  padding: 0 2px; transition: color .1s;
}
.zca-chip-rm:hover { color: #ef4444; }
.zca-add-agent-btn {
  padding: 4px 10px; border: 1.5px dashed var(--zen-border);
  border-radius: 20px; background: none; cursor: pointer;
  font-size: 12px; color: var(--zen-text-muted);
  font-family: inherit; transition: all .12s;
}
.zca-add-agent-btn:hover { border-color: var(--zen-primary); color: var(--zen-primary); }

/* Préassociation agents */
.zca-preset-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--zen-border);
}
.zca-preset-row:last-child { border-bottom: none; }
.zca-preset-agent { display: flex; align-items: center; gap: 8px; }
.zca-preset-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.zca-preset-chip {
  padding: 4px 10px; border: 1.5px solid var(--zen-border);
  border-radius: 20px; background: white; cursor: pointer;
  font-size: 11.5px; font-family: inherit; transition: all .12s;
  color: var(--zen-text-muted);
}
.zca-preset-chip:hover { border-color: var(--chip-color, #6366f1); color: var(--chip-color, #6366f1); }
.zca-preset-chip.selected {
  background: color-mix(in oklab, var(--chip-color, #6366f1) 12%, transparent);
  border-color: var(--chip-color, #6366f1);
  color: var(--chip-color, #6366f1); font-weight: 700;
}
