/* ── App Header ── Two-tier professional header ── */

.ah-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid var(--border);
}

/* ── Tier 1: Top Bar ── */
.ah-topbar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  gap: 8px;
  max-width: 1280px;
  margin: 0 auto;
}

.ah-topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.ah-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.ah-site-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

/* ── Navigation ── */
.ah-topbar__center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.ah-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}

.ah-nav__item {
  position: relative;
}

.ah-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.ah-nav__link:hover {
  background: rgba(232, 101, 26, 0.07);
  color: var(--primary);
}

.ah-nav__link--active {
  color: var(--primary);
  font-weight: 600;
}

.ah-nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.ah-nav__chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: transform 0.2s;
}

.ah-nav__item--open .ah-nav__chevron {
  transform: rotate(180deg);
}

/* ── Nav Dropdown ── */
.ah-nav__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(-4px);
}

.ah-nav__item--open .ah-nav__dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ah-nav__dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  transition: background 0.12s;
  white-space: nowrap;
}

.ah-nav__dropdown-item:hover {
  background: rgba(232, 101, 26, 0.07);
}

.ah-nav__dropdown-item--active {
  color: var(--primary);
  font-weight: 600;
}

/* ── Right Zone ── */
.ah-topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Notification Bell ── */
.ah-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  transition: background 0.15s;
}

.ah-bell:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ah-bell svg {
  width: 20px;
  height: 20px;
}

.ah-bell__badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: white;
  background: #e53935;
  border-radius: 10px;
  padding: 0 4px;
}

/* ── Invitation Badge ── */
.ah-inv-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.ah-inv-badge:hover {
  background: rgba(0, 0, 0, 0.05);
}
.ah-inv-badge__count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: white;
  background: #7c3aed;
  border-radius: 10px;
  padding: 0 4px;
}

/* ── Credits ── */
.ah-power {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(232, 101, 26, 0.08);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.ah-power:hover {
  background: rgba(232, 101, 26, 0.14);
}

.ah-power__icon {
  width: 14px;
  height: 14px;
}

/* ── Avatar ── */
.ah-avatar-wrap {
  position: relative;
}

.ah-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  text-transform: uppercase;
}

.ah-avatar:hover,
.ah-avatar--open {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(232, 101, 26, 0.2);
}

/* ── User Dropdown ── */
.ah-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  transform: translateY(-4px);
  overflow: hidden;
}

.ah-avatar-wrap--open .ah-user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ah-user-dropdown__identity {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.ah-user-dropdown__email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.ah-user-dropdown__badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(232, 101, 26, 0.12);
  color: var(--primary);
}

.ah-user-dropdown__section {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
}

.ah-user-dropdown__section:last-child {
  border-bottom: none;
}

.ah-user-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s;
}

.ah-user-dropdown__item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.ah-user-dropdown__item--checkin {
  color: var(--primary);
  font-weight: 600;
}

.ah-user-dropdown__item--checked {
  color: var(--muted);
  cursor: default;
}

.ah-user-dropdown__item--checked:hover {
  background: none;
}

.ah-user-dropdown__item--logout {
  color: #e53935;
}

.ah-user-dropdown__power-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  font-size: 13px;
}

.ah-user-dropdown__power-val {
  font-weight: 700;
  color: var(--primary);
}

.ah-user-dropdown__refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 15px;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  margin-left: auto;
}

.ah-user-dropdown__refresh:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.ah-user-dropdown__lang {
  padding: 8px 10px;
}

/* ── Login Button (not logged in) ── */
.ah-login-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s;
  box-shadow: 0 2px 8px rgba(232, 101, 26, 0.25);
}

.ah-login-btn:hover {
  filter: brightness(1.05);
}

/* ── Tier 2: Breadcrumb Bar ── */
.ah-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 24px;
  background: #FEFBF8;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  overflow-x: auto;
  max-width: 1280px;
  margin: 0 auto;
}

.ah-breadcrumb__link {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
  border: none;
  background: none;
  padding: 0;
  font-size: inherit;
}

.ah-breadcrumb__link:hover {
  color: var(--primary);
}

.ah-breadcrumb__sep {
  color: var(--muted);
  opacity: 0.5;
  font-size: 11px;
}

.ah-breadcrumb__current {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Notification Panel (positioned from header) ── */
.ah-ann-anchor {
  position: relative;
}

/* ── Hamburger (mobile) ── */
.ah-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  padding: 0;
}

.ah-hamburger:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ah-hamburger svg {
  width: 22px;
  height: 22px;
}

/* ── Mobile Menu Overlay ── */
.ah-mobile-overlay {
  display: none;
}

.ah-mobile-menu {
  display: none;
}

/* ── Responsive: Tablet ── */
@media (max-width: 900px) {
  .ah-topbar__center {
    display: none;
  }

  .ah-hamburger {
    display: flex;
  }

  .ah-power {
    display: none;
  }
}

/* ── Responsive: Mobile ── */
@media (max-width: 640px) {
  .ah-topbar {
    height: 48px;
    padding: 0 12px;
  }

  .ah-site-name {
    font-size: 15px;
  }

  .ah-logo {
    width: 28px;
    height: 28px;
  }

  .ah-topbar__center {
    display: none;
  }

  .ah-hamburger {
    display: flex;
  }

  .ah-power {
    display: none;
  }

  .ah-breadcrumb {
    padding: 0 12px;
    height: 32px;
    font-size: 12px;
  }

  .ah-header {
    border-radius: 0;
  }
}

/* ── Mobile Slide-Out Panel ── */
@media (max-width: 900px) {
  .ah-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 200;
  }

  .ah-mobile-overlay--open {
    display: block;
  }

  .ah-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    z-index: 201;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding: 16px 0;
  }

  .ah-mobile-menu--open {
    display: block;
    transform: translateX(0);
  }

  .ah-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .ah-mobile-menu__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--muted);
    border-radius: 6px;
  }

  .ah-mobile-menu__close:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  .ah-mobile-menu__section {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
  }

  .ah-mobile-menu__section:last-child {
    border-bottom: none;
  }

  .ah-mobile-menu__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 8px 4px;
  }

  .ah-mobile-menu__item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    text-decoration: none;
    transition: background 0.12s;
  }

  .ah-mobile-menu__item:hover {
    background: rgba(0, 0, 0, 0.04);
  }

  .ah-mobile-menu__item--active {
    color: var(--primary);
    font-weight: 600;
  }
}
