/* ==========================================================================
   Sidebar nav, + New menu, Admin / My Department submenus.
   Owning feature: app chrome
   Load order is defined in Views/Shared/_CssIncludes.cshtml — do not reorder.
   ========================================================================== */

/* --- Sidebar nav -------------------------------------------------------- */
.fh-sidebar-new-wrapper {
  margin: 1.125rem 0.75rem 0.35rem;
  display: flex;
  justify-content: center;
}

.fh-sidebar-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3rem;
  width: auto;
  min-width: 7.75rem;
  max-width: 10.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  font-size: var(--fh-text-md);
  font-weight: var(--fh-weight-semibold);
  letter-spacing: var(--fh-tracking-tight);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28), 0 1px 3px rgba(37, 99, 235, 0.16);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.fh-sidebar-new:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.38), 0 2px 4px rgba(37, 99, 235, 0.2);
}
.fh-sidebar-new:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.fh-sidebar-new:focus-visible {
  outline: 2px solid var(--fh-primary);
  outline-offset: 2px;
}
.fh-sidebar-new:disabled,
.fh-sidebar-new[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}
.fh-sidebar-new.dropdown-toggle::after {
  margin-left: 0.35rem;
  vertical-align: 0.125em;
}

.fh-sidebar-new-menu {
  min-width: 12.5rem;
  padding: 0.375rem;
  border-radius: 0.75rem;
}

.fh-sidebar-nav { padding: 0.5rem 0.75rem 0.5rem; }
.fh-nav-heading { display: none; }
/* The menu supplied its own list reset, flex column and link box via
   `.nav.nav-pills.sidebar-menu`; it owns all three directly now. */
.fh-sidebar-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fh-sidebar-menu .nav-link {
  display: flex; align-items: center; gap: 0.875rem;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  color: var(--fh-muted); border-radius: 0.625rem; margin-bottom: 0;
  font-size: var(--fh-text-base); letter-spacing: var(--fh-tracking-tight);
  text-decoration: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.fh-sidebar-menu .nav-link > p { margin: 0; flex: 1 1 auto; display: flex; align-items: center; font-weight: inherit; }
.fh-sidebar-menu .nav-link:hover {
  color: var(--fh-primary);
  background: var(--fh-primary-soft, var(--fh-sidebar-hover));
}
.fh-sidebar-menu .nav-link:active {
  color: var(--fh-primary-dark);
  background: var(--fh-primary-soft, var(--fh-sidebar-hover));
}
.fh-sidebar-menu .nav-link.active {
  background: var(--fh-primary-soft, var(--fh-sidebar-hover));
  color: var(--fh-primary);
  font-weight: var(--fh-weight-semibold);
}
.fh-sidebar-menu .nav-link.active:hover,
.fh-sidebar-menu .nav-link.active:active {
  color: var(--fh-primary-dark);
  background: var(--fh-primary-soft, var(--fh-sidebar-hover));
}
.fh-sidebar-menu .nav-icon { color: inherit; width: 1.25rem; text-align: center; flex: 0 0 auto; font-size: var(--fh-text-lg); }
.fh-sidebar-menu .nav-link:focus-visible {
  outline: 2px solid var(--fh-primary);
  outline-offset: 2px;
}

.fh-sidebar-footer {
  flex: 0 0 auto;
  padding: 1rem 0.875rem 1.25rem;
  border-top: 1px solid var(--fh-border);
}
.fh-sidebar-footer .fh-storage-meter {
  width: 100%;
  flex-wrap: wrap;
  border: 0;
  border-radius: 0;
  padding: 0;
  gap: 0.55rem 0.5rem;
}
.fh-sidebar-footer .fh-storage-meter-bar {
  width: 100%;
  order: 3;
  height: 5px;
  background: #eef0f3;
}
.fh-sidebar-footer .fh-storage-meter-label {
  font-weight: var(--fh-weight-regular);
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
}
.fh-sidebar-footer .fh-storage-meter > i { display: none; }

/* --- Sidebar submenus (Admin / My Department) ---------------------------
   A plain disclosure: a <button> owning aria-expanded, and a sibling list
   shown by the `is-open` class on the <li>. Replaces the treeview widget the
   vendor script used to provide, and unlike it the toggle is a real button
   rather than an `href="#"` anchor, so it never pushes a history entry or
   jumps the page when activated. */
.fh-sub-toggle {
  width: 100%;
  background: none; border: 0; appearance: none;
  font: inherit; text-align: left; cursor: pointer;
}
.fh-sub-caret {
  margin-left: auto;
  font-size: var(--fh-text-xs);
  transition: transform 150ms ease;
}
.fh-has-sub.is-open > .fh-sub-toggle .fh-sub-caret { transform: rotate(-90deg); }

.fh-submenu {
  list-style: none;
  margin: 0 0 2px;
  padding: 0 0 0 1.4rem;
  display: none;
}
.fh-has-sub.is-open > .fh-submenu { display: block; }
.fh-submenu .nav-link { font-size: var(--fh-text-base); padding: 0.4rem 0.75rem; }
.fh-submenu .nav-icon { font-size: var(--fh-text-2xs); }

@media (prefers-reduced-motion: reduce) {
  .fh-sub-caret { transition: none; }
}

