/* GRILLE 2x2 PRINCIPALE */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 colonnes égales */
  grid-template-rows: auto auto; /* Laisse chaque rangée prendre sa hauteur naturelle */
  gap: 24px; /* Espacement entre les cellules */
  height: auto; /* Laisse la grille prendre la hauteur nécessaire sans scroll interne */
  max-width: 100%;
  width: 100%; /* ✅ AJOUT CRUCIAL */
}

.grid-item {
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important pour éviter le débordement */
  min-width: 0; /* ✅ AJOUT CRUCIAL pour forcer le redimensionnement */
  width: 100%;
}

.grid-item h2 {
  color: #1A1A47 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 600 !important;
  font-size: 22px !important;
  margin-bottom: 16px;
  margin-top: 0;
  flex-shrink: 0; /* Empêche le titre de rétrécir */
}

.grid-item .card {
  flex: 1; /* Prend tout l'espace restant */
  background-color: #F9F9FF;
  border-radius: 12px;
  border: 0.7px solid #CACAE8;
  padding: 24px;
  box-shadow: 0 5px 14px rgba(26, 26, 71, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%; /* ✅ FORCE la largeur */
  min-width: 0; /* ✅ PERMET le redimensionnement */
  max-width: 100%; /* ✅ ÉVITE le débordement */
}

.grid-item .card-body {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: visible; /* Stop inner scroll; let content define height */
  width: 100%; /* ✅ FORCE la largeur */
  min-width: 0; /* ✅ PERMET le redimensionnement */
}

/* ✅ NOTIFICATION ITEMS - RESPONSIVE */
.notification-item {
  padding: 8px !important;
  border: 1px solid #CACAE8 !important;
  border-radius: 6px !important;
  background-color: #E5E5F9 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin-bottom: 8px !important;
}

.notification-item > div:first-child {
  flex: 1 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  margin-right: 8px !important;
  min-width: 0 !important; /* ✅ CRUCIAL pour le text-overflow */
}

.notification-item p {
  margin: 0 !important;
  color: #51518F !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 18px !important;
  max-width: 100% !important;
}

.notification-item a {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  color: #51518F !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}


/* POUR LES SECTIONS 3 ET 4 - GRILLE PARFAITE 1x2 */
.status-cards-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 16px;
  /* Remplit tout l'espace disponible pour permettre l'égalisation des hauteurs */
  flex: 1 1 auto;
  height: 100%;
  min-height: 0; /* ✅ AJOUT */
  overflow: visible; /* Plus de masquage/scroll interne */
  align-items: stretch; /* ✅ Assure que toutes les cartes ont la même hauteur (hauteur de la plus grande) */
  align-content: stretch; /* ✅ S'assure que la piste occupe toute la hauteur */
}

.status-cards-wrapper .card {
  min-height: 0; /* ✅ AJOUT CRUCIAL */
  min-width: 0; /* ✅ AJOUT CRUCIAL */
  display: flex;
  flex-direction: column;
  overflow: visible; /* Laisse le contenu s'afficher entièrement */
  height: 100%; /* ✅ Étire chaque carte à la hauteur de la piste (la plus grande) */
}

.status-cards-wrapper .card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0; /* Vous l'avez déjà */
  overflow: visible; /* Stop scroll for section cards */
  min-height: unset; /* Laisse la hauteur s'ajuster au contenu */
}

.inactive-screen-item h5 {
  color: #51518F !important;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 16px !important;
  margin-bottom: 4px;
  margin-top: 0;
}

.inactive-screen-item p {
  color: #51518F !important;
  margin-bottom: 0;
  font-size: 14px;
  opacity: 0.8;
}

.sidebar a:hover {
  color: #F9F9FF !important;
  text-decoration: none;
}


/* STYLES EXISTANTS - RESTAURÉS */

.fleet-management.container-fluid {
  overflow: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none
}

/* Chrome, Edge, Safari */
&::-webkit-scrollbar {
  display: none;
}

.fleet-management.container-fluid {
  padding: 0 !important;
  height: 100%;
  min-height: 100%;
}

.fleet-management.card-body {
  padding: 0;
  height: 100%;
  min-height: 100%;
}

.welcome-text {
  font-size: 1rem;
  color: #5A5A9A;
  margin-bottom: 1rem;
}

/* FLEX - RESTAURÉS ET PRÉSERVÉS */
.disconnected-screen-flex {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 0;
}

/* Modifier: column layout for placing total above stats (only when explicitly added) */
.disconnected-screen-flex.column-layout {
  flex-direction: column;
  align-items: stretch;
  gap: 0px;
}

.disconnected-screen-flex.column-layout .total-section {
  width: 100%;
}

.total-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Unified one-line total row for Active and Inactive */
.total-inline {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap; /* stay on one line until there isn't enough space, then wrap */
  min-width: 0; /* allow shrinking inside grid/cards */
}

/* Keep the label on a single word/line; let the value wrap if needed */
.total-inline .special-text-management {
  white-space: nowrap;
}

.total-inline .total-value,
.total-value {
  color: #8787BF !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  min-width: 0; /* allow wrapping when space is tight */
  overflow-wrap: anywhere;
}

.stats-section {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

/* Vertical list for Active screens right column */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.number-text-align-flex {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.number-text-align-flex a {
  display: inline-block;
  padding-bottom: 8px;
}

.fleet-management {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  overflow: visible;
  max-height: none;
}

.inactive-reason-card {
  flex: 1 1 calc(50% - 8px);
  min-width: 250px;
  margin-bottom: 16px;
}

@container (max-width: 470px) {
  .fleet-management {
    flex-direction: column !important;
  }

  .fleet-management > * {
    width: 100% !important;
    flex: none !important;
  }
}

.stats-item-flex {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 8px;
}

.player-alerts .stats-item-flex,
.management-issues .stats-item-flex {
  display: grid;
  grid-template-columns: auto 1fr; /* Résultat à gauche, texte à droite */
  align-items: baseline; /* Aligne les chiffres et le texte sur la même ligne */
  column-gap: 12px;
  row-gap: 0; /* pas d'écart vertical pour éviter l'effet "à la ligne" */
  margin-bottom: 16px;
}
.player-alerts .stats-item-flex p,
.management-issues .stats-item-flex p { margin: 0; grid-column: 2; grid-row: 1; align-self: baseline; }
.player-alerts .stats-item-flex strong,
.management-issues .stats-item-flex strong { justify-self: start; text-align: left; grid-column: 1; grid-row: 1; align-self: baseline; }
.player-alerts .stats-item-flex strong a,
.management-issues .stats-item-flex strong a { font-variant-numeric: tabular-nums; }
/* TEXT */
.fleet-management.container-fluid h1 {
  margin-bottom: 8px;
  color: #1A1A47 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 600 !important;
  font-size: 30px !important;
}

.welcome-text {
  color: #1A1A47;
  font-family: "Jost", sans-serif;
  font-size: 20px;
  margin-top: 0;
  margin-bottom: -24px;
}

.fleet-management.container-fluid h2 {
  color: #1A1A47 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 600 !important;
  font-size: 22px !important;
  margin-bottom: 16px;
  margin-top: 24px;
}

.fleet-management h4 {
  color: #51518F !important;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 22px !important;
  margin-bottom: 32px;
}

.special-text-management {
  color: #51518F !important;
  margin-bottom: 8px;
  font-size: 18px !important;
  font-weight: 600 !important;
}

.special-text-management-inactive {
  color: #51518F !important;
  margin-bottom: 8px;
  font-size: 18px !important;
  font-weight: 600 !important;
  margin-right: 8px !important;
}

.special-text-management-bold {
  font-size: 20px;
  color: #51518F !important;
  font-family: 'Jost', sans-serif;
  margin-bottom: 0;
  font-weight: 600;
}

.special-text-management-primary {
  color: #0C7BFD !important;
  font-size: 18px;
  margin-bottom: 24px;
}

.inactive-grid p {
  color: #51518F !important;
  font-size: 18px;
}

.text-red {
  color: #EC4540;
}

.text-orange {
  color: #FDB013;
}

.text-green {
  color: #0ACF97;
}

.margin-bottom-results {
  margin-bottom: 24px !important;
}

.small-text-total {
  color: #8787BF !important;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 16px !important;
  margin-top: 8px;
  font-style: italic;
}

/* BUTTONS */

.page-container a:hover {
  text-decoration: none;
  color: #51518F;
}

/* RESPONSIVE DESIGN - MOBILE */
@media (max-width: 767px) {

  .sidebar-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .sidebar-content a:hover {
    color: #8787BF !important;
    text-decoration: none;
  }

  /* ✅ Container principal */
  .fleet-management.container-fluid {
    padding: 16px !important;
    height: auto !important;
    min-height: auto !important;
  }

  /* ✅ Header mobile optimisé */
  .fleet-management.col-12 h1 {
    font-size: 24px !important;
    margin-bottom: 8px;
  }

  .welcome-text {
    font-size: 16px !important;
    margin-bottom: 24px !important;
  }

  /* ✅ Grille mobile - 1 colonne */
  .dashboard-grid {
    grid-template-columns: 1fr !important; /* Force 1 colonne */
    grid-template-rows: auto auto auto auto !important; /* 4 lignes auto */
    gap: 16px !important;
    height: auto !important; /* Hauteur automatique */
    padding: 0 !important;
    max-width: 100%;
  }

  /* ✅ Chaque item de grille */
  .grid-item {
    min-height: auto !important;
    width: 100%;
  }

  .grid-item h2 {
    font-size: 20px !important;
    margin-bottom: 12px !important;
  }

  .grid-item .card {
    padding: 16px !important;
    min-height: auto !important;
  }

  /* ✅ Cartes status empilées sur mobile */
  .status-cards-wrapper {
    grid-template-columns: 1fr !important; /* Force 1 colonne */
    grid-template-rows: auto auto !important; /* 2 lignes automatiques */
    gap: 12px !important;
    height: auto !important;
  }

  .status-cards-wrapper .card {
    min-height: auto !important;
    overflow: visible !important;
  }

  .status-cards-wrapper .card .card-body {
    overflow: visible !important;
    height: auto !important;
  }

  /* ✅ Section déconnectée mobile */
  .disconnected-screen-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 20px !important;
    padding: 0 !important;
  }

  .total-section {
    width: 100%;
    text-align: left;
  }

  .stats-section {
    flex-direction: column !important;
    gap: 16px !important;
    width: 100%;
  }

  /* ✅ Inactive screens mobile */
  .inactive-screens-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 8px !important;
  }

  .fleet-management .col-12.col-sm-6.mb-3 {
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  /* ✅ Textes et boutons mobile */
  .special-text-management {
    font-size: 16px !important;
  }

  .special-text-management-bold {
    font-size: 20px !important;
  }

  .fleet-management h4 {
    font-size: 18px !important;
    margin-bottom: 16px !important;
  }

  .btn-see-all-notif {
    font-size: 14px !important;
    padding: 6px 12px !important;
  }

  /* ✅ Player alerts mobile */
  .number-text-align-flex {
    flex-direction: row !important;
    gap: 12px !important;
  }

  .number-text-align-flex a {
    padding-bottom: 4px !important;
  }

  /* ✅ Fix pour les notifications - CORRIGÉ */
  .notification-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important; /* ✅ AJOUT */
    box-sizing: border-box !important; /* ✅ AJOUT */
  }

  .notification-item div:first-child {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    width: 100% !important; /* ✅ CRUCIAL */
    max-width: 100% !important; /* ✅ CRUCIAL */
    word-wrap: break-word !important; /* ✅ FORCE la coupure des mots */
    overflow-wrap: break-word !important; /* ✅ Support moderne */
    hyphens: auto !important; /* ✅ Césure automatique */
  }

  .notification-item p {
    width: 100% !important; /* ✅ AJOUT */
    max-width: 100% !important; /* ✅ AJOUT */
    word-wrap: break-word !important; /* ✅ FORCE la coupure */
    overflow-wrap: break-word !important; /* ✅ Support moderne */
    white-space: normal !important; /* ✅ Permet les retours à la ligne */
    margin: 0 !important;
    color: #51518F !important;
    font-size: 16px !important;
    line-height: 1.4 !important; /* ✅ Meilleure lisibilité */
  }

  .notification-item a {
    align-self: flex-end !important;
    font-size: 14px !important;
    flex-shrink: 0 !important; /* ✅ Empêche le lien de rétrécir */
    max-width: 100% !important; /* ✅ Au cas où le lien serait long */
    word-wrap: break-word !important; /* ✅ Au cas où */
  }
}

.special-text-management-primary:hover {
  text-decoration: none !important;
  color: #51518F !important;
}

.sidebar-content a:hover, a:focus, a:focus-visible, a:focus-within, a:active, a:target {
  text-decoration: none !important;
  color: #51518F;
}

.sidebar-content a:focus {
  text-decoration: none !important;
  color: #6565a6;
}

.btn-notif {
  background-color: #8787BF;
  color: #F9F9FF;
  border: 1px solid #CACAE8;
  font-size: 16px;
}

.btn-notif:disabled {
  background-color: #aeaedc;
  color: #F9F9FF;
  border: 1px solid #CACAE8;
  font-size: 16px;
}


.btn-notif:hover {
  background-color: #7575af;
  color: #F9F9FF !important;
  border: 1px solid #CACAE8;
  font-size: 16px;
}
