/* ==========================================================================
   Elevaan Network Ã¢â‚¬â€ Site Header
   ========================================================================== */

  /* Fixed wrapper so header can show/hide mid-page (sticky can't — parent is short) */
  #site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.28s ease;
    will-change: transform;
  }

  #site-header.is-hidden {
    transform: translateY(-100%);
  }

  body {
    padding-top: var(--header-height);
  }

   .site-header {
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    top: auto;
    z-index: 1;
    transition: box-shadow 0.28s ease, border-bottom-color 0.28s ease;
  }

  .site-header.is-scrolled {
    border-bottom-color: transparent;
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.08);
  }
  
  .header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: var(--header-height);
    position: relative;
    color: var(--color-header-text);
  }
  
  /* Logo */
  
  .logo {
    display: inline-flex;
    align-items: center;
    color: var(--color-header-text);
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
  }

  .logo-img {
    display: block;
    width: 130px;
    height: 29px;
    object-fit: contain;
    object-position: left center;
  }

  .logo-text {
    display: inline-block;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--color-header-text);
    white-space: nowrap;
  }

  .logo-text[hidden],
  .logo-img[hidden] {
    display: none !important;
  }
  
  /* Collapsible wrapper (search + nav) */
  
  .header-collapsible {
    display: flex;
    align-items: center;
    align-self: stretch;
    gap: 24px;
    flex: 1;
    min-width: 0;
  }
  
  /* Search */
  
  .header-search {
    flex: 1;
    max-width: 410px;
    display: flex;
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background: #f0f2f5;
  }

  .header-search--suggest {
    overflow: visible;
  }

  .header-search:has(.header-suggest:not([hidden])) {
    border-bottom: none;
  }
  
  .header-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    background: transparent;
    color: var(--color-text);
    font-weight: 500;
    border-radius: 0;
  }

  .header-search-input::placeholder {
    color: #6b7280;
  }
  
  .header-search-btn {
    background: transparent;
    border: none;
    width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1c1c1d;
    border-radius: 0;
  }

  .header-search-btn svg {
    width: 22px;
    height: 22px;
  }
  
  .header-search-btn:hover {
    background: transparent;
    color: #000;
    opacity: 0.75;
  }

  .header-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 44px;
    z-index: 120;
    background: #fff;
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
  }

  .header-suggest[hidden] {
    display: none;
  }

  .header-suggest-empty {
    padding: 14px 12px;
    font-size: 13px;
    color: #667085;
  }

  .header-suggest-item {
    width: 100%;
    display: block;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 11px 12px;
    cursor: pointer;
    color: #16181c;
    font-family: var(--font-sans);
  }

  .header-suggest-item:hover,
  .header-suggest-item.is-active {
    background: #f5f6f8;
  }

  .header-suggest-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #16181c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Nav */
  
  .header-nav {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 40px;
    margin-left: auto;
    white-space: nowrap;
    height: 100%;
  }
  
  .nav-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-header-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    padding: 0;
    margin: 0;
    height: 40px;
    line-height: 1;
    vertical-align: middle;
    text-decoration: none;
    box-sizing: border-box;
  }
  
  .nav-link:hover {
    color: var(--color-primary);
  }
  
  .nav-divider {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: #c5c6c9;
    flex-shrink: 0;
    align-self: center;
    margin: 0;
  }
  
  /* Hard chevron — same style as slider arrows */
  .nav-dropdown-toggle .chevron {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    margin-top: 0;
    border-right: 2px solid var(--color-header-text);
    border-bottom: 2px solid var(--color-header-text);
    transform: rotate(45deg);
    transition: transform 0.15s ease, border-color 0.15s ease;
  }
  
  .nav-dropdown-toggle:hover .chevron {
    border-color: currentColor;
  }
  
  .nav-dropdown.open .chevron {
    margin-top: 0;
    transform: rotate(225deg);
  }
  
  .nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    align-self: center;
    height: 40px;
  }
  
  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 60;
  }
  
  .nav-dropdown.open .nav-dropdown-menu {
    display: flex;
  }
  
  .nav-dropdown-menu a {
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1d;
    transition: color 0.15s ease;
  }
  
  .nav-dropdown-menu a:hover {
    background: transparent;
    color: var(--color-primary);
  }

  .nav-dropdown-highlight {
    font-weight: 700;
    color: #1c1c1d;
  }

  .nav-dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--color-border);
  }

  .nav-dropdown-action {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1d;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease;
  }

  .nav-dropdown-action:hover {
    color: var(--color-primary);
  }

  .nav-dropdown-action.nav-signout,
  #navSignOut {
    color: #dc2626;
    font-weight: 600;
  }

  .nav-dropdown-action.nav-signout:hover,
  #navSignOut:hover {
    color: #b91c1c;
  }

  .nav-account .nav-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
  }

  .header-auth-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
  }

  .nav-account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    min-width: 0;
    min-height: 40px;
    border-radius: 0;
  }

  .nav-account-toggle .chevron {
    display: none !important;
  }

  .nav-account-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--color-header-text);
    line-height: 1.2;
  }

  .nav-account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
    display: block;
    border: none;
  }

  /* ---- Header notifications (admin-style) ---- */

  .nav-notify {
    position: relative;
  }

  .nav-notify-btn {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #1c1c1d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .nav-notify-btn:hover,
  .nav-notify-btn[aria-expanded="true"] {
    background: #000;
  }

  .nav-notify-icon {
    display: block;
    width: 18px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 1;
  }

  .nav-notify-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #1c1c1d;
    box-sizing: border-box;
  }

  .nav-notify-badge[hidden] {
    display: none !important;
  }

  .nav-notify-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    max-height: min(420px, 70vh);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
    z-index: 90;
    overflow: hidden;
  }

  .nav-notify-panel[hidden] {
    display: none !important;
  }

  .nav-notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
  }

  .nav-notify-head strong {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
  }

  .nav-notify-mark {
    border: none;
    background: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
  }

  .nav-notify-mark:hover {
    text-decoration: underline;
  }

  .nav-notify-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
  }

  .nav-notify-empty {
    padding: 28px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
  }

  .nav-notify-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.12s ease;
  }

  .nav-notify-item:hover {
    background: #f9fafb;
  }

  .nav-notify-item.is-unread {
    background: #f5f8ff;
  }

  .nav-notify-type {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: #8b5cf6;
  }

  .nav-notify-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .nav-notify-body strong {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
  }

  .nav-notify-body span {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nav-notify-body time {
    font-size: 11px;
    color: #9ca3af;
  }

  /* CSS display rules override native [hidden] — force hide */
  .header-nav [data-header-guest].header-auth-hidden,
  .header-nav [data-header-auth].header-auth-hidden,
  .header-nav [data-header-guest][hidden],
  .header-nav [data-header-auth][hidden] {
    display: none !important;
  }

  .btn-join,
  .btn.btn-dark.btn-join {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    min-width: 88px;
    height: 40px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #1f1f1f;
    border: none;
    border-radius: var(--radius-btn);
    line-height: 1;
    transition: background-color 0.15s ease;
    box-sizing: border-box;
  }

  .btn-join:hover,
  .btn.btn-dark.btn-join:hover {
    background: #4b5563;
    color: #fff;
  }
  
  /* Burger (mobile) */

  .header-mobile-actions {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-mobile-account {
    display: none;
    position: relative;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
  }

  .header-mobile-account[hidden],
  .header-mobile-account.header-auth-hidden {
    display: none !important;
  }

  .header-mobile-avatar {
    display: block;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
  }

  .header-mobile-account .nav-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
    top: calc(100% + 8px);
  }

  .header-mobile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #e5e7eb;
  }

  .header-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 28px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0;
    flex-shrink: 0;
    padding: 0;
  }
  
  .header-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-header-text);
    border-radius: 1px;
  }
  
  /* ---- Responsive ---- */
  
  @media (max-width: 900px) {
    .header-mobile-actions {
      display: flex;
    }

    .header-burger {
      display: flex;
    }

    .header-mobile-account:not([hidden]):not(.header-auth-hidden) {
      display: flex;
    }

    .nav-account-name {
      display: none !important;
    }

    .header-collapsible .header-auth-tools,
    .header-collapsible .nav-account {
      display: none !important;
    }

    .header-collapsible {
      display: none;
    }
  
    .header-collapsible.open {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 16px;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--color-header-bg);
      border-bottom: 1px solid var(--color-border);
      padding: 18px var(--container-pad) 22px;
      box-shadow: var(--shadow-md);
    }
  
    .header-collapsible.open .header-search {
      max-width: none;
    }

    .header-search-input {
      flex: 1;
      min-width: 0;
      border: none;
      outline: none;
      padding: 12px 14px;
      font-size: 15px;
      font-family: var(--font-sans);
      background: transparent;
      font-weight: 500;
      border-radius: 0;
    }

    .header-collapsible.open .header-nav {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 4px;
      margin-left: 0;
      width: 100%;
      height: auto;
      white-space: normal;
    }

    .header-collapsible.open .nav-link {
      justify-content: flex-start;
      align-items: center;
      width: 100%;
      height: auto;
      min-height: 44px;
      font-size: 18px;
      font-weight: 600;
      padding: 8px 0;
    }

    .header-collapsible.open .nav-divider {
      display: none;
    }

    .header-collapsible.open .theme-toggle,
    .header-collapsible .theme-toggle--nav {
      display: none !important;
    }

    .header-collapsible.open .btn-join,
    .header-collapsible.open .btn.btn-dark.btn-join {
      align-self: flex-start;
      margin-top: 6px;
      font-size: 15px;
      min-height: 44px;
      padding: 10px 18px;
    }

    .header-collapsible.open .nav-dropdown {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      align-self: stretch;
      width: 100%;
      height: auto;
    }

    .header-collapsible.open .nav-dropdown-toggle .chevron {
      width: 9px;
      height: 9px;
    }

    .header-collapsible.open .nav-dropdown-menu {
      position: static;
      box-shadow: none;
      border: none;
      margin: 0 0 6px;
      padding: 0 0 0 12px;
      width: 100%;
      min-width: 0;
      background: transparent;
    }

    .header-collapsible.open .nav-dropdown-menu a {
      padding: 10px 0;
      font-size: 16px;
    }
  }
  