/* ========================================
   BPI360 Frontend Design Layout CSS
   ======================================== */

/* Force stable scrollbar gutter on html to prevent layout shift between pages
   with and without scrollbars. The browser always reserves ~15px, so 100vw
   content doesn't reflow when a scrollbar appears/disappears during navigation.
   html background matches the page bg so the transparent scrollbar track
   in the reserved gutter is invisible (no white strip visible). */
html {
  scrollbar-gutter: stable;
  background: var(--color-bpi-softblue);
}

/* Base Typography */
body {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  /* Prevent layout shifts during font loading */
  font-display: block;
  text-rendering: optimizeSpeed;
  margin: 0;
  padding: 0;
}

/* Prevent layout shifts during font loading */
* {
  font-display: block;
}

/* Layout Container - Now handled by CSS Grid above */

/* Header Height Synchronization */
.fd-header-sync {
  display: contents;
}

/* CSS-only equal height headers using CSS Grid */
.fd-layout-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  background-color: var(--color-bpi-softblue);
  /* Removed transition to prevent layout shifts during sidebar toggle */
  width: 100%;
  align-items: stretch; /* This makes headers in the same row equal height */
  /* Ensure stable dimensions */
  min-width: 320px;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Collapsed sidebar state */
.fd-layout-container.sidebar-collapsed {
  grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
}

/* Immediate collapsed state on page load - prevents flash */
.sidebar-collapsed-on-load .fd-layout-container {
  grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
}

.sidebar-collapsed-on-load .fd-sidebar {
  overflow: visible;
}

/* Collapsed nav/logo appearance from first paint - prevents icon/text/arrow flash before JS adds .fd-sidebar-collapsed (desktop/tablet only) */
@media (min-width: 768px) {
  /* Disable transitions on first paint while .sidebar-collapsed-on-load is active */
  .sidebar-collapsed-on-load .fd-layout-container,
  .sidebar-collapsed-on-load .fd-sidebar,
  .sidebar-collapsed-on-load .fd-sidebar-toggle,
  .sidebar-collapsed-on-load .fd-toggle-icon,
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-header,
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-content,
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-footer,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section-header,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section-title,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-items,
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-img,
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-link,
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-stack {
    transition: none !important;
  }

  /* Ensure toggle button starts in collapsed position and arrow already rotated */
  .sidebar-collapsed-on-load .fd-sidebar-toggle {
    left: var(--sidebar-width-collapsed);
  }
  .sidebar-collapsed-on-load .fd-toggle-icon {
    transform: rotate(180deg);
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-header {
    padding: var(--logo-header-pad-y-collapsed) var(--logo-header-pad-x-collapsed);
    justify-content: center;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-logo,
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-link {
    justify-content: center;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-stack {
    width: var(--logo-collapsed-size);
    min-width: var(--logo-collapsed-size);
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-stack::before {
    width: var(--logo-collapsed-size);
    height: var(--logo-collapsed-size);
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-expanded {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-logo-collapsed {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-text,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-arrow,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section-title {
    opacity: 0;
    max-width: 0;
    flex: 0 0 0;
    margin: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section:first-child {
    padding-top: var(--nav-section-header-expanded-height);
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section:not(:first-child) .fd-nav-items {
    margin-top: var(--nav-section-header-offset);
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section:first-child .fd-nav-section-header {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section:not(:first-child) .fd-nav-section-header {
    max-height: var(--nav-section-header-divider-height);
    margin: var(--inset-sm) var(--inset-sm);
    padding: 0;
    overflow: hidden;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section:not(:first-child) .fd-nav-section-header::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--border-secondary);
    margin: 0;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger {
    justify-content: center;
    align-items: center;
    width: var(--nav-collapsed-pill-size);
    height: var(--nav-collapsed-pill-size);
    min-width: var(--nav-collapsed-pill-size);
    min-height: var(--nav-collapsed-pill-size);
    max-width: var(--nav-collapsed-pill-size);
    margin: 0 0 var(--nav-item-margin-bottom) 0;
    padding: 0;
    display: inline-flex;
    flex-shrink: 0;
    box-sizing: border-box;
    background-color: transparent;
    border-radius: var(--radius-full);
    box-shadow: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link .fd-nav-icon-slot,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link i:first-child,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger i:first-child {
    margin-right: 0;
    margin-left: 0;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-content {
    padding: var(--inset-sm) 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-list,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-section,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-items {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-item {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-footer {
    padding: var(--inset-sm);
    text-align: center;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-sidebar-footer-links {
    display: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger .fd-nav-text,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger .fd-nav-arrow {
    display: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-menu {
    display: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link.active,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger.active {
    background-color: var(--bg-accent);
    color: var(--interactive-primary);
    border-radius: var(--radius-full);
    box-shadow: none;
  }
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link.active .fd-nav-icon,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger.active .fd-nav-icon,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-link.active i:first-child,
  .sidebar-collapsed-on-load .fd-sidebar .fd-nav-dropdown-trigger.active i:first-child {
    color: unset;
  }
}

/* Post-navigation hydration — keep collapsed sidebar stable across full page loads */
html.fd-layout-hydrating .fd-layout-container,
html.fd-layout-hydrating .fd-sidebar,
html.fd-layout-hydrating .fd-sidebar-toggle,
html.fd-layout-hydrating .fd-toggle-icon,
html.fd-layout-hydrating .fd-sidebar .fd-sidebar-header,
html.fd-layout-hydrating .fd-sidebar .fd-sidebar-content,
html.fd-layout-hydrating .fd-sidebar .fd-nav-link,
html.fd-layout-hydrating .fd-sidebar .fd-nav-dropdown-trigger,
html.fd-layout-hydrating .fd-sidebar .fd-nav-section-header,
html.fd-layout-hydrating .fd-sidebar .fd-nav-section-title,
html.fd-layout-hydrating .fd-sidebar .fd-nav-text,
html.fd-layout-hydrating .fd-sidebar .fd-logo-img,
html.fd-layout-hydrating .fd-sidebar .fd-logo-stack,
html.fd-layout-hydrating .fd-skin .fd-sidebar .fd-nav-icon-slot {
  transition: none !important;
  animation: none !important;
}

/* Collapsed session — soften main content swap on navigation */
@keyframes fd-content-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.fd-collapsed-session:not(.fd-layout-hydrated) .fd-content-body {
  opacity: 0;
}

html.fd-collapsed-session.fd-layout-hydrated .fd-content-body {
  animation: fd-content-enter var(--transition-content-enter) both;
}

/* Collapsed navigation — freeze sidebar chrome after hydration (no jump on page change) */
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-layout-container,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar-toggle,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-toggle-icon,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-sidebar-header,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-sidebar-content,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-sidebar-footer,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-nav-link,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-nav-section-header,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-nav-section-title,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-nav-text,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-nav-arrow,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-logo-img,
html.fd-collapsed-session.fd-layout-hydrated:not(.fd-sidebar-animate) .fd-sidebar .fd-logo-stack {
  transition: none !important;
  animation: none !important;
}

/* Keep proximity icon lift on hover during collapsed sessions */
html.fd-collapsed-session.fd-layout-hydrated .fd-skin .fd-sidebar-nav--proximity .fd-nav-icon-slot {
  transition: transform var(--nav-icon-settle-duration) cubic-bezier(0.33, 1, 0.68, 1);
}

@media (prefers-reduced-motion: reduce) {
  html.fd-collapsed-session:not(.fd-layout-hydrated) .fd-content-body {
    opacity: 1;
  }

  html.fd-collapsed-session.fd-layout-hydrated .fd-content-body {
    animation: none;
  }
}

/* Prevent flash of expanded sidebar on page load */
html.fd-collapsed-session .fd-layout-container,
html.fd-collapsed-session .fd-sidebar {
  transition: none !important;
}

html.fd-collapsed-session.fd-sidebar-animate .fd-layout-container {
  transition: grid-template-columns var(--transition-sidebar) !important;
}

html.fd-collapsed-session .fd-layout-container.sidebar-collapsed,
html.sidebar-collapsed-on-load.fd-collapsed-session .fd-layout-container {
  grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
}

html.fd-collapsed-session .fd-layout-container.sidebar-collapsed .fd-sidebar,
html.sidebar-collapsed-on-load.fd-collapsed-session .fd-sidebar {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Prevent flash of expanded sidebar on page load — expanded sessions only */
html:not(.fd-collapsed-session) .fd-layout-container {
  transition: grid-template-columns var(--transition-sidebar);
}

/* Initial state - sidebar width follows grid track; animate only on explicit toggle */
.fd-layout-container:not(.sidebar-collapsed) .fd-sidebar {
  transition: none;
}

.fd-layout-container.sidebar-collapsed .fd-sidebar {
  transition: none;
}

/* Prevent flash by hiding sidebar content until JavaScript loads */
.fd-sidebar {
  overflow: hidden;
}

/* Ensure content area expands properly */
.fd-layout-container.sidebar-collapsed .fd-content-area {
  width: 100%;
  max-width: none;
}

.fd-sidebar {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  background-color: var(--bg-primary);
  border-right: none;
  /* Removed transition to prevent layout shifts */
  box-shadow: var(--shadow-sidebar);
  align-items: stretch; /* Ensure sidebar content stretches to match content area */
}

.fd-content-area {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  /* Removed transition to prevent layout shifts */
  width: 100%;
  /* Allow horizontal content to use full width on narrower laptop screens */
  overflow-x: visible;
  overflow-y: visible;
  align-items: stretch; /* Ensure content area stretches to match sidebar */
}

/* Ensure headers are in the same grid row */
.fd-sidebar-header {
  grid-row: 1;
}

.fd-content-header {
  grid-row: 1;
}

/* Ensure footers are in the same grid row */
.fd-sidebar-footer {
  grid-row: 3;
}

.fd-content-footer {
  grid-row: 3;
}

/* Fallback for browsers that don't support CSS Grid */
@supports not (display: grid) {
  .fd-layout-container {
    display: flex;
  }
  
  .fd-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
  }
  
  .fd-content-area {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
}

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

/* Sidebar styles now handled by CSS Grid above */

/* Sidebar Header */
.fd-sidebar-header {
  padding: var(--logo-header-pad-y-expanded) var(--logo-header-pad-x-expanded);
  border-bottom: none;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: var(--header-height);
  height: var(--header-height);
  box-sizing: border-box;
  overflow: hidden;
  transition: padding var(--transition-sidebar);
}

.fd-sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  transition: justify-content var(--transition-sidebar);
}

.fd-logo-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 100%;
}

/* Stacked logos — centre-origin scale crossfade */
.fd-logo-stack {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  transition: width var(--transition-sidebar),
    min-width var(--transition-sidebar),
    height var(--transition-sidebar);
}

/* Sizing ghost — stack dimensions while logos are absolutely centred */
.fd-logo-stack::before {
  content: '';
  display: block;
  width: var(--logo-expanded-width);
  height: var(--logo-expanded-height);
  max-height: var(--logo-expanded-height);
  visibility: hidden;
  transition: width var(--transition-sidebar), height var(--transition-sidebar);
}

.fd-logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  object-fit: contain;
  transform-origin: center center;
  margin: 0;
  transition-property: opacity, transform, visibility;
  transition-duration: var(--logo-fade-duration);
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

.fd-logo-expanded {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  height: var(--logo-expanded-height);
  max-height: var(--logo-expanded-height);
  width: auto;
  max-width: var(--logo-expanded-width);
  transition-delay: 0s;
}

.fd-logo-collapsed {
  width: var(--logo-collapsed-size);
  height: var(--logo-collapsed-size);
  max-width: var(--logo-collapsed-size);
  max-height: var(--logo-collapsed-size);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition-delay: var(--logo-fade-stagger);
}

/* Expanding — icon shrinks first, then wordmark grows */
.fd-sidebar:not(.fd-sidebar-collapsed) .fd-logo-collapsed {
  transition-delay: 0s;
}

.fd-sidebar:not(.fd-sidebar-collapsed) .fd-logo-expanded {
  transition-delay: var(--logo-fade-stagger);
}

/* Collapsed — wordmark shrinks first, then icon grows */
.fd-sidebar-collapsed .fd-sidebar-header {
  padding: var(--logo-header-pad-y-collapsed) var(--logo-header-pad-x-collapsed);
  justify-content: center;
}

.fd-sidebar-collapsed .fd-sidebar-logo,
.fd-sidebar-collapsed .fd-logo-link {
  justify-content: center;
}

.fd-sidebar-collapsed .fd-logo-stack {
  width: var(--logo-collapsed-size);
  min-width: var(--logo-collapsed-size);
}

.fd-sidebar-collapsed .fd-logo-stack::before {
  width: var(--logo-collapsed-size);
  height: var(--logo-collapsed-size);
}

.fd-sidebar-collapsed .fd-logo-expanded {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition-delay: 0s;
}

.fd-sidebar-collapsed .fd-logo-collapsed {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  transition-delay: var(--logo-fade-stagger);
}

/* Sidebar Content */
.fd-sidebar-content {
  flex: 1;
  padding: var(--sidebar-content-pad-y) 0;
  overflow-y: auto;
}

/* New Sidebar Navigation */
.fd-sidebar-nav {
  width: 100%;
}

.fd-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fd-nav-section {
  margin-bottom: var(--nav-section-gap);
}

.fd-nav-section-header {
  padding: var(--inset-sm) var(--inset-2xl);
  margin-bottom: var(--inset-xs);
  max-height: var(--nav-section-header-expanded-height);
  overflow: hidden;
  transition: padding var(--transition-sidebar), margin var(--transition-sidebar),
    max-height var(--transition-sidebar), opacity var(--transition-sidebar);
}

.fd-nav-section-title {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  display: block;
  max-height: 1.25rem;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--transition-sidebar), max-height var(--transition-sidebar),
    margin var(--transition-sidebar), visibility var(--transition-sidebar);
}

/* First section — padding replaces header height when collapsed (retains icon Y) */
.fd-sidebar .fd-nav-section:first-child {
  padding-top: 0;
  transition: padding-top var(--transition-sidebar);
}

.fd-sidebar .fd-nav-section:not(:first-child) .fd-nav-items {
  margin-top: 0;
  transition: margin-top var(--transition-sidebar);
}

.fd-nav-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fd-nav-item {
  margin: 0;
}

.fd-nav-link {
  font-family: var(--font-family-primary);
  display: flex;
  align-items: center;
  padding: var(--inset-sm) var(--nav-link-pad-x-expanded);
  margin: 0 var(--nav-link-margin-x-expanded) var(--nav-item-margin-bottom) var(--nav-link-margin-x-expanded);
  color: var(--text-secondary);
  text-decoration: none;
  transition: padding var(--transition-sidebar),
    margin var(--transition-sidebar),
    background-color var(--transition-sidebar),
    border-radius var(--transition-sidebar),
    color var(--transition-sidebar),
    box-shadow var(--transition-sidebar);
  border-radius: var(--radius-2xl);
  position: relative;
  background-color: var(--bg-secondary);
  min-height: var(--nav-item-min-height);
  font-size: var(--nav-arrow-size);
}

.fd-nav-link:hover {
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

/* Focus state for accessibility */
.fd-nav-link:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

/* Primary active state - full width blue background like "Orders" in screenshot */
.fd-nav-link.active {
  background-color: var(--interactive-primary);
  color: var(--text-inverse);
  margin: 0 var(--nav-link-margin-x-expanded) var(--nav-item-margin-bottom) var(--nav-link-margin-x-expanded);
  padding: var(--inset-sm) var(--nav-link-pad-x-expanded);
  border-radius: var(--radius-2xl);
}

/* Secondary selected state - light gray background like "Inspections", "Users", "Templates" in screenshot */
.fd-nav-link.selected {
  background-color: var(--bg-secondary);
  color: var(--interactive-primary);
  margin: 0 var(--inset-lg) var(--nav-item-margin-bottom) var(--inset-lg);
  padding: var(--inset-sm) var(--inset-2xl);
  border-radius: var(--radius-2xl);
}

.fd-nav-link .fd-nav-icon:not(.ph-duotone),
.fd-nav-link i:first-child:not(.ph-duotone),
.fd-nav-dropdown-trigger i:first-child:not(.ph-duotone) {
  margin-right: var(--inset-sm);
  width: var(--nav-icon-width);
  text-align: center;
  font-size: var(--nav-icon-size);
  color: var(--interactive-primary);
  flex-shrink: 0;
}

.fd-nav-link.active i:first-child:not(.ph-duotone) {
  color: var(--text-inverse);
}

.fd-nav-link.selected i:first-child:not(.ph-duotone) {
  color: var(--interactive-primary);
}

/* Prevent hover effects on active nav links - maintain active styling */
.fd-nav-link.active:hover {
  background-color: var(--interactive-primary);
  color: var(--text-inverse);
}

.fd-nav-link.active:hover i:first-child:not(.ph-duotone) {
  color: var(--text-inverse);
}

.fd-nav-text {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 14rem;
  opacity: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.32s cubic-bezier(0.33, 1, 0.68, 1),
    max-width var(--transition-sidebar),
    flex var(--transition-sidebar),
    margin var(--transition-sidebar),
    padding var(--transition-sidebar),
    visibility var(--transition-sidebar);
}

.fd-nav-arrow {
  margin-left: auto;
  font-size: var(--nav-arrow-size);
  flex-shrink: 0;
  opacity: 1;
  max-width: 2rem;
  overflow: hidden;
  transition: opacity 0.32s cubic-bezier(0.33, 1, 0.68, 1),
    max-width var(--transition-sidebar),
    margin var(--transition-sidebar),
    visibility var(--transition-sidebar);
}

.fd-sidebar-collapsed .fd-nav-text,
.fd-sidebar-collapsed .fd-nav-arrow {
  opacity: 0;
  max-width: 0;
  flex: 0 0 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.fd-sidebar-collapsed .fd-nav-section-title {
  opacity: 0;
  max-height: 0;
  margin: 0;
  visibility: hidden;
}

.fd-sidebar-collapsed .fd-nav-section:first-child {
  padding-top: var(--nav-section-header-expanded-height);
}

.fd-sidebar-collapsed .fd-nav-section:not(:first-child) .fd-nav-items {
  margin-top: var(--nav-section-header-offset);
}

.fd-sidebar-collapsed .fd-nav-section:first-child .fd-nav-section-header {
  max-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.fd-sidebar-collapsed .fd-nav-section:not(:first-child) .fd-nav-section-header {
  max-height: var(--nav-section-header-divider-height);
  padding: 0;
  margin: var(--inset-sm) var(--inset-sm);
  opacity: 1;
}

/* Replace section title with HR line in collapsed state (sections 2+) */
.fd-sidebar-collapsed .fd-nav-section:not(:first-child) .fd-nav-section-header::before {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--border-secondary);
  margin: 0;
}

/* Collapsed sidebar — centred circular icon pills */
.fd-sidebar-collapsed .fd-nav-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: var(--nav-collapsed-pill-size);
  height: var(--nav-collapsed-pill-size);
  min-width: var(--nav-collapsed-pill-size);
  min-height: var(--nav-collapsed-pill-size);
  max-width: var(--nav-collapsed-pill-size);
  margin: 0 0 var(--nav-item-margin-bottom) 0;
  padding: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  background-color: transparent;
  box-shadow: none;
}

.fd-sidebar-collapsed .fd-nav-link:hover {
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

.fd-sidebar-collapsed .fd-nav-link.active {
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
  box-shadow: none;
}

.fd-sidebar-collapsed .fd-nav-link.active i:first-child:not(.ph-duotone) {
  color: unset;
}

.fd-sidebar-collapsed .fd-nav-link.active:hover {
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

.fd-sidebar-collapsed .fd-nav-link.active:hover i:first-child:not(.ph-duotone) {
  color: unset;
}

.fd-sidebar-collapsed .fd-nav-dropdown-trigger {
  justify-content: center;
  align-items: center;
  padding: var(--inset-sm) var(--inset-lg);
  margin: 0 var(--inset-sm) 4px var(--inset-sm);
  width: calc(100% - var(--inset-lg));
  display: flex;
  background-color: transparent;
  border-radius: var(--radius-full);
  position: relative;
}

/* Ensure all sidebar sections have consistent width and background in collapsed state */
.fd-sidebar-collapsed .fd-sidebar-header,
.fd-sidebar-collapsed .fd-sidebar-content,
.fd-sidebar-collapsed .fd-sidebar-footer {
  width: 100%;
  background-color: var(--bg-primary);
}

/* Collapsed sidebar header — padding animated above with logo rules */

/* Collapsed sidebar content — stretch rows (no centre-shift) */
.fd-sidebar-collapsed .fd-sidebar-content {
  padding: var(--inset-sm) 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.fd-sidebar-collapsed .fd-nav-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.fd-sidebar-collapsed .fd-nav-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: var(--nav-section-gap-collapsed);
}

.fd-sidebar-collapsed .fd-nav-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.fd-sidebar-collapsed .fd-nav-item {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Collapsed sidebar footer - center content and reduce padding */
.fd-sidebar-collapsed .fd-sidebar-footer {
  padding: var(--inset-sm);
  text-align: center;
}

/* Hide footer links in collapsed state */
.fd-sidebar-collapsed .fd-sidebar-footer-links {
  display: none;
}

/* Collapsed sidebar — overflow visible for tooltips + proximity scale */
.fd-sidebar.fd-sidebar-collapsed {
  overflow: visible;
}

.fd-sidebar-collapsed .fd-sidebar-content,
.fd-sidebar-collapsed .fd-sidebar-nav,
.fd-sidebar-collapsed .fd-nav-list {
  overflow: visible;
}

/* Collapsed nav tooltips — Pulse-style CSS (::after), desktop only */
@media (min-width: 768px) {
  .fd-sidebar-collapsed .fd-nav-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: var(--text-inverse);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transition-delay: 0.35s;
    z-index: var(--z-popover);
    box-shadow: var(--shadow-02);
  }

  .fd-sidebar-collapsed .fd-nav-link[data-tooltip]:hover::after,
  .fd-sidebar-collapsed .fd-nav-link[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .fd-sidebar-collapsed .fd-nav-link[data-tooltip]::after {
    transition: none;
    transition-delay: 0s;
  }

  .fd-nav-section-header,
  .fd-nav-section-title,
  .fd-sidebar .fd-nav-section:first-child,
  .fd-sidebar .fd-nav-section:not(:first-child) .fd-nav-items,
  .fd-skin .fd-sidebar .fd-nav-icon-slot .ph-duotone,
  .fd-sidebar-collapsed .fd-nav-link,
  .fd-logo-img,
  .fd-logo-stack {
    transition: none;
  }
}

/* ========================================
   DROPDOWN NAVIGATION STYLES
   ======================================== */

/* Dropdown Container */
.fd-nav-dropdown {
  position: relative;
}

/* Dropdown Trigger */
.fd-nav-dropdown-trigger {
  display: flex;
  align-items: center;
  padding: var(--inset-sm) var(--inset-2xl);
  margin: 0 var(--inset-lg) var(--nav-item-margin-bottom) var(--inset-lg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  border-radius: var(--radius-2xl);
  position: relative;
  background-color: var(--bg-secondary);
  min-height: var(--nav-item-min-height);
  font-size: var(--nav-arrow-size); /* 14px */
}

.fd-nav-dropdown-trigger:hover {
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

/* Focus state for dropdown triggers */
.fd-nav-dropdown-trigger:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

/* Primary active state for dropdown triggers */
.fd-nav-dropdown-trigger.active {
  background-color: var(--interactive-primary);
  color: var(--text-inverse);
  margin: 0 var(--inset-lg) var(--nav-item-margin-bottom) var(--inset-lg);
  padding: var(--inset-sm) var(--inset-2xl);
  border-radius: var(--radius-2xl);
}

/* Secondary selected state for dropdown triggers */
.fd-nav-dropdown-trigger.selected {
  background-color: var(--bg-secondary);
  color: var(--interactive-primary);
  margin: 0 var(--inset-lg) var(--nav-item-margin-bottom) var(--inset-lg);
  padding: var(--inset-sm) var(--inset-2xl);
  border-radius: var(--radius-2xl);
}

.fd-nav-dropdown-trigger i:first-child {
  margin-right: var(--inset-sm);
  width: var(--nav-icon-width);
  text-align: center;
  font-size: var(--nav-icon-size);
  color: var(--interactive-primary);
}

/* Icon colors for dropdown trigger states */
.fd-nav-dropdown-trigger.active i:first-child {
  color: var(--text-inverse);
}

.fd-nav-dropdown-trigger.selected i:first-child {
  color: var(--interactive-primary);
}

/* Prevent hover effects on active dropdown triggers - maintain active styling */
.fd-nav-dropdown-trigger.active:hover {
  background-color: var(--interactive-primary);
  color: var(--text-inverse);
}

.fd-nav-dropdown-trigger.active:hover i:first-child {
  color: var(--text-inverse);
}

.fd-nav-dropdown-trigger.active:hover .fd-nav-arrow {
  color: var(--text-inverse);
}

.fd-nav-dropdown-trigger .fd-nav-text {
  flex: 1;
  transition: opacity var(--transition-normal);
}

/* Higher specificity override for dropdown text color and font to match nav links */
.fd-skin .fd-sidebar .fd-nav-dropdown-trigger .fd-nav-text {
  color: var(--text-secondary);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-light);
  font-size: var(--nav-arrow-size);
}

/* Higher specificity override for dropdown submenu items to match nav links */
.fd-skin .fd-sidebar .fd-nav-dropdown-link {
  color: var(--text-secondary);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-light);
  font-size: var(--nav-arrow-size);
}

.fd-skin .fd-sidebar .fd-nav-dropdown-link .fd-nav-text {
  color: var(--text-secondary);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-light);
  font-size: var(--nav-arrow-size);
}

/* ========================================
   NAVIGATION TEXT HIGH SPECIFICITY OVERRIDES
   ======================================== */

/* Main Navigation Links - Default State */
.fd-skin .fd-sidebar .fd-nav-link {
  color: var(--text-secondary);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-light);
  font-size: var(--nav-arrow-size);
}

.fd-skin .fd-sidebar .fd-nav-link .fd-nav-text {
  color: var(--text-secondary);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-light);
  font-size: var(--nav-arrow-size);
}

/* Navigation Icons — Phosphor duotone colours in fd-icons.css */
.fd-skin .fd-sidebar .fd-nav-link i:first-child:not(.ph-duotone) {
  color: var(--interactive-primary);
}

/* High Specificity Overrides for Active States - Ensure White Text and Icons */
.fd-skin .fd-sidebar .fd-nav-link.active {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-link.active .fd-nav-text {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-link.active i:first-child:not(.ph-duotone) {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-link.active:hover {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-link.active:hover .fd-nav-text {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-link.active:hover i:first-child:not(.ph-duotone) {
  color: var(--text-inverse);
}

/* Collapsed active — centred pill accent */
.fd-skin .fd-sidebar-collapsed .fd-nav-link.active,
.fd-skin .fd-sidebar-collapsed .fd-nav-link.active:hover {
  color: var(--interactive-primary);
  background-color: var(--bg-accent);
  box-shadow: none;
  border-radius: var(--radius-full);
}

.fd-skin .fd-sidebar-collapsed .fd-nav-link.active .fd-nav-text,
.fd-skin .fd-sidebar-collapsed .fd-nav-link.active:hover .fd-nav-text {
  color: var(--interactive-primary);
}

.fd-skin .fd-sidebar-collapsed .fd-nav-link.active i:first-child:not(.ph-duotone),
.fd-skin .fd-sidebar-collapsed .fd-nav-link.active:hover i:first-child:not(.ph-duotone) {
  color: unset;
}

/* High Specificity Overrides for Active Dropdown Triggers */
.fd-skin .fd-sidebar .fd-nav-dropdown-trigger.active {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-dropdown-trigger.active .fd-nav-text {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-dropdown-trigger.active i:first-child {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-dropdown-trigger.active:hover {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-dropdown-trigger.active:hover .fd-nav-text {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar .fd-nav-dropdown-trigger.active:hover i:first-child {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar-collapsed .fd-nav-dropdown-trigger.active i:first-child {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar-collapsed .fd-nav-dropdown-trigger.active:hover i:first-child {
  color: var(--text-inverse);
}

/* Collapsed State Dropdown Arrow - Point Right */
.fd-skin .fd-sidebar-collapsed .fd-nav-dropdown-trigger .fd-nav-arrow {
  display: block !important;
  transform: rotate(-90deg); /* Rotate chevron-down to point right */
  font-size: var(--nav-arrow-size);
  color: var(--interactive-primary);
  transition: all var(--transition-normal);
  margin-left: auto; /* Position it to the right */
}

/* Collapsed State Dropdown Arrow Hover */
.fd-skin .fd-sidebar-collapsed .fd-nav-dropdown-trigger:hover .fd-nav-arrow {
  color: var(--interactive-primary);
}

/* Collapsed State Dropdown Arrow Active */
.fd-skin .fd-sidebar-collapsed .fd-nav-dropdown-trigger.active .fd-nav-arrow {
  color: var(--text-inverse);
}

.fd-skin .fd-sidebar-collapsed .fd-nav-dropdown-trigger.active:hover .fd-nav-arrow {
  color: var(--text-inverse);
}

/* ========================================
   MOBILE RESPONSIVE OVERRIDES
   ======================================== */

/* Hide sidebar toggle on mobile devices */
@media (max-width: 767px) {
  .fd-skin .fd-sidebar-toggle {
    display: none;
  }
}

/* ========================================
   HEADER ELEMENTS HIGH SPECIFICITY OVERRIDES
   ======================================== */

/* Search Input High Specificity */
.fd-skin .fd-content-header .fd-search-input {
  font-family: var(--font-family-primary);
  font-size: var(--nav-arrow-size);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  background-color: var(--bg-primary);
  transition: all var(--transition-normal);
}

.fd-skin .fd-content-header .fd-search-input:focus {
  border-color: var(--interactive-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.fd-skin .fd-content-header .fd-search-input::placeholder {
  color: var(--text-secondary);
  font-size: var(--nav-arrow-size);
}

/* Button High Specificity — Pulse parity (geometry/typography; states in fd-priority-system.css) */
.fd-skin .fd-content-header .fd-btn {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-compact);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  gap: 6px;
  transition: all var(--transition-normal);
}

/* User Profile High Specificity */
.fd-skin .fd-content-header .fd-user-name {
  font-family: var(--font-family-primary);
  font-size: var(--nav-arrow-size);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  line-height: 1.2;
}

.fd-skin .fd-content-header .fd-user-email,
.fd-skin .fd-content-header .fd-user-role {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
  line-height: 1.2;
}

/* User Button High Specificity */
.fd-skin .fd-content-header .fd-user-button {
  font-family: var(--font-family-primary);
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--inset-sm);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.fd-skin .fd-content-header .fd-user-button:hover {
  background-color: var(--bg-secondary);
  color: var(--interactive-primary);
}

/* Mobile Menu Toggle High Specificity */
.fd-skin .fd-content-header .fd-mobile-menu-toggle {
  font-family: var(--font-family-primary);
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--inset-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
}

.fd-skin .fd-content-header .fd-mobile-menu-toggle:hover {
  background-color: var(--bg-secondary);
  color: var(--interactive-primary);
}

.fd-nav-dropdown-trigger .fd-nav-arrow {
  margin-left: auto;
  font-size: var(--nav-arrow-size);
  transition: all var(--transition-normal);
}

/* Arrow colors for different states */
.fd-nav-dropdown-trigger.active .fd-nav-arrow {
  color: var(--text-inverse);
}

.fd-nav-dropdown-trigger.selected .fd-nav-arrow {
  color: var(--interactive-primary);
}

/* Dropdown Menu - Modern Sidebar Style - Updated v2 */
.fd-nav-dropdown-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: transparent;
  position: relative;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
  margin-left: var(--dropdown-margin-left);
}

/* Dropdown Menu - Open State */
.fd-nav-dropdown.open .fd-nav-dropdown-menu {
  max-height: var(--dropdown-max-height);
  padding: var(--dropdown-padding) 0;
}

.fd-nav-dropdown.open .fd-nav-arrow {
  transform: rotate(180deg);
}

/* Dropdown Items */
.fd-nav-dropdown-item {
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  list-style: none;
}

/* Dropdown Links - Modern Sidebar Style */
.fd-nav-dropdown-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--inset-sm) var(--inset-lg);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-normal);
  border-radius: var(--radius-md);
  margin: 2px var(--inset-lg) 2px calc(var(--layout-gap-lg) + var(--inset-2xl));
  position: relative;
  font-size: var(--font-size-sm); /* Consistent with main nav */
  background-color: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  min-height: var(--nav-item-min-height);
  font-weight: var(--font-weight-normal);
}

.fd-nav-dropdown-link:hover {
  color: var(--interactive-primary);
  background-color: var(--bg-accent);
  transform: translateX(2px);
}

/* Focus state for dropdown links */
.fd-nav-dropdown-link:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  color: var(--interactive-primary);
  background-color: var(--bg-accent);
  transform: translateX(2px);
}

.fd-nav-dropdown-link.active {
  color: var(--interactive-primary);
  background-color: var(--bg-secondary);
  font-weight: var(--font-weight-medium);
}

.fd-nav-dropdown-link .fd-nav-text {
  flex: 1;
  position: relative;
  margin-left: 0;
  text-align: left;
}

/* Modern sidebar indicator - left border line - REMOVED */

/* Subtle dot indicator for submenu items - REMOVED to prevent bullet points */

/* Badge Styles */
.fd-nav-badge {
  background-color: var(--bg-accent);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.fd-nav-dropdown-link.active .fd-nav-badge {
  background-color: var(--text-inverse);
  color: var(--interactive-primary);
}

/* Collapsed Sidebar States */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger .fd-nav-text {
  display: none;
}

/* Hide arrow by default in collapsed state, but show it with high specificity override */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger .fd-nav-arrow {
  display: none;
}

/* Fix icon alignment in collapsed state - remove margins since text is hidden */
.fd-sidebar-collapsed .fd-nav-link .fd-nav-icon-slot,
.fd-sidebar-collapsed .fd-nav-link i:first-child:not(.ph-duotone),
.fd-sidebar-collapsed .fd-nav-dropdown-trigger i:first-child:not(.ph-duotone) {
  margin-right: 0;
  margin-left: 0;
}

.fd-sidebar-collapsed .fd-nav-dropdown-menu {
  display: none;
}

/* Enhanced dropdown behavior in collapsed state */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
}

/* Add hover effect for collapsed dropdown triggers */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger:hover {
  background-color: transparent;
  color: var(--interactive-primary);
}

/* Active state for collapsed dropdown triggers */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger.active {
  background-color: var(--interactive-primary);
  color: var(--text-inverse);
}

/* Active state icon color for collapsed dropdown triggers */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger.active i:first-child {
  color: var(--text-inverse);
}

/* Prevent hover effects on active collapsed dropdown triggers - maintain active styling */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger.active:hover {
  background-color: var(--interactive-primary);
  color: var(--text-inverse);
}

.fd-sidebar-collapsed .fd-nav-dropdown-trigger.active:hover i:first-child {
  color: var(--text-inverse);
}

/* Position dropdown arrow absolutely in collapsed state so it doesn't affect main icon centering */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger .ti-chevron-down {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  transition: transform var(--transition-normal);
  z-index: var(--z-dropdown);
}

/* Hover state for collapsed dropdown chevron - match toggle button behavior */
.fd-sidebar-collapsed .fd-nav-dropdown-trigger:hover .ti-chevron-down {
  color: var(--interactive-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .fd-nav-dropdown-menu {
    margin-left: var(--inset-lg);
  }
  
  .fd-nav-dropdown-link {
    margin-left: 40px;
  }
}

/* Sidebar Footer */
.fd-sidebar-footer {
  padding: var(--footer-padding-vertical) var(--sidebar-inset-x);
  border-top: none;
  background-color: var(--bg-primary);
}

.fd-sidebar-footer-content {
  text-align: center;
}

.fd-sidebar-footer-text {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 0;
}

.fd-sidebar-footer-links {
  display: flex;
  gap: var(--inset-sm);
  margin-top: var(--inset-sm);
  justify-content: center;
}

.fd-footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--nav-arrow-size);
  transition: color var(--transition-fast);
}

.fd-footer-link:hover {
  color: var(--interactive-primary);
}

/* ========================================
   CONTENT AREA STYLES
   ======================================== */

/* Content area styles now handled by CSS Grid above */

/* Content Header */
.fd-content-header {
  background-color: var(--color-bpi-softblue);
  border-bottom: none;
  padding: var(--header-padding-vertical) var(--shell-gutter-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-01);
  min-height: var(--header-height);
  height: var(--header-height);
  box-sizing: border-box;
}

.fd-header-left {
  display: flex;
  align-items: center;
}

.fd-sidebar-toggle {
  position: fixed;
  top: calc(var(--header-height) / 2);
  left: var(--sidebar-width);
  transform: translate(-50%, -50%);
  z-index: var(--z-fixed);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--inset-xs);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.fd-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 1);
  color: var(--interactive-primary);
  box-shadow: var(--shadow-card-md);
}

/* Collapsed state positioning */
.fd-layout-container.sidebar-collapsed .fd-sidebar-toggle {
  left: var(--sidebar-width-collapsed);
}

/* Icon rotation for collapsed state */
.fd-toggle-icon {
  transition: transform var(--transition-normal);
}

.fd-layout-container.sidebar-collapsed .fd-toggle-icon {
  transform: rotate(180deg);
}

/* Mobile hamburger menu toggle - hidden by default, shown on mobile */
.fd-mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  cursor: pointer;
  padding: var(--inset-xs);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  margin-right: var(--inset-lg);
}

.fd-mobile-menu-toggle:hover {
  background-color: var(--bg-secondary);
  color: var(--interactive-primary);
}

.fd-header-center {
  flex: 1;
  text-align: center;
}

.fd-search-container {
  display: flex;
  align-items: center;
}

.fd-search-box {
  position: relative;
  width: 280px;
}

.fd-search-input {
  width: 100%;
  padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  background-color: var(--color-soft-02);
  font-family: var(--font-family-primary);
  font-size: var(--nav-arrow-size);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-01);
}

.fd-search-input:focus {
  outline: none;
  border-color: var(--interactive-primary);
  box-shadow: var(--shadow-focus);
}

.fd-search-input::placeholder {
  color: var(--text-secondary);
  font-size: var(--nav-arrow-size);
}

.fd-search-icon {
  position: absolute;
  right: var(--inset-lg);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: var(--nav-arrow-size);
  pointer-events: none;
}

.fd-page-title {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.fd-header-right {
  display: flex;
  align-items: center;
  gap: var(--inset-2xl);
}

.fd-action-buttons {
  display: flex;
  align-items: center;
  gap: var(--inset-sm);
}

.fd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-compact);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

/* Icon-only round actions (Export, Print, Refresh, Filters) — true circles, not ovals */
.fd-btn.fd-btn-icon-round:not(.fd-add-btn):not(.fd-map-view-btn):not(.fd-toolbar-icon-btn) {
  box-sizing: border-box;
  width: var(--fd-btn-icon-round-size);
  height: var(--fd-btn-icon-round-size);
  min-width: var(--fd-btn-icon-round-size);
  max-width: var(--fd-btn-icon-round-size);
  min-height: var(--fd-btn-icon-round-size);
  max-height: var(--fd-btn-icon-round-size);
  padding: 0 !important;
  gap: 0;
  flex: 0 0 var(--fd-btn-icon-round-size);
  border-radius: 50% !important;
  line-height: 1;
  overflow: hidden;
  justify-content: center;
}

.fd-btn.fd-btn-icon-round:not(.fd-add-btn):not(.fd-map-view-btn):not(.fd-toolbar-icon-btn) span:not(.fd-filter-badge) {
  display: none !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

.fd-btn.fd-btn-icon-round.dropdown-toggle:not(.fd-add-btn):not(.fd-map-view-btn):not(.fd-toolbar-icon-btn)::after {
  display: none !important;
  margin: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* FD-BUTTON-POLICY: sizes — default + sm only */
.fd-btn-sm {
  padding: var(--inset-xs) var(--inset-md);
  font-size: var(--font-size-sm);
  min-height: 28px;
}

/* Map/list toggle pill — active when map visible (FD-BUTTON-POLICY) */
.fd-btn-outline.fd-map-view-btn.active,
.fd-btn-outline.fd-map-view-btn[aria-pressed="true"] {
  border-color: var(--interactive-primary);
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

.fd-btn i {
  font-size: var(--nav-arrow-size);
}

/* Header Separator */
.fd-header-separator {
  width: 1px;
  height: 32px;
  background-color: #d1d5db;
  margin: 0 var(--inset-lg);
  flex-shrink: 0;
  display: block;
  opacity: 1;
}

/* User Profile */
.fd-user-profile {
  display: flex;
  align-items: center;
  gap: var(--inset-sm);
  border-radius: 25px;
  background-color: var(--bg-primary);
  padding: 0.15rem;
}

.fd-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--interactive-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fd-avatar-initials {
  color: var(--text-inverse);
  font-size: var(--nav-arrow-size);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  line-height: 1;
}

.fd-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  text-align: left;
}

.fd-user-name {
  font-family: var(--font-family-primary);
  font-size: var(--nav-arrow-size);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}

.fd-user-email,
.fd-user-role {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.2;
  margin: 0;
  margin-top: 2px;
}

.fd-user-menu {
  position: relative;
}

.fd-user-button {
  background: none;
  border: none;
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--inset-sm);
  border-radius: var(--radius-full);
  transition: var(--hover-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fd-user-button:hover {
  background-color: var(--bg-secondary);
  color: var(--interactive-primary);
}

.fd-user-button i {
  font-size: var(--nav-arrow-size);
  transition: transform var(--transition-normal);
}

/* ========================================
   FD USER DROPDOWN MENU STYLING
   ======================================== */

/* FD User Dropdown Menu Container */
.fd-skin .fd-user-menu .dropdown-menu {
  background-color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-02);
  padding: var(--inset-sm);
  min-width: 200px;
  margin-top: var(--layout-gap-sm);
  z-index: var(--z-dropdown);
  /* Add subtle offset to create visual separation */
  transform: translateY(2px);
}

/* FD User Dropdown Menu Items */
.fd-skin .fd-user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--inset-sm);
  padding: var(--inset-sm) var(--inset-lg);
  color: var(--text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  margin-bottom: var(--inset-xs);
}

.fd-skin .fd-user-menu .dropdown-item:last-child {
  margin-bottom: 0;
}

/* FD User Dropdown Item Hover States */
.fd-skin .fd-user-menu .dropdown-item:hover {
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
  transform: translateX(2px);
}

/* FD User Dropdown Item Icons */
.fd-skin .fd-user-menu .dropdown-item i {
  font-size: var(--font-size-base);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

/* Special styling for logout item */
.fd-skin .fd-user-menu .dropdown-item[href*="logout"] {
  color: var(--status-error);
  border-top: 1px solid var(--border-primary);
  margin-top: var(--inset-xs);
  padding-top: var(--inset-lg);
}

.fd-skin .fd-user-menu .dropdown-item[href*="logout"]:hover {
  background-color: var(--icon-bg-error);
  color: var(--status-error);
}

.fd-skin .fd-user-menu .dropdown-item[href*="logout"] i {
  color: var(--status-error);
}

/* Focus states for accessibility */
.fd-skin .fd-user-menu .dropdown-item:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

/* Mobile responsive styles for user dropdown */
@media (max-width: 768px) {
  .fd-skin .fd-user-menu .dropdown-menu {
    min-width: 180px;
    right: 0;
    left: auto;
    margin-top: var(--layout-gap-sm);
  }
  
  .fd-skin .fd-user-menu .dropdown-item {
    padding: var(--inset-lg) var(--inset-2xl);
    font-size: var(--font-size-base);
  }
  
  .fd-skin .fd-user-menu .dropdown-item i {
    font-size: var(--font-size-lg);
    width: 18px;
  }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
  .fd-skin .fd-user-menu .dropdown-menu {
    min-width: 160px;
    padding: var(--inset-xs);
  }
  
  .fd-skin .fd-user-menu .dropdown-item {
    padding: var(--inset-sm) var(--inset-lg);
    font-size: var(--font-size-sm);
  }
}

/* Content Body */
.fd-content-body {
  flex: 1;
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  box-sizing: border-box;
  padding: var(--shell-body-pad-y) var(--shell-gutter-x);
  background-color: var(--color-bpi-softblue);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden; /* prevent page-level horizontal scroll; inner wrappers will scroll */
  display: flex;
  flex-direction: column;
  gap: var(--shell-body-gap);
  min-height: 0; /* Allow flex children to shrink */
}

/* ========================================
   CONTENT BODY RESPONSIVE TYPOGRAPHY SYSTEM
   ======================================== */

/* Typography hierarchy within content body */
.fd-content-body h1,
.fd-content-body .fd-page-title {
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--layout-gap-xs);
}

.fd-content-body h2,
.fd-content-body .fd-section-title {
  font-size: var(--font-size-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--layout-gap-sm);
}

.fd-content-body h3:not(.fd-chart-title) {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  margin-bottom: var(--layout-gap-xs);
}

.fd-content-body h4:not(.fd-metric-title) {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  margin-bottom: var(--layout-gap-xs);
}

.fd-content-body h5 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  margin-bottom: var(--inset-xs);
}

.fd-content-body h6 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--text-secondary);
  margin-bottom: var(--inset-xs);
}

.fd-content-body p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  margin-bottom: var(--layout-gap-sm);
}

.fd-content-body .fd-page-subtitle {
  font-size: var(--font-size-page-subtitle);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
  margin-bottom: var(--inset-sm);
}

/* ========================================
   CONTENT-BODY RESPONSIVE TYPOGRAPHY (§6)
   Single breakpoint set — mobile overrides only
   ======================================== */

/* Mobile: compact page title + aligned h5/h6 per TYPE-SPACE-POLICY §5 */
@media (max-width: 767px) {
  .fd-content-body h1,
  .fd-content-body .fd-page-title {
    font-size: var(--font-size-page-title);
    line-height: var(--line-height-tight);
    margin-bottom: var(--inset-sm);
  }

  .fd-content-body h2,
  .fd-content-body .fd-section-title {
    margin-bottom: var(--inset-sm);
  }

  .fd-content-body h4:not(.fd-metric-title) {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    margin-bottom: var(--inset-xs);
  }

  .fd-content-body h5 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    margin-bottom: var(--inset-xs);
  }

  .fd-content-body h6 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
    margin-bottom: var(--inset-xs);
  }

  .fd-content-body p {
    font-size: var(--nav-arrow-size);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--inset-sm);
  }

  .fd-content-body .fd-page-subtitle {
    margin-bottom: var(--inset-sm);
  }
}

/* Desktop: spacing tweaks only — sizes inherit base cascade */
@media (min-width: 768px) {
  .fd-content-body h1,
  .fd-content-body .fd-page-title,
  .fd-content-body h2,
  .fd-content-body .fd-section-title {
    margin-bottom: var(--inset-sm);
  }

  .fd-content-body h3,
  .fd-content-body h4 {
    margin-bottom: var(--inset-sm);
  }
}

/* ========================================
   CONTENT-BODY RESPONSIVE LAYOUT (§6)
   Shared organization — per-breakpoint padding/gap in sidebar blocks
   ======================================== */

@media (max-width: 767px) {
  .fd-content-body > * {
    width: 100%;
    margin-bottom: var(--inset-sm);
  }

  .fd-content-body > *:last-child {
    margin-bottom: 0;
  }

  .fd-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--inset-sm);
    margin-bottom: var(--inset-sm);
  }

  .fd-page-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: var(--inset-xs);
  }

  .fd-stats-section,
  .fd-datatable-section {
    margin-bottom: 0;
  }

  .fd-content-card {
    margin-bottom: var(--inset-sm);
  }

  .row {
    margin-left: calc(-0.5 * var(--inset-sm));
    margin-right: calc(-0.5 * var(--inset-sm));
  }

  .row > * {
    padding-left: calc(0.5 * var(--inset-sm));
    padding-right: calc(0.5 * var(--inset-sm));
    margin-bottom: var(--inset-sm);
  }
}

@media (min-width: 768px) {
  .fd-content-body > * {
    width: 100%;
    margin-bottom: var(--inset-sm);
  }

  .fd-content-body > *:last-child {
    margin-bottom: 0;
  }

  .fd-page-header {
    flex-direction: row;
    align-items: center;
    margin-bottom: var(--inset-sm);
  }

  .fd-page-actions {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: var(--inset-sm);
  }

  .fd-stats-section,
  .fd-datatable-section {
    margin-bottom: 0;
  }

  .fd-content-card {
    margin-bottom: var(--inset-sm);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .fd-page-header { gap: var(--inset-lg); }
  .fd-content-card { padding: var(--inset-2xl); }
  .row {
    margin-left: calc(-0.5 * var(--inset-lg));
    margin-right: calc(-0.5 * var(--inset-lg));
  }
  .row > * {
    padding-left: calc(0.5 * var(--inset-lg));
    padding-right: calc(0.5 * var(--inset-lg));
    margin-bottom: var(--inset-sm);
  }
}

@media (min-width: 992px) {
  .fd-page-header { gap: var(--inset-2xl); }
  .fd-content-card { padding: var(--layout-gap-lg); }
  .row {
    margin-left: calc(-0.5 * var(--inset-2xl));
    margin-right: calc(-0.5 * var(--inset-2xl));
  }
  .row > * {
    padding-left: calc(0.5 * var(--inset-2xl));
    padding-right: calc(0.5 * var(--inset-2xl));
    margin-bottom: var(--inset-sm);
  }
}

/* Per-breakpoint content-card padding on mobile */
@media (max-width: 575px) {
  .fd-content-card { padding: var(--inset-sm); }
}
@media (min-width: 576px) and (max-width: 767px) {
  .fd-content-card { padding: var(--inset-lg); }
}

/* Mobile shell controls — shared across ≤767px sidebar breakpoints */
@media (max-width: 767px) {
  .fd-mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
  }

  .fd-mobile-menu-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--interactive-primary);
  }

  .fd-sidebar-toggle {
    display: none;
  }

  .fd-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .fd-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .fd-content-footer {
    flex-direction: column;
    gap: var(--inset-sm);
    text-align: center;
  }
}

/* Text truncation utilities */
.fd-text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive line height utilities */
.fd-leading-tight { line-height: var(--line-height-tight); }
.fd-leading-normal { line-height: var(--line-height-normal); }
.fd-leading-relaxed { line-height: var(--line-height-relaxed); }

/* ========================================
   RESPONSIVE LAYOUT UTILITIES
   ======================================== */

/* Flexbox utilities */
.fd-flex { display: flex; }
.fd-flex-column { flex-direction: column; }
.fd-flex-row { flex-direction: row; }
.fd-flex-wrap { flex-wrap: wrap; }
.fd-flex-nowrap { flex-wrap: nowrap; }

/* Alignment utilities */
.fd-items-start { align-items: flex-start; }
.fd-items-center { align-items: center; }
.fd-items-end { align-items: flex-end; }
.fd-items-stretch { align-items: stretch; }

.fd-justify-start { justify-content: flex-start; }
.fd-justify-center { justify-content: center; }
.fd-justify-end { justify-content: flex-end; }
.fd-justify-between { justify-content: space-between; }
.fd-justify-around { justify-content: space-around; }

/* Gap utilities */
.fd-gap-xs { gap: var(--inset-xs); }
.fd-gap-sm { gap: var(--layout-gap-xs); }
.fd-gap-md { gap: var(--layout-gap-sm); }
.fd-gap-lg { gap: var(--layout-gap-md); }
.fd-gap-xl { gap: var(--layout-gap-lg); }

/* Width utilities */
.fd-w-full { width: 100%; }
.fd-w-auto { width: auto; }
.fd-min-w-0 { min-width: 0; }

/* Responsive visibility utilities */
.fd-hidden-mobile { display: block; }
.fd-visible-mobile { display: none; }

@media (max-width: 767px) {
  .fd-hidden-mobile { display: none; }
  .fd-visible-mobile { display: block; }
}

/* Content density utilities */
.fd-content-dense { gap: var(--layout-gap-xs); }
.fd-content-comfortable { gap: var(--layout-gap-md); }
.fd-content-spacious { gap: var(--layout-gap-lg); }

/* Tablet landscape and iPad portrait range */
@media (max-width: 62rem) { /* 992px */
  /* Make grids breathe a bit more and avoid overflow in 768-990 */
  .row.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
  .row.g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
}

/* Ensure children never overflow the content area */
.fd-content-body > * {
  max-width: 100%;
}

/* Tables/scrollable sections keep within content padding on small screens */
.fd-content-body .table-responsive,
.fd-content-body .fd-table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Page Header Section */
.fd-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--layout-gap-sm);
  padding-bottom: var(--inset-sm);
}

.fd-page-title-section {
  flex: 1;
}

.fd-page-title {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
  line-height: var(--line-height-tight);
}

.fd-breadcrumb-section {
  display: flex;
  align-items: center;
}

.fd-breadcrumb-section .breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
}

.fd-breadcrumb-section .breadcrumb-item {
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
}

.fd-breadcrumb-section .breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
}

.fd-breadcrumb-section .breadcrumb-item a:hover {
  color: var(--interactive-primary);
  text-decoration: underline;
}

.fd-breadcrumb-section .breadcrumb-item.active {
  color: var(--text-secondary);
}

/* Page Actions Section */
.fd-page-actions {
  display: flex;
  gap: var(--inset-sm);
    margin-bottom: var(--inset-sm);
  justify-content: flex-end;
}

/* Main Content */
.fd-main-content {
  flex: 1;
}

/* Optional white wrapper card - can be used for pages that need a single container */
.fd-content-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-01);
  padding: var(--layout-gap-lg);
  min-height: 400px;
}

/* Content Footer */
.fd-content-footer {
  background-color: var(--color-bpi-softblue);
  border-top: none;
  padding: var(--footer-padding-vertical) var(--shell-gutter-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fd-footer-left {
  flex: 1;
}

.fd-footer-text {
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  margin: 0;
}

.fd-footer-text a {
  color: var(--interactive-primary);
  text-decoration: none;
}

.fd-footer-text a:hover {
  text-decoration: underline;
}

.fd-footer-right {
  display: flex;
  align-items: center;
}

.fd-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--inset-lg);
}

.fd-footer-links li {
  margin: 0;
}

.fd-footer-links a {
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

.fd-footer-links a:hover {
  color: var(--interactive-primary);
}

/* ========================================
   COMPREHENSIVE SIDEBAR RESPONSIVE SYSTEM
   NO DEAD ZONES - COVERS ALL SCREEN SIZES
   ======================================== */

/* Extra Small Devices: 0px - 575px */
@media (max-width: 575px) {
  .fd-layout-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  
  .fd-layout-container.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  
  /* Mobile sidebar - hidden by default, shown when hamburger is clicked */
  .fd-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: var(--sidebar-mobile-max-width);
    height: 100vh;
    z-index: var(--sidebar-mobile-z-index);
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-03);
    transition: left var(--transition-normal);
    grid-row: unset;
    border-right: 1px solid var(--border-primary);
    border-bottom: none;
  }
  
  /* Mobile sidebar - shown when hamburger is clicked */
  .fd-sidebar.mobile-open {
    left: 0;
  }
  
  .fd-sidebar-collapsed {
    width: 100%;
    max-width: var(--sidebar-mobile-max-width);
  }
  
  .fd-content-area {
    grid-row: 1 / -1;
    width: 100%;
  }
  
  .fd-sidebar-header {
    padding: var(--header-padding-vertical) var(--shell-gutter-x);
  }
  
  /* Content Body Layout Structure - Mobile */
  .fd-content-body {
    font-size: var(--nav-arrow-size);
    line-height: var(--line-height-relaxed);
    flex-direction: column;
    min-height: auto;
    align-items: stretch;
  }
}

/* Small Devices: 576px - 767px */
@media (min-width: 576px) and (max-width: 767px) {
  .fd-layout-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  
  .fd-layout-container.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  
  /* Mobile sidebar - hidden by default, shown when hamburger is clicked */
  .fd-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    z-index: var(--z-modal);
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-03);
    transition: left var(--transition-normal);
    grid-row: unset;
    border-right: 1px solid var(--border-primary);
    border-bottom: none;
  }
  
  /* Mobile sidebar - shown when hamburger is clicked */
  .fd-sidebar.mobile-open {
    left: 0;
  }
  
  .fd-sidebar-collapsed {
    width: 280px;
  }
  
  .fd-content-area {
    grid-row: 1 / -1;
    width: 100%;
  }
  
  .fd-sidebar-header {
    padding: var(--header-padding-vertical) var(--shell-gutter-x);
  }
  
  /* Content Body Layout Structure - Small Mobile */
  .fd-content-body {
    font-size: var(--nav-arrow-size);
    line-height: var(--line-height-relaxed);
    flex-direction: column;
    min-height: auto;
    align-items: stretch;
  }
}

/* Desktop sidebar toggle — shared across ≥768px breakpoints */
@media (min-width: 768px) {
  .fd-mobile-menu-toggle {
    display: none;
  }

  .fd-sidebar-toggle {
    display: flex;
    left: var(--sidebar-width);
  }

  .fd-layout-container.sidebar-collapsed .fd-sidebar-toggle {
    left: var(--sidebar-width-collapsed);
  }
}

/* Medium Devices: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
  .fd-layout-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
  }
  
  .fd-layout-container.sidebar-collapsed {
    grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
  }
  
  /* Sidebar adjustments for medium screens */
  .fd-sidebar {
    width: 100%;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sidebar);
  }
  
  /* Content area adjustments */
  .fd-content-area {
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Content Body Layout Structure - Medium Devices */
  .fd-content-body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    flex-direction: column;
    min-height: 0;
    align-items: stretch;
  }
  
}

/* Large Devices: 992px - 1199px */
@media (min-width: 992px) and (max-width: 1199px) {
  .fd-layout-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
  }
  
  .fd-layout-container.sidebar-collapsed {
    grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
  }
  
  /* Sidebar adjustments for large screens */
  .fd-sidebar {
    width: 100%;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sidebar);
  }
  
  /* Content area adjustments */
  .fd-content-area {
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Content Body Layout Structure - Large Devices */
  .fd-content-body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    flex-direction: column;
    min-height: 0;
    align-items: stretch;
  }
  
}

/* Extra Large Devices: 1200px - 1399px */
@media (min-width: 1200px) and (max-width: 1399px) {
  .fd-layout-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
  }
  
  .fd-layout-container.sidebar-collapsed {
    grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
  }
  
  /* Sidebar adjustments for extra large screens */
  .fd-sidebar {
    width: 100%;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sidebar);
  }
  
  /* Content area adjustments */
  .fd-content-area {
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Content Body Layout Structure - Extra Large Devices */
  .fd-content-body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    flex-direction: column;
    min-height: 0;
    align-items: stretch;
  }
  
}

/* XXL Devices: 1400px+ */
@media (min-width: 1400px) {
  .fd-layout-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
  }
  
  .fd-layout-container.sidebar-collapsed {
    grid-template-columns: minmax(var(--sidebar-width-collapsed), var(--sidebar-width-collapsed)) 1fr;
  }
  
  /* Sidebar adjustments for XXL screens */
  .fd-sidebar {
    width: 100%;
    background-color: var(--bg-primary);
    
    box-shadow: var(--shadow-sidebar);
  }
  
  /* Content area adjustments */
  .fd-content-area {
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Content Body Layout Structure - XXL Devices */
  .fd-content-body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    flex-direction: column;
    min-height: 0;
    align-items: stretch;
  }
}

/* ========================================
   COMPREHENSIVE HEADER RESPONSIVE SYSTEM
   NO DEAD ZONES - COVERS ALL SCREEN SIZES
   ======================================== */

/* ========================================
   HEADER RESPONSIVE BREAKPOINTS - NO GAPS
   ======================================== */

/* Extra Small Devices: 0px - 575px */
@media (max-width: 575px) {
  .fd-content-header {
    flex-direction: row;
    gap: var(--shell-topbar-gap);
    min-height: var(--header-height);
    height: var(--header-height);
    align-items: center;
  }
  
  .fd-header-left {
    flex: 0 0 auto;
    justify-content: flex-start;
    order: 1;
    display: flex;
    align-items: center;
    gap: var(--inset-xs);
  }
  
  .fd-header-center {
    flex: 1;
    order: 2;
  }
  
  .fd-header-right {
    flex: 0 0 auto;
    justify-content: flex-end;
    order: 3;
    display: flex;
    align-items: center;
  }
  
  .fd-search-container {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: var(--inset-xs);
  }
  
  .fd-search-box {
    flex: 1;
    max-width: none;
  }
  
  .fd-search-input {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-xs) var(--inset-sm);
    width: 100%;
  }
  
  /* Move action buttons to search container */
  .fd-search-container .fd-action-buttons {
    flex-shrink: 0;
    margin-left: var(--inset-xs);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
    text-align: left;
  }
  
  .fd-action-buttons {
    flex-direction: row;
    gap: var(--inset-xs);
    align-items: center;
  }
  
  /* Force icon-only buttons on mobile */
  .fd-action-buttons .fd-btn {
    text-indent: -9999px; /* Hide text by moving it off-screen */
    white-space: nowrap;
    overflow: hidden;
  }
  
  .fd-action-buttons .fd-btn i,
  .fd-action-buttons .fd-btn .ti {
    text-indent: 0; /* Reset for icons */
    display: block;
  }
  
  .fd-btn:not(.fd-btn-icon-round):not(.fd-add-btn):not(.fd-map-view-btn) {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: var(--inset-xs);
    justify-content: center;
    font-size: var(--nav-arrow-size);
    border-radius: var(--radius-md);
  }
  
  .fd-btn:not(.fd-btn-icon-round) .btn-text,
  .fd-btn:not(.fd-btn-icon-round) span:not(.ti),
  .fd-btn:not(.fd-btn-icon-round):not(.ti),
  .fd-btn:not(.fd-btn-icon-round) *:not(.ti):not(i) {
    display: none; /* Hide all button text on mobile */
  }
  
  .fd-btn:not(.fd-btn-icon-round):not(.fd-add-btn):not(.fd-map-view-btn) {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: var(--inset-xs);
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Hide any overflow text */
  }
  
  .fd-btn i,
  .fd-btn .ti {
    display: block; /* Ensure icons are visible */
  }
  
  .fd-btn i {
    font-size: var(--font-size-base);
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-xs);
    align-items: center;
    justify-content: flex-end;
    min-width: auto;
    max-width: 60px; /* Limit width to just avatar + arrow */
  }
  
  .fd-user-info,
  .fd-user-name,
  .fd-user-email,
  .fd-user-role,
  .fd-user-details {
    display: none; /* Hide all user info text on mobile */
  }
  
  .fd-user-avatar {
    width: 32px;
    height: 32px;
    font-size: var(--nav-arrow-size);
    flex-shrink: 0;
  }
  
  .fd-user-dropdown,
  .fd-user-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
  }
  
  /* Ensure user profile stays horizontal on mobile */
  @media (max-width: 575px) {
    .fd-user-profile {
      flex-direction: row;
      align-items: center;
      gap: var(--inset-xs);
      max-width: 60px;
    }
  }
  
  .fd-user-button {
    font-size: var(--font-size-lg);
    padding: var(--inset-xs);
  }
  
  /* Mobile hamburger menu button */
  .fd-mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    cursor: pointer;
    padding: var(--inset-xs);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
  }
  
  .fd-mobile-menu-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--interactive-primary);
  }
  
  /* Hide desktop toggle button on mobile */
  .fd-sidebar-toggle {
    display: none;
  }
}

/* Small Devices: 576px - 767px */
@media (min-width: 576px) and (max-width: 767px) {
  .fd-content-header {
    flex-direction: row;
    gap: var(--shell-topbar-gap);
    min-height: var(--header-height);
    height: var(--header-height);
  }
  
  .fd-header-left {
    flex: 0 0 auto;
    order: 1;
  }
  
  .fd-header-center {
    flex: 1;
    order: 2;
  }
  
  .fd-header-right {
    flex: 0 0 auto;
    order: 3;
  }
  
  .fd-search-container {
    width: 100%;
    max-width: 250px;
  }
  
  .fd-search-box {
    width: 100%;
    max-width: 250px;
  }
  
  .fd-search-input {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
    text-align: left;
  }
  
  .fd-action-buttons {
    flex-direction: row;
    gap: var(--inset-sm);
    flex-wrap: wrap;
  }
  
  .fd-btn {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--inset-lg);
    min-width: auto;
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-user-info {
    align-items: flex-start;
    text-align: left;
  }
  
  .fd-user-name {
    font-size: var(--nav-arrow-size);
  }
  
  .fd-user-email,
  .fd-user-role {
    font-size: var(--font-size-xs);
  }
  
  .fd-user-button {
    font-size: var(--font-size-2xl);
    padding: var(--inset-sm);
  }
  
  /* Mobile hamburger menu button */
  .fd-mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--inset-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    margin-right: var(--inset-lg);
  }
  
  .fd-mobile-menu-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--interactive-primary);
  }
  
  /* Hide desktop toggle button on mobile */
  .fd-sidebar-toggle {
    display: none;
  }
}

/* Medium Devices: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
  .fd-content-header {
    flex-direction: row;
    gap: var(--shell-topbar-gap);
    min-height: var(--header-height);
    height: var(--header-height);
  }
  
  .fd-header-left {
    flex: 0 0 auto;
    order: 1;
  }
  
  .fd-header-center {
    flex: 1;
    order: 2;
  }
  
  .fd-header-right {
    flex: 0 0 auto;
    order: 3;
  }
  
  .fd-search-container {
    width: 100%;
    max-width: 300px;
  }
  
  .fd-search-box {
    width: 100%;
    max-width: 300px;
  }
  
  .fd-search-input {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
    text-align: left;
  }
  
  .fd-action-buttons {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-btn {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--inset-lg);
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-user-info {
    align-items: flex-start;
    text-align: left;
  }
  
  .fd-user-name {
    font-size: var(--nav-arrow-size);
  }
  
  .fd-user-email,
  .fd-user-role {
    font-size: var(--font-size-xs);
  }
  
  .fd-user-button {
    font-size: var(--font-size-2xl);
    padding: var(--inset-sm);
  }
  
  /* Hide mobile hamburger menu on medium screens */
  .fd-mobile-menu-toggle {
    display: none;
  }
  
  /* Show desktop sidebar toggle on medium screens */
  .fd-sidebar-toggle {
    display: flex;
  }
}

/* Large Devices: 992px - 1199px */
@media (min-width: 992px) and (max-width: 1199px) {
  .fd-content-header {
    flex-direction: row;
    gap: var(--shell-topbar-gap);
    min-height: var(--header-height);
    height: var(--header-height);
  }
  
  .fd-header-left {
    flex: 0 0 auto;
    order: 1;
  }
  
  .fd-header-center {
    flex: 1;
    order: 2;
  }
  
  .fd-header-right {
    flex: 0 0 auto;
    order: 3;
  }
  
  .fd-search-container {
    width: 100%;
    max-width: 320px;
  }
  
  .fd-search-box {
    width: 100%;
    max-width: 320px;
  }
  
  .fd-search-input {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
    text-align: left;
  }
  
  .fd-action-buttons {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-btn {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--inset-lg);
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-user-info {
    align-items: flex-start;
    text-align: left;
  }
  
  .fd-user-name {
    font-size: var(--nav-arrow-size);
  }
  
  .fd-user-email,
  .fd-user-role {
    font-size: var(--font-size-xs);
  }
  
  .fd-user-button {
    font-size: var(--font-size-2xl);
    padding: var(--inset-sm);
  }
  
  /* Hide mobile hamburger menu on large screens */
  .fd-mobile-menu-toggle {
    display: none;
  }
  
  /* Show desktop sidebar toggle on large screens */
  .fd-sidebar-toggle {
    display: flex;
  }
}

/* Extra Large Devices: 1200px - 1399px */
@media (min-width: 1200px) and (max-width: 1399px) {
  .fd-content-header {
    flex-direction: row;
    gap: var(--shell-topbar-gap);
    min-height: var(--header-height);
    height: var(--header-height);
  }
  
  .fd-header-left {
    flex: 0 0 auto;
    order: 1;
  }
  
  .fd-header-center {
    flex: 1;
    order: 2;
  }
  
  .fd-header-right {
    flex: 0 0 auto;
    order: 3;
  }
  
  .fd-search-container {
    width: 100%;
    max-width: 350px;
  }
  
  .fd-search-box {
    width: 100%;
    max-width: 350px;
  }
  
  .fd-search-input {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
    text-align: left;
  }
  
  .fd-action-buttons {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-btn {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--inset-lg);
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-user-info {
    align-items: flex-start;
    text-align: left;
  }
  
  .fd-user-name {
    font-size: var(--nav-arrow-size);
  }
  
  .fd-user-email,
  .fd-user-role {
    font-size: var(--font-size-xs);
  }
  
  .fd-user-button {
    font-size: var(--font-size-2xl);
    padding: var(--inset-sm);
  }
  
  /* Hide mobile hamburger menu on extra large screens */
  .fd-mobile-menu-toggle {
    display: none;
  }
  
  /* Show desktop sidebar toggle on extra large screens */
  .fd-sidebar-toggle {
    display: flex;
  }
}

/* XXL Devices: 1400px+ */
@media (min-width: 1400px) {
  .fd-content-header {
    flex-direction: row;
    gap: var(--shell-topbar-gap);
    min-height: var(--header-height);
    height: var(--header-height);
  }
  
  .fd-header-left {
    flex: 0 0 auto;
    order: 1;
  }
  
  .fd-header-center {
    flex: 1;
    order: 2;
  }
  
  .fd-header-right {
    flex: 0 0 auto;
    order: 3;
  }
  
  .fd-search-container {
    width: 100%;
    max-width: 400px;
  }
  
  .fd-search-box {
    width: 100%;
    max-width: 400px;
  }
  
  .fd-search-input {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--layout-gap-lg) var(--inset-sm) var(--inset-lg);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
    text-align: left;
  }
  
  .fd-action-buttons {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-btn {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-sm) var(--inset-lg);
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-sm);
  }
  
  .fd-user-info {
    align-items: flex-start;
    text-align: left;
  }
  
  .fd-user-name {
    font-size: var(--nav-arrow-size);
  }
  
  .fd-user-email,
  .fd-user-role {
    font-size: var(--font-size-xs);
  }
  
  .fd-user-button {
    font-size: var(--font-size-2xl);
    padding: var(--inset-sm);
  }
  
  /* Hide mobile hamburger menu on XXL screens */
  .fd-mobile-menu-toggle {
    display: none;
  }
  
  /* Show desktop sidebar toggle on XXL screens */
  .fd-sidebar-toggle {
    display: flex;
  }
}

/* ========================================
   HEADER ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus management for header - removed to prevent blue border on entire header */

/* Skip to main content - visually hidden until focused */
.fd-skip-to-main {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--interactive-primary);
  color: var(--text-inverse);
  padding: 8px 12px;
  text-decoration: none;
  border-radius: var(--radius-sm, 4px);
  z-index: 10000;
  font-weight: var(--font-weight-medium);
  transition: top 0.2s ease;
}

.fd-skip-to-main:focus {
  top: 6px;
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
}

/* Skip link for header navigation */
.fd-header-skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--interactive-primary);
  color: var(--text-inverse);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: var(--z-dropdown);
}

.fd-header-skip-link:focus {
  top: 6px;
}

/* High contrast mode support for header */
@media (prefers-contrast: high) {
  .fd-content-header {
    border-bottom: 2px solid var(--text-primary);
  }
  
  .fd-btn:hover,
  .fd-user-button:hover {
    background-color: var(--text-primary);
    color: var(--text-inverse);
  }
}

/* ========================================
   ADDITIONAL RESPONSIVE IMPROVEMENTS
   ======================================== */

/* Sidebar Toggle Button Responsive Positioning */
.fd-sidebar-toggle {
  position: fixed;
  top: calc(var(--header-height) / 2);
  left: var(--sidebar-width);
  transform: translate(-50%, -50%);
  z-index: var(--z-fixed);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: var(--nav-arrow-size);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--inset-xs);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.fd-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 1);
  color: var(--interactive-primary);
  box-shadow: var(--shadow-card-md);
}

/* Collapsed state positioning */
.fd-layout-container.sidebar-collapsed .fd-sidebar-toggle {
  left: var(--sidebar-width-collapsed);
}

/* Icon rotation for collapsed state */
.fd-toggle-icon {
  transition: transform var(--transition-normal);
}

.fd-layout-container.sidebar-collapsed .fd-toggle-icon {
  transform: rotate(180deg);
}

/* ========================================
   SIDEBAR CONTENT RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Navigation link responsive behavior */
@media (max-width: 575px) {
  .fd-nav-link {
    padding: var(--inset-sm) var(--inset-lg);
    margin: 0 var(--inset-sm) 4px var(--inset-sm);
    font-size: var(--nav-arrow-size);
  }
  
  .fd-nav-dropdown-trigger {
    padding: var(--inset-sm) var(--inset-lg);
    margin: 0 var(--inset-sm) 4px var(--inset-sm);
    font-size: var(--nav-arrow-size);
  }
  
  .fd-nav-section-title {
    font-size: var(--font-size-xs);
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .fd-nav-link {
    padding: var(--inset-sm) var(--inset-2xl);
    margin: 0 var(--inset-lg) var(--nav-item-margin-bottom) var(--inset-lg);
    font-size: var(--nav-arrow-size);
  }
  
  .fd-nav-dropdown-trigger {
    padding: var(--inset-sm) var(--inset-2xl);
    margin: 0 var(--inset-lg) var(--nav-item-margin-bottom) var(--inset-lg);
    font-size: var(--nav-arrow-size);
  }
}

/* ========================================
   GLOBAL SCROLLBAR — Pulse Pro style
   Thin, transparent track, pill thumb that reveals on hover.
   Thumb fades to 70% transparency when inactive, solid on hover.
   ======================================== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(115, 123, 139, 0.35);
  border-radius: var(--radius-full);
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(115, 123, 139, 0.6);
}
/* Firefox global — thin pill, no hover state support */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 123, 139, 0.35) transparent;
}

/* ========================================
   SIDEBAR OVERFLOW HANDLING
   ======================================== */

/* Ensure sidebar content doesn't overflow */
.fd-sidebar-content {
  overflow-y: auto;
  overflow-x: hidden;
}

/* ========================================
   SIDEBAR Z-INDEX MANAGEMENT
   ======================================== */

/* Ensure proper layering */
.fd-sidebar {
  z-index: var(--z-sticky);
}

.fd-sidebar.mobile-open {
  z-index: var(--z-modal);
}

.fd-mobile-overlay {
  z-index: calc(var(--z-modal) - 1);
}

.fd-sidebar-toggle {
  z-index: var(--z-fixed);
}

/* ========================================
   SIDEBAR ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus management for sidebar - removed outline to prevent border on click */

/* Skip link for sidebar navigation */
.fd-sidebar-skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--interactive-primary);
  color: var(--text-inverse);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: var(--z-dropdown);
}

.fd-sidebar-skip-link:focus {
  top: 6px;
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .fd-sidebar {
    border-right: 2px solid var(--text-primary);
  }
  
  .fd-nav-link:hover,
  .fd-nav-dropdown-trigger:hover {
    background-color: var(--text-primary);
    color: var(--text-inverse);
  }
}

@media (max-width: 36rem) {
  .fd-content-card {
    padding: var(--inset-lg);
  }
  
  .fd-page-title {
    font-size: var(--font-size-page-title);
  }
  
  .fd-header-right {
    gap: var(--inset-lg);
    align-items: stretch;
  }
  
  .fd-header-separator {
    display: none;
  }
  
  .fd-action-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .fd-btn:not(.fd-btn-icon-round):not(.fd-add-btn):not(.fd-map-view-btn) {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
  
  .fd-user-profile {
    flex-direction: row;
    gap: var(--inset-xs);
    align-items: center;
    max-width: 60px;
  }
  
  .fd-user-info {
    align-items: center;
  }
  
  .fd-search-container {
    width: 100%;
  }
  
  .fd-search-box {
    width: 100%;
    max-width: 200px;
  }
  
  .fd-search-input {
    font-size: var(--font-size-xs);
    padding: var(--inset-xs) var(--inset-lg) var(--inset-xs) var(--inset-sm);
  }
  
  /* Extra small mobile improvements */
  .fd-mobile-menu-toggle {
    font-size: var(--font-size-lg);
    padding: var(--inset-xs);
  }
  
  .fd-sidebar {
    width: 100%;
    max-width: var(--sidebar-mobile-max-width);
  }
  
  /* Mobile table improvements for very small screens */
  .table-responsive {
    border: none;
  }
  
  .table {
    font-size: var(--font-size-xs);
    min-width: 500px;
  }
  
  .table th,
  .table td {
    padding: var(--inset-xs);
    white-space: nowrap;
  }
  
  .table th {
    font-size: var(--font-size-xs);
    padding: var(--inset-xs) var(--inset-sm);
  }
  
  .table td {
    font-size: var(--font-size-xs);
    padding: var(--inset-xs) var(--inset-sm);
  }
  
  /* Mobile button sizing — form-control font-size moved to fd-forms.css (FORM-012) */
  .btn {
    font-size: var(--nav-arrow-size);
    padding: var(--inset-xs) var(--inset-sm);
  }
  
  /* Extra small mobile stat cards — layout-only (typography canonical: fd-components.css) */
  .fd-metric-card {
    margin-bottom: var(--inset-xs);
  }
  
  .fd-stat-icon {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-base);
  }
  
  /* Extra small mobile table actions */
  .fd-btn-sm {
    min-width: 28px;
    height: 28px;
    padding: var(--inset-xs);
  }
  
  .fd-btn-icon {
    width: 28px;
    height: 28px;
  }
  
  /* Extra small mobile DataTable controls */
  .dataTables_length select,
  .dataTables_filter input {
    font-size: var(--font-size-xs);
    padding: var(--inset-xs);
  }
  
  .dt-button {
    font-size: var(--font-size-xs);
    padding: var(--inset-xs);
  }
}

/* ========================================
   DROPDOWN STYLING - CLEAN IMPLEMENTATION
   ======================================== */

/* Clean dropdown styling without conflicts */

/* Select typography — canonical in fd-forms.css (FORM-012) */

/* ========================================
   UTILITY CLASSES
   ======================================== */

.fd-text-center {
  text-align: center;
}

.fd-text-left {
  text-align: left;
}

.fd-text-right {
  text-align: right;
}

/* ========================================
   FOCUS STATES FOR ACCESSIBILITY
   ======================================== */

/* Focus state for sidebar toggle */
.fd-sidebar-toggle:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  background: rgba(255, 255, 255, 1);
  color: var(--interactive-primary);
}

/* Focus state for mobile menu toggle */
.fd-mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  background-color: var(--bg-accent);
  color: var(--interactive-primary);
}

/* Focus state for logo link */
.fd-logo-link:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* Focus state for header user menu trigger */
.fd-user-button:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========================================
   LOADING AND DISABLED STATES
   ======================================== */

/* Loading state for navigation items */
.fd-nav-link.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.fd-nav-link.loading::after {
  content: '';
  position: absolute;
  right: var(--inset-sm);
  top: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-secondary);
  border-top: 2px solid var(--interactive-primary);
  border-radius: 50%;
  animation: fd-spin 1s linear infinite;
}

/* Disabled state for navigation items */
.fd-nav-link:disabled,
.fd-nav-dropdown-trigger:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ========================================
   SHELL-02 — App top bar (Pulse-like zones)
   Menu | context | spacer | search + user tile
   ======================================== */

.fd-content-header.fd-topbar {
  display: flex;
  align-items: center;
  gap: var(--shell-topbar-gap);
  padding: 0 var(--shell-gutter-x);
  min-height: var(--header-height);
  height: var(--header-height);
  flex-shrink: 0;
  box-shadow: none;
  border-bottom: none;
}

.fd-topbar-zone {
  display: flex;
  align-items: center;
  min-width: 0;
}

.fd-topbar-zone--menu {
  flex: 0 0 auto;
}

.fd-topbar-zone--context {
  flex: 0 1 auto;
  max-width: min(48vw, 520px);
  overflow: hidden;
}

.fd-topbar-spacer {
  flex: 1 1 auto;
  min-width: var(--shell-topbar-gap);
}

.fd-topbar-zone--tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--shell-topbar-gap);
  margin-left: auto;
}

/* Z2 — title stack */
.fd-topbar-title-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.fd-topbar-title {
  font-family: var(--font-family-primary);
  font-size: calc(var(--font-size-page-title) * 1.2);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.fd-topbar-subtitle {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Z2 — breadcrumb (Pulse Pro parity) */
.fd-topbar-breadcrumb {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.fd-breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
}

.fd-breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--inset-xs);
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.fd-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--inset-xs);
  min-width: 0;
}

.fd-breadcrumb-link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast, 150ms ease);
}

.fd-breadcrumb-link:hover {
  color: var(--interactive-primary);
}

.fd-breadcrumb-sep {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1;
}

.fd-breadcrumb-item .fd-topbar-title {
  flex: unset;
}

/* Z4 — search (right cluster) — blended ghost + control transitions */
.fd-topbar-search .fd-search-box {
  width: 240px;
  max-width: 240px;
}

.fd-topbar-search .fd-search-input,
.fd-skin.fd-shell-topbar .fd-content-header.fd-topbar .fd-topbar-search .fd-search-input {
  width: 100%;
  border: 1px solid transparent;
  background-color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  transition:
    border-color var(--transition-control),
    box-shadow var(--transition-control),
    background-color var(--transition-control);
}

.fd-topbar-search .fd-search-input:hover:not(:focus),
.fd-skin.fd-shell-topbar .fd-content-header.fd-topbar .fd-topbar-search .fd-search-input:hover:not(:focus) {
  border-color: var(--interactive-primary);
  background-color: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-01);
}

.fd-skin.fd-shell-topbar .fd-content-header.fd-topbar .fd-topbar-search .fd-search-input:focus {
  border: 1px solid var(--interactive-primary);
  background-color: rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.fd-topbar-search .fd-search-icon {
  transition: color var(--transition-control);
}

.fd-topbar-search .fd-search-box:hover .fd-search-icon,
.fd-topbar-search .fd-search-box:focus-within .fd-search-icon {
  color: var(--interactive-primary);
}

@media (prefers-reduced-motion: reduce) {
  .fd-page-chrome .fd-datatable-search input.fd-search-input,
  .fd-topbar-search .fd-search-input,
  .fd-skin.fd-shell-topbar .fd-content-header.fd-topbar .fd-topbar-search .fd-search-input,
  .fd-page-chrome .fd-btn.fd-add-btn {
    transition: none;
  }
}

/* Z4 — user tile */
.fd-user-tile {
  flex-shrink: 0;
}

.fd-user-tile.fd-user-profile {
  border-radius: var(--radius-full);
  background-color: var(--bg-primary);
  padding: 2px 4px 2px 2px;
  gap: var(--inset-sm);
}

@media (max-width: 991.98px) {
  .fd-topbar-zone--context {
    max-width: min(36vw, 280px);
  }

  .fd-topbar-search .fd-search-box {
    width: 160px;
    max-width: 160px;
  }

  .fd-user-tile .fd-user-email,
  .fd-user-tile .fd-user-role {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .fd-content-header.fd-topbar {
    gap: var(--inset-sm);
    padding: 0 var(--shell-gutter-x);
  }

  .fd-topbar-subtitle {
    display: none;
  }

  .fd-topbar-zone--context {
    max-width: 42vw;
  }

  .fd-topbar-search .fd-search-box {
    width: 120px;
    max-width: 120px;
  }

  .fd-user-tile .fd-user-info {
    display: none;
  }

  .fd-user-tile.fd-user-profile {
    padding: 2px;
    background: transparent;
  }
}

