/* ============================================================
   VIGNETTE MDB MANAGER
   Reconstitution animée en HTML, à la charte du CRM (bleu nuit et or).
   Dessinée sur un plan fixe de 1120 x 640 px puis mise à l'échelle :
   nette à toute taille, là où une capture se pixelise.
   Données d'exemple uniquement.
   ============================================================ */
.mgr { --k: 1; position: relative; width: 100%; aspect-ratio: 1120 / 640; overflow: hidden; background: #F5F3EE; }
.mgr--etroit { aspect-ratio: 910 / 640; }
/* Sur un téléphone, l'écran ne rétrécit plus en dessous d'une taille lisible : il se parcourt en glissant */
.mgr--glisse { aspect-ratio: auto; height: calc(640px * var(--k)); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.mgr--glisse::-webkit-scrollbar { display: none; }
.mgr-cadre {
  position: absolute; left: 0; top: 0; width: 1120px; height: 640px;
  display: grid; grid-template-columns: 210px 910px;
  transform-origin: 0 0; transform: scale(var(--k));
  font: 400 13.5px/1.5 'Inter', system-ui, sans-serif; color: #16212B; text-align: left; letter-spacing: 0;
  -webkit-font-smoothing: antialiased; user-select: none;
}
.mgr--etroit .mgr-cadre { width: 910px; grid-template-columns: 910px; }
.mgr--etroit .mgr-menu { display: none; }
.mgr-cadre svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mgr-cadre h4, .mgr-cadre h5, .mgr-cadre p { margin: 0; }

/* --- MENU --- */
.mgr-menu { background: #111C26; padding: 18px 11px; display: flex; flex-direction: column; gap: 2px; color: #A9B4BF; }
.mgr-logo { display: flex; align-items: center; gap: 10px; padding: 2px 9px 20px; font: 800 14.5px/1 'Montserrat', 'Inter', sans-serif; color: #fff; letter-spacing: .01em; }
.mgr-logo i { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #1B2A38, #2E465C); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.mgr-logo i svg { width: 21px; height: 21px; }
.mgr-lien { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-weight: 500; font-size: 13px; transition: background .4s, color .4s; }
.mgr-lien.actif { background: rgba(212, 175, 55, .13); color: #E4C766; font-weight: 600; }
.mgr-lien b { margin-left: auto; font-size: 10.5px; background: #D4AF37; color: #111C26; border-radius: 999px; padding: 1px 7px; }
.mgr-groupe { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #5F6C78; padding: 14px 10px 5px; font-weight: 600; }
.mgr-compte { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 13px 9px 0; border-top: 1px solid rgba(255, 255, 255, .07); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.mgr-compte small { display: block; font-weight: 400; color: #A9B4BF; font-size: 11px; }
.mgr-avatar { width: 30px; height: 30px; border-radius: 50%; background: #F4EBCB; color: #8A6B14; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* --- ÉCRAN --- */
.mgr-ecran { position: relative; padding: 26px 30px; overflow: hidden; }
.mgr-vue { display: none; }
.mgr-vue.active { display: block; }
.mgr-tete { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.mgr-tete h4 { font: 700 22px/1.2 'Montserrat', 'Inter', sans-serif; letter-spacing: -.01em; }
.mgr-tete p { color: #5D6873; font-size: 13px; margin-top: 2px; }
.mgr-actions { display: flex; gap: 8px; }
.mgr-btn { font-weight: 600; font-size: 12.5px; padding: 8px 14px; border-radius: 10px; border: 1px solid #E6E1D6; background: #fff; }
.mgr-btn--plein { background: #16212B; color: #fff; border-color: #16212B; }
.mgr-carte { background: #fff; border: 1px solid #E6E1D6; border-radius: 12px; box-shadow: 0 1px 2px rgba(22, 33, 43, .05); }

/* --- TABLEAU DE BORD --- */
.mgr-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.mgr-kpi { padding: 16px 18px; }
.mgr-kpi span { font-size: 12px; color: #5D6873; font-weight: 500; }
.mgr-kpi strong { display: block; font: 700 25px/1.2 'Montserrat', 'Inter', sans-serif; letter-spacing: -.02em; margin: 7px 0 6px; font-variant-numeric: tabular-nums; }
.mgr-kpi em { font-style: normal; font-size: 11.5px; font-weight: 600; color: #0F7B55; background: #E4F4EC; padding: 2px 7px; border-radius: 999px; }
.mgr-kpi em.bas { color: #B93838; background: #FBEAEA; }
.mgr-kpi small { color: #98A1AA; font-size: 11.5px; margin-left: 6px; }
.mgr-deux { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.mgr-bloc { padding: 18px 20px; }
.mgr-bloc-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mgr-bloc-tete h5 { font: 700 14.5px/1.2 'Montserrat', 'Inter', sans-serif; }
.mgr-bloc-tete small { color: #98A1AA; font-size: 11.5px; }
.mgr-barres { display: flex; align-items: flex-end; gap: 10px; height: 226px; border-bottom: 1px solid #E6E1D6; }
.mgr-barres i { flex: 1; height: calc(var(--h) * 1%); background: #E3CB78; border-radius: 5px 5px 0 0; transform-origin: bottom; }
.mgr-barres i.fort { background: #16212B; }
.mgr-mois { display: flex; gap: 10px; margin-top: 7px; font-size: 10.5px; color: #98A1AA; }
.mgr-mois span { flex: 1; text-align: center; }
.mgr-rang { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #EFEBE2; font-size: 13px; }
.mgr-rang:last-child { border-bottom: 0; }
.mgr-rang > i { font-style: normal; font-size: 11.5px; color: #98A1AA; font-weight: 600; }
.mgr-rang em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.mgr-jauge { height: 4px; background: #F1EDE4; border-radius: 4px; margin-top: 5px; overflow: hidden; }
.mgr-jauge u { display: block; height: 100%; width: calc(var(--w) * 1%); background: #B8922A; border-radius: 4px; transform-origin: left; }

/* --- PIPELINE --- */
.mgr-colonnes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mgr-col { min-width: 0; background: #FAF8F3; border: 1px solid #E6E1D6; border-radius: 12px; padding: 11px 9px; min-height: 492px; }
.mgr-col-tete { display: flex; justify-content: space-between; align-items: center; padding: 0 3px; font-weight: 600; font-size: 12.5px; margin-bottom: 3px; }
.mgr-col-tete i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.mgr-col-tete small { padding: 1px 8px; border-radius: 99px; background: #EFEBE2; color: #5D6873; font-weight: 600; font-size: 11px; font-variant-numeric: tabular-nums; }
.mgr-col > p { padding: 0 3px; font-size: 11.5px; color: #5D6873; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.mgr-dossier { position: relative; background: #fff; border: 1px solid #E6E1D6; border-radius: 10px; padding: 10px 10px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(22, 33, 43, .05); }
.mgr-dossier-tete { display: flex; justify-content: space-between; gap: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.mgr-dossier-tete b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mgr-dossier-tete b small { font-size: 9.5px; color: #98A1AA; font-weight: 600; letter-spacing: .04em; }
.mgr-dossier p { font-size: 11.5px; color: #5D6873; margin-top: 5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-dossier p svg { width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; }
.mgr-dossier footer { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 7px; border-top: 1px solid #EFEBE2; font-size: 10.5px; color: #98A1AA; }
.mgr-dossier.voyage { z-index: 5; border-color: #D4AF37; box-shadow: 0 20px 44px rgba(22, 33, 43, .24); }

/* --- ARBORESCENCE --- */
.mgr-puces { display: flex; gap: 10px; margin-bottom: 18px; }
.mgr-puce { display: flex; align-items: baseline; gap: 8px; padding: 9px 14px; font-size: 12px; color: #5D6873; }
.mgr-puce b { font: 700 15px/1 'Montserrat', 'Inter', sans-serif; color: #16212B; font-variant-numeric: tabular-nums; }
.mgr-arbre { position: relative; width: 850px; height: 400px; }
.mgr-cadre .mgr-liens { position: absolute; left: 0; top: 0; width: 850px; height: 400px; stroke: #CFC6B0; stroke-width: 1.5; }
.mgr-liens path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.mgr-noeud { position: absolute; width: 158px; margin-left: -79px; background: #fff; border: 1px solid #E6E1D6; border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; box-shadow: 0 1px 2px rgba(22, 33, 43, .05); line-height: 1.3; }
.mgr-noeud strong { display: block; font-size: 12.5px; }
.mgr-noeud small { font-size: 11px; color: #5D6873; font-variant-numeric: tabular-nums; }
.mgr-noeud.racine { background: #16212B; color: #fff; border-color: #16212B; }
.mgr-noeud.racine small { color: #E4C766; }
.mgr-noeud .pastille { position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: #0F7B55; }
.mgr-noeud .pastille.or { background: #E0A63A; }

/* --- NOTIFICATION --- */
.mgr-toast { position: absolute; right: 26px; top: 20px; display: flex; align-items: center; gap: 10px; background: #16212B; color: #fff; padding: 10px 16px 10px 11px; border-radius: 12px; font-size: 12.5px; font-weight: 600; line-height: 1.3; box-shadow: 0 16px 36px rgba(22, 33, 43, .3); opacity: 0; transform: translateY(-14px) scale(.96); transition: opacity .4s, transform .55s cubic-bezier(.3, 1.4, .4, 1); pointer-events: none; z-index: 9; }
.mgr-toast.visible { opacity: 1; transform: none; }
.mgr-toast i { width: 24px; height: 24px; border-radius: 50%; background: #D4AF37; color: #16212B; display: grid; place-items: center; }
.mgr-toast i svg { width: 13px; height: 13px; stroke-width: 2.6; }
.mgr-toast small { display: block; font-weight: 400; color: #B9C3CC; font-size: 11px; }

/* --- MOUVEMENT : chaque vue se rejoue quand elle devient active --- */
.mgr-vue [data-a] { opacity: 0; transform: translateY(14px); }
.mgr-vue.joue [data-a] { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.2, .8, .2, 1) calc(var(--o, 0) * 70ms), transform .7s cubic-bezier(.2, .8, .2, 1) calc(var(--o, 0) * 70ms); }
.mgr-barres i { transform: scaleY(0); }
.mgr-vue.joue .mgr-barres i { transform: none; transition: transform .95s cubic-bezier(.2, .9, .25, 1) calc(320ms + var(--o, 0) * 55ms); }
.mgr-jauge u { transform: scaleX(0); }
.mgr-vue.joue .mgr-jauge u { transform: none; transition: transform 1.1s cubic-bezier(.2, .9, .25, 1) calc(520ms + var(--o, 0) * 90ms); }
.mgr-vue.joue .mgr-liens path { stroke-dashoffset: 0; transition: stroke-dashoffset .8s ease calc(250ms + var(--o, 0) * 150ms); }
.mgr-noeud { opacity: 0; transform: translateY(12px) scale(.9); }
.mgr-vue.joue .mgr-noeud { opacity: 1; transform: none; transition: opacity .5s ease calc(var(--o, 0) * 140ms), transform .65s cubic-bezier(.3, 1.4, .4, 1) calc(var(--o, 0) * 140ms); }

.calme .mgr-vue [data-a], .calme .mgr-barres i, .calme .mgr-jauge u, .calme .mgr-noeud { opacity: 1 !important; transform: none !important; transition: none !important; }
.calme .mgr-liens path { stroke-dashoffset: 0 !important; transition: none !important; }

/* ============================================================
   VUES AJOUTÉES : pilotage, activité des recrues, historique, encaissements
   ============================================================ */

/* --- COMPTEURS ET RUBRIQUES --- */
.mgr-compteurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.mgr-compteurs.trois { grid-template-columns: repeat(3, 1fr); }
.mgr-compteur { padding: 9px 16px; text-align: center; }
.mgr-compteur strong { display: block; font: 700 26px/1.15 'Montserrat', 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
.mgr-compteur span { font-size: 12px; color: #5D6873; font-weight: 500; }
.mgr-compteur.rouge { background: #FBEAEA; border-color: #F3D2D2; }
.mgr-compteur.rouge strong { color: #B93838; }
.mgr-compteur.ambre { background: #FDF3DF; border-color: #F3E0B5; }
.mgr-compteur.ambre strong { color: #B4760B; }
.mgr-compteur.vert { background: #E4F4EC; border-color: #C7E6D6; }
.mgr-compteur.vert strong { color: #0F7B55; }
.mgr-compteur strong.saute { animation: mgr-saut .6s cubic-bezier(.3, 1.5, .4, 1); }
@keyframes mgr-saut { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.mgr-cadre .mgr-rubrique { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: #5D6873; }
.mgr-rubrique i { width: 8px; height: 8px; border-radius: 50%; }
.mgr-rubrique i.ambre { background: #E0A63A; }
.mgr-rubrique i.vert { background: #0F7B55; }

/* --- PILOTAGE --- */
.mgr-alertes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.mgr-alerte { position: relative; padding: 10px 13px 10px 16px; overflow: hidden; }
.mgr-alerte::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #E0A63A; }
.mgr-alerte.vert::before { background: #0F7B55; }
.mgr-alerte-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.mgr-alerte-tete span { font-size: 10.5px; font-weight: 600; color: #5D6873; background: #F1EDE4; border-radius: 99px; padding: 2px 8px; }
.mgr-cadre .mgr-alerte p { font-size: 11.5px; line-height: 1.45; color: #5D6873; margin: 6px 0 9px; min-height: 33px; }
.mgr-alerte-pied { position: relative; height: 18px; font-size: 11.5px; font-weight: 600; }
.mgr-alerte-pied span { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: opacity .35s, transform .5s cubic-bezier(.3, 1.4, .4, 1); }
.mgr-cadre .mgr-alerte-pied svg { width: 13px; height: 13px; stroke-width: 2.2; }
.mgr-alerte-pied .apres { color: #0F7B55; opacity: 0; transform: translateY(8px); }
.mgr-alerte.fait .avant { opacity: 0; transform: translateY(-8px); }
.mgr-alerte.fait .apres { opacity: 1; transform: none; }
.mgr-alerte.fait { border-color: #C7E6D6; background: #F6FBF8; transition: background .5s, border-color .5s; }
.mgr-alerte.fait::before { background: #0F7B55; transition: background .5s; }

/* --- ACTIVITÉ DES RECRUES --- */
.mgr-filtres { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.mgr-filtres span { padding: 5px 13px; border-radius: 99px; border: 1px solid #E6E1D6; background: #fff; font-size: 11.5px; font-weight: 600; color: #5D6873; }
.mgr-filtres span.actif { background: #16212B; border-color: #16212B; color: #fff; }
.mgr-filtres > b { margin-left: auto; font-size: 12px; font-weight: 500; color: #5D6873; }
.mgr-filtres > b strong { font: 700 15px/1 'Montserrat', 'Inter', sans-serif; color: #16212B; font-variant-numeric: tabular-nums; }
.mgr-recrues { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mgr-recrue { position: relative; padding: 11px 13px 12px 16px; overflow: hidden; }
.mgr-recrue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #CFC6B0; }
.mgr-recrue.actif::before { background: #0F7B55; }
.mgr-recrue.ralenti::before { background: #E0A63A; }
.mgr-recrue.inactif::before { background: #D9534F; }
.mgr-recrue-tete { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; line-height: 1.3; min-width: 0; }
.mgr-recrue-tete > div { min-width: 0; }
.mgr-recrue-tete b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-recrue-tete small { display: block; font-size: 10.5px; color: #98A1AA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-recrue-ca { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 9px 0 6px; }
.mgr-recrue-ca strong { font: 700 16px/1 'Montserrat', 'Inter', sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mgr-etat { font-style: normal; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #F1EDE4; color: #5D6873; white-space: nowrap; }
.mgr-etat.actif { background: #E4F4EC; color: #0F7B55; }
.mgr-etat.ralenti { background: #FDF3DF; color: #B4760B; }
.mgr-etat.inactif { background: #FBEAEA; color: #B93838; }
.mgr-ligne { display: flex; justify-content: space-between; font-size: 10.5px; color: #5D6873; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mgr-recrue .mgr-jauge { height: 5px; margin-top: 4px; }
.mgr-jauge.vert u { background: #0F7B55; }

/* --- TABLEAUX : historique et encaissements --- */
.mgr-table { padding: 6px 16px 8px; }
.mgr-rangee { display: grid; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid #EFEBE2; font-size: 12.5px; }
.mgr-rangee:last-child { border-bottom: 0; }
.mgr-table.ventes .mgr-rangee { grid-template-columns: 88px 150px 104px 1fr 110px; }
.mgr-table.factures .mgr-rangee { grid-template-columns: 82px 130px 1fr 104px 96px 108px; padding-block: 10.5px; }
.mgr-table .mgr-rangee.entete { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #98A1AA; padding-block: 9px; }
.mgr-rangee > span { color: #5D6873; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-rangee > b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-rangee .droite { text-align: right; font-variant-numeric: tabular-nums; }
.mgr-rangee.entete > span { color: inherit; }
.mgr-etape, .mgr-facture { font-style: normal; font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.mgr-etape.mandat { background: #ECEEFB; color: #4755B5; }
.mgr-etape.offre { background: #FDF3DF; color: #B4760B; }
.mgr-etape.compromis { background: #FBE9F0; color: #B9416F; }
.mgr-etape.acte { background: #E4F4EC; color: #0F7B55; }
.mgr-facture.payee { background: #E4F4EC; color: #0F7B55; }
.mgr-facture.a-emettre { background: #FDF3DF; color: #B4760B; }
.mgr-facture.emise { background: #ECEEFB; color: #4755B5; }
.mgr-numero { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mgr-numero i { font-style: normal; color: #B9B2A0; }
.mgr-rangee[data-facture] > span { position: relative; overflow: visible; }
.mgr-rangee[data-facture] .apres { position: absolute; left: 0; top: 50%; opacity: 0; transform: translateY(calc(-50% + 8px)); transition: opacity .35s, transform .5s cubic-bezier(.3, 1.4, .4, 1); }
.mgr-rangee[data-facture] .avant { display: inline-block; transition: opacity .35s, transform .4s; }
.mgr-rangee[data-facture].fait .avant { opacity: 0; transform: translateY(-8px); }
.mgr-rangee[data-facture].fait .apres { opacity: 1; transform: translateY(-50%); }
.mgr-rangee[data-facture].fait i.apres { color: #16212B; }
.mgr-rangee[data-facture].fait { background: linear-gradient(90deg, rgba(212, 175, 55, .13), transparent 70%); transition: background .6s; }
