/* Sidebar customization: wider sidebar, smaller icons/text, consistent spacing */
:root {
  --sidebar-width: 280px;
}

.main-sidebar, .main-sidebar::before {
  width: var(--sidebar-width);
}

.layout-fixed .brand-link {
  width: var(--sidebar-width);
}

/* Content/header/footer shift for the open sidebar. Do NOT exclude
   .sidebar-mini-md here: with it the AdminLTE default is only 250px.
   Collapsed state is handled by AdminLTE's !important 4.6rem rail rule. */
@media (min-width: 768px) {
  body:not(.sidebar-mini-xs):not(.layout-top-nav) .content-wrapper,
  body:not(.sidebar-mini-xs):not(.layout-top-nav) .main-footer,
  body:not(.sidebar-mini-xs):not(.layout-top-nav) .main-header {
    margin-left: var(--sidebar-width);
  }
}

@media (max-width: 767.98px) {
  body:not(.sidebar-open) .main-sidebar,
  body:not(.sidebar-open) .main-sidebar::before {
    margin-left: calc(var(--sidebar-width) * -1);
  }
}

/* Collapsed on desktop, AdminLTE's sidebar-mini rules keep the sidebar at the
   4.6rem icon rail and shift the content by 4.6rem. The rules below only make
   that rail expand back to the project's sidebar width on hover/focus. */
.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover,
.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand).sidebar-focused,
.sidebar-mini.sidebar-collapse.layout-fixed .main-sidebar:not(.sidebar-no-expand):hover,
.sidebar-mini.sidebar-collapse.layout-fixed .main-sidebar:not(.sidebar-no-expand).sidebar-focused {
  width: var(--sidebar-width);
}

.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .brand-link,
.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand).sidebar-focused .brand-link,
.sidebar-mini.sidebar-collapse.layout-fixed .main-sidebar:not(.sidebar-no-expand):hover .brand-link,
.sidebar-mini.sidebar-collapse.layout-fixed .main-sidebar:not(.sidebar-no-expand).sidebar-focused .brand-link {
  width: var(--sidebar-width);
}

/* Keep treeview parent labels on one line, with room on the right so they
   never run into the absolutely positioned chevron. */
.nav-sidebar .nav-item.has-treeview > .nav-link {
  padding-right: 2.25rem;
  white-space: nowrap;
}

.nav-sidebar .nav-item.has-treeview > .nav-link p {
  white-space: nowrap;
}

/* Nudge the dropdown chevron towards the right edge so there is clear
   spacing between it and the label (AdminLTE default is right: 1rem). */
.nav-sidebar .nav-item.has-treeview > .nav-link p > .right {
  right: .4rem;
}

.nav-sidebar > .nav-item .nav-icon {
  font-size: 1rem;
  margin-right: .2rem;
  width: 1.6rem;
}

.nav-sidebar > .nav-item .nav-icon.fa,
.nav-sidebar > .nav-item .nav-icon.fas,
.nav-sidebar > .nav-item .nav-icon.far,
.nav-sidebar > .nav-item .nav-icon.fab,
.nav-sidebar > .nav-item .nav-icon.fal,
.nav-sidebar > .nav-item .nav-icon.fad,
.nav-sidebar > .nav-item .nav-icon.svg-inline--fa,
.nav-sidebar > .nav-item .nav-icon.ion {
  font-size: .9rem;
}

.nav-sidebar .nav-link {
  font-size: .9rem;
  padding: .45rem .8rem;
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link > .nav-icon {
  width: 1.6rem;
}

.nav-sidebar .nav-header {
  font-size: .8rem;
  padding: .4rem .75rem;
}
/* Sticky top navbar: stays pinned to the top of the viewport while the page scrolls */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1033;
}

/* UOD logo in the sidebar brand area (replaces the old "AA" placeholder).
   The brand row is centered so the logo sits neatly in both the expanded
   sidebar and the 4.6rem collapsed rail (and on hover-expand). */
.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem .75rem;
}

/* Collapsed rail: extra vertical padding around the favicon mark */
.sidebar-mini.sidebar-collapse .brand-link {
  padding: .8rem .75rem;
}

.brand-link .brand-image {
  float: none;
  margin: 0;
  max-width: 100%;
  max-height: 38px;
  object-fit: contain;
}

/* Collapsed rail (4.6rem): swap the wordmark for the square favicon mark */
.brand-link .brand-image-compact {
  display: none;
}

.sidebar-mini.sidebar-collapse .brand-link .brand-image-full {
  display: none;
}

.sidebar-mini.sidebar-collapse .brand-link .brand-image-compact {
  display: block;
  max-height: 30px;
}

/* Hover/focus expand brings the full wordmark back while the rail widens */
@media (min-width: 768px) {
  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .brand-image-full,
  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand).sidebar-focused .brand-image-full {
    display: block;
  }

  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .brand-image-compact,
  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand).sidebar-focused .brand-image-compact {
    display: none;
  }
}
