/* 
 * Estilos principais do Sistema de Gestão Jurídica
 * Paleta: azul-escuro profissional + branco + cinzas funcionais
 * Hierarquia clara, espaçamentos consistentes, sem exageros
 */

/* Importar fonte moderna (Inter) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variáveis CSS - nomes descritivos do domínio jurídico */
:root {
  /* Cores principais - azul escritório de advocacia */
  --azul-escuro: #0f172a; /* Slate 900 - Mais sóbrio */
  --azul-medio: #2563eb; /* Blue 600 - Ação */
  --azul-claro: #eff6ff; /* Blue 50 - Fundo suave */
  --azul-hover: #1d4ed8;
  
  /* Neutros para textos e fundos */
  --branco: #ffffff;
  --cinza-escuro: #334155; /* Slate 700 */
  --cinza-medio: #64748b; /* Slate 500 */
  --cinza-claro: #cbd5e1; /* Slate 300 */
  --cinza-fundo: #f1f5f9; /* Slate 100 - Fundo geral */
  --cinza-borda: #e2e8f0; /* Slate 200 */
  --cinza-placeholder: #94a3b8;
  
  /* Status processual */
  --status-ativo: #10b981;
  --status-arquivado: #6b7280;
  --status-prazo-vermelho: #ef4444;
  --status-prazo-amarelo: #f59e0b;
  --status-prazo-verde: #10b981;
  
  /* Tipografia */
  --fonte-principal: 'Inter', system-ui, -apple-system, sans-serif;
  --altura-linha: 1.5;
  
  /* Espaçamentos consistentes */
  --espaco-xs: 4px;
  --espaco-sm: 8px;
  --espaco-md: 16px;
  --espaco-lg: 24px;
  --espaco-xl: 32px;
  
  /* Bordas arredondadas sutis */
  --borda-arredondada: 8px;
  --borda-arredondada-lg: 12px;
  
  /* Sombras profissionais (sem exageros) */
  --sombra-card: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --sombra-elevada: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --sombra-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===========================
   DARK MODE (Tema Escuro)
   =========================== */
body.dark-mode {
  --branco: #1e293b;        /* Slate 800 - Cards/Sidebar */
  --cinza-fundo: #0f172a;   /* Slate 900 - Background App */
  --azul-escuro: #f8fafc;   /* Slate 50 - Texto Principal (Invertido) */
  --cinza-escuro: #cbd5e1;  /* Slate 300 - Texto Secundário */
  --cinza-medio: #94a3b8;   /* Slate 400 */
  --cinza-claro: #475569;   /* Slate 600 */
  --cinza-borda: #334155;   /* Slate 700 - Bordas */
  --azul-claro: #1e3a8a;    /* Azul escuro para fundos */
  --cinza-placeholder: #64748b;
}

/* Ajustes específicos do Dark Mode */
body.dark-mode .sidebar {
  border-right: 1px solid var(--cinza-borda);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #0f172a; /* Fundo input escuro */
  border-color: var(--cinza-borda);
  color: var(--azul-escuro);
}

/* Garantir contraste no campo de título/assunto do Atendimento no dark mode */
body.dark-mode #atend-titulo,
body.dark-mode #atend-titulo::placeholder {
  color: #0b1220 !important; /* preto quase-azulado para máxima legibilidade */
}

body.dark-mode #atend-titulo::placeholder {
  opacity: 0.7;
  color: rgba(11, 18, 32, 0.65) !important;
}

body.dark-mode #atend-titulo:disabled,
body.dark-mode #atend-titulo[disabled] {
  color: #334155 !important;
}



body.dark-mode .recent-table tr:hover td {
  background-color: var(--cinza-borda);
}

/* Banner ajustado para Dark Mode (mantém fundo escuro para texto branco) */
body.dark-mode .welcome-banner {
  background: linear-gradient(135deg, #312e81 0%, #1e3a8a 100%); /* Índigo profundo */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ===========================
   ANIMAÇÕES GLOBAIS
   =========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.9) translateY(10px); }
  60% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

/* Layout geral da aplicação */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--cinza-fundo);
}

/* Main content - flexível ao lado da sidebar */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  max-width: calc(100% - 280px); /* Considera sidebar de 260px + margem */
  height: 100vh;
}

/* Loading overlay global */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-overlay i {
  color: var(--azul-escuro);
  margin-bottom: var(--espaco-md);
}

/* Tipografia com hierarquia */
h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--azul-escuro);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--azul-escuro);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cinza-escuro);
  margin-bottom: var(--espaco-xs);
}

p {
  color: var(--cinza-medio);
  margin-bottom: var(--espaco-sm);
  line-height: 1.6;
}

/* ===========================
   PAGE HEADER (Páginas Internas)
   =========================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Centraliza verticalmente botões e títulos */
  margin-bottom: 2rem;
  background: transparent;
  animation: fadeInUp 0.5s ease-out backwards;
  flex-wrap: wrap; /* Responsivo */
  gap: 1rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--cinza-medio);
  margin: 0;
}

/* ===========================
   DASHBOARD BANNER (Tela Inicial)
   =========================== */
.welcome-banner {
  background: linear-gradient(120deg, #2563eb 0%, #1e40af 100%);
  padding: 2.5rem;
  border-radius: 20px;
  color: white;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(30, 58, 138, 0.3);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Efeito decorativo no banner */
.welcome-banner::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
}

/* Segundo elemento decorativo para o banner */
.welcome-banner::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 10% 80%, rgba(255,255,255,0.1) 0%, transparent 20%);
  pointer-events: none;
}

.welcome-banner h1,
.welcome-banner #saudacao,
#saudacao {
  color: #ffffff !important;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.welcome-banner p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin: 0;
}

/* Cards genéricos - processos, clientes, publicações */
.processo-card,
.cliente-card {
  background: var(--branco);
  border: 1px solid var(--cinza-borda);
  border-radius: var(--borda-arredondada-lg);
  padding: var(--espaco-lg);
  margin-bottom: var(--espaco-lg);
  box-shadow: var(--sombra-card);
  transition: all 0.2s ease;
  border: none; /* Remove borda dura em favor da sombra */
  animation: fadeInUp 0.5s ease-out backwards;
}

.processo-card:hover,
.cliente-card:hover {
  box-shadow: var(--sombra-elevada);
  transform: translateY(-4px);
}

/* Botões profissionais */
.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--espaco-xs);
  padding: var(--espaco-sm) var(--espaco-md);
  border-radius: var(--borda-arredondada);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--azul-medio);
  color: var(--branco);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--azul-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Efeito de clique físico (tátil) */
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-sm:active {
  transform: scale(0.95) !important;
}

.btn-secondary {
  background: transparent;
  color: var(--azul-escuro); /* Texto preto/escuro no tema claro */
  border: 1px solid var(--cinza-borda);
  background: var(--branco);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--cinza-medio);
  color: var(--azul-escuro);
}

/* Estilos para barras de progresso/carga de trabalho no Dashboard */
.workload-container {
  margin-top: var(--espaco-md);
}

.workload-item {
  margin-bottom: var(--espaco-sm);
}

.workload-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--cinza-escuro);
}

.workload-bar-bg {
  height: 8px;
  background: var(--cinza-borda);
  border-radius: 4px;
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  background: var(--azul-medio);
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

/* ===========================
   FORMULÁRIOS MODERNOS
   =========================== */
.form-group {
  margin-bottom: var(--espaco-lg);
}

label {
  display: block;
  font-weight: 500;
  color: var(--cinza-escuro);
  margin-bottom: var(--espaco-xs);
  font-size: 0.875rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--borda-arredondada);
  font-size: 1rem;
  color: var(--azul-escuro);
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder {
  color: var(--cinza-placeholder);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--azul-medio);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); /* Anel de foco suave */
  transform: translateY(-1px); /* Input "levanta" ao focar */
}

.error-message {
  background: #fef2f2;
  color: #dc2626;
  padding: var(--espaco-sm);
  border: 1px solid #fecaca;
  border-radius: var(--borda-arredondada);
  margin-top: var(--espaco-sm);
  font-size: 0.875rem;
}

/* Badge de status/prazos */
.status-badge,
.prazo-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-ativo { background: #d1fae5; color: var(--status-ativo); }
.prazo-verde { background: #d1fae5; color: var(--status-prazo-verde); }
.prazo-amarelo { background: #fef3c7; color: var(--status-prazo-amarelo); }
.prazo-vermelho { background: #fecaca; color: var(--status-prazo-vermelho); }

/* Badge de tipo de evento jurídico: compacto e alinhado */
.badge-tipo-judicial {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.badge-tipo-administrativo {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

/* Responsivo */
@media (max-width: 768px) {
  .main-content {
    padding: var(--espaco-md);
    max-width: 100%;
  }
  
  h1 { font-size: 1.5rem; }
}

/* Tabelas compactas: reduz padding interno sem perder legibilidade */
.recent-table td {
  padding: 10px 14px;
}

.recent-table th {
  padding: 10px 14px;
}


/* Dashboard KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--espaco-lg);
  margin-top: var(--espaco-lg);
}

.kpi-card {
  background: var(--branco);
  padding: var(--espaco-lg);
  border-radius: 20px; /* Mais arredondado */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: var(--espaco-lg);
  border: 1px solid rgba(241, 245, 249, 0.8);
  position: relative;
  overflow: hidden;
}

/* Cascata de animação para os cards */
.kpi-card:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.1s backwards; }
.kpi-card:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.2s backwards; }
.kpi-card:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.3s backwards; }
.kpi-card:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.4s backwards; }

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px; /* Quadrado arredondado (estilo iOS) */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.kpi-card:hover .kpi-icon { transform: scale(1.1) rotate(3deg); }

/* Cores dos ícones */
.icon-blue { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: #2563eb; }
.icon-green { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); color: #16a34a; }
.icon-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); color: #ea580c; }
.icon-purple { background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); color: #9333ea; }

.kpi-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cinza-escuro);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.85rem;
  color: var(--cinza-medio);
}

/* Layout Grid Dashboard */
.dashboard-content-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--espaco-lg);
  margin-top: var(--espaco-lg);
}

@media (max-width: 1024px) {
  .dashboard-content-grid { grid-template-columns: 1fr; }
}

/* Seções de Cards */
.card-section {
  background: var(--branco);
  border: none;
  border-radius: 20px;
  padding: var(--espaco-lg);
  box-shadow: var(--sombra-card);
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.card-section h2 {
  font-size: 1.15rem;
  color: var(--azul-escuro);
  margin-bottom: var(--espaco-md);
  padding-bottom: var(--espaco-sm);
  border-bottom: 1px solid #f1f5f9;
}

/* Ações Rápidas */
.quick-actions {
  display: grid;
  gap: var(--espaco-md);
}

.action-card {
  display: flex;
  align-items: center;
  gap: var(--espaco-md);
  padding: var(--espaco-md);
  background: var(--cinza-fundo);
  border-radius: 12px;
  text-decoration: none;
  color: var(--cinza-escuro);
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.action-card:hover { 
  background: white; 
  border-color: var(--cinza-borda); 
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); 
  transform: translateY(-2px); 
  color: #000 !important; /* Fonte preta no hover */
}

.action-card i { color: var(--azul-medio); font-size: 1.2rem; }

/* Tabela Recentes */
.recent-table { width: 100%; border-collapse: collapse; }
.recent-table th { 
  text-align: left;
  padding: 10px 14px;
  color: var(--cinza-medio);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--cinza-fundo);
  vertical-align: middle;
}

.recent-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.recent-table td:last-child > div {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

/* Garante que o conteúdo “sempre” ocupe a altura da linha no tbody */
.recent-table tbody td > div,
.recent-table tbody td > small {
  display: block;
}


.recent-table td { padding: 10px 14px; border-bottom: 1px solid var(--cinza-fundo); font-size: 0.95rem; color: var(--cinza-escuro); vertical-align: top; }
.recent-table tr:last-child td { border-bottom: none; }
.recent-table tr:hover td { background: #f8fafc; }

/* Animação em cascata (dominó) para linhas da tabela */
.recent-table tbody tr {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.recent-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.recent-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.recent-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.recent-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.recent-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.recent-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.recent-table tbody tr:nth-child(7) { animation-delay: 0.35s; }

.recent-table strong { font-weight: 600; color: var(--azul-escuro); }

.text-muted { color: var(--cinza-medio); font-size: 0.8rem; display: block; }
.text-center { text-align: center; }

.btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
  border: 1px solid var(--cinza-borda);
  border-radius: 4px;
  text-decoration: none;
  color: var(--cinza-escuro);
}
.btn-sm:hover { background: var(--cinza-fundo); }

/* ===========================
   MODAIS PREMIUNS
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6); /* Azul escuro semi-transparente */
  backdrop-filter: blur(4px); /* Efeito de vidro */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  width: 95%;
  max-width: 1000px; /* Ponto de equilíbrio ideal */
  max-height: 90vh;
  overflow-y: auto;
  background: var(--branco);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--sombra-modal);
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efeito elástico (Spring) */
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--cinza-borda);
}
.modal-header h2 { margin: 0; font-size: 1.25rem; color: var(--azul-escuro); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Deixa formulários em modais mais compactos */
.modal-body .form-group {
  margin-bottom: var(--espaco-md); /* 16px em vez de 24px */
}

/* ESTILO VISUALIZAÇÃO (READ-ONLY PREMIUM) */
/* Quando o modal tem a classe .mode-view */
.mode-view input:disabled,
.mode-view select:disabled,
.mode-view textarea:disabled {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--cinza-borda);
  border-radius: 0;
  padding: 8px 0;
  color: var(--azul-escuro);
  font-weight: 600;
  opacity: 1; /* Remove transparência padrão de disabled */
  cursor: default;
  -webkit-appearance: none; /* Remove a seta no Chrome/Safari */
  appearance: none; /* Remove a seta no Firefox/Edge */
}

.mode-view label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--azul-medio);
}

.modal-footer {
  padding: 16px 24px;
  background: var(--cinza-fundo);
  border-top: 1px solid var(--cinza-borda);
  border-radius: 0 0 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===========================
   TELA DE LOGIN (Premium & Animada)
   =========================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, #3d342b 0%, #1a1612 100%); /* Gradiente radial profundo e elegante */
  font-family: var(--fonte-principal);
  position: relative;
  overflow: hidden;
}

/* Elementos de Fundo Animados (Blobs) */
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: floatBlob 10s infinite alternate ease-in-out;
  z-index: 1;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #b8860b; /* Dark Goldenrod - Dourado mais clássico */
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: #cd853f; /* Peru - Tom terroso dourado */
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 50px) scale(1.1); }
}

.login-card {
  background: rgba(255, 255, 255, 0.95); /* Quase opaco para legibilidade */
  width: 100%;
  max-width: 400px; /* Mais compacto */
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); /* Sombra profunda */
  z-index: 10; /* Acima dos blobs */
  position: relative;
  backdrop-filter: blur(10px); /* Efeito vidro se background tiver transparência */
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1), floatCard 6s ease-in-out infinite;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); /* Transição suave ao sumir */
}

/* Estado oculto do cartão ao logar */
.login-card.hidden {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
}

/* Animação sutil de flutuação no card */
@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Garante que nada vaze do card */
.login-card * {
  box-sizing: border-box;
}

.brand-area {
  text-align: center;
  margin-bottom: 24px;
}

.brand-logo img {
  max-width: 240px; /* Aumentado para maior destaque */
  height: auto;
  margin-bottom: 16px;
  border-radius: 8px; /* Leve arredondamento se necessário */
  /* Opcional: Sombra suave para destacar o fundo branco sobre o cartão branco */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); 
}

/* Ajuste fino para harmonizar com o dourado da logo */
.btn-login {
  background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%); /* Gradiente Dourado */
  color: #fff;
  border: none;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--azul-escuro);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--cinza-medio);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Inputs do Login Customizados */
.login-input-group {
  position: relative;
  margin-bottom: 20px;
}

.login-input-group i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  transition: color 0.3s ease;
  z-index: 2;
}

.login-input-group input {
  width: 100%;
  padding: 14px 16px 14px 44px; /* Espaço para o ícone */
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  color: var(--azul-escuro);
}

.login-input-group input:focus {
  background: #fff;
  border-color: var(--azul-medio);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-input-group input:focus + i {
  color: var(--azul-medio); /* Ícone muda de cor no foco */
}

/* Botão de Login com Gradiente */
.btn-login {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(202, 138, 4, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(202, 138, 4, 0.4);
}

/* Tela de Boas-vindas (Overlay) */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95); /* Fundo escuro levemente translúcido */
  backdrop-filter: blur(20px); /* Blur intenso no fundo */
  z-index: 9999;
  display: none; /* Controlado via JS */
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

/* Animação de Deslize para a Direita */
@keyframes slideOutRight {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 1; }
}

.slide-out-animation {
  animation: slideOutRight 0.8s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

/* Animações internas do Overlay */
.welcome-content i {
  opacity: 0;
  transform: scale(0.5);
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.welcome-content h2, 
.welcome-content h3 {
  color: #ffffff !important;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards 0.1s;
}

.welcome-content p {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.2s;
}

.loading-bar {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 32px auto 0;
  overflow: hidden;
  position: relative;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards 0.3s;
}

.loading-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  transform: translateX(-100%);
  animation: loadProgress 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.5s;
}

@keyframes popIn {
  to { opacity: 1; transform: scale(1); }
}

@keyframes loadProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0%); }
}

/* ===========================
   NOTIFICAÇÕES (TOASTS)
   =========================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--branco);
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 450px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
}

/* Ajuste de visibilidade para Dark Mode */
body.dark-mode .toast {
  background: #334155; /* Slate 700 - Mais claro que o fundo */
  color: #ffffff;
  border: 1px solid #475569;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

@keyframes slideInRight {
  0% { transform: translateX(100%) scale(0.9); opacity: 0; }
  70% { transform: translateX(-5px) scale(1.02); opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* Tipos de Toast */
.toast-success { border-left-color: #10b981; }
.toast-success i { color: #10b981; font-size: 1.2rem; }

.toast-error { border-left-color: #ef4444; }
.toast-error i { color: #ef4444; font-size: 1.2rem; }

/* Aviso Chamativo (Warning High Visibility) */
.toast-warning { 
  border-left: 6px solid #f59e0b;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left-width: 6px;
  box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.2);
}
.toast-warning i { 
  color: #d97706; 
  font-size: 1.4rem; 
  animation: pulseWarning 1.5s infinite;
}
.toast-warning span {
  color: #92400e;
  font-weight: 700;
}

@keyframes pulseWarning {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.toast-info { border-left-color: var(--azul-medio); }
.toast-info i { color: var(--azul-medio); font-size: 1.2rem; }

/* Estilo de erro no Input */
.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ======================
   CLIENTE MODAL RESPONSIVE
   ====================== */

/* Classes específicas para modal cliente */
#modal-container.modal-cliente {
  align-items: flex-start;
  padding: 1rem;
}

#modal-container.modal-cliente .modal-content {
  /* Removemos as larguras forçadas para respeitar o .modal-content base */
  margin: auto;
}

#modal-container.modal-cliente .modal-body {
  display: block; /* O grid agora é controlado pelas classes form-grid dentro do HTML */
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
}

/* Grids responsivos para formulário cliente - MAIS COMPACTO */
.form-grid-main {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}

.form-grid-contact {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 0.25rem 0.5rem;
}

.form-grid-endereco {
  display: grid;
  grid-template-columns: 80px 1fr 60px 1fr 120px 50px;
  gap: 0.25rem;
}

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

.form-grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
}

/* Linha de formulário com campos lado a lado */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

.section-title {
  font-size: 0.8rem;
  color: var(--azul-escuro);
  margin: 0.75rem 0 0.25rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.125rem;
  font-weight: 600;
}

.form-note {
  font-size: 0.75rem;
  color: var(--cinza-medio);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Compact labels e inputs para modal */
.modal-cliente .form-group label {
  font-size: 0.65rem;
  margin-bottom: 0.0625rem;
  font-weight: 600;
  color: var(--azul-escuro);
  text-transform: uppercase;
}

.modal-cliente input,
.modal-cliente select {
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
  border-radius: 0.125rem;
}

/* Close button */
.btn-close-modal {
  background: none;
  border: none;
  color: var(--cinza-medio);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.2s;
}

.btn-close-modal:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Busca no menu lateral */
.sidebar-search {
  padding: 10px 16px 6px 16px;
}

.sidebar-search-icon {
  display: inline-flex;
  margin-right: 8px;
  color: var(--azul-medio);
}

.sidebar-search input {
  width: calc(100% - 36px);
  display: inline-block;
  vertical-align: middle;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--cinza-borda);
  background: var(--branco);
  color: var(--azul-escuro);
}

body.dark-mode .sidebar-search input {
  background: #0f172a;
  border-color: var(--cinza-borda);
  color: var(--azul-escuro);
}

/* ======================
   MEDIA QUERIES RESPONSIVAS
   ======================


/* Tablet/Large Mobile */
@media (max-width: 1200px) {
  .form-grid-main,
  .form-grid-contact {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .form-grid-endereco {
    grid-template-columns: 100px 1fr 80px 1fr 1fr;
  }
}

/* Tablet Portrait */
@media (max-width: 992px) {
  .form-grid-main,
  .form-grid-contact {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .form-grid-endereco {
    grid-template-columns: 1fr 1fr;
  }
  
  .form-grid-inss {
    grid-template-columns: 1fr;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) {
  #modal-container.modal-cliente .modal-content {
    margin: 0.5rem;
    height: 95vh;
  }
  
  #modal-container.modal-cliente .modal-body {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .form-grid-main,
  .form-grid-contact,
  .form-grid-endereco {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  /* Touch targets maiores */
  .modal-cliente input,
  .modal-cliente select {
    padding: 0.75rem;
    font-size: 1rem;
  }
  
.modal-cliente label {
    font-size: 0.8rem;
  }
}

.modal-cliente .mode-view input:disabled,
.modal-cliente .mode-view select:disabled {
  background: #f8fafc;
  color: var(--cinza-medio);
}

/* Mobile Portrait Pequeno */
@media (max-width: 480px) {
  .btn-close-modal {
    font-size: 1.75rem;
    padding: 0.75rem;
  }
  
  .section-title {
    font-size: 0.9rem;
  }
}

/* Dark mode adjustments para novos elementos */
body.dark-mode .form-note {
  color: var(--cinza-claro);
}

body.dark-mode .section-title {
  color: var(--azul-escuro);
  border-bottom-color: var(--cinza-borda);
}
