.sidebar,
.app-shell {
  transition: width .22s ease, grid-template-columns .22s ease;
}

.sidebar-brand {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.sidebar-brand .sidebar-brand-mark {
  display: none;
}

.sidebar-brand .sidebar-brand-full {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(188px, calc(100% - 42px));
  height: auto;
  max-height: calc(100% - 18px);
  margin: 0;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
}

.sidebar-collapse-toggle {
  position: absolute;
  right: -14px;
  bottom: -15px;
  z-index: 5;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid #c8dbe6;
  border-radius: 50%;
  padding: 0;
  color: #0a4c7f;
  background: #fff;
  box-shadow: 0 5px 14px rgba(6, 46, 79, .14);
  cursor: pointer;
  font: 700 22px/1 Arial, sans-serif;
}

.sidebar-collapse-toggle > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding-bottom: 2px;
}

.sidebar-collapse-toggle:focus-visible {
  outline: 3px solid rgba(44, 198, 193, .38);
  outline-offset: 3px;
}

.sidebar-collapse-toggle:hover {
  color: #fff;
  border-color: #0a598d;
  background: #0a598d;
}

.sidebar-footer {
  position: relative;
  flex: 0 0 72px;
  min-height: 72px;
  padding: 0;
  border-top: 0;
  overflow: visible;
}

.sidebar-profile-stack {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 10px;
  background: var(--forest-900);
}

.sidebar-profile-stack::before {
  content: "";
  position: absolute;
  top: 0;
  right: -12px;
  left: -12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.profile-menu {
  order: 2;
  display: grid !important;
  gap: 4px;
  max-height: 220px;
  margin: 8px 0 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  transform: translateY(0);
  background: rgba(2, 42, 74, .72);
  box-shadow: 0 12px 28px rgba(0, 20, 38, .2);
  transition:
    max-height .28s cubic-bezier(.22, 1, .36, 1),
    margin-top .28s cubic-bezier(.22, 1, .36, 1),
    padding .28s cubic-bezier(.22, 1, .36, 1),
    border-width .28s cubic-bezier(.22, 1, .36, 1),
    opacity .18s ease,
    transform .28s cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear 0s;
}

.profile-menu[hidden] {
  display: grid !important;
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    max-height .24s cubic-bezier(.4, 0, 1, 1),
    margin-top .24s cubic-bezier(.4, 0, 1, 1),
    padding .24s cubic-bezier(.4, 0, 1, 1),
    border-width .24s cubic-bezier(.4, 0, 1, 1),
    opacity .16s ease,
    transform .24s cubic-bezier(.4, 0, 1, 1),
    visibility 0s linear .24s;
}

.profile-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  color: #d7e6e1;
  background: transparent;
  cursor: pointer;
  font: 600 12px/1.25 Inter, sans-serif;
  text-align: left;
  text-decoration: none;
}

.profile-menu-item:hover,
.profile-menu-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.profile-menu-logout {
  display: contents;
}

.profile-menu-logout-button {
  color: #ffd6d3;
}

.profile-menu-logout-button:hover {
  color: #fff;
  background: rgba(211, 82, 74, .22);
}

.profile-mini-button {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.sidebar-profile-stack .profile-mini {
  position: relative;
  order: 1;
  margin: 0;
  padding: 0;
  transition: transform .2s ease;
}

.profile-menu-chevron {
  position: relative;
  width: 25px;
  height: 25px;
  display: block;
  flex: 0 0 25px;
  border-radius: 50%;
  color: transparent;
  background: #2cc6c1;
  font-size: 0;
  transition: background .18s ease;
}

.profile-menu-chevron::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -5px 0 0 -3.5px;
  border-right: 1.6px solid #073f70;
  border-bottom: 1.6px solid #073f70;
  transform: rotate(45deg);
  transform-origin: center;
  transition: margin .2s ease, transform .2s ease, border-color .18s ease;
}

.profile-mini-button[aria-expanded="true"] .profile-menu-chevron {
  background: #2cc6c1;
}

.profile-mini-button[aria-expanded="true"] .profile-menu-chevron::after {
  margin-top: -2px;
  border-color: #073f70;
  transform: rotate(225deg);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 76px;
}

body.sidebar-collapsed .sidebar-brand {
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-brand .sidebar-brand-full {
  display: none;
}

body.sidebar-collapsed .sidebar-brand .sidebar-brand-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  display: block;
  margin: 0;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
}

body.sidebar-collapsed .main-nav {
  padding-inline: 10px;
}

body.sidebar-collapsed .main-nav .nav-item {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .main-nav .nav-item > span:not(.nav-icon),
body.sidebar-collapsed .main-nav .nav-count,
body.sidebar-collapsed .profile-mini-copy,
body.sidebar-collapsed .profile-menu-chevron,
body.sidebar-collapsed .workspace-logout {
  display: none;
}

body.sidebar-collapsed .sidebar-footer {
  padding: 0;
}

body.sidebar-collapsed .sidebar-profile-stack {
  right: 10px;
  left: 10px;
  padding-inline: 0;
}

body.sidebar-collapsed .profile-mini {
  grid-template-columns: 1fr;
  padding-inline: 0;
}

body.sidebar-collapsed .profile-mini-button {
  grid-template-columns: 34px;
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .profile-menu {
  position: fixed;
  left: 88px;
  bottom: 14px;
  width: 218px;
  margin: 0;
  background: #073f70;
}

@media (max-width: 760px) {
  .sidebar-collapse-toggle {
    display: none;
  }
}

@media (min-width: 761px) {
  .sidebar {
    z-index: 45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-menu,
  .profile-menu[hidden],
  .sidebar-profile-stack .profile-mini,
  .profile-menu-chevron,
  .profile-menu-chevron::after {
    transition: none;
  }
}
