:root {
  --sidebar-width: 260px;
  --header-height: 60px;
  --primary-color: #0f172a; /* Slate 900 */
  --sidebar-bg: #ffffff;
  --sidebar-text: #334155; /* Slate 700 */
  --sidebar-active-bg: #f1f5f9; /* Slate 100 */
  --sidebar-active-text: #0f172a;
}

body {
  overflow-x: hidden;
  background-color: #f8fafc; /* Very light slate background for content */
}

#wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
}

#sidebar-wrapper {
  min-height: 100vh;
  width: var(--sidebar-width);
  margin-left: 0;
  transition: margin 0.25s ease-out;
  background-color: var(--sidebar-bg);
  border-right: 1px solid #e2e8f0;
  position: fixed;
  z-index: 1000;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}

#sidebar-wrapper .sidebar-heading {
  padding: 0 1.5rem;
  min-height: var(--header-height);
  height: var(--header-height);
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

#sidebar-wrapper .sidebar-heading #sidebarClose {
  margin-left: auto;
  color: var(--sidebar-text);
  transition: color 0.2s;
}

#sidebar-wrapper .sidebar-heading #sidebarClose:hover {
  color: var(--primary-color);
}

#sidebar-wrapper .list-group {
  width: var(--sidebar-width);
  padding: 1rem 0;
  overflow-y: auto;
  flex: 1;
}

#sidebar-wrapper .list-group-item {
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  color: var(--sidebar-text);
  background-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s;
}

#sidebar-wrapper .list-group-item:hover {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

#sidebar-wrapper .list-group-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--primary-color);
  font-weight: 600;
  border-right: 3px solid var(--primary-color);
}

#sidebar-wrapper .group-label {
  padding: 1.5rem 1.5rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8; /* Slate 400 */
  font-weight: 600;
}

#page-content-wrapper {
  min-width: 100vw;
  margin-left: var(--sidebar-width);
  transition: margin 0.25s ease-out;
  width: 100%;
}

.top-navbar {
  height: var(--header-height);
  background-color: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
}

.user-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--sidebar-text);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #64748b;
}

/* Toggle State */
body.sb-sidenav-toggled #sidebar-wrapper {
  margin-left: calc(-1 * var(--sidebar-width));
}

body.sb-sidenav-toggled #page-content-wrapper {
  margin-left: 0;
}

@media (min-width: 768px) {
  #page-content-wrapper {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  
  #page-content-wrapper {
    min-width: 0;
    width: 100%;
    margin-left: 0;
  }
  
  body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: 0;
  }
}
