.layout {
  display: flex;
  min-height: 100vh;
  background: var(--gris-clair);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  z-index: 90;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--blanc);
  border-right: 1px solid #eeeeee;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.2s ease, width 0.2s ease;
}

.sidebarOuverte {
  transform: translateX(0);
}

.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eeeeee;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
}

.closeSidebar {
  display: flex;
  border: none;
  background: none;
  color: var(--gris-moyen);
  cursor: pointer;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.nav:hover {
  scrollbar-color: #cccccc transparent;
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: var(--radius-pill);
}

.nav:hover::-webkit-scrollbar-thumb {
  background: #cccccc;
}

.navLink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--gris-moyen);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.navLink:hover {
  background: var(--gris-clair);
  color: var(--gris-fonce);
}

.navLinkActif {
  background: rgba(26, 107, 42, 0.1);
  color: var(--vert-fonce);
}

.navLink svg {
  flex-shrink: 0;
}

.navSection {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.navSectionTitre {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gris-moyen);
}

.sidebarFooter {
  flex-shrink: 0;
  border-top: 1px solid #eeeeee;
  padding: 12px 8px;
}

.logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--erreur);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.logout:hover {
  background: rgba(192, 57, 43, 0.08);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .main {
    margin-left: 240px;
    transition: margin-left 0.2s ease;
  }

  .layoutCollapsed .main {
    margin-left: 72px;
  }
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--blanc);
  border-bottom: 1px solid #eeeeee;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menuToggle,
.collapseToggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--gris-moyen);
  cursor: pointer;
}

.menuToggle:hover,
.collapseToggle:hover {
  background: var(--gris-clair);
}

.collapseToggle {
  display: none;
}

.userInfo {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  line-height: 1.3;
}

.userNom {
  font-size: 13px;
  font-weight: 600;
  color: var(--gris-fonce);
}

.userRole {
  font-size: 11px;
  color: var(--gris-moyen);
}

.content {
  flex: 1;
  padding: 24px;
}

@media (min-width: 1024px) {
  .sidebar {
    transform: none;
    width: 240px;
  }

  .layoutCollapsed .sidebar {
    width: 72px;
  }

  .layoutCollapsed .navLink span,
  .layoutCollapsed .logout span,
  .layoutCollapsed .userInfo,
  .layoutCollapsed .brand :global(img) {
    display: none;
  }

  .layoutCollapsed .navSectionTitre {
    display: none;
  }

  .closeSidebar {
    display: none;
  }

  .menuToggle {
    display: none;
  }

  .collapseToggle {
    display: flex;
  }
}
