/* Sistema Logs - Estilos Frontend */
.sistema-logs-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sistema-logs-frontend h1 {
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}

/* Header com filtros */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.logs-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.logs-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Filtros */
.logs-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Botão de refresh */
.refresh-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Container de logs */
#sistema-logs-container {
    min-height: 400px;
}

/* Estados de loading e erro */
.logs-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.logs-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.logs-error {
    text-align: center;
    padding: 60px 20px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 15px;
    color: #c53030;
}

.logs-error h3 {
    margin-bottom: 10px;
    color: #c53030;
}

.logs-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    color: #4a5568;
}

.logs-empty h3 {
    margin-bottom: 10px;
    color: #2d3748;
}

/* Grid de logs */
.logs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Cards de log */
.log-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 5px solid;
}

.log-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.log-card.fluxo-caixa {
    border-left-color: #667eea;
}

.log-card.propovoice {
    border-left-color: #11998e;
}

.log-card.generic {
    border-left-color: #6c757d;
}

/* Header do card */
.log-card-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.api-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.log-date {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Body do card */
.log-card-body {
    padding: 20px;
}

.log-action {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 8px;
    display: inline-block;
}

.log-user {
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 500;
}

.log-description {
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Informações do cliente (Propovoice) */
.client-info {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.client-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.client-email,
.client-value,
.client-broker {
    color: #4a5568;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Footer do card */
.log-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
}

.log-type {
    font-weight: 600;
    padding: 4px 8px;
    background: white;
    border-radius: 12px;
}

.log-ip,
.log-cpf {
    font-family: monospace;
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Responsivo */
@media (max-width: 768px) {
    .sistema-logs-frontend {
        padding: 15px;
    }
    
    .sistema-logs-frontend h1 {
        font-size: 2rem;
    }
    
    .logs-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logs-stats {
        justify-content: center;
    }
    
    .logs-filters {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .logs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .log-card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .log-card-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-card {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}