.close-sidebar {
  display: none;
}

/* Style du loader */

#loader {
  position: fixed;
  inset: 0;
  background-color: white;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#loader img {
  width: 120px;
}

.spinner {
  border: 6px solid #3498db;
  border-radius: 50%;
  animation: spin 2.3s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loader p {
  font-family: var(--main-font);
  font-size: 1.2rem;
  color: #444;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f5f7;
}

.logo_bbcar {
  width: 35px;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e4e4e4;
  padding: 20px 0;
  position: fixed;
  transition: width 0.3s;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.sidebar .logo h2 {
  margin-left: 8px;
  font-size: 20px;
  font-weight: 600;
}

.sidebar .menu {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

.logOut {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  padding: 12px 15px;
  background: #f0f0f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #444;
  transition: background 0.2s;
}

.logOut:hover {
  background: #e4e4e4;
}

.sidebar .menu li {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555;
  transition: background 0.2s;
}

.sidebar .menu li:hover {
  background: #f0f0f0;
}

.sidebar .menu li.active {
  background: #e9f2ff;
  color: #2f77ff;
}

/* CONTENT */
.content {
  margin-left: 240px;
  padding: 0 25px 20px 25px;
  transition: margin-left 0.3s;
}

header {
  height: 100px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid black;
}

header h1 {
  font-size: 24px;
  margin: 0;
}

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
}

/* Responsive cards */
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 750px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card.v2 {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 30px 30px 30px 20px;
  border-radius: 14px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.card.v2 .text-zone p {
  margin-bottom: 0;
}

.icon-badge {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  flex-shrink: 0;
}

.icon-yellow {
  background: #ffb300;
}
.icon-orange {
  background: #ff6f00;
}
.icon-purple {
  background: #7e57c2;
}
.icon-blue {
  background: #0097a7;
}
.icon-red {
  background: #e53935;
}

.card.v2 h3 {
  margin: 0;
  font-size: 16px;
  color: #444;
}

.card.v2 .number {
  margin-top: 5px;
  font-size: 24px;
  font-weight: bold;
  color: #222;
}

.card.v2:hover {
  transform: translateY(-3px);
  transition: 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* SIDEBAR COLLAPSÉE */
.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .menu li span.material-icons + * {
  display: none;
}

.sidebar.collapsed .logo h2 {
  display: none;
}

.sidebar.collapsed .logOut .label {
  display: none;
}

.sidebar.collapsed .logOut {
  width: 50px;
  padding: 10px 0;
  justify-content: center;
}

.content.collapsed {
  margin-left: 70px;
}

/* ================================
   TOP 3 SECTIONS (ACTIONS / MSG / MAP)
   ================================ */
.dashboard-top {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 25px;
}

/* Responsive dashboard-top */
@media (max-width: 1100px) {
  .dashboard-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 750px) {
  .dashboard-top {
    grid-template-columns: 1fr;
  }
}

/* ---- LEFT: QUICK ACTIONS ---- */
.quick-actions {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e5e5;
}

.quick-actions h2 {
  margin-top: 0;
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.action-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 15px;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  transition: 0.2s;
}

.action-btn:hover {
  background: #e8ecff;
}

/* Color variants */
.mission-create {
  background: #ffe7b8;
  color: #c47b00;
}
.mission-create:hover {
  background: #ffdfa1;
}

.mission-pickup {
  background: #ffd3d8;
  color: #c54858;
}
.mission-pickup:hover {
  background: #ffc2ca;
}

.user-client {
  background: #e8d8ff;
  color: #7b33c4;
}
.user-client:hover {
  background: #ddc7ff;
}

.user-convoyeur {
  background: #c8f2f0;
  color: #008b84;
}
.user-convoyeur:hover {
  background: #b6ebe8;
}

/* ---- MIDDLE: MESSAGES ---- */

/* ================================
   DASHBOARD — MESSAGE PREVIEW (STYLE D PREMIUM)
   ================================ */

#dashboardMessagesPreview {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 5px;
}

.message-preview-card {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 200, 200, 0.4);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.25s ease;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.message-preview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.75);
}

.message-preview-card .msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.message-preview-card strong {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.message-preview-card .msg-date {
  font-size: 12px;
  color: #666;
}

.message-preview-card .msg-text {
  font-size: 13px;
  color: #444;
  line-height: 1.35;
}

.see-more-messages {
  margin-top: 15px;
  align-self: center;
  background: #2f77ff;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
}

.see-more-messages:hover {
  background: #1b5cd7;
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  #dashboardMessagesPreview {
    max-height: 200px;
  }
}
.dashboard-messages {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e5e5;
}

.dashboard-messages h2 {
  margin-top: 0;
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.messages-list,
.action_list {
  height: 260px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  padding-top: 20px;
  color: #666;
  font-size: 14px;
}

.msg-unread {
  position: absolute;
  right: 12px;
  bottom: 10px;

  background: #e53935;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 50px;
  box-shadow: 0 2px 4px rgba(229, 57, 53, 0.4);
}

/* ---- RIGHT: MAP ---- */
.dashboard-map {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e5e5;
}

.dashboard-map h2 {
  margin-top: 0;
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.map-wrapper {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.map-wrapper iframe {
  transition: filter 0.3s ease;
  display: block;
}

.map-wrapper:hover iframe {
  filter: blur(3px) brightness(0.8);
}

.open-map-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 20px;
  background: #2f77ff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.map-wrapper:hover .open-map-btn {
  opacity: 1;
  pointer-events: auto;
}

/* ================================
   GRAPH: Missions par mois
   ================================ */

.missions-chart {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e5e5;
  margin-top: 30px;
}

.missions-chart h2 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.chart-box {
  width: 100%;
  height: 350px;
  position: relative;
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

/* MOBILE BURGER BUTTON */
.mobile-burger {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: none;
  background: #2f77ff;
  color: white;
  font-size: 26px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 9999;
}

@media (max-width: 800px) {
  .sidebar {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #ffffff;
    border-right: 1px solid #e4e4e4;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 9999;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .menu li .material-icons {
    margin-right: 0;
  }

  .sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    position: relative;
    justify-content: flex-start;
  }

  .close-sidebar {
    position: absolute;
    right: 20px;
    transform: translateY(-15%);
    display: block;
    font-size: 28px;
    cursor: pointer;
    z-index: 10000;
  }

  .logOut {
    left: 50%;
    transform: translateX(-50%);
    justify-content: center;
    text-align: center;
  }

  .content {
    margin-left: 0 !important;
    padding: 0 15px 20px 15px;
  }

  .mobile-burger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
