.hig-sidebar {
  background: var(--hig-color-surface) !important;
  border-right: 1px solid var(--hig-color-divider) !important;
  box-shadow: var(--hig-shadow-quiet);
  color: var(--hig-color-text);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hig-sidebar__header {
  padding: var(--hig-spacing-4) var(--hig-spacing-5);
  border-bottom: 1px solid var(--hig-color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hig-spacing-3);
}

.hig-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--hig-spacing-3);
  text-decoration: none;
}

.hig-sidebar__brand-text {
  color: var(--hig-color-text);
  font-weight: 600;
  font-size: 1.05rem;
}

.hig-sidebar__toggle {
  color: var(--hig-color-text-muted);
  border-radius: var(--hig-radius-medium);
  transition: background 0.2s ease, color 0.2s ease;
}

.hig-sidebar__toggle:hover,
.hig-sidebar__toggle:focus-visible {
  background: rgba(0, 113, 227, 0.08);
  color: var(--hig-color-primary);
  outline: none;
}

.hig-sidebar__content {
  padding: var(--hig-spacing-5) var(--hig-spacing-4);
  display: flex;
  flex-direction: column;
  gap: var(--hig-spacing-5);
}

.hig-nav {
  display: flex;
  flex-direction: column;
  gap: var(--hig-spacing-3);
}

.hig-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--hig-spacing-2);
}

.hig-nav__item,
.hig-nav__subitem {
  list-style: none;
}

.hig-nav__link,
.hig-nav__sublink {
  display: flex;
  align-items: center;
  gap: var(--hig-spacing-3);
  padding: var(--hig-spacing-3) var(--hig-spacing-4);
  border-radius: var(--hig-radius-medium);
  color: var(--hig-color-text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.hig-nav__link i:first-child,
.hig-nav__sublink i:first-child {
  font-size: 1rem;
  color: var(--hig-color-text-muted);
}

.hig-nav__sublink {
  font-size: 0.95rem;
  padding: var(--hig-spacing-2) var(--hig-spacing-4);
}

button.hig-nav__link {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

button.hig-nav__sublink {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
}

.hig-nav__link:hover,
.hig-nav__sublink:hover,
.hig-nav__link:focus-visible,
.hig-nav__sublink:focus-visible {
  background: rgba(0, 113, 227, 0.08);
  color: var(--hig-color-primary);
  outline: none;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-beta-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.15);
  color: var(--hig-color-warning);
  line-height: 1.2;
}

body.dark-theme .nav-beta-badge {
  background: rgba(255, 184, 77, 0.25);
  color: #ffd8a3;
}

.hig-nav__link.active,
.hig-nav__sublink.active {
  background: rgba(0, 113, 227, 0.12);
  color: var(--hig-color-primary);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.2);
}

.hig-nav__link .submenu-arrow {
  margin-left: auto;
  color: var(--hig-color-text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.submenu-toggle[aria-expanded="true"] .submenu-arrow {
  transform: rotate(180deg);
}

.submenu-toggle:hover .submenu-arrow,
.submenu-toggle:focus-visible .submenu-arrow,
.submenu-toggle.active .submenu-arrow {
  color: var(--hig-color-primary);
}

.hig-nav__submenu {
  margin: var(--hig-spacing-2) 0;
  padding-left: var(--hig-spacing-4);
  border-left: 1px solid var(--hig-color-divider);
  display: grid;
  gap: var(--hig-spacing-2);
}

.hig-nav__sublink.text-danger,
.hig-navbar__dropdown-item.text-danger {
  color: var(--hig-color-danger) !important;
}

.hig-nav__sublink.text-danger:hover,
.hig-nav__sublink.text-danger:focus-visible {
  background: rgba(255, 59, 48, 0.12);
  color: var(--hig-color-danger) !important;
}

.notification-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hig-spacing-1);
  padding-inline: var(--hig-spacing-3);
}

.notification-button .bi {
  font-size: 1.1rem;
}

.notification-button-sm {
  padding-inline: var(--hig-spacing-2);
}

.notification-button.notification-button-sm .bi,
.btn-sm.notification-button .bi {
  font-size: 1rem;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--hig-color-danger);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1.25rem;
  padding: 0 var(--hig-spacing-1);
  box-shadow: 0 6px 16px rgba(255, 59, 48, 0.25);
}

.notification-button-sm .notification-badge {
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  font-size: 0.65rem;
  line-height: 1.1rem;
}

.notification-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--hig-color-surface);
}

.notification-badge[data-empty="true"],
.notification-badge:empty {
  display: none;
}

.hig-sidebar__content .sidebar-guest {
  background: var(--hig-color-surface-alt);
  border-radius: var(--hig-radius-large);
  padding: var(--hig-spacing-5);
  box-shadow: inset 0 0 0 1px var(--hig-color-divider);
}

.hig-navbar {
  background: var(--hig-color-surface) !important;
  border: 1px solid var(--hig-color-divider) !important;
  box-shadow: var(--hig-shadow-quiet);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-radius: var(--hig-radius-large);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hig-navbar .container-fluid {
  padding: var(--hig-spacing-3) var(--hig-spacing-5);
}

.hig-navbar__brand {
  gap: var(--hig-spacing-3);
  font-weight: 700;
  color: var(--hig-color-text);
}

.hig-navbar__brand span {
  color: var(--hig-color-text);
}

.hig-navbar__list {
  gap: var(--hig-spacing-1);
}

.hig-navbar__link {
  display: flex;
  align-items: center;
  gap: var(--hig-spacing-2);
  padding: var(--hig-spacing-2) var(--hig-spacing-4);
  border-radius: var(--hig-radius-medium);
  color: var(--hig-color-text-secondary);
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.hig-navbar__link:hover,
.hig-navbar__link:focus-visible {
  background: rgba(0, 113, 227, 0.08);
  color: var(--hig-color-primary);
  outline: none;
}

.hig-navbar__link.active {
  background: rgba(0, 113, 227, 0.12);
  color: var(--hig-color-primary);
}

.hig-navbar__dropdown {
  background: var(--hig-color-surface) !important;
  border: 1px solid var(--hig-color-divider) !important;
  border-radius: var(--hig-radius-medium);
  box-shadow: var(--hig-shadow-quiet);
  padding: var(--hig-spacing-2) 0;
}

.hig-navbar__dropdown-item {
  font-weight: 500;
  color: var(--hig-color-text-secondary) !important;
  padding: var(--hig-spacing-2) var(--hig-spacing-4);
  display: flex;
  align-items: center;
  gap: var(--hig-spacing-2);
  transition: background 0.2s ease, color 0.2s ease;
}

button.hig-navbar__dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
}

.hig-navbar__dropdown-item:hover,
.hig-navbar__dropdown-item:focus-visible {
  background: rgba(0, 113, 227, 0.08);
  color: var(--hig-color-primary);
  outline: none;
}

.hig-navbar__dropdown-item.active {
  background: rgba(0, 113, 227, 0.12);
  color: var(--hig-color-primary);
}

.hig-navbar__actions {
  gap: var(--hig-spacing-3);
}

.hig-navbar .navbar-toggler {
  border: none;
  color: var(--hig-color-text);
  border-radius: var(--hig-radius-medium);
  padding: var(--hig-spacing-2);
  transition: background 0.2s ease, color 0.2s ease;
}

.hig-navbar .navbar-toggler:hover,
.hig-navbar .navbar-toggler:focus-visible {
  background: rgba(0, 113, 227, 0.08);
  color: var(--hig-color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--hig-color-focus);
}

@media (max-width: 991.98px) {
  .hig-sidebar__content {
    padding: var(--hig-spacing-4) var(--hig-spacing-3);
    gap: var(--hig-spacing-4);
  }

  .hig-navbar__list {
    gap: var(--hig-spacing-2);
    padding-top: var(--hig-spacing-3);
  }

  .hig-navbar__link {
    padding: var(--hig-spacing-3) var(--hig-spacing-4);
  }
}

body:not(.dark-theme) .hig-sidebar,
body.light-theme .hig-sidebar {
  background: var(--hig-color-surface) !important;
  color: var(--hig-color-text);
}

body:not(.dark-theme) .hig-navbar,
body:not(.dark-theme) .hig-navbar__dropdown,
body.light-theme .hig-navbar,
body.light-theme .hig-navbar__dropdown {
  background: var(--hig-color-surface) !important;
  border-color: var(--hig-color-divider) !important;
  color: var(--hig-color-text);
}

body.dark-theme .hig-sidebar,
body.dark-theme .hig-navbar,
body.dark-theme .hig-navbar__dropdown {
  background: var(--hig-color-surface) !important;
  border-color: var(--hig-color-border) !important;
  box-shadow: var(--hig-shadow-quiet);
  color: var(--hig-color-text);
}

body.dark-theme .hig-nav__link,
body.dark-theme .hig-nav__sublink,
body.dark-theme .hig-navbar__link,
body.dark-theme .hig-navbar__dropdown-item {
  color: var(--hig-color-text-secondary) !important;
}
