/* Importing Google Fonts - Poppins (kept for icon metrics; reset removed) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Global reset REMOVED to avoid overriding Trarity app styles */
/*
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(#F1F3FF, #CBD4FF);
}
*/

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 270px;
  height: 100vh;
  background: #151A2D;
  transition: all 0.4s ease;
}

/* Optional glass variant: apply with class "sidebar--glass" in markup */
.sidebar--glass {
  background: linear-gradient(180deg, rgba(18,24,38,.75), rgba(14,20,32,.60));
  border-right: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 25px rgba(0,0,0,.35);
}

.sidebar.collapsed {
  width: 85px;
}

.sidebar .sidebar-header {
  display: flex;
  position: relative;
  padding: 25px 20px;
  align-items: center;
  justify-content: flex-start; /* keep title snug next to logo */
}

.sidebar-header .header-logo img {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
  border-radius: 50%;
}

.sidebar-header .header-title {
  margin-left: 16px;                /* shifted 10px further right */
  padding-right: 56px;              /* keep clear of the toggler button */
  font-weight: 700;
  letter-spacing: .08em;
  font-size: .88rem;
  display: flex;
  flex-wrap: wrap;                  /* allow wrap when space is tight */
  align-items: baseline;
  gap: 0 6px;                       /* horizontal gap between words */
  line-height: 1.05;
  white-space: normal;              /* allow wrapping */
  max-width: calc(100% - 120px);
  color: #EEF2FF;
  position: relative;               /* underline anchor */
  will-change: background-position, letter-spacing, transform;
}

.sidebar-header .header-title .ht-brand {
  /* premium multi-layer gradient stack */
  background-image:
    linear-gradient(90deg, rgba(231,241,255,.85), rgba(107,240,181,.85), rgba(231,241,255,.85)), /* base flow */
    linear-gradient(115deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 60%), /* specular sheen */
    radial-gradient(circle at 35% 55%, rgba(54,210,217,.35), rgba(54,210,217,0) 70%), /* left glow */
    radial-gradient(circle at 70% 45%, rgba(107,240,181,.30), rgba(107,240,181,0) 72%); /* right glow */
  background-size: 240% 100%, 300% 100%, 140% 140%, 150% 150%;
  background-position: 0% 50%, -130% 50%, 0% 0%, 100% 0%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: htBrandFlow 18s linear infinite, htBrandSheen 7.5s ease-in-out infinite, htBrandPulse 11s ease-in-out infinite;
  text-shadow: 0 0 4px rgba(107,240,181,.10), 0 0 12px rgba(107,240,181,.08);
}

.sidebar-header .header-title .ht-sub {
  letter-spacing: .06em;
  background-image:
    linear-gradient(90deg, rgba(200,220,255,.82), rgba(54,210,217,.82), rgba(200,220,255,.82)), /* base */
    linear-gradient(115deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.38) 50%, rgba(255,255,255,0) 58%), /* sheen */
    radial-gradient(circle at 55% 50%, rgba(107,240,181,.45), rgba(54,210,217,0) 68%), /* centered glow */
    linear-gradient(90deg, rgba(54,210,217,.15) 0%, rgba(54,210,217,0) 12%, rgba(107,240,181,.25) 50%, rgba(54,210,217,0) 88%, rgba(54,210,217,.15) 100%); /* subtle side shimmer */
  background-size: 240% 100%, 300% 100%, 160% 160%, 180% 100%;
  background-position: 0% 50%, -140% 50%, 50% 50%, 50% 50%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: htSubFlow 20s linear infinite, htSubSheen 8.2s ease-in-out infinite, htSubPulse 10s ease-in-out infinite;
  text-shadow: 0 0 5px rgba(54,210,217,.12), 0 0 14px rgba(107,240,181,.10);
  position: relative; /* anchor for underline */
  display: inline-block; /* ensure proper box for ::after positioning */
}

/* animated underline fixed to just under "ANALYTICS" (6px beyond A/S) */
.sidebar-header .header-title .ht-sub::after {
  content: '';
  position: absolute;
  left: -6px;                 /* 6px left of the 'A' */
  bottom: -3px;
  height: 2px;
  width: calc(100% + 12px);   /* extends 6px past the 'S' */
  border-radius: 99px;
  /* multi-layer premium glow: base line + soft aura + moving core */
  background-image:
    linear-gradient(90deg, rgba(54,210,217,0) 0%, rgba(54,210,217,.08) 15%, rgba(54,210,217,.22) 50%, rgba(54,210,217,.08) 85%, rgba(54,210,217,0) 100%), /* base subtle line */
    radial-gradient(ellipse at center, rgba(107,240,181,.65), rgba(54,210,217,.25) 55%, rgba(54,210,217,0) 75%), /* centered aura */
    linear-gradient(90deg,
      rgba(54,210,217,0) 0%,
      rgba(54,210,217,0) 38%,
      rgba(54,210,217,.35) 44%,
      rgba(107,240,181,.95) 50%,
      rgba(54,210,217,.35) 56%,
      rgba(54,210,217,0) 62%,
      rgba(54,210,217,0) 100%); /* moving highlight */
  background-size: 100% 100%, 140% 300%, 200% 100%;
  background-position: 50% 50%, 50% 50%, 25% 50%;
  mix-blend-mode: screen;
  filter: blur(.6px) saturate(140%);
  opacity: .92;
  animation: htUnderlinePing 13s cubic-bezier(.77,.02,.24,.99) infinite, htUnderlineAmbient 9s ease-in-out infinite;
}
/* premium glint pass over underline */
.sidebar-header .header-title .ht-sub::before {
  content:'';
  position:absolute; left:-6px; bottom:-3px; height:2px; width:calc(100% + 12px); border-radius:99px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 46%, rgba(255,255,255,.95) 50%, rgba(255,255,255,0) 54%, rgba(255,255,255,0) 100%);
  background-size: 180% 100%; background-position: 25% 50%; mix-blend-mode:screen; opacity:.75; filter: blur(.3px);
  animation: htUnderlineGlint 9.2s cubic-bezier(.65,.05,.35,.95) infinite;
  pointer-events:none;
}

@keyframes htBrandFlow { 0% { background-position: 0% 50%, -130% 50%, 0% 0%, 100% 0%; } 100% { background-position: 240% 50%, 170% 50%, 0% 0%, 100% 0%; } }
@keyframes htBrandSheen { 0% { background-position: 0% 50%, -130% 50%; } 55% { background-position: 120% 50%, 60% 50%; } 100% { background-position: 240% 50%, -130% 50%; } }
@keyframes htBrandPulse { 0%,100% { text-shadow: 0 0 4px rgba(107,240,181,.10), 0 0 12px rgba(107,240,181,.08); } 50% { text-shadow: 0 0 6px rgba(107,240,181,.18), 0 0 18px rgba(107,240,181,.12); } }

@keyframes htSubFlow { 0% { background-position: 0% 50%, -140% 50%, 50% 50%, 50% 50%; } 100% { background-position: 240% 50%, 160% 50%, 50% 50%, 50% 50%; } }
@keyframes htSubSheen { 0% { background-position: 0% 50%, -140% 50%; } 60% { background-position: 130% 50%, 70% 50%; } 100% { background-position: 240% 50%, -140% 50%; } }
@keyframes htSubPulse { 0%,100% { text-shadow: 0 0 5px rgba(54,210,217,.12), 0 0 14px rgba(107,240,181,.10); } 50% { text-shadow: 0 0 7px rgba(54,210,217,.20), 0 0 20px rgba(107,240,181,.16); } }

@keyframes htUnderlineGlint {
  0% { background-position:25% 50%; opacity:.0; }
  10% { opacity:.75; }
  45% { background-position:70% 50%; opacity:.75; }
  55% { background-position:70% 50%; opacity:.75; }
  90% { opacity:0; }
  100% { background-position:25% 50%; opacity:0; }
}

@keyframes htUnderlinePing {
  0%   { background-position: 25% 50%; }
  45%  { background-position: 72% 50%; }
  55%  { background-position: 72% 50%; }
  100% { background-position: 25% 50%; }
}
@keyframes htUnderlineAmbient {
  0% { filter: blur(.55px) saturate(130%); opacity:.88; }
  50% { filter: blur(.75px) saturate(165%); opacity:.95; }
  100% { filter: blur(.55px) saturate(130%); opacity:.88; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-header .header-title .ht-brand,
  .sidebar-header .header-title .ht-sub {
    animation: none !important;
    text-shadow: none !important;
    background-position: 0 50%;
  }
  .sidebar-header .header-title .ht-sub::after { animation: none !important; opacity: .65; }
  .sidebar-header .header-title .ht-sub::before { animation: none !important; opacity:0; }
}

.sidebar.collapsed .sidebar-header .header-title { display: none; }
@media (max-width: 768px){ .sidebar-header .header-title { display: none; } }

.sidebar-header .sidebar-toggler,
.sidebar-menu-button {
  position: absolute;
  right: 20px;
  height: 35px;
  width: 35px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  /* glassy button — slightly dimmer than active nav to differentiate */
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-header .sidebar-toggler {
  transform: translate(-4px, 65px);
}

.sidebar-header .sidebar-toggler span,
.sidebar-menu-button span {
  font-size: 1.75rem;
  transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-header .sidebar-toggler span {
  transform: rotate(180deg);
}

.sidebar-header .sidebar-toggler:hover,
.sidebar-menu-button:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 14px rgba(0,0,0,.22);
}

/* Accessible focus ring with brand accent */
.sidebar-header .sidebar-toggler:focus-visible,
.sidebar-menu-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(54,210,217,.35), 0 6px 18px rgba(54,210,217,.2);
}

.sidebar-nav .nav-list {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0 15px;
  flex-direction: column;
  transform: translateY(15px);
  transition: 0.4s ease;
}

.sidebar .sidebar-nav .primary-nav {
  overflow-y: auto;
  scrollbar-width: thin;
  padding-bottom: 20px;
  height: calc(100vh - 227px);
  scrollbar-color: transparent transparent;
}

.sidebar .sidebar-nav .primary-nav:hover {
  scrollbar-color: #EEF2FF transparent;
}

.sidebar.collapsed .sidebar-nav .primary-nav {
  overflow: unset;
  transform: translateY(65px);
}

.sidebar-nav .nav-item .nav-link {
  color: #fff;
  display: flex;
  gap: 12px;
  white-space: nowrap;
  border-radius: 8px;
  padding: 11px 15px;
  align-items: center;
  text-decoration: none;
  border: 1px solid #151A2D;
  width: 100%;               /* ensure all links occupy same inner width */
  box-sizing: border-box;    /* include padding/border within sidebar width */
  transition: 0.4s ease;
}

.sidebar--glass .sidebar-nav .nav-item .nav-link {
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
}

.sidebar-nav .nav-item:is(:hover, .open)>.nav-link:not(.dropdown-title) {
  color: #151A2D;
  background: #EEF2FF;
}

.sidebar--glass .sidebar-nav .nav-item:is(:hover, .open)>.nav-link:not(.dropdown-title) {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.18);
}

.sidebar .nav-link .nav-label {
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-link :where(.nav-label, .dropdown-icon) {
  opacity: 0;
  pointer-events: none;
}

.sidebar.collapsed .nav-link .dropdown-icon {
  transition: opacity 0.3s 0s ease;
}

.sidebar-nav .secondary-nav {
  position: absolute;
  left: 0;
  bottom: 15px;
  width: 100%;
  padding: 0 15px;            /* align with primary nav padding */
  background: #151A2D;        /* overridden by glass variant below */
  box-sizing: border-box;     /* prevent any overflow from padding */
}
.sidebar-nav .secondary-nav .nav-item .nav-link {
  box-sizing: border-box;     /* ensure padding stays inside sidebar width */
}

.sidebar--glass .sidebar-nav .secondary-nav { background: transparent; }

.sidebar-nav .nav-item {
  position: relative;
}

/* Dropdown Stylings */
.sidebar-nav .dropdown-container .dropdown-icon {
  margin: 0 -4px 0 auto;
  transition: transform 0.4s ease, opacity 0.3s 0.2s ease;
}

.sidebar-nav .dropdown-container.open .dropdown-icon {
  transform: rotate(180deg);
}

/* When a dropdown is marked disabled, hide the caret to indicate no expansion */
.sidebar-nav .dropdown-container[data-disabled="true"] .dropdown-icon {
  display: none;
}

.sidebar-nav .dropdown-menu {
  height: 0;
  overflow-y: hidden;
  list-style: none;
  padding-left: 15px;
  transition: height 0.4s ease;
}

.sidebar.collapsed .dropdown-menu {
  position: absolute;
  top: -10px;
  left: 100%;
  opacity: 0;
  height: auto !important;
  padding-right: 10px;
  overflow-y: unset;
  pointer-events: none;
  border-radius: 0 10px 10px 0;
  background: #151A2D;
  transition: 0s;
}

.sidebar--glass.collapsed .dropdown-menu {
  background: linear-gradient(180deg, rgba(18,24,38,.95), rgba(14,20,32,.90));
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
}

.sidebar.collapsed .dropdown-menu:has(.dropdown-link) {
  padding: 7px 10px 7px 24px;
}

.sidebar.sidebar.collapsed .nav-item:hover>.dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(12px);
  transition: all 0.4s ease;
}

.sidebar.sidebar.collapsed .nav-item:hover>.dropdown-menu:has(.dropdown-link) {
  transform: translateY(10px);
}

.dropdown-menu .nav-item .nav-link {
  color: #F1F4FF;
  padding: 9px 15px;
}

.sidebar.collapsed .dropdown-menu .nav-link {
  padding: 7px 15px;
}

.dropdown-menu .nav-item .nav-link.dropdown-title {
  display: none;
  color: #fff;
  padding: 9px 15px;
}

.dropdown-menu:has(.dropdown-link) .nav-item .dropdown-title {
  font-weight: 500;
  padding: 7px 15px;
}

.sidebar.collapsed .dropdown-menu .nav-item .dropdown-title {
  display: block;
}

.sidebar-menu-button {
  display: none;
}

/* Responsive media query code for small screens */
@media (max-width: 768px) {
  .sidebar-menu-button {
    position: fixed;
    left: 20px;
    top: 20px;
    height: 40px;
    width: 42px;
    display: flex;
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  }

  .sidebar.collapsed {
    width: 270px;
    left: -270px;
  }

  .sidebar.collapsed .sidebar-header .sidebar-toggler {
    transform: none;
  }

  .sidebar.collapsed .sidebar-nav .primary-nav {
    transform: translateY(15px);
  }
}

/* ===== Active page styling (glassy button) ===== */
/* Top-level nav links */
.sidebar-nav .nav-item > .nav-link.is-active:not(.dropdown-title) {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.18);
}
/* Submenu links */
.dropdown-menu .nav-link.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
}