.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  color: #e7f4ea;
  font-family: var(--font-ui);
  background: var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: padding 180ms ease;
}

.sidebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: clamp(22px, 5vh, 38px);
  background: linear-gradient(rgba(6, 47, 40, 0), rgba(6, 47, 40, 0.78) 72%, var(--nav));
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.app-shell.has-sidebar-overflow:not(.is-sidebar-scroll-end) .sidebar::after {
  opacity: 1;
}

.sidebar-scrim {
  display: none;
}

.brand {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  padding: 3px 4px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: grid-template-columns 180ms ease, gap 180ms ease;
}

.sidebar-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 16px;
  margin: 16px -6px 0;
  padding: 0 6px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.brand__text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand__text strong {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.brand__text span {
  color: rgba(231, 244, 234, 0.68);
  font-size: 12px;
}

.sidebar-collapse {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(231, 244, 234, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(231, 244, 234, 0.78);
}

.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fffdf8;
}

.sidebar-collapse .icon {
  width: 16px;
  height: 16px;
  transform: none;
  transition: transform 180ms ease;
}

.sidebar-nav-block,
.sidebar-nav {
  display: grid;
}

.sidebar-nav-block {
  gap: 8px;
}

.sidebar-nav {
  gap: 6px;
}

.sidebar-nav__item,
.sidebar-quick__button {
  position: relative;
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: transparent;
  color: rgba(231, 244, 234, 0.82);
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, grid-template-columns 180ms ease;
}

.sidebar-nav__item:hover,
.sidebar-quick__button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav__item.is-active {
  border-color: rgba(155, 214, 199, 0.24);
  background: var(--nav-2);
  color: #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.14);
}

.sidebar-nav__item.is-active .icon {
  color: #9bd6c7;
}

.sidebar-nav__item.is-locked {
  color: rgba(231, 244, 234, 0.48);
}

.sidebar-nav__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav__badge {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d42035;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-shortcuts {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-section__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 4px;
  color: rgba(231, 244, 234, 0.6);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-shortcuts__head {
  justify-content: space-between;
}

.sidebar-shortcuts__configure {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(231, 244, 234, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(231, 244, 234, 0.76);
}

.sidebar-shortcuts__configure:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fffdf8;
}

.sidebar-shortcuts__configure .icon {
  width: 15px;
  height: 15px;
}

.sidebar-shortcuts__list {
  display: grid;
  gap: 6px;
}

.sidebar-user {
  flex: 0 0 auto;
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding: 12px 8px 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--nav);
}

.sidebar-user__main {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  padding: 6px;
  text-align: left;
}

.sidebar-user__main:hover {
  border-color: rgba(155, 214, 199, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user__body > strong,
.sidebar-user__body > span:not(.sidebar-user__meta) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__body > strong {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.12;
}

.sidebar-user__body > span:not(.sidebar-user__meta) {
  color: rgba(231, 244, 234, 0.68);
  font-size: 12px;
  line-height: 1.2;
}

.sidebar-user__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  color: rgba(231, 244, 234, 0.72);
  font-size: 11px;
  line-height: 1.25;
}

.sidebar-user__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__meta span + span::before {
  content: "·";
  margin-right: 5px;
  color: rgba(231, 244, 234, 0.42);
}

.sidebar-user__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}

.sidebar-user__actions .ghost-button {
  width: 100%;
  min-height: 30px;
  border-radius: 8px;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 650;
}

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

.app-shell--sidebar-collapsed .sidebar {
  padding: 12px 8px;
}

.app-shell--sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
}

.app-shell--sidebar-collapsed .brand__text,
.app-shell--sidebar-collapsed .sidebar-nav-block > .sidebar-section__head,
.app-shell--sidebar-collapsed .sidebar-nav__label,
.app-shell--sidebar-collapsed .sidebar-shortcuts__head span,
.app-shell--sidebar-collapsed .sidebar-quick__button span,
.app-shell--sidebar-collapsed .sidebar-user__body,
.app-shell--sidebar-collapsed .sidebar-user__actions {
  display: none;
}

.app-shell--sidebar-collapsed .sidebar-shortcuts__head {
  justify-content: center;
  padding: 0;
}

.app-shell--sidebar-collapsed .sidebar-collapse .icon {
  transform: scaleX(-1);
}

.app-shell--sidebar-collapsed .sidebar-nav__item,
.app-shell--sidebar-collapsed .sidebar-quick__button {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell--sidebar-collapsed .sidebar-nav__item.is-active {
  border-color: rgba(155, 214, 199, 0.22);
  box-shadow: inset 0 0 0 1px rgba(155, 214, 199, 0.08);
}

.app-shell--sidebar-collapsed .sidebar-nav__badge {
  position: absolute;
  top: 3px;
  right: 3px;
}

.app-shell--sidebar-collapsed .sidebar-user {
  display: flex;
  justify-content: center;
}

.app-shell--sidebar-collapsed .sidebar-user__main {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}
