/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Variables CSS pour les thèmes */
:root {
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --balance-positive: #4caf50;
    --balance-negative: #f44336;
    --balance-neutral: #9e9e9e;
    --btn-primary: #667eea;
    --btn-primary-hover: #764ba2;
    --input-bg: #ffffff;
    --input-border: #ddd;
}

/* Mode sombre */
body.dark-mode {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --card-bg: #0f3460;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #2a2a3e;
    --shadow: rgba(0, 0, 0, 0.5);
    --balance-positive: #66bb6a;
    --balance-negative: #ef5350;
    --balance-neutral: #bdbdbd;
    --btn-primary: #3a7bd5;
    --btn-primary-hover: #00d2ff;
    --input-bg: #1a1a2e;
    --input-border: #2a2a3e;
}

/* Boutons de test */


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    max-width: 100vw;
}

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

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-image {
    width: 60px;
    height: auto;
    max-height: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    object-fit: contain;
}

.logo-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Date du jour */
.current-date {
    margin-top: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.logout-btn-header {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logout-btn-header:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Style pour le bouton de déconnexion dans le menu popup */
.menu-popup .logout-btn-header {
    position: static;
    width: 100%;
    margin-top: 20px;
    background: #dc3545;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-popup .logout-btn-header:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Style pour le bouton de déconnexion dans le menu (nouvelle classe) */
.logout-btn-menu {
    background: #dc3545 !important;
    color: white !important;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.logout-btn-menu:hover {
    background: #c82333 !important;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Séparateur du menu */
.menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
    width: 100%;
}

/* Boutons d'action rapide */
.quick-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #218838, #1e7e34);
}

.quick-action-btn:active {
    transform: translateY(0);
}

/* Écran de connexion */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 15px 35px var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.login-logo {
    width: 120px;
    height: 80px;
    border-radius: 12px;
    margin-bottom: 20px;
    object-fit: cover;
}

.login-card h2 {
    margin-top: 10px;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

.error-message {
    background: #ff6b6b;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Application principale */
.app-container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow);
    overflow: hidden;
    min-height: 70vh;
    position: relative;
    transition: background 0.3s ease;
}

/* Bouton menu hamburger */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: #667eea;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.menu-toggle:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: var(--input-bg);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Overlay pour le menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Menu popup */
.menu-popup {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: 2px 0 10px var(--shadow);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.menu-popup.active {
    left: 0;
}

.menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.menu-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.menu-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Informations utilisateur connecté */
.current-user-info {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.user-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.menu-nav {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.menu-item {
    display: block;
    padding: 15px 20px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--border-color);
    transform: translateX(5px);
}

.menu-item.active {
    background: #667eea;
    color: white;
}

.menu-item:before {
    margin-right: 10px;
}

/* Contenu principal */
.main-content {
    padding: 30px;
    padding-top: 80px;
    overflow-y: auto;
    min-height: calc(100vh - 60px);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 100%;
    overflow: hidden;
}

.card {
    background: #d4e8d4;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.card:hover {
    background: #b8d9b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Mode sombre : Adapter les tuiles du dashboard */
body.dark-mode .card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 15px var(--shadow) !important;
}

body.dark-mode .card:hover {
    background: var(--border-color) !important;
    box-shadow: 0 6px 20px var(--shadow) !important;
}

.card h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

body.dark-mode .card h3 {
    color: var(--text-secondary) !important;
}

.balance {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

body.dark-mode .balance {
    color: var(--text-primary) !important;
}

.balance.positive {
    color: var(--balance-positive);
}

.balance.negative {
    color: var(--balance-negative);
}

.balance.neutral {
    color: #6c757d;
}

.balance-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 5px;
    text-align: center;
}

/* Formulaires */
.form {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.form h2 {
    margin-bottom: 30px;
    color: var(--text-primary);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Boutons */
.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

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

/* Listes */
.cheques-list,
.expenses-list {
    margin-bottom: 30px;
}

.cheque-item,
.expense-item,
.charge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.3s ease;
}

.cheque-item:hover,
.expense-item:hover,
.charge-item:hover {
    background: var(--border-color);
}

.cheque-number,
.expense-category,
.charge-name {
    font-weight: bold;
    color: var(--text-primary);
    flex: 1;
}

.cheque-amount,
.expense-amount,
.charge-amount {
    font-weight: bold;
    color: var(--btn-primary);
    text-align: right;
    min-width: 80px;
}

.cheque-date,
.expense-date,
.charge-date {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: right;
    min-width: 60px;
}

/* Structure spécifique pour les charges dans le menu */
.charge-item .charge-name {
    flex: 1;
    text-align: left;
    font-weight: bold;
    color: #333;
}

.charge-item .charge-amount {
    flex: 0 0 auto;
    text-align: center;
    min-width: 80px;
    font-weight: bold;
    color: #2E7D32;
}

.charge-item .charge-date {
    flex: 0 0 auto;
    text-align: center;
    min-width: 60px;
    color: #666;
}

.charge-item .delete-btn {
    flex: 0 0 auto;
    margin-left: 10px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.charge-item .delete-btn:hover {
    background: #ff3742;
    transform: scale(1.05);
}

/* Mode sombre : Adapter les couleurs des textes dans les tuiles */
body.dark-mode .charge-item .charge-name,
body.dark-mode .expense-item .expense-category,
body.dark-mode .expense-item .item-description,
body.dark-mode .cheque-item .cheque-number,
body.dark-mode .detail-item .item-description,
body.dark-mode .detail-item .expense-category,
body.dark-mode .detail-item .cheque-number,
body.dark-mode .detail-item .charge-name,
body.dark-mode .detail-item .payment-title {
    color: var(--text-primary) !important;
}

body.dark-mode .charge-item .charge-amount,
body.dark-mode .expense-item .expense-amount,
body.dark-mode .cheque-item .cheque-amount,
body.dark-mode .detail-item .item-amount,
body.dark-mode .detail-item .expense-amount,
body.dark-mode .detail-item .cheque-amount,
body.dark-mode .detail-item .charge-amount {
    color: #4CAF50 !important; /* Vert clair pour meilleur contraste */
}

body.dark-mode .charge-item .charge-date,
body.dark-mode .expense-item .expense-date,
body.dark-mode .cheque-item .cheque-date,
body.dark-mode .expense-item .expense-user,
body.dark-mode .cheque-item .cheque-user,
body.dark-mode .detail-item .item-date,
body.dark-mode .detail-item .expense-date,
body.dark-mode .detail-item .cheque-date,
body.dark-mode .detail-item .charge-date,
body.dark-mode .detail-item .payment-date,
body.dark-mode .detail-item .item-user,
body.dark-mode .detail-item .expense-user,
body.dark-mode .detail-item .cheque-user,
body.dark-mode .detail-item .item-parts,
body.dark-mode .detail-item .expense-parts,
body.dark-mode .detail-item .cheque-parts,
body.dark-mode .detail-item .charge-total,
body.dark-mode .detail-item .payment-description {
    color: var(--text-secondary) !important;
}

.cheque-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.cheque-status.en_attente {
    background: #ffc107;
    color: #856404;
}

.cheque-status.paye {
    background: #28a745;
    color: white;
}

.expense-user,
.charge-type {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Configuration avec onglets */
.config-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.config-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
}

.config-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

/* Onglets de configuration */
.config-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
    overflow: hidden;
}

.tab-btn {
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid transparent;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 160px;
    max-width: 180px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

/* Contenu des onglets */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

/* Sections */
.charges-container,
.config-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.charges-section,
.config-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
}

.charges-section h3,
.config-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--btn-primary);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.total-charges {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--btn-primary);
    background: var(--bg-secondary);
    padding: 5px 15px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    /* Date du jour - responsive mobile */
    .current-date {
        font-size: 0.95rem;
        padding: 6px 15px;
        margin-bottom: 15px;
    }
    
    /* Informations utilisateur - responsive mobile */
    .current-user-info {
        padding: 12px 15px;
    }
    
    .user-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    /* Optimisation PWA du menu popup */
    .menu-popup {
        width: 280px;
        left: -100%;
    }
    
    /* Optimisation PWA des modales */
    .modal-content {
        width: 95%;
        max-width: 400px;
        padding: 20px;
        margin: 10px;
    }
    
    /* Optimisation PWA du dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }
    
    .card {
        padding: 15px;
        margin: 0 5px;
    }
    
    /* Optimisation PWA des formulaires */
    .form {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    /* Optimisation PWA des onglets de configuration */
    .config-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .tab-btn {
        min-width: auto;
        padding: 10px 16px;
        font-size: 0.9em;
        flex: 1;
        min-width: 120px;
        max-width: 150px;
        text-align: center;
    }
    
    .tab-btn:nth-child(1) { /* Paramètres Financiers */
        flex: 1 1 100%;
        max-width: 200px;
    }
    
    .tab-btn:nth-child(2) { /* Gestion des Catégories */
        flex: 1 1 45%;
    }
    
    .tab-btn:nth-child(3) { /* Outils Système */
        flex: 1 1 45%;
    }
    
    .tab-btn:nth-child(4) { /* Logs */
        flex: 1 1 100%;
        max-width: 200px;
    }
    .menu-popup {
        width: 280px;
    }
    
    .menu-toggle {
        top: 15px;
        left: 15px;
        padding: 10px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
    }
    
    .main-content {
        padding: 20px;
        padding-top: 70px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .charges-container,
    .config-container {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .logout-btn-header {
        display: none; /* Masquer le bouton de déconnexion du header sur mobile */
    }
    
    .quick-action-buttons {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
    }
    
    .quick-action-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Optimisation PWA pour très petits écrans */
@media (max-width: 480px) {
    /* Menu popup ultra-compact */
    .menu-popup {
        width: 100%;
        left: -100%;
    }
    
    /* Modales pleine largeur */
    .modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: none;
    }
    
    /* Dashboard en colonne unique */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 5px;
    }
    
    .card {
        padding: 12px;
        margin: 0 2px;
    }
    
    /* Formulaires compacts */
    .form {
        padding: 0 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    /* Boutons d'action adaptés */
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions button {
        width: 100%;
        padding: 12px;
    }
    .config-tabs {
        flex-direction: column;
        gap: 6px;
    }
    
    .tab-btn {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: auto;
    }
    
    .tab-btn:nth-child(1),
    .tab-btn:nth-child(4) {
        max-width: none;
    }
}

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

.screen.active {
    animation: fadeIn 0.3s ease;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin: 20px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.form-actions .btn-primary {
    background: #667eea;
    color: white;
}

.form-actions .btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.form-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.form-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Styles pour l'affichage des chèques */
.cheques-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.cheque-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cheque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cheque-number {
    font-weight: bold;
    font-size: 16px;
}

.cheque-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-paid {
    background: #28a745;
    color: white;
}

.status-pending {
    background: #ffc107;
    color: #212529;
}

.cheque-amount {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.cheque-details {
    margin-bottom: 15px;
}

.cheque-details div {
    margin-bottom: 5px;
    font-size: 14px;
}

.btn-mark-paid {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-mark-paid:hover {
    background: #218838;
}

/* Styles pour l'affichage du prorata */
.prorata-label {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.prorata-display {
    display: flex;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.prorata-display span {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
}

#prorata-romain-display {
    color: #007bff;
}

#prorata-magali-display {
    color: #28a745;
}

/* Styles pour l'administration */
.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-virement {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

.btn-virement:hover {
    background: #218838;
    transform: translateY(-1px);
}

.expense-item, .cheque-item, .charge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #d4e8d4;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.expense-item:hover, .cheque-item:hover, .charge-item:hover {
    background: #b8d9b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Mode sombre : Adapter les tuiles pour le mode sombre */
body.dark-mode .expense-item,
body.dark-mode .cheque-item,
body.dark-mode .charge-item,
body.dark-mode .detail-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

body.dark-mode .expense-item:hover,
body.dark-mode .cheque-item:hover,
body.dark-mode .charge-item:hover,
body.dark-mode .detail-item:hover {
    background: var(--border-color) !important;
    box-shadow: 0 4px 12px var(--shadow) !important;
}

.expense-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-right: 15px;
}

.expense-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.expense-category {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
}

.expense-amount {
    font-size: 16px;
    font-weight: bold;
    color: var(--btn-primary);
}

.expense-parts {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 8px;
}

.expense-user {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
} 

.lgbt-title {
    background: linear-gradient(45deg, 
        #ff0000 0%, 
        #ff0000 5%, 
        #ff8000 20%, 
        #ffff00 35%, 
        #00ff00 50%, 
        #0000ff 65%, 
        #8000ff 80%, 
        #8000ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
} 

.expenses-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.expenses-filter label {
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.expenses-filter select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: var(--input-bg);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.expenses-filter select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.expenses-filter select:hover {
    border-color: #5a6fd8;
} 

.no-expenses-message {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 20px 0;
}

.no-expenses-message p {
    margin: 0;
    font-size: 16px;
} 

.expenses-filters {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.search-section {
    margin-bottom: 15px;
}

.search-section label {
    display: block;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.search-section input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-section input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-section input::placeholder {
    color: var(--text-secondary);
}

.filters-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 14px;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: var(--input-bg);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group select:hover {
    border-color: #5a6fd8;
}

.reset-section {
    text-align: center;
}

.reset-section button {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.reset-section button:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .filters-section {
        grid-template-columns: 1fr;
    }
} 

.add-charge-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.add-charge-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
} 

.expense-paid-status {
    color: #28a745;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 5px;
}

.expense-paid {
    opacity: 0.7;
    background: #e8f5e8 !important;
}

.expense-paid:hover {
    background: #d4e8d4 !important;
}

.cheque-info {
    flex: 1;
}

.cheque-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.cheque-parts {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cheque-parts span {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.btn-mark-part-paid {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mark-part-paid:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-mark-part-paid:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.cheque-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.cheque-parts {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cheque-parts span {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Styles pour les chèques (même style que les dépenses) */
.cheque-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    background: #d4e8d4;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    min-height: 120px;
}

.cheque-item:hover {
    background: #b8d9b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cheque-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-right: 15px;
}

.cheque-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.cheque-number {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
}

.cheque-beneficiaire {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
}

.cheque-amount {
    font-size: 16px;
    font-weight: bold;
    color: var(--btn-primary);
}

.cheque-parts {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 8px;
}

.cheque-user {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.cheque-status-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.cheque-paid-status {
    color: #28a745;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 5px;
}

.cheque-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

/* Thèmes personnalisables */
.theme-option:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.theme-option:active {
    transform: scale(0.98);
}

/* Menu Virements */
.virements-filters {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow);
}

.virements-filters .filter-group {
    margin-bottom: 15px;
}

.virements-filters .filter-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

.virements-filters select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.virements-filters .btn-secondary {
    margin-top: 10px;
}

.virements-section {
    margin-bottom: 30px;
}

.virements-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.virement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
}

.virement-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.virement-amount {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
}

body.dark-mode .virement-amount {
    color: #4CAF50;
}

.virement-details {
    flex: 1;
    display: flex;
    gap: 15px;
    margin: 0 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.virement-date {
    color: #FFC107;
}

body.dark-mode .virement-date {
    color: #FFC107;
}

.virement-desc {
    font-style: italic;
}

.virement-total {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    text-align: right;
    margin-top: 15px;
    border: 2px solid #667eea;
    font-size: 18px;
    color: var(--text-primary);
}

.virement-total strong {
    color: #667eea;
    font-size: 22px;
}

body.dark-mode .virement-total strong {
    color: #667eea;
}

/* Filtres pour les chèques */
.cheques-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.no-cheques-message {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 20px 0;
}

.no-cheques-message p {
    margin: 0;
    font-size: 16px;
} 

/* Styles pour les filtres toggle */
.filters-toggle-section {
    margin-bottom: 15px;
    text-align: center;
}

.btn-toggle-filters {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-toggle-filters:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.filters-hidden {
    display: none;
}

.filters-visible {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .btn-toggle-filters {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .expenses-filters,
    .cheques-filters {
        padding: 10px;
        background: #f9f9f9;
        border-radius: 5px;
        margin-bottom: 15px;
    }
    
    .search-section,
    .filters-section {
        flex-direction: column;
    }
    
    .filter-group {
        margin-bottom: 10px;
    }
} 

/* Tuiles cliquables */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Vue détaillée */
.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.btn-back {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #5a6fd8;
    transform: translateX(-2px);
}

#detail-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.detail-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px var(--shadow);
}

/* Responsive pour la vue détaillée */
@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn-back {
        width: 100%;
        text-align: center;
    }
} 

/* Styles pour la vue détaillée */
.detail-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-summary h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.detail-summary p {
    margin: 0;
    font-size: 1.1rem;
}

.detail-list {
    margin-bottom: 30px;
}

.detail-list h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    border-bottom: 2px solid var(--btn-primary);
    padding-bottom: 5px;
}

.detail-item {
    background: #d4e8d4;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: #b8d9b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Styles des éléments dans les detail-items */
.detail-item .item-date,
.detail-item .expense-date,
.detail-item .cheque-date,
.detail-item .charge-date,
.detail-item .payment-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.detail-item .item-description,
.detail-item .expense-category,
.detail-item .cheque-number,
.detail-item .charge-name,
.detail-item .payment-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.detail-item .item-amount,
.detail-item .expense-amount,
.detail-item .cheque-amount,
.detail-item .charge-amount {
    font-weight: bold;
    color: #2e7d32;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.detail-item .payment-amount {
    font-weight: bold;
    color: #28a745;
    font-size: 1.1em;
}

.detail-item .item-parts,
.detail-item .expense-parts,
.detail-item .cheque-parts {
    color: #666;
    font-size: 0.85em;
    font-style: italic;
    margin-left: 5px;
}

.detail-item .item-user,
.detail-item .expense-user,
.detail-item .cheque-user {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.detail-item .charge-total,
.detail-item .payment-description {
    color: #666;
    font-size: 0.85em;
    font-style: italic;
}

.detail-item .item-paid {
    color: #28a745;
    font-size: 0.9em;
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    font-size: 1.1rem;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-style: italic;
} 

/* Styles pour les parts prorata dans la vue détaillée */
.detail-item .expense-parts,
.detail-item .cheque-parts,
.detail-item .charge-parts {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: 8px;
}

.detail-item .expense-amount,
.detail-item .cheque-amount,
.detail-item .charge-amount {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

/* Filtres globaux */
.global-filters-toggle-section {
    margin-bottom: 15px;
    text-align: center;
}

.global-filters {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.global-filters.filters-hidden {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
    margin-bottom: 0;
}

.global-filters.filters-visible {
    max-height: 500px;
    opacity: 1;
    margin-bottom: 20px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-section label {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-section select,
.filter-section input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: var(--input-bg);
}

.filter-section select:focus,
.filter-section input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.filter-section button {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-section button:hover {
    background: #5a6268;
}

/* Responsive pour les filtres globaux */
@media (max-width: 768px) {
    .global-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
} 

/* ===== STYLES D'ADMINISTRATION ===== */

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-actions button {
    margin: 5px 0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-diagnostic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-diagnostic:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-performance {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-performance:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.btn-export {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.btn-fix {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-fix:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
}

/* Styles pour la section des logs */
.logs-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.auto-refresh-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-left: auto;
}

.auto-refresh-label input[type="checkbox"] {
    margin: 0;
}

.logs-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.logs-content {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.logs-content .log-entry {
    margin: 2px 0;
    padding: 2px 0;
}

.logs-content .log-entry.error {
    color: #dc3545;
    font-weight: bold;
}

.logs-content .log-entry.warning {
    color: #ffc107;
    font-weight: bold;
}

.logs-content .log-entry.info {
    color: #17a2b8;
}

.logs-content .log-entry.success {
    color: #28a745;
}

.logs-content .timestamp {
    color: #6c757d;
    font-size: 0.8em;
}

.logs-content .no-logs {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: var(--input-bg);
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Diagnostic results */
.diagnostic-results {
    max-width: 800px;
}

.diagnostic-section {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.diagnostic-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.diagnostic-section p {
    margin: 5px 0;
    font-size: 14px;
}

.diagnostic-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.diagnostic-section li {
    margin: 5px 0;
    font-size: 14px;
}

/* Status indicators */
.status-ok {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

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

/* Performance results */
.performance-results {
    max-width: 600px;
}

.performance-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.performance-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.performance-section p {
    margin: 8px 0;
    font-size: 14px;
}

.performance-section strong {
    color: #007bff;
    font-weight: bold;
}

/* Responsive design for admin */
@media (max-width: 768px) {
    .admin-actions {
        gap: 8px;
    }
    
    .admin-actions button {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .diagnostic-section {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .diagnostic-section h4 {
        font-size: 15px;
    }
    
    .diagnostic-section p {
        font-size: 13px;
    }
} 

/* ===== STYLES POUR LA GESTION DES CATÉGORIES ===== */

.category-form-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.category-form-container h4 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 18px;
}

.categories-list-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.categories-list-container h4 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 18px;
}

.categories-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.categories-list {
    min-height: 200px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.category-logo {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.category-details h5 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 16px;
}

.category-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.category-type.commun {
    background: #d4edda;
    color: #155724;
}

.category-type.romain {
    background: #fff3cd;
    color: #856404;
}

.category-type.magali {
    background: #f8d7da;
    color: #721c24;
}

.category-type.personal_prorata {
    background: #e2e3e5;
    color: #383d41;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.category-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.category-actions .edit-btn {
    background: #007bff;
    color: white;
}

.category-actions .edit-btn:hover {
    background: #0056b3;
}

.category-actions .disable-btn {
    background: #ffc107;
    color: #212529;
}

.category-actions .disable-btn:hover {
    background: #e0a800;
}

.category-actions .delete-btn {
    background: #dc3545;
    color: white;
}

.category-actions .delete-btn:hover {
    background: #c82333;
}

.category-order {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* ===== SÉLECTEUR D'EMOJIS ===== */

.logo-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.logo-selector input {
    flex: 1;
}

.btn-emoji {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-emoji:hover {
    background: #5a6268;
    transform: scale(1.05);
}

/* ===== CATALOGUE D'EMOJIS ===== */

.emoji-catalog-content {
    max-width: 600px;
    max-height: 80vh;
}

.emoji-search {
    margin-bottom: 20px;
}

.emoji-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.emoji-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.emoji-category-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.emoji-category-btn:hover {
    background: var(--border-color);
}

.emoji-category-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.emoji-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: var(--border-color);
    border-color: #007bff;
    transform: scale(1.1);
}

/* ===== FORM ACTIONS ===== */

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Responsive pour les catégories */
@media (max-width: 768px) {
    .category-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .category-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .category-actions {
        justify-content: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .emoji-categories {
        justify-content: center;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .emoji-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* ===== AUTO-REFRESH DASHBOARD PWA ===== */
.dashboard-refresh-control {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.dashboard-refresh-control .auto-refresh-label {
    margin: 0;
    font-size: 0.85em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-refresh-control input[type="checkbox"] {
    margin: 0;
    transform: scale(0.9);
}

/* Responsive pour le contrôle auto-refresh */
@media (max-width: 768px) {
    .dashboard-refresh-control {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
        text-align: center;
    }
}

/* ===== NOTIFICATIONS PUSH PWA ===== */
.notification-control {
    position: absolute;
    top: 20px;
    right: 120px; /* À gauche du contrôle auto-refresh */
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.notification-label {
    margin: 0;
    font-size: 0.85em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.notification-label input[type="checkbox"] {
    margin: 0;
    transform: scale(0.9);
}

/* Animation pour les notifications */
@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive pour le contrôle des notifications */
@media (max-width: 768px) {
    .notification-control {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
        text-align: center;
    }
    
    .dashboard-header {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* ===== INSTRUCTIONS NOTIFICATIONS MOBILE PWA ===== */
.mobile-notification-instructions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.instructions-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.instructions-content h4 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.instructions-content p {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.instructions-content ol {
    text-align: left;
    margin: 20px 0;
    padding-left: 20px;
}

.instructions-content li {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.4;
}

.instructions-content strong {
    color: #667eea;
}

.chrome-mobile-solution {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.chrome-mobile-solution h5 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1em;
}

.chrome-mobile-solution ol {
    margin: 10px 0;
    padding-left: 20px;
}

.chrome-mobile-solution li {
    margin-bottom: 8px;
    color: #856404;
}

.alternative-solution {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.alternative-solution h5 {
    color: #0c5460;
    margin-bottom: 10px;
    font-size: 1em;
}

.alternative-solution ul {
    margin: 10px 0;
    padding-left: 20px;
}

.alternative-solution li {
    margin-bottom: 8px;
    color: #0c5460;
}

/* Erreurs de notifications */
.notification-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.error-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive pour les instructions */
@media (max-width: 480px) {
    .instructions-content {
        padding: 20px;
        margin: 10px;
    }
    
    .notification-error {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ===== PARAMÈTRES NOTIFICATIONS PWA ===== */
.notifications-config {
    margin-top: 20px;
}

.notification-option {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    border-left: 4px solid var(--btn-primary);
}

.notification-checkbox,
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-checkbox input[type="checkbox"],
.checkbox input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
    cursor: pointer;
}

.notification-option small {
    display: block;
    margin-top: 8px;
    margin-left: 28px;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.4;
}

.notification-test-section {
    margin-top: 30px;
    padding: 20px;
    background: #e8f4fd;
    border-radius: 10px;
    border-left: 4px solid #17a2b8;
    text-align: center;
}

.notification-test-section h4 {
    color: #17a2b8;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.notification-test-section small {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Styles pour la section de diagnostic */
.diagnostic-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    text-align: center;
}

.diagnostic-section h5 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 1em;
}

.diagnostic-link {
    display: inline-block;
    text-decoration: none;
    margin: 5px 0;
    transition: transform 0.2s ease;
}

.diagnostic-link:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Styles pour la section de test mobile */
.mobile-test-section {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    text-align: center;
}

.mobile-test-section h5 {
    margin: 0 0 10px 0;
    color: #155724;
    font-size: 1em;
}

.mobile-test-link {
    display: inline-block;
    text-decoration: none;
    margin: 5px 0;
    transition: transform 0.2s ease;
}

.mobile-test-link:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Styles pour les outils de diagnostic dans Outils Système */
.diagnostic-tools {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.diagnostic-tools .diagnostic-link {
    display: block;
    margin: 15px 0;
    padding: 12px 20px;
    background: #007bff;
    color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.diagnostic-tools .diagnostic-link:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.diagnostic-tools small {
    display: block;
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.85em;
    text-align: center;
}

/* Animation pour les checkboxes */
.notification-checkbox input[type="checkbox"]:checked + .checkmark,
.checkbox input[type="checkbox"]:checked + .checkmark {
    color: #667eea;
}

/* Responsive pour les paramètres notifications */
@media (max-width: 768px) {
    .notification-option {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .notification-checkbox,
    .checkbox {
        font-size: 0.95em;
    }
    
    .notification-option small {
        margin-left: 24px;
        font-size: 0.85em;
    }
}

/* ===== STYLES POUR LE MENU FORMULES & CALCULS ===== */

/* Headers des sections formules */
.formules-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.formules-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
}

.formules-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.formules-content {
    max-width: 1200px;
    margin: 0 auto;
}

.formule-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.formule-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 2px solid var(--btn-primary);
    padding-bottom: 10px;
}

/* Prorata grid */
.prorata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.prorata-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.prorata-card:hover {
    border-color: var(--btn-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.prorata-card h4 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.prorata-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--btn-primary);
}

/* Table des formules */
.formules-table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.formules-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
}

.formules-table th {
    background: var(--btn-primary);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.formules-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    line-height: 1.5;
}

.formules-table tr:hover {
    background: var(--border-color);
}

.formules-table code {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--btn-primary);
    font-weight: 500;
}

.formules-table strong {
    color: var(--btn-primary);
}

.formules-table small {
    color: var(--text-secondary);
    font-style: italic;
    display: block;
    margin-top: 2px;
}

/* Calculs détaillés */
.calculs-detail-container {
    margin-top: 15px;
}

.calculs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.calcul-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.calcul-card:hover {
    border-color: var(--btn-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.calcul-card h4 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.calcul-value {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

.calcul-value.positive {
    color: var(--balance-positive);
}

.calcul-value.negative {
    color: var(--balance-negative);
}

.calcul-card small {
    color: var(--text-secondary);
    font-style: italic;
}

/* Compte commun */
.compte-commun-container {
    margin-top: 15px;
}

.compte-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.compte-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.compte-card:hover {
    border-color: var(--balance-positive);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.compte-card h4 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.compte-value {
    font-size: 1.8em;
    font-weight: bold;
}

.compte-value.positive {
    color: var(--balance-positive);
}

.compte-value.negative {
    color: var(--balance-negative);
}

/* Documentation des catégories */
.categories-doc-container {
    margin-top: 20px;
}

.category-doc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--btn-primary);
}

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

.category-doc-header h4 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.category-type-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-type-badge.commun {
    background: rgba(40, 167, 69, 0.2);
}

.category-type-badge.personnel {
    background: rgba(255, 193, 7, 0.2);
}

.category-type-badge.prorata {
    background: rgba(108, 117, 125, 0.2);
}

.category-doc-content {
    padding: 20px;
}

.category-doc-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-primary);
}

.category-doc-content code {
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #d63384;
    font-weight: 500;
}

.category-example {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.category-example h5 {
    color: var(--btn-primary);
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
}

.category-example ul {
    margin: 0;
    padding-left: 20px;
}

.category-example li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
}

.category-example strong {
    color: var(--btn-primary);
    font-weight: 600;
}

/* Résumé des catégories */
.categories-summary {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
}

.categories-summary h4 {
    color: var(--btn-primary);
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
}

.categories-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.categories-summary-table th {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.categories-summary-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.categories-summary-table tr:hover {
    background: var(--border-color);
}

.categories-summary-table strong {
    color: var(--btn-primary);
}

/* Responsive pour les formules */
@media (max-width: 768px) {
    .formules-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .formules-header h2 {
        font-size: 1.8em;
    }
    
    .formule-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .prorata-grid,
    .calculs-grid,
    .compte-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .formules-table {
        font-size: 0.9em;
    }
    
    .formules-table th,
    .formules-table td {
        padding: 10px 8px;
    }
    
    .calcul-value,
    .compte-value {
        font-size: 1.5em;
    }
    
    .category-doc-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .category-doc-content {
        padding: 15px;
    }
    
    .category-example {
        padding: 12px;
    }
    
    .categories-summary {
        padding: 15px;
    }
    
    .categories-summary-table {
        font-size: 0.85em;
    }
    
    .categories-summary-table th,
    .categories-summary-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .formules-header h2 {
        font-size: 1.5em;
    }
    
    .formule-section h3 {
        font-size: 1.2em;
    }
    
    .prorata-value {
        font-size: 1.5em;
    }
    
    .calcul-value,
    .compte-value {
        font-size: 1.3em;
    }
    
    .formules-table-container {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .category-doc-card {
        margin-bottom: 20px;
    }
    
    .category-doc-header {
        padding: 12px 15px;
    }
    
    .category-doc-header h4 {
        font-size: 1.1em;
    }
    
    .category-type-badge {
        font-size: 0.75em;
        padding: 4px 8px;
    }
}

/* ===== STYLES POUR LE SYSTÈME DE CHANGEMENT DE MOIS ===== */

.month-change-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

.month-change-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-in-out;
}

.month-change-header {
    text-align: center;
    margin-bottom: 25px;
    color: white;
    position: relative;
}

.month-change-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.month-close-btn {
    position: absolute;
    top: 0;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.month-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Bouton mode sombre */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--btn-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    background: var(--btn-primary-hover);
    box-shadow: 0 6px 20px var(--shadow);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

/* Popup Virement Partiel */
.virement-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.virement-modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.virement-modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px var(--shadow);
    position: relative;
    animation: slideUp 0.3s ease;
}

.virement-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.virement-modal-header h3 {
    color: var(--text-primary);
    font-size: 24px;
    margin: 0;
}

.virement-close-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.virement-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.virement-info {
    background: linear-gradient(135deg, var(--btn-primary), var(--btn-primary-hover));
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    color: white;
    text-align: center;
}

.virement-info .dette-totale {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.virement-info .montant-total {
    font-size: 36px;
    font-weight: bold;
}

.virement-form-group {
    margin-bottom: 25px;
}

.virement-form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
}

.virement-amount-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    text-align: center;
    transition: all 0.3s ease;
}

.virement-amount-input:focus {
    outline: none;
    border-color: var(--btn-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.virement-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.virement-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.virement-btn-valider {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
}

.virement-btn-valider:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.virement-btn-annuler {
    background: var(--border-color);
    color: var(--text-primary);
}

.virement-btn-annuler:hover {
    background: var(--text-secondary);
    color: white;
}

.virement-reste {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.virement-reste strong {
    color: #ff9800;
    font-size: 18px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.month-title {
    font-size: 22px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.month-change-body {
    background: var(--input-bg);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.info-text {
    text-align: center;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.prorata-form {
    margin-top: 25px;
}

.prorata-form .form-group {
    margin-bottom: 20px;
}

.prorata-form label {
    display: block;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
}

.prorata-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.prorata-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.prorata-total {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 10px;
    font-size: 18px;
    line-height: 1.8;
}

.prorata-total span {
    font-weight: bold;
    font-size: 20px;
    transition: color 0.3s ease;
}

.help-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 15px;
    line-height: 1.5;
}

.month-change-footer {
    text-align: center;
    margin-bottom: 15px;
}

.btn-validate-month {
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.btn-validate-month:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.5);
}

.btn-validate-month:active {
    transform: translateY(0);
}

.warning-text {
    text-align: center;
    font-size: 13px;
    color: #ffeb3b;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Animation pour le modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Styles pour l'historique prorata */
.prorata-history {
    padding: 20px;
}

.prorata-history h3 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.history-table th,
.history-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.history-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.history-table tbody tr:hover {
    background: #f0f0f0;
}

.history-table .no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .month-change-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .month-change-header h2 {
        font-size: 24px;
    }
    
    .month-title {
        font-size: 18px;
    }
    
    .btn-validate-month {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .history-table {
        font-size: 14px;
    }
    
    .history-table th,
    .history-table td {
        padding: 8px 4px;
    }
}

/* ===== CENTRE DE NOTIFICATIONS ===== */
/* Bouton cloche symétrique au hamburger */
.notification-toggle {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1002 !important; /* Au-dessus de tout */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Empêcher tout décalage */
    margin: 0;
    padding: 0;
    transform: translate(0, 0);
}

.notification-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.notification-toggle:active {
    transform: scale(0.95);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Panneau de notifications */
.notifications-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
}

.notifications-panel.show {
    right: 0;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.notifications-header h3 {
    margin: 0;
    font-size: 20px;
}

.btn-close-notifications {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-notifications:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.notifications-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.btn-mark-all-read,
.btn-clear-all {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mark-all-read {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-mark-all-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-clear-all {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-clear-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Item de notification */
.notification-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.notification-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.notification-item:hover::before {
    width: 8px;
}

.notification-item.unread {
    background: linear-gradient(to right, #f8f9ff, white);
    border-color: #667eea;
}

.notification-item.unread::before {
    width: 6px;
}

.notification-header-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.notification-type.info {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.notification-type.success {
    background: linear-gradient(135deg, #56ab2f, #a8e063);
    color: white;
}

.notification-type.warning {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.notification-time {
    font-size: 12px;
    color: #6c757d;
}

.notification-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.notification-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    margin-left: 10px;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .notification-toggle {
        top: 15px !important;
        right: 15px !important;
        width: 45px;
        height: 45px;
        font-size: 20px;
        /* Force la position même sur mobile */
        position: fixed !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .notifications-panel {
        width: 100vw;
        right: -100vw;
    }
}