
/* ============================================================
   HABYS — Menu commun du module Gestion du locatif
   Utilisé par gestion_locatif.html / caves_locatif.html /
   garages_locatif.html
   ============================================================ */

html.locatif-access-pending body { visibility:hidden !important; }

.sidebar {
  width:260px !important;
  min-width:260px !important;
  height:100vh !important;
  position:sticky !important;
  top:0 !important;
  overflow:hidden !important;
  flex-shrink:0 !important;
  display:flex !important;
  flex-direction:column !important;
  gap:18px !important;
  padding:22px 14px 18px !important;
  color:#e2e8f0 !important;
  background:linear-gradient(180deg,#0f1e35 0%,#162035 60%,#0f172a 100%) !important;
  border-right:1px solid rgba(255,255,255,.06) !important;
  transition:width .24s ease,min-width .24s ease,padding .24s ease !important;
}
.sidebar::before {
  content:"";
  position:absolute;
  top:-80px;
  left:-80px;
  width:270px;
  height:270px;
  background:radial-gradient(circle,rgba(79,70,229,.20) 0%,transparent 70%);
  pointer-events:none;
}
.sidebar-logo {
  position:relative;
  z-index:2;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  gap:5px !important;
  margin-top:2px;
  flex-shrink:0;
}
.sidebar-logo .building-img {
  width:72px !important;
  height:72px !important;
  object-fit:contain !important;
  filter:drop-shadow(0 9px 20px rgba(0,0,0,.35));
  animation:locatifLogoFloat 4.2s ease-in-out infinite !important;
}
@keyframes locatifLogoFloat {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-4px); }
}
.habys-word {
  display:flex;
  gap:1px;
  color:#fff;
  font-size:28px;
  font-weight:900;
  letter-spacing:.04em;
  line-height:1;
  text-shadow:0 4px 12px rgba(0,0,0,.30);
}
.sidebar-logo .habys-word span {
  margin:0 !important;
  color:inherit !important;
  font-size:inherit !important;
  font-weight:inherit !important;
  letter-spacing:inherit !important;
  line-height:inherit !important;
  opacity:1 !important;
  animation:none !important;
  transform:none !important;
  text-shadow:inherit !important;
}
.sidebar-logo > span {
  margin-top:2px;
  font-size:.71rem !important;
  text-align:center;
  color:rgba(226,232,240,.58) !important;
  letter-spacing:.03em;
}

.module-label {
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid rgba(96,165,250,.22);
  border-radius:10px;
  background:rgba(59,130,246,.08);
  color:#bfdbfe;
  font-size:.72rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  flex-shrink:0;
}
.module-label::before {
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#60a5fa;
  box-shadow:0 0 12px rgba(96,165,250,.75);
}

.return-habys {
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:8px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(226,232,240,.78);
  font-size:.82rem;
  font-weight:600;
  text-decoration:none;
  transition:background .18s,transform .18s,color .18s;
  flex-shrink:0;
}
.return-habys:hover {
  color:#fff;
  background:rgba(255,255,255,.11);
  transform:translateX(4px);
}
.return-habys img {
  width:34px !important;
  height:34px !important;
  object-fit:contain;
  flex-shrink:0;
}

#sidebar-nav {
  position:relative;
  z-index:2;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:5px;
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:0 4px 0 0 !important;
  margin:0 !important;
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.34) transparent;
}
#sidebar-nav::-webkit-scrollbar { width:5px; }
#sidebar-nav::-webkit-scrollbar-thumb {
  background:rgba(148,163,184,.30);
  border-radius:999px;
}

#sidebar-nav li {
  list-style:none;
  margin:0;
  padding:0;
}
#sidebar-nav a {
  position:relative;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  min-width:0;
  min-height:54px;
  padding:7px 10px !important;
  border-radius:10px !important;
  color:#e5e7eb !important;
  text-decoration:none !important;
  background:transparent;
  transition:background-color .18s,transform .18s,box-shadow .18s,color .18s !important;
}
#sidebar-nav a:hover {
  background:rgba(255,255,255,.10) !important;
  transform:translateX(5px);
  box-shadow:2px 0 0 #3b82f6 inset;
  color:#fff !important;
}
#sidebar-nav a.active {
  background:rgba(79,70,229,.25) !important;
  box-shadow:3px 0 0 #60a5fa inset !important;
  color:#fff !important;
  font-weight:700;
}
#sidebar-nav a.is-disabled { cursor:pointer; opacity:.82; }
#sidebar-nav a.is-disabled:hover { opacity:1; }

.locatif-menu-icon {
  width:40px;
  height:40px;
  min-width:40px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.08);
}
.locatif-menu-icon svg {
  width:28px;
  height:28px;
  fill:none;
  stroke:#93c5fd;
  stroke-width:2.4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.menu-label {
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.88rem;
  font-weight:600;
}
.menu-status {
  padding:2px 6px;
  border-radius:999px;
  background:rgba(245,158,11,.15);
  border:1px solid rgba(245,158,11,.25);
  color:#fcd34d;
  font-size:.57rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.sidebar-footer {
  position:relative;
  z-index:2;
  font-size:.66rem !important;
  color:rgba(226,232,240,.30) !important;
  text-align:center;
  letter-spacing:.04em;
  flex-shrink:0;
}

.habys-sidebar-toggle {
  position:absolute;
  top:10px;
  right:10px;
  z-index:50;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.10);
  color:#fff;
  font:700 22px/1 Arial,sans-serif;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,.16);
  transition:background .18s,transform .18s,border-color .18s;
}
.habys-sidebar-toggle:hover {
  background:rgba(255,255,255,.18);
  transform:scale(1.05);
}

.locatif-menu-toast {
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translate(-50%,20px);
  opacity:0;
  pointer-events:none;
  z-index:99999;
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:280px;
  padding:12px 16px;
  border-radius:12px;
  background:#0f172a;
  color:#fff;
  box-shadow:0 14px 40px rgba(15,23,42,.30);
  transition:opacity .2s ease,transform .2s ease;
}
.locatif-menu-toast span { color:#cbd5e1; font-size:.82rem; }
.locatif-menu-toast.show { opacity:1; transform:translate(-50%,0); }

@media (min-width:961px) {
  .sidebar.habys-sidebar-collapsed {
    width:82px !important;
    min-width:82px !important;
    padding-left:10px !important;
    padding-right:10px !important;
    gap:15px !important;
  }
  .sidebar.habys-sidebar-collapsed .habys-sidebar-toggle { right:8px; }
  .sidebar.habys-sidebar-collapsed .sidebar-logo { margin-top:18px; }
  .sidebar.habys-sidebar-collapsed .sidebar-logo .building-img {
    width:55px !important;
    height:55px !important;
    animation:none !important;
  }
  .sidebar.habys-sidebar-collapsed .habys-word,
  .sidebar.habys-sidebar-collapsed .sidebar-logo > span,
  .sidebar.habys-sidebar-collapsed .module-label,
  .sidebar.habys-sidebar-collapsed .return-habys span,
  .sidebar.habys-sidebar-collapsed .sidebar-footer,
  .sidebar.habys-sidebar-collapsed .menu-label,
  .sidebar.habys-sidebar-collapsed .menu-status {
    display:none !important;
  }
  .sidebar.habys-sidebar-collapsed .return-habys,
  .sidebar.habys-sidebar-collapsed #sidebar-nav a {
    justify-content:center !important;
    padding:7px 4px !important;
    transform:none !important;
  }
  .sidebar.habys-sidebar-collapsed .return-habys img {
    width:38px !important;
    height:38px !important;
  }
  .sidebar.habys-sidebar-collapsed .locatif-menu-icon {
    width:42px;
    height:42px;
    min-width:42px;
  }
}

@media (max-width:960px) {
  .habys-sidebar-toggle { display:none !important; }
  .sidebar {
    width:100% !important;
    min-width:0 !important;
    height:auto !important;
    position:relative !important;
  }
  .sidebar.habys-sidebar-collapsed {
    width:100% !important;
    min-width:0 !important;
  }
}
