/*
 * Rafraîchissement de l'interface (audit UI, lot quick wins)
 * Chargé en dernier dans l'espace bénéficiaire et l'espace admin.
 * Uniquement de la présentation : aucun sélecteur ne modifie un comportement.
 */

:root {
    --ui-navy: #244272;
    --ui-ink: #1d2b45;
    --ui-muted: #5d6b82;
    --ui-line: #e3e9f1;
    --ui-line-strong: #c9d6e6;
    --ui-hover: #f1f6fc;
    --ui-selected: #eaf5fb;
    --ui-surface: #ffffff;
    --ui-row-alt: #f8fbfe;
}

/* ===================== En-tête et zone de contenu ===================== */
/* Logo plus discret */
.app-header.bg-light .navbar-brand img {
    width: auto;
    height: 36px;
    max-width: 150px;
}

@media (min-width: 992px) {
    .aside-menu-fixed .app-header {
        height: 60px;
        margin-bottom: 0;
        border-bottom: 1px solid var(--ui-line) !important;
    }

    .app-body .main > .container-fluid,
    .app-body .main .container-fluid {
        padding-left: 24px;
        padding-right: 24px;
    }
}

.breadcrumb {
    margin: 12px 24px 4px 24px;
    font-size: 13px;
}

.app-body .main > .container-fluid > h2,
.app-body .main section > .container-fluid > h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 8px 0 16px;
    font-size: 24px;
}

#datatable_info_stack {
    font-size: 14px;
    font-weight: 400;
    color: var(--ui-muted);
}

#datatable_info_stack a {
    color: var(--ui-navy);
    text-decoration: underline;
}

/* ===================== Menu latéral ===================== */
.wrap_sidebar_footer {
    border-right: 1px solid var(--ui-line);
}

.sidebar-pills {
    width: 100%;
    padding: 10px 8px;
}

/* Barre de défilement discrète quand le menu dépasse la hauteur de l'écran */
.wrap_sidebar_footer .sidebar {
    scrollbar-width: thin;
    scrollbar-color: #c9d6e6 transparent;
}

.wrap_sidebar_footer .sidebar::-webkit-scrollbar {
    width: 6px;
}

.wrap_sidebar_footer .sidebar::-webkit-scrollbar-thumb {
    border-radius: 6px;
    background-color: #c9d6e6;
}

.wrap_sidebar_footer .sidebar .sidebar-nav,
.wrap_sidebar_footer .sidebar .sidebar-nav .nav,
.wrap_sidebar_footer .sidebar .nav-item {
    width: 100%;
}

.wrap_sidebar_footer .sidebar .sidebar-nav .nav {
    gap: 2px;
}

/* Chevron des sous-menus : place réservée à droite du libellé */
.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown-toggle {
    padding-right: 32px !important;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown-toggle::before {
    right: 12px;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ui-ink) !important;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link > i:first-child,
.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link .nav-icon {
    flex: 0 0 18px;
    width: 18px;
    margin: 0;
    font-size: 15px;
    text-align: center;
    color: var(--ui-muted);
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link:hover {
    background-color: var(--ui-hover);
    font-weight: 500;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link.active {
    background-color: var(--ui-selected);
    color: var(--ui-navy) !important;
    font-weight: 600;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link.active > i:first-child,
.wrap_sidebar_footer .sidebar.sidebar-pills .nav-link.active .nav-icon {
    color: var(--ui-navy);
}

/* Titres de section (Traitement, Pilotage, Configuration) */
.wrap_sidebar_footer .sidebar.sidebar-pills .nav-title {
    padding: 16px 10px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7c8ba3 !important;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-title:first-child {
    padding-top: 4px;
}

/* Menu fixe au défilement (desktop) : il reste visible et défile séparément du contenu.
   CoreUI met overflow-x: hidden sur .app-body, ce qui empêche position: sticky ;
   overflow-x: clip coupe aussi le débordement horizontal sans créer de zone de défilement. */
@supports (overflow-x: clip) {
    @media (min-width: 992px) {
        .app-body {
            overflow-x: clip;
        }
    }
}

@media (min-width: 992px) {
    .wrap_sidebar_footer {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        flex-wrap: nowrap;
    }

    /* CoreUI fixe la sidebar à 300px de haut (flex: 0 0 300px) : elle prend ici toute la hauteur
       disponible et défile si le menu est plus long que l'écran. */
    .wrap_sidebar_footer .sidebar {
        flex: 1 1 auto !important;
        min-height: 0;
        overflow-y: auto;
    }

    .wrap_sidebar_footer .sidebar .sidebar-nav {
        flex: 0 0 auto;
        overflow: visible !important;
    }

    .wrap_sidebar_footer .app-footer {
        flex: 0 0 auto;
    }
}

/* Sous-menus : alignés sous le libellé du parent */
.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown.open {
    background: transparent;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown.open > .nav-dropdown-items {
    margin: 2px 0 6px;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown-items .nav-link {
    padding: 6px 10px 6px 20px;
    font-size: 13.5px;
    font-weight: 400;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown-items .nav-link > i:first-child,
.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown-items .nav-link .nav-icon {
    font-size: 14px;
}

.wrap_sidebar_footer .sidebar.sidebar-pills .nav-dropdown-items .nav-dropdown-items .nav-link {
    padding-left: 32px;
}

.wrap_sidebar_footer .app-footer {
    font-size: 13px;
}

/* ===================== Listes (Backpack CRUD et liste des projets) ===================== */

/* Recherche */
#datatable_search_stack .dataTables_filter {
    text-align: right;
}

#datatable_search_stack .dataTables_filter label {
    width: 100%;
    max-width: 320px;
    margin: 0;
}

#datatable_search_stack .dataTables_filter input,
#crudTable_filter input {
    width: 100% !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 8px !important;
    background-color: var(--ui-surface);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ui-ink);
}

#datatable_search_stack .dataTables_filter input::placeholder,
#crudTable_filter input::placeholder {
    color: #7c8ba3;
    font-weight: 400;
}

#datatable_search_stack .dataTables_filter input:focus,
#crudTable_filter input:focus {
    border-color: var(--ui-navy) !important;
    box-shadow: 0 0 0 3px rgba(36, 66, 114, .12);
    outline: 0;
}

/* Filtres : pastilles sur une barre compacte, filtre actif mis en évidence */
.navbar-filters {
    margin-top: 12px;
    padding: 8px 10px !important;
    background-color: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: 10px;
}

.navbar-filters > a.nav-item {
    padding: 0 6px 0 2px;
    color: var(--ui-muted);
}

.navbar-filters .navbar-nav {
    flex-wrap: wrap;
    gap: 6px;
}

.navbar-filters .navbar-nav > .nav-item > .nav-link {
    padding: 5px 12px !important;
    border: 1px solid var(--ui-line-strong);
    border-radius: 999px;
    background-color: var(--ui-surface);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ui-ink);
    white-space: nowrap;
}

.navbar-filters .navbar-nav > .nav-item > .nav-link:hover,
.navbar-filters .navbar-nav > .nav-item.show > .nav-link {
    background-color: var(--ui-hover);
    border-color: var(--ui-navy);
}

.navbar-filters .navbar-nav > .nav-item.active > .nav-link {
    background-color: var(--ui-selected);
    border-color: var(--ui-navy);
    color: var(--ui-navy);
    font-weight: 600;
}

.navbar-filters .navbar-nav > .nav-item > #remove_filters_button {
    border-color: transparent;
    background: transparent;
    color: var(--ui-navy);
    text-decoration: underline;
}

.navbar-filters .navbar-nav .dropdown-menu {
    margin-top: 6px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(29, 43, 69, .12);
    font-size: 14px;
}

/* Le lien « Supprimer les filtres » masqué ne doit pas occuper une ligne */
.navbar-filters #remove_filters_button.invisible {
    display: none;
}

.navbar-filters .navbar-nav,
.navbar-filters .navbar-collapse {
    margin: 0;
    padding: 0;
}

/* Tableau */
#crudTable,
#crudTable_wrapper.dataTables_wrapper #crudTable {
    margin-top: 12px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 10px;
    border-collapse: separate !important;
    border-spacing: 0;
    box-shadow: none !important;
}

#crudTable thead > tr > th:first-child {
    border-top-left-radius: 10px;
}

#crudTable thead > tr > th:last-child {
    border-top-right-radius: 10px;
}

#crudTable thead > tr > th,
#crudTable tfoot > tr > th {
    padding: 11px 16px !important;
    background: #f3f7fb !important;
    color: #3e5175 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ui-line) !important;
    white-space: nowrap;
}

#crudTable tfoot > tr > th {
    border-top: 1px solid var(--ui-line) !important;
    border-bottom: 0 !important;
}

#crudTable tbody td {
    padding: 10px 16px !important;
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--ui-line) !important;
    font-size: 14px;
    font-weight: 500;
    color: var(--ui-ink);
    vertical-align: middle;
}

#crudTable tbody tr:last-child td {
    border-bottom: 0 !important;
}

#crudTable.table-striped tbody tr:nth-of-type(2n),
#crudTable.table-striped tbody tr:nth-of-type(2n) td {
    background-color: var(--ui-row-alt);
}

#crudTable.table-striped tbody tr:nth-of-type(2n+1) {
    background-color: var(--ui-surface);
}

#crudTable.table-hover tbody tr:hover,
#crudTable.table-hover tbody tr:hover td {
    background-color: var(--ui-hover);
}

/* Icône « ⋮ » (détails responsive de DataTables) : place réservée avant la référence */
#crudTable tbody td.dtr-control {
    padding-left: 30px !important;
}

/* Colonne d'actions : boutons alignés au centre de la ligne, côte à côte */
#crudTable tbody td:last-child > br {
    display: none;
}

#crudTable tbody td:last-child .btn {
    margin: 2px 0 2px 6px !important;
}

/* Boutons d'action dans les lignes */
#crudTable td .btn,
#crudTable td a.btn {
    padding: 5px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.4;
}

#crudTable td a:not(.btn) {
    padding: 0;
    font-size: 14px;
}

/* Pagination et nombre de lignes */
.dataTables_wrapper .dataTables_info {
    font-size: 14px;
    color: var(--ui-muted);
}

.page-link {
    width: 36px;
    height: 36px;
    padding: 6px 0 !important;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 8px !important;
    background-color: var(--ui-surface);
    font-size: 14px;
    line-height: 1.6;
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    font-size: 18px;
    line-height: 1.2;
}

.page-item.active .page-link {
    border-color: var(--ui-navy) !important;
}

.dataTables_length select,
.dataTables_wrapper .dataTables_length select {
    height: 36px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 14px;
}

/* Liste des projets du bénéficiaire (tableau statique, sans mode responsive DataTables) */
#crudTable.projects-table tbody td.dtr-control {
    padding-left: 16px !important;
}

#crudTable.projects-table thead > tr > th {
    white-space: normal;
}

#crudTable.projects-table tbody td:first-child,
#crudTable.projects-table tbody td:last-child {
    white-space: nowrap;
}

#crudTable.projects-table tbody td:nth-child(2) {
    min-width: 160px;
    white-space: normal;
}

#crudTable.projects-table tbody td:last-child .btn {
    margin: 0 !important;
    padding: 4px 8px !important;
}

/* ===================== Tableau de bord admin ===================== */
.dash {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
}

.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 4px;
}

.dash-title {
    margin: 0 !important;
    font-size: 26px;
}

.dash-sub {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--ui-muted);
}

.dash-updated {
    margin: 0;
    font-size: 13px;
    color: #7c8ba3;
}

.dash-card {
    min-width: 0;
    padding: 18px 20px;
    background-color: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: 12px;
}

.dash-card-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-ink);
}

.dash-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a35f05;
}

.dash-muted {
    font-size: 14px;
    font-weight: 400;
    color: var(--ui-muted);
}

.dash-foot {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: #7c8ba3;
}

/* Bloc À traiter */
.dash-todo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    border-left: 4px solid #c9790f;
}

.dash-todo-count {
    margin: 2px 0 0;
    font-size: 15px;
    color: var(--ui-ink);
}

.dash-todo-count b {
    margin-right: 4px;
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    color: var(--ui-ink);
}

.dash-todo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 999px;
    font-size: 14px;
    color: var(--ui-ink);
    text-decoration: none !important;
}

.dash-chip:hover,
.dash-chip:focus-visible {
    border-color: var(--ui-navy);
    background-color: var(--ui-hover);
    color: var(--ui-ink);
}

.dash-chip b {
    font-variant-numeric: tabular-nums;
}

.dash-chip-warn {
    border-color: #f0c98a;
    background-color: #fdf4e6;
    color: #7a4704;
}

.dash-dot {
    display: inline-block;
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dash-dot-preparing { background: #9aa6b8; }
.dash-dot-pending { background: #2f6fb0; }
.dash-dot-audit { background: #c9790f; }
.dash-dot-negative { background: #c0392b; }
.dash-dot-favorable { background: #5f9e1f; }

/* Indicateurs */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dash-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--ui-ink);
    text-decoration: none !important;
}

a.dash-kpi:hover,
a.dash-kpi:focus-visible {
    border-color: var(--ui-navy);
    color: var(--ui-ink);
}

.dash-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
}

.dash-kpi-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--ui-navy);
    font-variant-numeric: tabular-nums;
}

.dash-kpi-note {
    font-size: 13px;
    color: var(--ui-muted);
}

/* Grilles et graphiques */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dash-chart {
    position: relative;
    height: 240px;
}

.dash-chart-tall {
    height: 300px;
}

.dash-donut {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
}

.dash-chart-donut {
    height: 200px;
}

.dash-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
}

.dash-legend li,
.dash-legend li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ui-ink);
    text-decoration: none;
}

.dash-legend li > a {
    width: 100%;
}

.dash-legend li > a:hover .dash-legend-label {
    text-decoration: underline;
}

.dash-legend-label {
    flex: 1 1 auto;
    min-width: 0;
}

.dash-legend b {
    font-variant-numeric: tabular-nums;
}

/* Parcours */
.dash-funnel {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-funnel-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--ui-ink);
}

.dash-funnel-row b {
    font-variant-numeric: tabular-nums;
}

.dash-funnel small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #7c8ba3;
}

.dash-bar {
    height: 8px;
    border-radius: 999px;
    background-color: #edf1f6;
    overflow: hidden;
}

.dash-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background-color: var(--ui-navy);
}

/* Tableaux du tableau de bord */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dash-table th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ui-line);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #3e5175;
    text-align: left;
    white-space: nowrap;
}

.dash-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--ui-line);
    color: var(--ui-ink);
    vertical-align: middle;
}

.dash-table tr:last-child td {
    border-bottom: 0;
}

.dash-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dash-table .dash-col-bar {
    width: 30%;
    min-width: 120px;
}

.dash-ref {
    font-weight: 700;
    color: var(--ui-navy);
    white-space: nowrap;
}

.dash-age {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: #edf1f6;
    font-size: 13px;
    font-weight: 600;
}

.dash-age.is-late {
    background-color: #fdecea;
    color: #9b2c22;
}

/* Derniers changements */
.dash-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dash-timeline li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--ui-line);
    font-size: 14px;
}

.dash-timeline li:last-child {
    border-bottom: 0;
}

.dash-timeline .dash-dot {
    margin-top: 5px;
}

.dash-timeline li > div {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    min-width: 0;
}

.dash-timeline small {
    flex-basis: 100%;
    font-size: 12.5px;
    color: #7c8ba3;
}

/* État vide */
.dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    text-align: center;
}

.dash-empty i {
    font-size: 32px;
    color: #9aa6b8;
}

.dash-empty h3 {
    margin: 0;
    font-size: 18px;
}

.dash-empty p {
    margin: 0 0 8px;
    color: var(--ui-muted);
}

@media (max-width: 1199.98px) {
    .dash-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .dash-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-donut {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-chart-donut {
        max-width: 200px;
        margin: 0 auto;
    }
}

/* ===================== Tableau de bord porteur de projet ===================== */
.pdp-dash .dash-kpi-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pdp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pdp-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.pdp-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-navy);
}

.pdp-empty {
    padding: 28px 20px;
}

.pdp-projects {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pdp-project {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 28px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ui-line);
}

.pdp-project:first-child {
    padding-top: 0;
}

.pdp-project:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.pdp-project-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.pdp-project-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 0;
    font-size: 15px;
}

.pdp-project-title a {
    font-weight: 600;
    color: var(--ui-ink);
    overflow-wrap: anywhere;
}

.pdp-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px;
    border-radius: 999px;
    background-color: #edf1f6;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-ink);
}

.pdp-status-pending { background-color: #e8f0f9; }
.pdp-status-audit { background-color: #fdf4e6; }
.pdp-status-negative { background-color: #fdecea; }
.pdp-status-favorable { background-color: #eef6e5; }

.pdp-progress-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    margin-bottom: 6px;
    font-size: 13.5px;
    color: var(--ui-ink);
}

.pdp-progress-row small {
    font-size: 12.5px;
    color: #7c8ba3;
}

.pdp-project-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.pdp-banner {
    padding: 24px 28px;
}

.pdp-banner img,
.pdp-banner iframe {
    max-width: 100%;
}

.pdp-files {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

@media (max-width: 991.98px) {
    .pdp-project {
        grid-template-columns: minmax(0, 1fr);
    }

    .pdp-project-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .pdp-banner {
        padding: 18px 16px;
    }
}

/* ===================== Boutons : taille standard plus compacte ===================== */
.btn,
.btn-primary,
.btn-success,
.btn-default,
.btn-light,
.btn-secondary,
.btn-danger,
.btn-warning,
.btn-info {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 13px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 16px;
}

.btn i,
.btn .la,
.btn .fa-solid,
.btn .fa-regular {
    font-size: 1em;
}

/* ===================== En-tête : utilisateur connecté ===================== */
.app-header .navbar-nav .nav-item.header-user {
    min-width: 0;
    margin: 0 8px 0 6px;
    padding: 0 !important;
}

.app-header .navbar-nav .nav-item.header-user > .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    text-align: left;
}

.app-header .navbar-nav .nav-item.header-user > .nav-link:hover,
.app-header .navbar-nav .nav-item.header-user.show > .nav-link {
    background-color: var(--ui-hover);
}

.header-user-avatar {
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--ui-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.header-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.header-user-name {
    max-width: 180px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-role {
    font-size: 12px;
    color: var(--ui-muted);
}

.header-user-caret {
    font-size: 10px;
    color: var(--ui-muted);
}

.header-user-menu-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px 10px;
    border-bottom: 1px solid var(--ui-line);
    color: var(--ui-ink);
}

.header-user-menu-head span {
    font-size: 12.5px;
    color: var(--ui-muted);
}

@media (max-width: 767.98px) {
    .app-header .header-user .header-user-text,
    .app-header .header-user .header-user-caret {
        display: none;
    }
}

/* ===================== Formulaires : champs compacts ===================== */
/* style.css donnait 56px de haut, du texte en gras et une bordure bleu marine à tous les champs,
   y compris aux cases à cocher (input générique). */
label,
.bold-labels label {
    margin-bottom: 6px;
    font-size: 14.5px;
    font-weight: 600;
}

input,
.form-control {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ui-ink);
}

.form-control:focus,
input:focus {
    border-color: var(--ui-navy);
    box-shadow: 0 0 0 3px rgba(36, 66, 114, .12);
}

.form-control::placeholder,
input::placeholder {
    color: #8a97ab;
    font-weight: 400;
}

textarea.form-control {
    height: auto;
    min-height: 96px;
}

select.form-control[multiple],
select.form-control[size] {
    height: auto;
}

/* Cases à cocher, boutons radio, curseurs et fichiers gardent leur taille naturelle */
input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
    vertical-align: middle;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="range"],
input[type="file"],
input[type="color"] {
    height: auto;
    padding: 0;
    border: 0;
}

.form-check-label {
    padding: 0 0 6px;
    gap: 8px;
    font-weight: 500;
}

.checkbox label,
.font-weight-normal {
    gap: 10px;
}

/* Groupes avec icône (dates, montants) alignés sur la hauteur des champs */
.input-group > .form-control {
    height: 40px;
}

.input-group-text {
    height: 40px;
    padding: 0 12px;
    border-color: var(--ui-line-strong);
    font-size: 14px;
}

/* Listes déroulantes select2 : même hauteur que les champs, valeur centrée */
span.select2-selection.select2-selection--single,
form .select2-container--bootstrap span.select2-selection.select2-selection--single,
.select2-container--bootstrap span.select2-selection.select2-selection--single {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ui-ink);
}

.select2-container span.select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.4 !important;
    color: var(--ui-ink);
}

.select2-container span.select2-selection--single .select2-selection__arrow {
    top: 0 !important;
    right: 8px !important;
    height: 38px !important;
}

.select2-container--bootstrap.select2-container--focus span.select2-selection,
.select2-container--bootstrap.select2-container--open span.select2-selection {
    border-color: var(--ui-navy) !important;
    box-shadow: 0 0 0 3px rgba(36, 66, 114, .12);
}

.select2-container .select2-selection--multiple {
    min-height: 40px;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: 8px;
}

.select2-dropdown {
    border-color: var(--ui-line-strong);
    border-radius: 8px;
    font-size: 14px;
}

/* Champs en lecture seule */
.form-control:disabled,
.form-control[readonly] {
    border-color: var(--ui-line) !important;
    background-color: #f1f4f8 !important;
    color: var(--ui-muted);
}
