:root {
  --sidebar-width: 280px;
  --sidebar-bg: #0d1124;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #aeb6d0;
  --sidebar-text-active: #ffffff;
  --sidebar-primary: #6355e7;
  --sidebar-primary-light: #7568f0;
  --sidebar-hover: rgba(255, 255, 255, 0.055);
  --sidebar-section: #69728d;
  --sidebar-mobile-width: min(310px, 88vw);
}

.sidebar {
  position: fixed;
  top: var(--navbar-height, 76px);
  left: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height, 76px));
  height: calc(100dvh - var(--navbar-height, 76px));
  padding: 22px 20px;
  overflow: hidden;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  box-sizing: border-box;
  transition: transform 0.3s ease;
}

.sidebar-mobile-header {
  display: none;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-decoration: none;
}

.sidebar-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #7768ff, #5949d7);
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 7px 20px rgba(99, 85, 231, 0.25);
}

.sidebar-brand-name {
  color: #ffffff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  gap: 18px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-group,
.host-navigation {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  isolation: isolate;
}

.host-navigation {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--sidebar-border);
}

.host-navigation.visible {
  display: flex;
}

.nav-section-title {
  padding: 0 15px 8px;
  color: var(--sidebar-section);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.8px;
}

.nav-active-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 50px;
  border-radius: 13px;
  background: linear-gradient(110deg, var(--sidebar-primary), #5749d2);
  box-shadow: 0 8px 24px rgba(99, 85, 231, 0.22);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.35s ease,
    opacity 0.2s ease;
  will-change: transform;
}

.nav-active-indicator.is-visible {
  opacity: 1;
}

.nav-active-indicator.no-transition {
  transition: none !important;
}

.nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 12px;
  border-radius: 13px;
  box-sizing: border-box;
  background: transparent;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  transition:
    color 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(3px);
}

.nav-link.active {
  background: transparent;
  color: var(--sidebar-text-active);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  flex: 0 0 22px;
  font-size: 17px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.nav-link:hover .nav-icon {
  transform: scale(1.12);
}

.nav-text {
  flex: 1;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.nav-status {
  flex-shrink: 0;
  margin-left: auto;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-status.pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.nav-status.rejected {
  background: rgba(251, 113, 133, 0.12);
  color: #fb7185;
}

.sidebar-overlay {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

.sidebar-close {
  display: none;
}

body:not(.host-layout) .sidebar,
body:not(.host-layout) .sidebar-overlay,
body:not(.host-layout) .mobile-menu-btn {
  display: none !important;
}

body.host-layout .sidebar {
  display: flex;
}

@media (max-width: 1100px) {
  .sidebar {
    width: var(--sidebar-width);
  }
}

@media (max-width: 900px) {
  .sidebar {
    top: 0;
    left: 0;
    z-index: 1300;
    width: var(--sidebar-mobile-width);
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.2);
    transform: translateX(-105%);
    visibility: hidden;
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 0 19px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
  }

  .sidebar-brand-mark {
    width: 39px;
    height: 39px;
  }

  .sidebar-brand-name {
    font-size: 21px;
  }

  .sidebar-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: rotate(90deg);
  }

  .sidebar-nav {
    padding: 22px 17px 25px;
    gap: 16px;
  }

  .nav-link {
    min-height: 52px;
    padding: 0 15px;
    font-size: 14.5px;
    gap: 13px;
  }

  .host-navigation {
    margin-top: 14px;
    padding-top: 18px;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(5, 8, 20, 0.65);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }


  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .mobile-menu-btn {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: min(300px, 88vw);
  }

  .sidebar-mobile-header {
    min-height: 76px;
    padding: 0 16px;
  }

  .sidebar-nav {
    padding: 19px 14px 24px;
  }

  .nav-link {
    min-height: 51px;
    padding: 0 13px;
    font-size: 14px;
  }

  .nav-icon {
    width: 23px;
    min-width: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-link,
  .nav-active-indicator,
  .nav-icon,
  .mobile-menu-btn,
  .sidebar-overlay,
  .sidebar-close {
    transition: none !important;
  }
}
