/* ==============================================
   CONFIGURAÇÕES GLOBAIS E PALETA DE CORES
   ============================================== */
:root {
  --cor-primaria: #004225;       /* Verde escuro floresta */
  --cor-primaria-hover: #00311c;
  --cor-sucesso: #AF8F6F;        /* Bege/Bronze */
  --cor-sucesso-hover: #9a7d61;
  --cor-perigo: #b91c1c;
  --cor-fundo: #F5F5DC;          /* Bege claro (Beige) */
  --cor-container: #FFFAF0;     /* Creme (FloralWhite) */
  --cor-borda: #e5e0d7;
  --texto-principal: #36454F;   /* Cinza carvão (Charcoal) */
  --texto-secundario: #5c5c5c;
  --sombra-suave: 0 2px 8px -1px rgb(0 0 0 / 0.1);
  --font-titulos: 'Playfair Display', serif;
  --font-corpo: 'Lato', sans-serif;}
  /* ==============================================
   TEMAS PERSONALIZADOS (THEMES)
   ============================================== */
/* O tema "Padrão" já está definido no :root acima */

:root[data-theme="dark"] {
  --cor-primaria: #2d3748;
  --cor-primaria-hover: #1a202c;
  --cor-sucesso: #4a5568;
  --cor-sucesso-hover: #2d3748;
  --cor-fundo: #111827;
  --cor-container: #1f2937;
  --cor-borda: #374151;
  --texto-principal: #f3f4f6;
  --texto-secundario: #9ca3af;
}

:root[data-theme="ocean"] {
  --cor-primaria: #0f172a;
  --cor-primaria-hover: #020617;
  --cor-sucesso: #0284c7;
  --cor-sucesso-hover: #0369a1;
  --cor-fundo: #f0f9ff;
  --cor-container: #ffffff;
  --cor-borda: #bae6fd;
  --texto-principal: #0f172a;
  --texto-secundario: #475569;
}

:root[data-theme="sunset"] {
  --cor-primaria: #7c2d12;
  --cor-primaria-hover: #431407;
  --cor-sucesso: #ea580c;
  --cor-sucesso-hover: #c2410c;
  --cor-fundo: #fff7ed;
  --cor-container: #ffffff;
  --cor-borda: #fed7aa;
  --texto-principal: #431407;
  --texto-secundario: #9a3412;
}

/* 🌸 TEMA ROSA CEREJA */
:root[data-theme="pink"] {
  --cor-primaria: #831843;
  --cor-primaria-hover: #500724;
  --cor-sucesso: #be185d;
  --cor-sucesso-hover: #9d174d;
  --cor-fundo: #fdf2f8;
  --cor-container: #ffffff;
  --cor-borda: #fbcfe8;
  --texto-principal: #831843;
  --texto-secundario: #be185d;
}

/* 🍇 TEMA AMETISTA (Roxo) */
:root[data-theme="purple"] {
  --cor-primaria: #4c1d95;
  --cor-primaria-hover: #2e1065;
  --cor-sucesso: #7c3aed;
  --cor-sucesso-hover: #6d28d9;
  --cor-fundo: #f5f3ff;
  --cor-container: #ffffff;
  --cor-borda: #ede9fe;
  --texto-principal: #4c1d95;
  --texto-secundario: #7c3aed;
}

/* 🚀 TEMA CYBERPUNK (Escuro Diferente com Neon) */
:root[data-theme="cyberpunk"] {
  --cor-primaria: #d946ef; /* Rosa Neon */
  --cor-primaria-hover: #c026d3;
  --cor-sucesso: #06b6d4; /* Ciano Neon */
  --cor-sucesso-hover: #0891b2;
  --cor-fundo: #09090b; /* Preto profundo */
  --cor-container: #18181b; /* Cinza chumbo */
  --cor-borda: #27272a;
  --texto-principal: #f4f4f5; /* Branco brilhante */
  --texto-secundario: #a1a1aa; /* Cinza metálico */
}

/* ⚪ TEMA MINIMALISTA (Cinza P&B) */
:root[data-theme="monochrome"] {
  --cor-primaria: #111827;
  --cor-primaria-hover: #000000;
  --cor-sucesso: #4b5563;
  --cor-sucesso-hover: #374151;
  --cor-fundo: #f3f4f6;
  --cor-container: #ffffff;
  --cor-borda: #e5e7eb;
  --texto-principal: #111827;
  --texto-secundario: #4b5563;
}

/* 💖 TEMA HOT PINK (Escuro com Rosa Neon) */
:root[data-theme="hotpink"] {
  --cor-primaria: #ff1493; /* Rosa Neon super vibrante */
  --cor-primaria-hover: #c71585;
  --cor-sucesso: #ff69b4;
  --cor-sucesso-hover: #db7093;
  --cor-fundo: #0d0409; /* Preto com um fundo bem sutil de magenta */
  --cor-container: #1f0b17; /* Cinza super escuro rosado */
  --cor-borda: #421c32;
  --texto-principal: #fdf2f8; /* Branco rosado */
  --texto-secundario: #fbcfe8; /* Rosa claro para destaques */
}

/* 👽 TEMA MATRIX (Preto Absoluto com Verde Neon) */
:root[data-theme="matrix"] {
  --cor-primaria: #00ff41; /* Verde Hacker Neon */
  --cor-primaria-hover: #008f11;
  --cor-sucesso: #03a062;
  --cor-sucesso-hover: #027a4b;
  --cor-fundo: #050505; /* Preto quase absoluto */
  --cor-container: #121212; /* Cinza muito escuro */
  --cor-borda: #1a3320;
  --texto-principal: #e0e0e0; /* Cinza claro para não cansar a leitura */
  --texto-secundario: #00ff41; /* Textos secundários também em verde neon */
}


*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-corpo); /* Fonte nova para o corpo */
  background-color: var(--cor-fundo);
  color: var(--texto-principal);
  margin: 0;
  padding: 0;
}

/* ==============================================
   LAYOUT PRINCIPAL
   ============================================== */
.container {
  max-width: 1100px;
  margin: 40px auto;
  background: var(--cor-container);
  padding: 40px;
  border-radius: 24px;
  box-shadow: var(--sombra-suave);
}

/* ==============================================
   TIPOGRAFIA (Títulos)
   ============================================== */
h1, h2 {
  font-family: var(--font-titulos); /* Fonte nova para os títulos */
  text-align: center;
  color: var(--texto-principal);
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

/* ==============================================
   ABAS DE NAVEGAÇÃO
   ============================================== */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 12px;
  flex-wrap: wrap;
}

.tabs button {
  padding: 12px 24px;
  border: 1px solid var(--cor-borda);
  border-radius: 12px;
  background-color: var(--cor-container);
  color: var(--texto-secundario);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.tabs button:hover {
  background-color: var(--cor-primaria);
  color: white;
  border-color: var(--cor-primaria);
  transform: translateY(-2px);
  box-shadow: var(--sombra-suave);
}

/* ==============================================
   FORMULÁRIOS E ENTRADAS DE DADOS
   ============================================== */
.entrada-dados {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}

.entrada-dados label {
    font-weight: 500;
    color: var(--texto-secundario);
    display: flex;
    align-items: center;
    gap: 8px;
}

.entrada-dados select,
.entrada-dados input[type="text"],
.entrada-dados input[type="number"],
.entrada-dados input[type="date"],
.entrada-dados input[type="password"],
.entrada-dados input[type="email"] {
  padding: 12px;
  border: 1px solid var(--cor-borda);
  border-radius: 10px;
  font-size: 15px;
  background-color: var(--cor-container); /* MUDEI AQUI */
  color: var(--texto-principal);          /* ADICIONEI AQUI PARA A LETRA FICAR BRANCA NO ESCURO */
  transition: border-color 0.2s, box-shadow 0.2s;
}

.entrada-dados select:focus,
.entrada-dados input:focus {
  outline: none;
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.entrada-dados button {
  padding: 12px 20px;
  border: none;
  background-color: var(--cor-sucesso);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.2s;
}

.entrada-dados button:hover {
  background-color: var(--cor-sucesso-hover);
}

/* ==============================================
   TABELAS
   ============================================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--cor-borda);
}

th {
  background-color: var(--cor-fundo);
  font-weight: 600;
  color: var(--texto-secundario);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: var(--cor-fundo);
}

td.acoes {
    text-align: right;
}

td.acoes button {
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 20px;
  margin: 0 4px;
  padding: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  line-height: 1;
  transition: background-color 0.2s, transform 0.2s ease;
}

td.acoes button:hover {
  background-color: #eef2ff; /* Fundo suave de índigo no hover */
  transform: scale(1.1);
}

/* ==============================================
   COMPONENTES ESPECÍFICOS
   ============================================== */
.reservas-lista p {
  display: grid;
  grid-template-columns: 1fr 1fr auto; /* Divide a linha em 3 colunas perfeitamente retas */
  align-items: center;
  gap: 15px;
  font-size: 1.1em;
  padding: 12px 10px;
  border-bottom: 1px solid var(--cor-borda);
}

.reservas-lista p .reserva-nome {
  text-align: left;
  color: var(--texto-secundario);
  white-space: nowrap; /* Evita que nomes muito longos quebrem a linha */
  overflow: hidden;
  text-overflow: ellipsis; /* Coloca "..." se o nome for gigante */
}

.reservas-lista p .reserva-valor {
  text-align: center; /* Mantém TODOS os valores alinhados no centro da coluna 2 */
  font-weight: 700;
  color: var(--texto-principal);
}

.reservas-lista p:last-child {
  border-bottom: none;
}

.btn-editar-reserva {
  background-color: var(--cor-sucesso);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
  transition: background-color 0.2s;
}

.btn-editar-reserva:hover {
  background-color: var(--cor-sucesso-hover);
}

#totalMes, #totalFiltro, #totalDetalhado, #totalHistoricoReserva {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 20px 0;
  color: var(--texto-principal);
}

canvas {
  margin: 40px auto;
  max-width: 100%;
  display: block;
}

/* ==============================================
   TELAS DE LOGIN E REGISTRO
   ============================================== */
/* Centraliza o texto e restringe a largura máxima para o card não ficar gigante no PC */
 #tela-login, #tela-registro {
  max-width: 420px; /* Deixa o card estreito e chique no PC */
  margin: 40px auto; 
  text-align: center;
  padding: 30px 40px;
}

#tela-login h2, #tela-registro h2 {
  border: none;
  margin-bottom: 25px;
  font-size: 1.8rem;
  color: var(--cor-primaria);
}

/* Faz os campos ficarem um embaixo do outro com 100% de largura */
#tela-login input,
#tela-registro input,
#tela-registro select {
  width: 100%;
  padding: 14px;
  margin-bottom: 15px;
  border: 1px solid var(--cor-borda);
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box; /* Impede que o padding quebre a largura */
  background-color: #fcfcfc;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#tela-login input:focus,
#tela-registro input:focus,
#tela-registro select:focus {
  outline: none;
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(0, 66, 37, 0.15); /* Sombra suave ao clicar */
}

/* Estilo da nova nota multilíngue */
.nota-idioma {
  font-size: 12px;
  color: #888;
  margin-top: 15px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Botões de Ação Padronizados */
#tela-login button,
#tela-registro button {
  width: 100%;
  padding: 15px;
  background-color: var(--cor-primaria);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

#tela-login button:hover,
#tela-registro button:hover {
  background-color: var(--cor-primaria-hover);
  transform: translateY(-2px); /* Efeito de levitar ao passar o mouse */
}

/* Ajuste dos links inferiores */
#tela-login p, #tela-registro p {
  font-size: 14px;
  color: var(--texto-secundario);
}

#tela-login a, #tela-registro a {
  color: var(--cor-primaria);
  font-weight: bold;
  text-decoration: none;
}

#tela-login a:hover, #tela-registro a:hover {
  text-decoration: underline;
}
/* Centraliza o card na tela */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh; /* Ocupa toda a altura da tela */
  padding: 20px;
  background-color: #f4f7f6; /* Cor de fundo leve */
}

.auth-container {
  width: 100%;
  max-width: 480px; /* Largura elegante para o card */
  animation: fadeIn 0.5s ease;
  margin: 0 auto;
}

/* O Card Profissional */
.auth-card {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Sombra suave */
  border: 1px solid rgba(0,0,0,0.02);
}

/* Título Chique */
.auth-card h2 {
  font-family: 'Playfair Display', serif; /* Certifique-se de que esta fonte está no seu index.html */
  color: var(--cor-primaria);
  font-size: 2rem;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 700;
  border: none; /* Remove a borda inferior padrão */
}

/* Estrutura dos Campos de Entrada */
.input-group {
  margin-bottom: 18px;
  width: 100%;
}

/* Estilo solicitado para o rótulo da data */
.input-label-fixo {
  display: block;
  font-size: 1rem;
  color: var(--cor-primaria);
  margin-bottom: 5px;
  font-weight: bold;
  text-align: left;
}

/* Estilo Moderno para Inputs e Selects - Empilhados e Arredondados */
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="date"],
.lang-select {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--cor-borda);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  background-color: #fafafa;
  transition: all 0.3s ease;
  box-sizing: border-box; /* Garante que o padding não quebre a largura */
}

/* Efeito ao Clicar no Campo */
.auth-card input:focus,
.lang-select:focus {
  outline: none;
  border-color: var(--cor-primaria);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 77, 44, 0.1); /* Glow suave */
}

/* Bloco da Nota Multilíngue solicitado */
.language-selection-block {
  background-color: #f9fbf9;
  padding: 15px;
  border-radius: 12px;
  border: 1px dashed var(--cor-borda);
  margin-top: 25px;
  margin-bottom: 20px;
  text-align: center;
}

.multilang-note {
  font-size: 0.8rem;
  color: var(--texto-secundario);
  margin-bottom: 10px;
  line-height: 1.4;
}

.lang-select {
  cursor: pointer;
}

/* Botão Principal Elegante (Apenas UM botão) */
.btn-primary {
  width: 100%;
  padding: 16px;
  background-color: var(--cor-primaria);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  font-family: 'Lato', sans-serif;
}

.btn-primary:hover {
  background-color: var(--cor-primaria-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 77, 44, 0.2);
}

/* Links Auxiliares (Esqueci senha, Voltar) */
.auth-links {
  margin-top: 25px;
  text-align: center;
  font-size: 0.9rem;
}

.auth-links p {
  color: var(--texto-secundario);
  margin-top: 10px;
}

.auth-links a {
  color: var(--cor-primaria);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
}

.auth-links a:hover {
  color: var(--cor-primaria-hover);
  text-decoration: underline;
}

/* Mensagens de Erro */
.error-message {
  color: #e74c3c;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 15px;
  text-align: center;
}

/* Animação de Entrada */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================
   LISTAS DE CONFIGURAÇÃO (Categorias e Pagamentos)
   ============================================== */
.lista-config {
  list-style: none; /* Remove as bolinhas pretas */
  padding: 0;
  margin-top: 15px;
}

.lista-config li {
  display: flex;
  justify-content: space-between; /* Texto na esquerda, botões na direita */
  align-items: center;
  background-color: var(--cor-container); /* ISSO REMOVE A COR BEGE FIXA */
  border: 1px solid var(--cor-borda);
  padding: 12px 18px;
  margin-bottom: 10px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--texto-principal); /* ISSO ARRUMA A COR DA LETRA */
  transition: all 0.2s ease;
}

.lista-config li:hover {
  background-color: #f2eedc;
  transform: translateX(3px); /* Efeito suave ao passar o mouse */
}

/* Agrupador dos botões para eles ficarem juntinhos na direita */
.botoes-acao {
  display: flex;
  gap: 15px;
}

.lista-config li button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.6;
  transition: all 0.2s ease;
  padding: 0;
}

.lista-config li button:hover {
  opacity: 1;
  transform: scale(1.2); /* Faz o emoji crescer um pouquinho */
}
/* ==============================================
   CALENDÁRIO INTERATIVO (GRID E ETIQUETAS)
   ============================================== */
.calendario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendario-header button {
  background-color: var(--cor-primaria);
  color: var(--cor-container);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.calendario-header button:hover {
  transform: scale(1.1);
}

.calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background-color: var(--cor-borda);
  border: 1px solid var(--cor-borda);
  border-radius: 12px;
  overflow: hidden;
}

.calendario-dia-header {
  background-color: var(--cor-container);
  text-align: center;
  padding: 12px 0;
  font-weight: bold;
  color: var(--texto-secundario);
  font-size: 0.9rem;
}

.calendario-dia {
  background-color: var(--cor-container);
  min-height: 100px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s;
}

.calendario-dia:hover {
  background-color: var(--cor-fundo);
  transform: scale(0.98);
}

.calendario-dia.vazio {
  background-color: transparent;
  pointer-events: none;
}

.calendario-dia .numero {
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--texto-principal);
}

.calendario-dia.hoje .numero {
  background-color: var(--cor-primaria);
  color: var(--cor-container);
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.badges-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

.badge-gasto {
  background-color: #e74c3c; /* Vermelho para gastos */
  color: white;
  font-size: 0.75rem;
  padding: 4px;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
}

.badge-reserva {
  background-color: #10b981; /* Verde elegante para dinheiro guardado */
  color: white;
  font-size: 0.75rem;
  padding: 4px;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
}

.calendario-detalhes {
  background-color: var(--cor-fundo);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--cor-borda);
  margin-top: 20px;
}

/* ==============================================
   BOTÃO DE MICROFONE INTELIGENTE (IA)
   ============================================== */
.btn-mic {
  background-color: var(--cor-primaria);
  color: var(--cor-container);
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-mic:hover {
  transform: scale(1.05);
  background-color: var(--cor-sucesso);
}

.btn-mic.gravando {
  background-color: #e74c3c !important; /* Vermelho gravando */
  animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* ==============================================
   CHATBOT FINANCEIRO IA 🧠💬
   ============================================== */
.btn-flutuante-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
    transition: transform 0.3s;
    z-index: 1000;
}

.btn-flutuante-chat:hover {
    transform: scale(1.05);
}

.janela-chat {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: var(--cor-container);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--cor-borda);
    animation: fadeIn 0.3s ease-out;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-mensagens {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--cor-fundo);
}

.msg-bolha {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.msg-ia {
    background-color: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: var(--sombra-suave);
}

.msg-user {
    background-color: #667eea;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background-color: white;
    border-top: 1px solid var(--cor-borda);
}

.chat-input-area input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--cor-borda);
    border-radius: 20px;
    outline: none;
    background-color: #f9f9f9;
}

.chat-input-area button {
    background-color: transparent;
    border: none;
    color: #764ba2;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.1);
}
/* Botão de Sair Chique */
.btn-sair {
    float: right;
    background-color: transparent;
    color: var(--cor-perigo);
    border: 1px solid var(--cor-perigo);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sair:hover {
    background-color: var(--cor-perigo);
    color: white;
    transform: scale(1.05);
}
/* ==============================================
   ESTILIZAÇÃO PROFISSIONAL DOS SELECTS (DROPDOWNS)
   ============================================== */
/* Deixa todos os Dropdowns com cara de Aplicativo */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Adiciona uma setinha SVG minimalista e elegante no fundo */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%235c5c5c' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 96%;
    background-position-y: 50%;
    padding-right: 30px !important;
    cursor: pointer;
}

/* O Hack Mágico para o Select Múltiplo (Filtro de Categorias) não parecer o Windows 95 */
select[multiple] {
    appearance: auto;
    background-image: none;
    padding: 8px !important;
    border-radius: 12px;
    height: 150px; /* Altura fixa elegante para rolar */
    overflow-y: auto;
    /* Estilo de rolagem minimalista (Chrome/Edge) */
    scrollbar-width: thin;
    scrollbar-color: var(--cor-primaria) transparent;
}

select[multiple]::-webkit-scrollbar { width: 6px; }
select[multiple]::-webkit-scrollbar-thumb { background-color: var(--cor-primaria); border-radius: 10px; }

select[multiple] option {
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--cor-fundo);
}

select[multiple] option:hover {
    transform: translateX(4px);
}

/* O item clicado vira um 'Botão Pill' usando a cor do tema */
select[multiple] option:checked {
    background-color: var(--cor-primaria) !important;
    color: var(--cor-container) !important;
    font-weight: bold;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}

/* Fundo escuro que cobre a tela toda */
.modal {
  display: none; /* Escondido por padrão */
  position: fixed; 
  z-index: 1000; /* Fica por cima de tudo */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Transparência */
}

/* A caixa branca com o texto */
.modal-content {
  background-color: #fefefe;
  margin: 10% auto; /* Centraliza na tela */
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* O botão de fechar (X) */
.fechar-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.fechar-modal:hover {
  color: #000;
}
/* Camada de fundo (Overlay) */
.modal-overlay {
    position: fixed; /* Fixa na tela toda */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75); /* Fundo escuro */
    display: none; /* Escondido por padrão */
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Acima de tudo */
    padding: 20px;
}

/* Caixa de conteúdo centralizada */
.modal-content-box {
    background: var(--cor-container);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 95%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8); /* Fundo bem escuro para foco */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* ========================================= */
/* 📱 OTIMIZAÇÃO PARA CELULAR (RESPONSIVIDADE) */
/* ========================================= */
@media (max-width: 768px) {
    
    /* 1. Menu de Abas (Deixa 2 botões por linha) */
    .tabs {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }
    .tabs button {
        width: 48%; /* Ocupa quase metade da tela */
        padding: 12px 5px;
        font-size: 0.9rem;
        margin: 0;
    }

    /* 2. Formulários e Inputs (Empilha tudo e deixa grandão) */
    .entrada-dados {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .entrada-dados input:not([type="checkbox"]), 
    .entrada-dados select, 
    .entrada-dados button {
        width: 100% !important; /* Força a ocupar a tela toda */
        height: 48px; /* Altura ideal para o toque do dedo */
        font-size: 1rem;
        box-sizing: border-box;
        margin: 0;
    }

    /* 3. Ajusta a área das faturas e pagamentos */
    .entrada-dados div {
        flex-direction: column;
        width: 100%;
    }
    .entrada-dados label {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 5px;
    }

    /* Checkboxes arrumadinhos na esquerda */
    .entrada-dados label:has(input[type="checkbox"]) {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    /* 4. Tabelas de Histórico (Permite rolar para o lado sem quebrar a tela) */
    .aba table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        border-collapse: collapse;
    }
    
    .aba table th, .aba table td {
        padding: 10px;
    }

    /* 5. Ajustes gerais de texto para não vazar */
    h1 { font-size: 1.4rem; text-align: center; }
    h2 { font-size: 1.2rem; text-align: center; }
    
    /* Botão de sair no topo */
    h1 .btn-sair {
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin-left: 10px;
        padding: 5px 10px !important;
    }
}
/* ==============================================
   BARRAS DE PROGRESSO (METAS)
   ============================================== */
.meta-card {
    background: var(--cor-container);
    border: 1px solid var(--cor-borda);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--sombra-suave);
    position: relative;
}

.meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.meta-categoria {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--texto-principal);
}

.meta-valores {
    font-size: 0.9rem;
    color: var(--texto-secundario);
}

.progress-bg {
    background-color: var(--cor-borda);
    border-radius: 10px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out, background-color 0.5s ease;
}

.btn-remover-meta {
    background: none;
    border: none;
    color: var(--texto-secundario);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s, color 0.2s;
}

.btn-remover-meta:hover {
    color: var(--cor-perigo);
    transform: scale(1.1);
}

/* Cores dinâmicas de Status */
.status-bom { background-color: #10b981; } /* Verde */
.status-atencao { background-color: #f59e0b; } /* Amarelo */
.status-perigo { background-color: #ef4444; } /* Vermelho */

/* Estilo para a imagem no botão flutuante */
.avatar-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

/* Estilo para a imagem no topo do chat */
.avatar-header {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Ajuste do botão flutuante para alinhar imagem e texto */
.btn-flutuante-chat {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
}

.btn-fechar-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.btn-fechar-chat:hover {
    opacity: 1;
}
/* ========================================== */
/* WIDGET FLUTUANTE ESTILO CARTÃO PROFISSIONAL*/
/* ========================================== */
.widget-isa-flutuante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    /* Fundo escuro com leve transparência estilo vidro */
    background: linear-gradient(135deg, rgba(30, 0, 49, 0.95) 0%, rgba(62, 0, 102, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid #8a2be2; /* Borda roxa premium */
    border-radius: 16px; /* Reduzido */
    padding: 10px; /* Reduzido */
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Reduzido */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 150px; /* Largura bem menor para não atrapalhar a tela */
    pointer-events: auto;
}

.widget-isa-flutuante:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.4);
    border-color: #06b6d4; /* Muda a borda para ciano ao passar o mouse */
}

.widget-isa-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    width: 100%;
}

.widget-isa-avatar {
    width: 55px; /* Bem menor e mais delicado */
    height: 55px;
    border-radius: 12px; 
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.widget-isa-textos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.widget-isa-nome {
    font-weight: 900;
    font-size: 1.2rem; /* Reduzido */
    color: #ffffff;
    font-family: var(--font-titulos);
}

.widget-isa-cargo {
    font-size: 0.7rem; /* Reduzido */
    color: #e0d0f0;
    line-height: 1.2;
}

/* Etiqueta de 'Online' com a bolinha piscando */
.widget-isa-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem; /* Reduzido */
    color: #10b981; 
    margin-top: 4px;
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 8px; /* Reduzido */
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-weight: bold;
}

.bolinha-online {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    animation: piscar-online 1.5s infinite alternate;
}

@keyframes piscar-online {
    0% { opacity: 0.4; }
    100% { opacity: 1; box-shadow: 0 0 10px #10b981; }
}

/* O botão de "Ação" desenhado embaixo */
.widget-isa-acao {
    background: linear-gradient(135deg, #d946ef 0%, #8b5cf6 100%);
    color: white;
    font-weight: bold;
    font-size: 0.85rem; /* Reduzido */
    padding: 8px; /* Reduzido */
    border-radius: 20px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background 0.3s, transform 0.2s;
}

.widget-isa-flutuante:hover .widget-isa-acao {
    background: linear-gradient(135deg, #c026d3 0%, #7c3aed 100%);
    transform: scale(1.02);
}

/* ========================================== */
/* NOVO ESTILO: BOTÃO DE ESCONDER WIDGET ("X")*/
/* ========================================== */
.btn-esconder-isa {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.btn-esconder-isa:hover {
    color: #ff4757; /* Fica vermelho ao passar o mouse */
    transform: scale(1.1);
}

/* ========================================== */
/* OTIMIZAÇÃO PARA A TELA DO CELULAR */
/* ========================================== */
@media (max-width: 768px) {
    .widget-isa-flutuante {
        width: 140px; /* Ligeiramente menor no celular para não atrapalhar */
        padding: 8px;
        bottom: 15px;
        right: 15px;
        gap: 6px;
    }
    .widget-isa-avatar {
        width: 50px;
        height: 50px;
    }
    .widget-isa-nome { font-size: 1.1rem; }
    .widget-isa-cargo { font-size: 0.65rem; }
    .widget-isa-acao { font-size: 0.8rem; padding: 6px; }
}
/* ========================================== */
/* WIDGET MINIMIZADO DA ISA (ABINHA LATERAL)  */
/* ========================================== */
.isa-minimizada {
    position: fixed;
    bottom: 30px;
    right: -10px; /* Fica um pouco para fora da tela */
    background: linear-gradient(135deg, rgba(30, 0, 49, 0.95) 0%, rgba(62, 0, 102, 0.95) 100%);
    border: 2px solid #8a2be2;
    border-right: none; /* Tira a borda do lado direito */
    border-radius: 20px 0 0 20px; /* Arredonda só do lado esquerdo */
    padding: 8px 12px 8px 8px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: -4px 4px 15px rgba(0,0,0,0.5);
    transition: right 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
}

.isa-minimizada:hover {
    right: 0px; /* Puxa a abinha pra fora ao passar o mouse */
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(62, 0, 102, 0.95) 0%, rgba(138, 43, 226, 0.95) 100%);
}

.avatar-minimizada {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

/* ========================================= */
/* CORREÇÃO DO BUG DE TRAVAMENTO NO IPHONE   */
/* ========================================= */
input, select, textarea {
    font-size: 16px !important;
}

/* Evita o clique piscar de preto no iOS */
* {
    -webkit-tap-highlight-color: transparent;
}