/* Layout Shell */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 100;
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent sidebar itself from scrolling */
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background-color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}
.sidebar-menu::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.sidebar-menu-title {
  padding: 0 var(--space-5);
  margin-bottom: var(--space-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: var(--sidebar-text);
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.sidebar-item:hover, .sidebar-item.active {
  background-color: var(--sidebar-hover);
  color: #fff;
}

.sidebar-item.active {
  border-left-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-item i {
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-info strong {
  display: block;
  font-size: 0.875rem;
  color: #fff;
}

.user-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.topbar {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.search-bar {
  position: relative;
  width: 300px;
}

.search-bar i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-bar input {
  padding-left: 36px;
  border-radius: var(--radius-full);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.icon-btn {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition-fast);
  position: relative;
}

.icon-btn:hover {
  background-color: var(--bg-body);
  color: var(--primary);
}

.notification-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--error);
  border-radius: 50%;
}

/* Page Content */
.page-content {
  padding: var(--space-6);
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-6);
}

.page-title {
  margin: 0;
  font-size: 1.75rem;
}

.page-description {
  margin: var(--space-2) 0 0 0;
  font-size: 1rem;
}
