:root {
  --accent: #007bff;
  --accent-dark: #0056b3;
  --text-primary: #212529;
  --text-muted: #6c757d;
  --bg: #f8f9fa;
  --border: #e2e6ea;
  --radius: 0.375rem;

  /* Sidebar-specific */
  --sidebar-bg: #ffffff;
  --sidebar-border: var(--border);
}

/* Reset & Base */
body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover,
a:focus {
  color: var(--accent-dark);
  text-decoration: underline;
  outline: none;
}

/* Sidebar */
.sidebar {
  background-color: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  padding: 1.2rem 2rem;
  position: sticky;
  top: 5rem; /* align with navbar height */
  height: calc(100vh - 5rem);
  overflow-y: auto;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.03);
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
  background-color: #e9f3ff;
  color: var(--accent);
  outline: none;
}

.sidebar .nav-link.active {
  background-color: var(--accent-dark);
  color: #fff;
  font-weight: 600;
}

/* Sidebar Toggle Button */
.btn-toggle {
  color: var(--text-primary);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 1rem;
  cursor: pointer;
}

.btn-toggle .bi-caret-down-fill {
  transition: transform 0.3s ease;
}

.btn-toggle[aria-expanded="true"] .bi-caret-down-fill {
  transform: rotate(180deg);
}

.btn-toggle-nav .nav-link {
  padding-left: 1.5rem;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.btn-toggle-nav .nav-link:hover,
.btn-toggle-nav .nav-link:focus {
  background-color: #f1f3f5;
  color: var(--accent);
  outline: none;
}

/* Collapse All Button */
.collapse-all-btn {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--accent);
  border: none;
  background: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: color 0.2s ease-in-out;
}

.collapse-all-btn:hover,
.collapse-all-btn:focus {
  color: var(--accent-dark);
  outline: none;
}

.collapse-all-btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.collapse-all-btn.collapsed i {
  transform: rotate(-90deg);
}

/* Main Content */
main {
  padding: 1rem 2rem;
  min-height: 75vh;
}

@media (min-width: 992px) {
  main > .row {
    min-height: 75vh;
  }
}

/* Utility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
