/* avatar-hub.css — dropdown do avatar no header desktop (lg+) */

:root {
  --avatar-hub-z: 50;
  --avatar-hub-radius: 0.75rem;
  --avatar-hub-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  --avatar-hub-bg: #ffffff;
  --avatar-hub-border: rgba(0, 0, 0, 0.08);
  --avatar-hub-divider: rgba(0, 0, 0, 0.08);
  --avatar-hub-hover: rgba(0, 0, 0, 0.04);
  --avatar-hub-text: #1f2937;
  --avatar-hub-text-muted: #6b7280;
  --avatar-hub-gold: #f59e0b;
  --avatar-hub-green: #10b981;
  --avatar-hub-red: #ef4444;
  --gf-header-bg: #135d28;
}

/* Avatar button (pill shape conforme mockup) */
.avatar-hub__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.5rem;
  padding: 0 0.625rem 0 0.375rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.avatar-hub__button:hover,
.avatar-hub__button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  outline: none;
}

/* Círculo com gradient + inicial (dentro do button) */
.avatar-hub__initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--avatar-hub-gold), #15803d);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1;
  color: #ffffff;
  flex-shrink: 0;
}

.avatar-hub__photo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

/* Pill "PRO" dentro do button quando assinatura ativa */
.avatar-hub__pro-pill {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--avatar-hub-gold), #15803d);
  color: #ffffff;
  line-height: 1;
}

/* Chevron expand_more dentro do button */
.avatar-hub__chevron {
  font-size: 18px;
  opacity: 0.6;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.avatar-hub__button[aria-expanded="true"] .avatar-hub__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown */
.avatar-hub__dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 14rem;
  background: var(--avatar-hub-bg);
  border: 1px solid var(--avatar-hub-border);
  border-radius: var(--avatar-hub-radius);
  box-shadow: var(--avatar-hub-shadow);
  z-index: var(--avatar-hub-z);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  overflow: hidden;
}

.avatar-hub__dropdown:not([hidden]) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header (nome + email) */
.avatar-hub__header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--avatar-hub-divider);
}

.avatar-hub__name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--avatar-hub-text);
}

.avatar-hub__email {
  font-size: 0.75rem;
  color: var(--avatar-hub-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Items */
.avatar-hub__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--avatar-hub-text);
  text-decoration: none;
  transition: background 0.15s ease;
}

.avatar-hub__item:hover,
.avatar-hub__item:focus-visible {
  background: var(--avatar-hub-hover);
  outline: none;
}

.avatar-hub__item--billing {
  position: relative;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  padding-left: calc(1rem - 3px);
  font-weight: 700;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--avatar-hub-gold);
}

.avatar-hub__item--billing:hover,
.avatar-hub__item--billing:focus-visible {
  background: rgba(245, 158, 11, 0.14);
}

.avatar-hub__item--danger .avatar-hub__label {
  color: var(--avatar-hub-red);
}

.avatar-hub__item--disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.avatar-hub__item--disabled:hover,
.avatar-hub__item--disabled:focus-visible {
  background: transparent;
}

.avatar-hub__icon {
  font-size: 20px;
  color: var(--avatar-hub-text-muted);
}

.avatar-hub__icon--gold {
  color: var(--avatar-hub-gold);
}

.avatar-hub__icon--danger {
  color: var(--avatar-hub-red);
}

.avatar-hub__label {
  flex: 1 1 auto;
}

.avatar-hub__badge-pro {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--avatar-hub-green);
  color: #ffffff;
}

.avatar-hub__badge-soon {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(107, 114, 128, 0.14);
  color: var(--avatar-hub-text-muted);
  text-transform: uppercase;
}

.avatar-hub__divider {
  height: 1px;
  background: var(--avatar-hub-divider);
  margin: 0;
}

/* Seção com título (ex: Unidade de Área) */
.avatar-hub__section {
  padding: 0.25rem 0;
}

.avatar-hub__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 1rem 0.25rem;
}

.avatar-hub__section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--avatar-hub-text-muted);
}

.avatar-hub__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--avatar-hub-text-muted);
  cursor: help;
  border-radius: 9999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.avatar-hub__info-btn:hover,
.avatar-hub__info-btn:focus-visible {
  color: var(--avatar-hub-text);
  background: var(--avatar-hub-hover);
  outline: none;
}

.avatar-hub__info-btn .material-symbols-outlined {
  font-size: 16px;
}

/* Botão "unidade atual" (collapsed state) — click expande a lista */
.avatar-hub__unit-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  text-align: left;
  color: var(--avatar-hub-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.avatar-hub__unit-current:hover,
.avatar-hub__unit-current:focus-visible {
  background: var(--avatar-hub-hover);
  outline: none;
}

.avatar-hub__unit-current .avatar-hub__unit-short {
  background: linear-gradient(135deg, var(--avatar-hub-gold), #15803d);
  color: #ffffff;
}

.avatar-hub__unit-current .avatar-hub__unit-info {
  color: var(--avatar-hub-gold);
  font-weight: 600;
}

.avatar-hub__unit-chevron {
  font-size: 18px;
  opacity: 0.5;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.avatar-hub__unit-current[aria-expanded="true"] .avatar-hub__unit-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Lista de unidades de área — estado inicial colapsado (anima ao receber --expanded) */
.avatar-hub__unit-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  padding: 0;
  border-top: 0 solid var(--avatar-hub-divider);
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    border-top-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}

/* Estado expandido (adicionado via JS ao clicar no unit-current) */
.avatar-hub__unit-list.avatar-hub__unit-list--expanded {
  max-height: 18rem;
  padding: 0.25rem 0;
  border-top-width: 1px;
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}

.avatar-hub__unit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  text-align: left;
  color: var(--avatar-hub-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.avatar-hub__unit-item:hover,
.avatar-hub__unit-item:focus-visible {
  background: var(--avatar-hub-hover);
  outline: none;
}

.avatar-hub__unit-item--active {
  background: rgba(245, 158, 11, 0.08);
}

.avatar-hub__unit-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}

.avatar-hub__unit-short {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--avatar-hub-text-muted);
}

.avatar-hub__unit-item--active .avatar-hub__unit-short {
  background: linear-gradient(135deg, var(--avatar-hub-gold), #15803d);
  color: #ffffff;
}

.avatar-hub__unit-name {
  white-space: nowrap;
}

.avatar-hub__unit-info {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: var(--avatar-hub-text-muted);
  font-variant-numeric: tabular-nums;
}

.avatar-hub__unit-item--active .avatar-hub__unit-info {
  color: var(--avatar-hub-gold);
  font-weight: 600;
}

/* Largura fixa do dropdown — dimensionada para caber o nome completo da unidade de área mais longa */
.avatar-hub__dropdown {
  width: 22rem;
  min-width: 22rem;
  max-width: 22rem;
}

/* Override mobile (centralização no viewport) em avatar-hub-mobile.css. */

/* Botão "Entrar" (anônimo) */
.avatar-hub__login {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--avatar-hub-radius);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.avatar-hub__login:hover,
.avatar-hub__login:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}
