.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg-page);
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border-card);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-border-card);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logoText {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.collapseBtn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.collapseBtn:hover {
  background: var(--color-sidebar-hover);
}

.nav {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.navItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.navItem:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-text-primary);
}

.navItemActive {
  background: var(--color-sidebar-active);
  color: var(--color-text-primary);
}

.navDivider {
  height: 1px;
  background: var(--color-border-card);
  margin: 4px 12px;
}

.sidebarFooter {
  padding: 12px;
  border-top: 1px solid var(--color-border-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.userInfo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
}

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

.userMeta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.userName {
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logoutLink {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.logoutLink:hover {
  color: var(--color-danger);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  transition: margin-left 0.2s ease;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }
}
