/**
 * DesignBudget — Template CSS principal
 * Application Budget Manager — Design system complet
 *
 * @package     DesignBudget
 * @version     3.0.0
 * @author      i-FormaSite
 * @license     GNU GPL v3
 *
 * TABLE DES MATIERES :
 * A) Reset et base
 * B) Variables CSS (tokens du design system)
 * C) Typographie
 * D) Layout principal
 * E) Sidebar
 * F) Bottom navigation
 * G) Cartes
 * H) Listes de transactions
 * I) Formulaires
 * J) Boutons
 * K) Badges
 * L) Alertes et toasts
 * M) Skeleton loading
 * N) Responsive breakpoints
 * O) Page de connexion
 * P) Utilitaires
 * Q) Accessibilité
 * R) Graphiques
 * S) Surcharges Joomla
 * T) Tableaux
 * U-1) Filtres
 * U-2) Etat vide
 * U-3) Pagination
 * U-4) Lien texte avec chevron
 * U-5) Grille tableau de bord / Stats
 * U-6) Actions rapides
 * U-7) Carte — Titre
 * U-8) Formulaire — Champ montant
 * U-9) Formulaire — Checkbox
 * U-10) Tableau responsive (alias)
 * U-11) Overlay generique
 * U-12) Header — Bouton hamburger
 * U-13) Wizard fiscal
 * U-14) Membre du foyer
 * U-15) Avatar
 * U-16) Pastille couleur
 * U) Impression
 */


/* ============================================
   A) RESET ET BASE
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--bm-text-primary);
    background-color: var(--bm-bg-app);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

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

ul,
ol {
    list-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}


/* ============================================
   B) VARIABLES CSS — Tokens du design system
   ============================================ */

:root {
    /* Couleurs principales */
    --bm-primary: #6366F1;
    --bm-primary-light: #818CF8;
    --bm-primary-dark: #4F46E5;
    --bm-primary-bg: rgba(99, 102, 241, 0.1);

    /* Couleurs sémantiques */
    --bm-success: #10B981;
    --bm-success-bg: rgba(16, 185, 129, 0.1);
    --bm-warning: #F59E0B;
    --bm-warning-bg: rgba(245, 158, 11, 0.1);
    --bm-danger: #EF4444;
    --bm-danger-bg: rgba(239, 68, 68, 0.1);
    --bm-info: #3B82F6;
    --bm-info-bg: rgba(59, 130, 246, 0.1);

    /* Surfaces — Mode clair */
    --bm-bg-app: #F8FAFC;
    --bm-bg-card: #FFFFFF;
    --bm-bg-input: #F1F5F9;
    --bm-border: #E2E8F0;

    /* Textes */
    --bm-text-primary: #0F172A;
    --bm-text-secondary: #64748B;
    --bm-text-muted: #94A3B8;
    --bm-text-inverse: #FFFFFF;

    /* Espacements */
    --bm-space-xs: 4px;
    --bm-space-sm: 8px;
    --bm-space-md: 16px;
    --bm-space-lg: 24px;
    --bm-space-xl: 32px;
    --bm-space-2xl: 48px;

    /* Rayons de bordure */
    --bm-radius-sm: 8px;
    --bm-radius-md: 12px;
    --bm-radius-lg: 16px;
    --bm-radius-xl: 24px;
    --bm-radius-full: 9999px;

    /* Ombres */
    --bm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --bm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --bm-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --bm-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Transitions */
    --bm-transition: 0.2s ease;
    --bm-transition-slow: 0.3s ease;

    /* Dimensions de la sidebar */
    --bm-sidebar-width: 240px;
    --bm-sidebar-collapsed-width: 64px;

    /* Dimensions bottom nav */
    --bm-bottomnav-height: 64px;

    /* Dimensions header */
    --bm-header-height: 60px;

    /* Z-index */
    --bm-z-sidebar: 100;
    --bm-z-header: 90;
    --bm-z-bottomnav: 100;
    --bm-z-fab: 101;
    --bm-z-overlay: 150;
    --bm-z-panel: 160;
    --bm-z-toast: 200;
}

/* Mode sombre */
[data-theme="dark"] {
    --bm-bg-app: #0F172A;
    --bm-bg-card: #1E293B;
    --bm-bg-input: #334155;
    --bm-border: #475569;
    --bm-text-primary: #F1F5F9;
    --bm-text-secondary: #94A3B8;
    --bm-text-muted: #64748B;
    --bm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --bm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --bm-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --bm-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
}


/* ============================================
   C) TYPOGRAPHIE
   ============================================ */

h1, .bm-h1 {
    font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--bm-text-primary);
}

h2, .bm-h2 {
    font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--bm-text-primary);
}

h3, .bm-h3 {
    font-size: clamp(1.0625rem, 1.2vw + 0.3rem, 1.25rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--bm-text-primary);
}

h4, .bm-h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--bm-text-primary);
}

p {
    margin-bottom: var(--bm-space-md);
    color: var(--bm-text-secondary);
}

small, .bm-small {
    font-size: 0.75rem;
    line-height: 1.5;
}

.bm-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bm-text-secondary);
}

/* Montants avec chiffres tabulaires */
.bm-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.bm-amount--income {
    color: var(--bm-success);
}

.bm-amount--expense {
    color: var(--bm-danger);
}

.bm-amount--neutral {
    color: var(--bm-text-primary);
}

.bm-tabular {
    font-variant-numeric: tabular-nums;
}


/* ============================================
   D) LAYOUT PRINCIPAL
   ============================================ */

.bm-app {
    display: flex;
    min-height: 100vh;
    background-color: var(--bm-bg-app);
}

/* Page de connexion — pas de layout app */
.bm-app--login {
    display: block;
}

/* Contenu principal */
.bm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    /* Mobile : pas de marge (sidebar masquée) */
    margin-left: 0;
    /* Espace pour bottom nav sur mobile */
    padding-bottom: var(--bm-bottomnav-height);
    transition: margin-left var(--bm-transition-slow);
}

/* Header sticky */
.bm-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--bm-header-height);
    padding: 0 var(--bm-space-md);
    background-color: rgba(248, 250, 252, 0.85);
    border-bottom: 1px solid var(--bm-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: var(--bm-z-header);
    transition: background-color var(--bm-transition);
}

[data-theme="dark"] .bm-header {
    background-color: rgba(15, 23, 42, 0.85);
}

.bm-header__left {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
}

.bm-header__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-sm);
    color: var(--bm-text-primary);
    transition: background-color var(--bm-transition);
}

.bm-header__menu-btn:hover {
    background-color: var(--bm-bg-input);
}

.bm-header__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bm-text-primary);
    margin: 0;
}

.bm-header__right {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
}

.bm-header__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-full);
    color: var(--bm-text-secondary);
    transition: all var(--bm-transition);
}

.bm-header__action:hover {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}

.bm-header__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--bm-radius-full);
    background-color: var(--bm-primary);
    color: var(--bm-text-inverse);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--bm-transition);
}

.bm-header__avatar:hover {
    transform: scale(1.05);
}

/* Zone contenu */
.bm-content {
    flex: 1;
    padding: var(--bm-space-md);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}


/* ============================================
   E) SIDEBAR
   ============================================ */

.bm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--bm-sidebar-width);
    background-color: var(--bm-bg-card);
    border-right: 1px solid var(--bm-border);
    z-index: var(--bm-z-sidebar);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--bm-transition-slow), transform var(--bm-transition-slow);
    /* Mobile : masquée par défaut */
    transform: translateX(-100%);
}

/* Sidebar visible sur mobile (ouverte via JS) */
.bm-sidebar--open {
    transform: translateX(0);
}

/* Logo */
.bm-sidebar__logo {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-lg) var(--bm-space-md);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bm-primary);
    border-bottom: 1px solid var(--bm-border);
    white-space: nowrap;
}

.bm-sidebar__logo i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Navigation */
.bm-sidebar__nav {
    flex: 1;
    padding: var(--bm-space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bm-sidebar__item {
    display: flex;
    align-items: center;
    gap: var(--bm-space-md);
    padding: 12px 16px;
    border-radius: var(--bm-radius-sm);
    color: var(--bm-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--bm-transition);
    min-height: 44px;
}

.bm-sidebar__item:hover {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}

.bm-sidebar__item--active {
    background-color: var(--bm-primary-bg);
    color: var(--bm-primary);
    font-weight: 600;
}

.bm-sidebar__item--active:hover {
    background-color: var(--bm-primary-bg);
    color: var(--bm-primary);
}

.bm-sidebar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex-shrink: 0;
    font-size: 1rem;
    text-align: center;
}

.bm-sidebar__label {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--bm-transition);
}

/* Séparateur */
.bm-sidebar__divider {
    border-top: 1px solid var(--bm-border);
    margin: var(--bm-space-sm) var(--bm-space-md);
}

/* Bouton toggle collapse */
.bm-sidebar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    margin: var(--bm-space-sm) var(--bm-space-md) var(--bm-space-md);
    padding: var(--bm-space-sm);
    border-radius: var(--bm-radius-sm);
    color: var(--bm-text-muted);
    transition: all var(--bm-transition);
    min-height: 44px;
}

.bm-sidebar__toggle:hover {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}

/* Sidebar réduite */
.bm-sidebar--collapsed {
    width: var(--bm-sidebar-collapsed-width);
}

.bm-sidebar--collapsed .bm-sidebar__label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.bm-sidebar--collapsed .bm-sidebar__item {
    justify-content: center;
    padding: 12px;
}

.bm-sidebar--collapsed .bm-sidebar__logo {
    justify-content: center;
    padding: var(--bm-space-lg) var(--bm-space-sm);
}

.bm-sidebar--collapsed .bm-sidebar__toggle i {
    transform: rotate(180deg);
}

/* Overlay sidebar mobile */
.bm-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--bm-z-sidebar) - 1);
    opacity: 0;
    transition: opacity var(--bm-transition-slow);
}

.bm-sidebar-overlay--visible {
    display: block;
    opacity: 1;
}


/* ============================================
   F) NAVIGATION BAS (Mobile)
   ============================================ */

.bm-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bm-bottomnav-height);
    background-color: var(--bm-bg-card);
    border-top: 1px solid var(--bm-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--bm-z-bottomnav);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bm-bottomnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding: var(--bm-space-sm) 0;
    color: var(--bm-text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--bm-transition);
    min-height: 44px;
}

.bm-bottomnav__item i {
    font-size: 1.125rem;
}

.bm-bottomnav__item--active {
    color: var(--bm-primary);
}

.bm-bottomnav__item:hover {
    color: var(--bm-primary-light);
}

.bm-bottomnav__fab-placeholder {
    width: 56px;
    flex-shrink: 0;
}

/* FAB — Bouton d'action flottant */
.bm-fab {
    position: fixed;
    bottom: calc(var(--bm-bottomnav-height) - 20px);
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: var(--bm-radius-full);
    background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark));
    color: var(--bm-text-inverse);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--bm-shadow-lg), 0 4px 16px rgba(99, 102, 241, 0.3);
    z-index: var(--bm-z-fab);
    border: 3px solid var(--bm-bg-card);
    transition: transform var(--bm-transition), box-shadow var(--bm-transition);
}

.bm-fab:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: var(--bm-shadow-xl), 0 6px 20px rgba(99, 102, 241, 0.4);
}

.bm-fab:active {
    transform: translateX(-50%) scale(0.95);
}


/* ============================================
   G) CARTES
   ============================================ */

.bm-card {
    background-color: var(--bm-bg-card);
    border-radius: var(--bm-radius-md);
    box-shadow: var(--bm-shadow-sm);
    padding: var(--bm-space-md);
    border: 1px solid var(--bm-border);
    transition: box-shadow var(--bm-transition), transform var(--bm-transition);
}

.bm-card:hover {
    box-shadow: var(--bm-shadow-md);
}

/* Carte statistique */
.bm-card--stat {
    display: flex;
    flex-direction: column;
    gap: var(--bm-space-sm);
}

.bm-card--stat .bm-card__header {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
}

.bm-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-full);
    font-size: 1rem;
    flex-shrink: 0;
}

.bm-card__icon--primary {
    background-color: var(--bm-primary-bg);
    color: var(--bm-primary);
}

.bm-card__icon--success {
    background-color: var(--bm-success-bg);
    color: var(--bm-success);
}

.bm-card__icon--danger {
    background-color: var(--bm-danger-bg);
    color: var(--bm-danger);
}

.bm-card__icon--warning {
    background-color: var(--bm-warning-bg);
    color: var(--bm-warning);
}

.bm-card__icon--info {
    background-color: var(--bm-info-bg);
    color: var(--bm-info);
}

.bm-card__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bm-text-secondary);
}

.bm-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bm-text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.bm-card__trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.bm-card__trend--up {
    color: var(--bm-success);
}

.bm-card__trend--down {
    color: var(--bm-danger);
}

/* Barre de progression */
.bm-card__progress {
    width: 100%;
    height: 6px;
    border-radius: var(--bm-radius-full);
    background-color: var(--bm-bg-input);
    overflow: hidden;
    margin-top: var(--bm-space-xs);
}

.bm-card__progress-bar {
    height: 100%;
    border-radius: var(--bm-radius-full);
    background-color: var(--bm-primary);
    transition: width var(--bm-transition-slow);
}

.bm-card__progress-bar--success {
    background-color: var(--bm-success);
}

.bm-card__progress-bar--warning {
    background-color: var(--bm-warning);
}

.bm-card__progress-bar--danger {
    background-color: var(--bm-danger);
}

/* Grille de cartes */
.bm-cards-grid {
    display: grid;
    gap: var(--bm-space-md);
    grid-template-columns: 1fr;
}

/* Carte cliquable */
.bm-card--clickable {
    cursor: pointer;
}

.bm-card--clickable:hover {
    transform: translateY(-1px);
}

.bm-card--clickable:active {
    transform: translateY(0);
}


/* ============================================
   H) LISTES DE TRANSACTIONS
   ============================================ */

.bm-transactions {
    margin: 0;
    padding: 0;
}

.bm-transactions__group {
    margin-bottom: var(--bm-space-lg);
}

.bm-transactions__date {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bm-text-muted);
    padding: var(--bm-space-sm) var(--bm-space-md);
}

.bm-transactions__list {
    background-color: var(--bm-bg-card);
    border-radius: var(--bm-radius-md);
    border: 1px solid var(--bm-border);
    overflow: hidden;
}

.bm-transactions__item {
    display: flex;
    align-items: center;
    padding: 12px var(--bm-space-md);
    gap: 12px;
    border-bottom: 1px solid var(--bm-border);
    transition: background-color var(--bm-transition);
    cursor: pointer;
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.bm-transactions__item:last-child {
    border-bottom: none;
}

.bm-transactions__item:hover {
    background-color: var(--bm-bg-input);
}

.bm-transactions__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-full);
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.bm-transactions__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.bm-transactions__description {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--bm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-transactions__meta {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-transactions__amount {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Actions swipe (masquées par défaut) */
.bm-transactions__actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
    transform: translateX(100%);
    transition: transform var(--bm-transition);
}

.bm-transactions__item--swiped .bm-transactions__actions {
    transform: translateX(0);
}

.bm-transactions__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    color: var(--bm-text-inverse);
    font-size: 1rem;
}

.bm-transactions__action-btn--edit {
    background-color: var(--bm-info);
}

.bm-transactions__action-btn--delete {
    background-color: var(--bm-danger);
}


/* ============================================
   I) FORMULAIRES
   ============================================ */

.bm-form {
    max-width: 600px;
    width: 100%;
}

.bm-form--centered {
    margin: 0 auto;
}

.bm-form__group {
    margin-bottom: var(--bm-space-md);
}

.bm-form__row {
    display: flex;
    gap: var(--bm-space-md);
}

.bm-form__row > .bm-form__group {
    flex: 1;
}

.bm-form__label {
    display: block;
    margin-bottom: var(--bm-space-xs);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bm-text-primary);
}

.bm-form__label--required::after {
    content: ' *';
    color: var(--bm-danger);
}

.bm-form__input,
.bm-form__select,
.bm-form__textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bm-bg-input);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    font-size: 0.9375rem;
    color: var(--bm-text-primary);
    transition: border-color var(--bm-transition), box-shadow var(--bm-transition);
    min-height: 44px;
}

.bm-form__input::placeholder,
.bm-form__textarea::placeholder {
    color: var(--bm-text-muted);
}

.bm-form__input:focus,
.bm-form__select:focus,
.bm-form__textarea:focus {
    border-color: var(--bm-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.bm-form__input--error,
.bm-form__select--error,
.bm-form__textarea--error {
    border-color: var(--bm-danger);
}

.bm-form__input--error:focus,
.bm-form__select--error:focus,
.bm-form__textarea--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.bm-form__select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.bm-form__textarea {
    resize: vertical;
    min-height: 100px;
}

.bm-form__error {
    display: block;
    margin-top: var(--bm-space-xs);
    font-size: 0.75rem;
    color: var(--bm-danger);
}

.bm-form__hint {
    display: block;
    margin-top: var(--bm-space-xs);
    font-size: 0.75rem;
    color: var(--bm-text-muted);
}

.bm-form__actions {
    display: flex;
    gap: var(--bm-space-sm);
    margin-top: var(--bm-space-lg);
}

/* Champ montant avec symbole monétaire */
.bm-form__amount-wrapper {
    position: relative;
}

.bm-form__amount-wrapper .bm-form__input {
    padding-right: 50px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 1.125rem;
}

.bm-form__currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bm-text-muted);
}

/* Sélecteur de catégorie visuel */
.bm-form__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--bm-space-sm);
}

.bm-form__category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bm-space-xs);
    padding: var(--bm-space-sm);
    border-radius: var(--bm-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--bm-transition);
    text-align: center;
}

.bm-form__category-item:hover {
    background-color: var(--bm-bg-input);
}

.bm-form__category-item--selected {
    border-color: var(--bm-primary);
    background-color: var(--bm-primary-bg);
}


/* ============================================
   J) BOUTONS
   ============================================ */

.bm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bm-space-sm);
    padding: 12px 24px;
    border-radius: var(--bm-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all var(--bm-transition);
    min-height: 44px;
    text-decoration: none;
}

.bm-btn:active {
    transform: scale(0.97);
}

/* Primaire */
.bm-btn--primary {
    background-color: var(--bm-primary);
    color: var(--bm-text-inverse);
}

.bm-btn--primary:hover {
    background-color: var(--bm-primary-dark);
}

/* Secondaire */
.bm-btn--secondary {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}

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

/* Danger */
.bm-btn--danger {
    background-color: var(--bm-danger);
    color: var(--bm-text-inverse);
}

.bm-btn--danger:hover {
    background-color: #DC2626;
}

/* Succès */
.bm-btn--success {
    background-color: var(--bm-success);
    color: var(--bm-text-inverse);
}

.bm-btn--success:hover {
    background-color: #059669;
}

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

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

/* Fantôme (ghost) */
.bm-btn--ghost {
    background-color: transparent;
    color: var(--bm-text-secondary);
}

.bm-btn--ghost:hover {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}

/* Tailles */
.bm-btn--sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
    min-height: 36px;
}

.bm-btn--lg {
    padding: 16px 32px;
    font-size: 1rem;
    min-height: 52px;
}

/* Pleine largeur */
.bm-btn--block {
    width: 100%;
}

/* Bouton icône seule */
.bm-btn--icon {
    width: 44px;
    height: 44px;
    padding: 0;
}

/* État désactivé */
.bm-btn:disabled,
.bm-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Bouton chargement */
.bm-btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.bm-btn--loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: bm-spin 0.6s linear infinite;
}

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


/* ============================================
   K) BADGES
   ============================================ */

.bm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--bm-radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.bm-badge--primary {
    background-color: var(--bm-primary-bg);
    color: var(--bm-primary);
}

.bm-badge--success {
    background-color: var(--bm-success-bg);
    color: var(--bm-success);
}

.bm-badge--warning {
    background-color: var(--bm-warning-bg);
    color: var(--bm-warning);
}

.bm-badge--danger {
    background-color: var(--bm-danger-bg);
    color: var(--bm-danger);
}

.bm-badge--info {
    background-color: var(--bm-info-bg);
    color: var(--bm-info);
}

.bm-badge--neutral {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-secondary);
}


/* ============================================
   L) ALERTES ET TOASTS
   ============================================ */

/* Alertes en ligne */
.bm-alert {
    padding: var(--bm-space-md);
    border-radius: var(--bm-radius-sm);
    border-left: 4px solid;
    margin-bottom: var(--bm-space-md);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: var(--bm-space-sm);
}

.bm-alert__icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.bm-alert__content {
    flex: 1;
}

.bm-alert--success {
    background-color: var(--bm-success-bg);
    border-left-color: var(--bm-success);
    color: var(--bm-success);
}

.bm-alert--warning {
    background-color: var(--bm-warning-bg);
    border-left-color: var(--bm-warning);
    color: var(--bm-warning);
}

.bm-alert--danger {
    background-color: var(--bm-danger-bg);
    border-left-color: var(--bm-danger);
    color: var(--bm-danger);
}

.bm-alert--info {
    background-color: var(--bm-info-bg);
    border-left-color: var(--bm-info);
    color: var(--bm-info);
}

/* Messages Joomla */
.alert {
    padding: var(--bm-space-md);
    border-radius: var(--bm-radius-sm);
    border-left: 4px solid;
    margin-bottom: var(--bm-space-md);
    font-size: 0.875rem;
}

.alert-success,
.alert-message {
    background-color: var(--bm-success-bg);
    border-left-color: var(--bm-success);
    color: var(--bm-success);
}

.alert-warning {
    background-color: var(--bm-warning-bg);
    border-left-color: var(--bm-warning);
    color: var(--bm-warning);
}

.alert-danger,
.alert-error {
    background-color: var(--bm-danger-bg);
    border-left-color: var(--bm-danger);
    color: var(--bm-danger);
}

.alert-info {
    background-color: var(--bm-info-bg);
    border-left-color: var(--bm-info);
    color: var(--bm-info);
}

/* Toasts / Snackbars */
.bm-toast-container {
    position: fixed;
    bottom: calc(var(--bm-bottomnav-height) + var(--bm-space-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--bm-z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--bm-space-sm);
    pointer-events: none;
    width: calc(100% - var(--bm-space-xl));
    max-width: 400px;
}

.bm-toast {
    background-color: var(--bm-text-primary);
    color: var(--bm-bg-app);
    padding: 12px 24px;
    border-radius: var(--bm-radius-md);
    box-shadow: var(--bm-shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--bm-transition), transform var(--bm-transition);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
}

.bm-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.bm-toast--success {
    background-color: var(--bm-success);
    color: #FFFFFF;
}

.bm-toast--danger {
    background-color: var(--bm-danger);
    color: #FFFFFF;
}

.bm-toast--warning {
    background-color: var(--bm-warning);
    color: #FFFFFF;
}

.bm-toast--info {
    background-color: var(--bm-info);
    color: #FFFFFF;
}

.bm-toast__close {
    margin-left: auto;
    opacity: 0.7;
    cursor: pointer;
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-toast__close:hover {
    opacity: 1;
}


/* ============================================
   M) SKELETON LOADING
   ============================================ */

.bm-skeleton {
    background-color: var(--bm-bg-input);
    border-radius: var(--bm-radius-sm);
    animation: bm-pulse 1.5s ease-in-out infinite;
}

@keyframes bm-pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.6;
    }
}

.bm-skeleton--text {
    height: 16px;
    margin-bottom: 8px;
}

.bm-skeleton--text-sm {
    height: 12px;
    width: 60%;
    margin-bottom: 8px;
}

.bm-skeleton--title {
    height: 24px;
    width: 40%;
    margin-bottom: 12px;
}

.bm-skeleton--card {
    height: 100px;
    border-radius: var(--bm-radius-md);
}

.bm-skeleton--circle {
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-full);
}

.bm-skeleton--avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--bm-radius-full);
}

.bm-skeleton--button {
    height: 44px;
    width: 120px;
    border-radius: var(--bm-radius-sm);
}

.bm-skeleton--input {
    height: 44px;
    border-radius: var(--bm-radius-sm);
}


/* ============================================
   N) RESPONSIVE — Points de rupture
   ============================================ */

/* --- Tablette (768px et plus) --- */
@media (min-width: 768px) {
    /* Afficher la sidebar en mode réduit (icônes) */
    .bm-sidebar {
        transform: translateX(0);
        width: var(--bm-sidebar-collapsed-width);
    }

    .bm-sidebar .bm-sidebar__label {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .bm-sidebar .bm-sidebar__item {
        justify-content: center;
        padding: 12px;
    }

    .bm-sidebar .bm-sidebar__logo {
        justify-content: center;
        padding: var(--bm-space-lg) var(--bm-space-sm);
    }

    .bm-sidebar__toggle {
        display: flex;
    }

    /* Décaler le contenu */
    .bm-main {
        margin-left: var(--bm-sidebar-collapsed-width);
        padding-bottom: 0;
    }

    /* Masquer la bottom nav */
    .bm-bottomnav {
        display: none;
    }

    /* Repositionner le FAB */
    .bm-fab {
        bottom: var(--bm-space-xl);
        right: var(--bm-space-xl);
        left: auto;
        transform: none;
    }

    .bm-fab:hover {
        transform: scale(1.05);
    }

    .bm-fab:active {
        transform: scale(0.95);
    }

    /* Contenu plus large */
    .bm-content {
        padding: var(--bm-space-lg);
    }

    /* Grille de cartes sur 2 colonnes */
    .bm-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Formulaire : actions non-sticky */
    .bm-form__actions {
        position: static;
        background: none;
        padding: 0;
    }

    /* Toast au-dessus du contenu */
    .bm-toast-container {
        bottom: var(--bm-space-xl);
    }
}

/* --- Bureau (1024px et plus) --- */
@media (min-width: 1024px) {
    /* Sidebar complète avec labels */
    .bm-sidebar {
        width: var(--bm-sidebar-width);
    }

    .bm-sidebar .bm-sidebar__label {
        opacity: 1;
        width: auto;
    }

    .bm-sidebar .bm-sidebar__item {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .bm-sidebar .bm-sidebar__logo {
        justify-content: flex-start;
        padding: var(--bm-space-lg) var(--bm-space-md);
    }

    /* Sidebar réduite */
    .bm-sidebar--collapsed {
        width: var(--bm-sidebar-collapsed-width);
    }

    .bm-sidebar--collapsed .bm-sidebar__label {
        opacity: 0;
        width: 0;
    }

    .bm-sidebar--collapsed .bm-sidebar__item {
        justify-content: center;
        padding: 12px;
    }

    .bm-sidebar--collapsed .bm-sidebar__logo {
        justify-content: center;
        padding: var(--bm-space-lg) var(--bm-space-sm);
    }

    .bm-sidebar--collapsed ~ .bm-main {
        margin-left: var(--bm-sidebar-collapsed-width);
    }

    /* Contenu décalé */
    .bm-main {
        margin-left: var(--bm-sidebar-width);
    }

    /* Contenu */
    .bm-content {
        padding: var(--bm-space-xl);
        max-width: 1280px;
    }

    /* Grille de cartes sur 3 colonnes */
    .bm-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Grille 4 colonnes pour stats */
    .bm-cards-grid--stats {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Header — cacher le bouton menu */
    .bm-header__menu-btn {
        display: none;
    }

    /* Header padding */
    .bm-header {
        padding: 0 var(--bm-space-xl);
    }
}

/* --- Grand bureau (1280px et plus) --- */
@media (min-width: 1280px) {
    .bm-content {
        max-width: 1400px;
    }
}

/* --- Très grand écran (1440px et plus) --- */
@media (min-width: 1440px) {
    .bm-content {
        max-width: 1600px;
        padding: var(--bm-space-xl) var(--bm-space-2xl);
    }
}

/* --- Mobile : formulaire actions sticky --- */
@media (max-width: 767px) {
    .bm-form__actions {
        position: sticky;
        bottom: var(--bm-bottomnav-height);
        background-color: var(--bm-bg-card);
        padding: var(--bm-space-md);
        margin: 0 calc(var(--bm-space-md) * -1);
        border-top: 1px solid var(--bm-border);
        z-index: 50;
    }

    .bm-form__row {
        flex-direction: column;
    }

    /* Header title plus petit sur mobile */
    .bm-header__title {
        font-size: 1rem;
    }
}


/* ============================================
   O) PAGE DE CONNEXION
   ============================================ */

.bm-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bm-primary-dark) 0%, var(--bm-primary) 50%, var(--bm-primary-light) 100%);
    padding: var(--bm-space-md);
}

.bm-login__card {
    background-color: var(--bm-bg-card);
    border-radius: var(--bm-radius-lg);
    box-shadow: var(--bm-shadow-xl);
    padding: var(--bm-space-xl) var(--bm-space-lg);
    max-width: 400px;
    width: 100%;
}

.bm-login__logo {
    text-align: center;
    margin-bottom: var(--bm-space-lg);
}

.bm-login__title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bm-text-primary);
    margin-top: var(--bm-space-sm);
    margin-bottom: 0;
}

.bm-login__subtitle {
    text-align: center;
    color: var(--bm-text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--bm-space-lg);
}

/* Surcharges formulaires Joomla pour la page login */
.bm-login .control-group {
    margin-bottom: var(--bm-space-md);
}

.bm-login .control-label label {
    display: block;
    margin-bottom: var(--bm-space-xs);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bm-text-primary);
}

.bm-login .controls input[type="text"],
.bm-login .controls input[type="password"],
.bm-login .controls input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bm-bg-input);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    font-size: 0.9375rem;
    color: var(--bm-text-primary);
    transition: border-color var(--bm-transition), box-shadow var(--bm-transition);
    min-height: 44px;
}

.bm-login .controls input:focus {
    border-color: var(--bm-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.bm-login .btn-primary,
.bm-login button[type="submit"] {
    width: 100%;
    padding: 12px 24px;
    background-color: var(--bm-primary);
    color: var(--bm-text-inverse);
    border: none;
    border-radius: var(--bm-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--bm-transition);
    min-height: 44px;
    margin-top: var(--bm-space-sm);
}

.bm-login .btn-primary:hover,
.bm-login button[type="submit"]:hover {
    background-color: var(--bm-primary-dark);
}


/* ============================================
   P) UTILITAIRES
   ============================================ */

/* Texte */
.bm-text-center { text-align: center; }
.bm-text-right { text-align: right; }
.bm-text-left { text-align: left; }
.bm-text-primary { color: var(--bm-text-primary); }
.bm-text-secondary { color: var(--bm-text-secondary); }
.bm-text-muted { color: var(--bm-text-muted); }
.bm-text-success { color: var(--bm-success); }
.bm-text-danger { color: var(--bm-danger); }
.bm-text-warning { color: var(--bm-warning); }

/* Marges verticales */
.bm-mt-xs { margin-top: var(--bm-space-xs); }
.bm-mt-sm { margin-top: var(--bm-space-sm); }
.bm-mt-md { margin-top: var(--bm-space-md); }
.bm-mt-lg { margin-top: var(--bm-space-lg); }
.bm-mt-xl { margin-top: var(--bm-space-xl); }
.bm-mb-xs { margin-bottom: var(--bm-space-xs); }
.bm-mb-sm { margin-bottom: var(--bm-space-sm); }
.bm-mb-md { margin-bottom: var(--bm-space-md); }
.bm-mb-lg { margin-bottom: var(--bm-space-lg); }
.bm-mb-xl { margin-bottom: var(--bm-space-xl); }

/* Padding */
.bm-p-sm { padding: var(--bm-space-sm); }
.bm-p-md { padding: var(--bm-space-md); }
.bm-p-lg { padding: var(--bm-space-lg); }

/* Flexbox */
.bm-flex { display: flex; }
.bm-flex--between { display: flex; justify-content: space-between; align-items: center; }
.bm-flex--center { display: flex; align-items: center; justify-content: center; }
.bm-flex--column { display: flex; flex-direction: column; }
.bm-flex--wrap { flex-wrap: wrap; }
.bm-flex--grow { flex: 1; }

/* Gaps */
.bm-gap-xs { gap: var(--bm-space-xs); }
.bm-gap-sm { gap: var(--bm-space-sm); }
.bm-gap-md { gap: var(--bm-space-md); }
.bm-gap-lg { gap: var(--bm-space-lg); }

/* Visibilité responsive */
.bm-hidden-mobile {
    display: none;
}

.bm-hidden-desktop {
    display: block;
}

@media (min-width: 768px) {
    .bm-hidden-mobile {
        display: block;
    }

    .bm-hidden-desktop {
        display: none;
    }
}

/* Lecteur d'écran uniquement */
.bm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Troncature de texte */
.bm-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dimensions */
.bm-w-full { width: 100%; }

/* Bordure arrondie */
.bm-rounded { border-radius: var(--bm-radius-md); }
.bm-rounded-full { border-radius: var(--bm-radius-full); }

/* Divider */
.bm-divider {
    border: none;
    border-top: 1px solid var(--bm-border);
    margin: var(--bm-space-md) 0;
}

/* Panneau "Plus" mobile */
.bm-more-panel {
    position: fixed;
    inset: 0;
    z-index: var(--bm-z-panel);
    pointer-events: none;
    visibility: hidden;
}

.bm-more-panel--open {
    pointer-events: auto;
    visibility: visible;
}

.bm-more-panel__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--bm-transition-slow);
}

.bm-more-panel--open .bm-more-panel__overlay {
    opacity: 1;
}

.bm-more-panel__sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bm-bg-card);
    border-radius: var(--bm-radius-lg) var(--bm-radius-lg) 0 0;
    padding: var(--bm-space-sm) var(--bm-space-md) var(--bm-space-xl);
    transform: translateY(100%);
    transition: transform var(--bm-transition-slow);
    max-height: 70vh;
    overflow-y: auto;
}

.bm-more-panel--open .bm-more-panel__sheet {
    transform: translateY(0);
}

.bm-more-panel__handle {
    width: 36px;
    height: 4px;
    border-radius: var(--bm-radius-full);
    background-color: var(--bm-border);
    margin: 0 auto var(--bm-space-md);
}

.bm-more-panel__nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--bm-space-xs);
}

.bm-more-panel__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-md);
    border-radius: var(--bm-radius-sm);
    color: var(--bm-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    transition: all var(--bm-transition);
    min-height: 44px;
}

.bm-more-panel__item i {
    font-size: 1.25rem;
}

.bm-more-panel__item:hover {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}


/* ============================================
   Q) ACCESSIBILITE
   ============================================ */

/* Outline de focus visible */
:focus-visible {
    outline: 2px solid var(--bm-primary);
    outline-offset: 2px;
}

/* Désactiver outline par défaut pour les clics souris */
:focus:not(:focus-visible) {
    outline: none;
}

/* Classe skip-link pour navigation clavier */
.bm-skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background-color: var(--bm-primary);
    color: var(--bm-text-inverse);
    padding: var(--bm-space-sm) var(--bm-space-md);
    z-index: 9999;
    font-weight: 600;
    border-radius: 0 0 var(--bm-radius-sm) 0;
}

.bm-skip-link:focus {
    top: 0;
}

/* Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Assurer un contraste minimum des liens */
a:not([class]) {
    color: var(--bm-primary);
    text-decoration: underline;
}

a:not([class]):hover {
    color: var(--bm-primary-dark);
}


/* ============================================
   R) GRAPHIQUES
   ============================================ */

.bm-chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
    .bm-chart-container {
        aspect-ratio: 16 / 9;
    }
}

.bm-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Légende personnalisée pour les graphiques */
.bm-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-md);
    margin-top: var(--bm-space-md);
    justify-content: center;
}

.bm-chart-legend__item {
    display: flex;
    align-items: center;
    gap: var(--bm-space-xs);
    font-size: 0.75rem;
    color: var(--bm-text-secondary);
}

.bm-chart-legend__color {
    width: 10px;
    height: 10px;
    border-radius: var(--bm-radius-full);
    flex-shrink: 0;
}


/* ============================================
   S) SURCHARGES JOOMLA — Messages système
   ============================================ */

#system-message-container {
    margin-bottom: var(--bm-space-md);
}

#system-message-container .alert {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
}

#system-message-container .alert .close,
#system-message-container .alert .btn-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    padding: var(--bm-space-xs);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#system-message-container .alert .close:hover,
#system-message-container .alert .btn-close:hover {
    opacity: 1;
}


/* ============================================
   T) TABLEAUX
   ============================================ */

.bm-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--bm-radius-md);
    border: 1px solid var(--bm-border);
}

.bm-table {
    width: 100%;
    font-size: 0.875rem;
}

.bm-table th {
    padding: 12px var(--bm-space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bm-text-muted);
    background-color: var(--bm-bg-input);
    border-bottom: 1px solid var(--bm-border);
    white-space: nowrap;
}

.bm-table td {
    padding: 12px var(--bm-space-md);
    border-bottom: 1px solid var(--bm-border);
    color: var(--bm-text-primary);
    vertical-align: middle;
}

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

.bm-table tr:hover td {
    background-color: var(--bm-bg-input);
}

.bm-table--striped tr:nth-child(even) td {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .bm-table--striped tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.02);
}


/* ============================================
   U-1) FILTRES — Zone de filtres en haut des listes
   ============================================ */

.bm-filters {
    margin-bottom: var(--bm-space-md);
}

.bm-filters__form {
    display: flex;
    flex-direction: column;
    gap: var(--bm-space-sm);
}

.bm-filters__search {
    position: relative;
}

.bm-filters__search .bm-form__input {
    padding-left: 40px;
}

.bm-filters__search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bm-text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

.bm-filters__select {
    width: 100%;
}

@media (min-width: 768px) {
    .bm-filters__form {
        flex-direction: row;
        align-items: center;
    }

    .bm-filters__search {
        flex: 1;
        min-width: 200px;
    }

    .bm-filters__select {
        width: auto;
        min-width: 160px;
    }
}


/* ============================================
   U-2) ETAT VIDE — Aucun resultat / liste vide
   ============================================ */

.bm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--bm-space-2xl) var(--bm-space-md);
    color: var(--bm-text-muted);
}

.bm-empty-state i,
.bm-empty-state__icon {
    font-size: 3rem;
    margin-bottom: var(--bm-space-md);
    opacity: 0.5;
}

.bm-empty-state__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bm-text-primary);
    margin-bottom: var(--bm-space-xs);
}

.bm-empty-state__text {
    font-size: 0.875rem;
    color: var(--bm-text-muted);
    margin-bottom: var(--bm-space-lg);
    max-width: 320px;
}


/* ============================================
   U-3) PAGINATION
   ============================================ */

.bm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bm-space-xs);
    padding: var(--bm-space-md) 0;
    flex-wrap: wrap;
}

.bm-pagination__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--bm-space-sm);
    border-radius: var(--bm-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bm-text-secondary);
    background-color: transparent;
    border: 1px solid transparent;
    transition: all var(--bm-transition);
    cursor: pointer;
    text-decoration: none;
}

.bm-pagination__item:hover {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-primary);
}

.bm-pagination__item--active {
    background-color: var(--bm-primary);
    color: var(--bm-text-inverse);
    font-weight: 600;
}

.bm-pagination__item--active:hover {
    background-color: var(--bm-primary-dark);
    color: var(--bm-text-inverse);
}

.bm-pagination__item--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.bm-pagination__info {
    font-size: 0.8125rem;
    color: var(--bm-text-muted);
    margin: 0 var(--bm-space-sm);
}


/* ============================================
   U-4) LIEN TEXTE AVEC CHEVRON
   ============================================ */

.bm-link {
    display: inline-flex;
    align-items: center;
    gap: var(--bm-space-xs);
    color: var(--bm-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--bm-transition);
}

.bm-link:hover {
    color: var(--bm-primary-dark);
}

.bm-link::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.625rem;
    transition: transform var(--bm-transition);
}

.bm-link:hover::after {
    transform: translateX(2px);
}

.bm-link--no-chevron::after {
    display: none;
}


/* ============================================
   U-5) GRILLE TABLEAU DE BORD
   ============================================ */

.bm-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--bm-space-md);
}

@media (min-width: 1024px) {
    .bm-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Grille statistiques — 1 colonne mobile, 3 colonnes desktop */
.bm-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--bm-space-md);
}

@media (min-width: 768px) {
    .bm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bm-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ============================================
   U-6) ACTIONS RAPIDES
   ============================================ */

.bm-quick-actions {
    margin-bottom: var(--bm-space-md);
}

.bm-quick-actions__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bm-space-sm);
}

@media (min-width: 768px) {
    .bm-quick-actions__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bm-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-md);
    background-color: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--bm-text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    transition: all var(--bm-transition);
    min-height: 44px;
}

.bm-quick-action:hover {
    background-color: var(--bm-primary-bg);
    border-color: var(--bm-primary);
    color: var(--bm-primary);
    transform: translateY(-1px);
    box-shadow: var(--bm-shadow-sm);
}

.bm-quick-action__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--bm-radius-full);
    background-color: var(--bm-primary-bg);
    color: var(--bm-primary);
    font-size: 1.125rem;
    flex-shrink: 0;
}


/* ============================================
   U-7) CARTE — Titre
   ============================================ */

.bm-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bm-text-primary);
    margin: 0 0 var(--bm-space-sm);
}


/* ============================================
   U-8) FORMULAIRE — Champ montant proeminent
   ============================================ */

.bm-form__input--amount {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    padding: var(--bm-space-md) var(--bm-space-lg);
    min-height: 64px;
}

.bm-form__input--amount::placeholder {
    font-weight: 400;
    font-size: 1.25rem;
}


/* ============================================
   U-9) FORMULAIRE — Checkbox avec label
   ============================================ */

.bm-form__checkbox {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--bm-text-primary);
    min-height: 44px;
    user-select: none;
}

.bm-form__checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bm-border);
    border-radius: 4px;
    background-color: var(--bm-bg-input);
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all var(--bm-transition);
}

.bm-form__checkbox input[type="checkbox"]:checked {
    background-color: var(--bm-primary);
    border-color: var(--bm-primary);
}

.bm-form__checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid var(--bm-text-inverse);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bm-form__checkbox input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}


/* ============================================
   U-10) TABLEAU RESPONSIVE — Alias
   ============================================ */

.bm-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--bm-radius-md);
    border: 1px solid var(--bm-border);
}


/* ============================================
   U-11) OVERLAY GENERIQUE
   ============================================ */

.bm-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--bm-z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bm-transition-slow), visibility var(--bm-transition-slow);
}

.bm-overlay--visible {
    opacity: 1;
    visibility: visible;
}


/* ============================================
   U-12) HEADER — Bouton hamburger mobile
   ============================================ */

.bm-header__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-sm);
    color: var(--bm-text-primary);
    font-size: 1.125rem;
    transition: background-color var(--bm-transition);
    cursor: pointer;
    background: none;
    border: none;
}

.bm-header__hamburger:hover {
    background-color: var(--bm-bg-input);
}

@media (min-width: 1024px) {
    .bm-header__hamburger {
        display: none;
    }
}


/* ============================================
   U-13) WIZARD FISCAL — Etapes, boutons pays
   ============================================ */

.bm-tax-wizard {
    max-width: 700px;
    margin: 0 auto;
}

/* Barre de progression des etapes */
.bm-tax-wizard__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bm-space-sm);
    margin-bottom: var(--bm-space-xl);
    padding: 0 var(--bm-space-md);
}

.bm-tax-wizard__step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--bm-radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    background-color: var(--bm-bg-input);
    color: var(--bm-text-muted);
    border: 2px solid var(--bm-border);
    flex-shrink: 0;
    transition: all var(--bm-transition);
}

.bm-tax-wizard__step--active {
    background-color: var(--bm-primary);
    color: var(--bm-text-inverse);
    border-color: var(--bm-primary);
}

.bm-tax-wizard__step--done {
    background-color: var(--bm-success);
    color: var(--bm-text-inverse);
    border-color: var(--bm-success);
}

.bm-tax-wizard__connector {
    flex: 1;
    height: 2px;
    background-color: var(--bm-border);
    max-width: 60px;
}

.bm-tax-wizard__connector--done {
    background-color: var(--bm-success);
}

/* Contenu de l'etape */
.bm-tax-wizard__content {
    background-color: var(--bm-bg-card);
    border-radius: var(--bm-radius-md);
    border: 1px solid var(--bm-border);
    padding: var(--bm-space-lg);
}

.bm-tax-wizard__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bm-text-primary);
    margin-bottom: var(--bm-space-sm);
}

.bm-tax-wizard__description {
    font-size: 0.875rem;
    color: var(--bm-text-secondary);
    margin-bottom: var(--bm-space-lg);
}

/* Navigation entre etapes */
.bm-tax-wizard__actions {
    display: flex;
    justify-content: space-between;
    gap: var(--bm-space-sm);
    margin-top: var(--bm-space-lg);
}

/* Bouton selection pays (grand, avec drapeau) */
.bm-tax-country-btn {
    display: flex;
    align-items: center;
    gap: var(--bm-space-md);
    padding: var(--bm-space-md) var(--bm-space-lg);
    background-color: var(--bm-bg-card);
    border: 2px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--bm-text-primary);
    text-align: left;
    width: 100%;
    min-height: 64px;
    transition: all var(--bm-transition);
}

.bm-tax-country-btn:hover {
    border-color: var(--bm-primary-light);
    background-color: var(--bm-primary-bg);
}

.bm-tax-country-btn--selected {
    border-color: var(--bm-primary);
    background-color: var(--bm-primary-bg);
}

.bm-tax-country-btn__flag {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.bm-tax-country-btn__name {
    font-weight: 600;
}

.bm-tax-country-btn__detail {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
}

/* Carte resultat fiscal */
.bm-tax-result {
    background-color: var(--bm-bg-card);
    border-radius: var(--bm-radius-md);
    border: 1px solid var(--bm-border);
    padding: var(--bm-space-lg);
    box-shadow: var(--bm-shadow-sm);
}

.bm-tax-result__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bm-space-md);
}

.bm-tax-result__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bm-text-primary);
}

.bm-tax-result__amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bm-text-primary);
    font-variant-numeric: tabular-nums;
}

.bm-tax-result__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--bm-space-sm) 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--bm-border);
}

.bm-tax-result__row:last-child {
    border-bottom: none;
}

.bm-tax-result__label {
    color: var(--bm-text-secondary);
}

.bm-tax-result__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--bm-text-primary);
}


/* ============================================
   U-14) MEMBRE DU FOYER
   ============================================ */

.bm-household-member {
    display: flex;
    align-items: center;
    gap: var(--bm-space-md);
    padding: var(--bm-space-md);
    background-color: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    transition: background-color var(--bm-transition);
}

.bm-household-member:hover {
    background-color: var(--bm-bg-input);
}

.bm-household-member__info {
    flex: 1;
    min-width: 0;
}

.bm-household-member__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-household-member__role {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
}

.bm-household-member__actions {
    display: flex;
    align-items: center;
    gap: var(--bm-space-xs);
    flex-shrink: 0;
}


/* ============================================
   U-15) AVATAR — Rond avec initiale
   ============================================ */

.bm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bm-radius-full);
    background-color: var(--bm-primary-bg);
    color: var(--bm-primary);
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    user-select: none;
}

.bm-avatar--sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.bm-avatar--lg {
    width: 52px;
    height: 52px;
    font-size: 1.125rem;
}

.bm-avatar--xl {
    width: 64px;
    height: 64px;
    font-size: 1.375rem;
}


/* ============================================
   U-16) PASTILLE COULEUR — Categories, personnes
   ============================================ */

.bm-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: var(--bm-radius-full);
    flex-shrink: 0;
    vertical-align: middle;
}

.bm-color-dot--sm {
    width: 8px;
    height: 8px;
}

.bm-color-dot--lg {
    width: 16px;
    height: 16px;
}


/* ============================================
   U) IMPRESSION
   ============================================ */

@media print {
    .bm-sidebar,
    .bm-bottomnav,
    .bm-fab,
    .bm-header__action,
    .bm-more-panel,
    .bm-toast-container {
        display: none !important;
    }

    .bm-main {
        margin-left: 0 !important;
        padding-bottom: 0 !important;
    }

    .bm-header {
        position: static;
        border-bottom: 2px solid #000;
        backdrop-filter: none;
    }

    .bm-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    body {
        background: #fff;
        color: #000;
    }
}
