.sidebar {
  position: relative;
  display: grid;
  grid-template: 1fr auto / 1fr;
  width: var(--sidebar-width);
  height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  align-self: stretch;
  border-right: 1px solid var(--grey-100);
  padding-bottom: var(--gap-small);
  background: var(--dashboard-bg);
  z-index: 996;
  /*  overflow-y: auto;*/

  will-change: width, contents;
   /* transition: 0.3125s ease-out width;  */
}

:where(.sidebar) .nav-tag {
  display: flex;
  height: 16px;
  padding: 0px 4px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--badge-new-badge-new-label-text-color, #fff);
  border-radius: 2px;
  background-color: var(--badge-new-badge-new-label-bg, #4473d4) !important;
}

.brand {
  --_brand-height: var(--top-nav-height);
  position: relative;
  display: flex;
  height: var(--_brand-height);
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  padding: 8px;
  border-bottom: 1px solid var(--grey-100);
  padding-left: var(--padding-left);
}

.app:has(.banner-container) .brand {
  --_brand-height: var(--banner-height);
}

.brand+.block-card {
  /*  margin-bottom: 20px;*/
  border-top: none;
}

.brand img {
  width: 150px;
  height: 32px;
  object-fit: contain;
  margin-right: var(--gap-small);
}
#nav-toggler {
  position: absolute;
  right: .5em;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-grey-600);
  cursor: pointer;
  transition: background-color .12s ease-out, color .12s ease-out;
}

#nav-toggler:hover {
  background: var(--navigation-button-bg-hover);
  color: var(--color-text);
}

#nav-toggler:focus {
  outline: none;
  filter: none;
}

#nav-toggler:focus-visible {
  outline: 2px solid var(--outline-color);
  outline-offset: 2px;
}

.nav-collapsed #nav-toggler {
  right: 50%;
  translate: 50% 0;
}

.nav-collapsed #nav-toggler .icon {
  rotate: 180deg;
}

.sidebar__item {
  --_pl: 25px;
  position: relative;
  display: flex;
  padding: 8px 16px;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  border-radius: var(--border-radius);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.sidebar) .display-contents {
  display: contents;
}

/* [data-parent-sidebar-item] {
  --_pl: 18px;
} */

.sidebar__item:hover {
  background: var(--navigation-button-bg-hover);
}

.sidebar-group {
    /* display: content; */
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.sidebar__title .action {
    opacity: 1 !important;
}

p-sidebar-item:not([title]) .sidebar__label {
  font-weight: 500;
}

p-sidebar-item:has(p-sidebar-item) {
  display: flex;
  flex-direction: column;
}

p-sidebar-item>p-sidebar-item {
  display: flex;
  flex-direction: column;
  margin-left: 1em;
}

.sidebar__nested-list {
  position: relative;
  margin: 0;
  margin-left: 1em;
  height: 0;
  overflow: hidden;
  transition: height .25s ease-out, padding .25s ease-out, opacity .2s ease-out, visibility .25s;
  opacity: 0;
  interpolate-size: allow-keywords;
  visibility: hidden;

  border-color: var(--_border-color);
  border-bottom: 1px solid var(--_border-color);
  border-left: 1px solid var(--_border-color);
  border-bottom-left-radius: 1em;
}

.sidebar__nested-list.expanded {
  --_border-color: var(--color-grey-200);
  height: auto;
  visibility: inherit;
  padding-bottom: 0.5em;
  opacity: 1;
}

.sidebar__label .icon-expand {
    opacity: 0.7;
    transition: var(--transition);
}

.sidebar__item > .icon-expand {
    opacity: .76;
}

/* TREE LINE */
.sidebar__nested {
    padding-left: 2em;
}

.sidebar__item.active::before {
  content: '';
  position: absolute;
  height: 100%;
  width: 4px;
  left: 0;
  background: var(--navigation-button-indicator-active);
  transition: transform 0.145s ease-in-out;
}

.sidebar__item.active {
  background: var(--prompt-colors-primary-light);
}

.nav-collapsed .sidebar-group {
    position: relative;
}

.nav-collapsed .sidebar-group::after {
    --background: transparent;

    content: "";
    position: absolute;
    inset: .5em;
    top: 0;
/*    width: calc(100%);*/
    height: 100%;
    border-radius: 4px;
    background: var(--background);
    z-index: -1;

    transition: 125ms ease-out;
}

.nav-collapsed [group] .sidebar__item:hover {
    background: transparent;
}

:where(.sidebar) .icon-expand::before {
    opacity: 1;
    display: inline-block;
    transition: 0.4s ease-in-out;
    transition-property: rotate, transform;
}

:where(.sidebar) .icon-expand {
    transition-property: rotate, transform;
    transition: 200ms;
}
.sidebar__label {
    display: flex;
    gap: var(--gap-small);
    line-height: 1.5;
    align-items: center;
    font-weight: 600;
}

.sidebar__label span:not(.icon) {
  max-width: 18ch;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
}

.group-items {
  interpolate-size: allow-keywords;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: height .25s ease-out, margin-top .25s ease-out, visibility .25s;
}

.group-items.expanded {
  height: auto;
  margin-top: var(--gap-small);
  visibility: visible;
}

.group-items .sidebar__item {
  padding-left: var(--_pl);
}

.group-items .sidebar__label {
  gap: var(--gap-small);
}

.sidebar__item:not(:hover) .action {
  pointer-events: none;
}

.sidebar__top,
.sidebar__bottom {
  width: 100%;
  overflow: hidden;
}

.sidebar__top {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: start;
  overflow-y: auto;
}

.product-navigation {
  width: 100%;
}

/* nav-block CARD */
.block-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: calc(var(--gap-small) * 2);
  border-bottom: 1px solid var(--grey-100);
  border-top: 1px solid var(--grey-100);
  cursor: pointer;
}

.block-card:hover {
/*  background: var(--navigation-button-bg-hover);*/
}

.emblem {
  --_size: 44px;
  display: flex;
  width: var(--_size);
  height: var(--_size);
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-white);
  vertical-align: middle;
  line-height: 1.2;
  padding: calc(var(--gap-small) / 2);
  background: var(--color-white, #fff);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(0 0 0 / 0);

  margin: auto;

  transition: 200ms ease-out;

}

.emblem:hover {
    transform: scale(1.15);
    box-shadow: 0 0 16px rgba(0 0 0 / .08);
}

.emblem-round {
  --_size: 28px !important;
  border-radius: 50% !important;
  background: color-mix(in srgb, var(--color-brand-accent) 15%, white);
  color: var(--color-brand-accent);
  padding: 0;
}

.emblem-round .icon {
  --_size: 18px;
}

.emblem img {
  width: 100%;
}

.block-card :is(.left, .right) {
  display: flex;
  gap: var(--gap-small);
  align-items: center;
}

.block-card__content {
  height: 100%;
  padding: 4px;
  border-radius: 4px;
}

.block-card__content:hover {
  background-color: var(--navigation-button-bg-hover);
}

.profile-user-block:hover {
  background-color: var(--navigation-button-bg-hover);
}

.block-card__title {
  color: var(--black);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  max-width: 14ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.block-card__title:only-child {
  font-weight: 400;
}

.block-card__subtitle {
  color: var(--grey-600);
  font-weight: 400;
  line-height: 1.5;
  font-size: 12px;
  margin: 0;
  padding: 0;

  width: 100%;
  max-width: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* nav-block CARD */

.powered-badge {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 116px;
}


.nav-collapsed-only {
  --_size: 32px !important;
  display: none;
  transition: 0.25s ease-out;
  transition-property: opacity, transform;
}

.nav-collapsed .nav-collapsed-only {
  display: block;
  opacity: 1;
  transform: scaleY(1);
}

.nav-collapsed .sidebar :is(.right,
  .sidebar__label + .action,
    .brand-img-link,
  .powered-badge) {
  display: none;
}

.nav-collapsed .nav-collapsed-only :is(img) {
  display: block !important;
}
:where(.sidebar) a:has(.brand-img){
  display: contents;
}
.nav-collapsed .brand-img {
  width: 100%;
  margin: auto;
}

.nav-collapsed .product-navigation {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto !important;
/*    padding: 8px;
    padding-left: 10px;*/
}

.nav-collapsed .sidebar .icon:not(.group-items *) {
  --_size: 20px;
}

.nav-collapsed .sidebar .group-items:not(:popover-open) {
  display: none !important;
}

.nav-collapsed .emblem {
  --_size: 48px;
  aspect-ratio: 1 / 1;
}

.nav-collapsed .emblem-round .icon {
  --_size: 22px;
}

.nav-collapsed .brand {
  padding: 8px;
}

.nav-collapsed .sidebar .sidebar__item:not(.group-items *) {
  padding: 12px 8px;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.nav-collapsed .sidebar .block-card {
  padding: 8px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.nav-collapsed .block-card :is(.left, .right) {
  display: flex;
  align-items: center;
  flex-direction: column;
  font-size: 10px;

  .block-card__content>* {
    font-size: 11px;
    max-width: 12ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
}

.nav-collapsed .sidebar .sidebar__label:not(.group-items *) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
}

.powered-badge--small {
  display: none;
  width: var(--sidebar-width);
}

.nav-collapsed :is(.powered-badge--small) {
  display: block !important;
}

.nav-collapsed .sidebar-group:not(.sidebar-group--current):hover::after {
  --background: var(--navigation-button-bg-hover);
}

.nav-collapsed .sidebar-group--current::after {
  --background: var(--prompt-colors-primary-light);
}

.nav-collapsed .sidebar-group--current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--navigation-button-indicator-active);
}

.app:not(.nav-collapsed) .sidebar-group--current > p-sidebar-item > .sidebar__item {
  color: color-mix(in oklab, var(--navigation-button-indicator-active), black 25%);
}

button.sidebar__item {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  color: #333;
  text-align: start;
  cursor: pointer;
}

.sidebar button.sidebar__item {
  color: #444;
}

button.sidebar__item:focus {
  outline: none;
  filter: none;
}

button.sidebar__item:focus-visible {
  outline: 2px solid var(--outline-color);
  outline-offset: -2px;
}

:where(.sidebar) button[aria-expanded="true"] .icon-expand {
  rotate: 180deg;
}

:where(.sidebar) button[aria-expanded="true"] .expand-prefix-icon {
  rotate: 90deg;
}

@media (prefers-reduced-motion: reduce) {
  .group-items,
  .sidebar__nested-list {
    transition: none;
  }
}

.sidebar .group-items:popover-open {
  position: fixed;
  inset: auto;
  top: var(--y);
  left: calc(var(--sidebar-width) + 8px);
  margin: 0;
  padding: 0 6px 6px;
  height: auto;
  max-height: calc(100vh - var(--y) - 8px);
  overflow-y: auto;
  visibility: visible;
  min-width: 232px;
  background: #fff;
  border: 1px solid var(--grey-100);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(20 40 32 / .12), 0 2px 6px rgba(0 0 0 / .04);
  transition: none;
}

.sidebar .group-items:popover-open::before {
  content: attr(data-title);
  display: block;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 2em;
  margin: 0 -6px 6px;
  border-radius: 8px 8px 0 0;
  color: var(--color-grey-600);
  background: #fff;
  border-bottom: 1px solid var(--grey-100);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sidebar .group-items:popover-open .sidebar__item {
  padding-left: 8px;
  border-radius: 4px;
  margin-block: 2px;
}

.sidebar .group-items:popover-open .sidebar__item.active {
  color: color-mix(in oklab, var(--navigation-button-indicator-active), black 25%);
  font-weight: 600;
}

.sidebar .group-items:popover-open .sidebar__item.active::before {
  display: none;
}

.sidebar .group-items:popover-open .sidebar__nested-list {
  padding-left: 4px;
}

.sidebar .group-items:popover-open .sidebar__nested-list.expanded {
  margin-bottom: 6px;
}

.sidebar .external-icon {
  --_size: 12px;
  opacity: .55;
}

.nav-collapsed .sidebar .external-icon:not(.group-items *) {
  display: none;
}

.sidebar .product-navigation {
  scrollbar-width: thin;
  scrollbar-color: var(--grey-400) transparent;
  --shadow-top: transparent;
  --shadow-bottom: transparent;
  box-shadow: inset 0 10px 10px -10px var(--shadow-top), inset 0 -10px 10px -10px var(--shadow-bottom);
  transition: box-shadow .15s ease-out;
}

.nav-collapsed .sidebar .product-navigation {
  scrollbar-width: none;
}

.sidebar .icon.dot::before {
  --_size: 5px;
  --_color: var(--grey-400);
  opacity: .7;
}

.sidebar .sidebar__item:hover .icon.dot::before {
  opacity: 1;
}

.sidebar .sidebar__item.active .icon.dot::before {
  --_color: var(--navigation-button-indicator-active);
  opacity: 1;
}

.sidebar .product-navigation.more-above {
  --shadow-top: rgba(0 0 0 / .28);
}

.sidebar .product-navigation.more-below {
  --shadow-bottom: rgba(0 0 0 / .28);
}

.sidebar p-sidebar-item:has(.sidebar__item.active) > button.sidebar__item {
  color: color-mix(in oklab, var(--navigation-button-indicator-active), black 25%);
}