/* ── Top Header ── */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-lg);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-center {
  flex: 1;
}

/* ── Brand ── */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: 3px;
  border-bottom: 3px solid var(--color-brand);
}

.brand img {
  height: 34px;
  width: 34px;
}

.brand-name {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* ── Icon Buttons ── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  position: relative;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
  background: var(--color-hover);
  transform: scale(1.02);
  box-shadow: var(--shadow-sm);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  margin-left: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-deep);
}

.menu-toggle:hover {
  background: var(--color-brand-soft);
  border-color: var(--color-brand);
  box-shadow: var(--shadow-brand);
  transform: scale(1.02);
}

.menu-toggle:active {
  transform: scale(0.96);
  background: var(--color-brand-muted);
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.notification-btn {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
}

/* ── Settings Button ── */
.settings-btn {
  width: auto;
  gap: var(--space-sm);
  padding: 0 10px;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-secondary);
  font-family: var(--font-bn);
}

.settings-btn:hover {
  background: var(--color-brand-soft);
  color: var(--color-brand-dark);
}

/* ── Header Divider ── */
.header-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  margin: 0 var(--space-xs);
}

/* ── Profile Button ── */
.profile-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: var(--color-hover);
  box-shadow: var(--shadow-md);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5b800, #d4a017);
  color: var(--color-text-primary);
  font-family: var(--font-en);
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.username {
  font-family: var(--font-en);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-primary);
}

.chevron {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}

.chevron svg {
  width: 16px;
  height: 16px;
}

.profile-menu-wrap {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
}

.profile-dropdown-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  transition: background 0.2s ease;
}

.profile-dropdown-item:hover {
  background: var(--color-hover);
}

@media (max-width: 992px) {
  .top-header {
    padding: 0 var(--space-md);
  }

  .settings-btn span {
    display: none;
  }

  .settings-btn {
    width: var(--touch-min);
    height: var(--touch-min);
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 0 var(--page-padding-mobile);
  }

  .header-left,
  .header-right {
    gap: var(--space-sm);
  }

  .brand-name {
    font-size: 16px;
  }

  .username,
  .profile-btn .chevron {
    display: none;
  }

  .profile-btn {
    padding: 4px;
    border: none;
    box-shadow: none;
  }

  .icon-btn {
    width: var(--touch-min);
    height: var(--touch-min);
  }

  .menu-toggle {
    width: var(--touch-min);
    height: var(--touch-min);
    margin-left: 0;
  }

  .header-divider {
    display: none;
  }
}

@media (max-width: 768px) {
  body.page-home .top-header {
    background: var(--color-brand);
    border-bottom: none;
    box-shadow: none;
  }

  body.page-home .brand {
    display: none;
  }

  body.page-home .menu-toggle {
    background: rgba(255, 255, 255, 0.3);
    border-color: transparent;
    color: var(--color-text-primary);
  }

  body.page-home .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.45);
    border-color: transparent;
  }

  body.page-home .icon-btn {
    color: var(--color-text-primary);
  }

  body.page-home .icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  body.page-home .profile-btn {
    background: rgba(255, 255, 255, 0.35);
    border-color: transparent;
  }
}
