/* Masque la navbar mobile */
.mobile-topbar,
.mobile-bottombar {
  display: none;
}

/* Logo */
.logo {
  height:20px;
  margin: 0;
  position: fixed;
  top: 22px;
  left: 85px;
  transition: left 0.25s ease;
  pointer-events: auto;
  z-index: 100;
}

.logo-bar{
color:var(--redlina-red);
font-weight:900;
}

body.navbar-open .logo {
  left: 200px; /* 80px + (180px - 60px) = 80 + 120 */
}

html.navbar-is-open .logo {
  left: 200px;
  transition: none;
}

/* =========================
   NAVBAR (FERMÉE PAR DÉFAUT)
   ========================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;

  height: 100vh;
  width: 60px; /* ÉTAT PAR DÉFAUT */

  background: none;
  border-right: 1px solid var(--redlina-grayline-1);

  display: flex;
  flex-direction: column;

  padding: 15px 10px 5px 10px;
  box-sizing: border-box;

  transition: width 0.25s ease;
  will-change: width;
}

/* =========================
   NAVBAR OUVERTE
   ========================= */
.navbar.open {
  width: 180px;
}

/* =========================
   ZONES
   ========================= */
.nav-top,
.nav-bottom {
  display: flex;
  flex-direction: column;
}

.nav-bottom {
  margin-top: auto;
}

/* =========================
   ITEMS
   ========================= */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;

  height: 40px;
  padding: 0 10px;

  border: none;
  border-radius: 10px;
  background: transparent;

  font-size: 13px;
  font-weight: 400;
  color: #000;
  text-decoration: none;
  cursor: pointer;

  margin-bottom: 10px;

  transition: background-color 0.2s ease;
}

.nav-item:hover {
  background: var(--redlina-background-1-accent);
}

/* =========================
   ICONES
   ========================= */
.nav-icon {
  width: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG ICONS */
.icon-svg-navbar{
    max-height:17px;
}

/* =========================
   TEXTE (MASQUÉ PAR DÉFAUT)
   ========================= */
.nav-text {
  white-space: nowrap;
  overflow: hidden;

  opacity: 0;
  max-width: 0;

  transition: opacity 0.15s ease, max-width 0.25s ease;
}

/* TEXTE VISIBLE QUAND OUVERTE */
.navbar.open .nav-text {
  opacity: 1;
  max-width: 200px;
}







/* =========================
   LAYOUT APPLICATION
   ========================= */

/* ÉTAT PAR DÉFAUT : NAVBAR FERMÉE */
.app-content {
  margin-left: 60px;
  transition: margin-left 0.25s ease;
  will-change: margin-left;
}

/* NAVBAR OUVERTE */
body.navbar-open .app-content {
  margin-left: 180px;
}








/* =========================
   TOOLTIP (NAVBAR FERMÉE)
   ========================= */

/* base */
.navbar:not(.open) .nav-item {
  position: relative;
}

/* bulle */
.navbar:not(.open) .nav-item::after {
  content: attr(data-label);

  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);

  background: #111;
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;

  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;

  z-index: 1000;
}

/* apparition au hover */
.navbar:not(.open) .nav-item:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

.navbar.open .nav-item::after {
  display: none !important;
}







/* =========================
   CURSEUR NAVBAR (léger)
   ========================= */

/* Navbar OUVERTE → flèche gauche */
.navbar {
  cursor: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'>\
<polyline points='8,5 16,12 8,19' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>") 12 12, pointer;
}


.navbar.open {
  cursor: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'>\
<polyline points='16,5 8,12 16,19' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>") 12 12, pointer;
}


/* Liens et boutons */
.navbar a,
.navbar button {
  cursor: pointer;
}




/* =========================
   ÉTAT INITIAL SANS FLASH
   ========================= */
html.navbar-is-open .navbar {
  width: 180px;
  transition: none;
}

html.navbar-is-open .nav-text {
  opacity: 1;
  max-width: 200px;
  transition: none;
}

html.navbar-is-open .app-content {
  margin-left: 180px;
  transition: none;
}