/* ===== Variables ===== */
:root {
  --primary-color: #3c8dbc;
  --secondary-color: #0073b7;
  --success-color: #00a65a;
    --warning-color: #f39c12;
  --danger-color: #dd4b39;
  --info-color: #00c0ef;
    
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    
  --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
  --header-height: 60px;
    --footer-height: 60px;
    
  --border-radius: 0.25rem;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition-speed: 0.3s;
  }
  
  /* ===== Global Styles ===== */
  body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #212529;
  background-color: #f4f6f9;
    margin: 0;
    overflow-x: hidden;
  }
  
  .admin-wrapper {
    display: flex;
  position: relative;
    min-height: 100vh;
  width: 100%;
  }
  
  .admin-content {
    flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
  }
  
  .content {
    flex: 1;
    padding: 20px 0;
  background-color: #f4f6f9;
  }
  
  a {
    text-decoration: none;
  color: var(--primary-color);
  }
  
  a:hover {
  color: var(--secondary-color);
  text-decoration: none;
  }
  
  .page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
  color: var(--dark-color);
  }
  
  /* ===== Sidebar ===== */
  .sidebar {
    position: fixed;
  left: 0;
    top: 0;
  height: 100%;
  width: var(--sidebar-width);
  background-color: #343a40;
  color: #fff;
  z-index: 1000;
  transition: all var(--transition-speed) ease;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  /* Personnalisation de la barre de défilement */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Personnalisation de la barre de défilement pour Webkit */
.sidebar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* En mode hover uniquement */
.sidebar {
  scrollbar-width: thin;
  /* Cacher par défaut mais garder l'espace */
  scrollbar-color: transparent transparent;
}

.sidebar:hover {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  }
  
  .nav-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    margin: 20px 0 10px 20px;
  }
  
  .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .nav-item {
    margin-bottom: 2px;
  }
  
  .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
  color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
  border-left: 3px solid transparent;
  }
  
  .nav-link:hover, .nav-item.active .nav-link {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-color);
  }
  
  .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
  }
  
  .submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
  }
  
  .nav-item.open .submenu-arrow {
    transform: rotate(180deg);
  }
  
  .submenu {
    list-style: none;
  padding-left: 35px;
    margin: 0;
  height: auto;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  }
  
  .nav-item.open .submenu {
  max-height: 1000px;
  }
  
.submenu .nav-link {
    padding: 8px 15px;
  color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
  border-left: none;
  }
  
.submenu .nav-link:hover, 
.submenu .nav-item.active .nav-link {
    color: white;
  background-color: rgba(255, 255, 255, 0.05);
  border-left: none;
}

.submenu .nav-link i {
  font-size: 0.85rem;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  
body.sidebar-collapsed .admin-content {
  margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar .brand-name, 
body.sidebar-collapsed .sidebar .link-text,
body.sidebar-collapsed .sidebar .submenu,
body.sidebar-collapsed .sidebar .nav-category,
body.sidebar-collapsed .sidebar .submenu-arrow,
body.sidebar-collapsed .sidebar .sidebar-footer {
  display: none;
}

body.sidebar-collapsed .sidebar .nav-link {
  padding: 15px 0;
    justify-content: center;
  }
  
body.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0;
  font-size: 1.2rem;
}

/* Animations sidebar */
body.sidebar-transition .sidebar,
body.sidebar-transition .admin-content {
  transition: all var(--transition-speed) ease;
}

/* Overlay pour la sidebar sur mobile/tablette */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* En-tête de la sidebar */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-name {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.3s;
}

.sidebar-toggle:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Footer de la sidebar */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px 20px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  background-color: rgba(0, 0, 0, 0.1);
  }
  
  /* ===== Header ===== */
  .header {
    height: var(--header-height);
    background-color: white;
    border-bottom: 1px solid #e9ecef;
  padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  .header-left, .header-right {
    display: flex;
    align-items: center;
  }
  
  .header-right > * {
  margin-left: 15px;
}

/* Bouton toggle dans le header */
.header .sidebar-toggle {
  background-color: var(--primary-color);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header .sidebar-toggle:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.header .sidebar-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

/* Formulaire de recherche */
.search-form {
  width: 250px;
}

.search-form .input-group {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.search-form .form-control {
  border-right: none;
  height: 38px;
}

.search-form .btn {
  background-color: #fff;
  border-color: #ced4da;
  border-left: none;
  color: var(--gray-color);
  height: 38px;
}

/* Info portefeuille */
  .wallet-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  
  .wallet-label {
    font-size: 0.75rem;
    color: var(--gray-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  
  .wallet-amount {
    font-weight: 600;
  color: var(--dark-color);
  }
  
  .currency {
    font-size: 0.75rem;
    font-weight: normal;
    color: var(--gray-color);
  }
  
/* Notifications */
  .notification-dropdown .btn {
    position: relative;
    padding: 0;
    background: none;
    border: none;
    color: var(--gray-color);
    font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  }
  
  .notification-badge {
    position: absolute;
  top: 0;
  right: 0;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
  font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

.notification-dropdown-menu {
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}
  
  .notification-item {
    display: flex;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .notification-item.unread {
  background-color: rgba(60, 141, 188, 0.05);
  }
  
  .notification-icon {
  margin-right: 15px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  }
  
  .notification-text p {
    margin: 0;
    font-size: 0.85rem;
  font-weight: 500;
  }
  
  .notification-time {
    font-size: 0.75rem;
    color: var(--gray-color);
  display: block;
  margin-top: 3px;
}

.view-all {
  font-weight: 500;
  color: var(--primary-color);
  padding: 10px 0;
}

.no-notifications {
  padding: 15px;
  text-align: center;
  color: var(--gray-color);
}

/* Menu utilisateur */
  .user-dropdown-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }
  
  .user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
  margin-right: 10px;
  }
  
  .user-name {
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--gray-color);
}

.user-dropdown-menu {
  width: 280px;
  padding: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.dropdown-header {
  background-color: #f8f9fa;
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  }
  
  .dropdown-header h6 {
  margin-bottom: 5px;
  font-weight: 600;
  }
  
  .dropdown-header span {
    font-size: 0.75rem;
    color: var(--gray-color);
  }

.user-dropdown-menu .dropdown-item {
  padding: 12px 15px;
}

.user-dropdown-menu .dropdown-item i {
  width: 20px;
  text-align: center;
}

.logout-item {
  color: var(--danger-color);
}
  
  /* ===== Footer ===== */
  .footer {
    height: var(--footer-height);
    background-color: white;
    border-top: 1px solid #e9ecef;
  padding: 0 20px;
    display: flex;
    align-items: center;
  }

.footer p {
  color: var(--gray-color);
  font-size: 0.875rem;
}
  
  /* ===== Dashboard Cards ===== */
  .metric-card {
    border: none;
    border-radius: var(--border-radius);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.13), 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-bottom: 1rem;
    height: 100%;
    transition: transform 0.3s, box-shadow 0.3s;
  }
  
  .metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.metric-card .card-body {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  }
  
  .metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 10px;
    color: white;
  font-size: 1.8rem;
  margin-right: 1rem;
  }
  
  .metric-icon.blue {
  background-color: var(--primary-color);
  }
  
  .metric-icon.green {
    background-color: var(--success-color);
  }
  
  .metric-icon.orange {
    background-color: var(--warning-color);
  }
  
  .metric-icon.red {
    background-color: var(--danger-color);
  }
  
.metric-info {
  flex: 1;
}

.metric-title {
  color: var(--gray-color);
  font-size: 0.875rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--dark-color);
  line-height: 1.2;
}

.metric-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.01);
  font-size: 0.85rem;
}

/* ===== Cards ===== */
.card {
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.13), 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-bottom: 1rem;
  border: none;
}

.card-header {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
  font-weight: 600;
  margin-bottom: 0;
}

/* ===== Boutons ===== */
  .btn {
    font-weight: 500;
  padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
  transition: all 0.2s;
  }
  
  .btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
  }
  
  .btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
  }
  
  .btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
  }
  
  .btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
  }

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ===== Tables ===== */
.table th {
  font-weight: 600;
  padding: 0.75rem;
  vertical-align: middle;
  border-top: none;
  background-color: #f8f9fa;
  color: var(--dark-color);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}
  
  /* ===== Responsive ===== */
  @media (max-width: 991.98px) {
  :root {
    --sidebar-width: 240px;
  }
  
    .sidebar {
      width: var(--sidebar-width);
      transform: translateX(-100%);
    }
    
    .admin-content {
      margin-left: 0;
    }
    
  body:not(.sidebar-collapsed) .sidebar {
      transform: translateX(0);
    }
    
    .wallet-info {
      display: none;
    }
    
  .dashboard-link {
    display: none;
  }
  
  /* Effet d'animation plus fluide */
  .sidebar {
    transition: transform var(--transition-speed) ease, width var(--transition-speed) ease;
  }
}

@media (max-width: 767.98px) {
  .header {
    padding: 0 15px;
    height: 56px;
  }
  
  .user-info {
    display: none;
  }
  
  .content {
    padding: 15px 0;
  }
  
  .page-title {
    font-size: 1.25rem;
  }
  
  .sidebar-toggle.d-md-none {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.25rem;
    z-index: 1001;
  }
  
  /* Indicateur swipe pour mobile */
  .swipe-indicator {
    position: fixed;
    top: 50%;
    left: 0;
    width: 5px;
    height: 40px;
    background-color: rgba(60, 141, 188, 0.5);
    border-radius: 0 4px 4px 0;
    transform: translateY(-50%);
    z-index: 998;
    opacity: 0.7;
    transition: opacity 0.3s ease, width 0.3s ease;
  }
  
  .swipe-indicator:hover {
    opacity: 1;
    width: 10px;
  }
  
  body:not(.sidebar-collapsed) .swipe-indicator {
    display: none;
  }
}

/* Animation pour les badges */
.badge {
  position: relative;
    transition: all 0.3s ease;
}

/* Animation pulse pour attirer l'attention */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Accessibilité tactile */
@media (pointer: coarse) {
  .submenu .nav-link,
  .nav-link {
    padding: 12px 20px;
  }
  
  .btn, 
  .form-control, 
  .form-select {
    min-height: 44px;
  }
}

/* Styles spécifiques pour le bouton hamburger */
.sidebar-toggle, 
button.navbar-toggler, 
[aria-label="Menu"],
button[aria-label="Afficher/masquer le menu latéral"] {
    cursor: pointer !important;
    position: relative;
    z-index: 1050 !important;
    transition: all 0.3s ease !important;
}

/* Style pour l'état actif du bouton */
.sidebar-toggle.active, 
button.navbar-toggler.active, 
[aria-label="Menu"].active,
button[aria-label="Afficher/masquer le menu latéral"].active {
    background-color: var(--secondary-color) !important;
    transform: rotate(90deg);
}

/* Améliorer la zone de clic sur mobile */
@media (max-width: 767.98px) {
    .sidebar-toggle, 
    button.navbar-toggler, 
    [aria-label="Menu"],
    button[aria-label="Afficher/masquer le menu latéral"] {
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Forcer la visibilité du bouton en mode mobile */
@media (max-width: 991.98px) {
    .sidebar-toggle, 
    button.navbar-toggler, 
    [aria-label="Menu"],
    button[aria-label="Afficher/masquer le menu latéral"] {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
  }