/* ========================================
   GestãoBLZ - Relatórios CSS
   ======================================== */

/* ============================
   Filtros Globais
   ============================ */
.reports-filters-section {
    margin-bottom: 2rem;
}

.filters-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.filters-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--theme-border-color);
}

.filters-header h5 {
    margin: 0;
    font-weight: 600;
}

.filters-header small {
    opacity: 0.9;
}

.filters-body {
    padding: 1.5rem;
}

/* ============================
   Accordions dos Relatórios
   ============================ */
.reports-accordions .accordion-item {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px !important;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reports-accordions .accordion-button {
    background: var(--theme-card-bg);
    color: var(--theme-text-primary);
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    border-radius: 12px !important;
    transition: all 0.3s ease;
}

.reports-accordions .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: none;
}

.reports-accordions .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.25);
}

.accordion-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.accordion-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.accordion-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.accordion-body {
    padding: 2rem;
    background: var(--theme-bg-secondary);
}

/* ============================
   Grid de Relatórios
   ============================ */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.report-item {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.report-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.report-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.report-item:hover::before {
    transform: scaleX(1);
}

.report-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.report-content {
    flex: 1;
}

.report-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.report-description {
    color: var(--theme-text-secondary);
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.report-arrow {
    color: var(--theme-text-secondary);
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.report-item:hover .report-arrow {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* ============================
   Ações Rápidas
   ============================ */
.quick-actions-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.quick-actions-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--theme-border-color);
}

.quick-actions-header h5 {
    margin: 0;
    font-weight: 600;
}

.quick-actions-body {
    padding: 1.5rem;
}

.quick-actions-body .btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.quick-actions-body .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================
   Filtros de Período (Mantido para compatibilidade)
   ============================ */
.reports-filters-bar {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reports-filters-bar .form-label {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.reports-filters-bar .form-select,
.reports-filters-bar .form-control {
    border: 1px solid var(--theme-border-color);
    background-color: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    border-radius: 8px;
}

.reports-filters-bar .form-select:focus,
.reports-filters-bar .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.25);
}

/* ============================
   KPIs Principais
   ============================ */
.kpis-row {
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

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

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.kpi-card.revenue .kpi-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.kpi-card.clients .kpi-icon {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.kpi-card.services .kpi-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.kpi-card.ltv .kpi-icon {
    background: linear-gradient(135deg, #fd7e14, #ffc107);
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.kpi-trend.positive {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.kpi-trend.negative {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.kpi-trend.neutral {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.kpi-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.kpi-label {
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.kpi-subtitle {
    color: var(--theme-text-secondary);
    font-size: 0.8rem;
}

/* ============================
   Cards de Relatório
   ============================ */
.reports-container {
    margin-top: 2rem;
}

.report-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    transition: all 0.3s ease;
}

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

.report-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--theme-bg-secondary), var(--theme-card-bg));
    border-bottom: 1px solid var(--theme-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-title {
    color: var(--theme-text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-title i {
    color: var(--primary-color);
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-report-action {
    background: none;
    border: 1px solid var(--theme-border-color);
    color: var(--theme-text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-report-action:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.report-content {
    padding: 1.5rem;
}

/* Scroll específico para o card de profissionais */
.report-card:has(.professional-ranking) .report-content {
    height: 600px;
    overflow-y: auto;
    padding-right: 1rem;
}

/* Fallback para navegadores que não suportam :has() */
.professional-ranking-card .report-content {
    height: 600px;
    overflow-y: auto;
    padding-right: 1rem;
}

/* ============================
   Análise de Clientes
   ============================ */
.client-segments {
    margin-bottom: 1.5rem;
}

.segment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--theme-bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--theme-border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.segment-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.segment-item:hover::before {
    opacity: 1;
}

.segment-item:hover {
    background: var(--theme-card-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.segment-item:last-child {
    margin-bottom: 0;
}

.segment-info {
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.segment-label {
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
}

.segment-count {
    color: var(--theme-text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
}

.segment-bar {
    flex: 1;
    height: 8px;
    background-color: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.segment-progress {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.segment-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.segment-progress.active {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.segment-progress.birthday {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.segment-progress.absent {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.segment-progress.premium {
    background: linear-gradient(90deg, #6f42c1, #e83e8c);
}

.segment-percentage {
    min-width: 50px;
    text-align: right;
    color: var(--theme-text-primary);
    font-weight: 600;
}

.client-insights {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.05), rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.02));
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--theme-text-primary);
    padding: 0.625rem;
    background: var(--theme-card-bg);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.insight-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.insight-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.insight-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.insight-icon.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

/* ============================
   Ranking de Profissionais
   ============================ */
.professional-ranking {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Scroll personalizado para o ranking de profissionais */
.professional-ranking-card .report-content::-webkit-scrollbar {
    width: 6px;
}

.professional-ranking-card .report-content::-webkit-scrollbar-track {
    background: var(--theme-bg-secondary);
    border-radius: 3px;
}

.professional-ranking-card .report-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.professional-ranking-card .report-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--theme-bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--theme-border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item:hover {
    background: var(--theme-card-bg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Card do 1º lugar */
.ranking-item:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08), rgba(253, 126, 20, 0.05));
    border: 2px solid rgba(255, 193, 7, 0.3);
    position: relative;
}

.ranking-item:nth-child(1)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #ffc107, #fd7e14);
}

/* Card do 2º lugar */
.ranking-item:nth-child(2) {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.08), rgba(173, 181, 189, 0.05));
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.ranking-item:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #6c757d, #adb5bd);
}

/* Card do 3º lugar */
.ranking-item:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.08), rgba(139, 69, 19, 0.05));
    border: 1px solid rgba(205, 127, 50, 0.2);
}

.ranking-item:nth-child(3)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #cd7f32, #8b4513);
}

.ranking-position {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #6c757d, #495057);
}

/* Posições específicas com cores diferentes */
.ranking-item:nth-child(1) .ranking-position {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.ranking-item:nth-child(2) .ranking-position {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.ranking-item:nth-child(3) .ranking-position {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

/* Posições 4º em diante - estilo padrão */
.ranking-item:nth-child(n+4) .ranking-position {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 3px 8px rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.3);
}

.ranking-info {
    flex: 1;
}

.professional-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
}

.performance-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-weight: 600;
    color: var(--theme-text-primary);
    font-size: 0.875rem;
}

.metric small {
    color: var(--theme-text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
}

.ranking-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.ranking-badge.gold {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.ranking-badge.silver {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
}

.ranking-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
}

/* Badges para posições 4º em diante */
.ranking-item:nth-child(n+4) .ranking-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

/* ============================
   Top Produtos
   ============================ */
.top-products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--theme-bg-secondary);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.product-item:hover {
    background: var(--theme-card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-info {
    min-width: 200px;
}

.product-name {
    display: block;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 0.25rem;
}

.product-category {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.product-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.product-sales {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
}

.product-revenue {
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.product-chart {
    flex: 1;
    height: 8px;
    background-color: var(--theme-border-color);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Variação de cores para produtos e serviços */
.product-item:nth-child(1) .chart-bar {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.product-item:nth-child(2) .chart-bar {
    background: linear-gradient(90deg, #007bff, #6610f2);
}

.product-item:nth-child(3) .chart-bar {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.product-item:nth-child(4) .chart-bar {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.product-item:nth-child(5) .chart-bar {
    background: linear-gradient(90deg, #6f42c1, #5a2d91);
}

.product-item:nth-child(6) .chart-bar {
    background: linear-gradient(90deg, #17a2b8, #138496);
}

.product-item:nth-child(n+7) .chart-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

/* ============================
   Análise Temporal
   ============================ */
.temporal-analysis {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.time-periods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.period-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--theme-bg-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* Variação de cores para períodos temporais */
.period-item:nth-child(1) {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05), var(--theme-bg-secondary));
}

.period-item:nth-child(2) {
    border-left: 4px solid #007bff;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), var(--theme-bg-secondary));
}

.period-item:nth-child(3) {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), var(--theme-bg-secondary));
}

.period-item:nth-child(4) {
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05), var(--theme-bg-secondary));
}

.period-item:nth-child(n+5) {
    border-left: 4px solid var(--primary-color);
}

.period-label {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.period-value {
    color: var(--theme-text-primary);
    font-weight: 700;
    font-size: 1.05rem;
}

.period-change {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.period-change.positive {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.period-change.negative {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.peak-hours h6 {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--theme-border-color);
}

.peak-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.peak-time {
    min-width: 120px;
    color: var(--theme-text-primary);
    font-weight: 500;
}

.peak-bar {
    flex: 1;
    height: 8px;
    background-color: var(--theme-bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.peak-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Variação de cores para horários de pico */
.peak-item:nth-child(1) .peak-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.peak-item:nth-child(2) .peak-fill {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.peak-item:nth-child(3) .peak-fill {
    background: linear-gradient(90deg, #007bff, #6610f2);
}

.peak-item:nth-child(n+4) .peak-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.peak-percentage {
    min-width: 50px;
    text-align: right;
    color: var(--theme-text-primary);
    font-weight: 600;
}

/* ============================
   Métricas Avançadas
   ============================ */
.advanced-metrics .report-content {
    padding: 2rem;
}

.metric-box {
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
}

.metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

/* Variação de cores para ícones das métricas avançadas */
.metric-box:nth-child(1) .metric-icon {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.metric-box:nth-child(2) .metric-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.metric-box:nth-child(3) .metric-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.metric-box:nth-child(4) .metric-icon {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.metric-box:nth-child(n+5) .metric-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.metric-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin: 0;
}

.metric-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.metric-description {
    color: var(--theme-text-secondary);
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.metric-trend.positive {
    color: #28a745;
}

.metric-trend.negative {
    color: #dc3545;
}

/* ============================
   Insights Avançados
   ============================ */
.advanced-insights {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--theme-border-color);
}

.insights-title {
    color: var(--theme-text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.insights-title i {
    color: #ffc107;
}

.insight-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.insight-card.growth::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.insight-card.opportunity::before {
    background: linear-gradient(90deg, #007bff, #6610f2);
}

.insight-card.alert::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.insight-card .insight-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.insight-card.growth .insight-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.insight-card.opportunity .insight-icon {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.insight-card.alert .insight-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.insight-card h6 {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.insight-card p {
    color: var(--theme-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ============================
   Responsividade
   ============================ */
@media (max-width: 768px) {
    .reports-filters-bar {
        padding: 1rem;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
    
    .report-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .report-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .report-content {
        padding: 1rem;
    }
    
    .segment-item,
    .ranking-item,
    .product-item,
    .period-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .segment-bar,
    .product-chart,
    .peak-bar {
        width: 100%;
    }
    
    .performance-metrics {
        width: 100%;
        justify-content: space-around;
    }
    
    .advanced-insights .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .metric-box {
        padding: 1rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
}

/* ============================
   Dashboard de Ações Imediatas
   ============================ */
.priority-actions .report-header {
    background: linear-gradient(135deg, #fff3cd, #f8f9fa);
    border-left: 4px solid #ffc107;
}

.priority-badge.high {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.action-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.action-card.urgent::before {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.action-card.opportunity::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.action-card.alert::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.action-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.action-card.urgent .action-icon {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.action-card.opportunity .action-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.action-card.alert .action-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.action-count {
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

.action-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-description {
    color: var(--theme-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--theme-bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.action-item.warning {
    border-left-color: #ffc107;
}

.action-item.danger {
    border-left-color: #dc3545;
}

.client-name,
.alert-text {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.client-info,
.alert-impact {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
}

.action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* ============================
   Análise de Rentabilidade
   ============================ */
.profitability-analysis {
    border-left: 4px solid #28a745;
}

.profitability-table {
    margin-bottom: 2rem;
}

.profitability-data {
    margin: 0;
}

.profitability-data th {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.profitability-data td {
    padding: 1rem;
    border: none;
    border-bottom: 1px solid var(--theme-border-color);
    color: var(--theme-text-primary);
}

.profitability-row:hover {
    background: var(--theme-bg-secondary);
}

.professional-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.professional-info small {
    color: var(--theme-text-secondary);
}

.revenue {
    font-weight: 600;
    color: #007bff;
}

.commission {
    font-weight: 600;
    color: #ffc107;
}

.costs {
    font-weight: 600;
    color: #dc3545;
}

.profit.positive {
    font-weight: 700;
    color: #28a745;
}

.profit.negative {
    font-weight: 700;
    color: #dc3545;
}

.margin,
.roi {
    font-weight: 600;
}

.roi.excellent {
    color: #28a745;
}

.roi.good {
    color: #20c997;
}

.roi.average {
    color: #ffc107;
}

.roi.poor {
    color: #dc3545;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-badge.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-badge.danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.profitability-insights {
    padding: 1.5rem;
    background: var(--theme-bg-secondary);
    border-radius: 12px;
}

.insight-metric {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--theme-card-bg);
    border-radius: 8px;
}

.insight-metric .insight-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.insight-icon.gold {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.insight-label {
    display: block;
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.insight-value {
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================
   Mapa de Fidelidade
   ============================ */
.loyalty-map {
    border-left: 4px solid #e83e8c;
}

.loyalty-matrix {
    padding: 1rem;
    background: var(--theme-bg-secondary);
    border-radius: 12px;
}

.matrix-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.matrix-quadrant {
    background: var(--theme-card-bg);
    border: 2px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.matrix-quadrant:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.matrix-quadrant.champions {
    border-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(253, 126, 20, 0.05));
}

.matrix-quadrant.loyalists {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.05));
}

.matrix-quadrant.potential {
    border-color: #007bff;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(102, 16, 242, 0.05));
}

.matrix-quadrant.at-risk {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(232, 62, 140, 0.05));
}

.matrix-quadrant h6 {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.quadrant-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.count {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.percentage {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
}

.matrix-quadrant p {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.loyalty-actions {
    padding: 1rem;
}

.actions-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.action-segment {
    margin-bottom: 1rem;
}

.segment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: white;
}

.champions-bg {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.loyalists-bg {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.potential-bg {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.at-risk-bg {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.action-segment .action-list {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    margin: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-segment .action-list li {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
    padding-left: 1rem;
    position: relative;
}

.action-segment .action-list li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.loyalty-alerts {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--theme-border-color);
}

.alerts-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loyalty-alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.loyalty-alert.urgent {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.loyalty-alert.warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

.loyalty-alert.positive {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.loyalty-alert:hover {
    transform: translateX(4px);
}

.loyalty-alert i {
    font-size: 1.5rem;
}

.loyalty-alert.urgent i {
    color: #dc3545;
}

.loyalty-alert.warning i {
    color: #ffc107;
}

.loyalty-alert.positive i {
    color: #28a745;
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-content strong {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.alert-content span {
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
}

/* ============================
   Insights da IA
   ============================ */
.ai-insights-section {
    margin-bottom: 2rem;
}

.ai-insights-card {
    background: var(--theme-card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--theme-border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.ai-insights-header {
    background: linear-gradient(135deg, #6f42c1, #5a2d91);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.ai-insights-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M30 30c0-11.046-8.954-20-20-20s-20 8.954-20 20 8.954 20 20 20 20-8.954 20-20zm0 0c0 11.046 8.954 20 20 20s20-8.954 20-20-8.954-20-20-20-20 8.954-20 20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.3;
}

.ai-insights-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.ai-insights-title i {
    font-size: 1.5rem;
    color: #ffc107;
    animation: pulse 2s infinite;
}

.ai-insights-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
    margin: 0;
    position: relative;
    z-index: 1;
}

.ai-insights-body {
    padding: 2rem 1.5rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.insight-card-ai {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.insight-card-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.insight-card-ai:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.insight-card-ai:hover::before {
    opacity: 1;
}

/* Cores específicas para cada tipo de insight */
.insight-card-ai.opportunity-window:hover {
    border-color: #007bff;
}

.insight-card-ai.opportunity-window:hover::before {
    background: linear-gradient(to bottom, #007bff, #0056b3);
}

.insight-card-ai.spending-pattern:hover {
    border-color: #28a745;
}

.insight-card-ai.spending-pattern:hover::before {
    background: linear-gradient(to bottom, #28a745, #218838);
}

.insight-card-ai.critical-moment:hover {
    border-color: #ffc107;
}

.insight-card-ai.critical-moment:hover::before {
    background: linear-gradient(to bottom, #ffc107, #e0a800);
}

.insight-card-ai.golden-season:hover {
    border-color: #17a2b8;
}

.insight-card-ai.golden-season:hover::before {
    background: linear-gradient(to bottom, #17a2b8, #138496);
}

.insight-card-ai.ghost-client:hover {
    border-color: #dc3545;
}

.insight-card-ai.ghost-client:hover::before {
    background: linear-gradient(to bottom, #dc3545, #c82333);
}

.insight-card-ai.comfort-zone:hover {
    border-color: #6f42c1;
}

.insight-card-ai.comfort-zone:hover::before {
    background: linear-gradient(to bottom, #6f42c1, #5a2d91);
}

.insight-card-ai.invisible-competition:hover {
    border-color: #fd7e14;
}

.insight-card-ai.invisible-competition:hover::before {
    background: linear-gradient(to bottom, #fd7e14, #e8690c);
}

.insight-card-ai.diamond-rough:hover {
    border-color: #28a745;
}

.insight-card-ai.diamond-rough:hover::before {
    background: linear-gradient(to bottom, #28a745, #218838);
}

.insight-card-ai .insight-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.insight-card-ai.opportunity-window .insight-icon {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.insight-card-ai.spending-pattern .insight-icon {
    background: linear-gradient(135deg, #28a745, #218838);
}

.insight-card-ai.critical-moment .insight-icon {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.insight-card-ai.golden-season .insight-icon {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.insight-card-ai.ghost-client .insight-icon {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.insight-card-ai.comfort-zone .insight-icon {
    background: linear-gradient(135deg, #6f42c1, #5a2d91);
}

.insight-card-ai.invisible-competition .insight-icon {
    background: linear-gradient(135deg, #fd7e14, #e8690c);
}

.insight-card-ai.diamond-rough .insight-icon {
    background: linear-gradient(135deg, #28a745, #218838);
}

.insight-card-ai .insight-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.insight-card-ai:hover .insight-icon::before {
    transform: rotate(45deg) translateX(100%);
}

.insight-card-ai .insight-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.insight-card-ai .insight-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.insight-card-ai .insight-description {
    font-size: 0.875rem;
    color: var(--theme-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.insight-card-ai .insight-description strong {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.insight-card-ai .insight-suggestion {
    background: rgba(111, 66, 193, 0.05);
    border: 1px solid rgba(111, 66, 193, 0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-style: italic;
    color: #6f42c1;
    margin-bottom: 0;
    position: relative;
}

.insight-card-ai .insight-suggestion::before {
    content: '💡';
    position: absolute;
    left: -8px;
    top: -8px;
    background: var(--theme-card-bg);
    padding: 4px;
    border-radius: 50%;
    font-style: normal;
    animation: pulse 2s infinite;
}

.insight-card-ai .insight-action {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.insight-card-ai .insight-action .btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.insight-card-ai .insight-action .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@media (max-width: 576px) {
    .kpis-row .col-xl-3 {
        margin-bottom: 1rem;
    }
    
    .reports-container .col-xl-6,
    .reports-container .col-lg-12 {
        margin-bottom: 1rem;
    }
    
    .metric-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .time-periods,
    .professional-ranking,
    .top-products {
        gap: 0.75rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-count {
        font-size: 1.25rem;
        padding: 0.25rem 0.75rem;
    }
    
    .matrix-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .profitability-data {
        font-size: 0.875rem;
    }
    
    .profitability-data td,
    .profitability-data th {
        padding: 0.75rem 0.5rem;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ai-insights-body {
        padding: 1.5rem 1rem;
    }
    
    .insight-card-ai {
        padding: 1rem;
    }
    
    .insight-card-ai .insight-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* === Gráfico de Horários Mais Movimentados === */
.hourly-chart {
    padding: 1.5rem;
}

.chart-container {
    margin-bottom: 2rem;
}

.hourly-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding: 1rem 0.5rem;
    background: linear-gradient(to top, rgba(79, 70, 229, 0.05) 0%, transparent 100%);
    border-radius: 12px;
    position: relative;
}

.hourly-bars::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(79, 70, 229, 0.2);
}

.hour-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: 0 2px;
}

.bar-column {
    height: 160px;
    width: 100%;
    max-width: 32px;
    display: flex;
    align-items: flex-end;
    position: relative;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(to top, 
        #4F46E5, 
        #7C3AED
    );
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.bar-fill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.bar-fill::after {
    content: attr(data-clients);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.bar-fill:hover::after {
    opacity: 1;
}

.hour-label {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.hourly-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
}

.summary-item.peak .summary-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.summary-item.low .summary-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
}

.summary-item.average .summary-icon {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.summary-info {
    flex: 1;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.summary-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.summary-detail {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsividade */
@media (max-width: 768px) {
    .hourly-bars {
        height: 150px;
        padding: 0.5rem;
    }
    
    .bar-column {
        height: 120px;
        max-width: 24px;
    }
    
    .hour-label {
        font-size: 0.7rem;
    }
    
    .hourly-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-item {
        padding: 0.8rem;
    }
}

/* ============================
   Gráfico de Evolução de Clientes
   ============================ */
.clients-evolution-chart {
    padding: 1.5rem 0;
}

.chart-description {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.05), rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.02));
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
}

.description-item {
    font-size: 0.875rem;
    color: var(--theme-text-secondary);
    line-height: 1.5;
}

.description-item strong {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.evolution-chart-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.line-chart-wrapper {
    width: 100%;
    height: 450px;
    position: relative;
    background: linear-gradient(135deg, var(--theme-card-bg), var(--theme-bg-secondary));
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--theme-border-color);
}

.evolution-canvas {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    cursor: crosshair;
    transition: all 0.3s ease;
    background: transparent;
}

.evolution-canvas:hover {
    transform: scale(1.01);
}

.chart-label {
    font-size: 12px;
    fill: var(--theme-text-secondary);
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.evolution-line {
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.data-point {
    cursor: pointer;
    transition: all 0.3s ease;
}

.data-point:hover {
    r: 8;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.data-point.new-clients:hover {
    fill: rgb(22, 163, 74) !important;
}

.data-point.returning-clients:hover {
    fill: rgb(37, 99, 235) !important;
}

.chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tooltip-month {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tooltip-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.color-indicator.new {
    background: rgb(34, 197, 94);
}

.color-indicator.returning {
    background: rgb(59, 130, 246);
}

.tooltip-value .label {
    font-weight: 500;
    min-width: 100px;
}

.tooltip-value .value {
    font-weight: 700;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--theme-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--theme-border-color);
    margin-bottom: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--theme-card-bg);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legend-color {
    width: 16px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.new-clients {
    background: linear-gradient(90deg, rgb(34, 197, 94), rgb(22, 163, 74));
}

.legend-color.returning-clients {
    background: linear-gradient(90deg, rgb(59, 130, 246), rgb(37, 99, 235));
}

.legend-label {
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.legend-trend {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.legend-trend.positive {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(22, 163, 74);
}

.evolution-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.evolution-insights .insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--theme-card-bg);
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.evolution-insights .insight-item.success {
    border-left-color: #28a745;
}

.evolution-insights .insight-item.info {
    border-left-color: #007bff;
}

.evolution-insights .insight-item.warning {
    border-left-color: #ffc107;
}

.evolution-insights .insight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.evolution-insights .insight-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.evolution-insights .insight-item.success .insight-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.evolution-insights .insight-item.info .insight-icon {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.evolution-insights .insight-item.warning .insight-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.insight-content {
    flex: 1;
}

.insight-title {
    display: block;
    color: var(--theme-text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.insight-description {
    color: var(--theme-text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

/* Responsividade para o gráfico de evolução */
@media (max-width: 768px) {
    .chart-description {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .description-item {
        font-size: 0.8rem;
    }
    
    .line-chart-wrapper {
        height: 380px;
        padding: 1.5rem;
    }
    
    .chart-legend {
        gap: 1rem;
        padding: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .legend-item {
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
    }
    
    .legend-label {
        font-size: 0.8rem;
    }
    
    .legend-trend {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .evolution-insights {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .evolution-insights .insight-item {
        padding: 0.75rem;
    }
    
    .evolution-insights .insight-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .insight-title {
        font-size: 0.85rem;
    }
    
    .insight-description {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .line-chart-wrapper {
        height: 350px;
        padding: 1rem;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .tooltip-content {
        gap: 0.4rem;
    }
    
    .tooltip-month {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
        padding-bottom: 0.4rem;
    }
    
    .tooltip-value {
        gap: 0.5rem;
    }
    
    .tooltip-value .label {
        min-width: 80px;
        font-size: 0.8rem;
    }

    .clients-evolution-chart {
        padding: 1rem 0;
    }
}