/*
 * Cross-module navigation enhancements. These selectors deliberately support
 * both the current QHealth shell and the two remaining Bootstrap navigation
 * implementations.
 */
.header-nav .nav-dropdown.has-current-app > .nav-dropdown-btn {
  color: var(--color-accent, #007aff);
  background: var(--color-accent-light, rgba(0, 122, 255, 0.08));
}

.header-nav .dropdown-item.qhealth-current-app,
.header-nav .dropdown-item.current {
  color: var(--color-text-primary, #1d1d1f);
  background: var(--color-accent-light, rgba(0, 122, 255, 0.08));
}

.header-nav .dropdown-item.qhealth-current-app svg,
.header-nav .dropdown-item.current svg {
  color: var(--color-accent, #007aff);
}

.current-app-mark {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--color-accent, #007aff);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.navbar .navbar-nav:not(.navbar-right) > .dropdown.has-current-app > .dropdown-toggle {
  color: #007aff !important;
  background: rgba(0, 122, 255, 0.08) !important;
}

.navbar .navbar-nav:not(.navbar-right) .dropdown-menu > li > a.qhealth-current-app {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1d1d1f !important;
  background: rgba(0, 122, 255, 0.08) !important;
}

.navbar .navbar-nav:not(.navbar-right) .dropdown-menu > li > a.qhealth-current-app .current-app-mark {
  color: #007aff;
}

.navbar .navbar-right .dropdown-menu > li > a.qhealth-current-app {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1d1d1f !important;
  background: rgba(0, 122, 255, 0.08) !important;
}

/*
 * Shared profile contract for modules using the modern QHealth shell. Treasury
 * is the visual reference; the extra shell specificity keeps these controls
 * consistent even when a module's stylesheet is loaded after this file.
 */
.layout .header-right .user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 4px;
  color: var(--color-text-secondary, #6e6e73);
  border: 0;
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif);
  cursor: pointer;
}

.layout .header-right .user-menu-btn:hover,
.layout .header-right .user-menu-btn:focus,
.layout .header-right .nav-dropdown.active > .user-menu-btn {
  color: var(--color-text-primary, #1d1d1f);
  background: var(--color-surface, #f5f5f7);
}

.layout .header-right .header-avatar {
  display: flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: var(--radius-sm, 8px);
  background: #1d1d1f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.layout .header-right .dropdown-panel-right {
  min-width: 220px;
}

.layout .header-right .dropdown-account-summary {
  display: block;
  min-width: 0;
  padding: 10px 12px 8px;
}

.layout .header-right .dropdown-account-summary strong,
.layout .header-right .dropdown-account-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout .header-right .dropdown-account-summary strong {
  color: var(--color-text-primary, #1d1d1f);
  font-size: 14px;
  font-weight: 650;
}

.layout .header-right .dropdown-account-summary span {
  margin-top: 2px;
  color: var(--color-text-tertiary, #8e8e93);
  font-size: 12px;
}

.layout .header-right .dropdown-panel-right .dropdown-item {
  display: flex;
  min-height: 0;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: normal;
}

.layout .header-right .dropdown-logout-form {
  margin: 0;
}

.layout .header-right button.dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.layout .sidebar-footer .sidebar-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md, 12px);
}

.layout .sidebar-footer .sidebar-user-avatar {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(135deg, #636366 0%, #48484a 100%);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.layout .sidebar-footer .sidebar-user-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.layout .sidebar-footer .sidebar-user-name,
.layout .sidebar-footer .sidebar-user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout .sidebar-footer .sidebar-user-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
}

.layout .sidebar-footer .sidebar-user-role {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  #sidebar .nav-submenu,
  #sidebar .collapse {
    transition: none !important;
  }
}
