.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--app-sidebar-width, 260px);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.52s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.95);
  color: #ffffff;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  min-height: 0;
}

.app-shell--sidebar-open .app-sidebar {
  transform: translateX(0);
}

.app-shell--sidebar-closed .app-sidebar {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar {
    transition-duration: 0.01ms;
  }
}

.sidebar-logo {
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #910404e0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sidebar-logo-text {
  margin: 0;
  padding: 0.4rem 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
}

.sidebar-close-button {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-close-button-icon {
  display: block;
  flex-shrink: 0;
}

.sidebar-close-button:hover {
  background: #e5e5e5;
  color: #f21b23;
}

.sidebar-close-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-menu::-webkit-scrollbar {
  display: none;
}

.sidebar-nav-group {
  margin-bottom: 0.35rem;
}

.sidebar-menu-link {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 1.1rem;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-menu-link--flat.is-active {
  background: #e5e5e5;
  color: #f21b23;
  border-left-color: #f21b23;
  font-weight: 600;
}

.sidebar-menu-link:hover,
.sidebar-nav-group.is-open > .sidebar-menu-link {
  background: #e5e5e5;
  color: #f21b23;
}

.sidebar-nav-group.is-active-section > .sidebar-menu-link {
  background: #e5e5e5;
  color: #f21b23;
  border-left-color: #f21b23;
  font-weight: 600;
}

.sidebar-chevron {
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.sidebar-chevron--open {
  transform: rotate(180deg);
}

.sidebar-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: #fafafa;
}

.sidebar-nav-group.is-open > .sidebar-submenu {
  max-height: 520px;
}

.sidebar-submenu-link {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: #4d4d4f;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-submenu-link:hover {
  background: #e5e5e5;
  color: #f21b23;
}

.sidebar-submenu-link.is-active,
.sidebar-nav-group .is-active > .sidebar-submenu-link {
  background: #e5e5e5;
  color: #f21b23;
  border-left-color: #f21b23;
  font-weight: 600;
}

.sidebar-nav-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.85rem 1.1rem 0.45rem;
  margin: 0;
}

.sidebar-menu-link__main {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.sidebar-nav-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  opacity: 0.92;
}

.sidebar-nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-submenu-link .sidebar-nav-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-nav-label {
  flex: 1;
  min-width: 0;
}

.sidebar-nav-footer {
  margin-top: auto;
  padding: 0.65rem 1rem;
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.95);
  flex-shrink: 0;
}

.sidebar-logout-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  min-height: 36px;
  background: #f21b23;
  color: #ffffff;
  border: none;
  border-radius: 0.35rem;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}

.sidebar-logout-button:hover {
  background: #d91820;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.sidebar-logout-button svg {
  flex-shrink: 0;
}

.sidebar-menu-link:focus-visible,
.sidebar-submenu-link:focus-visible,
.sidebar-logout-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-submenu,
  .sidebar-chevron,
  .sidebar-logout-button,
  .sidebar-close-button {
    transition: none;
  }

  .sidebar-logout-button:hover {
    transform: none;
  }
}

[data-theme="dark"] .app-sidebar {
  background: #1a1a1a;
  border-right-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-logo {
  background: #910404e0;
}

[data-theme="dark"] .sidebar-menu-link {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .sidebar-menu-link:hover,
[data-theme="dark"] .sidebar-nav-group.is-open > .sidebar-menu-link {
  background: rgba(255, 255, 255, 0.08);
  color: #f87171;
}

[data-theme="dark"] .sidebar-nav-group.is-active-section > .sidebar-menu-link,
[data-theme="dark"] .sidebar-menu-link--flat.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #f87171;
  border-left-color: #f87171;
}

[data-theme="dark"] .sidebar-submenu {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .sidebar-submenu-link {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .sidebar-submenu-link:hover,
[data-theme="dark"] .sidebar-submenu-link.is-active,
[data-theme="dark"] .sidebar-nav-group .is-active > .sidebar-submenu-link {
  background: rgba(255, 255, 255, 0.08);
  color: #f87171;
  border-left-color: #f87171;
}

[data-theme="dark"] .sidebar-close-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f87171;
}

[data-theme="dark"] .sidebar-nav-footer {
  background: #1a1a1a;
}
