/**
 * Estilos para o Dashboard de Campanhas FAOS
 *
 * Breakpoints (max-width):
 *   1024px - Ajustes finos da tabela em telas médias (1 regra)
 *   768px  - Layout vertical/empilhado (header, filtros, KPIs, painel acessibilidade)
 *   480px  - Layout mobile completo: substitui tabela por boxes + popup
 */
:root {
  --primary: #0069C3;
  --primary-light: #E6F0F9;
  --primary-dark: #004b99;
  --secondary: #388E3C;
  --warning: #FFC107;
  --danger: #D32F2F;
  --dark: #212121;
  --light: #F5F5F5;
  --white: #FFFFFF;
  --border-radius: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Cores para tipos de campanha */
  --campanha-t: #4CAF50;
  --campanha-h: #2196F3;
  --campanha-p: #FF9800;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  padding: 20px;
}

.dashboard-container {
  max-width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
}

/* Estilos do cabeçalho */
.dashboard-header {
  background-color: var(--white);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.dashboard-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.dashboard-title i {
  margin-right: 8px;
}

.control-panel {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-button {
  padding: 8px 16px;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: background-color 0.3s;
}

.toggle-button:hover {
  background-color: #004b99;
}

.toggle-button i {
  margin-right: 8px;
}

/* KPI Cards */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.kpi-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* KPI Cards para diferentes campanhas */
.kpi-cards-campaign {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.kpi-card-campaign {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card-campaign:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.kpi-card-campaign.tipo-t {
  border-left: 4px solid var(--campanha-t);
}

.kpi-card-campaign.tipo-h {
  border-left: 4px solid var(--campanha-h);
}

.kpi-card-campaign.tipo-p {
  border-left: 4px solid var(--campanha-p);
}

.kpi-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 5px;
}

.kpi-value.positive {
  color: var(--secondary);
}

.kpi-value.negative {
  color: var(--danger);
}

.kpi-value.neutral {
  color: var(--primary);
}

.kpi-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.kpi-card.roi .kpi-icon {
  color: var(--primary);
}

.kpi-card.lucro .kpi-icon {
  color: var(--secondary);
}

.kpi-card.resp .kpi-icon {
  color: #FF9800;
}

.kpi-card.pix .kpi-icon {
  color: #9C27B0;
}

/* Tabela */
.table-container {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
  width: 100%;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.table-header {
  background-color: var(--primary);
  color: var(--white);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-title {
  font-size: 18px;
  font-weight: 600;
}

.table-actions {
  display: flex;
  gap: 10px;
}

.filter-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 15px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

/* Labels dos grupos de filtros */
.filter-group-label {
  font-weight: 700;
  color: var(--dark);
  font-size: 14px;
  margin-right: 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Separadores visuais entre grupos */
.filter-separator {
  width: 2px;
  height: 35px;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  opacity: 0.3;
  margin: 0 5px;
}

/* Seção de gráficos */
.charts-section {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.charts-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 20px;
  text-align: center;
}

.charts-header h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
}

.charts-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 14px;
}

.charts-content {
  padding: 40px 20px;
}

.chart-placeholder {
  text-align: center;
  color: var(--dark);
  padding: 40px 20px;
}

.chart-placeholder p {
  margin: 15px 0 5px 0;
  font-size: 18px;
  font-weight: 600;
}

.chart-placeholder small {
  color: #666;
  font-style: italic;
}

/* Grupo de botões de filtro à esquerda */
.filter-container::before {
  content: "";
  display: flex;
  order: 1;
  flex: 1;
}

.filter-button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.filter-button.all {
  background-color: var(--dark);
  color: var(--white);
}

.filter-button.tipo-t {
  background-color: var(--campanha-t);
  color: var(--white);
}

.filter-button.tipo-h {
  background-color: var(--campanha-h);
  color: var(--white);
}

.filter-button.tipo-p {
  background-color: var(--campanha-p);
  color: var(--white);
}

/* Estilos do filtro de ano */
.year-filter-label {
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
  white-space: nowrap;
}

.year-filter-label i {
  margin-right: 5px;
  color: var(--primary);
}

.year-filter-select {
  padding: 8px 12px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  background-color: var(--white);
  color: var(--dark);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
}

.year-filter-select:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-dark);
}

.year-filter-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 105, 195, 0.2);
  border-color: var(--primary-dark);
}

/* Botão de gráficos */
.filter-button.charts {
  background-color: var(--secondary);
  color: var(--white);
}

.filter-button.charts:hover {
  background-color: #2e7d32;
  transform: translateY(-1px);
}

/* Botão de detalhes */
.filter-button.details {
  background-color: var(--primary);
  color: var(--white);
}

.filter-button.details:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

.filter-button.details.active {
  background-color: var(--primary-dark);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Botão reset */
.filter-button.reset {
  background-color: #6c757d;
  color: var(--white);
}

.filter-button.reset:hover {
  background-color: #545b62;
  transform: translateY(-1px);
}



.filter-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Alternar ícone quando o botão de detalhes está ativo */
.filter-button.details.active {
  background-color: #004080;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  opacity: 1;
  border-bottom: 2px solid #fff;
}

/* Adicionar estilo para o ícone quando o botão está ativo */
.filter-button.details.active i {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

#dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

#dashboard-table th {
  background-color: var(--primary);
  color: var(--white);
  text-align: left;
  padding: 12px 8px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
  text-align: right;
}

#dashboard-table tbody tr:hover {
  background-color: var(--primary-light);
}

#dashboard-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

#dashboard-table th:nth-child(1), #dashboard-table td:nth-child(1),
#dashboard-table th:nth-child(2), #dashboard-table td:nth-child(2),
#dashboard-table th:nth-child(3), #dashboard-table td:nth-child(3),
#dashboard-table th:nth-child(4), #dashboard-table td:nth-child(4),
#dashboard-table th:nth-child(5), #dashboard-table td:nth-child(5) {
  text-align: left;
}

.campaign-details {
  display: none;
}

.subtotal {
  background-color: #f1f8ff;
  font-weight: 600;
}

.subtotal td {
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* Estilo para as linhas TOTAL */
.total {
  background-color: #e6f0f9;
  font-weight: 700;
}

.total td {
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  font-weight: 700 !important;
}

/* Estilo específico para totais por tipo */
.total-tipo {
  background-color: #f0f4f8;
  font-weight: 600;
}

.total-tipo td {
  border-top: 1px solid #b8c5d1;
  border-bottom: 1px solid #b8c5d1;
  font-weight: 600 !important;
}

/* Estilo para o total geral (mais destacado) */
#total-geral-row {
  background-color: #d4edda;
}

#total-geral-row td {
  border-top: 3px solid var(--success);
  border-bottom: 3px solid var(--success);
}

.campaign-header {
  cursor: pointer;
  background-color: var(--primary-light);
  transition: background-color 0.3s;
}

.campaign-header:hover {
  background-color: #d0e4f7;
}

.campaign-header td {
  padding: 15px;
  font-weight: 600;
  color: var(--primary);
  /* Garantir que ocupe a largura total */
  width: 100%;
}

.campaign-header td[colspan] {
  text-align: left;
  width: 100%;
  display: table-cell;
}

/* Definir larguras específicas para colunas */
#dashboard-table th:nth-child(1), #dashboard-table td:nth-child(1) { width: 100px; } /* ID */
#dashboard-table th:nth-child(2), #dashboard-table td:nth-child(2) { width: 120px; } /* Postagem */
#dashboard-table th:nth-child(3), #dashboard-table td:nth-child(3) { width: 120px; } /* Campanha */
#dashboard-table th:nth-child(4), #dashboard-table td:nth-child(4) { width: 120px; } /* Segmento */
#dashboard-table th:nth-child(5), #dashboard-table td:nth-child(5) { width: 300px; } /* Brinde - Aumentado para mais espaço */

/* Estilos para diferentes tipos de campanha */
.campaign-header.tipo-t {
  background-color: rgba(76, 175, 80, 0.2);
}

.campaign-header.tipo-h {
  background-color: rgba(33, 150, 243, 0.2);
}

.campaign-header.tipo-p {
  background-color: rgba(255, 152, 0, 0.2);
}

.campaign-header.tipo-t td {
  color: var(--campanha-t);
}

.campaign-header.tipo-h td {
  color: var(--campanha-h);
}

.campaign-header.tipo-p td {
  color: var(--campanha-p);
}

.campaign-icon {
  margin-right: 8px;
}

.value-positive {
  color: var(--secondary);
  font-weight: 600;
}

.value-negative {
  color: var(--danger);
  font-weight: 600;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Login form */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  background-color: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  color: var(--primary);
  font-size: 24px;
  margin-bottom: 10px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-weight: 600;
  color: var(--dark);
}

.form-group input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.login-button {
  padding: 12px;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-button:hover {
  background-color: #004b99;
}

.user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info span {
  font-weight: 600;
}

.logout-button {
  background-color: transparent;
  color: var(--dark);
  border: 1px solid var(--dark);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.logout-button:hover {
  background-color: rgba(33, 33, 33, 0.1);
}

/* Alerta */
.alert {
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Mobile responsive */
@media (max-width: 1024px) {
  #dashboard-table {
    table-layout: auto;
  }
  
  #dashboard-table th, #dashboard-table td {
    min-width: auto;
    max-width: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .dashboard-container {
    padding: 0;
  }

  .dashboard-header {
    padding: 15px;
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-title {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
  }

  .control-panel {
    flex-direction: column;
    width: 100%;
  }

  .toggle-button {
    width: 100%;
    justify-content: center;
    margin-bottom: 5px;
  }
  
  /* Ajustar os cards de KPI para mobile */
  .kpi-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .kpi-card {
    margin-bottom: 0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

  .kpi-value {
    font-size: 22px;
    word-break: break-word;
  }
  
  .kpi-subtitle {
    font-size: 11px;
  }

  .kpi-title {
    font-size: 12px;
  }

  .table-container {
    margin: 0;
    border-radius: 0;
  }

  .table-header {
    padding: 10px;
  }

  .table-title {
    font-size: 16px;
  }

  .filter-container {
    margin: 5px 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    justify-content: space-between;
  }

  .filter-container::before {
    display: none;
  }

  .filter-button {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    padding: 8px 5px;
    font-size: 13px;
  }
  
  .filter-button i {
    margin-right: 4px;
  }

  .filter-button.all {
    grid-column: span 3;
  }

  .filter-button.reset,
  .filter-button.details {
    grid-column: span 3;
    margin-top: 5px;
  }

  #dashboard-table {
    font-size: 14px;
  }

  #dashboard-table th,
  #dashboard-table td {
    padding: 8px;
    white-space: nowrap;
  }

  .user-info {
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }

  .logout-button {
    width: 100%;
    margin-top: 5px;
  }

  .client-selector {
    margin: 10px 0;
    width: 100%;
    justify-content: center;
  }

  /* Ajustar a informação de última atualização */
  .last-update-info {
    margin: 5px auto;
    font-size: 0.75rem;
    text-align: center;
    width: 100%;
    justify-content: center;
  }

  /* Painel de acessibilidade */
  .accessibility-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .accessibility-label {
    margin-bottom: 8px;
  }

  .accessibility-controls {
    width: 100%;
    justify-content: space-between;
  }

  .zoom-slider {
    max-width: none;
    width: 100%;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
  }
  
  /* Ajustar os KPIs para ficarem como cards em mobile */
  .kpi-cards {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 15px 0;
  }
  
  .kpi-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
  }
  
  .kpi-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .kpi-icon {
    font-size: 24px;
    margin-bottom: 0;
  }
  
  .kpi-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 0;
    text-transform: uppercase;
  }
  
  .kpi-subtitle {
    font-size: 11px;
    color: #666;
  }
  
  .kpi-value {
    font-size: 22px;
    text-align: right;
    margin-bottom: 0;
  }
  
  /* Estilo específico para os KPIs alinhados ao design do print */
  .kpi-card.lucro .kpi-icon {
    color: #4CAF50;
  }
  
  .kpi-card.roi .kpi-icon {
    color: #2196F3;
  }
  
  .kpi-card.resp .kpi-icon {
    color: #FF9800;
  }
  
  .kpi-card.pix .kpi-icon {
    color: #9C27B0;
  }
  
  /* Ajustar informações do usuário em mobile */
  .user-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  
  /* Estilo para o botão de atualizar no mobile */
  #run-analysis-btn-mobile {
    padding: 6px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    order: 1;
    flex: 0 1 auto;
  }
  
  .user-info span {
    order: 0;
    font-size: 0.85rem;
    flex: 0 1 auto;
  }
  
  .logout-button {
    order: 2;
    white-space: nowrap;
    text-align: center;
    padding: 6px 12px;
    font-size: 0.85rem;
    flex: 0 1 auto;
  }
  
  /* Cartões KPI mais compactos */
  .kpi-card {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
  
  .kpi-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .kpi-icon {
    font-size: 20px;
    margin-bottom: 0;
  }
  
  .kpi-title-group {
    display: flex;
    flex-direction: column;
  }
  
  .kpi-value {
    font-size: 20px;
    text-align: right;
    margin-bottom: 0;
  }
  
  .kpi-subtitle {
    font-size: 10px;
    text-align: right;
  }

  .kpi-cards-campaign {
    grid-template-columns: 1fr;
  }

  .kpi-card-campaign {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    min-height: 60px;
  }

  .kpi-card-campaign .kpi-card-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .kpi-card-campaign .kpi-title {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .kpi-card-campaign .kpi-subtitle {
    font-size: 10px;
    opacity: 0.8;
  }

  .kpi-card-campaign .kpi-value {
    font-size: 16px;
    text-align: right;
  }

  #dashboard-table {
    font-size: 12px;
  }

  #dashboard-table th,
  #dashboard-table td {
    padding: 6px;
  }

  /* Melhorias para tabela em mobile */
  .table-wrapper {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #dashboard-table {
    min-width: 700px; /* Reduzindo a largura mínima para melhor adaptação em telas pequenas */
  }

  /* Melhorar a visualização em dispositivos móveis */
  .campaign-header td {
    font-size: 14px;
    padding: 12px 8px;
  }

  /* Indicador de scroll mais visível e atrativo */
  .table-wrapper::after {
    content: "← Deslize para ver mais →";
    display: block;
    text-align: center;
    padding: 8px;
    margin-top: 5px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    opacity: 0.8;
    animation: fadeInOut 2s infinite;
  }

  @keyframes fadeInOut {
    0% { opacity: 0.5; }
    50% { opacity: 0.9; }
    100% { opacity: 0.5; }
  }

  .filter-container {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  
  .filter-button {
    font-size: 12px;
    padding: 6px 3px;
  }
  
  .filter-button.all {
    grid-column: span 2;
  }

  .filter-button.reset,
  .filter-button.details {
    grid-column: 1 / span 1;
    margin-top: 4px;
  }
  
  .filter-button.reset {
    grid-column: 2 / span 1;
  }

  /* Esconde as linhas de subtotais da tabela em mobile */
  tr.subtotal {
    display: none !important;
  }
  
  /* Esconde os headers da tabela em mobile */
  #dashboard-table thead,
  .campaign-header {
    display: none !important;
  }
  
  /* Esconde a linha de total */
  #total-geral-row {
    display: none !important;
  }
  
  /* Esconde o wrapper da tabela para que apenas os boxes apareçam */
  .table-wrapper {
    display: none !important;
  }
  
  /* Esconde o botão de configurar colunas na versão mobile */
  #configure-columns, 
  .tooltip {
    display: none !important;
  }
  
  /* Esconde o botão de mostrar detalhes na versão mobile */
  #toggle-details {
    display: none !important;
  }
  
  /* Container para boxes de subtotais */
  .mobile-subtotal-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 5px;
    padding: 0 5px;
  }
  
  /* Estilo para cada box de subtotal */
  .subtotal-box {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-top: 3px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  /* Box filtrado (escondido) */
  .subtotal-box.filtered-out {
    display: none !important;
  }
  
  .subtotal-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }
  
  /* Estilo específico por tipo de campanha */
  .subtotal-box.tipo-t {
    border-top-color: var(--campanha-t);
  }
  
  .subtotal-box.tipo-h {
    border-top-color: var(--campanha-h);
  }
  
  .subtotal-box.tipo-p {
    border-top-color: var(--campanha-p);
  }
  
  /* Conteúdo do box */
  .subtotal-box-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .subtotal-box-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .subtotal-box-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
  }
  
  .subtotal-box-label {
    color: #555;
  }
  
  .subtotal-box-value {
    font-weight: 600;
  }
  
  .subtotal-box-value.positive {
    color: var(--secondary);
  }
  
  .subtotal-box-value.negative {
    color: var(--danger);
  }
  
  .subtotal-box-footer {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: #777;
  }
  
  /* Estilos para o indicador de deslize (removido) */
  .mobile-scroll-indicator {
    display: none !important;
  }
  
  /* Popup de detalhes */
  .campaign-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    overflow-y: auto;
    padding: 15px;
  }
  
  .campaign-detail-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    max-width: 100%;
    width: 100%;
    margin: 10px auto;
    position: relative;
    animation: slideUpModal 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  @keyframes slideUpModal {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  .campaign-detail-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--white);
    z-index: 2;
  }
  
  .campaign-detail-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
  }
  
  .campaign-detail-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #777;
    padding: 0 10px;
  }
  
  .campaign-detail-body {
    padding: 15px;
  }
  
  .campaign-detail-summary {
    background-color: var(--primary-light);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
  }
  
  .campaign-detail-summary-title {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary);
    text-align: center;
    font-size: 14px;
  }
  
  .campaign-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .campaign-detail-stat-item {
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 5px;
    border-radius: 4px;
  }
  
  .campaign-detail-stat-label {
    font-size: 10px;
    color: #555;
    font-weight: 600;
  }
  
  .campaign-detail-stat-value {
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .campaign-detail-table-container {
    margin-top: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .campaign-detail-table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .campaign-detail-table th {
    background-color: var(--primary);
    color: var(--white);
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
  }
  
  .campaign-detail-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    text-align: center;
  }
  
  .campaign-detail-table tr:nth-child(even) {
    background-color: #f9f9f9;
  }
  
  .campaign-detail-table tr:hover td {
    background-color: var(--primary-light);
  }
  
  .campaign-detail-table tr:last-child td {
    border-bottom: none;
  }
  
  .campaign-detail-footer {
    padding: 12px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 11px;
    color: #777;
    background-color: #f9f9f9;
  }
}

/* Faz o popup se tornar fullscreen apenas em mobile */
@media (min-width: 481px) {
  .campaign-detail-modal {
    display: none !important; /* Não mostrar popup em desktop */
  }
  
  .mobile-subtotal-boxes {
    display: none !important; /* Não mostrar boxes em desktop */
  }
}

/* Melhorias para touch devices */
@media (hover: none) {
  .toggle-button:hover,
  .filter-button:hover,
  .logout-button:hover {
    background-color: var(--primary);
  }

  .kpi-card:hover {
    transform: none;
  }
}

/* Ajustes para iOS */
@supports (-webkit-touch-callout: none) {
  .table-wrapper {
    -webkit-overflow-scrolling: touch;
  }
}

/* Configuração para tabela com cabeçalho fixo */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  /* Altura máxima para ativar o scroll, ajuste conforme necessário */
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

/* Garantir que o cabeçalho da tabela fique fixo durante o scroll */
#dashboard-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Cabeçalho da tabela */
#dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--primary);
}

/* Fixar seção de filtros */
.filter-container {
  position: sticky;
  top: 0;
  z-index: 6;
  background-color: var(--white);
  margin: 0;
  padding: 10px 20px;
  border-bottom: 1px solid #ddd;
}

/* Ajustar o título da tabela para ficar fixo */
.table-header {
  position: sticky;
  top: 0;
  z-index: 7;
}

/* Ajustar espaçamento para caso haja título e filtros */
.table-header + .filter-container {
  top: 60px; /* Ajuste conforme altura do .table-header */
}

.filter-container + #dashboard-table thead th {
  top: 60px; /* Ajuste conforme altura do .filter-container */
}

.table-header + .filter-container + #dashboard-table thead th {
  top: 120px; /* Soma das alturas de .table-header e .filter-container */
}

/* Estilos para redimensionamento de colunas */
.column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.05);
  cursor: col-resize;
}

.column-resizer:hover,
body.resizing .column-resizer {
  background-color: var(--primary);
}

body.resizing {
  cursor: col-resize !important;
}

body.resizing * {
  user-select: none;
}

th {
  position: relative;
  overflow: visible;
}

/* Classes para gradientes de valores */
/* Taxa de Resposta (do mais escuro/melhor para o mais claro/pior) */
.resp-gradient-5 { background-color: rgba(25, 118, 210, 0.9); color: white; }
.resp-gradient-4 { background-color: rgba(25, 118, 210, 0.7); color: white; }
.resp-gradient-3 { background-color: rgba(25, 118, 210, 0.5); color: white; }
.resp-gradient-2 { background-color: rgba(25, 118, 210, 0.3); color: black; }
.resp-gradient-1 { background-color: rgba(25, 118, 210, 0.1); color: black; }
.resp-gradient-0 { background-color: black; color: white; } /* Para valores zero */
.resp-gradient-n { background-color: var(--warning); color: black; } /* Para valores negativos */

/* % PIX (do mais escuro/melhor para o mais claro/pior) */
.pix-gradient-5 { background-color: rgba(156, 39, 176, 0.9); color: white; }
.pix-gradient-4 { background-color: rgba(156, 39, 176, 0.7); color: white; }
.pix-gradient-3 { background-color: rgba(156, 39, 176, 0.5); color: white; }
.pix-gradient-2 { background-color: rgba(156, 39, 176, 0.3); color: black; }
.pix-gradient-1 { background-color: rgba(156, 39, 176, 0.1); color: black; }
.pix-gradient-0 { background-color: black; color: white; } /* Para valores zero */
.pix-gradient-n { background-color: var(--warning); color: black; } /* Para valores negativos */

/* Lucro (do mais escuro/melhor para o mais claro/pior) */
.lucro-gradient-5 { background-color: rgba(56, 142, 60, 0.9); color: white; }
.lucro-gradient-4 { background-color: rgba(56, 142, 60, 0.7); color: white; }
.lucro-gradient-3 { background-color: rgba(56, 142, 60, 0.5); color: white; }
.lucro-gradient-2 { background-color: rgba(56, 142, 60, 0.3); color: black; }
.lucro-gradient-1 { background-color: rgba(56, 142, 60, 0.1); color: black; }
.lucro-gradient-0 { background-color: black; color: white; } /* Para valores zero */
.lucro-gradient-n { background-color: var(--warning); color: black; } /* Para valores negativos */

/* ROI (do mais escuro/melhor para o mais claro/pior) */
.roi-gradient-5 { background-color: rgba(0, 105, 195, 0.9); color: white; }
.roi-gradient-4 { background-color: rgba(0, 105, 195, 0.7); color: white; }
.roi-gradient-3 { background-color: rgba(0, 105, 195, 0.5); color: white; }
.roi-gradient-2 { background-color: rgba(0, 105, 195, 0.3); color: black; }
.roi-gradient-1 { background-color: rgba(0, 105, 195, 0.1); color: black; }
.roi-gradient-0 { background-color: black; color: white; } /* Para valores zero */
.roi-gradient-n { background-color: var(--warning); color: black; } /* Para valores negativos */

/* Classes para aplicar nas células com transição suave */
.gradient-cell {
  transition: background-color 0.3s ease;
  padding: 8px 10px !important;
  border-radius: 3px;
  font-weight: 600;
}

/* Adicionar estilos para o seletor de clientes */
.client-selector {
  display: flex;
  align-items: center;
  margin-right: 15px;
  background-color: var(--primary-light);
  padding: 8px 12px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.client-selector label {
  margin-right: 8px;
  font-weight: bold;
  color: var(--primary);
}

.client-selector select {
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 4px 8px;
  background-color: var(--white);
  color: var(--dark);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.client-selector select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 105, 195, 0.2);
}

/* Estilos para o painel de acessibilidade */
.accessibility-panel {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 15px;
  display: none;
  animation: fadeIn 0.3s ease;
}

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

.accessibility-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.accessibility-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #eee;
}

.accessibility-section:last-child {
  border-bottom: none;
}

.accessibility-label {
  flex: 0 0 150px;
  font-weight: 600;
  color: var(--dark);
}

.accessibility-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.a11y-button {
  border: 1px solid #ddd;
  background-color: var(--white);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.a11y-button:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.a11y-button.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.zoom-slider {
  flex: 1;
  max-width: 200px;
  height: 8px;
}

#zoom-value {
  width: 45px;
  text-align: center;
  font-weight: 600;
}

.accessibility-info {
  font-size: 12px;
  color: #666;
  margin-top: 10px;
  text-align: center;
  font-style: italic;
}

/* Clases para alto contraste */
.high-contrast {
  background-color: black !important;
  color: white !important;
}

.high-contrast .dashboard-header,
.high-contrast .table-container,
.high-contrast .kpi-card,
.high-contrast .kpi-card-campaign,
.high-contrast .accessibility-panel {
  background-color: black !important;
  border: 1px solid white !important;
  color: white !important;
}

.high-contrast th,
.high-contrast .table-header {
  background-color: #333 !important;
  color: yellow !important;
}

.high-contrast .campaign-header {
  background-color: #222 !important;
  color: yellow !important;
}

.high-contrast a,
.high-contrast button,
.high-contrast .dashboard-title,
.high-contrast .kpi-title {
  color: yellow !important;
}

.high-contrast a:hover,
.high-contrast button:hover {
  background-color: #444 !important;
}

.high-contrast .kpi-value.positive {
  color: lightgreen !important;
}

.high-contrast .kpi-value.negative {
  color: lightcoral !important;
}

/* Modos de visualização da tabela */
.compact-table th,
.compact-table td {
  padding: 4px 6px !important;
  font-size: 90% !important;
}

.compact-table .campaign-header td {
  padding: 8px !important;
}

.expanded-table th,
.expanded-table td {
  padding: 12px 16px !important;
  font-size: 110% !important;
}

.expanded-table .campaign-header td {
  padding: 16px !important;
}


/* Botão de Configuração de Colunas */
.config-button {
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #444;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  margin-right: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.config-button:hover {
  background-color: #e9ecef;
  color: #333;
}

.config-button i {
  margin-right: 5px;
}

#hidden-columns-count {
  display: inline-block;
  background-color: #0069C3;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  text-align: center;
  line-height: 18px;
  margin-left: 5px;
  font-weight: bold;
}

/* Modal de Configuração de Colunas */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s;
}

.modal-content {
  position: relative;
  background-color: #fefefe;
  margin: 10% auto;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 85%;
  max-width: 500px;
  animation: slideIn 0.3s;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.close {
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: #444;
}

.modal-body {
  padding: 15px 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.columns-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.column-option {
  display: flex;
  align-items: center;
  padding: 8px 5px;
  background-color: #f8f9fa;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.column-option:hover {
  background-color: #e9ecef;
}

.column-option input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.column-option label {
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px;
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.modal-button {
  padding: 8px 16px;
  margin-left: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

#restore-columns {
  background-color: #f8f9fa;
  color: #444;
  border: 1px solid #ddd;
}

#restore-columns:hover {
  background-color: #e9ecef;
}

#save-columns {
  background-color: #0069C3;
  color: white;
}

#save-columns:hover {
  background-color: #0058a3;
}

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

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Estilos para colunas ocultas */
.hidden-column {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

/* Ajustes especiais para subtotais e totais com colunas ocultas */
tr.subtotal td[colspan="5"],
tr#total-geral-row td[colspan="5"] {
  position: sticky;
  left: 0;
  background-color: inherit;
  z-index: 1;
}

/* Tabela com rolagem horizontal quando colunas são ocultas */
.table-wrapper {
  overflow-x: auto;
  position: relative;
}

/* Garantir que o layout da tabela seja fixo para manter alinhamento de colunas */
#dashboard-table {
  table-layout: fixed;
  width: 100%;
}

/* Garantir o alinhamento perfeito para cabeçalhos e células */
#dashboard-table th,
#dashboard-table td {
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Garantir que linhas ocultas não afetem o layout */
tr.campaign-details.hidden-row {
  display: none !important;
}

/* Estilos para cabeçalhos de coluna ordenáveis */
.sortable {
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background-color 0.3s;
}

.sortable:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sort-icon {
  display: inline-block;
  width: 10px;
  height: 14px;
  margin-left: 5px;
  position: relative;
  opacity: 0.5;
}

.sort-icon::before,
.sort-icon::after {
  content: "";
  position: absolute;
  left: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.sort-icon::before {
  top: 0;
  border-bottom: 5px solid #aaa;
}

.sort-icon::after {
  bottom: 0;
  border-top: 5px solid #aaa;
}

.sortable.asc .sort-icon::before {
  border-bottom-color: #0069C3;
  opacity: 1;
}

.sortable.desc .sort-icon::after {
  border-top-color: #0069C3;
  opacity: 1;
}

.sortable.asc .sort-icon::after,
.sortable.desc .sort-icon::before {
  opacity: 0.3;
}

/* Destaque para coluna ordenada */
.sortable.asc,
.sortable.desc {
  background-color: #e6f0f9; /* Cor de fundo destacada */
  box-shadow: inset 0 -2px 0 #0069C3; /* Linha sublinhando o cabeçalho */
}

/* Estilo para a tabela quando uma coluna está sendo ordenada */
#dashboard-table.sorting {
  animation: flash-sorting 0.3s;
}

@keyframes flash-sorting {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* Ajuste para campanhas expandidas */

/* Estilos para notificação de status */
#status-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.3s ease-out;
  background-color: #0069C3;
  color: white;
}

#status-notification.show {
  transform: translateX(0);
}

#status-notification i {
  margin-right: 10px;
  font-size: 20px;
}

#status-notification.success {
  background-color: #388E3C;
}

#status-notification.error {
  background-color: #D32F2F;
}

#status-notification.processing {
  background-color: #0069C3;
}

#status-notification.processing i {
  animation: spin 1s infinite linear;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estilos para o botão vermelho e para a exibição da última atualização */
.admin-button {
  padding: 8px 16px;
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: background-color 0.3s;
}

.admin-button:hover {
  background-color: #2d7430;
}

.admin-button-red {
  background-color: var(--danger);
}


.admin-button-blue {
  background-color: var(--primary);
}

.admin-button-blue:hover {
  background-color: var(--primary-dark);
}

.admin-button-red:hover {
  background-color: #b71c1c;
}

.admin-button i {
  margin-right: 8px;
}

.last-update-info {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  font-size: 0.85rem;
  color: #555;
  background-color: #f1f1f1;
  padding: 4px 8px;
  border-radius: 4px;
}

.last-update-info i {
  margin-right: 5px;
  color: var(--primary);
}

/* Estilos para ferramentas de administração */
.admin-tools {
  display: flex;
  gap: 10px;
  margin: 0 10px;
  align-items: center;
}

.admin-button {
  padding: 8px 16px;
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: background-color 0.3s;
}

.admin-button:hover {
  background-color: #2d7430;
}

.admin-button-red {
  background-color: var(--danger);
}


.admin-button-blue {
  background-color: var(--primary);
}

.admin-button-blue:hover {
  background-color: var(--primary-dark);
}

.admin-button-red:hover {
  background-color: #b71c1c;
}

.admin-button i {
  margin-right: 8px;
}

.last-update-info {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  font-size: 0.85rem;
  color: #555;
  background-color: #f1f1f1;
  padding: 4px 8px;
  border-radius: 4px;
}

.last-update-info i {
  margin-right: 5px;
  color: var(--primary);
}

/* Adicionar ajuste para o novo ícone de usuário com gráfico */
.fa-user-chart:before {
    content: "\f007"; /* ícone de usuário */
    margin-right: -0.4em;
}

.fa-user-chart:after {
    content: "\f080"; /* ícone de gráfico de barras */
    font-size: 0.7em;
    position: relative;
    top: -0.5em;
    left: 0.6em;
}

/* Estilo para a seção de KPIs de doadores */
.donor-kpi-section {
    margin: 20px 0;
    animation: fadeIn 0.3s ease-in-out;
}
/* === Cores semânticas ROI/Lucro (gradiente coerente) === */
/* ROI: <0.5 vermelho forte | 0.5-1.0 vermelho/laranja | 1.0-1.5 verde claro | >=1.5 verde forte */
.roi-very-low {
  color: #c0392b;
  font-weight: 700;
  background-color: rgba(192, 57, 43, 0.08);
}

.roi-low {
  color: #e67e22;
  font-weight: 700;
  background-color: rgba(230, 126, 34, 0.08);
}

.roi-mid {
  color: #27ae60;
  font-weight: 600;
  background-color: rgba(39, 174, 96, 0.06);
}

.roi-high {
  color: #16a34a;
  font-weight: 700;
  background-color: rgba(22, 163, 74, 0.10);
}

/* Lucro: positivo verde, negativo vermelho */
.lucro-positive {
  color: #16a34a;
  font-weight: 600;
}

.lucro-negative {
  color: #c0392b;
  font-weight: 600;
}

/* Subtotais e totais ganham ênfase visual */
tr.subtotal .roi-very-low,
tr.subtotal .roi-low,
tr.subtotal .roi-mid,
tr.subtotal .roi-high,
tr.total .roi-very-low,
tr.total .roi-low,
tr.total .roi-mid,
tr.total .roi-high {
  font-weight: 800;
}

/* === Modal seletor de gráficos === */
.chart-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInOverlay 0.15s ease;
}

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

.chart-selector-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  overflow: hidden;
}

.chart-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: var(--primary, #0069C3);
  color: #fff;
}

.chart-selector-header h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}

.chart-selector-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 8px;
}

.chart-selector-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
}

.chart-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.2s;
}

.chart-tab:hover {
  background: #f3f4f6;
  color: #111;
}

.chart-tab.active {
  color: var(--primary, #0069C3);
  border-bottom-color: var(--primary, #0069C3);
  background: #fff;
}

.chart-selector-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chart-filters input,
.chart-filters select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.chart-filters .chart-search {
  flex: 1;
  min-width: 180px;
}

.chart-select-all-row {
  margin: 8px 0;
}

.chart-select-all {
  color: var(--primary, #0069C3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.chart-select-all:hover {
  text-decoration: underline;
}

.chart-out-of-filter {
  background: #fef3c7;
  color: #78350f;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}

.chart-cap-warning {
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.chart-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
}

.chart-item {
  border-bottom: 1px solid #f3f4f6;
}

.chart-item:last-child {
  border-bottom: none;
}

.chart-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.chart-item label:hover {
  background: #f9fafb;
}

.chart-item label.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chart-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.chart-item-name {
  font-weight: 600;
  color: #111;
  flex-shrink: 0;
}

.chart-item-sub {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.chart-item-kpi {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.chart-selector-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.chart-counter {
  font-size: 13px;
  color: #374151;
  font-weight: 600;
}

.chart-actions {
  display: flex;
  gap: 8px;
}

.chart-btn-cancel,
.chart-btn-confirm {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.chart-btn-cancel {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.chart-btn-cancel:hover {
  background: #f3f4f6;
}

.chart-btn-confirm {
  background: var(--primary, #0069C3);
  color: #fff;
}

.chart-btn-confirm:hover:not(:disabled) {
  background: var(--primary-dark, #004b99);
}

.chart-btn-confirm:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .chart-selector-modal {
    max-height: 100vh;
    border-radius: 0;
  }
  .chart-selector-overlay {
    padding: 0;
  }
  .chart-item-kpi {
    font-size: 11px;
  }
}
