:root {
    --blanc: #ffffff;
    --noir: #000000;
    --fond: #ffffff;
    --fond-alt: #fafafa;
    --fond-creux: #f4f4f4;
    --surface: #ffffff;
    --surface-survol: #f7f7f7;
    --texte: #0a0a0a;
    --texte-doux: #5c5c5c;
    --texte-faible: #8a8a8a;
    --bordure: #e3e3e3;
    --bordure-forte: #cfcfcf;
    --laterale-fond: #0a0a0a;
    --laterale-texte: #d8d8d8;
    --laterale-texte-actif: #ffffff;
    --laterale-survol: #1b1b1b;
    --laterale-bordure: #262626;
    --accent: #042e33;
    --accent-texte: #ffffff;
    --positif: #176b3a;
    --positif-fond: #eef6f1;
    --negatif: #99201a;
    --negatif-fond: #fdf0ef;
    --attention: #8a5000;
    --attention-fond: #fdf4e8;
    --info: #3c3c3c;
    --info-fond: #f2f2f2;
    --graphique-1: #0a0a0a;
    --graphique-2: #525252;
    --graphique-3: #8f8f8f;
    --graphique-4: #bdbdbd;
    --graphique-5: #dedede;
    --rayon: 3px;
    --laterale-largeur: 244px;
    --police: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="sombre"] {
    --fond: #0c0c0c;
    --fond-alt: #121212;
    --fond-creux: #171717;
    --surface: #111111;
    --surface-survol: #191919;
    --texte: #f2f2f2;
    --texte-doux: #a6a6a6;
    --texte-faible: #767676;
    --bordure: #242424;
    --bordure-forte: #333333;
    --laterale-fond: #060606;
    --laterale-texte: #9f9f9f;
    --laterale-texte-actif: #ffffff;
    --laterale-survol: #171717;
    --laterale-bordure: #1e1e1e;
    --accent: #0c565f;
    --positif: #4caf7d;
    --positif-fond: #11281c;
    --negatif: #e2665f;
    --negatif-fond: #2a1312;
    --attention: #d99b3f;
    --attention-fond: #2a1f0e;
    --info: #c6c6c6;
    --info-fond: #1c1c1c;
    --graphique-1: #f2f2f2;
    --graphique-2: #b4b4b4;
    --graphique-3: #828282;
    --graphique-4: #555555;
    --graphique-5: #363636;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--police);
    font-size: 14px;
    line-height: 1.5;
    color: var(--texte);
    background: var(--fond);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv05", "cv08";
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 12px;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--texte);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

[data-theme="sombre"] :focus-visible {
    outline-color: #5bb9c4;
}

.nombre,
.tableau td.nombre,
.carte-kpi__valeur,
.tableau--chiffres td {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.visuellement-cache {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Chargement */

.barre-chargement {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease-out;
}

.barre-chargement.est-active {
    opacity: 1;
}

.barre-chargement__progression {
    height: 100%;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="sombre"] .barre-chargement__progression {
    background: #5bb9c4;
}

.barre-chargement__progression::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    height: 100%;
    background: linear-gradient(90deg, transparent, currentColor);
    opacity: 0.25;
}

body.est-en-chargement {
    cursor: progress;
}

body.est-en-chargement .contenu {
    opacity: 0.55;
    transition: opacity 220ms ease-out 80ms;
}

@keyframes apparition-contenu {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.contenu {
    animation: apparition-contenu 220ms ease-out both;
}

.bouton.est-occupe {
    position: relative;
    color: transparent !important;
}

.bouton.est-occupe::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 13px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    color: var(--texte);
    animation: rotation-chargement 600ms linear infinite;
}

.bouton--primaire.est-occupe::after,
.bouton--accent.est-occupe::after {
    color: #ffffff;
}

[data-theme="sombre"] .bouton--primaire.est-occupe::after {
    color: #0a0a0a;
}

@keyframes rotation-chargement {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .contenu { animation: none; }
    .barre-chargement__progression { transition: none; }
    .bouton.est-occupe::after { animation-duration: 2s; }
    body.est-en-chargement .contenu { transition: none; }
}

/* Structure */

.app {
    display: flex;
    min-height: 100vh;
}

.barre-laterale {
    width: var(--laterale-largeur);
    flex: 0 0 var(--laterale-largeur);
    background: var(--laterale-fond);
    color: var(--laterale-texte);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.barre-laterale__marque {
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--laterale-bordure);
}

.barre-laterale__nom {
    display: block;
    color: var(--laterale-texte-actif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.barre-laterale__nom:hover {
    text-decoration: none;
}

.barre-laterale__espace {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #6f6f6f;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.barre-laterale__navigation {
    flex: 1;
    padding: 14px 10px 20px;
}

.barre-laterale__groupe {
    margin-bottom: 20px;
}

.barre-laterale__titre-groupe {
    padding: 0 10px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6a6a6a;
}

.barre-laterale__lien {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--rayon);
    color: var(--laterale-texte);
    font-size: 13.5px;
    line-height: 1.35;
}

.barre-laterale__lien:hover {
    background: var(--laterale-survol);
    color: var(--laterale-texte-actif);
    text-decoration: none;
}

.barre-laterale__lien.est-actif {
    background: var(--accent);
    color: var(--accent-texte);
    font-weight: 600;
}

.barre-laterale__lien.est-desactive {
    color: #5a5a5a;
    cursor: default;
}

.barre-laterale__lien.est-desactive:hover {
    background: none;
    color: #5a5a5a;
    text-decoration: none;
}

.barre-laterale__compteur {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #272727;
    color: #e6e6e6;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.barre-laterale__compteur.est-critique {
    background: var(--negatif);
    color: #ffffff;
}

.barre-laterale__pied {
    padding: 14px 16px 18px;
    border-top: 1px solid var(--laterale-bordure);
    font-size: 12.5px;
}

.barre-laterale__utilisateur {
    color: var(--laterale-texte-actif);
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barre-laterale__role {
    display: block;
    color: #6f6f6f;
    font-size: 11.5px;
    margin-top: 2px;
}

.barre-laterale__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.lien-pied {
    background: none;
    border: 1px solid var(--laterale-bordure);
    color: var(--laterale-texte);
    font: inherit;
    font-size: 11.5px;
    padding: 4px 9px;
    border-radius: var(--rayon);
    cursor: pointer;
}

.lien-pied:hover {
    background: var(--laterale-survol);
    color: var(--laterale-texte-actif);
    text-decoration: none;
}

.zone-contenu {
    flex: 1;
    min-width: 0;
    background: var(--fond);
    display: flex;
    flex-direction: column;
}

.contenu {
    padding: 24px 28px 56px;
    max-width: 1460px;
    width: 100%;
}

.barre-mobile {
    display: none;
}

/* Entete de page */

.entete-page {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--bordure);
}

.entete-page__titre {
    font-size: 21px;
    line-height: 1.25;
}

.entete-page__sous-titre {
    margin-top: 5px;
    color: var(--texte-doux);
    font-size: 13px;
    max-width: 72ch;
}

.entete-page__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fil-ariane {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--texte-faible);
}

.fil-ariane a {
    color: var(--texte-doux);
}

/* Barre de filtres globale */

.barre-controle {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 22px;
    background: var(--fond-alt);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
}

.barre-controle__bloc {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.barre-controle__libelle {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--texte-faible);
}

.barre-controle__pousse {
    margin-left: auto;
}

.segments {
    display: inline-flex;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon);
    overflow: hidden;
    background: var(--surface);
}

.segments a,
.segments button {
    padding: 6px 11px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--texte-doux);
    background: none;
    border: none;
    border-right: 1px solid var(--bordure);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.segments a:last-child,
.segments button:last-child {
    border-right: none;
}

.segments a:hover,
.segments button:hover {
    background: var(--surface-survol);
    color: var(--texte);
    text-decoration: none;
}

.segments a.est-actif,
.segments button.est-actif {
    background: var(--noir);
    color: #ffffff;
    font-weight: 600;
}

[data-theme="sombre"] .segments a.est-actif,
[data-theme="sombre"] .segments button.est-actif {
    background: #f2f2f2;
    color: #0a0a0a;
}

/* Cartes */

.carte {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    margin-bottom: 20px;
}

.carte__entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bordure);
}

.carte__titre {
    font-size: 14px;
    font-weight: 650;
}

.carte__indice {
    font-size: 12px;
    color: var(--texte-faible);
}

.carte__corps {
    padding: 16px;
}

.carte__corps--serre {
    padding: 0;
}

.carte__pied {
    padding: 11px 16px;
    border-top: 1px solid var(--bordure);
    font-size: 12.5px;
    color: var(--texte-doux);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

/* Grilles */

.grille {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.grille--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grille--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grille--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grille--2-1 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.grille--1-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.grille > .carte {
    margin-bottom: 0;
}

/* KPI */

.grille-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
    gap: 0;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--surface);
    margin-bottom: 22px;
    overflow: hidden;
}

.carte-kpi {
    padding: 15px 16px 14px;
    border-right: 1px solid var(--bordure);
    border-bottom: 1px solid var(--bordure);
    min-width: 0;
    overflow: hidden;
}

.carte-kpi__libelle {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--texte-faible);
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.carte-kpi__libelle > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carte-kpi__aide {
    border-bottom: 1px dotted var(--bordure-forte);
    cursor: help;
}

.carte-kpi__valeur {
    margin-top: 8px;
    font-size: 25px;
    font-weight: 650;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.carte-kpi__valeur.est-vide {
    color: var(--texte-faible);
    font-size: 20px;
    font-weight: 500;
}

.carte-kpi__pied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
    min-height: 22px;
}

.carte-kpi__variation {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.carte-kpi__sparkline {
    flex: 0 0 auto;
    height: 22px;
    line-height: 0;
}

.carte-kpi__sparkline svg {
    display: block;
}

.est-positif { color: var(--positif); }
.est-negatif { color: var(--negatif); }
.est-attention { color: var(--attention); }
.est-neutre { color: var(--texte-faible); }

/* Jauge de score */

.score-bloc {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.jauge {
    position: relative;
    width: 124px;
    height: 124px;
    flex: 0 0 auto;
}

.jauge svg {
    transform: rotate(-90deg);
}

.jauge__valeur {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.jauge__nombre {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.jauge__sur {
    font-size: 11px;
    color: var(--texte-faible);
    margin-top: 3px;
}

.score-composantes {
    flex: 1;
    min-width: 230px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.composante {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 10px;
    align-items: center;
}

.composante__libelle {
    font-size: 12.5px;
    color: var(--texte-doux);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composante__poids {
    font-size: 10.5px;
    color: var(--texte-faible);
    margin-left: 5px;
}

.composante__valeur {
    font-size: 12.5px;
    font-weight: 650;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.composante__barre {
    grid-column: 1 / -1;
    height: 4px;
    background: var(--fond-creux);
    border-radius: 2px;
    overflow: hidden;
}

.composante__barre span {
    display: block;
    height: 100%;
    background: var(--graphique-1);
}

/* Tableaux */

.tableau-enveloppe {
    width: 100%;
    overflow-x: auto;
}

.tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tableau th,
.tableau td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--bordure);
    vertical-align: top;
}

.tableau thead th {
    position: sticky;
    top: 0;
    background: var(--fond-alt);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--texte-faible);
    white-space: nowrap;
    z-index: 1;
}

.tableau tbody tr:hover {
    background: var(--surface-survol);
}

.tableau tbody tr:last-child td {
    border-bottom: none;
}

.tableau td.nombre,
.tableau th.nombre {
    text-align: right;
    white-space: nowrap;
}

.tableau td.compact,
.tableau th.compact {
    white-space: nowrap;
}

.tableau--dense th,
.tableau--dense td {
    padding: 7px 12px;
}

.tableau__principal {
    font-weight: 550;
}

.tableau__secondaire {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--texte-faible);
}

.tableau__extrait {
    display: block;
    margin-top: 4px;
    color: var(--texte-doux);
    font-size: 12.5px;
    max-width: 62ch;
}

a.tableau__extrait:hover {
    color: var(--texte);
}

.lien-externe {
    display: inline-block;
    margin-left: 5px;
    color: var(--texte-faible);
    font-size: 11px;
    line-height: 1;
    vertical-align: 1px;
    text-decoration: none;
}

.lien-externe:hover {
    color: var(--texte);
    text-decoration: none;
}

.tableau th a {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tableau th a::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.35;
}

.tableau th a.est-actif {
    color: var(--texte);
}

.tableau th a.est-actif::after {
    opacity: 1;
}

.tableau__ligne-totaux td {
    background: var(--fond-alt);
    font-weight: 650;
    border-top: 1px solid var(--bordure-forte);
}

/* Badges et pastilles */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge.est-positif { background: var(--positif-fond); color: var(--positif); border-color: color-mix(in srgb, var(--positif) 22%, transparent); }
.badge.est-negatif { background: var(--negatif-fond); color: var(--negatif); border-color: color-mix(in srgb, var(--negatif) 22%, transparent); }
.badge.est-attention { background: var(--attention-fond); color: var(--attention); border-color: color-mix(in srgb, var(--attention) 22%, transparent); }
.badge.est-neutre { background: var(--info-fond); color: var(--texte-doux); border-color: var(--bordure); }
.badge.est-sombre { background: var(--noir); color: #ffffff; }

[data-theme="sombre"] .badge.est-sombre { background: #f2f2f2; color: #0a0a0a; }

.badge--contour {
    background: none;
    border-color: var(--bordure-forte);
    color: var(--texte-doux);
}

.pastille {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--texte-doux);
    background: var(--surface);
    flex: 0 0 auto;
}

.plateforme-cellule {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.point {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.point.est-positif { background: var(--positif); }
.point.est-negatif { background: var(--negatif); }
.point.est-attention { background: var(--attention); }
.point.est-neutre { background: var(--bordure-forte); }

.etoiles {
    display: inline-flex;
    gap: 1px;
    font-size: 12px;
    letter-spacing: 0.08em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Boutons */

.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.3;
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.bouton:hover {
    background: var(--surface-survol);
    border-color: var(--texte-faible);
    text-decoration: none;
}

.bouton:disabled,
.bouton.est-desactive {
    opacity: 0.45;
    cursor: not-allowed;
}

.bouton--primaire {
    background: var(--noir);
    border-color: var(--noir);
    color: #ffffff;
}

.bouton--primaire:hover {
    background: #222222;
    border-color: #222222;
}

[data-theme="sombre"] .bouton--primaire {
    background: #f2f2f2;
    border-color: #f2f2f2;
    color: #0a0a0a;
}

[data-theme="sombre"] .bouton--primaire:hover {
    background: #ffffff;
}

.bouton--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-texte);
}

.bouton--accent:hover {
    background: #063f46;
    border-color: #063f46;
}

.bouton--danger {
    color: var(--negatif);
    border-color: color-mix(in srgb, var(--negatif) 35%, transparent);
}

.bouton--danger:hover {
    background: var(--negatif-fond);
}

.bouton--discret {
    border-color: transparent;
    background: none;
    color: var(--texte-doux);
    padding: 5px 8px;
}

.bouton--discret:hover {
    background: var(--surface-survol);
    color: var(--texte);
    border-color: var(--bordure);
}

.bouton--petit {
    padding: 4px 9px;
    font-size: 12px;
}

.groupe-boutons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.formulaire-inline {
    display: inline;
}

/* Formulaires */

.champ {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    min-width: 0;
}

.champ__libelle {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--texte);
}

.champ__obligatoire {
    color: var(--negatif);
    margin-left: 2px;
}

.champ__aide {
    font-size: 11.5px;
    color: var(--texte-faible);
    line-height: 1.45;
}

.champ__erreur {
    font-size: 11.5px;
    color: var(--negatif);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon);
    appearance: none;
}

input[type="number"] {
    font-variant-numeric: tabular-nums;
}

select {
    padding-right: 28px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.55;
}

textarea.code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    min-height: 180px;
    line-height: 1.6;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent);
}

input::placeholder,
textarea::placeholder {
    color: var(--texte-faible);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--fond-creux);
    color: var(--texte-faible);
    cursor: not-allowed;
}

.champ--compact {
    margin-bottom: 0;
}

.champ--auto input,
.champ--auto select {
    width: auto;
    min-width: 132px;
}

.case {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 9px;
}

.case input[type="checkbox"],
.case input[type="radio"] {
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
    cursor: pointer;
}

.case__texte {
    min-width: 0;
}

.case__aide {
    display: block;
    font-size: 11.5px;
    color: var(--texte-faible);
    margin-top: 2px;
}

.cases-ligne {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cases-ligne .case {
    margin-bottom: 0;
}

.interrupteur {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}

.interrupteur input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.interrupteur__piste {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--bordure-forte);
    transition: background 0.15s ease;
    flex: 0 0 auto;
}

.interrupteur__piste::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.15s ease;
}

.interrupteur input:checked + .interrupteur__piste {
    background: var(--accent);
}

.interrupteur input:checked + .interrupteur__piste::after {
    transform: translateX(16px);
}

.interrupteur input:focus-visible + .interrupteur__piste {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.interrupteur__libelle {
    font-size: 13px;
    font-weight: 550;
}

.ligne-champs {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.ligne-champs--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ligne-champs--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.separateur-formulaire {
    height: 1px;
    background: var(--bordure);
    border: none;
    margin: 20px 0;
}

.bloc-champs {
    margin-bottom: 24px;
}

.bloc-champs__titre {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--texte-faible);
    margin-bottom: 13px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--bordure);
}

.actions-formulaire {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    padding-top: 6px;
}

/* Onglets */

.onglets {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--bordure);
}

.onglets a {
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 550;
    color: var(--texte-doux);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

.onglets a:hover {
    color: var(--texte);
    text-decoration: none;
    background: var(--surface-survol);
}

.onglets a.est-actif {
    color: var(--texte);
    border-bottom-color: var(--accent);
    font-weight: 650;
}

/* Etats vides et messages */

.etat-vide {
    padding: 40px 22px;
    text-align: center;
    color: var(--texte-doux);
}

.etat-vide--compact {
    padding: 26px 18px;
}

.etat-vide__titre {
    font-size: 14px;
    font-weight: 600;
    color: var(--texte);
    margin-bottom: 5px;
}

.etat-vide__texte {
    font-size: 13px;
    max-width: 46ch;
    margin: 0 auto;
    line-height: 1.6;
}

.etat-vide__actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.etat-vide__marque {
    width: 34px;
    height: 34px;
    margin: 0 auto 14px;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texte-faible);
    font-size: 15px;
}

.notice {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border: 1px solid var(--bordure);
    border-left-width: 3px;
    border-radius: var(--rayon);
    background: var(--fond-alt);
    font-size: 13px;
    line-height: 1.55;
}

.notice--succes { border-left-color: var(--positif); background: var(--positif-fond); }
.notice--erreur { border-left-color: var(--negatif); background: var(--negatif-fond); }
.notice--attention { border-left-color: var(--attention); background: var(--attention-fond); }
.notice--info { border-left-color: var(--texte-faible); }

.notice__titre {
    font-weight: 650;
    display: block;
    margin-bottom: 3px;
}

.notice__corps {
    min-width: 0;
}

.banniere-impersonation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 28px;
    background: var(--accent);
    color: var(--accent-texte);
    font-size: 12.5px;
}

.banniere-impersonation .lien-pied {
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.banniere-impersonation .lien-pied:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Progression */

.barre-progression {
    height: 6px;
    background: var(--fond-creux);
    border-radius: 3px;
    overflow: hidden;
}

.barre-progression span {
    display: block;
    height: 100%;
    background: var(--graphique-1);
    transition: width 0.2s ease;
}

.barre-progression--fine {
    height: 4px;
}

.progression-ligne {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 10px;
    align-items: center;
    margin-bottom: 11px;
}

.progression-ligne__libelle {
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progression-ligne__valeur {
    font-size: 12px;
    text-align: right;
    color: var(--texte-doux);
    font-variant-numeric: tabular-nums;
}

.progression-ligne__barre {
    grid-column: 1 / -1;
}

/* Graphiques */

.graphique {
    position: relative;
    width: 100%;
    height: 260px;
}

.graphique--petit {
    height: 190px;
}

.graphique--grand {
    height: 320px;
}

.legende {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--texte-doux);
}

.legende__element {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legende__trait {
    width: 14px;
    height: 2px;
    background: var(--graphique-1);
    flex: 0 0 auto;
}

/* Listes de details */

.liste-detail {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
    gap: 9px 18px;
    font-size: 13px;
}

.liste-detail dt {
    color: var(--texte-faible);
    font-size: 12.5px;
}

.liste-detail dd {
    margin: 0;
    font-weight: 550;
    min-width: 0;
    overflow-wrap: anywhere;
}

.liste-simple {
    margin: 0;
    padding: 0;
    list-style: none;
}

.liste-simple li {
    padding: 10px 0;
    border-bottom: 1px solid var(--bordure);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.liste-simple li:first-child {
    padding-top: 0;
}

.liste-simple li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.liste-simple__principal {
    min-width: 0;
    font-size: 13px;
}

.liste-simple__secondaire {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--texte-faible);
}

.liste-simple__valeur {
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Arbre d entites */

.arbre {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arbre__element {
    border-bottom: 1px solid var(--bordure);
}

.arbre__element:last-child {
    border-bottom: none;
}

.arbre__ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
}

.arbre__ligne:hover {
    background: var(--surface-survol);
}

.arbre__ligne.est-selectionne {
    background: var(--fond-creux);
    box-shadow: inset 3px 0 0 var(--accent);
}

.arbre__nom {
    font-size: 13.5px;
    font-weight: 600;
    min-width: 0;
}

.arbre__meta {
    font-size: 12px;
    color: var(--texte-faible);
}

.arbre__actions {
    margin-left: auto;
    display: flex;
    gap: 5px;
    align-items: center;
}

.indentation-1 { padding-left: 34px; }
.indentation-2 { padding-left: 54px; }
.indentation-3 { padding-left: 74px; }

/* Modules de plateforme */

.module-plateforme {
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    margin-bottom: 14px;
    background: var(--surface);
}

.module-plateforme__entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
}

.module-plateforme__entete.est-actif {
    border-bottom: 1px solid var(--bordure);
    background: var(--fond-alt);
}

.module-plateforme__nom {
    font-size: 13.5px;
    font-weight: 650;
}

.module-plateforme__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-plateforme__corps {
    padding: 0;
}

.mode-bloc {
    padding: 15px;
    border-bottom: 1px solid var(--bordure);
}

.mode-bloc:last-child {
    border-bottom: none;
}

.mode-bloc__entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
}

.mode-bloc__titre {
    font-size: 13px;
    font-weight: 650;
}

.mode-bloc__aide {
    font-size: 11.5px;
    color: var(--texte-faible);
    flex: 1;
    min-width: 180px;
}

.mode-bloc__corps {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.mode-bloc.est-inactif .mode-bloc__corps {
    opacity: 0.5;
}

/* Pagination */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--bordure);
    font-size: 12.5px;
    color: var(--texte-doux);
}

.pagination__pages {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination__pages a,
.pagination__pages span {
    min-width: 29px;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    font-variant-numeric: tabular-nums;
}

.pagination__pages a:hover {
    background: var(--surface-survol);
    text-decoration: none;
}

.pagination__pages .est-actif {
    background: var(--noir);
    color: #ffffff;
    border-color: var(--noir);
    font-weight: 600;
}

[data-theme="sombre"] .pagination__pages .est-actif {
    background: #f2f2f2;
    color: #0a0a0a;
    border-color: #f2f2f2;
}

.pagination__pages .est-inactif {
    color: var(--texte-faible);
    border-color: var(--bordure);
}

/* Code et journaux */

pre.bloc-code {
    margin: 0;
    padding: 13px 15px;
    background: var(--fond-creux);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    color: var(--texte);
}

pre.bloc-code--limite {
    max-height: 340px;
    overflow-y: auto;
}

code.en-ligne {
    padding: 1px 5px;
    background: var(--fond-creux);
    border: 1px solid var(--bordure);
    border-radius: 2px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
}

.texte-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
}

.analyse-markdown {
    font-size: 13.5px;
    line-height: 1.7;
}

.analyse-markdown h2 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--texte-faible);
    margin: 22px 0 9px;
}

.analyse-markdown h2:first-child {
    margin-top: 0;
}

.analyse-markdown ul {
    margin: 0 0 14px;
    padding-left: 20px;
}

.analyse-markdown li {
    margin-bottom: 6px;
}

/* Utilitaires */

.texte-doux { color: var(--texte-doux); }
.texte-faible { color: var(--texte-faible); }
.texte-petit { font-size: 12px; }
.texte-droite { text-align: right; }
.texte-centre { text-align: center; }
.gras { font-weight: 650; }
.sans-marge { margin: 0 !important; }
.marge-haut { margin-top: 20px; }
.marge-bas { margin-bottom: 20px; }
.pleine-largeur { width: 100%; }
.flex-ligne { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.flex-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tronque { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; display: inline-block; vertical-align: bottom; }
.coupure { overflow-wrap: anywhere; }

/* Authentification */

.page-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: var(--fond-alt);
}

.carte-auth {
    width: 100%;
    max-width: 384px;
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 30px 28px 26px;
}

.carte-auth__marque {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.carte-auth__accroche {
    font-size: 12.5px;
    color: var(--texte-faible);
    margin-bottom: 26px;
}

.carte-auth__titre {
    font-size: 17px;
    margin-bottom: 18px;
}

.carte-auth__pied {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--bordure);
    font-size: 12.5px;
    color: var(--texte-doux);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Page d erreur */

.page-erreur {
    padding: 70px 20px;
    text-align: center;
}

.page-erreur__code {
    font-size: 46px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.page-erreur__message {
    margin: 14px auto 24px;
    max-width: 44ch;
    color: var(--texte-doux);
}

/* Responsive */

@media (max-width: 1180px) {
    .grille--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grille--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grille--2-1,
    .grille--1-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
    .app { flex-direction: column; }

    .barre-laterale {
        position: static;
        width: 100%;
        flex: none;
        height: auto;
    }

    .barre-laterale__navigation {
        display: none;
        padding-bottom: 14px;
    }

    .barre-laterale.est-ouverte .barre-laterale__navigation {
        display: block;
    }

    .barre-laterale__pied {
        display: none;
    }

    .barre-laterale.est-ouverte .barre-laterale__pied {
        display: block;
    }

    .barre-laterale__marque {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: none;
    }

    .barre-laterale.est-ouverte .barre-laterale__marque {
        border-bottom: 1px solid var(--laterale-bordure);
    }

    .barre-mobile {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        background: none;
        border: 1px solid var(--laterale-bordure);
        border-radius: var(--rayon);
        color: var(--laterale-texte-actif);
        font-family: inherit;
        font-size: 12px;
        padding: 6px 10px;
        cursor: pointer;
    }

    .contenu { padding: 20px 16px 48px; }
    .banniere-impersonation { padding: 9px 16px; }
    .grille--2,
    .grille--3,
    .grille--4 { grid-template-columns: minmax(0, 1fr); }
    .ligne-champs--2,
    .ligne-champs--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
    body { font-size: 13.5px; }

    .entete-page { align-items: flex-start; }
    .entete-page__titre { font-size: 19px; }
    .entete-page__actions { width: 100%; }

    .barre-controle { padding: 12px; gap: 11px; }
    .barre-controle__bloc { width: 100%; }
    .barre-controle__pousse { margin-left: 0; width: 100%; }
    .segments { width: 100%; overflow-x: auto; }
    .segments a, .segments button { flex: 1; text-align: center; }

    .grille-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .carte-kpi__valeur { font-size: 21px; }
    .carte-kpi__sparkline { display: none; }

    .tableau th, .tableau td { padding: 9px 11px; }
    .tableau__extrait { max-width: none; }
    .tronque { max-width: 20ch; }

    .liste-detail { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
    .liste-detail dd { margin-bottom: 11px; }

    .score-bloc { gap: 16px; }
    .jauge { width: 104px; height: 104px; }

    .graphique { height: 220px; }
    .graphique--grand { height: 250px; }

    .onglets { overflow-x: auto; flex-wrap: nowrap; }
    .pagination { justify-content: center; }
}

@media print {
    .barre-laterale,
    .barre-controle,
    .entete-page__actions,
    .pagination,
    .notice {
        display: none !important;
    }

    .contenu { padding: 0; }
    .carte { border-color: #cccccc; break-inside: avoid; }
}
