.sgf-application {
    min-width: 320px;
    min-height: 100vh;
    background: #f5f7fa;
}

.sgf-skip-link:focus {
    position: fixed;
    z-index: 1090;
    top: .5rem;
    left: .5rem;
    padding: .75rem 1rem;
    background: #fff;
    border: 2px solid #0a58ca;
}

.sgf-application :focus-visible,
.sgf-authentification :focus-visible {
    outline: 3px solid #9a3412;
    outline-offset: 3px;
}

.sgf-navigation .nav-link.disabled {
    color: #495057;
    opacity: 1;
    cursor: not-allowed;
}

.sgf-authentification {
    min-height: 100vh;
    background: #f5f7fa;
}

.sgf-auth-card {
    max-width: 30rem;
}

.sgf-texte-long {
    overflow-wrap: anywhere;
}

.sgf-application main {
    min-width: 0;
}

/* Contient aussi les libellés accessibles positionnés dans les tableaux défilants. */
.sgf-application .table-responsive {
    position: relative;
}

.sgf-table-imports {
    min-width: 1050px;
}

.sgf-table-validation {
    min-width: 950px;
}

.sgf-recherche-table {
    min-width: 850px;
}

.sgf-recherche-table td {
    max-width: 22rem;
    overflow-wrap: anywhere;
}

@media (min-width: 992px) {
    .sgf-sidebar {
        min-height: calc(100vh - 3.5rem);
        border-right: 1px solid #dee2e6;
        background: #fff;
    }

    .sgf-navigation {
        position: sticky;
        top: 0;
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }
}
/* Fiche : textes longs contenus et formulaires utilisables sur smartphone. */
.sgf-fiche { overflow-wrap: anywhere; }
.sgf-fiche summary { cursor: pointer; font-weight: 600; }
.sgf-fiche details > summary { padding-block: .4rem; }
.sgf-fiche .card, .sgf-fiche .row > * { min-width: 0; }
.sgf-texte-multiligne { white-space: pre-wrap; overflow-wrap: anywhere; }
.sgf-historique-exports {
    min-width: 68rem;
}

.sgf-historique-exports td:nth-child(3) {
    min-width: 14rem;
    max-width: 22rem;
}

.sgf-historique-exports td:nth-child(7) {
    min-width: 12rem;
}

.sgf-table-utilisateurs { min-width: 850px; }
.sgf-table-utilisateurs td { max-width: 22rem; overflow-wrap: anywhere; }

/* Parametrage : tableaux defilants et longues valeurs contenus dans Bootstrap. */
.sgf-parametrage { overflow-wrap: anywhere; }
.sgf-parametrage .card, .sgf-parametrage .row > * { min-width: 0; }
.sgf-parametrage-table { min-width: 48rem; }
.sgf-parametrage-table td { max-width: 24rem; overflow-wrap: anywhere; }
.sgf-parametrage summary { cursor: pointer; font-weight: 600; }

/* Identité visuelle Decoster — couche commune aux pages métier et Shield. */
:root {
    --sgf-anthracite: #383e42;
    --sgf-cuivre: #b17134;
    --sgf-cuivre-accessible: #8a5427;
    --sgf-bordeaux: #5b2f2c;
    --sgf-beige: #eee5dd;
    --sgf-blanc: #fff;
    --sgf-fond: #f9f9f9;
    --sgf-texte: #383e42;
    --sgf-bordure: #dedbd8;
    --sgf-bordure-champ: #73797c;
    --bs-primary: #8a5427;
    --bs-primary-rgb: 138, 84, 39;
    --bs-link-color: #8a5427;
    --bs-link-hover-color: #5b2f2c;
    --bs-body-color: #383e42;
    --bs-body-bg: #f9f9f9;
    --bs-border-color: #dedbd8;
    --bs-font-sans-serif: Verdana, Geneva, sans-serif;
    --bs-border-radius: .45rem;
    --bs-border-radius-lg: .65rem;
}

html { scroll-behavior: smooth; }
body.sgf-application, body.sgf-authentification {
    color: var(--sgf-texte);
    background: var(--sgf-fond);
    font-family: Verdana, Geneva, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

.sgf-application > header.navbar {
    min-height: 4.25rem;
    color: var(--sgf-blanc);
    background: var(--sgf-anthracite) !important;
    border-color: var(--sgf-cuivre) !important;
    border-bottom-width: 3px !important;
}
.sgf-application .navbar-brand {
    color: var(--sgf-blanc) !important;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.3rem;
    letter-spacing: .015em;
}
.sgf-application .navbar-brand:hover,
.sgf-application .navbar-brand:focus { color: #f4e6d7; }
.sgf-application header .text-body-secondary { color: #f1eeeb !important; }
.sgf-application .sgf-sidebar { background: var(--sgf-anthracite); }
.sgf-application .sgf-navigation { background: var(--sgf-anthracite); }
.sgf-navigation .offcanvas-header { border-color: #62676a !important; }
.sgf-navigation .offcanvas-title { color: var(--sgf-blanc); }
.sgf-navigation .btn-close { filter: invert(1) grayscale(1); }
.sgf-navigation .nav { padding: 1rem .8rem; }
.sgf-navigation .nav-link {
    position: relative;
    padding: .7rem .85rem;
    border-radius: .35rem;
    color: #f7f5f3;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.sgf-navigation .nav-link:hover,
.sgf-navigation .nav-link:focus-visible {
    color: var(--sgf-blanc);
    background: #50565a;
}
.sgf-navigation .nav-link.active {
    color: var(--sgf-blanc);
    background: var(--sgf-bordeaux);
    box-shadow: inset 3px 0 var(--sgf-cuivre);
    font-weight: 700;
}
.sgf-navigation .nav-link.disabled { color: #d6d2cf; }
.sgf-navigation .badge { color: var(--sgf-anthracite) !important; background: #f2e8de !important; }
.sgf-navigation .nav-link:focus-visible { outline-color: #f3c894; }
.sgf-application main { padding-top: 2rem !important; padding-bottom: 3rem !important; }

h1, h2, h3, h4, h5, h6,
.sgf-application .offcanvas-title,
.sgf-authentification h1,
.sgf-authentification h2 {
    color: var(--sgf-anthracite);
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    line-height: 1.25;
}
.sgf-application h1 { margin-bottom: 1.25rem; }
.sgf-application main > .d-flex h1 { margin-bottom: 0; }
.sgf-application a:not(.btn):not(.nav-link):not(.page-link):not(.navbar-brand),
.sgf-authentification a { color: var(--sgf-cuivre-accessible); text-underline-offset: .15em; }
.sgf-application a:not(.btn):not(.nav-link):not(.page-link):not(.navbar-brand):hover,
.sgf-authentification a:hover { color: var(--sgf-bordeaux); }

.sgf-application .card,
.sgf-authentification .card {
    background: var(--sgf-blanc);
    border: 1px solid var(--sgf-bordure);
    box-shadow: 0 .15rem .55rem rgb(56 62 66 / 5%);
}
.sgf-application .card-header,
.sgf-application .card-footer { background: #f7f3ef; border-color: var(--sgf-bordure); }
.sgf-application .card-header { color: var(--sgf-anthracite); font-weight: 700; }
.sgf-application .lead { color: #555b5e; font-size: 1.08rem; }

.sgf-application .btn,
.sgf-authentification .btn { min-height: 2.55rem; font-weight: 600; }
.sgf-application .btn-primary,
.sgf-authentification .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #8a5427;
    --bs-btn-border-color: #8a5427;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #70421f;
    --bs-btn-hover-border-color: #70421f;
    --bs-btn-active-bg: #5b2f2c;
    --bs-btn-active-border-color: #5b2f2c;
    --bs-btn-disabled-bg: #8a5427;
    --bs-btn-disabled-border-color: #8a5427;
}
.sgf-application .btn-outline-primary,
.sgf-authentification .btn-outline-primary {
    --bs-btn-color: #75451f;
    --bs-btn-border-color: #8a5427;
    --bs-btn-hover-bg: #8a5427;
    --bs-btn-hover-border-color: #8a5427;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #5b2f2c;
    --bs-btn-active-border-color: #5b2f2c;
}
.sgf-application .btn-outline-secondary,
.sgf-authentification .btn-outline-secondary {
    --bs-btn-color: #383e42;
    --bs-btn-border-color: #73797c;
    --bs-btn-hover-bg: #383e42;
    --bs-btn-hover-border-color: #383e42;
    --bs-btn-hover-color: #fff;
}
.sgf-application .btn-danger,
.sgf-authentification .btn-danger { --bs-btn-bg: #a52a2a; --bs-btn-border-color: #a52a2a; }
.sgf-application .btn:disabled,
.sgf-application .btn.disabled,
.sgf-authentification .btn:disabled { opacity: .62; }

.sgf-application .form-label,
.sgf-authentification .form-label { color: var(--sgf-anthracite); font-weight: 600; }
.sgf-application .form-control,
.sgf-application .form-select,
.sgf-authentification .form-control,
.sgf-authentification .form-select {
    min-height: 2.7rem;
    color: #292d2f;
    border-color: var(--sgf-bordure-champ);
    background-color: #fff;
}
.sgf-application textarea.form-control,
.sgf-authentification textarea.form-control { min-height: 7rem; }
.sgf-application .form-control:focus,
.sgf-application .form-select:focus,
.sgf-authentification .form-control:focus,
.sgf-authentification .form-select:focus {
    border-color: var(--sgf-cuivre-accessible);
    box-shadow: 0 0 0 .22rem rgb(138 84 39 / 20%);
}
.sgf-application .form-text { color: #565c60; }
.sgf-application .form-check-input:checked { background-color: var(--sgf-cuivre-accessible); border-color: var(--sgf-cuivre-accessible); }
.sgf-application .form-check-input,
.sgf-authentification .form-check-input { border-color: var(--sgf-bordure-champ); }

.sgf-application .table { --bs-table-color: #303538; --bs-table-border-color: #dedbd8; font-size: .94rem; }
.sgf-application .table > :not(caption) > * > * { padding: .72rem .7rem; }
.sgf-application .table thead th {
    color: #fff;
    background: var(--sgf-anthracite);
    border-color: #555b5e;
    font-family: Verdana, Geneva, sans-serif;
    font-size: .86rem;
    font-weight: 700;
    vertical-align: middle;
}
.sgf-application .table thead a { color: #fff !important; }
.sgf-application .table tbody tr:hover > * { --bs-table-bg-state: #f4eee8; }
.sgf-application .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-striped-bg: #f7f5f3; }
.sgf-application .table-responsive { border-radius: .35rem; }
.sgf-application .table-responsive:focus-visible { outline: 3px solid var(--sgf-cuivre-accessible); outline-offset: 2px; }
.sgf-application .pagination { --bs-pagination-color: #75451f; --bs-pagination-hover-color: #5b2f2c; --bs-pagination-focus-color: #5b2f2c; --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgb(138 84 39 / 20%); --bs-pagination-active-bg: #5b2f2c; --bs-pagination-active-border-color: #5b2f2c; }

.sgf-application .badge { font-size: .78em; font-weight: 700; letter-spacing: .01em; }
.sgf-application .text-bg-warning { color: #33220e !important; background-color: #f0d7ad !important; }
.sgf-application .text-bg-info { color: #123b4a !important; background-color: #cde7ef !important; }
.sgf-application .text-bg-success { color: #164b2c !important; background-color: #d4ead9 !important; }
.sgf-application .text-bg-danger { color: #711d25 !important; background-color: #f1d3d5 !important; }
.sgf-application .text-bg-secondary { color: #303538 !important; background-color: #e4e5e5 !important; }
.sgf-application .alert { border-width: 1px; border-left-width: 4px; }
.sgf-application .alert-info { --bs-alert-color: #174353; --bs-alert-bg: #e3f1f5; --bs-alert-border-color: #9fcbd8; }
.sgf-application .alert-warning { --bs-alert-color: #51360d; --bs-alert-bg: #fbf1dc; --bs-alert-border-color: #e4c88c; }
.sgf-application .alert-success { --bs-alert-color: #205333; --bs-alert-bg: #e4f2e8; --bs-alert-border-color: #a9d2b4; }
.sgf-application .alert-danger { --bs-alert-color: #76252b; --bs-alert-bg: #f8e7e8; --bs-alert-border-color: #e3aeb2; }
.sgf-application .modal-content { border: 1px solid #cbc5c0; box-shadow: 0 .75rem 2.5rem rgb(0 0 0 / 22%); }
.sgf-application .modal-header { color: var(--sgf-anthracite); background: #f7f3ef; border-color: var(--sgf-bordure); }
.sgf-application .modal-title { font-family: "Playfair Display", Georgia, serif; font-weight: 600; }
.sgf-application .modal-footer { border-color: var(--sgf-bordure); }
.sgf-application :focus-visible,
.sgf-authentification :focus-visible,
.sgf-skip-link:focus { outline-color: #8a5427; }
.sgf-application .btn:focus-visible,
.sgf-authentification .btn:focus-visible {
    outline: 3px solid #8a5427;
    outline-offset: 2px;
    box-shadow: 0 0 0 .25rem rgb(138 84 39 / 24%);
}
.sgf-application header .btn:focus-visible { outline-color: #f3c894; }

.sgf-authentification {
    display: grid;
    align-items: center;
    background: linear-gradient(145deg, #eee5dd 0%, #f9f9f9 58%, #e8e2dc 100%);
}

.sgf-authentification .sgf-auth-card { overflow: hidden; border-top: 4px solid var(--sgf-cuivre); }
.sgf-authentification .sgf-auth-card > .card-body { padding: clamp(1.5rem, 5vw, 3rem) !important; }
.sgf-authentification .sgf-auth-card > .card-body > p:first-child {
    color: var(--sgf-anthracite) !important;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.2rem;
}

@media (min-width: 992px) {
    .sgf-application .sgf-sidebar { border-right: 1px solid #62676a; }
    .sgf-application .sgf-navigation { height: calc(100vh - 4.25rem); }
    .sgf-application main { padding-inline: clamp(1.5rem, 3vw, 3.25rem) !important; }
}
@media (max-width: 575.98px) {
    .sgf-application > header.navbar { min-height: 3.75rem; }
    .sgf-application .navbar-brand { font-size: 1.08rem; }
    .sgf-application main { padding: 1.25rem .9rem 2rem !important; }
    .sgf-application main > .d-flex { align-items: flex-start !important; }
    .sgf-application main > .d-flex > div { width: 100%; }
    .sgf-application main > .d-flex .btn { flex: 1 1 auto; }
    .sgf-application .table > :not(caption) > * > * { padding: .6rem .55rem; }
    .sgf-application .modal-dialog { margin: .5rem; }
    .sgf-application .modal-footer { gap: .5rem; }
    .sgf-application .modal-footer .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* UI-01B : contraste par contexte et sous-navigation indépendante du menu. */
.sgf-application header .btn-outline-secondary,
.sgf-application header .btn-outline-primary,
.sgf-navigation .btn-outline-secondary {
    --bs-btn-color: #fff;
    --bs-btn-border-color: #c4c5c6;
    --bs-btn-hover-color: #383e42;
    --bs-btn-hover-bg: #eee5dd;
    --bs-btn-hover-border-color: #eee5dd;
    --bs-btn-active-color: #383e42;
    --bs-btn-active-bg: #eee5dd;
    --bs-btn-active-border-color: #eee5dd;
}
.sgf-navigation .text-body-secondary { color: #f1eeeb !important; }
.sgf-navigation .btn:focus-visible,
.sgf-application header .btn:focus-visible { outline-color: #f3c894; }
.sgf-application .btn-sm { min-height: 2rem; }
.sgf-application .btn-primary { --bs-btn-focus-shadow-rgb: 138, 84, 39; }
.sgf-application .btn-outline-primary {
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #8a5427;
    --bs-btn-disabled-border-color: #8a5427;
    --bs-btn-focus-shadow-rgb: 138, 84, 39;
}
.sgf-application main .nav { --bs-nav-link-color: #8a5427; --bs-nav-link-hover-color: #5b2f2c; }
.sgf-application main .nav-pills { --bs-nav-pills-link-active-bg: #5b2f2c; --bs-nav-pills-link-active-color: #fff; }
.sgf-application main .nav-pills .nav-link { border: 1px solid var(--sgf-bordure); background: #fff; }
.sgf-application main .nav-pills .nav-link.active { color: #fff; background: #5b2f2c; border-color: #5b2f2c; }
.sgf-application main .nav-tabs { --bs-nav-tabs-link-active-color: #5b2f2c; --bs-nav-tabs-link-active-bg: #fff; --bs-nav-tabs-link-active-border-color: #dedbd8 #dedbd8 #fff; }
.sgf-application main .nav-tabs .nav-link.active { box-shadow: inset 0 3px #b17134; font-weight: 700; }
.sgf-application main .nav-link:hover:not(.active) { background-color: #eee5dd; }
.sgf-application .page-item.active .page-link { color: #fff; }
.sgf-application .form-check-input:focus { border-color: #8a5427; box-shadow: 0 0 0 .2rem rgb(138 84 39 / 20%); }
.sgf-application select[multiple] option:checked { color: #383e42; background: #eee5dd; font-weight: 700; }
.sgf-section-formulaire { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--sgf-bordure); }
.sgf-section-formulaire h2 { margin-bottom: 0; }
.sgf-libelle-aide { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.sgf-libelle-aide .form-label { margin-bottom: 0; }
.sgf-aide {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 1.65rem; height: 1.65rem; margin-left: .3rem; padding: 0;
    border: 1px solid #8a5427; border-radius: 50%; background: #fff; color: #8a5427;
    font: 700 .9rem/1 Verdana, Geneva, sans-serif; vertical-align: middle; cursor: help;
}
.sgf-aide:hover, .sgf-aide[aria-expanded="true"] { color: #fff; background: #8a5427; }
.sgf-popover-aide {
    --bs-popover-max-width: 23rem; --bs-popover-border-color: #dedbd8;
    --bs-popover-header-bg: #eee5dd; --bs-popover-header-color: #383e42;
    --bs-popover-body-color: #383e42; --bs-popover-bg: #fff;
    max-width: min(23rem, calc(100vw - 2rem)); box-shadow: 0 .4rem 1.25rem rgb(56 62 66 / 15%);
    font-family: Verdana, Geneva, sans-serif; line-height: 1.55;
}
.sgf-popover-aide .popover-header { font: 700 .95rem/1.4 Verdana, Geneva, sans-serif; }
.sgf-popover-aide .popover-body { overflow-wrap: anywhere; }
.sgf-referentiel-defilant { max-height: 28rem; overflow: auto; border: 1px solid var(--sgf-bordure); background: #fff; }
.sgf-referentiel-defilant .table { margin-bottom: 0; }
.sgf-referentiel-defilant .table thead th { position: sticky; top: 0; z-index: 1; color: #383e42; background: #eee5dd; border-color: #dedbd8; }
.sgf-referentiel-defilant .table thead a { color: #8a5427 !important; }
.sgf-referentiel-defilant td[colspan] { padding: 1.5rem; color: #565c60; }
.sgf-parametrage details > summary, .sgf-fiche details > summary { color: #8a5427; padding-block: .65rem; }
@media (max-width: 575.98px) {
    .sgf-application main .nav-pills .nav-link { padding: .55rem .7rem; }
    .sgf-referentiel-defilant { max-height: 23rem; }
}

/* UI-01C : actions pleines, hiérarchie conservée sans changer les contrats HTML. */
.sgf-application .btn-outline-primary, .sgf-authentification .btn-outline-primary {
    --bs-btn-color: var(--sgf-blanc); --bs-btn-bg: var(--sgf-bordeaux); --bs-btn-border-color: var(--sgf-bordeaux);
    --bs-btn-hover-color: var(--sgf-blanc); --bs-btn-hover-bg: #472321; --bs-btn-hover-border-color: #472321;
    --bs-btn-active-color: var(--sgf-blanc); --bs-btn-active-bg: #472321;
    --bs-btn-disabled-color: var(--sgf-blanc); --bs-btn-disabled-bg: var(--sgf-bordeaux);
}
.sgf-application .btn-outline-secondary, .sgf-authentification .btn-outline-secondary {
    --bs-btn-color: var(--sgf-blanc); --bs-btn-bg: var(--sgf-anthracite); --bs-btn-border-color: var(--sgf-anthracite);
    --bs-btn-hover-color: var(--sgf-anthracite); --bs-btn-hover-bg: var(--sgf-beige); --bs-btn-hover-border-color: #73797c;
    --bs-btn-active-color: var(--sgf-anthracite); --bs-btn-active-bg: var(--sgf-beige);
    --bs-btn-disabled-color: var(--sgf-blanc); --bs-btn-disabled-bg: var(--sgf-anthracite);
}
.sgf-application header .btn-outline-secondary, .sgf-navigation .btn-outline-secondary {
    --bs-btn-bg: var(--sgf-bordeaux); --bs-btn-border-color: #d6d2cf;
}
.sgf-application .btn-outline-danger, .sgf-authentification .btn-outline-danger,
.sgf-application .btn-danger, .sgf-authentification .btn-danger {
    --bs-btn-color: var(--sgf-blanc); --bs-btn-bg: #a52a2a; --bs-btn-border-color: #a52a2a;
    --bs-btn-hover-color: var(--sgf-blanc); --bs-btn-hover-bg: #822121; --bs-btn-hover-border-color: #822121;
    --bs-btn-active-color: var(--sgf-blanc); --bs-btn-active-bg: #822121;
    --bs-btn-disabled-color: var(--sgf-blanc); --bs-btn-disabled-bg: #a52a2a; --bs-btn-disabled-border-color: #a52a2a;
}
.sgf-aide {
    width: 24px; height: 24px; border: 3px solid transparent; background: var(--sgf-cuivre-accessible);
    background-clip: padding-box; color: var(--sgf-blanc); font-size: .75rem; line-height: 1;
}
.sgf-aide:hover, .sgf-aide[aria-expanded="true"] { background-color: var(--sgf-bordeaux); }
.sgf-mot-de-passe { flex-wrap: nowrap; }
.sgf-mot-de-passe > .form-control { min-width: 0; }
.sgf-mot-de-passe .sgf-voir-mot-de-passe { min-width: 44px; padding-inline: .65rem; }
.sgf-voir-mot-de-passe svg { width: 1.15rem; height: 1.15rem; }
.sgf-actions-mot-de-passe { margin-block: .75rem 1rem; }
.sgf-actions-mot-de-passe [role="status"] { margin: .4rem 0 0; font-size: .875rem; }
