/* Shared authenticated sidebar: dark cosmic rail, icon-first navigation. */

:root {
  --fh-sidebar-width: 16rem;
  --fh-sidebar-collapsed-width: 5.25rem;
  --fh-shell-border: rgba(148, 163, 184, 0.16);
  --fh-shell-panel: rgba(10, 15, 22, 0.78);
  --fh-shell-panel-soft: rgba(16, 24, 32, 0.64);
  --fh-shell-text: #f7fff9;
  --fh-shell-muted: rgba(226, 232, 240, 0.68);
  --fh-accent: #73e38b;
  --fh-accent-strong: #9dffb0;
}

.main-sidebar.fh-cosmic-sidebar,
.main-sidebar.fh-cosmic-sidebar::before {
  width: var(--fh-sidebar-width);
}

.main-sidebar.fh-cosmic-sidebar {
  overflow: hidden;
  border-right: 1px solid var(--fh-shell-border);
  background:
    linear-gradient(180deg, rgba(2, 6, 10, 0.96), rgba(5, 11, 17, 0.9)),
    radial-gradient(circle at 50% 8%, rgba(72, 187, 120, 0.2), transparent 32%);
  box-shadow: 18px 0 52px rgba(0, 0, 0, 0.28);
}

body.dark-mode .main-sidebar.fh-cosmic-sidebar {
  background:
    linear-gradient(180deg, rgba(2, 6, 10, 0.96), rgba(5, 11, 17, 0.9)),
    radial-gradient(circle at 50% 8%, rgba(72, 187, 120, 0.2), transparent 32%) !important;
}

.fh-cosmic-sidebar .brand-link.fh-brand-link {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  height: 5.9rem;
  padding: 1.15rem 1rem;
  border-bottom: 1px solid var(--fh-shell-border);
  color: var(--fh-shell-text);
  background: transparent !important;
  text-decoration: none;
}

.layout-navbar-fixed .wrapper .main-sidebar.fh-cosmic-sidebar > .brand-link.fh-brand-link {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
}

.layout-navbar-fixed .wrapper .main-sidebar.fh-cosmic-sidebar .sidebar {
  margin-top: 0 !important;
}

.fh-cosmic-sidebar .brand-link.fh-brand-link:hover {
  color: #fff;
}

.fh-brand-mark-img {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 3.5rem;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 0 10px rgba(115, 227, 139, 0.22));
}

.fh-cosmic-sidebar .brand-text {
  margin: 0 !important;
  color: #f7fff9;
  font-family: var(--fh-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(115, 227, 139, 0.22);
}

.fh-brand-wordmark {
  display: block;
  width: min(10rem, calc(100% - 3.72rem));
  max-height: 2.45rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 14px rgba(115, 227, 139, 0.2));
}

.fh-cosmic-sidebar .sidebar-brand-logo-img.sidebar-brand-logo--full {
  display: block;
  width: 100%;
  max-height: 4rem;
  object-fit: contain;
  object-position: center;
}

.fh-cosmic-sidebar .sidebar-brand-logo-img.sidebar-brand-logo--compact {
  display: none;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

.fh-shell-sidebar {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  gap: 0.65rem;
  height: calc(100vh - 5.9rem);
  overflow: hidden;
  padding: 0.82rem 0.75rem 0.7rem;
}

.fh-cosmic-sidebar .sidebar.fh-shell-sidebar {
  height: calc(100vh - 5.9rem) !important;
  max-height: calc(100vh - 5.9rem);
  min-height: 0;
}

.fh-shell-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.15rem;
  overscroll-behavior: contain;
}

.fh-shell-nav::-webkit-scrollbar {
  width: 4px;
}

.fh-shell-nav::-webkit-scrollbar-thumb {
  background: rgba(115, 227, 139, 0.22);
  border-radius: 999px;
}

.fh-shell-nav .nav-item {
  width: 100%;
}

.sidebar .fh-shell-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 2.32rem;
  gap: 0.62rem;
  margin: 0 0 0.18rem;
  padding: 0.44rem 0.68rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(226, 232, 240, 0.76);
  text-decoration: none;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.sidebar .fh-shell-nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 50%, rgba(115, 227, 139, 0.2), transparent 42%),
    linear-gradient(90deg, rgba(115, 227, 139, 0.12), rgba(115, 227, 139, 0.02));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sidebar .fh-shell-nav-link:hover,
.sidebar .fh-shell-nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.13);
  transform: translateX(2px);
}

.sidebar .fh-shell-nav-link:hover::before,
.sidebar .fh-shell-nav-link:focus::before,
.sidebar .fh-shell-nav-link.active::before {
  opacity: 1;
}

.sidebar .fh-shell-nav-link.active {
  color: var(--fh-accent-strong) !important;
  border-color: rgba(115, 227, 139, 0.42) !important;
  background: rgba(31, 88, 46, 0.32) !important;
  background-color: rgba(31, 88, 46, 0.32) !important;
  box-shadow:
    inset 3px 0 0 rgba(115, 227, 139, 0.9),
    0 0 28px rgba(115, 227, 139, 0.12);
}

.fh-shell-nav-link__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.34rem;
  height: 1.34rem;
  flex: 0 0 1.34rem;
  font-size: 0.95rem;
}

.fh-shell-nav-link__label {
  position: relative;
  z-index: 1;
  margin: 0 !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.fh-shell-nav-divider {
  height: 1px;
  min-height: 1px;
  margin: 0.45rem 0.55rem;
  padding: 0 !important;
  background: var(--fh-shell-border);
}

.fh-sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 0.4rem;
  margin-top: 0;
  padding-top: 0.2rem;
}

.fh-sidebar-promo,
.fh-sidebar-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 2.8rem;
  gap: 0.48rem;
  padding: 0.46rem 0.54rem;
  border: 1px solid var(--fh-shell-border);
  border-radius: 8px;
  color: var(--fh-shell-text);
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
}

.fh-sidebar-promo {
  background:
    radial-gradient(circle at 100% 0%, rgba(115, 227, 139, 0.2), transparent 48%),
    rgba(255, 255, 255, 0.045);
}

.fh-sidebar-promo:hover,
.fh-sidebar-profile:hover {
  color: #fff;
  text-decoration: none;
  border-color: rgba(115, 227, 139, 0.32);
}

.fh-sidebar-promo__icon,
.fh-sidebar-profile__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  flex: 0 0 1.85rem;
  background: rgba(115, 227, 139, 0.12);
  color: #f6d365;
}

.fh-sidebar-profile__avatar {
  background: linear-gradient(135deg, rgba(115, 227, 139, 0.28), rgba(148, 163, 184, 0.12));
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
}

.fh-sidebar-promo__body,
.fh-sidebar-profile__body {
  min-width: 0;
}

.fh-sidebar-promo__title,
.fh-sidebar-profile__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 800;
}

.fh-sidebar-promo__text,
.fh-sidebar-profile__text {
  display: block;
  margin-top: 0.06rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fh-shell-muted);
  font-size: 0.62rem;
}

.fh-sidebar-promo__chevron,
.fh-sidebar-profile__chevron {
  color: rgba(226, 232, 240, 0.45);
  font-size: 0.75rem;
}

@media (min-width: 992px) {
  .layout-fixed .main-sidebar.fh-cosmic-sidebar {
    bottom: 0;
  }

  body.sidebar-mini.sidebar-collapse .main-sidebar.fh-cosmic-sidebar,
  body.sidebar-mini.sidebar-collapse .main-sidebar.fh-cosmic-sidebar::before {
    width: var(--fh-sidebar-collapsed-width);
  }

  body.sidebar-mini.sidebar-collapse .fh-cosmic-sidebar .brand-link.fh-brand-link {
    justify-content: center;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  body.sidebar-mini.sidebar-collapse .fh-cosmic-sidebar .brand-text,
  body.sidebar-mini.sidebar-collapse .fh-brand-wordmark,
  body.sidebar-mini.sidebar-collapse .fh-shell-nav-link__label,
  body.sidebar-mini.sidebar-collapse .fh-sidebar-promo__body,
  body.sidebar-mini.sidebar-collapse .fh-sidebar-profile__body,
  body.sidebar-mini.sidebar-collapse .fh-sidebar-promo__chevron,
  body.sidebar-mini.sidebar-collapse .fh-sidebar-profile__chevron,
  body.sidebar-mini.sidebar-collapse .fh-cosmic-sidebar .sidebar-brand-logo--full {
    display: none !important;
  }

  body.sidebar-mini.sidebar-collapse .fh-cosmic-sidebar .sidebar-brand-logo--compact {
    display: block !important;
  }

  body.sidebar-mini.sidebar-collapse .sidebar .fh-shell-nav-link,
  body.sidebar-mini.sidebar-collapse .fh-sidebar-promo,
  body.sidebar-mini.sidebar-collapse .fh-sidebar-profile {
    justify-content: center;
    grid-template-columns: 1fr;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

@media (max-width: 991.98px) {
  .main-sidebar.fh-cosmic-sidebar,
  .main-sidebar.fh-cosmic-sidebar::before {
    width: min(var(--fh-sidebar-width), 88vw);
  }

  .main-sidebar.fh-cosmic-sidebar {
    z-index: 1050 !important;
  }

  .fh-cosmic-sidebar .brand-link.fh-brand-link {
    height: 4.6rem;
  }

  .fh-shell-sidebar {
    height: calc(100vh - 4.6rem);
  }

  .fh-cosmic-sidebar .sidebar.fh-shell-sidebar {
    height: calc(100vh - 4.6rem) !important;
    max-height: calc(100vh - 4.6rem);
  }
}
