/* Shell visual unificado sem barra superior duplicada */
.topbar {
  display: none;
}

.appBody {
  min-height: 100dvh;
}

/* Evita o flash da tela de login durante a validação rápida da sessão. */
#loginView:not(.hidden) {
  opacity: 0;
  animation: adminLoginReveal .01s .65s forwards;
}

@keyframes adminLoginReveal {
  to { opacity: 1; }
}

.viewUtilityRow {
  min-height: 44px;
  margin-bottom: 14px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.viewUtilityRow .topbarActions,
.leadActions .topbarActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#view-publicacoes .pageLead,
#view-sistemas .pageLead,
#view-livro .pageLead,
#view-notas .pageLead {
  align-items: flex-start;
}

#view-publicacoes .leadActions,
#view-sistemas .leadActions,
#view-livro .leadActions,
#view-notas .leadActions {
  align-items: center;
  justify-content: flex-end;
}

/* Hub Conteúdo do site: Publicações + Editor visual no mesmo painel. */
.contentHubTabs {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: -4px 0 20px;
  padding: 5px;
  border: 1px solid rgba(16, 34, 52, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .64);
  box-shadow: 0 8px 24px rgba(16, 34, 52, .04);
}

.contentHubTab {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: #607486;
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}

.contentHubTab:hover {
  color: #183246;
  background: rgba(17, 110, 170, .06);
}

.contentHubTab.active {
  color: #fff;
  background: linear-gradient(135deg, #0d5fa3, #1279be);
  box-shadow: 0 8px 18px rgba(14, 95, 163, .20);
}

.contentHubPanel {
  display: none;
}

.contentHubPanel.active {
  display: grid;
}

.siteEditorPanel.active {
  display: block;
  width: 100%;
  height: calc(100dvh - 205px);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(16, 34, 52, .10);
  border-radius: 20px;
  background: #f4f7fa;
  box-shadow: 0 14px 36px rgba(16, 34, 52, .08);
}

.siteEditorFrame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f7fa;
}

/* Após mover Editar site para Publicações, a Visão geral passa a ter três cartões. */
#view-inicio .actionGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Livro de Ponto ocupa a área útil como parte nativa do painel. */
.workspace:has(#view-livro.active) {
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: clamp(18px, 3vw, 34px) clamp(18px, 3vw, 38px) 0;
  overflow: hidden;
}

#view-livro.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#view-livro .pageLead {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.livroEmbedShell {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7f8fc;
  box-shadow: none;
}

.livroPontoFrame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #f7f8fc;
}

/* Gestão de Notas integrada à área Sistemas. */
.workspace:has(#view-notas.active) {
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: clamp(18px, 3vw, 34px) clamp(18px, 3vw, 38px) 0;
  overflow: hidden;
}

#view-notas.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#view-notas .pageLead {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.notasEmbedShell {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 34, 52, .08);
  border-radius: 18px 18px 0 0;
  background: #071a33;
  box-shadow: 0 14px 36px rgba(16, 34, 52, .07);
}

.notasFrame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #071a33;
}

@media (max-width: 1180px) {
  #view-inicio .actionGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .siteEditorPanel.active {
    height: calc(100dvh - 190px);
    min-height: 620px;
  }
}

@media (max-width: 820px) {
  .viewUtilityRow {
    justify-content: space-between;
    margin-bottom: 10px;
  }

  #view-publicacoes .leadActions,
  #view-sistemas .leadActions,
  #view-livro .leadActions,
  #view-notas .leadActions {
    width: 100%;
    justify-content: flex-start;
  }

  .contentHubTabs {
    width: 100%;
  }

  .contentHubTab {
    flex: 1 1 0;
  }

  .siteEditorPanel.active {
    height: calc(100dvh - 205px);
    min-height: 560px;
    border-radius: 15px;
  }

  .workspace:has(#view-livro.active),
  .workspace:has(#view-notas.active) {
    height: 100dvh;
    padding: 14px 12px 0;
  }

  .notasEmbedShell {
    border-radius: 14px 14px 0 0;
  }
}

@media (max-width: 600px) {
  #view-inicio .actionGrid {
    grid-template-columns: 1fr;
  }

  .viewUtilityRow .topbarActions,
  .leadActions .topbarActions {
    flex-wrap: wrap;
  }

  .contentHubTabs {
    margin-bottom: 14px;
  }

  .contentHubTab {
    padding-inline: 10px;
  }

  .siteEditorPanel.active {
    height: calc(100dvh - 190px);
    min-height: 520px;
  }
}
