/* Sticky footer — le body occupe au minimum toute la hauteur de l'écran */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

/* Centre le contenu sur la home */
body .home-center {
  min-height: calc(100vh - 14rem); /* 56px ≈ hauteur navbar bootstrap */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo responsive au centre */
body .home-logo {
  width: min(320px, 40vw);
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.45));
  opacity: 0.95;
}

nav button.btn{
  border: none;
}

.user_password .container {
  max-width: 540px;
}

/* ═══════════════════════════════════════════
   LAYOUT : sidebar + main en colonnes flex
═══════════════════════════════════════════ */

#layout {
  display: flex;
  align-items: flex-start;
  /*min-height: calc(100vh - 56px);*/
}

main {
  flex: 1;
  min-width: 0; /* évite le débordement flex */
}

/* Toggle button — toujours visible sur le bord gauche */
#sidebarToggle {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 1040;
  width: 20px;
  height: 48px;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0 6px 6px 0;
  color: #adb5bd;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.28s ease, background 0.2s;
  padding: 0;
  line-height: 1;
}
#sidebarToggle:hover {
  background: rgba(50, 65, 85, 0.98);
  color: #fff;
}
#sidebarToggle.sidebar-open {
  left: 220px;
}

/* Panel sidebar */
#sidebar {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  transition: width 0.28s ease;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  background: var(--surface-2);
  backdrop-filter: blur(4px);
  z-index: 1035;
  border-right: 1px solid rgba(255,255,255,0.07);
}
#sidebar.sidebar-open {
  width: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Bouton fermeture (×) */
.sidebar-close-row {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.5rem 0;
}
#sidebarClose {
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}
#sidebarClose:hover {
  color: #fff;
}

/* Navigation interne */
.sidebar-nav {
  padding: 0.25rem 0 1.5rem;
}
.sidebar-section {
  padding: 0.85rem 1rem 0.3rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bs-nav-s3-link-section-color);
  font-weight: 600;
}
.sidebar-item {
  display: block;
  padding: 0.1rem 1rem 0.1rem 1.4rem;
  color: var(--bs-nav-s3-link-color);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-item:hover {
  color: var(--bs-nav-s3-link-hover-color);
  background: rgba(255,255,255,0.05);
  border-left-color: rgba(255,255,255,0.2);
}
.sidebar-item.active {
  color: var(--bs-nav-s3-link-hover-color);
  border-left-color: #0d6efd;
  background: rgba(13, 110, 253, 0.12);
}

.app_login main.container,
.app_register main.container,
.app_login_2fa main.container,
.app_register_check_email main.container,
.app_forgot_password main.container,
.user_password main.container,
.app_reset_password main.container{
  max-width: 540px;

}