/* ============================================
   App Sidebar - Global Navigation
   ============================================ */

:root {
  --sidebar-width: 250px;
}

/* Sidebar Container */
.app-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #0f1419;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}

/* Sidebar Header — must match main content header height */
.sidebar-header {
  padding: 0 16px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 57px;
  box-sizing: border-box;
}

.sidebar-logo {
  font-size: 16px;
  font-weight: 700;
  color: #1173d4;
  letter-spacing: 0.5px;
}

/* Navigation List */
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 12px 8px;
  flex: 1;
}

.sidebar-nav-item {
  margin-bottom: 4px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
  background: #1e293b;
  color: #ffffff;
}

.sidebar-nav-link.active {
  background: rgba(17, 115, 212, 0.15);
  color: #1173d4;
  border-left-color: #1173d4;
}

.sidebar-nav-link .icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-link .label {
  flex: 1;
}

/* Submenu */
.sidebar-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-nav-item.expanded .sidebar-submenu {
  max-height: 500px;
}

.sidebar-submenu-item {
  margin-bottom: 2px;
}

.sidebar-submenu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 40px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-submenu-link:hover {
  background: #1e293b;
  color: #ffffff;
}

.sidebar-submenu-link.active {
  color: #1173d4;
  background: rgba(17, 115, 212, 0.1);
}

/* Main Content */
.app-main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  width: calc(100% - var(--sidebar-width));
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scrollable content area between header and footer */
.app-main-wrapper > main {
  flex: 1;
  overflow-y: auto;
}

/* Sticky footer pinned to bottom */
.app-main-wrapper > footer {
  flex-shrink: 0;
}

/* Scrollbar */
.app-sidebar::-webkit-scrollbar {
  width: 6px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Responsive - Hide sidebar on mobile, show hamburger */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
  }

  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  .app-main-wrapper {
    margin-left: 0;
    width: 100%;
  }
}
