.ams-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  padding: 0.75rem 1rem;
}

.header-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .header-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  border-radius: 8px;
  object-fit: cover;
}

.brand-icon-box {
  overflow: hidden;
}

.brand-icon-box .brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #fff;
}

.brand-status {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--status-pulse);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.search-pill-wrapper input {
  width: 100%;
  background: #05070b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.2rem;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-pill-wrapper input:focus {
  border-color: #00E5FF;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

@media (min-width: 768px) {
  .search-pill-wrapper input {
    width: 320px;
  }
}

.main-content {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.satellites-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .satellites-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .satellites-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.direct-b2b-zones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .direct-b2b-zones {
    grid-template-columns: 1fr 1fr;
  }
}

.corporate-footer {
  background: #030407;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 1rem 1.5rem;
  margin-top: 3rem;
}

.footer-columns {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-columns {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-bottom {
  max-width: 1380px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 1. CABEÇALHO CANÔNICO FULL-WIDTH (ESTRITAMENTE FIXO NO TOPO) */
.ams-header, .ams-header-gsc, header[role="banner"] {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 72px !important;
  z-index: 1000 !important;
  background: rgba(6, 8, 12, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   CANÔNICO AMS: ARQUITETURA PRINCIPAL WIDESCREEN (NATURAL STICKY GRID)
   FÍSICA ESTRUTURAL HOMOLOGADA AGÊNCIA SKYNET - LATERAIS EM STICKY NATURAL
   ========================================================================== */
html, body {
  min-height: 100vh;
  height: auto;
  overflow-x: clip;
  margin: 0;
  padding: 0;
}

html {
  overflow-y: auto;
}

body {
  display: flex;
  flex-direction: column;
}

main, .main-content, .portal-container {
  flex: 1 0 auto;
  width: 100%;
}

/* Container Geral: Grid de 3 Colunas com Suporte ao Sticky Natural */
.gsc-widescreen-layout {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0.75rem 1rem 2rem !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) 300px !important;
  gap: 1rem !important;
  align-items: start !important;
  min-height: calc(100vh - 72px);
  height: auto;
  flex: 1 0 auto;
}

@media screen and (min-width: 1024px) {
  .gsc-widescreen-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0.75rem 1rem 2rem !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 260px minmax(0, 1fr) 300px !important;
    gap: 1rem !important;
    align-items: start !important;
  }
}

/* 1. Coluna Esquerda: Sticky Natural no Desktop (>= 1024px) */
.gsc-sidebar-left {
  width: 260px !important;
  max-width: 260px !important;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 80px !important;
  left: auto !important;
  height: fit-content !important;
  max-height: calc(100vh - 95px) !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none;
  z-index: 30 !important;
  align-self: start !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 0.85rem !important;
  box-sizing: border-box !important;
  padding-bottom: 0 !important;
}

.gsc-sidebar-left::-webkit-scrollbar {
  display: none;
}

.sidebar-menu-card {
  background: var(--ams-card-bg, #0B0F17);
  border: 1px solid var(--ams-border, #1F293D);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

.category-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 4px;
}

.category-nav-list::-webkit-scrollbar {
  display: none;
}

.sidebar-governance-seal {
  background: var(--ams-card-bg, #0B0F17);
  border: 1px solid rgba(0, 255, 163, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.06), rgba(0, 229, 255, 0.06));
  flex-shrink: 0;
  box-sizing: border-box;
}

/* 2. Coluna Central (Hero Showcase / Satélites Conectados) */
.gsc-feed-center {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* 3. Coluna Direita (Ficha Técnica // Matriz / Telemetria) */
.gsc-sidebar-right {
  width: 300px !important;
  max-width: 300px !important;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 80px !important;
  right: auto !important;
  height: fit-content !important;
  max-height: calc(100vh - 95px) !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none;
  z-index: 30 !important;
  align-self: start !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  box-sizing: border-box !important;
  padding-bottom: 0.5rem !important;
}

.gsc-sidebar-right::-webkit-scrollbar {
  display: none;
}

/* 4. Rodapé Canônico (Delimitação Estrutural Fora do Grid Widescreen) */
footer, .corporate-footer-gsc, .corporate-footer {
  position: relative !important;
  width: 100% !important;
  clear: both !important;
  z-index: 40 !important;
  margin-top: 2rem !important;
  box-sizing: border-box;
}

/* ==========================================================================
   5. RESPONSIVIDADE MOBILE & TABLET (< 1024px)
   ========================================================================== */
@media screen and (max-width: 1023px) {
  html, body {
    height: auto;
    min-height: 100vh;
    overflow-x: clip;
  }
  html {
    overflow-y: auto;
  }
  .gsc-widescreen-layout {
    display: flex !important;
    flex-direction: column !important;
    padding: 1rem !important;
    gap: 1.5rem !important;
    height: auto !important;
    min-height: calc(100vh - 72px) !important;
  }
  .gsc-sidebar-left,
  .gsc-sidebar-right {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    align-self: auto !important;
  }
  .gsc-feed-center {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    padding-bottom: 2rem !important;
  }
  .sidebar-menu-card {
    flex: none;
  }
  .category-nav-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    overflow-y: visible;
  }
  .gsc-sidebar-right {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
  }
  .footer-four-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}
