.sidebar {
  --menu-accent: #645ED6;

  background: #fff;
  border-right: 1px solid #f2f2f2;
  box-sizing: border-box;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 80px;
  transition: width 0.3s ease;
  position: fixed;
  z-index: 110;
}

.sidebar.expanded .sidebar-top,
.sidebar.expanded .menu,
.sidebar.expanded .user {
  padding: 24px 20px;
}

.sidebar.expanded {
  width: 236px;
}

.sidebar:not(.expanded) .menu {
  align-items: center;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  min-width: 0;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: #232149;
}

.logo-1 {
  display: block;
  width: 31px;
  height: auto;
  flex: 0 0 31px;
  object-fit: contain;
}

.logo-2 {
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  color: #232149;
  white-space: nowrap;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #4F5359;
  padding: 0;
  transition: transform 0.3s ease;
}

.sidebar-collapse-btn:focus,
.sidebar-collapse-btn:focus-visible,
.sidebar-collapse-btn:active {
  outline: none;
  box-shadow: none;
}

.menu {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  list-style: none;
  overflow: auto;
}

.menu-item {
  display: flex;
  flex-direction: column;
  position: relative;
}

.menu-top {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.menu-top svg {
  color: #4F5359;
  transition: color 0.3s ease;
}

.menu-text {
  white-space: nowrap;
  overflow: hidden;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 5%;
  color: #4F5359;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.menu-arrow {
  display: flex;
  align-items: center;
  transition: transform 0.5s ease;
}

.menu-submenu {
  display: none;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 20px 0 0 9px;
  padding-left: 22px;
  position: relative;
}

.menu-submenu li {
  list-style: none;
  line-height: 17px;
  margin: 0;
}

.menu-submenu a {
  font-size: 14px;
  line-height: 17px;
  text-decoration: none;
  color: #4F5359;
  transition: color 0.5s ease;
}

.menu-submenu li.active,
.menu-submenu li.active a {
  color: var(--menu-accent);
}

.menu-submenu:has(li.active) .menu-line {
  border-left: 1px solid var(--menu-accent);
  border-bottom: 1px solid var(--menu-accent);
  border-bottom-left-radius: 2px;
}

.menu-line {
  position: absolute;
  left: -1px;
  width: 16px;
  height: 100%;
  border-left: 1px solid rgba(79, 83, 89, 0.25);
  background: transparent;
  transition: top 0.5s ease, height 0.5s ease;
  z-index: 0;
}

.menu-item.active svg,
.menu-item.active .menu-text,
.menu-item.active .menu-arrow svg {
  color: var(--menu-accent);
}

.menu-item.active .menu-arrow {
  transform: rotate(180deg);
}

.menu-item.active .menu-submenu {
  display: flex;
}

.user {
  margin-top: auto;
  padding: 24px 16px;
  position: relative;
  display: inline-block;
}

.user-card {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #fff;
  overflow: visible;
  transition: box-shadow 0.25s ease;
}

.user-card:has(.user-menu.show) {
  box-shadow: 0 10px 30px rgba(35, 33, 73, 0.1);
}

.user-btn {
  padding: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-btn:hover {
  background: #FAFAFC;
}

.user-btn:hover,
.user-btn:focus,
.user-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.user-avatar {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #F1F0FF;
  color: var(--menu-accent);
}

.user-avatar svg {
  width: 18px;
  height: 18px;
}

.user-text {
  font-size: 14px;
  line-height: 17px;
  color: #333;
}

.user-summary {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.user-cabinet-name,
.user-seller-name {
  max-width: 125px;
  overflow: hidden;
  font-size: 11px;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cabinet-name {
  color: #5F6370;
}

.user-seller-name {
  color: #9A9DA7;
  white-space: normal;
  overflow-wrap: anywhere;
}

.user-arrow {
  margin-left: auto;
  color: var(--menu-accent);
  transform: rotate(-90deg);
  transition: transform 0.25s ease;
}

.user-card:has(.user-menu.show) .user-arrow {
  transform: rotate(0deg);
}

.sidebar:not(.expanded) .user-btn {
  padding: 9px;
}

.sidebar:not(.expanded) .logo-2,
.sidebar:not(.expanded) .menu-text,
.sidebar:not(.expanded) .menu-arrow,
.sidebar:not(.expanded) .menu-submenu,
.sidebar:not(.expanded) .user-arrow,
.sidebar:not(.expanded) .user-avatar {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.sidebar:not(.expanded) .user-cabinet-name,
.sidebar:not(.expanded) .user-seller-name {
  display: none;
}

.sidebar:not(.expanded) .user-summary {
  flex: 0 0 auto;
}

.sidebar:not(.expanded) .sidebar-collapse-btn {
  transform: rotate(-180deg);
}

.sidebar:not(.expanded) .user-text {
  background-color: #F1F1F3;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--menu-accent);
}

.user-menu {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 0 12px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(-4px);
}

.user-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu.hide {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.user-menu .button {
  justify-content: center;
  width: 100%;
}

.cabinet-context {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid #EEF0F5;
}

.cabinet-context label {
  color: #858894;
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cabinet-switch-form,
.cabinet-switch-form .select-container,
.cabinet-switch-form .ts-wrapper {
  width: 100%;
  min-width: 0;
}

.cabinet-switch-form .ts-wrapper .ts-control {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 48px;
  padding: 8px 30px 8px 10px;
  border-color: #D8DCE9;
  border-radius: 8px;
  background: #F8F8FB;
  align-items: flex-start;
}

.cabinet-switch-form .ts-control .item {
  max-width: 120px;
  color: #333;
  font-size: 12px;
  line-height: 15px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.cabinet-switch-form .ts-dropdown {
  width: 100%;
  min-width: 100%;
  top: auto !important;
  bottom: calc(100% + 4px);
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(35, 33, 73, 0.16);
}

.cabinet-switch-form .ts-dropdown-content {
  max-height: 190px;
}

.cabinet-switch-form .ts-dropdown .option {
  padding: 8px 10px;
  line-height: 16px;
  white-space: normal;
}

.user-menu .user-logout {
  justify-content: center;
  gap: 8px;
}

.user-menu .user-logout svg {
  width: 17px;
  height: 17px;
}

