/* ===== CENTRAL DO NEGÓCIO — CSS Global ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primaria: #0f1e35;
  --primaria-escura: #091526;
  --acento: #c8a96e;
  --acento-claro: #e0c99a;
  --fundo: #f5f0e8;
  --fundo-card: #ffffff;
  --texto: #1a2a3a;
  --texto-suave: #5a6a7a;
  --borda: #ddd8ce;
  --sucesso: #27ae60;
  --erro: #e74c3c;
  --aviso: #f39c12;
  --info: #2980b9;
  --sombra: 0 2px 12px rgba(15,30,53,0.08);
  --sombra-hover: 0 6px 24px rgba(15,30,53,0.15);
  --radius: 10px;
  --radius-lg: 16px;
  --transicao: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.6;
  font-size: 15px;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; font-weight: 600; }

a { color: var(--acento); text-decoration: none; transition: var(--transicao); }
a:hover { color: var(--acento-claro); }

/* ===== BOTÕES ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: var(--transicao); white-space: nowrap;
}
.btn-primario { background: var(--primaria); color: #fff; }
.btn-primario:hover { background: var(--primaria-escura); transform: translateY(-1px); box-shadow: var(--sombra-hover); }
.btn-acento { background: var(--acento); color: var(--primaria); }
.btn-acento:hover { background: var(--acento-claro); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primaria); border: 2px solid var(--primaria); }
.btn-outline:hover { background: var(--primaria); color: #fff; }
.btn-perigo { background: var(--erro); color: #fff; }
.btn-perigo:hover { background: #c0392b; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== CARDS ===== */
.card {
  background: var(--fundo-card); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--sombra); border: 1px solid var(--borda);
}
.card-titulo { font-size: 18px; color: var(--primaria); margin-bottom: 16px; }

/* ===== FORMULÁRIOS ===== */
.form-grupo { margin-bottom: 18px; }
.form-grupo label { display: block; font-size: 13px; font-weight: 500; color: var(--texto-suave); margin-bottom: 6px; }
.form-grupo input, .form-grupo select, .form-grupo textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--borda); background: #fff;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--texto);
  transition: var(--transicao); outline: none;
}
.form-grupo input:focus, .form-grupo select:focus, .form-grupo textarea:focus {
  border-color: var(--acento); box-shadow: 0 0 0 3px rgba(200,169,110,0.15);
}
.form-grupo textarea { resize: vertical; min-height: 90px; }

/* ===== TABELA ===== */
.tabela-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--primaria); color: #fff; }
thead th { padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 500; }
tbody tr { border-bottom: 1px solid var(--borda); transition: var(--transicao); }
tbody tr:hover { background: var(--fundo); }
tbody td { padding: 12px 16px; font-size: 14px; }

/* ===== BADGES / STATUS ===== */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-verde   { background: #d4f1e4; color: #1a8a4a; }
.badge-vermelho{ background: #fde8e6; color: #c0392b; }
.badge-amarelo { background: #fef3cd; color: #856404; }
.badge-azul    { background: #d6eaf8; color: #1a5276; }
.badge-cinza   { background: #eaecef; color: #5a6472; }

/* ===== ALERTAS ===== */
.alerta {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.alerta-erro    { background: #fde8e6; color: #c0392b; border-left: 4px solid var(--erro); }
.alerta-sucesso { background: #d4f1e4; color: #1a8a4a; border-left: 4px solid var(--sucesso); }
.alerta-aviso   { background: #fef3cd; color: #856404; border-left: 4px solid var(--aviso); }

/* ===== LOADING ===== */
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--borda);
  border-top-color: var(--acento); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.8);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,30,53,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 32px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15,30,53,0.2);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-titulo { font-size: 20px; color: var(--primaria); }
.modal-fechar { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--texto-suave); }

/* ===== UTILITÁRIOS ===== */
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.text-suave { color: var(--texto-suave); }
.text-acento { color: var(--acento); }
.fw-600 { font-weight: 600; }
.d-none { display: none !important; }
.w-100 { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; min-height: 48px; }
  input, select, textarea { font-size: 16px !important; } /* Previne zoom no iOS */
}
