/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2A5C56; /* Verde Escuro Sóbrio da logo - Mais profissional para o cabeçalho */
  --primary-light: #3D968A;
  --primary-dark: #1F4540;
  --secondary: #E95A28; /* Laranja Vibrante - Agora como destaque */
  --secondary-light: #F27A50;
  --accent: #F9B233; /* Amarelo Ouro */
  --bg: #F8F9FA; /* Cinza muito claro e limpo */
  --card: #ffffff;
  --text: #2D3436;
  --text-light: #636E72;
  --border: #E9ECEF;
  --danger: #D32F2F;
  --success: #3D968A;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 64px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 0 1.25rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo img {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

.header-logo h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.header-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.ativo {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ==================== CONTAINER ==================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==================== CARDS ==================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.card .valor {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ==================== FORMULÁRIOS ==================== */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.form-card h2 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ==================== BOTÕES ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #333;
}

.btn-secondary:hover {
  background: var(--secondary-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #C62828;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==================== TABELAS ==================== */
.table-container {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--primary);
  color: #fff;
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #FFF3E0;
}

/* ==================== CHECKBOX PRESENÇA ==================== */
.presenca-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--primary);
}

.presente-true {
  color: var(--success);
  font-weight: 600;
}

.presente-false {
  color: var(--danger);
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: #E8F5E9;
  color: var(--primary-dark);
}

.badge-secondary {
  background: #FFF8E1;
  color: #F57F17;
}

/* ==================== MENSAGENS ==================== */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 999;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== LOADING ==================== */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== VAZIO ==================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1rem;
}

/* ==================== RESPONSIVO ==================== */
@media (max-width: 768px) {
  :root { --header-height: 56px; }

  .header-logo h1 {
    font-size: 0.95rem;
    display: none;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .header-nav.aberto {
    display: flex;
  }

  .header-nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
  }

  .menu-toggle {
    display: block;
  }

  .container {
    padding: 1rem 0.85rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .card {
    padding: 1rem;
  }

  .card .valor {
    font-size: 1.5rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  th, td {
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
  }

  .toast {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-card {
    padding: 1rem;
  }
}
