/* loca.css - Styles modernes pour la gestion locative */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --background: #f8fafc;
    --background-light: #f1f5f9;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.05);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.15s ease-out;
    --transition-base: 0.2s ease-out;
    --transition-slow: 0.3s ease-out;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background décoratif */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/family_design.png');
    background-size: cover;
    background-position: center;
    opacity: 0.06;
    pointer-events: none;
    z-index: -1;
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

/* Header moderne */
.header-container {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px 32px;
    background: var(--card-background);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.header-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation par onglets */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--card-background);
    padding: 8px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
}

.tab-btn:hover {
    background: var(--background-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Sous-onglets */
.sub-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--background-light);
    padding: 6px;
    border-radius: var(--radius-md);
}

.sub-tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sub-tab-btn:hover {
    background: var(--card-background);
    color: var(--text-primary);
}

.sub-tab-btn.active {
    background: var(--card-background);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Contenu des onglets */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

.sub-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.sub-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 4px;
}

.section-header h2,
.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h3 {
    font-size: 1.25rem;
}

.section-header h2::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
}

/* Boutons modernes */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

/* Container de table moderne */
.table-container-modern {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.table-container-modern .table {
    background: transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-container-modern .table thead {
    background: var(--background-light);
}

.table-container-modern .table thead th {
    padding: 16px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-container-modern .table tbody tr {
    transition: all var(--transition-fast);
}

.table-container-modern .table tbody tr:hover {
    background: var(--background-light);
    transform: scale(1.01);
}

.table-container-modern .table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

/* Boutons d'actions */
.table-container-modern .button.is-small {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.table-container-modern .button.is-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.table-container-modern .button.is-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: transparent;
}

.table-container-modern .button.is-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
}

.table-container-modern .button.is-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
}

/* Barre de recherche */
.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.search-input {
    flex: 1;
    max-width: 500px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    background: var(--card-background);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Container de cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Card personne (locataire/garant) */
.person-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
}

.person-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.person-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.person-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
}

.person-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.person-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.person-details p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.person-card .btnDeleteLocataire {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.badge.locataire {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.badge.garant {
    background: #dcfce7;
    color: #059669;
}

.badge.colocataire {
    background: #fef3c7;
    color: #d97706;
}

.badge.signataire {
    background: #e0e7ff;
    color: #4f46e5;
}

/* Card foncier */
.foncier-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
}

.foncier-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.foncier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.foncier-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.foncier-header .badge {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.foncier-obs {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.foncier-card .btnDeleteFoncier {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Placeholder gestion */
.gestion-placeholder {
    text-align: center;
    padding: 80px 20px;
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.gestion-placeholder .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.gestion-placeholder h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.gestion-placeholder p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Workflow steps */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--background-light);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    transition: all var(--transition-base);
}

.workflow-step:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.workflow-step .step-number {
    font-size: 2rem;
    flex-shrink: 0;
}

.workflow-step p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.workflow-step strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Messages et états vides */
.empty-bail {
    padding: 60px 20px !important;
}

.empty-bail-text {
    display: block;
    margin-top: 16px;
    font-size: 1rem;
    color: var(--text-muted);
}

.help-text {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* Animation pour les nouvelles lignes */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-row {
    animation: fadeInRow 0.4s ease-out;
}

/* Highlight des lignes filtrées */
.table-container-modern tbody tr.filtered-out {
    display: none;
}

/* Modales */
.modal-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-card-head {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-bottom: none;
    padding: 20px 24px;
}

.modal-card-title {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-card-head .delete {
    background: rgba(255, 255, 255, 0.2);
}

.modal-card-head .delete:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal standard */
.modal-card-body {
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

/* Si certains modales doivent être plus petits */
.modal:not(.is-large) .modal-card-body {
    max-height: 70vh;
}

.modal.is-large .modal-card-body {
    max-height: 85vh;
}

.modal-card-foot {
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    justify-content: flex-end;
    gap: 12px;
}

/* Champs de formulaire */
.field .label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

.field .input,
.field .textarea,
.field .select select {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
    font-size: 0.95rem;
}

.field .input:focus,
.field .textarea:focus,
.field .select select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.field .help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .logo {
        width: 60px;
    }

    .title {
        font-size: 1.5rem;
    }

    .tabs-container {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-container-modern {
        padding: 16px;
        overflow-x: auto;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .sub-tabs-container {
        flex-direction: column;
    }
}
/* === AGENCES === */
.agence-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
}

.agence-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.agence-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.agence-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.agence-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.agence-details p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.agence-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-hover);
}

.agence-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}

/* === SECTION AGENCE DANS LE BAIL === */
.bail-agence-section {
    background: var(--background-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    border: 2px dashed var(--border-color);
}

.bail-agence-section.has-agence {
    border-style: solid;
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.bail-agence-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bail-agence-details {
    flex: 1;
}

.bail-agence-details h5 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bail-agence-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.bail-agence-meta span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === PIÈCES JUSTIFICATIVES === */
.pieces-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.piece-card {
    background: var(--card-background);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
}

.piece-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.piece-card.piece-invalide {
    opacity: 0.6;
    border-color: var(--danger-color);
}

.piece-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.piece-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.piece-info {
    flex: 1;
    min-width: 0;
}

.piece-info h6 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.piece-info .piece-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.piece-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.piece-badge-valide {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--success-color);
    color: white;
}

.piece-badge-invalide {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--danger-color);
    color: white;
}

/* === BOUTON PIÈCES SUR LA CARD LOCATAIRE === */
.btn-pieces {
    margin-top: 12px;
    width: 100%;
}

/* === UPLOAD DE FICHIERS === */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    background: var(--background-light);
    cursor: pointer;
    transition: all var(--transition-base);
}

.file-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-zone.dragging {
    border-color: var(--success-color);
    background: #dcfce7;
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.file-upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.file-upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-preview {
    margin-top: 20px;
    padding: 16px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-preview-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.file-preview-info {
    flex: 1;
}

.file-preview-name {
    font-weight: 600;
    color: var(--text-primary);
}

.file-preview-size {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === MODAL PIÈCES === */
.pieces-modal .modal-card-body {
    max-height: 70vh;
    overflow-y: auto;
}

.empty-pieces {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-pieces i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Styles pour les nouveaux champs du formulaire bail */

/* Champ régime fiscal en lecture seule */
#bail_regime_fiscal {
  background-color: #f0f9ff;
  border: 2px solid #3b82f6;
  font-weight: 500;
  color: #1e40af;
  cursor: not-allowed;
}

#bail_regime_fiscal:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Select désactivés avec style distinctif */
select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Animation lors du changement de champs conditionnels */
.field.field-animated {
  animation: fadeInField 0.3s ease-in-out;
}

@keyframes fadeInField {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style pour les labels des champs obligatoires avec nouveaux types */
.label.has-background-info-light {
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.label.has-background-info-light:hover {
  background-color: #dbeafe !important;
}

/* Indicateur de champ calculé automatiquement */
.label.has-background-success-light {
  border-radius: 4px;
  position: relative;
}

.label.has-background-success-light::before {
  content: "✓";
  position: absolute;
  left: 8px;
  color: #10b981;
  font-weight: bold;
}

/* Style pour les options de select */
.select select option[value=""] {
  color: #9ca3af;
  font-style: italic;
}

/* Indicateur visuel pour les champs requis */
.field.is-required label::after {
  content: " *";
  color: #ef4444;
  font-weight: bold;
}

/* Tooltip d'aide contextuelle */
.help-tooltip {
  display: inline-block;
  margin-left: 8px;
  color: #6b7280;
  cursor: help;
  transition: color 0.2s ease;
}

.help-tooltip:hover {
  color: #3b82f6;
}

.help-tooltip i {
  font-size: 0.9em;
}

/* Container de champ avec icône */
.field-with-icon {
  position: relative;
}

.field-with-icon .field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
}

.field-with-icon input,
.field-with-icon select {
  padding-left: 40px;
}

/* Style pour le résumé fiscal */
.fiscal-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.fiscal-summary h4 {
  margin: 0 0 12px 0;
  font-size: 1.1em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiscal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.fiscal-summary-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.fiscal-summary-label {
  font-size: 0.85em;
  opacity: 0.9;
  margin-bottom: 4px;
}

.fiscal-summary-value {
  font-weight: 600;
  font-size: 1em;
}

/* Badge pour identifier le type de régime */
.regime-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 8px;
}

.regime-badge.micro {
  background-color: #dbeafe;
  color: #1e40af;
}

.regime-badge.reel {
  background-color: #fef3c7;
  color: #92400e;
}

.regime-badge.bic {
  background-color: #dcfce7;
  color: #166534;
}

/* Animation de validation */
.field.is-valid .input,
.field.is-valid .select select {
  border-color: #10b981;
  animation: validPulse 0.5s ease;
}

@keyframes validPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

/* État d'erreur amélioré */
.field.is-danger .input,
.field.is-danger .select select {
  border-color: #ef4444;
  animation: errorShake 0.3s ease;
}

@keyframes errorShake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Message d'aide contextuel */
.field-help {
  display: block;
  margin-top: 4px;
  font-size: 0.85em;
  color: #6b7280;
  font-style: italic;
}

.field-help.is-info {
  color: #3b82f6;
}

.field-help.is-success {
  color: #10b981;
}

/* Responsive pour mobile */
@media screen and (max-width: 768px) {
  .fiscal-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .columns .column {
    padding: 0.5rem;
  }
}

/* Transition douce pour tous les champs */
.field .control .input,
.field .control .select select,
.field .control .textarea {
  transition: all 0.2s ease;
}

.field .control .input:focus,
.field .control .select select:focus,
.field .control .textarea:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Style pour les groupes de champs logiques */
.field-group {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
  margin-bottom: 16px;
}

.field-group-title {
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Loading state pour les select qui chargent des données */
.select.is-loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}
/* Zone d'information fiscale */
.fiscal-info-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fiscal-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.fiscal-info-icon {
  font-size: 1.5rem;
}

.fiscal-info-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e40af;
}

.fiscal-info-content {
  color: #1e3a8a;
  font-size: 0.9rem;
  line-height: 1.6;
}

.fiscal-info-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.fiscal-info-content li {
  margin: 6px 0;
}

.fiscal-info-content strong {
  color: #1e40af;
}

.fiscal-info-content em {
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-style: normal;
}
/* Zone d'information fiscale améliorée */
.fiscal-info-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  animation: slideDown 0.3s ease-out;
  box-shadow: var(--shadow-sm);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fiscal-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.fiscal-info-icon {
  font-size: 2rem;
  line-height: 1;
}

.fiscal-info-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e40af;
}

.fiscal-info-content {
  color: #1e3a8a;
  font-size: 0.9rem;
  line-height: 1.7;
}

.fiscal-info-content .info-description {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 16px;
  font-style: italic;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
}

.fiscal-info-content .info-section {
  margin-top: 12px;
}

.fiscal-info-content p {
  margin: 10px 0;
}

.fiscal-info-content ul {
  margin: 8px 0 12px 0;
  padding-left: 24px;
}

.fiscal-info-content li {
  margin: 6px 0;
  line-height: 1.6;
}

.fiscal-info-content strong {
  color: #1e40af;
  font-weight: 600;
}

.fiscal-info-content em {
  background: rgba(59, 130, 246, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  font-style: normal;
  font-weight: 500;
}

/* Champs calculés automatiquement - style distinctif */
#bail_usage,
#bail_duree,
#bail_reference,
#bail_regime_fiscal {
  background-color: #f0fdf4;
  border: 2px solid #10b981;
  font-weight: 500;
  color: #065f46;
  cursor: not-allowed;
}

#bail_usage:focus,
#bail_duree:focus,
#bail_reference:focus,
#bail_regime_fiscal:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Label avec indicateur "automatique" */
.label.has-background-success-light {
  background-color: #d1fae5 !important;
  border-radius: 4px;
  position: relative;
  padding-left: 32px !important;
}

.label.has-background-success-light::before {
  content: "✓";
  position: absolute;
  left: 10px;
  color: #10b981;
  font-weight: bold;
  font-size: 1.1em;
}

/* Animation pour les champs qui se remplissent automatiquement */
@keyframes fillField {
  from {
    background-color: #ffffff;
  }
  to {
    background-color: #f0fdf4;
  }
}

.field-auto-filled input {
  animation: fillField 0.4s ease-out;
}

/* === DÉPENSES === */

.depenses-filters {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.filter-dates {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-dates span {
    color: var(--text-muted);
    font-weight: 500;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* Statistiques */
.depenses-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-content h4 {
    margin: 0 0 4px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal dépense */
.modal-large .modal-card {
    width: 90%;
    max-width: 900px;
}

.form-section {
    background: var(--background-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

/* Tabs rattachement */
.tabs-rattachement {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--card-background);
    padding: 6px;
    border-radius: var(--radius-md);
}

.tab-ratt {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-ratt:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

.tab-ratt.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.ratt-content {
    display: none;
}

.ratt-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Checkbox list */
.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: var(--card-background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.checkbox-item:hover {
    background: var(--primary-light);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
}

/* Statuts */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.saisi {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.valide {
    background: #dcfce7;
    color: #166534;
}

.status-badge.declare {
    background: #dbeafe;
    color: #1e40af;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .depenses-filters {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .depenses-stats {
        grid-template-columns: 1fr;
    }
    
    .checkbox-list {
        grid-template-columns: 1fr;
    }
}

/* === CHECKBOXES RÉGIMES FISCAUX === */
.regimes-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--card-background);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

.regimes-checkbox-group .checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.regimes-checkbox-group .checkbox-item:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.regimes-checkbox-group .checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.regimes-checkbox-group .checkbox-item label {
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    user-select: none;
}

.regimes-checkbox-group .checkbox-item input[type="checkbox"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.regimes-checkbox-group .checkbox-item input[type="checkbox"]:checked {
    animation: checkBounce 0.3s ease;
}


/* ✅ À AJOUTER dans loca.css */

/* === CATÉGORISATION DÉPENSES AMÉLIORÉE === */

.help-inline {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 8px;
}

.select-large select {
    font-size: 1rem;
    padding: 12px 16px;
    min-height: 48px;
}

.select-large select option {
    padding: 10px;
}

/* Info box régimes fiscaux */
.regime-info-box {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
    animation: slideDown 0.3s ease-out;
}

.regime-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #1e40af;
    font-size: 0.95rem;
}

.regime-info-header i {
    font-size: 1.1rem;
}

.regime-info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.regime-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    background: white;
    border: 2px solid;
    transition: all var(--transition-fast);
}

.regime-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.regime-tag.revenus_fonciers {
    border-color: #3b82f6;
    color: #1e40af;
}

.regime-tag.lmnp_lmp {
    border-color: #10b981;
    color: #065f46;
}

.regime-tag.bic_lmnp_lmp {
    border-color: #f59e0b;
    color: #92400e;
}

.regime-tag.revenus_fonciers_agricoles {
    border-color: #8b5cf6;
    color: #5b21b6;
}

.regime-tag.revenus_fonciers_non_batis {
    border-color: #ef4444;
    color: #991b1b;
}

.regime-tag i {
    font-size: 0.9rem;
}

/* Animation champ type de dépense */
#field_type_depense {
    animation: fadeInField 0.3s ease-out;
}

@keyframes fadeInField {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les options avec icônes */
.select-large select option[data-icon]::before {
    content: attr(data-icon);
    margin-right: 8px;
}

/* Indication visuelle du champ actif */
.select-large select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: scale(1.01);
}

/* Badge de compteur */
#count_types {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .regime-info-tags {
        flex-direction: column;
    }
    
    .regime-tag {
        width: 100%;
        justify-content: center;
    }
}
/* === AUTOCOMPLÉTION === */
.has-autocomplete {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
}

.autocomplete-dropdown.is-active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.autocomplete-item.is-active {
    background: var(--primary-color);
    color: white;
}

.autocomplete-item-count {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.autocomplete-new {
    background: var(--success-color);
    color: white;
    font-weight: 600;
}

.autocomplete-new:hover {
    background: #059669;
}

/* Liste des types existants */
.existing-types-list {
    max-height: 400px;
    overflow-y: auto;
    background: var(--background-light);
    border-radius: var(--radius-md);
    padding: 12px;
}

.existing-type-card {
    background: var(--card-background);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.existing-type-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.existing-type-info {
    flex: 1;
}

.existing-type-info h5 {
    margin: 0 0 4px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.existing-type-info .type-category {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.existing-type-regimes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.existing-type-regimes .regime-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.existing-type-actions {
    display: flex;
    gap: 8px;
}

.existing-type-card.deleting {
    opacity: 0.5;
    pointer-events: none;
}
/* === AUTOCOMPLÉTION AMÉLIORÉE === */
.input-step {
    transition: all 0.3s ease;
}

.input-step:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: scale(1.01);
}

/* Info box auto-remplissage */
.auto-fill-info-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid #10b981;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.auto-fill-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #065f46;
    font-weight: 600;
    margin-bottom: 8px;
}

.auto-fill-header i {
    font-size: 1.2rem;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.auto-fill-message {
    margin: 0;
    color: #047857;
    font-size: 0.9rem;
}

/* Header liste types existants */
.existing-types-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Champs additionnels qui apparaissent progressivement */
#field_type_libelle,
#field_regimes,
#field_compte {
    animation: fadeInField 0.4s ease-out;
}

/* Tags auto */
.tag.is-success.is-light {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

/* Bouton ajout compte */
#btnAddCompte {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

#btnAddCompte:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Modal compte */
#compteModal .notification {
    margin-top: 16px;
}

/* Bouton save désactivé */
#saveTypeDepense:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#saveTypeDepense:not(:disabled) {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Amélioration checkbox avec animation */
.regimes-checkbox-group .checkbox-item input[type="checkbox"]:checked {
    animation: checkBounce 0.3s ease;
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* État pré-rempli */
.checkbox-item.auto-filled {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

.select.auto-filled select {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

/* Surlignage dans l'autocomplétion */
.autocomplete-item strong {
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* Item d'aide */
.autocomplete-item.help {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
    pointer-events: none;
}

.autocomplete-item.help:hover {
    background: transparent;
}

/* Scroll smooth dans dropdown */
.autocomplete-dropdown {
    scroll-behavior: smooth;
}
/* ========================================
   🎨 AJOUTS dans loca.css
   ======================================== */

/* === BADGES DE DÉDUCTIBILITÉ === */
.deductible-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.deductible-badge i {
    font-size: 1rem;
}

.deductible-badge.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 2px solid #059669;
}

.deductible-badge.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.deductible-badge.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 2px solid #dc2626;
}

.deductible-badge.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.deductible-badge.neutral {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: 2px solid #4b5563;
}

.deductible-badge.neutral:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

/* Animation pulse pour attirer l'attention */
@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

.deductible-badge.success {
    animation: badge-pulse 2s ease-in-out infinite;
}

/* === BOUTON TÉLÉCHARGER FACTURE === */
.btnDownloadFacture {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: white;
    transition: all var(--transition-base);
}

.btnDownloadFacture:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* === ZONE D'UPLOAD FACTURE === */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    background: var(--background-light);
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.file-upload-zone.dragging {
    border-color: var(--success-color);
    background: #dcfce7;
    transform: scale(1.02);
}

.file-upload-zone.is-hidden {
    display: none;
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    transition: all var(--transition-base);
}

.file-upload-zone:hover .file-upload-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

.file-upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.file-upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === APERÇU FICHIER FACTURE === */
.file-preview {
    margin-top: 0;
    padding: 16px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--primary-color);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.file-preview.is-hidden {
    display: none;
}

.file-preview-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.file-preview .button {
    flex-shrink: 0;
}

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === AMÉLIORATION DU TABLEAU DÉPENSES === */
#depensesTable thead th:nth-child(5),
#depensesTable thead th:nth-child(6) {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    font-weight: 700;
    color: var(--primary-color);
}

#depensesTable tbody td:nth-child(5),
#depensesTable tbody td:nth-child(6) {
    vertical-align: middle;
}

/* Highlight des lignes avec dépenses déductibles */
#depensesTable tbody tr:has(.deductible-badge.success) {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.05), transparent);
}

#depensesTable tbody tr:has(.deductible-badge.success):hover {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
}

/* Highlight des lignes avec dépenses non déductibles */
#depensesTable tbody tr:has(.deductible-badge.danger) {
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.05), transparent);
}

#depensesTable tbody tr:has(.deductible-badge.danger):hover {
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
}

/* === RESPONSIVE === */
@media screen and (max-width: 768px) {
    .deductible-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .deductible-badge i {
        font-size: 0.9rem;
    }
    
    .file-upload-zone {
        padding: 20px 15px;
        min-height: 120px;
    }
    
    .file-upload-icon {
        font-size: 2rem;
    }
    
    .file-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .file-preview-name {
        white-space: normal;
    }
}

/* === INDICATEURS DE STATUT AMÉLIORÉS === */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.status-badge.saisi {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 2px solid #f59e0b;
}

.status-badge.valide {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 2px solid #10b981;
}

.status-badge.declare {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 2px solid #3b82f6;
}

/* === INFO TOOLTIP RÉGIME FISCAL === */
.regime-info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 4px;
}

.regime-info-tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    text-align: left;
    border-radius: var(--radius-md);
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: var(--shadow-xl);
    font-size: 0.85rem;
    line-height: 1.4;
}

.regime-info-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.regime-info-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* === AMÉLIORATION DES FILTRES === */
.filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label i {
    color: var(--primary-color);
}

/* Indication visuelle pour les filtres actifs */
.filter-group select:not([value=""]),
.filter-group input:not([value=""]) {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* === ANIMATION DE CHARGEMENT === */
.table-loading {
    position: relative;
}

.table-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* === STATS CARDS AMÉLIORÉES === */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}


/* === DÉPENSES - FILTRES OPTIMISÉS === */

.depenses-filters {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Période : 2 colonnes rapprochées */
.filter-group:nth-child(1) {
    grid-column: 1;
}

.filter-dates {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-dates input {
    flex: 1;
    min-width: 0;
}

.filter-dates span {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Type de dépense : colonne 2 */
.filter-group:nth-child(2) {
    grid-column: 2;
}

/* Bien concerné : colonne 3, avec hauteur limitée */
.filter-group:nth-child(3) {
    grid-column: 3;
}

#filter_foncier {
    max-height: 44px;
    overflow: hidden;
}

/* Réduire la taille du select de foncier */
.filter-group:nth-child(3) .select select {
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Régime fiscal : colonne 4 */
.filter-group:nth-child(4) {
    grid-column: 4;
}

/* Boutons : nouvelle ligne */
.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

/* Responsive : tablette */
@media screen and (max-width: 1200px) {
    .depenses-filters {
        grid-template-columns: 1fr 1fr;
    }

    .filter-group:nth-child(1) {
        grid-column: 1;
    }

    .filter-group:nth-child(2) {
        grid-column: 2;
    }

    .filter-group:nth-child(3) {
        grid-column: 1;
    }

    .filter-group:nth-child(4) {
        grid-column: 2;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }
}

/* Responsive : mobile */
@media screen and (max-width: 768px) {
    .depenses-filters {
        grid-template-columns: 1fr;
    }

    .filter-group {
        grid-column: 1 !important;
    }

    .filter-dates {
        gap: 4px;
    }

    .filter-dates span {
        font-size: 0.85rem;
    }

    .filter-actions {
        grid-column: 1;
        flex-direction: column;
    }

    .filter-actions .button {
        width: 100%;
    }
}
/* Badge formulaire fiscal */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.badge-formulaire {
    background: #dbeafe;
    color: #1e40af;
}

/* Classe utilitaire pour masquer les éléments */
.is-hidden-initial {
    display: none !important;
}
.button-group {
    display: flex;
    gap: 8px;
}
/* === AMORTISSEMENTS === */

/* Sélecteur de bien */
.bien-selector-container {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.bien-selector-container .filter-group {
    margin-bottom: 0;
}

.bien-selector-container .filter-group label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Cartes composants */
.composant-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.composant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.composant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.composant-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.composant-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.composant-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.composant-badge.lineaire {
    background: #dbeafe;
    color: #1e40af;
}

.composant-badge.degressif {
    background: #fef3c7;
    color: #92400e;
}

.composant-details {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.detail-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value.highlight {
    color: var(--success-color);
    font-size: 1.1rem;
}

/* Progress bar amortissement */
.progress-container {
    margin-top: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-amort {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-amort {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Actions composant */
.composant-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.btn-composant-action {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
}

.btn-composant-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-composant-edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn-composant-history {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.btn-composant-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Tableau historique amortissements */
.amort-table-container {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

.amort-table-container .table thead th {
    background: var(--background-light);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
}

.amort-table-container .table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.amort-table-container .table tbody tr:hover {
    background: var(--background-light);
}

/* Badge exercice */
.exercice-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Info box amortissement */
.amort-info-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.amort-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e40af;
    font-weight: 600;
    margin-bottom: 8px;
}

.amort-info-content {
    color: #1e3a8a;
    font-size: 0.9rem;
    line-height: 1.6;
}

.amort-info-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.amort-info-content li {
    margin: 6px 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .composant-card {
        margin-bottom: 16px;
    }
    
    .composant-actions {
        flex-direction: column;
    }
    
    .btn-composant-action {
        width: 100%;
    }
}

/* === RÉCAPITULATIF EXERCICE === */

.exercice-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Tableau exercice */
.amort-table-container table tfoot tr {
    font-weight: 700;
    font-size: 1.05rem;
}

.amort-table-container table tfoot th {
    border-top: 3px solid var(--primary-color);
    padding: 16px;
}

/* Alertes */
.alert-card {
    background: var(--card-background);
    border-left: 4px solid;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.alert-card.warning {
    border-color: var(--warning-color);
    background: linear-gradient(90deg, #fffbeb, var(--card-background));
}

.alert-card.info {
    border-color: var(--info-color);
    background: linear-gradient(90deg, #eff6ff, var(--card-background));
}

.alert-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.alert-icon.warning {
    color: var(--warning-color);
}

.alert-icon.info {
    color: var(--info-color);
}

.alert-content h4 {
    margin: 0 0 4px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.alert-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Badge compte */
.compte-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--background-light);
    color: var(--text-secondary);
}

/* Export buttons group */
.section-header .btn-primary + .btn-primary {
    margin-left: 0;
}
/* === GRAPHIQUES === */

.charts-container {
    margin-top: 24px;
}

.chart-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.chart-content.active {
    display: block;
}

.chart-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: 16px;
}

.chart-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-header .help {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.chart-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.chart-controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Légende détaillée */
.legend-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.legend-item {
    background: var(--card-background);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-base);
}

.legend-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.legend-color {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.legend-info {
    flex: 1;
}

.legend-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.legend-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Responsive charts */
@media screen and (max-width: 768px) {
    .chart-wrapper {
        height: 300px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animation des graphiques */
@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chart-card canvas {
    animation: chartFadeIn 0.5s ease-out;
}
.exercice-header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== MODAL STYLES ===== */
.modal-card-large {
    max-width: 900px;
}

.modal-card-head-with-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-card-subtitle {
    margin-left: auto;
    margin-bottom: 0;
}

.modal-card-foot-right {
    justify-content: flex-end;
}

/* ===== TABLE STYLES ===== */
.table-header-row {
    background-color: #f5f5f5;
}

.table-header-cell {
    min-width: 80px;
}

.table-header-cell-wide {
    min-width: 150px;
}

.table-footer-row {
    font-weight: bold;
    background-color: #f9f9f9;
}

.table-footer-total {
    font-weight: bold;
}

.table-footer-total-primary {
    font-weight: bold;
    color: #3273dc;
}

.table-footer-total-success {
    font-weight: bold;
    color: #48c774;
}

.table-row-cell-primary {
    color: #3273dc;
    font-weight: 600;
}

.table-row-cell-success {
    color: #48c774;
    font-weight: 600;
}

.table-overflow {
    overflow-x: auto;
}

/* ===== SUMMARY SECTION ===== */
.modal-summary-section {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.modal-summary-title {
    margin-bottom: 10px;
    font-weight: 600;
}

.modal-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.modal-summary-item {
    display: flex;
    flex-direction: column;
}

.modal-summary-item-label {
    font-size: 12px;
    margin-bottom: 5px;
}

.modal-summary-item-value {
    font-size: 18px;
    font-weight: bold;
    color: #363636;
}

/* ===== LEGEND STYLES ===== */
.legend-item {
    border-left: 4px solid;
    padding-left: 12px;
    margin-bottom: 10px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 8px;
}

.legend-info {
    display: inline-block;
    vertical-align: middle;
}

.legend-info h4 {
    margin: 0 0 4px 0;
    font-weight: 600;
}

.legend-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.legend-value {
    float: right;
    font-weight: bold;
    color: #363636;
}

/* ===== EXERCICE HEADER ===== */
.exercice-header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== PROGRESS BAR ===== */
.progress-fill-amort {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}



#bailModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#depenseModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#composantModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#typeDepenseModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#compteModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#agenceModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#locataireModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#foncierModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#loyerModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#piecesModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}


#recetteModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#typeRecetteModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#generateMasseModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* Conteneur boutons recettes */
.recettes-btn-group {
  display: flex;
  gap: 12px;
}

/* Liste avec indentation */
.recap-list {
  margin-left: 1.5em;
}

.filter-controls {
    margin-bottom: 1rem;
}

.filter-controls .checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* Configuration defaults recettes */
.defaults-config-container {
    max-height: 60vh;
    overflow-y: auto;
}

.default-config-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.default-config-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.default-config-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.default-config-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #363636;
}

.default-config-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.default-select-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.default-select-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a4a4a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.default-select-group .select {
    width: 100%;
}

.default-status {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
}

.default-status.configured {
    background: #d4edda;
    color: #155724;
}

.default-status.not-configured {
    background: #fff3cd;
    color: #856404;
}

@media (max-width: 768px) {
    .default-config-body {
        grid-template-columns: 1fr;
    }
}


#recetteDefaultsModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}


/* Sélecteur de mois pour génération en masse */
.months-selector {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.month-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.month-checkbox-item:hover {
    border-color: #3273dc;
    background: #f0f7ff;
}

.month-checkbox-item.checked {
    border-color: #48c774;
    background: #e8f5e9;
}

.month-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.month-checkbox-item label {
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-checkbox-item .month-icon {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .months-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.read-only-montant {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.default-config-emoji {
    font-size: 1.5rem;
}

select option.bail-termine {
    color: #999;
    font-style: italic;
}

/* Séparateur dans les select */
select option:disabled {
    color: #ccc;
    font-size: 0.85rem;
}

/* === UNIFORMISATION DES FILTRES DÉPENSES === */

/* Appliquer la même taille à tous les selects de filtres */
.depenses-filters .filter-group .select select {
    font-size: 0.9rem;
    padding: 8px 12px;
    max-height: 44px;
}

/* Container select avec hauteur limitée */
.depenses-filters .filter-group .select {
    max-height: 44px;
}

/* Pour les selects spécifiques */
#filter_type_depense,
#filter_foncier,
#filter_regime_fiscal {
    max-height: 44px;
    overflow: hidden;
}

/* === UNIFORMISATION DES FILTRES RECETTES === */

/* Appliquer la même taille à tous les selects de filtres recettes */
.depenses-filters .filter-group .select select {
    font-size: 0.9rem;
    padding: 8px 12px;
    max-height: 44px;
}

/* Container select avec hauteur limitée pour recettes */
.depenses-filters .filter-group .select {
    max-height: 44px;
}

/* Pour les selects spécifiques des recettes */
#filter_recette_annee,
#filter_recette_type,
#filter_recette_bail,
#filter_recette_foncier,
#filter_recette_regime_fiscal {
    max-height: 44px;
    overflow: hidden;
}

/* Aussi pour les inputs date des recettes */
#filter_recette_date_debut,
#filter_recette_date_fin {
    font-size: 0.9rem;
    padding: 8px 12px;
    max-height: 44px;
}

recap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.recap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #3273dc;
}

.recap-label {
    font-weight: 600;
    color: #666;
}

.recap-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* CORRECTION MODAL COUPE EN DEUX (coupé en 2) */
#confirmGenerateMasseModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}


/* Largeur fixe pour colonne checkbox */
.checkbox-column {
    width: 40px;
}

/* Ligne de pied de tableau */
.table-footer-row {
    background-color: #f5f5f5;
}

/* Alternative si vous utilisez Bulma */
.table-footer-row {
    background-color: hsl(0, 0%, 96%); /* équivalent Bulma is-light */
}


/* Style pour le champ compte amortissement */
#composant_compte_amort {
    background-color: #fffbea; /* Légèrement jaune pour différencier */
}

#composant_compte_amort:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Style pour l'info box */
#infoCompte28Box .table {
    font-size: 0.875rem;
    background-color: white;
}

#infoCompte28Box .table th {
    background-color: #3e8ed0;
    color: white;
    font-weight: 600;
}

#infoCompte28Box .table td {
    vertical-align: middle;
}

/* Cache l'élément par défaut, comme dans votre CSS initial (si ce n'est pas déjà fait) */
#infoCompte28Box {
    margin-top: 1rem; /* Conserve la mise en page CSS */
}

/* Classe utilisée par JavaScript pour afficher/masquer */
.is-hidden {
    display: none !important; /* Force le masquage si nécessaire */
}

/* Style pour le compte d'immobilisation (couleur bleu marine) */
.compte-immo-style {
    color: #00008b; /* Navy Blue */
}

/* Style pour le compte d'amortissement (couleur magenta foncé et petite taille) */
.compte-amort-style {
    color: #8b008b; /* Dark Magenta */
    font-size: 0.9em;
}
/* Styles pour le modal des soldes */
#soldesModal .modal-card {
    width: 90vw;
    max-width: 800px;
}

/* Large écran */
@media (min-width: 1024px) {
    #soldesModal .modal-card {
        max-width: 900px;
    }
}

/* Très grand écran */
@media (min-width: 1440px) {
    #soldesModal .modal-card {
        max-width: 1100px;
    }
}

#soldesModal .notification ul {
    list-style: disc;
}

#soldesModal .field {
    margin-bottom: 1.5rem;
}

#soldesModal .help {
    margin-top: 0.5rem;
}

#soldesModal .modal-card-body {
    max-height: 70vh;
    overflow-y: auto;
}

#soldesModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}
#pdfPreviewModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}


