:root {
    --couleur-principale: #1b8a6b;
    --couleur-principale-hover: #157a5e;
    --couleur-principale-claire: #d4f0e8;
    --couleur-accent: #fbd022;
    --couleur-accent-hover: #e6bb12;
    --couleur-accent-claire: #fff8d6;
    --couleur-danger: #c0392b;
    --couleur-fond: #f4f6f8;
    --couleur-texte: #444444;
    --couleur-muted: #7f8c8d;
    --couleur-bordure: #dce1e6;
    --rayon: 8px;
    --ombre: 0 4px 16px rgba(251, 208, 34, .28);
    --ombre-forte: 0 10px 28px rgba(251, 208, 34, .32);
    --bs-primary: #1b8a6b;
    --bs-primary-rgb: 27, 138, 107;
    --bs-link-color: #1b8a6b;
    --bs-link-hover-color: #157a5e;
    --sidebar-largeur: 260px;
    --police-titre: "Segoe UI", SegoeUI, Tahoma, Geneva, Verdana, sans-serif;
    --police-texte: "Segoe UI", SegoeUI, Tahoma, Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 14.5px;
}

body {
    font-family: var(--police-texte);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    background: var(--couleur-fond);
    color: var(--couleur-texte);
    line-height: 1.5;
    min-height: 100vh;
}
body.app-layout {
    min-height: 0;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6,
.titre-page,
.sidebar-titre,
.navbar-brand,
.carte-section h2,
.carte-section h3,
.section h2 {
    font-family: var(--police-titre);
    font-weight: 600;
    letter-spacing: 0.005em;
}

/* Layout application — bandeau pleine largeur au-dessus du menu */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.app-shell {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Menu latéral */
.sidebar {
    width: var(--sidebar-largeur);
    flex-shrink: 0;
    background: #e6f3ee;
    border-right: 1px solid #c5ddd4;
    display: flex;
    flex-direction: column;
    transition: width .25s ease, opacity .25s ease, transform .25s ease;
    overflow: hidden;
    z-index: 105;
    height: 100%;
    align-self: stretch;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 100;
    border: none;
    padding: 0;
    cursor: pointer;
}
.sidebar-overlay:not([hidden]) {
    display: block;
}
.sidebar-entete {
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--couleur-bordure);
    background: var(--couleur-principale-claire);
}
.sidebar-titre {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--couleur-principale);
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: .85rem .75rem;
    flex: 1;
    overflow-y: auto;
    font-size: 0.85rem;
}
.sidebar-section {
    padding: .65rem .35rem .15rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--couleur-muted);
    text-align: left;
}
.sidebar-lien {
    display: block;
    padding: .7rem .85rem;
    color: #0f5c47;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    background: #fff;
    border: 1px solid #c5ddd4;
    border-radius: 4px;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.sidebar-lien:hover {
    background: #fff;
    color: #0a4636;
    border-color: #9fc9b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}
.sidebar-lien-actif {
    background: #fff;
    color: #0a4636;
    font-weight: 700;
    border-left-color: var(--couleur-principale);
    border-color: #9fc9b8;
    box-shadow: 0 2px 6px rgba(27, 138, 107, .14);
}
.sidebar-lien-secondaire {
    font-size: 0.85rem;
    color: #0f5c47;
}
.sidebar-lien-secondaire.sidebar-lien-actif {
    color: #0a4636;
}

.app-layout.sidebar-replie .sidebar {
    width: 0;
    border-right: none;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
}

.btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--couleur-accent);
    border-radius: var(--rayon);
    background: rgba(251, 208, 34, .2);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-sidebar-toggle:hover {
    background: rgba(251, 208, 34, .35);
    border-color: var(--couleur-accent-hover);
    color: #fff;
}
.btn-sidebar-toggle-icone {
    display: block;
    transition: transform .2s ease;
}
.app-layout.sidebar-replie .btn-sidebar-toggle-icone {
    transform: rotate(180deg);
}

.conteneur { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }
.principal { padding: 2rem 1.25rem; flex: 1; }

/* En-tête */
.entete {
    background: var(--couleur-principale);
    color: #fff;
    padding: .75rem 0;
    box-shadow: var(--ombre);
    position: relative;
    flex-shrink: 0;
    z-index: 110;
}
.entete-contenu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    max-width: none;
    padding: 0 1.25rem;
}
.entete-gauche {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    flex: 1;
}
.logo {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 0 1 auto;
    min-width: 0;
}
.logo img {
    height: 48px;
    width: 48px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    box-sizing: border-box;
}
.logo-texte { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-texte small {
    margin-top: .3rem;
    font-size: .72rem;
    font-weight: 400;
    opacity: .9;
    white-space: normal;
    line-height: 1.25;
    max-width: 18rem;
}
.logo-texte span {
    white-space: nowrap;
    font-family: var(--police-titre);
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid var(--couleur-accent);
    padding-bottom: .1rem;
    display: inline-block;
}
.utilisateur-menu { margin-left: auto; flex-shrink: 0; }
.entete .utilisateur-toggle {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--couleur-principale-hover);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0f4f3f;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0f4f3f;
    --bs-btn-border-color: rgba(255, 255, 255, .55);
    --bs-btn-hover-border-color: rgba(255, 255, 255, .8);
    --bs-btn-active-border-color: rgba(255, 255, 255, .8);
    background-color: var(--couleur-principale-hover);
    background-image: none;
    border-color: rgba(255, 255, 255, .55);
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 220px;
}
.entete .utilisateur-toggle:hover,
.entete .utilisateur-toggle:focus,
.entete .utilisateur-toggle.show,
.entete .utilisateur-toggle:active {
    background-color: #0f4f3f;
    background-image: none;
    border-color: rgba(255, 255, 255, .8);
    color: #fff !important;
}
.utilisateur-toggle::after {
    margin-left: .15rem;
    border-top-color: #fff;
}
.utilisateur-nom-complet {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}
.utilisateur-initiales {
    display: none;
    font-weight: 700;
    letter-spacing: .03em;
    color: #fff;
}
.utilisateur-dropdown { min-width: 240px; }
.utilisateur-dropdown .dropdown-header {
    color: var(--couleur-texte);
    font-weight: 600;
}

/* Pied */
.pied {
    background: #fff;
    border-top: 3px solid var(--couleur-accent);
    padding: 1rem 0;
    text-align: center;
    color: var(--couleur-muted);
    font-size: .85rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        transform: translateX(0);
    }
    .app-layout.sidebar-replie .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-largeur);
        opacity: 1;
    }
    .app-layout:not(.sidebar-replie) .sidebar {
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    .utilisateur-nom-complet { display: none; }
    .utilisateur-initiales { display: inline; }
}

/* Boutons */
.btn {
    display: inline-block; padding: .5rem 1rem; border-radius: var(--rayon);
    font-size: .9rem; text-decoration: none; border: none; cursor: pointer;
    transition: background .15s;
}
.btn-principal { background: var(--couleur-principale); color: #fff; }
.btn-principal:hover { background: var(--couleur-principale-hover); }
.btn-outline {
    background: #e8edf1;
    border: 1px solid #c5ced6;
    color: #3d4a57;
}
.btn-outline:hover,
.btn-outline:focus {
    background: #dce3e9;
    border-color: #b0bac4;
    color: #2c3e50;
}
.btn-danger { background: var(--couleur-danger); color: #fff; }
.btn-large { padding: .75rem 1.5rem; width: 100%; }

/* Boutons d'abandon / secondaire (Annuler, Réinitialiser, Retour…) */
.btn-outline-secondary {
    --bs-btn-color: #3d4a57;
    --bs-btn-bg: #e8edf1;
    --bs-btn-border-color: #c5ced6;
    --bs-btn-hover-color: #2c3e50;
    --bs-btn-hover-bg: #dce3e9;
    --bs-btn-hover-border-color: #b0bac4;
    --bs-btn-active-color: #2c3e50;
    --bs-btn-active-bg: #d0d8e0;
    --bs-btn-active-border-color: #a8b3be;
    --bs-btn-disabled-color: #6c757d;
    --bs-btn-disabled-bg: #f0f2f4;
    --bs-btn-disabled-border-color: #dce1e6;
}
.btn-outline-danger {
    --bs-btn-color: #922b21;
    --bs-btn-bg: #fdecea;
    --bs-btn-border-color: #f5c6c0;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--couleur-danger);
    --bs-btn-hover-border-color: var(--couleur-danger);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #a93226;
    --bs-btn-active-border-color: #a93226;
}

/* Alertes */
.alerte {
    padding: .75rem 1rem;
    border-radius: var(--rayon);
    margin-bottom: 1.25rem;
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
    overflow: hidden;
    transition: opacity .4s ease, transform .4s ease, max-height .4s ease, margin .4s ease, padding .4s ease, border-width .4s ease;
}
.alerte.alerte-masquee {
    opacity: 0 !important;
    transform: translateY(-8px);
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    pointer-events: none;
}
.alerte-succes { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.alerte-erreur { background: #fadbd8; color: #922b21; border: 1px solid #f1948a; }

/* Toasts toujours visibles dans le viewport (indépendants du scroll) */
.notifications-flottantes {
    position: fixed;
    top: calc(var(--entete-hauteur, 4.25rem) + .75rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    width: min(40rem, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.notifications-flottantes .alerte,
.notifications-flottantes .alert {
    margin: 0;
    max-height: none;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.notifications-flottantes .alerte.alerte-masquee {
    transform: translateY(-8px);
}

/* Formulaires */
.formulaire { max-width: 480px; }
.formulaire-large { max-width: 800px; }
.champ { margin-bottom: 1rem; }
.champ label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .9rem; }
.champ input:not(.form-control):not(.form-check-input),
.champ select:not(.form-select),
.champ textarea:not(.form-control) {
    width: 100%; padding: .55rem .75rem; border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon); font-size: .95rem;
}
.champ .form-control,
.champ .form-select,
.mb-3 .form-control,
.mb-3 .form-select {
    width: 100%;
}
.btn-primary {
    --bs-btn-bg: var(--couleur-principale);
    --bs-btn-border-color: var(--couleur-principale);
    --bs-btn-hover-bg: var(--couleur-principale-hover);
    --bs-btn-hover-border-color: var(--couleur-principale-hover);
    --bs-btn-active-bg: var(--couleur-principale-hover);
    --bs-btn-active-border-color: var(--couleur-principale-hover);
}
.btn-rechercher-ifu {
    --bs-btn-bg: var(--couleur-accent);
    --bs-btn-border-color: var(--couleur-accent);
    --bs-btn-color: #2c2c2c;
    --bs-btn-hover-bg: var(--couleur-accent-hover);
    --bs-btn-hover-border-color: var(--couleur-accent-hover);
    --bs-btn-hover-color: #1a1a1a;
    --bs-btn-active-bg: var(--couleur-accent-hover);
    --bs-btn-active-border-color: var(--couleur-accent-hover);
    --bs-btn-active-color: #1a1a1a;
    font-weight: 700;
    min-width: 7.5rem;
    box-shadow: 0 2px 8px rgba(251, 208, 34, .45);
}
.demande-consignes {
    margin: 0 0 1.25rem;
    padding-left: 1.35rem;
    line-height: 1.55;
    font-size: 1.15rem;
    color: #3a4542;
}
.page-auth .demande-consignes {
    font-size: 13px;
    color: #2f3a37;
}
.demande-consignes li {
    margin-bottom: .4rem;
}
.demande-consignes li:last-child {
    margin-bottom: 0;
}
.form-check-input:checked {
    background-color: var(--couleur-principale);
    border-color: var(--couleur-principale);
}

.ifu-recherche-bloc .ifu-recherche-btn {
    min-width: 7.5rem;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .ifu-recherche-bloc .ifu-recherche-btn {
        width: 100%;
    }
}
.form-check-input:focus {
    border-color: var(--couleur-principale);
    box-shadow: 0 0 0 .25rem rgba(27, 138, 107, .25);
}
.datatable + .dataTables_wrapper,
div.dt-container table.datatable,
table.datatable {
    background: #fff;
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    font-size: 0.85rem;
}
table.datatable thead th,
table.datatable tbody td,
div.dt-container table.datatable thead th,
div.dt-container table.datatable tbody td {
    font-size: 0.85rem;
}
table.datatable thead th,
div.dt-container table.datatable thead th,
table.datatable > thead > tr > th,
.table.datatable thead th {
    background: var(--couleur-principale) !important;
    color: #fff !important;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    text-transform: lowercase;
    border-bottom-color: var(--couleur-principale) !important;
    border-color: var(--couleur-principale) !important;
    vertical-align: middle;
    padding: .55rem .65rem;
}
table.datatable thead th::first-letter,
div.dt-container table.datatable thead th::first-letter,
.table.datatable thead th::first-letter {
    text-transform: uppercase;
}
table.datatable thead th .dt-column-title,
div.dt-container table.datatable thead th .dt-column-title {
    color: #fff;
    text-transform: lowercase;
    display: inline-block;
    white-space: nowrap;
}
table.datatable thead th .dt-column-title::first-letter,
div.dt-container table.datatable thead th .dt-column-title::first-letter {
    text-transform: uppercase;
}
table.datatable thead th .dt-column-order,
table.datatable thead .dt-orderable-asc .dt-column-order:before,
table.datatable thead .dt-orderable-desc .dt-column-order:after,
table.datatable thead .dt-ordering-asc .dt-column-order:before,
table.datatable thead .dt-ordering-desc .dt-column-order:after {
    color: #fff !important;
    opacity: .9;
}
/* Conserve la casse des sigles (ex. NIM SECeF) */
table.datatable thead th.th-sigle,
div.dt-container table.datatable thead th.th-sigle,
.table.datatable thead th.th-sigle,
table.datatable thead th.th-sigle .dt-column-title,
div.dt-container table.datatable thead th.th-sigle .dt-column-title {
    text-transform: none !important;
}
table.datatable thead th.th-sigle::first-letter,
div.dt-container table.datatable thead th.th-sigle::first-letter,
.table.datatable thead th.th-sigle::first-letter,
table.datatable thead th.th-sigle .dt-column-title::first-letter,
div.dt-container table.datatable thead th.th-sigle .dt-column-title::first-letter {
    text-transform: none !important;
}
div.dt-container,
div.dt-container .dt-search,
div.dt-container .dt-length,
div.dt-container .dt-info,
div.dt-container .dt-paging,
div.dt-container label,
div.dt-container select,
div.dt-container input,
.dataTables_wrapper,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.85rem;
}
div.dt-container .pagination,
div.dt-container .pagination .page-link,
div.dt-container .dt-paging .page-link,
div.dt-container .dt-paging button,
.dataTables_wrapper .pagination .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 0.85rem !important;
    padding: .25rem .5rem;
    line-height: 1.35;
}

/* Page création de groupe */
.formulaire-large,
.formulaire-large .form-label,
.formulaire-large .form-control,
.formulaire-large .form-select,
.formulaire-large .form-text,
.formulaire-large .form-check-label,
.formulaire-large legend,
.formulaire-large .btn {
    font-size: 0.85rem;
}

/* Pagination DataTables — page active verte */
div.dt-container {
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--couleur-principale);
    --bs-pagination-active-border-color: var(--couleur-principale);
    --bs-pagination-focus-color: var(--couleur-principale-hover);
    --bs-pagination-focus-bg: var(--couleur-principale-claire);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(27, 138, 107, 0.25);
}
div.dt-container .pagination .page-item.active .page-link,
div.dt-container .pagination .active > .page-link,
.dataTables_wrapper .pagination .page-item.active .page-link,
.dataTables_wrapper .pagination .active > .page-link {
    background-color: var(--couleur-principale);
    border-color: var(--couleur-principale);
    color: #fff;
}
div.dt-container .pagination .page-item.active .page-link:hover,
div.dt-container .pagination .active > .page-link:hover,
.dataTables_wrapper .pagination .page-item.active .page-link:hover,
.dataTables_wrapper .pagination .active > .page-link:hover {
    background-color: var(--couleur-principale-hover);
    border-color: var(--couleur-principale-hover);
    color: #fff;
}
div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover,
.dataTables_wrapper .dt-paging .dt-paging-button.current,
.dataTables_wrapper .dt-paging .dt-paging-button.current:hover {
    background: var(--couleur-principale) !important;
    border-color: var(--couleur-principale) !important;
    color: #fff !important;
}
.grille-formulaire { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.champ-large { grid-column: 1 / -1; }
.actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
fieldset { border: 1px solid var(--couleur-bordure); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1.25rem; }
.formulaire fieldset {
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon);
    padding: .85rem 1rem 1rem;
    margin-bottom: 1.25rem;
    background: #fff;
    min-inline-size: 0;
}
.formulaire fieldset legend {
    float: none;
    width: auto;
    max-width: 100%;
    padding: 0 .45rem;
    margin-bottom: .65rem;
    font-family: var(--police-titre);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--couleur-principale);
}
.page-auth .formulaire fieldset legend {
    font-size: 13px;
}
.radio-inline { margin-right: 1.5rem; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
.tableau th, .tableau td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--couleur-bordure); }
.tableau th { background: #eef2f5; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.tableau tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-large { font-size: .9rem; padding: .35rem .85rem; }
.badge-brouillon { background: #eee; color: #555; }
.badge-en_cours { background: var(--couleur-principale-claire); color: var(--couleur-principale); }
.badge-termine { background: #d5f5e3; color: #1e8449; }
.badge-refuse { background: #fadbd8; color: #922b21; }
.badge-annule { background: #f5f5f5; color: #999; }
.badge-piece {
    display: inline-block;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.2;
    padding: .35rem .7rem;
    border-radius: .35rem;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-piece-manquante {
    background: #e9ecef !important;
    color: #343a40 !important;
    border-color: #ced4da;
}
.badge-piece-fournie {
    background: #cfe2ff !important;
    color: #084298 !important;
    border-color: #9ec5fe;
}
.badge-piece-validee {
    background: #198754 !important;
    color: #ffffff !important;
    border-color: #146c43;
}
.badge-piece-rejetee {
    background: #dc3545 !important;
    color: #ffffff !important;
    border-color: #b02a37;
}

/* Tableau des pièces (étape 2) */
.tableau-pieces {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d5e5df;
    border-radius: var(--rayon);
    overflow: hidden;
    background: #fff;
    font-size: .9rem;
}
.tableau-pieces thead th {
    background: var(--couleur-principale);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .65rem .85rem;
    border: none;
    white-space: nowrap;
    vertical-align: middle;
}
.tableau-pieces tbody td {
    padding: .7rem .85rem;
    border-top: 1px solid #e6efeb;
    vertical-align: middle;
}
.tableau-pieces tbody tr:nth-child(even) td {
    background: #f5faf8;
}
.tableau-pieces tbody tr:hover td {
    background: #eaf6f1;
}
.tableau-pieces tbody td.col-piece {
    min-width: 11rem;
    font-weight: 600;
    color: #2c3e50;
}
.tableau-pieces tbody td.col-piece a {
    color: inherit;
    font-weight: inherit;
    text-decoration: underline;
}
.tableau-pieces tbody td.col-piece a:hover {
    color: var(--couleur-principale);
}
.tableau-pieces .piece-oblig-marque {
    color: #c0392b;
    font-weight: 800;
    margin-left: .15rem;
}
.tableau-pieces .col-oblig {
    width: 7rem;
    text-align: center;
}
.tableau-pieces .col-statut {
    width: 9.5rem;
}
.tableau-pieces .col-motif {
    min-width: 12rem;
}
.tableau-pieces .col-commentaire {
    min-width: 10rem;
}
.badge-obligatoire {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: .28em .65em;
    border-radius: 999px;
    letter-spacing: .02em;
}
.badge-oblig-oui {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffe69c;
}
.badge-oblig-non {
    background: #eef1f4;
    color: #6c757d;
    border: 1px solid #dce1e6;
}
.tableau-pieces .select-statut-piece,
.tableau-pieces .select-motif-rejet {
    min-width: 8.5rem;
    font-size: .85rem;
}

/* Bouton validation pièces : gris inactif, vert actif */
.btn-valider-pieces {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--couleur-principale);
    --bs-btn-border-color: var(--couleur-principale);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--couleur-principale-hover);
    --bs-btn-hover-border-color: var(--couleur-principale-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--couleur-principale-hover);
    --bs-btn-active-border-color: var(--couleur-principale-hover);
    --bs-btn-disabled-color: #6c757d;
    --bs-btn-disabled-bg: #e8edf1;
    --bs-btn-disabled-border-color: #c5ced6;
    --bs-btn-disabled-opacity: 1;
    font-weight: 600;
}
.btn-valider-pieces:disabled,
.btn-valider-pieces.disabled {
    color: #6c757d;
    background-color: #e8edf1;
    border-color: #c5ced6;
    opacity: 1;
}

.btn-rejeter-pieces {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--couleur-danger);
    --bs-btn-border-color: var(--couleur-danger);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #a93226;
    --bs-btn-hover-border-color: #a93226;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #922b21;
    --bs-btn-active-border-color: #922b21;
    --bs-btn-disabled-color: #6c757d;
    --bs-btn-disabled-bg: #e8edf1;
    --bs-btn-disabled-border-color: #c5ced6;
    --bs-btn-disabled-opacity: 1;
    font-weight: 600;
}
.btn-rejeter-pieces:disabled,
.btn-rejeter-pieces.disabled {
    color: #6c757d;
    background-color: #e8edf1;
    border-color: #c5ced6;
    opacity: 1;
}

/* Sections — en-tête de page (bandeau avec dégradé) */
.entete-page {
    background: linear-gradient(90deg, var(--couleur-principale-claire) 0%, rgba(212, 240, 232, 0.55) 42%, rgba(244, 246, 248, 0) 100%);
    border-radius: 6px var(--rayon) var(--rayon) 6px;
    border-left: 5px solid var(--couleur-principale);
    margin-bottom: 1.5rem;
    padding: .85rem 1.25rem;
    box-shadow: none;
}
.titre-page {
    font-family: var(--police-titre);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--couleur-principale);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
}
.entete-page-sous-titre {
    margin: .4rem 0 0;
    font-size: .9rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}
.entete-page .section-entete {
    align-items: center;
}
.entete-page .section-entete .titre-page {
    flex: 1;
    min-width: 0;
}
.section-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.entete-page .section-entete { margin-bottom: 0; }
.section { margin-top: 2rem; }

.bloc-bienvenue {
    background: #fff;
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    border: 1px solid var(--couleur-bordure);
    border-left: 4px solid var(--couleur-accent);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
}
.bloc-bienvenue-titre {
    margin: 0;
    font-family: var(--police-titre);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--couleur-texte);
    line-height: 1.25;
}
.bloc-bienvenue-texte {
    margin: .45rem 0 0;
    font-size: .95rem;
    color: var(--couleur-muted);
    line-height: 1.45;
}

.bloc-tb-titre {
    margin: 0 0 1rem;
    font-family: var(--police-titre);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--couleur-texte);
}

.bloc-indicateurs,
.bloc-carte-tb {
    background: #fff;
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    border: 1px solid var(--couleur-bordure);
    padding: 1.25rem 1.35rem 1.35rem;
    margin-bottom: 1.25rem;
}
.grille-indicateurs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .75rem;
}
.grille-indicateurs-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grille-indicateurs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille-indicateurs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.indicateur {
    border: 1px solid var(--couleur-bordure);
    border-radius: 6px;
    padding: .85rem .75rem;
    background: #fafbfc;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-height: 4.5rem;
}
.indicateur-accent {
    border-color: #f5d45a;
    background: var(--couleur-accent-claire);
}
.indicateur-libelle {
    font-size: .82rem;
    color: var(--couleur-muted);
    line-height: 1.3;
}
.indicateur-valeur {
    font-family: var(--police-titre);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--couleur-texte);
    line-height: 1;
}
.indicateur-accent .indicateur-valeur {
    color: var(--couleur-accent-hover);
}

.grille-repartitions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}
.grille-repartitions > .bloc-carte-tb {
    margin-bottom: 0;
}
.grille-repartitions .carte-repartition {
    max-width: none;
    width: 100%;
    box-shadow: none;
    border: none;
    border-left: none;
    padding: 0;
    background: transparent;
}

@media (max-width: 1100px) {
    .grille-indicateurs-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grille-indicateurs-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .grille-repartitions { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .grille-indicateurs-5,
    .grille-indicateurs-4,
    .grille-indicateurs-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.titre-section-tb {
    font-family: var(--police-titre);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--couleur-texte);
    margin-bottom: .85rem;
}
.carte-section { background: #fff; border-radius: var(--rayon); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--ombre); }
.carte-section[id] { scroll-margin-top: 5.5rem; }
.carte-section h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--couleur-principale); }
.carte-section h3 { font-size: 1rem; margin-bottom: .75rem; }

.bloc-autorisation-paiement {
    background: var(--couleur-principale-claire);
    border: 2px solid var(--couleur-principale);
    border-radius: var(--rayon);
    padding: 1.25rem 1.5rem;
    text-align: center;
}
.bloc-autorisation-paiement .btn-lg {
    display: inline-block;
    padding: .85rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 600;
}

/* Stats */
.grille-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.grille-stats-types { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.carte-stat-type { border-top: 3px solid var(--couleur-principale); }
.carte-stat-total { border-top: 3px solid var(--couleur-accent); }
.carte-stat-total .stat-valeur { color: var(--couleur-accent); }
.carte-stat { background: #fff; padding: 1.25rem; border-radius: var(--rayon); box-shadow: var(--ombre); text-align: center; }
.page-stocks .carte-stat .stat-valeur {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: .35rem;
    line-height: 1.2;
}
.page-stocks .carte-stat .stat-libelle {
    display: block;
    font-size: .9rem;
    color: var(--couleur-muted);
}

.carte-stat-attente .stat-valeur {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: .25rem;
    color: var(--couleur-principale);
    letter-spacing: -0.01em;
}
.carte-stat-attente .stat-libelle {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--couleur-muted);
}
.carte-stat-attente.carte-stat-total .stat-valeur {
    color: var(--couleur-accent);
}
.carte-stat-attente {
    padding: .85rem 1rem;
}

.carte-repartition {
    background: #fff;
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    border: 1px solid var(--couleur-bordure);
    border-left: 4px solid var(--couleur-principale);
    padding: 1.35rem 1.5rem;
    max-width: 760px;
}
.repartition-total {
    margin: 0 0 1.15rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--couleur-bordure);
    font-family: var(--police-titre);
    font-size: 1.05rem;
    color: var(--couleur-texte);
}
.repartition-total strong {
    font-weight: 700;
    color: var(--couleur-principale);
}
.liste-repartition {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.repartition-ligne {
    padding: .35rem 0;
}
.repartition-entete {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: .4rem;
}
.repartition-libelle {
    font-size: .95rem;
    color: var(--couleur-texte);
    line-height: 1.35;
}
.repartition-libelle strong {
    font-family: var(--police-titre);
    font-weight: 700;
    color: var(--couleur-principale);
}
.repartition-pct {
    flex-shrink: 0;
    font-size: .85rem;
    font-weight: 500;
}
.repartition-barre {
    height: .65rem;
    background: #e8eef1;
    border-radius: 999px;
    overflow: hidden;
}
.repartition-barre-remplissage {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--couleur-principale), #22a883);
    border-radius: 999px;
    min-width: 0;
    transition: width .25s ease;
}
.repartition-barre-acquereur {
    background: linear-gradient(90deg, var(--couleur-accent), #ffe566);
}
.grille-graphiques {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: .25rem;
}
@media (max-width: 900px) {
    .grille-graphiques { grid-template-columns: 1fr; }
}
.carte-graphique {
    background: #fafbfc;
    border-radius: var(--rayon);
    box-shadow: none;
    border: 1px solid var(--couleur-bordure);
    padding: 1.25rem 1.35rem;
}
.carte-graphique h3 {
    font-family: var(--police-titre);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    color: var(--couleur-texte);
}
.graphique-conteneur {
    position: relative;
    height: 260px;
}
.graphique-conteneur-barre {
    height: 280px;
}

.recherche-contribuable { max-width: 520px; }
.liste-suggestions-contribuable {
    list-style: none;
    margin: .35rem 0 0;
    padding: 0;
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    max-height: 280px;
    overflow-y: auto;
}
.liste-suggestions-contribuable li {
    padding: .65rem .85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--couleur-bordure);
}
.liste-suggestions-contribuable li:last-child { border-bottom: none; }
.liste-suggestions-contribuable li:hover,
.liste-suggestions-contribuable li:focus {
    background: var(--couleur-principale-claire);
    outline: none;
}
.resume-couverture-contribuable {
    background: #fff;
    border: 1px solid var(--couleur-bordure);
    border-left: 4px solid var(--couleur-principale);
    border-radius: var(--rayon);
    padding: 1rem 1.25rem;
    box-shadow: var(--ombre);
}

/* Onglets situations statistiques (Bootstrap nav-tabs) */
.nav-situations {
    margin-bottom: 1.25rem;
    border-bottom-color: var(--couleur-bordure);
}
.nav-situations .nav-link {
    color: var(--couleur-muted);
    border-color: transparent;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
}
.nav-situations .nav-link:hover {
    color: var(--couleur-principale);
    border-color: var(--couleur-bordure) var(--couleur-bordure) transparent;
    background: var(--couleur-principale-claire);
}
.nav-situations .nav-link.active {
    color: var(--couleur-principale);
    background-color: #fff;
    border-color: var(--couleur-bordure) var(--couleur-bordure) #fff;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--couleur-accent);
}
.cellule-acteur {
    font-size: .82rem;
    min-width: 8.5rem;
    vertical-align: top;
}
.acteur-groupe {
    display: block;
    color: var(--couleur-muted);
    font-size: .75rem;
    font-weight: 400;
}
.titre-section-modal {
    font-size: .9rem;
    font-weight: 600;
    margin: 0 0 .65rem;
    color: var(--couleur-texte);
}
#modal-acteurs-validation .modal-title {
    font-size: 1rem;
}
#modal-acteurs-validation .modal-body {
    font-size: .82rem;
}
#modal-acteurs-validation .liste-details {
    margin-bottom: 0;
    font-size: .82rem;
    grid-template-columns: 110px 1fr;
}
#modal-acteurs-validation .table {
    font-size: .8rem;
}
#modal-acteurs-validation .modal-footer .btn {
    font-size: .82rem;
}

/* Workflow */
.workflow-etapes { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.etape { display: flex; align-items: center; gap: .4rem; padding: .4rem .75rem; background: #fff; border: 1px solid var(--couleur-bordure); border-radius: var(--rayon); font-size: .8rem; }
.etape-active { border-color: var(--couleur-principale); background: var(--couleur-principale-claire); font-weight: 600; }
.etape-passee { opacity: .6; }
.etape-num { background: var(--couleur-principale); color: #fff; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; }

/* Dossier layout */
.grille-dossier { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
@media (max-width: 900px) { .grille-dossier { grid-template-columns: 1fr; } }
.liste-details { display: grid; grid-template-columns: 140px 1fr; gap: .35rem .75rem; font-size: .9rem; }
.liste-details dt { color: var(--couleur-muted); }
.historique-liste { list-style: none; font-size: .85rem; }
.historique-liste li { padding: .5rem 0; border-bottom: 1px solid var(--couleur-bordure); }
.historique-liste time { display: block; color: var(--couleur-muted); font-size: .78rem; }

/* Tableaux SECeF activés / acquis (étapes 6 et 8) */
.titre-tableau-secef {
    margin: 0 0 .65rem;
    font-weight: 700;
    color: var(--couleur-principale);
}
.tableau-secef {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d5e5df;
    border-radius: var(--rayon);
    overflow: hidden;
    background: #fff;
    font-size: .9rem;
}
.tableau-secef thead th {
    background: var(--couleur-principale);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .65rem .85rem;
    border: none;
    white-space: nowrap;
}
.tableau-secef tbody td {
    padding: .7rem .85rem;
    border-top: 1px solid #e6efeb;
    vertical-align: middle;
}
.tableau-secef tbody tr:nth-child(even) td {
    background: #f5faf8;
}
.tableau-secef tbody tr:hover td {
    background: #eaf6f1;
}
.tableau-secef .col-num {
    width: 3rem;
    text-align: center;
    font-weight: 700;
    color: var(--couleur-principale);
}
.tableau-secef thead .col-num {
    color: #fff;
}
.tableau-secef .col-nim code {
    font-family: Consolas, "Courier New", monospace;
    font-size: .88rem;
    letter-spacing: .03em;
    background: #eef6f3;
    color: #1a5c4a;
    padding: .2rem .45rem;
    border-radius: 4px;
    border: 1px solid #d5e5df;
}
.tableau-secef .col-date {
    white-space: nowrap;
    color: #556;
}
.tableau-secef .col-geo {
    max-width: 16rem;
    word-break: break-word;
}
.tableau-secef .col-actions {
    white-space: nowrap;
    width: 1%;
}
.badge-mode-activation {
    font-size: .75rem;
    font-weight: 700;
    padding: .35em .65em;
    border-radius: 999px;
}
.badge-mode-test {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffe69c;
}
.badge-mode-production {
    background: #d4f0e8;
    color: #0f5132;
    border: 1px solid #a3d9c5;
}

/* Auth */
html:has(body.page-auth) {
    height: 100%;
    overflow: hidden;
}
.page-auth {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: #dfe8e4;
    font-family: var(--police-texte);
    font-size: 11px;
}
.page-auth .form-control,
.page-auth .form-label,
.page-auth .btn,
.page-auth .alerte,
.page-auth .alert {
    font-family: var(--police-texte);
    font-size: 11px;
}
.page-auth .mb-3 {
    margin-bottom: .75rem !important;
}
.page-auth .form-control:not([type="file"]),
.page-auth .form-select {
    min-height: 2.35rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
}
.auth-bandeau {
    background: var(--couleur-principale);
    color: #fff;
    padding: .55rem 0;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    z-index: 2;
    border-bottom: 3px solid var(--couleur-accent);
}
.auth-bandeau-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.auth-bandeau-partenaire {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    max-width: none;
    text-align: center;
}
.auth-bandeau-fec {
    flex: 0 1 auto;
}
.auth-bandeau-cci {
    margin-left: 0;
}
.auth-bandeau-logo {
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 0;
    padding: .3rem .45rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--ombre);
}
.auth-bandeau-fec .auth-bandeau-logo {
    height: 46px;
}
.auth-bandeau-cci .auth-bandeau-logo {
    height: 40px;
}
.auth-bandeau-nom {
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    white-space: nowrap;
}
.auth-bandeau-cci .auth-bandeau-nom {
    font-size: clamp(9px, 1.05vw, 11px);
}

@media (max-width: 560px) {
    .auth-bandeau-inner {
        gap: .65rem;
        padding: 0 .85rem;
    }
    .auth-bandeau-logo {
        height: 36px;
        padding: .25rem .35rem;
    }
    .auth-bandeau-fec .auth-bandeau-logo {
        height: 38px;
    }
    .auth-bandeau-cci .auth-bandeau-logo {
        height: 34px;
    }
    .auth-bandeau-nom {
        font-size: 8px;
    }
    .auth-bandeau-cci .auth-bandeau-nom {
        font-size: 7px;
    }
}
.auth-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(400px, 660px);
    gap: 1rem;
    padding: .85rem 1rem 1rem;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}
.auth-panneau {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--ombre-forte);
    min-height: 0;
}
.auth-panneau-vente {
    background:
        linear-gradient(160deg, #1b8a6b 0%, #157a5e 42%, #0f4f3f 100%);
    color: #fff;
    display: flex;
    min-height: 0;
}
.auth-panneau-connexion {
    background: #f7faf9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 0;
    overflow: hidden;
}
/* Formulaires longs (demande en ligne) : panneau droit scrollable */
.page-auth-scrollable .auth-panneau-connexion {
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.page-auth-scrollable .auth-conteneur {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: .25rem 0 1.5rem;
}
.page-auth-scrollable .formulaire-large {
    max-width: 100%;
}
.page-auth-scrollable .form-control:not([type="file"]),
.page-auth-scrollable .form-select {
    min-height: 2.35rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
}
.page-auth-scrollable .form-control[type="file"] {
    min-height: 2.35rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
}
.page-auth-scrollable .btn-rechercher-ifu {
    min-height: 2.35rem;
}
.auth-scene {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 1rem;
    gap: .75rem;
    min-height: 0;
}
.auth-scene-entete {
    max-width: none;
    text-align: center;
    flex-shrink: 0;
}
.auth-scene-titre {
    margin: 0;
    min-width: 0;
    font-family: var(--police-titre);
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    color: #fff;
    white-space: normal;
    text-align: center;
}
.auth-scene-visuel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, .12);
    border: 1px solid rgba(255, 255, 255, .14);
}
.auth-scene-visuel img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}
.auth-conteneur {
    width: 100%;
    max-width: 400px;
}
.auth-carte {
    background: #fff;
    padding: 2rem;
    border-radius: var(--rayon);
    box-shadow: var(--ombre-forte);
}
.auth-carte-connexion {
    width: 100%;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--ombre-forte);
    border: 1px solid #e2ebe7;
}

@media (max-width: 980px) {
    .auth-main {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, auto) minmax(0, 1fr);
    }
    .auth-panneau-connexion {
        order: -1;
        padding: .75rem .85rem;
        flex-shrink: 0;
    }
    .page-auth-scrollable .auth-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "form"
            "visuel";
        grid-template-rows: minmax(0, 1fr) minmax(120px, 22vh);
    }
    .page-auth-scrollable .auth-panneau-connexion {
        grid-area: form;
        flex-shrink: 1;
        min-height: 0;
        overflow-y: auto;
    }
    .page-auth-scrollable .auth-panneau-vente {
        grid-area: visuel;
    }
    .auth-panneau-vente {
        min-height: 0;
    }
    .auth-scene {
        padding: .75rem;
        gap: .5rem;
    }
    .auth-carte-corps {
        padding: 1rem 1.25rem 1.25rem;
    }
    .auth-carte-entete {
        padding: .75rem 1rem;
        font-size: clamp(1.25rem, 4vw, 1.6rem);
    }
    .auth-indication {
        margin-bottom: .85rem;
    }
}

@media (max-width: 640px) {
    .auth-main {
        padding: .55rem;
        gap: .55rem;
    }
    .auth-scene {
        padding: .65rem;
    }
    .auth-bandeau {
        padding: .4rem 0;
    }
    /* Téléphone uniquement : padding / hauteur des champs. Ordinateur inchangé. */
    .page-auth-scrollable .form-control:not([type="file"]),
    .page-auth-scrollable .form-select {
        min-height: 3rem;
        padding: .8rem .95rem;
        font-size: 16px;
    }
    .page-auth-scrollable .form-control[type="file"] {
        min-height: 3rem;
        padding: .55rem .75rem;
    }
    .page-auth-scrollable .form-label {
        font-size: 15px;
    }
    .page-auth-scrollable .btn,
    .page-auth-scrollable .btn-rechercher-ifu,
    .page-auth-scrollable .btn-lg {
        min-height: 3rem;
        font-size: 16px;
        padding: .7rem 1rem;
    }
    .page-auth-scrollable .form-check {
        min-height: 2.25rem;
        padding-top: .3rem;
        padding-bottom: .3rem;
    }
    #form-demande-ligne .row.g-2 > .col-auto {
        flex: 0 0 100%;
        width: 100%;
    }
    #form-demande-ligne .btn-rechercher-ifu {
        width: 100%;
    }
}
.auth-carte-entete {
    background: var(--couleur-principale);
    color: #fff;
    text-align: center;
    padding: .85rem 1rem;
    font-family: var(--police-titre);
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.auth-carte-corps {
    padding: 1.25rem 1.5rem 1.5rem;
}
.auth-flash {
    position: relative;
    margin-bottom: 1rem;
    padding: .75rem 2rem .75rem 1rem;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .4s ease, transform .4s ease, max-height .4s ease, margin .4s ease, padding .4s ease, border-width .4s ease;
    max-height: 240px;
    overflow: hidden;
}
.auth-flash-fermer {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.2rem;
}
.auth-flash-fermer:hover,
.auth-flash-fermer:focus {
    opacity: 1;
}
.auth-flash.auth-flash-masquee {
    opacity: 0 !important;
    transform: translateY(-8px);
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    pointer-events: none;
    visibility: hidden;
}
.auth-flash-succes {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}
.auth-flash-erreur {
    background: #fadbd8;
    color: #922b21;
    border: 1px solid #f1948a;
}
.auth-flash-avertissement {
    background: #fef5e7;
    color: #9a7b0a;
    border: 1px solid #f9e79f;
}
.auth-flash-verrouillage {
    max-height: none;
}
.formulaire[data-verrouille="1"] .form-control {
    background: #f0f3f2;
    cursor: not-allowed;
}
.alerte-avertissement {
    background: #fef5e7;
    color: #9a7b0a;
    border: 1px solid #f9e79f;
}
.auth-indication {
    text-align: center;
    color: var(--couleur-muted);
    font-size: 1em;
    margin-bottom: 1rem;
}
.auth-lien-oublie {
    margin: .45rem 0 0;
    text-align: right;
}
.auth-lien-oublie a,
.auth-lien-retour a {
    color: var(--couleur-principale);
    text-decoration: none;
    font-size: .95em;
    font-weight: 600;
}
.auth-lien-oublie a:hover,
.auth-lien-retour a:hover {
    text-decoration: underline;
}
.auth-lien-retour {
    margin: 1rem 0 0;
    text-align: center;
}
.auth-champ-mdp {
    position: relative;
}
.auth-champ-mdp .form-control {
    padding-right: 2.75rem;
}
.auth-toggle-mdp {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    border: none;
    background: transparent;
    color: #95a5a6;
    padding: .35rem .5rem;
    line-height: 0;
    cursor: pointer;
    border-radius: 4px;
}
.auth-toggle-mdp:hover,
.auth-toggle-mdp:focus-visible {
    color: var(--couleur-principale);
    outline: none;
}
.auth-btn-connexion {
    margin-top: .25rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .05em;
    padding: .75rem 1rem;
}
.auth-carte h1 { margin-bottom: 1.25rem; font-size: 1.4em; }
.auth-titre { font-size: 1.15em; margin-bottom: 1rem; color: var(--couleur-principale); text-align: center; }
.auth-carte-large { max-width: 640px; margin: 0 auto; }
.auth-entete { text-align: center; margin-bottom: 1.5rem; }
.auth-entete img { height: 90px; width: auto; margin-bottom: .75rem; }
.auth-entete h1 { font-size: 1.1em; color: var(--couleur-texte); margin: 0; }
.auth-entete p { font-size: 1em; color: var(--couleur-muted); margin-top: .25rem; }
.actions-wrap { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.texte-muted { color: var(--couleur-muted); }
.filtres { margin-bottom: 1rem; }
.liste-permissions { list-style: none; font-size: .9rem; }
.liste-permissions li { padding: .25rem 0; }
.liste-permissions code { background: #eef2f5; padding: .1rem .4rem; border-radius: 4px; font-size: .82rem; }

.erreur-page { text-align: center; padding: 4rem 1rem; }
.erreur-page h1 { font-size: 3rem; margin-bottom: 1rem; }
