/* =========================================================================
   INFSS Scolarité — Couche premium des formulaires et des champs

   Chargée après app.css et smart-fields.css, cette feuille unifie et élève
   la présentation de toutes les saisies de l'application : anatomie des
   champs, états, icônes contextuelles, cases à cocher et interrupteurs,
   sections numérotées, barres d'actions, boutons hérités.

   Périmètre : uniquement les formulaires de saisie (formulaires POST qui
   contiennent des champs .field). Les tableaux de bord, registres, barres
   de filtres et la page de connexion — alignés au pixel sur les maquettes —
   ne sont pas touchés. Le préfixe :where() n'ajoute aucune spécificité :
   chaque règle garde la sienne et reste sous les réglages spécifiques des
   pages (ex. .reg-filter-grid).

   Aucun style en ligne (politique de sécurité stricte) ; jetons de app.css.
   ========================================================================= */

/* ------------------------------------------------------------- 1. Jetons */
:root {
    --pf-h: 46px;                 /* hauteur d'un contrôle standard */
    --pf-h-sm: 40px;              /* hauteur des filtres et barres d'outils */
    --pf-r: 12px;                 /* rayon des contrôles */
    --pf-line: #d9e3ea;           /* bordure au repos */
    --pf-line-hover: #b9cad6;     /* bordure au survol */
    --pf-fill: #ffffff;
    --pf-fill-soft: #f8fafc;
    --pf-inset: inset 0 1px 2px rgba(12, 40, 60, .04);
    --pf-ring: 0 0 0 4px var(--brand-50);
    --pf-ring-strong: 0 0 0 4px var(--brand-100);
    --pf-label: var(--ink-2);
    --pf-gap-x: 24px;
    --pf-gap-y: 20px;
    --pf-chip-r: 999px;
    --pf-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --pf-chevron-active: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230176cd' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --pf-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    --pf-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
    --pf-ic-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E");
    --pf-ic-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2'/%3E%3C/svg%3E");
    --pf-ic-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20.5c0-3.6 3.6-6 8-6s8 2.4 8 6'/%3E%3C/svg%3E");
    --pf-ic-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.7-6.5-11a6.5 6.5 0 0 1 13 0c0 5.3-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.4'/%3E%3C/svg%3E");
    --pf-ic-hash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9h14M5 15h14M10 4 8 20M16 4l-2 16'/%3E%3C/svg%3E");
    --pf-ic-id: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Ccircle cx='8.5' cy='11' r='2'/%3E%3Cpath d='M5.5 16c.5-1.5 1.7-2.2 3-2.2s2.5.7 3 2.2M14 10h4M14 13.5h4'/%3E%3C/svg%3E");
    --pf-ic-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='2.5'/%3E%3Cpath d='M3.5 9.5h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
    --pf-ic-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
    --pf-ic-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8393' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2.5'/%3E%3Cpath d='M8 10.5V8a4 4 0 0 1 8 0v2.5'/%3E%3Ccircle cx='12' cy='15.5' r='1.3'/%3E%3C/svg%3E");
}
[data-env="formation"] {
    --pf-chevron-active: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23d97b0f' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* =========================================================================
   A. Intérieur des formulaires de saisie
   ========================================================================= */
:where(
    form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form, .dash-filters, .reg-filter-grid, [data-premium="off"], .ad-page form, .au-page form, .st-page form, .hp-page form),
    .modal:has(.field):not(.ad-page *, .au-page *, .st-page *, .hp-page *),
    .drawer:has(.field),
    .install,
    .premium
) {

/* ------------------------------------------------- 2. Grilles de saisie */
.form-grid,
.formgrid {
    display: grid;
    gap: var(--pf-gap-y) var(--pf-gap-x);
    align-items: start;
}
.formgrid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.c1 { grid-template-columns: 1fr; }
.form-grid.c2, .formgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.c3, .formgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.c5 { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.form-grid > .field.span-2, .formgrid > .field.span-2 { grid-column: span 2; }
.form-grid > .field.span-3, .formgrid > .field.span-3 { grid-column: span 3; }
.form-grid > .field.span-full, .formgrid > .field.span-full { grid-column: 1 / -1; }

/* Une grille posée directement dans une carte (sans .card-body) respire. */
.card > .formgrid, .card > .form-grid { padding: 4px 22px 22px; }
.card > .title { padding: 18px 22px 0; }
.card > .formgrid + .title { padding-top: 6px; }
.card-body > .formgrid, .card-body > .form-grid { padding: 0; }

@media (max-width: 1180px) {
    .form-grid, .form-grid.c4, .form-grid.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.c3, .formgrid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .form-grid, .form-grid.c2, .form-grid.c3, .form-grid.c4, .form-grid.c5,
    .formgrid, .formgrid.two, .formgrid.three { grid-template-columns: 1fr; }
    .form-grid > .field.span-2, .formgrid > .field.span-2,
    .form-grid > .field.span-3, .formgrid > .field.span-3 { grid-column: auto; }
    & { --pf-gap-x: 16px; --pf-gap-y: 16px; }
}

/* ------------------------------------------------ 3. Anatomie d'un champ */
.field { min-width: 0; position: relative; }

.field > label,
.field .form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font: 700 12.75px/1.35 var(--font);
    letter-spacing: .01em;
    color: var(--pf-label);
    transition: color .15s var(--ease);
}
.field:focus-within > label { color: var(--brand-600); }
.field .req {
    display: inline-block;
    width: 6px; height: 6px;
    margin-left: 1px;
    border-radius: 50%;
    background: var(--pink-600);
    font-size: 0;
    line-height: 0;
    vertical-align: middle;
    transform: translateY(-1px);
}

/* Contrôles — spécificité (0,3,1) : au-dessus de app.css, en dessous des
   réglages de page comme .reg-filter-grid .field input. */
.control,
.field input:where(:not([type="range"]):not([type="file"]):not(.sf-native)):not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
    width: 100%;
    height: var(--pf-h);
    padding: 0 14px;
    background: var(--pf-fill);
    border: 1px solid var(--pf-line);
    border-radius: var(--pf-r);
    box-shadow: var(--pf-inset);
    color: var(--ink);
    font: 500 14.25px/1.3 var(--font);
    outline: 0;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease);
}
.field input:not([type="checkbox"]):not([type="radio"]):hover,
.field select:hover,
.field textarea:hover,
.control:hover { border-color: var(--pf-line-hover); }

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus,
.control:focus {
    border-color: var(--brand-400);
    box-shadow: var(--pf-ring), var(--pf-inset);
    background: #fff;
}
.field input::placeholder, .field textarea::placeholder, .control::placeholder { color: var(--muted-2); font-weight: 400; }
.field input:disabled, .field select:disabled, .field textarea:disabled,
.field input[readonly], .field textarea[readonly] {
    background: var(--pf-fill-soft);
    color: var(--body);
    border-style: dashed;
    box-shadow: none;
    cursor: not-allowed;
}
.field input[readonly] { cursor: text; }

/* Zone de texte */
.field textarea { height: auto; min-height: 118px; padding: 12px 14px; line-height: 1.6; resize: vertical; }

/* Sélecteur natif */
.field select {
    appearance: none;
    cursor: pointer;
    padding-right: 42px;
    background-image: var(--pf-chevron);
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 18px;
}
.field select:focus { background-image: var(--pf-chevron-active); }
.field select:has(option[value=""]:checked) { color: var(--muted); }
.field select option { color: var(--ink); }

/* Nombres : pas de molettes natives */
.field input[type="number"] { appearance: textfield; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Champ natif de date non converti : l'indicateur natif s'efface derrière
   le bouton calendrier des champs intelligents. */
.field .sf-control.has-tools > input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.field input[type="date"], .field input[type="time"], .field input[type="month"] { font-variant-numeric: tabular-nums; }

/* Unité affichée dans le champ : <div class="field" data-unit="%"> —
   premium.js recopie l'attribut sur l'enveloppe .sf-control. */
.sf-control[data-unit]::after {
    content: attr(data-unit);
    position: absolute; right: 14px; top: 0; height: var(--pf-h);
    display: flex; align-items: center;
    font-size: 12.5px; font-weight: 700; color: var(--muted); pointer-events: none;
}
.sf-control[data-unit] > input { padding-right: 44px; }
.sf-control[data-unit].has-status .sf-status { right: 40px; }

/* Indices, erreurs, notes */
.field .hint { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 7px; }
.field .field-error, .field .error.is-shown { margin-top: 7px; }
.field.has-error > label { color: var(--red-700); }
.field.has-error input:not([type="checkbox"]):not([type="radio"]),
.field.has-error select,
.field.has-error textarea { border-color: var(--sf-err-line); background: var(--sf-err-bg); }
.field.has-error input:focus, .field.has-error select:focus, .field.has-error textarea:focus {
    border-color: var(--red); box-shadow: var(--sf-ring-err), var(--pf-inset);
}
.field.is-valid input:not([type="checkbox"]):not([type="radio"]),
.field.is-valid select,
.field.is-valid textarea { border-color: var(--sf-ok-line); }

/* Champ modifié depuis le chargement : point discret après l'intitulé. */
.field.is-dirty > label::after {
    content: '';
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--brand-400);
    margin-left: 2px;
    opacity: .9;
}

/* Bouton d'aide contextuelle « ? » */
.sf-help {
    width: 17px; height: 17px; padding: 0; margin-left: 1px;
    border: 1px solid var(--pf-line); border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font: 800 10.5px/1 var(--font);
    display: inline-grid; place-items: center;
    cursor: help;
    transition: all .14s var(--ease);
}
.sf-help:hover, .sf-help:focus-visible { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); outline: 0; }

/* ------------------------------------------ 4. Icônes contextuelles */
/* L'enveloppe .sf-control est posée par smart-fields.js ; l'icône est un
   pseudo-élément choisi selon le type détecté, sans modifier les vues. */
.field .sf-control::before {
    content: none;
    position: absolute; left: 14px; top: 14px;
    width: 18px; height: 18px;
    background-repeat: no-repeat; background-size: 18px; background-position: center;
    opacity: .78; pointer-events: none;
    transition: opacity .15s var(--ease);
}
.field .sf-control:focus-within::before { opacity: 1; }
.field .sf-control:has(> input[data-sf-type="email"])::before { content: ''; background-image: var(--pf-ic-mail); }
.field .sf-control:has(> input[data-sf-type="phone"])::before { content: ''; background-image: var(--pf-ic-phone); }
.field .sf-control:has(> input[data-sf-type="name"])::before { content: ''; background-image: var(--pf-ic-user); }
.field .sf-control:has(> input[data-sf-type="place"])::before { content: ''; background-image: var(--pf-ic-pin); }
.field .sf-control:has(> input[data-sf-type="matricule"])::before,
.field .sf-control:has(> input[data-sf-type="reference"])::before { content: ''; background-image: var(--pf-ic-hash); }
.field .sf-control:has(> input[data-sf-type="nina"])::before,
.field .sf-control:has(> input[data-sf-type="identifier"])::before { content: ''; background-image: var(--pf-ic-id); }
.field .sf-control:has(> input[data-sf-type="date-fr"])::before { content: ''; background-image: var(--pf-ic-cal); }
.field .sf-control:has(> input[data-sf-type="search"])::before { content: ''; background-image: var(--pf-ic-search); }
.field .sf-control:has(> input[data-sf-type^="password"])::before { content: ''; background-image: var(--pf-ic-lock); }

.field .sf-control > input[data-sf-type="email"],
.field .sf-control > input[data-sf-type="phone"],
.field .sf-control > input[data-sf-type="name"],
.field .sf-control > input[data-sf-type="place"],
.field .sf-control > input[data-sf-type="matricule"],
.field .sf-control > input[data-sf-type="nina"],
.field .sf-control > input[data-sf-type="identifier"],
.field .sf-control > input[data-sf-type="date-fr"],
.field .sf-control > input[data-sf-type="search"],
.field .sf-control > input[data-sf-type="reference"],
.field .sf-control > input[data-sf-type^="password"] { padding-left: 42px !important; }
/* Les gabarits qui posent déjà leur icône (.input-icon) gardent la main. */
.input-icon .sf-control::before { content: none !important; }
.input-icon .sf-control > input { padding-left: 44px !important; }

/* Pastille d'état et outils alignés sur la hauteur premium */
.sf-status { top: calc(var(--pf-h) / 2); }
.sf-control.is-textarea .sf-status { top: 24px; }
.sf-tools { top: calc(var(--pf-h) / 2); }

/* -------------------------------------------- 5. Cases, boutons radio */
input[type="checkbox"]:where(:not(table *)):not(.switch input),
input[type="radio"]:where(:not(table *)) {
    appearance: none;
    -webkit-appearance: none;
    width: 19px; height: 19px;
    margin: 0;
    flex: 0 0 auto;
    border: 1.5px solid #b9cad6;
    border-radius: 6px;
    background: #fff;
    display: inline-grid; place-items: center;
    vertical-align: middle;
    cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
input[type="radio"]:where(:not(table *)) { border-radius: 50%; }
input[type="checkbox"]:where(:not(table *)):hover, input[type="radio"]:where(:not(table *)):hover { border-color: var(--brand-400); }
input[type="checkbox"]:where(:not(table *)):focus-visible, input[type="radio"]:where(:not(table *)):focus-visible { outline: 0; box-shadow: var(--pf-ring); border-color: var(--brand-400); }
input[type="checkbox"]:where(:not(table *)):active, input[type="radio"]:where(:not(table *)):active { transform: scale(.94); }
input[type="checkbox"]:where(:not(table *)):not(.switch input):checked {
    background: var(--brand-450) var(--pf-check) center / 15px no-repeat;
    border-color: var(--brand-450);
}
input[type="checkbox"]:where(:not(table *)):indeterminate {
    background: var(--brand-450) var(--pf-dash) center / 15px no-repeat;
    border-color: var(--brand-450);
}
input[type="radio"]:where(:not(table *)):checked { border: 6px solid var(--brand-450); background: #fff; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }
.switch input[type="checkbox"] { appearance: none; width: 0; height: 0; border: 0; position: absolute; opacity: 0; }

/* Étiquette de case */
.check {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 36px; padding: 0 2px;
    font-size: 13.5px; font-weight: 500; color: var(--ink-2);
    cursor: pointer; border-radius: var(--r-sm);
    transition: color .14s var(--ease);
}
.check:hover { color: var(--ink); }
.check:has(input:checked) { color: var(--brand-700); font-weight: 600; }
.check:has(input:disabled) { color: var(--muted); cursor: not-allowed; }

/* Groupe de cases → jetons sélectionnables (sites, départements, canaux…) */
.ad-checks, .check-group, .chips-check {
    display: flex; flex-wrap: wrap; gap: 8px 8px;
    margin-top: 2px;
}
.ad-checks .check, .check-group .check, .chips-check .check {
    min-height: 36px; padding: 0 13px 0 10px; gap: 8px;
    border: 1px solid var(--pf-line); border-radius: var(--pf-chip-r);
    background: var(--surface); font-size: 13px; font-weight: 600; color: var(--body);
    transition: all .15s var(--ease);
}
.ad-checks .check:hover, .check-group .check:hover, .chips-check .check:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-700); }
.ad-checks .check:has(input:checked), .check-group .check:has(input:checked), .chips-check .check:has(input:checked) {
    border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-700);
    box-shadow: 0 0 0 1px var(--brand-100) inset;
}
.ad-checks .check input, .check-group .check input, .chips-check .check input { width: 16px; height: 16px; border-radius: 5px; }

/* Case pleine largeur de confirmation */
.field-inline {
    border-radius: var(--pf-r); padding: 14px 16px;
    background: var(--pf-fill-soft); border: 1px solid var(--pf-line);
}
.field-inline:has(input:checked) { border-color: var(--sf-ok-line); background: var(--sf-ok-bg); }
.field-inline label { font-weight: 500; }

/* Interrupteur */
.switch .track { width: 44px; height: 25px; background: #cbd8e0; box-shadow: inset 0 1px 2px rgba(12, 40, 60, .12); }
.switch .track::after { width: 19px; height: 19px; box-shadow: 0 1px 3px rgba(12, 40, 60, .25); }
.switch input:checked + .track { background: var(--green-600); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch:hover .track { filter: brightness(.97); }
.switch-row { width: 100%; justify-content: space-between; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.switch-row > span:first-child small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.switch-row > span:last-child { display: inline-flex; align-items: center; }

/* ------------------------------------------------ 6. Sections & cartes */
.card { border-radius: 18px; }
.card + .card, .card.mt { margin-top: 18px; }

.card > .title, h2.title, h3.title {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 18px;
    font: 800 15.5px/1.3 var(--font-title); color: var(--ink);
}
.card > .title::before {
    content: '';
    width: 4px; height: 18px; flex: 0 0 auto;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cyan), var(--brand-450));
}
/* Numérotation automatique quand le formulaire compte plusieurs sections */
&:is(form):has(.card ~ .card > .title), & form:has(.card ~ .card > .title) { counter-reset: pf-section; }
&:is(form):has(.card ~ .card > .title) .card > .title::before,
& form:has(.card ~ .card > .title) .card > .title::before {
    counter-increment: pf-section;
    content: counter(pf-section, decimal-leading-zero);
    width: 28px; height: 28px; border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    color: var(--brand-600);
    font: 800 11.5px/1 var(--font);
    letter-spacing: .02em;
}
.card > .title .sub { margin-left: 4px; font: 600 12.5px/1.3 var(--font); color: var(--muted); }

.card-head { background: linear-gradient(180deg, #fbfcfd, #fff); border-radius: 18px 18px 0 0; }

.fieldset { border-radius: 14px; border-color: var(--pf-line); padding: 20px 22px 18px; background: var(--pf-fill-soft); }
.fieldset > legend { font: 800 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--brand-600); padding: 0 8px; }

/* -------------------------------------------------- 7. Barres d'actions */
.form-actions {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--line-2);
}
.form-actions .spacer { flex: 1 1 auto; }
.form-actions .sf-progress { margin-left: auto; }
.card > .form-actions { padding: 16px 22px 20px; margin-top: 8px; }

/* Barre épinglée par premium.js sur les formulaires longs */
.form-actions.is-sticky {
    position: sticky; bottom: 0; z-index: 8;
    padding: 14px 0;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px -18px rgba(12, 40, 60, .35);
}

/* ----------------------------------------------------------- 8. Boutons */
.btn {
    height: var(--pf-h);
    padding: 0 20px;
    border-radius: var(--pf-r);
    font-weight: 700;
    letter-spacing: .005em;
    transition: transform .12s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--pf-ring-strong); }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 26px; border-radius: 14px; }
.btn-icon { width: var(--pf-h); padding: 0; }

.btn-primary, .btn.primary {
    background: linear-gradient(180deg, var(--brand-400), var(--brand-450) 55%, var(--brand-500));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(1, 47, 73, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover, .btn.primary:hover {
    background: linear-gradient(180deg, var(--brand-450), var(--brand-500));
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(1, 47, 73, .45), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-outline, .btn.secondary {
    background: var(--surface); border: 1px solid var(--pf-line); color: var(--ink-2);
    box-shadow: var(--sh-xs);
}
.btn-outline:hover, .btn.secondary:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.btn-ghost, .btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover, .btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger, .btn.danger { background: var(--surface); border: 1px solid #f3b9bb; color: var(--red-700); }
.btn-danger:hover, .btn.danger:hover { background: var(--red-50); border-color: #ea9b9e; }
.btn-success { background: linear-gradient(180deg, var(--green), var(--green-600)); border-color: transparent; }
.btn .ic { flex: 0 0 auto; }

/* ------------------------------------------------ 9. Robustesse du secret */
.sf-rules {
    display: flex; flex-wrap: wrap; gap: 6px 10px;
    margin: 10px 0 0; padding: 0; list-style: none;
}
.sf-rules li {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px 5px 8px;
    border: 1px solid var(--pf-line); border-radius: var(--pf-chip-r);
    background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted);
    transition: all .15s var(--ease);
}
.sf-rules li.is-met { border-color: var(--sf-ok-line); background: var(--sf-ok-bg); color: var(--sf-ok); }
.sf-strength { margin-top: 10px; }

/* ---------------------------------------------- 10. Listes filtrables */
.sf-combo-btn { height: var(--pf-h); border-radius: var(--pf-r); border-color: var(--pf-line); box-shadow: var(--pf-inset); font-weight: 500; }
.sf-combo-btn:hover { border-color: var(--pf-line-hover); }
.sf-combo-btn[aria-expanded="true"] { border-color: var(--brand-400); box-shadow: var(--pf-ring), var(--pf-inset); }
.sf-combo-pop { border-radius: 14px; }

/* Raccourcis rapides sous un champ (années, jours…) */
.sf-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sf-quick button {
    height: 28px; padding: 0 11px;
    border: 1px solid var(--pf-line); border-radius: var(--pf-chip-r);
    background: var(--surface); color: var(--body);
    font: 600 12px/1 var(--font); cursor: pointer;
    transition: all .14s var(--ease);
}
.sf-quick button:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }
.sf-quick button.is-active { border-color: var(--brand-400); background: var(--brand-100); color: var(--brand-700); }
.sf-fact { border-radius: 10px; }

/* ---------------------------------------------- 11. Zones de dépôt */
.sf-drop { border-radius: 16px; border-style: dashed; }
.sf-drop:hover, .sf-drop.is-over { border-color: var(--brand-400); background: var(--brand-50); }

/* --------------------------------------------- 12. Petites finitions */
.field .sf-note { font-size: 12.5px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; }

} /* fin du périmètre A */

/* =========================================================================
   B. Carte qui enveloppe un formulaire (titre à l'extérieur du <form>)
   ========================================================================= */
:where(.card:has(> form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form)):not(.ad-page *, .au-page *, .st-page *, .hp-page *), .premium .card) {
    border-radius: 18px;
}
:where(.card:has(> form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form)):not(.ad-page *, .au-page *, .st-page *, .hp-page *), .premium .card) > .title,
:where(.card:has(> form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form)):not(.ad-page *, .au-page *, .st-page *, .hp-page *), .premium .card) > form > .title {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 18px;
    font: 800 15.5px/1.3 var(--font-title); color: var(--ink);
}
:where(.card:has(> form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form)):not(.ad-page *, .au-page *, .st-page *, .hp-page *), .premium .card) > .title::before,
:where(.card:has(> form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form)):not(.ad-page *, .au-page *, .st-page *, .hp-page *), .premium .card) > form > .title::before {
    content: '';
    width: 4px; height: 18px; flex: 0 0 auto;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cyan), var(--brand-450));
}
:where(.card:has(> form:where([method="post" i], [data-premium]):has(.field):not(.auth form, .auth-card form)):not(.ad-page *, .au-page *, .st-page *, .hp-page *), .premium .card) > .title.mt-xs { margin-top: 6px; } .mt-sm { margin-top: 10px; } .mt-md { margin-top: 14px; } .mt-lg { margin-top: 22px; } .mb-md { margin-bottom: 14px; } .mb-lg { margin-bottom: 16px; }
.pointer { cursor: pointer; }
.center-title { justify-content: center; }
.card-narrow { max-width: 640px; margin: 0 auto; }
.switch-row { width: 100%; justify-content: space-between; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.switch-row > span:first-child small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.switch-row > span:last-child { display: inline-flex; align-items: center; }
/* Authentification forte : codes de secours, QR, clé manuelle */
.recovery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mono-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; font-weight: 700; letter-spacing: 1px; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink); }
.mono-box.is-key { text-align: left; }
.qr-box { width: 200px; height: 200px; margin: 0 auto; display: block; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.steps-list { line-height: 2; padding-left: 18px; margin: 0; }

/* =========================================================================
   C. Règles génériques (hors pages alignées : elles utilisent leurs propres
   classes .reg-*, .dash-*, .db-*)
   ========================================================================= */
.mt-xs { margin-top: 6px; } .mt-sm { margin-top: 10px; } .mt-md { margin-top: 14px; } .mt-lg { margin-top: 22px; } .mb-md { margin-bottom: 14px; } .mb-lg { margin-bottom: 16px; }
.pointer { cursor: pointer; }
.center-title { justify-content: center; }
.card-narrow { max-width: 640px; margin: 0 auto; }
.switch-row { width: 100%; justify-content: space-between; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.switch-row > span:first-child small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.switch-row > span:last-child { display: inline-flex; align-items: center; }
/* Authentification forte : codes de secours, QR, clé manuelle */
.recovery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mono-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; font-weight: 700; letter-spacing: 1px; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink); }
.mono-box.is-key { text-align: left; }
.qr-box { width: 200px; height: 200px; margin: 0 auto; display: block; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.steps-list { line-height: 2; padding-left: 18px; margin: 0; }

:where(.shell) .filter-bar { padding: 18px 22px; border-radius: 18px; }
:where(.shell) .filter-bar .field > label { font-size: 12px; margin-bottom: 6px; }
:where(.shell) .filter-bar .field input:where(:not(.sf-native)):not([type="checkbox"]):not([type="radio"]),
:where(.shell) .filter-bar .field select,
:where(.shell) .filter-bar .control {
    height: var(--pf-h-sm); border-radius: 10px; font-size: 13.5px;
    border-color: var(--pf-line); box-shadow: var(--pf-inset);
}
:where(.shell) .filter-bar .field input:focus, :where(.shell) .filter-bar .field select:focus {
    border-color: var(--brand-400); box-shadow: var(--pf-ring), var(--pf-inset);
}
:where(.shell) .filter-bar .sf-status, :where(.shell) .filter-bar .sf-tools { top: calc(var(--pf-h-sm) / 2); }
:where(.shell) .filter-bar .btn { height: var(--pf-h-sm); border-radius: 10px; }
:where(.shell) .filter-bar .sf-combo-btn { height: var(--pf-h-sm); border-radius: 10px; }

/* Page d'erreur (gabarit blank) */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.error-card { max-width: 620px; width: 100%; text-align: center; padding: 38px 30px; border-radius: 22px; }
.error-logo { height: 56px; margin: 0 auto 24px; display: block; }
.error-code { font: 800 52px/1 var(--font-title); color: var(--teal); letter-spacing: -.02em; }
.error-title { margin: 10px 0 12px; font: 800 24px/1.25 var(--font-title); color: var(--ink); }
.error-text { max-width: 460px; margin: 0 auto 22px; line-height: 1.7; color: var(--body); }
.error-notice { text-align: left; margin-bottom: 20px; }
.error-actions { justify-content: center; }
.error-ref { margin-top: 24px; }
.error-trace { margin-top: 20px; text-align: left; }
.error-pre { overflow: auto; font-size: 11px; background: var(--surface-2); padding: 14px; border-radius: 10px; margin-top: 10px; }

/* Tables des grilles et maquettes (vues grades/grid, curriculum/program) */
.table .center { text-align: center; }
.table .row-group td { background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.grade-cell.is-absent { background: var(--sf-warn-bg); border-color: var(--sf-warn-line); }
.grade-cell:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* =========================================================================
   D. Tableaux et listes
   Même logique que les formulaires : la couche s'applique à toutes les pages
   de la coquille sauf celles alignées au pixel sur les maquettes, repérées
   par leur conteneur racine (.reg, .dos, .dash) ou par data-premium="off".
   Les gabarits denses (.ad-table, .au-table, .adm-grid, .table-teachers,
   .st-table) conservent leurs dimensions : seule l'apparence est harmonisée.
   ========================================================================= */
/* Modules pilotés par une autre session (Administration, maquettes 21-23 ; centre
   d'aide, maquette 24) : exclus pour ne pas interférer avec leur alignement. */
:where(main.content:not(:has(> .reg, > .dos, > .dash, > [data-premium="off"], > .ad-page, > .au-page, > .st-page, > .hp-page, > [class^="hp-"]))) {

/* ------------------------------------------------ 1. Conteneur du tableau */
.table-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #c9d6df transparent;
    border-radius: inherit;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #c9d6df; border-radius: 8px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.card > .table-wrap:first-child, .card > form > .table-wrap:first-child { border-radius: 18px 18px 0 0; }
.card > .table-wrap:last-child { border-radius: 0 0 18px 18px; }

/* ------------------------------------------------------- 2. En-têtes */
.table thead th,
.ad-table thead th,
.au-table thead th {
    font-family: var(--font);
    font-weight: 800;
    color: var(--muted);
    background: linear-gradient(180deg, #f8fafc, #f3f6f9);
    border-bottom: 1px solid var(--line);
}
/* Capitales espacées réservées aux tableaux standards : les gabarits denses
   (enseignants, utilisateurs, matrices) gardent leurs largeurs de colonnes. */
.table:not(.table-teachers):not(.adm-grid):not(.st-table):not(.pivot) thead th {
    font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    height: 46px; padding-top: 0; padding-bottom: 0; vertical-align: middle;
}
.table th .sort, .ad-table th .sort {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 8px; margin: -4px -8px;
    border-radius: 8px; color: inherit;
    transition: background .14s var(--ease), color .14s var(--ease);
}
.table th .sort:hover, .ad-table th .sort:hover { background: var(--brand-50); color: var(--brand-600); text-decoration: none; }
.table th[aria-sort] .sort, .ad-table th[aria-sort] .sort { color: var(--brand-600); background: var(--brand-50); }

/* --------------------------------------------------------- 3. Lignes */
.table:not(.table-teachers):not(.adm-grid):not(.st-table) tbody td { padding: 14px 16px; font-size: 13.5px; line-height: 1.45; border-bottom: 1px solid var(--line-2); }
.table tbody tr, .ad-table tbody tr, .au-table tbody tr { transition: background .14s var(--ease), box-shadow .14s var(--ease); }
.table tbody tr:hover, .ad-table tbody tr:hover, .au-table tbody tr:hover { background: #f6fafd; }
.table tbody tr:hover td:first-child, .ad-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand-300); }
.table tbody tr.is-selected, .ad-table tbody tr.is-current { background: var(--brand-50); }
.table tbody tr.is-selected td:first-child, .ad-table tbody tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--brand-450); }
.table tbody tr:has(input[type="checkbox"]:checked) { background: var(--brand-50); }
.table tbody tr:has(input[type="checkbox"]:checked) td:first-child { box-shadow: inset 3px 0 0 var(--brand-450); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Première colonne : identifiant, nom ou lien principal mis en avant */
.table:not(.table-teachers):not(.adm-grid):not(.st-table):not(.pivot) tbody td:first-child { font-weight: 600; color: var(--ink); }
.table tbody td:first-child .mono, .table tbody td .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px; letter-spacing: .01em;
}
.table tbody td:first-child a.mono, .table tbody td a.mono {
    display: inline-block; padding: 2px 8px; border-radius: 7px;
    background: var(--surface-2); color: var(--brand-600); font-weight: 700;
    transition: background .14s var(--ease), color .14s var(--ease);
}
.table tbody td a.mono:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.table .num, .ad-table .ad-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.table .muted { font-weight: 400; }
.table tfoot td { font-weight: 700; color: var(--ink); background: var(--surface-2); border-top: 2px solid var(--line); }

/* Personne dans une cellule */
.cell-person { gap: 12px; }
.cell-person .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.cell-person .person-name { font-weight: 700; color: var(--ink); }
.cell-person .person-sub { font-size: 12px; color: var(--muted); }

/* Pastilles et étiquettes dans les tableaux */
.table .badge, .ad-table .badge { font-weight: 700; letter-spacing: .01em; }
.table .tag, .ad-table .tag { font-weight: 700; }

/* Actions de ligne : boutons ronds révélés au survol */
.row-actions { gap: 2px; }
.row-action {
    width: 34px; height: 34px; border-radius: 10px;
    color: var(--muted-2); opacity: .75;
    transition: background .14s var(--ease), color .14s var(--ease), opacity .14s var(--ease), transform .12s var(--ease);
}
tr:hover .row-action { opacity: 1; }
.row-action:hover { background: var(--brand-50); color: var(--brand-600); transform: translateY(-1px); text-decoration: none; }
.row-action.danger:hover { background: var(--red-50); color: var(--red-700); }
.row-action:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 1px; opacity: 1; }

/* Cases de sélection en tête et en ligne */
.table .check-col input[type="checkbox"],
.table input[type="checkbox"][data-role="row-select"],
.table input[type="checkbox"][data-action="select-all"] {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px; margin: 0;
    border: 1.5px solid #b9cad6; border-radius: 5px; background: #fff;
    display: inline-grid; place-items: center; vertical-align: middle; cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.table .check-col input[type="checkbox"]:hover, .table input[type="checkbox"][data-role="row-select"]:hover { border-color: var(--brand-400); }
.table .check-col input[type="checkbox"]:checked,
.table input[type="checkbox"][data-role="row-select"]:checked,
.table input[type="checkbox"][data-action="select-all"]:checked {
    background: var(--brand-450) var(--pf-check) center / 14px no-repeat; border-color: var(--brand-450);
}
.table input[type="checkbox"][data-action="select-all"]:indeterminate {
    background: var(--brand-450) var(--pf-dash) center / 14px no-repeat; border-color: var(--brand-450);
}
.table .check-col input[type="checkbox"]:focus-visible { outline: 0; box-shadow: var(--pf-ring); }

/* Tableau croisé */
.pivot tbody tr:nth-child(even) { background: #fbfcfd; }
.pivot tbody tr:hover { background: #f6fafd; }

/* ------------------------------------------------ 4. Pied de tableau */
.table-foot, .ad-table-foot {
    padding: 14px 22px; gap: 16px;
    border-top: 1px solid var(--line-2);
    background: linear-gradient(180deg, #fff, #fbfcfd);
    border-radius: 0 0 18px 18px;
}
.table-foot .count, .ad-count { font-size: 12.75px; color: var(--muted); font-weight: 500; }
.table-foot .count b, .ad-count b { color: var(--ink); font-weight: 700; }

.pagination { gap: 6px; }
.pagination a, .pagination span {
    min-width: 36px; height: 36px; border-radius: 10px;
    font-size: 13px; font-weight: 700; color: var(--ink-2);
    border: 1px solid var(--pf-line); background: var(--surface);
    box-shadow: var(--sh-xs);
    transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease), transform .12s var(--ease);
}
.pagination a:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); transform: translateY(-1px); text-decoration: none; }
.pagination .is-current {
    background: linear-gradient(180deg, var(--brand-400), var(--brand-450) 55%, var(--brand-500));
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 12px -6px rgba(1, 47, 73, .5);
}
.pagination .gap { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted-2); }
.pagination .disabled { opacity: .45; pointer-events: none; box-shadow: none; }

/* ------------------------------------------------- 5. États vides */
.empty { padding: 56px 24px; }
.empty .empty-glyph {
    width: 72px; height: 72px; border-radius: 22px;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    color: var(--brand-450);
    box-shadow: inset 0 0 0 1px rgba(1, 118, 205, .08);
}
.empty h3, .empty b { font: 800 16px/1.3 var(--font-title); color: var(--ink); display: block; margin-bottom: 6px; }
.empty p { color: var(--muted); }

/* ------------------------------------------------------- 6. Listes */
.list-row {
    padding: 12px 12px;
    margin: 0 -12px;
    border-radius: 12px;
    border-bottom: 1px solid var(--line-2);
    transition: background .14s var(--ease);
}
.list-row:hover { background: #f6fafd; }
.list-row:last-child { border-bottom: 0; }
.list-row .list-title { font-weight: 700; color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.list-row .list-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.list-row .list-meta {
    font-size: 12px; font-weight: 600; color: var(--muted);
    padding: 3px 9px; border-radius: 999px; background: var(--surface-2);
    white-space: nowrap;
}
.list-row.card-link { color: inherit; }
.list-row.card-link:hover { text-decoration: none; }
.list-row.card-link:hover .list-title { color: var(--brand-600); }
.list-row .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.list-row .chev { transition: transform .14s var(--ease), color .14s var(--ease); }
.list-row:hover .chev { transform: translateX(2px); color: var(--brand-450); }

/* Liste posée directement dans une carte (sans .card-body) : on lui rend ses marges */
.card > .list, .card > .timeline, .card > .list-cards { padding: 8px 22px 12px; }
.card > .title + .list, .card > .card-head + .list { padding-top: 2px; }

.list-cards { gap: 10px; }
.list-card {
    padding: 14px 16px; border-radius: 14px;
    border-color: var(--pf-line); box-shadow: var(--sh-xs);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.list-card:hover { border-color: var(--brand-300); box-shadow: var(--sh); transform: translateY(-1px); }
.list-card .list-title { font-weight: 700; }

/* --------------------------------------------------- 7. Chronologie */
.timeline { gap: 0; }
.tl-item { position: relative; gap: 14px; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute; left: 4px; top: 17px; bottom: -2px;
    width: 1.5px; background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
    width: 10px; height: 10px; margin-top: 5px;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
    position: relative; z-index: 1;
}
.tl-title { font-weight: 600; color: var(--ink); font-size: 13.5px; line-height: 1.4; }
.tl-time {
    display: inline-block; margin-top: 4px;
    font-size: 11.5px; font-weight: 600; color: var(--muted);
    padding: 2px 8px; border-radius: 999px; background: var(--surface-2);
}
.timeline.aligned .tl-item::before { display: none; }
.timeline.aligned .tl-time { margin-top: 0; }

/* Cartes contenant un tableau : angles et pied cohérents */
.card:has(> .table-wrap) { overflow: hidden; }
.card:has(> .table-wrap) > .card-head { border-bottom: 0; }

/* Carte « lâche » : titre posé directement dans la carte, sans en-tête ni corps.
   On lui rend une respiration cohérente avec les autres cartes. */
.card:has(> .card-title):not(:has(> .card-head, > .card-body, > .table-wrap)) { padding: 18px 20px 20px; }
.card:has(> .card-title):not(:has(> .card-head, > .card-body)) > .card-title { margin-bottom: 14px; }
.card:has(> .card-title):not(:has(> .card-head, > .card-body)) > .card-title + .muted { margin-top: -6px; }

/* Listes de définitions (fiches) */
.dl-row { padding: 10px 0; }
.dl-row + .dl-row { border-top: 1px dashed var(--line); }
.dl-row dt { font-size: 12.5px; font-weight: 500; }
.dl-row dd { font-weight: 700; color: var(--ink); }

/* Jauges libellées */
.meter-list { gap: 14px; }
.meter-head .meter-label { font-weight: 600; }
.bar { height: 8px; background: var(--line-2); }

} /* fin du périmètre D */

/* Impression : les champs redeviennent sobres */
@media print {
    .field input, .field select, .field textarea { box-shadow: none; border-color: #999; }
    .form-actions, .sf-help, .sf-tools, .sf-status { display: none !important; }
}
