:root {
  --sb-bg: #0f172a;
  --sb-bg-2: #111c33;
  --sb-border: rgba(148, 163, 184, 0.22);
  --sb-text: #e5e7eb;
  --sb-muted: #94a3b8;
  --sb-hover: rgba(14, 165, 233, 0.2);
  --sb-active: linear-gradient(135deg, #0ea5e9, #0284c7);
  --sb-shadow: 0 14px 34px rgba(2, 6, 23, 0.35);
}

.app-sidebar {
  background: linear-gradient(180deg, var(--sb-bg), var(--sb-bg-2));
  color: var(--sb-text);
  min-height: 100vh;
  border-right: 1px solid var(--sb-border);
  box-shadow: var(--sb-shadow);
}

.app-sidebar .brand-wrap {
  padding: 1rem 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-sidebar .brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-sidebar .brand-sub {
  color: var(--sb-muted);
  font-size: 0.8rem;
}

.sidebar-nav {
  padding: 0.75rem 0.45rem;
}

.sidebar-nav .nav-item {
  margin-bottom: 0.28rem;
}

.sidebar-nav .nav-link {
  color: var(--sb-text);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.7rem;
  padding: 0.62rem 0.68rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 180ms ease;
  position: relative;
  cursor: pointer;
  background: transparent;
}

.sidebar-nav .nav-link i {
  color: #cbd5e1;
  width: 18px;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  background: var(--sb-hover);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
  background: var(--sb-active);
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.sidebar-nav .nav-link.active i {
  color: #fff;
}

.sidebar-nav .submenu {
  margin: 0.3rem 0 0.45rem 1.65rem;
  border-left: 1px dashed rgba(148, 163, 184, 0.34);
  padding-left: 0.7rem;
}

.sidebar-nav .submenu a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.34rem 0.45rem;
  border-radius: 0.45rem;
  transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-nav .submenu a:hover,
.sidebar-nav .submenu a.active {
  color: #ffffff;
  background: rgba(14, 165, 233, 0.18);
}

.sidebar-nav .nav-link:focus-visible,
.sidebar-nav .submenu a:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.6);
  outline-offset: 2px;
}

#offcanvasSidebar {
  background: linear-gradient(180deg, var(--sb-bg), var(--sb-bg-2));
  color: var(--sb-text);
}

#offcanvasSidebar .offcanvas-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

#offcanvasSidebar .btn-close {
  filter: invert(1) grayscale(100%);
}

.mobile-topbar {
  background: #0b1224;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.mobile-topbar .btn,
.mobile-topbar .dropdown-toggle {
  color: #e2e8f0 !important;
}

@media (min-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030;
  }

  .app-main-pane {
    margin-left: 280px;
    max-width: calc(100% - 280px);
  }
}

@media (max-width: 991.98px) {
  .app-shell-content {
    padding: 0 !important;
  }

  .mobile-topbar {
    padding: 0.5rem 0.7rem;
  }

  #offcanvasSidebar {
    width: min(84vw, 320px);
  }

  #offcanvasSidebar .offcanvas-body {
    padding: 0.5rem 0.5rem 1rem;
  }
}
