// 📊 Expense Chart - Gráfico Moderno de Despesas
.expense-chart {
  // background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  background: var(--surface, #ffffff);
  border-radius: 16px;
  padding: 24px;
  // box-shadow: 
  //   0 4px 6px -1px rgba(0, 0, 0, 0.1),
  //   0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(135, 139, 144, 0.241);
  position: relative;
  overflow: hidden;
  
  // ✨ Efeito de brilho sutil
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
    animation: shimmer 3s infinite;
  }

  @keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
  }
}

// 🌙 Dark mode
.expense-chart.dark-mode {  
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border: 1px solid rgba(210, 230, 27, 0.889) !important; // Cor mais neutra para dark mode
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
    
  // 🎯 Ajustar cores dos elementos internos para dark mode
  .chart-header {
    border-bottom-color: rgba(71, 85, 105, 0.3) !important;
    
    .chart-title {
      color: #f1f5f9 !important;
      
      i {
        color: #60a5fa !important; // Azul mais claro para dark mode
      }
    }
    
    .chart-summary {
      .total-value {
        color: #34d399 !important; // Verde mais claro para dark mode
      }
      
      .total-count {
        color: #94a3b8 !important; // Cinza mais claro para dark mode
      }
    }

    // ✨ DARK MODE: Estilos para seção de comparação
    .chart-comparison {
      // background: rgba(51, 65, 85, 0.6) !important; // Cinza escuro com transparência
      border: 1px solid rgba(71, 85, 105, 0.4) !important; // Borda mais visível
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important; // Sombra mais pronunciada
    }

    .period-label {
      color: #cbd5e1 !important; // Cinza claro para labels
    }

    .period-value {
      color: #f1f5f9 !important; // Branco suave para valores
    }

    .period-count {
      color: #94a3b8 !important; // Cinza médio para contadores
    }

    // Trends no dark mode com cores mais vibrantes
    .comparison-trend.trend-up {
      background: rgba(34, 197, 94, 0.15) !important; // Verde mais vibrante
      color: #4ade80 !important;
      border: 1px solid rgba(34, 197, 94, 0.3) !important;
    }

    .comparison-trend.trend-down {
      background: rgba(248, 113, 113, 0.15) !important; // Vermelho mais vibrante
      color: #f87171 !important;
      border: 1px solid rgba(248, 113, 113, 0.3) !important;
    }

    .comparison-trend.trend-stable {
      background: rgba(148, 163, 184, 0.15) !important; // Cinza mais claro
      color: #cbd5e1 !important;
      border: 1px solid rgba(148, 163, 184, 0.3) !important;
    }
  }
  
  // 🏢 Filtro de empresa em dark mode
  .company-filter {
    label {
      color: #f1f5f9 !important;
    }
    
    .company-select {
      background: #374151 !important;
      border-color: rgba(71, 85, 105, 0.6) !important;
      color: #f1f5f9 !important;
      
      option {
        background: #374151 !important;
        color: #f1f5f9 !important;
      }
    }
  }
  
  // 📊 Barras do gráfico em dark mode
  .chart-bars {
    .bar-label {
      .label-text {
        color: #f1f5f9 !important;
      }
    }
    
    .bar-values {
      .value-amount {
        color: #f1f5f9 !important;
      }
      
      .value-percentage {
        color: #94a3b8 !important;
      }
    }
    
    .bar-details {
      .detail-count,
      .detail-average {
        color: #94a3b8 !important;
      }
    }
  }
  
  // 🍩 Gráfico donut em dark mode
  .donut-center {
    .center-value {
      color: #f1f5f9 !important;
    }
    
    .center-label {
      color: #94a3b8 !important;
    }
  }
  
  // 🏷️ Legenda em dark mode
  .chart-legend {
    .legend-item {
      .legend-info {
        .legend-label {
          color: #f1f5f9 !important;
        }
        
        .legend-value {
          color: #34d399 !important;
        }
      }
    }
  }
  
  // 🏢 Seção de empresas em dark mode
  .company-section {
    .section-header {
      h4 {
        color: #f1f5f9 !important;
        
        i {
          color: #60a5fa !important;
        }
      }
      
      .section-subtitle {
        color: #94a3b8 !important;
      }
    }
    
    .company-item {
      background: rgba(30, 41, 59, 0.5) !important;
      border-color: rgba(71, 85, 105, 0.3) !important;
      
      .company-header {
        .company-info {
          .company-name {
            color: #f1f5f9 !important;
            
            i {
              color: #60a5fa !important;
            }
          }
          
          .company-totals {
            .company-value {
              color: #34d399 !important;
            }
            
            .company-count {
              color: #94a3b8 !important;
            }
          }
        }
        
        .company-percentage {
          color: #94a3b8 !important;
        }
      }
      
      .company-breakdown {
        .breakdown-item {
          background: rgba(15, 23, 42, 0.3) !important;
          
          .breakdown-info {
            .breakdown-label {
              span {
                color: #f1f5f9 !important;
              }
            }
            
            .breakdown-values {
              .breakdown-value {
                color: #34d399 !important;
              }
              
              .breakdown-count {
                color: #94a3b8 !important;
              }
            }
          }
        }
      }
    }
  }
  
  // 🚫 Estado vazio em dark mode
  .empty-state {
    .empty-icon {
      i {
        color: #64748b !important;
      }
    }
    
    h4 {
      color: #f1f5f9 !important;
    }
    
    p {
      color: #94a3b8 !important;
    }
  }
}

// 🎯 Header do Gráfico
.chart-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light, #e2e8f0);

  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    white-space: nowrap; // Evita quebra de linha no título

    i {
      color: var(--primary, #3b82f6);
      font-size: 1.1rem;
    }
  }

  .chart-summary {
    text-align: right;
    flex-shrink: 0; // Não encolhe
    
    .total-value {
      display: block;
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--success, #059669);
      line-height: 1.2;
    }
    
    .total-count {
      display: block;
      font-size: 0.875rem;
      color: var(--text-secondary, #64748b);
      margin-top: 4px;
    }

  }

  // ✨ NOVOS ESTILOS: Seção de Comparação Mensal (abaixo do título)
  .chart-comparison {
    // background: rgba(var(--surface-rgb, 248, 250, 252), 0.5);
    border-radius: 8px;
    padding: 0.875rem;
    border: 1px solid var(--divider, rgba(229, 231, 235, 1));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%; // Ocupa toda a largura disponível
  }

  .comparison-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .previous-month-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
  }

  .period-label {
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
  }

  .period-value {
    font-weight: 600;
    color: var(--text-primary, #111827);
    font-size: 0.9rem;
  }

  .period-count {
    font-size: 0.75rem;
    color: var(--text-tertiary, #9ca3af);
    font-style: italic;
  }

  // Trend Styling Compacto
  .comparison-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .comparison-trend.trend-up {
    background: rgba(16, 185, 129, 0.1);
    color: #DC2626;
    border: 1px solid rgba(16, 185, 129, 0.2);
  }

  .comparison-trend.trend-down {
    background: rgba(239, 68, 68, 0.1);
    color: #059669;
    border: 1px solid rgba(239, 68, 68, 0.2);
  }

  .comparison-trend.trend-stable {
    background: rgba(107, 114, 128, 0.1);
    color: #6B7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
  }

  .trend-percentage {
    font-weight: 700;
  }

  .trend-label {
    font-weight: 500;
    opacity: 0.8;
  }


}

// 📈 Conteúdo do Gráfico
.chart-content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

// 📊 Gráfico de Barras
.chart-bars {
  max-height: 350px; // ✨ NOVO: Altura máxima para ativar scroll
  overflow-y: auto;  // ✨ NOVO: Scroll vertical quando necessário
  padding-right: 8px; // ✨ NOVO: Espaço para a scrollbar
  
  // ✨ NOVO: Estilização da scrollbar
  &::-webkit-scrollbar {
    width: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: var(--background-secondary, #f1f5f9);
    border-radius: 3px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: var(--text-secondary, #64748b);
    border-radius: 3px;
    opacity: 0.6;
    
    &:hover {
      background: var(--text-primary, #1e293b);
      opacity: 0.8;
    }
  }
  
  // 🌙 Dark mode scrollbar
  .expense-chart.dark-theme &,
  :host-context([data-theme="dark"]) & {
    &::-webkit-scrollbar-track {
      background: #1e293b !important;
    }
    
    &::-webkit-scrollbar-thumb {
      background: #64748b !important;
      
      &:hover {
        background: #94a3b8 !important;
      }
    }
  }

  .chart-item {
    margin-bottom: 20px;
    
    &.animated {
      opacity: 0;
      transform: translateX(-20px);
      animation: slideInLeft 0.6s ease-out forwards;
    }

    @keyframes slideInLeft {
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
  }

  .bar-container {
    background: var(--background, #ffffff);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-light, #e2e8f0);
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
      transform: translateY(-2px);
    }

    // 🌙 Dark mode
    .expense-chart.dark-theme &,
    :host-context([data-theme="dark"]) & {
      background: #334155 !important;
      border: 1px solid rgba(71, 85, 105, 0.3) !important;

      &:hover {
        box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.4) !important;
      }
    }
  }

  .bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }

  .bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    
    i {
      font-size: 1.1rem;
    }
    
    .label-text {
      font-weight: 500;
      color: var(--text-primary, #374151);
    }
  }

  .bar-values {
    text-align: right;
    
    .value-amount {
      font-weight: 600;
      color: var(--text-primary, #1e293b);
      font-size: 1.1rem;
    }
    
    .value-percentage {
      color: var(--text-secondary, #64748b);
      font-size: 0.875rem;
      margin-left: 8px;
    }
  }

  // 🌙 Dark mode para textos das barras
  .expense-chart.dark-theme &,
  :host-context([data-theme="dark"]) & {
    .bar-label .label-text {
      color: #e2e8f0 !important;
    }
    
    .bar-values {
      .value-amount {
        color: #f1f5f9 !important;
      }
      
      .value-percentage {
        color: #94a3b8 !important;
      }
    }
  }

  .progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--background-secondary, #f1f5f9);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;

    // 🌙 Dark mode
    .expense-chart.dark-theme &,
    :host-context([data-theme="dark"]) & {
      background-color: #1e293b !important;
    }
  }

  .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    
    &[style*="animation-duration"] {
      animation: fillBar ease-out;
    }

    @keyframes fillBar {
      from { width: 0% !important; }
    }
  }

  // 🏢 Barra segmentada por empresa
  .segmented-bar {
    display: flex !important;
    height: 100% !important;
    border-radius: 6px;
    overflow: hidden;
    width: 100% !important;

    .segment {
      height: 100% !important;
      transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      cursor: pointer;
      opacity: 1 !important; // Forçar visibilidade
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 2px; // Largura mínima para visibilidade

      &:hover {
        filter: brightness(1.1);
        transform: scaleY(1.1);
        z-index: 2;
      }

      &:not(:last-child) {
        border-right: 2px solid rgba(255, 255, 255, 0.8);
      }

      // Texto dentro do segmento
      span {
        font-size: 8px !important;
        color: white !important;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
        padding: 2px;
        white-space: nowrap;
        overflow: hidden;
      }

      // Efeito de brilho nos segmentos
      &::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        animation: segmentShimmer 2s infinite;
        animation-delay: var(--animation-delay, 0s);
        pointer-events: none;
      }
    }
  }

  // 🏢 Legenda das empresas
  .company-legend {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);

    .legend-items {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.3rem 0.6rem;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 15px;
      font-size: 0.8rem;
      transition: all 0.2s ease;
      border: 1px solid rgba(0, 0, 0, 0.05);

      &:hover {
        background: rgba(255, 255, 255, 0.95);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      }

      .legend-color {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        flex-shrink: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }

      .legend-company {
        font-weight: 600;
        color: var(--text-primary);
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .legend-value {
        font-weight: 700;
        color: var(--success-color);
      }

      .legend-percentage {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-weight: 500;
      }
    }

    // 🌙 Dark mode para legenda
    .expense-chart.dark-mode & {
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.1);

      .legend-item {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.1);

        &:hover {
          background: rgba(255, 255, 255, 0.15);
        }

        .legend-company {
          color: #e2e8f0;
        }

        .legend-value {
          color: #10b981;
        }

        .legend-percentage {
          color: #94a3b8;
        }
      }
    }
  }

  // 🏢 Indicadores das empresas
  .company-indicators {
    margin: 0.75rem 0 0.5rem 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);

    .company-indicator {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0;
      font-size: 0.85rem;
      
      &:not(:last-child) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        margin-bottom: 0.4rem;
        padding-bottom: 0.4rem;
      }

      .company-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }

      .company-name {
        font-weight: 600;
        color: var(--text-primary);
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .company-value {
        font-weight: 700;
        color: var(--success-color);
        margin-right: 0.25rem;
      }

      .company-percentage {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-weight: 500;
      }
    }

    // 🌙 Dark mode
    .expense-chart.dark-mode & {
      background: rgba(255, 255, 255, 0.05);
      border-left-color: #3b82f6;

      .company-indicator {
        &:not(:last-child) {
          border-bottom-color: rgba(255, 255, 255, 0.1);
        }

        .company-name {
          color: #e2e8f0;
        }

        .company-value {
          color: #10b981;
        }

        .company-percentage {
          color: #94a3b8;
        }
      }
    }
  }

  // 🏢 Mensagem quando não há dados de empresa
  .no-company-data {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    border-left: 3px solid #94a3b8;

    .no-company-message {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.8rem;
      color: var(--text-muted);
      font-style: italic;

      i {
        color: #94a3b8;
        font-size: 0.75rem;
      }
    }

    // 🌙 Dark mode
    .expense-chart.dark-mode & {
      background: rgba(255, 255, 255, 0.03);
      border-left-color: #64748b;

      .no-company-message {
        color: #94a3b8;

        i {
          color: #64748b;
        }
      }
    }
  }

  .bar-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    
    .detail-count {
      font-weight: 500;
    }
    
    .detail-average {
      font-style: italic;
    }

    // 🌙 Dark mode
    .expense-chart.dark-theme &,
    :host-context([data-theme="dark"]) & {
      color: #94a3b8 !important;
    }
  }
}

// 🍩 Gráfico de Donut
.donut-chart {
  .donut-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
  }

  .donut-visual {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: all 0.6s ease;
    
    // Criar o buraco do donut
    &::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 60%;
      height: 60%;
      background: var(--card-bg, vr(--surface, #ffffff));
      border-radius: 50%;
      box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
    }

    // 🌙 Dark mode
    .expense-chart.dark-theme &::after,
    :host-context([data-theme="dark"]) &::after {
      background: #1e293b !important;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
    }
    
    // Efeito hover
    &:hover {
      transform: scale(1.05);
      box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.25);
    }
  }

  .donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    
    .center-value {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--text-primary, #1e293b);
      line-height: 1.2;
    }
    
    .center-label {
      font-size: 0.75rem;
      color: var(--text-secondary, #64748b);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-top: 4px;
    }

    // 🌙 Dark mode
    .expense-chart.dark-theme &,
    :host-context([data-theme="dark"]) & {
      .center-value {
        color: #f1f5f9 !important;
      }
      
      .center-label {
        color: #94a3b8 !important;
      }
    }
  }
}

// 🏷️ Legenda
.chart-legend {
  .legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    
    &:last-child {
      border-bottom: none;
    }
    
    &.animated {
      opacity: 0;
      transform: translateY(10px);
      animation: fadeInUp 0.5s ease-out forwards;
    }

    @keyframes fadeInUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }

  .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .legend-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    .legend-label {
      font-size: 0.875rem;
      color: var(--text-primary, #374151);
      font-weight: 500;
    }
    
    .legend-value {
      font-size: 0.875rem;
      color: var(--text-primary, #1e293b);
      font-weight: 600;
    }
  }

  // 🌙 Dark mode para legenda
  .expense-chart.dark-theme &,
  :host-context([data-theme="dark"]) & {
    .legend-item {
      border-bottom: 1px solid rgba(71, 85, 105, 0.3) !important;
    }

    .legend-info {
      .legend-label {
        color: #e2e8f0 !important;
      }
      
      .legend-value {
        color: #f1f5f9 !important;
      }
    }
  }
}

// 🚫 Estado Vazio
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary, #64748b);

  .empty-icon {
    font-size: 3rem;
    color: var(--text-muted, #cbd5e1);
    margin-bottom: 16px;
  }

  h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #374151);
    margin: 0 0 8px 0;
  }

  p {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
  }

  // 🌙 Dark mode
  .expense-chart.dark-theme &,
  :host-context([data-theme="dark"]) & {
    color: #94a3b8 !important;

    .empty-icon {
      color: #64748b !important;
    }

    h4 {
      color: #e2e8f0 !important;
    }
  }
}

// 📱 Responsividade
@media (max-width: 768px) {
  .expense-chart {
    padding: 16px;
  }

  .chart-header {
    .header-top {
      flex-direction: column;
      gap: 12px;
      align-items: flex-start;
    }
    
    .chart-summary {
      text-align: left;
    }

    // ✨ Responsividade para comparação mensal
    .chart-comparison {
      padding: 0.75rem;
      border-radius: 6px;
    }

    .comparison-info {
      flex-direction: column;
      align-items: stretch;
      gap: 0.75rem;
    }

    .previous-month-info {
      flex-wrap: wrap;
      gap: 0.375rem;
      font-size: 0.8rem;
    }

    .period-value {
      font-size: 0.85rem;
    }

    .period-count {
      font-size: 0.7rem;
    }

    .comparison-trend {
      align-self: stretch;
      justify-content: center;
      padding: 0.5rem;
      font-size: 0.75rem;
    }
  }

  .chart-content {
    grid-template-columns: 1fr !important;
  }

  .donut-chart .donut-container {
    width: 160px;
    height: 160px;
  }

  .bar-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .bar-values {
    text-align: left !important;
  }

  .chart-bars {
    max-height: 280px; // ✨ NOVO: Altura menor em mobile
    
    .chart-item {
      margin-bottom: 16px;
    }
  }

  .bar-container {
    padding: 12px !important;
  }
}

// 🌙 DARK MODE - Estilos com classe
.expense-chart.dark-theme {
  .chart-header {
    border-bottom: 1px solid rgba(71, 85, 105, 0.3) !important;
    
    .chart-title {
      color: #f1f5f9 !important;
      
      i {
        color: #60a5fa !important;
      }
    }
    
    .chart-summary {
      .total-value {
        color: #34d399 !important;
      }
      
      .total-count {
        color: #94a3b8 !important;
      }
    }

    // ✨ DARK MODE: Estilos para seção de comparação
    .chart-comparison {
      background: rgba(51, 65, 85, 0.6) !important; // Cinza escuro com transparência
      border: 1px solid rgba(71, 85, 105, 0.4) !important; // Borda mais visível
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important; // Sombra mais pronunciada
    }

    .period-label {
      color: #cbd5e1 !important; // Cinza claro para labels
    }

    .period-value {
      color: #f1f5f9 !important; // Branco suave para valores
    }

    .period-count {
      color: #94a3b8 !important; // Cinza médio para contadores
    }

    // Trends no dark mode com cores mais vibrantes
    .comparison-trend.trend-up {
      background: rgba(34, 197, 94, 0.15) !important; // Verde mais vibrante
      color: #4ade80 !important;
      border: 1px solid rgba(34, 197, 94, 0.3) !important;
    }

    .comparison-trend.trend-down {
      background: rgba(248, 113, 113, 0.15) !important; // Vermelho mais vibrante
      color: #f87171 !important;
      border: 1px solid rgba(248, 113, 113, 0.3) !important;
    }

    .comparison-trend.trend-stable {
      background: rgba(148, 163, 184, 0.15) !important; // Cinza mais claro
      color: #cbd5e1 !important;
      border: 1px solid rgba(148, 163, 184, 0.3) !important;
    }
  }

  .bar-container {
    background: #334155 !important;
    border: 1px solid rgba(71, 85, 105, 0.3) !important;

    &:hover {
      box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.4) !important;
    }
  }

  .bar-label .label-text {
    color: #e2e8f0 !important;
  }

  .value-amount {
    color: #f1f5f9 !important;
  }

  .value-percentage {
    color: #94a3b8 !important;
  }

  .progress-bar {
    background-color: #1e293b !important;
  }

  .bar-details {
    color: #94a3b8 !important;
  }

  .donut-visual::after {
    background: #1e293b !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
  }

  .center-value {
    color: #f1f5f9 !important;
  }

  .center-label {
    color: #94a3b8 !important;
  }

  .legend-item {
    border-bottom: 1px solid rgba(71, 85, 105, 0.3) !important;
  }

  .legend-label {
    color: #e2e8f0 !important;
  }

  .legend-value {
    color: #f1f5f9 !important;
  }

  .empty-state {
    color: #94a3b8 !important;

    .empty-icon {
      color: #64748b !important;
    }

    h4 {
      color: #e2e8f0 !important;
    }
  }

  // 🏢 Filtro de empresa - Dark Mode
  .company-filter {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    
    label {
      color: #e2e8f0 !important;
    }
    
    .company-select {
      background: #0f172a !important;
      border: 1px solid #475569 !important;
      color: #e2e8f0 !important;
      
      &:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
      }
    }
  }

  // 🏢 Seção de empresa - Dark Mode
  .company-section {
    border-top: 1px solid #475569 !important;
    
    .section-header h4 {
      color: #e2e8f0 !important;
    }
    
    .section-subtitle {
      color: #94a3b8 !important;
    }
    
    .company-item {
      background: #1e293b !important;
      border: 1px solid #475569 !important;
      
      &.highlighted {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
      }
    }
    
    .company-header {
      background: #1e293b !important;
      
      &:hover {
        background: #334155 !important;
      }
      
      .company-name {
        color: #e2e8f0 !important;
      }
      
      .company-value {
        color: #10b981 !important;
      }
      
      .company-count {
        color: #94a3b8 !important;
      }
    }
    
    .company-breakdown {
      background: #0f172a !important;
      
      .breakdown-item {
        background: #1e293b !important;
        
        .breakdown-label {
          color: #e2e8f0 !important;
        }
        
        .breakdown-value {
          color: #e2e8f0 !important;
        }
        
        .breakdown-count {
          color: #94a3b8 !important;
        }
        
        .mini-progress {
          background: #475569 !important;
        }
      }
    }
  }
}

// 🏢 Estilos para seção de empresa (modo claro)
.expense-chart {
  .company-filter {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card-background, #ffffff);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    
    label {
      display: block;
      margin-bottom: 0.5rem;
      font-weight: 500;
      color: var(--text-primary, #1e293b);
      font-size: 0.9rem;
    }
    
    .company-select {
      width: 100%;
      padding: 0.5rem;
      border: 1px solid var(--border-color, #e2e8f0);
      border-radius: 4px;
      background: var(--input-background, #ffffff);
      color: var(--text-primary, #1e293b);
      font-size: 0.9rem;
      
      &:focus {
        outline: none;
        border-color: var(--primary-color, #3b82f6);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
      }
    }
  }

  .company-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
    
    .section-header {
      margin-bottom: 1.5rem;
      
      h4 {
        margin: 0 0 0.25rem 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary, #1e293b);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        
        i {
          color: var(--primary-color, #3b82f6);
        }
      }
      
      .section-subtitle {
        font-size: 0.85rem;
        color: var(--text-muted, #64748b);
      }
    }
    
    .company-list {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }
    
    .company-item {
      background: var(--card-background, #ffffff);
      border: 1px solid var(--border-color, #e2e8f0);
      border-radius: 8px;
      overflow: hidden;
      transition: all 0.3s ease;
      
      &.highlighted {
        border-color: var(--primary-color, #3b82f6);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
      }
      
      &.animated {
        opacity: 0;
        transform: translateY(20px);
        animation: slideInUp 0.6s ease forwards;
      }
      
      &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
    }
    
    .company-header {
      padding: 1rem;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--card-background, #ffffff);
      transition: background-color 0.2s ease;
      
      &:hover {
        background: var(--hover-background, #f8fafc);
      }
      
      .company-info {
        flex: 1;
        
        .company-name {
          margin: 0 0 0.5rem 0;
          font-size: 1rem;
          font-weight: 600;
          color: var(--text-primary, #1e293b);
          display: flex;
          align-items: center;
          gap: 0.5rem;
          
          i {
            color: var(--primary-color, #3b82f6);
            font-size: 0.9rem;
          }
        }
        
        .company-totals {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          
          .company-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--success-color, #10b981);
          }
          
          .company-count {
            font-size: 0.85rem;
            color: var(--text-muted, #64748b);
          }
        }
      }
      
      .company-percentage {
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-color, #3b82f6);
        padding: 0.25rem 0.75rem;
        background: rgba(59, 130, 246, 0.1);
        border-radius: 20px;
      }
    }
    
    .company-breakdown {
      padding: 0 1rem 1rem 1rem;
      background: var(--background-secondary, #f8fafc);
      
      .breakdown-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        background: var(--card-background, #ffffff);
        border-radius: 6px;
        border-left: 4px solid var(--border-color, #e2e8f0);
        transition: all 0.2s ease;
        
        &:hover {
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
          transform: translateX(2px);
        }
        
        &:last-child {
          margin-bottom: 0;
        }
        
        .breakdown-info {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 0.5rem;
          
          .breakdown-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-primary, #1e293b);
            
            i {
              font-size: 0.8rem;
            }
          }
          
          .breakdown-values {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            
            .breakdown-value {
              font-weight: 600;
              color: var(--text-primary, #1e293b);
            }
            
            .breakdown-count {
              font-size: 0.8rem;
              color: var(--text-muted, #64748b);
            }
          }
        }
        
        .mini-progress {
          height: 4px;
          background: var(--border-color, #e2e8f0);
          border-radius: 2px;
          overflow: hidden;
          
          .mini-progress-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.8s ease;
          }
        }
      }
    }
  }
}

// 💻 Media Queries - Ocultar indicadores de empresa em resoluções de notebook
@media screen and (max-width: 1366px) and (min-width: 1024px) {
  .expense-chart {
    // 🏢 Ocultar indicadores das empresas em notebooks
    .company-indicators {
      display: none !important;
    }
    
    // 🏢 Ocultar mensagem de dados não disponíveis também
    .no-company-data {
      display: none !important;
    }
  }
}

// 📱 Media Queries adicionais para tablets e dispositivos menores
@media screen and (max-width: 1023px) {
  .expense-chart {
    // 🏢 Ocultar indicadores das empresas em tablets e mobile
    .company-indicators {
      display: none !important;
    }
    
    // 🏢 Ocultar mensagem de dados não disponíveis também
    .no-company-data {
      display: none !important;
    }
    
    // 📊 Ajustar layout para dispositivos menores
    .chart-content {
      flex-direction: column;
      
      .chart-bars {
        margin-bottom: 1.5rem;
      }
      
      .donut-chart {
        .donut-container {
          width: 200px;
          height: 200px;
          margin: 0 auto;
        }
      }
    }
  }
}
