/* ==========================================================================
   OEOS Design System - layout.css
   Header / Navbar, Sidebar, Footer, Main content wrapper
   Uses !important where inline <style> blocks in base_nav.html would otherwise win
   ========================================================================== */


/* ==========================================================================
   HEADER / TOP NAVBAR
   ========================================================================== */

.navbar,
nav.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1030 !important;
  height: var(--header-height) !important;
  min-height: var(--header-height) !important;
  padding: 0 var(--space-6) !important;
  background-color: var(--soft-gray) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Override Bootstrap's .navbar-dark.bg-dark colour */
.navbar.navbar-dark,
.navbar.bg-dark {
  background-color: var(--white) !important;
  color: var(--navy-blue) !important;
}

/* Brand / logo link */
.navbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: var(--space-2) !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

/* Tagline text beside logo */
.navbar-tagline {
  color: var(--deep-gray) !important;
  font-family: var(--font-primary) !important;
  font-size: 0.9375rem !important;
  font-weight: 400 !important;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Mobile hamburger toggle - shown only on small screens */
.navbar-mobile-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--primary-blue);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.navbar-mobile-toggle i {
  color: var(--primary-blue);
  font-size: 1.2rem;
}

.navbar-mobile-toggle:hover,
.navbar-mobile-toggle:active {
  background: transparent;
  border: none;
  box-shadow: none;
}

.navbar-mobile-toggle:focus,
.navbar-mobile-toggle:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Right-side header controls wrapper (profile/login + hamburger) */
.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}


/* ==========================================================================
   HEADER PROFILE DROPDOWN (top-right)
   ========================================================================== */

.oeos-header-profile {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.oeos-header-profile-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 10px 5px 5px;
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-full);
  cursor: pointer;
  max-width: 240px;
  overflow: hidden;
  transition: background-color var(--ease-fast), border-color var(--ease-fast);
}

.oeos-header-profile-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.18);
}

.oeos-header-profile-toggle:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.oeos-header-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid rgba(48, 142, 251, 0.25);
  flex-shrink: 0;
}

.oeos-header-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.oeos-header-profile-name {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--navy-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  line-height: 1.3;
}

.oeos-header-profile-email {
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  color: var(--deep-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  line-height: 1.3;
}

.oeos-header-dropdown-icon {
  font-size: 0.65rem;
  color: var(--deep-gray);
  transition: transform var(--ease-base);
  flex-shrink: 0;
  margin-left: 2px;
}

.oeos-header-dropdown-icon.rotate {
  transform: rotate(180deg);
}

.oeos-header-profile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  z-index: 2000;
  overflow: hidden;
  /* Always display:flex - never toggled to avoid display-change flash */
  display: flex;
  flex-direction: column;
  /* Hidden via visibility+opacity so CSS transitions work smoothly */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 130ms ease, transform 130ms ease, visibility 0s linear 130ms;
}

.oeos-header-profile-menu.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 130ms ease, transform 130ms ease, visibility 0s linear 0s;
}

.oeos-header-menu-item {
  display: flex;
  align-items: center;
  padding: 10px var(--space-4);
  color: var(--navy-blue);
  text-decoration: none;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  gap: var(--space-2);
  transition: background-color var(--ease-fast);
}

.oeos-header-menu-item:hover {
  background-color: var(--cool-blue);
  color: var(--navy-blue);
  text-decoration: none;
}

.oeos-header-menu-item i {
  color: var(--deep-gray);
  width: 18px;
  font-size: 0.875rem;
  text-align: center;
  flex-shrink: 0;
}

.oeos-header-menu-item:hover i {
  color: var(--primary-blue);
}

.oeos-header-menu-item--danger {
  color: var(--danger-red) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.oeos-header-menu-item--danger i {
  color: var(--danger-red) !important;
}

.oeos-header-menu-item--danger:hover {
  background-color: var(--danger-red-light) !important;
  color: var(--danger-red-dark) !important;
}

.oeos-header-menu-item--danger:hover i {
  color: var(--danger-red-dark) !important;
}

/* On very small screens: show avatar + chevron only */
@media (max-width: 480px) {
  .oeos-header-profile-email {
    display: none;
  }

  .oeos-header-profile-meta {
    display: none;
  }

  .oeos-header-profile-toggle {
    max-width: 68px;
    padding: 5px 10px 5px 5px;
  }
}


/* ==========================================================================
   HEADER LOGIN BUTTON (top-right, logged-out state)
   ========================================================================== */

.oeos-header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 18px;
  background-color: var(--primary-blue);
  color: var(--white) !important;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
  transition: background-color var(--ease-fast), box-shadow var(--ease-fast);
}

.oeos-header-login-btn:hover {
  background-color: var(--primary-blue-hover);
  color: var(--white) !important;
  box-shadow: 0 4px 12px rgba(48, 142, 251, 0.35);
  text-decoration: none !important;
}

.oeos-header-login-btn i {
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .oeos-header-login-btn span {
    display: none;
  }

  .oeos-header-login-btn {
    padding: 7px 12px;
  }

  .oeos-header-login-btn i {
    font-size: 1rem;
  }
}


/* ==========================================================================
   HEADER NOTIFICATION BELL (top-right, logged-in only)
   ========================================================================== */

@keyframes oeos-bell-ring {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-12deg); }
  40%  { transform: rotate(10deg); }
  60%  { transform: rotate(-8deg); }
  80%  { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}

.oeos-header-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.oeos-notification-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(48, 142, 251, 0.08);
  border: 1px solid rgba(48, 142, 251, 0.15);
  border-radius: var(--radius-full);
  color: var(--primary-blue);
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color var(--ease-fast),
    box-shadow var(--ease-fast),
    border-color var(--ease-fast);
}

.oeos-notification-btn:hover {
  background: rgba(48, 142, 251, 0.14);
  border-color: rgba(48, 142, 251, 0.3);
}

.oeos-notification-btn:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.oeos-notification-btn.is-active {
  background: rgba(48, 142, 251, 0.14);
  border-color: rgba(48, 142, 251, 0.35);
  box-shadow: 0 0 0 3px rgba(48, 142, 251, 0.12);
}

.oeos-notification-btn.is-ringing i {
  animation: oeos-bell-ring 450ms ease-in-out;
}

.oeos-notification-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 0s linear 120ms;
  z-index: 1100;
}

.oeos-notification-menu.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 0s linear 0s;
}

.oeos-notification-empty {
  padding: 20px 20px 18px;
  text-align: center;
  color: var(--deep-gray);
}

.oeos-notification-empty i {
  display: block;
  color: var(--primary-blue);
  opacity: 0.65;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.oeos-notification-empty p {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--deep-gray);
  font-family: var(--font-primary);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .oeos-notification-btn {
    width: 34px;
    height: 34px;
    font-size: 0.875rem;
  }

  .oeos-notification-menu {
    min-width: 220px;
    right: -48px;
    max-width: calc(100vw - 20px);
  }
}


/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar,
#sidebar {
  width: var(--sidebar-width) !important;
  background-color: var(--navy-blue) !important;
  padding: var(--space-4) 0 var(--space-8) !important;
  flex-shrink: 0;
  position: sticky !important;
  top: var(--header-height) !important;
  height: calc(100vh - var(--header-height)) !important;
  min-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  transition: width var(--ease-slow) !important;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  font-family: var(--font-primary);
}

.sidebar::-webkit-scrollbar,
#sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track,
#sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* Collapsed state */
.sidebar.collapsed,
#sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
}

/* Section divider lines in sidebar */
.section-divider {
  border: none !important;
  height: 1px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  margin: var(--space-3) var(--space-4) !important;
  width: auto !important;
  border-radius: 0 !important;
  opacity: 1 !important;
}

/* ===== Sidebar Nav Items ===== */
.nav-item {
  display: flex !important;
  align-items: center !important;
  padding: 10px var(--space-4) !important;
  margin: 2px var(--space-2) !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8) !important;
  transition: background-color var(--ease-fast) !important;
  gap: var(--space-2);
  user-select: none;
}

.nav-item a,
.nav-item > a {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 0 !important;
  text-decoration: none !important;
  color: rgba(255, 255, 255, 0.8) !important;
  cursor: pointer;
  gap: var(--space-2);
}

.nav-item span {
  font-size: var(--text-sm) !important;
  font-weight: 500 !important;
  font-family: var(--font-secondary) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--ease-base);
}

/* Force icon colours white on dark sidebar (overrides inline style="color:#003366") */
.nav-item i,
#sidebar .nav-item i {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 1rem !important;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: color var(--ease-fast);
}

.nav-item:hover,
.nav-item.active {
  background-color: var(--navy-sidebar-hover) !important;
  color: var(--white) !important;
}

.nav-item:hover a,
.nav-item:hover i,
.nav-item.active a,
.nav-item.active i {
  color: var(--white) !important;
}

.nav-item.active {
  background-color: var(--navy-sidebar-active) !important;
}

.nav-item.active i,
#sidebar .nav-item.active i {
  color: var(--primary-blue) !important;
}

/* ===== Profile Toggle (user section header) ===== */
.profile-name {
  display: flex !important;
  align-items: center !important;
  padding: 10px var(--space-4) !important;
  margin: 2px var(--space-2) !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85) !important;
  transition: background-color var(--ease-fast);
  font-size: var(--text-sm);
  font-weight: 500;
  user-select: none;
}

.profile-name:hover {
  background-color: var(--navy-sidebar-hover) !important;
}

.profile-name.active {
  background-color: var(--navy-sidebar-active) !important;
}

/* Override the flex-wrap & overflow in base_nav.html inline styles */
#profileToggle a {
  padding-left: 0 !important;
  padding-right: 0 !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Profile picture in sidebar */
.navBarProfilePicture {
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-full) !important;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0 !important;
}

/* Sidebar profile name / email text */
.sidebar-user-name {
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  font-size: var(--text-sm) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
}

.sidebar-user-email {
  font-family: var(--font-primary) !important;
  font-size: var(--text-xs) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
}

/* ===== Profile & Service Suite Sublists ===== */
.profile-tree {
  list-style: none !important;
  padding-left: var(--space-5) !important;
  padding-right: var(--space-2) !important;
  margin: 0 !important;
  border-left: 2px solid rgba(255, 255, 255, 0.1) !important;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.profile-tree.show {
  max-height: 600px;
  opacity: 1;
}

.profile-tree li {
  position: relative;
  padding-left: var(--space-2);
  margin-bottom: 2px;
}

.profile-tree li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 14px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%);
}

.nav-item-profile a,
.profile-item-centered a {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 7px var(--space-3) !important;
  border-radius: var(--radius-sm) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  text-decoration: none !important;
  font-size: 0.8125rem !important;
  font-family: var(--font-secondary) !important;
  font-weight: 500 !important;
  transition: background-color var(--ease-fast), color var(--ease-fast);
  gap: var(--space-2) !important;
}

.nav-item-profile a:hover,
.profile-item-centered a:hover {
  background-color: var(--navy-sidebar-hover) !important;
  color: var(--white) !important;
}

.nav-item-profile a i,
.profile-item-centered a i {
  color: rgba(255, 255, 255, 0.45) !important;
  font-size: 0.9rem !important;
  width: 18px !important;
  text-align: center;
  flex-shrink: 0;
}

.nav-item-profile:hover a i,
.profile-item-centered:hover a i {
  color: rgba(255, 255, 255, 0.85) !important;
}

.nav-item-profile.active a,
.profile-item-centered.active a {
  background-color: var(--navy-sidebar-active) !important;
  color: var(--primary-blue) !important;
}

.nav-item-profile.active a i,
.profile-item-centered.active a i {
  color: var(--primary-blue) !important;
}

/* Dropdown chevron icon */
.dropdown-icon {
  font-size: 0.7rem !important;
  color: rgba(255, 255, 255, 0.35) !important;
  transition: transform var(--ease-base) !important;
  flex-shrink: 0;
}

/* ===== Sidebar Toggle (splitter) Button ===== */
.sidebar-splitter-btn {
  position: absolute !important;
  top: 24px !important;
  right: 0 !important;
  background-color: var(--primary-blue) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  width: 18px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.18) !important;
  z-index: 1000 !important;
  transition: background-color var(--ease-fast), width var(--ease-fast);
}

.sidebar-splitter-btn:hover {
  background-color: var(--primary-blue-hover) !important;
  width: 22px !important;
}

.sidebar-splitter-btn #toggleIcon {
  font-size: 0.7rem !important;
  color: var(--white) !important;
  transition: transform var(--ease-base) !important;
}

/* ===== Collapsed Sidebar - Hide Labels ===== */
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .profile-name span,
#sidebar.collapsed .nav-list span,
#sidebar.collapsed .sidebar-user-name,
#sidebar.collapsed .sidebar-user-email {
  display: none !important;
}

#sidebar.collapsed .dropdown-icon {
  display: none !important;
}

#sidebar.collapsed .nav-item,
#sidebar.collapsed .profile-name {
  justify-content: center !important;
  padding: 10px var(--space-2) !important;
}

#sidebar.collapsed .navBarProfilePicture {
  margin-right: 0 !important;
}

#sidebar.collapsed .section-divider {
  margin: var(--space-2) auto !important;
  width: 50% !important;
}

#sidebar.collapsed .login-container {
  padding-left: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#sidebar.collapsed .login-container .fa-lock {
  display: inline-block !important;
  font-size: 1.1rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  margin: 0 !important;
}

#sidebar.collapsed .login-container .btn span {
  display: none !important;
}

#sidebar.collapsed .login-container .btn {
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* ===== Login Container in Sidebar ===== */
.login-container {
  padding: var(--space-4) !important;
}

/* Sidebar nav section section-header text override */
.section-header {
  font-family: var(--font-secondary) !important;
  font-size: var(--text-xs) !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.4) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  margin: var(--space-5) var(--space-4) var(--space-2) !important;
}


/* ===== Sidebar Social / Contact Links ===== */

.oeos-sidebar-social {
  margin-top: auto;
  padding: 16px 14px 18px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.oeos-sidebar-social__grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.oeos-sidebar-social__link,
.oeos-sidebar-social__collapsed-phone {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(226, 232, 240, 0.65);
  text-decoration: none !important;
  transition:
    color var(--ease-fast),
    background var(--ease-fast),
    border-color var(--ease-fast),
    box-shadow var(--ease-fast);
}

.oeos-sidebar-social__link:hover,
.oeos-sidebar-social__collapsed-phone:hover {
  color: var(--primary-blue) !important;
  background: rgba(48, 142, 251, 0.14);
  border-color: rgba(48, 142, 251, 0.28);
  box-shadow: 0 0 0 3px rgba(48, 142, 251, 0.08);
  text-decoration: none !important;
}

.oeos-sidebar-social__link i,
.oeos-sidebar-social__collapsed-phone i {
  font-size: 0.78rem;
  color: inherit;
  width: auto !important;
  flex-shrink: 0;
}

/* Collapsed sidebar: centre the 3 social icons and hide the About Us text label */
#sidebar.collapsed .oeos-sidebar-social {
  padding: 14px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#sidebar.collapsed .oeos-sidebar-about-link span {
  display: none !important;
}

/* ===== Sidebar About Us Link ===== */
.oeos-sidebar-about-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  color: rgba(226, 232, 240, 0.78);
  font-family: var(--font-secondary);
  font-size: var(--text-lg);
  font-weight: 600;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.oeos-sidebar-about-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.2s ease;
}

.oeos-sidebar-about-link:hover,
.oeos-sidebar-about-link.active {
  color: var(--primary-blue) !important;
  text-decoration: none !important;
}

.oeos-sidebar-about-link:hover::after,
.oeos-sidebar-about-link.active::after {
  width: 100%;
}

.oeos-sidebar-about-link i {
  font-size: 0.85rem;
  color: inherit;
  width: auto !important;
  flex-shrink: 0;
}

/* ===== Fix Collapsed Sidebar Hover - replace light-blue/grey with branded blue ===== */

#sidebar.collapsed .nav-item:hover,
#sidebar.collapsed .profile-name:hover {
  background-color: rgba(48, 142, 251, 0.14) !important;
}

#sidebar.collapsed .nav-item:hover a,
#sidebar.collapsed .nav-item:hover > i,
#sidebar.collapsed .profile-name:hover i {
  color: var(--primary-blue) !important;
}

#sidebar.collapsed .nav-item:hover i {
  color: var(--primary-blue) !important;
}

/* ===== Collapsed Sidebar: Service Suite sublist - compact icon layout ===== */

/* Remove expanded-mode tree connectors (left border, padding, branch lines) */
#sidebar.collapsed .profile-tree {
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-left: none !important;
  margin: 0 !important;
}

#sidebar.collapsed .profile-tree li::before {
  display: none !important;
}

#sidebar.collapsed .profile-tree li {
  padding-left: 0 !important;
  margin-bottom: 2px !important;
}

/* Compact <li> wrapper: remove the oversized 12px top/bottom padding */
#sidebar.collapsed .nav-item-profile,
#sidebar.collapsed .profile-item-centered {
  padding: 2px 0 !important;
  justify-content: center !important;
  background-color: transparent !important;
}

/* Turn the <a> into a centred 38×38 icon button */
#sidebar.collapsed .nav-item-profile a,
#sidebar.collapsed .profile-item-centered a {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid transparent;
  transition:
    background-color var(--ease-fast),
    color var(--ease-fast),
    border-color var(--ease-fast),
    box-shadow var(--ease-fast) !important;
}

/* Strip Bootstrap me-2 margin so icon sits centred with no right offset */
#sidebar.collapsed .nav-item-profile a i,
#sidebar.collapsed .profile-item-centered a i {
  margin-right: 0 !important;
  width: auto !important;
}

/* ===== Collapsed Sidebar: Service Suite sublist - branded blue hover ===== */

/* Suppress the grey #E8F2FF block on the <li> from styles.css */
#sidebar.collapsed .nav-item-profile:hover,
#sidebar.collapsed .profile-item-centered:hover {
  background-color: transparent !important;
}

/* Blue-tinted hover on the icon <a> button */
#sidebar.collapsed .nav-item-profile a:hover,
#sidebar.collapsed .profile-item-centered a:hover {
  background-color: rgba(48, 142, 251, 0.14) !important;
  color: var(--primary-blue) !important;
  border-color: rgba(48, 142, 251, 0.28) !important;
  box-shadow: 0 0 0 3px rgba(48, 142, 251, 0.08) !important;
}

#sidebar.collapsed .nav-item-profile a:hover i,
#sidebar.collapsed .profile-item-centered a:hover i {
  color: var(--primary-blue) !important;
  opacity: 1 !important;
}


/* ==========================================================================
   MAIN CONTENT WRAPPER
   ========================================================================== */

.main-content-wrapper {
  flex-grow: 1;
  min-height: calc(100vh - var(--header-height));
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 0 var(--collapsed-footer-height, 36px) 0 !important;
}

.main-content-box {
  flex-grow: 1;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}


/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  background-color: var(--navy-blue);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-7);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
}

/* LEFT - disclaimer + nav links stacked vertically */
.footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.footer-brand {
  font-family: var(--font-secondary);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* LINKS */
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.6rem;
  gap: var(--space-2) var(--space-4);
}

.footer-link {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  transition: color var(--ease-fast);
}

.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1px;
  background: var(--mint-accent);
  transition: width var(--ease-fast);
}

.footer-link:hover {
  color: var(--white);
}

.footer-link:hover::after {
  width: 100%;
}

/* RIGHT - contact items stacked vertically, right-aligned */
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  flex-shrink: 0;
}

.footer-contact {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color var(--ease-fast);
}

.footer-contact i {
  color: var(--mint-accent);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.footer-contact:hover {
  color: var(--white);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 992px) {
  .footer-container {
    gap: var(--space-5);
  }

  .footer-right {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-5);
  }

  .footer-right {
    align-items: flex-start;
    width: 100%;
  }

  .footer-link,
  .footer-contact {
    font-size: 0.58rem;
  }
}

@media (max-width: 480px) {
  .footer-container {
    padding: var(--space-4) var(--space-4);
  }

  .footer-links {
    gap: var(--space-2);
    font-size: 0.58rem;
  }

  .footer-right {
    gap: var(--space-2);
  }
}
/* ==========================================================================
   MOBILE SIDEBAR OVERLAY
   ========================================================================== */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1019;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
  display: block;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  /* Show hamburger in navbar */
  .navbar-mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Compact navbar padding on tablet */
  .navbar,
  nav.navbar {
    padding: 0 var(--space-5) !important;
  }

  /* Allow brand to shrink so right-side controls always fit */
  .navbar-brand {
    flex-shrink: 1 !important;
    min-width: 0;
    overflow: hidden;
  }

  /* Reduce OEOS name logo at tablet */
  .navbar-brand img[alt="OneEstateOS"] {
    max-width: 150px;
    width: auto;
    height: auto;
  }

  /* Constrain profile dropdown so it never overflows the viewport */
  .oeos-header-profile-menu {
    max-width: calc(100vw - 32px);
    right: 0;
  }

  /* Slide sidebar off-screen by default on mobile */
  .sidebar,
  #sidebar {
    position: fixed !important;
    left: 0;
    top: var(--header-height) !important;
    height: calc(100vh - var(--header-height)) !important;
    z-index: 1020;
    transform: translateX(-100%);
    transition: transform var(--ease-slow) !important;
    width: var(--sidebar-width) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3) !important;
  }

  .sidebar.mobile-open,
  #sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Hide the desktop splitter button on mobile */
  .sidebar-splitter-btn {
    display: none !important;
  }

  /* Full-width content on mobile */
  .main-content-wrapper {
    min-height: auto;
    width: 100%;
  }

}

@media (max-width: 480px) {
  :root {
    --sidebar-width: 240px;
  }

  .navbar-tagline {
    display: none !important;
  }

  .navbar,
  nav.navbar {
    padding: 0 var(--space-4) !important;
  }

  /* Further shrink OEOS name logo at iPhone SE / very small phones */
  .navbar-brand img[alt="OneEstateOS"] {
    max-width: 110px;
  }

  /* Tighten gap between profile/login and hamburger */
  .navbar-right {
    gap: var(--space-1);
  }
}


/* ==========================================================================
   LOGOUT CONFIRMATION MODAL
   ========================================================================== */

/* Overlay - always display:flex, shown/hidden via visibility+opacity (no layout shift) */
.oeos-logout-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--ease-base),
    visibility 0s linear 250ms;
}

.oeos-logout-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity var(--ease-base),
    visibility 0s linear 0s;
}

/* Backdrop overlay behind the card */
.oeos-logout-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 26, 47, 0.55);
  cursor: default;
}

/* Modal card */
.oeos-logout-modal__dialog {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition:
    opacity var(--ease-base),
    transform var(--ease-base);
}

.oeos-logout-modal.is-open .oeos-logout-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Icon circle */
.oeos-logout-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--danger-red-light);
  color: var(--danger-red);
  font-size: 1.25rem;
  margin: 0 auto var(--space-5);
}

/* Title */
.oeos-logout-modal__title {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--navy-blue);
  margin: 0 0 var(--space-3);
  line-height: 1.3;
}

/* Body text */
.oeos-logout-modal__message {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  color: var(--deep-gray);
  line-height: 1.75;
  margin: 0 0 var(--space-7);
}

/* Button row */
.oeos-logout-modal__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* Base button */
.oeos-logout-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-7);
  border-radius: var(--radius-full);
  font-family: var(--font-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  border: 2px solid transparent;
  line-height: 1.4;
  transition:
    background-color var(--ease-fast),
    color var(--ease-fast),
    border-color var(--ease-fast),
    box-shadow var(--ease-fast),
    transform var(--ease-fast);
}

.oeos-logout-modal__btn:active {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

/* Cancel button - blue outline */
.oeos-logout-modal__btn--cancel {
  background-color: var(--white);
  color: var(--primary-blue) !important;
  border-color: var(--primary-blue);
}

.oeos-logout-modal__btn--cancel:hover {
  background-color: var(--primary-blue);
  color: var(--white) !important;
  box-shadow: 0 4px 12px rgba(48, 142, 251, 0.25);
  transform: translateY(-1px);
}

.oeos-logout-modal__btn--cancel:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 3px;
}

/* Danger button - red filled */
.oeos-logout-modal__btn--danger {
  background-color: var(--danger-red);
  color: var(--white) !important;
  border-color: var(--danger-red);
}

.oeos-logout-modal__btn--danger:hover {
  background-color: var(--danger-red-dark);
  border-color: var(--danger-red-dark);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.32);
  transform: translateY(-1px);
}

.oeos-logout-modal__btn--danger:focus-visible {
  outline: 2px solid var(--danger-red);
  outline-offset: 3px;
}

/* Mobile: stack buttons, tighten padding */
@media (max-width: 480px) {
  .oeos-logout-modal__actions {
    flex-direction: column;
  }

  .oeos-logout-modal__btn {
    width: 100%;
    justify-content: center;
  }

  .oeos-logout-modal__dialog {
    padding: var(--space-6) var(--space-5);
  }
}

/* ==========================================================================
   DISCLOSURE HEADER PROFILE LOCKED STATE
   ========================================================================== */

.oeos-header-profile-toggle--locked {
  cursor: help;
  opacity: 1;
}

.oeos-header-profile-toggle--locked:hover {
  background: rgba(248, 250, 252, 0.9);
  box-shadow: none;
  transform: none;
}

.oeos-header-profile-toggle--locked .oeos-header-profile-avatar {
  opacity: 0.95;
}

.oeos-header-profile-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--navy-blue);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  white-space: normal;
  pointer-events: none;
}

.oeos-header-profile-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 22px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--navy-blue);
}

.oeos-header-profile:hover .oeos-header-profile-tooltip {
  display: block;
}


/* ==========================================================================
   SHORT-WIDE DESKTOP  (e.g. 1440 × 520 — "Desktop Short Wide" device)
   Fires only on wide + short viewports. No effect on normal desktops
   (height ≥ 650px), tablets, or mobiles.
   ========================================================================== */
@media (min-width: 1200px) and (max-height: 650px) {
  /* Slightly wider sidebar so long labels like "Acquisition Management Suite"
     fit on one line without wrapping. Main content auto-adjusts via flex-grow. */
  :root {
    --sidebar-width: 315px;
  }

  /* Reduce vertical padding per nav item to fit more items in short viewports */
  .nav-item {
    padding: 7px var(--space-4) !important;
  }

  /* Slightly smaller label font so long suite names clear the sidebar width */
  .nav-item span {
    font-size: 0.78rem !important;
  }
}