/* ROOT */
.sidebar {
  display: flex;
  height: 100vh;
  background: #fff;
  position: relative; /* 🔴 CRITICAL FIX */
  --accent: linear-gradient(135deg, #2563eb, #3b82f6, #60a5fa);
}

/* MAIN */
.sidebar-main {
  width: 260px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
  background: #fff;
}

/* ITEMS */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-item:hover:not([data-active="true"]) {
  background: #f1f5f9;
}

.sidebar-item[data-active="true"] {
  background: var(--accent);
  color: #fff;
}

/* ICON */
.icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef2ff;
}

.sidebar-item[data-active="true"] .icon {
  background: rgba(255,255,255,0.25);
}

/* PANEL — THIS IS THE MAIN FIX */
.sidebar-panel {
  position: absolute;        /* 🔴 REQUIRED */
  top: 0;
  left: 260px;               /* width of main sidebar */
  width: 280px;
  height: 100%;

  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);

  transform: translateX(-20px);
  opacity: 0;
  pointer-events: none;

  transition: transform .25s ease, opacity .25s ease;
  z-index: 1;
}

/* OPEN STATE */
.sidebar[data-state="open"] .sidebar-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* PANEL MENU */
.panel-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.panel-menu[data-visible="true"] {
  display: flex;
}

.panel-menu a {
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;     /* 🔴 FIX RAW LINKS */
  color: #0f172a;
  font-weight: 500;
}

.panel-menu a:hover {
  background: #f1f5f9;
}

/* COLLAPSED MAIN */
.sidebar[data-collapsed="true"] .sidebar-main {
  width: 80px;
}

.sidebar[data-collapsed="true"] .text {
  display: none;
}
