[x-cloak] { display: none !important; }
/* ===== VARIABLES CSS ===== */
:root {
    /* Thème clair (par défaut) - Palette vert forêt & émeraude */
    --primary: #166534;          /* Vert forêt profond */
    --primary-light: #16A34A;    /* Vert vif */
    --primary-dark: #14532D;     /* Vert foncé */
    --secondary: #0D9488;        /* Vert océan/teal */
    --secondary-light: #14B8A6;  /* Teal clair */
    --accent: #CA8A04;           /* Or miel */
    --accent-light: #EAB308;     /* Or clair */
    --danger: #B91C1C;           /* Rouge rubis */
    --success: #15803D;          /* Vert émeraude */
    --warning: #C2410C;          /* Orange cuivré */
    
    /* Couleurs de texte */
    --text-dark: #1C1917;        /* Gris foncé */
    --text-light: #57534E;       /* Gris moyen */
    --text-white: #FAFAF9;       /* Blanc cassé */
    
    /* Arrière-plans */
    --bg-light: #F7F7F5;         /* Vert très pâle */
    --bg-white: #FFFFFF;         /* Blanc pur */
    --bg-sidebar: #1E293B;       /* Ardoise foncée */
    --bg-card: #FFFFFF;          /* Blanc pour cartes */
    --bg-alt: #F5F5F4;           /* Pierre naturelle */
    
    /* Bordures et ombres */
    --border: #D6D3D1;           /* Gris clair */
    --border-light: #E7E5E4;     /* Gris très clair */
    --shadow: 0 4px 6px -1px rgba(22, 101, 52, 0.08), 0 2px 4px -1px rgba(22, 101, 52, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(22, 101, 52, 0.1), 0 4px 6px -2px rgba(22, 101, 52, 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;
    
    /* Direction par défaut */
    --direction: ltr;
}

/* Variables du thème sombre */
.dark-mode {
    --primary: #16A34A;          /* Vert vif */
    --primary-light: #22C55E;    /* Vert lime */
    --primary-dark: #15803D;     /* Vert forêt */
    --secondary: #0D9488;        /* Teal */
    --secondary-light: #14B8A6;  /* Teal clair */
    --accent: #EAB308;           /* Or */
    --accent-light: #FACC15;     /* Jaune doré */
    --danger: #EF4444;           /* Rouge clair */
    --success: #22C55E;          /* Vert lime */
    --warning: #FB923C;          /* Orange */
    
    --text-dark: #F5F5F4;        /* Gris très clair */
    --text-light: #A8A29E;       /* Gris moyen clair */
    --text-white: #FAFAF9;       /* Blanc cassé */
    
    --bg-light: #0C0A09;         /* Noir profond */
    --bg-white: #171615;         /* Gris très foncé */
    --bg-sidebar: #1C1917;       /* Brun foncé */
    --bg-card: #292524;          /* Gris foncé chaud */
    --bg-alt: #44403C;           /* Gris moyen foncé */
    
    --border: #57534E;           /* Gris foncé */
    --border-light: #44403C;     /* 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);
}

/* ===== BASE RTL/LTR ===== */
html[dir="rtl"] {
    --direction: rtl;
}

html[dir="ltr"] {
    --direction: ltr;
}

body {
    direction: var(--direction);
    text-align: var(--direction) === 'rtl' ? right : left;
}

/* ===== 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 - RTL SUPPORT ===== */
.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);
}

/* Position sidebar selon direction */
html[dir="ltr"] .sidebar {
    left: 0;
    right: auto;
}

html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
    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;
}

html[dir="rtl"] .logo {
    flex-direction: row-reverse;
}

.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);
    flex-shrink: 0;
}

.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;
}

html[dir="rtl"] .nav-item {
    flex-direction: row-reverse;
}

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

html[dir="ltr"] .nav-item:hover {
    --translate-hover: 3px;
}

html[dir="rtl"] .nav-item:hover {
    --translate-hover: -3px;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.2), rgba(202, 138, 4, 0.15));
    font-weight: 600;
}

/* Bordure active selon direction */
html[dir="ltr"] .nav-item.active {
    border-left: 3px solid var(--accent);
    border-right: none;
}

html[dir="rtl"] .nav-item.active {
    border-right: 3px solid var(--accent);
    border-left: none;
}

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

html[dir="ltr"] .nav-item.active::before {
    left: 0;
    right: auto;
}

html[dir="rtl"] .nav-item.active::before {
    right: 0;
    left: auto;
}

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

.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;
}

html[dir="rtl"] .profile-box {
    flex-direction: row-reverse;
}

.profile-info {
    min-width: 0;
    flex-grow: 1;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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;
    flex-shrink: 0;
}

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

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

html[dir="rtl"] .sidebar-actions {
    flex-direction: row-reverse;
}

/* ===== THEME : bouton icône seule ===== */
.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;
    color: var(--accent-light);
    flex-shrink: 0;
}

.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);
    flex-shrink: 0;
}

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

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

/* ===== LANG SWITCH (Flag + Button + Menu) - RTL SUPPORT ===== */
.lang-switch{
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bouton texte cliquable */
.lang-btn{
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    user-select: none;
}

html[dir="rtl"] .lang-btn {
    flex-direction: row-reverse;
}

.lang-btn:hover{
    background: rgba(255,255,255,0.09);
}

.lang-label{
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .2px;
}

.lang-caret{
    font-size: 12px;
    opacity: .85;
    transition: transform .15s ease;
}

/* Etat ouvert */
.lang-switch.open .lang-caret{
    transform: rotate(180deg);
}

/* Menu déroulant */
.lang-menu{
    position: absolute;
    min-width: 210px;
    background: rgba(20,20,20,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    padding: 8px;
    display: none;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

/* Position selon direction */
html[dir="ltr"] .lang-menu {
    left: calc(100% + 10px);
    right: auto;
    top: 50%;
    transform: translateY(-50%);
}

html[dir="rtl"] .lang-menu {
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    transform: translateY(-50%);
}

.lang-switch.open .lang-menu{
    display: block;
}

.lang-item{
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .lang-item {
    text-align: right;
    flex-direction: row-reverse;
}

.lang-item:hover{
    background: rgba(255,255,255,0.08);
}

.lang-item.active{
    background: rgba(255,255,255,0.10);
    outline: 1px solid rgba(255,255,255,0.12);
}

/* Conteneur du drapeau (badge) */
.lang-flag-wrap{
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
}

/* Image drapeau à l'intérieur */
.lang-flag{
    width: 26px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    user-select: none;
    image-rendering: -webkit-optimize-contrast;
}

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

/* Marges selon direction */
html[dir="ltr"] .main-content {
    margin-left: var(--sidebar-width);
    margin-right: 0;
}

html[dir="rtl"] .main-content {
    margin-right: var(--sidebar-width);
    margin-left: 0;
}

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

html[dir="rtl"] .header {
    flex-direction: row-reverse;
}

.header-title h1 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.header-title p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.25rem;
    text-align: var(--direction) === 'rtl' ? right : left;
}

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

html[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

.search-bar {
    position: relative;
}

.search-bar input {
    padding: 0.7rem 1rem;
    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);
}

/* Padding icône selon direction */
html[dir="ltr"] .search-bar input {
    padding-left: 2.5rem;
}

html[dir="rtl"] .search-bar input {
    padding-right: 2.5rem;
}

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

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

/* Position icône selon direction */
html[dir="ltr"] .search-bar i {
    left: 1rem;
    right: auto;
}

html[dir="rtl"] .search-bar i {
    right: 1rem;
    left: auto;
}

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

html[dir="rtl"] .user-profile {
    flex-direction: row-reverse;
}

.user-profile:hover {
    background-color: rgba(22, 101, 52, 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);
    flex-shrink: 0;
}

.user-info {
    line-height: 1.3;
    text-align: var(--direction) === 'rtl' ? right : left;
}

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

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

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

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

html[dir="rtl"] .section-title {
    flex-direction: row-reverse;
}

.section-title h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    font-weight: 700;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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);
}

html[dir="rtl"] .stat-card {
    flex-direction: row-reverse;
}

.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);
    flex-shrink: 0;
}

.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, #166534, #16A34A);
}

.stat-info {
    flex-grow: 1;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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;
}

html[dir="rtl"] .stat-change {
    flex-direction: row-reverse;
}

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

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

/* ===== TABLE SECTION - RTL SUPPORT ===== */
.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;
}

html[dir="rtl"] .table-header {
    flex-direction: row-reverse;
}

.table-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    font-weight: 700;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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);
}

html[dir="rtl"] .btn {
    flex-direction: row-reverse;
}

.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(22, 101, 52, 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;
}

html[dir="rtl"] th {
    text-align: right;
}

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

html[dir="rtl"] td {
    text-align: right;
}

tbody tr:hover {
    background-color: rgba(22, 101, 52, 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;
}

html[dir="rtl"] .member-name {
    flex-direction: row-reverse;
}

.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;
    flex-shrink: 0;
}

.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(21, 128, 61, 0.1);
    color: var(--success);
    border: 1px solid rgba(21, 128, 61, 0.2);
}

.dark-mode .status-active {
    background-color: rgba(34, 197, 94, 0.15);
}

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

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

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

html[dir="rtl"] .actions-cell {
    flex-direction: row-reverse;
}

.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);
    flex-shrink: 0;
}

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

/* ===== CHART SECTION - RTL SUPPORT ===== */
.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(22, 101, 52, 0.05) 0%, rgba(202, 138, 4, 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(22, 101, 52, 0.2) 0%, rgba(202, 138, 4, 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 - RTL SUPPORT ===== */
.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;
}

.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;
    flex-shrink: 0;
}

.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);
}

html[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
}

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

/* Position selon direction */
html[dir="ltr"] .resize-handle {
    right: 6px;
    left: auto;
}

html[dir="rtl"] .resize-handle {
    left: 6px;
    right: auto;
}

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

/* Position selon direction */
html[dir="ltr"] .resize-handle::before {
    right: 2px;
    bottom: 2px;
    left: auto;
}

html[dir="rtl"] .resize-handle::before {
    left: 2px;
    bottom: 2px;
    right: auto;
    transform: rotate(90deg);
}

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

/* Position selon direction */
html[dir="ltr"] .resize-handle::after {
    right: 6px;
    bottom: 6px;
    left: auto;
}

html[dir="rtl"] .resize-handle::after {
    left: 6px;
    bottom: 6px;
    right: auto;
    transform: rotate(90deg);
}

.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;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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);
    text-align: var(--direction) === 'rtl' ? right : left;
}

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

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

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

/* ===== SIDE PANEL COMPONENT STYLES - RTL SUPPORT ===== */
.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;
    height: 100vh;
    background-color: var(--bg-white);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    border: 1px solid var(--border);

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

/* Position selon direction */
html[dir="ltr"] .side-panel {
    right: 0;
    left: auto;
    box-shadow: -5px 0 25px rgba(22, 101, 52, 0.1);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
}

html[dir="rtl"] .side-panel {
    left: 0;
    right: auto;
    box-shadow: 5px 0 25px rgba(22, 101, 52, 0.1);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
}

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

html[dir="ltr"] .side-panel-overlay.active .side-panel {
    transform: translateX(0);
}

html[dir="rtl"] .side-panel-overlay.active .side-panel {
    transform: translateX(0);
}

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

/* Position selon direction */
html[dir="ltr"] .panel-handle {
    left: -20px;
    right: auto;
    border-radius: 8px 0 0 8px;
}

html[dir="rtl"] .panel-handle {
    right: -20px;
    left: auto;
    border-radius: 0 8px 8px 0;
}

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

html[dir="ltr"] .panel-handle:hover {
    left: -24px;
}

html[dir="rtl"] .panel-handle:hover {
    right: -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);
}

html[dir="rtl"] .side-panel-header {
    flex-direction: row-reverse;
}

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

html[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

.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);
    flex-shrink: 0;
}

.side-panel-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    font-weight: 700;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.panel-subtitle {
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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;
}

html[dir="rtl"] .section-title {
    flex-direction: row-reverse;
}

.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;
    min-height: 24px;
}

html[dir="ltr"] .checkbox-label {
    padding-left: 35px;
    padding-right: 0;
}

html[dir="rtl"] .checkbox-label {
    padding-right: 35px;
    padding-left: 0;
}

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

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

html[dir="ltr"] .checkmark {
    left: 0;
    right: auto;
}

html[dir="rtl"] .checkmark {
    right: 0;
    left: auto;
}

.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;
}

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

html[dir="rtl"] .checkbox-label .checkmark:after {
    right: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(-135deg);
}

/* 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);
}

html[dir="rtl"] .side-panel-footer {
    flex-direction: row-reverse;
}

/* ===== 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;
}

html[dir="rtl"] .app-loader-box {
    flex-direction: row-reverse;
}

.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;
    flex-shrink: 0;
}

.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);
}

/* ===== SCROLL DISCRET POUR SIDE PANEL - RTL SUPPORT ===== */
.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) - RTL SUPPORT ===== */
.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;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

html[dir="ltr"] .data-table th {
    text-align: left;
}

html[dir="rtl"] .data-table th {
    text-align: right;
}

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

html[dir="ltr"] .data-table td {
    text-align: left;
}

html[dir="rtl"] .data-table td {
    text-align: right;
}

.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(22, 101, 52, 0.03);
}

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

/* Colonne Actions */
.td-actions { 
    vertical-align: middle; 
    white-space: nowrap;
}

.actions-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

html[dir="ltr"] .actions-wrap {
    justify-content: flex-end;
}

html[dir="rtl"] .actions-wrap {
    justify-content: flex-start;
}

/* 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;
    min-width: 140px;
}

html[dir="ltr"] .table-actions {
    justify-content: flex-end;
}

html[dir="rtl"] .table-actions {
    justify-content: flex-start;
}

/* 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;
    flex-shrink: 0;
}

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

/* ===== STYLES POUR LES TRANSACTIONS - RTL SUPPORT ===== */
.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:before {
    transform: translateX(20px);
}

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

/* 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;
}

html[dir="rtl"] .toggle-label {
    flex-direction: row-reverse;
}

.toggle-label:hover {
    border-color: var(--accent);
    background: rgba(22, 101, 52, 0.03);
}

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

html[dir="rtl"] .toggle-label .toggle-text {
    flex-direction: row-reverse;
}

.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(21, 128, 61, 0.1);
    color: var(--success);
    border: 1px solid rgba(21, 128, 61, 0.2);
}

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

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

/* ===== MODALES DE DÉTAIL - RTL SUPPORT ===== */
.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;
    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;
}

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

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

/* 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);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

html[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

.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);
    text-align: var(--direction) === 'rtl' ? right : left;
}

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

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: var(--direction) === 'rtl' ? right : left;
}

.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;
}

.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;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-align: center;
}

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

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

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

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

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

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

.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);
}

/* 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;
}

html[dir="rtl"] .modal-btn {
    flex-direction: row-reverse;
}

.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(22, 101, 52, 0.2);
}

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

/* Cellules des montants - FLEXIBLES */
.amount-cell {
    font-weight: 600;
    font-size: 14px;
    padding: 12px 16px;
    min-width: 140px;
    max-width: 180px;
    white-space: nowrap;
}

html[dir="ltr"] .amount-cell {
    text-align: right !important;
}

html[dir="rtl"] .amount-cell {
    text-align: left !important;
}

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

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

html[dir="ltr"] .total-cell {
    text-align: right;
}

html[dir="rtl"] .total-cell {
    text-align: left;
}

/* 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;
}

/* 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;
}

html[dir="rtl"] .table-legend {
    flex-direction: row-reverse;
}

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

html[dir="rtl"] .legend-item {
    flex-direction: row-reverse;
}

.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(34, 197, 94, 0.15);
}

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

/* ===== BACK TO TOP - RTL SUPPORT ===== */
.back-to-top {
    position: fixed;
    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(22, 101, 52, 0.2), 0 2px 4px rgba(22, 101, 52, 0.1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Position selon direction */
html[dir="ltr"] .back-to-top {
    right: 20px;
    left: auto;
}

html[dir="rtl"] .back-to-top {
    left: 20px;
    right: auto;
}

.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(22, 101, 52, 0.25), 0 4px 8px rgba(22, 101, 52, 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 - RTL SUPPORT ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

html[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

.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;
}

html[dir="rtl"] .page-link {
    flex-direction: row-reverse;
}

.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(22, 101, 52, 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;
}

html[dir="ltr"] .page-item:first-child .page-link i {
    order: -1;
}

html[dir="rtl"] .page-item:first-child .page-link i {
    order: 1;
}

html[dir="ltr"] .page-item:last-child .page-link i {
    order: 1;
}

html[dir="rtl"] .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);
}

/* 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(21, 128, 61, 0.1) !important; }
.bg-danger { background-color: rgba(185, 28, 28, 0.1) !important; }
.bg-warning { background-color: rgba(194, 65, 12, 0.1) !important; }

.dark-mode .bg-success { background-color: rgba(34, 197, 94, 0.15) !important; }
.dark-mode .bg-danger { background-color: rgba(239, 68, 68, 0.15) !important; }
.dark-mode .bg-warning { background-color: rgba(251, 146, 60, 0.15) !important; }

/* ===== TOAST BOIS SCULPTÉ - RTL SUPPORT ===== */
.floating-toast-host {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* Position selon direction */
html[dir="ltr"] .floating-toast-host {
    left: 20px;
    right: auto;
    bottom: 20px;
}

html[dir="rtl"] .floating-toast-host {
    right: 20px;
    left: auto;
    bottom: 20px;
}

.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);
    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(22, 101, 52, 0.2),
        0 4px 6px rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
    display: flex;
    gap: 14px;
    align-items: center;
    opacity: 0;
    animation: toastWoodCarve 350ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    background-image: 
        linear-gradient(135deg, transparent 49%, rgba(22, 101, 52, 0.03) 50%, transparent 51%),
        linear-gradient(45deg, transparent 49%, rgba(22, 101, 52, 0.03) 50%, transparent 51%);
    background-size: 10px 10px;
}

/* Animation direction selon RTL/LTR */
html[dir="ltr"] .floating-toast {
    transform: translateX(-18px);
}

html[dir="rtl"] .floating-toast {
    transform: translateX(18px);
    flex-direction: row-reverse;
}

.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;
    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;
    text-align: var(--direction) === 'rtl' ? right : left;
}

/* Types avec couleurs d'encadrement */
.floating-toast.success .icon-frame {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.1), rgba(34, 197, 94, 0.1));
}

.floating-toast.error .icon-frame {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.1), rgba(239, 68, 68, 0.1));
}

.floating-toast.warning .icon-frame {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(202, 138, 4, 0.1), rgba(234, 179, 8, 0.1));
}

.floating-toast.info .icon-frame {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.1), rgba(22, 163, 74, 0.1));
}

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

html[dir="ltr"] {
    --toast-start: -18px;
    --toast-mid: 3px;
    --toast-end-out: -22px;
}

html[dir="rtl"] {
    --toast-start: 18px;
    --toast-mid: -3px;
    --toast-end-out: 22px;
}

@keyframes toastWoodCarveOut {
    to { 
        opacity: 0; 
        transform: translateX(var(--toast-end-out)) 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;
}

/* Colonnes */
.td-batch { width: 50px; }
.td-actions { width: 140px; }

/* Checkbox UI */
.invoice-checkbox-wrap { display: none; cursor: pointer; }
.invoice-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.cb-ui{
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid rgba(22, 101, 52, 0.35);
    background: var(--bg-white);
    display: inline-block;
    position: relative;
}
.invoice-checkbox:checked + .cb-ui{
    background: rgba(22, 101, 52, 0.12);
    border-color: rgba(22, 101, 52, 0.7);
}
.invoice-checkbox:checked + .cb-ui::after{
    content: "";
    position: absolute;
    border: solid rgba(22, 101, 52, 1);
    border-width: 0 2px 2px 0;
}

html[dir="ltr"] .invoice-checkbox:checked + .cb-ui::after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    transform: rotate(45deg);
}

html[dir="rtl"] .invoice-checkbox:checked + .cb-ui::after {
    right: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    transform: rotate(-135deg);
}

/* ===== MODE NUIT : CHECKBOX ===== */
html.dark-mode .cb-ui{
    background: rgba(255,255,255,0.04);
    border-color: rgba(34,197,94,0.55);
}

html.dark-mode .invoice-checkbox:checked + .cb-ui{
    background: rgba(34,197,94,0.25);
    border-color: rgba(34,197,94,0.9);
}

html.dark-mode .invoice-checkbox:checked + .cb-ui::after{
    border-color: rgba(220,252,231,1);
}

/* Wrapper actions */
.row-actions{
    position: relative;
    display: flex;
    align-items: center;
}

html[dir="ltr"] .row-actions {
    justify-content: flex-end;
}

html[dir="rtl"] .row-actions {
    justify-content: flex-start;
}

/* Bouton menu */
.action-menu-btn{
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, box-shadow .12s ease;
}
.action-menu-btn:hover{
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Menu */
.action-menu{
    position: absolute;
    top: calc(100% + 8px);
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    z-index: 9999;
}

/* Position selon direction */
html[dir="ltr"] .action-menu {
    right: 0;
    left: auto;
}

html[dir="rtl"] .action-menu {
    left: 0;
    right: auto;
}

.action-menu.open{ display: block; }

.menu-item{
    width: 100%;
    padding: 10px 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

html[dir="rtl"] .menu-item {
    flex-direction: row-reverse;
    text-align: right;
}

.menu-item:hover{ background: var(--bg-light); }
.menu-item.danger{ color: #b91c1c; }
.menu-item.danger:hover{ background: rgba(185,28,28,.08); }

.action-menu.is-fixed{
  position: fixed !important;
  z-index: 999999 !important;
}


.type-proforma{
  background: rgba(245,158,11,.12);
  color:#b45309;
  border:1px solid rgba(245,158,11,.25);
}
.type-devis{
  background: rgba(59,130,246,.12);
  color:#1d4ed8;
  border:1px solid rgba(59,130,246,.25);
}

/* Couleur par défaut (optionnel) */
.status-badge i { color: inherit; }

/* Couleurs spécifiques des icônes */
.status-badge.badge-certified i { color: #16a34a; } /* vert */
.status-badge.badge-pending   i { color: #f59e0b; } /* orange */
.status-badge.badge-error     i { color: #dc2626; } /* rouge */
.status-badge.badge-ready     i { color: #3b82f6; } /* bleu */
.status-badge.badge-draft     i { color: #9ca3af; } /* gris */

/* Members header */
.members-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 6px 0 24px;
    margin-bottom: 16px;
}

html[dir="rtl"] .members-header {
    flex-direction: row-reverse;
}

/* ===== SCROLL DES MODALES - RTL SUPPORT ===== */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    text-align: var(--direction) === 'rtl' ? right : left;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

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

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

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

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

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

/* ===== RESPONSIVE - RTL SUPPORT ===== */
@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;
    }
    
    html[dir="rtl"] .logo {
        flex-direction: row;
    }
    
    .nav-item {
        padding: 0.85rem;
        justify-content: center;
    }
    
    html[dir="rtl"] .nav-item {
        flex-direction: row;
    }
    
    .main-content {
        margin-left: 70px;
        margin-right: 0;
    }
    
    html[dir="rtl"] .main-content {
        margin-right: 70px;
        margin-left: 0;
    }
    
    .search-bar input {
        width: 200px;
    }
    
    .profile-box {
        justify-content: center;
        padding: 0.75rem;
    }
    
    html[dir="rtl"] .profile-box {
        flex-direction: row;
    }
    
    .profile-logout-btn {
        width: 42px;
        height: 42px;
    }
    
    .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) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    html[dir="rtl"] .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    html[dir="rtl"] .header-actions {
        flex-direction: row-reverse;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    html[dir="rtl"] .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .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;
    }
    
    html[dir="rtl"] .header-content {
        flex-direction: column;
    }
    
    .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;
    }
    
    .table-view-container {
        overflow-x: auto;
    }
    
    .funds-data-table {
        min-width: 600px;
    }
    
    .account-column,
    .amount-cell {
        min-width: 100px;
        max-width: 130px;
    }
    
    .funds-data-table .sticky-column {
        min-width: 120px;
        max-width: 160px;
    }
    
    .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;
    }
    
    /* 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;
    }
}

@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;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 0.375rem;
        font-size: 0.8rem;
    }
}

/* ====== PANEL DETAILS FACTURE : ORGANISATION PRO ====== */

.invoice-detail-section{
  padding: 14px 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.invoice-detail-section h4{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
}

/* ✅ La grille qui range les cartes */
.invoice-info-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ✅ Les cartes d’info */
.invoice-info-card{
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-alt);
  border-radius: var(--radius);
  min-width: 0;
}

.invoice-info-label{
  display:block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.invoice-info-value{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 700;
}

/* ✅ Responsive : si panel trop étroit => 1 colonne */
@media (max-width: 560px){
  .invoice-info-grid{
    grid-template-columns: 1fr;
  }
}

/* ====== Table articles un peu plus clean dans panel ====== */
.invoice-articles-table{
  width:100%;
  border-collapse: collapse;
}
.invoice-articles-table th{
  text-align:left;
  font-size: 12px;
  color: var(--text-light);
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border-light);
}
.invoice-articles-table td{
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

