/* =========================================================
   AlexOne — surcharge de thème (palette du logo)
   Cyan vif #29ABE2  +  Violet/indigo foncé #2B1A52
   ========================================================= */

:root,
[data-bs-theme="light"] {
  /* Couleur primaire = cyan AlexOne */
  --bs-primary: #29abe2;
  --bs-primary-rgb: 41, 171, 226;
  --bs-primary-active: #1e90c0;
  --bs-primary-light: #e7f6fd;
  --bs-primary-clarity: rgba(41, 171, 226, 0.2);
  --bs-text-primary: #29abe2;
  --bs-link-color: #29abe2;
  --bs-link-hover-color: #1e90c0;

  /* Violet de marque (utilisé pour la sidebar) */
  --alexone-purple: #2b1a52;
  --alexone-purple-dark: #221442;
  --alexone-cyan: #29abe2;
}

/* Boutons primaires */
.btn.btn-primary {
  --bs-btn-bg: #29abe2;
  --bs-btn-border-color: #29abe2;
  --bs-btn-hover-bg: #1e90c0;
  --bs-btn-hover-border-color: #1e90c0;
  --bs-btn-active-bg: #1e90c0;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}

/* =====================================================================
   LAYOUT ALEXONE — shell + sidebar React (responsive)
   ===================================================================== */
.alexone-shell {
  display: flex;
  min-height: 100vh;
  background: #f5f7fb;
}
.alexone-sidebar {
  width: 264px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #eef0f4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.22s ease;
}
.alexone-shell.collapsed .alexone-sidebar { width: 86px; }

.alexone-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---- Logo ---- */
.alexone-sidebar-logo {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-bottom: 1px solid #f1f3f7;
  cursor: pointer;
  flex-shrink: 0;
}
.alexone-sidebar-logo .logo-full { max-height: 46px; max-width: 100%; object-fit: contain; }
.alexone-sidebar-logo .logo-mini { max-height: 40px; display: none; }
.alexone-shell.collapsed .alexone-sidebar-logo .logo-full { display: none; }
.alexone-shell.collapsed .alexone-sidebar-logo .logo-mini { display: block; }

/* ---- Navigation ---- */
.alexone-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 10px 12px 16px; }
.alexone-nav::-webkit-scrollbar { width: 6px; }
.alexone-nav::-webkit-scrollbar-thumb { background: #e2e6ee; border-radius: 4px; }
.alexone-nav-group { margin-bottom: 6px; }
.alexone-nav-section {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a1a5b7;
  padding: 14px 12px 6px;
}
.alexone-nav-item { position: relative; }
.alexone-nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: none;
  background: transparent;
  border-radius: 11px;
  color: #3f4254;
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.alexone-nav-link .icon { font-size: 1.32rem; width: 26px; text-align: center; flex-shrink: 0; line-height: 1; }
.alexone-nav-link .label { flex: 1 1 auto; white-space: nowrap; overflow: hidden; }
.alexone-nav-arrow { font-size: 0.72rem; color: #b5b9c8; transition: transform 0.2s; }
.alexone-nav-item.open > .alexone-nav-link .alexone-nav-arrow { transform: rotate(90deg); }
.alexone-nav-link:hover { background: #f3f6fb; color: var(--alexone-cyan); }
.alexone-nav-link:hover .icon { color: var(--alexone-cyan); }
.alexone-nav-link.active { background: #eaf6fd; color: var(--alexone-cyan); }
.alexone-nav-link.active .icon { color: var(--alexone-cyan); }

/* sous-menu accordéon */
.alexone-subnav { overflow: hidden; max-height: 0; transition: max-height 0.25s ease; }
.alexone-nav-item.open > .alexone-subnav { max-height: 420px; }
.alexone-sublink {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px 8px 50px;
  border: none;
  background: transparent;
  border-radius: 9px;
  color: #5e6278;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}
.alexone-sublink .dot { width: 6px; height: 6px; border-radius: 50%; background: #c5cad6; flex-shrink: 0; transition: background 0.15s; }
.alexone-sublink:hover { color: var(--alexone-cyan); background: #f7fafd; }
.alexone-sublink:hover .dot { background: var(--alexone-cyan); }
.alexone-sublink.active { color: var(--alexone-cyan); font-weight: 700; }
.alexone-sublink.active .dot { background: var(--alexone-cyan); }
.alexone-sublink.disabled { color: #b5b9c8; cursor: default; }
.alexone-sublink.disabled:hover { background: transparent; color: #b5b9c8; }
.alexone-sublink.disabled .dot { background: #e1e4ec; }

/* ---- Footer sidebar (bouton réduire) ---- */
.alexone-sidebar-footer { border-top: 1px solid #f1f3f7; padding: 10px 12px; flex-shrink: 0; }
.alexone-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: #f5f7fb;
  border-radius: 10px;
  color: #5e6278;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.alexone-collapse-btn:hover { background: #eaf6fd; color: var(--alexone-cyan); }

/* ---- Flyout (mode réduit) ---- */
.alexone-flyout {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: -4px;
  min-width: 220px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(20, 16, 46, 0.16);
  padding: 10px;
  z-index: 300;
}
.alexone-flyout-title { font-weight: 700; color: #1b2559; font-size: 0.9rem; padding: 4px 12px 8px; }
.alexone-flyout .alexone-sublink { padding-left: 14px; }

/* ============ MODE RÉDUIT (rail desktop) ============ */
.alexone-shell.collapsed .alexone-nav-link .label,
.alexone-shell.collapsed .alexone-nav-arrow,
.alexone-shell.collapsed .alexone-nav-section,
.alexone-shell.collapsed .alexone-collapse-btn .label { display: none; }
.alexone-shell.collapsed .alexone-nav-link { justify-content: center; padding: 13px; border-radius: 12px; }
.alexone-shell.collapsed .alexone-nav-link .icon { font-size: 1.7rem; width: auto; }
.alexone-shell.collapsed .alexone-subnav { display: none; }
.alexone-shell.collapsed .alexone-nav-section { padding: 6px 0; }
.alexone-shell.collapsed .alexone-sidebar-logo .logo-mini { max-height: 46px; }
.alexone-shell.collapsed .alexone-collapse-btn { justify-content: center; }
.alexone-shell.collapsed .alexone-nav-item:hover > .alexone-flyout { display: block; }

/* ---- Topbar ---- */
.alexone-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  padding: 12px 28px;
}
.alexone-content { flex: 1 1 auto; }
.alexone-footer {
  padding: 16px 28px;
  border-top: 1px solid #eef0f4;
  font-size: 0.85rem;
}

/* Backdrop mobile (masqué par défaut) */
.alexone-sidebar-backdrop { display: none; }

/* ====================== RESPONSIVE (mobile / tablette) ====================== */
@media (max-width: 991.98px) {
  .alexone-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.26s ease;
    box-shadow: 0 0 60px rgba(20, 16, 46, 0.25);
  }
  .alexone-shell.mobile-open .alexone-sidebar { transform: translateX(0); }
  /* en mobile on ignore le mode réduit : libellés visibles */
  .alexone-shell.collapsed .alexone-sidebar-logo .logo-full { display: block; }
  .alexone-shell.collapsed .alexone-sidebar-logo .logo-mini { display: none; }
  .alexone-shell.collapsed .alexone-nav-link .label,
  .alexone-shell.collapsed .alexone-nav-section { display: block; }
  .alexone-shell.collapsed .alexone-nav-arrow { display: inline; }
  .alexone-shell.collapsed .alexone-nav-link { justify-content: flex-start; padding: 13px 14px; }
  .alexone-shell.collapsed .alexone-nav-link .icon { font-size: 1.5rem; width: 28px; }
  .alexone-shell.collapsed .alexone-nav-item.open > .alexone-subnav { display: block; max-height: 420px; }
  .alexone-flyout { display: none !important; }

  /* Mobile : menu plus grand et lisible */
  .alexone-nav-link { padding: 13px 14px; font-size: 1rem; gap: 14px; }
  .alexone-nav-link .icon { font-size: 1.55rem; width: 28px; }
  .alexone-nav-section { font-size: 0.72rem; padding: 16px 14px 8px; }
  .alexone-sublink { padding: 11px 14px 11px 56px; font-size: 0.95rem; }
  .alexone-sublink .dot { width: 7px; height: 7px; }
  .alexone-sidebar-logo { height: 90px; }
  .alexone-sidebar-logo .logo-full { max-height: 52px; }
  .alexone-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 46, 0.45);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
  }
  .alexone-shell.mobile-open .alexone-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .alexone-topbar { padding: 10px 16px; }
  .alexone-footer { padding: 14px 16px; text-align: center; }
}

/* =========================  SIDEBAR (ancienne, legacy)  ========================= */
.app-sidebar {
  background: #ffffff !important;
  border-right: 1px solid #eef0f4;
}

/* Logo en pleine largeur de la sidebar */
#kt_app_sidebar_logo,
#kt_app_sidebar_logo a,
.app-sidebar-logo-default {
  display: block;
  width: 100%;
}
.alexone-logo-box {
  display: block;
  width: 100%;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.alexone-logo-box img {
  width: 88%;
  height: auto;
  display: block;
}
/* Version réduite (sidebar minimisée) */
.alexone-logo-box-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
}
.alexone-logo-box-mini img {
  width: auto;
  height: 34px;
}

/* Liens du menu → texte violet foncé */
.app-sidebar .menu .menu-link,
.app-sidebar .menu .menu-link .menu-title {
  color: #4a4361;
}
.app-sidebar .menu .menu-icon i,
.app-sidebar .menu .menu-icon .ki-duotone,
.app-sidebar .menu .menu-icon [class^="flaticon-"] {
  color: #8a83a0;
}
.app-sidebar .menu .menu-bullet .bullet {
  background-color: #b3adc4;
}

/* Survol */
.app-sidebar .menu .menu-link:hover,
.app-sidebar .menu .menu-item:hover > .menu-link,
.app-sidebar .menu .menu-link:hover .menu-title {
  color: var(--alexone-purple) !important;
  background-color: rgba(41, 171, 226, 0.1) !important;
  border-radius: 8px;
}
.app-sidebar .menu .menu-link:hover .menu-icon i {
  color: var(--alexone-cyan) !important;
}

/* Actif / ouvert → pastille cyan, texte blanc */
.app-sidebar .menu > .menu-item.here > .menu-link,
.app-sidebar .menu > .menu-item.show > .menu-link,
.app-sidebar .menu > .menu-item > .menu-link.active {
  background-color: var(--alexone-cyan) !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(41, 171, 226, 0.3);
}
.app-sidebar .menu > .menu-item.here > .menu-link .menu-title,
.app-sidebar .menu > .menu-item > .menu-link.active .menu-title,
.app-sidebar .menu > .menu-item.here > .menu-link .menu-icon i,
.app-sidebar .menu > .menu-item > .menu-link.active .menu-icon i,
.app-sidebar .menu > .menu-item.here > .menu-link .menu-arrow:after,
.app-sidebar .menu > .menu-item > .menu-link.active .menu-arrow:after {
  color: #fff !important;
}

/* Sous-menu actif → fond cyan léger, texte cyan */
.app-sidebar .menu .menu-sub .menu-link.active,
.app-sidebar .menu .menu-sub .menu-item.show > .menu-link {
  background-color: rgba(41, 171, 226, 0.14) !important;
  border-radius: 8px;
}
.app-sidebar .menu .menu-sub .menu-link.active .menu-title {
  color: var(--alexone-cyan) !important;
}
.app-sidebar .menu .menu-sub .menu-link.active .menu-bullet .bullet,
.app-sidebar .menu .menu-link:hover .menu-bullet .bullet {
  background-color: var(--alexone-cyan) !important;
}

/* Flèches d'accordéon */
.app-sidebar .menu .menu-arrow:after {
  opacity: 0.7;
}

/* En-tête de section dans la sidebar */
.app-sidebar .menu .menu-heading {
  color: #9a93b0 !important;
}

/* =========================  TOOLBAR / CONTENU  ========================= */
.app-main {
  background-color: #f7f8fb;
}
.page-title {
  background: #fff;
  border-bottom: 1px solid #eef0f4;
}

/* Bouton "rubrique" à droite de la toolbar (sélecteur de programme) */
.alexone-program-btn {
  display: inline-flex;
  align-items: center;
  background: var(--alexone-cyan);
  border: 1px solid var(--alexone-cyan);
  border-radius: 8px;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(41, 171, 226, 0.3);
}
.alexone-program-btn span {
  color: #fff !important;
}
.alexone-program-btn:hover {
  background: #1e90c0;
  border-color: #1e90c0;
}

/* Boutons outils (recherche / notifications) */
.alexone-tool-btn {
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  background: #fff;
  color: #4a4361;
}
.alexone-tool-btn i {
  color: #4a4361;
}
.alexone-tool-btn:hover {
  border-color: var(--alexone-cyan);
  background: rgba(41, 171, 226, 0.08);
}
.alexone-tool-btn:hover i {
  color: var(--alexone-cyan) !important;
}

/* Pastille de notification */
.alexone-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f1416c;
  border: 1px solid #fff;
}

/* Photo de profil */
.app-navbar .symbol img {
  object-fit: cover;
}

/* Avatar de repli (initiales) si aucune photo Graph */
.alexone-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--alexone-cyan), var(--alexone-purple));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Toggle de sidebar */
#kt_app_sidebar_toggle.active .ki-toggle-on-circle {
  color: var(--alexone-cyan);
}

/* Cartes KPI (dashboard projets) */
.alexone-kpi {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 22px 24px;
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(43, 26, 82, 0.18);
  overflow: hidden;
  position: relative;
}
.alexone-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.alexone-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}
.alexone-kpi-label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 2px;
}
.alexone-kpi-cyan {
  background: linear-gradient(135deg, #2bb2e8, #1f9fd6);
}
.alexone-kpi-purple {
  background: linear-gradient(135deg, #4b2e83, #2b1a52);
}
.alexone-kpi-gradient {
  background: linear-gradient(135deg, #29abe2, #2b1a52);
}
.alexone-kpi-dark {
  background: linear-gradient(135deg, #2b1a52, #16102e);
}

/* Cartes KPI sobres (préférence DG : épuré, peu de couleurs) */
.alexone-kpi2 {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-left: 4px solid var(--kpi-accent, #29abe2);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(43, 26, 82, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.alexone-kpi2:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(43, 26, 82, 0.12);
}
.alexone-kpi2-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--kpi-soft, #eef6fb);
  color: var(--kpi-accent, #29abe2);
  flex-shrink: 0;
}
/* Accents doux par carte */
.alexone-kpi2-c1 { --kpi-accent: #29abe2; --kpi-soft: #e7f6fd; }
.alexone-kpi2-c2 { --kpi-accent: #6c4bd1; --kpi-soft: #efeafb; }
.alexone-kpi2-c3 { --kpi-accent: #17c653; --kpi-soft: #e6f9ed; }
.alexone-kpi2-c4 { --kpi-accent: #f6a609; --kpi-soft: #fff5e1; }
.alexone-kpi2-c5 { --kpi-accent: #0d9488; --kpi-soft: #e3f7f4; }
.alexone-kpi2-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.15;
  white-space: nowrap;
}
.alexone-kpi2 > div:last-child { min-width: 0; }
.alexone-kpi2-label {
  font-size: 0.9rem;
  color: #6c6783;
  margin-top: 4px;
  line-height: 1.25;
}
.alexone-kpi2-sub {
  font-size: 0.78rem;
  color: #a1a5b7;
  margin-top: 1px;
}
.alexone-kpi2-danger {
  --kpi-accent: #f1416c;
  --kpi-soft: #fff0f3;
}
.alexone-kpi2-danger .alexone-kpi2-value {
  color: #f1416c;
}

/* Fiche projet — hero */
.alexone-project-hero {
  background: linear-gradient(120deg, #1f1240 0%, #2b1a52 45%, #1f9fd6 100%);
  color: #fff;
  border-radius: 18px;
}
.alexone-project-hero .card-body {
  overflow: hidden;
}
.alexone-project-hero h2 {
  color: #fff !important;
  font-size: 2rem;
  letter-spacing: -0.3px;
}
.alexone-project-hero .alexone-hero-meta {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}
.alexone-project-hero .badge.badge-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(4px);
}
.alexone-hero-late {
  background: #f1416c;
  color: #fff;
}
.alexone-hero-deco {
  position: absolute;
  right: -25px;
  top: -30px;
  font-size: 11rem;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  transform: rotate(-10deg);
}
/* Bandeau financier intégré au hero */
.alexone-hero-finance {
  display: flex;
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.alexone-hero-fin-item {
  flex: 1;
  padding: 16px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}
.alexone-hero-fin-item:last-child {
  border-right: none;
}
.alexone-hero-fin-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.75);
}
.alexone-hero-fin-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
}
.alexone-hero-fin-main {
  background: rgba(41, 171, 226, 0.25);
}
.alexone-hero-fin-main .alexone-hero-fin-value {
  font-size: 1.7rem;
}

/* Chips de répartition BU */
.alexone-share-chip {
  min-width: 220px;
  padding: 14px 16px;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  background: #fbfcfe;
}

/* Boutons d'action en icônes (listes) */
.alexone-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #eef0f4;
  background: #fff;
  color: #8a83a0;
  margin-left: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.alexone-act:hover {
  background: #e7f6fd;
  color: #29abe2;
  border-color: #bfe6f8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(41, 171, 226, 0.18);
}
.alexone-act-edit:hover {
  background: #efeafb;
  color: #6c4bd1;
  border-color: #dcd2f5;
  box-shadow: 0 4px 10px rgba(108, 75, 209, 0.18);
}
.alexone-act-danger:hover {
  background: #fff0f3;
  color: #f1416c;
  border-color: #ffd6df;
  box-shadow: 0 4px 10px rgba(241, 65, 108, 0.18);
}
/* Boutons d'action déployés depuis le menu « 3 points » : couleurs (hover) affichées d'emblée */
.alexone-act.act-on-view {
  background: #e7f6fd;
  color: #29abe2;
  border-color: #bfe6f8;
}
.alexone-act.act-on-edit {
  background: #efeafb;
  color: #6c4bd1;
  border-color: #dcd2f5;
}
.alexone-act.act-on-danger {
  background: #fff0f3;
  color: #f1416c;
  border-color: #ffd6df;
}

/* Menu déroulant « 3 points » : ancré à côté du bouton (pattern kebab, positionné en fixed via JS) */
.alexone-act-menu {
  min-width: 180px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(20, 23, 39, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.alexone-act-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #3f4254;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.12s ease;
}
.alexone-act-menu-item:hover {
  background: #f4f6fa;
}
.alexone-act-menu-item.text-danger:hover {
  background: #fff0f3;
}

/* KPI encaissement (règlements) */
.alexone-pay-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f4f6fa;
  border-left: 4px solid #c7cddb;
  height: 100%;
}
.alexone-pay-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a86a1;
  font-weight: 600;
}
.alexone-pay-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1b2559;
}
.alexone-pay-kpi.ok { border-left-color: #21b573; background: #eafaf2; }
.alexone-pay-kpi.wait { border-left-color: #f1b34a; background: #fdf6e9; }
.alexone-pay-kpi.due { border-left-color: #29abe2; background: #e9f7fd; }

/* Modal de répartition BU */
.alexone-bu-modal {
  width: min(680px, 95vw);
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(20, 16, 46, 0.45);
  max-height: 85vh;
  overflow-y: auto;
  animation: alexone-pop 0.2s cubic-bezier(0.2, 1, 0.7, 1);
}
.alexone-bu-owner-row > td {
  background: #eaf6fd;
}

/* Répartition BU par lot — pastilles */
.alexone-bu-shares {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.alexone-bu-shares-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa4bf;
  margin-right: 2px;
}
.alexone-bu-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid #e6e8f0;
  border-radius: 10px;
  background: #fff;
}
.alexone-bu-pill.owner {
  background: #eaf6fd;
  border-color: #bfe3fa;
}
.alexone-bu-pill-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: #1b2559;
}
.alexone-bu-pill-pct {
  background: #29abe2;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.4;
}
.alexone-bu-pill-amt {
  font-size: 0.74rem;
  color: #7a86a1;
  white-space: nowrap;
}
.alexone-bu-pill-select {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.82rem;
  color: #1b2559;
  min-width: 120px;
  padding: 0;
  cursor: pointer;
  outline: none;
}
.alexone-bu-pill-input {
  border: 1px solid #e6e8f0;
  border-radius: 6px;
  width: 52px;
  text-align: right;
  padding: 2px 6px;
  font-size: 0.8rem;
  background: #f7f9fc;
  outline: none;
}
.alexone-bu-pill-x {
  border: none;
  background: transparent;
  color: #c25;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}
.alexone-bu-pill-x:hover {
  color: #f1416c;
}

/* Carte Objectif Commercial */
.alexone-objectif {
  border-left: 4px solid var(--alexone-cyan) !important;
}
.alexone-objectif-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf6fd;
  color: var(--alexone-cyan);
  flex-shrink: 0;
}
.alexone-objectif-bar {
  flex: 1 1 240px;
  min-width: 220px;
}
@media (max-width: 991.98px) {
  .alexone-objectif-bar { flex-basis: 100%; }
}

/* Pagination */
.alexone-pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.alexone-pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e6e8f0;
  background: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #3f4254;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.alexone-pagination button:hover:not(:disabled) {
  border-color: var(--alexone-cyan);
  color: var(--alexone-cyan);
}
.alexone-pagination button.active {
  background: var(--alexone-cyan);
  border-color: var(--alexone-cyan);
  color: #fff;
}
.alexone-pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}
.alexone-pagination-dots {
  min-width: 24px;
  text-align: center;
  color: #a1a5b7;
  font-weight: 700;
}

/* Ligne dépliée — lots du projet (liste) */
.alexone-expand-row > td {
  background: #f6f9fc;
  border-bottom: 2px solid #e9edf4 !important;
}

/* Champs montants éditables (Pilotage) — fond blanc, chiffres en gras */
.alexone-num-edit {
  background: #fff !important;
  border: 1px solid #e4e6ef !important;
  font-weight: 700 !important;
  font-size: 0.98rem !important;
  color: #1b2559 !important;
}
.alexone-num-edit:focus {
  border-color: var(--alexone-cyan) !important;
  box-shadow: 0 0 0 0.1rem rgba(41, 171, 226, 0.18) !important;
}

/* Ratios Pilotage — rectangle clair, en gras (couleur via text-danger/warning/success) */
.alexone-ratio {
  display: inline-block;
  min-width: 64px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 1.02rem;
  color: #1b2559;
  text-align: center;
}

/* Modal d'analyse Pilotage — barres de progression (style jauge) */
.alexone-pbar {
  position: relative;
  height: 16px;
  background: #eef1f6;
  border-radius: 9px;
}
.alexone-pbar .fill {
  position: relative;
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, #29abe2, #2b1a52);
  transition: width 0.4s ease;
  min-width: 9px;
}
.alexone-pbar .thumb {
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #29abe2;
  box-shadow: 0 2px 8px rgba(41, 171, 226, 0.45);
}

/* Bouton capacité de production (ouvre le modal) */
.alexone-cap-btn {
  display: inline-flex;
  align-items: center;
  border: 1px dashed #cdd5e3;
  background: #f9fbfe;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.alexone-cap-btn:hover { border-color: var(--alexone-cyan); background: #eef8fe; }

/* Indicateurs repliables (Taux d'encaissement, Objectif commercial) */
.alexone-ind {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(20, 16, 46, 0.04);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.alexone-ind.open { box-shadow: 0 10px 34px rgba(20, 16, 46, 0.09); }
.alexone-ind-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.alexone-ind-head:hover { background: #fafbfd; }
.alexone-ind-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.alexone-ind-icon.c-cyan { background: #eaf6fd; color: var(--alexone-cyan); }
.alexone-ind-icon.c-purple { background: #efeafa; color: var(--alexone-purple); }
.alexone-ind-title { font-weight: 700; color: #1b2559; font-size: 1rem; }
.alexone-ind-headline { margin-left: auto; font-weight: 800; font-size: 1.18rem; color: #1b2559; }
.alexone-ind-chev { color: #b5b9c8; transition: transform 0.2s; font-size: 1rem; }
.alexone-ind.open .alexone-ind-chev { transform: rotate(180deg); }
.alexone-ind-body { padding: 12px 18px 16px; border-top: 1px solid #f3f5f9; }

/* Jauge milestone — Objectif commercial */
.alexone-goal { padding-top: 58px; }
.alexone-goal-track {
  position: relative;
  height: 9px;
  background: #eef1f6;
  border-radius: 6px;
}
.alexone-goal-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #29abe2, #2b1a52);
  transition: width 0.4s ease;
}
.alexone-goal-fill.done { background: linear-gradient(90deg, #2ecc71, #1eae63); }
.alexone-goal-tick {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 3px;
}
.alexone-goal-tick.start { left: -1px; background: #c4cad8; }
.alexone-goal-tick.end { right: -1px; background: #2b1a52; }
.alexone-goal-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #29abe2;
  box-shadow: 0 3px 9px rgba(41, 171, 226, 0.4);
  z-index: 3;
}
.alexone-goal-bubble {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  background: #29abe2;
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(41, 171, 226, 0.35);
}
.alexone-goal-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #29abe2;
}
/* Près du départ : la bulle s'ancre à droite du curseur (évite le débordement gauche). */
.alexone-goal-bubble.edge-left { left: -10px; transform: none; }
.alexone-goal-bubble.edge-left::after { left: 16px; transform: none; }
/* Près de l'objectif : la bulle s'ancre à gauche du curseur. */
.alexone-goal-bubble.edge-right { left: auto; right: -10px; transform: none; }
.alexone-goal-bubble.edge-right::after { left: auto; right: 16px; transform: none; }
.alexone-goal-bubble .lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.alexone-goal-bubble .val { font-weight: 800; font-size: 1.05rem; }
/* Deux puces sur la même piste : « Actuel » (cyan, bas) + « CA comptable » (violet foncé, empilée au-dessus). */
.alexone-goal.dual { padding-top: 104px; }
.alexone-goal-thumb.comptable { border-color: #2b1a52; box-shadow: 0 3px 9px rgba(43, 26, 82, 0.4); }
.alexone-goal-bubble.comptable { background: #2b1a52; bottom: 74px; box-shadow: 0 6px 16px rgba(43, 26, 82, 0.35); }
.alexone-goal-bubble.comptable::after { border-top-color: #2b1a52; }
.alexone-goal-foot { display: flex; align-items: flex-start; margin-top: 16px; gap: 12px; }
.alexone-goal-foot .lbl { font-size: 0.7rem; text-transform: uppercase; color: #a1a5b7; font-weight: 700; letter-spacing: 0.04em; }
.alexone-goal-foot .val { font-weight: 800; color: #1b2559; font-size: 1.5rem; }
.alexone-goal-foot .end-pt { flex: 0 0 auto; }
.alexone-goal-foot .mid { flex: 1 1 auto; text-align: center; align-self: center; display: flex; flex-direction: column; gap: 2px; }
.alexone-goal-foot .mid .pct { font-weight: 800; color: #1b2559; font-size: 1.5rem; }
.alexone-goal-foot .mid .delta { font-size: 0.9rem; font-weight: 700; }

/* Jalons sur la piste (Charges BU / Capacité de production) */
.alexone-goal-mark { position: absolute; top: 50%; width: 3px; height: 18px; transform: translate(-50%, -50%); border-radius: 2px; z-index: 2; }
.alexone-goal-mark.cout { background: #f1416c; }
.alexone-goal-mark.capa { background: #7239ea; }
/* Jalons alignés sous leurs repères : Départ → Charges → Capacité → Objectif CA */
.alexone-goal-steps { position: relative; height: 46px; margin-top: 16px; }
.alexone-goal-steps .step { position: absolute; top: 0; }
.alexone-goal-steps .step.at-start { transform: translateX(0); text-align: left; }
.alexone-goal-steps .step.at-mid { transform: translateX(-50%); text-align: center; }
.alexone-goal-steps .step.at-end { transform: translateX(-100%); text-align: right; }
.alexone-goal-steps .lbl { font-size: 0.68rem; text-transform: uppercase; color: #a1a5b7; font-weight: 700; letter-spacing: 0.03em; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.alexone-goal-steps .step.at-mid .lbl { justify-content: center; }
.alexone-goal-steps .step.at-end .lbl { justify-content: flex-end; }
.alexone-goal-steps .val { font-weight: 800; color: #1b2559; font-size: 1.05rem; white-space: nowrap; }
.alexone-goal-steps .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.alexone-goal-steps .dot.cout { background: #f1416c; }
.alexone-goal-steps .dot.capa { background: #7239ea; }
.alexone-goal-midline { text-align: center; margin-top: 14px; }
.alexone-goal-midline .pct { font-weight: 800; color: #1b2559; font-size: 1.4rem; display: block; }
.alexone-goal-midline .delta { font-size: 0.9rem; font-weight: 700; }

/* Item de lot à facturer (modal de sélection) */
.alexone-bill-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; gap: 12px;
  padding: 10px 14px; border: 1px solid #e4e6ef; border-radius: 10px;
  background: #fff; transition: all 0.15s ease;
}
.alexone-bill-item:hover { border-color: #29abe2; background: #f1faff; box-shadow: 0 2px 10px rgba(41,171,226,0.12); }
.alexone-bill-item.selected { border-color: #29abe2; background: #e7f6fd; box-shadow: 0 0 0 1px #29abe2 inset; }

/* Intitulé de section au-dessus d'une rangée de KPI */
.alexone-kpi-section {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a5b7;
  margin-bottom: 10px;
}

/* Chevron repliable (blocs de lots) */
.alexone-chevron {
  transition: transform 0.2s ease;
}
.alexone-chevron.open {
  transform: rotate(-180deg);
}
/* Sous-ligne "BU affectée(s)" sous chaque lot */
.alexone-lot-bu-row > td {
  background: #f6f9fc;
  border-top: none !important;
  border-radius: 0 0 8px 8px;
}

/* Colonnes de facture — chips glissables (drag & drop) */
.alexone-col-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e7f6fd;
  color: #1b6f96;
  border: 1px solid #bfe6f8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: all 0.12s ease;
}
.alexone-col-chip:active {
  cursor: grabbing;
}
.alexone-col-chip.dragging {
  opacity: 0.4;
}
.alexone-col-chip.over {
  border-color: #29abe2;
  box-shadow: 0 0 0 2px rgba(41, 171, 226, 0.35);
  transform: translateY(-2px);
}
.alexone-col-chip i {
  opacity: 0.55;
}
.alexone-col-chip-x {
  color: #c25;
  margin-left: 2px;
}
.alexone-col-chip-x:hover {
  color: #f1416c;
}

/* Barre de progression (taux de réalisation) */
.alexone-progress {
  height: 10px;
  background: #edf0f5;
  border-radius: 20px;
  overflow: hidden;
  width: 100%;
}
.alexone-progress-bar {
  height: 100%;
  min-width: 6px;
  background: linear-gradient(90deg, #29abe2, #6c4bd1);
  border-radius: 20px;
  transition: width 0.4s ease;
}
.alexone-progress-lg {
  height: 18px;
}

/* ============================ Responsive mobile ============================ */
@media (max-width: 991.98px) {
  .app-content .app-container.px-7,
  .page-title.px-7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .alexone-project-hero h2 {
    font-size: 1.4rem;
  }
  .alexone-kpi2 {
    padding: 16px;
  }
  .alexone-kpi2-value {
    font-size: 1.2rem;
  }
  /* Filtres / recherche : pleine largeur sur mobile */
  .card-header .form-control[class*="w-"],
  .card-header .form-select[class*="w-"] {
    width: 100% !important;
  }
  /* Logo sidebar un peu plus compact */
  .alexone-logo-box img {
    width: 78%;
  }
}
@media (max-width: 575.98px) {
  .alexone-project-hero .card-body {
    padding: 1.25rem !important;
  }
  .alexone-toast {
    left: 12px;
    right: 12px;
    min-width: 0;
    max-width: none;
  }
  .page-title h1.page-heading {
    font-size: 1.1rem;
  }
}

/* Modal de confirmation / saisie */
.alexone-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 46, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1090;
  animation: alexone-fade 0.15s ease;
}
.alexone-modal {
  width: 430px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 18px;
  padding: 30px 28px 24px;
  box-shadow: 0 24px 70px rgba(20, 16, 46, 0.4);
  text-align: center;
  animation: alexone-pop 0.2s cubic-bezier(0.2, 1, 0.7, 1);
}
.alexone-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.alexone-modal-icon.danger { background: #fff0f3; color: #f1416c; }
.alexone-modal-icon.primary { background: #e7f6fd; color: #29abe2; }
.alexone-modal-title { font-weight: 800; color: #1a1a2e; margin-bottom: 8px; }
.alexone-modal-message { color: #6c6783; margin-bottom: 24px; }
.alexone-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  background: #f9f9fb;
  margin-bottom: 20px;
}
.alexone-modal-input:focus { outline: none; border-color: #29abe2; }
.alexone-modal-actions { display: flex; gap: 12px; justify-content: center; }

/* Aperçu PDF (modal large) */
.alexone-pdf-modal {
  width: min(920px, 95vw);
  background: #fff;
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 24px 70px rgba(20, 16, 46, 0.45);
  animation: alexone-pop 0.2s cubic-bezier(0.2, 1, 0.7, 1);
}
.alexone-pdf-frame {
  width: 100%;
  height: 72vh;
  border: none;
  border-radius: 8px;
  background: #525659;
}
@keyframes alexone-pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes alexone-fade { from { opacity: 0; } to { opacity: 1; } }

/* Toast de confirmation */
.alexone-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(43, 26, 82, 0.22);
  border-left: 5px solid var(--alexone-cyan);
  animation: alexone-toast-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.alexone-toast-success {
  border-left-color: #17c653;
}
.alexone-toast-success i {
  color: #17c653;
}
.alexone-toast-error {
  border-left-color: #f1416c;
}
.alexone-toast-error i {
  color: #f1416c;
}
.alexone-toast .fw-bold {
  color: #1a1a2e;
}
.alexone-toast-close {
  margin-left: auto;
  color: #a1a5b7;
  font-size: 0.9rem;
}
.alexone-toast-close:hover {
  color: #4a4361;
}
@keyframes alexone-toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Recherche annuaire (typeahead) */
.alexone-typeahead {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(43, 26, 82, 0.15);
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.alexone-typeahead-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.alexone-typeahead-item:hover {
  background: rgba(41, 171, 226, 0.1);
}
