/* ============================================================
   EQI Budget System — header.css
   Header global persistente (A1) + Breadcrumbs (A4)
   Depende de: ../styles.css (design tokens)
   ============================================================ */

/* ============================================================
   HEADER CONTAINER
   Altura fixa 48px, compacto para não competir com a sidebar.
   Posicionado no topo do .page-shell (sticky).
   ============================================================ */
.gh-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 48px;
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  background-color: rgba(0, 41, 30, 0.92);
  border-bottom: 1px solid rgba(99, 198, 165, 0.15);
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

/* backdrop-filter: progressive enhancement */
@supports (backdrop-filter: blur(1px)) {
  .gh-header {
    background-color: rgba(0, 41, 30, 0.92);
    backdrop-filter: blur(8px);
  }
}
@supports (-webkit-backdrop-filter: blur(1px)) {
  .gh-header {
    background-color: rgba(0, 41, 30, 0.92);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* ============================================================
   LAYOUT: ESQUERDA E DIREITA
   ============================================================ */
.gh-left {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.75rem;
  min-width: 0;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
}

.gh-right {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.75rem;
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

/* ============================================================
   BRAND / LOGO
   ============================================================ */
.gh-brand {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

.gh-brand:focus-visible {
  outline: 2px solid var(--green-light, #63C6A5);
  outline-offset: 2px;
  border-radius: 4px;
}

.gh-brand-mark {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--off-white, #FFFAFA);
  background-color: var(--green-primary, #009E76);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}

.gh-brand-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--off-white, #FFFAFA);
  opacity: 0.9;
  white-space: nowrap;
}

/* ============================================================
   DIVIDER (separador vertical)
   ============================================================ */
.gh-divider {
  width: 1px;
  height: 20px;
  background-color: rgba(99, 198, 165, 0.25);
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

/* ============================================================
   BREADCRUMB (A4)
   ============================================================ */
.gh-breadcrumb {
  min-width: 0;
  overflow: hidden;
}

.gh-breadcrumb-list {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  -ms-flex-wrap: nowrap;
      flex-wrap: nowrap;
  overflow: hidden;
}

.gh-breadcrumb-item {
  display: -webkit-inline-box;
  display:    -ms-inline-flexbox;
  display:        inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  white-space: nowrap;
  min-width: 0;
}

.gh-breadcrumb-link {
  font-size: 0.75rem;
  color: rgba(255, 250, 250, 0.7);
  text-decoration: none;
  transition: color var(--transition, 150ms ease);
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-breadcrumb-link:hover {
  color: var(--green-light, #63C6A5);
}

.gh-breadcrumb-link:focus-visible {
  outline: 2px solid var(--green-light, #63C6A5);
  outline-offset: 2px;
  border-radius: 2px;
}

.gh-breadcrumb-text {
  font-size: 0.75rem;
  color: rgba(255, 250, 250, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-breadcrumb-current {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--off-white, #FFFAFA);
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-breadcrumb-sep {
  display: -webkit-inline-box;
  display:    -ms-inline-flexbox;
  display:        inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  color: rgba(255, 250, 250, 0.35);
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

/* ============================================================
   API STATUS INDICATOR
   ============================================================ */
.gh-api-status {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.06);
  cursor: default;
}

.gh-api-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgba(255, 250, 250, 0.4);
  transition: background-color 0.3s ease;
}

.gh-api-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgba(255, 250, 250, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Estados */
.gh-api-online .gh-api-dot {
  background-color: var(--green-light, #63C6A5);
  box-shadow: 0 0 4px rgba(99, 198, 165, 0.5);
}

.gh-api-offline .gh-api-dot {
  background-color: #E74C3C;
  box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}

/* ============================================================
   USER INFO
   ============================================================ */
.gh-user {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.4rem;
}

.gh-user-avatar {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: rgba(99, 198, 165, 0.15);
  color: var(--green-light, #63C6A5);
}

.gh-user-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--off-white, #FFFAFA);
  opacity: 0.9;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   LOGOUT BUTTON
   ============================================================ */
.gh-logout-btn {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  color: rgba(255, 250, 250, 0.7);
  cursor: pointer;
  transition: background-color var(--transition, 150ms ease),
              color var(--transition, 150ms ease);
}

.gh-logout-btn:hover {
  background-color: rgba(231, 76, 60, 0.15);
  color: #E74C3C;
}

.gh-logout-btn:focus-visible {
  outline: 2px solid var(--green-light, #63C6A5);
  outline-offset: 2px;
}

/* ============================================================
   RESPONSIVO — MOBILE (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  .gh-header {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .gh-brand-name {
    display: none;
  }

  .gh-divider {
    display: none;
  }

  .gh-breadcrumb {
    display: none;
  }

  .gh-api-label {
    display: none;
  }

  .gh-user-name {
    display: none;
  }
}

/* ============================================================
   RESPONSIVO — TABLET (768px–1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .gh-user-name {
    max-width: 80px;
  }

  .gh-breadcrumb-list {
    max-width: 300px;
  }
}

/* ============================================================
   ACESSIBILIDADE: prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .gh-header,
  .gh-api-dot,
  .gh-logout-btn,
  .gh-breadcrumb-link {
    transition: none;
  }
}

/* ============================================================
   PRINT: esconder header para impressão
   ============================================================ */
@media print {
  .gh-header {
    display: none;
  }
}
