/*
  FlowOS Dashboard Overrides
  ---
  Uniquement ce que Velzon ne couvre pas.
  Tout le reste vient de bootstrap.min.css + app.min.css + theme.min.css
  Dark/Light geré par data-bs-theme sur <html> — aucun bloc custom.
*/

/* Bootstrap 5 expose --bs-orange par défaut, mais Velzon a rebuild son
   bundle sans cette variable. On la rétablit pour permettre l'usage de
   var(--bs-orange) dans le code (cf. renderFinAgedReceivables bucket 61-90j). */
:root { --bs-orange: #fd7e14; }

/* ── Layout — entièrement géré par Velzon app.min.css ── */

/* ── Dashboard background — transparent pour laisser transparaître le fond vivant
   (.upme-bg). Était #f3f3f9 (gris) qui masquait les auroras. */
.flowos-dashboard-view {
  background: transparent;
}
[data-bs-theme="dark"] .flowos-dashboard-view,
[data-theme="dark"] .flowos-dashboard-view {
  background: var(--vz-body-bg);
}

/* ── Cartes dashboard — verre dépoli : l'aurora transparaît (était #fff pur,
   d'où l'effet « très blanc » signalé). Scopé au dashboard. (2026-06-14) */
.flowos-dashboard-view .card {
  background: var(--up-card-glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .55);
}
[data-bs-theme="dark"] .flowos-dashboard-view .card,
[data-theme="dark"] .flowos-dashboard-view .card {
  background-color: var(--vz-card-bg);
}

/* ── VAGUE ANIMÉE derrière le DASHBOARD (dashboard-wave.js) ───────────────────
   Gated par body.dashboard-wave-on (posée seulement quand #view-dashboard est actif)
   → 100% RÉVERSIBLE : sans la classe, le dashboard garde son style d'origine ci-dessus.
   Cartes en VERRE CLAIR recette cockpit : on RETIRE le backdrop-filter (le flou aplatissait
   la vague) + opacité basse + ombre de texte pour la lisibilité. (Fabrice 2026-06-25) */
body.dashboard-wave-on .flowos-dashboard-view { background: transparent !important; }
body.dashboard-wave-on .flowos-dashboard-view .card {
  background: rgba(255, 255, 255, .16) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, .5) !important;
  box-shadow: 0 7px 22px rgba(80, 70, 160, .07), inset 0 1px 0 rgba(255, 255, 255, .4) !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .55);
}
/* Sombre = navy du site : verre teinté SOMBRE (pas blanc, sinon texte clair illisible sur
   damier vif) + ombre de texte sombre. Un peu plus opaque pour la lisibilité des graphes. */
html[data-theme="dark"] body.dashboard-wave-on .flowos-dashboard-view .card,
html[data-bs-theme="dark"] body.dashboard-wave-on .flowos-dashboard-view .card {
  background: rgba(10, 15, 38, .46) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
/* Le <hr> Bootstrap en tête de #dashboard-grid (séparateur) ressort en trait sombre
   sur la vague → invisible (on garde la marge mt-2/mb-4 pour ne pas décaler le contenu). */
body.dashboard-wave-on .flowos-dashboard-view #dashboard-grid hr {
  border: 0 !important; background: transparent !important; opacity: 0 !important;
}

/* ===== LOGO ANIMÉ de l'écran de connexion (remplace le logo statique) ============
   Lever de soleil + pulse doux du point. Joué 1× à l'apparition (login-wave.js pose
   .play). Keyframes préfixées lg- pour éviter toute collision globale. ============= */
/* opacity:0 par défaut → on NE voit PAS le logo en police de repli (Georgia) avant que
   Fraunces soit prête ; login-wave ajoute .play (après fonts.ready) qui le révèle EN
   s'animant. Hauteur réservée (width+viewBox) → aucun saut de mise en page. */
.upme-logo-anim{width:208px;height:auto;display:inline-block;overflow:visible;opacity:0}
.upme-logo-anim.play{opacity:1}
/* Encre : navy en clair, clair en sombre (sinon invisible sur la vague navy). Bat la
   présentation attribute fill/stroke="#1b2b54". Soleil + point restent orange. */
.upme-logo-anim .ink{fill:#1b2b54;stroke:#1b2b54}
html[data-theme="dark"] .upme-logo-anim .ink,
html[data-bs-theme="dark"] .upme-logo-anim .ink{fill:#F3F4F6;stroke:#F3F4F6}
/* États de base = VISIBLE (no-JS / pas encore .play) */
.upme-logo-anim .lg-sun{transform-box:fill-box;transform-origin:center bottom}
.upme-logo-anim .lg-horizon,.upme-logo-anim .lg-reflet{stroke-dasharray:120;stroke-dashoffset:0}
.upme-logo-anim .lg-lt{opacity:1}
.upme-logo-anim .lg-dot{transform-box:fill-box;transform-origin:center;opacity:1}
.upme-logo-anim .lg-u,.upme-logo-anim .lg-p,.upme-logo-anim .lg-me{transform-box:fill-box;transform-origin:center}
/* Timeline (déclenchée par .play) */
/* Ordre : les 2 traits se tracent D'ABORD (horizon →0.95s, reflet →1.30s), PUIS le soleil
   se lève (1.4→3.0s, après les traits), puis les lettres, puis le pulse du point. */
.upme-logo-anim.play .lg-horizon{animation:lgDraw .85s ease-out .1s both}
.upme-logo-anim.play .lg-reflet{animation:lgDraw .85s ease-out .45s both}
.upme-logo-anim.play .lg-sun{animation:lgRise 1.6s cubic-bezier(.22,.9,.3,1) 1.4s both}
.upme-logo-anim.play .lg-u{animation:lgFadeUp .55s ease-out 2.6s both}
.upme-logo-anim.play .lg-p{animation:lgFadeUp .55s ease-out 2.75s both}
.upme-logo-anim.play .lg-me{animation:lgFadeUp .55s ease-out 2.93s both}
.upme-logo-anim.play .lg-dot{animation:lgDotIn .55s ease-out 2.93s both, lgPulse 1.35s cubic-bezier(.34,.07,.16,1) 3.6s 1 both}
@keyframes lgRise{0%{transform:translateY(46px) scale(.6);opacity:0}55%{opacity:1}100%{transform:translateY(0) scale(1);opacity:1}}
@keyframes lgDraw{from{stroke-dashoffset:120}to{stroke-dashoffset:0}}
@keyframes lgFadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes lgDotIn{from{opacity:0}to{opacity:1}}
@keyframes lgPulse{
  0%{transform:scale(1);filter:drop-shadow(0 0 0 rgba(234,88,12,0))}
  42%{transform:scale(1.55);filter:drop-shadow(0 0 8px rgba(234,88,12,.7))}
  100%{transform:scale(1);filter:drop-shadow(0 0 0 rgba(234,88,12,0))}
}
@media(prefers-reduced-motion:reduce){
  .upme-logo-anim{opacity:1} /* pas d'anim → on montre le logo directement */
  .upme-logo-anim .lg-sun,.upme-logo-anim .lg-horizon,.upme-logo-anim .lg-reflet,
  .upme-logo-anim .lg-lt,.upme-logo-anim .lg-dot{animation:none!important;transform:none!important;opacity:1!important;stroke-dashoffset:0!important}
}

/* ── Journal de la vie (vue Jour) — les 2 colonnes (.jdf-col-rdv « libres » +
   .jdf-col-tasks « Q1… ») étaient blanc pur (ce ne sont pas des .card) → même
   verre dépoli que les cartes du dashboard, sur demande. (2026-06-14) */
#view-journal .jdf-col-rdv,
#view-journal .jdf-col-tasks {
  background: var(--up-card-glass) !important;
  backdrop-filter: blur(18px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
  border: 1px solid rgba(255, 255, 255, .55) !important;
}

/* ── Module DOCUMENTS — calé EXACTEMENT sur le dashboard (Fabrice 2026-06-25) :
   fond transparent (l'aurora .upme-bg transparaît, comme le dashboard) + panneaux
   et cartes en VERRE DÉPOLI aux MÊMES valeurs que .flowos-dashboard-view .card
   (--up-card-glass + blur(18) saturate(1.4) + bord rgba(255,255,255,.55)). Le
   composant Velzon file-manager posait des surfaces blanches/grises
   (.file-manager-sidebar blanc, .card.bg-light) → on les reverre. */
#view-documents,
#view-documents .chat-wrapper,
#view-documents .file-manager-content {
  background: transparent !important;
}
#view-documents .file-manager-sidebar,
#view-documents .card {
  background: var(--up-card-glass) !important;
  backdrop-filter: blur(18px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
  border: 1px solid rgba(255, 255, 255, .55) !important;
}
/* Vignettes fichiers : l'image remplit la carte → le flou de fond est invisible
   ET coûteux (50+ couches GPU au scroll). On garde le verre translucide, sans
   backdrop-filter, pour ne pas réintroduire un coût perf. */
#view-documents .gallery-box.card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-bs-theme="dark"] #view-documents .file-manager-sidebar,
[data-bs-theme="dark"] #view-documents .card,
[data-theme="dark"] #view-documents .file-manager-sidebar,
[data-theme="dark"] #view-documents .card {
  background: var(--vz-card-bg) !important;
}

/* ── Layout : max-width du dashboard ── */
body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-shell,
body.flowos-ui-v2 .flowos-dashboard-view .dashboard-grid.container-fluid {
  max-width: 1680px;
}

/* ── Dashboard header layout ── */
body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header {
  margin-bottom: 0.5rem;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.4rem;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-meta h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vz-heading-color);
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-title-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--vz-border-radius-lg);
  background: var(--vz-primary-bg-subtle);
  color: var(--vz-primary);
  font-size: 1.2rem;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-date {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: var(--vz-secondary-color);
}

/* ── Commandbar layout ── */
body.flowos-ui-v2 .flowos-dashboard-view .dashboard-commandbar {
  flex: 1 1 720px;
  max-width: 760px;
  margin-left: auto;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-command {
  min-height: 3rem;
  border-radius: var(--vz-border-radius-lg);
  border: 1px solid var(--vz-border-color);
  background: var(--vz-card-bg, var(--vz-secondary-bg));
  color: var(--vz-heading-color);
  box-shadow: var(--vz-box-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-command:hover {
  transform: translateY(-1px);
  box-shadow: var(--vz-box-shadow-lg);
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-command-color {
  background: linear-gradient(180deg, rgba(64, 81, 137, 0.98), rgba(64, 81, 137, 0.92));
  border-color: rgba(64, 81, 137, 0.18);
  color: #fff;
}

body.flowos-ui-v2 .flowos-dashboard-view .dashboard-command-color i,
body.flowos-ui-v2 .flowos-dashboard-view .dashboard-command-color span {
  color: inherit;
}

/* ── Hero row (Maintenant + Semaine) ── */
body.flowos-ui-v2 .flowos-dashboard-view .dashboard-hero-row {
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-hero-card {
  padding: var(--vz-card-spacer-y) var(--vz-card-spacer-x);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-card-eyebrow {
  margin-bottom: 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vz-secondary-color);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-now-title,
body.flowos-ui-v2 .flowos-dashboard-view .dash-week-total {
  color: var(--vz-heading-color);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-now-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-now-meta,
body.flowos-ui-v2 .flowos-dashboard-view .dash-now-reason,
body.flowos-ui-v2 .flowos-dashboard-view .dash-week-summary-side,
body.flowos-ui-v2 .flowos-dashboard-view .dash-week-day,
body.flowos-ui-v2 .flowos-dashboard-view .dash-week-count {
  color: var(--vz-body-color);
}

/* ── KPI cards — now 100% Velzon widget pattern, no custom CSS needed ── */

/* ── Sections (À traiter, Points chauds, Projets) — fond transparent ── */
body.flowos-ui-v2 .flowos-dashboard-view .dash-section {
  padding: var(--vz-card-spacer-y) 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0;
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--vz-border-color);
  color: var(--vz-heading-color);
  font-size: 1rem;
  font-weight: 700;
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-section-title i {
  color: var(--vz-primary);
  font-size: 1rem;
}

/* ── Task rows ── */
body.flowos-ui-v2 .flowos-dashboard-view .dash-task-row,
body.flowos-ui-v2 .flowos-dashboard-view .recent-task-item {
  min-height: 88px;
  background: #fff;
  border: 1px solid var(--vz-border-color);
  box-shadow: var(--vz-box-shadow-sm);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-task-row:hover,
body.flowos-ui-v2 .flowos-dashboard-view .recent-task-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--vz-box-shadow);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-task-row-title,
body.flowos-ui-v2 .flowos-dashboard-view .recent-task-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vz-heading-color);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-task-context,
body.flowos-ui-v2 .flowos-dashboard-view .dash-task-row-meta,
body.flowos-ui-v2 .flowos-dashboard-view .recent-task-meta {
  color: var(--vz-body-color);
}

/* ── Project cards ── */
body.flowos-ui-v2 .flowos-dashboard-view .dash-proj-card {
  background: var(--vz-secondary-bg);
  border: 1px solid var(--vz-border-color);
  border-left-width: 4px;
  border-radius: var(--vz-border-radius);
  box-shadow: none;
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-proj-name,
body.flowos-ui-v2 .flowos-dashboard-view .dash-proj-pct {
  color: var(--vz-heading-color);
}

body.flowos-ui-v2 .flowos-dashboard-view .dash-empty {
  color: var(--vz-secondary-color);
}

/* ── Responsive ── */
@media (max-width: 1199.98px) {
  body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-shell {
    flex-direction: column;
  }
  body.flowos-ui-v2 .flowos-dashboard-view .dashboard-commandbar {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 767.98px) {
  body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  body.flowos-ui-v2 .flowos-dashboard-view .dashboard-header-meta h2 {
    font-size: 1.4rem;
  }
}

/* ── Task list actions — toujours visibles ── */
#tasksList tr .tasks-list-menu { opacity: 1; }

/* ── Scrollbars page invisibles par défaut, fines au survol ──
   Pattern macOS : pas de bandeau gris imposant en haut/bas, mais on
   garde la possibilité de scroller. S'applique aux scrolls horizontal
   et vertical du document. Webkit (Chrome/Safari/Edge) + Firefox. */
html, body {
  scrollbar-width: none;        /* Firefox : barre cachée par défaut */
  -ms-overflow-style: none;     /* IE/Edge legacy : pareil */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}
html:hover::-webkit-scrollbar,
body:hover::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
html:hover::-webkit-scrollbar-thumb,
body:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 3px;
}
html:hover::-webkit-scrollbar-thumb:hover,
body:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.3);
}
html:hover, body:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.18) transparent;
}

/* ================================================================
 * Sidebar Architecture 4 couches — styles cosmétiques uniquement.
 * Toutes les structures (li, a, ul) restent en classes Velzon natives
 * (.nav-item, .nav-link, .menu-link, .navbar-nav). On ajoute juste les
 * sections cognitives, le mode édition, les contrôles drag/rename/hide.
 * ================================================================ */

/* ════════════════════════════════════════════════════════
   PHASE 4 (2026-06-14) — Sidebar claire en verre + filet indigo actif.
   Reskin Up·me. Les vars --vz-vertical-menu-* sont (re)définies dans
   core-kernel/css/tokens.css ; data-sidebar="light" dans index.html →
   Velzon n'applique plus le navy. Ici : la surface verre + l'état actif.
   ════════════════════════════════════════════════════════ */
.app-menu,
.vertical-menu {
  background: var(--vz-vertical-menu-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
          backdrop-filter: blur(18px) saturate(1.4);
  border-right: 1px solid var(--vz-vertical-menu-border);
  box-shadow: none;
}
/* Survol : fond très léger (la couleur de texte est gérée par Velzon via var). */
.navbar-menu .navbar-nav .nav-link:hover {
  background: rgba(120,110,170,.06);
}
/* Item actif : texte indigo + dégradé indigo léger + filet indigo à gauche.
   Sélecteur 3 classes (0,3,0) = même spécificité que la règle Velzon native
   (.navbar-menu .navbar-nav .nav-link.active) ; flowos-overrides est chargé
   APRÈS app.min.css → on gagne sur l'égalité, sans !important. */
.navbar-menu .navbar-nav .nav-link.active,
.navbar-menu .navbar-nav .menu-link.active {
  color: var(--vz-vertical-menu-item-active-color);
  background: linear-gradient(90deg, rgba(99,102,241,.16), rgba(99,102,241,.05));
  box-shadow: inset 2px 0 0 var(--vz-primary);
}

/* ── PHASE 4b — Items en PILULES arrondies + icônes MONOCHROMES (modèle .nav-i).
   Le réel avait des bandes pleine largeur plates + des icônes arc-en-ciel
   (pensées sidebar foncée). Scopé à la sidebar ÉTENDUE (lg) pour ne pas
   décaler le rail réduit. */
/* icônes de dimension : COULEURS D'ORIGINE conservées (cf .dim-icon-* plus bas) —
   pas d'override monochrome (retiré à la demande de Fabrice). */
/* La nav verticale étire ses enfants sur toute la largeur. Velzon la rend en
   align-items:flex-start → les items rétrécissent à leur contenu (Dashboard
   116px, en-têtes de dimension 205px) = largeurs inégales qui « ne vont pas
   jusqu'au bout ». stretch → tous à 226px : pilule uniforme, chevron poussé à
   droite, identique pour chaque onglet (cf reskin note 2026-06-14). */
html[data-sidebar-size="lg"] .navbar-menu .navbar-nav { align-items: stretch !important; }

/* items (modules transverses + en-têtes de dimension) en pilules */
html[data-sidebar-size="lg"] .navbar-menu .navbar-nav .nav-link.menu-link,
html[data-sidebar-size="lg"] .navbar-menu .navbar-nav .sidebar-section-header.is-mega-trigger {
  margin: 1px 12px !important;
  width: auto !important;
  border-radius: 10px;
  padding-left: 12px !important; padding-right: 12px !important;
}
/* arrondir l'item actif dans la pilule (le filet inset suit le radius) */
html[data-sidebar-size="lg"] .navbar-menu .navbar-nav .nav-link.active { border-radius: 10px; }

/* Intelligence Entreprise — conteneur transparent sur TOUS les onglets
   (prospection, recherche unitaire, sauvegardées, fiche société) → l'aurora
   vivante remplace le fond gris #FAFAF9 ; les cartes blanches (.fe-card) et le
   panneau prospection (transparent côté labo) restent inchangés. (2026-06-14) */
#view-intelligence-entreprise #intelligence-content { background: transparent !important; }

/* Intelligence Entreprise — onglet Recherche unitaire : carte d'état vide
   (« Lance une recherche ») transparente → texte + bouton flottent sur l'aurora.
   Ciblé en ENFANT DIRECT de .fe-shell (`> .fe-card`) pour NE PAS toucher les
   cartes de données de la fiche société (plus profondes, dans .fe-main). (2026-06-14) */
#view-intelligence-entreprise .fe-shell > .fe-card { background: transparent !important; border: none !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* Mon offre et Paul — conteneur hôte gris #FAFAFA retiré (vaut pour TOUS les
   onglets : Vue d'ensemble, Mon Offre, Cas Clients, Personas, Objections,
   Concurrents, Scripts, Ma Méthode, Rituels) → l'aurora vivante remplit derrière
   les cartes (qui gardent leur fond clair). (2026-06-14) */
#mon-offre-paul-host { background: transparent !important; }

/* Notes — plein écran (focus stage) : blanc/gris retirés → backdrop AURORA.
   L'overlay (#notes-focus-overlay, z:1060) doit rester opaque pour masquer l'app
   derrière (sinon double-vision : timer/fav-bar visibles) → on lui donne l'aurora
   (lilas #B2A6FF + corail #FCA5A5, comme .upme-bg) plutôt que transparent. Les
   panneaux internes (note, éditeur Quill, sidebar « Pages », input titre) passent
   transparents pour laisser voir cette aurora. (2026-06-14) */
#notes-focus-overlay {
  background:
    radial-gradient(65vw 65vw at 30% -8%, rgba(var(--up-aurora-1-rgb),.32), rgba(var(--up-aurora-1-rgb),0) 68%),
    radial-gradient(55vw 55vw at 0% 108%, rgba(var(--up-aurora-2-rgb),.26), rgba(var(--up-aurora-2-rgb),0) 66%),
    linear-gradient(180deg, #f7f6fc 0%, #eef0fb 100%) !important;
}
#notes-focus-overlay .notes-focus-stage,
#notes-focus-overlay .ql-editor,
#notes-focus-overlay .notes-focus-sidebar,
#notes-focus-overlay .notes-focus-stage input.form-control { background: transparent !important; }

/* Toolbar "Personnaliser" en haut de la sidebar */
.sidebar-edit-toolbar {
  opacity: 0.65;
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-edit-toolbar:hover { opacity: 1; }
.sidebar-edit-toolbar .nav-link.sidebar-edit-toggle {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.375rem 0.75rem;
}
.sidebar-edit-toolbar.sidebar-edit-mode .nav-link.sidebar-edit-toggle {
  color: var(--bs-primary);
  font-weight: 600;
}
.sidebar-collapse-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.5rem;
  color: var(--vz-secondary-color);
  text-decoration: none;
  border-radius: 0.25rem;
  transition: color 0.15s, background 0.15s;
}
.sidebar-collapse-all:hover {
  color: var(--bs-primary);
  background: rgba(var(--vz-primary-rgb), 0.1);
}
.sidebar-collapse-all i { font-size: 0.95rem; }

/* En-tête d'une section cognitive (Intelligence — Mémoire, etc.).
   display: block + position: relative → les contrôles d'édition sont
   en position: absolute à droite, ce qui laisse l'<a> prendre toute
   la largeur disponible. En mode édition, on ajoute padding-right pour
   que le label ne soit pas masqué par les icônes drag/edit/delete.
   Title Case (pas de text-transform uppercase) pour un rendu moderne
   et chaleureux, conforme aux conventions SaaS 2024+ (Notion, Slack…). */
.sidebar-section-header {
  display: block;
  position: relative;
  /* Match flowos-components.css:158 (.navbar-menu .navbar-nav .nav-link) :
     mêmes padding/font/color que les modules natifs. margin-top plus
     conséquent pour matérialiser une "respiration de section" (saut de
     paragraphe entre groupes de modules). */
  padding: 0.45rem 1.5rem;
  margin-top: 0.625rem;
  font-family: hkgrotesk, sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--vz-vertical-menu-item-color);
  list-style: none;
  user-select: none;
}
.sidebar-edit-mode .sidebar-section-header {
  padding-right: 6rem;
}
.sidebar-section-header > a {
  display: flex;
  align-items: center;
  gap: 0;
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
  font-size: inherit;
  background: transparent;
  width: 100%;
}
.sidebar-section-header > a:hover { color: var(--bs-primary) !important; }
/* `color: inherit` sur les enfants span/i forcerait le SVG dim-icon à suivre
   la couleur du <a> parent (blanc/gris sidebar dark) → on exclut .dim-icon
   pour préserver la couleur signature de chaque dimension. */
.sidebar-section-header > a > span:not(.dim-icon),
.sidebar-section-header > a > i { color: inherit; }
.sidebar-section-header > a .sidebar-section-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-section-icon { display: none; }
/* Sauf quand l'icône est un SVG dimension (.dim-icon) : on la montre,
   colorée via la classe .dim-icon-{section_key}. */
.sidebar-section-icon.dim-icon { display: inline-flex; margin-right: 0.5rem; vertical-align: middle; }
.sidebar-section-name { flex: 1; }
.sidebar-section-arrow {
  font-size: 1rem;
  transition: transform 0.2s ease;
}
.sidebar-section-arrow.collapsed { transform: rotate(-90deg); }

/* Contrôles d'édition section (drag, rename, delete) — invisibles hors mode édition */
.sidebar-section-edit {
  display: none;
  gap: 0.5rem;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}
.sidebar-edit-mode .sidebar-section-edit { display: inline-flex; }
.sidebar-section-edit i {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--vz-secondary-color);
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
}
.sidebar-section-edit i:hover { opacity: 1; color: var(--bs-primary); }
.sidebar-section-edit .sidebar-section-delete:hover { color: var(--bs-danger); }
.sidebar-section-drag-handle { cursor: grab; }
.sidebar-section-drag-handle:active { cursor: grabbing; }

/* Contenu d'une section (UL des modules) — collapse géré via .d-none.
   list-style + padding-left forcés : les UL imbriqués héritent du style
   "circle" du navigateur, qu'il faut écraser explicitement. */
.sidebar-section-content,
.sidebar-section-modules,
.sidebar-hidden-modules,
.sidebar-transverse-modules,
.sidebar-transverse-wrap,
.sidebar-section-modules .sidebar-module,
.sidebar-hidden-modules .sidebar-module,
.sidebar-transverse-modules .sidebar-module {
  list-style: none !important;
  padding-left: 0;
  margin: 0;
}
.sidebar-section-modules,
.sidebar-hidden-modules,
.sidebar-transverse-modules { padding: 0; }

/* Respiration verticale homogène entre modules transverses (Dashboard,
   Finances, Paramètres) ET entre sections (Intelligence — Mémoire, etc.).
   Sans cette règle, les transverses étaient collés (Velzon natif sans
   margin) alors que les sections avaient 0.625rem → asymétrie visuelle. */
.sidebar-transverse-modules .sidebar-module + .sidebar-module {
  margin-top: 0.625rem;
}

/* Indentation des sous-modules en mode étendu pour marquer leur hiérarchie
   sous le section-header. Reset en mode réduit pour que les icônes restent
   alignées avec celles des sections. */
.sidebar-section-modules .nav-link.menu-link {
  padding-left: 2.5rem;
}
html[data-sidebar-size="sm"] .sidebar-section-modules .nav-link.menu-link,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-modules .nav-link.menu-link {
  padding-left: 1.5rem;
}

/* Velzon génère un ::before hollow-circle 5px sur .nav-link en contexte
   sous-menu — il ressort dans nos UL imbriqués personnalisés. On le tue. */
.sidebar-module > .nav-link::before,
.sidebar-section-modules .nav-link::before,
.sidebar-hidden-modules .nav-link::before,
.sidebar-transverse-modules .nav-link::before {
  display: none !important;
  content: none !important;
}

/* Sidebar réduite (data-sidebar-size="sm" toujours-collapsed, ou
   "sm-hover" hors hover) : les libellés de sections + l'arrow + les
   contrôles d'édition + la toolbar "Personnaliser" déborderaient sur le
   main content. On les cache. Les modules eux-mêmes restent visibles
   sous forme d'icônes (Velzon gère ça nativement via .menu-link span). */
html[data-sidebar-size="sm"] .sidebar-section-name,
html[data-sidebar-size="sm"] .sidebar-section-arrow,
html[data-sidebar-size="sm"] .sidebar-section-edit,
html[data-sidebar-size="sm"] .sidebar-hidden-header,
html[data-sidebar-size="sm"] .sidebar-edit-toolbar,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-name,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-arrow,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-edit,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-hidden-header,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-edit-toolbar {
  display: none !important;
}

/* CAUSE RACINE : Velzon a la règle
   [data-sidebar-size=sm] .navbar-menu .navbar-nav .nav-link span { display: none }
   qui masque TOUS les <span> dans nav-link en mode collapsed. Notre
   <span class="dim-icon"> qui contient le SVG est donc caché → modules
   transverses sans icône en mode rétracté. On ré-affiche explicitement
   les .dim-icon avec spécificité supérieure (5 classes + 1 élément). */
html[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link .dim-icon,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .navbar-nav .nav-link .dim-icon {
  display: inline-flex !important;
}
/* Sub-modules de section (Notes, Idées...) cachés en mode réduit : ils
   sont déjà accessibles via leurs sections, on évite de surcharger le rail. */
html[data-sidebar-size="sm"] .sidebar-section-modules,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-modules {
  display: none !important;
}

/* En mode réduit, le section-header doit s'aligner pixel-perfect avec les
   .nav-link.menu-link de Velzon (sinon les icônes des sections sont
   décalées par rapport aux icônes des modules). Velzon utilise
   padding: 0.625rem 1.5rem sur .nav-link → on copie exactement.
   L'icône (premier enfant du <a>) se positionne naturellement à
   padding-left, comme pour les nav-link standards. */
html[data-sidebar-size="sm"] .sidebar-section-header,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-header {
  display: block !important;
  padding: 0.625rem 1.5rem !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
html[data-sidebar-size="sm"] .sidebar-section-header > a,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-section-header > a {
  display: flex;
  align-items: center;
  width: auto;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* ── FIX zone cliquable des en-têtes de dimension (Fabrice 2026-06-26) ──
   Avant : le padding était sur le <li> (la pilule violette) et le <a> ne faisait que la
   taille du texte → cliquer « à côté » ou « en dessous » du texte mais DANS le violet ne
   déclenchait rien (zone morte). Désormais le padding est porté par le <a> → le lien
   remplit TOUTE la pilule (haut/bas/gauche/droite cliquables). Le <li> n'a plus de padding
   (sauf rétracté sm, inchangé ci-dessus, + place pour les icônes d'édition à droite).
   100% CSS, aucun changement de comportement ni de JS. */
.sidebar-section-header,
html[data-sidebar-size="lg"] .navbar-menu .navbar-nav .sidebar-section-header.is-mega-trigger {
  padding: 0 !important;
}
.sidebar-section-header > a { padding: 0.45rem 12px; box-sizing: border-box; }
.sidebar-edit-mode .sidebar-section-header { padding-right: 6rem !important; } /* place aux icônes drag/suppr */
/* En mode réduit, la dim-icon garde la même taille qu'en mode étendu
   (1.75rem min-width / 18px SVG), aligné pixel-perfect avec les nav-link i. */
.sidebar-section-empty {
  padding: 0.5rem 1.375rem;
  font-style: italic;
  list-style: none;
}

/* Module item — réutilise .nav-item Velzon, on ajoute juste les contrôles d'édition */
.sidebar-module { position: relative; }
.sidebar-module.is-hidden { opacity: 0.45; }
.sidebar-module.is-transverse { /* dashboard etc. — visuel inchangé */ }
/* Modules "à venir" (catalog comingSoon: true) : visuellement identifiables,
   non navigables. Le badge "Bientôt" est rendu dans le HTML. */
.sidebar-module.is-coming-soon > .nav-link {
  opacity: 0.55;
  cursor: not-allowed;
}
.sidebar-module.is-coming-soon > .nav-link:hover {
  opacity: 0.7;
  background: transparent !important;
}
/* En mode édition, le label ne doit pas passer SOUS l'overlay d'édition
   (drag handle + œil) qui est en position: absolute à droite. */
.sidebar-edit-mode .sidebar-module > .nav-link {
  padding-right: 4.5rem !important;
}
.sidebar-module-edit {
  display: none;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  gap: 0.5rem;
  z-index: 2;
}
.sidebar-edit-mode .sidebar-module-edit { display: inline-flex; }
.sidebar-module-edit i {
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 300;
  color: var(--vz-secondary-color);
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
}
.sidebar-module-edit i:hover { opacity: 1; color: var(--bs-primary); }
.sidebar-module-drag-handle { cursor: grab; }
.sidebar-module-drag-handle:active { cursor: grabbing; }

/* Visuel mode édition : pointillé sur hover pour distinguer ce qui est draggable.
   Couleur = primary à 35% via rgba(var(--vz-primary-rgb)) → suit le thème. */
.sidebar-edit-mode .sidebar-section-header,
.sidebar-edit-mode .sidebar-module {
  outline: 1px dashed transparent;
  outline-offset: -2px;
  transition: outline-color 0.15s;
}
.sidebar-edit-mode .sidebar-section-header:hover,
.sidebar-edit-mode .sidebar-module:hover {
  outline-color: rgba(var(--vz-primary-rgb), 0.35);
}

/* FIX 2026-06-24 — Contrôles d'édition PAR MODULE (drag + œil) invisibles en mode
   édition. Cause racine : .sidebar-transverse-wrap est un flex-item avec
   min-width:auto → il refusait de rétrécir sous la largeur de son contenu (~323px)
   et débordait des 249px de la sidebar. Les modules héritaient de ce 323px, donc
   leurs contrôles (position:absolute à droite, x≈280-310) tombaient HORS de la zone
   visible → coupés. On contraint tous les conteneurs de modules à la largeur réelle
   de la sidebar (min-width:0 lève le blocage du flex-item). Sûr en/hors édition. */
.sidebar-transverse-wrap,
.sidebar-transverse-modules,
.sidebar-section-content,
.sidebar-section-modules,
.sidebar-hidden-modules,
.sidebar-module {
  min-width: 0 !important;
  max-width: 100% !important;
}
/* Réserver la place des contrôles à droite du lien en mode édition (sinon le
   libellé passe sous les icônes). Sélecteur volontairement spécifique pour battre
   la règle "pilule" (html[data-sidebar-size=lg] .navbar-menu .navbar-nav .nav-link.menu-link). */
html .navbar-menu .navbar-nav.sidebar-edit-mode .sidebar-module > .nav-link.menu-link {
  padding-right: 3.6rem !important;
  overflow: hidden;
}

.sidebar-hidden-header {
  margin-top: 1rem;
  border-top: 1px solid var(--vz-border-color);
  padding-top: 0.625rem;
  color: var(--vz-secondary-color);
  font-style: italic;
}

.sidebar-compact .nav-link.menu-link { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.sidebar-compact .sidebar-section-header { padding-top: 0.375rem; padding-bottom: 0.125rem; }

.sidebar-no-icons .sidebar-module .nav-link.menu-link > i:first-child { display: none; }

/* ════════════════════════════════════════════════════════
   Mega Panel pédagogique — slide depuis la droite au clic d'une dimension.
   Mode interaction_mode='mega_panel' : la sidebar n'affiche que les
   sections, les sub-modules sont accessibles via le panel.
   Voir memory/concept_mega_menu.md.
   ════════════════════════════════════════════════════════ */

/* Couleurs signatures des 8 dimensions humaines + Action transverse.
   Style C : icône SVG monochrome colorée via currentColor (.dim-icon).
   Le HTML rend `<span class="dim-icon dim-icon-{section_key}">` qui définit
   `color:` → l'SVG hérite via stroke="currentColor". Cohérent fond clair
   ET fond sombre, pas de "sticker effect" sur sidebar dark. */
.dim-icon {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 1.75rem;
  width: 1.75rem;
  height: 1.125rem;
  padding: 0 !important;
  margin: 0 !important;
}
.dim-icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block;
  stroke-width: 1.25;
  margin: 0 !important;
}
/* Palette équirépartie sur le cercle chromatique : aucune paire ne se ressemble.
   Du froid intellectuel au chaud exécutif (violet → bleu → cyan → vert → lime
   → jaune → orange → rouge), avec rose magenta en complément pour l'émotion. */
.dim-icon-intelligence_memoire   { color: #c084fc; } /* violet vif */
.dim-icon-decision_strategie     { color: #facc15; } /* jaune franc */
.dim-icon-organisation_priorite  { color: #4ade80; } /* vert pomme */
.dim-icon-relation_communication { color: #22d3ee; } /* cyan lumineux */
.dim-icon-volonte_discipline     { color: #3b82f6; } /* bleu franc */
.dim-icon-equilibre_emotion      { color: #fb7185; } /* rose pastel clair */
.dim-icon-motivation_sens        { color: #fb923c; } /* orange */
.dim-icon-energie_vitalite       { color: #eab308; } /* or/doré chaud */
.dim-icon-action_transverse      { color: #dc2626; } /* rouge écarlate profond */

/* Le mega panel header reprend la même classe dim-icon, mais en plus grand
   et avec un fond très subtil pour ne pas être "perdu" sur fond blanc. */
.sidebar-mega-emoji.dim-icon {
  width: 3.5rem;
  height: 3.5rem;
  min-width: 3.5rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, currentColor 12%, transparent);
  justify-content: center;
}
.sidebar-mega-emoji.dim-icon svg { width: 60%; height: 60%; }

/* Brand colors hoistées : single source of truth pour le bandeau co-build
   et les ombres profondes du panel (pas d'équivalent Velzon natif).
   Fallbacks comma-séparés pour rgba() : si Velzon ne fournit pas la var
   ou la fournit en notation espace, le rgba() reste valide. */
:root {
  --upme-cobuild-navy-1: #1d2638;
  --upme-cobuild-navy-2: #2a3552;
  --upme-cobuild-warm-1: #f7b84b;
  --upme-cobuild-warm-2: #ec4899;
  --upme-cobuild-warm-glow: rgba(247, 184, 75, 0.4);
  --upme-mega-overlay: rgba(15, 23, 42, 0.5);
  --upme-mega-shadow: rgba(15, 23, 42, 0.18);
  --upme-mega-card-shadow: rgba(15, 23, 42, 0.08);
}

/* Mega panel : principe POC v2 — passe SOUS la topbar et SORT DE DERRIÈRE
   la sidebar. Hiérarchie z-index VRAIMENT alignée sur Velzon :
     sidebar (.app-menu)    : 1004 (natif Velzon)
     topbar (#page-topbar)  : 1002 (natif Velzon)
     panel mega             : 1001  ← sous topbar ET sous sidebar
     backdrop               : 1000  ← sous le panel pour pas l'assombrir
   Le topbar (1002) couvre le panel au niveau de la barre. La sidebar
   (1004) couvre le panel au niveau de la sidebar lors du slide. */
.sidebar-mega-backdrop {
  position: fixed;
  inset: 0;
  background: var(--upme-mega-overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;  /* 100 ms — aligné sur le panel */
}
.sidebar-mega-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-mega-panel {
  position: fixed;
  /* top : sous la topbar Velzon (height fixe 70px de .navbar-header). */
  top: 70px;
  /* left : collé à droite de la sidebar. */
  left: var(--vz-vertical-menu-width, 250px);
  bottom: 0;
  width: min(680px, calc(100vw - var(--vz-vertical-menu-width, 250px) - 1rem));
  background: var(--vz-card-bg, #ffffff);
  box-shadow: 8px 0 32px var(--upme-mega-shadow);
  transform: translateX(-100%);     /* caché derrière la sidebar au repos */
  transition: transform 0.1s cubic-bezier(0.32, 0.72, 0, 1);  /* 100 ms — ouverture vive (2026-06-24) */
  z-index: 1001;                     /* < topbar (1002) ET < sidebar (1004) */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-mega-panel.show { transform: translateX(0); }

/* Sidebar repliée : la left du panel s'ajuste automatiquement à la largeur
   réduite de la sidebar Velzon pour rester collé. */
html[data-sidebar-size="sm"] .sidebar-mega-panel,
html[data-sidebar-size="sm-hover"] .sidebar-mega-panel {
  left: var(--vz-vertical-menu-width-sm, 70px);
  width: min(680px, calc(100vw - var(--vz-vertical-menu-width-sm, 70px) - 1rem));
}

.sidebar-mega-header {
  /* Zone d'en-tête plus fine : padding réduit pour gagner ~25-30px de hauteur. */
  padding: 0.875rem 1.5rem 0.875rem;
  border-bottom: 1px solid var(--vz-border-color, #e5e8ee);
  position: sticky;
  top: 0;
  background: var(--vz-card-bg, #ffffff);
  z-index: 5;
  flex-shrink: 0;
}
.sidebar-mega-close {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--vz-light, #eef0f5);
  color: var(--vz-secondary-color, #6b7280);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-mega-close:hover {
  background: var(--vz-tertiary-bg, #e9ecf3);
  color: var(--vz-heading-color, #1a1f36);
  transform: translateY(-50%) rotate(90deg);
}

.sidebar-mega-title-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.sidebar-mega-emoji {
  /* Icône réduite (avant 3.5rem → maintenant 2.25rem) pour matcher la
     hauteur réduite du header. */
  font-size: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(var(--vz-primary-rgb, 91, 107, 209), 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-mega-emoji.dim-icon { width: 2.25rem; height: 2.25rem; min-width: 2.25rem; }
.sidebar-mega-emoji.dim-icon svg { width: 65%; height: 65%; }
.sidebar-mega-title-text h2 {
  /* Titre réduit pour rester proportionnel à l'icône plus petite. */
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--vz-heading-color, #1a1f36);
}

.sidebar-mega-body {
  flex: 1;
  padding: 2rem 2.5rem 3rem;
}

/* Bloc coaching — texte qui explique POURQUOI cette dimension compte.
   Couleurs avec fallbacks explicites : si --vz-primary-rgb n'est pas
   défini, le gradient s'évanouit ; le fallback solide assure la visibilité. */
.sidebar-mega-coaching {
  background: rgba(91, 107, 209, 0.08);
  background: linear-gradient(135deg, rgba(var(--vz-primary-rgb, 91, 107, 209), 0.10) 0%, rgba(var(--vz-primary-rgb, 91, 107, 209), 0.03) 100%);
  border-left: 3px solid var(--bs-primary, #5b6bd1);
  padding: 1.125rem 1.5rem;
  border-radius: 0 0.75rem 0.75rem 0;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--vz-heading-color, #1a1f36);
}
.sidebar-mega-coaching strong {
  color: var(--bs-primary, #5b6bd1);
  font-weight: 700;
}

.sidebar-mega-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--vz-secondary-color, #6b7280);
  font-weight: 700;
  margin-bottom: 1rem;
}
.sidebar-mega-section-title .count {
  background: var(--vz-light, #eef0f5);
  color: var(--vz-secondary-color, #6b7280);
  padding: 0.125rem 0.5rem;
  border-radius: 0.625rem;
  font-size: 0.7rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

/* Grille de modules dans le mega panel */
.sidebar-mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.mega-module-card {
  background: var(--vz-card-bg, #ffffff);
  border: 1px solid var(--vz-border-color, #e5e8ee);
  border-radius: 0.75rem;
  padding: 1.125rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.mega-module-card:hover {
  border-color: var(--bs-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--upme-mega-card-shadow);
}
.mega-module-card.coming {
  opacity: 0.65;
  cursor: not-allowed;
}
.mega-module-card.coming:hover {
  border-color: var(--vz-border-color);
  transform: none;
  box-shadow: none;
}
/* (Le verre des cartes du méga-menu est défini plus bas, avec le bloc panneau —
   voir « Cartes du méga-menu = même verre … » : règle unique, valeurs explicites.) */

.mega-module-card-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.mega-module-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(var(--vz-primary-rgb, 91, 107, 209), 0.12);
  color: var(--bs-primary, #5b6bd1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.mega-module-card.coming .mega-module-card-icon {
  background: var(--vz-light, #eef0f5);
  color: var(--vz-secondary-color, #6b7280);
}
.mega-module-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
  color: var(--vz-heading-color, #1a1f36);
}
.mega-module-card-badge {
  background: var(--vz-warning-bg-subtle, #fef3c7);
  color: var(--vz-warning-text-emphasis, #92400e);
  font-size: 0.65rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mega-module-card-desc {
  font-size: 0.82rem;
  color: var(--vz-secondary-color, #6b7280);
  line-height: 1.45;
}

/* CTA co-build : bandeau dégradé en bas du mega panel — couleurs de marque
   Up-me hoistées dans :root, pas d'équivalent Velzon car positionnement
   spécifique (gradient navy + warm coloré). */
.sidebar-mega-cobuild {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, var(--upme-cobuild-navy-1) 0%, var(--upme-cobuild-navy-2) 100%);
  color: white;
  border-radius: 0.75rem;
  padding: 1.375rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.125rem;
}
.sidebar-mega-cobuild-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--upme-cobuild-warm-1), var(--upme-cobuild-warm-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.sidebar-mega-cobuild-text { flex: 1; }
.sidebar-mega-cobuild-text h4 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: white;
}
.sidebar-mega-cobuild-text p {
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.5;
  margin: 0;
}
.sidebar-mega-cobuild-btn {
  background: white;
  color: var(--upme-cobuild-navy-1);
  padding: 0.625rem 1.125rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
}
.sidebar-mega-cobuild-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px var(--upme-cobuild-warm-glow);
}

/* En mode mega_panel, les section-headers SONT l'élément cliquable principal
   de la sidebar (et non plus de simples dividers). On les booste en visibilité
   et en interactivité, sans casser le mode inline.
   - Police plus lisible sur fond sidebar dark (color blanc à 90%)
   - Taille +10%, plus de padding pour zone clic confortable
   - Hover et état actif clairs et discrètement marqués
   - Chevron `›` plus visible */
.sidebar-section-header.is-mega-trigger {
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  /* Force la li à occuper 100% de la sidebar (sécurité contre flex/simplebar
     qui pourraient la rétrécir). Padding-right réduit pour que le chevron
     se rapproche du bord droit → highlight perçu jusqu'au bout.
     margin-top conservé (0.625rem) pour que la respiration verticale soit
     identique à celle des modules transverses (Dashboard / Finances...). */
  margin: 0.625rem 0 0 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 0.75rem !important;
}
.sidebar-section-header.is-mega-trigger > a {
  color: inherit !important;
}
/* Phase 4 (2026-06-14) : hover/actif rendus var-driven (étaient color:#fff en
   dur, pensés sidebar foncée → illisibles sur la sidebar claire). Alignés sur
   l'item actif nav-link : texte indigo + dégradé indigo léger + filet. */
.sidebar-section-header.is-mega-trigger:hover {
  background: rgba(120, 110, 170, 0.06);
  color: var(--vz-vertical-menu-item-hover-color);
}
.sidebar-section-header.is-mega-trigger.active {
  background: linear-gradient(90deg, rgba(99,102,241,.16), rgba(99,102,241,.05));
  color: var(--vz-vertical-menu-item-active-color);
  box-shadow: inset 2px 0 0 var(--vz-primary);
}
.sidebar-section-header.is-mega-trigger .sidebar-section-arrow {
  font-size: 0.95rem;
  opacity: 0.6;
  transition: transform 0.15s, opacity 0.15s;
}
.sidebar-section-header.is-mega-trigger:hover .sidebar-section-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* Animations cascade des cards */
.sidebar-mega-panel.show .sidebar-mega-coaching,
.sidebar-mega-panel.show .sidebar-mega-section-title,
.sidebar-mega-panel.show .mega-module-card,
.sidebar-mega-panel.show .sidebar-mega-cobuild {
  animation: megaFadeUp 0.4s ease backwards;
}
.sidebar-mega-panel.show .sidebar-mega-coaching { animation-delay: 0.08s; }
.sidebar-mega-panel.show .sidebar-mega-grid .mega-module-card:nth-child(1) { animation-delay: 0.14s; }
.sidebar-mega-panel.show .sidebar-mega-grid .mega-module-card:nth-child(2) { animation-delay: 0.17s; }
.sidebar-mega-panel.show .sidebar-mega-grid .mega-module-card:nth-child(3) { animation-delay: 0.20s; }
.sidebar-mega-panel.show .sidebar-mega-grid .mega-module-card:nth-child(4) { animation-delay: 0.23s; }
.sidebar-mega-panel.show .sidebar-mega-grid .mega-module-card:nth-child(5) { animation-delay: 0.26s; }
.sidebar-mega-panel.show .sidebar-mega-grid .mega-module-card:nth-child(n+6) { animation-delay: 0.29s; }
.sidebar-mega-panel.show .sidebar-mega-cobuild { animation-delay: 0.36s; }

@keyframes megaFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive : panel plein écran sur mobile (sidebar Velzon devient drawer
   en dessous de 992px, donc le panel n'a plus de sidebar adjacente). */
@media (max-width: 992px) {
  .sidebar-mega-panel,
  html[data-sidebar-size="sm"] .sidebar-mega-panel,
  html[data-sidebar-size="sm-hover"] .sidebar-mega-panel {
    left: 0;
    width: 100%;
    top: 70px;
  }
}
@media (max-width: 768px) {
  .sidebar-mega-header { padding: 0.75rem 1rem; }
  .sidebar-mega-body { padding: 1.5rem 1.25rem 2.5rem; }
  .sidebar-mega-grid { grid-template-columns: 1fr 1fr; }
  .sidebar-mega-cobuild {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
}
@media (max-width: 480px) {
  .sidebar-mega-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════
   Command Palette ⌘K — modale de navigation rapide.
   Pattern Linear/Notion/Vercel : centrée, backdrop flou, input + liste.
   z-index 9000 = au-dessus de TOUT (modales, mega panel, topbar).
   Voir command-palette.js pour le comportement.
   ════════════════════════════════════════════════════════ */

/* Bouton trigger dans le topbar — discret avec hint clavier */
#cmd-palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}
.cmd-palette-trigger-kbd {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border: 1px solid var(--vz-border-color, #e5e7eb);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--vz-secondary-color, #6b7280);
  background: var(--vz-light, #f3f3f9);
  font-family: inherit;
  letter-spacing: 0.02em;
}

/* Overlay (backdrop sombre + flou) */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmd-palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modale */
.cmd-palette {
  width: min(640px, 92vw);
  max-height: 70vh;
  background: var(--vz-card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}
.cmd-palette-overlay.open .cmd-palette {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Input de recherche */
.cmd-palette-input-wrap {
  position: relative;
  border-bottom: 1px solid var(--vz-border-color, #e5e7eb);
}
.cmd-palette-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
  pointer-events: none;
}
.cmd-palette input {
  width: 100%;
  padding: 1.1rem 1.25rem 1.1rem 3rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
  color: var(--vz-heading-color, #1e293b);
  outline: none;
  font-family: inherit;
}
.cmd-palette input::placeholder {
  color: var(--vz-secondary-color, #94a3b8);
  opacity: 0.7;
}

/* Liste des résultats */
.cmd-palette-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.cmd-palette-group { padding: 0.5rem 0; }
.cmd-palette-group-title {
  padding: 0.4rem 1.25rem 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vz-secondary-color, #94a3b8);
  font-weight: 600;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  color: var(--vz-heading-color, #1e293b);
  transition: background 0.1s;
  border-left: 3px solid transparent;
}
.cmd-palette-item:hover { background: var(--vz-tertiary-bg, #f8fafc); }
.cmd-palette-item.selected {
  background: rgba(91, 107, 209, 0.08);
  border-left-color: var(--bs-primary, #5b6bd1);
}
.cmd-palette-item-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: rgba(91, 107, 209, 0.08);
  color: var(--bs-primary, #5b6bd1);
}
.cmd-palette-item-icon i { font-size: 1rem; }
.cmd-palette-item-label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
}
.cmd-palette-item-hint {
  font-size: 0.74rem;
  color: var(--vz-secondary-color, #94a3b8);
}
.cmd-palette-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--vz-secondary-color, #94a3b8);
  font-size: 0.9rem;
}

/* Footer hint clavier */
.cmd-palette-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--vz-border-color, #e5e7eb);
  background: var(--vz-tertiary-bg, #f8fafc);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.74rem;
  color: var(--vz-secondary-color, #64748b);
}
.cmd-palette-footer kbd {
  padding: 1px 5px;
  background: var(--vz-card-bg, #fff);
  border: 1px solid var(--vz-border-color, #cbd5e1);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--vz-secondary-color, #64748b);
}
.cmd-palette-footer-hint {
  margin-left: auto;
  opacity: 0.7;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════
   Sidebar Coach Zone — DÉPLACE le #coach-fab existant (avec son iframe avatar
   compagnon) dans une zone en bas de sidebar. Pas de duplication d'avatar.
   Position: absolute bottom : reste visible en permanence, pas wipé par le
   re-render de #navbar-nav (kernel sidebar).
   Voir sidebar-coach.js pour le déplacement DOM.
   ════════════════════════════════════════════════════════ */

/* Padding-bottom sur la sidebar pour réserver la place de la zone Coach
   (compagnon ~95px + label + marge). */
.app-menu.navbar-menu { padding-bottom: 140px !important; }

.sidebar-coach-zone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  /* Pas de cadre, pas de fond : le compagnon respire directement sur le navy
     de la sidebar. Cohérent avec ton positionnement "intégration native". */
  background: transparent;
  border: 0;
  user-select: none;
}

/* OVERRIDE position fixed du coach-fab. Tuile 88px, dégradé indigo (palette Paul v2),
   glyphe blanc STATIQUE (l'avatar animé iframe a été neutralisé 2026-06-25 pour le CPU). */
.sidebar-coach-zone .coach-fab,
.sidebar-coach-zone .coach-fab.coach-fab-avatar {
  position: static !important;
  bottom: auto !important;
  right: auto !important;
  width: 88px !important;
  height: 88px !important;
  flex-shrink: 0;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #6366f1, #a78bfa) !important;
  color: #fff;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: auto !important;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-coach-zone .coach-fab .coach-fab-glyph {
  width: 44px;
  height: 44px;
  display: block;
}
.sidebar-coach-zone .coach-fab:hover,
.sidebar-coach-zone .coach-fab.coach-fab-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.5);
}
.sidebar-coach-zone .coach-fab .coach-avatar-iframe {
  border-radius: 14px !important;
}

/* ── Icône AI = ÉTOILE Up·me (étoile-ia) sur TRANSPARENCE (plus de carré violet) ──
   Au repos : sparkle orange + halo doux (satellites masqués). Au survol : l'étoile
   « respire »/tourne, les satellites navy scintillent, le halo pulse — fidèle à étoile-ia. */
.sidebar-coach-zone .coach-fab,
.sidebar-coach-zone .coach-fab.coach-fab-avatar,
.sidebar-coach-zone .coach-fab:hover,
.sidebar-coach-zone .coach-fab.coach-fab-avatar:hover {
  background: transparent !important;
  box-shadow: none !important;
}
.sidebar-coach-zone .coach-fab .coach-fab-glyph { width: 80px !important; height: 80px !important; overflow: visible; }
.coach-fab-glyph .halo { transform-box: fill-box; transform-origin: center; opacity: .16; }
.coach-fab-glyph .spark { transform-box: fill-box; transform-origin: center; }
.coach-fab-glyph .sat { transform-box: fill-box; transform-origin: center; opacity: 0; }
.sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .halo { animation: coachStarHalo 3.4s ease-in-out infinite; }
.sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .spark { animation: coachStarSpark 3.4s cubic-bezier(.4,0,.2,1) infinite; }
.sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .sat-1 { animation: coachStarTwinkle 3.4s ease-in-out infinite .4s; }
.sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .sat-2 { animation: coachStarTwinkle 3.4s ease-in-out infinite 1.05s; }
@keyframes coachStarHalo { 0%,100%{opacity:.16;transform:scale(.9)} 50%{opacity:.34;transform:scale(1.08)} }
@keyframes coachStarSpark { 0%{transform:scale(.84) rotate(-6deg)} 46%{transform:scale(1.06) rotate(3deg)} 60%{transform:scale(1) rotate(0deg)} 100%{transform:scale(.84) rotate(-6deg)} }
@keyframes coachStarTwinkle { 0%,100%{opacity:0;transform:scale(.2)} 18%{opacity:1;transform:scale(1.1)} 38%{opacity:.5;transform:scale(.85)} 55%{opacity:0;transform:scale(.3)} }
@media(prefers-reduced-motion:reduce){ .sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .halo, .sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .spark, .sidebar-coach-zone .coach-fab:hover .coach-fab-glyph .sat { animation: none !important; } }

/* REPLAY one-shot : quand Paul (rail latéral) se referme, l'étoile « rejaillit » une fois
   (sparkle pop + halo + satellites qui scintillent). Classe posée/retirée par sidebar-coach.js. */
.sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .spark { animation: coachStarBurst 1.5s cubic-bezier(.34,.1,.2,1) 1; }
.sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .halo { animation: coachStarHaloBurst 1.5s ease-in-out 1; }
.sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .sat-1 { animation: coachStarTwinkle 1.5s ease-in-out 1 .25s; }
.sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .sat-2 { animation: coachStarTwinkle 1.5s ease-in-out 1 .5s; }
@keyframes coachStarBurst { 0%{transform:scale(1) rotate(0)} 28%{transform:scale(1.22) rotate(8deg)} 60%{transform:scale(.95) rotate(-4deg)} 100%{transform:scale(1) rotate(0)} }
@keyframes coachStarHaloBurst { 0%{opacity:.16;transform:scale(.95)} 45%{opacity:.4;transform:scale(1.15)} 100%{opacity:.16;transform:scale(1)} }
@media(prefers-reduced-motion:reduce){ .sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .spark, .sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .halo, .sidebar-coach-zone .coach-fab.is-star-playing .coach-fab-glyph .sat { animation: none !important; } }

.sidebar-coach-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  max-width: 200px;
  padding: 0 0.75rem;
}
.sidebar-coach-name {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.sidebar-coach-msg {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Pulse : signalement quand Paul a qq chose à dire. */
.sidebar-coach-zone.is-pulsing .coach-fab {
  position: relative;
}
.sidebar-coach-zone.is-pulsing .coach-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid #a78bfa;
  animation: coachPulse 1.2s ease-out infinite;
  pointer-events: none;
}
@keyframes coachPulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Sidebar repliée : avatar plus petit, texte caché. */
html[data-sidebar-size="sm"] .sidebar-coach-zone .coach-fab,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-coach-zone .coach-fab {
  width: 48px !important;
  height: 48px !important;
  border-radius: 10px !important;
}
html[data-sidebar-size="sm"] .sidebar-coach-zone .coach-fab .coach-fab-glyph,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-coach-zone .coach-fab .coach-fab-glyph {
  width: 26px;
  height: 26px;
}
html[data-sidebar-size="sm"] .sidebar-coach-text,
html[data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .sidebar-coach-text {
  display: none;
}

/* Coach Panel : reste à droite (flux de lecture). On override seulement le
   .hidden pour utiliser opacity/transform au lieu de display:none — ça permet
   l'animation scale-up depuis le coin haut-gauche au moment où le fil arrive. */
.coach-panel {
  transform-origin: 0% 0%;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.coach-panel.hidden {
  display: flex !important;     /* override le display:none de Velzon/coach.css */
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
  visibility: hidden;
}
/* Frame "is-opening" : utilisé par sidebar-coach.js pour démarrer l'animation
   à l'arrivée du fil. La classe est ajoutée puis retirée en RAF → CSS interpole. */
.coach-panel.is-opening {
  opacity: 0;
  transform: scale(0);
}

/* SVG overlay plein écran qui héberge le fil lumineux + comète. */
.fil-coach-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1100;
  display: block;
}
.fil-coach-line {
  fill: none;
  stroke: url(#filCoachGradient);
  stroke-width: 0.3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px #a78bfa) drop-shadow(0 0 2px #c4b5fd);
}
.fil-coach-comet {
  fill: #ffffff;
  filter: drop-shadow(0 0 18px #a78bfa) drop-shadow(0 0 8px #ffffff);
}

/* Avatar source disparaît à mi-parcours du fil ("transféré" en énergie). */
.coach-fab.is-transferred {
  opacity: 0 !important;
  transform: scale(0.7) !important;
  pointer-events: none !important;
}

/* Pulse "arrivée" sur le mini-avatar du panel (durée 1s).
   Box-shadow animé (cf. coach-fab) pour éviter le clipping si le mini-avatar
   a overflow:hidden (mounting iframe possible). Halo qui irradie. */
#coach-panel-avatar.is-arriving {
  animation: coachArrivalGlow 1s ease-out;
}
@keyframes coachArrivalGlow {
  0%   { box-shadow: 0 0 0 0 rgba(167,139,250,0.9), 0 0 0 0 rgba(196,181,253,0); }
  60%  { box-shadow: 0 0 0 12px rgba(167,139,250,0.05), 0 0 18px 3px rgba(196,181,253,0.55); }
  100% { box-shadow: 0 0 0 24px rgba(167,139,250,0), 0 0 24px 6px rgba(196,181,253,0); }
}

/* Pulse "départ" sur le coach-fab quand le fil part.
   On utilise box-shadow animé plutôt que pseudo-éléments car le coach-fab a
   `overflow: hidden` (pour clipper l'iframe avatar à l'intérieur), ce qui
   couperait des ::before/::after. box-shadow rend hors de la box → pas de
   clipping. Halo violet doux qui irradie autour du compagnon. */
.coach-fab.is-linking {
  animation: coachDepartureGlow 0.75s ease-out;
}
@keyframes coachDepartureGlow {
  0%   { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(167,139,250,0.85), 0 0 0 0 rgba(196,181,253,0); }
  50%  { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 16px rgba(167,139,250,0.06), 0 0 22px 4px rgba(196,181,253,0.55); }
  100% { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 32px rgba(167,139,250,0), 0 0 32px 8px rgba(196,181,253,0); }
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .sidebar-mega-panel,
  .sidebar-mega-backdrop,
  .sidebar-mega-panel.show * {
    transition: none !important;
    animation: none !important;
  }
}

/* SortableJS ghost/chosen/drag — couleurs dérivées du theme primary. */
.sortable-ghost {
  opacity: 0.4;
  background: rgba(var(--vz-primary-rgb), 0.15) !important;
}
.sortable-chosen {
  background: rgba(var(--vz-primary-rgb), 0.25);
  border-radius: 0.375rem;
}
.sortable-drag {
  background: var(--vz-vertical-menu-bg) !important;
  box-shadow: var(--vz-box-shadow-lg);
  border-radius: 0.375rem;
}

/* ============================================================
   COULEUR SIGNATURE PAR DIMENSION (mega menu)
   Quand le panel est ouvert sur une dimension, sa couleur
   signature est injectée via `data-dim` posé par sidebar.kernel.js
   sur _populateMegaPanel. Sources de vérité = palette des
   `.dim-icon-{key}` déjà définie plus haut dans ce fichier.
   ============================================================ */
.sidebar-mega-panel[data-dim="intelligence_memoire"]    { --dim-color: #c084fc; --dim-rgb: 192,132,252; }
.sidebar-mega-panel[data-dim="decision_strategie"]      { --dim-color: #facc15; --dim-rgb: 250,204,21;  }
.sidebar-mega-panel[data-dim="organisation_priorite"]   { --dim-color: #4ade80; --dim-rgb: 74,222,128;  }
.sidebar-mega-panel[data-dim="relation_communication"]  { --dim-color: #22d3ee; --dim-rgb: 34,211,238;  }
.sidebar-mega-panel[data-dim="volonte_discipline"]      { --dim-color: #3b82f6; --dim-rgb: 59,130,246;  }
.sidebar-mega-panel[data-dim="equilibre_emotion"]       { --dim-color: #fb7185; --dim-rgb: 251,113,133; }
.sidebar-mega-panel[data-dim="motivation_sens"]         { --dim-color: #fb923c; --dim-rgb: 251,146,60;  }
.sidebar-mega-panel[data-dim="energie_vitalite"]        { --dim-color: #eab308; --dim-rgb: 234,179,8;   }
.sidebar-mega-panel[data-dim="action_transverse"]       { --dim-color: #dc2626; --dim-rgb: 220,38,38;   }

/* MODULE VEILLE — overrides minimaux. Le markup utilise 100% Velzon natif
   (card, card-animate, btn-soft-*, badge, list-group, alert). Ces overrides
   servent uniquement pour : (1) clamp multilignes des titres/snippets, (2)
   stripe colorée pour les cards sans thumbnail, (3) hover thumb subtil. */
.text-truncate-2, .text-truncate-3 {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.text-truncate-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.text-truncate-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* Stripe colorée en haut des cards sans thumbnail (article texte seul) */
.veille-card .veille-stripe { height: 4px; }

/* Hover image : zoom subtil dans le ratio 16:9 (will-change pour éviter le jank) */
.veille-card .veille-thumb img { transition: transform 0.4s ease; will-change: transform; }
.veille-card:hover .veille-thumb img { transform: scale(1.04); }

/* Checkbox overlay : pastille blanche 32×32 cachée par défaut, révélée au hover ou si sélectionné */
.veille-select-overlay {
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.veille-card:hover .veille-select-overlay,
.veille-select-overlay.is-selected,
.veille-select-overlay:focus-within {
  opacity: 1; transform: scale(1);
}
.veille-select-overlay.is-selected {
  background: var(--vz-primary);
}
.veille-select-overlay.is-selected .form-check-input {
  border-color: #fff;
}
.veille-select-overlay .form-check-input { cursor: pointer; }

/* Bouton supprimer : effacé par défaut, visible au hover de la card.
   Évite la pollution visuelle quand on n'a pas l'intention de supprimer. */
.veille-card-del { opacity: 0.35; transition: opacity 0.15s ease; }
.veille-card:hover .veille-card-del,
.veille-card-del:hover,
.veille-card-del:focus { opacity: 1; }

/* Drag & drop card → chip de dossier */
.veille-card { cursor: grab; }
.veille-card:active { cursor: grabbing; }
.veille-card-dragging { opacity: 0.5; transform: scale(0.97); transition: none; }
/* Pendant un drag, les chips dossiers se signalent comme drop-zones (légère pulse) */
body.veille-dragging [data-coll-filter]:not([data-coll-filter=""]) {
  outline: 2px dashed transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s ease, transform 0.15s ease;
}
body.veille-dragging [data-coll-filter]:not([data-coll-filter=""]) {
  outline-color: rgba(var(--vz-primary-rgb), 0.3);
}
[data-coll-filter].veille-drop-target {
  outline: 2px dashed var(--vz-primary) !important;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(var(--vz-primary-rgb), 0.3);
}


/* Trame de fond + bordure gauche du bandeau intro = couleur dimension */
.sidebar-mega-panel[data-dim] .sidebar-mega-coaching {
  background: linear-gradient(135deg, rgba(var(--dim-rgb), 0.12) 0%, rgba(var(--dim-rgb), 0.04) 100%);
  border-left-color: var(--dim-color);
}
.sidebar-mega-panel[data-dim] .sidebar-mega-coaching strong {
  color: var(--dim-color);
}

/* Cadre arrondi de l'icône en haut du panel = teinte dimension */
.sidebar-mega-panel[data-dim] .sidebar-mega-emoji.dim-icon {
  background: rgba(var(--dim-rgb), 0.15);
}

/* Cadres arrondis des cards de modules disponibles = teinte dimension subtile */
.sidebar-mega-panel[data-dim] .mega-module-card:not(.coming) .mega-module-card-icon {
  background: rgba(var(--dim-rgb), 0.12);
  color: var(--dim-color);
}

/* ═══════════════════════════════════════════════════════════════
   FAVORIS BOTTOM BAR (fav-bar.kernel.js)
   Bandeau fixe en bas style taskbar Windows / dock macOS.
   Z-index 1040 = sous les modales Bootstrap (1055), au-dessus
   du reste. Masqué via .is-empty tant qu'aucun favori → la bar
   apparaît seulement au 1er ★, sans surface vide permanente.
   ═══════════════════════════════════════════════════════════════ */

#upme-fav-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 40px;
  z-index: 1040;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--vz-border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  display: flex; align-items: center;
  padding: 0 12px;
  transition: transform 0.25s ease;
}
#upme-fav-bar.is-empty {
  /* Bar masquée tant qu'aucun favori (le DOM reste, juste invisible) */
  transform: translateY(100%);
  pointer-events: none;
}

[data-layout-mode="dark"] #upme-fav-bar,
[data-bs-theme="dark"] #upme-fav-bar {
  background: rgba(33, 37, 65, 0.96);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.upme-fav-bar-inner {
  flex-grow: 1;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 0;
  scrollbar-width: thin;
  height: 100%;
}
.upme-fav-bar-inner::-webkit-scrollbar { height: 3px; }
.upme-fav-bar-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15); border-radius: 2px;
}

/* Chip favori : compacte, icône + label, padding minimal pour bar 40px de haut.
   Aucune bordure (ni au repos, ni au hover, ni active) — juste un tint de fond
   discret + le dot d'activité sous la chip pour marquer la vue courante. */
.upme-fav-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--vz-body-color);
  font-size: 12.5px; font-weight: 500;
  line-height: 1;
  transition: background 0.15s;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  font-family: inherit;
  height: 28px;
}
.upme-fav-chip:hover {
  background: rgba(var(--vz-primary-rgb), 0.08);
}
.upme-fav-chip.active {
  background: rgba(var(--vz-primary-rgb), 0.12);
}
/* Indicateur d'activité (dot dock macOS) sous la chip si vue active */
.upme-fav-chip.active::after {
  content: ''; position: absolute;
  bottom: -5px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px;
  background: var(--vz-primary);
  border-radius: 50%;
}
.upme-fav-chip i {
  font-size: 14px;
  color: var(--vz-primary);
  flex-shrink: 0;
  line-height: 1;
}

/* Badge compteur sur la chip favorite — pastille ronde à droite du label.
   Renseigné par Up.FavBar.setBadge(key, count, color) depuis les modules
   (timer / eisenhower / crm / signatures). Hidden par défaut (attribut HTML),
   apparaît dès que count > 0. */
.upme-fav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  flex-shrink: 0;
}
.upme-fav-badge[hidden] { display: none !important; }

/* Phase 9 — Items "remote" (résultats serveur SQL, pas encore en cache local).
   Aspect légèrement atténué + bordure gauche cyan pour signaler "extérieur au working-set".
   Au clic, l'item est promu en local et perd cette classe au prochain render. */
.crm-list-item-remote {
  border-left: 3px solid #0ab39c;  /* cyan Velzon -- aligné avec bg-info */
  background: rgba(10, 179, 156, 0.03);
}
.crm-list-item-remote:hover {
  background: rgba(10, 179, 156, 0.08);
}

/* ═══════════════════════════════════════════════════════════
   FIXES MOBILE 2026-05-13
   ═══════════════════════════════════════════════════════════ */

/* Focus tableau mobile : le td "titre" se contractait à 0px car style inline
   `max-width:0;width:100%` + colonnes droites prenaient toute la place.
   Solution : forcer min-width sur le td + tronquer le span à ~10 caractères
   avec ellipsis. Tooltip natif via attribut title. */
@media (max-width: 767px) {
  .tl-name-cell {
    /* override style inline max-width:0 */
    max-width: none !important;
    min-width: 180px !important;
    width: auto !important;
  }
  .tl-task-title {
    max-width: 160px !important;
    min-width: 160px !important;
    display: inline-block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }
}

/* Sidebar principale mobile : harmoniser la taille de police entre
   les items modules (Recherche, Dashboard, Finances) et les sections
   à mega menu (Intelligence — Mémoire, Décision — Stratégie, etc.).
   La racine sidebar Up-me est #navbar-nav (Velzon Bootstrap).
   Items modules = .nav-link.menu-link (Velzon default ~15-16px).
   Sections mega = .sidebar-section-header > a + .sidebar-section-name (custom Up-me ~13px).
   → Forcer les deux à 14px sur mobile pour uniformité. */
@media (max-width: 767px) {
  #navbar-nav .nav-link,
  #navbar-nav .menu-link,
  #navbar-nav .sidebar-section-header > a,
  #navbar-nav .sidebar-section-name {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }
}

/* Dashboard radars (activité + ressenti). 450px par défaut desktop,
   réduit à 280px sur mobile/tablet pour éviter le grand blanc avant
   que ApexCharts ne charge. */
.dashboard-radar {
  min-height: 450px;
}
@media (max-width: 991.98px) {
  .dashboard-radar {
    min-height: 280px !important;
  }
  /* Cartes dashboard : neutraliser les hauteurs héritées pour qu'elles
     prennent leur hauteur naturelle sur petit écran. */
  #view-dashboard .card-height-100 {
    height: auto !important;
    min-height: 0 !important;
  }
  /* BUGFIX 2026-05-13 : la dashboard-commandbar a `flex: 1` (qui force la
     commandbar à prendre toute la hauteur dispo en flex-column sur mobile).
     Résultat mesuré : 720px de hauteur au lieu de 80px → grand blanc avant
     la carte Répartition. → forcer flex: 0 0 auto pour hauteur naturelle. */
  #view-dashboard .dashboard-commandbar {
    flex: 0 0 auto !important;
  }
}

/* Couleur de l'icône = dimension d'origine, via data-dim sur la chip
   (mappées vers les variables --dim-* de la palette officielle Up-me) */
.upme-fav-chip[data-dim="intelligence_memoire"] i   { color: #c084fc; }
.upme-fav-chip[data-dim="decision_strategie"] i     { color: #facc15; }
.upme-fav-chip[data-dim="organisation_priorite"] i  { color: #4ade80; }
.upme-fav-chip[data-dim="relation_communication"] i { color: #22d3ee; }
.upme-fav-chip[data-dim="volonte_discipline"] i     { color: #3b82f6; }
.upme-fav-chip[data-dim="equilibre_emotion"] i      { color: #fb7185; }
.upme-fav-chip[data-dim="motivation_sens"] i        { color: #fb923c; }
.upme-fav-chip[data-dim="energie_vitalite"] i       { color: #eab308; }
.upme-fav-chip[data-dim="action_transverse"] i      { color: #dc2626; }

/* Drag & drop visuel */
.upme-fav-chip[draggable="true"] { cursor: grab; }
.upme-fav-chip[draggable="true"]:active { cursor: grabbing; }
.upme-fav-chip.dragging { opacity: 0.4; }
.upme-fav-chip.drop-target {
  background: rgba(var(--vz-primary-rgb), 0.22) !important;
  outline: 2px dashed var(--vz-primary);
}

/* Responsive : sur mobile (< 760px) on cache le label, icône-only.
   Le bottom-nav mobile existant pourra être progressivement migré ici. */
@media (max-width: 760px) {
  .upme-fav-chip span { display: none; }
  .upme-fav-chip { padding: 8px 10px; }
}

/* ─── ★ favoris dans le mega-menu sidebar (cf. _renderMegaCard) ─── */
.mega-module-card { position: relative; }
.mega-module-card-star {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: color 0.15s, background 0.15s, transform 0.15s;
  z-index: 2;
}
.mega-module-card-star:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--dim-color, var(--vz-primary));
  transform: scale(1.15);
}
.mega-module-card-star.is-fav { color: #facc15; }
.mega-module-card-star.is-fav:hover { color: #eab308; }

[data-layout-mode="dark"] .mega-module-card-star,
[data-bs-theme="dark"] .mega-module-card-star {
  color: rgba(255, 255, 255, 0.3);
}
[data-layout-mode="dark"] .mega-module-card-star:hover,
[data-bs-theme="dark"] .mega-module-card-star:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════
   Module Finance — mode immersion (2026-05-11)
   Top bar Up-me hidden + sidebar principal rétracté (data-sidebar-size=sm
   via ui.js) + sidebar Finance vertical à gauche + onglets horizontaux
   cachés. Cf. memory/pattern_finance_immersion.md.
   ═══════════════════════════════════════════════════════════════════ */

/* Layout 2 colonnes : sidebar + contenu */
#view-finance .fin-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
  min-height: calc(100vh - 70px);
}
#view-finance .fin-sidebar {
  flex: 0 0 240px;
  width: 240px;
  padding: 16px 12px;
  border-right: 1px solid var(--bs-border-color, #e9ebec);
  background: var(--bs-body-bg, #fff);
  position: sticky;
  top: 70px; /* sous la top bar quand non immersive */
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  /* Scrollbar fin overlay (pattern macOS) : invisible par défaut, apparaît au survol */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 200ms ease;
}
#view-finance .fin-sidebar:hover {
  scrollbar-color: var(--bs-border-color) transparent;
}
/* WebKit (Chrome / Edge / Safari) — scrollbar 4px overlay translucide */
#view-finance .fin-sidebar::-webkit-scrollbar {
  width: 4px;
}
#view-finance .fin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
#view-finance .fin-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 200ms ease;
}
#view-finance .fin-sidebar:hover::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
}
#view-finance .fin-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--bs-secondary-color);
}
#view-finance .fin-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px 28px;
}

/* Sidebar Finance — header (hamburger + titre) */
#view-finance .fin-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--bs-border-color, #e9ebec);
  margin-bottom: 12px;
}
#view-finance .fin-sidebar-header h5 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
/* Bouton hamburger : toggle main sidebar Up-me (sm ↔ lg).
   Icône change selon état (menu ↔ arrow-left) via JS. */
#view-finance .fin-sidebar-toggle-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--bs-border-color, #e9ebec);
  background: transparent;
  border-radius: 6px;
  color: var(--bs-body-color, #495057);
  flex-shrink: 0;
  transition: background-color 120ms ease;
}
#view-finance .fin-sidebar-toggle-main:hover {
  background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.05));
}
#view-finance .fin-sidebar-toggle-main i { font-size: 17px; line-height: 1; }

/* Sidebar Finance — sections (groupes) */
#view-finance .fin-sidebar-section {
  margin-bottom: 16px;
}
#view-finance .fin-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bs-secondary-color, #878a99);
  padding: 6px 12px 4px;
  margin: 0;
}

/* Sidebar Finance — items */
#view-finance .fin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--bs-body-color, #495057);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  margin: 1px 0;
  transition: background-color 120ms ease, color 120ms ease;
  position: relative;
}
#view-finance .fin-sidebar-item:hover {
  background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.04));
  color: var(--bs-body-color, #212529);
}
#view-finance .fin-sidebar-item.active {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 600;
}
#view-finance .fin-sidebar-item i {
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
#view-finance .fin-sidebar-item span {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge compteur à droite des items dynamiques */
#view-finance .fin-sidebar-badge {
  flex-shrink: 0;
  background: var(--bs-danger, #f06548);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ───────────────────────────────────────────────────────────────
   Mode immersion Finance (body.is-finance-immersive)
   - Top bar Up-me hidden
   - Onglets horizontaux Finance hidden
   - Le titre H4 dupliqué du main est hidden (sidebar a déjà le titre)
   ─────────────────────────────────────────────────────────────── */
/* ───────────────────────────────────────────────────────────────
   Mode immersion Coach v2 (body.is-coach-v2-immersive)
   - Top bar Up-me cachée (focus sur la conversation, espace intime)
   - Sidebar reste visible mais en mode sm (gérée par coach-v2.js au boot)
   - Vue plein écran pour chat + panneau mémoire évolutive
   - Pattern repris de Finance immersion.
   ─────────────────────────────────────────────────────────────── */
body.is-coach-v2-immersive #page-topbar,
body.is-coach-v2-immersive .bottom-nav,
body.is-coach-v2-immersive #upme-fav-bar,
body.is-coach-v2-immersive #status-bar,
body.is-coach-v2-immersive .floating-status-bar { display: none !important; }
body.is-coach-v2-immersive #view-coach-v2 {
  /* height fixe + overflow hidden : la vue ne déborde JAMAIS du viewport.
     Le scroll se fait à l'intérieur (chat-stream / panel-body), pas sur la vue. */
  height: 100vh;
  overflow: hidden;
  margin-top: calc(-1 * var(--vz-header-height, 70px));
  margin-left: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2);
  margin-right: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2);
}
/* Le parent direct (.page-content Velzon) ne doit pas créer de marge basse */
body.is-coach-v2-immersive .page-content { padding-bottom: 0 !important; }

/* Mode plein écran Coach v2 : cache aussi la sidebar Up-me et étend la vue */
body.is-coach-v2-fullscreen .app-menu.navbar-menu,
body.is-coach-v2-fullscreen #scrollbar { display: none !important; }
body.is-coach-v2-fullscreen .main-content,
body.is-coach-v2-fullscreen .vertical-menu-btn { margin-left: 0 !important; }
body.is-coach-v2-fullscreen #view-coach-v2 {
  margin-left: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2) !important;
  margin-right: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2) !important;
}

body.is-finance-immersive #page-topbar { display: none !important; }
body.is-finance-immersive #finance-tabs { display: none !important; }
body.is-finance-immersive #view-finance .fin-main-title { display: none; }
body.is-finance-immersive #view-finance .fin-sidebar { top: 0; max-height: 100vh; }
body.is-finance-immersive #view-finance .fin-layout {
  min-height: 100vh;
  /* Marge négative pour absorber le padding par défaut de Velzon (.page-content
     padding-top ~70px réservé top bar + ~24px horizontal). Approche scopée à
     #view-finance — protège 100% les autres vues même en cas de body class fantôme. */
  margin-top: calc(-1 * var(--vz-header-height, 70px));
  margin-left: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2);
  margin-right: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2);
}
/* .fin-main porte son propre padding défini ci-dessus (20px 28px) pour aérer
   entre le sidebar Finance et le contenu. Pas d'override container-fluid ici :
   notre règle #view-finance .fin-main bat la spécificité de .container-fluid. */

/* Dark mode */
[data-bs-theme="dark"] #view-finance .fin-sidebar { background: var(--bs-body-bg); }
[data-bs-theme="dark"] #view-finance .fin-sidebar-item.active {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

/* Responsive : sidebar collapse en mobile (< 992px) — devient overlay
   À itérer si besoin, pour l'instant on garde le sidebar visible et on
   réduit sa largeur. Bouton menu mobile à ajouter en Phase 2 si besoin. */
@media (max-width: 991.98px) {
  #view-finance .fin-sidebar {
    flex: 0 0 56px;
    width: 56px;
    padding: 12px 4px;
  }
  #view-finance .fin-sidebar-item span,
  #view-finance .fin-sidebar-title,
  #view-finance .fin-sidebar-header h5,
  #view-finance .fin-sidebar-badge { display: none; }
  #view-finance .fin-sidebar-item { justify-content: center; padding: 8px 0; }
  #view-finance .fin-sidebar-item i { font-size: 18px; width: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   Notes — scrollbars overlay fins (2026-05-11)
   Pattern macOS : 4px invisibles par défaut, apparaissent au survol.
   Cible les 2 zones scrollables : col 1 (catégories tree) + col 2
   (liste de notes via #notes-list-container).
   ═══════════════════════════════════════════════════════════════════ */
#view-notes .chat-leftsidebar,
#view-notes #notes-list-container,
#view-notes #notes-tree-container,
#view-notes #notes-editor-shell {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 200ms ease;
}
#view-notes .chat-leftsidebar:hover,
#view-notes #notes-list-container:hover,
#view-notes #notes-tree-container:hover,
#view-notes #notes-editor-shell:hover {
  scrollbar-color: var(--bs-border-color) transparent;
}
#view-notes .chat-leftsidebar::-webkit-scrollbar,
#view-notes #notes-list-container::-webkit-scrollbar,
#view-notes #notes-tree-container::-webkit-scrollbar,
#view-notes #notes-editor-shell::-webkit-scrollbar {
  width: 4px;
}
#view-notes .chat-leftsidebar::-webkit-scrollbar-track,
#view-notes #notes-list-container::-webkit-scrollbar-track,
#view-notes #notes-tree-container::-webkit-scrollbar-track,
#view-notes #notes-editor-shell::-webkit-scrollbar-track {
  background: transparent;
}
#view-notes .chat-leftsidebar::-webkit-scrollbar-thumb,
#view-notes #notes-list-container::-webkit-scrollbar-thumb,
#view-notes #notes-tree-container::-webkit-scrollbar-thumb,
#view-notes #notes-editor-shell::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 200ms ease;
}
#view-notes .chat-leftsidebar:hover::-webkit-scrollbar-thumb,
#view-notes #notes-list-container:hover::-webkit-scrollbar-thumb,
#view-notes #notes-tree-container:hover::-webkit-scrollbar-thumb,
#view-notes #notes-editor-shell:hover::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
}
#view-notes .chat-leftsidebar::-webkit-scrollbar-thumb:hover,
#view-notes #notes-list-container::-webkit-scrollbar-thumb:hover,
#view-notes #notes-tree-container::-webkit-scrollbar-thumb:hover,
#view-notes #notes-editor-shell::-webkit-scrollbar-thumb:hover {
  background: var(--bs-secondary-color);
}

/* ═══════════════════════════════════════════════════════════════════
   Finance — Légende ApexCharts (donut "Dépenses par catégorie")
   Les labels contiennent des emoji (🍔 📁 🎓 💻) qui décalent la
   baseline du texte. Sans correction, le marker rond coloré apparaît
   désaligné par rapport à son label. Le fix : forcer un layout flex
   centré sur chaque .apexcharts-legend-series, et neutraliser le
   margin-top des markers.
   ═══════════════════════════════════════════════════════════════════ */
#view-finance .apexcharts-legend-series {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  line-height: 1.4 !important;
}
#view-finance .apexcharts-legend-marker {
  margin: 0 !important;
  vertical-align: middle !important;
  flex-shrink: 0;
}
#view-finance .apexcharts-legend-text {
  vertical-align: middle !important;
  line-height: 1.4 !important;
  padding-left: 0 !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   FICHE ENTREPRISE V2 — scoping minimal (100% Velzon Bootstrap 5)
   La fiche V2 utilise les composants Velzon natifs (card, btn-soft-*, badge,
   nav-pills, progress, list-group, avatar-*, etc.). Ce bloc ne contient QUE :
   1. La grille 2 colonnes (col-fiche + col-side)
   2. La chaîne flex sticky (col-fiche-fixed + col-fiche-scroll)
   3. La structure du host (#crm-company-detail.crm-v2-host)
   4. Le toggle form compact/expanded (form-block.compact)
   5. Le tasks-block.collapsed (collapse simple)
   Tout le visuel passe par Bootstrap → dark mode automatique, cohérence Up-me garantie.
   ════════════════════════════════════════════════════════════════════════════ */
.crm-fiche-v2 {
  display: grid;
  /* Col-side resserrée (max 320, 22vw) pour donner BEAUCOUP plus d'air à col-fiche.
     Avant : col-side pouvait monter à 380 et bouffait la zone de lecture des commentaires. */
  grid-template-columns: minmax(280px, 1fr) clamp(240px, 22vw, 320px);
  height: 100%;
  overflow: hidden;
}
@media (max-width: 1199.98px) {
  /* Sous xl (1200px) : on stacke col-side sous col-fiche. La timeline prend toute la largeur,
     plus de wrap moche du titre + commentaire en colonne étroite. */
  .crm-fiche-v2 { grid-template-columns: 1fr; overflow: visible; }
}
.crm-fiche-v2 .col-fiche {
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.crm-fiche-v2 .col-fiche-fixed { flex-shrink: 0; padding: 0.75rem 0.75rem 0; }
.crm-fiche-v2 .col-fiche-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.crm-fiche-v2 .col-side {
  border-left: 1px solid var(--vz-border-color, #e9ebec);
  overflow-y: auto;
}
@media (max-width: 991.98px) {
  .crm-fiche-v2 .col-fiche,
  .crm-fiche-v2 .col-fiche-scroll,
  .crm-fiche-v2 .col-side { overflow: visible; height: auto; }
  .crm-fiche-v2 .col-side { border-left: none; border-top: 1px solid var(--vz-border-color, #e9ebec); }
}

/* Toggle compact/expanded du form Nouvelle interaction.
   .compact masque la zone étendue, expose le trigger d'une ligne. */
/* Le trigger reste TOUJOURS visible (sert de toggle re-cliquable) ; seule la zone
   form-expanded apparaît/disparaît selon la classe .compact sur form-block. */
.crm-fiche-v2 #crm-v2-form-block.compact .form-expanded { display: none; }

/* Toggle du bloc "X relances en retard" collapsed/expanded. */
.crm-fiche-v2 #crm-v2-tasks-block.collapsed .tasks-list { display: none; }

/* Score popover : positionnement absolu sous le badge score, montré au hover/click. */
.crm-fiche-v2 .score-badge-trigger:hover .score-popover,
.crm-fiche-v2 .score-popover.show { display: block !important; }

/* Min-width:0 helper pour permettre le text-truncate dans flex children. */
.crm-fiche-v2 .min-width-0 { min-width: 0; }

/* Host conteneur : hauteur calculée pour permettre la chaîne flex.
   200px ≈ topbar + tabs CRM + padding. */
#crm-company-detail.crm-v2-host {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 460px;
}
#crm-company-detail.crm-v2-host > .crm-fiche-v2 {
  flex: 1 1 auto; min-height: 0; height: auto;
}
@media (max-width: 991.98px) {
  #crm-company-detail.crm-v2-host {
    height: auto; min-height: 0; overflow: visible !important;
  }
  #crm-company-detail.crm-v2-host > .crm-fiche-v2 { overflow: visible; }
}

/* Col 1 (file de prospection) : chaîne flex identique à col 2 pour scroll sticky.
   La .card existante d'Up-me reste, on rend la zone scrollable interne. */
/* Tabs CRM : forcer 1 seule ligne avec scroll horizontal invisible plutôt
   qu'un wrap moche en 2 lignes (cf "Stats Email" qui sautait à 1366 et
   poussait le contenu vers le bas). Le scroll est masqué visuellement
   mais l'user peut scroller via shift+wheel ou drag tactile. */
#crm-tabs {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
#crm-tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari */
#crm-tabs .nav-item,
#crm-tabs .nav-link { flex-shrink: 0; white-space: nowrap; }
#crm-col-companies-list.crm-v2-list-host .card-header { display: none; }
/* Hauteur de la file de prospection : offset réduit (200 → 130) pour utiliser
   l'espace réellement disponible. À 1366×768 avec tabs wrap, l'ancien calc
   laissait ~500px de card visible alors qu'on peut tenir 640px sans rogner
   sur les zones critiques (top bar Up-me 70px + tabs CRM ~60px). Gain :
   ~50% de fiches visibles d'un coup. */
#crm-col-companies-list.crm-v2-list-host > .card {
  height: calc(100vh - 130px);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: 540px;
}
/* WHY flex-basis: 0% (et pas auto) : avec basis: auto, le card-body démarre
   à sa hauteur naturelle (somme des enfants) et `flex-grow: 1` n'agit que
   sur l'espace RESTANT. Résultat : sur certains layouts, le card-body restait
   à 575px alors que la card faisait 725px → 150px gaspillés en bas (zone
   blanche observée sur la file de prospection). basis: 0 force le démarrage
   à 0 et le grow remplit tout l'espace disponible. */
#crm-col-companies-list.crm-v2-list-host #crm-companies-list {
  flex: 1 1 0%; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
#crm-col-companies-list.crm-v2-list-host .crm-v2-list-head { flex-shrink: 0; }
#crm-col-companies-list.crm-v2-list-host .crm-v2-list-items { flex: 1; overflow-y: auto; min-height: 0; }
#crm-col-companies-list.crm-v2-list-host .crm-v2-list-footer { flex-shrink: 0; }
#crm-col-companies-list.crm-v2-list-host .crm-v2-list-batch-toolbar { flex-shrink: 0; }
/* Écrans encore plus courts (< 700px viewport) : on bascule en hauteur auto
   pour laisser la page scroller naturellement plutôt que d'écraser la liste. */
@media (max-height: 700px) {
  #crm-col-companies-list.crm-v2-list-host > .card { min-height: 460px; }
}
@media (max-width: 991.98px) {
  #crm-col-companies-list.crm-v2-list-host > .card { height: auto; min-height: 0; overflow: visible; }
  #crm-col-companies-list.crm-v2-list-host #crm-companies-list { overflow: visible; }
}

/* Tabs fiche V2 (Timeline · Contacts · Deals) : placés sous le pipeline dans la zone
   fixe. nav-tabs-custom Velzon natif, juste un peu plus compacts. */
.crm-fiche-v2 .crm-v2-fiche-tabs {
  border-bottom: 1px solid var(--vz-border-color, #e9ebec);
}
.crm-fiche-v2 .crm-v2-fiche-tab {
  border: 0;
  background: transparent;
  color: var(--vz-secondary, #878a99);
  font-weight: 500;
}
.crm-fiche-v2 .crm-v2-fiche-tab:hover {
  color: var(--vz-primary, #405189);
}
.crm-fiche-v2 .crm-v2-fiche-tab.active {
  color: var(--vz-primary, #405189);
  font-weight: 700;
  border-bottom: 2px solid var(--vz-primary, #405189);
  margin-bottom: -1px;
}

/* Side-cards cliquables (lien vers tabs) : feedback hover discret. */
.crm-fiche-v2 [data-v2-side-link] {
  transition: border-color .12s, box-shadow .12s;
}
.crm-fiche-v2 [data-v2-side-link]:hover {
  border-color: var(--vz-primary, #405189);
}

/* Pipeline stepper Velzon natif : progress bar fine + labels cliquables sous chaque
   segment. Pattern sobre, cohérent avec le reste de l'app. Step actif en gras coloré
   selon le stage (primary / success / danger), steps passés en primary, futurs muted. */
.crm-fiche-v2 .pipeline-stepper .stepper-step {
  flex: 1 1 0;
  text-align: center;
  color: var(--vz-secondary, #878a99);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color .12s;
  padding: 2px 4px;
}
.crm-fiche-v2 .pipeline-stepper .stepper-step:hover {
  color: var(--vz-body-color, #495057);
}
.crm-fiche-v2 .pipeline-stepper .stepper-step.is-active {
  font-weight: 700;
}

/* Colonnes 1 (file de prospection) et 2 (fiche) COLLÉES : zéro gutter Bootstrap.
   On annule la variable --bs-gutter-x du .row parent du panel companies. */
#crm-panel-companies > .row {
  --bs-gutter-x: 0;
  margin-right: 0;
  margin-left: 0;
}
#crm-panel-companies > .row > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}
/* Fond Up-me sur la zone CRM — 100% variables Velzon natives.
   --vz-body-bg vaut #f3f3f9 en clair, #1a1d21 en dark → dark mode automatique.
   !important nécessaire UNIQUEMENT pour gagner contre body{background:transparent !important}
   imposé par bootstrap.min.css de Velzon (sinon la cascade naturelle suffirait). */
/* Fond gris pâle de la zone CRM — 100% tokens Up-me natifs.
   Up-me redéfinit --vz-body-bg = blanc et --vz-secondary-bg = gris pâle
   (inverse du Velzon natif) dans core-kernel/css/tokens.css.
   Donc on utilise --up-color-bg-subtle (= #f9fafb clair, #131826 dark) pour
   le fond, et --up-color-bg (= #ffffff clair, #0a0e1a dark) pour les cards.
   Dark mode automatique, 0% hardcoded. */
.crm-fiche-v2,
.crm-fiche-v2 .col-fiche-scroll,
.crm-fiche-v2 .col-side,
#crm-col-companies-list,
#crm-panel-companies {
  background-color: var(--up-color-bg) !important;
}
/* Padding réduit (12px → 4px) pour gagner ~16px de largeur utile
   sur la liste de prospection. */
#crm-panel-companies {
  padding: 4px;
  border-radius: 8px;
}
/* Largeur de la file de prospection : 18% (compact list view).
   La fiche entreprise prend 82% pour avoir la lecture confortable du détail.
   Les cards ont été densifiées (police réduite fs-12 nom, fs-10 status/urgence)
   pour rester lisibles à cette largeur étroite (cf .crm-v2-list-row plus bas). */
@media (min-width: 992px) {
  #crm-panel-companies > .row > #crm-col-companies-list.col-lg-3 {
    flex: 0 0 18%;
    max-width: 18%;
  }
  #crm-panel-companies > .row > #crm-col-companies-detail.col-lg-9 {
    flex: 0 0 82%;
    max-width: 82%;
  }
}
/* Densification typo des cards de la file (compatible 18% de largeur).
   Tailles ajustées : nom 12px (vs 13), badges/urgence 10px (vs 11). */
#crm-col-companies-list .crm-v2-list-row .fw-medium { font-size: 12px !important; }
#crm-col-companies-list .crm-v2-list-row .badge { font-size: 9px !important; padding: 1px 4px !important; }
#crm-col-companies-list .crm-v2-list-row small { font-size: 10px !important; }
/* Cards CRM : couleur cards/contenu Up-me natif. Dark mode automatique. */
#crm-panel-companies .card {
  background-color: var(--up-color-bg-subtle) !important;
}

/* Mini-cards Faits : fond blanc explicite (sans border, retiré du HTML) */
.crm-fiche-v2 .fact-cell {
  background-color: var(--up-color-bg-subtle);
}

/* Blocs col-side V2 : titre H6 indépendant + card avec body uniquement.
   Échelle typo stricte 2026-05-15 (synthèse 3 agents) :
   - Titres de cards latérales : 11px uppercase letter-spacing 0.5px → "label section"
   - Le tout en text-muted pour ne pas concurrencer le contenu */
.crm-fiche-v2 .col-side .crm-v2-side-header {
  margin-bottom: 6px;
}
.crm-fiche-v2 .col-side .crm-v2-side-header h6 {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vz-secondary, #878a99) !important;
  font-weight: 600;
}
/* Échelle typographique fiche V2 (axe 1 = identité, axe 2 = titres section, axe 3 = contenu, axe 4 = meta) */
.crm-fiche-v2 .fiche-id-line-1 .crm-inline-edit-name {
  font-size: 20px !important;
  font-weight: 700;
  line-height: 1.2;
}
.crm-fiche-v2 .col-side .ct-card-name,
.crm-fiche-v2 .col-side .mini-contact-name {
  font-size: 14px;
  font-weight: 600;
}
.crm-fiche-v2 .col-side .ct-card-position,
.crm-fiche-v2 .col-side .mini-contact-pos {
  font-size: 12px;
  color: var(--vz-secondary, #878a99);
}
/* Deal stale (sans contact > 14j) : bordure gauche rouge subtile signalant l'urgence */
.crm-fiche-v2 .col-side .crm-deal-stale {
  border-left: 3px solid var(--vz-danger, #f06548);
  padding-left: 8px !important;
}
.crm-fiche-v2 .col-side [data-v2-side-link] .card {
  cursor: pointer;
  transition: box-shadow .12s;
}
.crm-fiche-v2 .col-side [data-v2-side-link] .card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Séparateur vertical fin entre col 1 (file) et col 2 (fiche) : remplace le gutter
   Bootstrap supprimé. 1px gris-bleu Velzon, discret mais marque la frontière. */
#crm-panel-companies > .row > #crm-col-companies-list {
  border-right: 1px solid var(--vz-border-color, #e9ebec);
}
/* Mode immersif : la zone parent doit aussi avoir le fond gris pâle puisqu'on
   cache les barres Up-me autour. Sinon = blanc plat. */
body.crm-v2-immersive .page-content,
body.crm-v2-immersive #crm-panel-companies {
  background: var(--vz-body-bg, #f3f3f9);
}

/* Scrollbars fines + invisibles par défaut (pattern overlay macOS). Apparaissent
   seulement au hover du conteneur scrollable. WebKit + Firefox. Appliqué aux
   zones de scroll de la fiche V2 et de la file de prospection. */
.crm-fiche-v2 .col-fiche-scroll,
.crm-fiche-v2 .col-side,
#crm-col-companies-list #crm-companies-list,
#crm-col-companies-list .crm-v2-list-items {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.crm-fiche-v2 .col-fiche-scroll::-webkit-scrollbar,
.crm-fiche-v2 .col-side::-webkit-scrollbar,
#crm-col-companies-list #crm-companies-list::-webkit-scrollbar,
#crm-col-companies-list .crm-v2-list-items::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.crm-fiche-v2 .col-fiche-scroll::-webkit-scrollbar-track,
.crm-fiche-v2 .col-side::-webkit-scrollbar-track,
#crm-col-companies-list #crm-companies-list::-webkit-scrollbar-track,
#crm-col-companies-list .crm-v2-list-items::-webkit-scrollbar-track {
  background: transparent;
}
.crm-fiche-v2 .col-fiche-scroll::-webkit-scrollbar-thumb,
.crm-fiche-v2 .col-side::-webkit-scrollbar-thumb,
#crm-col-companies-list #crm-companies-list::-webkit-scrollbar-thumb,
#crm-col-companies-list .crm-v2-list-items::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background .15s;
}
.crm-fiche-v2 .col-fiche-scroll:hover::-webkit-scrollbar-thumb,
.crm-fiche-v2 .col-side:hover::-webkit-scrollbar-thumb,
#crm-col-companies-list #crm-companies-list:hover::-webkit-scrollbar-thumb,
#crm-col-companies-list .crm-v2-list-items:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.18);
}
.crm-fiche-v2 .col-fiche-scroll:hover,
.crm-fiche-v2 .col-side:hover,
#crm-col-companies-list #crm-companies-list:hover,
#crm-col-companies-list .crm-v2-list-items:hover {
  scrollbar-color: rgba(0,0,0,.18) transparent;
}

/* Filtrage timeline + filtrage liste prospects via attributs body */
body[data-crm-v2-filter="chaud"] .crm-v2-list-item:not([data-status="chaud"]) { display: none; }
body[data-crm-v2-filter="overdue"] .crm-v2-list-item:not([data-urgency="overdue"]) { display: none; }
body[data-crm-v2-filter="today"] .crm-v2-list-item:not([data-urgency="today"]) { display: none; }
body[data-crm-v2-filter="client"] .crm-v2-list-item:not([data-status="client"]) { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   CONFLIT .btn-icon — flowos-components.css (Pomodoro timer) redéfinit .btn-icon
   globalement avec color:#fff + background blanc transparent (visible sur fond
   foncé du timer, INVISIBLE sur fond blanc des cards V2). On override dans le
   scope .crm-fiche-v2 pour restaurer le comportement Velzon natif : couleur et
   bg pilotés par les variables --vz-btn-* (définies par btn-ghost-*, btn-soft-*,
   btn-warning, etc.). Spécificité .crm-fiche-v2 .btn-icon (0.2.0) > .btn-icon
   (0.1.0) + flowos-overrides.css chargé après → gagne la cascade proprement.
   ════════════════════════════════════════════════════════════════════════════ */
.crm-fiche-v2 .btn-icon {
  width: calc(1rem + 1.5em + 2px);
  height: calc(1rem + 1.5em + 2px);
  border: 1px solid var(--vz-btn-border-color, transparent);
  background: var(--vz-btn-bg, transparent);
  color: var(--vz-btn-color, inherit);
  border-radius: var(--vz-btn-border-radius, 0.25rem);
  font-size: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.crm-fiche-v2 .btn-icon.btn-sm {
  width: calc(.5rem + 1.5em + 2px);
  height: calc(.5rem + 1.5em + 2px);
}
.crm-fiche-v2 .btn-icon:hover {
  background: var(--vz-btn-hover-bg, var(--vz-btn-bg, transparent));
  color: var(--vz-btn-hover-color, var(--vz-btn-color, inherit));
  border-color: var(--vz-btn-hover-border-color, transparent);
}

/* Recherche timeline expandable inline : pattern Velzon search-box-expand.
   Input width:0 + opacity:0 au repos (occupe pas la ligne), à droite la loupe seule visible.
   Au clic loupe → .expanded ajoutée : input s'étire à 200px à GAUCHE de la loupe.
   Transition douce pour rendre l'expansion lisible. */
.crm-fiche-v2 .hist-search-expand {
  display: flex;
  align-items: center;
}
.crm-fiche-v2 .hist-search-expand #crm-v2-timeline-search {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  border-color: transparent;
  background: var(--vz-secondary-bg);
  transition: width .22s ease, opacity .22s ease, padding .22s ease, border-color .22s ease;
}
.crm-fiche-v2 .hist-search-expand.expanded #crm-v2-timeline-search {
  width: 200px;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  opacity: 1;
  border-color: var(--vz-border-color);
  margin-right: 4px;
}

/* Next Best Action (NBA) : recommandation IA en hero du panneau droit.
   Bordure gauche colorée selon urgence. Skeleton animé en loading.
   Tout est scopé .crm-fiche-v2 pour éviter tout effet de bord. */
.crm-fiche-v2 .crm-v2-nba-item {
  border-left: 3px solid var(--vz-info);
  padding-left: 10px;
  transition: border-color .2s ease;
}
.crm-fiche-v2 .crm-v2-nba-haute { border-left-color: var(--vz-danger); }
.crm-fiche-v2 .crm-v2-nba-moyenne { border-left-color: var(--vz-warning); }
.crm-fiche-v2 .crm-v2-nba-basse { border-left-color: var(--vz-info); }

.crm-fiche-v2 .crm-v2-nba-action {
  line-height: 1.35;
  word-break: break-word;
}
.crm-fiche-v2 .crm-v2-nba-reason {
  line-height: 1.4;
  margin-bottom: 0;
}

.crm-fiche-v2 .crm-v2-nba-badge-haute   { background: var(--vz-danger-bg-subtle, #fde2dd); color: var(--vz-danger, #f06548); }
.crm-fiche-v2 .crm-v2-nba-badge-moyenne { background: var(--vz-warning-bg-subtle, #fef0d4); color: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .crm-v2-nba-badge-basse   { background: var(--vz-info-bg-subtle, #d8e8f7); color: var(--vz-info, #299cdb); }

/* Skeleton de chargement : 3 lignes pulsent. Background neutre via tokens Up-me
   (cf design_system_tokens_upme.md : --vz-secondary-bg = gris pâle dans Up-me). */
.crm-fiche-v2 .crm-v2-nba-skeleton .sk-line {
  height: 10px;
  background: linear-gradient(90deg, var(--vz-secondary-bg) 0%, var(--vz-border-color) 50%, var(--vz-secondary-bg) 100%);
  background-size: 200% 100%;
  border-radius: 3px;
  margin-bottom: 6px;
  animation: nba-skel 1.4s ease-in-out infinite;
}
.crm-fiche-v2 .crm-v2-nba-skeleton .sk-line:last-child { margin-bottom: 0; }
@keyframes nba-skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Bouton Régénérer : icône qui tourne au hover, pas à l'arrêt (signal d'action) */
.crm-fiche-v2 .crm-v2-nba-refresh:hover i.ri-refresh-line {
  transform: rotate(180deg);
  transition: transform .35s ease;
}

/* Mode "fiche pleine largeur" : bouton expand → cache la file de prospection,
   col 2 (fiche) prend 100% du parent .row. Toggle via .is-fiche-fullwidth sur
   #crm-panel-companies. Réversible : retirer la classe restaure les 2 colonnes. */
#crm-panel-companies.is-fiche-fullwidth #crm-col-companies-list {
  display: none;
}
#crm-panel-companies.is-fiche-fullwidth #crm-col-companies-detail {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Mode IMMERSIF : cache toute l'enveloppe Up-me (topbar, sidebar, tabs CRM,
   fav-bar) pour donner la totalité de l'écran à la fiche entreprise.
   Activé via body.crm-v2-immersive en parallèle de is-fiche-fullwidth.
   Le bouton expand + raccourci ⌘\ + Échap permettent de sortir.
   Aussi : un clic sur n'importe quel onglet CRM sort du mode (cf crm.js bind). */
body.crm-v2-immersive #page-topbar { display: none !important; }
body.crm-v2-immersive .app-menu { display: none !important; }
body.crm-v2-immersive .main-content { margin-left: 0 !important; }
body.crm-v2-immersive .page-content { padding-top: 0 !important; padding-bottom: 0 !important; }
body.crm-v2-immersive #crm-kpis { display: none !important; }
body.crm-v2-immersive #upme-fav-bar { display: none !important; }
/* La fiche prend toute la hauteur viewport sans réservations pour topbar/tabs */
body.crm-v2-immersive #crm-company-detail.crm-v2-host {
  height: 100vh !important;
  min-height: 100vh !important;
}
/* Icône fullwidth : expand par défaut, exit quand le panel est en mode fullwidth */
.crm-v2-fullwidth-toggle .crm-v2-fw-collapse-icon { display: none; }
#crm-panel-companies.is-fiche-fullwidth .crm-v2-fullwidth-toggle .crm-v2-fw-expand-icon { display: none; }
#crm-panel-companies.is-fiche-fullwidth .crm-v2-fullwidth-toggle .crm-v2-fw-collapse-icon { display: inline-block; }

/* ════════════════════════════════════════════════════════════════════════════
   CARTE D'IDENTITÉ — 3 lignes alignées gauche, pas d'indent en cascade.
   L1 : favicon inline + nom + lien site + position + actions (à droite)
   L2 : ville · activité · effectif (icônes muted, démarre bord gauche)
   L3 : badge score · dernier contact (démarre bord gauche)
   ════════════════════════════════════════════════════════════════════════════ */
.crm-fiche-v2 .fiche-id-favicon {
  width: 22px; height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--vz-light, #f3f6f9);
}
.crm-fiche-v2 .fiche-id-fallback {
  width: 22px; height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}
.crm-fiche-v2 .fiche-id-website {
  font-size: 12.5px;
  color: var(--vz-primary, #405189);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}
.crm-fiche-v2 .fiche-id-website:hover {
  text-decoration: underline;
  color: var(--vz-primary, #405189);
}
.crm-fiche-v2 .fiche-id-line-2,
.crm-fiche-v2 .fiche-id-line-3 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--vz-secondary, #878a99);
}
.crm-fiche-v2 .fiche-id-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crm-fiche-v2 .fiche-id-item i {
  font-size: 14px;
  opacity: 0.85;
}
.crm-fiche-v2 .fiche-id-sep {
  color: var(--vz-secondary, #878a99);
  opacity: 0.5;
}
/* Mini-popover de confirmation in-place (remplace les confirm() natifs).
   Positionné en JS sous le bouton qui l'a déclenché. z-index élevé pour passer
   au-dessus des modales Bootstrap (qui sont à 1055). */
.crm-confirm-popover {
  position: absolute;
  z-index: 10600;
  background: #fff;
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  padding: 10px 12px;
  min-width: 200px;
  max-width: 280px;
  font-size: 13px;
}
.crm-confirm-popover .crm-confirm-msg {
  margin-bottom: 8px;
  color: #495057;
}
.crm-confirm-popover .crm-confirm-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.crm-confirm-popover .crm-confirm-actions .btn {
  padding: 3px 10px;
  font-size: 12px;
}

/* ════════════════════════════════════════════════════════════════════════════
   VUE CONTACTS Phase 2 — groupage par fonction (Direction · Décideurs · Influents
   · Opérationnels). Pills résumé en haut + groupes en grille de cards.
   ════════════════════════════════════════════════════════════════════════════ */
.crm-fiche-v2 .crm-v2-contacts-summary {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.crm-fiche-v2 .crm-v2-contact-pill {
  padding: 5px 12px; border-radius: 999px;
  background: #fff;
  border: 1px solid var(--vz-border-color, #e9ebec);
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.crm-fiche-v2 .crm-v2-contact-pill strong { font-size: 13px; }
.crm-fiche-v2 .crm-v2-contact-pill.alert { border-color: var(--vz-danger, #f06548); color: var(--vz-danger, #f06548); background: #fde8e4; }
.crm-fiche-v2 .crm-v2-contact-pill.boost { border-color: var(--vz-success, #0ab39c); color: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .crm-v2-contact-pill.block { border-color: var(--vz-danger, #f06548); color: var(--vz-danger, #f06548); }

/* Couleurs par fonction (cohérence avec le labo) */
.crm-fiche-v2 .ri-circle-fill.fn-direction     { color: #6559cc; font-size: 9px; }
.crm-fiche-v2 .ri-circle-fill.fn-deciders      { color: var(--vz-success, #0ab39c); font-size: 9px; }
.crm-fiche-v2 .ri-circle-fill.fn-influents     { color: var(--vz-info, #299cdb); font-size: 9px; }
.crm-fiche-v2 .ri-circle-fill.fn-operationnels { color: var(--vz-warning, #f7b84b); font-size: 9px; }

.crm-fiche-v2 .crm-v2-contacts-group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: #495057;
  margin-bottom: 8px;
}
.crm-fiche-v2 .crm-v2-contacts-group-title .group-count {
  background: var(--vz-light, #f3f6f9); border-radius: 10px;
  padding: 2px 8px; font-size: 11px; color: var(--vz-secondary, #878a99); font-weight: 600;
}
/* Grid layout uniquement en mode cards (en mode rows c'est un <tbody> qui doit
   garder display:table-row-group natif pour que le tableau Velzon fonctionne). */
.crm-fiche-v2 .crm-v2-contacts-tab.view-cards .crm-v2-contacts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 8px;
}

/* Cards contacts dans le tab Contacts — 100% Velzon natif (.card + .card-body).
   On override seulement le hover (border-color au survol) ; le fond, l'ombre,
   le border-radius natif et le bg blanc sont gérés par Velzon + l'override
   global #crm-panel-companies .card. */
.crm-fiche-v2 .crm-v2-contacts-tab .card {
  transition: border-color .12s;
}
.crm-fiche-v2 .crm-v2-contacts-tab .card:hover {
  border-color: var(--vz-primary, #405189);
}
.crm-fiche-v2 .ct-card-role {
  position: absolute; top: 8px; right: 8px;
  font-size: 9.5px; padding: 1px 7px; border-radius: 999px;
  font-weight: 700; letter-spacing: .3px;
}
.crm-fiche-v2 .ct-card-role.booster { background: #d1f4ed; color: #0c9d87; }
.crm-fiche-v2 .ct-card-role.blocker { background: #fde8e4; color: var(--vz-danger, #f06548); }
.crm-fiche-v2 .ct-card-top { display: flex; align-items: flex-start; gap: 8px; }
.crm-fiche-v2 .ct-card-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--vz-primary, #405189); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.crm-fiche-v2 .ct-card-avatar.eng-high { background: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .ct-card-avatar.eng-mid  { background: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .ct-card-avatar.eng-low  { background: #c5c5cb; }
.crm-fiche-v2 .ct-card-info { flex: 1; min-width: 0; }
.crm-fiche-v2 .ct-card-name { font-size: 13px; font-weight: 700; }
.crm-fiche-v2 .ct-card-position { font-size: 11.5px; color: var(--vz-secondary, #878a99); }

.crm-fiche-v2 .ct-card-engagement {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 11px;
}
.crm-fiche-v2 .ct-card-engagement .lbl { color: var(--vz-secondary, #878a99); font-size: 10.5px; }
.crm-fiche-v2 .ct-card-engagement .bar {
  flex: 1; height: 3px; background: var(--vz-light, #f3f6f9);
  border-radius: 2px; overflow: hidden; max-width: 100px;
}
.crm-fiche-v2 .ct-card-engagement .bar-fill { height: 100%; }
.crm-fiche-v2 .ct-card-engagement .bar-fill.eng-high { background: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .ct-card-engagement .bar-fill.eng-mid  { background: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .ct-card-engagement .bar-fill.eng-low  { background: var(--vz-danger, #f06548); }
.crm-fiche-v2 .ct-card-engagement .val.eng-high { color: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .ct-card-engagement .val.eng-mid  { color: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .ct-card-engagement .val.eng-low  { color: var(--vz-danger, #f06548); }

.crm-fiche-v2 .ct-card-meta {
  margin-top: 6px; font-size: 11px; color: var(--vz-secondary, #878a99);
  display: flex; gap: 12px;
}
.crm-fiche-v2 .ct-card-meta .overdue { color: var(--vz-danger, #f06548); font-weight: 600; }

.crm-fiche-v2 .ct-card-actions {
  display: flex; gap: 4px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--vz-light, #f3f6f9);
}
.crm-fiche-v2 .ct-card-actions .ct-act {
  background: transparent; border: 1px solid transparent;
  padding: 3px 8px; border-radius: 4px; cursor: pointer;
  font-size: 11px; color: #5b5d6b;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .12s, color .12s;
}
.crm-fiche-v2 .ct-card-actions .ct-act:hover { background: var(--vz-light, #f3f6f9); color: #212529; }
.crm-fiche-v2 .ct-card-actions .ct-act-primary {
  margin-left: auto; background: var(--vz-primary, #405189); color: #fff;
  padding: 4px 10px; font-weight: 500;
}
.crm-fiche-v2 .ct-card-actions .ct-act-primary:hover {
  background: #2c3a64; color: #fff;
}

/* Vue rows : table Velzon dense + régularité parfaite (synthèse 2 agents 2026-05-15).
   1 ligne = 1 personne. Placeholders "—" pour les vides. Recence colorée = signal d'action.
   Pattern Linear/Notion : actions discrètes au repos, visibles au hover. */
.crm-fiche-v2 .crm-v2-contacts-rows-table {
  --vz-table-bg: transparent;
  width: 100%;
  table-layout: auto;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table tr { height: 52px; }
.crm-fiche-v2 .crm-v2-contacts-rows-table td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--up-color-bg-muted);
}
/* Colonnes système : drag, checkbox, avatar — centrées, largeur fixe */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-col-drag,
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-col-check,
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-col-avatar {
  text-align: center; padding-left: 6px; padding-right: 6px;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-col-drag { width: 28px; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-col-check { width: 32px; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-col-avatar { width: 44px; }
/* Cellule nom : flex prioritaire, role en second plan avec séparateur visuel */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-name {
  min-width: 180px; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-name .name {
  font-weight: 600;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-name .role {
  font-size: 12px; color: var(--vz-secondary, #878a99);
  margin-left: 8px; padding-left: 8px;
  border-left: 1px solid var(--up-color-bg-strong);
}
/* Colonnes email + téléphone : texte cliquable, icône + valeur */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-email,
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-phone {
  min-width: 150px; max-width: 220px;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-email a,
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-phone a {
  color: var(--vz-body-color, #495057);
  font-size: 13px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-email a:hover,
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-phone a:hover {
  color: var(--vz-primary, #405189); text-decoration: underline;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-email a i,
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-phone a i {
  color: var(--vz-secondary, #878a99);
  font-size: 14px; flex-shrink: 0;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-email a span {
  overflow: hidden; text-overflow: ellipsis;
}
/* Placeholder universel pour cellules vides (régularité) */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-empty {
  color: var(--vz-secondary, #878a99); opacity: 0.45; font-weight: 400;
}
/* Engagement : neutre à 0%, signal coloré quand renseigné */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-engagement { width: 140px; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .val {
  font-size: 12px; font-weight: 600;
  color: var(--vz-body-color, #495057);
  min-width: 28px; text-align: right;
}
/* Meta = recence colorée (signal d'action principal) */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-meta {
  width: 130px; font-size: 12px;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-meta i {
  margin-right: 4px;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .recence-fresh { color: var(--vz-success, #0ab39c); font-weight: 600; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .recence-warn  { color: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .recence-old   { color: var(--vz-danger, #f06548); font-weight: 600; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .recence-never { color: var(--vz-secondary, #878a99); opacity: 0.7; }
/* Actions : 3 boutons même poids, révélés au hover row */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-actions {
  width: 130px; text-align: right; padding-right: 12px;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-actions .btn {
  width: 30px; height: 30px; padding: 0; margin-left: 2px;
  opacity: 0.5; transition: opacity .12s;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table tr:hover .ct-row-actions .btn { opacity: 1; }
/* Pastille role booster/blocker sur l'avatar */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-card-avatar { position: relative; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .role-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--up-color-bg-subtle, #fff);
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .role-dot.booster { background: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .role-dot.blocker { background: var(--vz-danger, #f06548); }
/* Cellule nom : truncate sur une ligne, prend tout l'espace restant. */
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-row-name {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Toutes les lignes : forcer une seule ligne (pas de wrap dans aucune cellule) */
.crm-fiche-v2 .crm-v2-contacts-rows-table tr td {
  white-space: nowrap;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-card-avatar {
  width: 28px; height: 28px; font-size: 11px;
  border-radius: 50%;
  background: var(--vz-primary, #405189); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-card-avatar.eng-high { background: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-card-avatar.eng-mid  { background: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .ct-card-avatar.eng-low  { background: #c5c5cb; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .bar {
  height: 5px;
  background: var(--up-color-bg-strong, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}
/* Hauteur régulière pour toutes les lignes */
.crm-fiche-v2 .crm-v2-contacts-rows-table tr {
  height: 48px;
}
.crm-fiche-v2 .crm-v2-contacts-rows-table .bar-fill { height: 100%; }
.crm-fiche-v2 .crm-v2-contacts-rows-table .bar-fill.eng-high { background: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .bar-fill.eng-mid  { background: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .bar-fill.eng-low  { background: var(--vz-danger, #f06548); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .val.eng-high { color: var(--vz-success, #0ab39c); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .val.eng-mid  { color: var(--vz-warning, #f7b84b); }
.crm-fiche-v2 .crm-v2-contacts-rows-table .val.eng-low  { color: var(--vz-danger, #f06548); }

/* Drag-and-drop : cible .card (mode cards) OU .crm-v2-contact-row (mode rows) */
.crm-fiche-v2 .crm-v2-contacts-tab .card,
.crm-fiche-v2 .crm-v2-contact-row { cursor: grab; }
.crm-fiche-v2 .crm-v2-contacts-tab .card:active,
.crm-fiche-v2 .crm-v2-contact-row:active { cursor: grabbing; }
.crm-fiche-v2 .crm-v2-contacts-tab .card.sortable-ghost,
.crm-fiche-v2 .crm-v2-contact-row.sortable-ghost {
  opacity: 0.4;
  background: var(--vz-primary-bg-subtle, #e2e5ed) !important;
}
.crm-fiche-v2 .crm-v2-contacts-tab .card.sortable-chosen,
.crm-fiche-v2 .crm-v2-contact-row.sortable-chosen {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* Zone drop vide (mode cards uniquement — en mode rows un <tbody> vide reste dropable) */
.crm-fiche-v2 .crm-v2-contacts-tab.view-cards .crm-v2-contacts-grid.is-empty {
  min-height: 60px;
  border: 1px dashed var(--vz-border-color, #e9ebec);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crm-fiche-v2 .crm-v2-contacts-tab.view-cards .crm-v2-contacts-grid.is-empty::before {
  content: '·';
  color: var(--vz-secondary, #878a99);
  font-size: 11px;
  opacity: 0.5;
}

/* Item ligne 2 cliquable (ex: localisation → modale carte) */
.crm-fiche-v2 .fiche-id-item-clickable {
  color: var(--vz-secondary, #878a99);
  text-decoration: none;
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 4px;
  margin: -1px -4px;
  transition: background .12s, color .12s;
}
.crm-fiche-v2 .fiche-id-item-clickable:hover {
  background: var(--vz-light, #f3f6f9);
  color: var(--vz-primary, #405189);
}

/* ════════════════════════════════════════════════════════════════
   PHASES 1-2 (2026-06-14) — Ambiance Up·me : fond vivant + verre + palette.
   Valeurs reprises VERBATIM du modèle (design_handoff_upme_velzon : maquette
   « Design System SaaS » l.27-31/56 + upme-velzon-theme.css). Reskin, pas
   réécriture. Les tokens (--vz-card-bg verre, neutres, rayons) sont dans
   core-kernel/css/tokens.css.
   ════════════════════════════════════════════════════════════════ */

/* — FOND VIVANT léger (CSS only). Le HTML pose <div class="upme-bg"><div class="grid">.
     Three.js complet réservé au Cockpit. Conteneurs rendus transparents pour que
     les auroras transparaissent derrière le contenu (cartes en verre). */
.upme-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: #FAFAFA; }
.upme-bg::before, .upme-bg::after { content: ""; position: absolute; border-radius: 50%; filter: blur(180px); }
.upme-bg::before { width: 65vw; height: 65vw; background: var(--up-aurora-1); top: -10vw; left: 30vw; opacity: .30; animation: upmeDrift1 75s ease-in-out infinite, upmePulse1 14s ease-in-out infinite; }
.upme-bg::after  { width: 55vw; height: 55vw; background: var(--up-aurora-2); bottom: -10vw; left: -5vw; opacity: .28; animation: upmeDrift2 90s ease-in-out infinite, upmePulse2 18s ease-in-out infinite; }
.upme-bg > .grid { position: absolute; inset: 0; opacity: .6;
  background-image: linear-gradient(rgba(120,110,170,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(120,110,170,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000, transparent 85%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000, transparent 85%); }
@keyframes upmeDrift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-6vw,8vh)} }
@keyframes upmeDrift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(5vw,-5vh)} }
@keyframes upmePulse1 { 0%,100%{opacity:.32} 50%{opacity:.42} }
@keyframes upmePulse2 { 0%,100%{opacity:.38} 50%{opacity:.46} }
@media (prefers-reduced-motion: reduce){ .upme-bg::before,.upme-bg::after{ animation: none; } }

/* conteneurs transparents → le fond vivant transparaît derrière le contenu */
body.flowos-ui-v2,
body.flowos-ui-v2 #app-container,
body.flowos-ui-v2 #layout-wrapper,
body.flowos-ui-v2 .main-content,
body.flowos-ui-v2 .page-content { background: transparent; }

/* — CARTES EN VERRE. Bootstrap pose le fond carte via --bs-card-bg/--vz-secondary-bg
     (blanc solide), PAS --vz-card-bg → on force explicitement le verre ici (cette
     règle charge après bootstrap/app.min → gagne sur l'égalité, sans !important). */
.card {
  /* Bootstrap redéfinit --vz-card-bg:#fff LOCALEMENT sur .card (shadow du :root) →
     on le redéfinit ICI, sur .card, pour imposer le verre (sinon var() relit le #fff local). */
  --vz-card-bg: rgba(255,255,255,.62);
  background: var(--vz-card-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
          backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: var(--vz-box-shadow), inset 0 1px 0 rgba(255,255,255,.4);
}
/* En-têtes de carte : SANS trait dur (le modèle .ag-head fond la teinte en
   dégradé vertical, seamless). Les teintes Bootstrap plates (bg-*-subtle) sont
   converties en dégradés comme le modèle (Tandem Agent A/B, etc.). */
.card-header { background: transparent; border-bottom: 0; }
.card-header.bg-primary-subtle { background: linear-gradient(180deg, rgba(99,102,241,.14), transparent) !important; }
.card-header.bg-warning-subtle { background: linear-gradient(180deg, rgba(194,130,12,.14), transparent) !important; }
.card-header.bg-success-subtle { background: linear-gradient(180deg, rgba(10,157,110,.13), transparent) !important; }
.card-header.bg-info-subtle    { background: linear-gradient(180deg, rgba(37,99,235,.13), transparent) !important; }
.card-header.bg-light          { background: transparent !important; }

/* ── Indicateurs emoji des lignes de tâches (énergie/cœur/humeur) → SOBRES.
   Ce sont des emoji (🟢 💚 😌) : leur couleur est inhérente au glyphe, insensible
   à `color`. La maquette utilise des icônes monochromes (#5b5872), pas des emoji
   couleur. On les DÉSATURE (grayscale) pour coller au registre sobre.
   NB : on perd le code-couleur d'énergie (vert/jaune/rouge → nuances de gris). */
.tl-row .badge.bg-light { filter: grayscale(.45); }

/* ── CONSIGNE handoff : entête compacte 56px (Velzon impose height:70px en dur
   dans app.min.css). flowos-overrides charge après → on gagne sans !important. */
.navbar-header { height: var(--vz-header-height); min-height: var(--vz-header-height); }

/* ── CONSIGNE handoff : rouge réservé à l'urgent/destructif. Le bouton « Ajouter »
   (création = non destructif) était en btn-danger (rouge plein) → repassé en indigo. */
.add-btn.btn-danger {
  --vz-btn-bg: #6366F1; --vz-btn-border-color: #6366F1;
  --vz-btn-hover-bg: #5457e6; --vz-btn-hover-border-color: #5457e6;
  --vz-btn-active-bg: #5457e6; --vz-btn-active-border-color: #5457e6;
}

/* — BADGES DOMPTÉS : fond translucide + texte coloré (fini l'aplat saturé). */
.badge.bg-primary   { background: rgba(99,102,241,.14)  !important; color: #4f46e5 !important; }
.badge.bg-success   { background: rgba(10,157,110,.13)  !important; color: #0a8c62 !important; }
.badge.bg-info      { background: rgba(37,99,235,.13)   !important; color: #2563eb !important; }
.badge.bg-warning   { background: rgba(191,139,28,.16)  !important; color: #a8780f !important; }
.badge.bg-danger    { background: rgba(224,73,47,.13)   !important; color: #d23f23 !important; }
.badge.bg-secondary { background: rgba(120,110,170,.12) !important; color: #5b5872 !important; }

/* — BOUTONS : primaire indigo (ombre douce) + .btn-dark en pill (CTA façon site). */
.btn-primary { box-shadow: 0 6px 18px rgba(99,102,241,.28); }
.btn-dark    { border-radius: 999px; }

/* — CHAMPS : focus indigo aligné au verre. */
.form-control:focus, .form-select:focus { border-color: var(--vz-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* ── PHASE 3 (2026-06-14) — Topbar verre compacte (modèle : maquette l.112-126). */
#page-topbar {
  background: var(--vz-header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
          backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--vz-border-color);
  box-shadow: none;
}
#page-topbar .app-search .form-control {
  background: rgba(120,110,170,.07);
  border: 0;
  border-radius: 11px;
  height: 38px;
}
/* le titre de page vit dans chaque .view-header (pas la page-title-box Velzon) →
   on neutralise la rangée page-title-box au cas où un module l'utilise encore. */
.page-title-box { padding: 0 !important; margin: 0 !important; background: transparent !important; box-shadow: none !important; }

/* ════════════════════════════════════════════════════════════════
   PHASE 6 (2026-06-14) — MODE SOMBRE (sélecteurs). Valeurs = modèle
   [data-theme=dark]. Les --vz (verre/sidebar/topbar/bordures) sont surchargés
   dans tokens.css ; ici le fond vivant + le verre LOCAL de .card (que Bootstrap
   redéfinit sur .card, donc à re-surcharger sur .card en dark). */
[data-theme="dark"] .upme-bg,
[data-bs-theme="dark"] .upme-bg { background: #0A0A0F; }
[data-theme="dark"] .upme-bg::before,
[data-bs-theme="dark"] .upme-bg::before { background: var(--up-aurora-1); opacity: .34; }
[data-theme="dark"] .upme-bg::after,
[data-bs-theme="dark"] .upme-bg::after { background: var(--up-aurora-2); opacity: .30; }
[data-theme="dark"] .card,
[data-bs-theme="dark"] .card {
  --vz-card-bg: rgba(30,28,50,.6);
  border-color: rgba(180,170,230,.10);
  box-shadow: 0 8px 26px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
}
/* item de menu actif en dark : dégradé + filet indigo clair (modèle --indigo2). */
[data-theme="dark"] .navbar-menu .navbar-nav .nav-link.active,
[data-bs-theme="dark"] .navbar-menu .navbar-nav .nav-link.active,
[data-theme="dark"] .sidebar-section-header.is-mega-trigger.active,
[data-bs-theme="dark"] .sidebar-section-header.is-mega-trigger.active {
  background: linear-gradient(90deg, rgba(129,140,248,.22), rgba(129,140,248,.05));
}



/* ── Notes : catégories à la taille de la maquette (.cat = 13px). Les noms sont
   en MAJUSCULES côté data → on descend à 12px pour égaler le rendu visuel de la
   maquette (title-case 13px). Icône dossier réduite (moins épaisse que le glyphe
   Remix par défaut). Scopé aux liens de catégorie Notes uniquement. */
a[data-cat-id] .mail-list-link { font-size: 12px; }
a[data-cat-id] .mail-list-link .ri-folder-3-line { font-size: 13px; }

/* ── Topbar 56px : recoller le contenu sous la barre. Velzon réservait ~94px de
   padding-top (ancienne rangée breadcrumb) → 37px de vide avec la topbar à 56px.
   On aligne sur la hauteur d'entête + petit espace. Sans !important pour laisser
   gagner les overrides plein écran scopés (body.*-fullscreen). */
.page-content { padding-top: calc(var(--vz-header-height) + 12px); }

/* ── Notes : la zone de scroll de l'éditeur ne descendait plus jusqu'en bas.
   notes.js pose un style INLINE `height: calc(100vh - 94px - 60px - 8px)` (=−162px)
   figé sur l'ANCIEN layout (topbar 70 + footer 60). Depuis le reskin (topbar 56,
   footer masqué, fav-bar 40px) il réserve ~50px de trop → gros vide en bas. CSS
   !important bat l'inline. On recale sur le layout réel (header var + fav-bar).
   Scopé `#view-notes` → le plein écran (#notes-focus-overlay) n'est PAS touché.
   (2026-06-14) */
#view-notes.view { height: calc(100vh - var(--vz-header-height) - 52px) !important; }
#view-notes #notes-editor-shell { height: calc(100vh - var(--vz-header-height) - 64px) !important; }

/* ── Paul v2 (.coach-v2-shell) : conversation « trop étendue ». Les bulles sont
   des .msg (pas .coach-msg !) avec déjà max-width:78% — MAIS 78% de la colonne
   chat PLEINE (1fr du grid ≈ 1450px) = bulles ~1130px. La maquette Coach IA borne
   d'abord une COLONNE centrée (.msgs-in 860px) PUIS applique 78%. On reproduit :
   on centre le flux .chat-stream (+ le composer) dans une colonne 860px → les
   bulles .msg gardent leur 78% (= 78% de 860, correct) et leur alignement
   margin-auto (user à droite / bot à gauche), exactement comme le modèle. */
.coach-v2-shell .chat-stream { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }
.coach-v2-shell:not(.chat-empty) .chat-input { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }

/* ── Paul v2 : LE vrai fix. Les bulles .msg sont des BLOCS → elles s'étirent à
   max-width:78% même pour un court "bonjour". La maquette dimensionne la bulle au
   CONTENU. On force width:fit-content → la bulle prend la taille de son texte,
   plafonnée à 78%, et reste alignée (user droite via margin-left:auto / bot gauche).
   (La system-hint garde son max-width:100% centré, non touchée.) */
.coach-v2-shell .msg.user, .coach-v2-shell .msg.bot { width: fit-content; }

/* ── Paul v2 : convention chat universelle (ChatGPT/Claude) → SEUL l'utilisateur
   a une bulle ; l'ASSISTANT est en texte brut (pas de fond, flush gauche). Avant :
   deux grosses bulles. coach-v2.js injecte .msg.bot{background:#f1f3f6} au runtime
   APRÈS ce fichier → !important pour l'emporter. */
.coach-v2-shell .msg.bot {
  background: transparent !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-radius: 0 !important;
}

/* ── Paul v2 — entête reproduite de la maquette Coach IA (.chead) : barre en VERRE
   + titre Fraunces 18px/500 (modèle .t). coach-v2.js injecte .chat-header{background:#fff}
   au runtime APRÈS ce fichier → !important sur le fond. Le titre (h5, déjà Fraunces
   via la règle globale) : mon sélecteur .coach-v2-shell .chat-header h5 est plus
   spécifique → gagne sans !important. Toggle Perso/Business inchangé (vert = sens). */
.coach-v2-shell .chat-header {
  background: rgba(255,255,255,.55) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
          backdrop-filter: blur(16px) saturate(1.4);
}
.coach-v2-shell .chat-header h5 { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }

/* Correctif : le titre coach-v2.js (.coach-v2-shell .chat-header h5, 15px/600) a la
   MÊME spécificité que mon override et s'injecte après → !important nécessaire. */
.coach-v2-shell .chat-header h5 { font-size: 18px !important; font-weight: 500 !important; letter-spacing: -.01em !important; }

/* ── Fond blanc retiré (demande Fabrice 2026-06-14) : coach-v2.js pose .chat-col,
   .chat-input, .panel-col/.panel-header/.panel-tabs/.footer-stats en #fff / #f7f8fa
   au runtime APRÈS ce fichier → !important pour transparentiser et laisser voir
   l'aurora vivante de l'app. On NE touche PAS : le champ de saisie (.composer), les
   cartes mémoire (.fact-card) ni les encarts colorés (.fact-pill/.auto-archived).
   L'entête (.chat-header) garde son verre .55 (séparateur du haut). */
.coach-v2-shell,
.coach-v2-shell .chat-col,
.coach-v2-shell .chat-input,
.coach-v2-shell .panel-col,
.coach-v2-shell .panel-header,
.coach-v2-shell .panel-tabs,
.coach-v2-shell .footer-stats { background: transparent !important; }

/* ── Paul v2 — champ de saisie (.composer) : TRANSPARENT au repos (l'aurora
   transparaît comme le reste du champ) → BLANC au focus (clic/écriture = surface
   nette pour rédiger). coach-v2.js l.286 pose .composer{background:#fff} au runtime
   APRÈS ce fichier → !important. La bordure (#d1d5db) reste pour délimiter le champ.
   Fondu doux via transition. (2026-06-15) */
.coach-v2-shell .chat-input .composer {
  background: transparent !important;
  transition: background .18s ease, border-color .15s ease, box-shadow .15s ease !important;
}
.coach-v2-shell .chat-input .composer:focus-within {
  background: #ffffff !important;
}

/* ── Compteurs de la barre de raccourcis (.upme-fav-badge) : domptés comme les
   autres badges (translucide + texte coloré) — ils étaient en aplats Bootstrap
   solides vifs, ce qui jurait avec le style sobre. bg-* Bootstrap est !important
   → !important requis ici aussi. */
.upme-fav-badge.bg-primary   { background: rgba(99,102,241,.14)  !important; color: #4f46e5 !important; }
.upme-fav-badge.bg-danger    { background: rgba(224,73,47,.13)   !important; color: #d23f23 !important; }
.upme-fav-badge.bg-warning   { background: rgba(191,139,28,.16)  !important; color: #a8780f !important; }
.upme-fav-badge.bg-success   { background: rgba(10,157,110,.13)  !important; color: #0a8c62 !important; }
.upme-fav-badge.bg-info      { background: rgba(37,99,235,.13)   !important; color: #2563eb !important; }
.upme-fav-badge.bg-secondary { background: rgba(120,110,170,.12) !important; color: #5b5872 !important; }

/* ── Footer (« 2026 Up·me ») masqué par la barre de raccourcis fixe (40px) :
   on le remonte au-dessus de la barre pour qu'il redevienne visible. */
body.flowos-ui-v2 .footer { display: none; }

/* ── Mega panel « éclairci » : verre FROSTÉ flottant sur le fond vivant + backdrop
   ADOUCI + cartes intérieures MATES (un seul niveau de verre = lisibilité).
   Avant : panneau .62 SANS blur (kanban bave à travers = muddy) + cartes .62 (verre
   sur verre) + backdrop navy .5 (sombre). */
/* Fond du méga-menu TRANSPARENT (comme les autres écrans) → l'aurora vivante
   passe derrière, donc les cartes verre (var(--up-card-glass)) prennent la même
   teinte frostée que sur le dashboard. Voile derrière allégé (était navy .28
   = sombre → cartes paraissaient grises/blanches). (2026-06-14) */
:root { --upme-mega-overlay: rgba(247,246,252,.22); }
.sidebar-mega-panel {
  background: transparent;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
          backdrop-filter: blur(16px) saturate(1.4);
}
/* Cartes du méga-menu = même verre translucide que les cartes du dashboard
   (2026-06-14 : étaient blanc plein #fff = elles restaient blanches même sur
   fond noir). Valeurs EXPLICITES (pas de var) pour zéro ambiguïté de cascade. */
.sidebar-mega-panel .mega-module-card {
  background: var(--up-card-glass);   /* MÊME token que .flowos-dashboard-view .card — pas de hardcode */
  border: 1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
          backdrop-filter: blur(18px) saturate(1.4);
}
.sidebar-mega-panel .mega-module-card:hover { border-color: var(--bs-primary); }

/* ── Notes : fond des panneaux TRANSPARENT (le fond vivant transparaît) SAUF
   l'intérieur de l'éditeur (.ql-editor) qui reste blanc (sheet lisible).
   Panneaux : .chat-leftsidebar (catégories + liste notes) + .user-chat (colonne éditeur). */
#view-notes .chat-leftsidebar,
#view-notes .user-chat { background: transparent !important; }
/* Surface d'écriture (.ql-editor) : TRANSPARENTE au repos (l'aurora transparaît,
   le texte reste lisible) → BLANCHE au focus (clic/écriture = feuille nette),
   comme le champ de Paul v2. :focus a une spécificité + haute que le repos →
   l'emporte au clic. Fondu doux via transition. (2026-06-15) */
#view-notes #notes-quill-editor .ql-editor { background: transparent; transition: background .18s ease; }
/* transition:none à l'ENTRÉE du focus = passage au blanc INSTANTANÉ → pas de flash
   aurora→blanc à l'ouverture d'une note (l'éditeur s'auto-focus). Le fondu .18s du
   repos ne s'applique qu'à la SORTIE (blur) → retour transparent en douceur. */
#view-notes #notes-quill-editor .ql-editor:focus { background: #fff; transition: none; }
/* Champ TITRE (#notes-editor-title) : même schéma transparent→blanc au focus.
   + padding gauche 16px pour (a) ne plus coller le titre au bord et (b) l'aligner
   sur le corps de note (.ql-editor a 15px). padding !important pour battre .p-0
   (Bootstrap, padding:0!important) ; background bat .form-control via l'ID. (2026-06-15) */
#notes-editor-title { background: transparent; padding: 4px 16px !important; transition: background .18s ease; }
#notes-editor-title:focus { background: #fff; transition: none; }
/* Sélecteurs méta de la note (carnet / sous-cat / projet / contact / statut) :
   transparent au repos → blanc au focus, comme le titre/corps. background-COLOR
   seul (le chevron ▾ est un background-image .form-select à NE PAS effacer).
   instant au focus, fondu doux au blur. (2026-06-15) */
#view-notes .notes-selects-row .form-select { background-color: transparent; transition: background-color .18s ease; }
#view-notes .notes-selects-row .form-select:focus { background-color: #fff; transition: none; }

/* Intelligence Entreprise — fiche : les cartes (.fe-header = carte société, .fe-kpi
   = KPI, .fe-card = sections) étaient en BLANC plein → on les met en VERRE comme « la
   première » carte de la vue (le bandeau de recherche = .card = var(--vz-card-bg) .62
   + blur(14) saturate(1.3)). Même token que le header, pas de hardcode. !important car
   intelligence-entreprise.css (chargé après) les pose en #fff. (2026-06-15) */
#view-intelligence-entreprise .fe-header,
#view-intelligence-entreprise .fe-card,
#view-intelligence-entreprise .fe-kpi {
  background: var(--vz-card-bg) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.3) !important;
  backdrop-filter: blur(14px) saturate(1.3) !important;
}

/* ════════════════════════════════════════════════════════════════
   Modale création de tâche (#taskModalNew) — c'était le DERNIER gros bloc
   blanc opaque de l'app → passée en VERRE comme les cartes. (2026-06-16)

   • .modal-content : même verre que .card (var(--vz-card-bg) = .62 clair / .6
     sombre, donc dark-safe sans règle dédiée) + flou prononcé + ombre profonde
     pour la faire flotter. La bordure passe en !important car la modale porte
     la classe .border-0 (border:0 !important côté Bootstrap).
   • Colonne droite (réglages) : voile lilas très léger → lue comme un RAIL
     distinct de la zone d'édition (gauche), sans trait dur. La gauche garde
     son .border-end comme séparateur.
   • Backdrop : le voile noir .5 de Bootstrap jurait avec l'aurora claire. On
     le remplace par un voile navy léger + flou → l'app reste devinée derrière
     (effet verre iOS) et le verre de la modale prend une teinte claire au lieu
     de virer gris/terne sur fond noir. Scopé body.flowos-ui-v2 → cohérent pour
     toutes les modales Bootstrap de la refonte (les overlays mega-menu / palette
     ⌘K ont leur PROPRE backdrop, non touché). */
#taskModalNew .modal-content {
  background: var(--vz-card-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
          backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.5) !important;
  box-shadow: var(--vz-box-shadow), 0 28px 70px rgba(15,20,40,.24), inset 0 1px 0 rgba(255,255,255,.45);
}
#taskModalNew .row.g-0 > .col-lg-3 { background: rgba(120,110,170,.06); }

body.flowos-ui-v2 .modal-backdrop { background-color: rgba(20,18,45,.20); }
body.flowos-ui-v2 .modal-backdrop.show {
  opacity: 1;                       /* l'alpha du voile vit désormais dans le rgba */
  -webkit-backdrop-filter: blur(7px) saturate(1.1);
          backdrop-filter: blur(7px) saturate(1.1);
}

/* #taskModalNew #2 — DÉSATURER LE VIOLET (2026-06-16). Avant : 3 aplats indigo
   pleins se disputaient l'œil (Enregistrer + toggle Tâche actif + Important
   sélectionné) → l'action principale ne ressortait plus. Règle : UN SEUL rempli
   loud = #tm-save (Enregistrer, garde son glow global). Les ÉTATS sélectionnés
   (toggle actif, Eisenhower coché) repassent en tons DOUX via les variables de
   bouton Velzon — donc zéro !important et la logique JS qui swappe les classes
   (tmSetEisenhower : btn-primary↔btn-outline-primary, btn-warning↔outline ;
   toggle : .active) continue de marcher : on ne fait que reteinter la variante.
   Couleurs = palette des badges domptés (rgba(99,102,241,.16)/#4f46e5 indigo,
   rgba(191,139,28,.16)/#a8780f ambre). */
#taskModalNew #tm-type-group .btn.btn-soft-primary {
  --vz-btn-active-bg: rgba(99,102,241,.16);
  --vz-btn-active-border-color: rgba(99,102,241,.30);
  --vz-btn-active-color: #4f46e5;
}
#taskModalNew #tm-type-group .btn.active { box-shadow: none; }
#taskModalNew #tm-important.btn-primary {
  --vz-btn-bg: rgba(99,102,241,.16);  --vz-btn-border-color: rgba(99,102,241,.30);  --vz-btn-color: #4f46e5;
  --vz-btn-hover-bg: rgba(99,102,241,.24);  --vz-btn-hover-border-color: rgba(99,102,241,.42);  --vz-btn-hover-color: #4f46e5;
  --vz-btn-active-bg: rgba(99,102,241,.24); --vz-btn-active-border-color: rgba(99,102,241,.42); --vz-btn-active-color: #4f46e5;
  box-shadow: none;
}
#taskModalNew #tm-urgent.btn-warning {
  --vz-btn-bg: rgba(191,139,28,.16);  --vz-btn-border-color: rgba(191,139,28,.30);  --vz-btn-color: #a8780f;
  --vz-btn-hover-bg: rgba(191,139,28,.24);  --vz-btn-hover-border-color: rgba(191,139,28,.42);  --vz-btn-hover-color: #a8780f;
  --vz-btn-active-bg: rgba(191,139,28,.24); --vz-btn-active-border-color: rgba(191,139,28,.42); --vz-btn-active-color: #a8780f;
  box-shadow: none;
}

/* #taskModalNew — CHAMPS & SÉLECTEURS « transparent au repos → blanc au focus »
   (2026-06-16), même schéma que Notes / Paul v2 : sur la modale en verre, les
   champs blancs pleins juraient → ils montrent l'aurora au repos et passent au
   blanc net quand on écrit dedans.
   • background-COLOR seul sur .form-select (le chevron ▾ est un background-image
     à NE PAS effacer). #tm-title inclus (titre = champ, padding pour ne pas coller
     le texte au bord du cadre blanc au focus). L'éditeur Quill (.ql-editor) idem.
   • transition au REPOS seulement ; :focus{transition:none} = passage au blanc
     INSTANTANÉ (pas de flash), retour transparent en fondu au blur.
   • .form-range (slider durée) n'est PAS .form-control → non touché. */
#taskModalNew .form-control,
#taskModalNew .form-select {
  background-color: transparent;
  transition: background-color .18s ease;
}
#taskModalNew .form-control:focus,
#taskModalNew .form-select:focus {
  background-color: #ffffff;
  transition: none;
}
#taskModalNew #tm-title { padding-left: 12px !important; padding-right: 12px !important; }

/* Éditeur Description (Quill) : le .ql-editor ne fait que ~1-2 lignes (61px) alors
   que le conteneur #tm-editor.ql-container fait 300px → blanchir le .ql-editor au
   focus ne colorait qu'une BANDE. On blanchit donc TOUT le bloc éditeur
   (#tm-editor-wrap = barre d'outils + zone) en :focus-within, et on garde le
   .ql-editor transparent pour laisser ce blanc remplir toute la hauteur. (2026-06-16) */
#taskModalNew #tm-editor .ql-editor { background-color: transparent; }
#taskModalNew #tm-editor-wrap { background-color: transparent; transition: background-color .18s ease; }
#taskModalNew #tm-editor-wrap:focus-within { background-color: #ffffff; transition: none; }

/* Bouton Enregistrer : était en indigo PLEIN saturé (seul aplat criard sur la
   modale en verre). Reteinté en indigo VERRE translucide → reste le CTA primaire
   (rempli, pleine largeur, en haut) mais dans le registre glass de la fenêtre.
   Via les variables de bouton Velzon (pas de !important) ; le glow global
   .btn-primary est remplacé par une ombre douce (spécificité #taskModalNew #tm-save).
   (2026-06-16) */
#taskModalNew #tm-save {
  --vz-btn-bg: rgba(99,102,241,.80);
  --vz-btn-border-color: rgba(99,102,241,.55);
  --vz-btn-hover-bg: rgba(99,102,241,.92);
  --vz-btn-hover-border-color: rgba(99,102,241,.70);
  --vz-btn-active-bg: rgba(99,102,241,.92);
  --vz-btn-active-border-color: rgba(99,102,241,.70);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
          backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 6px 20px rgba(99,102,241,.16);
}

/* ============================================================== */
/* ATELIER IMMERSIF — quand la vue Atelier est active, on masque   */
/* le chrome de l'app (top bar, barre latérale, fav-bar du bas,    */
/* pastille statut) et l'atelier prend tout l'écran.               */
/* La classe `atelier-immersive` est posée/retirée sur <body> par  */
/* activateView (ui.js). Retour à Up·me via le bouton « ← Quitter » */
/* du header de l'atelier (cf atelier/index.html → parent.activateView). */
/* ============================================================== */
body.atelier-immersive #page-topbar,
body.atelier-immersive .app-menu.navbar-menu,
body.atelier-immersive #upme-fav-bar,
body.atelier-immersive #sidebar-status { display: none !important; }

/* l'atelier sort du flux et couvre tout le viewport (z-index sous les modales Bootstrap = 1055) */
body.atelier-immersive #view-atelier {
  position: fixed; inset: 0; z-index: 1050; margin: 0; background: #0b0d18;
}
body.atelier-immersive #view-atelier > #atelier-frame {
  width: 100% !important; height: 100% !important;
}

/* ══════════════════════════════════════════════════════════════
   COCKPIT IMMERSIF (vue d'ensemble, route 'overview') — même principe
   que l'atelier : on masque le chrome de l'app (top bar, sidebar, fav-bar,
   pastille statut, lanceur musique) et le cockpit prend TOUT l'écran. La
   classe `overview-immersive` est posée/retirée sur <body> par cockpit-bridge.js
   à l'entrée/sortie de la vue. ══════════════════════════════════════════ */
body.overview-immersive #page-topbar,
body.overview-immersive .app-menu.navbar-menu,
body.overview-immersive #upme-fav-bar,
body.overview-immersive #sidebar-status,
body.overview-immersive #mus-launch { display: none !important; }

body.overview-immersive #view-overview {
  position: fixed; inset: 0; z-index: 1050; margin: 0; background: transparent;
}
body.overview-immersive #view-overview > #cockpit-frame {
  width: 100% !important; height: 100% !important;
}

/* ══════════════════════════════════════════════════════════════
   LANCEUR MUSIQUE (#mus-launch, music.js) — au-dessus de la fav-bar
   Le bouton flottant 🎶 est ancré en bas-gauche (bottom:16px, défini
   dans le <style> injecté par music.js). Quand la fav-bar (40px,
   #upme-fav-bar) est visible il la chevauchait → on le remonte pour
   qu'il se pose juste au-dessus. Adaptatif via :has() : il RESTE à
   16px tant qu'aucun favori (fav-bar masquée par .is-empty), donc pas
   d'icône qui flotte dans le vide pour un nouvel utilisateur.
   Spécificité (0,2,0)+!important → bat le style inline (0,1,0) quel
   que soit l'ordre d'injection. On ne touche PAS au player/celeb
   (draggables, position mémorisée). ══════════════════════════════ */
body:has(#upme-fav-bar:not(.is-empty)) #mus-launch {
  bottom: 56px !important;
}

/* ══════════════════════════════════════════════════════════════
   MODULE PROCHAINEMENT — vitrine roadmap + vote (prochainement.js)
   Verre dépoli sur aurora, MÊMES valeurs que le dashboard. ════════ */
#view-prochainement { background: transparent !important; }
#view-prochainement .proch-header { margin: 0.5rem 0 1.5rem; }
#view-prochainement .proch-title { font-weight: 700; margin: 0 0 .35rem; }
#view-prochainement .proch-sub { color: var(--vz-body-color); opacity: .8; max-width: 720px; margin: 0; }

#view-prochainement .proch-card {
  background: var(--up-card-glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
#view-prochainement .proch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(99, 102, 241, .12);
}
[data-bs-theme="dark"] #view-prochainement .proch-card,
[data-theme="dark"] #view-prochainement .proch-card { background: var(--vz-card-bg); }

#view-prochainement .proch-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
#view-prochainement .proch-icon { font-size: 30px; line-height: 1; }
#view-prochainement .proch-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
#view-prochainement .proch-badge-labo { background: rgba(245, 158, 11, .15); color: #b45309; }
#view-prochainement .proch-badge-prep { background: rgba(99, 102, 241, .15); color: #4338ca; }
#view-prochainement .proch-badge-soon { background: rgba(16, 163, 74, .15); color: #15803d; }
[data-theme="dark"] #view-prochainement .proch-badge-labo { color: #fcd34d; }
[data-theme="dark"] #view-prochainement .proch-badge-prep { color: #a5b4fc; }
[data-theme="dark"] #view-prochainement .proch-badge-soon { color: #86efac; }

#view-prochainement .proch-name { font-size: 1.05rem; font-weight: 700; margin: 0 0 .35rem; }
#view-prochainement .proch-pitch { font-size: .85rem; line-height: 1.5; color: var(--vz-body-color); opacity: .82; margin: 0 0 .9rem; flex-grow: 1; }
#view-prochainement .proch-actions { margin-bottom: .75rem; }

#view-prochainement .proch-feedback { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; border-top: 1px solid rgba(120, 110, 170, .14); padding-top: .75rem; }
#view-prochainement .proch-like {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid rgba(99, 102, 241, .35); background: rgba(255, 255, 255, .35);
  color: var(--vz-body-color); border-radius: 999px; padding: 5px 12px; font-size: .8rem; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
#view-prochainement .proch-like:hover { background: rgba(99, 102, 241, .10); }
#view-prochainement .proch-like:active { transform: scale(.97); }
#view-prochainement .proch-like.is-on { background: linear-gradient(135deg, #6366f1, #a78bfa); border-color: transparent; color: #fff; }
#view-prochainement .proch-like-count { font-weight: 700; background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
#view-prochainement .proch-like.is-on .proch-like-count { background: rgba(255, 255, 255, .25); }
#view-prochainement .proch-comment-toggle { background: none; border: none; color: var(--vz-primary); font-size: .8rem; cursor: pointer; padding: 4px 2px; }
#view-prochainement .proch-comment-toggle:hover { text-decoration: underline; }
#view-prochainement .proch-comment-box { margin-top: .75rem; }
#view-prochainement .proch-comment-ok { color: #16a34a; font-size: .8rem; font-weight: 600; margin-left: .5rem; }

/* Overlay d'aperçu plein écran (iframe MegaCity / Compagnon à la demande) */
.proch-preview-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(12, 10, 32, .55);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  display: none; align-items: center; justify-content: center; padding: 2.5vh 2vw;
}
.proch-preview-overlay.open { display: flex; }
.proch-preview-shell {
  width: 100%; height: 100%; max-width: 1400px;
  background: #0b0d18; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.proch-preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(255, 255, 255, .06); color: #fff; flex-shrink: 0; }
.proch-preview-title { font-weight: 600; font-size: .95rem; }
.proch-preview-close { background: rgba(255, 255, 255, .12); color: #fff; border: none; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .85rem; }
.proch-preview-close:hover { background: rgba(255, 255, 255, .22); }
.proch-preview-iframe { flex: 1 1 auto; width: 100%; border: 0; display: block; background: #0b0d18; }

/* ══════════════════════════════════════════════════════════════
   ÉCRAN DE CONNEXION — vague animée en fond (cockpit?bg=1, via login-wave.js)
   + carte du formulaire en VERRE DÉPOLI lisible posée dessus. Première
   impression : continuité site/cockpit. La vague est chargée seulement quand
   le login est visible (sinon about:blank). ══════════════════════════════ */
#login-wave-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; z-index: 0; pointer-events: none;
}
#login-screen .login-box {
  position: relative; z-index: 1;                 /* le formulaire passe DEVANT la vague */
  /* Carte retirée : le contenu (logo, champs, bouton) flotte directement sur la vague. */
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}
