      :root {
  /* Cores Base44 (Mais profundas e azuladas) */
  --bg-dark: #0B1120; /* Fundo geral mais escuro */
  --bg-panel: #151e32; /* Fundo dos cards (levemente mais claro) */
  --bg-sidebar: #0B1120; /* Sidebar igual ao fundo para parecer flutuante */
  
  /* Bordas quase invisíveis */
  --border: #2A3241; 
  
  /* Textos */
  --text-primary: #F1F5F9;
  --text-muted: #94A3B8;
  
  /* Cores de Ação (Mais vibrantes para contraste) */
  --primary: #F59E0B; /* Seu Laranja */
  --primary-hover: #D97706;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --purple: #8B5CF6;
  
  --sidebar-width: 260px; /* Um pouco mais fina */
  --card-radius: 16px;    /* Arredondamento padrão */
}
      
      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      
      body {
        font-family: 'Poppins', sans-serif;
        background: var(--bg-dark);
        color: var(--text-primary);
        overflow-x: hidden;
      }
      
      /* NOVO LAYOUT */
      .app-container {
        display: flex;
        min-height: 100vh;
      }
      
      /* SIDEBAR LATERAL FIXA */
      .sidebar-left {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  /* Removemos a borda direita para ficar clean */
  border-right: none; 
  transition: transform 0.3s ease;
}
      
      .sidebar-left.mobile-hidden {
        transform: translateX(-100%);
      }
      
      /* Header da Sidebar */
      .sidebar-header {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}
      
      .sidebar-logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 0px;
        border-radius: 50%;
        background: var(--bg-panel);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border: 2px solid var(--primary);
        position: relative;
      }
      
      .sidebar-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }
      
      .sidebar-logo i {
        font-size: 1.8rem;
        color: var(--primary);
        position: absolute;
      }
      
      .sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.sidebar-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
      
      /* Menu de Navegação */
  .sidebar-nav {
  flex: 1;
  overflow-y: auto;  /* Mantém a rolagem funcional */
  overflow-x: hidden;
  padding: 12px 0;
  min-height: 0;
  scrollbar-width: none;  /* Esconde a barra no Firefox */
}

/* --- NOVO ESTILO DA BARRA DE ROLAGEM (SIDEBAR) --- */

/* 1. Para Firefox */
.sidebar-nav {
  scrollbar-width: thin; /* Barra fina */
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent; /* Cor do "polegar" e do fundo */
}

/* 2. Para Chrome, Edge e Safari */
.sidebar-nav::-webkit-scrollbar {
  display: block; /* Garante que apareça */
  width: 6px;     /* Largura fina (6px é ideal) */
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent; /* Fundo transparente para não poluir */
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15); /* Cinza translúcido sutil */
  border-radius: 10px; /* Bordas bem redondas */
  border: 2px solid transparent; /* Cria um respiro */
  background-clip: content-box;
  transition: background-color 0.3s;
}

/* Quando passar o mouse, ela acende na cor do sistema */
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary); 
}      
      .nav-section {
  margin-bottom: 16px;
}
      
      .nav-section-title {
  padding: 0 16px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
      
      .nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 0.9rem;

  /* --- NOSSAS MUDANÇAS --- */
  margin: 4px 12px;       /* Cria espaço entre os botões */
  border-radius: 8px;     /* Arredonda as bordas */
  border: 1px solid transparent; /* Cria um contorno transparente para manter o espaço */
}

.nav-item:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary);

  /* --- MUDANÇA --- */
  border: 1px solid var(--border); /* Mostra um contorno sutil ao passar o mouse */
}

.nav-item.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  font-weight: 600;

  /* --- MUDANÇA --- */
  border: 1px solid var(--primary); /* Destaca o contorno do item ativo */
}
      
      .nav-item i {
  width: 20px;
  margin-right: 10px;
  font-size: 1rem;
}
      
      /* Footer da Sidebar */
      .sidebar-footer {
  padding: 1px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
      
      .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}
      
      .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--bg-dark);
  font-size: 0.9rem;
}
      
      .user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}
      
      /* CONTEÚDO PRINCIPAL */
      .main-wrapper {
        flex: 1;
        margin-left: var(--sidebar-width);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
      }
      
      /* Top Bar - Versão Sólida */
.top-bar {
  height: 80px;
  background: var(--bg-panel); /* Mudado para a cor sólida dos painéis (#151e32) */
  /* backdrop-filter: blur(10px);  <-- REMOVIDO O EFEITO DE VIDRO */
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 2000;
}
      
      .top-bar-left {
        display: flex;
        align-items: center;
        gap: 12px;
      }
      
      .top-bar-left h1 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
      }
      
      .top-bar-right {
        display: flex;
        gap: 12px;
        align-items: center;
      }
      
      .top-bar-btn {
        padding: 8px 16px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s;
        font-size: 0.9rem;
      }
      
      .top-bar-btn:hover {
        background: var(--primary);
        color: var(--bg-dark);
        border-color: var(--primary);
      }
      
      .mobile-menu-btn {
        display: none;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: var(--bg-sidebar);
        border: 1px solid var(--border);
        color: var(--text-primary);
        font-size: 1.2rem;
        cursor: pointer;
      }
      
      /* Conteúdo */
      .main-content {
        flex: 1;
        padding: 30px;
        overflow-y: auto;
      }
      
      .view-section {
        display: none;
      }
      
      .view-section.active {
        display: block;
        animation: fadeIn 0.3s ease;
      }
      
      @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
      }
      
      /* === CARDS E PROFUNDIDADE === */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 28px; /* Mais espaçamento interno */
  margin-bottom: 24px;
  /* Sombra suave */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); 
}
      
      .controls-row {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
      }
      
      /* Botões */
      .btn {
        padding: 10px 20px;
        border-radius: 8px;
        border: none;
        font-family: 'Poppins', sans-serif;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }
      
      .btn-primary {
  /* Gradiente sutil em vez de cor chapada */
  background: linear-gradient(135deg, var(--primary) 0%, #d97706 100%);
  color: white; /* Texto branco sempre garante contraste no laranja */
  border: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}
      
      .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(245, 158, 11, 0.3);
  filter: brightness(1.1);
}
      
      .btn-success {
        background: var(--success);
        color: white;
      }
      
      .btn-danger {
        background: var(--danger);
        color: white;
      }
      
      .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
      }
      
      /* Stats */
      .stats-overview {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 20px;
      }
      
      .stat-box {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 20px;
        text-align: center;
      }
      
      .stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: var(--primary);
        margin-bottom: 8px;
      }
      
      .stat-label {
        font-size: 0.85rem;
        color: var(--text-muted);
      }
      
      /* === TABELAS MODERNAS PREMIUM === */
.table-container {
  overflow-x: auto;
  background: var(--bg-panel);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

table {
  width: 100%;
  border-collapse: separate; /* Importante para bordas arredondadas */
  border-spacing: 0 4px; /* Espaço entre as linhas */
  margin-top: 8px;
}

thead {
  background: transparent;
}

th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: none;
}

tbody tr {
  background: var(--bg-dark);
  transition: all 0.2s ease;
}

tbody tr:hover {
  transform: scale(1.005); /* Leve efeito de zoom */
  background: rgba(59, 130, 246, 0.05); /* Azul bem suave */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
  position: relative;
}

td {
  padding: 16px;
  border: none; /* Remove bordas padrão */
  color: var(--text-primary);
  font-size: 0.9rem;
  vertical-align: middle;
}

/* Arredonda as pontas de cada linha */
tbody tr td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
tbody tr td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
      
      .empty-state {
        text-align: center;
        color: var(--text-muted);
        padding: 40px !important;
      }
      
      /* ==================== MODAL CORRIGIDO ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85); /* Fundo escuro atrás mais forte */
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 15px; /* Espaçamento para não colar na borda do celular */
  backdrop-filter: blur(4px); /* Desfoque elegante no fundo */
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

/* A JANELA DO MODAL (CORRIGIDA) */
.modal-content {
  background-color: var(--bg-panel); /* IMPORTANTE: Cor de fundo sólida */
  width: 100%;
  /* Limita a altura para caber na tela e habilita rolagem */
  max-height: 90vh; 
  overflow-y: auto; 
  
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  
  /* Garante que a largura respeite o max-width definido no HTML */
  margin: 0 auto; 
}

/* Animação de entrada */
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Cabeçalho do Modal Fixo (Opcional, ajuda na leitura) */
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel); /* Garante fundo no cabeçalho */
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-header h3 {
  color: var(--primary);
  font-size: 1.2rem;
  margin: 0;
}

/* Corpo do modal com espaçamento correto */
.modal-body {
  padding: 24px;
}

/* Rodapé do Modal */
.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: var(--bg-panel);
}

/* Botão de fechar */
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* Scrollbar dentro do modal (para ficar bonita) */
.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
      
      @keyframes slideUp {
        from { transform: translateY(50px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
      }
      
      .modal-header {
        padding: 24px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      
      .modal-header h3 {
        color: var(--primary);
        font-size: 1.3rem;
      }
      
      .modal-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: var(--bg-dark);
        color: var(--text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        transition: all 0.2s;
      }
      
      .modal-close:hover {
        background: var(--danger);
        color: white;
      }
      
      .modal-body {
        padding: 24px;
      }
      
      .form-group {
        margin-bottom: 20px;
      }
      
      /* === INPUTS MODERNOS === */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid transparent; /* Prepara para o foco */
  border-radius: 10px;
  background: #0f172a; /* Mais escuro que o painel */
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); /* Profundidade interna */
}

/* Efeito de Foco Brilhante */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  background: #1e293b;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); /* Aura laranja suave */
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.3px;
}
      
      .modal-footer {
        padding: 24px;
        border-top: 1px solid var(--border);
        display: flex;
        gap: 12px;
        justify-content: flex-end;
      }
      
      /* Action Buttons in Table */
      .action-btns {
        display: flex;
        gap: 8px;
      }
      
      /* Botões de Ação (Tabelas) - Redondos */
.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%; /* Totalmente redondo */
  border: none;
  transition: all 0.2s;
}
      
      .action-btn.edit {
        background: var(--info);
        color: white;
      }
      
      .action-btn.delete {
        background: var(--danger);
        color: white;
      }
      
      .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
      }
      
      /* Responsive */
      @media (max-width: 768px) {
        .sidebar-left {
          transform: translateX(-100%);
        }
        
        .sidebar-left.mobile-visible {
          transform: translateX(0);
        }
        
        .main-wrapper {
          margin-left: 0;
        }
        
        .mobile-menu-btn {
          display: flex;
        }
        
        .top-bar {
          padding: 0 15px;
        }
        
        .main-content {
          padding: 15px;
        }
        
        .stats-overview {
          grid-template-columns: 1fr;
        }
      }
      
      /* ==================== FINANCEIRO STYLES ==================== */
      .finance-header {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
      }
      
      .finance-card {
        background: linear-gradient(135deg, var(--bg-panel) 0%, rgba(30, 41, 59, 0.8) 100%);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 24px;
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
      }
      
      .finance-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        opacity: 0.1;
        filter: blur(40px);
      }
      
      .finance-card.receita::before {
        background: var(--success);
      }
      
      .finance-card.despesa::before {
        background: var(--danger);
      }
      
      .finance-card.saldo::before {
        background: var(--info);
      }
      
      .finance-card.pendente::before {
        background: var(--warning);
      }
      
      .finance-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
      }
      
      .finance-card-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        margin-bottom: 12px;
      }
      
      .finance-card.receita .finance-card-icon {
        background: rgba(16, 185, 129, 0.15);
        color: var(--success);
      }
      
      .finance-card.despesa .finance-card-icon {
        background: rgba(239, 68, 68, 0.15);
        color: var(--danger);
      }
      
      .finance-card.saldo .finance-card-icon {
        background: rgba(59, 130, 246, 0.15);
        color: var(--info);
      }
      
      .finance-card.pendente .finance-card-icon {
        background: rgba(245, 158, 11, 0.15);
        color: var(--warning);
      }
      
      .finance-card-label {
        font-size: 0.85rem;
        color: var(--text-muted);
        margin-bottom: 8px;
        font-weight: 500;
      }
      
      .finance-card-value {
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--text-primary);
      }
      
      .finance-card.receita .finance-card-value {
        color: var(--success);
      }
      
      .finance-card.despesa .finance-card-value {
        color: var(--danger);
      }
      
      .finance-card.saldo .finance-card-value {
        color: var(--info);
      }
      
      .finance-tabs {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
        border-bottom: 2px solid var(--border);
        padding-bottom: 0;
        flex-wrap: wrap;
      }
      
      .finance-tab {
        padding: 12px 24px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-family: 'Poppins', sans-serif;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        position: relative;
        transition: all 0.2s;
        border-radius: 8px 8px 0 0;
      }
      
      .finance-tab:hover {
        color: var(--primary);
        background: rgba(245, 158, 11, 0.05);
      }
      
      .finance-tab.active {
        color: var(--primary);
        background: rgba(245, 158, 11, 0.1);
      }
      
      .finance-tab.active::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--primary);
      }
      
      .finance-tab-content {
        display: none;
      }
      
      .finance-tab-content.active {
        display: block;
        animation: fadeIn 0.3s ease;
      }
      
      .badge {
        display: inline-block;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
      
      .badge.receita {
        background: rgba(16, 185, 129, 0.15);
        color: var(--success);
      }
      
      .badge.despesa {
        background: rgba(239, 68, 68, 0.15);
        color: var(--danger);
      }
      
      .badge.pago {
        background: rgba(16, 185, 129, 0.15);
        color: var(--success);
      }
      
      .badge.pendente {
        background: rgba(245, 158, 11, 0.15);
        color: var(--warning);
      }
      
      .badge.atrasado {
        background: rgba(239, 68, 68, 0.15);
        color: var(--danger);
      }
      
      .filter-row {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        align-items: center;
      }
      
      .filter-input {
        flex: 1;
        min-width: 200px;
        padding: 10px 16px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-dark);
        color: var(--text-primary);
        font-family: 'Poppins', sans-serif;
        font-size: 0.9rem;
      }
      
      .filter-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
      }
      
      .chart-container {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 24px;
        margin-bottom: 20px;
      }
      
      .chart-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
      }
      
      .chart-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--primary);
      }
      
      .parcela-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: var(--bg-dark);
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 8px;
        transition: all 0.2s;
      }
      
      .parcela-item:hover {
        background: rgba(245, 158, 11, 0.05);
        border-color: var(--primary);
      }
      
      .parcela-info {
        flex: 1;
      }
      
      .parcela-numero {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
      }
      
      .parcela-vencimento {
        font-size: 0.8rem;
        color: var(--text-muted);
      }
      
      .parcela-valor {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--primary);
        margin-right: 12px;
      }
      
      .previsao-mes {
        background: var(--bg-dark);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
      }
      
      .previsao-mes-nome {
        font-weight: 600;
        color: var(--primary);
        margin-bottom: 12px;
        font-size: 1rem;
      }
      
      .previsao-valores {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
      }
      
      .previsao-valor-item {
        text-align: center;
      }
      
      .previsao-valor-label {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-bottom: 4px;
      }
      
      .previsao-valor-numero {
        font-weight: 700;
        font-size: 0.95rem;
      }
      
      .form-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        margin-bottom: 16px;
      }
      
      /* Responsive Finance */
      @media (max-width: 768px) {
        .finance-header {
          grid-template-columns: 1fr;
        }
        
        .finance-tabs {
          overflow-x: auto;
          flex-wrap: nowrap;
        }
        
        .filter-row {
          flex-direction: column;
        }
        
        .filter-input {
          width: 100%;
        }
        
        .previsao-valores {
          grid-template-columns: 1fr;
        }
      }
      
     /* ==================== LEADS STYLES (Visual Card Box) ==================== */

.funil-container {
  /* Mudamos de Flex para Grid para ficar igual ao Dashboard */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 24px; /* Mais espaço entre as caixas */
  margin-top: 24px;
  padding-bottom: 20px;
}

.funil-stage {
  /* O SEGREDO: Um fundo levemente mais claro que o fundo da página */
  background-color: #151e32; /* Cor fixa para garantir o contraste */
  
  /* Borda sutil para delimitar a caixa */
  border: 1px solid rgba(255, 255, 255, 0.08);
  
  /* Arredondamento e Sombra para dar efeito 3D "flutuante" */
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); 
  
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  min-height: 220px; /* Altura mínima para ficarem uniformes */
}

.funil-stage:hover {
  transform: translateY(-5px); /* Levanta levemente ao passar o mouse */
  border-color: rgba(255, 255, 255, 0.2); /* Borda brilha */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.funil-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Linha divisória interna sutil */
}

.funil-stage-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 12px;
}

.funil-stage-count {
  font-size: 0.9rem;
  font-weight: 800;
  /* O fundo colorido virá do HTML, aqui definimos o shape */
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 32px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.funil-stage-leads {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Estilo quando não tem leads (texto centralizado) */
.funil-stage-leads:empty::after {
  content: "Nenhum lead";
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  text-align: center;
  margin-top: auto;
  margin-bottom: auto;
  display: block;
}

/* CARD DO LEAD (O cartãozinho dentro da coluna) */
.funil-lead-card {
  background: #0B1120; /* Fundo mais escuro (cor da página) para criar "buraco" */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.funil-lead-card:hover {
  border-color: var(--primary);
  transform: translateX(5px);
}

.funil-lead-name {
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.funil-lead-info {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.lead-badge {
  /* Badges mais sutis */
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}
      
      .lead-badge.novo {
        background: rgba(139, 92, 246, 0.15);
        color: #8b5cf6;
      }
      
      .lead-badge.contato {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
      }
      
      .lead-badge.negociacao {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
      }
      
      .lead-badge.proposta {
        background: rgba(236, 72, 153, 0.15);
        color: #ec4899;
      }
      
      .lead-badge.convertido {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
      }
      
      .lead-badge.perdido {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
      }
      
      .origem-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.7rem;
        font-weight: 500;
        background: rgba(100, 116, 139, 0.15);
        color: var(--text-muted);
      }
      
      @media (max-width: 1200px) {
        .funil-container {
          grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        }
      }
      
      @media (max-width: 768px) {
        .funil-container {
          grid-template-columns: 1fr;
        }
      }
      
      /* ==================== PROCESSOS STYLES ==================== */
      .processos-status-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
      }
      
      .processo-status-card {
        background: var(--bg-dark);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 16px;
        transition: all 0.3s ease;
      }
      
      .processo-status-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
      }
      
      .processo-status-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        flex-shrink: 0;
      }
      
      .processo-status-info {
        flex: 1;
      }
      
      .processo-status-count {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 4px;
      }
      
      .processo-status-label {
        font-size: 0.8rem;
        color: var(--text-muted);
        font-weight: 500;
        line-height: 1.3;
        word-wrap: break-word;
      }
      
      .processo-prazo-card {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
        border: 1px solid rgba(239, 68, 68, 0.3);
        border-left: 4px solid var(--danger);
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        transition: all 0.2s;
      }
      
      .processo-prazo-card:hover {
        background: rgba(239, 68, 68, 0.15);
        transform: translateX(5px);
      }
      
      .processo-prazo-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 8px;
      }
      
      .processo-prazo-numero {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 0.95rem;
      }
      
      .processo-prazo-dias {
        background: var(--danger);
        color: white;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 700;
      }
      
      .processo-prazo-cliente {
        color: var(--text-muted);
        font-size: 0.85rem;
        margin-bottom: 4px;
      }
      
      .processo-prazo-info {
        color: var(--danger);
        font-size: 0.85rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
      }
      
      .processo-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
      }
      
      .processo-badge.distribuido {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
      }
      
      .processo-badge.instrucao {
        background: rgba(139, 92, 246, 0.15);
        color: #8b5cf6;
      }
      
      .processo-badge.sentenca {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
      }
      
      .processo-badge.recurso {
        background: rgba(236, 72, 153, 0.15);
        color: #ec4899;
      }
      
      .processo-badge.calculo {
        background: rgba(6, 182, 212, 0.15);
        color: #06b6d4;
      }
      
      .processo-badge.arquivado {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
      }
      
      .tipo-processo-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: 10px;
        font-size: 0.7rem;
        font-weight: 600;
        background: rgba(100, 116, 139, 0.15);
        color: var(--text-muted);
      }
      
      @media (max-width: 768px) {
        .processos-status-grid {
          grid-template-columns: 1fr;
        }
      }
      
      /* ==================== TAREFAS STYLES ==================== */
      .tarefas-board {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-top: 20px;
      }
      
      .tarefa-coluna {
        background: var(--bg-dark);
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
        min-height: 400px;
        display: flex;
        flex-direction: column;
      }
      
      .tarefa-coluna-header {
        padding: 16px;
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      }
      
      .tarefa-coluna-title {
        font-weight: 700;
        font-size: 1rem;
        display: flex;
        align-items: center;
        gap: 8px;
        color: white;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
      }
      
      .tarefa-coluna-count {
        background: rgba(255, 255, 255, 0.25);
        color: white;
        font-weight: 700;
        font-size: 1.1rem;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
      }
      
      .tarefa-coluna-body {
        flex: 1;
        padding: 12px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      
      .tarefa-card {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 14px;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }
      
      .tarefa-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        border-color: var(--primary);
      }
      
      .tarefa-card-title {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
        font-size: 0.95rem;
        line-height: 1.4;
      }
      
      .tarefa-card-info {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 10px;
      }
      
      .tarefa-card-info-item {
        font-size: 0.8rem;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 6px;
      }
      
      .tarefa-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
      }
      
      .tarefa-prioridade-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
      
      .tarefa-prioridade-badge.baixa {
        background: rgba(100, 116, 139, 0.2);
        color: #94a3b8;
        border: 1px solid rgba(100, 116, 139, 0.3);
      }
      
      .tarefa-prioridade-badge.media {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      
      .tarefa-prioridade-badge.alta {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .tarefa-prioridade-badge.urgente {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
      }
      
      .tarefa-prazo-badge {
        font-size: 0.75rem;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 4px;
      }
      
      .tarefa-prazo-badge.atrasado {
        color: var(--danger);
        font-weight: 600;
      }
      
      .tarefa-prazo-badge.hoje {
        color: var(--warning);
        font-weight: 600;
      }
      
      .tarefa-hoje-card {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-left: 4px solid var(--primary);
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        transition: all 0.2s;
      }
      
      .tarefa-hoje-card:hover {
        background: var(--bg-dark);
        transform: translateX(5px);
      }
      
      .tarefa-hoje-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 10px;
      }
      
      .tarefa-hoje-title {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 1rem;
        flex: 1;
      }
      
      .tarefa-hoje-info {
        display: flex;
        gap: 16px;
        font-size: 0.85rem;
        color: var(--text-muted);
        flex-wrap: wrap;
      }
      
      .tarefa-hoje-info-item {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      
      .tarefa-hoje-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
      }
      
      .tarefa-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
      }
      
      .tarefa-status-badge.afazer {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        border: 1px solid rgba(139, 92, 246, 0.3);
      }
      
      .tarefa-status-badge.emandamento {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      
      .tarefa-status-badge.concluida {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      
      @media (max-width: 1200px) {
        .tarefas-board {
          grid-template-columns: 1fr;
        }
      }
      
      @media (max-width: 768px) {
        .tarefas-board {
          grid-template-columns: 1fr;
        }
      }
      
      /* ==================== PRAZOS STYLES ==================== */
      .prazos-timeline {
        margin-top: 16px;
      }
      
      .prazos-timeline-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 12px;
      }
      
      .prazos-timeline-filtros {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }
      
      .prazo-critico-card {
        background: var(--bg-panel);
        border: 1px solid rgba(239, 68, 68, 0.3);
        border-left: 4px solid #ef4444;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        transition: all 0.2s;
      }
      
      .prazo-critico-card:hover {
        background: var(--bg-dark);
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
      }
      
      .prazo-card-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 10px;
      }
      
      .prazo-card-titulo {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 1rem;
        flex: 1;
      }
      
      .prazo-card-badge {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
      }
      
      .prazo-card-badge.hoje {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .prazo-card-info {
        display: flex;
        gap: 16px;
        font-size: 0.85rem;
        color: var(--text-muted);
        flex-wrap: wrap;
        margin-bottom: 8px;
      }
      
      .prazo-card-info-item {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      
      .prazo-card-descricao {
        color: var(--text-muted);
        font-size: 0.9rem;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
      }
      
      .prazo-timeline-item {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 16px;
        margin-bottom: 12px;
        position: relative;
        transition: all 0.2s;
      }
      
      .prazo-timeline-item:hover {
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      }
      
      .prazo-timeline-item.vencido {
        border-left: 4px solid #ef4444;
        background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .prazo-timeline-item.hoje {
        border-left: 4px solid #f59e0b;
        background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .prazo-timeline-item.proximo {
        border-left: 4px solid #3b82f6;
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .prazo-timeline-item.futuro {
        border-left: 4px solid #10b981;
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .prazo-timeline-data {
        position: absolute;
        left: 16px;
        top: 16px;
        background: var(--bg-dark);
        padding: 8px 12px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 0.85rem;
        color: var(--text-primary);
        min-width: 100px;
        text-align: center;
      }
      
      .prazo-timeline-content {
        margin-left: 120px;
      }
      
      .prazo-timeline-processo {
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 6px;
        font-size: 0.95rem;
      }
      
      .prazo-timeline-tipo {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 600;
        background: rgba(100, 116, 139, 0.2);
        color: #94a3b8;
        border: 1px solid rgba(100, 116, 139, 0.3);
        margin-bottom: 8px;
      }
      
      .prazo-timeline-descricao {
        color: var(--text-muted);
        font-size: 0.9rem;
        margin-top: 8px;
      }
      
      .prazo-timeline-dias {
        position: absolute;
        right: 16px;
        top: 16px;
        font-weight: 700;
        font-size: 1.1rem;
      }
      
      .prazo-timeline-dias.vencido {
        color: #ef4444;
      }
      
      .prazo-timeline-dias.hoje {
        color: #f59e0b;
      }
      
      .prazo-timeline-dias.proximo {
        color: #3b82f6;
      }
      
      .prazo-timeline-dias.futuro {
        color: #10b981;
      }
      
      .prazo-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
      }
      
      .prazo-status-badge.pendente {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .prazo-status-badge.cumprido {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      
      .prazo-status-badge.vencido {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
      }
      
      @media (max-width: 768px) {
        .prazo-timeline-data {
          position: static;
          margin-bottom: 12px;
          display: inline-block;
        }
        
        .prazo-timeline-content {
          margin-left: 0;
        }
        
        .prazo-timeline-dias {
          position: static;
          display: block;
          margin-top: 8px;
        }
        
        .prazos-timeline-filtros {
          width: 100%;
        }
        
        .prazos-timeline-filtros button {
          flex: 1;
        }
      }
      
      /* ==================== PERÍCIAS STYLES ==================== */
      .pericias-timeline {
        margin-top: 16px;
      }
      
      .pericias-timeline-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 12px;
      }
      
      .pericias-timeline-filtros {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }
      
      .pericia-card {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-left: 4px solid var(--primary);
        border-radius: 10px;
        padding: 18px;
        margin-bottom: 12px;
        transition: all 0.2s;
      }
      
      .pericia-card:hover {
        background: var(--bg-dark);
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      }
      
      .pericia-card.agendada {
        border-left-color: #f59e0b;
        background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .pericia-card.andamento {
        border-left-color: #3b82f6;
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .pericia-card.aguardando {
        border-left-color: #8b5cf6;
        background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .pericia-card.concluida {
        border-left-color: #10b981;
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .pericia-card-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 14px;
        gap: 12px;
      }
      
      .pericia-card-processo {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 1rem;
        flex: 1;
      }
      
      .pericia-card-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 5px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        flex-shrink: 0;
      }
      
      .pericia-card-badge.agendada {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .pericia-card-badge.andamento {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      
      .pericia-card-badge.aguardando {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        border: 1px solid rgba(139, 92, 246, 0.3);
      }
      
      .pericia-card-badge.concluida {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      
      .pericia-card-badge.cancelada {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
      }
      
      .pericia-card-info {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
        margin-bottom: 12px;
      }
      
      .pericia-card-info-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.9rem;
        color: var(--text-muted);
      }
      
      .pericia-card-info-item i {
        color: var(--primary);
        width: 18px;
        text-align: center;
      }
      
      .pericia-card-tipo {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 600;
        background: rgba(100, 116, 139, 0.2);
        color: #94a3b8;
        border: 1px solid rgba(100, 116, 139, 0.3);
        margin-bottom: 10px;
      }
      
      .pericia-card-observacoes {
        background: var(--bg-dark);
        border-radius: 8px;
        padding: 12px;
        margin-top: 12px;
        font-size: 0.85rem;
        color: var(--text-muted);
        border: 1px solid var(--border);
      }
      
      .pericia-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
      }
      
      .pericia-destaque {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
        border: 2px solid rgba(245, 158, 11, 0.5);
      }
      
      .pericia-destaque .pericia-card-processo::before {
        content: '⚡ ';
        color: #f59e0b;
      }
      
      .pericia-tipo-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 600;
      }
      
      .pericia-tipo-badge.medica {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
      }
      
      .pericia-tipo-badge.social {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      
      .pericia-tipo-badge.contabil {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      
      .pericia-tipo-badge.engenharia {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .pericia-tipo-badge.psicologica {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        border: 1px solid rgba(139, 92, 246, 0.3);
      }
      
      .pericia-tipo-badge.grafotecnica {
        background: rgba(236, 72, 153, 0.2);
        color: #f472b6;
        border: 1px solid rgba(236, 72, 153, 0.3);
      }
      
      .pericia-tipo-badge.outra {
        background: rgba(100, 116, 139, 0.2);
        color: #94a3b8;
        border: 1px solid rgba(100, 116, 139, 0.3);
      }
      
      @media (max-width: 768px) {
        .pericia-card-info {
          grid-template-columns: 1fr;
        }
        
        .pericias-timeline-filtros {
          width: 100%;
        }
        
        .pericias-timeline-filtros button {
          flex: 1;
        }
      }
      
      /* ==================== AUDIÊNCIAS STYLES ==================== */
      .audiencias-timeline {
        margin-top: 16px;
      }
      
      .audiencias-timeline-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 12px;
      }
      
      .audiencias-timeline-filtros {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }
      
      .audiencia-card {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-left: 4px solid var(--primary);
        border-radius: 10px;
        padding: 18px;
        margin-bottom: 12px;
        transition: all 0.2s;
      }
      
      .audiencia-card:hover {
        background: var(--bg-dark);
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      }
      
      .audiencia-card.agendada {
        border-left-color: #f59e0b;
        background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .audiencia-card.realizada {
        border-left-color: #10b981;
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .audiencia-card.cancelada {
        border-left-color: #ef4444;
        background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .audiencia-card.remarcada {
        border-left-color: #3b82f6;
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-panel) 50%);
      }
      
      .audiencia-card-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 14px;
        gap: 12px;
      }
      
      .audiencia-card-processo {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 1rem;
        flex: 1;
      }
      
      .audiencia-card-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 5px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        flex-shrink: 0;
      }
      
      .audiencia-card-badge.agendada {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .audiencia-card-badge.realizada {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      
      .audiencia-card-badge.cancelada {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
      }
      
      .audiencia-card-badge.remarcada {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      
      .audiencia-card-info {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
        margin-bottom: 12px;
      }
      
      .audiencia-card-info-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.9rem;
        color: var(--text-muted);
      }
      
      .audiencia-card-info-item i {
        color: var(--primary);
        width: 18px;
        text-align: center;
      }
      
      .audiencia-tipo-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 600;
        margin-bottom: 10px;
      }
      
      .audiencia-tipo-badge.inicial {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        border: 1px solid rgba(139, 92, 246, 0.3);
      }
      
      .audiencia-tipo-badge.instrucao {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      
      .audiencia-tipo-badge.conciliacao {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      
      .audiencia-tipo-badge.julgamento {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border: 1px solid rgba(239, 68, 68, 0.3);
      }
      
      .audiencia-tipo-badge.depoimento {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.3);
      }
      
      .audiencia-tipo-badge.testemunhas {
        background: rgba(236, 72, 153, 0.2);
        color: #f472b6;
        border: 1px solid rgba(236, 72, 153, 0.3);
      }
      
      .audiencia-tipo-badge.sentenca {
        background: rgba(99, 102, 241, 0.2);
        color: #818cf8;
        border: 1px solid rgba(99, 102, 241, 0.3);
      }
      
      .audiencia-tipo-badge.outra {
        background: rgba(100, 116, 139, 0.2);
        color: #94a3b8;
        border: 1px solid rgba(100, 116, 139, 0.3);
      }
      
      .audiencia-card-observacoes {
        background: var(--bg-dark);
        border-radius: 8px;
        padding: 12px;
        margin-top: 12px;
        font-size: 0.85rem;
        color: var(--text-muted);
        border: 1px solid var(--border);
      }
      
      .audiencia-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
      }
      
      .audiencia-destaque {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
        border: 2px solid rgba(245, 158, 11, 0.5);
      }
      
      .audiencia-destaque .audiencia-card-processo::before {
        content: '⚡ ';
        color: #f59e0b;
      }
      
      .audiencia-pauta-item {
        background: var(--bg-dark);
        padding: 8px 12px;
        border-radius: 6px;
        margin-top: 6px;
        font-size: 0.85rem;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 8px;
      }
      
      .audiencia-pauta-item i {
        color: var(--primary);
      }
      
      @media (max-width: 768px) {
        .audiencia-card-info {
          grid-template-columns: 1fr;
        }
        
        .audiencias-timeline-filtros {
          width: 100%;
        }
        
        .audiencias-timeline-filtros button {
          flex: 1;
        }
      }
      
      /* ==================== DASHBOARD STYLES ==================== */
      .dashboard-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 24px;
      }
      
      .dashboard-grid-2 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 20px;
        margin-bottom: 24px;
      }
      
      /* === INÍCIO DO NOVO BLOCO COMPLETO DOS CARDS === */

.dashboard-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  /* Removemos a borda colorida grossa do topo */
  border-top: none !important; 
}

.dashboard-card.clickable {
  cursor: pointer;
}

.dashboard-card.clickable:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* ESTE É O ÍCONE ATUALIZADO (Item 6 do Passo 3) */
.dashboard-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px; /* Mais quadrado e moderno */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0;
}

.dashboard-card-valor {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.dashboard-card-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.dashboard-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

/* === FIM DO NOVO BLOCO === */
      
      .aniversariante-item {
        background: var(--bg-dark);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 12px;
      }
      
      .aniversariante-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 700;
        font-size: 1.1rem;
      }
      
      .aniversariante-info {
        flex: 1;
      }
      
      .aniversariante-nome {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 2px;
      }
      
      .aniversariante-data {
        font-size: 0.85rem;
        color: var(--text-muted);
      }
      
      .alerta-item {
        background: var(--bg-dark);
        border-left: 4px solid var(--danger);
        border-radius: 6px;
        padding: 12px;
        margin-bottom: 8px;
      }
      
      .alerta-item.warning {
        border-left-color: var(--warning);
      }
      
      .alerta-item.info {
        border-left-color: var(--info);
      }
      
      .atividade-item {
        background: var(--bg-dark);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
        display: flex;
        gap: 12px;
      }
      
      .atividade-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      
      .atividade-content {
        flex: 1;
      }
      
      .atividade-texto {
        color: var(--text-primary);
        font-size: 0.9rem;
        margin-bottom: 4px;
      }
      
      .atividade-tempo {
        font-size: 0.8rem;
        color: var(--text-muted);
      }
      
      @media (max-width: 768px) {
        .dashboard-grid {
          grid-template-columns: 1fr;
        }
        
        .dashboard-grid-2 {
          grid-template-columns: 1fr;
        }
      }
      
      /* ==================== CALCULADORA STYLES ==================== */
      .calculadora {
        background: var(--bg-dark);
      }
      
      .calculadora-display {
        background: var(--bg-panel);
        border-bottom: 1px solid var(--border);
      }
      
      .calculadora-botoes {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1px;
        background: var(--border);
        padding: 1px;
      }
      
      .calc-btn {
        background: var(--bg-panel);
        border: none;
        padding: 24px;
        font-size: 1.3rem;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s;
      }
      
      .calc-btn:hover {
        background: var(--bg-dark);
      }
      
      .calc-btn:active {
        transform: scale(0.95);
      }
      
      .calc-btn.operator {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
      }
      
      .calc-btn.operator:hover {
        background: rgba(59, 130, 246, 0.25);
      }
      
      .calc-btn.equals {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        font-size: 1.5rem;
      }
      
      .calc-btn.equals:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
      }
      
      /* ==================== GERENCIAMENTO CLIENTE STYLES ==================== */
      .gerenciar-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 24px;
        border-bottom: 2px solid var(--border);
        overflow-x: auto;
        padding-bottom: 8px;
      }
      
      .gerenciar-tab {
        background: transparent;
        border: none;
        padding: 12px 20px;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-muted);
        cursor: pointer;
        border-radius: 8px 8px 0 0;
        transition: all 0.2s;
        white-space: nowrap;
      }
      
      .gerenciar-tab:hover {
        background: var(--bg-dark);
        color: var(--text-primary);
      }
      
      .gerenciar-tab.active {
        background: var(--primary);
        color: white;
      }
      
      .gerenciar-content {
        min-height: 400px;
      }
      
      .gerenciar-aba {
      display: none; /* Mantém a aba escondida */
      overflow-y: auto;
      max-height: 600px;
      padding: 24px;
      background: var(--bg-panel);
      border-radius: 8px;
    }
      
      .gerenciar-aba.active {
        display: block;
        animation: fadeIn 0.3s;
      }
      
      @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
      }
      
      .cliente-info-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
        margin-bottom: 20px;
      }
      
      .cliente-info-item {
        background: var(--bg-dark);
        padding: 12px;
        border-radius: 8px;
        border: 1px solid var(--border);
      }
      
      .cliente-info-label {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin-bottom: 4px;
        font-weight: 600;
        text-transform: uppercase;
      }
      
      .cliente-info-value {
        color: var(--text-primary);
        font-size: 1rem;
        font-weight: 500;
      }
      
      @media (max-width: 768px) {
        .gerenciar-tabs {
          flex-wrap: nowrap;
        }
      }
/* ==================== INFORMAÇÕES COMPLETAS DO CLIENTE ==================== */
.cliente-info-completa {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.info-section {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.info-section:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-row {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.info-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.info-value {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  display: block;
  line-height: 1.4;
}

.info-value a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}

.info-value a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Botão WhatsApp */
.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.whatsapp-icon-table {
  color: #25D366;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.whatsapp-icon-table:hover {
  transform: scale(1.2);
  filter: brightness(1.2);
}

/* Responsivo */
@media (max-width: 768px) {
  .cliente-info-completa {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .info-section {
    padding: 16px;
  }
}
/* ==================== ETIQUETAS - CSS COMPLETO ==================== */
.etiquetas-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: default;
  transition: all 0.2s;
  border: 1px solid;
  white-space: nowrap;
}

.etiqueta.vermelho {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

.etiqueta.amarelo {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: #f59e0b;
}

.etiqueta.verde {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-color: #10b981;
}

.etiqueta.azul {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border-color: #3b82f6;
}

.etiqueta.roxo {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
  border-color: #8b5cf6;
}

.etiqueta.rosa {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
  border-color: #ec4899;
}

.etiqueta.laranja {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  border-color: #f97316;
}

.etiqueta.cinza {
  background: rgba(100, 116, 139, 0.2);
  color: #64748b;
  border-color: #64748b;
}

.etiqueta-remover {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
  margin-left: 2px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.etiqueta-remover:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Seletor de cores */
.cores-etiqueta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.cor-option {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cor-option:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cor-option.selected {
  border-color: white;
  box-shadow: 0 0 0 3px var(--primary), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

.cor-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Responsivo */
@media (max-width: 768px) {
  .cor-option {
    width: 40px;
    height: 40px;
  }
  
  .cores-etiqueta {
    gap: 8px;
  }
}
/* Corrigir z-index do SweetAlert para aparecer sobre os modais */
.swal2-container {
  z-index: 10000 !important;
}

.swal2-popup {
  z-index: 10001 !important;
}
/* ==================== DOCUMENTOS PDF CARDS ==================== */
.documento-card {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 16px;
}

.documento-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.documento-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.documento-info {
  flex: 1;
}

.documento-info h5 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.documento-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.documento-action {
  color: var(--primary);
  font-size: 1.5rem;
  opacity: 0;
  transition: all 0.2s;
}

.documento-card:hover .documento-action {
  opacity: 1;
}

#abaDocumentos h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#abaDocumentos h4 i {
  font-size: 1.5rem;
}

/* Ajusta padding do gerenciar-content para documentos */
.gerenciar-content {
  min-height: 400px;
  padding: 24px;
  overflow-x: hidden;
  background: var(--bg-panel);     ← ADICIONE esta linha
}


.gerenciar-aba.active {
  display: block;
  animation: fadeIn 0.3s;
}
/* ========== TELA DE LOGIN ========== */
#loginScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-container {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUpLogin 0.6s ease;
}

@keyframes slideUpLogin {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-dark); /* <-- COR PRETA/ESCURA DO SISTEMA */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2.5rem;
  color: white;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.login-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px 0;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.login-form {
  margin-top: 32px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #d97706 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 24px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-footer i {
  color: var(--primary);
  margin-right: 6px;
}

/* SISTEMA DE ANEXOS */
.anexos-section {
  background: var(--bg-dark);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  margin-top: 24px;
  min-height: 200px;
}

.anexos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.anexos-header h4 {
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.anexos-lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anexo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
}

.anexo-item:hover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.05);
}

.anexo-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.anexo-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 8px;
  color: #3b82f6;
  font-size: 1.5rem;
}

.anexo-icon.pdf {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.anexo-icon.image {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.anexo-details {
  flex: 1;
}

.anexo-nome {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.anexo-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.anexo-actions {
  display: flex;
  gap: 8px;
}

.anexo-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.anexo-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.anexo-btn.delete:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.anexos-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.anexos-empty i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.upload-progress {
  margin-top: 16px;
  padding: 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-dark);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  transition: width 0.3s;
  border-radius: 4px;
}

.anexo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
/* ==================== CALCULADORA DISPLAY HISTORY ==================== */
.calculadora-display {
  padding-top: 10px; /* Ajusta o preenchimento */
}

#calcDisplayHistory {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0 20px;
  min-height: 20px;
  word-break: break-all;
  opacity: 0.7;
}
/* ==================== LOGIN CONSENT ==================== */
.login-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.login-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}

.login-consent label {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.login-consent label a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.login-consent label a:hover {
  text-decoration: underline;
}
/* ==================== MODAL UPGRADE ==================== */
.upgrade-container {
  padding: 32px 32px 40px;
  text-align: center;
  position: relative;
}

.upgrade-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.upgrade-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.upgrade-icon i {
  font-size: 2.5rem;
  color: var(--primary);
}

.upgrade-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.upgrade-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.upgrade-features {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 0 auto 24px;
  padding: 20px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 400px;
}

.upgrade-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--text-primary);
}

.upgrade-feature-item i {
  color: var(--success);
  font-size: 1.2rem;
}

.upgrade-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upgrade-price-suffix {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.upgrade-container .btn-large {
  font-size: 1.1rem;
  padding: 16px 32px;
  margin-top: 20px;
}
/* ==========================================
   STATUS DO PLANO (Sidebar)
   ========================================== */
.plan-status-container {
    padding-top: 4px;
    padding-bottom: 4px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.plan-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-status-badge span:first-child {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Estilo Dinâmico: Plano Free */
.plan-status-badge.free {
    background: rgba(245, 158, 11, 0.15); /* Fundo Laranja */
    color: var(--warning); /* Texto Laranja */
}
.plan-status-badge.free span:first-child {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

/* Estilo Dinâmico: Plano PRO */
.plan-status-badge.pro {
    background: rgba(16, 185, 129, 0.15); /* Fundo Verde */
    color: var(--success); /* Texto Verde */
}
.plan-status-badge.pro span:first-child {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Botão de Upgrade */
.btn-upgrade-pro {
    width: 100%;
    margin-top: 4px;
    padding: 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-upgrade-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
/* ==========================================
   TEXTO DE EXPIRAÇÃO DO PLANO (Sidebar)
   ========================================== */
.plan-expiry-text {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    margin-bottom: 0;
}
.plan-expiry-text i {
    margin-right: 4px;
    opacity: 0.8;
}
/* ========================================
   BOTÕES DE AÇÃO DA SIDEBAR - OTIMIZADO
   ======================================== */
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.sidebar-action-btn {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-action-btn i {
  font-size: 0.9rem;
  width: 16px;
  text-align: center;
}

.sidebar-action-btn span {
  flex: 1;
  text-align: left;
}

.btn-personalizar {
  color: var(--info);
}

.btn-personalizar:hover {
  background: var(--info);
  color: white;
  border-color: var(--info);
  transform: translateY(-1px);
}

.btn-security {
  color: var(--warning);
}

.btn-security:hover {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
  transform: translateY(-1px);
}

.btn-delete {
  color: var(--danger);
}

.btn-delete:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  transform: translateY(-1px);
}

.btn-logout {
  color: var(--text-muted);
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  transform: translateY(-1px);
}
/* ==========================================
   CORREÇÃO ABA DOCUMENTOS (SEM PADDING)
   ========================================== */
#abaDocumentos {
  padding: 0;
  background: var(--bg-panel);  ← ADICIONE esta linha
}
/* ==========================================
   PALETA DE CORES - TEMA CLARO
   ========================================== */

/* Quando o body tiver o atributo data-theme="light", 
   essas variáveis vão sobrescrever as do :root */
[data-theme="light"] {
  --bg-dark: #f4f7fa;        /* Fundo principal (cinza bem claro) */
  --bg-panel: #ffffff;       /* Fundo dos cards e modais (branco) */
  --bg-sidebar: #ffffff;     /* Fundo da sidebar (branco) */
  --border: #e2e8f0;       /* Bordas (cinza claro) */
  --text-primary: #1e293b;  /* Texto principal (azul-escuro, ótimo contraste) */
  --text-muted: #64748b;   /* Texto secundário (cinza-médio) */

  /* As cores de ação (primary, success, etc) podem ser mantidas
     ou ajustadas se preferir, mas a sua cor --primary (f59e0b)
     funciona muito bem em fundos claros também. */
}

/* ==========================================
   ESTILO DO INTERRUPTOR DE TEMA
   ========================================== */
.theme-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.theme-switcher-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-switcher-label .fa-sun {
  color: var(--primary); /* Cor do ícone de sol */
}
.theme-switcher-label .fa-moon {
  color: var(--info); /* Cor do ícone de lua */
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 24px;
}

.theme-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .theme-slider {
  background-color: var(--primary);
}

input:checked + .theme-slider:before {
  transform: translateX(20px);
}
/* ==========================================
   NOVOS ESTILOS PARA A TOP-BAR
   ========================================== */

/* Ajusta o top-bar-right para ter mais botões */
.top-bar-right {
  gap: 10px; /* Reduz o espaço entre os ícones */
}

/* Estilo base para os botões de ícone */
.top-bar-btn {
  width: 40px;   /* Tamanho fixo */
  height: 40px;
  padding: 0;    /* Remove padding extra */
  font-size: 1.1rem; /* Tamanho do ícone */
  border-radius: 50%; /* Deixa redondo */
  border: 1px solid var(--border);
  background: var(--bg-dark);
display: flex;
align-items: center;
justify-content: center;
}

.top-bar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Cores específicas para cada botão */
.top-bar-btn.btn-personalizar {
  color: var(--info);
}
.top-bar-btn.btn-personalizar:hover {
  background: var(--info);
  border-color: var(--info);
  color: white;
}

.top-bar-btn.btn-security {
  color: var(--warning);
}
.top-bar-btn.btn-security:hover {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}

.top-bar-btn.btn-delete {
  color: var(--danger);
}
.top-bar-btn.btn-delete:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.top-bar-btn.btn-logout {
  color: var(--text-muted);
}
.top-bar-btn.btn-logout:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* ==========================================
   SWITCH DE TEMA (VERSÃO TOP-BAR)
   ========================================== */

.theme-switcher-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-switcher-topbar:hover {
  border-color: var(--primary);
}

.theme-switcher-topbar #themeToggleLabelTop {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

/* Muda a cor do ícone conforme o tema */
[data-theme="light"] .theme-switcher-topbar #themeToggleLabelTop {
  color: var(--primary);
}
[data-theme="dark"] .theme-switcher-topbar #themeToggleLabelTop {
  color: var(--info);
}

.theme-switch-topbar {
  position: relative;
  display: inline-block;
  width: 40px; /* Menor */
  height: 20px;
}

.theme-switch-topbar input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider-topbar {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 20px;
}

.theme-slider-topbar:before {
  position: absolute;
  content: "";
  height: 14px; /* Menor */
  width: 14px;  /* Menor */
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .theme-slider-topbar {
  background-color: var(--primary);
}

input:checked + .theme-slider-topbar:before {
  transform: translateX(20px);
}
/* ==========================================
   ESTILOS DOS NOVOS BOTÕES DA TOP-BAR
   ========================================== */

/* Botão de Suporte (Novo) */
.top-bar-btn.btn-suporte {
  color: var(--success);
}
.top-bar-btn.btn-suporte:hover {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Botão de Admin (Novo) */
.top-bar-btn.btn-admin {
  color: var(--purple);
}
.top-bar-btn.btn-admin:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}
/* ==========================================
   AJUSTES DO PERFIL DE USUÁRIO NA TOP-BAR
   ========================================== */

/* Alinha o novo bloco de usuário à direita dos botões */
.top-bar-right .user-info {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

/* Remove o comportamento de "esticar" do flex que existia na sidebar */
.top-bar-right .user-details {
  flex: 0 0 auto; /* Não cresce, não encolhe, tamanho automático */
  text-align: right;
  overflow: visible; /* Garante que o nome não seja cortado */
}

/* Ajusta o tamanho da fonte para a barra superior */
.top-bar-right .user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.top-bar-right .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Oculta o avatar em telas pequenas para economizar espaço */
@media (max-width: 768px) {
  .top-bar-right .user-avatar {
    display: none;
  }
  .top-bar-right .user-info {
     margin-left: 8px;
     padding-left: 8px;
  }
}
/* ==========================================
   AJUSTES DO PERFIL DE USUÁRIO NA TOP-BAR
   ========================================== */

/* Alinha o novo bloco de usuário à direita dos botões */
.top-bar-right .user-info {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

/* Remove o comportamento de "esticar" do flex que existia na sidebar */
.top-bar-right .user-details {
  flex: 0 0 auto; /* Não cresce, não encolhe, tamanho automático */
  text-align: right;
  overflow: visible; /* Garante que o nome não seja cortado */
}

/* Ajusta o tamanho da fonte para a barra superior */
.top-bar-right .user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.top-bar-right .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Oculta o avatar em telas pequenas para economizar espaço */
@media (max-width: 768px) {
  .top-bar-right .user-avatar {
    display: none;
  }
  .top-bar-right .user-info {
     margin-left: 8px;
     padding-left: 8px;
  }
}
/* ==========================================
   ESTILOS DO PLANO (MOVIDOS P/ TOP-BAR)
   ========================================== */
   
/* Novo container para o plano (para alinhar lado a lado) */
.plan-info-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  justify-content: flex-end; /* Alinha à direita */
}

/* Badge (Free/Pro) - Agora na Top-bar */
.plan-info-topbar .plan-status-badge {
  padding: 2px 8px; /* Mais compacto */
  font-size: 0.65rem; /* Fonte menor */
  gap: 4px;
  margin: 0; /* Reseta margem da sidebar */
}

.plan-info-topbar .plan-status-badge span:first-child {
  width: 6px; /* Bolinha menor */
  height: 6px;
}

/* Texto de expiração - Agora na Top-bar */
.plan-info-topbar .plan-expiry-text {
  font-size: 0.65rem; /* Fonte menor */
  margin: 0;
  padding: 0;
  display: block; /* Garante que ele apareça */
  color: var(--text-muted); /* Garante a cor correta */
}

/* ==========================================
   AJUSTE NO FOOTER DA SIDEBAR (Limpando)
   ========================================== */
   
/* O container no footer agora só segura o botão de upgrade */
.sidebar-footer .plan-status-container {
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 1px solid var(--border); /* Mantém o separador */
  text-align: center;
}

/* Esconde os itens que moveram (por segurança) */
.sidebar-footer .plan-status-badge,
.sidebar-footer .plan-expiry-text {
  display: none !important;
}

/* Ajuste no botão de upgrade para centralizar */
.sidebar-footer .btn-upgrade-pro {
  margin-top: 4px;
}

/* Garante que o user-details na top-bar se comporte bem */
.top-bar-right .user-details {
  display: flex;
  flex-direction: column; /* Empilha email e plano */
  align-items: flex-end; /* Alinha tudo à direita */
}
/* ==========================================
   REMOVER LINHAS DO RODAPÉ DA SIDEBAR
   ========================================== */

/* Remove a linha de cima do rodapé principal */
.sidebar-footer {
  border-top: none !important;
}

/* Remove a linha de dentro do container do botão (se ainda existir) */
.sidebar-footer .plan-status-container {
  border-top: none !important;
}
/* ==========================================
   ESTILOS DE PAGINAÇÃO
   ========================================== */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.pagination-rows-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-rows-select label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pagination-rows-select select {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-dark);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-family: 'Poppins', sans-serif;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-nav span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-nav button {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-nav button:hover {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

.pagination-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-dark);
  color: var(--text-muted);
  border-color: var(--border);
}

/* Ajuste para telas pequenas */
@media (max-width: 768px) {
  .pagination-controls {
    flex-direction: column;
    align-items: center;
  }
}

/* === SCROLLBAR PREMIUM === */
/* Funciona em Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark); 
}

::-webkit-scrollbar-thumb {
  background: #334155; 
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary); 
}

/* Títulos de seção mais limpos */
h2, h3 {
  font-weight: 600;
  letter-spacing: -0.5px; /* Deixa a fonte mais moderna */
}

/* Inputs mais integrados */
.form-group input, 
.form-group select, 
.form-group textarea,
.filter-input {
  background: #0f1522 !important; /* Fundo muito escuro */
  border: 1px solid #2A3241 !important;
  color: #F1F5F9 !important;
}

/* Botão Principal mais flat */
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: none; /* Remove sombra pesada */
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ==================== AVISO OFFLINE (NOVO) ==================== */
.offline-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #ef4444; /* Vermelho */
  color: white;
  text-align: center;
  padding: 10px;
  z-index: 10000; /* Fica por cima de tudo */
  font-weight: 600;
  font-size: 0.9rem;
  display: none; /* Começa escondido */
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.offline-warning i {
  margin-right: 8px;
}
/* Ajusta a top-bar quando o aviso aparecer para não esconder o menu */
body.is-offline .top-bar {
  top: 40px; 
}
body.is-offline .sidebar-left {
  padding-top: 40px;
}

/* --- CORREÇÃO DE EMERGÊNCIA PARA MODAIS --- */
.modal.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 99999 !important; /* Z-index altíssimo para ficar acima de tudo */
}

/* Garante que o botão de personalização apareça */
#btnPersonalizarTop {
  display: flex !important;
}

/* ==========================================
   CORREÇÃO DE SOBREPOSIÇÃO (Z-INDEX FIX)
   ========================================== */

/* 1. Garante que os alertas (SweetAlert2) fiquem ACIMA DE TUDO */
/* O número 99999 garante que nada cubra o alerta */
.swal2-container {
  z-index: 99999 !important;
}

.swal2-popup {
  z-index: 100000 !important;
}

/* 2. Garante que seus Modais (Janelas) fiquem acima do menu lateral */
.modal {
  z-index: 2000; /* Mais alto que a sidebar que costuma ser 1000 */
}

/* 3. Correção para quando abrir um Modal em cima de outro */
/* Ex: Abrir "Novo Prazo" de dentro do "Gerenciar Cliente" */
.modal.active {
  z-index: 2001; 
}

/* Se houver um segundo modal aberto, o JavaScript já trata, 
   mas essa regra CSS garante a base correta. */

/* ============================================================
   CORREÇÃO DE PRIORIDADE (JANELA SOBRE JANELA)
   ============================================================ */

/* Nível 1: Janela de Gerenciar Cliente (Base) */
#modalGerenciarCliente {
  z-index: 2000 !important;
}

/* Nível 2: Janelas de Edição/Cadastro (Devem ficar ACIMA do Gerenciar Cliente) */
#modalProcesso,
#modalTarefa,
#modalAudiencia,
#modalPericia,
#modalLancamento,
#modalParcelamento,
#modalPrazo,
#modalLead,
#modalTimesheet,
#modalModelo,
#modalWhatsapp {
  z-index: 3000 !important; /* Camada superior garantida */
}

/* Nível 3: Alertas do Sistema (SweetAlert) - Sempre no topo de tudo */
.swal2-container {
  z-index: 99999 !important;
}

/* ==================== LISTA DE MERGE PDF ==================== */
.merge-list-container {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.merge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  padding: 10px 15px;
  border-radius: 8px;
  transition: all 0.2s;
}

.merge-item:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}

.merge-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.merge-actions {
  display: flex;
  gap: 5px;
}

.btn-move {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-move:hover {
  background: #3b82f6;
  color: white;
}

.btn-remove {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
}

.btn-remove:hover {
  background: #ef4444;
  color: white;
}

/* === ESTILO FINAL PARA CLIENTES INATIVOS === */

/* 1. Muda o fundo da linha para um cinza bem escuro (diferente do azul padrão) */
tr.cliente-inativo {
    background-color: #111827 !important; /* Fundo quase preto/cinza */
    border-left: 4px solid #4b5563 !important; /* Borda lateral cinza morto */
}

/* 2. Força TODO o texto, ícones e badges a ficarem cinza */
tr.cliente-inativo td,
tr.cliente-inativo td span,
tr.cliente-inativo td div,
tr.cliente-inativo td i {
    color: #6b7280 !important; /* Cor de texto "desativado" */
    filter: grayscale(100%) !important; /* Remove cor de badges (verde/laranja viram cinza) */
}

/* 3. Deixa os botões de ação bem apagados */
tr.cliente-inativo .action-btn {
    background-color: #1f2937 !important; /* Fundo do botão escuro */
    color: #4b5563 !important; /* Ícone escuro */
    border-color: #374151 !important;
    opacity: 0.5;
}

/* 4. Efeito ao passar o mouse (para permitir reativar) */
tr.cliente-inativo:hover {
    opacity: 1;
    background-color: #1f2937 !important; /* Clareia um pouco o fundo */
}

/* O botão de ação acende quando passa o mouse em cima */
tr.cliente-inativo .action-btn:hover {
    opacity: 1;
    filter: none !important; /* Devolve a cor original só no botão */
    color: #fff !important;
    cursor: pointer;
}

/* === ESTILOS DA BUSCA GLOBAL === */
.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(245, 158, 11, 0.1); /* Hover Laranja Suave */
}

.search-icon-box {
  width: 32px; 
  height: 32px; 
  border-radius: 8px; 
  background: var(--bg-dark); 
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-info h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

.search-info p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-category-header {
  padding: 8px 16px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0,0,0,0.2);
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .top-bar-center {
    display: none; /* Esconde no mobile por enquanto para não quebrar o layout */
  }
}

/* === KANBAN DRAG & DROP === */
.tarefa-card[draggable="true"] {
  cursor: grab; /* Mãozinha aberta */
}

.tarefa-card[draggable="true"]:active {
  cursor: grabbing; /* Mãozinha fechada */
}

.tarefa-card.dragging {
  opacity: 0.5;
  border: 2px dashed var(--primary);
  transform: scale(0.95);
}

.tarefa-coluna-body.drag-over {
  background: rgba(245, 158, 11, 0.05); /* Fundo laranja bem suave */
  border: 2px dashed var(--primary);
  border-radius: 8px;
}

/* Estilos para o Divisor de PDF Visual */
.pagina-thumbnail {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    background: var(--bg-dark);
}

.pagina-thumbnail:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Estado Selecionado */
.pagina-thumbnail.selected {
    border-color: #10b981; /* Verde */
    background-color: rgba(16, 185, 129, 0.1);
}

/* Checkmark visual */
.pagina-thumbnail.selected::after {
    content: '\f00c'; /* Ícone de check do FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background: #10b981;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.pagina-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.8;
}

.pagina-thumbnail.selected img {
    opacity: 1;
}

.pagina-numero {
    text-align: center;
    font-size: 0.75rem;
    padding: 4px;
    color: var(--text-muted);
}

/* === ESTILO DIVIDIR PDF (VISUAL iLovePDF) === */
.grid-paginas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  padding: 10px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  margin-bottom: 15px;
}

.pagina-card {
  position: relative;
  border: 2px solid transparent; /* Borda invisível por padrão */
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  background: #334155;
  aspect-ratio: 1 / 1.4; /* Formato papel A4 */
  display: flex;
  flex-direction: column;
}

.pagina-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.7; /* Meio apagado quando não selecionado */
  transition: opacity 0.2s;
}

.pagina-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  border-color: #94a3b8;
}

/* --- ESTADO SELECIONADO (VERDE) --- */
.pagina-card.selected {
  border-color: #e53e3e; /* Vermelho do iLovePDF ou Verde #10b981 */
  border: 3px solid #e53e3e; /* Borda grossa colorida */
  background-color: rgba(229, 62, 62, 0.1);
}

.pagina-card.selected img {
  opacity: 1; /* Imagem nítida */
}

/* O "Check" (Visto) no canto */
.pagina-card.selected::after {
  content: '\f00c'; /* Código do ícone Check do FontAwesome */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e53e3e; /* Cor de fundo da bolinha */
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 10;
}

.pagina-numero {
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.75rem;
  padding: 4px 0;
}

