/*
  Navigation (clean).
  Fix: hover background is clipped to rounded corners.
*/

.nav{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 4px 4px;
}

.nav-block{
  padding: 6px 0 10px 0;
}
.nav-block:not(:last-child){
  border-bottom: 1px solid var(--border2);
}

.nav-children{
  display:flex;
  flex-direction:column;
  gap: 2px;
  margin-top: 4px;
}

.nav-link{
  --padL: 12px;
  display:flex;
  align-items:center;
  min-height: 38px;
  padding: 9px 12px;
  padding-left: var(--padL);

  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration:none;
  color: var(--text);

  /* crucial: clip hover/focus layers */
  overflow: hidden;
  background-clip: padding-box;

  transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.nav-text{
  line-height: 1.2;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.nav-link:hover{
  background: var(--hover);
  transform: translateY(-1px);
  border-color: rgba(52,211,153,0.20);
}

.nav-link.is-active{
  background: var(--active);
  border-color: rgba(52,211,153,0.45);
}

.nav-section .nav-text{
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: .92;
}
.nav-page .nav-text{
  font-weight: 500;
  opacity: .92;
}

.nav-label{ cursor: default; }
.nav-label:hover{
  transform:none;
  background: transparent;
  border-color: transparent;
}

/* nesting */
.d-0{ --padL: 12px; }
.d-1{ --padL: 28px; }
.d-2{ --padL: 44px; }
.d-3{ --padL: 60px; }
.d-4{ --padL: 76px; }
.d-5{ --padL: 92px; }

/* Icons + collapsible sections (ПКМ раскрывает) */
.nav-link{ gap: 10px; }

.nav-item{ display:flex; flex-direction:column; gap:2px; }
.nav-item.is-collapsed > .nav-children{ display:none; }

.nav-icon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  opacity: .92;
}
.nav-icon svg{ width: 18px; height: 18px; }
.nav-icon img{ width: 18px; height: 18px; object-fit: contain; }


.nav-item.is-open > .nav-link .nav-caret{ transform: rotate(90deg); }

/* Caret positioning/visibility (fix: in search menu the arrow could disappear / wrap) */
.nav-caret{
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  opacity: .92;
  transition: transform 140ms ease;
}
.nav-caret svg{ width: 18px; height: 18px; }

/* Sidebar search */
.sidebar-search{ padding: 4px 4px 10px 4px; }
.nav-search{
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: 0.2px;
  outline: none;
}
html[data-theme="light"] .nav-search{ background: rgba(255,255,255,0.92); }
.nav-search::placeholder{ color: var(--muted); opacity: .8; }
.nav-search:focus{
  border-color: rgba(52,211,153,0.45);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.12);
}
.shell.is-collapsed .sidebar-search{ display:none; }