/* CSS Frontend pour Gestion Perso */

/* Police Arial globale - FORCE PARTOUT */
* {
    font-family: Arial, sans-serif !important;
}

body,
.gestion-perso-container,
.gestion-perso-form-container,
.gestion-perso-stats-container,
input,
select,
textarea,
button,
.gp-btn {
    font-family: Arial, sans-serif !important;
}

.gestion-perso-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* Filtres */
.gp-filters-frontend {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.gp-filter-form {
    display: block;
}

.gp-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.gp-filter-item {
    display: flex;
    flex-direction: column;
}

.gp-filter-item label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.gp-filter-item select,
.gp-filter-item input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.gp-filter-item select:focus,
.gp-filter-item input[type="text"]:focus {
    outline: none;
    border-color: #2271b1;
}

.gp-filter-actions {
    display: flex;
    gap: 10px;
}

/* Boutons */
.gp-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.gp-btn:hover {
    background: #135e96;
    color: #fff;
    transform: translateY(-1px);
}

.gp-btn-primary {
    background: #2271b1;
}

.gp-btn-secondary {
    background: #6c757d;
}

.gp-btn-success {
    background: #46b450;
}

.gp-btn-success:hover {
    background: #2ea32e;
}

.gp-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Grille de factures */
.gp-factures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Carte de facture */
.gp-facture-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.gp-facture-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.gp-facture-card .gp-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gp-facture-card .gp-card-title strong {
    font-size: 16px;
}

.gp-card-body {
    padding: 20px;
}

.gp-facture-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.gp-info-row:last-child {
    border-bottom: none;
}

.gp-info-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
    margin-right: 10px;
}

.gp-info-value {
    text-align: right;
    color: #333;
    font-size: 14px;
}

.gp-montant {
    font-size: 18px;
    font-weight: bold;
    color: #2271b1;
}

.gp-notes {
    flex-direction: column;
    align-items: flex-start;
}

.gp-notes .gp-info-value {
    text-align: left;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.gp-card-footer {
    padding: 15px;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Badges */
.gp-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.gp-status-en_attente {
    background: #fff3cd;
    color: #856404;
}

.gp-status-paiement_partiel,
.gp-status-partiel {
    background: #d1ecf1;
    color: #0c5460;
}

.gp-status-payee {
    background: #d4edda;
    color: #155724;
}

.gp-status-annulee {
    background: #f8d7da;
    color: #721c24;
}

.gp-category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* États */
.gp-overdue {
    color: #dc3545;
    font-weight: bold;
}

.gp-warning {
    color: #ffc107;
    font-weight: bold;
}

/* Totaux */
.gp-totals {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gp-total-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gp-total-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.gp-total-value {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.gp-total-amount {
    font-size: 24px;
    color: #2271b1;
}

/* Pas de résultats */
.gp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gp-no-results p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Statistiques */
.gp-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gp-stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.gp-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 32px;
    color: #2271b1;
}

.gp-stat-card p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.gp-stat-upcoming .gp-stat-icon {
    color: #f39c12;
}

.gp-stat-upcoming h3 {
    color: #f39c12;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .gestion-perso-container {
        padding: 10px;
    }
    
    .gp-factures-grid {
        grid-template-columns: 1fr;
    }
    
    .gp-filter-row {
        grid-template-columns: 1fr;
    }
    
    .gp-filter-actions {
        flex-direction: column;
    }
    
    .gp-filter-actions .gp-btn {
        width: 100%;
    }
    
    .gp-totals {
        flex-direction: column;
        gap: 15px;
    }
    
    .gp-total-item {
        width: 100%;
        text-align: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gp-facture-card {
    animation: fadeIn 0.3s ease-out;
}

/* Loader */
.gp-loading {
    text-align: center;
    padding: 40px;
}

.gp-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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