/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #0b0f19 0%, #1f2937 60%, #312e81 100%);
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
.app-header {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.app-title h1 {
    font-size: 2.2rem;
    font-weight: 600;
    -webkit-background-clip: text;

}

.app-title .icon {
    font-size: 2.5rem;
  
    padding: 12px;
    border-radius: 10px;
    color: white;
}

.app-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ===== NAVIGATION ===== */
.main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 2rem;
}

.nav-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.nav-card .icon {
    font-size: 1.8rem;
    color: #667eea;
}

.nav-card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.nav-card-content p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #eaeaea;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.stat-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #7f8c8d;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.stat-trend {
    font-size: 0.9rem;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-trend.negative {
    color: #e74c3c;
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* ===== BACK LINK ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
}

.back-link:hover {
    transform: translateX(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.12);
}

/* ===== PAGE CONTAINERS ===== */
.page-container {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #eaeaea;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #7f8c8d;
    font-size: 1.05rem;
}

/* ===== FORMS ===== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-width: 200px;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.25);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

/* ===== TABLES ===== */
.table-container {
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5a6fd0;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f9f9ff;
}

.data-table td {
    padding: 16px;
    color: #555;
}

/* ===== SOLDE STYLES ===== */
.solde-d {
    color: #e74c3c;
    font-weight: 600;
    background: rgba(231, 76, 60, 0.08);
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.solde-c {
    color: #27ae60;
    font-weight: 600;
    background: rgba(39, 174, 96, 0.08);
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.table-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ===== FILTERS ===== */
.filter-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #7f8c8d; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.p-3 { padding: 1.5rem; }
.shadow-sm { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.07); }
.shadow-lg { box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }

/* ===== LOADING STATES ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .main-nav {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-container {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }
    
    .table-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
}