/* =========================================================
   ESTILOS DO LAYOUT PRINCIPAL
   ========================================================= */

:root {
  --phi-text: #EAF1FF;
  --phi-text-muted: #B8C7E6;
  --phi-text-dark: #17212B;
  --phi-dark: #EAF1FF;

  --phi-primary: #0B1F49;
  --phi-primary-2: #163269;
  --phi-accent: #EAB308;
  --phi-secondary: #9AA9C2;

  --phi-bg: #050A14;
  --phi-bg-2: #0B1F49;
  --phi-bg-3: #17386B;

  --phi-surface: rgba(255, 255, 255, 0.08);
  --phi-surface-strong: rgba(255, 255, 255, 0.14);
  --phi-card: rgba(11, 31, 73, 0.4);
  --phi-card-strong: rgba(14, 36, 78, 0.96);
  --phi-input-bg: rgba(234, 241, 255, 0.08);
  --phi-input-bg-focus: rgba(234, 241, 255, 0.13);

  --phi-border: rgba(255, 255, 255, 0.1);
  --phi-border-strong: rgba(143, 183, 255, 0.38);
  --phi-shadow: rgba(0, 0, 0, 0.28);
  --phi-danger: #FF8A8A;
  --phi-success: #76D99A;
  --phi-warning: #FFD166;

  --phi-font: "Poppins", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--phi-bg);
  color: var(--phi-text);
  font-family: var(--phi-font);
}

a {
  color: var(--phi-accent);
}

.page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- HEADER (FLEXBOX) --- */
header {
  position: relative;
  z-index: 2;
  padding: 15px 18px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(3, 11, 29, 0.98) 0%, rgba(11, 31, 73, 0.95) 68%, rgba(23, 56, 107, 0.86) 100%);
  border-bottom: 1px solid var(--phi-border);
  box-shadow: 0 6px 20px var(--phi-shadow);
}

header::before {
  content: "";
  position: absolute;
  inset: 4px 8px 4px auto;
  width: min(38vw, 520px);
  background: url('/assets/aviacao_naval.png') no-repeat right center;
  background-size: contain; /* 'contain' evita cortes estranhos no brasão */
  

}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 1440px; /* Alterado de 1100px para 1440px */
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--phi-text);
  letter-spacing: 0.5px;
  text-decoration: none;
}

/* --- PERFIL E AÇÕES DO USUÁRIO --- */
.user-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  
  background: rgba(3, 11, 29, 0.72);
  padding: 6px 14px;
  border: 1px solid var(--phi-border);
  border-radius: 50px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px var(--phi-shadow);
  margin-right: 200px;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #FFF;
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  background-color: var(--phi-primary-2);
  border: 1px solid var(--phi-border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(11, 31, 73, 0.45);
}

/* --- MENU DE NAVEGAÇÃO --- */
.main-nav-wrapper {
  position: relative;
  z-index: 1;
  background: var(--phi-primary); /* Força uma cor sólida diferente do fundo */
  border-bottom: 2px solid var(--phi-border-strong); /* Borda mais grossa para delinear a área */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.main-nav {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  gap: 25px;
  padding: 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  padding: 16px 0;
  color: var(--phi-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.main-nav a:hover {
  color: var(--phi-text);
}

.main-nav a.active {
  color: var(--phi-accent);
  border-bottom-color: var(--phi-accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

/* --- Estrutura principal --- */
main {
  position: relative;
  z-index: 1;
  padding: 28px 18px 42px;
  max-width: 1440px;
  margin: 0 auto;
  flex: 1;
  width: 100%;
}

.card {
  background: var(--phi-card);
  border: 1px solid var(--phi-border);
  border-radius: 14px;
  padding: 28px;
  color: var(--phi-text);
  box-shadow: 0 12px 32px var(--phi-shadow);
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--phi-accent);
  background: var(--phi-accent);
  color: var(--phi-bg);
  transition: opacity 0.2s;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

.btn.secondary {
  background: transparent;
  color: var(--phi-text-muted);
  border-color: var(--phi-border);
}

.btn.secondary:hover {
  background: rgba(143, 183, 255, 0.10);
  color: var(--phi-text);
}

.btn-sair-header {
  padding: 6px 14px;
  font-size: 13px;
}

footer {
  position: relative;
  padding: 18px;
  color: var(--phi-text-muted);
  font-size: 13px;
  border-top: 1px solid var(--phi-border);
  text-align: center;
  background: var(--phi-bg);
}

@media (max-width: 980px) {
  header {
    padding-top: 0;
    background: var(--phi-bg-2);
  }

  header::before {
    content: "";
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 4;
    background: url('/assets/aviacao_naval.png') no-repeat center;
    background-size: contain;
    margin-bottom: 12px;
  }

  .brand {
    font-size: 18px;
  }
}
