/* Variables CSS */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --bg-color: #ffffff;
    --sidebar-bg: #1f2937;
    --header-height: 60px;
    --sidebar-width: 250px;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--light-gray);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* En-tête */
.header {
    background: white;
    box-shadow: var(--shadow);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 30px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-nav a {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.header-nav a:hover {
    background: var(--light-gray);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
}

/* Pages d'authentification */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--gray);
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--gray);
    font-size: 12px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

/* Boutons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Dashboard */
.dashboard {
    padding: 20px 0;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.text-muted {
    color: var(--gray);
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--light-gray);
}

.stat-income .stat-icon {
    background: #d1fae5;
}

.stat-expense .stat-icon {
    background: #fee2e2;
}

.stat-balance .stat-icon {
    background: #dbeafe;
}

.stat-debt .stat-icon {
    background: #fef3c7;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-balance.positive .stat-value {
    color: var(--success-color);
}

.stat-balance.negative .stat-value {
    color: var(--danger-color);
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
}

/* Sections */
.section {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    color: var(--dark);
}

/* Budgets */
.budget-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.budget-item {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.budget-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.budget-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.budget-info {
    flex: 1;
}

.budget-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.budget-info p {
    font-size: 14px;
    color: var(--gray);
}

.budget-percentage {
    font-weight: bold;
    color: var(--success-color);
}

.budget-percentage.over {
    color: var(--danger-color);
}

/* Barre de progression */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.progress-fill.over {
    background: var(--danger-color);
}

/* Objectifs d'épargne */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.goal-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--light-gray);
}

.goal-card h4 {
    margin-bottom: 16px;
    color: var(--dark);
}

.goal-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-amount {
    font-size: 14px;
    color: var(--gray);
}

.goal-percentage {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: right;
}

/* Transactions */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.transaction-item:hover {
    background: var(--light-gray);
}

.transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.transaction-icon.income {
    background: #d1fae5;
}

.transaction-icon.expense {
    background: #fee2e2;
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--dark);
}

.transaction-details p {
    font-size: 13px;
}

.transaction-amount {
    font-size: 18px;
    font-weight: bold;
}

.transaction-amount.income {
    color: var(--success-color);
}

.transaction-amount.expense {
    color: var(--danger-color);
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-sm .modal-content {
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 22px;
    color: var(--dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--dark);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .goals-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal {
        padding: 0;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* ===== AMÉLIORATION DES INPUTS ===== */

/* Style de base pour tous les inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* État focus des inputs */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #ffffff;
}

/* État hover des inputs */
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
input[type="time"]:hover:not(:focus),
input[type="datetime-local"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: #d1d5db;
}

/* État disabled */
input:disabled,
select:disabled,
textarea:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Labels améliorés */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

/* Labels requis */
label.required::after {
    content: " *";
    color: #ef4444;
}

/* Container pour les inputs avec icône */
.input-with-icon {
    position: relative;
}

.input-with-icon input,
.input-with-icon select {
    padding-left: 45px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.input-with-icon input:focus ~ .input-icon {
    color: #6366f1;
}

/* Helper text sous les inputs */
.input-helper {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    display: block;
}

.input-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
    display: block;
}

.input-success {
    font-size: 13px;
    color: #10b981;
    margin-top: 6px;
    display: block;
}

/* ===== STYLE UNIFIÉ DES CARDS ===== */

/* Container principal des pages */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* En-tête de page unifié */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 15px;
    color: #6b7280;
}

/* Cards style dashboard */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* En-tête de card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.card-header .card-actions {
    display: flex;
    gap: 10px;
}

/* Corps de card */
.card-body {
    color: #374151;
}

/* Footer de card */
.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid de cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Stats cards (petites cards de stats) */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card .stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-card .stat-content {
    flex: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-card .stat-change.positive {
    color: #10b981;
}

.stat-card .stat-change.negative {
    color: #ef4444;
}

/* ===== AMÉLIORATION DES TABLEAUX ===== */

.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
}

thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody td {
    padding: 16px;
    font-size: 14px;
    color: #374151;
}

/* ===== BOUTONS AMÉLIORÉS ===== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Boutons icônes seulement */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ===== BADGES & TAGS ===== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .page-container {
        padding: 20px 15px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ===================================================
   CSS SPÉCIFIQUE POUR LA PAGE REVENUS RÉCURRENTS
   À ajouter à assets/css/style.css
   ================================================== */

/* ===== LAYOUT GÉNÉRAL ===== */

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

/* ===== CARDS SYSTÈME ===== */

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.card-body {
    color: #374151;
}

.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== GRILLE DE CARDS ===== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ===== STAT CARDS (CARTES STATISTIQUES) ===== */

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card .stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-card .stat-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-card .stat-content {
    flex: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-card .stat-change.positive {
    color: #10b981;
}

.stat-card .stat-change.negative {
    color: #ef4444;
}

/* ===== TABLEAUX ===== */

.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
}

thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody td {
    padding: 16px;
    font-size: 14px;
    color: #374151;
    vertical-align: middle;
}

/* ===== BADGES ===== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

/* ===== BOUTONS ===== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
}

/* ===== MODALES ===== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.close {
    color: #9ca3af;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    color: #374151;
}

.modal form {
    padding: 24px;
}

/* ===== FORMULAIRES ===== */

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

label.required::after {
    content: " *";
    color: #ef4444;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: #d1d5db;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input,
.input-with-icon select {
    padding-left: 45px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.input-with-icon input:focus ~ .input-icon,
.input-with-icon select:focus ~ .input-icon {
    color: #6366f1;
}

.input-helper {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    display: block;
}

.input-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
    display: block;
}

.input-success {
    font-size: 13px;
    color: #10b981;
    margin-top: 6px;
    display: block;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* ===== NOTIFICATIONS / TOASTS ===== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

/* ===== ÉTATS VIDES ===== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
}

/* ===== LOADING / SPINNER ===== */

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 20px 15px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
    
    .card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .table-responsive {
        font-size: 13px;
    }
    
    thead th,
    tbody td {
        padding: 12px 8px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 20px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .stat-card .stat-icon {
        width: 56px;
        height: 56px;
    }
    
    tbody td {
        font-size: 13px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
}

/* ===== UTILITAIRES ===== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ===== ANIMATIONS SUPPLÉMENTAIRES ===== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* ===== PRINT STYLES ===== */

@media print {
    .btn,
    .card-actions,
    .modal,
    .notification {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }
    
    .page-container {
        padding: 0;
    }
}

/* ===================================================
   FIX MODAL - À ajouter APRÈS le CSS principal
   Si les modales ne s'affichent pas correctement
   ================================================== */

/* Force l'affichage correct des modales */
.modal {
    display: none !important;
    position: fixed !important;
    z-index: 10000 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    animation: fadeIn 0.3s ease !important;
}

/* Quand la modal est active */
.modal[style*="display: block"] {
    display: block !important;
}

/* Contenu de la modal */
.modal .modal-content {
    background-color: #fefefe !important;
    padding: 0 !important;
    border-radius: 16px !important;
    width: 90% !important;
    max-width: 960px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    animation: slideUp 0.3s ease !important;
    position: relative !important;
    z-index: 10001 !important;
}

/* En-tête de la modal */
.modal .modal-header {
    padding: 24px 24px 16px 24px !important;
    border-bottom: 2px solid #f3f4f6 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: white !important;
    border-radius: 16px 16px 0 0 !important;
}

.modal .modal-header h3 {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

/* Bouton fermer */
.modal .close {
    color: #9ca3af !important;
    font-size: 32px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal .close:hover,
.modal .close:focus {
    color: #374151 !important;
}

/* Corps de la modal */
.modal form {
    padding: 24px !important;
    background: white !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .modal .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
    }
}

/* Test de visibilité - Retire après debug */
.modal.debug-test {
    display: block !important;
    background: rgba(255, 0, 0, 0.5) !important;
}

.modal.debug-test .modal-content {
    background: yellow !important;
    border: 5px solid red !important;
}