/**
 * ╔══════════════════════════════════════════════════════════════════╗
 * ║          ACRÉSCIMOS - MODERN DESIGN SYSTEM                       ║
 * ║          Design moderno e profissional para a dashboard          ║
 * ╚══════════════════════════════════════════════════════════════════╝
 */

/* ========================================
   SEÇÃO DE ACRÉSCIMOS - CONTAINER PRINCIPAL
   ======================================== */

#acrescimosSection {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

#acrescimosSection .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid rgba(255, 255, 255, 0.3);
}

#acrescimosSection .section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
    margin: 0;
}

/* ========================================
   BOTÃO PROCESSAR AUTOMÁTICO
   ======================================== */

#acrescimosSection .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#acrescimosSection .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#acrescimosSection .btn-primary:active {
    transform: translateY(0);
}

/* ========================================
   CARDS DE MÉTRICAS (KPIs)
   ======================================== */

#acrescimosSection .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Card 1: Total Pendente - Verde */
#acrescimosSection .stats-grid .stat-card:nth-child(1) {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.3);
}

#acrescimosSection .stats-grid .stat-card:nth-child(1) h3,
#acrescimosSection .stats-grid .stat-card:nth-child(1) .stat-value,
#acrescimosSection .stats-grid .stat-card:nth-child(1) .stat-subtitle {
    color: white !important;
    -webkit-text-fill-color: white !important;
    background: none !important;
}

/* Card 2: Aguardando Instruções - Laranja */
#acrescimosSection .stats-grid .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.3);
}

#acrescimosSection .stats-grid .stat-card:nth-child(2) h3,
#acrescimosSection .stats-grid .stat-card:nth-child(2) .stat-value,
#acrescimosSection .stats-grid .stat-card:nth-child(2) .stat-subtitle {
    color: white !important;
    -webkit-text-fill-color: white !important;
    background: none !important;
}

/* Card 3: Notas Vencendo - Vermelho */
#acrescimosSection .stats-grid .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border: none;
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.3);
}

#acrescimosSection .stats-grid .stat-card:nth-child(3) h3,
#acrescimosSection .stats-grid .stat-card:nth-child(3) .stat-value,
#acrescimosSection .stats-grid .stat-card:nth-child(3) .stat-subtitle {
    color: white !important;
    -webkit-text-fill-color: white !important;
    background: none !important;
}

/* Card 4: Taxa de Conversão - Azul */
#acrescimosSection .stats-grid .stat-card:nth-child(4) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

#acrescimosSection .stats-grid .stat-card:nth-child(4) h3,
#acrescimosSection .stats-grid .stat-card:nth-child(4) .stat-value,
#acrescimosSection .stats-grid .stat-card:nth-child(4) .stat-subtitle {
    color: white !important;
    -webkit-text-fill-color: white !important;
    background: none !important;
}

/* Estilo geral dos cards */
#acrescimosSection .stat-card {
    padding: 1.5rem;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#acrescimosSection .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

#acrescimosSection .stat-card:hover::before {
    opacity: 1;
}

#acrescimosSection .stat-card:hover {
    transform: translateY(-8px) scale(1.02);
}

#acrescimosSection .stat-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0.9;
}

#acrescimosSection .stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0.5rem 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#acrescimosSection .stat-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 500;
}

/* ========================================
   SEÇÃO DE ALERTAS
   ======================================== */

#acrescimosSection .alert-section {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border-left: 5px solid #f5576c;
}

#acrescimosSection .alert-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f5576c;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#acrescimosSection #alertasAcrescimos {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar customizada */
#acrescimosSection #alertasAcrescimos::-webkit-scrollbar {
    width: 8px;
}

#acrescimosSection #alertasAcrescimos::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#acrescimosSection #alertasAcrescimos::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

/* Card de alerta individual */
#acrescimosSection .alert-item {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid #f5576c;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

#acrescimosSection .alert-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2);
}

/* ========================================
   FILTROS
   ======================================== */

#acrescimosSection .filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

#acrescimosSection .filters select,
#acrescimosSection .filters input[type="text"] {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.3s;
    flex: 1;
    min-width: 200px;
}

#acrescimosSection .filters select:focus,
#acrescimosSection .filters input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   TABELA MODERNA
   ======================================== */

#acrescimosSection .table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#acrescimosSection #acrescimosTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#acrescimosSection #acrescimosTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#acrescimosSection #acrescimosTable thead th {
    padding: 1.2rem 1rem;
    text-align: left;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border: none;
}

#acrescimosSection #acrescimosTable tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid #f0f0f0;
}

#acrescimosSection #acrescimosTable tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

#acrescimosSection #acrescimosTable tbody td {
    padding: 1rem;
    color: #333;
    font-size: 0.95rem;
    border: none;
}

/* Badge de Status */
#acrescimosSection .status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#acrescimosSection .status-badge.pendente {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#acrescimosSection .status-badge.aprovado {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

#acrescimosSection .status-badge.nota_emitida {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

#acrescimosSection .status-badge.pago {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#acrescimosSection .status-badge.aguardando_instrucoes {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* Botões de ação na tabela */
#acrescimosSection #acrescimosTable .btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

#acrescimosSection #acrescimosTable .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

#acrescimosSection #acrescimosTable .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

@media (max-width: 768px) {
    #acrescimosSection {
        padding: 1rem;
    }

    #acrescimosSection .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    #acrescimosSection .section-header h2 {
        font-size: 1.5rem;
    }

    #acrescimosSection .stats-grid {
        grid-template-columns: 1fr;
    }

    #acrescimosSection .filters {
        flex-direction: column;
    }

    #acrescimosSection .filters select,
    #acrescimosSection .filters input[type="text"] {
        width: 100%;
    }

    /* Tabela responsiva */
    #acrescimosSection .table-container {
        overflow-x: auto;
    }

    #acrescimosSection #acrescimosTable {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    #acrescimosSection .stat-value {
        font-size: 2rem;
    }

    #acrescimosSection #acrescimosTable thead th,
    #acrescimosSection #acrescimosTable tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    #acrescimosSection #acrescimosTable .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#acrescimosSection .stat-card {
    animation: fadeInUp 0.5s ease-out;
}

#acrescimosSection .stat-card:nth-child(1) { animation-delay: 0.1s; }
#acrescimosSection .stat-card:nth-child(2) { animation-delay: 0.2s; }
#acrescimosSection .stat-card:nth-child(3) { animation-delay: 0.3s; }
#acrescimosSection .stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   ESTADOS VAZIOS
   ======================================== */

#acrescimosSection .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

#acrescimosSection .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

#acrescimosSection .empty-state-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
}

/* ========================================
   LOADING STATES
   ======================================== */

#acrescimosSection .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

#acrescimosSection .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
