/* Layout Styles */
.app-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  transition: width 0.3s ease;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
}

.main-content {
  flex-grow: 1;
  padding: var(--content-padding);
  overflow-y: auto;
  background-color: var(--main-bg);
  display: flex;
  flex-direction: column;
}

/* Sidebar Components */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.75rem 1.5rem 1.75rem;
  margin-bottom: 1rem;
}

.sidebar-logo {
  height: 32px;
  width: 32px;
  flex-shrink: 0;
}
.sidebar-brand-name {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.sidebar-profile {
  text-align: left;
  margin-bottom: 2rem;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-user-details {
    overflow: hidden;
}

.sidebar-user-name {
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
  margin-bottom: 0.1rem;
}

.sidebar-user-email {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 0 1rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 0.75rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 50px; /* Pill shape */
  transition: background-color 0.2s, color 0.2s;
  font-weight: 500;
  white-space: nowrap;
  font-size: 0.95rem;
}

.sidebar-nav a:hover {
  background-color: var(--sidebar-link-hover-bg);
}

.sidebar-nav a.active {
  background-color: var(--sidebar-link-active-bg);
  color: var(--sidebar-link-active-text);
  font-weight: 700;
}
.sidebar-nav a.active i {
    color: var(--sidebar-link-active-text);
}

.sidebar-nav a i {
  width: 24px;
  text-align: center;
  font-size: 1.25rem;
  color: var(--sidebar-icon-color);
}

.sidebar-footer {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-toggle {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--sidebar-icon-color);
  cursor: pointer;
  border-radius: 50px;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background-color: var(--sidebar-link-hover-bg);
  border-color: var(--primary-color);
}

.btn-logout {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--sidebar-icon-color);
  cursor: pointer;
  border-radius: 50px;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
  background-color: var(--sidebar-link-hover-bg);
  border-color: var(--danger-color);
  color: var(--danger-color);
}


/* Responsive Layout Styles */
@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-width-collapsed);
    padding: 1.5rem 0;
    align-items: center;
  }
  
  .sidebar-brand-name,
  .sidebar-user-details,
  .sidebar-nav a span {
    display: none;
  }

  .sidebar-header {
    order: 1;
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0;
    padding-bottom: 1rem;
  }

  .sidebar-nav {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    width: 100%;
    flex-grow: 1;
  }
  
  .sidebar-profile {
    order: 3;
    padding: 1rem 0 0.5rem 0;
    margin-bottom: 0;
    width: 100%;
    justify-content: center;
  }

  .sidebar-footer {
    order: 4;
    padding: 0 0 1rem 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }

  .sidebar-nav a {
    justify-content: center;
    gap: 0;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
  }

  .sidebar-nav a i {
    font-size: 1.4rem;
  }
  
  .theme-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
  }

  .theme-toggle i {
    font-size: 1.4rem;
    color: var(--sidebar-icon-color);
  }

  .btn-logout {
    justify-content: center;
    gap: 0;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    border: none;
  }
  
  .btn-logout i {
    font-size: 1.4rem;
  }

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

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