/* Header layout */
.hdr { background: transparent; color: inherit; direction: ltr; }
.hdr__wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hdr__brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.hdr__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.hdr__brand-name { font-weight: 750; font-size: 1.25rem; letter-spacing: .25px; }
.hdr__logo { width: 70px; height: auto; display: block; object-fit: contain; }
.hdr__role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  color: inherit;
}

.hdr__controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}
.hdr__lang { display: flex; align-items: center; }
.hdr__select {
  background: transparent;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .75rem;
  min-width: 74px;
  font-weight: 600;
}

.hdr__actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.hdr__notif { position: relative; display: inline-flex; }
.hdr__btn {
  background: transparent;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.hdr__btn:hover { border-color: var(--ring); background: var(--soft); }
.hdr__btn--icon { width: 38px; height: 38px; padding: 0; font-size: 1.05rem; }

[data-theme="dark"] .hdr__select,
[data-theme="dark"] .hdr__btn { border-color: rgba(255,255,255,.18); }

/* Avatar & menus */
[data-role="avatar-menu"] .hdr__avatar { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.hdr__avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.amenu { position: relative; }
.amenu__panel {
  position: absolute;
  top: 110%;
  inset-inline-end: 0;
  background: #fff;
  color: inherit;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  display: none;
  z-index: 1000;
  overflow: hidden;
}
.amenu__panel.is-open { display: block; }
[data-theme="dark"] .amenu__panel { background: #0f1620; border-color: #1f2937; }
.amenu__item { display: block; width: 100%; padding: 10px 12px; background: transparent; border: 0; color: inherit; text-align: start; cursor: pointer; text-decoration: none; }
.amenu__item:hover { background: rgba(0,0,0,.05); }
[data-theme="dark"] .amenu__item:hover { background: #1f2937; }

.hdr__avatar-menu .amenu__panel {
  min-width: 180px;
  width: max-content;
  max-width: min(88vw, 280px);
}

.hdr__notif .amenu__panel {
  width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
}

@media (max-width: 640px) {
  .hdr__notif .amenu__panel {
    inset-inline-end: -50px;
    width: min(360px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    min-width: 220px;
  }
}

.hdr__badge { position: absolute; top: -6px; right: -6px; background: #b71c1c; color: #fff; border-radius: 12px; padding: 0 6px; font-size: 11px; line-height: 16px; min-width: 18px; text-align: center; display: none; }
.hdr__badge.is-show { display: inline-block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Responsive */
@media (max-width: 720px) {
  .hdr__wrap { flex-direction: column; align-items: stretch; gap: 12px; }
  .hdr__brand-group { justify-content: space-between; }
  .hdr__controls { width: 100%; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .hdr__actions { flex: 1 1 auto; justify-content: flex-end; gap: 8px; }
}
