/**
 * 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 {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    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;
}

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);
    --bm-primary-bg-hover: rgba(99, 102, 241, 0.15);
    --bm-primary-bg-active: rgba(99, 102, 241, 0.2);

    /* 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-warning-dark: #b45309;
    --bm-danger: #EF4444;
    --bm-danger-bg: rgba(239, 68, 68, 0.1);
    --bm-danger-dark: #dc2626;
    --bm-info: #3B82F6;
    --bm-info-bg: rgba(59, 130, 246, 0.1);

    /* Overlays */
    --bm-overlay: rgba(0, 0, 0, 0.5);
    --bm-overlay-light: rgba(0, 0, 0, 0.4);

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

    /* Couleurs alertes complémentaires */
    --bm-warning-dark: #b45309;
    --bm-danger-dark: #dc2626;
    --bm-warning-light: #fbbf24;
    --bm-danger-light: #f87171;
    --bm-success-dark: #059669;

    /* Couleurs print */
    --bm-print-text: #000;
    --bm-print-text-secondary: #666;
    --bm-print-border: #ccc;
    --bm-print-border-light: #ddd;
}

/* 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-width: 0;
    overflow-x: hidden;
    /* Mobile : pas de marge (sidebar masquée) */
    margin-left: 0;
    /* Espace pour bottom nav + FAB sur mobile (FAB déborde de 36px au-dessus de la bottom nav) */
    padding-bottom: calc(var(--bm-bottomnav-height) + 56px);
    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);
    min-height: var(--bm-header-height);
    max-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);
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
}

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

/* Menu utilisateur (dropdown) */
.bm-header__user-menu {
    position: relative;
}

.bm-header__user-menu .bm-header__avatar {
    border: none;
    padding: 0;
}

.bm-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
}

.bm-user-dropdown.is-open {
    display: block;
}

.bm-user-dropdown__header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bm-user-dropdown__header strong {
    font-size: 0.875rem;
    color: var(--bm-text-primary);
}

.bm-user-dropdown__header small {
    font-size: 0.75rem;
    color: var(--bm-text-secondary);
}

.bm-user-dropdown__sep {
    height: 1px;
    background: var(--bm-border);
}

.bm-user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.8125rem;
    color: var(--bm-text-primary);
    text-decoration: none;
    transition: background var(--bm-transition);
}

.bm-user-dropdown__item:hover {
    background: var(--bm-bg-input);
    text-decoration: none;
}

.bm-user-dropdown__item i {
    width: 16px;
    text-align: center;
    color: var(--bm-text-secondary);
}

.bm-user-dropdown__item--danger {
    color: var(--bm-danger, #EF4444);
}

.bm-user-dropdown__item--danger i {
    color: var(--bm-danger, #EF4444);
}

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

/* Titres dans la zone de contenu */
.bm-content h1 {
    margin-bottom: var(--bm-space-lg);
}

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

.bm-content h3 {
    margin-bottom: var(--bm-space-sm);
}


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

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

.bm-fab--open {
    transform: translateX(-50%) rotate(45deg);
}

/* Menu FAB — mini-menu contextuel */
.bm-fab-menu {
    flex-direction: column;
    gap: var(--bm-space-xs);
    z-index: var(--bm-z-fab);
    animation: bm-fab-menu-in 0.15s ease;
}

@keyframes bm-fab-menu-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bm-fab-menu__item {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    padding: 10px 16px;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bm-text-primary);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--bm-shadow-md);
    transition: all var(--bm-transition);
}

.bm-fab-menu__item:hover {
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    border-color: var(--bm-primary);
}

.bm-fab-menu__item i {
    width: 18px;
    text-align: center;
}


/* ============================================
   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-lg);
    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;
    background-color: color-mix(in srgb, var(--bm-cat-color, #94A3B8) 15%, transparent);
    color: var(--bm-cat-color, #94A3B8);
}

.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__badges {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.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: 100%;
    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;
    min-width: 0;
}

/* Grilles 2 et 3 colonnes — stack sur mobile */
.bm-form__row--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bm-space-sm);
}

.bm-form__row--3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--bm-space-sm);
}

.bm-form__row--4 {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: var(--bm-space-sm);
    align-items: end;
}

.bm-form__group--narrow {
    max-width: 90px;
}

@media (max-width: 767px) {
    .bm-form__row--2 {
        grid-template-columns: 1fr;
    }
    .bm-form__row--3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .bm-form__row--4 {
        grid-template-columns: 1fr auto 1fr auto;
    }
}

@media (max-width: 480px) {
    .bm-form__row--3 {
        grid-template-columns: 1fr;
    }
    .bm-form__row--4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Formulaire compact — espacement réduit */
.bm-form--compact .bm-form__group {
    margin-bottom: var(--bm-space-sm);
}

.bm-form--compact .bm-form__row--2,
.bm-form--compact .bm-form__row--3,
.bm-form--compact .bm-form__row--4,
.bm-form--compact .bm-form__row--auto {
    margin-bottom: var(--bm-space-xs);
    gap: var(--bm-space-sm);
}

.bm-form--compact select[multiple] {
    height: 68px !important;
    max-height: 68px !important;
    min-height: 44px;
    overflow-y: auto;
}

.bm-form--compact textarea {
    height: 68px !important;
    max-height: 68px !important;
    min-height: 44px;
    resize: vertical;
}

.bm-form__row--auto {
    display: flex;
    gap: var(--bm-space-sm);
    flex-wrap: wrap;
}

.bm-form__row--auto > .bm-form__group {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 767px) {
    .bm-form__row--auto {
        flex-direction: column;
    }
}

/* Section avec titre + bouton inline */
.bm-form__section {
    margin: var(--bm-space-md) 0 var(--bm-space-sm);
    border-top: 1px solid var(--bm-border);
    padding-top: var(--bm-space-sm);
}

.bm-form__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bm-space-sm);
}

.bm-form__section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bm-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    margin: 0;
}

/* Scan IA compact */
.bm-scan-compact {
    margin-bottom: var(--bm-space-md);
    border: 2px dashed var(--bm-border);
    border-radius: var(--bm-radius-md);
    cursor: pointer;
    transition: border-color var(--bm-transition), background var(--bm-transition);
}

.bm-scan-compact:hover {
    border-color: var(--bm-primary);
    background: rgba(99, 102, 241, 0.03);
}

.bm-scan-compact__inner {
    display: flex;
    align-items: center;
    gap: var(--bm-space-md);
    padding: var(--bm-space-md);
}

.bm-scan-compact__icon {
    font-size: 1.5rem;
    color: var(--bm-primary);
    flex-shrink: 0;
}

.bm-scan-compact__text {
    flex: 1;
    min-width: 0;
}

.bm-scan-compact__text strong {
    display: block;
    font-size: 0.9rem;
}

.bm-scan-compact__text small {
    color: var(--bm-text-muted);
    font-size: 0.75rem;
}

/* Sélecteur de devise dans le champ montant */
.bm-form__currency-select {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 70px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bm-text-secondary);
    text-align: center;
    cursor: pointer;
    appearance: none;
    padding-right: 8px;
}

.bm-form__currency-select:focus {
    outline: none;
    color: var(--bm-primary);
}

.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: var(--bm-danger-dark);
}

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

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

/* 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: var(--bm-text-inverse);
    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: var(--bm-text-inverse);
}

.bm-toast--danger {
    background-color: var(--bm-danger);
    color: var(--bm-text-inverse);
}

.bm-toast--warning {
    background-color: var(--bm-warning);
    color: var(--bm-text-inverse);
}

.bm-toast--info {
    background-color: var(--bm-info);
    color: var(--bm-text-inverse);
}

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

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

    /* Activer la transition après l'initialisation JS */
    .bm-sidebar--animated {
        transition: width 0.3s ease, transform var(--bm-transition-slow);
    }

    .bm-sidebar--animated ~ .bm-main {
        transition: margin-left 0.3s ease;
    }

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

    .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: 3fr 2fr;
    }

    /* 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: #0F172A;
    position: relative;
    overflow: hidden;
    padding: var(--bm-space-md);
}

/* Cercles décoratifs en arrière-plan */
.bm-login::before,
.bm-login::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}

.bm-login::before {
    width: 500px;
    height: 500px;
    background: var(--bm-primary);
    top: -150px;
    right: -100px;
}

.bm-login::after {
    width: 400px;
    height: 400px;
    background: var(--bm-primary-light);
    bottom: -120px;
    left: -80px;
}

.bm-login__card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--bm-radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: var(--bm-space-2xl) var(--bm-space-xl);
    max-width: 380px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: bm-login-in 0.4s ease;
}

@keyframes bm-login-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.bm-login__logo i {
    color: var(--bm-primary) !important;
    font-size: 2.5rem !important;
    margin-bottom: var(--bm-space-sm);
    display: block;
}

.bm-login__title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--bm-text-inverse);
    margin: var(--bm-space-sm) 0 0;
    letter-spacing: -0.02em;
}

.bm-login__subtitle {
    text-align: center;
    color: var(--bm-text-muted);
    font-size: 0.85rem;
    margin: var(--bm-space-xs) 0 0;
}

/* Formulaire login */
.bm-login .bm-form__group {
    margin-bottom: var(--bm-space-md);
}

.bm-login .bm-form__label {
    color: var(--bm-text-secondary);
    font-size: 0.8rem;
}

.bm-login .bm-form__input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--bm-text-primary);
    border-radius: var(--bm-radius-sm);
}

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

.bm-login .bm-form__input:focus {
    border-color: var(--bm-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.bm-login .bm-form__checkbox span {
    color: var(--bm-text-muted);
    font-size: 0.8rem;
}

.bm-login .bm-btn--primary {
    background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark));
    border: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.bm-login .bm-btn--primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.bm-login__links {
    display: flex;
    justify-content: center;
    gap: var(--bm-space-md);
    margin-top: var(--bm-space-lg);
}

.bm-login__links a {
    color: var(--bm-text-secondary);
    font-size: 0.75rem;
    text-decoration: none;
    transition: color var(--bm-transition);
}

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

.bm-login__footer {
    text-align: center;
    margin-top: var(--bm-space-lg);
    font-size: 0.7rem;
    color: var(--bm-text-muted);
}

/* Surcharges formulaires Joomla natifs sur 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.8rem;
    font-weight: 500;
    color: var(--bm-text-secondary);
}

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

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

.bm-login button[type="submit"] {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark));
    color: var(--bm-text-inverse);
    border: none;
    border-radius: var(--bm-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    margin-top: var(--bm-space-sm);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all var(--bm-transition);
}

.bm-login button[type="submit"]:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}


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

/* Texte utilitaires */
.bm-text-xs { font-size: 0.7rem; }
.bm-text-sm { font-size: 0.8rem; }
.bm-text-base { font-size: 0.85rem; }
.bm-text-lg { font-size: 1.1rem; }
.bm-text-bold { font-weight: 700; }
.bm-text-semibold { font-weight: 600; }
.bm-text-medium { font-weight: 500; }
.bm-text-nowrap { white-space: nowrap; }
.bm-text-mono { font-family: monospace; font-size: 12px; word-break: break-all; }
.bm-text-link { color: var(--bm-primary); text-decoration: none; }
.bm-text-link:hover { text-decoration: underline; }

/* Flexbox utilitaires supplémentaires */
.bm-flex--end { display: flex; align-items: flex-end; }
.bm-flex--inline { display: inline-flex; align-items: center; }
.bm-flex--noshrink { flex: 0 0 auto; }

/* Stat box — carte compacte pour les résumés chiffrés */
.bm-stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--bm-radius);
    padding: 10px 16px;
    flex: 1;
    min-width: 120px;
}
.bm-stat-box--narrow { flex: 0 0 auto; min-width: 80px; }
.bm-stat-box__label { font-size: 0.75rem; color: var(--bm-text-muted); }
.bm-stat-box__value { font-size: 1.1rem; font-weight: 700; }
.bm-stat-box__sub { font-size: 0.7rem; color: var(--bm-text-muted); }

/* Filtres toolbar */
.bm-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.bm-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bm-filter-group__label {
    font-size: 0.8rem;
    color: var(--bm-text-muted);
}

/* Affichage conditionnel */
.bm-d-none { display: none !important; }
.bm-d-inline { display: inline; }

/* 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: 3fr 2fr;
    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%;
}

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

/* Conteneur donut — ratio 1:1 centre */
.bm-chart-container--donut {
    max-width: 400px;
    margin: 0 auto;
}

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

/* Masquer les alertes Joomla natives — remplacées par nos toasts */
#system-message-container {
    display: none !important;
}

/* Success */
#system-message-container .alert-success,
#system-message-container joomla-alert[type="success"],
#system-message-container .alert[type="success"] {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.06));
    color: var(--bm-color-success, #10B981);
    border-left: 4px solid var(--bm-color-success, #10B981);
}
#system-message-container .alert-success::before,
#system-message-container joomla-alert[type="success"]::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: var(--bm-space-xs);
}

/* Danger / Error */
#system-message-container .alert-danger,
#system-message-container .alert-error,
#system-message-container joomla-alert[type="danger"],
#system-message-container joomla-alert[type="error"] {
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06));
    color: var(--bm-color-danger, #EF4444);
    border-left: 4px solid var(--bm-color-danger, #EF4444);
}
#system-message-container .alert-danger::before,
#system-message-container .alert-error::before,
#system-message-container joomla-alert[type="danger"]::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: var(--bm-space-xs);
}

/* Warning */
#system-message-container .alert-warning,
#system-message-container joomla-alert[type="warning"] {
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.06));
    color: var(--bm-color-warning, #F59E0B);
    border-left: 4px solid var(--bm-color-warning, #F59E0B);
}
#system-message-container .alert-warning::before,
#system-message-container joomla-alert[type="warning"]::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: var(--bm-space-xs);
}

/* Info / Message */
#system-message-container .alert-info,
#system-message-container .alert-message,
#system-message-container joomla-alert[type="info"],
#system-message-container joomla-alert[type="message"] {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(99,102,241,0.06));
    color: var(--bm-primary, #6366F1);
    border-left: 4px solid var(--bm-primary, #6366F1);
}
#system-message-container .alert-info::before,
#system-message-container joomla-alert[type="info"]::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: var(--bm-space-xs);
}

/* Message type (Joomla default success) */
#system-message-container .alert-message,
#system-message-container joomla-alert[type="message"] {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.06));
    color: var(--bm-color-success, #10B981);
    border-left: 4px solid var(--bm-color-success, #10B981);
}

#system-message-container .alert-message::before,
#system-message-container joomla-alert[type="message"]::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.1rem;
    margin-right: var(--bm-space-xs);
}

/* Hide the "success" / "error" type label */
#system-message-container .alert-heading,
#system-message-container joomla-alert .alert-heading {
    display: none;
}

/* Close button */
#system-message-container .alert .close,
#system-message-container .alert .btn-close,
#system-message-container joomla-alert .close,
#system-message-container joomla-alert .btn-close,
#system-message-container joomla-alert button[slot="close"] {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.5;
    padding: var(--bm-space-xs);
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bm-radius-sm);
    transition: all 0.15s;
}
#system-message-container .alert .close:hover,
#system-message-container .alert .btn-close:hover,
#system-message-container joomla-alert button:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05);
}


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

.bm-table-wrapper {
    overflow-x: auto;
    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);
}


/* ============================================
   T-2) LIGNES DE TICKET — Détail par article
   ============================================ */

.bm-ticket-lines__bulk {
    margin-bottom: var(--bm-space-sm);
    padding: var(--bm-space-sm);
    background: var(--bm-primary-bg);
    border-radius: var(--bm-radius-sm);
}

.bm-ticket-lines__bulk-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-sm);
    align-items: center;
}

.bm-ticket-lines__bulk-row select {
    flex: 1;
    min-width: 120px;
}

.bm-ticket-lines__table-wrap {
    overflow-x: auto;
}

.bm-ticket-lines__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bm-ticket-lines__table thead th {
    text-align: left;
    padding: var(--bm-space-xs) var(--bm-space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--bm-text-muted);
    border-bottom: 2px solid var(--bm-border);
    white-space: nowrap;
}

.bm-ticket-lines__th--amount,
.bm-ticket-lines__th--reimb,
.bm-ticket-lines__th--actions {
    text-align: center !important;
    width: 1%;
}

.bm-ticket-lines__table tbody td {
    padding: var(--bm-space-xs) var(--bm-space-sm);
    border-bottom: 1px solid var(--bm-border);
    vertical-align: middle;
}

.bm-ticket-lines__td-center {
    text-align: center;
}

.bm-ticket-lines__td-actions {
    white-space: nowrap;
    text-align: center;
}

.bm-ticket-lines__td-actions .bm-btn {
    margin: 0 2px;
}

.bm-ticket-lines__input-amount {
    width: 140px;
    min-width: 130px;
    text-align: right;
}

.bm-ticket-lines__row:hover {
    background: var(--bm-primary-bg);
}

.bm-ticket-lines__total-row td {
    padding: var(--bm-space-sm);
    border-top: 2px solid var(--bm-border);
    font-weight: 600;
}

.bm-ticket-lines__total-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bm-primary);
    text-align: right;
    padding-right: 24px !important;
}

.bm-ticket-lines__person-totals {
    margin-top: var(--bm-space-sm);
    padding: var(--bm-space-sm);
    background: var(--bm-bg-input);
    border-radius: var(--bm-radius-sm);
}

.bm-ticket-lines__person-totals-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--bm-text-muted);
    margin-bottom: var(--bm-space-xs);
}

.bm-ticket-lines__person-totals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-sm) var(--bm-space-lg);
}

.bm-ticket-lines__person-total-item {
    display: flex;
    gap: var(--bm-space-sm);
    align-items: center;
    font-size: 0.85rem;
}

.bm-ticket-lines__person-total-item strong {
    color: var(--bm-primary);
}

/* Boutons mini pour les lignes */
.bm-btn--xs {
    padding: 4px 6px;
    font-size: 0.7rem;
    min-height: 28px;
    min-width: 28px;
}

/* Toggle mini pour profils CSV */
.bm-toggle-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    user-select: none;
}
.bm-toggle-mini input { display: none; }
.bm-toggle-mini__track {
    width: 28px;
    height: 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    position: relative;
    transition: background 0.2s;
}
.bm-toggle-mini__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--bm-text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.bm-toggle-mini input:checked + .bm-toggle-mini__track {
    background: var(--bm-primary);
}
.bm-toggle-mini input:checked + .bm-toggle-mini__track::after {
    transform: translateX(12px);
    background: #fff;
}
.bm-toggle-mini__label {
    color: var(--bm-text-muted);
    font-weight: 600;
}
.bm-toggle-mini input:checked ~ .bm-toggle-mini__label {
    color: var(--bm-primary);
}

/* Icon picker pour catégories */
.bm-icon-picker {
    position: relative;
}
.bm-icon-picker__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    background: var(--bm-bg-input);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    color: var(--bm-text);
    cursor: pointer;
    font-size: 0.85rem;
    min-height: 38px;
    transition: border-color 0.15s;
}
.bm-icon-picker__trigger:hover {
    border-color: var(--bm-primary);
}
.bm-icon-picker__trigger i:first-child {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.bm-icon-picker__grid {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow-xl);
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    flex-wrap: wrap;
    gap: 2px;
}
.bm-icon-picker__grid.bm-icon-picker--open {
    display: flex;
}
.bm-icon-picker__item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--bm-text-muted);
    cursor: pointer;
    border-radius: var(--bm-radius-sm);
    font-size: 0.95rem;
    transition: background 0.1s, color 0.1s;
}
.bm-icon-picker__item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--bm-text);
}
.bm-icon-picker__item--active {
    background: var(--bm-primary);
    color: #fff;
}

/* Bouton recherche Google — dans les labels de formulaire */
.bm-search-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    color: var(--bm-primary);
    cursor: pointer;
    padding: 3px 8px;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 1;
    transition: all 0.15s ease;
    vertical-align: middle;
    margin-left: 6px;
    line-height: 1;
    white-space: nowrap;
}
.bm-search-google::after {
    content: 'Google';
    font-size: 0.65rem;
    font-weight: 500;
}
.bm-search-google:hover {
    background: var(--bm-primary);
    color: #fff;
    border-color: var(--bm-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}
/* Bouton dans une cellule tableau — pastille ronde visible */
td .bm-search-google {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.68rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: var(--bm-primary);
    opacity: 1;
}
td .bm-search-google::after {
    content: none;
}
td .bm-search-google:hover {
    background: var(--bm-primary);
    color: #fff;
    border-color: var(--bm-primary);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transform: translateY(-50%) scale(1.1);
}
td:has(.bm-search-google) {
    position: relative;
}
td:has(.bm-search-google) input {
    padding-right: 38px;
}

/* Toggle exclusion totaux dans la liste des transactions */
.bm-tx-exclude-toggle {
    background: none;
    border: none;
    color: var(--bm-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.7rem;
    opacity: 0.4;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}
.bm-tx-exclude-toggle:hover {
    opacity: 1;
    color: var(--bm-primary);
}
.bm-tx-exclude-toggle[data-excluded="1"] {
    opacity: 0.8;
    color: var(--bm-warning);
}
.bm-amount--excluded {
    opacity: 0.4;
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.3);
}

/* Transactions masquées dans le compte bancaire */
.ba-tx-hidden {
    opacity: 0.4;
}
.ba-tx-hidden td {
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.2);
}
.ba-tx-hidden td:first-child,
.ba-tx-hidden td:nth-child(2) {
    text-decoration: none;
}
.ba-vis-toggle {
    background: none;
    border: none;
    color: var(--bm-text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
}
.ba-vis-toggle:hover {
    opacity: 1;
    color: var(--bm-primary);
}
.ba-tx-hidden .ba-vis-toggle {
    color: var(--bm-warning);
    opacity: 0.8;
}

.ba-filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--bm-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.ba-filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--bm-text);
}
.ba-filter-btn.ba-filter-active {
    background: var(--bm-primary);
    color: #fff;
    border-color: var(--bm-primary);
}

.bm-btn--danger-ghost {
    color: var(--bm-danger);
}

.bm-btn--danger-ghost:hover {
    background: var(--bm-danger-bg);
}

/* Badge compteur */
.bm-badge--small {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--bm-radius-full);
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    font-weight: 600;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

/* Inputs plus petits pour les lignes */
.bm-form__input--sm {
    padding: 6px 8px;
    font-size: 0.8rem;
    border-radius: var(--bm-radius-sm);
}

/* Responsive : cartes empilées sur mobile */
@media (max-width: 767px) {
    .bm-ticket-lines__table thead {
        display: none;
    }

    .bm-ticket-lines__table,
    .bm-ticket-lines__table tbody,
    .bm-ticket-lines__table tr,
    .bm-ticket-lines__table td {
        display: block;
        width: 100%;
    }

    .bm-ticket-lines__row {
        padding: var(--bm-space-sm);
        margin-bottom: var(--bm-space-sm);
        border: 1px solid var(--bm-border);
        border-radius: var(--bm-radius-sm);
        background: var(--bm-bg-card);
    }

    .bm-ticket-lines__table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        padding: 4px 0;
    }

    .bm-ticket-lines__table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--bm-text-muted);
        min-width: 80px;
    }

    .bm-ticket-lines__table tbody td input,
    .bm-ticket-lines__table tbody td select {
        flex: 1;
        max-width: 60%;
    }

    .bm-ticket-lines__input-amount {
        width: auto;
    }

    .bm-ticket-lines__td-actions {
        justify-content: flex-end;
    }

    .bm-ticket-lines__total-row {
        display: flex;
        justify-content: space-between;
        padding: var(--bm-space-sm);
    }

    .bm-ticket-lines__total-row td {
        border-top: none;
    }

    .bm-ticket-lines__total-row td:first-child {
        flex: 1;
    }
}


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

.bm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-sm);
    margin-bottom: var(--bm-space-md);
}

.bm-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-sm);
    width: 100%;
}

.bm-filters select,
.bm-filters .bm-filters__select {
    flex: 1;
    min-width: 120px;
    max-width: 250px;
}

.bm-filters input[type="text"],
.bm-filters .bm-filters__search {
    flex: 2;
    min-width: 150px;
}

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

/* Pagination Joomla native — override pour le design system */
.bm-pagination .pagination,
.bm-pagination ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bm-space-xs);
    list-style: none;
    padding: 0;
    margin: 0;
}
.bm-pagination .pagination li a,
.bm-pagination .pagination li span {
    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: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    text-decoration: none;
    transition: all 0.15s;
}
.bm-pagination .pagination li a:hover {
    background: var(--bm-bg-input);
    color: var(--bm-text-primary);
}
.bm-pagination .pagination li.active span,
.bm-pagination .pagination li span.active {
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    border-color: var(--bm-primary);
    font-weight: 600;
}
.bm-pagination .pagination li.disabled span,
.bm-pagination .pagination li.disabled a {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.bm-pagination p.counter,
.bm-pagination .pagination-counter,
.bm-pagination .text-end {
    font-size: 0.8125rem;
    color: var(--bm-text-muted);
    text-align: center;
    margin-bottom: var(--bm-space-sm);
}

/* Joomla pagination — full restyle */
.bm-pagination .pagination__wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.bm-pagination .pagination-toolbar {
    margin: 0;
}
.bm-pagination ul.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.bm-pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--bm-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bm-text-secondary);
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.bm-pagination .page-item .page-link:hover {
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    border-color: var(--bm-primary);
}
.bm-pagination .page-item.active .page-link {
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    border-color: var(--bm-primary);
    font-weight: 600;
}
.bm-pagination .page-item.disabled .page-link {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Joomla icons → Font Awesome */
.bm-pagination .icon-angle-double-left::before { content: '\f100'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.bm-pagination .icon-angle-left::before { content: '\f104'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.bm-pagination .icon-angle-right::before { content: '\f105'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.bm-pagination .icon-angle-double-right::before { content: '\f101'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }


/* ============================================
   BUDGETS — Grille et cartes
   ============================================ */
.bm-budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--bm-space-md);
    margin-top: var(--bm-space-md);
}
.bm-card--budget {
    padding: var(--bm-space-md);
}
.bm-card--budget .bm-card__header {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    margin-bottom: var(--bm-space-sm);
}
.bm-card--budget .bm-card__title {
    margin: 0;
    font-size: 1rem;
}
.bm-card--budget .bm-card__progress {
    height: 6px;
    background: var(--bm-bg-input);
    border-radius: 3px;
    margin-bottom: var(--bm-space-sm);
    overflow: hidden;
}
.bm-budget-card__details {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--bm-space-xs);
    font-size: 0.8rem;
}
.bm-budget-card__row {
    display: flex;
    flex-direction: column;
}
.bm-budget-card__label {
    color: var(--bm-text-muted);
    font-size: 0.7rem;
}
.bm-budget-card__value {
    font-weight: 600;
}
.bm-budget-card__percent {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bm-text-muted);
    margin-top: var(--bm-space-xs);
}
.bm-budget-actions {
    display: flex;
    gap: var(--bm-space-sm);
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   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: 768px) {
    .bm-dashboard-grid {
        grid-template-columns: 3fr 2fr;
    }
}
@media (min-width: 1200px) {
    .bm-dashboard-grid {
        grid-template-columns: 3fr 2fr;
    }
}

/* Grille formulaire fluide — auto-fit pour remplir la largeur */
.bm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--bm-space-md);
}

/* Force full-width pour les conteneurs de formulaire et réponses IA */
.bm-ai-response,
.bm-form .bm-form__group,
.bm-card .bm-form__group {
    max-width: 100%;
}
.bm-form textarea,
.bm-form .bm-form__textarea {
    width: 100%;
}

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

@media (min-width: 768px) {
    .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;
    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;
    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 — voir bloc complet plus bas */

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


/* Déductions fiscales suisses */
.bm-tax-deductions {
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    padding: var(--bm-space-md);
    margin-top: var(--bm-space-md);
}

.bm-tax-deductions__toggle {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bm-text-primary);
    cursor: pointer;
    list-style: none;
}

.bm-tax-deductions__toggle::-webkit-details-marker { display: none; }

.bm-tax-deductions__toggle::before {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    transition: transform 0.2s;
    color: var(--bm-text-muted);
}

.bm-tax-deductions[open] > .bm-tax-deductions__toggle::before {
    transform: rotate(180deg);
}

.bm-tax-deductions__section {
    border: none;
    padding: 0;
    margin: 0 0 var(--bm-space-md) 0;
}

.bm-tax-deductions__legend {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bm-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--bm-space-xs);
    margin-bottom: var(--bm-space-sm);
    padding-bottom: var(--bm-space-xs);
    border-bottom: 1px solid var(--bm-border);
    width: 100%;
}

.bm-tax-deductions__summary {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--bm-radius);
    padding: var(--bm-space-sm) var(--bm-space-md);
}

/* Carte fiscale interactive */
.bm-tax-map-section {
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    padding: var(--bm-space-md);
}

.bm-tax-map__svg svg {
    width: 100%;
    height: auto;
    max-height: 350px;
}

.bm-tax-map__svg .bm-canton {
    stroke: var(--bm-border);
    stroke-width: 1;
    transition: opacity 0.2s, stroke-width 0.2s;
    cursor: pointer;
}

.bm-tax-map__svg .bm-canton:hover {
    opacity: 0.8;
    stroke-width: 2;
    stroke: var(--bm-text-primary);
}

.bm-tax-map__svg .bm-canton-label {
    font-size: 10px;
    font-weight: 600;
    fill: var(--bm-text-primary);
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
}

.bm-tax-map__legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bm-tax-map__gradient {
    display: flex;
    align-items: center;
    gap: var(--bm-space-xs);
}

.bm-tax-map__gradient-bar {
    width: 120px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, rgb(0, 255, 60), rgb(255, 255, 60), rgb(255, 0, 60));
}

.bm-tax-map__tooltip {
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: var(--bm-space-xs) var(--bm-space-sm);
    font-size: 0.8rem;
    text-align: center;
    margin-top: var(--bm-space-xs);
}

/* Modal générique */
.bm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--bm-space-md);
}

.bm-modal {
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-lg, 12px);
    max-width: 600px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto;
    animation: bm-modal-slide-in 0.2s ease;
}

.bm-modal--lg {
    max-width: min(90vw, 900px);
    max-height: calc(100vh - 3rem);
}

.bm-modal__header {
    padding: var(--bm-space-md);
    border-bottom: 1px solid var(--bm-border);
    flex-shrink: 0;
}

.bm-modal__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.bm-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--bm-text-muted);
    cursor: pointer;
    line-height: 1;
}

.bm-modal__close:hover { color: var(--bm-text-primary); }

.bm-modal__body {
    padding: var(--bm-space-md);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-gutter: stable;
}

.bm-modal__body .bm-table {
    font-size: 0.8rem;
}

.bm-modal__body .bm-table tr {
    cursor: pointer;
    transition: background 0.15s;
}

.bm-modal__body .bm-table tbody tr:hover {
    background: var(--bm-primary-bg, rgba(99, 102, 241, 0.1));
}

/* Liste visuelle des communes (barres heatmap) */
.bm-canton-communes-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.bm-canton-commune-bar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    border-radius: var(--bm-radius);
    cursor: pointer;
    transition: background 0.15s;
}

.bm-canton-commune-bar:hover {
    background: var(--bm-primary-bg, rgba(99, 102, 241, 0.1));
}

.bm-canton-commune-bar__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.bm-canton-commune-bar__name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

.bm-canton-commune-bar__detail {
    font-size: 0.75rem;
    text-align: right;
}

.bm-canton-commune-bar__track {
    height: 4px;
    background: var(--bm-bg-input, rgba(255,255,255,0.05));
    border-radius: 2px;
    overflow: hidden;
}

.bm-canton-commune-bar__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Header modal canton — 2 colonnes */
.bm-tax-modal-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bm-space-sm);
}

.bm-tax-modal-header-col {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: var(--bm-space-sm);
}

@media (max-width: 500px) {
    .bm-tax-modal-header-grid {
        grid-template-columns: 1fr;
    }
}

/* Tabs modal canton */
.bm-tax-modal-tabs {
    display: flex;
    align-items: center;
    gap: var(--bm-space-xs);
    border-bottom: 1px solid var(--bm-border);
    padding-bottom: var(--bm-space-xs);
}

.bm-tax-modal-tab--active {
    pointer-events: none;
}

.bm-tax-modal-sort {
    display: flex;
    align-items: center;
    gap: var(--bm-space-xs);
}

/* Carte cantonale (communes) */
.bm-tax-canton-map__svg svg {
    width: 100%;
    height: auto;
    max-height: 60vh;
}

.bm-tax-canton-map__svg .bm-commune {
    stroke: var(--bm-border);
    stroke-width: 0.5;
    transition: opacity 0.15s, stroke-width 0.15s;
}

.bm-tax-canton-map__svg .bm-commune:hover {
    opacity: 0.75;
    stroke-width: 1.5;
    stroke: var(--bm-text-primary);
}

.bm-tax-canton-map__svg .bm-commune-label {
    font-size: 6px;
    fill: var(--bm-text-primary);
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
    opacity: 0.7;
}

/* Ranking cantons */
.bm-tax-map__ranking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bm-space-md);
}

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

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

@media (max-width: 600px) {
    .bm-tax-map__ranking-grid {
        grid-template-columns: 1fr;
    }
}

.bm-spinner--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Comparaison entre communes */
.bm-tax-compare__grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--bm-space-md);
    align-items: center;
}

.bm-tax-compare__vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--bm-space-sm);
}

@media (max-width: 600px) {
    .bm-tax-compare__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .bm-tax-compare__vs {
        flex-direction: row;
        justify-content: center;
        gap: var(--bm-space-sm);
    }
}

/* ============================================
   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-cat-color, var(--bm-primary-bg));
    color: var(--bm-text-inverse);
    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-17) GRILLE DE MINI-CARTES
   ============================================ */

.bm-card-grid {
    display: grid;
    gap: var(--bm-space-sm);
}

.bm-card-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.bm-card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.bm-card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1280px) {
    .bm-card-grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .bm-card-grid--3,
    .bm-card-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .bm-card-grid--2,
    .bm-card-grid--3,
    .bm-card-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Mini-carte */
.bm-card-mini {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-sm) var(--bm-space-md);
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    text-decoration: none;
    color: inherit;
    transition: all var(--bm-transition);
    min-height: 56px;
}

.bm-card-mini:hover {
    border-color: var(--bm-primary);
    box-shadow: var(--bm-shadow-sm);
    transform: translateY(-1px);
}

.bm-card-mini__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--bm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.bm-card-mini__content {
    flex: 1;
    min-width: 0;
}

.bm-card-mini__title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-card-mini__meta {
    display: block;
    font-size: 0.7rem;
    color: var(--bm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-card-mini__badge {
    flex-shrink: 0;
    font-size: 0.6rem;
}

.bm-card-mini__right {
    text-align: right;
    flex-shrink: 0;
}

.bm-card-mini__amount {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bm-danger);
    white-space: nowrap;
}

.bm-card-mini__badges {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 2px;
}

.bm-badge--xs {
    font-size: 0.6rem;
    padding: 1px 6px;
}


.bm-th-left { text-align: left; }
.bm-th-right { text-align: right; }

/* Tags personnes */
.bm-person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bm-person-tag {
    padding: 3px 10px;
    border-radius: var(--bm-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--tag-color, var(--bm-border));
    background: transparent;
    color: var(--tag-color, var(--bm-text-muted));
    transition: all var(--bm-transition);
}

.bm-person-tag:hover {
    background: color-mix(in srgb, var(--tag-color) 10%, transparent);
}

.bm-person-tag--active {
    background: var(--tag-color, var(--bm-primary));
    color: var(--bm-text-inverse);
    border-color: var(--tag-color, var(--bm-primary));
}

/* Boutons filtres rapides (Mois / Année / Tout) */
.bm-quick-filters {
    display: inline-flex;
    gap: 2px;
    font-size: 0.7rem;
    align-self: center;
    height: fit-content;
    flex-shrink: 0;
}

.bm-quick-filter {
    padding: 2px 8px;
    color: var(--bm-text-muted);
    text-decoration: none;
    transition: all var(--bm-transition);
    border-radius: 4px;
    background: transparent;
    line-height: 1.4;
}

.bm-quick-filter:hover {
    color: var(--bm-primary);
    background: var(--bm-primary-bg);
}

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

/* ============================================
   U-21) CARTES CATÉGORIES
   ============================================ */

.bm-cat-card {
    display: flex;
    flex-direction: column;
    gap: var(--bm-space-xs);
    padding: var(--bm-space-sm) var(--bm-space-md);
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    text-decoration: none;
    color: inherit;
    transition: all var(--bm-transition);
}

.bm-cat-card:hover {
    box-shadow: var(--bm-shadow-sm);
    transform: translateY(-1px);
    border-color: var(--bm-primary);
}

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

.bm-cat-card__name {
    font-size: 0.9rem;
    font-weight: 600;
}

.bm-cat-card__keywords {
    font-size: 0.7rem;
    color: var(--bm-text-muted);
    line-height: 1.4;
    word-break: break-word;
}

@media (max-width: 767px) {
    .bm-cat-card__keywords {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}


/* ============================================
   U-20) MODAL DE CONFIRMATION
   ============================================ */

.bm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bm-modal-fade-in 0.2s ease;
}

@keyframes bm-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Animation modal (ancienne définition .bm-modal fusionnée dans le bloc principal) */
@keyframes bm-modal-slide-in {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Confirm dialog (BM.confirm) — le .bm-modal ici n'a pas de header/body/footer */
.bm-modal-overlay > .bm-modal:not(:has(.bm-modal__header)) {
    max-width: 420px;
    padding: var(--bm-space-lg) var(--bm-space-lg) var(--bm-space-md);
    text-align: center;
}

.bm-modal__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--bm-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto var(--bm-space-sm);
}

.bm-modal__icon--danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--bm-danger);
}

.bm-modal__icon--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--bm-warning);
}

.bm-modal__icon--info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--bm-primary);
}

.bm-modal__icon + .bm-modal__title {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: var(--bm-space-sm);
    color: var(--bm-text-primary);
}

.bm-modal__message {
    text-align: left;
    font-size: 0.85rem;
    color: var(--bm-text-secondary);
    margin-bottom: var(--bm-space-md);
    line-height: 1.6;
    background: var(--bm-bg-input);
    border-radius: var(--bm-radius-sm);
    padding: 10px 12px;
}

.bm-modal__actions {
    display: flex;
    gap: var(--bm-space-sm);
    justify-content: stretch;
    margin-top: var(--bm-space-sm);
}

.bm-modal__actions .bm-btn {
    flex: 1;
}

/* Modale d'édition (profils CSV, etc.) */
.bm-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.bm-edit-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.bm-edit-modal__content {
    position: relative;
    background: var(--bm-bg-card);
    border-radius: var(--bm-radius-lg);
    box-shadow: var(--bm-shadow-xl);
    width: 900px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: bm-modal-slide-in 0.2s ease;
}
.bm-edit-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bm-edit-modal__header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.bm-edit-modal__close {
    background: none;
    border: none;
    color: var(--bm-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.bm-edit-modal__close:hover { color: var(--bm-text); }
.bm-edit-modal__body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.bm-edit-modal__footer {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}


/* ============================================
   U-19) CATEGORY PICKER — Sélection rapide de catégorie
   ============================================ */

.bm-cat-picker {
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    box-shadow: var(--bm-shadow-lg);
    padding: var(--bm-space-sm);
    animation: bm-fab-menu-in 0.15s ease;
}

.bm-cat-picker__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bm-cat-picker__dot {
    width: 36px;
    height: 36px;
    border-radius: var(--bm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--bm-transition);
    position: relative;
}

.bm-cat-picker__dot:hover {
    border-color: currentColor;
    transform: scale(1.15);
}

.bm-cat-picker__similar {
    border-top: 1px solid var(--bm-border);
    margin-top: var(--bm-space-sm);
    padding-top: var(--bm-space-sm);
}

.bm-cat-picker__check {
    font-size: 0.75rem;
    color: var(--bm-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    cursor: pointer;
}

.bm-cat-picker__check input {
    accent-color: var(--bm-primary);
}

/* ---- Page Catégories : colonnes masonry (collées sans vide) ---- */
.bm-cat-grid {
    column-count: 3;
    column-gap: var(--bm-space-md);
}

.bm-cat-grid .bm-catcard {
    break-inside: avoid;
    margin-bottom: var(--bm-space-md);
}

@media (max-width: 1024px) {
    .bm-cat-grid { column-count: 2; }
}

@media (max-width: 600px) {
    .bm-cat-grid { column-count: 1; }
}

/* Carte catégorie */
.bm-catcard {
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    overflow: hidden;
    transition: box-shadow var(--bm-transition);
}

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

/* En-tête de la carte */
.bm-catcard__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-left: 4px solid #94A3B8;
    background: var(--bm-bg-card);
}

.bm-catcard__icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.bm-catcard__name {
    font-weight: 600;
    font-size: 0.88rem;
    color: inherit;
    text-decoration: none;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.bm-catcard__action {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--bm-text-muted);
    font-size: 0.72rem;
    text-decoration: none;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--bm-transition), background var(--bm-transition);
}

.bm-catcard:hover .bm-catcard__action {
    opacity: 1;
}

.bm-catcard__action:hover {
    background: var(--bm-surface-alt);
    color: var(--bm-primary);
}

/* Zone sans sous-catégories / mots-clés */
.bm-catcard__sub {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--bm-border);
}

.bm-catcard__sub--empty {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
    font-style: normal;
}

.bm-catcard__keywords {
    font-size: 0.72rem;
    color: var(--bm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Liste des sous-catégories */
.bm-catcard__sublist {
    list-style: none;
    margin: 0;
    padding: 4px 0 6px;
    border-top: 1px solid var(--bm-border);
}

.bm-catcard__subitem {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    transition: background var(--bm-transition);
}

.bm-catcard__subitem:hover {
    background: var(--bm-surface-alt);
}

.bm-catcard__subdot {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.bm-catcard__subname {
    font-size: 0.82rem;
    color: inherit;
    text-decoration: none;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.bm-catcard__subaction {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--bm-text-muted);
    font-size: 0.65rem;
    text-decoration: none;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--bm-transition), background var(--bm-transition);
}

.bm-catcard__subitem:hover .bm-catcard__subaction {
    opacity: 1;
}

.bm-catcard__subaction:hover {
    background: var(--bm-border);
    color: var(--bm-primary);
}

/* Indicateur chevron sur les boutons parent avec sous-catégories */
.bm-cat-picker__dot--has-children .bm-cat-picker__chevron {
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-size: 0.45rem;
    line-height: 1;
    opacity: 0.8;
}

.bm-cat-picker__dot--has-children:hover {
    border-color: currentColor;
    transform: scale(1.15);
}

/* Bouton "Tout" niveau 2 — légèrement plus large */
.bm-cat-picker__dot[style*="dashed"] {
    width: 42px;
    font-size: 0.7rem;
}

/* Bouton icône cliquable dans la liste */
button.bm-transactions__icon--cat {
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--bm-transition), transform var(--bm-transition);
}

button.bm-transactions__icon--cat:hover {
    border-color: var(--bm-primary);
    transform: scale(1.1);
}


/* ============================================
   U-18) RÉCONCILIATION — Paires de doublons
   ============================================ */

.bm-recon-pair {
    margin-bottom: var(--bm-space-md);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    background: var(--bm-bg-card);
    overflow: hidden;
}

.bm-recon-pair__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--bm-space-sm) var(--bm-space-md);
    background: var(--bm-bg-input);
    border-bottom: 1px solid var(--bm-border);
}

.bm-recon-pair__score {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--bm-radius-full);
}

.bm-recon-pair__amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bm-danger);
}

.bm-recon-pair__cards {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
}

.bm-recon-card {
    padding: var(--bm-space-sm) var(--bm-space-md);
    position: relative;
}

.bm-recon-card--keep {
    border-right: 1px solid var(--bm-border);
}

.bm-recon-card__badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--bm-space-xs);
}

.bm-recon-card--keep .bm-recon-card__badge {
    color: var(--bm-success);
}

.bm-recon-card--delete .bm-recon-card__badge {
    color: var(--bm-danger);
}

.bm-recon-card__date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bm-text-secondary);
}

.bm-recon-card__desc {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 2px 0;
}

.bm-recon-card__meta {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.bm-recon-pair__vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--bm-text-muted);
    padding: 0 var(--bm-space-sm);
    background: var(--bm-bg-input);
}

.bm-recon-pair__actions {
    display: flex;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-sm) var(--bm-space-md);
    border-top: 1px solid var(--bm-border);
    background: var(--bm-bg-input);
}

@media (max-width: 767px) {
    .bm-recon-pair__cards {
        grid-template-columns: 1fr;
    }

    .bm-recon-card--keep {
        border-right: none;
        border-bottom: 1px solid var(--bm-border);
    }

    .bm-recon-pair__vs {
        padding: var(--bm-space-xs);
    }

    .bm-recon-pair__actions {
        flex-wrap: wrap;
    }
}


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

@media print {
    .bm-sidebar,
    .bm-bottomnav,
    .bm-fab,
    .bm-header__action,
    .bm-more-panel,
    .bm-toast-container,
    .bm-fab-menu,
    .bm-page-header,
    .bm-form,
    .bm-form__actions,
    .bm-form--compact,
    .bm-cat-picker,
    .bm-scan-compact,
    .bm-header,
    .bm-form__section-header .bm-btn,
    .bm-no-print {
        display: none !important;
    }

    /* Titre d'impression visible */
    .bm-print-title {
        display: block !important;
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 8px;
        border-bottom: 2px solid var(--bm-print-text);
        padding-bottom: 4px;
    }

    .bm-print-subtitle {
        display: block !important;
        font-size: 0.9rem;
        color: var(--bm-print-text-secondary);
        margin-bottom: 16px;
    }

    /* Tableau transactions — forcer colonnes sur une ligne */
    .bm-ticket-lines__table,
    .bm-ticket-lines__table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .bm-ticket-lines__table {
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }

    .bm-ticket-lines__table thead,
    .bm-ticket-lines__table tbody,
    .bm-ticket-lines__table tfoot {
        display: table-header-group !important;
    }

    .bm-ticket-lines__table tbody {
        display: table-row-group !important;
    }

    .bm-ticket-lines__table tr {
        display: table-row !important;
    }

    .bm-ticket-lines__table th,
    .bm-ticket-lines__table td {
        display: table-cell !important;
        padding: 3px 6px !important;
        font-size: 0.75rem !important;
        border-bottom: 1px solid var(--bm-print-border-light) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Colonnes : Date 15% | Description reste | Montant 20% */
    .bm-ticket-lines__table th:first-child,
    .bm-ticket-lines__table td:first-child {
        width: 15% !important;
        text-align: left !important;
    }

    .bm-ticket-lines__table th:nth-child(2),
    .bm-ticket-lines__table td:nth-child(2) {
        text-align: left !important;
    }

    .bm-ticket-lines__table th:last-child,
    .bm-ticket-lines__table td:last-child,
    .bm-th-right {
        width: 20% !important;
        text-align: right !important;
    }

    .bm-th-left {
        text-align: left !important;
    }

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

    .bm-header {
        position: static;
        border-bottom: 2px solid var(--bm-print-text);
        backdrop-filter: none;
    }

    .bm-card {
        box-shadow: none;
        border: 1px solid var(--bm-print-border);
        break-inside: avoid;
    }

    body {
        background: var(--bm-bg-card);
        color: var(--bm-print-text);
    }
}

/* ========================================================================
   V. SURCHARGES FORMULAIRES JOOMLA
   Stylise les éléments de formulaire natifs Joomla pour correspondre au design system
   ======================================================================== */

/* Tous les inputs, selects et textareas dans la zone de contenu */
.bm-content input[type="text"],
.bm-content input[type="number"],
.bm-content input[type="email"],
.bm-content input[type="tel"],
.bm-content input[type="url"],
.bm-content input[type="password"],
.bm-content input[type="search"],
.bm-content input[type="date"],
.bm-content input[type="datetime-local"],
.bm-content input[type="color"],
.bm-content select,
.bm-content textarea,
.bm-form input[type="text"],
.bm-form input[type="number"],
.bm-form input[type="email"],
.bm-form input[type="tel"],
.bm-form input[type="url"],
.bm-form input[type="password"],
.bm-form input[type="search"],
.bm-form input[type="date"],
.bm-form input[type="datetime-local"],
.bm-form select,
.bm-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bm-bg-input);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    color: var(--bm-text-primary);
    transition: border-color var(--bm-transition), box-shadow var(--bm-transition);
    box-sizing: border-box;
    appearance: none;
}

.bm-content input:focus,
.bm-content select:focus,
.bm-content textarea:focus,
.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);
}

/* Selects — flèche personnalisée */
.bm-content select,
.bm-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Color input natif */
.bm-content input[type="color"],
.bm-form input[type="color"] {
    width: 100%;
    height: 44px;
    padding: 2px;
    cursor: pointer;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    background: var(--bm-bg-input);
}

/* Champ couleur compact (carré) — masquer l'input, afficher que le swatch */
.bm-form__group--color {
    max-width: 50px;
    min-width: 44px;
}

.bm-form__group--color .minicolors-input,
.bm-form__group--color input.minicolors-input {
    font-size: 0 !important;
    width: 44px !important;
    height: 44px !important;
    padding: 4px !important;
    cursor: pointer !important;
}

.bm-form__group--color .minicolors-input-swatch {
    top: 50% !important;
    transform: translateY(-50%);
    left: 4px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 6px !important;
}

.bm-form__group--color .minicolors-input-swatch .minicolors-swatch-color {
    border-radius: 6px !important;
}

/* ---- Sélecteur de couleur personnalisé ---- */
.bm-color-picker {
    position: relative;
}

.bm-color-picker__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    background: var(--bm-bg-input);
    cursor: pointer;
    height: 40px;
    transition: border-color var(--bm-transition);
}

.bm-color-picker__trigger:hover,
.bm-color-picker__trigger:focus-within {
    border-color: var(--bm-primary);
}

.bm-color-picker__swatch {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.15);
    display: inline-block;
    flex-shrink: 0;
}

.bm-color-picker__hex {
    font-family: monospace;
    font-size: 0.82rem;
    background: none;
    border: none;
    outline: none;
    color: inherit;
    width: 70px;
    padding: 0;
    cursor: text;
    letter-spacing: 0.03em;
}

.bm-color-picker__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 600;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-md);
    box-shadow: var(--bm-shadow-lg);
    padding: 10px;
    min-width: 220px;
    animation: bm-fab-menu-in 0.12s ease;
}

.bm-color-picker__preset {
    width: 100%;
    padding-top: 100%;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
    display: block;
}

.bm-color-picker__preset:hover {
    transform: scale(1.18);
    border-color: rgba(255,255,255,0.6);
    outline: 2px solid rgba(0,0,0,0.2);
    outline-offset: 1px;
}

/* Grille bankaccount ligne 1 : couleur + 3 champs */
.bm-form__row--bank1 {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr;
    gap: var(--bm-space-sm);
    align-items: end;
}

@media (max-width: 767px) {
    .bm-form__row--bank1 {
        grid-template-columns: 50px 1fr;
    }
}

/* File input — stylé comme un bouton */
.bm-content input[type="file"],
.bm-form input[type="file"] {
    padding: 8px 12px;
    background: var(--bm-bg-input);
    border: 2px dashed var(--bm-border);
    border-radius: var(--bm-radius-sm);
    cursor: pointer;
    color: var(--bm-text-secondary);
    font-size: 0.8rem;
    width: 100%;
}

.bm-content input[type="file"]:hover,
.bm-form input[type="file"]:hover {
    border-color: var(--bm-primary);
    background: var(--bm-primary-bg);
}

.bm-content input[type="file"]::file-selector-button,
.bm-form input[type="file"]::file-selector-button {
    padding: 6px 12px;
    border: none;
    border-radius: var(--bm-radius-sm);
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: var(--bm-space-sm);
    transition: background var(--bm-transition);
}

.bm-content input[type="file"]::file-selector-button:hover,
.bm-form input[type="file"]::file-selector-button:hover {
    background: var(--bm-primary-dark);
}

/* Champ calendrier Joomla — masquer le bouton, icône intégrée */
.bm-form .field-calendar .btn,
.bm-form .input-group > button[id$="_btn"],
.bm-content .field-calendar .btn,
.bm-content .input-group > button[id$="_btn"] {
    display: none !important;
}

.bm-form .field-calendar .input-group,
.bm-content .field-calendar .input-group,
.bm-form .input-group:has(> button[id$="_btn"]) {
    position: relative;
}

.bm-form .field-calendar input,
.bm-content .field-calendar input,
.bm-form .input-group:has(> button[id$="_btn"]) > input {
    padding-right: 36px !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
}

/* Clic sur l'input calendrier déclenche le bouton caché */
@supports selector(:has(*)) {
    .bm-form .input-group:has(> button[id$="_btn"]) > input:focus ~ button {
        display: block !important;
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }
}

/* Fieldset Joomla radio — supprimer le cadre et le label dupliqué */
.bm-content fieldset,
.bm-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.bm-content fieldset > legend,
.bm-form fieldset > legend {
    display: none;
}

/* Labels Joomla */
.bm-content label,
.bm-form label,
.bm-content .control-label,
.bm-form .control-label {
    display: block;
    margin-bottom: var(--bm-space-xs);
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--bm-text-secondary);
}

/* Groupes de champs Joomla */
.bm-content .control-group,
.bm-form .control-group {
    margin-bottom: var(--bm-space-md);
}

/* Radio buttons Joomla 5 (Bootstrap 5 btn-check) */
.bm-content .btn-group,
.bm-form .btn-group {
    display: inline-flex;
    gap: 0;
    border-radius: var(--bm-radius-sm);
    overflow: hidden;
    border: 1px solid var(--bm-border);
}

/* Masquer les inputs radio natifs */
.bm-content .btn-group .btn-check,
.bm-form .btn-group .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

/* Labels comme boutons */
.bm-content .btn-group label,
.bm-content .btn-group .btn,
.bm-form .btn-group label,
.bm-form .btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    margin: 0;
    background: var(--bm-bg-input);
    color: var(--bm-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-right: 1px solid var(--bm-border);
    border-radius: 0;
    transition: all var(--bm-transition);
}

.bm-content .btn-group label:last-of-type,
.bm-form .btn-group label:last-of-type {
    border-right: none;
}

/* État actif — btn-check:checked + label */
.bm-content .btn-group .btn-check:checked + label,
.bm-content .btn-group .btn-check:checked + .btn,
.bm-form .btn-group .btn-check:checked + label,
.bm-form .btn-group .btn-check:checked + .btn,
.bm-content .btn-group label.active,
.bm-form .btn-group label.active {
    background: var(--bm-primary) !important;
    color: var(--bm-text-inverse) !important;
    border-color: var(--bm-primary) !important;
}

/* Hover */
.bm-content .btn-group label:hover,
.bm-form .btn-group label:hover {
    background: var(--bm-primary-bg);
}

/* Ancien fallback */
.bm-content .btn-group input[type="radio"],
.bm-form .btn-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
}

/* Bouton calendrier Joomla */
.bm-content .field-calendar .btn,
.bm-form .field-calendar .btn,
.bm-content button[data-toggle="calendar"],
.bm-form button[data-toggle="calendar"] {
    background: var(--bm-primary);
    color: var(--bm-text-inverse);
    border: none;
    padding: 8px 12px;
    border-radius: var(--bm-radius-sm);
    cursor: pointer;
}

/* Placeholder style */
.bm-content input::placeholder,
.bm-content textarea::placeholder,
.bm-form input::placeholder,
.bm-form textarea::placeholder {
    color: var(--bm-text-muted);
}

/* Textarea */
.bm-content textarea,
.bm-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* Messages flash Joomla natifs */
.bm-content .alert,
.bm-content .alert-message {
    padding: var(--bm-space-md);
    border-radius: var(--bm-radius-sm);
    margin-bottom: var(--bm-space-md);
    border-left: 4px solid;
}

.bm-content .alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--bm-success);
    color: var(--bm-success);
}

.bm-content .alert-danger,
.bm-content .alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--bm-danger);
    color: var(--bm-danger);
}

.bm-content .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--bm-warning);
    color: var(--bm-warning);
}

.bm-content .alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--bm-info);
    color: var(--bm-info);
}

/* Details/summary (Plus de détails) */
.bm-content details,
.bm-form details {
    margin: var(--bm-space-md) 0;
}

.bm-content summary,
.bm-form summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--bm-primary);
    padding: var(--bm-space-sm) 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
}

.bm-content summary::before,
.bm-form summary::before {
    content: '▸';
    transition: transform var(--bm-transition);
}

.bm-content details[open] summary::before,
.bm-form details[open] summary::before {
    transform: rotate(90deg);
}

/* Masquer les styles Joomla par défaut qui cassent le design */
.bm-content .form-control {
    background: var(--bm-bg-input) !important;
    border-color: var(--bm-border) !important;
    color: var(--bm-text-primary) !important;
}

/* Zone d'action du formulaire sticky sur mobile */
@media (max-width: 767px) {
    .bm-form__actions,
    .bm-content .form-actions {
        position: sticky;
        bottom: 70px;
        background: var(--bm-bg-card);
        padding: var(--bm-space-md);
        border-top: 1px solid var(--bm-border);
        margin: 0 calc(-1 * var(--bm-space-md));
        z-index: 10;
    }
}

/* ========================================================================
   W. COMPOSANTS DE PAGE ET ESPACEMENT
   ======================================================================== */

.bm-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--bm-space-lg);
    gap: var(--bm-space-md);
}

.bm-transactions__item {
    display: flex;
    align-items: center;
    padding: 14px var(--bm-space-md);
    gap: var(--bm-space-md);
    border-bottom: 1px solid var(--bm-border);
    text-decoration: none;
    color: inherit;
    transition: background var(--bm-transition);
    min-height: 64px;
}

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

.bm-transactions__icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--bm-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background-color: color-mix(in srgb, var(--bm-cat-color, #94A3B8) 15%, transparent);
    color: var(--bm-cat-color, #94A3B8);
}

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

.bm-transactions__description {
    font-weight: 500;
    font-size: 0.9375rem;
    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 {
    font-weight: 600;
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    min-width: 80px;
}

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

/* .bm-avatar, .bm-badge, .bm-empty-state — définis dans les sections U-15, K, U-2 */

/* =============================================
 * V) Panneau d'ajout rapide (Quick Add)
 * ============================================= */
.bm-quick-panel { display: none; position: fixed; inset: 0; z-index: 500; }
.bm-quick-panel--open { display: flex; flex-direction: column; justify-content: flex-end; }
.bm-quick-panel__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.bm-quick-panel__content { position: relative; background: var(--bm-bg-card); border-radius: var(--bm-radius-lg) var(--bm-radius-lg) 0 0; padding: var(--bm-space-lg); max-height: 85vh; overflow-y: auto; }
.bm-quick-panel__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--bm-space-md); }
.bm-quick-panel__header h3 { margin: 0; font-size: 1.125rem; }
.bm-quick-panel__close { background: none; border: none; font-size: 1.5rem; color: var(--bm-text-muted); cursor: pointer; }
.bm-quick-panel__amount { text-align: center; padding: var(--bm-space-lg) 0; }
.bm-quick-panel__amount span:first-child { font-size: 2.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bm-text-primary); }
.bm-quick-panel__currency { font-size: 1.25rem; color: var(--bm-text-muted); margin-left: var(--bm-space-sm); }
.bm-quick-panel__keypad { display: grid; grid-template-columns: 3fr 2fr; gap: var(--bm-space-sm); margin-bottom: var(--bm-space-md); }
.bm-quick-panel__key { padding: 16px; font-size: 1.25rem; font-weight: 600; background: var(--bm-bg-input); border: 1px solid var(--bm-border); border-radius: var(--bm-radius-sm); cursor: pointer; color: var(--bm-text-primary); transition: all var(--bm-transition); }
.bm-quick-panel__key:active { background: var(--bm-primary); color: var(--bm-text-inverse); transform: scale(0.95); }
.bm-quick-panel__label { text-align: center; color: var(--bm-text-secondary); margin-bottom: var(--bm-space-md); }
.bm-quick-panel__categories { display: grid; grid-template-columns: 3fr 2fr; gap: var(--bm-space-sm); }
.bm-quick-panel__cat { display: flex; flex-direction: column; align-items: center; gap: var(--bm-space-xs); padding: var(--bm-space-md); background: var(--bm-bg-input); border: 1px solid var(--bm-border); border-radius: var(--bm-radius-md); cursor: pointer; color: var(--bm-text-primary); font-size: 0.75rem; transition: all var(--bm-transition); }
.bm-quick-panel__cat i { font-size: 1.25rem; }
.bm-quick-panel__cat:active { border-color: var(--bm-primary); background: rgba(99,102,241,0.1); transform: scale(0.95); }
.bm-quick-panel__success { text-align: center; padding: var(--bm-space-xl); }
.bm-quick-panel__success i { font-size: 3rem; color: var(--bm-success); margin-bottom: var(--bm-space-md); }
.bm-quick-panel__success p { font-size: 1.125rem; font-weight: 600; }
.bm-quick-panel__next { margin-top: var(--bm-space-sm); }

/* =============================================
 * W) Alertes de dépassement budgétaire
 * ============================================= */
.bm-alerts-budget { display: flex; flex-direction: column; gap: var(--bm-space-sm); margin-bottom: var(--bm-space-md); }
/* .bm-alert — défini dans la section L) Alertes */
.bm-alert i { flex-shrink: 0; }
.bm-alert--warning { background: var(--bm-warning-bg); color: var(--bm-warning-dark); border: 1px solid rgba(245,158,11,0.3); }
.bm-alert--danger { background: var(--bm-danger-bg); color: var(--bm-danger-dark); border: 1px solid rgba(239,68,68,0.3); }

[data-theme="dark"] .bm-alert--warning { color: var(--bm-warning-light); }
[data-theme="dark"] .bm-alert--danger { color: var(--bm-danger-light); }

/* =============================================
 * X) Carte budget glissant
 * ============================================= */
.bm-card--gliding { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--bm-space-sm); margin-top: var(--bm-space-md); margin-bottom: var(--bm-space-lg); padding: var(--bm-space-lg); }
.bm-card--gliding .bm-card__icon { margin: 0 auto; }
.bm-card--gliding .bm-card__body { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* =============================================
 * Y) Onboarding wizard
 * ============================================= */
.bm-onboarding {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    padding: var(--bm-space-lg);
}
.bm-onboarding__card {
    background: var(--bm-bg-card);
    border-radius: var(--bm-radius-lg);
    padding: var(--bm-space-xl);
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--bm-shadow-xl);
    position: relative;
}
.bm-onboarding__card.bm-hidden {
    display: none !important;
}
.bm-onboarding__icon {
    font-size: 3rem;
    color: var(--bm-primary);
    margin-bottom: var(--bm-space-lg);
}
.bm-onboarding__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--bm-space-md);
}
.bm-onboarding__text {
    color: var(--bm-text-secondary);
    margin-bottom: var(--bm-space-lg);
}
.bm-onboarding__steps {
    display: flex;
    justify-content: center;
    gap: var(--bm-space-sm);
    margin-bottom: var(--bm-space-lg);
}
.bm-onboarding__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bm-border);
    transition: width 0.3s ease, border-radius 0.3s ease, background 0.3s ease;
}
.bm-onboarding__dot--active {
    background: var(--bm-primary);
    width: 24px;
    border-radius: 4px;
}
.bm-body--no-scroll { overflow: hidden; }

/* =============================================
 * Z) Page d'aide (FAQ)
 * ============================================= */
.bm-help__item { margin-bottom: var(--bm-space-sm); }
.bm-help__item summary {
    cursor: pointer;
    padding: var(--bm-space-md);
    font-weight: 500;
    color: var(--bm-text-primary);
    border-bottom: 1px solid var(--bm-border);
}
.bm-help__item summary:hover { color: var(--bm-primary); }
.bm-help__item[open] summary { color: var(--bm-primary); }
.bm-help__item p {
    padding: var(--bm-space-md);
    color: var(--bm-text-secondary);
    line-height: 1.6;
}
.bm-help__shortcuts { display: flex; flex-direction: column; gap: var(--bm-space-xs); }
.bm-help__shortcut-icon--primary { background-color: rgba(99,102,241,0.15); color: var(--bm-primary); }
.bm-help__shortcut-icon--success { background-color: rgba(16,185,129,0.15); color: var(--bm-success); }
.bm-help__shortcut-icon--warning { background-color: rgba(245,158,11,0.15); color: var(--bm-warning); }

/* =============================================
 * Z-1) Override profil utilisateur
 * ============================================= */
.bm-profile__header {
    display: flex;
    align-items: center;
    gap: var(--bm-space-lg);
    padding: var(--bm-space-md) 0;
}
.bm-profile__name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 var(--bm-space-xs) 0;
}
.bm-profile__email {
    color: var(--bm-text-secondary);
    margin: 0 0 var(--bm-space-xs) 0;
}
.bm-profile__meta {
    color: var(--bm-text-muted);
    font-size: 0.8125rem;
    margin: 0;
}
.bm-profile__actions {
    display: flex;
    gap: var(--bm-space-md);
    flex-wrap: wrap;
    padding: var(--bm-space-md) 0;
}
.bm-login__logo-icon { color: var(--bm-primary); }

/* ========================================================================
   ASSISTANT IA
   ======================================================================== */

.bm-ai-chat { max-width: 800px; }
.bm-ai-modes { display: flex; gap: var(--bm-space-sm); margin-bottom: var(--bm-space-lg); flex-wrap: wrap; }
.bm-ai-mode { padding: 10px 16px; border-radius: var(--bm-radius-full); border: 1px solid var(--bm-border); background: var(--bm-bg-input); color: var(--bm-text-secondary); cursor: pointer; font-size: 0.8125rem; font-weight: 500; transition: all var(--bm-transition); display: flex; align-items: center; gap: var(--bm-space-sm); }
.bm-ai-mode:hover { border-color: var(--bm-primary); }
.bm-ai-mode--active { background: var(--bm-primary); color: var(--bm-text-inverse); border-color: var(--bm-primary); }
.bm-ai-suggestions { margin-bottom: var(--bm-space-md); }
.bm-ai-suggestions__list { display: flex; gap: var(--bm-space-sm); flex-wrap: wrap; }
.bm-ai-suggestion { padding: 6px 12px; border-radius: var(--bm-radius-full); border: 1px solid var(--bm-border); background: var(--bm-bg-card); color: var(--bm-text-secondary); cursor: pointer; font-size: 0.75rem; transition: all var(--bm-transition); }
.bm-ai-suggestion:hover { border-color: var(--bm-primary); color: var(--bm-primary); }
.bm-ai-response { min-height: 200px; margin-bottom: var(--bm-space-md); line-height: 1.7; }
.bm-ai-response ul { padding-left: var(--bm-space-lg); margin: var(--bm-space-sm) 0; }
.bm-ai-response li { margin-bottom: var(--bm-space-xs); }
.bm-ai-response strong { color: var(--bm-primary); }
.bm-ai-input { display: flex; gap: var(--bm-space-sm); align-items: flex-end; }
.bm-ai-input textarea { flex: 1; }
.bm-ai-spinner { text-align: center; padding: var(--bm-space-xl); color: var(--bm-text-muted); }
.bm-ai-spinner i { display: block; margin-bottom: var(--bm-space-md); }

/* Utilitaire caché */
.bm-hidden { display: none !important; }

/* ========================================================================
   SIMULATEUR FISCAL - Wizard (surcharges et complements)
   ======================================================================== */

/* Etapes du wizard : affichage numero + label cote a cote */
.bm-tax-wizard__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bm-space-md);
    margin-bottom: var(--bm-space-xl);
    padding: 0 var(--bm-space-md);
}

.bm-tax-wizard__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bm-space-xs);
    opacity: 0.4;
    transition: opacity var(--bm-transition);
    width: auto;
    height: auto;
    border: none;
    background: none;
}

.bm-tax-wizard__step--active {
    opacity: 1;
    background: none;
    border: none;
}

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

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

.bm-tax-wizard__step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bm-text-secondary);
    text-align: center;
}

.bm-tax-wizard__step--active .bm-tax-wizard__step-label {
    color: var(--bm-primary);
    font-weight: 600;
}

.bm-tax-wizard__step-separator {
    width: 40px;
    height: 2px;
    background: var(--bm-border);
    flex-shrink: 0;
    align-self: center;
    margin-bottom: var(--bm-space-md);
}

/* Panels — masques par defaut, visibles avec la classe */
.bm-tax-wizard__panel { display: none; }
.bm-tax-wizard__panel--visible { display: block; }

/* Country selection buttons */
.bm-tax-countries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--bm-space-sm);
    margin: var(--bm-space-sm) 0;
}

@media (max-width: 500px) {
    .bm-tax-countries { grid-template-columns: repeat(2, 1fr); }
}

.bm-tax-region__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bm-tax-country {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--bm-space-sm);
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    text-decoration: none;
    color: var(--bm-text-primary);
    transition: all 0.15s;
    text-align: center;
    cursor: pointer;
}

.bm-tax-country:hover {
    border-color: var(--bm-primary);
    background: var(--bm-primary-bg, rgba(99, 102, 241, 0.08));
    transform: translateY(-1px);
}

.bm-tax-country--highlight {
    border-color: var(--bm-primary);
    border-width: 2px;
    background: var(--bm-primary-bg, rgba(99, 102, 241, 0.05));
}

.bm-tax-country__flag { font-size: 2rem; line-height: 1; }
.bm-tax-country__name { font-size: 0.8rem; font-weight: 600; }
.bm-tax-country__desc { font-size: 0.65rem; color: var(--bm-text-muted); }

.bm-tax-wizard__title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--bm-space-md);
}

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

.bm-tax-form { max-width: 600px; margin: 0 auto; }

.bm-tax-autocomplete { position: relative; }
.bm-tax-autocomplete__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    box-shadow: var(--bm-shadow-lg);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.bm-tax-autocomplete__item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--bm-border);
}

.bm-tax-autocomplete__item:hover { background: var(--bm-bg-input); }

/* .bm-btn--outline — défini dans la section J) Boutons. Variante wizard ci-dessous : */
.bm-tax-wizard .bm-btn--outline {
    border-color: var(--bm-border);
    color: var(--bm-text-secondary);
    padding: var(--bm-space-sm) var(--bm-space-md);
    font-size: 0.8125rem;
    text-decoration: none;
}

.bm-tax-wizard .bm-btn--outline:hover { border-color: var(--bm-primary); color: var(--bm-primary); }

/* ========================================================================
   SIMULATEUR FISCAL — Resultat ameliore
   ======================================================================== */

/* Carte principale mise en avant */
.bm-card--stat-highlight {
    background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark, #6d28d9));
    color: var(--bm-text-inverse);
    border: none;
}

.bm-card--stat-highlight .bm-card__label {
    color: rgba(255, 255, 255, 0.8);
}

.bm-card--stat-highlight .bm-card__value {
    color: var(--bm-text-inverse);
}

.bm-card--stat-highlight .bm-card__icon {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--bm-text-inverse);
}

.bm-card--stat-highlight .bm-card__sub {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
}

/* Valeur extra-large pour montant principal */
.bm-card__value--xl {
    font-size: 2rem;
}

/* Sous-texte de carte */
.bm-card__sub {
    font-size: 0.8125rem;
    color: var(--bm-text-secondary);
}

/* Grille des taux (effectif + marginal) */
.bm-tax-result-rates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--bm-space-md);
}

/* Grille de detail des composantes fiscales */
.bm-tax-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--bm-space-md);
}

/* Navigation du wizard resultat */
.bm-tax-wizard__nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-sm);
}

/* Etape done — cercle vert */
.bm-tax-wizard__step--done .bm-tax-wizard__step-number {
    background: var(--bm-success);
    border-color: var(--bm-success);
    color: var(--bm-text-inverse);
}

/* Force sidebar collapsed au chargement sans transition */
.bm-sidebar-init-collapsed .bm-sidebar {
    width: var(--bm-sidebar-collapsed-width) !important;
    transition: none !important;
}
.bm-sidebar-init-collapsed .bm-sidebar .bm-sidebar__label {
    opacity: 0 !important;
    width: 0 !important;
}
.bm-sidebar-init-collapsed .bm-main {
    margin-left: var(--bm-sidebar-collapsed-width) !important;
    transition: none !important;
}

/* Alertes budget compactes — badges en ligne */
.bm-alerts-budget-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-sm) var(--bm-space-md);
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--bm-radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.15);
    margin-bottom: var(--bm-space-md);
    font-size: 0.8125rem;
}

.bm-alerts-budget-compact > i {
    color: var(--bm-danger);
    font-size: 0.875rem;
}

/* ========================================================================
   HUB OUTILS IA — Grille de cartes
   ======================================================================== */

.bm-aitools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--bm-space-lg);
    margin-top: var(--bm-space-lg);
}

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

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

.bm-aitools-card {
    display: flex;
    flex-direction: column;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-lg);
    padding: var(--bm-space-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    cursor: pointer;
}

.bm-aitools-card:hover {
    border-color: var(--bm-primary);
    box-shadow: var(--bm-shadow-lg);
    transform: translateY(-4px);
}

.bm-aitools-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--bm-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bm-text-inverse);
    font-size: 1.5rem;
    margin-bottom: var(--bm-space-md);
}

.bm-aitools-card__body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 var(--bm-space-xs) 0;
    color: var(--bm-text-primary);
}

.bm-aitools-card__body p {
    font-size: 0.8125rem;
    color: var(--bm-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.bm-aitools-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-space-xs);
    margin-top: var(--bm-space-md);
}

/* ============================================
   Scan multi-tickets (batch)
   ============================================ */

.bm-scan-batch-drop {
    border: 2px dashed var(--bm-border);
    border-radius: var(--bm-radius);
    padding: var(--bm-space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--bm-transition);
}

.bm-scan-batch-drop:hover,
.bm-scan-batch-drop--active {
    border-color: var(--bm-primary);
    background: rgba(99, 102, 241, 0.05);
}

.bm-scan-batch-drop__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bm-batch-ticket {
    padding: 0 !important;
    overflow: hidden;
    transition: all var(--bm-transition);
}

.bm-batch-ticket__header {
    display: flex;
    align-items: center;
    gap: var(--bm-space-sm);
    padding: var(--bm-space-sm) var(--bm-space-md);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--bm-border);
}

.bm-batch-ticket__preview {
    flex: 0 0 60px;
    height: 60px;
    border-radius: var(--bm-radius-sm);
    overflow: hidden;
}

.bm-batch-ticket__preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--bm-radius-sm);
}

.bm-batch-ticket__status {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.bm-batch-ticket__remove {
    flex: 0 0 auto;
}

.bm-batch-ticket__body {
    padding: var(--bm-space-sm) var(--bm-space-md);
}

.bm-batch-ticket__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--bm-space-xs);
}

.bm-batch-ticket--done {
    border-left: 3px solid var(--bm-success, #22C55E);
}

.bm-batch-ticket--error {
    border-left: 3px solid var(--bm-danger, #EF4444);
    opacity: 0.7;
}

.bm-batch-ticket__preview {
    cursor: zoom-in;
}

.bm-batch-ticket__grid--5 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--bm-space-xs);
}

/* Modal aperçu ticket */
.bm-ticket-modal__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-ticket-modal__content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow-xl);
}

.bm-ticket-modal__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bm-bg-card);
    color: var(--bm-text);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--bm-shadow-md);
    z-index: 10;
    transition: all var(--bm-transition);
}

.bm-ticket-modal__close:hover {
    background: var(--bm-danger);
    color: #fff;
}

/* Panneau conversion devise */
.bm-fx-panel {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--bm-radius-sm);
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.bm-fx-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--bm-primary);
    margin-bottom: 10px;
}

.bm-fx-panel__original {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 700;
}

.bm-fx-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 1fr;
    gap: var(--bm-space-xs);
    align-items: end;
}

@media (max-width: 768px) {
    .bm-fx-panel__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Multi-select personnes (tags) */
.bm-persons-select {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 32px;
    padding: 3px 6px;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    background: var(--bm-bg-input);
    cursor: pointer;
    align-items: center;
}

.bm-persons-select__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 99px;
    background: var(--bm-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.bm-persons-select__tag-remove {
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.65rem;
}

.bm-persons-select__tag-remove:hover {
    opacity: 1;
}

.bm-persons-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bm-bg-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    box-shadow: var(--bm-shadow-md);
    z-index: 20;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

.bm-persons-dropdown--open {
    display: block;
}

.bm-persons-dropdown__item {
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bm-persons-dropdown__item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.bm-persons-dropdown__item--selected {
    background: rgba(99, 102, 241, 0.08);
    font-weight: 600;
}

@media (max-width: 768px) {
    .bm-batch-ticket__grid,
    .bm-batch-ticket__grid--5 {
        grid-template-columns: 1fr 1fr;
    }
}

/* === Badges système === */
.bm-badge--review {
    font-size: 0.55rem;
    padding: 1px 6px;
    border-radius: 99px;
    margin-left: 4px;
    font-weight: 600;
    vertical-align: middle;
    cursor: pointer;
}
.bm-badge--review-pending {
    background: rgba(245,158,11,0.15);
    color: #b45309;
    border: 1px solid rgba(245,158,11,0.3);
}
.bm-badge--review-done {
    background: rgba(16,185,129,0.12);
    color: #059669;
    border: 1px solid rgba(16,185,129,0.3);
}
.bm-badge--scan {
    font-size: 0.55rem;
    background: rgba(99,102,241,0.12);
    color: var(--bm-primary);
    padding: 1px 5px;
    border-radius: 99px;
    margin-left: 2px;
    font-weight: 600;
    vertical-align: middle;
}
.bm-badge--csv {
    font-size: 0.55rem;
    background: rgba(16,185,129,0.12);
    color: var(--bm-success);
    padding: 1px 5px;
    border-radius: 99px;
    margin-left: 2px;
    font-weight: 600;
    vertical-align: middle;
}
.bm-badge--merge {
    font-size: 0.55rem;
    background: rgba(99,102,241,0.12);
    color: #4f46e5;
    padding: 1px 5px;
    border-radius: 99px;
    margin-left: 2px;
    font-weight: 600;
    vertical-align: middle;
}
.bm-badge--recurring {
    font-size: 0.55rem;
    background: rgba(168,85,247,0.12);
    color: #7c3aed;
    padding: 1px 5px;
    border-radius: 99px;
    margin-left: 2px;
    font-weight: 600;
    vertical-align: middle;
}
[data-theme="dark"] .bm-badge--recurring {
    background: rgba(168,85,247,0.2);
    color: #a78bfa;
}

/* Toggle récurrence pause/play */
.bm-rec-card {
    position: relative;
}
.bm-rec-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--bm-border);
    background: var(--bm-bg-card);
    color: var(--bm-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s;
}
.bm-rec-toggle:hover {
    background: var(--bm-primary);
    color: #fff;
    border-color: var(--bm-primary);
}
.bm-rec-card--inactive {
    opacity: 0.5;
}
.bm-rec-card--inactive .bm-card-mini__amount {
    text-decoration: line-through;
}

/* ============================================
   BUDGET INTELLIGENCE
   ============================================ */

/* Score */
.bm-bi-score-card { padding: var(--bm-space-md); }
.bm-bi-score { display: flex; align-items: center; gap: var(--bm-space-lg); flex-wrap: wrap; }
.bm-bi-score__gauge { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.bm-bi-score__svg { width: 100%; height: 100%; }
.bm-bi-score__value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bm-bi-score__number { font-size: 2rem; font-weight: 800; line-height: 1; }
.bm-bi-score__label { font-size: 0.7rem; color: var(--bm-text-muted); }
.bm-bi-score__details { flex: 1; min-width: 200px; }
.bm-bi-score__grade { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.bm-bi-score__row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 0.8rem; }
.bm-bi-score__row > span:first-child { width: 140px; color: var(--bm-text-secondary); }
.bm-bi-score__bar { flex: 1; height: 6px; background: var(--bm-border); border-radius: 3px; overflow: hidden; }
.bm-bi-score__bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease-out; }
.bm-bi-score__pts { width: 40px; text-align: right; font-weight: 600; font-size: 0.75rem; }

/* Catégories */
.bm-bi-cat-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bm-border); }
.bm-bi-cat-row:last-child { border-bottom: none; }
.bm-bi-cat-icon { width: 24px; text-align: center; font-size: 0.85rem; }
.bm-bi-cat-name { width: 110px; font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-bi-cat-bar { flex: 1; height: 8px; background: var(--bm-border); border-radius: 4px; overflow: hidden; }
.bm-bi-cat-bar { display: flex; }
.bm-bi-cat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease-out; }
.bm-bi-cat-bar-fill--pending { border-radius: 0 4px 4px 0; }
.bm-bi-cat-amount { width: 70px; text-align: right; font-weight: 600; font-size: 0.85rem; }
.bm-bi-cat-trend { width: 50px; text-align: right; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.bm-bi-cat-head { display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; border-bottom: 2px solid var(--bm-border); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--bm-text-secondary); letter-spacing: 0.05em; }
.bm-bi-cat-head .bm-bi-cat-amount, .bm-bi-cat-head .bm-bi-cat-trend { font-size: 0.65rem; font-weight: 700; color: var(--bm-text-secondary); }
@media (max-width: 640px) {
    .bm-bi-cat-name { width: 90px; }
    .bm-bi-cat-trend { width: 40px; font-size: 0.65rem; }
    .bm-bi-cat-head { font-size: 0.6rem; }
}

/* Projections */
/* Comparaison 2 colonnes */
.bm-bi-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bm-space-md); }
@media (max-width: 768px) {
    .bm-bi-compare-grid { grid-template-columns: 1fr; }
}

.bm-bi-proj--current { border: 2px solid var(--bm-primary); }

/* Projections compactes — grille 6 mois responsive */
.bm-bi-proj-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--bm-space-xs);
}
@media (max-width: 1100px) { .bm-bi-proj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .bm-bi-proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bm-bi-proj-card {
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    text-align: center;
}
.bm-bi-proj-card__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bm-text-secondary);
}
.bm-bi-proj-card__balance {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}
.bm-bi-proj-card__currency {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.7;
    margin-left: 2px;
}
.bm-bi-proj-card__split {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding-top: 4px;
    border-top: 1px solid var(--bm-border);
}
.bm-bi-proj-card__detail {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.66rem;
    color: var(--bm-text-secondary);
    padding-top: 4px;
    border-top: 1px dashed var(--bm-border);
}
.bm-bi-proj-card__detail i { font-size: 0.6rem; }

/* Joomla Calendar dark mode fix */
[data-theme="dark"] .calendar-container,
[data-theme="dark"] .calendar-container table {
    --calendar-bg: var(--bm-bg-card);
    --calendar-week-bg: var(--bm-bg-input);
    background-color: var(--bm-bg-card);
    color: var(--bm-text-primary);
    border: 1px solid var(--bm-border);
}
[data-theme="dark"] .calendar-container table thead td.headrow {
    color: var(--bm-text-primary);
    background: var(--bm-bg-input);
}
[data-theme="dark"] .calendar-container table thead td.name {
    color: var(--bm-text-secondary);
    border-bottom-color: var(--bm-border);
}
[data-theme="dark"] .calendar-container table thead td.weekend {
    color: var(--bm-text-muted);
}
[data-theme="dark"] .calendar-container table tbody td {
    color: var(--bm-text-primary);
}
[data-theme="dark"] .calendar-container table tbody td.weekend {
    color: var(--bm-text-muted);
}
[data-theme="dark"] .calendar-container table tbody td.wn,
[data-theme="dark"] .calendar-container table tbody td.day.wn {
    background-color: var(--bm-bg-input);
    color: var(--bm-text-muted);
}
[data-theme="dark"] .calendar-container table tbody td.hilite {
    background: var(--bm-primary);
    color: #fff;
}
[data-theme="dark"] .calendar-container table tbody td.day.othermonth {
    color: var(--bm-text-muted);
    opacity: 0.4;
}
[data-theme="dark"] .calendar-container table tfoot td {
    color: var(--bm-text-secondary);
    background: var(--bm-bg-input);
}
[data-theme="dark"] .calendar-container .nav {
    color: var(--bm-primary);
}
[data-theme="dark"] .js-calendar {
    box-shadow: 0 0 15px 4px rgba(0,0,0,0.5) !important;
}

/* Récurrences accordion */
.bm-bi-rec-group { border-bottom: 1px solid var(--bm-border); }
.bm-bi-rec-group:last-child { border-bottom: none; }
.bm-bi-rec-header { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; }
.bm-bi-rec-header:hover { background: var(--bm-bg-input); }
.bm-bi-rec-items { display: none; padding: 0 0 8px 32px; }
.bm-bi-rec-group--open .bm-bi-rec-items { display: block; }
.bm-bi-rec-group--open .bm-bi-rec-chevron { transform: rotate(180deg); }
.bm-bi-rec-chevron { transition: transform 0.2s; }
.bm-bi-rec-item { display: flex; justify-content: space-between; padding: 3px 0; font-size: 0.8rem; }

/* Catégories accordion */
.bm-bi-cat-group { border-bottom: 1px solid var(--bm-border); }
.bm-bi-cat-group:last-child { border-bottom: none; }
.bm-bi-cat-chevron { transition: transform 0.2s; }
.bm-bi-cat-group--open .bm-bi-cat-chevron { transform: rotate(180deg); }
.bm-bi-cat-detail { display: none; padding: 0 0 6px 0; }
.bm-bi-cat-group--open .bm-bi-cat-detail { display: block; }
.bm-bi-cat-tx { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 32px; font-size: 0.78rem; text-decoration: none; color: var(--bm-text-primary); border-radius: var(--bm-radius-sm); }
.bm-bi-cat-tx:hover { background: var(--bm-bg-input); }
.bm-bi-cat-tx-date { width: 40px; color: var(--bm-text-muted); font-size: 0.7rem; flex-shrink: 0; }
.bm-bi-cat-tx-desc { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-bi-cat-tx-amount { font-weight: 600; white-space: nowrap; }

/* Futures dépenses */
/* Grille 2 colonnes pour les 12 mois à venir */
.bm-bi-future-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.bm-bi-future-grid .bm-card { margin-bottom: 0; }
@media (max-width: 600px) { .bm-bi-future-grid { grid-template-columns: 1fr; } }

.bm-bi-future-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 0.82rem; border-bottom: 1px solid var(--bm-border); }
.bm-bi-future-item:last-child { border-bottom: none; }
.bm-bi-future-type { width: 20px; text-align: center; flex-shrink: 0; font-size: 0.75rem; }
.bm-bi-future-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-bi-future-amount { font-weight: 600; white-space: nowrap; }
.bm-bi-future-item--linked { background: rgba(16,185,129,0.04); }
.bm-bi-link-btn { padding: 2px 4px !important; opacity: 0.4; }
.bm-bi-link-btn:hover { opacity: 1; }
.bm-bi-future-item--linked .bm-bi-future-name { color: var(--bm-success); }

/* Suggestions */
.bm-bi-sug-table { display: flex; flex-direction: column; gap: 4px; }
.bm-bi-sug-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: var(--bm-radius-sm); }
.bm-bi-sug-row:hover { background: var(--bm-bg-input); }
.bm-bi-sug-icon { width: 24px; text-align: center; }
.bm-bi-sug-info { flex: 1; min-width: 0; }
.bm-bi-sug-info strong { display: block; font-size: 0.85rem; }
.bm-bi-sug-amounts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.bm-bi-sug-check { flex-shrink: 0; }
.bm-bi-sug-input { font-weight: 600; }

/* Conseils */
.bm-bi-tip { padding: 10px 12px !important; }

/* Section title */
.bm-section-title { font-size: 1rem; font-weight: 700; margin: var(--bm-space-md) 0 var(--bm-space-sm); display: flex; align-items: center; gap: 8px; }
.bm-section-title i { color: var(--bm-primary); }

/* Toggle dépense/revenu (legacy) */
.bm-toggle-type { display: flex; border-radius: var(--bm-radius-sm); overflow: hidden; border: 1px solid var(--bm-border); }
.bm-toggle-type__btn { padding: 4px 10px; font-size: 0.75rem; border: none; background: var(--bm-bg-card); color: var(--bm-text-secondary); cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.bm-toggle-type__btn--active { background: var(--bm-danger); color: #fff; font-weight: 600; }
.bm-toggle-type__btn--income { background: var(--bm-success) !important; }

/* Barre de pilules d'options (formulaire dépense) */
.bm-option-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--bm-space-sm); }
.bm-option-pill-group { display: flex; border-radius: var(--bm-radius-sm); overflow: hidden; border: 1px solid var(--bm-border); }
.bm-option-pill-group .bm-option-pill { border-radius: 0; border: none; border-right: 1px solid var(--bm-border); }
.bm-option-pill-group .bm-option-pill:last-child { border-right: none; }
.bm-option-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; font-size: 0.8rem; font-weight: 500; border: 1px solid var(--bm-border); border-radius: var(--bm-radius-sm); background: var(--bm-bg-card); color: var(--bm-text-secondary); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap; line-height: 1.3; }
.bm-option-pill:hover { background: rgba(255,255,255,0.06); color: var(--bm-text); }
.bm-option-pill--active-danger  { background: rgba(239,68,68,0.15);  color: var(--bm-danger);  border-color: rgba(239,68,68,0.4);  font-weight: 600; }
.bm-option-pill--active-success { background: rgba(16,185,129,0.15); color: var(--bm-success); border-color: rgba(16,185,129,0.4); font-weight: 600; }
.bm-option-pill--active-warning { background: rgba(245,158,11,0.15); color: #f59e0b;            border-color: rgba(245,158,11,0.4); font-weight: 600; }
.bm-option-pill--active-primary { background: rgba(99,102,241,0.15); color: var(--bm-primary);  border-color: rgba(99,102,241,0.4); font-weight: 600; }
.bm-option-pill--active-info    { background: rgba(6,182,212,0.15);  color: #06b6d4;            border-color: rgba(6,182,212,0.4);  font-weight: 600; }
.bm-option-pill--active-violet  { background: rgba(139,92,246,0.15); color: #8b5cf6;            border-color: rgba(139,92,246,0.4); font-weight: 600; }
@media (max-width: 480px) { .bm-option-pills { gap: 4px; } .bm-option-pill { padding: 4px 9px; font-size: 0.75rem; } }

/* Bloc lissage annuel (récurrences) */
.bm-spread-block { border: 1px solid var(--bm-border); border-radius: var(--bm-radius-sm); margin-bottom: var(--bm-space-sm); overflow: hidden; transition: border-color 0.2s; }
.bm-spread-block--active { border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.04); }
.bm-spread-block__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; user-select: none; }
.bm-spread-block__header:hover { background: rgba(255,255,255,0.03); }
.bm-spread-block__body { padding: 12px 14px; border-top: 1px solid var(--bm-border); }
.bm-spread-block__toggle-wrap { flex-shrink: 0; }
.bm-spread-block__toggle { width: 36px; height: 20px; border-radius: 10px; background: var(--bm-border); position: relative; transition: background 0.2s; }
.bm-spread-block--active .bm-spread-block__toggle { background: #8b5cf6; }
.bm-spread-block__toggle-knob { width: 16px; height: 16px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.bm-spread-block--active .bm-spread-block__toggle-knob { left: 18px; }
.bm-spread-block__preview { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bm-spread-monthly-preview { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(139,92,246,0.1); border-radius: var(--bm-radius-sm); color: #8b5cf6; font-size: 0.88rem; min-width: 160px; }
.bm-spread-block__info { margin-top: 10px; padding: 8px 12px; background: rgba(99,102,241,0.06); border-radius: var(--bm-radius-sm); font-size: 0.75rem; color: var(--bm-text-secondary); display: flex; align-items: center; gap: 8px; }
.bm-spread-block__info i { color: var(--bm-primary); flex-shrink: 0; }

/* Responsive */
@media (max-width: 768px) {
    .bm-bi-score { flex-direction: column; text-align: center; }
    .bm-bi-score__details { width: 100%; }
    .bm-bi-cat-name { width: 90px; }
    .bm-bi-sug-row { flex-wrap: wrap; }
    .bm-bi-sug-info { min-width: 120px; }
}
