#app .ymg-shell .sidebar {
  --sidebar-row-inset: 12px;
  --sidebar-divider: rgba(255, 255, 255, 0.08);
  --sidebar-active: #A78BFA;
  max-width: 100vw;
}

.ymg-sidebar-switcher.ymg-switcher {
  position: relative;
  flex: none;
  min-height: 44px;
  gap: 6px;
  padding: 0 var(--sidebar-row-inset);
  background: transparent;
  border: 0;
  border-radius: 12px;
}
label.ymg-sidebar-switcher:is(:hover,:focus-within) { background: rgba(255, 255, 255, 0.05); }
label.ymg-sidebar-switcher:focus-within { outline: 2px solid var(--sidebar-active); }
.ymg-sidebar-switcher select {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ymg-sidebar-switcher > .bd-select {
  position: absolute;
  inset: 0;
  width: auto;
}
.ymg-sidebar-switcher .bd-select-trigger {
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ymg-tenant-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}
.ymg-tenant-version {
  margin-inline-start: auto;
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid rgba(196, 181, 253, 0.26);
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(167, 139, 250, 0.08));
  color: #DDD6FE;
  font-size: 12px;
  font-weight: 500;
}

#app .ymg-shell .sidebar .nav {
  flex: 0 1 auto;
  min-height: 0;
  gap: 0;
  margin: 8px 0;
}
#app .ymg-shell .sidebar .nav::before,
.sidebar-shortcuts::after {
  content: '';
  flex: none;
  height: 1px;
  margin: 0 var(--sidebar-row-inset) 8px;
  background: rgba(255, 255, 255, 0.07);
}
.sidebar-shortcuts {
  flex: none;
  display: grid;
  gap: var(--ymg-space-1);
}
.sidebar-shortcuts::after {
  margin-block: 4px 8px;
  background: var(--sidebar-divider);
}
.sidebar-menu {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--ymg-space-1);
}
#app .ymg-shell .sidebar .sidebar-divider {
  flex: none;
  height: 1px;
  margin: 4px var(--sidebar-row-inset);
  border: 0;
  background: var(--sidebar-divider);
}
#app .ymg-shell .sidebar :is(.nav button,.sidebar-group > summary) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ymg-space-2);
  padding: 0 var(--sidebar-row-inset);
  margin: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ymg-nav-text);
}
#app .ymg-shell .sidebar .nav button::before { content: none; }
#app .ymg-shell .sidebar :is(.nav button,.sidebar-group > summary):hover {
  background: var(--ymg-nav-hover);
  color: #FFFFFF;
}
#app .ymg-shell .sidebar .sidebar-shortcuts button { border-radius: 9999px; }
#app .ymg-shell .sidebar .sidebar-shortcuts button.active {
  background: var(--ymg-primary-gradient);
  color: #FFFFFF;
}

.sidebar-group {
  flex: none;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 12px;
}
.sidebar-group[open] {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
}
#app .ymg-shell .sidebar .sidebar-group > summary {
  min-height: 40px;
  padding-inline: calc(var(--sidebar-row-inset) - 1px);
  border-radius: 11px;
  font-size: 14px;
  cursor: pointer;
}
#app .ymg-shell .sidebar .sidebar-group > summary svg {
  flex: none;
  width: 16px;
  height: 16px;
}
#app .ymg-shell .sidebar .sidebar-group:is([open],:has(button.active)) > summary {
  color: #F5F3FF;
  font-weight: 600;
}
.sidebar-group:is([open],:has(button.active)) > summary svg { color: var(--sidebar-active); }
.sidebar-group.sidebar-group-admin > summary svg { color: #E5B869; }
.sidebar-group-chevron {
  position: relative;
  flex: none;
  width: 6px;
  height: 6px;
  margin-inline-start: auto;
  margin-inline-end: 2px;
}
.sidebar-group-chevron::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
}
.sidebar-group[open] .sidebar-group-chevron::before { transform: rotate(45deg); }
.sidebar-group:not([open]):has(button.active) .sidebar-group-chevron::after {
  content: '';
  position: absolute;
  top: 0;
  right: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sidebar-active);
  box-shadow: 0 0 6px rgba(167, 139, 250, 0.55);
}
.sidebar-group:not([open]):has(button.active) > summary .sidebar-group-badge { margin-inline-end: 10px; }
.sidebar-group-badge {
  margin-inline-start: auto;
  padding-inline: var(--ymg-space-2);
  border-radius: var(--ymg-radius-pill);
  background: var(--ymg-danger-solid);
  color: var(--ymg-text-on-primary);
  font-size: var(--ymg-fs-xs);
}
.sidebar-group[open] > summary .sidebar-group-badge { display: none; }

.sidebar-group-items {
  display: grid;
  min-width: 0;
  margin: 0 8px 8px 20px;
  padding-inline-start: 8px;
  border-inline-start: 1.5px solid rgba(167, 139, 250, 0.22);
  gap: 2px;
}
#app .ymg-shell .sidebar .sidebar-group-items button {
  position: relative;
  min-height: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  color: #9D92B8;
}
.sidebar-group-items button svg { display: none; }
#app .ymg-shell .sidebar .sidebar-group-items button:hover { color: #FFFFFF; }
#app .ymg-shell .sidebar .sidebar-group-items button.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(139, 92, 246, 0.05));
  color: #FFFFFF;
  font-weight: 500;
}
#app .ymg-shell .sidebar .sidebar-group-items button.active::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 -10px;
  width: 2.5px;
  border: 0;
  border-radius: 9999px;
  background: var(--sidebar-active);
}

.ymg-sidebar-balance {
  display: grid;
  flex: none;
  gap: var(--ymg-space-1);
  min-width: 0;
  margin-top: auto;
  padding: var(--ymg-space-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: #251D36;
  font-size: var(--ymg-fs-sm);
  overflow-wrap: anywhere;
}
.ymg-sidebar-balance[hidden] { display: none; }
.ymg-sidebar-balance strong {
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ymg-sidebar-balance small { font-size: var(--ymg-fs-xs); }
