/* =====================================================================
   Guichet — feuille de style (sobre, professionnelle, accessible).
   Contrastes conformes WCAG AA, navigation clavier visible, responsive.
   ===================================================================== */

:root {
    --c-bg:        #f4f6f9;
    --c-surface:   #ffffff;
    --c-text:      #1c2530;
    --c-muted:     #5a6673;
    --c-border:    #d5dbe2;
    --c-primary:   #1d4ed8;
    --c-primary-d: #1739a8;
    --c-focus:     #ff8a00;
    --radius:      10px;
    --shadow:      0 1px 3px rgba(20, 30, 45, .08), 0 4px 14px rgba(20, 30, 45, .06);
    --maxw:        1080px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--c-primary); }

/* Focus clavier visible partout (accessibilité). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

/* Lien d'évitement */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--c-primary);
    color: #fff;
    padding: .6rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* -------------------------------------------------- En-tête */
.app-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}
.app-header__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.app-header__brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--c-text);
    text-decoration: none;
}
.app-header__logo { display: block; width: 28px; height: 28px; flex: 0 0 auto; }
.app-nav { display: flex; gap: 1rem; margin-right: auto; }
.app-nav a {
    text-decoration: none;
    color: var(--c-muted);
    padding: .35rem .2rem;
    border-bottom: 2px solid transparent;
}
.app-nav a:hover { color: var(--c-text); border-bottom-color: var(--c-border); }
.app-header__user { display: flex; align-items: center; gap: .75rem; }
.app-header__name { color: var(--c-muted); font-size: .9rem; }
.inline-form { margin: 0; }

/* -------------------------------------------------- Contenu */
.app-main {
    flex: 1;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}
.app-footer {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    color: var(--c-muted);
    font-size: .85rem;
    text-align: center;
    padding: 1rem;
}

/* -------------------------------------------------- Messages flash */
.flash {
    border-radius: var(--radius);
    padding: .8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-weight: 500;
}
.flash--success { background: #e7f6ec; border-color: #9bd6ae; color: #14562b; }
.flash--error   { background: #fdecec; border-color: #f3b0b0; color: #8a1c1c; }
.flash--info    { background: #e8f0fe; border-color: #a9c5f5; color: #123a8a; }
.flash--warning { background: #fff4e0; border-color: #f0cd8a; color: #7a4d05; }

/* -------------------------------------------------- Boutons */
.btn {
    display: inline-block;
    font: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .6rem 1.2rem;
    cursor: pointer;
    text-decoration: none;
    background: #e9edf2;
    color: var(--c-text);
}
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-d); }
.btn--link {
    background: none;
    border: none;
    color: var(--c-primary);
    padding: .35rem;
    text-decoration: underline;
}

/* -------------------------------------------------- Connexion */
.auth {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth__card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}
.auth__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .25rem;
    font-size: 1.5rem;
}
.auth__logo { display: block; width: 40px; height: 40px; flex: 0 0 auto; }
.auth__subtitle { color: var(--c-muted); margin: 0 0 1.5rem; }

/* -------------------------------------------------- Formulaires */
.form__row { margin-bottom: 1.1rem; }
.form__row label {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
}
.form__help { display: block; color: var(--c-muted); font-size: .85rem; margin-top: .3rem; }
.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="number"],
.form input[type="date"],
.form select,
.form textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--c-text);
}
.form textarea { min-height: 120px; resize: vertical; }
.form__actions { margin-top: 1.5rem; }

/* Champ « pièce(s) jointe(s) » */
.form input[type="file"] {
    width: 100%;
    padding: .5rem;
    border: 1px dashed var(--c-border);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: var(--c-text);
}
.form__help--file { margin-top: .35rem; }

/* Liste des pièces jointes (détail / confirmation) */
.file-list { margin: 0; padding-left: 1.1rem; }
.file-list li { margin: .15rem 0; }

/* -------------------------------------------------- Accueil / tuiles */
.home__title { margin: .5rem 0 .25rem; font-size: 1.8rem; }
.home__intro { color: var(--c-muted); margin: 0 0 2rem; }
.tiles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.tile {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    height: 100%;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--c-text);
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.tile:hover {
    transform: translateY(-3px);
    border-color: var(--c-primary);
    box-shadow: 0 6px 20px rgba(20, 30, 45, .12);
}
.tile__icon { font-size: 2.2rem; }
.tile__title { font-size: 1.2rem; font-weight: 700; }
.tile__desc { color: var(--c-muted); font-size: .92rem; }

/* -------------------------------------------------- Tableau de bord (accueil) */
.dash__hero {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-d));
    color: #fff;
    border-radius: var(--radius);
    padding: 1.75rem 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}
.dash__hello { margin: 0 0 .35rem; font-size: 1.7rem; }
.dash__lead  { margin: 0; color: rgba(255, 255, 255, .9); }

.dash__section-title {
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--c-border);
}
.dash__section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dash__section-head .dash__section-title { flex: 1 1 auto; }
.dash__seeall { font-size: .9rem; white-space: nowrap; text-decoration: none; }
.dash__seeall:hover { text-decoration: underline; }

/* Cartes d'accès rapide : plus compactes que les tuiles de dépôt. */
.nav-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.nav-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.15rem;
    text-decoration: none;
    color: var(--c-text);
    height: 100%;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--c-primary);
    box-shadow: 0 6px 20px rgba(20, 30, 45, .12);
}
.nav-card__icon { font-size: 1.7rem; line-height: 1; flex: 0 0 auto; }
.nav-card__body { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 auto; }
.nav-card__title { font-weight: 700; }
.nav-card__desc  { color: var(--c-muted); font-size: .88rem; }
.nav-card__count {
    flex: 0 0 auto;
    min-width: 2.2rem;
    padding: .15rem .55rem;
    text-align: center;
    font-weight: 700;
    font-size: .95rem;
    color: var(--c-primary);
    background: #eaf0fe;
    border-radius: 999px;
}

/* -------------------------------------------------- Diagrammes (draw.io) */
.diagram-cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.diagram-card {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.15rem;
    flex-wrap: wrap;
}
.diagram-card__main {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--c-text);
    flex: 1 1 280px;
    min-width: 0;
}
.diagram-card__icon { font-size: 1.8rem; flex: 0 0 auto; }
.diagram-card__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.diagram-card__title { font-weight: 700; font-size: 1.05rem; }
.diagram-card__desc  { color: var(--c-muted); font-size: .9rem; }
.diagram-card__meta  { color: var(--c-muted); font-size: .82rem; }
.diagram-card__main:hover .diagram-card__title { text-decoration: underline; }
.diagram-card__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

/* Éditeur draw.io embarqué */
.diagram-editor__bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.diagram-editor__back { margin: 0 0 .25rem; }
.diagram-editor__title { margin: 0; font-size: 1.5rem; }
.diagram-editor__desc { margin: .25rem 0 0; color: var(--c-muted); }
.diagram-editor__actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.drawio-frame {
    width: 100%;
    height: 78vh;
    min-height: 480px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface);
}
.drawio-status { font-size: .9rem; color: var(--c-muted); }
.drawio-status--saving { color: var(--c-muted); }
.drawio-status--ok  { color: #14562b; }
.drawio-status--err { color: #b91c1c; }
.drawio-status--ro  {
    background: #eef2f7; color: var(--c-muted);
    padding: .2rem .6rem; border-radius: 999px; font-weight: 600;
}

/* -------------------------------------------------- Pages d'erreur */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-detail {
    text-align: left;
    background: #1c2530;
    color: #e6edf3;
    padding: 1rem;
    border-radius: 8px;
    overflow: auto;
    font-size: .8rem;
}
.empty { color: var(--c-muted); }

/* -------------------------------------------------- Administration */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-head--mt { margin-top: 2.5rem; }
.page-head__actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.req { color: #dc2626; }

/* Pleine page : le tableau occupe toute la largeur disponible. */
.app-main--wide { max-width: none; }

/* Barre d'outils au-dessus du tableau (filtre + sélecteur de colonnes). */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 1rem 0 .25rem;
}

/* Sélecteur de colonnes (menu déroulant natif <details>). */
.colpicker { position: relative; }
.colpicker > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.colpicker > summary::-webkit-details-marker { display: none; }
.colpicker > summary::after { content: " ▾"; }
.colpicker[open] > summary::after { content: " ▴"; }
.colpicker__menu {
    position: absolute;
    right: 0;
    z-index: 5;
    margin-top: .35rem;
    min-width: 240px;
    max-height: 60vh;
    overflow-y: auto;
    padding: .6rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.colpicker__actions {
    display: flex;
    gap: .75rem;
    padding: 0 .25rem .4rem;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--c-border);
}
.colpicker__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .92rem;
}
.colpicker__item:hover { background: #eef2f7; }

.table-filter {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 0;
}
.table-filter__input {
    flex: 1 1 260px;
    max-width: 420px;
    padding: .5rem .7rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font: inherit;
}
.table-filter__count { color: var(--c-muted); font-size: .9rem; }

.table-wrap { overflow-x: auto; max-height: 78vh; }
/* En-tête collant : la première ligne reste visible au défilement du tableau. */
.table-wrap .data-table thead th { position: sticky; top: 0; z-index: 1; }

/* Colonnes masquées via le sélecteur de colonnes. */
.data-table [hidden] { display: none; }

/* -------------------------------------------------- Tableau « style Excel »
   Reprend l'aspect du classeur Cartographie Infra GHT (style Excel « Medium 9 »,
   accent bleu) : en-tête bleu, lignes alternées, filets verticaux entre colonnes. */
.data-table--excel { border-color: #9dc3e6; }
.data-table--excel th,
.data-table--excel td {
    border-right: 1px solid #cfe0f3; /* filet vertical entre colonnes */
    white-space: nowrap;
}
.data-table--excel th:last-child,
.data-table--excel td:last-child { border-right: none; }
/* Colonnes « texte long » : retour à la ligne autorisé, largeur bornée. */
.data-table--excel td.col--wrap,
.data-table--excel th.col--wrap {
    white-space: normal;
    min-width: 16rem;
    max-width: 32rem;
    vertical-align: top;
}
.data-table--excel thead th {
    background: #5b9bd5;            /* bleu accent1 du classeur */
    color: #fff;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid #4a86c0;
    border-right-color: rgba(255, 255, 255, .4);
}
/* Bandes alternées : ligne impaire en bleu clair, paire en blanc. */
.data-table--excel tbody tr:nth-child(odd) td  { background: #ddebf7; }
.data-table--excel tbody tr:nth-child(even) td { background: #fff; }
.data-table--excel tbody tr:hover td { background: #c7dcf2; }
.data-table--excel code { background: rgba(255, 255, 255, .65); }

/* -------------------------------------------------- Filtre par colonne (Excel)
   Bouton entonnoir dans chaque en-tête + menu des valeurs distinctes. */
.th__cell { display: flex; align-items: flex-start; gap: .4rem; }
.th__label { flex: 1 1 auto; }
.th__filter {
    flex: 0 0 auto;
    border: 0;
    cursor: pointer;
    line-height: 1;
    font-size: .8rem;
    padding: .1rem .3rem;
    border-radius: 4px;
    color: #fff;
    background: rgba(0, 0, 0, .22);
}
.th__filter:hover  { background: rgba(0, 0, 0, .38); }
.th__filter:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* Colonne dont un filtre est actif : bouton mis en évidence (jaune Excel). */
.th__filter.is-filtered { background: #ffd966; color: #5b4a00; }
.th__filter.is-filtered::after { content: " ●"; font-size: .6em; vertical-align: middle; }

/* Panneau de filtre (ajouté au <body>, positionné sous le bouton). */
.colfilter {
    position: fixed;
    z-index: 1000;
    width: 16rem;
    max-width: calc(100vw - 1rem);
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #cbd2dc);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    padding: .6rem;
    font-weight: 400;
    color: var(--c-text, #222);
    text-transform: none;
    letter-spacing: normal;
}
.colfilter__search input { width: 100%; box-sizing: border-box; margin-bottom: .5rem; }
.colfilter__all {
    display: flex; align-items: center; gap: .45rem;
    font-weight: 600; padding: .2rem .1rem .4rem;
    border-bottom: 1px solid var(--c-border, #e2e6ec);
}
.colfilter__list {
    list-style: none; margin: .35rem 0; padding: 0;
    max-height: 15rem; overflow-y: auto;
}
.colfilter__item label {
    display: flex; align-items: center; gap: .45rem;
    padding: .2rem .1rem; cursor: pointer; white-space: normal;
}
.colfilter__item:hover { background: #eef2f7; }
.colfilter__item input { flex: 0 0 auto; width: auto; }
.colfilter__empty { color: var(--c-muted, #6b7280); font-style: italic; }
.colfilter__foot {
    display: flex; justify-content: space-between; align-items: center;
    gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--c-border, #e2e6ec);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: .5rem;
}
.data-table th,
.data-table td {
    text-align: left;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.data-table thead th {
    background: #eef2f7;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--c-muted);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table code { background: #eef2f7; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }
.data-table--muted { opacity: .8; }
.data-table__actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.reorder { display: flex; gap: .25rem; }

.badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
}
.badge--on  { background: #e7f6ec; color: #14562b; }
.badge--off { background: #f0f2f5; color: #5a6673; }
/* Champ réservé au traitement (form builder) : pastille discrète. */
.badge--reserved { background: #eef1fb; color: #3730a3; margin-left: .4rem; }
/* Rôles d'un compte local (gestion des utilisateurs). */
.badge--role  { background: #eef2f7; color: #3a4656; font-weight: 600; }
.badge--admin { background: #fdecef; color: #9f1239; }
/* Cases à cocher empilées dans un fieldset (rôles). */
fieldset.form__row { border: 1px solid var(--c-border, #dfe3ea); border-radius: 8px; padding: .85rem 1rem; }
fieldset.form__row legend { font-weight: 600; padding: 0 .35rem; }
fieldset.form__row .check { margin-top: .5rem; }

.btn--icon { padding: .3rem .55rem; line-height: 1; }
.btn--danger { color: #b91c1c; }

/* Zone de suppression (actions destructives) : encadré rouge discret. */
.danger-zone {
    margin-top: 2.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid #f0c7c7;
    border-radius: 8px;
    background: #fdf5f5;
}
.danger-zone p { color: var(--c-muted); margin: .25rem 0 1rem; }
.danger-zone .detail__section-title { margin-top: 0; color: #b91c1c; }

/* Champs réservés au traitement : encart éditable sur le détail d'une demande. */
.admin-fields {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid #d9def5;
    border-radius: 8px;
    background: #f6f8ff;
}
.admin-fields .detail__section-title { margin-top: 0; }
.admin-fields .form { max-width: 640px; }

.form--admin { max-width: 640px; }
.form__error { color: #b91c1c; font-size: .85rem; margin: .35rem 0 0; }
.form__row--check { margin-top: 1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.archived-title { margin-top: 2rem; }

/* -------------------------------------------------- Formulaires de demande */
.request-form__form { max-width: 680px; }
.request-form__form .form__row { margin-bottom: 1.3rem; }

.field-group {
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: .8rem 1rem 1rem;
    margin: 0;
}
.field-group legend { font-weight: 600; padding: 0 .35rem; }
.choices { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.choice { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.choice input { width: auto; }

/* État d'erreur d'un champ */
.form__row.has-error input,
.form__row.has-error select,
.form__row.has-error textarea,
.form__row.has-error .field-group {
    border-color: #dc2626;
    outline: 1px solid #dc2626;
}
.form__required-note { color: var(--c-muted); font-size: .9rem; }

/* Résumé d'erreurs en tête de formulaire */
.error-summary ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.error-summary a { color: #8a1c1c; }

/* -------------------------------------------------- Confirmation */
.confirmation { max-width: 720px; }
.confirmation__banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #e7f6ec;
    border: 1px solid #9bd6ae;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.confirmation__banner h1 { margin: 0 0 .25rem; font-size: 1.4rem; color: #14562b; }
.confirmation__banner p { margin: 0; color: #14562b; }
.confirmation__check {
    flex: none;
    width: 2.5rem; height: 2.5rem;
    display: grid; place-items: center;
    background: #16a34a; color: #fff;
    border-radius: 50%; font-size: 1.4rem; font-weight: 700;
}
.confirmation__ref {
    display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
    background: var(--c-surface);
    border: 1px dashed var(--c-primary);
    border-radius: var(--radius);
    padding: 1rem 1.5rem; margin: 1.5rem 0;
}
.confirmation__ref-label { color: var(--c-muted); text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; }
.confirmation__ref-value { font-size: 1.6rem; letter-spacing: .03em; color: var(--c-primary-d); }

.recap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 1.5rem;
}
.recap__row { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--c-border); }
.recap__row:last-child { border-bottom: none; }
.recap dt { color: var(--c-muted); font-weight: 600; margin: 0; }
.recap dd { margin: 0; }
@media (max-width: 560px) {
    .recap__row { grid-template-columns: 1fr; gap: .2rem; }
}

/* -------------------------------------------------- Suivi / filtres */
.filters {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
}
.filters--grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}
.filters__field { display: flex; flex-direction: column; gap: .3rem; }
.filters__field label { font-weight: 600; font-size: .85rem; color: var(--c-muted); }
.filters__field select,
.filters__field input {
    padding: .5rem .6rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--c-text);
}
.filters__actions {
    display: flex;
    gap: .5rem;
    align-items: end;
    flex-wrap: wrap;
}

/* -------------------------------------------------- Pagination */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.pager__info { color: var(--c-muted); font-size: .9rem; margin: 0; }
.pager__nav { display: flex; align-items: center; gap: .75rem; }
.pager__pos { color: var(--c-muted); font-size: .9rem; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------- Détail d'une demande */
.detail__ref { color: var(--c-muted); margin: .25rem 0 0; }
.detail__section-title { margin: 2rem 0 .5rem; font-size: 1.2rem; }
.badge--lg { font-size: .95rem; padding: .3rem .9rem; align-self: center; }

.status-form {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0 .5rem;
}
.status-form label { font-weight: 600; display: block; margin-bottom: .4rem; }
.status-form__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.status-form__row select {
    padding: .5rem .6rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--c-text);
    min-width: 200px;
}

/* Barre de gestion (statut + bouton Modifier) sur le détail d'une demande. */
.detail__manage-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}
.detail__manage-bar .status-form { flex: 1 1 auto; }
.detail__manage-bar > .btn { margin-bottom: .5rem; }

/* Libellé non interactif (champ affiché en lecture seule, ex. pièces jointes en édition). */
.form__label-static {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
}

/* -------------------------------------------------- Historique (timeline) */
.timeline { list-style: none; margin: .5rem 0 0; padding: 0; }
.timeline__item {
    position: relative;
    display: flex;
    gap: .8rem;
    padding: 0 0 1.1rem 0;
}
.timeline__dot {
    flex: none;
    width: .8rem; height: .8rem;
    margin-top: .35rem;
    border-radius: 50%;
    background: var(--c-primary);
    box-shadow: 0 0 0 3px #dbe4fb;
}
.timeline__item::before {
    content: "";
    position: absolute;
    left: .35rem; top: 1.2rem; bottom: 0;
    width: 2px;
    background: var(--c-border);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }
.timeline__body { padding-top: .1rem; }
.timeline__label { margin: 0; font-weight: 600; }
.timeline__meta { margin: .15rem 0 0; color: var(--c-muted); font-size: .85rem; }

/* -------------------------------------------------- Responsive */
@media (max-width: 640px) {
    .app-header__inner { gap: .75rem; }
    .app-nav { order: 3; width: 100%; }
    .app-header__user { margin-left: auto; }
}
