/* =================================================================
   Header Component
   Mobile-first. Desktop nav hidden by default; hamburger visible.
   ================================================================= */

/* ---- Header bar ---- */
.header {
  width: 100%;
  position: relative;
  z-index: 50;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
}

/* ---- Logo ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.logo__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background-color: oklch(0.78 0.14 175 / 20%);
}

.logo__diamond {
  width: 0.75rem;
  height: 0.75rem;
  transform: rotate(45deg);
  background-color: var(--primary);
}

.logo__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.logo__text span {
  color: var(--primary);
}

/* ---- Desktop nav ---- */
.header__nav {
  display: none;
  align-items: center;
  gap: 2.5rem;
}

.header__nav a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  transition: color 0.15s;
}

.header__nav a:hover,
.header__nav a.is-active {
  color: var(--primary);
}

/* ---- Header actions (right side) ---- */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-dashboard {
  display: none;
  border-radius: var(--radius-md);
  border: 1px solid oklch(0.18 0.02 260 / 80%);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  transition: background-color 0.15s, color 0.15s;
}

.btn-dashboard:hover {
  background-color: var(--foreground);
  color: var(--background);
}

.shield-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  flex-shrink: 0;
}

/* ---- Hamburger button ---- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  padding: 0.3rem;
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--foreground);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile nav overlay ---- */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav__link {
  display: block;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  transition: color 0.15s;
}

.mobile-nav__link:hover,
.mobile-nav__link.is-active {
  color: var(--primary);
}

.mobile-nav__dashboard {
  display: block;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid oklch(0.18 0.02 260 / 80%);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: var(--foreground);
  transition: background-color 0.15s, color 0.15s;
}

.mobile-nav__dashboard:hover {
  background-color: var(--foreground);
  color: var(--background);
}

/* ---- Responsive: sm 480 px+ ---- */
@media (min-width: 480px) {
  .header__inner {
    padding: 0;
  }

  .logo__text {
    font-size: 1.125rem;
  }
}

/* ---- Responsive: md 768 px+ ---- */
@media (min-width: 768px) {
  .header__inner {
    padding: 1.5rem 0;
  }

  .logo__text {
    font-size: 1.25rem;
  }

  .header__nav {
    display: flex;
  }

  .btn-dashboard {
    display: inline-flex;
  }

  .hamburger {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }
}
