.sidebar nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
}

.sidebar-bottom {
  flex-shrink: 0;
}

/* Shared portal shell: grouping is presentational only; navigation targets,
   permissions and view routing remain unchanged. */
#primary-navigation {
  display: grid;
  flex: 1 1 auto;
  gap: 4px;
  min-height: 0;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.nav-group {
  border-radius: 10px;
}

.nav-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #8290a5;
  cursor: pointer;
  display: flex;
  font: 700 10px 'DM Sans', Arial, sans-serif;
  justify-content: space-between;
  letter-spacing: 1px;
  min-height: 32px;
  padding: 10px 10px 5px;
  text-align: left;
  text-transform: uppercase;
  width: 100%;
}

.nav-group-toggle b {
  color: #9ca8b8;
  font-size: 14px;
  line-height: 1;
  transition: transform .18s ease;
}

.nav-group.is-collapsed .nav-group-toggle b { transform: rotate(-90deg); }
.nav-group.is-collapsed .nav-group-items { display: none; }
.nav-group-items { display: grid; gap: 1px; }
.navigation-filtered { display: none !important; }

.global-search {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  width: min(220px, 20vw);
}

.global-search input {
  background: transparent;
  border: 0;
  color: var(--ink);
  font: 500 13px 'DM Sans', Arial, sans-serif;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.global-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px #2764e71a; }

.page-breadcrumb {
  color: #8490a2;
  font: 700 10px 'DM Sans', Arial, sans-serif;
  letter-spacing: .7px;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.academic-period {
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding-left: 12px;
  white-space: nowrap;
}

.profile-menu { position: relative; }
.profile-menu summary { align-items: center; cursor: pointer; display: flex; gap: 8px; list-style: none; min-height: 38px; }
.profile-menu summary::-webkit-details-marker { display: none; }
.header-avatar { align-items: center; background: #fff0dc; border-radius: 50%; color: #b66b0d; display: inline-flex; font-size: 10px; font-weight: 800; height: 34px; justify-content: center; width: 34px; }
.profile-menu-label { display: grid; gap: 1px; max-width: 118px; }
.profile-menu-label b { color: var(--ink); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-label small { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.profile-menu-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 32px #182b4a1a; display: grid; min-width: 165px; padding: 6px; position: absolute; right: 0; top: calc(100% + 8px); z-index: 12; }
.profile-menu-panel button { background: transparent; border: 0; border-radius: 7px; color: #526075; cursor: pointer; font: 600 12px 'DM Sans', Arial, sans-serif; min-height: 36px; padding: 8px 10px; text-align: left; }
.profile-menu-panel button:hover { background: var(--blue-soft); color: var(--blue); }
.profile-menu-panel button:last-child { color: #b44051; }

thead th {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:nth-child(even) td { background: #fcfdff; }
tbody tr:hover td { background: #f6f9ff; }

@media (max-width: 700px) {
  .sidebar.open { transform: translateX(0); }
  #primary-navigation { padding-bottom: 8px; }
  .nav-group-toggle { min-height: 38px; font-size: 11px; }
  .global-search { display: none; }
  .academic-period { display: none; }
  .profile-menu-label { display: none; }
}
