@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

/* ==========================================================================
   1. CONFIGURAÇÕES GLOBAIS E VARIÁVEIS
   ========================================================================== */
:root {
  /* Cores Principais */
  --azul-solucao: #203351;
  --vermelho-confianca: #a6191c;
  --vinho-reveste: #7e1210;
  --laranja-promocao: #e94e24;

  /* Cores de Apoio */
  --rosa-decora: #c31152;
  --verde-planta: #b0c053;
  --azul-agua: #2ba3d5;

  /* Cores Neutras */
  --background-color: #f4f7fa;
  --card-background: #ffffff;
  --border-color: #dee2e6;
  --text-color: #333;
  --text-color-light: #6c757d;
  --header-text: #ffffff;

  /* Métricas de Layout */
  --nav-sidebar-width: 260px;
  --filter-sidebar-width: 280px;
  --header-height: 70px;
}

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

body {
  font-family: "Roboto", sans-serif;
  background-color: #cccccc;
  color: var(--text-color);
  overflow: hidden;
  /* Previne scroll da página inteira */
}

/* ==========================================================================
   2. ESTRUTURA E LAYOUT GERAL
   ========================================================================== */

/* O Container Pai que gerencia o Grid (Filtro + Conteúdo) */
.page-container {
  display: block;
  /* Padrão (login) */
  padding-top: var(--header-height);
  height: 100vh;
  transition: grid-template-columns 0.3s ease-in-out;
}

/* Estado Ativo (Dashboard com Grid) */
body:not(.page-login-active) .page-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  /* Largura do filtro | Resto */
}

.main-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  /* Impede que o grid estoure com conteúdo largo */
}

.main-content {
  flex-grow: 1;
  overflow-y: auto;
  /* Apenas esta área principal é rolável */
  padding: 2rem;
}

/* ==========================================================================
   3. COMPONENTES GERAIS (HEADER, BOTÕES, MENUS)
   ========================================================================== */

/* --- Header --- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--azul-solucao);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  flex-basis: 250px;
  gap: 16px;
}

.header-right {
  justify-content: flex-end;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 80px;
  width: auto;
}

#page-title {
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  flex-grow: 1;
}

.header-icon-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 1.8rem;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.header-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Botão de Filtro no Header */
#filter-toggle-button {
  margin-left: 10px;
}

/* --- Dropdown do Usuário --- */
.user-profile {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.user-profile:hover {
  opacity: 0.8;
}

.user-profile i {
  font-size: 2rem;
  margin-left: 0.8rem;
  color: var(--header-text);
  opacity: 0.8;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  width: 150px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  overflow: hidden;
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu ul {
  list-style: none;
}

.dropdown-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.8rem 1rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-color);
  transition: background-color 0.2s ease;
}

.dropdown-menu button:hover {
  background-color: #f8f9fa;
}

.dropdown-menu button i {
  margin-right: 0.8rem;
  color: var(--text-color-light);
}

/* ==========================================================================
   4. SIDEBAR DE NAVEGAÇÃO (MENU HAMBÚRGUER)
   ========================================================================== */

.nav-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-sidebar-width);
  height: 100vh;
  background-color: var(--vinho-reveste);
  color: white;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1100;
  display: flex;
  flex-direction: column;
}

.nav-sidebar.visible {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.5rem;
  text-align: center;
  background-color: var(--vermelho-confianca);
  flex-shrink: 0;
  position: relative;
  /* <--- IMPORTANTE: Permite posicionar o botão 'absolute' */
  display: flex;
  /* Garante alinhamento vertical */
  align-items: center;
  justify-content: center;
}

/* Estilização do Botão de Fechar (X) */
.close-sidebar-btn {
  /* Posicionamento: Canto superior direito */
  position: absolute;
  top: 50%;
  /* Centraliza verticalmente */
  right: 15px;
  /* Distância da direita */
  transform: translateY(-50%);
  /* Ajuste fino da centralização vertical */

  /* Visual: Transparente e Circular */
  background-color: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  /* Branco com leve transparência */

  width: 32px;
  height: 32px;
  border-radius: 50%;
  /* Faz virar uma bolinha */

  /* Flex para centralizar o ícone dentro da bolinha */
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Efeito ao passar o mouse */
.close-sidebar-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  /* Fundo branco suave */
  color: #ffffff;
  /* Branco puro */
  transform: translateY(-50%) scale(1.1);
  /* Aumenta um pouquinho */
}

/* Ajuste para telas muito pequenas (opcional) */
@media (max-width: 768px) {
  .close-sidebar-btn {
    right: 10px;
  }
}

.nav-sidebar ul {
  list-style: none;
  flex-grow: 1;
  overflow-y: auto;
  padding-bottom: 2rem;
}

.nav-sidebar ul li a {
  display: block;
  padding: 1rem 1.5rem;
  color: white;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.nav-sidebar ul li a:hover {
  background-color: var(--vermelho-confianca);
}

.nav-sidebar ul li a i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.nav-sidebar ul::-webkit-scrollbar {
  width: 8px;
}

.nav-sidebar ul::-webkit-scrollbar-track {
  background: var(--vermelho-confianca);
}

.nav-sidebar ul::-webkit-scrollbar-thumb {
  background-color: var(--laranja-promocao);
  border-radius: 10px;
  border: 2px solid var(--vermelho-confianca);
}

/* ==========================================================================
   5. SIDEBAR DE FILTROS (BARRA LATERAL)
   ========================================================================== */

/* Seletor genérico para a barra (usando classe ou tag) */
aside.filter-sidebar {
  display: none;
  /* Oculto no login */
  width: 240px;
  background-color: transparent;
  padding: 1.5rem;
  overflow-y: auto;
  border-right: 1px solid #bbbbbb;
  flex-shrink: 0;
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease-in-out;
}

/* Mostra a barra quando não está no login */
body:not(.page-login-active) aside.filter-sidebar {
  display: block;
}

/* Lógica do Botão Ocultar Filtros */
body.filters-hidden .page-container {
  grid-template-columns: 0px 1fr;
}

body.filters-hidden aside.filter-sidebar {
  transform: translateX(-100%);
  opacity: 0;
  padding: 0;
  margin: 0;
}

/* Estilos internos da barra de filtros */
.filter-sidebar h3 {
  font-size: 1.1rem;
  color: var(--azul-solucao);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.filter-group .checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.filter-group .checkbox-group input {
  margin-right: 0.75rem;
  width: 16px;
  height: 16px;
}

select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: white;
  cursor: pointer;
}

/* ==========================================================================
   6. CHAT WIDGET E JANELA
   ========================================================================== */

.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background-color: var(--laranja-promocao);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  z-index: 900;
}

.chat-widget:hover {
  transform: scale(1.1);
  background-color: var(--vermelho-confianca);
}

.chat-window {
  position: fixed;
  bottom: 7rem;
  right: 2rem;
  width: 350px;
  max-height: 500px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.9);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1200;
  visibility: hidden;
  pointer-events: none;
}

.chat-window.visible {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
  pointer-events: auto;
}

.chat-header {
  background-color: var(--azul-solucao);
  color: white;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
}

.chat-messages {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
}

.message {
  margin-bottom: 1rem;
  max-width: 85%;
}

.message p {
  padding: 0.75rem 1rem;
  border-radius: 15px;
  line-height: 1.4;
}

.bot-message {
  align-self: flex-start;
}

.bot-message p {
  background-color: #e9ecef;
  color: var(--text-color);
  border-bottom-left-radius: 2px;
}

.user-message {
  margin-left: auto;
}

.user-message p {
  background-color: var(--laranja-promocao);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  display: flex;
  padding: 0.5rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

#chat-input {
  flex-grow: 1;
  border: none;
  padding: 0.8rem;
  font-size: 1rem;
}

#chat-input:focus {
  outline: none;
}

#chat-send-btn {
  background: var(--laranja-promocao);
  color: white;
  border: none;
  padding: 0 1.2rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 0.5rem;
}

/* ==========================================================================
   7. ESTADOS ESPECIAIS (LOGIN, PLACEHOLDER)
   ========================================================================== */

.page-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 60vh;
  text-align: center;
  color: #999;
  background-color: #e9ecef;
  border-radius: 8px;
}

.page-placeholder h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Oculta a interface principal quando na página de login */
body.page-login-active .nav-sidebar,
body.page-login-active .filter-sidebar,
body.page-login-active .main-header,
body.page-login-active .chat-widget {
  display: none;
}

body.page-login-active .page-container,
body.page-login-active .main-container {
  margin-left: 0;
  padding-left: 0;
}

body.page-login-active .main-content {
  padding-top: 0;
}

/* ==========================================================================
   8. COMPONENTE MULTI-SELECT
   ========================================================================== */

.multiselect-container {
  position: relative;
  width: 100%;
}

.multiselect-button {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: white;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.multiselect-button svg {
  width: 16px;
  height: 12px;
  transition: transform 0.2s ease;
}

.multiselect-options {
  position: absolute;
  top: 105%;
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  display: none;
  padding: 0.5rem 0;
}

.multiselect-options.visible {
  display: block;
}

.multiselect-options.visible+.multiselect-button svg {
  transform: rotate(180deg);
}

.multiselect-option {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.multiselect-option:hover {
  background-color: #f8f9fa;
}

.multiselect-option input[type="checkbox"] {
  margin-right: 0.75rem;
  width: 16px;
  height: 16px;
}

.multiselect-option label {
  margin-bottom: 0;
  font-weight: 400;
  pointer-events: none;
}

.periodo-group .ano-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.periodo-group .ano-option label {
  flex-grow: 1;
  pointer-events: auto;
}

.toggle-meses {
  padding: 0 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.meses-container {
  display: none;
  padding-left: 25px;
}

.meses-container.visible {
  display: block;
}

.mes-option label {
  font-weight: 400;
  pointer-events: auto;
}

.header-icon-btn,
#hamburger-menu,
/* <-- ADICIONE ESTE ID AQUI */
#menu-toggle,
/* (Pode manter por segurança) */
#filter-toggle-button {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 1.8rem !important;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

/* Efeito hover suave */
.header-icon-btn:hover,
#menu-toggle:hover,
#filter-toggle-button:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px;
}

/* ==========================================================================
   ESTILOS DA SIDEBAR DE FILTROS (TEMA AZUL ESCURO)
   ========================================================================== */

/* 1. Container Pai da Sidebar */
aside.filter-sidebar {
  height: calc(100vh - 70px);
  /* Ocupa a altura restante abaixo do header */
  overflow-y: auto;
  /* Scroll vertical se necessário */
  overflow-x: hidden;
  /* Sem scroll horizontal */
  padding: 0;
  margin: 0;
  background-color: var(--azul-solucao);
  /* Fundo Azul Escuro (#203351) */
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  /* Divisória sutil */

  /* Transição para o efeito de ocultar */
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease-in-out;
}

/* 2. Wrapper do Conteúdo dos Filtros */
.filter-global {
  background-color: transparent;
  padding: 20px;
  color: #e2e8f0;
  /* Texto cinza claro */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

/* 3. Títulos (h3) */
.filter-global h3 {
  color: #ffffff;
  /* Branco puro */
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 20px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
}

/* 4. Grupos de Filtros e Labels */
.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #cbd5e0;
  /* Cinza claro para labels */
}

/* 5. Dropdowns Customizados (Botão) */
.multiselect-container {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.multiselect-container .multiselect-button {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;

  /* Estilo "Glass" sobre o azul */
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;

  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.multiselect-container .multiselect-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Ícone SVG dentro do botão */
.multiselect-container .multiselect-button svg {
  width: 14px;
  height: 14px;
  stroke: #ffffff;
  /* Ícone branco */
  transition: transform 0.2s ease;
}

/* 6. Menu Flutuante de Opções (Dropdown aberto) */
.multiselect-options {
  position: absolute;
  top: 105%;
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;

  /* Fundo escuro sólido para leitura */
  background-color: #1a202c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);

  z-index: 1100;
  display: none;
  padding: 0.5rem 0;
  box-sizing: border-box;
}

.multiselect-options.visible {
  display: block;
}

/* Rotação do ícone quando aberto */
.multiselect-options.visible+.multiselect-button svg {
  transform: rotate(180deg);
}

/* Itens dentro do dropdown */
.multiselect-option {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #e2e8f0;
}

.multiselect-option:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.multiselect-option input[type="checkbox"],
.multiselect-option input[type="radio"] {
  margin-right: 10px;
  accent-color: var(--laranja-promocao);
  /* Cor do check */
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.multiselect-option label {
  margin-bottom: 0;
  font-weight: 400;
  pointer-events: none;
  /* Clique na linha ativa o input */
  color: #e2e8f0;
  flex-grow: 1;
}

/* 7. Grupos de Checkbox (Tipo) */
.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 10px;
  accent-color: var(--laranja-promocao);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-group label {
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
  color: #e2e8f0;
}

/* 8. Selects Nativos (Arquiteto, Exp. Vila) - Estilo Dark */
.filter-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;

  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;

  border-radius: 6px;
  cursor: pointer;

  /* Remove estilo padrão do navegador para customizar a seta */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Ícone de seta BRANCO (SVG encodado) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  box-sizing: border-box;
}

.filter-group select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.15);
}

/* Opções dentro do Select Nativo (O navegador controla isso, mas tentamos forçar escuro) */
.filter-group select option {
  background-color: #1a202c;
  color: #ffffff;
}

/* 9. Estilos Específicos para o Filtro de Período (Ano/Mês) */
.periodo-group .ano-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  padding: 8px 12px;
  color: #ffffff;
}

.periodo-group .ano-option label {
  flex-grow: 1;
  pointer-events: auto;
  margin-bottom: 0;
  color: #ffffff;
}

.toggle-meses {
  padding: 0 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  color: #ffffff;
}

.meses-container {
  display: none;
  padding-left: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  /* Fundo levemente mais escuro para os meses */
}

.meses-container.visible {
  display: block;
  color: #cbd5e0;
}

/* Botão de Limpar Filtros */
.limpar-filtros-button {
  width: 100%;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.limpar-filtros-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.limpar-filtros-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.08);
}

/* Campo de busca dentro do multiselect */
.multiselect-search {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px;
  background-color: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.multiselect-search input {
  width: 100%;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.multiselect-search input::placeholder {
  color: rgba(226, 232, 240, 0.5);
}

.multiselect-search input:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   MODAL DE COMPARAÇÃO
======================================== */
.comparison-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.comparison-modal-overlay.active {
    display: flex;
}

.comparison-modal {
    background: #1a202c;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.comparison-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
}

.comparison-modal-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.comparison-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comparison-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Body */
.comparison-modal-body {
    padding: 32px;
}

.comparison-configs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Config Cards */
.config-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s ease;
}

.config-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.config-card.config-1 {
    border-top: 3px solid #5B9BD5;
}

.config-card.config-2 {
    border-top: 3px solid #ED7D31;
}

.config-card h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
}

.config-1 .config-number {
    background: #5B9BD5;
    color: white;
}

.config-2 .config-number {
    background: #ED7D31;
    color: white;
}

/* Filter Groups dentro do Modal */
.config-card .filter-group {
    margin-bottom: 16px;
}

.config-card .filter-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.config-card select,
.config-card .multiselect-button {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-card select:hover,
.config-card .multiselect-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.config-card select:focus,
.config-card .multiselect-button:focus {
    outline: none;
    border-color: #5B9BD5;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}

/* Checkbox dentro do modal */
.config-card .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.config-card .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.config-card .checkbox-group label {
    margin: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

/* Footer */
.comparison-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.comparison-modal-footer button {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-apply {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: white;
}

.btn-apply:hover {
    background: linear-gradient(135deg, #3d6ba3 0%, #2d4a6f 100%);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.4);
}

.btn-clear {
    background: rgba(237, 125, 49, 0.2);
    color: #ED7D31;
}

.btn-clear:hover {
    background: rgba(237, 125, 49, 0.3);
}

/* ========================================
   BOTÃO DE COMPARAÇÃO NO SIDEBAR
======================================== */
.comparison-toggle-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.comparison-toggle-btn:hover {
    background: linear-gradient(135deg, #3d6ba3 0%, #2d4a6f 100%);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.4);
    transform: translateY(-1px);
}

.comparison-toggle-btn.active {
    background: linear-gradient(135deg, #ED7D31 0%, #d6691f 100%);
}

.comparison-toggle-btn i {
    font-size: 1rem;
}

/* ========================================
   INDICADORES DE COMPARAÇÃO
======================================== */
.comparison-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 8px;
}

.comparison-indicator.positive {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.comparison-indicator.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.comparison-indicator.neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.comparison-indicator i {
    font-size: 0.75rem;
}

/* Badge de modo comparação */
.comparison-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(237, 125, 49, 0.2);
    color: #ED7D31;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   RESPONSIVIDADE
======================================== */
@media (max-width: 768px) {
    .comparison-configs {
        grid-template-columns: 1fr;
    }
    
    .comparison-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .comparison-modal-header,
    .comparison-modal-body,
    .comparison-modal-footer {
        padding: 16px;
    }

.bottom-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px;
  width: 100% !important;
}

.bottom-row .chart-block {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 300px;
  flex: 1 1 100% !important;
}

.bottom-row .evolution-block {
  width: 100% !important;
  max-width: none !important;
}

.bottom-row .chart-block>div {
  width: 100% !important;
}

.full-width-span {
  grid-column: 1 / -1 !important;
}
}