
[x-cloak] { display: none !important; }
/* ===== VARIABLES CSS ===== */
:root {
    /* Thème clair (par défaut) - Palette église */
    --primary: #8B4513;          /* Marron chaleureux */
    --primary-light: #A0522D;    /* Marron clair */
    --primary-dark: #654321;     /* Marron foncé */
    --secondary: #2E8B57;        /* Vert sapin */
    --secondary-light: #3CB371;  /* Vert moyen */
    --accent: #B8860B;           /* Or doré */
    --accent-light: #DAA520;     /* Or clair */
    --danger: #8B0000;           /* Rouge bordeaux */
    --success: #228B22;          /* Vert forêt */
    --warning: #CD853F;          /* Terre cuite */
    
    /* Couleurs de texte */
    --text-dark: #2F4F4F;        /* Gris ardoise foncé */
    --text-light: #696969;       /* Gris moyen */
    --text-white: #FAF9F6;       /* Blanc cassé */
    
    /* Arrière-plans */
    --bg-light: #F5F5F5;         /* Gris très clair */
    --bg-white: #FFFFFF;         /* Blanc pur */
    --bg-sidebar: #2F4F4F;       /* Ardoise foncée */
    --bg-card: #FFFFFF;          /* Blanc pour cartes */
    --bg-alt: #F6F3EE;        /* Bleu très pâle */
    
    /* Bordures et ombres */
    --border: #D3D3D3;           /* Gris clair */
    --border-light: #E8E8E8;     /* Gris très clair */
    --shadow: 0 4px 6px -1px rgba(139, 69, 19, 0.08), 0 2px 4px -1px rgba(139, 69, 19, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(139, 69, 19, 0.1), 0 4px 6px -2px rgba(139, 69, 19, 0.05);
    
    /* Rayons */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    /* Transition pour changement de thème */
    --transition: all 0.3s ease;
}

/* Variables du thème sombre */
.dark-mode {
    --primary: #D2691E;          /* Marron chaud */
    --primary-light: #DEB887;    /* Beige bois */
    --primary-dark: #8B4513;     /* Marron classique */
    --secondary: #20B2AA;        /* Vert mer clair */
    --secondary-light: #3CB371;  /* Vert medium */
    --accent: #FFD700;           /* Or vif */
    --accent-light: #F0E68C;     /* Kaki doré */
    --danger: #FF6B6B;           /* Rouge corail */
    --success: #32CD32;          /* Vert lime */
    --warning: #FFA500;          /* Orange */
    
    --text-dark: #E8E8E8;        /* Gris très clair */
    --text-light: #B0B0B0;       /* Gris moyen */
    --text-white: #FAF9F6;       /* Blanc cassé */
    
    --bg-light: #121212;         /* Noir profond */
    --bg-white: #1A1A1A;         /* Gris très foncé */
    --bg-sidebar: #1E2A3A;       /* Bleu ardoise foncé */
    --bg-card: #252525;          /* Gris foncé */
    --bg-alt: #2D2D2D;           /* Gris moyen foncé */
    
    --border: #404040;           /* Gris foncé */
    --border-light: #333333;     /* Gris très foncé */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ✅ Empêche le reset de casser les animations des composants overlay */
.modal-overlay,
.modal,
.app-loader,
.app-loader * {
    transition: none !important;
}



body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
    transition: var(--transition);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    height: 100vh;
    position: fixed;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-white);
}

.logo-text span {
    color: var(--accent-light);
    font-weight: 800;
}

.nav-menu {
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    color: var(--text-white);
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(184, 134, 11, 0.15));
    border-left: 3px solid var(--accent);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: var(--accent);
}

.nav-icon {
    width: 20px;
    text-align: center;
    color: var(--accent-light);
    font-size: 1.1rem;
}

.nav-text {
    font-size: 0.95rem;
    color: var(--text-white);
}

/* ===== Profil dans sidebar ===== */
.profile-box {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-info {
    min-width: 0;
    flex-grow: 1;
}

.profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    margin-top: 3px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-logout-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.profile-logout-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

/* ===== Sidebar actions : Theme + Langue ===== */
/* ===== Sidebar actions : Theme + Langue + SIMY ===== */
.sidebar-actions {
    margin-top: auto;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== THEME : bouton icône seule (mêmes couleurs que tes autres boutons) ===== */
.theme-toggle {
    width: 52px;
    height: 46px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;

    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* ✅ assure une couleur correcte même si FA/texte hérite ailleurs */
    color: var(--accent-light);
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle i {
    font-size: 1.1rem;
    line-height: 1;
}

/* ===== LANGUE : drapeau ===== */
.lang-toggle {
    width: 52px;
    height: 46px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;

    background-color: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s;
    color: var(--text-white);
}

.lang-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.lang-toggle .flag {
    font-size: 18px;
    line-height: 1;
}

/* ===== SIMY : même style que langue (inactif) ===== */
.simy-toggle {
    /* ✅ au lieu d'une largeur fixe */
    flex: 1;
    min-width: 0;

    height: 46px;
    border-radius: var(--radius);
    border: none;
    cursor: default;

    background-color: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s;
    color: var(--text-white);
}

.simy-toggle .simy-label{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.simy-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.simy-toggle .simy-label {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.6px;
}


/* ===== MAIN CONTENT ===== */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    max-width: calc(100vw - var(--sidebar-width));
    transition: var(--transition);
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.header-title h1 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-title p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-bar {
    position: relative;
}

.search-bar input {
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    width: 250px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background-color: var(--bg-white);
    color: var(--text-dark);
    box-shadow: var(--shadow);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: rgba(139, 69, 19, 0.05);
}

.dark-mode .user-profile:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.user-info {
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===== STATS CARDS ===== */
.stats-section {
    margin-bottom: 2.5rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-light);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon.members {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.stat-icon.donations {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
}

.stat-icon.events {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
}

.stat-icon.groups {
    background: linear-gradient(135deg, #8B4513, #A0522D);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat-change {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ===== TABLE SECTION ===== */
.table-section {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-light);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--bg-alt);
    border-bottom: 2px solid var(--border);
}

th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tbody tr:hover {
    background-color: rgba(139, 69, 19, 0.03);
}

.dark-mode tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.member-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.status-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background-color: rgba(34, 139, 34, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 139, 34, 0.2);
}

.dark-mode .status-active {
    background-color: rgba(50, 205, 50, 0.15);
}

.status-inactive {
    background-color: rgba(139, 0, 0, 0.1);
    color: var(--danger);
    border: 1px solid rgba(139, 0, 0, 0.2);
}

.dark-mode .status-inactive {
    background-color: rgba(255, 107, 107, 0.15);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.icon-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== CHART SECTION ===== */
.chart-section {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.chart-container {
    height: 300px;
    margin-top: 1.5rem;
    position: relative;
}

.chart-placeholder {
    background: linear-gradient(180deg, rgba(139, 69, 19, 0.05) 0%, rgba(184, 134, 11, 0.05) 100%);
    border-radius: var(--radius);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    border: 2px dashed var(--accent-light);
}

.dark-mode .chart-placeholder {
    background: linear-gradient(180deg, rgba(139, 69, 19, 0.2) 0%, rgba(184, 134, 11, 0.2) 100%);
    border-color: var(--accent);
    color: var(--accent-light);
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    color: var(--accent);
}


/* ===== FOOTER ===== */
.footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: center;
}

/* ===== MODAL COMPONENT STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; 
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1; 
    visibility: visible; 
    backdrop-filter: blur(4px);
   
}


.modal {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 50%;
    max-width: 500px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 400px;
    min-height: 300px;
    position: relative;
    border: 1px solid var(--border-light);
}


.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    background-color: var(--bg-card);
    user-select: none;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: var(--bg-card);
}

/* Resize handle */

/* Resize handle - Style ornementé */
.resize-handle {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.resize-handle::before {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    border-radius: 0 0 4px 0;
}

.resize-handle::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, 
        transparent 50%, 
        var(--accent-light) 50%);
    border-radius: 2px;
}

.modal:hover .resize-handle {
    opacity: 1;
}


/* Form styles for modal */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: var(--bg-white);
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* ===== SIDE PANEL COMPONENT STYLES ===== */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

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

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background-color: var(--bg-white);
    box-shadow: -5px 0 25px rgba(139, 69, 19, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    border-left: 1px solid var(--border);

    border-top-left-radius: var(--radius-lg);  
    border-bottom-left-radius: var(--radius-lg);
}

.dark-mode .side-panel {
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
}

.side-panel-overlay.active .side-panel {
    transform: translateX(0);
}

/* Panel handle for dragging */
.panel-handle {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 100px;
    background: var(--primary);
    border-radius: 8px 0 0 8px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1002;
}

.panel-handle:hover {
    background: var(--primary-dark);
    width: 24px;
    left: -24px;
}

.handle-dots {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.handle-dots span {
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
}

/* Panel header */
.side-panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: var(--bg-card);

    border-top-left-radius: var(--radius-lg);
}

.header-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.panel-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.side-panel-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.panel-subtitle {
    color: var(--text-light);
    font-size: 0.85rem;
}

.side-panel-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--bg-white);
}

/* Form sections */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.section-title i {
    color: var(--accent);
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    position: relative;
    padding-left: 35px;
    min-height: 24px;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-label:hover input ~ .checkmark {
    border-color: var(--accent);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Panel footer */
.side-panel-footer {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: var(--bg-card);

    border-bottom-left-radius: var(--radius-lg);
}

/* ===== Loader interne ===== */
.app-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.app-loader.is-active {
    opacity: 1;
    pointer-events: auto;
}

.app-loader-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dark-mode .app-loader-box {
    background: var(--bg-card);
}

.app-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--accent);
    animation: appSpin 0.7s linear infinite;
}

.dark-mode .app-spinner {
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent);
}

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

.app-loader-text {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
        padding: 1.5rem 0.5rem;
        align-items: center;
    }
    
    .logo-text, .nav-text, .profile-name, .profile-role {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding: 0;
    }
    
    .nav-item {
        padding: 0.85rem;
        justify-content: center;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .search-bar input {
        width: 200px;
    }
    
    .profile-box {
        justify-content: center;
        padding: 0.75rem;
    }
    
    .profile-logout-btn {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .test-buttons {
        flex-direction: column;
    }
    
    .modal {
        width: 95%;
        max-height: 90vh;
        min-width: unset;
        max-width: unset;
    }
    
    .side-panel {
        width: 100%;
        max-width: 100vw;
    }
    
    .panel-handle {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ===== SCROLL DISCRET POUR SIDE PANEL ===== */
.side-panel-body {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

/* Webkit Scrollbar (Chrome, Safari, Edge) */
.side-panel-body::-webkit-scrollbar {
    width: 6px;
}

.side-panel-body::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.side-panel-body::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
    transition: background 0.2s;
}

.side-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* Dark mode scrollbar */
.dark-mode .side-panel-body::-webkit-scrollbar-thumb {
    background: var(--accent-light);
}

.dark-mode .side-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Empêche header et footer de bouger */
.side-panel-header,
.side-panel-footer {
    flex-shrink: 0;
}


/* =========================================================
   TABLES + EMPTY STATE (GLOBAL - pages Paramètres / Finances)
   À placer EN FIN de fichier pour écraser les tables génériques
========================================================= */

/* Conteneur tableau */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

/* Table "design" */
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.data-table thead {
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border);
}

.data-table th {
    padding: 18px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 18px 20px;
    font-size: 14px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(139, 69, 19, 0.03);
}

.dark-mode .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Pagination */
.pagination-wrapper {
    margin-top: 24px;
    padding: 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    text-align: center;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
    margin-top: 20px;
}

.empty-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 20px;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Actions tableau */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    min-width: 140px;
}

/* Icon buttons (version tableau) */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.icon-btn:hover {
    transform: translateY(-2px);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== STYLES POUR LES TRANSACTIONS (AJOUTS) ===== */

/* Toggle switch pour récurrence */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: .3s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
    background-color: var(--primary);
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Mode sombre pour toggle */
.dark-mode .switch-slider {
    background-color: #4b5563;
}

.dark-mode .switch-toggle input:checked + .switch-slider {
    background-color: var(--accent);
}

/* Animation pour les champs qui apparaissent/disparaissent */
.recurrence-fields {
    animation: fadeIn 0.3s ease;
    margin-top: 12px;
}

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

/* Style pour le label toggle */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.toggle-label:hover {
    border-color: var(--accent);
    background: rgba(139, 69, 19, 0.03);
}

.toggle-label .toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.amount-positive {
    color: var(--success) !important;
}

.amount-negative {
    color: var(--danger) !important;
}

/* Classes pour les statuts de transaction */
.status-brouillon {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.status-en_attente {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.status-valide {
    background: rgba(34, 139, 34, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 139, 34, 0.2);
}

.status-rejete {
    background: rgba(139, 0, 0, 0.08);
    color: var(--danger);
    border: 1px solid rgba(139, 0, 0, 0.15);
}

.icon-btn.action-submit:hover {
    background: #ffc107;
    color: white;
    border-color: #ffc107;
}


/* ===================== MODALES DE DÉTAIL ===================== */

/* Overlay des modales */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000 !important;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
    opacity: 1 !important;
    visibility: visible !important;
}

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

/* Conteneur de la modale */
.modal {
    background: var(--bg-card) !important; /* Utilise vos variables */
    border-radius: var(--radius-lg);
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1 !important;
    visibility: visible !important;
}

.dark-mode .modal {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* En-tête de la modale */
.modal-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card) !important;
    cursor: move;
    color: var(--text-dark);
}

.dark-mode .modal-header {
    background: var(--bg-card) !important;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--primary-dark);
}

.dark-mode .modal-title {
    color: var(--text-dark);
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
}

.dark-mode .modal-subtitle {
    color: var(--text-light);
}

/* Corps de la modale */
.modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    background: var(--bg-card) !important;
}

.dark-mode .modal-body {
    background: var(--bg-card) !important;
}

/* Pied de page de la modale */
.modal-footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-light) !important;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.dark-mode .modal-footer {
    background: var(--bg-light) !important;
    border-top: 1px solid var(--border);
}

/* Style spécifique pour modale solde global */
.modal-balance-total {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-light));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.dark-mode .modal-balance-total {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-light));
    border: 1px solid var(--border);
}

.modal-balance-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.dark-mode .modal-balance-label {
    color: var(--text-light);
}

.modal-balance-amount {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.dark-mode .modal-balance-amount {
    color: var(--text-dark);
}

.modal-balance-currency {
    font-size: 1.125rem;
    color: var(--text-light);
}

.dark-mode .modal-balance-currency {
    color: var(--text-light);
}

/* Cartes de compte dans la modale */
.modal-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.modal-account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.dark-mode .modal-account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.modal-account-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.account-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.dark-mode .account-name {
    color: var(--text-dark);
}

.account-number {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.dark-mode .account-number {
    color: var(--text-light);
}

.account-amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
}

.account-percentage {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.dark-mode .account-percentage {
    color: var(--text-light);
}

.account-progress {
    height: 6px;
    background: var(--bg-light);
    border-radius: 50px;
    overflow: hidden;
}

.dark-mode .account-progress {
    background: var(--bg-light);
}

.account-progress-bar {
    height: 100%;
    border-radius: 50px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--primary); /* Couleur par défaut */
}

/* Modale en construction */
.modal-construction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    text-align: center;
}

.construction-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--accent);
}

.construction-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.dark-mode .construction-title {
    color: var(--text-dark);
}

.construction-text {
    font-size: 0.9375rem;
    color: var(--text-light);
    max-width: 400px;
    line-height: 1.6;
}

.dark-mode .construction-text {
    color: var(--text-light);
}

/* Boutons dans les modales */
.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.modal-btn-secondary {
       background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.modal-btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(139, 69, 19, 0.25);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .modal {
        width: 95vw !important;
        height: 90vh !important;
        max-width: 95vw;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.25rem;
    }
    
    .modal-balance-amount {
        font-size: 2.25rem;
    }
    
    .modal-accounts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-balance-amount {
        font-size: 2rem;
    }
    
    .modal-construction {
        padding: 2rem 1.5rem;
    }
    
    .construction-icon {
        font-size: 3rem;
    }
    
    .construction-title {
        font-size: 1.25rem;
    }
}

/* ===== TABLEAU AVANCÉ (pour le tableau des fonds) ===== */

/* Conteneur avec header */
.table-view-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Header du tableau */
.table-header-section {
    margin-bottom: 1.5rem;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.table-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Scroll horizontal */
.table-scroll-container {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

/* Colonnes fixes */
.sticky-column {
    position: sticky;
    background: var(--bg-card);
    z-index: 10;
}

.sticky-column:first-child {
    left: 0;
    border-right: 1px solid var(--border);
}

.sticky-column.right-column {
    right: 0;
    border-left: 1px solid var(--border);
}

.sticky-header {
    white-space: nowrap;
}

/* ===== TABLEAU AVANCÉ (pour le tableau des fonds) - VERSION CORRIGÉE ===== */

/* ===== TABLEAU SANS SCROLL - VERSION FLEXIBLE ===== */

/* Conteneur avec header */
.table-view-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow: visible; /* Changé: hidden → visible */
}

/* Header du tableau */
.table-header-section {
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.table-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* SUPPRIME cette classe (pas de scroll container) */
/*
.table-scroll-container {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
    position: relative;
}
*/

/* Tableau principal - SANS largeur minimale fixe */
.funds-data-table {
    width: 100%;
    border-collapse: collapse;
    /* SUPPRIME: min-width: 800px; */
    table-layout: auto; /* Changé: fixed → auto pour flexibilité */
}

/* En-têtes et cellules */
.funds-data-table th,
.funds-data-table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    box-sizing: border-box;
}

.funds-data-table thead th {
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    white-space: nowrap;
}

/* Colonnes fixes - moins large */
.funds-data-table .sticky-column {
    position: sticky;
    background: var(--bg-card);
    z-index: 20;
    min-width: 160px; /* Réduit: 200px → 160px */
    max-width: 200px; /* Réduit: 250px → 200px */
    left: 0;
    border-right: 1px solid var(--border);
}

.funds-data-table .sticky-column.right-column {
    right: 0;
    left: auto;
    border-left: 1px solid var(--border);
    border-right: none;
    min-width: 100px; /* Réduit: 120px → 100px */
}

/* Colonnes des comptes - FLEXIBLES */
.funds-data-table .account-column {
    min-width: 140px; /* Réduit: 180px → 140px */
    max-width: 180px; /* Réduit la max */
    width: auto; /* S'adapte au contenu */
    text-align: center;
}

.account-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
}

.account-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 4px;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-number {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Lignes de fonds */


.fund-row:hover {
    background-color: rgba(139, 69, 19, 0.03);
}

.fund-info-cell {
    white-space: nowrap;
    padding-right: 15px; /* Réduit: 20px → 15px */
}

.fund-code-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.fund-code-badge.active {
    background: rgba(34, 139, 34, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 139, 34, 0.2);
}

.fund-code-badge.inactive {
    background: rgba(139, 0, 0, 0.1);
    color: var(--danger);
    border: 1px solid rgba(139, 0, 0, 0.2);
}

.fund-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fund-manager {
    font-size: 0.75rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cellules des montants - FLEXIBLES */
.amount-cell {
    text-align: right !important;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 16px;
    min-width: 140px; /* Réduit: 180px → 140px */
    max-width: 180px;
    white-space: nowrap;
}

.zero-amount {
    color: var(--text-light);
    font-style: italic;
}

.total-cell {
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 16px;
    white-space: nowrap;
}

/* Ligne des totaux */
.totals-row {
    background-color: var(--bg-alt);
    font-weight: 700;
    border-top: 2px solid var(--border);
}

.total-header-cell {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px; /* Ajouté pour alignement */
}

/* Légende */
.table-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    padding: 1.5rem 0.25rem 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-badge.active {
    background-color: var(--success);
}

.legend-badge.inactive {
    background-color: var(--danger);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.positive {
    background-color: var(--success);
}

.legend-color.negative {
    background-color: var(--danger);
}

.legend-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Dark mode */
.dark-mode .fund-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.dark-mode .fund-code-badge.active {
    background: rgba(50, 205, 50, 0.15);
}

.dark-mode .fund-code-badge.inactive {
    background: rgba(255, 107, 107, 0.15);
}

/* Correction spécifique pour l'alignement vertical */
.funds-data-table tbody tr {
    height: 60px;
}

.funds-data-table tbody td {
    vertical-align: middle;
}

/* Responsive - adapté pour pas de scroll */
@media (max-width: 1024px) {
    .table-view-container {
        padding: 1rem;
    }
    
    .funds-data-table th,
    .funds-data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .account-column,
    .amount-cell {
        min-width: 120px;
        max-width: 150px;
    }
    
    .funds-data-table .sticky-column {
        min-width: 140px;
        max-width: 180px;
    }
    
    .funds-data-table .sticky-column.right-column {
        min-width: 90px;
    }
}

@media (max-width: 768px) {
    /* À partir de 768px, on peut ajouter un scroll si vraiment nécessaire */
    .table-view-container {
        overflow-x: auto; /* Scroll seulement si vraiment trop étroit */
    }
    
    .funds-data-table {
        min-width: 600px; /* Largeur minimale pour mobile */
    }
    
    .account-column,
    .amount-cell {
        min-width: 100px;
        max-width: 130px;
    }
    
    .funds-data-table .sticky-column {
        min-width: 120px;
        max-width: 160px;
    }
}



/* =====================
   BACK TO TOP - Minimal Flottant
===================== */

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;

    width: 48px;
    height: 48px;
    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: var(--text-white);

    border: none;
    box-shadow: 
        0 6px 18px rgba(139, 69, 19, 0.2),
        0 2px 4px rgba(139, 69, 19, 0.1);
    
    cursor: pointer;

    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;

    transition: all 0.3s ease;
}

.back-to-top i {
    font-size: 18px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 
        0 10px 25px rgba(139, 69, 19, 0.25),
        0 4px 8px rgba(139, 69, 19, 0.15);
    animation: none;
}

.back-to-top:hover i {
    transform: translateY(-5px) scale(1.1);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* Dark mode */
html.dark-mode .back-to-top {
    background: var(--primary);
    box-shadow: 
        0 6px 18px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

html.dark-mode .back-to-top:hover {
    background: var(--primary-light);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-dark);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.page-link:hover {
    background-color: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(139, 69, 19, 0.2);
}

.page-item.disabled .page-link {
    background-color: var(--bg-alt);
    color: var(--text-light);
    border-color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-item.disabled .page-link:hover {
    transform: none;
    background-color: var(--bg-alt);
    border-color: var(--border-light);
}

/* Style spécifique pour "Previous" et "Next" */
.page-item:first-child .page-link,
.page-item:last-child .page-link {
    min-width: 100px;
    gap: 0.5rem;
}

.page-item:first-child .page-link i {
    order: -1;
}

.page-item:last-child .page-link i {
    order: 1;
}

/* Mode sombre */
.dark-mode .page-link {
    background-color: var(--bg-card);
    border-color: var(--border);
    color: var(--text-dark);
}

.dark-mode .page-link:hover {
    background-color: var(--bg-alt);
    border-color: var(--accent);
    color: var(--accent-light);
}

.dark-mode .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--accent);
}

.dark-mode .page-item.disabled .page-link {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .page-link {
        min-width: 34px;
        height: 34px;
        font-size: 0.85rem;
        padding: 0 0.5rem;
    }
    
    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 0.375rem;
        font-size: 0.8rem;
    }
    
    /* Masquer le texte sur mobile, garder juste les icônes */
    .page-item:first-child .page-link span:not(.sr-only),
    .page-item:last-child .page-link span:not(.sr-only) {
        display: none;
    }
    
    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        min-width: 38px;
        width: 38px;
        padding: 0;
    }
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(139, 69, 19, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(139, 69, 19, 0.2);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Classes utilitaires pour les couleurs */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

.bg-success { background-color: rgba(34, 139, 34, 0.1) !important; }
.bg-danger { background-color: rgba(139, 0, 0, 0.1) !important; }
.bg-warning { background-color: rgba(205, 133, 63, 0.1) !important; }

.dark-mode .bg-success { background-color: rgba(50, 205, 50, 0.15) !important; }
.dark-mode .bg-danger { background-color: rgba(255, 107, 107, 0.15) !important; }
.dark-mode .bg-warning { background-color: rgba(255, 165, 0, 0.15) !important; }

/* ===================== TOAST MINIMALISTE ===================== */

.members-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 6px 0 24px;
    margin-bottom: 16px;
}
/* ===================== TOAST VITRAIL ===================== */
/* ===================== TOAST BOIS SCULPTÉ ===================== */
.floating-toast-host {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.floating-toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 340px;
    padding: 12px 14px;
    border-radius: 12px;
    
    background: var(--bg-card);
    border: 2px solid var(--border);
    
    /* Effet relief bois */
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 6px 20px rgba(139, 69, 19, 0.2),
        0 4px 6px rgba(0, 0, 0, 0.05);
    
    color: var(--text-dark);
    
    display: flex;
    gap: 14px;
    align-items: center;
    
    opacity: 0;
    transform: translateX(-18px);
    animation: toastWoodCarve 350ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    
    /* Texture bois subtile */
    background-image: 
        linear-gradient(135deg, 
            transparent 49%, 
            rgba(139, 69, 19, 0.03) 50%, 
            transparent 51%),
        linear-gradient(45deg, 
            transparent 49%, 
            rgba(139, 69, 19, 0.03) 50%, 
            transparent 51%);
    background-size: 10px 10px;
}

.floating-toast.out {
    animation: toastWoodCarveOut 250ms ease forwards;
}

/* Icône dans un cadre sculpté */
.floating-toast .icon-frame {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    position: relative;
    flex-shrink: 0;
    
    /* Effet encadrement sculpté */
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.floating-toast .icon-frame i {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.floating-toast .text { 
    font-size: 0.9rem; 
    line-height: 1.3;
    font-weight: 600;
}

/* Types avec couleurs d'encadrement */
.floating-toast.success .icon-frame {
    border-color: var(--success);
    background: linear-gradient(135deg, 
        rgba(34, 139, 34, 0.1), 
        rgba(60, 179, 113, 0.1));
}

.floating-toast.error .icon-frame {
    border-color: var(--danger);
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.1), 
        rgba(178, 34, 34, 0.1));
}

.floating-toast.warning .icon-frame {
    border-color: var(--accent);
    background: linear-gradient(135deg, 
        rgba(184, 134, 11, 0.1), 
        rgba(218, 165, 32, 0.1));
}

.floating-toast.info .icon-frame {
    border-color: var(--primary);
    background: linear-gradient(135deg, 
        rgba(139, 69, 19, 0.1), 
        rgba(160, 82, 45, 0.1));
}

/* Animations de sculpture */
@keyframes toastWoodCarve {
    0% { 
        opacity: 0; 
        transform: translateX(-18px) scale(0.8);
        filter: brightness(1.5);
    }
    60% { 
        transform: translateX(3px) scale(1.05);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
        filter: brightness(1);
    }
}

@keyframes toastWoodCarveOut {
    to { 
        opacity: 0; 
        transform: translateX(-22px) scale(0.85);
        filter: blur(2px);
    }
}

/* ===== DRAGGABLE MODAL STYLES ===== */
.modal.draggable {
    position: fixed !important;
    margin: 0;
}

.modal.draggable .modal-header {
    cursor: move;
    user-select: none;
}

.modal.draggable.dragging {
    opacity: 0.9;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* S'assurer que le resize-handle est visible sur les modales draggables */
.modal.draggable .resize-handle {
    display: block;
}