/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  background-color: var(--bs-white) !important;
  border-bottom: 1px solid var(--bs-border-color) !important;
  height: 57px;
  padding: 0;
  z-index: 1030;
}

.navbar-brand,
.navbar-brand:hover {
  font-weight: 700;
  color: var(--bs-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  height: calc(100vh - 57px);
  position: sticky;
  top: 57px;
  background-color: var(--bs-white);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1020;
  display: flex;
  flex-direction: column;
}

.sidebar-expanded {
  width: 260px;
}
.sidebar-collapsed {
  width: 72px;
}

/* ── Sidebar Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    top: 57px !important;
    left: 0 !important;
    height: calc(100vh - 57px) !important;
    width: 260px !important;
    z-index: 1035 !important;
    transform: translateX(-100%) !important;
    transition:
      transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0.4s !important;
    visibility: hidden !important;
    background-color: var(--bs-white) !important;
    border-right: 1px solid var(--bs-border-color) !important;
    box-shadow: none !important;
    flex: 0 0 0 !important;
    margin: 0 !important;
  }

  .sidebar-expanded {
    transform: translateX(-100%) !important;
  }

  .sidebar-collapsed {
    transform: translateX(0) !important;
    visibility: visible !important;
    box-shadow: var(--bs-box-shadow-lg) !important;
  }

  .sidebar-text,
  .sidebar-collapsed .sidebar-text,
  .sidebar-expanded .sidebar-text {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    display: inline-block !important;
    pointer-events: auto !important;
    transition: none !important;
  }

  .sidebar-heading span {
    display: block !important;
  }

  .sidebar-heading::before {
    display: none !important;
  }

  .sidebar-heading,
  .sidebar-link,
  .sidebar-collapsed .sidebar-heading,
  .sidebar-collapsed .sidebar-link,
  .sidebar-expanded .sidebar-heading,
  .sidebar-expanded .sidebar-link {
    width: 260px !important;
    padding: 0 24px !important;
    transition: none !important;
  }

  .sidebar-link::after,
  .sidebar-collapsed .sidebar-link::after,
  .sidebar-expanded .sidebar-link::after {
    left: 10px !important;
    width: 240px !important;
    transition: none !important;
  }

  .sidebar-profile-avatar,
  .sidebar-collapsed .sidebar-profile-avatar,
  .sidebar-expanded .sidebar-profile-avatar {
    margin: 0 !important;
  }
}

.sidebar-inner {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  padding: 0.5rem 0 0.75rem;
  flex-grow: 1;
}

.sidebar-footer {
  flex-shrink: 0;
}

.sidebar-profile-avatar {
  width: 40px;
  height: 40px;
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border: 2px solid var(--bs-primary-bg-subtle);
}

.profile-dropdown:hover .sidebar-profile-avatar {
  background-color: var(--bs-primary);
  color: white;
  border-color: var(--bs-primary);
  transform: scale(1.05);
}

.sidebar-collapsed .sidebar-profile-avatar {
  margin: 0 auto;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 24px;
  white-space: nowrap;
  opacity: 0.7;
  height: 48px;
  display: flex;
  align-items: center;
  transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 260px;
  overflow: hidden;
}

.sidebar-collapsed .sidebar-heading {
  padding: 0 26px;
}

.sidebar-collapsed .sidebar-heading span {
  display: none;
}

.sidebar-collapsed .sidebar-heading::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--bs-secondary-color);
  border-radius: 99px;
  opacity: 0.2;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0 24px;
  color: var(--bs-secondary-color);
  text-decoration: none;
  transition:
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s ease;
  margin-bottom: 2px;
  font-size: 0.875rem;
  width: 260px;
  height: 44px;
  position: relative;
  overflow: hidden;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--bs-primary);
}

.sidebar-link.active {
  font-weight: 500;
}

.sidebar-link::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 240px;
  border-radius: var(--bs-border-radius);
  z-index: -1;
  transition:
    left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s ease;
}

.sidebar-link:hover::after {
  background-color: var(--bs-light);
}
.sidebar-link.active::after {
  background-color: var(--bs-primary-bg-subtle);
}

.sidebar-collapsed .sidebar-link {
  padding: 0 26px;
}

.sidebar-collapsed .sidebar-link::after {
  left: 14px;
  width: 44px;
}

.sidebar-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-text {
  white-space: nowrap;
  opacity: 1;
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.3s;
  display: inline-block;
  margin-left: 1rem;
}

.sidebar-collapsed .sidebar-text {
  visibility: hidden;
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
}

/* ── Profile Dropdown ────────────────────────────────────────────── */
.profile-menu {
  min-width: 15rem;
  border-radius: var(--bs-border-radius-lg);
}

.dropdown-avatar {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bs-light);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-primary);
  flex-shrink: 0;
  font-size: 1.1rem;
}

.profile-menu .dropdown-item {
  font-size: 0.875rem;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.profile-menu .dropdown-item:hover,
.profile-menu .dropdown-item:focus {
  background-color: var(--bs-light);
  color: var(--bs-body-color);
}

.profile-menu .dropdown-item.text-danger:hover,
.profile-menu .dropdown-item.text-danger:focus {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger) !important;
}
