/* ═══════════════ BTOB NOVA — SIDEBAR OVERLAY (design aligné sur le mockup sidebar) ═══════════════
 * Thème vert #1D9E75 ; scopé sous #btob-nova-root / #btob-nova-sidebar (anti-collision Bootstrap).
 */
#btob-nova-root { --nova-green:#1D9E75; --nova-navy:#0f172a; }
#btob-nova-root.nova-client { --nova-green:#1A6FDB; --nova-navy:#0A1628; } /* variante bleue client */

/* ── Déclencheur topbar admin (rendu par le hook, hors root → classe globale) ── */
/* Le bouton ne porte plus que le VISAGE. Le lien reste un lien de barre ordinaire —
   le cœur lui impose `height:57px` et un padding vertical, et lui reprendre cette
   hauteur décalait l'icône vers le haut au lieu de la centrer. C'est la PASTILLE
   interne qui porte la forme, comme pour les autres icônes de la barre. */
.btob-nova-navbtn { display:inline-flex; align-items:center; text-decoration:none; }
.btob-nova-navchip { display:inline-flex; align-items:center; justify-content:center; position:relative;
  padding:4px; border-radius:50%; background:rgba(29,158,117,.14); border:1px solid rgba(29,158,117,.28); }
.btob-nova-navbtn:hover .btob-nova-navchip { background:rgba(29,158,117,.22); border-color:rgba(29,158,117,.45); }
.btob-nova-navchip img { display:block; width:22px; height:22px; border-radius:50%; object-fit:cover; object-position:top center; border:1.5px solid rgba(29,158,117,.5); }
.btob-nova-navdot { position:absolute; top:-2px; inset-inline-end:-2px; width:8px; height:8px; border-radius:50%; background:#22c55e; border:2px solid #0f172a; }

/* ── Déclencheur flottant client ── */
#btob-nova-root .nova-trigger { position:fixed; top:14px; inset-inline-end:18px; z-index:99989; display:inline-flex; align-items:center; gap:7px;
  padding:6px 12px 6px 6px; border-radius:24px; background:var(--nova-navy); border:1px solid rgba(255,255,255,.08);
  cursor:pointer; box-shadow:0 6px 20px rgba(10,22,40,.3); }
#btob-nova-root .nova-trigger-av { width:26px; height:26px; border-radius:50%; overflow:hidden; }
#btob-nova-root .nova-trigger-av img { width:100%; height:100%; object-fit:cover; object-position:top center; }
#btob-nova-root .nova-trigger-label { font-size:12px; font-weight:700; color:var(--nova-green); }
#btob-nova-root .nova-trigger-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; }
body.nova-open #btob-nova-root .nova-trigger { opacity:0; pointer-events:none; }

/* NOVA intégré DANS la topbar du portail Beneficiary : le JS déplace le trigger dans
   .btob-topbar-actions (à gauche du menu profil/company) → styles autonomes, variante bleue client. */
.nova-trigger--inline {
  position:static; z-index:auto; box-shadow:none; margin-inline-end:10px; flex-shrink:0; vertical-align:middle;
  display:inline-flex; align-items:center; gap:7px; padding:5px 12px 5px 5px; border-radius:22px;
  background:#0A1628; border:1px solid rgba(255,255,255,.08); cursor:pointer;
}
.nova-trigger--inline:hover { background:#12213a; }
.nova-trigger--inline .nova-trigger-av { width:24px; height:24px; border-radius:50%; overflow:hidden; flex-shrink:0; }
.nova-trigger--inline .nova-trigger-av img { width:100%; height:100%; object-fit:cover; object-position:top center; }
.nova-trigger--inline .nova-trigger-label { font-size:12px; font-weight:700; color:#1A6FDB; }
.nova-trigger--inline .nova-trigger-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; }
body.nova-open .nova-trigger--inline { opacity:0; pointer-events:none; }

/* ── Sidebar overlay ── */
#btob-nova-sidebar {
  position:fixed; top:0; inset-inline-end:0; height:100vh; width:380px; max-width:100vw; z-index:99990;
  background:#fff; border-inline-start:1px solid #e2e8f0; display:flex; flex-direction:column;
  transform:translateX(100%); transition:transform .32s cubic-bezier(.4,0,.2,1);
  box-shadow:-8px 0 32px rgba(15,23,42,.14);
}
#btob-nova-sidebar.open { transform:translateX(0); }

/* Header */
#btob-nova-sidebar .nova-sidebar-header { background:var(--nova-navy); padding:14px 16px 12px; display:flex; flex-direction:column; gap:10px; flex-shrink:0; }
#btob-nova-sidebar .nova-header-top { display:flex; align-items:center; gap:10px; }
#btob-nova-sidebar .nova-header-info { flex:1; }
#btob-nova-sidebar .nova-name { font-size:14px; font-weight:700; color:#fff; }
#btob-nova-sidebar .nova-role-line { display:flex; align-items:center; gap:5px; margin-top:2px; }
#btob-nova-sidebar .nova-online-dot { width:6px; height:6px; border-radius:50%; background:#22c55e; }
#btob-nova-sidebar .nova-role { font-size:10px; color:var(--nova-green); font-weight:500; }
#btob-nova-sidebar .nova-header-actions { display:flex; gap:6px; }
#btob-nova-sidebar .nova-hbtn { width:28px; height:28px; border-radius:7px; background:rgba(255,255,255,.07); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; color:#64748b; transition:all .15s; padding:0; }
#btob-nova-sidebar .nova-hbtn:hover { background:rgba(255,255,255,.12); color:#94a3b8; }
#btob-nova-sidebar .nova-hbtn.on { background:rgba(29,158,117,.2); color:var(--nova-green); }
#btob-nova-sidebar .nova-hbtn svg { width:14px; height:14px; }
#btob-nova-sidebar .nova-lang-row { display:flex; gap:4px; }
#btob-nova-sidebar .nova-lang-pill { padding:3px 9px; border-radius:20px; font-size:10px; font-weight:600; border:1px solid rgba(255,255,255,.1); background:transparent; color:#64748b; cursor:pointer; transition:all .15s; }
#btob-nova-sidebar .nova-lang-pill.active { background:rgba(29,158,117,.2); border-color:var(--nova-green); color:var(--nova-green); }

/* Buste */
#btob-nova-sidebar .nova-buste-area { background:linear-gradient(180deg,var(--nova-navy) 0%,#1e293b 100%); display:flex; justify-content:center; align-items:flex-end; position:relative; height:180px; flex-shrink:0; overflow:hidden; }
#btob-nova-sidebar .nova-glow { position:absolute; bottom:-20px; width:200px; height:200px; border-radius:50%; background:radial-gradient(circle,rgba(29,158,117,.15) 0%,transparent 70%); pointer-events:none; }
#btob-nova-sidebar.nova-cl-glow .nova-glow { background:radial-gradient(circle,rgba(26,111,219,.18) 0%,transparent 70%); }
#btob-nova-sidebar .nova-avatar-img { position:absolute; bottom:0; height:175px; width:auto; object-fit:contain; object-position:bottom center; opacity:0; transition:opacity .2s ease; filter:drop-shadow(0 0 20px rgba(29,158,117,.2)); }
#btob-nova-sidebar .nova-avatar-img.active { opacity:1; }
#btob-nova-sidebar .nova-avatar-img.bob { animation:nova-bob .55s ease-in-out infinite alternate; }
@keyframes nova-bob { from{transform:translateY(0)} to{transform:translateY(-6px)} }
#btob-nova-sidebar .nova-speech { position:absolute; top:12px; inset-inline-start:14px; background:#fff; border:1px solid #e2e8f0; border-radius:12px 12px 12px 0; padding:8px 12px; font-size:11.5px; color:#0f172a; line-height:1.5; max-width:210px; box-shadow:0 4px 16px rgba(0,0,0,.1); opacity:0; transform:scale(.9) translateY(4px); transform-origin:bottom left; transition:opacity .22s,transform .22s; pointer-events:none; z-index:5; }
#btob-nova-sidebar .nova-speech.visible { opacity:1; transform:scale(1) translateY(0); }
#btob-nova-sidebar .nova-wave { display:flex; align-items:center; gap:2px; height:12px; margin-top:6px; }
#btob-nova-sidebar .nova-wbar { width:3px; border-radius:2px; background:var(--nova-green); }
#btob-nova-sidebar .nova-wave.active .nova-wbar { animation:nova-wv .8s ease-in-out infinite alternate; }
#btob-nova-sidebar .nova-wbar:nth-child(1){height:3px;animation-delay:0s} #btob-nova-sidebar .nova-wbar:nth-child(2){height:9px;animation-delay:.1s}
#btob-nova-sidebar .nova-wbar:nth-child(3){height:12px;animation-delay:.2s} #btob-nova-sidebar .nova-wbar:nth-child(4){height:6px;animation-delay:.3s}
#btob-nova-sidebar .nova-wbar:nth-child(5){height:4px;animation-delay:.15s} #btob-nova-sidebar .nova-wbar:nth-child(6){height:8px;animation-delay:.25s}
@keyframes nova-wv { from{transform:scaleY(.3)} to{transform:scaleY(1)} }

/* Context + state */
#btob-nova-sidebar .nova-ctx { background:#f8fafc; padding:6px 14px; display:flex; align-items:center; gap:7px; border-bottom:1px solid #f1f5f9; flex-shrink:0; }
#btob-nova-sidebar .nova-ctx-dot { width:6px; height:6px; border-radius:50%; background:var(--nova-green); flex-shrink:0; }
#btob-nova-sidebar .nova-ctx-txt { font-size:10px; color:#64748b; }
#btob-nova-sidebar .nova-ctx-val { margin-inline-start:auto; font-size:10px; font-weight:600; color:#0f172a; background:#e2e8f0; padding:2px 8px; border-radius:5px; max-width:60%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#btob-nova-sidebar .nova-state-bar { padding:5px 14px; background:#f8fafc; border-bottom:1px solid #f1f5f9; display:flex; align-items:center; gap:6px; flex-shrink:0; min-height:28px; }
#btob-nova-sidebar .nova-state-dot { width:7px; height:7px; border-radius:50%; background:#22c55e; flex-shrink:0; }
#btob-nova-sidebar .nova-state-dot.pulsing { animation:nova-blink .9s infinite; } /* v2 : couleur en inline, blink via .pulsing */
#btob-nova-sidebar .nova-state-dot.speaking { background:var(--nova-green); animation:nova-blink .8s infinite; }
#btob-nova-sidebar .nova-state-dot.listening { background:#ef4444; animation:nova-blink .8s infinite; }
#btob-nova-sidebar .nova-state-dot.thinking { background:#f59e0b; animation:nova-blink 1.2s infinite; }
/* v2 — animations d'expression avatar */
#btob-nova-sidebar .nova-avatar-img.celebrate-anim { animation:nova-celebrate .4s ease-in-out infinite alternate; }
@keyframes nova-celebrate { from{transform:translateY(0) rotate(-2deg)} to{transform:translateY(-8px) rotate(2deg)} }
#btob-nova-sidebar .nova-avatar-img.urgent-anim { animation:nova-shake .3s ease-in-out infinite alternate; }
@keyframes nova-shake { from{transform:translateX(-3px)} to{transform:translateX(3px)} }
#btob-nova-sidebar .nova-avatar-img.coaching-anim { animation:nova-pulse-s .5s ease-in-out infinite alternate; }
@keyframes nova-pulse-s { from{transform:scale(1)} to{transform:scale(1.04)} }
@keyframes nova-blink { 0%,100%{opacity:1} 50%{opacity:.25} }
#btob-nova-sidebar .nova-state-txt { font-size:10px; color:#64748b; }

/* Messages */
#btob-nova-sidebar .nova-msgs { flex:1; background:#f8fafc; padding:14px; display:flex; flex-direction:column; gap:10px; overflow-y:auto; }
#btob-nova-sidebar .nova-mrow { display:flex; gap:8px; align-items:flex-end; }
#btob-nova-sidebar .nova-mrow.user { justify-content:flex-end; }
#btob-nova-sidebar .nova-mav { width:24px; height:24px; border-radius:50%; overflow:hidden; flex-shrink:0; }
#btob-nova-sidebar .nova-mav img { width:100%; height:100%; object-fit:cover; object-position:top center; }
#btob-nova-sidebar .nova-bub-n { background:#fff; border:1px solid #e2e8f0; border-radius:14px 14px 14px 2px; padding:9px 12px; font-size:12px; color:#0f172a; line-height:1.55; max-width:290px; box-shadow:0 1px 3px rgba(0,0,0,.04); white-space:pre-wrap; word-wrap:break-word; }
#btob-nova-sidebar .nova-bub-u { background:var(--nova-green); border-radius:14px 14px 2px 14px; padding:9px 12px; font-size:12px; color:#fff; line-height:1.55; max-width:290px; white-space:pre-wrap; word-wrap:break-word; }
#btob-nova-sidebar .nova-mtime { font-size:9px; color:#94a3b8; margin-top:3px; }
#btob-nova-sidebar .nova-mrow.user .nova-mtime { text-align:end; }
#btob-nova-sidebar .nova-bub-err { align-self:center; background:#fef2f2; color:#b91c1c; border:1px solid #fecaca; border-radius:10px; padding:6px 10px; font-size:11px; }
#btob-nova-sidebar .nova-typing { display:flex; gap:4px; align-items:center; padding:9px 12px; }
#btob-nova-sidebar .nova-typing span { width:7px; height:7px; border-radius:50%; background:#cbd5e1; animation:nova-tdot 1.2s ease-in-out infinite; }
#btob-nova-sidebar .nova-typing span:nth-child(2){animation-delay:.2s} #btob-nova-sidebar .nova-typing span:nth-child(3){animation-delay:.4s}
@keyframes nova-tdot { 0%,60%,100%{transform:translateY(0);background:#cbd5e1} 30%{transform:translateY(-6px);background:var(--nova-green)} }

/* Chips */
#btob-nova-sidebar .nova-chips { padding:8px 14px 6px; background:#f8fafc; display:flex; gap:5px; flex-wrap:wrap; border-top:1px solid #f1f5f9; flex-shrink:0; }
#btob-nova-sidebar .nova-chip { padding:5px 10px; border-radius:20px; border:1px solid #e2e8f0; background:#fff; font-size:10.5px; color:#475569; cursor:pointer; font-weight:500; transition:all .15s; white-space:nowrap; }
#btob-nova-sidebar .nova-chip:hover { border-color:var(--nova-green); color:var(--nova-green); background:#f0fdf9; }

/* Input */
#btob-nova-sidebar .nova-input-area { padding:10px 12px; border-top:1px solid #e2e8f0; background:#fff; display:flex; gap:7px; align-items:center; flex-shrink:0; }
#btob-nova-sidebar .nova-input { flex:1; border:1.5px solid #e2e8f0; background:#f8fafc; border-radius:22px; padding:8px 14px; font-size:12px; color:#0f172a; outline:none; font-family:inherit; resize:none; max-height:80px; line-height:1.4; }
#btob-nova-sidebar .nova-input:focus { border-color:var(--nova-green); background:#fff; }
#btob-nova-sidebar .nova-input::placeholder { color:#94a3b8; }
#btob-nova-sidebar .nova-mic { width:34px; height:34px; border-radius:50%; background:#f1f5f9; border:1.5px solid #e2e8f0; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; transition:all .2s; color:#64748b; }
#btob-nova-sidebar .nova-mic svg { width:15px; height:15px; }
#btob-nova-sidebar .nova-mic.recording { background:#fef2f2; border-color:#ef4444; color:#ef4444; animation:nova-mic 1s ease-in-out infinite; }
@keyframes nova-mic { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.3)} 50%{box-shadow:0 0 0 7px rgba(239,68,68,0)} }
#btob-nova-sidebar .nova-send { width:34px; height:34px; border-radius:50%; background:var(--nova-green); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; transition:transform .15s; color:#fff; }
#btob-nova-sidebar .nova-send:hover { transform:scale(1.05); }
#btob-nova-sidebar .nova-send svg { width:15px; height:15px; }

/* ── RTL : sidebar à gauche ── */
html[dir="rtl"] #btob-nova-sidebar { inset-inline-end:auto; inset-inline-start:0; border-inline-start:0; border-inline-end:1px solid #e2e8f0; transform:translateX(-100%); box-shadow:8px 0 32px rgba(15,23,42,.14); }
html[dir="rtl"] #btob-nova-sidebar.open { transform:translateX(0); }
html[dir="rtl"] #btob-nova-root .nova-trigger { inset-inline-end:auto; inset-inline-start:18px; }
html[dir="rtl"] #btob-nova-sidebar .nova-mrow.user { justify-content:flex-start; }
html[dir="rtl"] #btob-nova-sidebar .nova-speech { inset-inline-start:auto; inset-inline-end:14px; border-radius:12px 12px 0 12px; transform-origin:bottom right; }

@media (max-width:480px){ #btob-nova-sidebar{ width:100vw; } }

/* ── Bouton « réécriture pro » injecté sous les zones de texte (Note/description) ── */
.nova-rw-btn { display:inline-flex; align-items:center; gap:4px; margin-top:5px; padding:3px 11px; border-radius:14px; border:1px solid #cbd5e1; background:#fff; color:#1D9E75; font-size:11px; font-weight:600; cursor:pointer; line-height:1.5; transition:all .15s; }
.nova-rw-btn:hover { border-color:#1D9E75; background:#f0fdf9; }
.nova-rw-btn:disabled { opacity:.55; cursor:default; }

/* ═══ Carte suggestion MAKTOB (pont NOVA ↔ btob_maktob) ═══ */
#btob-nova-sidebar .nova-sugcard { margin:8px 0 4px 42px; background:#f0fdf9; border:1px solid #a7f3d0; border-radius:12px; padding:10px 12px; }
#btob-nova-sidebar .nova-sugtxt { font-size:12px; font-weight:600; color:#065f46; } 
#btob-nova-sidebar .nova-sugtxt i { color:#1D9E75; margin-inline-end:5px; }
#btob-nova-sidebar .nova-sugacts { display:flex; gap:6px; margin-top:8px; }
#btob-nova-sidebar .nova-sugok, #btob-nova-sidebar .nova-sugno { flex:1; border:none; border-radius:8px; padding:6px 10px; font-size:11.5px; font-weight:600; cursor:pointer; }
#btob-nova-sidebar .nova-sugok { background:#1D9E75; color:#fff; } #btob-nova-sidebar .nova-sugok:hover { background:#0F6E56; }
#btob-nova-sidebar .nova-sugno { background:#fff; color:#dc2626; border:1px solid #fca5a5; } #btob-nova-sidebar .nova-sugno:hover { background:#fef2f2; }
#btob-nova-sidebar .nova-sugdone { font-size:12px; font-weight:600; color:#065f46; text-align:center; padding:2px; }
