/* =============================================================================
   FUNIL DE VENDAS - DESIGN EXECUTIVO ELEGANTE
   ============================================================================= */

.funil-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;

}

/* =============================================================================
   CABEÇALHO EXECUTIVO
   ============================================================================= */

.funil-executive-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    padding: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.funil-executive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.funil-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.funil-title-group h2 {
 
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.funil-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 15px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Painel de Métricas */
.funil-metrics-panel {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.metric-card {
    text-align: center;
    min-width: 120px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.metric-label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-separator {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Botão de ação no funil executive header */
.funil-action-button {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
}

.funil-action-button .btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-decoration: none;
}

.funil-action-button .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.funil-action-button .btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.funil-action-button .btn i {
    font-size: 1.1rem;
    text-shadow: inherit;
}

/* =============================================================================
   CONTAINER DO PIPELINE
   ============================================================================= */

.pipeline-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* =============================================================================
   ESTÁGIOS DO PIPELINE
   ============================================================================= */

.pipeline-stage {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    min-height: 160px;
    max-height: 450px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pipeline-stage:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #007bff;
}

/* Cabeçalho do Estágio */
.stage-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stage-info {
    flex: 1;
    margin-left: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stage-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

.stage-count {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* Cores específicas dos ícones por estágio */
.pipeline-stage[data-stage="lead-captado"] .stage-icon {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.pipeline-stage[data-stage="primeiro-contato"] .stage-icon {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.pipeline-stage[data-stage="agendamento-feito"] .stage-icon {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.pipeline-stage[data-stage="recontato-pendente"] .stage-icon {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #c2410c;
}

.pipeline-stage[data-stage="aguardando-documentos"] .stage-icon {
    background: #fdf4ff;
    border-color: #e9d5ff;
    color: #7c3aed;
}

.pipeline-stage[data-stage="em-negociacao"] .stage-icon {
    background: #fef7ff;
    border-color: #f3e8ff;
    color: #a855f7;
}

.pipeline-stage[data-stage="aprovado"] .stage-icon {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

.pipeline-stage[data-stage="contrato-assinado"] .stage-icon {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #d97706;
}
.stage-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Scroll customizado para o conteúdo */
.stage-content::-webkit-scrollbar {
    width: 6px;
}

.stage-content::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.stage-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.stage-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
.stage-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f3f4;
}

.stage-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.stage-empty p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Cards de Lead dentro dos estágios */
.lead-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.lead-card:last-child {
    margin-bottom: 0;
}

.lead-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.lead-company {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.lead-potential {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex-shrink: 0;
}

.lead-potential.alto {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.lead-potential.medio {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.lead-potential.baixo {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.lead-contact {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Botões de ação rápida no card do lead */
.lead-actions {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
}

.lead-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.lead-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.lead-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lead-action-btn.phone {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.lead-action-btn.phone:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    color: white;
}

.lead-action-btn.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
}

.lead-action-btn.whatsapp:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    color: white;
}

.lead-action-btn.email {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.lead-action-btn.email:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    color: white;
}

.lead-action-btn.view {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
}

.lead-action-btn.view:hover {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
    color: white;
}
.lead-action-btn.prot {
    background: linear-gradient(135deg, #fd6c67, #f14040);
    color: white;
}

.lead-action-btn.prot:hover {
    background: linear-gradient(135deg, #fd6c67, #f14040);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
    color: white;
}

/* Garantir que os botões da task e do funil tenham o mesmo estilo */
.btn-contact,
.lead-action-btn {
    font-family: inherit;
    outline: none;
    user-select: none;
}

.btn-contact:focus,
.lead-action-btn:focus {
    outline: 2px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Indicador de scroll quando há mais conteúdo */
.stage-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 6px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pipeline-stage:hover .stage-content::after {
    opacity: 1;
}

/* =============================================================================
   RESPONSIVIDADE EXECUTIVA
   ============================================================================= */

@media (max-width: 1200px) {
    .funil-header-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .funil-metrics-panel {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pipeline-stages {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .funil-executive-header {
        margin: -15px -15px 2rem -15px;
        padding: 2rem 1rem;
    }
    
    .funil-title-group h2 {
        font-size: 2rem;
    }
    
    .funil-metrics-panel {
        gap: 1rem;
        padding: 1rem;
    }
    
    .funil-action-button .btn {
        font-size: 0.9rem;
        padding: 0.875rem 1.5rem;
    }
    
    .metric-card {
        min-width: 100px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .pipeline-container {
        padding: 0 1rem;
    }
    
    .pipeline-stages {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stage-header {
        padding: 1rem;
    }
    
    .stage-content {
        padding: 1rem;
        min-height: 140px;
    }
    
    .stage-empty {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .funil-executive-header {
        margin: -15px -15px 2rem -15px;
        padding: 1.5rem 1rem;
    }
    
    .funil-title-group h2 {
        font-size: 1.75rem;
    }
    
    .funil-description {
        font-size: 1rem;
    }
    
    .funil-metrics-panel {
        flex-direction: column;
        gap: 1rem;
    }
    
    .funil-action-button .btn {
        font-size: 0.85rem;
        padding: 0.75rem 1.25rem;
        width: 100%;
        justify-content: center;
    }
    
    .metric-separator {
        display: none;
    }
    
    .stage-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .stage-title {
        font-size: 0.9rem;
    }
    
    .stage-count {
        min-width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .lead-card {
        padding: 0.75rem;
    }
    
    .lead-company {
        font-size: 0.85rem;
    }
    
    .lead-contact {
        font-size: 0.75rem;
    }
}

/* =============================================================================
   ANIMAÇÕES EXECUTIVAS
   ============================================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pipeline-stage {
    animation: fadeInUp 0.4s ease-out;
}

.pipeline-stage:nth-child(1) { animation-delay: 0.05s; }
.pipeline-stage:nth-child(2) { animation-delay: 0.1s; }
.pipeline-stage:nth-child(3) { animation-delay: 0.15s; }
.pipeline-stage:nth-child(4) { animation-delay: 0.2s; }
.pipeline-stage:nth-child(5) { animation-delay: 0.25s; }
.pipeline-stage:nth-child(6) { animation-delay: 0.3s; }
.pipeline-stage:nth-child(7) { animation-delay: 0.35s; }
.pipeline-stage:nth-child(8) { animation-delay: 0.4s; }
.pipeline-stage:nth-child(9) { animation-delay: 0.45s; }

/* =============================================================================
   CARD DESCARTADOS (LARGURA COMPLETA)
   ============================================================================= */

.pipeline-stage-wide {
    grid-column: 1 / -1; /* Ocupa toda a largura da grid */
    margin-top: 1rem;
}

.pipeline-stage[data-stage="descartado"] .stage-icon {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* Suporte para movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .pipeline-stage {
        animation: none;
    }
    
    .pipeline-stage:hover {
        transform: none;
    }
    
    .lead-card:hover {
        transform: none;
    }
}