:root {
      --sidebar-width: 280px;
      --sidebar-collapsed-width: 80px;
      --sidebar-bg: #1a1d2e;
      --sidebar-hover: #252837;
      --sidebar-active: #e3b709;
      --text-primary: #ffffff;
    --footer-h: 60px;
      --text-secondary: #94a3b8;
        --header-h: 70px;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: #f8f9fa;
    }

    /* Sidebar - Toujours visible */
    .pro-sidebar {
      position: fixed;
      left: 0;
      top: 0;
      height: 100vh;
      width: var(--sidebar-width);
      background: var(--sidebar-bg);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1040;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .pro-sidebar.collapsed {
      width: var(--sidebar-collapsed-width);
    }

    .sidebar-header {
      padding: 1.5rem 1.25rem;
      display: flex;
      align-items: center;
      gap: 1rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      min-height: 70px;
    }

    .sidebar-logo {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: bold;
      font-size: 1.25rem;
      flex-shrink: 0;
    }

    .sidebar-title {
      color: var(--text-primary);
      font-size: 1.25rem;
      font-weight: 600;
      white-space: nowrap;
      opacity: 1;
      transition: opacity 0.3s;
    }

    .pro-sidebar.collapsed .sidebar-title {
      opacity: 0;
      width: 0;
    }

    .sidebar-content {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 1rem 0;
    }

    .sidebar-content::-webkit-scrollbar {
      width: 6px;
    }

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

    .sidebar-content::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 3px;
    }

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

    .menu-section-title {
      color: var(--text-secondary);
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 1.5rem 1.25rem 0.5rem;
      white-space: nowrap;
      transition: opacity 0.3s;
    }

    .pro-sidebar.collapsed .menu-section-title {
      opacity: 0;
      height: 0;
      padding: 0;
    }

    .menu-item {
      margin: 0.25rem 0.5rem;
      position: relative;
    }

    .menu-link {
      display: flex;
      align-items: center;
      padding: 0.75rem 1rem;
      color: var(--text-secondary);
      text-decoration: none;
      border-radius: 8px;
      transition: all 0.2s;
      cursor: pointer;
      position: relative;
      gap: 1rem;
    }

    .menu-link:hover {
      background: var(--sidebar-hover);
      color: var(--text-primary);
    }

    .menu-link.active {
      background: var(--sidebar-active);
      color: var(--text-primary);
    }

    .menu-icon {
      width: 20px;
      height: 20px;
      font-size: 1.25rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .menu-text {
      flex: 1;
      white-space: nowrap;
      opacity: 1;
      transition: opacity 0.3s;
    }

    .pro-sidebar.collapsed .menu-text {
      opacity: 0;
      width: 0;
    }

    .menu-badge {
      background: #ef4444;
      color: white;
      font-size: 0.7rem;
      padding: 0.15rem 0.5rem;
      border-radius: 12px;
      font-weight: 600;
    }

    .pro-sidebar.collapsed .menu-badge {
      display: none;
    }

    .menu-arrow {
      font-size: 0.875rem;
      transition: transform 0.3s;
    }

    .menu-link.expanded .menu-arrow {
      transform: rotate(90deg);
    }

    .pro-sidebar.collapsed .menu-arrow {
      display: none;
    }

    /* Tooltip pour mode collapsed */
    .menu-item {
      position: relative;
    }

    .menu-tooltip {
      position: absolute;
      left: 100%;
      top: 50%;
      transform: translateY(-50%);
      background: var(--sidebar-bg);
      color: var(--text-primary);
      padding: 0.5rem 1rem;
      border-radius: 8px;
      white-space: nowrap;
      margin-left: 1rem;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s;
      z-index: 1050;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    .pro-sidebar.collapsed .menu-item:hover .menu-tooltip {
      opacity: 1;
    }

    /* Submenu */
    .submenu {
      list-style: none;
      padding: 0;
      margin: 0;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }

    .submenu.expanded {
      max-height: 800px;
    }

    .submenu .menu-link {
      padding-left: 3rem;
      font-size: 0.9rem;
    }

    .submenu .submenu .menu-link {
      padding-left: 4.5rem;
    }

    /* En mode collapsed, afficher les sous-menus au hover */
    .pro-sidebar.collapsed .submenu {
      position: absolute;
      left: 100%;
      top: 0;
      background: var(--sidebar-bg);
      min-width: 200px;
      border-radius: 8px;
      margin-left: 1rem;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
      max-height: 0;
      overflow: hidden;
    }

    .pro-sidebar.collapsed .menu-item:hover > .submenu {
      max-height: 600px;
      padding: 0.5rem 0;
    }

    .pro-sidebar.collapsed .submenu .menu-link {
      padding-left: 1rem;
    }

    .pro-sidebar.collapsed .submenu .submenu .menu-link {
      padding-left: 2rem;
    }

    /* Toggle Button */
    .sidebar-toggle {
      position: fixed;
      left: calc(var(--sidebar-width) - 20px);
      top: 20px;
      width: 40px;
      height: 40px;
      background: var(--sidebar-bg);
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-radius: 50%;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s;
      z-index: 1041;
    }

    .pro-sidebar.collapsed ~ .sidebar-toggle {
      left: calc(var(--sidebar-collapsed-width) - 20px);
    }

    .sidebar-toggle:hover {
      background: var(--sidebar-active);
      transform: scale(1.1);
    }

    /* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-h);
    margin-bottom: var(--footer-h);
    transition: margin-left 0.3s;
    min-height: calc(100vh - var(--header-h) - var(--footer-h));
    padding: 2rem;
}

    .pro-sidebar.collapsed ~ .main-content {
      margin-left: var(--sidebar-collapsed-width);
    }

.app-footer {
    left: var(--sidebar-width);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pro-sidebar.collapsed ~ .app-footer {
    left: var(--sidebar-collapsed-width);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-h);
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    z-index: 1030;
    transition: left 0.3s;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.pro-sidebar.collapsed ~ .app-header {
    left: var(--sidebar-collapsed-width);
    transition: left 0.3s;
}
.header-breadcrumb .active {
    color: var(--sidebar-active);
    display: block;
}

.header-breadcrumb { display: flex; gap: 0.5rem; color: #6c757d; font-size: 0.9rem; }
.header-breadcrumb a { color: #6c757d; text-decoration: none; }
.header-breadcrumb a:hover { color: var(--sidebar-active); }
.header-right { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; }
.header-search { position: relative; }
.header-search input { padding: 0.5rem 1rem 0.5rem 2.5rem; border: 1px solid #e9ecef; border-radius: 8px; width: 250px; }
.header-search i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #6c757d; }
.header-icon-btn { position: relative; width: 40px; height: 40px; border: none; background: transparent; border-radius: 8px; cursor: pointer; }
.header-icon-btn:hover { background: #f8f9fa; }
.header-icon-btn .badge { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; font-size: 0.7rem; }
.header-user { display: flex; gap: 0.75rem; cursor: pointer; padding: 0.5rem; border-radius: 8px; }
.header-user:hover { background: #f8f9fa; }
.header-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--sidebar-active), #3b82f6); display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; }
.sidebar-header { padding: 1.5rem 1.25rem; display: flex; gap: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); min-height: var(--header-h); }
.header-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--sidebar-active), #3b82f6); display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; }
.user-dropdown { position: relative; }
.user-dropdown-menu { position: absolute; top: calc(100% + 10px); right: 0; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 200px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s; z-index: 1100; }
.user-dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-menu::before { content: ''; position: absolute; top: -6px; right: 20px; width: 12px; height: 12px; background: white; transform: rotate(45deg); }
.dropdown-header { padding: 1rem; border-bottom: 1px solid #e9ecef; }
.dropdown-user-name { font-weight: 600; color: #212529; font-size: 0.95rem; }
.dropdown-user-email { font-size: 0.8rem; color: #6c757d; margin-top: 0.25rem; }
.dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: #495057; text-decoration: none; transition: background 0.2s; }
.dropdown-item:hover { background: #f8f9fa; }
.dropdown-item i { width: 20px; font-size: 1.1rem; }
.dropdown-divider { height: 1px; background: #e9ecef; margin: 0.5rem 0; }
.dropdown-item.danger { color: #dc3545; }
.dropdown-item.danger:hover { background: #fff5f5; }

    /* Responsive - Sur tablette (< 992px) : Mode collapsed automatique */
    @media (max-width: 991px) {
      .pro-sidebar {
        width: var(--sidebar-collapsed-width);
      }

        .app-footer,.app-header {
            left: var(--sidebar-collapsed-width);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }


      .sidebar-title {
        opacity: 0;
        width: 0;
      }

      .menu-text {
        opacity: 0;
        width: 0;
      }

      .menu-badge,
      .menu-arrow {
        display: none;
      }

      .menu-section-title {
        opacity: 0;
        height: 0;
        padding: 0;
      }

      .sidebar-toggle {
        left: calc(var(--sidebar-collapsed-width) - 20px);
      }

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

      /* Afficher le tooltip au hover */
      .menu-item:hover .menu-tooltip {
        opacity: 1;
      }

      /* Sous-menus en overlay */
      .submenu {
        position: absolute;
        left: 100%;
        top: 0;
        background: var(--sidebar-bg);
        min-width: 200px;
        border-radius: 8px;
        margin-left: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        max-height: 0;
        overflow: hidden;
      }

      .menu-item:hover > .submenu {
        max-height: 600px;
        padding: 0.5rem 0;
      }

      .submenu .menu-link {
        padding-left: 1rem;
      }

      .submenu .submenu .menu-link {
        padding-left: 2rem;
      }

      /* Possibilité de dé-collapse via toggle */
      .pro-sidebar.force-expanded {
        width: var(--sidebar-width);
      }

      .pro-sidebar.force-expanded .sidebar-title {
        opacity: 1;
        width: auto;
      }

      .pro-sidebar.force-expanded .menu-text {
        opacity: 1;
        width: auto;
      }

      .pro-sidebar.force-expanded .menu-badge,
      .pro-sidebar.force-expanded .menu-arrow {
        display: initial;
      }

      .pro-sidebar.force-expanded .menu-section-title {
        opacity: 1;
        height: auto;
        padding: 1.5rem 1.25rem 0.5rem;
      }

      .pro-sidebar.force-expanded ~ .sidebar-toggle {
        left: calc(var(--sidebar-width) - 20px);
      }

      .pro-sidebar.force-expanded ~ .main-content {
        margin-left: var(--sidebar-width);
      }

      .pro-sidebar.force-expanded .submenu {
        position: static;
        margin-left: 0;
        box-shadow: none;
        background: transparent;
      }

      .pro-sidebar.force-expanded .submenu.expanded {
        max-height: 800px;
      }

      .pro-sidebar.force-expanded .submenu .menu-link {
        padding-left: 3rem;
      }
    }

    /* Mobile très petit (< 576px) : Sidebar réduite */
    @media (max-width: 575px) {
        .main-content, .app-header, .app-footer { padding: 1rem; }
        .header-breadcrumb { display: none; }
    }

    /* Content Styling */
    .content-header {
      background: white;
      padding: 1.5rem;
      border-radius: 12px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
      margin-bottom: 2rem;
    }

    .stat-card {
      background: white;
      padding: 1.5rem;
      border-radius: 12px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
      margin-bottom: 1.5rem;
    }







