﻿/* ======================================================
   RESET + BASE
====================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: #f7f9f8;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ======================================================
   CABEÇALHO
====================================================== */
header {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

header img.logo {
  height: 50px;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

/* ======================================================
   CONTEÚDO PRINCIPAL
====================================================== */
main {
  flex: 1;
}

/* Container padrão das páginas internas */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* Cabeçalho da página */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.6rem;
  color: #2e7d32;
  font-weight: 600;
}

/* ======================================================
   CARDS (BASE DO SISTEMA)
====================================================== */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card + .card {
  margin-top: 1.5rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2e7d32;
  margin-bottom: 1rem;
}

/* ======================================================
   BOTÕES
====================================================== */
button,
input[type="submit"],
.btn-primary {
  display: inline-block;
  background-color: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover,
input[type="submit"]:hover,
.btn-primary:hover {
  background-color: #1b5e20;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #9e9e9e;
}

.btn-secondary:hover {
  background-color: #757575;
}

.btn-outline {
  background: transparent;
  border: 2px solid #2e7d32;
  color: #2e7d32;
}

.btn-outline:hover {
  background: #e8f5e9;
}

/* Ações no topo da página */
.page-actions {
  display: flex;
  gap: 0.8rem;
}

/* ======================================================
   FORMULÁRIOS
====================================================== */
form {
  width: 100%;
}

label {
  font-weight: 500;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2e7d32;
}

/* Grid de formulários */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full {
  grid-column: span 2;
}

/* Ações do formulário */
.form-actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 1rem;
}

/* ======================================================
   TABELAS
====================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
}

th {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  color: white;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

tr:hover {
  background-color: #e8f5e9;
}

/* Ações dentro da tabela */
.table-actions a {
  margin-right: 8px;
  font-weight: 500;
  color: #2e7d32;
  text-decoration: none;
}

.table-actions a:hover {
  text-decoration: underline;
}

/* ======================================================
   IMAGENS / THUMBS
====================================================== */
img.thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

img.thumb:hover {
  transform: scale(1.1);
}

/* ======================================================
   FILTROS
====================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.filters select,
.filters input[type="date"] {
  width: 200px;
}

/* ======================================================
   MENSAGENS
====================================================== */
.message {
  background-color: #e8f5e9;
  border: 1px solid #81c784;
  color: #2e7d32;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* ======================================================
   LOGIN / FEEDBACK
====================================================== */
.login-container,
.feedback-container {
  background: #fff;
  max-width: 400px;
  margin: 5rem auto;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.feedback-container.success h2 {
  color: #2e7d32;
}

.feedback-container.error h2 {
  color: #c62828;
}

/* ======================================================
   RODAPÉ
====================================================== */
footer {
  background-color: #2e7d32;
  color: white;
  text-align: center;
  padding: 0.8rem;
  font-size: 0.9rem;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
}

/* ======================================================
   RESPONSIVIDADE
====================================================== */
@media (max-width: 768px) {
  .page-container {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  header img.logo {
    height: 40px;
  }

  table th,
  table td {
    font-size: 0.85rem;
  }

  footer {
    font-size: 0.8rem;
  }
}

/* =======================
   PORTAL DO SISTEMA
======================= */

.portal-container {
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

.portal-logo {
  width: 120px;
  margin: 20px auto 10px;
  display: block;
}

.portal-title {
  color: #2e7d32;
  margin-bottom: 30px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.portal-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
  color: #2e7d32;
  font-weight: 600;
  transition: transform 0.25s, box-shadow 0.25s;
}

.portal-card img {
  width: 64px;
  margin-bottom: 12px;
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
