/* HeaderBar desktop normalization (Dashboard is the standard) */

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* HeaderBar surface should not depend on Tailwind utility classes */
header.mobile-header-style {
  background: #ffffff;
}

/* Minimal Tailwind utility replacements for HeaderBar markup (so ZIP/dividers/user cluster work without Tailwind) */
header.mobile-header-style .flex { display: flex; }
header.mobile-header-style .items-center { align-items: center; }
header.mobile-header-style .flex-col { flex-direction: column; }
header.mobile-header-style .justify-between { justify-content: space-between; }
header.mobile-header-style .gap-2 { gap: 8px; }
header.mobile-header-style .gap-4 { gap: 16px; }
header.mobile-header-style .me-3 { margin-right: 12px; }

header.mobile-header-style .rounded-full { border-radius: 9999px; }
header.mobile-header-style .border { border: 1px solid #d1d5db; }
header.mobile-header-style .border-gray-300 { border-color: #d1d5db; }
header.mobile-header-style .border-l { border-left: 1px solid #d1d5db; }
header.mobile-header-style .h-5 { height: 20px; }
header.mobile-header-style .px-3 { padding-left: 12px; padding-right: 12px; }
header.mobile-header-style .py-2 { padding-top: 8px; padding-bottom: 8px; }
header.mobile-header-style .bg-white { background: #ffffff; }

header.mobile-header-style .text-gray-400 { color: #9ca3af; }
header.mobile-header-style .text-gray-700 { color: #374151; }
header.mobile-header-style .text-stone-950 { color: #0c0a09; }
header.mobile-header-style .text-stone-800 { color: #292524; }
header.mobile-header-style .text-sm { font-size: 14px; line-height: 20px; }
header.mobile-header-style .text-base { font-size: 16px; line-height: 24px; }
header.mobile-header-style .font-semibold { font-weight: 600; }
header.mobile-header-style .capitalize { text-transform: capitalize; }

header.mobile-header-style .block { display: block; }
header.mobile-header-style .hidden { display: none; }
@media (min-width: 768px) {
  header.mobile-header-style .md\:hidden { display: none !important; }
}

/* Container/layout utilities used by _HeaderBar markup */
header.mobile-header-style .mx-auto { margin-left: auto; margin-right: auto; }
header.mobile-header-style .gap-8 { gap: 32px; }
header.mobile-header-style .px-4 { padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) {
  header.mobile-header-style .sm\:px-6 { padding-left: 24px; padding-right: 24px; }
  header.mobile-header-style .sm\:gap-6 { gap: 24px; }
  header.mobile-header-style .sm\:flex { display: flex; }
}
@media (min-width: 1024px) {
  header.mobile-header-style .lg\:px-8 { padding-left: 32px; padding-right: 32px; }
}

/* HeaderBar user cluster (canonical avatar sizing, avoid page-specific overrides) */
header.mobile-header-style .user-photo {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: #9ca3af;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
}

header.mobile-header-style .user-photo .material-symbols-outlined { font-size: 20px; }

/* Match existing mobile behavior: hide the name block on small screens */
@media (max-width: 500px) {
  header.mobile-header-style .hide-name-mobile { display: none; }
  header.mobile-header-style .user-photo { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
  header.mobile-header-style .me-3 { margin-right: 0; }
}

/* HeaderBar apps icon (keep consistent across pages) */
header.mobile-header-style .fbo-settings-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #25293A;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* HeaderBar user dropdown (mirrors settings dropdown pattern) */
header.mobile-header-style .header-user-menu { position: relative; }

header.mobile-header-style .user-menu-trigger {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

header.mobile-header-style .user-dropdown {
  z-index: 100001;
  display: none;
  top: 50px;
  right: 0;
  min-width: 260px;
  gap: 10px;
  width: auto;
  max-width: 320px;
  max-height: 500px;
  color: black;
  padding: 15px;
  border: 1px #d6d6d6 solid;
  background: white;
  border-radius: 10px;
  position: absolute;
  margin-top: 5px;
  overflow: hidden;
}

header.mobile-header-style .user-dropdown.show-now { display: flex !important; flex-direction: column; }

header.mobile-header-style .user-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 6px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -15px -15px 10px;
}

header.mobile-header-style .user-dropdown-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #fecaca;
  background-color: #fee2e2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  gap: 6px;
  white-space: nowrap;
}

header.mobile-header-style .user-dropdown-logout .material-symbols-outlined { font-size: 18px; }

header.mobile-header-style .user-dropdown-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #374151;
  border-radius: 6px;
  line-height: 0;
}

header.mobile-header-style .user-dropdown-close:hover {
  background: #f3f4f6;
  color: #111;
}

header.mobile-header-style .user-dropdown-close .material-symbols-outlined { font-size: 22px; }

header.mobile-header-style .user-menu {
  color: black;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

header.mobile-header-style .user-dropdown a { white-space: nowrap; }

/* HeaderBar settings dropdown (normalize spacing/sizing regardless of page-level CSS) */
header.mobile-header-style #drop-settings { position: relative; }

header.mobile-header-style .settings-dropdown {
  z-index: 100001;
  display: none;
  top: 50px;
  right: 0;
  min-width: 260px;
  gap: 10px;
  width: auto;
  max-width: 320px;
  max-height: 500px;
  color: black;
  padding: 15px;
  border: 1px #d6d6d6 solid;
  background: white;
  border-radius: 10px;
  position: absolute;
  margin-top: 5px;
  overflow: hidden;
}

header.mobile-header-style .settings-dropdown.show-now {
  display: flex !important;
  flex-direction: column;
}

header.mobile-header-style .settings-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 6px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -15px -15px 10px;
}

header.mobile-header-style .settings-menu {
  color: black;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

header.mobile-header-style .settings-dropdown a { white-space: nowrap; }

header.mobile-header-style .settings-dropdown-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #374151;
  border-radius: 6px;
  line-height: 0;
}

header.mobile-header-style .settings-dropdown-close:hover {
  background: #f3f4f6;
  color: #111;
}

header.mobile-header-style .settings-dropdown-close .material-symbols-outlined { font-size: 22px; }

/* Canonical HeaderBar logo (shared across Dashboard / Start / WD; overrides site.css 150px img) */
header.mobile-header-style .desking-logo {
  text-decoration: none;
  color: var(--accent-btn-color, #3455ff);
  cursor: pointer;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 230px;
  max-width: 100%;
  height: auto;
  padding: 10px 15px;
  margin-left: 0;
  justify-content: center;
}

header.mobile-header-style .desking-logo img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 768px) {
  /* Desktop grid layout: Left | Center | Right */
  header.mobile-header-style .header-mobile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    position: relative;
    height: fit-content;
    max-height: 80px;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
  }

  /* Promote hb-center / hb-right into the parent grid */
  header.mobile-header-style .header-column-mobile {
    display: contents;
  }

  /* Divider on .hb-left: a sibling <span> was a 4th grid item and stretched across the 1fr column */
  header.mobile-header-style .hb-left {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    border-right: 2px solid #d1d5db;
  }

  header.mobile-header-style .hb-center {
    grid-column: 2;
    min-width: 0;
    width: 100%;
  }

  header.mobile-header-style .hb-right {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
  }

  /* Replace inline-centered logo behavior with a class */
  header.mobile-header-style .hb-center-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  header.mobile-header-style .desking-logo-mobile {
    display: none;
  }

  /* Desktop: hide the mobile-only cluster (apps/user/back near the mobile logo) */
  header.mobile-header-style .mobile-logo-area {
    display: none;
  }

  /* Back button near logo (desktop only) */
  header.mobile-header-style .header-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #111827;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
  }

  /* Middle section fills available space */
  header.mobile-header-style .hb-center .top-container {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }

  header.mobile-header-style .hb-center #free-text-w {
    flex: 1 1 auto;
    width: 100%;
    max-width: 760px;
    min-width: 260px;
  }

  header.mobile-header-style .hb-center #free-text {
    width: 100%;
  }

  header.mobile-header-style .search-anything-input {
    width: 100%;
  }

  header.mobile-header-style .top-container {
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
  }

  /* Right cluster: keep aligned and prevent wrapping */
  header.mobile-header-style .login-zip-mobile {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  /* Responsive priority: keep one row by hiding center extras first */
  @media (max-width: 1180px) {
    header.mobile-header-style #header-filter-tabs {
      display: none !important;
    }
  }

  @media (max-width: 1040px) {
    header.mobile-header-style .hb-center .number-container,
    header.mobile-header-style .hb-center .results-inventory-buttons {
      display: none !important;
    }
  }

  @media (max-width: 940px) {
    header.mobile-header-style .hb-center .go-button,
    header.mobile-header-style .hb-center .go-button-results {
      display: none !important;
    }
  }

  /* Canonical settings dropdown sizing for HeaderBar pages (fixed height requirement) */
  header.mobile-header-style #drop-settings > .settings-dropdown {
    height: 800px;
  }
}

/* ------------------------------------------------------------
   Global page layout normalization for HeaderBar pages
   (replicates the pattern introduced in users.css)
   ------------------------------------------------------------ */

/* HeaderBar renders inside #main; keep header full-width */
body.use-headerbar #main {
  padding: 0 !important;
}

/* Restore page-side padding for normal content beneath the header.
   Exclude full-screen overlays/modals which must remain edge-to-edge. */
body.use-headerbar #main > h2,
body.use-headerbar #main > div:not(.flyer-modal-overlay):not(.overlay):not(.dialog):not(#modalBackdrop):not(#jobHistoryModal):not(#app-modal-overlay) {
  padding-left: 40px;
  padding-right: 40px;
}

/* Match HeaderBar horizontal rhythm on smaller screens */
@media (max-width: 640px) {
  body.use-headerbar #main > h2,
  body.use-headerbar #main > div:not(.flyer-modal-overlay):not(.overlay):not(.dialog):not(#modalBackdrop):not(#jobHistoryModal):not(#app-modal-overlay) {
    padding-left: 0px;
    padding-right: 0px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  body.use-headerbar #main > h2,
  body.use-headerbar #main > div:not(.flyer-modal-overlay):not(.overlay):not(.dialog):not(#modalBackdrop):not(#jobHistoryModal):not(#app-modal-overlay) {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ============================================================
   Mobile Header Layout (≤500px)
   ============================================================ */
@media (max-width: 500px) {
  /* Header container: simple 2-column layout (logo + hamburger) */
  header.mobile-header-style .header-mobile {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    height: auto !important;
    max-height: none !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    gap: 0 !important;
  }
  
  /* Left side: logo + spacer to push hamburger right */
  header.mobile-header-style .hb-left {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-right: none !important;
    min-width: auto !important;
    gap: 0 !important;
    flex: 1 1 auto !important;
    width: 100% !important;
  }
  
  header.mobile-header-style .desking-logo {
    display: flex !important;
    width: 160px !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
  }
  
  /* Hide desktop-only elements on mobile */
  header.mobile-header-style .header-back,
  header.mobile-header-style .hb-center,
  header.mobile-header-style .hb-right,
  header.mobile-header-style .header-column-mobile,
  header.mobile-header-style .mobile-logo-area,
  header.mobile-header-style .login-zip-mobile,
  header.mobile-header-style .zip-code-div,
  header.mobile-header-style #drop-settings,
  header.mobile-header-style #drop-user,
  header.mobile-header-style .button-header,
  header.mobile-header-style .filters-clear {
    display: none !important;
  }
  
  /* Mobile hamburger button - right aligned */
  header.mobile-header-style .mobile-hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }
  
  header.mobile-header-style .mobile-hamburger-btn .material-symbols-outlined {
    font-size: 24px;
    color: #374151;
  }
  
  header.mobile-header-style .mobile-hamburger-btn:hover {
    background: #e5e7eb;
  }
}

/* Hide hamburger on desktop (>500px) */
@media (min-width: 501px) {
  header.mobile-header-style .mobile-hamburger-btn {
    display: none !important;
  }
}

/* ============================================================
   Mobile Menu Overlay
   ============================================================ */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100002;
  background: rgba(0, 0, 0, 0.5);
}

.mobile-menu-overlay.show {
  display: flex;
  justify-content: flex-end;
}

.mobile-menu-panel {
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #374151;
}

.mobile-menu-close:hover {
  background: #f3f4f6;
}

.mobile-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.mobile-menu-section {
  margin-bottom: 24px;
}

.mobile-menu-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-links a {
  display: block;
  padding: 12px 16px;
  color: #111827;
  text-decoration: none;
  font-size: 15px;
  border-radius: 8px;
  transition: background 0.15s;
}

.mobile-menu-links a:hover {
  background: #f3f4f6;
}

/* Hide empty sections */
.mobile-menu-section:has(.mobile-menu-links:empty) {
  display: none;
}

.mobile-menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  gap: 12px;
}

.mobile-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 9999px;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.mobile-logout-btn:hover {
  background: #fecaca;
}

.mobile-logout-btn .material-symbols-outlined {
  font-size: 18px;
}

.mobile-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.mobile-profile-btn:hover {
  background: #f3f4f6;
}

.mobile-profile-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Hide mobile menu on desktop */
@media (min-width: 501px) {
  .mobile-menu-overlay {
    display: none !important;
  }
}

