/* Importa a fonte do Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* Define as variáveis de cor para o tema */
:root {
  --background: #f4f7fa; /* Um cinza bem claro para o fundo */
  --foreground: #1e293b; /* Um azul escuro para o texto */
  --card: #ffffff;
  --border: #e2e8f0;

  /* Cores da Marca */
  --primary: #2563eb; /* Azul extraído do seu logo */
  --primary-foreground: #ffffff; /* Texto para usar sobre a cor primária */
  --secondary: #f97316; /* Laranja do seu logo */

  /* Cores de Feedback */
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;

  --radius: 0.5rem; /* Raio da borda para cards e botões */
}

/* Resets e Estilos Globais */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: "Inter", sans-serif;
  font-size: 16px;
}

h1,
h2,
h3 {
  font-weight: 600;
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Componentes reutilizáveis que vamos criar */
.container {
  display: flex;
}

/* Estilos básicos para os formulários */
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "Inter", sans-serif;
}

button,
.button,
.button-final {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover,
.button:hover,
.button-final:hover {
  background-color: #1d4ed8; /* Um tom de azul mais escuro */
}
/* ==================
   LAYOUT PRINCIPAL (COM SIDEBAR FIXA)
   ================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;

  /* --- CORREÇÃO AQUI --- */
  position: fixed; /* Fixa a sidebar na tela */
  top: 0;
  left: 0;
  height: 100%; /* Garante que ela ocupe toda a altura */
  z-index: 1000; /* Garante que ela fique acima de outros elementos */
}

/* ... (O restante das regras do .sidebar-header, .sidebar-nav, etc., permanecem as mesmas) ... */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}
.sidebar-header .logo {
  width: 100px;
  height: auto;
}
.sidebar-header h2 {
  font-size: 1.25rem;
  margin: 0;
}
.sidebar-nav {
  flex-grow: 1;
}
.sidebar-nav ul {
  list-style: none;
}
.sidebar-nav ul li a {
  display: block;
  padding: 10px 15px;
  border-radius: var(--radius);
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--foreground);
  transition: background-color 0.2s, color 0.2s;
}
.sidebar-nav ul li a:hover {
  background-color: #f1f5f9;
  text-decoration: none;
}
.sidebar-nav ul li.active a {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-link,
.logout-button {
  text-align: center;
  padding: 10px;
  border-radius: var(--radius);
  font-weight: 500;
}
.settings-link {
  background-color: #f1f5f9;
  color: var(--foreground);
}
.logout-button {
  background-color: var(--danger);
  color: var(--primary-foreground);
}

.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;

  /* --- CORREÇÃO AQUI --- */
  margin-left: 250px; /* Adiciona uma margem à esquerda com a largura da sidebar */
}
/* ==================
   ESTILOS DO DASHBOARD
   ================== */

.welcome-banner {
  background: linear-gradient(90deg, var(--secondary) 0%, #f59e0b 100%);
  color: var(--primary-foreground);
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.welcome-banner p {
  color: #fff;
  opacity: 0.9;
}
.lightning-icon {
  font-size: 2.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
}
.stat-card h4 {
  color: #64748b;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--foreground);
}
.stat-value small {
  font-size: 0.5em;
  font-weight: 600;
}
.stat-icon {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: var(--primary);
  opacity: 0.2;
}

.actions-section {
  margin-bottom: 2rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.action-card {
  background-color: #f8fafc;
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
}
.action-card h4 {
  margin-bottom: 0.5rem;
}
.action-card p {
  color: #64748b;
  font-size: 0.9em;
  margin-bottom: 1rem;
}
.action-card a {
  font-weight: 600;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1em;
  color: #334155;
}

.lista-recente {
  list-style: none;
  padding: 0;
}
.lista-recente li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.lista-recente li:last-child {
  border-bottom: none;
}
.lista-recente strong {
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.empty-state span {
  font-size: 0.9em;
}
/* ==================
   ESTILOS DAS PÁGINAS DE DADOS (Tabelas)
   ================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.page-header h2 {
  margin-bottom: 0;
}

.content-card {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse; /* Remove o espaço entre as bordas */
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table thead th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #475569;
}

.data-table tbody tr:hover {
  background-color: #f1f5f9;
}

.data-table td.actions {
  text-align: right;
}

.data-table td.actions .button {
  padding: 6px 12px;
  font-size: 0.85em;
  margin-left: 5px;
}

/* Botões de Ação Específicos */
.btn-details {
  background-color: #64748b; /* Cinza */
}
.btn-details:hover {
  background-color: #475569;
}

.btn-edit {
  background-color: var(--warning); /* Laranja/Amarelo */
  color: #fff;
}
.btn-edit:hover {
  background-color: #d97706;
}

.btn-delete {
  background-color: var(--danger); /* Vermelho */
}
.btn-delete:hover {
  background-color: #b91c1c;
}

.empty-row {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
}
/* ==================
   ESTILOS DOS BOTÕES DE ÍCONE
   ================== */

.data-table td.actions .btn-icon {
  width: 36px; /* Largura fixa */
  height: 36px; /* Altura fixa */
  padding: 0; /* Remove o padding interno */
  font-size: 1em; /* Tamanho do ícone */
  display: inline-flex; /* Alinha o ícone no centro */
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

/* Cores específicas para os ícones */
.btn-icon.btn-details {
  background-color: #64748b; /* Cinza */
}
.btn-icon.btn-details:hover {
  background-color: #475569;
}

.btn-icon.btn-edit {
  background-color: var(--warning); /* Laranja/Amarelo */
  color: #fff;
}
.btn-icon.btn-edit:hover {
  background-color: #d97706;
}

.btn-icon.btn-delete {
  background-color: var(--danger); /* Vermelho */
}
.btn-icon.btn-delete:hover {
  background-color: #b91c1c;
}
/* ==================
   ESTILOS DA GESTÃO DE CONTRATOS
   ================== */

.gestao-container {
  display: flex;
  gap: 1.5rem;
}

.lista-contratos {
  width: 40%;
  max-width: 450px;
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.lista-contratos h4,
.preview-contrato h4 {
  margin-bottom: 1rem;
  font-size: 1.1em;
  color: #334155;
}

.lista-contratos-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contrato-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.contrato-item:last-child {
  border-bottom: none;
}

.contrato-item a {
  display: block;
  padding: 10px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--foreground);
  border: 1px solid transparent;
}

.contrato-item a:hover {
  background-color: #f8fafc;
  border-color: var(--border);
}

.contrato-item a.active {
  background-color: #eef2ff;
  border-color: var(--primary);
  color: var(--primary);
}

.contrato-item a strong {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.contrato-item a small {
  font-size: 0.85em;
  color: #64748b;
}

.contrato-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.form-status select {
  padding: 4px 8px;
  font-size: 0.85em;
  margin: 0;
}

.autosave-feedback {
  margin-left: 10px;
  font-style: italic;
  font-size: 0.8em;
  color: var(--primary);
}

.btn-icon-delete {
  color: #64748b;
  font-size: 1em;
  padding: 5px;
}
.btn-icon-delete:hover {
  color: var(--danger);
}

.empty-list {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  font-style: italic;
}

.preview-contrato {
  flex: 1;
}

.preview-contrato iframe {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 75vh;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: #94a3b8;
  text-align: center;
}
/* ==================
   ESTILOS DE FORMULÁRIOS
   ================== */

.form-fieldset {
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.fieldset-legend {
  font-size: 1.1em;
  font-weight: 600;
  padding: 0 10px;
  margin-left: 10px;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Cria 3 colunas por padrão */
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

/* Classes para controlar o tamanho das colunas no grid */
.grid-col-span-2 {
  grid-column: span 2;
}
.grid-col-span-full {
  grid-column: span 3;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9em;
}

/* Estilos para inputs, selects e textareas */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  background-color: #f8fafc;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: var(--radius);
  font-size: 1em;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #475569;
}
.btn-secondary:hover {
  background-color: #cbd5e1;
}
/* ==================
   ESTILOS DA PÁGINA DE DETALHES DO CLIENTE
   ================== */

.details-grid {
  display: grid;
  grid-template-columns: 1fr; /* Começa com uma coluna em telas pequenas */
  gap: 1.5rem;
}

/* Em telas maiores, divide em duas colunas */
@media (min-width: 992px) {
  .details-grid {
    grid-template-columns: 1fr 2fr; /* Coluna da esquerda menor, da direita maior */
  }
}

.details-col-left,
.details-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.details-list {
  list-style: none;
  padding: 0;
}
.details-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.details-list li:last-child {
  border-bottom: none;
}
.details-list li span {
  color: #64748b; /* Cor mais suave para o rótulo */
}
.details-list li strong {
  text-align: right;
}
.details-list li p {
  margin: 0;
  text-align: right;
  width: 60%;
}

.form-simulacao {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-simulacao .form-group {
  flex: 1;
}

.results-card .graficos {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.grafico-item {
  margin-bottom: 1.5rem;
}
.grafico-item h4 {
  text-align: center;
  font-weight: 500;
  color: #475569;
  margin-bottom: 1rem;
}

.acoes-proposta {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
}
.acoes-proposta h4 {
  margin-bottom: 1rem;
  font-weight: 600;
}
.botoes-finais {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
/* ==================
   ESTILOS DA PÁGINA DE DETALHES DO CLIENTE
   ================== */

.details-grid {
  display: grid;
  grid-template-columns: 1fr; /* Começa com uma coluna em telas pequenas */
  gap: 1.5rem;
}

/* Em telas maiores, divide em duas colunas */
@media (min-width: 992px) {
  .details-grid {
    grid-template-columns: 1fr 2fr; /* Coluna da esquerda menor, da direita maior */
  }
}

.details-col-left,
.details-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.details-list {
  list-style: none;
  padding: 0;
}
.details-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.details-list li:last-child {
  border-bottom: none;
}
.details-list li span {
  color: #64748b; /* Cor mais suave para o rótulo */
  flex-shrink: 0; /* Impede que o rótulo encolha */
}
.details-list li strong {
  text-align: right;
  font-weight: 500;
}
.details-list li p {
  margin: 0;
  text-align: right;
  width: 60%;
  font-size: 0.9em;
  color: #334155;
  line-height: 1.4;
}

.form-simulacao {
  display: flex;
  align-items: flex-end; /* Alinha o botão com o select */
  gap: 1rem;
}
.form-simulacao .form-group {
  flex: 1;
}
.form-simulacao label {
  margin-bottom: 0.5rem;
  display: block;
  font-weight: 500;
}
.form-simulacao select {
  margin-bottom: 0;
}
.form-simulacao button {
  margin-bottom: 0;
}

.results-card .graficos {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.results-card .graficos h4 {
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 1.5rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1200px) {
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.grafico-item {
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.grafico-item h5 {
  text-align: center;
  font-weight: 500;
  color: #475569;
  margin-bottom: 1rem;
}

.acoes-proposta {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
}
.acoes-proposta h4 {
  margin-bottom: 1rem;
  font-weight: 600;
}
.botoes-finais {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
/* ==================
   ESTILOS DO MODAL DE GRÁFICO
   ================== */

.modal-overlay {
  position: fixed; /* Fica fixo na tela */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 41, 59, 0.8); /* Fundo escuro semi-transparente */
  display: none; /* Começa escondido */
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Garante que fique acima de tudo */
  backdrop-filter: blur(5px); /* Efeito de desfoque no fundo */
  padding: 1rem;
}

.modal-overlay.active {
  display: flex; /* Classe que usamos via JS para mostrar o modal */
}

.modal-content {
  background-color: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px; /* Largura máxima do modal */
  max-height: 90vh; /* Altura máxima */
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: zoomIn 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2.5rem;
  font-weight: bold;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover {
  color: var(--foreground);
}

/* Animação simples de zoom para o modal */
@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* ==================
   MELHORIAS DE INTUIÇÃO NO DASHBOARD
   ================== */

.stat-card-link {
  text-decoration: none;
  color: inherit;
}

.stat-card {
  transition: box-shadow 0.2s, border-color 0.2s;
}

.stat-card-link:hover .stat-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.stat-card .stat-value {
  margin-bottom: 0.25rem; /* Reduz a margem para dar espaço ao subtítulo */
}

.stat-card .stat-subtitle {
  font-size: 0.8em;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}
/* ==================
   MELHORIAS NO HEADER / SIDEBAR
   ================== */

.sidebar {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Efeito "elevado" */
  z-index: 1001; /* Garante que a sombra apareça corretamente */
}

.sidebar-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .header-title span {
  font-size: 0.8em;
  color: #64748b;
}

.sidebar-nav ul li a {
  display: flex; /* Alinha ícone e texto */
  align-items: center;
  gap: 12px; /* Espaço entre ícone e texto */
}

.sidebar-nav ul li a i {
  width: 20px; /* Largura fixa para o ícone */
  text-align: center;
  font-size: 1.1em;
  opacity: 0.7;
}

.sidebar-nav ul li.active a {
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2); /* Sombra sutil no item ativo */
}

.sidebar-nav ul li.active a i {
  opacity: 1;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.nav-link-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--foreground);
  transition: background-color 0.2s, color 0.2s;
}

.nav-link-bottom i {
  width: 20px;
  text-align: center;
  font-size: 1.1em;
  opacity: 0.7;
}

.nav-link-bottom:hover {
  background-color: #f1f5f9;
  text-decoration: none;
}
.nav-link-bottom.active {
  background-color: #eef2ff;
  color: var(--primary);
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 10px;
  background-color: #f8fafc;
  border-radius: var(--radius);
}

.user-info span {
  font-weight: 500;
  font-size: 0.9em;
}

.user-info a {
  color: #64748b;
  font-size: 1.2em;
  padding: 5px;
}
.user-info a:hover {
  color: var(--danger);
}
/* ==================
   ESTILOS DA PÁGINA DE LOGIN
   ================== */

.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #eef2ff; /* Um fundo azul bem claro */
  background-image: radial-gradient(
      circle at 15% 15%,
      rgba(37, 99, 235, 0.1) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 75%,
      rgba(249, 115, 22, 0.1) 0%,
      transparent 40%
    );
}

.login-container {
  background: var(--card);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.5rem;
}
.login-logo img {
  width: 150px; /* Ou o tamanho que preferir */
  height: 150px; /* Mesmo valor da largura para formar um círculo perfeito */
  border-radius: 50%; /* Deixa a borda totalmente redonda */
  object-fit: cover; /* Garante que a imagem preencha o espaço sem distorcer */
  margin-bottom: 0.5rem;
}
.login-logo h1 {
  font-size: 1.5rem;
  color: var(--foreground);
  margin: 0;
}

.login-container .feedback.error {
  margin-bottom: 1.5rem;
}
/* ==================
   BARRA DE NAVEGAÇÃO INFERIOR (MOBILE)
   ================== */

.bottom-nav {
  display: none; /* Escondido em telas grandes */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.bottom-nav a {
  flex: 1; /* Faz com que todos os links ocupem o mesmo espaço */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  color: #64748b;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
}

.bottom-nav a i {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.bottom-nav a.active {
  color: var(--primary);
}
/* ==================
   ESTILOS DO RODAPÉ
   ================== */

.footer {
    width: 100%;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85em;
    color: #64748b; /* Um cinza azulado suave */
}

.footer p {
    margin-bottom: 0.25rem;
}

.footer a {
    color: #475569; /* Um cinza um pouco mais escuro */
    font-weight: 500;
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}
/* =================================
   5. RESPONSIVIDADE
   ================================= */

/* --- Mobile Nav & Header --- */
.bottom-nav, .mobile-header {
    display: none;
    position: fixed;
    width: 100%;
    background-color: var(--card);
    z-index: 1000;
}
.bottom-nav { bottom: 0; left: 0; border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.mobile-header { top: 0; left: 0; height: 60px; border-bottom: 1px solid var(--border); padding: 0 1rem; align-items: center; justify-content: space-between; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; color: #64748b; text-decoration: none; font-size: 0.75rem; font-weight: 500; }
.bottom-nav a i { font-size: 1.25rem; margin-bottom: 4px; }
.bottom-nav a.active { color: var(--primary); }
.mobile-header-logo { display: flex; align-items: center; gap: 10px; }
.mobile-header-logo img { height: 35px; width: auto; }
.mobile-header-logo span { font-weight: 600; font-size: 1.1em; }
.mobile-header-actions { display: flex; align-items: center; gap: 1rem; }
.mobile-header-actions a { color: #475569; font-size: 1.3rem; text-decoration: none; }
.mobile-header-actions a:hover { color: var(--primary); }


/* --- Ponto de Quebra Principal (Tablets e Celulares) --- */
@media (max-width: 992px) {
    .sidebar{
        display: none;
    }
    .mobile-header, .bottom-nav {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 80px;
        padding-bottom: 90px;
    }
    .bottom-grid, .details-grid, .gestao-container {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .chart-grid {
        grid-template-columns: 1fr;
    }
    .lista-contratos {
        width: 100%;
        max-width: none;
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border);
        padding-bottom: 1.5rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .grid-col-span-2, .grid-col-span-full {
        grid-column: span 1;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions .button, .form-actions .button-final, .form-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* --- Ponto de Quebra para Tabelas (Celulares) --- */
@media (max-width: 768px) {
    .data-table {
        border: none;
    }
    .data-table thead {
        display: none;
    }
    .data-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1rem;
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
    }
    .data-table td:last-child {
        border-bottom: none;
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        margin-right: 1rem;
        color: #475569;
    }
    .data-table td.actions {
        justify-content: flex-end;
    }
    .data-table td.actions::before {
        content: "";
    }
}

/* --- Ponto de Quebra para Celulares Pequenos --- */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .main-content {
        padding: 1rem;
        padding-top: 75px;
        padding-bottom: 80px;
    }
    .stat-value {
        font-size: 1.8rem;
    }
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* ==================
   ANIMAÇÕES E TRANSIÇÕES FINAIS
   ================== */

/* Animação de entrada (fade-in e slide-up sutil) */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aplica a animação de entrada aos principais blocos de conteúdo */
.welcome-banner,
.stat-card,
.content-card,
.action-card {
  animation: fadeInSlideUp 0.5s ease-out forwards;
  opacity: 0; /* Começa invisível para a animação funcionar */
}

/* Efeito de "cascata": faz os cards aparecerem um após o outro */
.stats-grid .stat-card:nth-child(1) {
  animation-delay: 0.1s;
}
.stats-grid .stat-card:nth-child(2) {
  animation-delay: 0.2s;
}
.stats-grid .stat-card:nth-child(3) {
  animation-delay: 0.3s;
}
.stats-grid .stat-card:nth-child(4) {
  animation-delay: 0.4s;
}

.bottom-grid .content-card:nth-child(1) {
  animation-delay: 0.5s;
}
.bottom-grid .content-card:nth-child(2) {
  animation-delay: 0.6s;
}

/* Aprimora as transições de hover nos botões e links */
.button,
.button-final,
.btn-secondary,
.sidebar-nav ul li a,
.bottom-nav a,
.stat-card {
  transition: all 0.2s ease-in-out;
}

/* Transição mais suave para o formulário de status do contrato */
.contrato-item a {
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

