/*
 * GESTION LOCATIVE - CSS PRINCIPAL
 * Version: 0.20.2
 * Design: Moderne, Responsive, Accessible
 */

/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

/* ============================================================================
   VARIABLES CSS
   ============================================================================ */

:root {
    /* Couleurs primaires */
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-primary-light: #3b82f6;
    
    /* Couleurs secondaires */
    --color-secondary: #64748b;
    --color-secondary-dark: #475569;
    --color-secondary-light: #94a3b8;
    
    /* Couleurs status */
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    
    /* Couleurs neutres */
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-500: #6b7280;
    --color-gray-700: #374151;
    --color-gray-900: #111827;
    
    /* Typographie */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordures */
    --border-radius: 0.5rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 0.75rem;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

/* ============================================================================
   TYPOGRAPHIE
   ============================================================================ */

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-gray-900);
    background-color: var(--color-gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-gray-900);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

.header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-gray-900);
    text-decoration: none;
}

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

.nav-user,

.user-email {
    color: var(--color-gray-700);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ============================================================================
   BOUTONS
   ============================================================================ */

/* Boutons définis plus bas dans le fichier */

/* ============================================================================
   FORMULAIRES
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--color-gray-700);
}

.form-control {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-gray-900);
    background-color: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group.has-error .form-control {
    border-color: var(--color-danger);
}

.form-error {
    margin-top: var(--spacing-xs);
    color: var(--color-danger);
    font-size: var(--font-size-sm);
}

.form-help {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--color-gray-500);
    font-size: var(--font-size-sm);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-check-input {
    width: auto;
}

.form-check-label {
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================================================
   AUTH PAGES
   ============================================================================ */

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-2xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-gray-200);
}

/* ============================================================================
   FLASH MESSAGES (ALERTS)
   ============================================================================ */

.alert {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    animation: slideIn 0.3s ease;
}

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

.alert-danger {
    background: rgba(254, 226, 226, 0.98);  /* Rouge très clair */
    color: #991b1b;  /* Texte rouge foncé */
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: rgba(254, 243, 199, 0.98);  /* Orange très clair */
    color: #92400e;  /* Texte orange foncé */
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: rgba(219, 234, 254, 0.98);  /* Bleu très clair */
    color: #1e3a8a;  /* Texte bleu foncé */
    border-left: 4px solid #3b82f6;
}

.alert-icon {
    font-size: var(--font-size-xl);
    font-weight: bold;
}

/* ============================================================================
   DASHBOARD
   ============================================================================ */

.stat-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: var(--font-size-3xl);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-gray-100);
    border-radius: var(--border-radius);
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-gray-900);
}

.stat-label {
    color: var(--color-gray-500);
    font-size: var(--font-size-sm);
}

.card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-gray-200);
}

.card-title {
    font-size: var(--font-size-xl);
    margin: 0;
}

.card-body {
    padding: var(--spacing-lg);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    padding: var(--spacing-lg) 0;
    margin-top: auto;
}

.footer-text {
    text-align: center;
    color: var(--color-gray-500);
    font-size: var(--font-size-sm);
}

.version {
    font-weight: 500;
    color: var(--color-primary);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    
    
    .nav-user,
    
    
}

/* ========================================
   BIENS - LISTE & CARDS
   ======================================== */

.page-header h1 {
    margin: 0;
    color: var(--text-primary);
}

/* Filtres */

/* Grille de biens */

.bien-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bien-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.bien-card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bien-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.bien-type-badge {
    background: var(--color-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.bien-card-body {
    padding: var(--spacing-md);
}

.bien-address {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.bien-specs {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bien-price {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.bien-price strong {
    font-size: 1.3rem;
    color: var(--color-success);
}

.bien-price small {
    color: var(--text-secondary);
    margin-left: var(--spacing-xs);
}

.bien-card-footer {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    display: flex;
    gap: var(--spacing-sm);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.pagination-info {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Formulaires large */
.form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.form-large {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.form-section {
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.form-section legend {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 var(--spacing-sm);
}



/* Détail bien */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.detail-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.detail-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.detail-card-full {
    grid-column: 1 / -1;
}

.detail-card h2 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.detail-card p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.detail-card p strong {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    
    
    
    
    
    .detail-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* ========================================
   COMPTE UTILISATEUR
   ======================================== */

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.account-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.account-card h2 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.role-admin {
    background: var(--color-danger);
    color: white;
}

.text-muted {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

/* Admin Dashboard */

.stat-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-help {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Flash Messages Animations */

/* Responsive */
@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    
    
    .account-header,
}

/* ========================================
   NOTIFICATIONS OVERLAY MODERNES
   ======================================== */

.notifications-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;  /* Plus large pour éviter 2 lignes */
    min-width: 400px;  /* Largeur minimum */
    pointer-events: none;
}

.notifications-overlay .alert, .notifications-overlay .notification {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;  /* Plus de padding */
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);  /* Ombre plus douce */
    font-size: 1rem;
    line-height: 1.5;
    animation: slideInRight 0.3s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
    
}

/* Animation entrée */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Types de notifications */

.alert-danger {
    background: rgba(254, 226, 226, 0.98);  /* Rouge très clair */
    color: #991b1b;  /* Texte rouge foncé */
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: rgba(254, 243, 199, 0.98);  /* Orange très clair */
    color: #92400e;  /* Texte orange foncé */
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: rgba(219, 234, 254, 0.98);  /* Bleu très clair */
    color: #1e3a8a;  /* Texte bleu foncé */
    border-left: 4px solid #3b82f6;
}

/* Message */

/* Bouton fermer */

/* Responsive mobile */
@media (max-width: 768px) {
    .notifications-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;  /* Plus large pour éviter 2 lignes */
    min-width: 400px;  /* Largeur minimum */
    pointer-events: none;
}
    
    .notifications-overlay .alert, .notifications-overlay .notification {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;  /* Plus de padding */
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);  /* Ombre plus douce */
    font-size: 1rem;
    line-height: 1.5;
    animation: slideInRight 0.3s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
    
}
}

/* Hover notification pour indiquer cliquable */
.notifications-overlay .alert:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Transition smooth */
.notifications-overlay .alert, .notifications-overlay .notification {
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

/* ============================================================================
   LOCATAIRES - Styles spécifiques
   ============================================================================ */

/* Filtres barre */

/* Badge statut */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* Table responsive */

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table thead {
    background: #f8f9fa;
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table .text-right {
    text-align: right;
}

/* Bouton groupe */
.btn-group {
    display: flex;
    gap: 5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* ============================================================================
   MODAL GÉNÉRIQUE - Réutilisable partout
   Utilisé via fragments/modal_confirm.html
   Fonction JS : afficherModalConfirm(action, titre, message, btnLabel)
   ============================================================================ */
/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #212529;
}

.modal-content p {
    margin-bottom: 10px;
}

/* Input group (pour € après input) */
.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    padding: 10px 15px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #495057;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.empty-state a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Responsive mobile */
@media (max-width: 768px) {
    
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    .btn-group {
        flex-direction: column;
    }
}

/* ============================================================================
   LOCATAIRES - UX Menu déroulant
   ============================================================================ */

.solde-negatif {
    color: #dc3545;
}

.solde-positif {
    color: #28a745;
}

.toggle-icon {
    font-size: 1.2rem;
    color: #6c757d;
    transition: transform 0.3s;
}

/* Menu déroulant */
.locataire-details {
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    padding: 25px;
    animation: slideDown 0.3s ease-out;
}

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

.detail-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.detail-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.detail-value {
    color: #212529;
    font-weight: 500;
}

/* ============================================================================
   GRAND LIVRE
   ============================================================================ */

.grand-livre-resume {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.resume-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

.resume-solde {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.resume-solde .resume-label,
.resume-solde .resume-value {
    color: white;
}

.resume-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resume-value {
    font-size: 2rem;
    font-weight: 700;
}

.resume-du {
    color: #dc3545;
}

.resume-recu {
    color: #28a745;
}

.caution-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.caution-icon {
    font-size: 1.5rem;
}

.historique-container {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.historique-container h3 {
    margin: 0 0 20px 0;
    color: #212529;
    font-size: 1.3rem;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-item {
    border-left: 4px solid #dc3545;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    transition: transform 0.2s;
}

.transaction-item:hover {
    transform: translateX(5px);
}

.transaction-header {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 8px;
}

.transaction-date {
    font-weight: 600;
    color: #495057;
}

.transaction-type {
    color: #212529;
}

.transaction-montant {
    text-align: right;
}

.montant-du {
    color: #dc3545;
    font-weight: 600;
    font-size: 1.1rem;
}

.transaction-details {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}

.montant-recu {
    color: #28a745;
    font-weight: 500;
}

.statut-impaye {
    color: #dc3545;
    font-weight: 500;
}

/* Responsive mobile */
@media (max-width: 768px) {
    
    
    
    
    .grand-livre-resume {
        grid-template-columns: 1fr;
    }
    
    .transaction-header {
        grid-template-columns: 1fr;
    }
}

/* Biens tags dans liste locataires */

/* ============================================================================
   MODAL MODIFICATION LOCATAIRE
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    overflow-y: visible;
    padding: 40px 20px;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 900px;
    width: 100%;
    max-height: none;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 1000px;
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #212529;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #212529;
}

.modal-body {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: visible;
    flex: 1;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}



.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Biens checkboxes */
.bien-checkbox-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.bien-checkbox-header {
    margin-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #212529;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.bien-nom {
    font-size: 1.05rem;
}

.bien-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .modal-dialog {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    
    
    .bien-fields {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   STATS CARDS - LOYERS
   ============================================ */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card.stat-success {
    border-left: 4px solid #10b981;
}

.stat-card.stat-danger {
    border-left: 4px solid #ef4444;
}

.stat-card.stat-warning {
    border-left: 4px solid #f59e0b;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-success .stat-value {
    color: #10b981;
}

.stat-danger .stat-value {
    color: #ef4444;
}

.stat-warning .stat-value {
    color: #f59e0b;
}

/* Filters bar */

/* Table improvements */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

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

.data-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

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

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

/* Dropdown loyers */
.table-row-clickable {
    cursor: pointer;
    transition: background 0.2s;
}

.table-row-clickable:hover {
    background: #f9fafb !important;
}

.dropdown-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.75rem;
    color: #6b7280;
}

.dropdown-row {
    background: #f9fafb;
}

.dropdown-content {
    padding: 1.5rem;
}

.dropdown-section h4 {
    margin-bottom: 1rem;
    color: #374151;
    font-size: 1rem;
}

.dropdown-form {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}



.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

/* Actions buttons */

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

.btn-outline:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
}

.close {
    font-size: 2rem;
    font-weight: 300;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert strong {
    font-weight: 600;
}

/* Actions buttons inline */

/* Modal style locataires */

.modal-header-warning h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #92400e;
}

.info-box {
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.info-icon {
    font-size: 2rem;
}

.info-content {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* === FORMULAIRES === */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 13px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0 1rem;
    height: 34px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    
    text-decoration: none;
    box-sizing: border-box;
}

/* ========================================
   ÉDITEUR TEMPLATES QUITTANCES (TinyMCE)
   ======================================== */

.editor-container {
    display: flex;
    gap: 20px;
}

.editor-main {
    flex: 1;
}

.variables-panel {
    width: 280px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.variables-panel h4 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
    font-size: 14px;
}

.variables-panel-intro {
    font-size: 11px;
    color: #666;
    margin-bottom: 15px;
}

.variables-section {
    margin-bottom: 15px;
}

.variables-section h5 {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

.variable-btn {
    display: block;
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.variable-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.variable-btn code {
    display: block;
    color: #e74c3c;
    font-size: 11px;
    font-family: monospace;
}

.variable-btn:hover code {
    color: #fff;
}

/* Drag & drop variables */
.variable-btn[draggable="true"] {
    cursor: grab;
}

.variable-btn[draggable="true"]:active {
    cursor: grabbing;
}

/* Preview template avec fond blanc */
.template-preview-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
    max-height: none;
    overflow-y: visible;
}

/* Actions en ligne (pas en colonne) */
.dropdown-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dropdown-actions-inline .inline-form {
    display: inline-block;
    margin: 0;
}

/* Bouton info (bleu) */
.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background-color: #138496;
    color: white;
}

/* Fix: alias pour alert-error */

/* ================================================
   QUITTANCES SECTION (dans dropdown loyers)
   ================================================ */

.quittance-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Modal suppression quittance */
.modal-header-danger {
    background: #dc3545;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modal-header-danger .close {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-header-danger .close:hover {
    opacity: 0.8;
}

/* Fix fond preview PDF */

/* Override fond PDF viewer */

/* Fix PDF preview - fond blanc et bordures */

/* ============================================================================
   ADMIN - SMTP SETTINGS
   ============================================================================ */

/* Toggle Switch */

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.toggle-label {
    font-weight: 600;
    color: var(--color-gray-700);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-gray-300);
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

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

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

/* SMTP Status */

/* SMTP Config Form */



.checkbox-group {
    margin: var(--spacing-md) 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.section-title {
    margin: var(--spacing-xl) 0 var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-gray-700);
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.text-muted {
    color: var(--color-gray-500);
}

/* Responsive */
@media (max-width: 768px) {
    
    
    
    .form-group-large,
    
    
    .form-actions {
        flex-direction: column;
    }
}

/* ============================================================================
   MODAL SMTP - STYLES COMPACTS
   ============================================================================ */

/* ============================================================================
   BOUTONS EMAIL - ÉTATS
   ============================================================================ */

/* Colonne email dans tableau */

/* === SUBSCRIPTION STYLES === */
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.875rem; font-weight: 600; }
.status-badge.trial { background: #fef3c7; color: #92400e; }
.status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.expired { background: #fee2e2; color: #991b1b; }
.user-plan { padding: 4px 10px; border-radius: 20px; font-size: 0.875rem; font-weight: 500; }
.user-plan.pro { background: #fef3c7; color: #92400e; }
.stat-card.clickable { cursor: pointer; transition: all 0.2s; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); border-color: #0f172a; }

/* === ADMIN USERS === */
.modal-lg { max-width: 700px; }
.users-list { max-height: 400px; overflow-y: visible; }
.user-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #e5e7eb; cursor: pointer; transition: all 0.2s; }
.user-item:hover {  }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 500; color: #111827; }
.user-email { font-size: 0.85rem; color: #6b7280; }
.user-meta { display: flex; gap: 10px; align-items: center; }
.user-detail-header { text-align: center; padding-bottom: 15px; border-bottom: 1px solid #e5e7eb; margin-bottom: 15px; }
.user-timestamps { display: flex; justify-content: space-between; color: #9ca3af; font-size: 0.75rem; margin-top: 15px; padding-top: 10px; border-top: 1px solid #e5e7eb; }
.text-danger { color: #ef4444 !important; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.plan-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; }
.section-title { margin: 30px 0 20px; font-size: 1.3rem; color: #374151; }

/* === USERS FILTERS === */
.users-filters { padding: 15px; border-bottom: 1px solid #e5e7eb; }
.users-filters .form-control { margin-bottom: 10px; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn { padding: 5px 12px; border: 1px solid #e5e7eb; background: #fff; border-radius: 20px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.filter-btn:hover {  }
.filter-btn.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.users-count { padding: 10px 15px; background: #f9fafb; text-align: center; font-size: 0.85rem; color: #6b7280; border-top: 1px solid #e5e7eb; }
.user-name-row { display: flex; align-items: center; gap: 8px; }
.badge-admin { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }

/* === MODAL DANGER === */
.modal-header-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.status-badge.suspended { background: #374151; color: #fff; }

/* === RESET PASSWORD === */
.modal-header-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.reset-user-email { font-weight: 500; color: #374151; margin-bottom: 15px; padding: 10px;  border-radius: 6px; }

/* === USER LOGS === */
.user-logs { margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 15px; }
.user-logs h5 { margin-bottom: 10px; }
.logs-list { max-height: 200px; overflow-y: visible; }

.log-item:hover { background: #f9fafb; }
.log-icon { font-size: 1rem; }

.logs-empty { padding: 20px; text-align: center; color: #9ca3af; }

/* === MODAL SCROLLABLE === */
#modalUserDetail .modal-dialog { max-height: 90vh; display: flex; flex-direction: column; }
#modalUserDetail .modal-body { overflow-y: visible; max-height: calc(90vh - 60px); }
.user-detail { padding-bottom: 20px; }

/* === DATEPICKER & INLINE LABEL === */
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}
.btn-outline:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}
input[type="date"].form-control { min-width: 140px; }

/* === LOG IP === */
.log-ip { font-size: 0.7rem; color: #9ca3af; font-family: monospace;  padding: 1px 5px; border-radius: 3px; }

/* === LOGS FILTERS & PAGINATION === */
.logs-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.logs-header h5 { margin: 0; }
.logs-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.log-filter-btn { padding: 3px 8px; border: 1px solid #e5e7eb; background: #fff; border-radius: 15px; font-size: 0.7rem; cursor: pointer; transition: all 0.2s; }
.log-filter-btn:hover {  }
.log-filter-btn.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.logs-pagination { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 10px; border-top: 1px solid #e5e7eb; margin-top: 10px; }
.pagination-info { font-size: 0.8rem; color: #6b7280; }

/* === USER DETAIL PRO === */
.user-detail { padding: 0; }

.user-detail-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; gap: 15px; }
.user-header-info h4 { margin: 0 0 5px 0; font-size: 1.2rem; color: #1f2937; }
.user-header-info .user-email { color: #6b7280; font-size: 0.9rem; }
.user-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-role-admin { background: #fef3c7; color: #92400e; padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.badge-plan { background: #e5e7eb; color: #374151; padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.badge-plan.pro { background: #dbeafe; color: #1e40af; }

.user-stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.stat-item { padding: 12px; text-align: center; border-right: 1px solid #e5e7eb; }
.stat-item:last-child { border-right: none; }
.stat-value { font-size: 1.3rem; font-weight: 600; color: #1f2937; display: block; }
.stat-value small { font-size: 0.7rem; color: #9ca3af; font-weight: 400; }
.stat-label { font-size: 0.7rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-danger .stat-value { color: #dc2626; }

.user-edit-form { padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.form-card-header { display: flex; align-items: center; gap: 8px; padding: 10px 15px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.form-card-icon { font-size: 1rem; }
.form-card-title { font-weight: 600; color: #374151; font-size: 0.85rem; }
.form-card-body { padding: 15px; display: flex; flex-direction: column; gap: 12px; }

.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group label { font-size: 0.7rem; color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.input-group .form-control { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; transition: all 0.2s; }
.input-group .form-control:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.1); outline: none; }
.input-group .form-control:disabled {  color: #9ca3af; }

.input-with-checkbox { display: flex; gap: 10px; align-items: center; }
.input-with-checkbox .form-control { flex: 1; }
.checkbox-pill { display: flex; align-items: center; gap: 5px; padding: 6px 10px;  border-radius: 6px; cursor: pointer; font-size: 0.8rem;  transition: all 0.2s; }
.checkbox-pill:hover { background: #e5e7eb; }
.checkbox-pill input { width: auto; margin: 0; }
.checkbox-pill input:checked + span { color: #3b82f6; font-weight: 500; }

.form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #e5e7eb; }
.btn-icon { display: flex; align-items: center; gap: 5px; }
.btn-icon span { font-size: 0.85rem; }
.btn-lg { padding: 10px 20px; font-size: 0.95rem; }

/* Logs sobre */
.user-logs { padding: 15px 20px; border-top: 1px solid #e5e7eb; }
.logs-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.logs-header h5 { margin: 0; font-size: 0.9rem; color: #374151; }
.logs-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.log-filter-btn { padding: 4px 10px; border: 1px solid #e5e7eb; background: #fff; border-radius: 4px; font-size: 0.7rem; cursor: pointer; transition: all 0.2s; }
.log-filter-btn:hover {  }
.log-filter-btn.active { background: #1f2937; color: #fff; border-color: #1f2937; }

.logs-list { background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; max-height: none; overflow-y: visible; }

.log-item:last-child { border-bottom: none; }
.log-item:hover { background: #f9fafb; }
.log-icon { font-size: 0.9rem; flex-shrink: 0; }

.log-ip { font-size: 0.65rem; color: #9ca3af; font-family: monospace;  padding: 1px 5px; border-radius: 3px; }

.logs-empty { padding: 20px; text-align: center; color: #9ca3af; font-size: 0.85rem; }

.logs-pagination { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin-top: 10px; }
.pagination-info { font-size: 0.75rem; color: #6b7280; }

.user-timestamps { display: flex; justify-content: space-between; padding: 10px 20px; background: #f9fafb; font-size: 0.7rem; color: #9ca3af; }

/* === LOGS STYLE UNIFIÉ === */
.log-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-bottom: 1px solid #f3f4f6; }
.log-item:last-child { border-bottom: none; }
.log-item:hover { background: #f9fafb; }
.log-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.log-content { flex: 1; min-width: 0; }
.log-description { display: block; font-size: 0.85rem; color: #374151; line-height: 1.4; }
.log-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; align-items: center; }
.log-by-admin { font-size: 0.75rem; color: #6b7280; }
.log-ip { font-size: 0.7rem; color: #9ca3af; font-family: monospace;  padding: 2px 6px; border-radius: 3px; }
.log-date { font-size: 0.75rem; color: #9ca3af;  flex-shrink: 0; text-align: right; }

/* === PAGINATION CENTRÉE === */
.logs-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-top: 1px solid #e5e7eb; margin-top: 0; }

.logs-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* === MODAL SCROLL FIX === */
#modalUserDetail .modal-dialog { max-height: 90vh; display: flex; flex-direction: column; }
#modalUserDetail .modal-body { overflow-y: auto; flex: 1; }
.logs-list { max-height: none; overflow-y: visible; }

/* ============================================================================
   DÉPENSES - Phase 11
   ============================================================================ */

/* Filtres bar */

/* Ventilation rows */
.ventilation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: var(--bg-primary);
}

.ventilation-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ventilation-input input[type="number"] {
    width: 80px;
    text-align: right;
}

.ventilation-total {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.1rem;
}

.ventilation-total .text-success {
    color: var(--success);
}

.ventilation-total .text-danger {
    color: var(--danger);
}

/* Catégories grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.category-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Form inline */
.form-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 200px;
}

/* Badge outline */

/* Page footer */

/* Checkbox group */
.checkbox-group {
    margin: 1rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Form sections */
.form-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Form row */


/* ============================================================================
   FIX DÉPENSES - Form sections + styles
   ============================================================================ */

/* Form card container */
.form-card {
    max-width: 800px;
    margin: 0 auto;
}

/* Form sections avec fond */
.form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.form-section h3 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #dee2e6;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Required asterisk */
.required {
    color: #dc3545;
}

/* Form help text */
.form-help {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Ventilation row amélioré */
.ventilation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.ventilation-row:hover {
    border-color: #adb5bd;
}

.ventilation-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ventilation-input input[type="number"] {
    width: 80px;
    text-align: right;
    padding: 0.375rem 0.5rem;
}

.pct-label {
    color: #6c757d;
    font-weight: 500;
}

/* Ventilation total box */
.ventilation-total {
    padding: 1rem;
    background: #e9ecef;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.text-success {
    color: #198754 !important;
    font-weight: bold;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: bold;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Form row grid */


@media (max-width: 600px) {
    
}

/* Form actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    margin-top: 1rem;
}

/* Inputs styling */
.form-section input[type="text"],
.form-section input[type="number"],
.form-section input[type="date"],
.form-section select,
.form-section textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* ============================================================================
   FIX VENTILATION DÉPENSES v2
   ============================================================================ */

/* Actions ventilation */
.ventilation-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Ventilation row - zone entière cliquable */
.ventilation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    min-height: 56px;
}

.ventilation-row:hover {
    border-color: #0d6efd;
    background-color: #f8f9ff;
}

/* Label avec checkbox et nom - centré verticalement */
.ventilation-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.ventilation-label .bien-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.ventilation-label .bien-nom {
    font-weight: 500;
    color: #333;
}

/* Input pourcentage - aligné verticalement */
.ventilation-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ventilation-input input[type="number"] {
    width: 80px;
    text-align: right;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.ventilation-input .pct-label {
    color: #6c757d;
    font-weight: 500;
    min-width: 20px;
}

/* Total avec tolérance arrondis */
.ventilation-total {
    padding: 1rem;
    background: #e9ecef;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.ventilation-total .text-success {
    color: #198754 !important;
    font-weight: bold;
    margin-left: 0.5rem;
}

.ventilation-total .text-danger {
    color: #dc3545 !important;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* Checkbox inline pour déductibilité */
.checkbox-label-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================================================
   FIX DÉPENSES v3 - Alignement + Footer ventilation
   ============================================================================ */

/* Form row 2 colonnes égales */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.form-row-2 .form-group {
    margin-bottom: 0;
}

.form-row-2 input[type="date"],
.form-row-2 input[type="number"] {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* Footer ventilation : boutons + total sur même ligne */
.ventilation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.ventilation-total-inline {
    background: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
}

.ventilation-total-inline .text-success {
    color: #198754 !important;
    font-weight: bold;
    margin-left: 0.25rem;
}

.ventilation-total-inline .text-danger {
    color: #dc3545 !important;
    font-weight: bold;
    margin-left: 0.25rem;
}

/* Masquer l'ancien total (au cas où) */
.ventilation-total {
    display: none;
}

/* Alert danger pour erreur ventilation */
.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

/* ============================================================================
   CATÉGORIES DE DÉPENSES - Styles complets
   ============================================================================ */

/* Grille des catégories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Carte catégorie */
.category-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.category-card:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.category-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Catégorie système (non supprimable) */
.category-card.system {
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
}

/* Catégorie personnalisée */
.category-card.custom {
    border-left: 3px solid #0d6efd;
}

.category-card.custom .category-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

/* Section titre avec icône */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.section-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Formulaire inline ajout catégorie */
.form-inline-add {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.form-inline-add .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.form-inline-add label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.form-inline-add input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
}

.form-inline-add input[type="text"]:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-inline-add .btn {
    
}

/* Empty state pour catégories perso */
.empty-state-small {
    color: #6c757d;
    font-style: italic;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

/* ============================================================================
   LISTE DÉPENSES - Amélioration stats cards
   ============================================================================ */

/* Stats cards en ligne */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value.text-success {
    color: #198754;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filtres dépenses */

/* Tableau dépenses */
.table-container {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

/* Badge catégorie */

/* Badge bien */

/* Actions boutons */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-icon.edit {
    background: #e7f1ff;
    color: #0d6efd;
}

.btn-icon.edit:hover {
    background: #cfe2ff;
}

.btn-icon.delete {
    background: #f8d7da;
    color: #dc3545;
}

.btn-icon.delete:hover {
    background: #f1aeb5;
}

/* Check déductible */

/* ============================================================================
   MODAL - Styles communs
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.2s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 1rem 0;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Category card meta */

.badge-count {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #495057;
}

/* ============================================================================
   MODALS - Confirmation et détails
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.25s ease;
}

.modal-container.modal-lg {
    max-width: 700px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.modal-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Tableau dans modal */
.table-modal {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table-modal th {
    background: #f1f3f4;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table-modal td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

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

.table-modal tr:hover {
    background: #f8f9fa;
}

/* Summary dépenses */
.depenses-summary {
    background: #e8f5e9;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: #2e7d32;
    font-size: 0.95rem;
}

/* Text muted */
.text-muted {
    color: #6c757d;
}

.text-danger {
    color: #dc3545;
}

/* Category card cliquable */
.category-card {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Btn outline danger */
.btn-outline-danger {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: #fff;
}

/* ============================================================================
   DROPDOWN MENU
   ============================================================================ */

.dropdown {
    position: relative;
    display: inline-block;
}

/* ============================================================================
   MODAL FORMULAIRE DEPENSE
   ============================================================================ */

@media (max-width: 500px) {
}

.form-section-modal input[type="text"],
.form-section-modal input[type="number"],
.form-section-modal input[type="date"],
.form-section-modal select,

.form-section-modal input:focus,
.form-section-modal select:focus,

/* Ventilation dans modal */

.ventilation-pct {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ventilation-pct input[type="number"] {
    width: 70px;
    text-align: right;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* ============================================================================
   ACCORDION - Liste dépliable
   ============================================================================ */

.detail-row {
    display: flex;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    color: #6c757d;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    
    
    .detail-row {
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .detail-label {
        width: auto;
        font-size: 0.8rem;
    }
}

/* ============================================
   PHASE 12.1 - DASHBOARD KPIs
   ============================================ */

/* Section KPI */

/* Grilles stats */

@media (max-width: 1024px) {
}

@media (max-width: 768px) {
    .stats-grid-3,
}

/* Stat cards améliorées */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card.stat-success {
    border-left: 4px solid #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.stat-card.stat-danger {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, white 100%);
}

.stat-card.stat-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.stat-value.text-success {
    color: #16a34a;
}

.stat-value.text-danger {
    color: #dc2626;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Barre de progression */

/* Alertes */

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Actions rapides */

@media (max-width: 768px) {
}

/* Graphique */

/* ============================================
   DASHBOARD - STYLES
   ============================================ */

/* Variables */
:root {
    --dash-bg: #f8fafc;
    --dash-card: #ffffff;
    --dash-border: #e2e8f0;
    --dash-text: #0f172a;
    --dash-text-secondary: #64748b;
    --dash-text-muted: #94a3b8;
    --dash-positive: #10b981;
    --dash-positive-bg: #ecfdf5;
    --dash-negative: #f43f5e;
    --dash-negative-bg: #fff1f2;
    --dash-warning: #f59e0b;
    --dash-warning-bg: #fffbeb;
    --dash-info: #3b82f6;
    --dash-info-bg: #eff6ff;
    --dash-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --dash-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --dash-radius: 10px;
}

/* Container */
.dash {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--dash-bg);
    min-height: calc(100vh - 60px);
}

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

.dash-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dash-text);
    margin: 0;
    letter-spacing: -0.025em;
}

.dash-period {
    font-size: 0.875rem;
    color: var(--dash-text-secondary);
    margin-left: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--dash-card);
    border-radius: 9999px;
    border: 1px solid var(--dash-border);
}

/* Alertes */
.dash-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.dash-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--dash-radius);
    text-decoration: none;
    transition: all 0.15s ease;
}

.dash-alert-critical {
    background: var(--dash-negative-bg);
    color: var(--dash-negative);
}

.dash-alert-warning {
    background: var(--dash-warning-bg);
    color: #b45309;
}

.dash-alert:hover {
    transform: translateX(4px);
}

.dash-alert-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dash-alert-text {
    flex: 1;
    font-size: 0.875rem;
}

.dash-alert-text strong {
    font-weight: 600;
}

.dash-alert-arrow {
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.dash-alert:hover .dash-alert-arrow {
    opacity: 1;
}

/* Sections */
.dash-section {
    margin-bottom: 2.5rem;
}

.dash-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dash-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.dash-section-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--dash-text-muted);
    text-transform: none;
    letter-spacing: normal;
}

/* KPI Grid */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .dash-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .dash-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* KPI Card */
.dash-kpi {
    background: var(--dash-card);
    border-radius: var(--dash-radius);
    padding: 1.25rem;
    border: 1px solid var(--dash-border);
    box-shadow: var(--dash-shadow);
}

.dash-kpi-featured {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: none;
    color: white;
}

.dash-kpi-featured .dash-kpi-label {
    color: #94a3b8;
}

.dash-kpi-featured .dash-kpi-badge {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dash-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dash-kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dash-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-kpi-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: var(--dash-bg);
    border-radius: 4px;
    color: var(--dash-text-secondary);
}

.dash-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dash-text);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.dash-kpi-featured .dash-kpi-value {
    color: white;
}

.dash-kpi-value.is-positive {
    color: var(--dash-positive);
}

.dash-kpi-value.is-negative {
    color: var(--dash-negative);
}

.dash-kpi-featured .dash-kpi-value.is-positive {
    color: #6ee7b7;
}

.dash-kpi-featured .dash-kpi-value.is-negative {
    color: #fda4af;
}

.dash-kpi-currency,
.dash-kpi-unit {
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.7;
}

/* KPI Breakdown */
.dash-kpi-breakdown {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-kpi-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dash-kpi-breakdown-label {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-kpi-breakdown-value {
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-kpi-breakdown-value.is-positive {
    color: #6ee7b7;
}

.dash-kpi-breakdown-value.is-negative {
    color: #fda4af;
}

/* KPI Bar */
.dash-kpi-bar {
    height: 4px;
    background: var(--dash-border);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.dash-kpi-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.dash-kpi-bar-fill.is-good {
    background: var(--dash-positive);
}

.dash-kpi-bar-fill.is-medium {
    background: var(--dash-warning);
}

.dash-kpi-bar-fill.is-low {
    background: var(--dash-negative);
}

/* KPI Meta */
.dash-kpi-meta {
    font-size: 0.75rem;
    color: var(--dash-text-muted);
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dash-kpi-meta-item.is-success {
    color: var(--dash-positive);
}

.dash-kpi-meta-item.is-warning {
    color: var(--dash-warning);
}

/* Metrics Row */
.dash-metrics-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--dash-card);
    border-radius: var(--dash-radius);
    border: 1px solid var(--dash-border);
    box-shadow: var(--dash-shadow);
    flex-wrap: wrap;
}

.dash-metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-metric-result {
    padding: 0.75rem 1.25rem;
    background: var(--dash-bg);
    border-radius: 8px;
    margin: -0.5rem 0;
}

.dash-metric-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dash-text);
}

.dash-metric-value.is-positive {
    color: var(--dash-positive);
}

.dash-metric-value.is-negative {
    color: var(--dash-negative);
}

.dash-metric-separator {
    font-size: 1.25rem;
    color: var(--dash-text-muted);
    font-weight: 300;
}

@media (max-width: 768px) {
    .dash-metrics-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dash-metric-separator,
    
    .dash-metric {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--dash-border);
    }
    
    .dash-metric:last-child {
        border-bottom: none;
    }
    
    .dash-metric-result {
        margin: 0;
        padding: 0.75rem;
    }
}

/* Chart */
.dash-chart-wrapper {
    background: var(--dash-card);
    border-radius: var(--dash-radius);
    border: 1px solid var(--dash-border);
    padding: 1.5rem;
    height: 300px;
    box-shadow: var(--dash-shadow);
}

/* Navigation Grid */
.dash-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .dash-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    text-decoration: none;
    color: var(--dash-text);
    transition: all 0.15s ease;
    box-shadow: var(--dash-shadow);
}

.dash-nav-item:hover {
    border-color: var(--dash-info);
    box-shadow: var(--dash-shadow-md);
    transform: translateY(-2px);
}

.dash-nav-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-bg);
    border-radius: 10px;
}

.dash-nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dash-nav-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dash-text);
}

.dash-nav-count {
    font-size: 0.75rem;
    color: var(--dash-text-muted);
}

/* Table */
.dash-table-wrapper {
    background: var(--dash-card);
    border-radius: var(--dash-radius);
    border: 1px solid var(--dash-border);
    overflow: hidden;
    box-shadow: var(--dash-shadow);
}

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

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

.dash-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--dash-text);
    border-bottom: 1px solid var(--dash-border);
}

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

.dash-table-name {
    font-weight: 500;
}

.dash-table-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.dash-table-badge.is-critical {
    background: var(--dash-negative-bg);
    color: var(--dash-negative);
}

.dash-table-badge.is-warning {
    background: var(--dash-warning-bg);
    color: #b45309;
}

.dash-table-badge.is-info {
    background: var(--dash-info-bg);
    color: var(--dash-info);
}

/* ============================================
   NAVBAR - DESIGN PROFESSIONNEL
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-nav {
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
}

/* Logo / Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-brand-icon {
    font-size: 1.25rem;
}

.nav-brand-text {
    letter-spacing: -0.025em;
}

.nav-brand:hover {
    color: #0f172a;
}

/* Navigation principale */
.nav-main {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.nav-item.is-active {
    color: #0f172a;
    background: #eff6ff;
}

/* Actions utilisateur */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.nav-action-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.nav-action-btn.nav-action-primary {
    color: #ffffff;
    background: #0f172a;
    border-color: #0f172a;
}

.nav-action-btn.nav-action-primary:hover {
    background: #1e293b;
}

.nav-action-btn.nav-action-logout:hover {
    color: #dc2626;
    background: #fef2f2;
}

.nav-action-icon {
    font-size: 1rem;
    line-height: 1;
}

.nav-action-text {
    display: inline;
}

/* Mobile */
@media (max-width: 768px) {
    .site-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 0;
        gap: 0.75rem;
    }
    
    .nav-brand {
        width: 100%;
        justify-content: center;
    }
    
    .nav-main {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .nav-item {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: center;
    }
    
    .nav-action-text {
        display: none;
    }
}

/* ============================================
   NOTIFICATIONS FLASH
   ============================================ */

.notifications-overlay {
    position: fixed;
    top: 70px;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #3b82f6;
    animation: slideIn 0.3s ease;
}

.notification-error,

.notification-text {
    flex: 1;
    font-size: 0.875rem;
    color: #1f2937;
}
.notification-text a {
    color: #4f46e5;
    text-decoration: underline;
    pointer-events: auto;
    cursor: pointer;
}
.notification-text a:hover {
    color: #3730a3;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    color: #6b7280;
}

.notification.is-hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   MAIN CONTENT & FOOTER
   ============================================ */

.site-main {
    min-height: calc(100vh - 56px - 48px);
    background: #f8fafc;
}

.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 0.875rem 0;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-size: 0.8125rem;
    color: #64748b;
}

.footer-version {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: monospace;
}

/* ============================================
   COMPOSANTS UI
   ============================================ */

/* Page Layout */
.page {
    max-width: 1280px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.025em;
}

.page-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #94a3b8;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Filtres */
.filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters .form-control {
    min-width: 180px;
    height: 38px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.15s ease;
}

.filters .form-control:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filters .btn {
    height: 38px;
}

/* Tables */
.table-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

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

.table th {
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

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

.table tbody tr:hover td {
    background: #f8fafc;
}

.table .text-right { text-align: right; }
.table .text-center { text-align: center; }

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #0f172a;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
}

.card-price {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.card-price-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.card-price-sub {
    font-size: 0.8125rem;
    color: #94a3b8;
}

.card-footer {
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.5rem;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 34px;
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    
    text-decoration: none;
    box-sizing: border-box;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn-primary {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

.btn-primary:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: white;
}

.btn-secondary {
    background: #ffffff;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    color: #0f172a;
}

.btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

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

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-ghost {
    background: transparent;
    color: #475569;
    border-color: transparent;
}

.btn-ghost:hover {
    background: #f8fafc;
    color: #0f172a;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-default {
    background: #f8fafc;
    color: #475569;
}

.badge-success {
    background: #ecfdf5;
    color: #10b981;
}

.badge-danger {
    background: #fef2f2;
    color: #ef4444;
}

.badge-warning {
    background: #fffbeb;
    color: #b45309;
}

/* Modals */
.modal,
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

.modal-dialog.modal-lg { max-width: 700px; }
.modal-dialog.modal-xl { max-width: 900px; }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f8fafc;
    color: #0f172a;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header-danger {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}

.modal-header-danger h3 { color: #ef4444; }

.modal-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.modal-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.modal-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    font-size: 1.125rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* Auth Pages */
.auth-page {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f1f5f9;
}

.auth-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.auth-header h1 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.875rem;
    color: #94a3b8;
}

.auth-body {
    padding: 1.5rem 2rem 2rem;
}

.auth-footer {
    padding: 1.25rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 0.875rem;
    color: #475569;
}

.auth-footer a {
    color: #0f172a;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-box-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-box-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-box-label {
    font-size: 0.8125rem;
    color: #94a3b8;
}

.stat-box.stat-success { border-left: 3px solid #10b981; }
.stat-box.stat-danger { border-left: 3px solid #ef4444; }
.stat-box.stat-warning { border-left: 3px solid #f59e0b; }

/* Formulaires */
.form-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

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

.form-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1rem;
}



.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-error {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 1.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
}

.form-check-label {
    font-size: 0.875rem;
    color: #475569;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters .form-control {
        width: 100%;
    }
    
    .modal-dialog {
        max-width: 100%;
        border-radius: 0;
    }
}

/* Auth footer link */
.auth-footer a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-footer a:hover {
    color: #475569;
}

/* Auth page sans scroll */
.auth-page {
    min-height: calc(100vh - 56px - 49px);
    height: calc(100vh - 56px - 49px);
    overflow: hidden;
}

/* Cacher navbar actions sur page auth */
.auth-page-body .nav-actions {
    display: none;
}

/* List Items (accordion) */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.list-item-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 1rem;
}

.list-item-header:hover {
    background: #f8fafc;
}

.list-item-main {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.125rem;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: #94a3b8;
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.list-item-meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.list-item-meta-label {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.list-item-meta-value {
    font-weight: 600;
    color: #0f172a;
}

.list-item-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.15s ease;
}

.list-item.is-open .list-item-toggle {
    transform: rotate(180deg);
}

.list-item-content {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.list-item.is-open .list-item-content {
    display: block;
}

.list-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.list-item-section h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.list-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
}

.list-item-row-label {
    color: #64748b;
}

.list-item-row-value {
    font-weight: 500;
    color: #0f172a;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Dropdown table */
.dropdown-row {
    background: #f8fafc;
}

.dropdown-row td {
    padding: 0 !important;
    border-bottom: none !important;
}

.dropdown-content {
    padding: 1.25rem;
}

.dropdown-section {
    margin-bottom: 1.25rem;
}

.dropdown-section:last-child {
    margin-bottom: 0;
}

.dropdown-section h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.dropdown-form 

.dropdown-form .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.dropdown-form .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

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

.dropdown-icon {
    color: #94a3b8;
    font-size: 0.75rem;
}

.text-muted {
    color: #94a3b8;
}

/* Card clickable */
.card-clickable {
    cursor: pointer;
}

/* Bien detail modal */
.bien-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.bien-detail-section {
    margin-bottom: 1rem;
}

.bien-detail-section h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.detail-row span {
    color: #64748b;
}

.detail-row strong {
    color: #0f172a;
}

.detail-row-total {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.detail-row-total strong {
    font-size: 1rem;
}

/* Email sent badge */
.email-sent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #059669;
}

.email-sent-badge-lg {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.email-sent-icon {
    font-weight: bold;
}

.email-sent-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-reset-email {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-reset-email:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}

/* Quittance preview */
.quittance-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

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

/* Modal alert info */
.modal-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@media (max-width: 768px) {
    .bien-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .quittance-preview {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Quittance PDF Preview */
.quittance-preview-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.quittance-pdf-frame {
    width: 100%;
    height: 600px;
    background: #ffffff;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
}

.quittance-pdf-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.quittance-pdf-frame object {
    width: 100%;
    height: 100%;
}

.quittance-actions-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Ventilation */
.ventilation-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ventilation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ventilation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ventilation-pct {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ventilation-pct .pct-input {
    width: 80px;
    text-align: right;
}

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

/* Modal body scroll */
.modal-body-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

/* Modal body scroll */
.modal-body-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

/* Account grid */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.account-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.account-card-header {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.account-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.account-card-body {
    padding: 1.25rem;
}

.account-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.account-row:last-child {
    border-bottom: none;
}

.account-label {
    color: #64748b;
    font-size: 0.875rem;
}

.account-value {
    color: #0f172a;
    font-weight: 500;
    font-size: 0.875rem;
}

.account-admin {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

/* Form container sizes */
.form-container-sm {
    max-width: 600px;
}

.form-container-xs {
    max-width: 400px;
}

/* ============================================================================
   CLASSES UTILITAIRES
   ============================================================================ */

/* Margins */
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }

/* Text */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.font-semibold { font-weight: 600; }

/* Flexbox */
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }

/* Cursors */
.cursor-pointer { cursor: pointer; }

/* Float */
.float-right { float: right; }

/* Width */
.w-30 { width: 30px; }

/* ================================================================
   DASHBOARD PRO - Styles additionnels v0.14.0
   ================================================================ */

/* Section header avec filtres */
.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dash-section-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Filtre dropdown */
.dash-chart-filters {
    display: flex;
    gap: 0.5rem;
}

.dash-filter-dropdown {
    position: relative;
}

.dash-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dash-filter-btn:hover {
    border-color: #6366f1;
    background: #f9fafb;
}

.dash-filter-icon {
    font-size: 1rem;
}

.dash-filter-arrow {
    font-size: 0.625rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.dash-filter-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.dash-filter-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dash-filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dash-filter-option:hover {
    
}

.dash-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.dash-filter-option span {
    font-size: 0.875rem;
    color: #374151;
}

.dash-filter-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

/* Chart container amélioré */
.dash-chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.dash-chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

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

.dash-legend-label {
    font-size: 0.8125rem;
    color: #6b7280;
}

.dash-legend-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.dash-legend-value.is-positive {
    color: #10b981;
}

.dash-legend-value.is-negative {
    color: #f43f5e;
}

.dash-legend-item-total {
    padding-left: 1.5rem;
    border-left: 1px solid #e5e7eb;
}

.dash-chart-wrapper {
    height: 320px;
    position: relative;
}

/* Layout 2 colonnes */
.dash-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .dash-two-columns {
        grid-template-columns: 1fr;
    }
}

.dash-section-half {
    margin-bottom: 0;
}

/* Donut chart container */
.dash-donut-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 1rem auto;
}

.dash-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.dash-donut-total {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.dash-donut-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

.dash-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dash-donut-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: #f9fafb;
}

.dash-donut-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.dash-donut-legend-name {
    flex: 1;
    font-size: 0.8125rem;
    color: #374151;
    
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-donut-legend-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1f2937;
}

.dash-donut-legend-pct {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 40px;
    text-align: right;
}

/* Rentabilité par bien */
.dash-rentabilite-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-rentabilite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    gap: 1rem;
}

.dash-rentabilite-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.dash-rentabilite-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-rentabilite-type {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: capitalize;
}

.dash-rentabilite-stats {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.dash-rentabilite-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.dash-rentabilite-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-rentabilite-stat-value.is-positive {
    color: #10b981;
}

.dash-rentabilite-stat-value.is-negative {
    color: #f43f5e;
}

.dash-rentabilite-stat-label {
    font-size: 0.6875rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.dash-rentabilite-stat-main {
    padding-left: 1rem;
    border-left: 1px solid #e5e7eb;
}

/* Prochains encaissements */
.dash-encaissements-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-encaissement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.dash-encaissement-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dash-encaissement-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.dash-encaissement-bien {
    font-size: 0.75rem;
    color: #6b7280;
}

.dash-encaissement-amount {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
}

/* Empty state */
.dash-empty-state {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.dash-empty-state-success {
    background: #ecfdf5;
    border-radius: 8px;
}

.dash-empty-state-success .dash-empty-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #10b981;
}

.dash-empty-state-success p {
    color: #047857;
    font-weight: 500;
}

/* Bilan grid */
.dash-bilan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .dash-bilan-grid {
        grid-template-columns: 1fr;
    }
}

.dash-bilan-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.dash-bilan-item-total {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
}

.dash-bilan-item-total .dash-bilan-icon,
.dash-bilan-item-total .dash-bilan-value,
.dash-bilan-item-total .dash-bilan-label {
    color: #ffffff !important;
}

.dash-bilan-icon {
    font-size: 1.5rem;
}

.dash-bilan-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-bilan-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.dash-bilan-value.is-positive {
    color: #10b981;
}

.dash-bilan-value.is-negative {
    color: #f43f5e;
}

.dash-bilan-label {
    font-size: 0.75rem;
    color: #6b7280;
}

/* KPI Trend indicator */
.dash-kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    width: fit-content;
}

.dash-kpi-trend.is-up {
    background: #ecfdf5;
    color: #047857;
}

.dash-kpi-trend.is-down {
    background: #fef2f2;
    color: #dc2626;
}

.dash-kpi-trend-icon {
    font-weight: 700;
}

.dash-kpi-trend-value {
    font-weight: 600;
}

.dash-kpi-trend-label {
    color: #6b7280;
}

/* Badge petit */
.dash-kpi-badge-small {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    
    color: #6b7280;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Centrer boutons dans account cards */
.account-card-footer {
    text-align: center;
}


/* Account cards - amélioration layout */
.account-card {
    display: flex;
    flex-direction: column;
}
.account-card-body {
    flex: 1;
}
.account-card-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 1rem;
}
.account-row .account-label {
    min-width: 100px;
    
}


/* Account card double largeur */
.account-card-wide {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .account-card-wide {
        grid-column: span 1;
    }
}

/* Contenu sécurité en 2 colonnes */
.security-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}
@media (max-width: 768px) {
    .security-content {
        grid-template-columns: 1fr;
    }
}
.security-password {
    border-right: 1px solid var(--border-color);
    padding-right: 2rem;
}
@media (max-width: 768px) {
    .security-password {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1rem;
    }
}
.security-history h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tableau connexions */
.security-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.security-table th,
.security-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.security-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
}
.security-table code {
    background: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}


/* Dashboard - Sélecteur de mois */
.dash-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-month-selector {
    position: relative;
}
.dash-month-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.dash-month-btn:hover {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
}
.dash-month-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}
.dash-month-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dash-month-option {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}
.dash-month-option:hover {
    background: #e0e7ff;
    color: #4f46e5;
}
.dash-month-option.is-active {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
}


/* Dashboard - Sélecteur de mois */
.dash-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-month-selector {
    position: relative;
}
.dash-month-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.dash-month-btn:hover {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
}
.dash-month-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}
.dash-month-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dash-month-option {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}
.dash-month-option:hover {
    background: #e0e7ff;
    color: #4f46e5;
}
.dash-month-option.is-active {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
}

/* Fix Dashboard - Sélecteur de mois */
.dash-month-dropdown {
    background: #ffffff !important;
}
.dash-month-option {
    background: #ffffff;
}
.dash-month-option:hover {
    
}
.dash-month-btn {
    
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-weight: 500;
}

/* Harmoniser bouton mois avec bouton biens */
.dash-month-btn {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 400 !important;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dash-month-btn:hover {
    border-color: #6366f1 !important;
    color: #6366f1;
}

/* Bilan annuel - Design sobre */
.dash-bilan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.dash-bilan-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-bilan-item-total {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-color: #cbd5e1 !important;
}
.dash-bilan-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 10px;
}
.dash-bilan-item-total .dash-bilan-icon {
    background: #e0e7ff;
}
.dash-bilan-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.dash-bilan-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}
.dash-bilan-value.is-positive {
    color: #059669;
}
.dash-bilan-value.is-negative {
    color: #dc2626;
}
.dash-bilan-label {
    font-size: 0.8rem;
    color: #6b7280;
}
@media (max-width: 768px) {
    .dash-bilan-grid {
        grid-template-columns: 1fr;
    }
}

/* Bilan - Résultat net avec fond coloré */
.dash-bilan-item-total.is-positive {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: #6ee7b7 !important;
}
.dash-bilan-item-total.is-negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-color: #fca5a5 !important;
}
.dash-bilan-item-total.is-positive .dash-bilan-icon {
    background: #a7f3d0;
}
.dash-bilan-item-total.is-negative .dash-bilan-icon {
    background: #fecaca;
}

/* Bilan - Texte visible sur fond coloré */
.dash-bilan-item-total .dash-bilan-value {
    color: #065f46 !important;
}
.dash-bilan-item-total.is-negative .dash-bilan-value {
    color: #991b1b !important;
}
.dash-bilan-item-total .dash-bilan-label {
    color: #047857 !important;
}
.dash-bilan-item-total.is-negative .dash-bilan-label {
    color: #b91c1c !important;
}

/* Bilan - Valeur sur une seule ligne */
.dash-bilan-value {
    
}

/* Bilan - Tous les labels sur une seule ligne */
.dash-bilan-label {
    
}
.dash-bilan-content {
    min-width: 0;
}


/* Sélecteur de période graphique */
.dash-period-selector {
    position: relative;
    margin-top: 0.5rem;
}
.dash-period-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dash-period-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}
.dash-period-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}
.dash-period-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dash-period-option {
    display: block;
    padding: 0.6rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}
.dash-period-option:hover {
    background: #e0e7ff;
    color: #4f46e5;
}
.dash-period-option.is-active {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
}


/* Sélecteur d'année inline */
.dash-year-selector {
    display: inline-block;
    position: relative;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.dash-year-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}
.dash-year-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}
.dash-year-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    min-width: 100px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s;
    z-index: 100;
}
.dash-year-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dash-year-option {
    display: block;
    padding: 0.5rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.dash-year-option:hover {
    background: #e0e7ff;
    color: #4f46e5;
    
}
.dash-year-option.is-active {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
}

.dash-section-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.dash-chart-filters {
    margin-top: 0;
}

.dash-section-title-group {
    width: 100%;
}
.dash-chart-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-period-selector {
    position: relative;
    margin-top: 0;
}


/* Graphique - Header avec titre, période et filtre alignés */
.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.dash-section-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-section-title-group .dash-section-title {
    margin: 0;
}
.dash-chart-filters {
    margin: 0;
}


/* Contrôles du graphique (période + filtre biens) */
.dash-chart-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Harmoniser hauteur boutons période et filtre biens */
.dash-period-btn,
.dash-filter-btn {
    height: 38px;
    padding: 0 1rem !important;
    display: inline-flex;
    align-items: center;
}

/* Harmoniser style boutons période et filtre biens */
.dash-period-btn,
.dash-filter-btn {
    color: #374151 !important;
}
.dash-period-btn:hover,
.dash-filter-btn:hover {
    color: #6366f1 !important;
    border-color: #6366f1 !important;
}
.dash-filter-btn .dash-filter-arrow {
    color: inherit;
}


/* Légende interactive */
.dash-legend-item {
    cursor: pointer;
    transition: opacity 0.2s, text-decoration 0.2s;
    user-select: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.dash-legend-item:hover {
    background: rgba(0,0,0,0.05);
}
.dash-legend-item.is-hidden {
    opacity: 0.4;
    text-decoration: line-through;
}


/* Légende cumuls */
.dash-legend-separator {
    color: #d1d5db;
    margin: 0 0.5rem;
}
.dash-legend-dot-dashed {
    position: relative;
}
.dash-legend-dot-dashed::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}
.dash-legend-item-cumul {
    font-size: 0.85rem;
}


/* Légende cumuls */
.dash-legend-separator {
    color: #d1d5db;
    margin: 0 0.75rem;
    font-size: 1.2rem;
}
.dash-legend-color-dashed {
    position: relative;
    border: 2px dashed currentColor;
    background: transparent !important;
}


/* Version link dans footer */
.version-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.version-link:hover {
    color: #6366f1;
    text-decoration: underline;
}

/* Changelog dans modal */
.changelog {
    max-height: 60vh;
    overflow-y: auto;
}
.changelog-version {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.changelog-version:last-child {
    border-bottom: none;
}
.changelog-version-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.changelog-badge {
    background: #6366f1;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.changelog-badge.changelog-current {
    background: #10b981;
    font-size: 0.85rem;
}
.changelog-date {
    color: #6b7280;
    font-size: 0.85rem;
}
.changelog-tag {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
}
    color: #065f46;
}
.changelog-version h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #1f2937;
}
.changelog-version ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #4b5563;
}
.changelog-version li {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.changelog-version li strong {
    color: #1f2937;
}

/* Modal large pour changelog */
.modal-lg {
    max-width: 700px;
}

/* Footer version link */
.footer-version.version-link {
    color: #9ca3af;
    text-decoration: none;
}
.footer-version.version-link:hover {
    color: #6366f1;
    text-decoration: underline;
}

/* Modal overlay affichage */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.modal-overlay.is-open {
    display: flex;
}


/* ================================================================
   NAVBAR REDESIGN v0.15.0
   ================================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #f8fafc;
    border-bottom: none;
}
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
}
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #1f2937;
    font-weight: 700;
    font-size: 1.1rem;
}
.nav-brand-icon {
    width: 28px;
    height: 28px;
    color: #6366f1;
}
.nav-brand-text {
    color: #1f2937;
}
.nav-brand:hover .nav-brand-icon {
    color: #4f46e5;
}

/* Navigation principale */
.nav-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Boutons navigation */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}
.nav-btn:hover {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.nav-btn.is-active {
    background: #ffffff;
    border-color: #6366f1;
    color: #6366f1;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.15);
}
.nav-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Boutons icône seule */
.nav-btn-icon-only {
    padding: 0.5rem;
}
.nav-btn-icon-only .nav-btn-icon {
    width: 20px;
    height: 20px;
}

/* Bouton déconnexion */
.nav-btn-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-btn span:not(.nav-btn-icon) {
        display: none;
    }
    .nav-btn {
        padding: 0.5rem;
    }
    .nav-brand-text {
        display: none;
    }
}


/* Navbar emojis */
.nav-btn-icon {
    font-size: 1rem;
    line-height: 1;
}
.nav-brand-icon {
    font-size: 1.4rem;
}


/* Navbar Dropdown Patrimoine */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-dropdown-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 160px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.15s;
}
.nav-dropdown-item:hover {
    
    color: #1f2937;
}
.nav-dropdown-item.is-active {
    color: #6366f1;
    background: #eef2ff;
}


/* ================================================================
   PATRIMOINE - Page unifiée Biens + Locataires
   ================================================================ */

.patrimoine-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.patrimoine-item {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.patrimoine-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.patrimoine-item.is-vacant {
    border-left: 4px solid #f59e0b;
}

.patrimoine-header {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(200px, 300px) 50px;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    gap: 1rem;
}
.patrimoine-header:hover {
    background: #f9fafb;
}

.patrimoine-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.patrimoine-icon {
    font-size: 1.5rem;
}
.patrimoine-info {
    display: flex;
    flex-direction: column;
}
.patrimoine-nom {
    font-weight: 600;
    color: #1f2937;
}
.patrimoine-type {
    font-size: 0.85rem;
    color: #6b7280;
}

.patrimoine-header-center {
    text-align: center;
    justify-self: center;
}
.patrimoine-loyer {
    font-weight: 600;
    color: #10b981;
}
.patrimoine-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.patrimoine-badge.is-vacant {
    background: #fef3c7;
    color: #92400e;
}

.patrimoine-header-right {
    justify-self: end;
    text-align: right;
}
.patrimoine-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}
.patrimoine-stats .is-positive {
    color: #10b981;
}
.patrimoine-stats .is-negative {
    color: #ef4444;
}
.patrimoine-toggle {
    font-size: 0.8rem;
    color: #9ca3af;
    transition: transform 0.2s;
}
.patrimoine-item.is-open .patrimoine-toggle {
    transform: rotate(90deg);
}

/* Contenu déplié */
.patrimoine-content {
    display: none;
    border-top: 1px solid #e5e7eb;
    padding: 1.25rem;
    background: #f9fafb;
}
.patrimoine-item.is-open .patrimoine-content {
    display: block;
}

.patrimoine-section {
    margin-bottom: 1rem;
}
.patrimoine-section-header {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.patrimoine-locataire {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
}
.patrimoine-locataire-info {
    display: flex;
    flex-direction: column;
}
.patrimoine-locataire-nom {
    font-weight: 500;
    color: #1f2937;
}
.patrimoine-locataire-date {
    font-size: 0.8rem;
    color: #6b7280;
}
.patrimoine-locataire-actions {
    display: flex;
    gap: 0.5rem;
}

.patrimoine-empty {
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}

.patrimoine-add-btn {
    margin-top: 0.5rem;
}

.patrimoine-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Boutons */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}
.btn-outline:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}
.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-danger:hover {
    background: #fecaca;
}


/* Patrimoine - Légende */
.patrimoine-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #6b7280;
}
.patrimoine-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Patrimoine - Charges */
.patrimoine-charges {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 400;
}

/* Alert */
.alert-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fde68a;
}
.alert-warning a {
    color: #92400e;
    font-weight: 600;
}


/* Patrimoine - Historique section */
.patrimoine-section-historique {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e5e7eb;
}
.patrimoine-section-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.patrimoine-section-toggle:hover {
    color: #6366f1;
}
.patrimoine-section-arrow {
    font-size: 0.8rem;
    color: #9ca3af;
}
.patrimoine-locataire-ancien {
    opacity: 0.7;
    background: #f9fafb;
}

/* Patrimoine - Section standalone */
.patrimoine-section-standalone {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}
.patrimoine-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.patrimoine-section-count {
    background: #e5e7eb;
    color: #4b5563;
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* Patrimoine - Cards locataires */
.patrimoine-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.patrimoine-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
}
.patrimoine-card.has-impayes {
    border-left: 4px solid #f59e0b;
}
.patrimoine-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.patrimoine-card-name {
    font-weight: 600;
    color: #1f2937;
}
.patrimoine-card-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.patrimoine-card-badge.is-warning {
    background: #fef3c7;
    color: #92400e;
}
.patrimoine-card-info {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}
.patrimoine-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}


/* RAPPORTS */
.rapports-stats {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
}
.rapports-stats-header { margin-bottom: 1rem; }
.rapports-stats-header h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.rapports-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.rapports-stat-card { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 1rem; text-align: center; }
.rapports-stat-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.rapports-stat-value { display: block; font-size: 1.5rem; font-weight: 700; }
.rapports-stat-value.is-positive { color: var(--color-success); }
.rapports-stat-value.is-negative { color: var(--color-danger); }
.rapports-section { margin-bottom: 2rem; }
.rapports-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.rapports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.rapports-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 1.5rem; transition: box-shadow 0.2s, transform 0.2s; }
.rapports-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.rapports-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.rapports-card-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem 0; }
.rapports-card-description { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 1rem 0; line-height: 1.5; }
.rapports-card-actions { display: flex; gap: 0.75rem; align-items: center; }
.rapports-select { flex: 1; max-width: 120px; }
.rapports-info { display: flex; gap: 1rem; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-top: 2rem; }
.rapports-info-icon { font-size: 1.5rem; flex-shrink: 0; }
.rapports-info-content h4 { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.25rem 0; }
.rapports-info-content p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.page-header-left { display: flex; align-items: center; gap: 1rem; }
.btn-back { padding: 0.5rem 1rem; }
.rapport-resume { background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%); border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; }
.rapport-resume h2 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin: 0 0 1rem 0; text-transform: uppercase; letter-spacing: 0.5px; }
.rapport-resume-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.rapport-resume-item { text-align: center; }
.rapport-resume-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.rapport-resume-value { display: block; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.rapport-resume-ref { display: block; font-size: 0.75rem; color: var(--text-muted); }
.rapport-resume-total { background: #fff; border-radius: var(--radius-md); padding: 1rem; border: 2px solid var(--color-primary); }
.rapport-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-md); overflow: hidden; border: 1px solid #e5e7eb; }
.rapport-table th, .rapport-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.rapport-table th { background: var(--bg-secondary); font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; }
.rapport-table tbody tr:hover { background: var(--bg-hover); }
.rapport-table tfoot tr { background: var(--bg-secondary); }
.rapport-table-total td { border-top: 2px solid var(--border-color); font-weight: 600; }
.rapport-section { margin-bottom: 2rem; }
.rapport-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.rapport-note { background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-top: 2rem; }
.rapport-note p { font-size: 0.9rem; margin: 0; line-height: 1.5; }
@media print { .site-header, .site-footer, .page-actions, .btn-back { display: none !important; } .rapport-resume, .rapport-table { break-inside: avoid; } }


/* RAPPORTS - Cards Synthese ameliorees */
.rapports-synthese {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.rapports-synthese-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    opacity: 0.9;
}
.rapports-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.rapports-card-stat {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, background 0.2s;
}
.rapports-card-stat:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}
.rapports-card-stat.is-highlight {
    background: rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
}
.rapports-card-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.rapports-card-stat-icon.is-success { background: rgba(16, 185, 129, 0.2); }
.rapports-card-stat-icon.is-danger { background: rgba(239, 68, 68, 0.2); }
.rapports-card-stat-icon.is-info { background: rgba(59, 130, 246, 0.2); }
.rapports-card-stat-icon.is-primary { background: rgba(139, 92, 246, 0.2); }
.rapports-card-stat-content { flex: 1; }
.rapports-card-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.rapports-card-stat-value.is-positive { color: #34d399; }
.rapports-card-stat-value.is-negative { color: #f87171; }
.rapports-card-stat-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.25rem;
}

/* Export buttons stack */
.rapports-card-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.rapports-export-btns {
    display: flex;
    gap: 0.5rem;
}
.rapports-export-btns .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}
.btn-outline:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}


/* RAPPORTS - Cards Synthèse sobres style dashboard */
.rapports-synthese-section {
    margin-bottom: 2rem;
}
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.stats-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}
.stats-card:hover {
    box-shadow: var(--shadow-md);
}
.stats-card.is-highlight {
    border-color: var(--color-primary);
    border-width: 2px;
}
.stats-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.stats-card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.stats-card-icon {
    font-size: 1.25rem;
}
.stats-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stats-card-value.is-positive {
    color: var(--color-success);
}
.stats-card-value.is-negative {
    color: var(--color-danger);
}


/* ============================================
   RAPPORTS - Classes dédiées (pas de CSS inline)
   ============================================ */

/* Grille des rapports disponibles */
.rapports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* Card rapport */
.rapport-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
}

.rapport-card.is-disabled {
    opacity: 0.6;
}

/* Header de card rapport */
.rapport-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rapport-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.rapport-card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Actions de card rapport */
.rapport-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: auto;
}

.rapport-export-btns {
    display: flex;
    gap: 0.5rem;
}

.rapport-export-btns .btn {
    flex: 1;
}

/* Note d'information */
.rapport-note {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
}

.rapport-note-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.rapport-note-content strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.rapport-note-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Grille KPI 3 colonnes */
.rapports-kpi-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .rapports-kpi-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Tables rapports */
.rapport-table th.text-right,
.rapport-table td.text-right {
    text-align: right;
}

.rapport-table td.is-positive {
    color: var(--color-success);
}

.rapport-table td.is-negative {
    color: var(--color-danger);
}

.rapport-table td.is-muted {
    color: var(--text-secondary);
}

.rapport-table td.is-bold {
    font-weight: 600;
}

.rapport-table .address-small {
    color: var(--text-secondary);
}

.rapport-table tr.total-row {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.rapport-table td.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Header fiscal */
.rapport-fiscal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rapport-fiscal-header .btn-back {
    margin-right: 0.5rem;
}

/* Spacer pour alignement KPI */
.dash-kpi-spacer {
    height: 32px;
}


/* ============================================
   FICHE LOCATAIRE
   ============================================ */

/* Alerte impayés */
.fiche-alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.fiche-alert-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

.fiche-alert-icon {
    font-size: 1.25rem;
}

.fiche-alert-text {
    flex: 1;
    color: #92400e;
}

/* KPIs */
.fiche-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .fiche-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.fiche-kpi {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}

.fiche-kpi-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.fiche-kpi-value.is-positive {
    color: #10b981;
}

.fiche-kpi-value.is-negative {
    color: #ef4444;
}

.fiche-kpi-label {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Grille 2 colonnes */
.fiche-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .fiche-grid {
        grid-template-columns: 1fr;
    }
}

.fiche-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cards */
.fiche-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.fiche-card-full {
    height: fit-content;
}

.fiche-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.fiche-card-header-toggle {
    cursor: pointer;
}

.fiche-card-header-toggle:hover {
    
}

.fiche-card-arrow {
    color: #6b7280;
    font-size: 0.875rem;
}

.fiche-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.fiche-card-body {
    padding: 1.25rem;
}

.fiche-card-collapsible {
    display: none;
}

/* Infos grid */
.fiche-info-grid {
    display: grid;
    gap: 1rem;
}

.fiche-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fiche-info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.fiche-info-value {
    font-size: 0.95rem;
    color: #1f2937;
}

.fiche-info-value a {
    color: #6366f1;
    text-decoration: none;
}

.fiche-info-value a:hover {
    text-decoration: underline;
}

.fiche-info-big {
    font-size: 1.5rem;
    font-weight: 600;
}

.fiche-info-empty {
    color: #9ca3af;
    font-style: italic;
}

/* Badges */
.fiche-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.fiche-badge.is-success {
    background: #d1fae5;
    color: #065f46;
}

.fiche-badge.is-warning {
    background: #fef3c7;
    color: #92400e;
}

.fiche-badge.is-danger {
    background: #fee2e2;
    color: #991b1b;
}

.fiche-badge.is-muted {
    
    color: #6b7280;
}

/* Biens */
.fiche-bien-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.fiche-bien-item:last-child {
    border-bottom: none;
}

.fiche-bien-ancien {
    opacity: 0.7;
}

.fiche-bien-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.fiche-bien-nom {
    font-weight: 600;
    color: #1f2937;
}

.fiche-bien-detail {
    font-size: 0.8rem;
    color: #6b7280;
}

.fiche-bien-loyer {
    text-align: right;
}

.fiche-bien-montant {
    font-weight: 600;
    color: #1f2937;
}

.fiche-bien-charges {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Table loyers */
.fiche-table {
    width: 100%;
    border-collapse: collapse;
}

.fiche-table th,
.fiche-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.fiche-table th {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.fiche-table td {
    font-size: 0.9rem;
    color: #1f2937;
}

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

/* Empty state */
.fiche-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-style: italic;
}

/* Lien locataire cliquable */
.patrimoine-locataire-link {
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.patrimoine-locataire-link:hover {
    
    color: #6366f1;
}

/* Zone locataire entièrement cliquable */
a.patrimoine-locataire-link {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-decoration: none;
    color: inherit;
    padding: 0.75rem 1rem;
    margin: -0.75rem -1rem;
    margin-right: 0;
    border-radius: 8px;
    transition: background 0.15s;
    flex: 1;
}

a.patrimoine-locataire-link:hover {
    background: transparent;
    
}

a.patrimoine-locataire-link:hover .patrimoine-locataire-nom {
    color: #6366f1;
}

/* ===========================================
   FIX Modal Dépense v0.18.5
   Le form dans le modal doit être flex pour
   que le footer reste visible
   =========================================== */
#modal-depense form,
.modal-dialog form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#modal-depense .modal-body,
.modal-dialog form .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#modal-depense .modal-footer,
.modal-dialog form .modal-footer {
    flex-shrink: 0;
}


/* Auth page */
.auth-page {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.auth-header h1 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}
.auth-header p {
    color: #6b7280;
    font-size: 0.9rem;
}
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}
.auth-hint {
    font-size: 0.8rem;
    color: #9ca3af;
}
.admin-preview-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.admin-preview-icon {
    font-size: 1.1rem;
}
.admin-preview-link {
    background: #4f46e5;
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}
.admin-preview-link:hover {
    background: #4338ca;
}
.password-strength {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s;
    border-radius: 3px;
}
.strength-weak { background: #ef4444; }
.strength-fair { background: #f59e0b; }
.strength-good { background: #10b981; }
.strength-strong { background: #059669; }
.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}
.text-weak { color: #ef4444; }
.text-fair { color: #f59e0b; }
.text-good { color: #10b981; }
.text-strong { color: #059669; }
.password-requirements {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}
.password-requirements li {
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.password-requirements .req-valid {
    color: #10b981;
}
.password-match {
    font-size: 0.75rem;
    margin-top: 0.35rem;
    min-height: 1rem;
}
.match-valid { color: #10b981; }
.match-invalid { color: #ef4444; }


/* Forgot password link */
.form-options {
    text-align: right;
    margin-bottom: 0.5rem !important;
}
.forgot-password-link {
    font-size: 0.85rem;
    color: #6366f1;
    text-decoration: none;
}
.forgot-password-link:hover {
    text-decoration: underline;
    color: #4f46e5;
}
.auth-back-link {
    font-size: 0.9rem;
    color: #6b7280;
    text-decoration: none;
}
.auth-back-link:hover {
    color: #4f46e5;
}


/* Form row between */
.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* Auth footer separator */
.auth-footer-separator {
    margin: 0 0.75rem;
    color: #d1d5db;
}


/* Auth footer stacked */
.auth-footer-register {
    margin-bottom: 0.5rem;
}
.auth-footer-forgot {
    font-size: 0.85rem;
}
.auth-footer-forgot a {
    color: #9ca3af;
    text-decoration: none;
}
.auth-footer-forgot a:hover {
    color: #6366f1;
    text-decoration: underline;
}


/* Impersonation toast */
.impersonator-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.impersonator-icon {
    font-size: 1.2rem;
}
.impersonator-text {
    flex: 1;
}
.impersonator-exit {
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}
.impersonator-exit:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

.notification {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}
.notification:hover {
    opacity: 0.95;
}
.notification-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid #10b981;
}
.notification-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}
.notification-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
}
.notification-danger, .notification-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-modal {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    color: #374151;
    font-size: 1rem;
}


/* Animation sortie notification */
.notification-hide {
    animation: slideOut 0.3s ease forwards;
}
@keyframes slideOut {
    from { 
        opacity: 1; 
        transform: translateX(0); 
    }
    to { 
        opacity: 0; 
        transform: translateX(100%); 
    }
}

/* ===========================================
   Modal Header Variants (v0.19.3)
   =========================================== */
.modal-header-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}
.modal-header-primary h3 {
    margin: 0;
    color: white;
}
.modal-header-primary .modal-close {
    color: white;
}

/* ===========================================
   Info Box Variants (v0.19.3)
   =========================================== */
.info-box-blue {
    background: #f0f9ff;
    border-left-color: #3b82f6;
}
.info-box-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}
.info-box-warning p {
    margin: 0;
    font-size: 0.9rem;
    color: #92400e;
}
.info-box p {
    margin: 0;
}
.info-box p + p {
    margin-top: 0.5rem;
}

/* ===========================================
   Form Input Variants (v0.19.3)
   =========================================== */
.form-control-lg {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ===========================================
   Helper Text (v0.19.3)
   =========================================== */
.form-help {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================================================
   MODAL ERREUR GÉNÉRIQUE
   ============================================================================ */

#modal-error {
    display: none;
    z-index: 10001;
}

#modal-error .modal-container {
    max-width: 400px;
    z-index: 10002;
}

#modal-error-message {
    text-align: center;
    font-size: 1rem;
    color: var(--color-gray-700);
}

#modal-error .modal-footer {
    justify-content: center;
}

/* ============================================================================
   WIDGET DÉPENSES À PAYER - Dashboard
   ============================================================================ */

.dash-encaissement-item.is-overdue {
    background: var(--color-red-50);
    border-left: 3px solid var(--color-red-500);
}

.dash-encaissement-item.is-overdue .dash-encaissement-amount {
    color: var(--color-red-600);
    font-weight: 600;
}

.dash-badge-retard {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: var(--color-red-100);
    color: var(--color-red-700);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.dash-encaissement-amount.is-negative {
    color: var(--color-red-600);
}

.dash-voir-plus {
    display: block;
    text-align: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-top: 1px solid var(--color-gray-200);
    transition: background 0.15s;
}

.dash-voir-plus:hover {
    background: var(--color-gray-50);
}

/* ============================================================================
   DÉPENSES RÉCURRENTES
   ============================================================================ */

.list-item.is-inactive {
    opacity: 0.6;
}

.list-item.is-inactive .list-item-title {
    color: var(--color-gray-500);
}

.list-item-frequency {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-left: 0.25rem;
}

.list-item-chevron {
    font-size: 0.75rem;
    color: var(--color-gray-400);
    transition: transform 0.2s;
    margin-left: 1rem;
}

.list-item.is-expanded .list-item-chevron {
    transform: rotate(180deg);
}

.list-item-details {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-gray-200);
}

.list-item.is-expanded .list-item-details {
    display: block;
}

.list-item-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.list-item-details-section h4 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

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

.table-simple td {
    padding: 0.25rem 0;
}

.table-simple td:first-child {
    color: var(--color-gray-500);
    width: 40%;
}

.ventilation-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary-50);
    color: var(--color-primary-700);
    border-radius: 4px;
    font-size: 0.875rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.ventilation-badge span {
    font-weight: 600;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray-200);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.stat-warning {
    border-left-color: var(--color-yellow-500);
}

.stat-warning .stat-box-icon {
    color: var(--color-yellow-600);
}

@media (max-width: 768px) {
    .list-item-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .list-item-actions {
        flex-wrap: wrap;
    }
}

/* BADGES DÉPENSES RÉCURRENTES / AUTO-PAYÉES */

.dash-badge-recurrent {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.dash-badge-auto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--color-green-100);
    color: var(--color-green-600);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.375rem;
}

.dash-encaissement-item.is-auto-paid {
    background: var(--color-green-50);
    border-left: 3px solid var(--color-green-400);
}

.dash-encaissement-item.is-auto-paid .dash-encaissement-amount {
    color: var(--color-green-600);
}

.badge-recurrent {
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0.8;
}

/* MODAL CHOIX RÉCURRENCE */

.choix-recurrente-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn-choix-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.btn-choix-option:hover {
    background: var(--color-primary-50);
    border-color: var(--color-primary);
}

.btn-choix-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.btn-choix-title {
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
}

.btn-choix-desc {
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

/* DASHBOARD - DÉPENSES CLICKABLES */

.dash-clickable {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.dash-clickable:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--color-primary);
}

.dash-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.btn-action-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.btn-action-option:hover {
    background: var(--color-primary-50);
    border-color: var(--color-primary);
}

.btn-action-option.btn-action-danger:hover {
    background: var(--color-red-50);
    border-color: var(--color-red-500);
}

.btn-action-icon {
    font-size: 1.5rem;
}

.btn-action-title {
    font-weight: 500;
    color: var(--color-gray-900);
}

.choix-recurrente-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn-choix-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.btn-choix-option:hover {
    background: var(--color-primary-50);
    border-color: var(--color-primary);
}

.btn-choix-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.btn-choix-title {
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
}

.btn-choix-desc {
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

/* BTN CHOIX DANGER */
.btn-choix-option.btn-choix-danger:hover {
    background: var(--color-red-50);
    border-color: var(--color-red-500);
}

.btn-choix-option.btn-choix-danger .btn-choix-icon {
    color: var(--color-red-500);
}

/* FORM SECTION DIVIDER */
.form-section-divider {
    height: 1px;
    background: var(--color-gray-200);
    margin: 1.5rem 0;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 1rem;
}

.form-subsection {
    padding-left: 1.5rem;
    border-left: 3px solid var(--color-primary-100);
    margin-top: 0.75rem;
}

/* MODAL DÉPENSE - AMÉLIORATION UX */



@media (max-width: 500px) {
    
}



.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-gray-100);
}

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

.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-section-badge {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-gray-500);
}

.form-subsection {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--color-gray-50);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
    display: block;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Ventilation améliorée */
.ventilation-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ventilation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ventilation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--color-gray-50);
    border-radius: 6px;
    transition: background 0.15s;
}

.ventilation-row:hover {
    background: var(--color-gray-100);
}

.ventilation-check {
    flex: 1;
}

.ventilation-pct {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100px;
}

.ventilation-pct .form-control-sm {
    width: 70px;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    text-align: right;
}

.pct-symbol {
    color: var(--color-gray-500);
    font-size: 0.9rem;
}

/* Boutons améliorés */
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}

.btn-outline:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-600);
}

.btn-ghost:hover {
    background: var(--color-gray-100);
}

/* FORM ROWS - ALIGNEMENT PARFAIT */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
}

.form-row .form-label {
    min-height: 1.5rem;
    display: flex;
    align-items: flex-end;
}

.form-row .form-control {
    width: 100%;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row .form-label {
        min-height: auto;
    }
}

.form-col-6 {
    width: 100%;
}

/* Récurrences dans dashboard */
.dash-recurrences-header {
    padding: 0.75rem 0 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--color-gray-200);
}

.dash-item-recurrence {
    background: linear-gradient(to right, var(--color-primary-50), transparent);
    border-left: 3px solid var(--color-primary);
}

.dash-badge-recurrent {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.dash-badge-auto {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Bouton action success */
.btn-action-success {
    border-left: 3px solid var(--color-success);
}

.btn-action-success:hover {
    background: var(--color-success-50);
    border-color: var(--color-success);
}

/* Montant dans modal */
.modal-montant {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 0.25rem;
}

/* Hint dans boutons action */
.btn-action-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
}

/* Date info dans modal */
.modal-date-info {
    display: block;
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-top: 0.25rem;
}

.btn-action-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
    font-weight: normal;
}


/* ========================================================================
   DASHBOARD REFONTE v0.20.5
   ======================================================================== */

/* Header row : titre + bouton sur même ligne */
.dash-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.dash-section-header-row .dash-section-title {
    margin-bottom: 0;
}

.dash-section-header-row .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dash-section-header-row .btn-success {
    background: #10b981;
    color: white;
    border: none;
}

.dash-section-header-row .btn-success:hover {
    background: #059669;
}

.dash-section-header-row .btn-primary {
    background: #6366f1;
    color: white;
    border: none;
}

.dash-section-header-row .btn-primary:hover {
    background: #4f46e5;
}

/* Bloc Analyse Annuelle avec border visible */
.dash-analyse-annuelle {
    background: var(--card-bg, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

/* Bilan en ligne horizontale (3 colonnes) */
.dash-bilan-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.dash-bilan-row .dash-bilan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dash-bilan-row .dash-bilan-icon {
    font-size: 1.5rem;
}

.dash-bilan-row .dash-bilan-content {
    display: flex;
    flex-direction: column;
}

.dash-bilan-row .dash-bilan-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.dash-bilan-row .dash-bilan-value.is-positive {
    color: #10b981;
}

.dash-bilan-row .dash-bilan-value.is-negative {
    color: #ef4444;
}

.dash-bilan-row .dash-bilan-label {
    font-size: 0.8rem;
    color: #64748b;
}

.dash-bilan-row .dash-bilan-result {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.dash-bilan-row .dash-bilan-result.is-negative {
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

/* Colonnes Donut + Rentabilité côte à côte (50% chacune) */
.dash-analyse-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dash-analyse-col {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.dash-subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Ajustements donut dans nouvelle structure */
.dash-analyse-col .dash-donut-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dash-analyse-col .dash-donut-legend {
    margin-top: 1rem;
    width: 100%;
}

/* Ajustements rentabilité dans nouvelle structure */
.dash-analyse-col .dash-rentabilite-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .dash-analyse-columns {
        grid-template-columns: 1fr;
    }
    
    .dash-bilan-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ========================================================================
   DASHBOARD AJUSTEMENTS v0.20.5b
   ======================================================================== */

/* Dropdown mois tout à droite dans le header */
.page-header .dash-header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.page-header .dash-header-title h1 {
    margin: 0;
}

.page-header .dash-month-selector {
    margin-left: auto;
}

/* Force les colonnes Répartition/Rentabilité côte à côte */
.dash-analyse-columns {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
}

.dash-analyse-col {
    width: 100% !important;
    min-width: 0;
}

/* Responsive uniquement sur petit écran */
@media (max-width: 768px) {
    .dash-analyse-columns {
        grid-template-columns: 1fr !important;
    }
    
    .page-header .dash-header-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .page-header .dash-month-selector {
        margin-left: 0;
    }
}



/* ========================================================================
   DROPDOWN MOIS DANS BLOC SOLDE (fond sombre)
   ======================================================================== */
.dash-kpi-featured .dash-month-selector-compact {
    position: relative;
    display: inline-block;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-btn svg {
    opacity: 0.7;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-option {
    display: block;
    padding: 0.6rem 1rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-option:last-child {
    border-bottom: none;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-option:hover {
    background: #f8fafc;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-option.is-active {
    background: #6366f1;
    color: white;
}

.dash-kpi-featured .dash-month-selector-compact .dash-month-option.is-active:hover {
    background: #4f46e5;
}


/* ========================================================================
   DROPDOWN MOIS BLOC SOLDE - OVERRIDE FINAL
   ======================================================================== */
.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 6px !important;
    padding: 0.3rem 0.6rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: white !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    color: white !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-btn svg {
    stroke: white !important;
    opacity: 0.8;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-dropdown {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    left: auto !important;
    background: white !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    min-width: 180px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    display: none !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-dropdown.is-open {
    display: block !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-option {
    display: block !important;
    padding: 0.65rem 1rem !important;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: white !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-option:last-child {
    border-bottom: none !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-option:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

.dash-kpi.dash-kpi-featured .dash-month-selector-compact .dash-month-option.is-active {
    background: #6366f1 !important;
    color: white !important;
}


/* ============================================
   GRAND LIVRE COMPTABLE
   ============================================ */

.grand-livre-totaux {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.total-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 150px;
}

.total-card.total-solde {
    background: #f8fafc;
    border-color: var(--primary);
}

.total-card.total-lettre {
    opacity: 0.7;
}

.total-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.total-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.total-value.is-debit {
    color: var(--danger);
}

.total-value.is-credit {
    color: var(--success);
}



.selection-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}



.grand-livre-table {
    font-size: 0.9rem;
}

.grand-livre-table th {
    background: #f1f5f9;
    font-weight: 600;
    white-space: nowrap;
}

.grand-livre-table .col-check {
    width: 40px;
    text-align: center;
}

.grand-livre-table .col-date {
    width: 100px;
}

.grand-livre-table .col-debit,
.grand-livre-table .col-credit {
    width: 120px;
    text-align: right;
}

.grand-livre-table .col-lettrage {
    width: 80px;
    text-align: center;
}

.grand-livre-table .col-actions {
    width: 60px;
    text-align: center;
}

.grand-livre-table tr.is-lettre {
    background: #f0fdf4;
}

.grand-livre-table tr.is-lettre td {
    color: #6b7280;
}

.libelle-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nature-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: #e5e7eb;
    color: #374151;
    text-transform: uppercase;
    width: fit-content;
}

.nature-badge.nature-depense { background: #fee2e2; color: #991b1b; }
.nature-badge.nature-paiement_depense { background: #dcfce7; color: #166534; }
.nature-badge.nature-loyer_appel { background: #dbeafe; color: #1e40af; }
.nature-badge.nature-loyer_encaissement { background: #d1fae5; color: #065f46; }
.nature-badge.nature-avoir { background: #fef3c7; color: #92400e; }
.nature-badge.nature-remboursement { background: #fce7f3; color: #9d174d; }
.nature-badge.nature-regularisation { background: #e0e7ff; color: #3730a3; }

.libelle-text {
    font-size: 0.85rem;
}

.mode-paiement {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.montant-debit {
    color: var(--danger);
    font-weight: 500;
}

.montant-credit {
    color: var(--success);
    font-weight: 500;
}

.code-lettrage {
    display: inline-block;
    background: white;
    color: #475569;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-lettrage:hover,
.code-lettrage.highlight {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.filtres-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filtres-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filtre-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filtre-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.filtre-group .form-control {
    min-width: 120px;
}

.filtre-actions {
    flex-direction: row;
    gap: 0.5rem;
}

.filtre-checkbox {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.filtre-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}


/* Card mise en avant (Grand Livre) */
.rapport-card-highlight {
    border: 1px solid #e5e7eb;
    background: #fff;
}

.rapport-card-highlight .rapport-card-header {
    color: var(--primary);
}

.rapport-card-highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.rapport-export-btns {
    display: flex;
    gap: 0.5rem;
}

.rapport-export-btns .btn {
    flex: 1;
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}


/* ============================================
   GRAND LIVRE - STICKY LETTRAGE UNIQUEMENT
   ============================================ */
.lettrage-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    position: sticky;
    top: 76px;
    z-index: 50;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 0 0 1rem 0;
}

.grand-livre-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    padding: 0.75rem;
    font-weight: 600;
    color: #475569;
}

/* Modal Créer Loyer - Liste baux */
.modal-md .modal-dialog {
    max-width: 500px;
}

.baux-liste {
    max-height: 300px;
    overflow-y: auto;
}

.bail-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.bail-checkbox:hover {
    background: #f8f9fa;
}

.bail-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.bail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bail-bien {
    font-size: 0.85rem;
    color: #6c757d;
}

.bail-montant {
    font-weight: 600;
    color: #2d3748;
}

.bail-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.bail-tag.auto {
    background: #d4edda;
    color: #155724;
}

.bail-tag.manuel {
    background: #fff3cd;
    color: #856404;
}

.baux-empty {
    text-align: center;
    padding: 2rem;
    color: #28a745;
}

.baux-empty-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

/* Filtres loyers améliorés */
.filters-form {
    width: 100%;
}

.filters-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters-row .form-control {
    min-width: 150px;
    flex: 1;
}

.filters-row .btn-ghost {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
}

/* Actions loyer - bouton supprimer à droite */
.dropdown-section h4 + .actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dropdown-section .actions-right {
    margin-left: auto;
}

/* Spacer pour pousser bouton supprimer à droite */
.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.actions-spacer {
    flex: 1;
}
}

.row-expanded td {
    border-top: 1px solid #dee2e6;
}

/* Dropdown loyer ouvert */
.row-expanded {
    background-color: #f8f9fa !important;
}

.row-expanded td {
    background-color: #f8f9fa !important;
    box-shadow: inset 0 1px 0 0 #adb5bd !important;
}

.dropdown-expanded > td {
    background-color: #f8f9fa !important;
    box-shadow: inset 0 -1px 0 0 #adb5bd !important;
}

/* Paiements loyers */
.paiement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.paiement-info {
    font-size: 1.1rem;
}

.paiement-montants {
    display: flex;
    gap: 1rem;
}

.paiement-montants span {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
}

.montant-total {
    background: #e5e7eb;
}

.montant-paye {
    background: #fef3c7;
    color: #92400e;
}

.montant-paye.is-success {
    background: #d1fae5;
    color: #065f46;
}

.montant-paye.is-warning {
    background: #fef3c7;
    color: #92400e;
}

.montant-reste {
    background: #fee2e2;
    color: #991b1b;
}

.progress-bar-container {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.progress-label {
    text-align: right;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.paiements-liste {
    margin-bottom: 1.5rem;
}

.paiements-liste h4 {
    margin-bottom: 0.75rem;
    color: #374151;
}

.paiement-form {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.paiement-form h4 {
    margin-bottom: 1rem;
    color: #374151;
}

/* Statut partiel */
.status-badge.partiel {
    background: #fef3c7;
    color: #92400e;
}

/* Paiements - Badge partiel */
.status-badge.partiel {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    font-weight: 600;
}

/* Paiements - Icône commentaire avec infobulle */
.comment-icon {
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
}

.comment-icon:hover {
    transform: scale(1.2);
}

.comment-icon[title] {
    position: relative;
}

.comment-icon[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-width: 250px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.comment-icon[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

/* Modal small */
.modal-sm {
    max-width: 400px;
}

/* Badge paiement partiel */
.badge-partiel {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
    font-size: 0.85em;
}

/* Modal suppression récurrence - style compact */
.choix-recurrente-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.btn-choix-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.btn-choix-option:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-choix-option.btn-choix-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.btn-choix-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.btn-choix-content {
    display: flex;
    flex-direction: column;
}

.btn-choix-title {
    font-weight: 600;
    color: #1f2937;
}

.btn-choix-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

.modal-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Modal suppression récurrence - style compact */
.choix-options-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.btn-choix-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.btn-choix-compact:hover {
    background: #f9fafb;
    border-color: #3b82f6;
}

.btn-choix-compact-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.btn-choix-compact-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.btn-choix-compact-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.btn-choix-compact-title {
    font-weight: 600;
    color: #1f2937;
}

.btn-choix-compact-desc {
    font-size: 0.85rem;
    color: #6b7280;
}

.modal-header-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

/* v0.22.3 - Affichage montants partiels */
.dash-encaissement-amount .amount-principal {
    font-weight: 600;
    color: #10b981;
}
.dash-encaissement-amount .amount-detail,
.dash-encaissement-amount small {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
}

/* v0.22.5 - Badge lettrage actif (filtré) */
.badge-lettrage {
    cursor: pointer;
}
.badge-lettrage:hover {
    transform: scale(1.1);
}
.badge-lettrage-active {
    background-color: #3b82f6 !important;
    color: #fff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}


/* =============================================================================
   FORM VALIDATION ERRORS
   ============================================================================= */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.input-error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* ==========================================================================
   PAGE DÉTAIL BIEN - v0.22.18
   ========================================================================== */

/* Cards uniformes */
.detail-card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    margin-bottom:1.5rem;
    overflow:hidden;
}
.detail-card:hover{
    border-color:#e5e7eb;
}
.detail-card-header{
    padding:1rem 1.5rem;
    border-bottom:1px solid #e5e7eb;
    background:#fafafa;
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.detail-card-header h5{
    margin:0;
    font-size:1rem;
    font-weight:600;
    color:#374151;
}
.detail-card-body{
    padding:1.5rem;
}
.detail-card-body.p-0{
    padding:0;
}

/* Grille caractéristiques */
.carac-grid{
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:1rem;
}
@media(max-width:992px){.carac-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:576px){.carac-grid{grid-template-columns:repeat(2,1fr)}}

.carac-item{
    text-align:center;
    padding:1rem;
    background:#f9fafb;
    border-radius:8px;
}
.carac-item .label{
    font-size:0.7rem;
    text-transform:uppercase;
    letter-spacing:0.5px;
    color:#6b7280;
    margin-bottom:0.25rem;
}
.carac-item .value{
    font-size:1.1rem;
    font-weight:600;
    color:#111827;
}

/* Equipements */
.equip-list{
    display:flex;
    flex-wrap:wrap;
    gap:0.5rem;
    margin-top:1rem;
}
.equip-tag{
    background:#dcfce7;
    color:#166534;
    padding:0.35rem 0.75rem;
    border-radius:20px;
    font-size:0.8rem;
    font-weight:500;
}

/* Section deux colonnes */
.two-cols{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:1.5rem;
}
@media(max-width:768px){.two-cols{grid-template-columns:1fr}}

/* Locataire */
.locataire-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:1rem;
    background:#f9fafb;
    border-radius:8px;
    margin-bottom:0.5rem;
}
.locataire-row:last-child{
    margin-bottom:0;
}
.vacant-alert{
    background:#fef3c7;
    border:1px solid #f59e0b;
    border-radius:8px;
    padding:1rem;
    text-align:center;
}

/* Loyer summary */
.loyer-summary{
    background:#f0f9ff;
    border-radius:8px;
    padding:1.25rem;
}
.loyer-line{
    display:flex;
    justify-content:space-between;
    padding:0.5rem 0;
}
.loyer-line.total{
    border-top:2px solid #0ea5e9;
    margin-top:0.5rem;
    padding-top:0.75rem;
    font-weight:700;
}
.loyer-line.total .amount{
    font-size:1.25rem;
    color:#0369a1;
}

/* Finance boxes */
.finance-box{
    background:#f9fafb;
    border-radius:8px;
    padding:1.25rem;
    height:100%;
}
.finance-box h6{
    font-size:0.85rem;
    color:#6b7280;
    margin-bottom:1rem;
    font-weight:500;
}
.finance-row{
    display:flex;
    justify-content:space-between;
    padding:0.6rem 0;
    border-bottom:1px solid #e5e7eb;
}
.finance-row:last-of-type{
    border-bottom:none;
}
.finance-row .label{
    color:#6b7280;
    font-size:0.9rem;
}
.finance-row .value{
    font-weight:600;
    color:#111827;
}
.finance-total{
    background:#dbeafe;
    margin:1rem -1.25rem -1.25rem;
    padding:1rem 1.25rem;
    border-radius:0 0 8px 8px;
    display:flex;
    justify-content:space-between;
}
.finance-total .value{
    font-size:1.25rem;
    color:#1d4ed8;
    font-weight:700;
}

/* Credit progress bar */
.credit-progress{
    margin:1rem 0;
}
.credit-bar{
    height:20px;
    background:#e5e7eb;
    border-radius:10px;
    overflow:hidden;
}
.credit-bar-fill{
    height:100%;
    background:linear-gradient(90deg,#10b981,#34d399);
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:0.75rem;
    font-weight:600;
}

/* KPIs */
.kpi-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:1rem;
    margin-bottom:1.5rem;
}
@media(max-width:768px){.kpi-grid{grid-template-columns:1fr}}

.kpi-card{
    padding:1.5rem;
    border-radius:10px;
    text-align:center;
}
.kpi-card.green{background:#dcfce7}
.kpi-card.red{background:#fee2e2}
.kpi-card.blue{background:#dbeafe}
.kpi-card .amount{
    font-size:1.75rem;
    font-weight:700;
    margin-bottom:0.25rem;
}
.kpi-card.green .amount{color:#166534}
.kpi-card.red .amount{color:#dc2626}
.kpi-card.blue .amount{color:#1d4ed8}
.kpi-card .label{
    font-size:0.85rem;
    color:#6b7280;
}

/* Stats row */
.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:1rem;
}
@media(max-width:768px){.stats-grid{grid-template-columns:repeat(2,1fr)}}

.stat-card{
    background:#f9fafb;
    border-radius:8px;
    padding:1.25rem 1rem;
    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    position:relative;
    cursor:help;
}
.stat-card .title{
    font-size:0.7rem;
    text-transform:uppercase;
    letter-spacing:0.5px;
    color:#6b7280;
    margin-bottom:0.5rem;
}
.stat-card .value{
    font-size:1.5rem;
    font-weight:700;
    color:#111827;
    line-height:1.2;
}
.stat-card .value.positive{color:#059669}
.stat-card .value.negative{color:#dc2626}
.stat-card .subtitle{
    font-size:0.75rem;
    color:#9ca3af;
    margin-top:0.25rem;
}

/* Tooltip stats */
.stat-card .stat-tooltip{
    display:none;
    position:absolute;
    bottom:calc(100% + 8px);
    left:50%;
    transform:translateX(-50%);
    background:#1f2937;
    color:#fff;
    padding:0.75rem 1rem;
    border-radius:8px;
    font-size:0.8rem;
    line-height:1.4;
    white-space:pre-line;
    min-width:220px;
    text-align:left;
    z-index:100;
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
}
.stat-card .stat-tooltip::after{
    content:'';
    position:absolute;
    top:100%;
    left:50%;
    transform:translateX(-50%);
    border:6px solid transparent;
    border-top-color:#1f2937;
}
.stat-card:hover .stat-tooltip{
    display:block;
}
.stat-tooltip strong{color:#60a5fa}
.stat-tooltip .result{
    display:block;
    margin-top:0.5rem;
    padding-top:0.5rem;
    border-top:1px solid #374151;
    color:#34d399;
    font-weight:600;
}

/* Pagination amortissement */
.pagination-controls{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:1rem;
}

/* Amortissement header sticky */
.amortissement-header{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:1.25rem;
    margin-bottom:1.5rem;
    position:sticky;
    top:70px;
    z-index:100;
    box-shadow:0 2px 8px rgba(0,0,0,0.05);
}
.amortissement-stats{
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:1rem;
}
@media(max-width:992px){.amortissement-stats{grid-template-columns:repeat(3,1fr)}}
@media(max-width:576px){.amortissement-stats{grid-template-columns:repeat(2,1fr)}}

.amor-stat{
    text-align:center;
    padding:0.5rem;
}
.amor-stat.highlight{
    background:#dbeafe;
    border-radius:8px;
}
.amor-label{
    display:block;
    font-size:0.75rem;
    color:#6b7280;
    text-transform:uppercase;
    letter-spacing:0.5px;
}
.amor-value{
    font-weight:600;
    font-size:1.1rem;
    color:#111827;
}

/* Lignes tableau amortissement */
.mois-actuel{
    background:#dbeafe!important;
}
.mois-passe{
    opacity:0.6;
}
