.nav-sidebar {
  display: inline-flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: flex-start;
  padding: 24px 16px;
  position: relative;
  width: 224px;
  top: -1px;
  left: 0;
  background-color: var(--white-1000);
  border-right-width: 1px;
  border-right-style: solid;
  border-color: transparent;
  border-image: linear-gradient(
      180deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(228, 228, 228, 1) 24%
    )
    1;
}

.nav-sidebar-content {
  width: 100%;
  overflow: hidden auto;
}

.nav-sidebar.state .nav-sidebar-content {
  overflow: visible;
}

.nav-sidebar-header {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
}

.nav-sidebar-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  flex: 1;
  flex-grow: 1;
} 

.nav-sidebar-logo {
  position: relative;
  width: 36px;
  height: 36px;
  object-fit: cover;
  margin: 3px 0 0 3px;
}

.collapse-button {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 4px;
  min-width: auto;
  width: 16px;
  height: 16px;
  box-sizing: content-box;
}

.collapse-button>span {
  font-size: 18px;
  font-weight: 400;
}

.collapse-button:hover,
.collapse-button:focus-visible {
  background-color: var(--blue-50);
  outline: 0;
}

.chevrons-left {
  margin: auto;
  font-weight: 400;
  color: var(--gray-800);
  font-size: 16px;
  text-align: center;
  letter-spacing: 0;
  line-height: normal;
}

.side-nav-items {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  position: relative;
  align-self: stretch;
  width: 100%;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 4px;
}

.nav-sidebar .icon-wrapper, 
.nav-sidebar .icon-wrapper a {
  font-weight: 300;
  color: var(--blue-1000);
  font-size: 16px;
  width: 16px;
  text-align: center;
  letter-spacing: 0;
  line-height: normal;
  margin-right: 8px;
}

.side-nav-items .icon-wrapper {
  width: 14px;
}

.component {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 4px;
}

.badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0px 4px;
  flex: 0 0 auto;
  margin-left: 6px;
  background-color: var(--red-400);
  border-radius: 100px;
  width: 16px;
  height: 16px;
}

.badge > span {
  position: relative;
  width: fit-content;
  font-weight: var(--body-copy-xs-bold-font-weight);
  color: var(--white-1000);
  font-size: var(--body-copy-xs-bold-font-size);
  text-align: center;
  letter-spacing: var(--body-copy-xs-bold-letter-spacing);
  line-height: var(--body-copy-xs-bold-line-height);
  font-style: var(--body-copy-xs-bold-font-style);
}

.nav-sidebar.state .badge {
  background-color: var(--red-400);
  width: 8px;
  height: 8px;
  position: absolute;
  left: 6px;
  top: 0px;
}

.nav-sidebar.state .badge > span {
  display:none;
}

.nav-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 0px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-color: var(--gray-200);
}

.nav-section:last-child {
  border: 0;
}

.nav-section > .nav-section-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
}

.nav-section-container ul {
  width: 100%;
}

.nav-section-header {
  align-items: center;
  padding: 8px;
  display: flex;
}

.children-wrapper {
  display: flex;
  align-items: center;
  padding: 8px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
  border-radius: 4px;
}

.children-wrapper:hover,
.children-wrapper:hover a,
.side-nav-items:hover,
.side-nav-items:hover a {
  background: var(--blue-50);
  --bg-currentcolor: var(--blue-50);
  color: var(--blue-500);
  font-weight: 700;
}

.children {
  position: relative;
  flex: 1;
  margin-top: -1.00px;
  font-family: var(--body-copy-font-family);
  font-weight: var(--body-copy-sm-body-font-weight);
  color: #171717;
  font-size: var(--body-copy-sm-body-font-size);
  letter-spacing: var(--body-copy-sm-body-letter-spacing);
  line-height: var(--body-copy-sm-body-line-height);
  font-style: var(--body-copy-sm-body-font-style);
}

.h4 {
  flex: 1;
  color: var(--gray-800);
  font-size: var(--body-copy-xs-body-font-size);
  line-height: var(--body-copy-xs-body-line-height);
  position: relative;
  margin-top: -1.00px;
  font-family: var(--body-copy-font-family);
  font-weight: var(--body-copy-xs-body-font-weight);
  letter-spacing: var(--body-copy-xs-body-letter-spacing);
  font-style: var(--body-copy-xs-body-font-style);
  text-transform: uppercase;
}

.nav-section a {
  flex: 1;
  color: var(--blue-1000);
  font-size: var(--body-copy-sm-body-font-size);
  line-height: var(--body-copy-sm-body-line-height);
  position: relative;
  margin-top: -1.00px;
  font-family: var(--body-copy-font-family);
  font-weight: var(--body-copy-sm-body-font-weight);
  letter-spacing: var(--body-copy-sm-body-letter-spacing);
  font-style: var(--body-copy-sm-body-font-style);
  text-decoration: none;
}

.nav-section .icon-wrapper {
  color: var(--blue-1000);
}

.children-wrapper.active a,
.side-nav-items.active .icon-wrapper,
.side-nav-items.active .nav-text {
  font-weight: 700;
  color: var(--blue-500);
}

.nav-section a.active {
  flex: 1;
  font-weight: var(--body-copy-sm-bold-font-weight);
  color: var(--blue-500);
  font-size: var(--body-copy-sm-bold-font-size);
  line-height: var(--body-copy-sm-bold-line-height);
  position: relative;
  margin-top: -1.00px;
  font-family: var(--body-copy-font-family);
  letter-spacing: var(--body-copy-sm-bold-letter-spacing);
  font-style: var(--body-copy-sm-bold-font-style);
}

.nav-link:hover {
  background-color: #f8f9fa;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-navigation {
  display: none;

  @media screen and (max-width: 768px) {
    display: block;
  }
}

.mobile-menu {
  background: none;
  border: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
  font-size: 16px;
  color: var(--white-1000);
  width: 16px;
  height: 16px;
  min-width: auto;
  min-height: auto;
}

.mobile-menu:hover,
.mobile-menu:focus-visible {
  background: none;
  outline: 0;
}

.user-dropdown-button {
  display: flex;
  width: 40px;
  height: 40px;
  outline-width: 0;
  outline-style: solid;
  outline-color: transparent;
  background-color: var(--blue-200);
  border-radius: 4px;
  border: none;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: auto;
  padding: 0;
  transition: outline 0.2s ease;
}

.user-dropdown-button:focus-visible,
.user-dropdown-button:hover {
  outline-width: 4px;
  outline-style: solid;
  outline-color: var(--blue-50);
}

.user {
  font-family: var(--headings-font-family);
  font-size: 16px;
  font-weight: 500;
  color: #171717;
}

.user-dropdown-menu {
  position: absolute;
  display: none;
  padding: 0;
  margin: 0;
  top: 48px;
  right: 0;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 4px;
  background:  var(--white-1000);
  overflow: hidden;
  z-index: 100;
  box-shadow: var(--sm-dropshadow-primary);
}

.user-dropdown-menu.state {
  display: flex;
}

.user-dropdown-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  z-index: 1;
  width: 100%;
}

.user-dropdown-item>a {
  color: #171717;
  padding: 10px 16px;
  width: 100%;
  font-size: var(--body-copy-sm-body-font-size);
  letter-spacing: var(--body-copy-sm-body-letter-spacing);
  line-height: var(--body-copy-sm-body-line-height);
  font-style: var(--body-copy-sm-body-font-style);
  text-wrap: nowrap;
  text-decoration: none;
}

.user-dropdown-item>a:hover {
  background-color: var(--blue-50);
}

.nav-sidebar .nav-section-menu .nav-section-header {
  display: none;
  padding-top: 0;
}

.nav-section-menu {
  width: 100%;
}

@media screen and (min-width: 769px) {
  .nav-sidebar.state {
    width: 70px;
  }

  .nav-sidebar.state .collapse-button {
    transform: rotate(180deg);
  }

  .nav-sidebar.state .nav-sidebar-header {
    flex-direction: column;
  }

  .nav-sidebar.state .nav-section {
    padding-bottom: 0;
    border-bottom: 0;
  }

   .nav-sidebar.state .nav-section-top {
    border-bottom: 1px solid var(--gray-100);
   }

  .nav-sidebar.state .nav-section-top .nav-text {
    display: none;
  }

  .nav-sidebar.state .nav-section-container>.nav-section-header {
    cursor: pointer;
  }

  .nav-sidebar.state .nav-section-container>.nav-section-header .h4 {
    display: none;
  }

  .nav-sidebar.state .nav-section-menu .nav-section-header {
    display: block;
  }

  .nav-sidebar.state .nav-section-menu {
    display: none;
  }

  .nav-sidebar.state .nav-section:hover .nav-section-menu,
  .nav-sidebar.state .nav-section:focus-within .nav-section-menu {
    display: block;
    position: absolute;
    background-color: var(--white-1000);
    width: 224px;
    left: 38px;
    top: -12px;
    z-index: 100;
    padding: 16px;
    border-radius: 8px;
    box-shadow: var(--sm-dropshadow-primary);
    border: 1px solid var(--gray-100);
  }
}

/* Responsive navigation */
@media (max-width: 768px) {
  .nav-sidebar {
    position: fixed;
    width: 100%;
    left: -100%;
    transition: left 0.3s ease;
    z-index: 1000;
    height: 100vh;
  }
  
  .nav-sidebar.state {
    left: 0;
  }

  .nav-sidebar.state .nav-sidebar-content {
    overflow: hidden auto;
  }
  
  .nav-sidebar.collapsed {
    width: 100%;
    padding: 24px 16px;
  }
  
  .nav-sidebar.collapsed .children,
  .nav-sidebar.collapsed .h4,
  .nav-sidebar.collapsed .nav-sidebar-logo-wrapper {
    display: block;
  }
}

/* Navigation link transitions */
.nav-link {
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:focus-visible {
  /* Unmapped blue (#007bff); bootstrap blue. Consider adding token */
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

@supports selector(:has(*)) {
  /* Select .icon-wrapper inside a .nav-section-container that has any .active descendant */
  .nav-section-container:has(.active) .icon-wrapper {
    color: var(--blue-500);
    font-weight: 550;
  }
}

