:root {
  --nl-primary: #082579;
  --nl-primary-dark: #082579;
  --nl-accent: #3b7ddd;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo:hover {
  opacity: 0.9;
  color: inherit;
  text-decoration: none !important;
}

.brand-name {
  font-size: 1.3rem;
  line-height: 1.15;
  text-decoration: none;
}

.brand-name-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.nav-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-main .nav-link {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: #475569;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-main .nav-link:hover {
  color: var(--nl-primary);
  background: #f1f5f9;
}

.nav-main .nav-link.active {
  color: var(--nl-primary);
  background: #eff6ff;
  font-weight: 600;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-chevron,
.nav-dropdown:hover .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown.is-active > .nav-dropdown-toggle,
.nav-dropdown.is-open > .nav-dropdown-toggle {
  color: var(--nl-primary);
  background: #eff6ff;
  font-weight: 600;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 12.5rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1040;
}

.nav-dropdown.is-open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown-link .ti {
  font-size: 1rem;
  color: #64748b;
}

.nav-dropdown-link:hover {
  color: var(--nl-primary);
  background: #f8fafc;
  text-decoration: none;
}

.nav-dropdown-link:hover .ti {
  color: var(--nl-primary);
}

.nav-dropdown-link.active {
  color: var(--nl-primary);
  background: #eff6ff;
  font-weight: 600;
}

.nav-dropdown-link.active .ti {
  color: var(--nl-primary);
}

.nav-dropdown-link--disabled {
  cursor: default;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}

.nav-dropdown-link--disabled .ti {
  color: #94a3b8;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.btn-login-header {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--nl-primary) !important;
  border: 2px solid var(--nl-primary);
  background: #fff;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-login-header:hover {
  background: #eff6ff;
  color: var(--nl-primary-dark) !important;
}

.btn-trial-header {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--nl-primary), var(--nl-accent));
  border: none;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(30, 77, 140, 0.35);
}

.btn-trial-header:hover {
  color: #fff;
}

.admin-subnav {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.admin-subnav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0;
}

.admin-subnav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
}

.admin-subnav .nav-link:hover {
  background: #eff6ff;
  color: var(--nl-primary);
}

.admin-subnav .nav-link.active {
  background: #dbeafe;
  color: var(--nl-primary-dark);
  font-weight: 600;
}

.layout-superadmin .page-wrapper {
  margin-left: 0 !important;
  padding-left: 0 !important;
  width: 100%;
}

.layout-superadmin .app-mobile-topbar {
  display: none !important;
}

.superadmin-crm-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.superadmin-crm-bar .chapter-switcher-select {
  min-width: 12rem;
  max-width: 18rem;
}

.admin-subnav-switcher {
  border-top: 1px solid #e2e8f0;
}

.chapter-switcher-form .chapter-switcher-select {
  min-width: 11rem;
  max-width: 16rem;
}

@media (max-width: 991px) {
  .header-nav-wrap {
    width: 100%;
    order: 3;
  }

  .nav-main {
    justify-content: center;
    width: 100%;
    padding-top: 0.5rem;
  }

  .nav-dropdown {
    position: static;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 0.25rem;
    box-shadow: none;
    transform: none;
    display: none;
  }

  .nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .nav-dropdown:hover .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown.is-open:hover .nav-dropdown-menu {
    display: block;
  }

  .nav-actions {
    width: 100%;
    justify-content: center;
    padding-bottom: 0.25rem;
  }
}
