/* Sidebar core */
#sidebar {
  width: 80px;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: linear-gradient(180deg, #004d61 0%, #003646 100%);
  color: #f8f9fa;
  display: flex;
  flex-direction: column;
  box-shadow: 3px 0 8px rgba(0,0,0,0.3);
  transition: width 0.3s ease, background 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
  z-index: 1000;
}

#sidebar:hover {
  width: 250px;
}

#sidebar .nav-link {
  padding: 12px 18px;
  font-weight: 500;
  color: #f1f1f1;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

#sidebar .nav-link i {
  min-width: 30px; /* Ensure icon stays fixed size/pos */
  text-align: center;
}

.nav-text, .sidebar-title-text, .btn-text {
  opacity: 0;
  transition: opacity 0.2s ease;
  margin-left: 10px;
}

#sidebar:hover .nav-text,
#sidebar:hover .sidebar-title-text,
#sidebar:hover .btn-text {
  opacity: 1;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
  /* transform: translateX(4px); Removed to avoid jumping when collapsed */
}

#sidebar .dropdown-menu {
  background-color: #013f50;
  border-radius: 6px;
  border: none;
}

#sidebar .dropdown-item {
  color: #f8f9fa;
  transition: all 0.2s ease;
}

#sidebar .dropdown-item:hover {
  background-color: rgba(255,255,255,0.2);
}

/* Light theme mode */
body.light-theme #sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #e9ecef 100%);
  color: #212529;
  box-shadow: 3px 0 10px rgba(0,0,0,0.05);
}

body.light-theme #sidebar .nav-link {
  color: #333;
}

body.light-theme #sidebar .nav-link:hover {
  background-color: rgba(0, 77, 97, 0.1);
  color: #004d61;
}

/* Page Content */
#page-content {
  margin-left: 80px; /* Matched to collapsed sidebar width */
  padding: 30px;
  transition: margin-left 0.3s ease;
}

body.dark-theme #page-content {
  background-color: #2c2c3c;
  color: #f1f1f1;
}

body.light-theme #page-content {
  background-color: #ffffff;
  color: #212529;
}

/* Theme Toggle Button */
#theme-toggle {
  margin: 15px auto;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  background: #0dcaf0;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
}

#theme-toggle:hover {
  background: #0bb2d1;
}
