/* ESTRUTURA GERAL */
.layout-body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f5f6fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.layout-topbar {
  background-color: var(--verde-institucional);
  height: 60px;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1000;
}

.layout-main {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.layout-menu {
  width: 220px;
  background-color: white;
  padding: 1rem;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.layout-content {
  flex: 1;
  padding: 2rem;
  background-color: #ffffff;
  overflow-y: auto;
  min-width: 0;
}

/* FOOTER FIXO */
.layout-footer {
  height: 40px;
  background-color: var(--verde-institucional);
  color: white;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin-top: auto;
}

/* COMPONENTES RESPONSIVOS */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .desktop-menu {
    display: none !important;
  }
  
  /* Ajustes para formulários */
  .ui-inputfield {
    width: 100% !important;
    font-size: 16px !important; /* Evita zoom no iOS */
  }
  
  .p-button {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Cards responsivos */
  .ui-card {
    margin-bottom: 1rem;
  }
  
  /* Tabelas responsivas */
  .p-datatable {
    font-size: 0.875rem;
    border-radius: 8px;
    overflow: hidden;
  }
  
  .p-datatable .p-datatable-tbody td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
  }
  
  @media (max-width: 768px) {
    .p-datatable .p-datatable-tbody td {
      padding: 0.5rem 0.25rem;
    }
  }
  
  /* Diálogos responsivos */
  .ui-dialog {
    width: 95% !important;
    max-width: 500px !important;
    margin: 1rem !important;
  }
}

/* UTILITÁRIOS MOBILE */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

/* MELHORIAS DE TOQUE */
@media (max-width: 768px) {
  .p-menuitem-link,
  .p-button,
  .ui-commandlink {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
  }
  
  .p-menu .p-menuitem-link {
     padding: 1rem;
     border-bottom: 1px solid #f0f0f0;
   }
   
   .p-menu .p-menuitem-link:hover {
     background-color: #f8f9fa;
   }
}

:root {
  --verde-institucional: #4a7354;
  --branco: #ffffff;
  --cinza-fundo: #f5f6fa;
  --sombra-leve: 0 2px 8px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* RESPONSIVIDADE MOBILE */
@media (max-width: 768px) {
  .layout-topbar {
    height: 56px;
    padding: 0 0.75rem;
  }
  
  .layout-main {
    flex-direction: column;
  }
  
  .layout-menu {
    position: fixed;
    top: 56px;
    left: -100%;
    width: 280px;
    height: calc(100vh - 56px);
    z-index: 999;
    transform: translateX(-100%);
    box-shadow: var(--sombra-leve);
  }
  
  .layout-menu.mobile-open {
    left: 0;
    transform: translateX(0);
  }
  
  .layout-content {
    padding: 1rem;
    width: 100%;
  }
  
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
  }
  
  .mobile-overlay.active {
    display: block;
  }
}

@media (max-width: 480px) {
  .layout-topbar {
    height: 52px;
    padding: 0 0.5rem;
  }
  
  .layout-content {
    padding: 0.75rem;
  }
  
  .layout-menu {
    width: 100%;
    left: -100%;
  }
}

.layout-footer {
  height: 40px;
  background-color: var(--verde-institucional);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

