@import url('./variables.css');

/* ==========================================================================
   RESET GLOBAL E REGRAS ESTRUTURAIS
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  font-family: var(--font-family-base);
  font-size: 12px; /* Tamanho Base: 12px (1rem = 12px) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout em Viewport Completo com Flexbox */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  background-color: var(--main-bg);
  color: var(--text-primary);
  transition: var(--theme-transition);
}

/* ==========================================================================
   CABEÇALHO
   ========================================================================== */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  max-height: var(--header-height);
  background-color: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title {
  font-size: var(--font-section-title); /* 1.8rem */
  font-weight: 800;
  letter-spacing: 0.05rem;
  color: #ffffff;
  text-decoration: none;
  line-height: 1;
}

.brand-badge {
  font-size: var(--font-control); /* 0.8rem - Controles */
  font-weight: 700;
  background-color: #1976d2;
  color: #ffffff;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1;
}

/* Nome do Contrato Corrente: Centralizado, Negrito e Destaque */
.header-contract-info {
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

.contract-display-name {
  font-size: var(--font-output); /* 1.1rem - Dados de Saída */
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01rem;
  display: inline-block;
  max-width: 100%;
  line-height: 1.2;
}

.header-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   RODAPÉ (TEXTO REGULAR / INFORMATIVO: 1.2rem)
   ========================================================================== */
.app-footer {
  height: var(--footer-height);
  min-height: var(--footer-height);
  max-height: var(--footer-height);
  background-color: var(--footer-bg);
  color: var(--footer-text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.2rem;
  font-size: var(--font-default); /* 1.2rem - Textos Gerais / Informativos */
  font-weight: 400;
  line-height: 1;
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   ÁREA CENTRAL (Menu Lateral de Navegação + Conteúdo Principal)
   ========================================================================== */
.app-body {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Menu de Navegação Vertical */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: var(--theme-transition);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-sidebar::-webkit-scrollbar {
  display: none;
}

.nav-menu {
  list-style: none;
  padding: 0.75rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--font-control); /* 0.8rem - Controles */
  font-weight: 600;
  border-radius: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover {
  background-color: var(--color-accent-bg);
  color: var(--color-primary);
}

.nav-link.active {
  background-color: var(--color-primary);
  color: #ffffff !important;
  font-weight: 700;
}

.nav-icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  fill: currentColor;
}

/* Painel de Conteúdo Principal (Sem Scrollbar Visível) */
.app-main-content {
  flex: 1 1 auto;
  background-color: var(--main-bg);
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-main-content::-webkit-scrollbar {
  display: none;
}