/**
 * DesignBudget Template - Styles Mobile (app-like)
 * Charge uniquement sur ecrans <= 768px via media="(max-width: 768px)"
 * (C) 2025 i-FormaSite
 *
 * Sections :
 *  1. Corrections debordement horizontal
 *  2. Sidebar — masquee sur mobile
 *  3. En-tete simplifie
 *  4. Barre de navigation inferieure
 *  5. Typographie mobile (clamp)
 *  6. Contenu principal — espacement
 *  7. Grilles et statistiques
 *  8. Barre d'outils / filtres
 *  9. Tableaux en cartes
 * 10. Formulaires
 * 11. Tableau de bord
 * 12. Cartes budget
 * 13. Menus deroulants
 * 14. Cibles tactiles (48px min)
 * 15. Zones de securite (safe-area)
 * 16. Mode standalone PWA
 * 17. Animations app-like
 * 18. Mode sombre — ajustements
 * 19. Ecrans tres petits (< 375px)
 */

/* ==========================================================================
   1. CORRECTIONS DEBORDEMENT HORIZONTAL
   overflow-x: clip coupe le debordement SANS creer de contexte de scroll
   (contrairement a overflow-x: hidden qui bloque le scroll sur mobile)
   ========================================================================== */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: clip !important;
    max-width: 100vw !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.app-wrapper {
    overflow-x: clip !important;
    max-width: 100vw !important;
}

.main-content {
    overflow-x: clip !important;
    max-width: 100vw !important;
    min-width: 0 !important;
}

.page-content {
    max-width: 100% !important;
}

/* ==========================================================================
   2. SIDEBAR — CORRIGE LE GAP A GAUCHE
   Le sidebar reste accessible via le hamburger (slide-over)
   mais ne reserve plus d'espace dans le layout
   ========================================================================== */

.sidebar {
    transform: translateX(-100%) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    height: 100vh !important;
}

.sidebar.show {
    transform: translateX(0) !important;
}

/* Supprimer le margin-left qui reserve l'espace du sidebar */
.main-content {
    margin-left: 0 !important;
}

/* ==========================================================================
   3. EN-TETE SIMPLIFIE
   ========================================================================== */

/* Masquer les elements non essentiels */
.page-icon-header {
    display: none !important;
}

.page-subtitle {
    display: none !important;
}

.notification-menu {
    display: none !important;
}

.user-info {
    display: none !important;
}

.header-search {
    display: none !important;
}

/* Bouton hamburger — cible tactile */
.mobile-menu-toggle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Header compact */
.top-header {
    height: auto !important;
    min-height: 56px;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0 !important;
    margin-bottom: 0.75rem !important;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.125rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

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

/* Bouton theme jour/nuit — visible a cote de l'avatar */
.header-theme-switcher {
    display: flex !important;
    align-items: center;
}

.header-theme-switcher .theme-btn-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.header-theme-switcher .theme-btn-toggle svg {
    width: 20px;
    height: 20px;
}

/* Avatar utilisateur compact */
.user-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
}

.user-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.875rem !important;
}

.header-left {
    flex: 1;
    min-width: 0;
}

.header-right {
    gap: 0.25rem !important;
    flex-shrink: 0;
}

/* ==========================================================================
   3. BARRE DE NAVIGATION INFERIEURE
   ========================================================================== */

.bm-bottom-nav {
    display: flex !important; /* Ecrase le display:none inline (masque sur desktop) */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--db-bg-card, #fff);
    border-top: 1px solid var(--db-border-color, #E2E8F0);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1001;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.bm-bottom-nav.hidden {
    transform: translateY(100%);
}

/* Lien de navigation */
.bm-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--db-text-muted, #94A3B8);
    font-size: 10px;
    font-weight: 500;
    gap: 2px;
    padding: 6px 0;
    min-width: 56px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.bm-bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    flex-shrink: 0;
}

.bm-bottom-nav-label {
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

/* Etat actif */
.bm-bottom-nav-item.active {
    color: var(--db-primary, #27A9DF);
}

.bm-bottom-nav-item.active svg {
    stroke-width: 2.5;
}

/* Bouton central "+" sureleve */
.bm-bottom-nav-add {
    position: relative;
}

.bm-bottom-nav-add-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--db-primary, #27A9DF), var(--db-primary-dark, #1E8AB8));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(39, 169, 223, 0.35);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bm-bottom-nav-add-btn:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(39, 169, 223, 0.25);
}

.bm-bottom-nav-add-btn svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    stroke-width: 2.5;
}

/* Overlay sidebar — la bottom nav passe derriere */
.sidebar-overlay.show ~ .bm-bottom-nav {
    z-index: 999;
}

/* ==========================================================================
   4. TYPOGRAPHIE MOBILE (clamp)
   ========================================================================== */

h1 {
    font-size: clamp(1.25rem, 4vw, 1.875rem) !important;
}

h2 {
    font-size: clamp(1.125rem, 3.5vw, 1.5rem) !important;
}

h3 {
    font-size: clamp(1rem, 3vw, 1.25rem) !important;
}

h4 {
    font-size: clamp(0.9375rem, 2.5vw, 1.125rem) !important;
}

p, li, td, th, span, a, label {
    font-size: inherit;
}

.bm-stat-value {
    font-size: 1.5rem !important;
}

.bm-stat-label {
    font-size: 0.8125rem !important;
}

.bm-card-title {
    font-size: 0.9375rem !important;
}

/* ==========================================================================
   5. CONTENU PRINCIPAL — ESPACEMENT
   ========================================================================== */

.main-content {
    padding: 0 !important;
}

.page-content {
    padding: 0 12px 1rem !important;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important;
}

.top-header {
    margin: 0 !important;
}

/* Cartes — espacement compact */
.bm-card,
.card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
}

.bm-card-body,
.card-body {
    padding: 12px !important;
}

.bm-card-header,
.card-header {
    padding: 12px !important;
}

/* ==========================================================================
   6. GRILLES ET STATISTIQUES
   ========================================================================== */

/* Grille stats dashboard — 2 colonnes */
.bm-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
}

/* Grille stats composant (transactions, etc.) — 3 colonnes compactes */
.bm-stats-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
}

.bm-stat-card {
    padding: 10px !important;
    gap: 4px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* Masquer les icones stats sur mobile pour gagner de la place */
.bm-stats-row .bm-stat-icon {
    display: none !important;
}

.bm-stat-icon {
    width: 32px !important;
    height: 32px !important;
}

.bm-stat-icon svg {
    width: 16px !important;
    height: 16px !important;
}

/* Actions rapides — 2 colonnes */
.bm-quick-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
}

/* ==========================================================================
   7. BARRE D'OUTILS / FILTRES
   ========================================================================== */

.bm-toolbar {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
}

.bm-toolbar-spacer {
    display: none !important;
}

.bm-toolbar-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.bm-toolbar-actions .bm-btn {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 0.8125rem !important;
    padding: 8px 10px !important;
    justify-content: center !important;
}

.bm-toolbar select,
.bm-toolbar input {
    font-size: 0.875rem !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.bm-toolbar .bm-dropdown-toggle {
    font-size: 0.8125rem !important;
    padding: 8px 12px !important;
}

.bm-toolbar .bm-search-box {
    width: 100% !important;
    max-width: none !important;
}

.bm-toolbar-divider {
    display: none !important;
}

/* Filtres en barre defilante horizontale */
.filters-bar {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px !important;
}

.filters-bar::-webkit-scrollbar {
    display: none;
}

.filter-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* ==========================================================================
   8. TABLEAUX EN CARTES — layout compact 2 lignes
   Ligne 1 : checkbox + date + montant + personnes + actions
   Ligne 2 : description + reference + categorie
   ========================================================================== */

.bm-table-container {
    overflow-x: visible !important;
    border-radius: 12px !important;
}

.bm-table {
    min-width: 0 !important;
}

.bm-table thead {
    display: none !important;
}

.bm-table tbody tr {
    display: flex !important;
    flex-wrap: wrap !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid var(--db-border-color, #E2E8F0) !important;
    gap: 2px 6px;
    align-items: center;
    position: relative;
}

.bm-table tbody tr:last-child {
    border-bottom: none !important;
}

.bm-table td {
    display: inline-flex !important;
    align-items: center !important;
    padding: 1px 0 !important;
    border: none !important;
    text-align: left !important;
    white-space: nowrap !important;
}

/* === Reordonner les cellules ===
   td1=checkbox td2=date td3=montant td4=desc td5=ref td6=cat td7=persons td8=actions */
/* Ordre : ligne 1 = checkbox date montant personnes actions, ligne 2 = desc ref cat */
.bm-table td:nth-child(1) { order: 1; } /* checkbox */
.bm-table td:nth-child(2) { order: 2; } /* date */
.bm-table td:nth-child(3) { order: 3; } /* montant */
.bm-table td:nth-child(7) { order: 4; } /* personnes */
.bm-table td:nth-child(8) { order: 5; } /* actions */
.bm-table td:nth-child(4) { order: 7; } /* description */
.bm-table td:nth-child(5) { order: 8; } /* reference */
.bm-table td:nth-child(6) { order: 9; } /* categorie */

/* Separateur invisible entre ligne 1 et ligne 2 */
.bm-table tbody tr::after {
    content: '';
    order: 6;
    flex-basis: 100%;
    height: 0;
}

/* Checkbox — inline compact */
.bm-table td:first-child {
    width: auto !important;
    flex-shrink: 0;
}

/* Date — compact inline */
.bm-table .bm-date-cell {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 4px;
}

.bm-table .bm-date-time {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Montant — mise en evidence */
.bm-table .bm-amount,
.bm-table td[data-label*="ontant"] {
    font-weight: 700;
    font-size: 0.9375rem;
}

/* Description — tronquee, debut de ligne 2 */
.bm-table .bm-desc-cell {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.bm-table .bm-desc-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    font-size: 0.8125rem;
}

.bm-table .bm-source-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    font-size: 0.6rem !important;
}

/* Reference — compact */
.bm-table .bm-ref-badge {
    font-size: 0.75rem;
    padding: 1px 6px;
}

/* Actions — inline compact, collees */
.bm-table .bm-table-actions,
.bm-table .table-actions,
.bm-table .bm-actions {
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    display: inline-flex !important;
    gap: 1px;
}

.bm-table .bm-actions {
    gap: 1px;
}

.bm-table .bm-action-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    font-size: 0.65rem !important;
    padding: 0 !important;
}

/* Checkbox dans tableau (ancien style fallback) */
.bm-table .bm-checkbox-cell {
    position: absolute !important;
    top: 10px;
    right: 10px;
    width: auto !important;
}

/* Personnes — compact, sur ligne 1 */
.bm-table .bm-person-badge {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.55rem !important;
}

.bm-table .bm-persons-cell {
    display: inline-flex !important;
    gap: 2px;
}

/* Categories badges — compact, sur ligne 2 */
.bm-table .bm-cat-badge {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.6rem !important;
}

/* ==========================================================================
   9. FORMULAIRES
   ========================================================================== */

.bm-form-input,
.bm-form-select,
.bm-form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
    font-size: 16px !important; /* Empeche le zoom auto iOS */
    height: 48px;
    padding: 10px 14px !important;
    border-radius: 10px !important;
}

textarea,
.bm-form-textarea {
    height: auto !important;
    min-height: 100px;
}

.bm-form-group {
    margin-bottom: 14px !important;
}

.bm-form-label {
    font-size: 0.8125rem !important;
    margin-bottom: 4px !important;
}

/* Groupes d'icone input */
.bm-input-icon-group,
.bm-select-icon-group,
.bm-input-icon-addon-group {
    border-radius: 10px !important;
}

/* Boutons formulaire */
.bm-btn {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 0.875rem !important;
    border-radius: 10px !important;
}

.bm-btn-lg {
    min-height: 48px !important;
    font-size: 1rem !important;
}

/* Disposition en colonne pour les boutons de formulaire */
.bm-form-actions {
    flex-direction: column !important;
    gap: 8px !important;
}

.bm-form-actions .bm-btn {
    width: 100% !important;
    justify-content: center !important;
}

/* ==========================================================================
   10a. ANALYSE IA / SCANNER — LIGNES DETECTEES
   ========================================================================== */

/* Selects globaux "Categorie" et "Personne" au-dessus des lignes */
.bm-apply-all-inline {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
}

.bm-apply-all-inline .bm-form-select-sm {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
}

.bm-apply-all-inline .bm-btn {
    align-self: flex-end;
}

/* "Appliquer a toutes les lignes" — disposition en colonne */
.bm-apply-all-row {
    flex-direction: column !important;
    gap: 10px !important;
}

.bm-apply-all-row .bm-select-icon-group {
    width: 100% !important;
    min-width: 0 !important;
}

.bm-apply-divider {
    display: none !important;
}

/* Chaque ligne detectee — disposition verticale sur mobile */
.bm-ai-line {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 12px !important;
}

/* Premiere rangee : checkbox + description + montant */
.bm-ai-line input[type="checkbox"] {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 20px !important;
    height: 20px !important;
}

.bm-ai-line {
    position: relative !important;
}

.bm-ai-line .ai-line-desc {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
    padding-right: 40px !important;
    height: 44px !important;
}

.bm-ai-line .ai-line-amount {
    width: 100% !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 8px 12px !important;
    height: 44px !important;
    text-align: left !important;
}

/* Selects categorie et personne — pleine largeur, texte lisible */
.bm-ai-line .bm-form-select {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    height: 44px !important;
}

/* Checkbox remboursement */
.bm-ai-line .bm-checkbox-inline {
    font-size: 13px !important;
    gap: 6px !important;
    padding: 4px 0 !important;
}

.bm-ai-line .bm-checkbox-inline input {
    width: 18px !important;
    height: 18px !important;
}

/* Conteneur des lignes — plus de hauteur pour le scroll */
.bm-parsed-lines {
    max-height: 60vh !important;
}

/* Total et boutons action */
.bm-ai-total {
    padding: 14px 16px !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
}

/* Boutons Retour / Appliquer */
.bm-ai-actions {
    flex-direction: column !important;
    gap: 10px !important;
}

.bm-ai-actions .bm-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
}

/* Zone de drop / scanner — plus grande cible tactile */
.bm-dropzone {
    min-height: 140px !important;
    padding: 20px 16px !important;
}

.bm-dropzone-buttons {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
}

.bm-dropzone-buttons .bm-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
}

/* ==========================================================================
   10b. TABLEAU DE BORD
   ========================================================================== */

/* Grille du dashboard — 1 colonne */
.bm-dashboard-grid,
.dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

/* Graphiques — hauteur reduite */
.bm-chart-container {
    height: 200px !important;
    min-height: 180px !important;
}

/* Transactions recentes */
.bm-recent-list {
    max-height: 300px !important;
}

/* ==========================================================================
   11. CARTES BUDGET
   ========================================================================== */

.bm-budget-card {
    padding: 12px !important;
}

.bm-budget-header {
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.bm-budget-amount {
    font-size: 1.125rem !important;
}

.bm-budget-progress {
    height: 8px !important;
    border-radius: 4px !important;
}

/* ==========================================================================
   12. MENUS DEROULANTS
   ========================================================================== */

/* Notification dropdown — pleine largeur */
.notification-dropdown {
    width: calc(100vw - 2rem) !important;
    max-width: 360px !important;
    right: -0.5rem !important;
}

/* User dropdown */
.user-dropdown {
    right: 0 !important;
    min-width: 200px !important;
}

/* Dropdown generique */
.bm-dropdown-menu {
    min-width: 180px !important;
    max-width: calc(100vw - 2rem) !important;
}

.bm-dropdown-item {
    min-height: 44px !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
}

/* ==========================================================================
   13. CIBLES TACTILES (48px min)
   ========================================================================== */

.bm-action-btn,
.table-action-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-link,
.nav-sublink {
    min-height: 44px !important;
    padding: 10px 16px !important;
}

.pagination .page-link {
    min-width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
}

/* Desactiver les effets hover sur ecrans tactiles */
@media (hover: none) {
    .bm-action-btn:hover,
    .table-action-btn:hover,
    .bm-btn:hover,
    .nav-link:hover,
    .nav-sublink:hover,
    .bm-table tbody tr:hover,
    .bm-dropdown-item:hover,
    .notification-item:hover {
        background: inherit !important;
        color: inherit !important;
        transform: none !important;
        box-shadow: inherit !important;
    }

    /* Feedback tactile via :active */
    .bm-btn:active,
    .bm-action-btn:active,
    .nav-link:active,
    .bm-dropdown-item:active {
        transform: scale(0.96) !important;
        opacity: 0.85;
    }
}

/* ==========================================================================
   14. ZONES DE SECURITE (safe-area iPhone)
   ========================================================================== */

.bm-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.top-header {
    padding-top: max(0.5rem, env(safe-area-inset-top, 0)) !important;
}

/* ==========================================================================
   15. MODE STANDALONE PWA
   ========================================================================== */

@media (display-mode: standalone) {
    .top-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        border-radius: 0 !important;
    }

    .page-content {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    /* Masquer le bouton d'installation */
    .sidebar-install {
        display: none !important;
    }
}

/* ==========================================================================
   16. ANIMATIONS APP-LIKE
   ========================================================================== */

/* Animation d'entree de page */
.page-content {
    animation: pageEnter 0.25s ease-out;
}

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

/* Transitions fluides */
.bm-card,
.bm-stat-card,
.bm-btn,
.nav-link {
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* ==========================================================================
   17. MODE SOMBRE — AJUSTEMENTS
   ========================================================================== */

body.dark-mode .bm-bottom-nav {
    background: var(--db-bg-card, #1E293B);
    border-top-color: var(--db-border-color, #334155);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .bm-bottom-nav-item {
    color: var(--db-text-muted, #94A3B8);
}

body.dark-mode .bm-bottom-nav-item.active {
    color: var(--db-primary, #60A5FA);
}

body.dark-mode .bm-bottom-nav-add-btn {
    background: linear-gradient(135deg, var(--db-primary, #60A5FA), #3B82F6);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.35);
}

body.dark-mode .bm-table tbody tr {
    border-bottom-color: var(--db-border-color, #334155) !important;
}

body.dark-mode .bm-table .bm-table-actions,
body.dark-mode .bm-table .table-actions {
    border-top-color: var(--db-border-color, #334155);
}

/* ==========================================================================
   18. ECRANS TRES PETITS (< 375px)
   ========================================================================== */

@media (max-width: 374px) {
    .bm-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .bm-stat-value {
        font-size: 1.25rem !important;
    }

    .bm-stat-card {
        padding: 10px !important;
    }

    .bm-dropdown-toggle {
        font-size: 11px !important;
        padding: 6px 8px !important;
    }

    .bm-bottom-nav-label {
        font-size: 9px !important;
    }

    .bm-bottom-nav-add-btn {
        width: 44px;
        height: 44px;
        margin-top: -16px;
    }

    .bm-quick-actions {
        grid-template-columns: 1fr !important;
    }

    .page-title {
        font-size: 1rem !important;
        max-width: 50vw !important;
    }

    .page-content {
        padding: 0 8px 1rem !important;
    }

    .bm-toolbar {
        padding: 8px !important;
    }

    .bm-card-body,
    .card-body {
        padding: 10px !important;
    }
}
