.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px var(--shadow);
  z-index: 100;
  transition: background-color 0.3s ease;
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.sidebar-logo p {
  font-size: 0.75rem;
  color: #9aa5b1;
  margin-top: 0.25rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-nav a .icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-nav a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #ffffff;
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), transparent);
  color: var(--sidebar-active);
  border-left: 3px solid #3b82f6;
  font-weight: 600;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  background: var(--bg-secondary);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px var(--shadow);
  z-index: 50;
  transition: background-color 0.3s ease;
}

.topbar-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.topbar-title p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle:hover {
  background: var(--bg-primary);
  transform: translateY(-1px);
}

.user-info {
  text-align: right;
}

.user-info .name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info .role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-logout {
  padding: 0.5rem 1rem;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

@media (max-width: 1024px) {
  .main-content {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    transition: left 0.3s ease;
  }

  .topbar {
    padding: 1rem;
  }

  .topbar-title h1 {
    font-size: 1.25rem;
  }

  .topbar-user {
    gap: 0.75rem;
  }

  .user-info {
    display: none;
  }

  .main-content {
    padding: 1rem;
  }
}
