.btn-primary{
background-color:  #438EB9;
border:#438EB9 ;
}
.btn-primary:hover{
background-color:  #1f7cb1;
}
.text-Primary{
   color:  #438EB9;
}

.btn-red{
background-color:  #852b23da;
color:white;
}
.bg-red{
background-color:  #852b23da;
color: white;
}
/* === GLOBAL === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #e9f0f7;
  margin: 0;
  padding-top: 60px; 
}
main {
  margin-left: 250px;
  padding-top: 10px; /* Ajusté pour compenser le navbar fixe */
  transition: margin-left 0.3s ease;
}
html, body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}


/* === SIDEBAR === */
#sidebar {
  width: 250px;
  transition: width 0.3s ease;
  background: #fff;
  min-height: 100vh;
  border-right: 1px solid #ddd;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1030; /* au-dessus du contenu normal */
}

#sidebar.collapsed {
  width: 70px;
}

#sidebar img.logo {
  max-width: 170px;
  transition: all 0.3s ease;
}

#sidebar.collapsed img.logo {
  max-width: 45px;
}
#userSub a{
  margin-top: 5px;
}

/* MENU */
#menuSidebar .nav-link {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 600;
  color: #333;
  transition: background 0.2s ease, color 0.2s ease;
  gap: 12px;
}

#menuSidebar .nav-link:hover{
  background-color: #e6f0fa;
  color: #438EB9;
}
#menuSidebar .nav-link:hover i{
  color: #438EB9;
}
#menuSidebar .nav-link.active {
  background-color: #e6f0fa;
  color: #852b23da;
}
#menuSidebar .nav-link.active i {
  color: #852b23da;
}


#sidebar.collapsed .nav-link span {
  display: none;
}

/* PARAMETRES EN BAS */
#sidebar .nav-link i {
  stroke-width: 2;
  min-width: 24px;
}

/* TOGGLE BUTTON */
#toggleSidebar {
  background: none;
  border: none;
  color: #438EB9;
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  transition: transform 0.3s ease;
}
#toggleSidebar:hover {
  background: #e6f0fa;
  border-radius: 8px;
}

/* === NAVBAR === */
.navbar {
  background-color: #438EB9 !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1020; /* Moins que le sidebar */
  height: 60px;
  padding-left: 250px; /* Pour ne pas chevaucher le sidebar */
  transition: padding-left 0.3s ease;
}


.navbar .navbar-brand {
  color: white;
  font-size: 1.2rem;
}

.navbar input.form-control {
  border-radius: 4px; /* bords légèrement arrondis */
  width: 200px; /* largeur fixe confortable */
  height: 32px; /* un peu plus petit */
 padding: 4px 10px; 
}
.navbar img {
  border: 2px solid white;
}

/* === MAIN CONTENT === */
main {
  flex-grow: 1;
}
.cardUser{
  background-color: #852b23da;
  border-radius: 5px;
}

.cardUser h6 {
  font-weight: bold;
  color: #333;
}

/* === CHARTS === */
canvas {
  width: 100% !important;
  height: auto !important;
}

/* === DROPDOWN UTILISATEUR === */
.dropdown-menu {
  font-size: 0.9rem;
  border-radius: 8px;
}

/* === SOUS-MENUS === */
.collapse .nav-link {
  padding-left: 35px;
  font-weight: 500;
}

/* === SCROLLBAR === */
#sidebar::-webkit-scrollbar {
  width: 6px;
}
#sidebar::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 6px;
}


.btn-toggle-mobile {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  margin-right: 10px;
}
/* === RESPONSIVE === */
@media (max-width: 992px) {
/* #sidebar {
    position: fixed;
    z-index: 1000;
    height: 100vh;
    left: -250px;
  } */
 #sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    height: 100%;
    z-index: 1040;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
  }

  #sidebar.show {
    left: 0;
  }

  #sidebar.collapsed {
    width: 70px;
  }
  .navbar {
    padding-left: 0 !important;
  }

  .navbar .navbar-brand {
    font-size: 1rem;
  }

  .navbar .form-control {
    width: 120px;
  }

 main {
    margin-left: 0 !important;
    padding-top: 10px; /* navbar toujours fixée */
  }
  

 /* les Ajouts */

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1039;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  #toggleSidebar {
    display: none !important;
  }
   .navbar .btn-toggle-mobile {
    display: inline-block;
  }
}
.card {
  border-radius: 12px;
  border: none;
}

.card-header {
  border-bottom: 1px solid #eee;
}

label.form-label {
  font-weight: 500;
  color: #333;
}

input.form-control, select.form-select {
  border-radius: 8px;
}
.footer {
  font-size: 14px;
  color: #6c757d;
  border-top: 1px solid #dee2e6;
}

/* style de page assignaffect */
#mapContainer {
  height: 500px;
  background-color: #f2f4f6;
  border: 1px solid #dcdcdc;
  width: 100%;
}

.card h6 {
  font-weight: 600;
  font-size: 16px;
}
/* === Pour s'assurer que le composant Chosen prend toute la largeur du parent === */
.chosen-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* === Pour harmoniser le style avec Bootstrap (taille, padding, bordure) === */
.chosen-container-single .chosen-single {
  height: 40px !important;
  padding: 8px 10px !important;
  border: 1px solid #ced4da;
  border-radius: 5px;
  background-color: #fff;
  font-size: 12px;
  line-height: 22px !important;
  box-shadow: none;
}

/* === Couleur de sélection dans la liste déroulante === */
.chosen-container .chosen-results li.highlighted {
  background-color: #438EB9;
  color: #fff;
}

/* Harmoniser DataTables avec Bootstrap */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 6px;
  border: 1px solid #ced4da;
  padding: 6px 12px;
  margin-left: 0.5em;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 6px;
  border: 1px solid #ced4da;
  padding: 6px 10px;
}

/* Améliorer la pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 12px;
  margin: 0 2px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid #438EB9;
  color: #438EB9 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #438EB9 !important;
  color: white !important;
  border-color: #438EB9 !important;
}

/* Hover effet */
.table-hover tbody tr:hover {
  background-color: #f5faff;
}

/* Actions buttons */
.table td .btn {
  padding: 4px 10px;
  font-size: 0.85rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.card .form-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.card .btn {
  font-weight: 500;
  font-size: 0.9rem;
}


/* === ANIMATION DU THÈME === */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card,
.navbar,
#sidebar,
.main-content,
.table,
.form-control,
.form-select {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === DARK MODE GLOBAL === */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}
/* === SIDEBAR === */
body.dark-mode #sidebar {
  background-color: #1e1e1e;
  border-right: 1px solid #333;
}

body.dark-mode #sidebar .nav-link {
  color: #bbb;
}

body.dark-mode #sidebar .nav-link.active,
body.dark-mode #sidebar .nav-link:hover {
  background-color: #333;
  color: #fff;
}

/* === NAVBAR === */
body.dark-mode .navbar {
  background-color: #222;
  border-bottom: 1px solid #333;
}

body.dark-mode .navbar .nav-link,
body.dark-mode .navbar-brand,
body.dark-mode .navbar-text {
  color: #ccc;
}

/* === CARDS === */
body.dark-mode .card {
  background-color: #1f1f1f;
  border-color: #333;
}

body.dark-mode .card-header {
  background-color: #1f1f1f;
  border-bottom-color: #333;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: #2c2c2c;
  color: #fff;
  border-color: #444;
}

body.dark-mode .form-control::placeholder {
  color: #aaa;
}

/* === TABLES === */
body.dark-mode .table {
  background-color: #1e1e1e;
  color: #ddd;
}

body.dark-mode .table thead {
  background-color: #2a2a2a;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: #2a2a2a;
}

body.dark-mode .table-hover tbody tr:hover {
  background-color: #333;
}

/* === BUTTONS === */
body.dark-mode .btn-outline-secondary {
  border-color: #888;
  color: #ccc;
}

body.dark-mode .btn-outline-secondary:hover {
  background-color: #444;
}

body.dark-mode .btn-primary {
  background-color: #438EB9;
  border-color: #438EB9;
}
body.dark-mode .card,
body.dark-mode .card * {
  color: #e0e0e0 !important;
}
/* === DARK MODE POUR DATATABLE === */
body.dark-mode table.dataTable {
  background-color: #1f1f1f;
  color: #e0e0e0;
}

body.dark-mode table.dataTable thead {
  background-color: #2a2a2a;
  color: #ffffff;
}

body.dark-mode table.dataTable tbody tr {
  background-color: #1f1f1f;
  color: #e0e0e0;
}

body.dark-mode table.dataTable tbody tr:hover {
  background-color: #333333;
}

/* Pagination, search, etc. */
body.dark-mode .dataTables_wrapper .dataTables_filter input,
body.dark-mode .dataTables_wrapper .dataTables_length select,
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_paginate {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #e0e0e0 !important;
  background-color: transparent !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #438EB9 !important;
  color: #fff !important;
}
body.dark-mode table.dataTable th,
body.dark-mode table.dataTable td {
  background-color: #1f1f1f !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

/* En-tête */
body.dark-mode table.dataTable thead th {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
}

/* Hover sur les lignes */
body.dark-mode table.dataTable tbody tr:hover {
  background-color: #333 !important;
}

/* css pour skeleton */
.cardUser.skeleton {
  background-color: #e2e5e7;
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  color: transparent;
  min-height: 80px;
  transition: all 0.3s ease-in-out;
}

.cardUser.skeleton::after {
  content: "";
  display: block;
  position: absolute;
  top: 0; left: 0;
  height: 100%; width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: loading 1.2s infinite;
  z-index: 1;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.cardUser.skeleton .placeholder {
  background-color: #d1d4d6;
  border-radius: 4px;
  height: 1rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
  transition: width 0.3s ease-in-out;
}

/* css pour véhicule */
#mapContainer {
  height: 100%;
  width: 100%;
  z-index: 1;
}

#vehicleInfoPanel {
  z-index: 1000;
  background-color: #fff;
  border-left: 1px solid #ddd;
}

.vehicle-icon {
  width: 30px;
  height: 30px;
  background-color: #0d6efd;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 14px;
  cursor: pointer;
}

.timeline-point {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
}

.timeline-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  background: #0d6efd;
  border-radius: 50%;
}
.spin {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.leaflet-control-custom {
  width: 30px;           /* même largeur que zoom */
  height: 30px;          /* même hauteur que zoom */
  padding: 0;            /* supprimer le padding */
  display: flex;         /* pour centrer l'icône */
  justify-content: center;
  align-items: center;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
}

.leaflet-control-custom i {
  width: 18px;           /* taille icône lucide */
  height: 18px;
}

.chart-skeleton {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.barriere-item {
  background-color: #f8f9fa;
  border-left: 4px solid #438EB9;
  border-radius: 8px;
  font-weight: 500;
  transition: 0.3s ease;
}

.barriere-item:hover {
  background-color: #e9f1f7;
}

.barriere-name {
  font-size: 0.95rem;
  color: #333;
}

.badge-count {
  background-color: #438EB9;
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: bold;
  font-size: 1.2rem;
  min-width: 50px;
  text-align: center;
  margin : 0 50px;
}

.route-step-icon {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.route-step-icon.leaflet-marker-icon {
  opacity: 1;
}
#vehicleInfoPanel {
  transition: transform 0.3s ease;
}
#vehicleInfoPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: white;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
}
#vehicleInfoPanel.open {
  transform: translateX(0);
}