.layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg, #1e293b);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
}

.sidebarCollapsed {
  width: 60px;
}

/* ===== Brand / Logo ===== */
.brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 68px;
}

.sidebarCollapsed .brand {
  padding: 1.25rem 0;
  justify-content: center;
  min-height: 56px;
}

.brand h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #60a5fa;
  white-space: nowrap;
}

.collapseBtn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapseBtn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* ===== Navigation ===== */
.nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.navSection {
  padding: 1rem 1.5rem 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.navSectionToggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.navSectionToggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

.chevron {
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.chevronOpen {
  transform: rotate(0deg);
}

.navDivider {
  margin: 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.navLink {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.sidebarCollapsed .navLink {
  padding: 0.625rem 0;
  justify-content: center;
  border-left: none;
}

.navLink:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.active {
  color: white;
  background: rgba(96, 165, 250, 0.15);
  border-left-color: #60a5fa;
}

.sidebarCollapsed .active {
  border-left-color: transparent;
}

/* ===== Admin-Bereich ueber dem Profil ===== */
.adminSection {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebarCollapsed .adminSection {
  padding: 0.5rem 0.25rem;
}

.adminLink {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
}

.sidebarCollapsed .adminLink {
  padding: 0.625rem 0;
  justify-content: center;
}

.adminLink:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.adminLinkActive {
  color: white;
  background: rgba(96, 165, 250, 0.15);
}

/* ===== Theme Toggle ===== */
.themeToggle {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebarCollapsed .themeToggle {
  padding: 0.5rem 0;
  display: flex;
  justify-content: center;
}

.themeBtn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.themeBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.themeBtnGroup {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.themeOption {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.3rem 0.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.themeOption:hover {
  color: rgba(255, 255, 255, 0.8);
}

.themeOptionActive {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.themeIcon {
  font-size: 0.75rem;
  line-height: 1;
}

/* ===== User Info ===== */
.userInfo {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebarCollapsed .userInfo {
  padding: 0.75rem 0;
  display: flex;
  justify-content: center;
}

.userProfile {
  cursor: pointer;
  padding: 0.375rem;
  margin: -0.375rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.userProfile:hover {
  background: rgba(255, 255, 255, 0.1);
}

.userProfileInner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.userDetails {
  min-width: 0;
}

.userName {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userEmail {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profileHint {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.375rem;
  transition: color 0.15s;
}

.userProfile:hover .profileHint {
  color: rgba(255, 255, 255, 0.7);
}

.logoutBtn {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  transition: all 0.15s;
}

.logoutBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  transition: margin-left 0.2s ease;
}
