/* Variables de thème */
:root {
    color-scheme: light;

    /* fonds */
    --fond-page: #f7f4ed;
    --fond-carte: #fffdfa;
    --fond-alterne: #f2eee5;

    /* textes */
    --texte: #4a423a;
    --texte-titre: #2b2620;
    --texte-doux: #6e655b;
    --texte-inverse: #fffdfa;

    /* accent unique */
    --accent: #9e5330;
    --accent-hover: #8f4a2a;

    /* états */
    --succes: #4f7340;
    --succes-fond: #eef2e7;
    --succes-bordure: #d5e0c9;

    --info: #4d6d7a;
    --info-fond: #eaf0f2;
    --info-bordure: #cfdde2;

    --avertissement: #836424;
    --avertissement-fond: #f7f1e2;
    --avertissement-bordure: #e5d9bd;

    --alerte: #a33f2e;
    --alerte-fond: #f8ece7;
    --alerte-bordure: #e6cdc3;

    /* bordures et ombres */
    --bordure: #dcd5c7;
    --bordure-forte: #b0a695;
    --ombre-1: 0 1px 2px rgba(43, 38, 32, 0.05);
    --anneau-focus: rgba(158, 83, 48, 0.18);

    /* barre latérale */
    --barre-fond: #d8d4cf;
    --barre-fond-fin: #d3cfca;
    --barre-bordure: #cbc7c2;
    --barre-texte: #5c544a;
    --barre-texte-fort: #2b2620;
    --barre-separateur: rgba(43, 38, 32, 0.12);
    --barre-survol: rgba(43, 38, 32, 0.06);
    --barre-actif: rgba(158, 83, 48, 0.16);
    --barre-scroll: rgba(43, 38, 32, 0.18);

    /* rayons et dimensions */
    --rayon: 0;
    --rayon-petit: 0;
    --rayon-barre: 6px;
    --largeur-barre: 250px;
}

/* thème sombre */
[data-theme="nuit"] {
    color-scheme: dark;

    --fond-page: #232019;
    --fond-carte: #2c2820;
    --fond-alterne: #322d24;

    --texte: #c8c0b4;
    --texte-titre: #f2ece2;
    --texte-doux: #9e9588;
    --texte-inverse: #232019;

    --accent: #d08a5e;
    --accent-hover: #dda078;

    --succes: #9dbf8a;
    --succes-fond: #232b1f;
    --succes-bordure: #38472f;

    --info: #93b5c2;
    --info-fond: #212a2e;
    --info-bordure: #33454e;

    --avertissement: #d4b06a;
    --avertissement-fond: #2b2719;
    --avertissement-bordure: #453d26;

    --alerte: #e0907c;
    --alerte-fond: #2e211d;
    --alerte-bordure: #4a322b;

    --bordure: #3a352c;
    --bordure-forte: #4a4438;
    --ombre-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --anneau-focus: rgba(208, 138, 94, 0.22);

    --barre-fond: #1a1713;
    --barre-fond-fin: #171410;
    --barre-bordure: #3f3a33;
    --barre-texte: #a89f92;
    --barre-texte-fort: #f2ece2;
    --barre-separateur: rgba(255, 255, 255, 0.09);
    --barre-survol: rgba(255, 255, 255, 0.05);
    --barre-actif: rgba(208, 138, 94, 0.16);
    --barre-scroll: rgba(255, 255, 255, 0.18);
}

/* Reset et base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--fond-page);
    color: var(--texte);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

a:hover, a:focus {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* lien secondaire */
.lien-subtil {
    color: inherit;
    font-weight: 400;
    text-decoration: none;
}

.lien-subtil:hover,
.lien-subtil:focus {
    color: var(--accent-hover);
    text-decoration: underline;
}

ul {
    list-style-position: inside;
    margin-top: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

::selection {
    background-color: var(--accent);
    color: var(--texte-inverse);
}

/* Structure du tableau de bord */
.appli {
    display: grid;
    grid-template-columns: var(--largeur-barre) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--barre-fond) 0%, var(--barre-fond-fin) 100%);
}

/* Barre latérale */
/* barre collée en haut pendant le défilement */
.barre-laterale {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    color: var(--barre-texte-fort);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1rem 0;
}

.barre-laterale::-webkit-scrollbar {
    width: 8px;
}

.barre-laterale::-webkit-scrollbar-thumb {
    background-color: var(--barre-scroll);
    border-radius: 4px;
}

/* marque centrée dans la barre */
.marque {
    align-self: center;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--barre-separateur);
}

/* nom du site */
.marque h1 {
    color: var(--barre-texte-fort);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.marque-esperluette {
    color: var(--accent);
    font-weight: 400;
    padding: 0 0.05em;
}

/* sous-titre de la marque */
.marque .sous-titre {
    width: 0;
    min-width: 100%;
    margin-top: 0.55rem;
    font-size: 0.62rem;
    color: var(--barre-texte);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 500;
    line-height: 1.6;
}

.nav-laterale ul {
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nav-laterale li {
    margin: 0;
}

.nav-laterale a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-left: 2px solid transparent;
    border-radius: 0 var(--rayon-barre) var(--rayon-barre) 0;
    color: var(--barre-texte);
    font-size: 0.92rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-laterale a:hover,
.nav-laterale a:focus {
    background-color: var(--barre-survol);
    color: var(--barre-texte-fort);
    text-decoration: none;
}

.nav-laterale a.actif {
    background-color: var(--barre-actif);
    border-left-color: var(--accent);
    color: var(--barre-texte-fort);
    font-weight: 600;
}

/* groupe de pages du menu */
.nav-groupe-titre {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    color: var(--barre-texte);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.nav-groupe-actif .nav-groupe-titre {
    color: var(--barre-texte-fort);
}

.nav-laterale .nav-sous {
    margin: 0.15rem 0 0 0.9rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--barre-separateur);
}

.nav-laterale .nav-sous a {
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
}

/* icônes SVG insérées en ligne, elles héritent de la couleur du texte */
.icone {
    display: inline-flex;
    flex-shrink: 0;
}

.icone svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* bascule clair / sombre */
.bascule-theme {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--barre-bordure);
    border-radius: var(--rayon-barre);
    color: var(--barre-texte);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.bascule-theme:hover,
.bascule-theme:focus {
    background-color: var(--barre-survol);
    color: var(--barre-texte-fort);
    text-decoration: none;
}

/* pied de barre collé en bas */
.pied-barre {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 1rem;
    border-top: 1px solid var(--barre-separateur);
    background-color: var(--barre-fond-fin);
    font-size: 0.82rem;
}

.pied-barre-nom {
    color: var(--barre-texte-fort);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.profil {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--barre-bordure);
}

.avatar-vide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: var(--texte-inverse);
    font-weight: 700;
    font-size: 1rem;
}

.profil-texte {
    min-width: 0;
}

.profil-nom {
    color: var(--barre-texte-fort);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profil-texte a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--barre-texte);
    font-size: 0.78rem;
    font-weight: 500;
}

.profil-texte a:hover,
.profil-texte a:focus {
    color: var(--accent-hover);
}

.profil-texte .icone svg {
    width: 14px;
    height: 14px;
}

/* Zone de contenu */
.contenu {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--fond-page);
    border-radius: 0 0 0 14px;
    overflow: hidden;
}

main {
    flex-grow: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

main h2 {
    margin-bottom: 0.4rem;
    color: var(--texte-titre);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* barre de filtres et bouton d'action */
.barre-filtres {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.barre-filtres .vues {
    margin-bottom: 0;
}

/* plan de l'entrepôt, allées puis étagères */
.entrepot-menus .vues {
    margin-bottom: 1.1rem;
    gap: 1.75rem;
}

.entrepot-legende {
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
    color: var(--texte-doux);
}

main > p {
    margin-bottom: 1.5rem;
    color: var(--texte-doux);
    max-width: 75ch;
}

/* ligne de synthèse placée juste avant un tableau */
main > p.recap {
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

/* lien de retour placé en haut d'une page de détail */
main > p.retour {
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

/* Cartes */
.carte {
    background-color: var(--fond-carte);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ombre-1);
}

.carte h2, .carte h3 {
    margin-bottom: 0.75rem;
    color: var(--texte-titre);
    font-weight: 600;
}

.carte h3 {
    font-size: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--bordure);
}

.carte p {
    margin-bottom: 0.75rem;
}

/* Salutation du tableau de bord */
.salutation {
    text-align: left;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--texte-titre);
    letter-spacing: -0.02em;
    margin-top: 1rem;
    margin-bottom: 2.5rem;
}

.salutation-nom {
    color: var(--accent);
    font-weight: 700;
}

/* compteurs en tuiles de largeur fixe */
.compteurs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 4rem;
}

.compteur {
    --accent-compteur: var(--accent);
    flex: 0 0 auto;
    width: 190px;
    display: flex;
    flex-direction: column;
}

.compteur:nth-child(1) { --accent-compteur: var(--accent); }
.compteur:nth-child(2) { --accent-compteur: var(--alerte); }
.compteur:nth-child(3) { --accent-compteur: var(--info); }
.compteur:nth-child(4) { --accent-compteur: var(--succes); }

.compteur-alerte {
    --accent-compteur: var(--alerte);
}

.compteur-valeur {
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--accent-compteur);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.compteur-libelle {
    font-size: 0.82rem;
    color: var(--texte-doux);
    margin-top: 0.15rem;
}

/* icône d'une tuile de compteur, colorée comme sa valeur */
.compteur-icone {
    color: var(--accent-compteur);
    margin-bottom: 0.4rem;
}

.compteur-icone svg {
    width: 1.4rem;
    height: 1.4rem;
}

/* en-tête de la page Entrepôt */
.entrepot-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.entrepot-entete p {
    margin-bottom: 0;
    color: var(--texte-doux);
    max-width: 75ch;
}

/* camembert compact dans l'en-tête */
.entrepot-entete .camembert {
    padding: 0;
    width: 80px;
    height: 80px;
}

/* synthèse d'une étagère */
.entrepot-barre {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.entrepot-resume {
    gap: 1.6rem;
    margin: 0;
}

.entrepot-resume .compteur {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    width: auto;
}

.entrepot-resume .compteur-valeur {
    font-size: 1.15rem;
}

.entrepot-resume .compteur-icone {
    margin-bottom: 0;
}

.entrepot-resume .compteur-icone svg {
    width: 1.15rem;
    height: 1.15rem;
}

/* Catégories du tableau de bord */
.categorie {
    margin-bottom: 3rem;
}

.categorie p {
    margin-bottom: 0.75rem;
    color: var(--texte-doux);
    font-size: 0.88rem;
}

/* filtres avec compteur */
.vues {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-bottom: 1.75rem;
}

.vue {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: var(--texte-doux);
}

.vue:not(.vue-actif):hover,
.vue:not(.vue-actif):focus {
    text-decoration: none;
}

.vue-nombre {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--texte-doux);
    transition: color 0.15s ease;
}

.vue-libelle {
    font-size: 0.82rem;
    font-weight: 500;
}

.vue:not(.vue-actif):hover .vue-nombre,
.vue:not(.vue-actif):focus .vue-nombre {
    color: var(--texte-titre);
}

.vue-actif .vue-nombre {
    color: var(--accent);
}

.vue-actif .vue-libelle {
    color: var(--texte-titre);
}

/* titre de page précédé d'une icône */
main h2 .icone {
    vertical-align: -0.12em;
}

.titre-alerte .icone svg {
    width: 22px;
    height: 22px;
    color: var(--alerte);
}

/* fiche d'identité d'un fournisseur */
.fiche {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 2rem;
    font-size: 0.92rem;
}

.fiche dt {
    color: var(--texte-doux);
    font-weight: 600;
}

.fiche dd {
    color: var(--texte);
}

.categorie-titre {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--texte-titre);
    margin-bottom: 0.5rem;
}

.categorie-titre .icone svg {
    width: 17px;
    height: 17px;
    color: var(--texte-doux);
}

/* camembert et courbe en SVG */
.repartition {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
}

.repartition-camembert,
.repartition-courbe {
    display: flex;
    flex-direction: column;
}

.repartition-courbe {
    flex: 1;
    min-width: 260px;
}

/* camembert et sa légende */
figure.camembert-contenu {
    margin: 0;
}

.camembert-contenu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.camembert {
    width: 130px;
    height: 130px;
    padding: 25px 0;
    box-sizing: content-box;
    flex-shrink: 0;
}

/* contour des parts */
.camembert .part {
    stroke: var(--fond-page);
    stroke-width: 3;
}

.part-alerte {
    fill: var(--alerte);
}

.part-ok {
    fill: var(--succes);
}

.courbe {
    width: 100%;
    height: 180px;
    display: block;
    overflow: visible;
}

.courbe-aire {
    fill: url(#degrade-courbe);
}

.courbe-stop-haut {
    stop-color: var(--accent);
    stop-opacity: 0.35;
}

.courbe-stop-bas {
    stop-color: var(--accent);
    stop-opacity: 0;
}

.courbe-grille {
    stroke: var(--bordure);
    stroke-width: 1;
}

.courbe-echelle {
    fill: var(--texte-doux);
    font-size: 10px;
    font-family: inherit;
}

.courbe polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.courbe circle {
    fill: var(--accent);
}

.courbe text {
    fill: var(--texte-doux);
    font-size: 11px;
    font-family: inherit;
}

.legende {
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legende li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--texte);
}

.legende strong {
    color: var(--texte-titre);
}

.pastille {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.pastille-alerte {
    background-color: var(--alerte);
}

.pastille-ok {
    background-color: var(--succes);
}

/* tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

thead th {
    background: none;
    color: var(--texte-doux);
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--bordure-forte);
}

tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--bordure);
    vertical-align: middle;
    color: var(--texte);
}

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

tbody tr:hover {
    background-color: var(--fond-alterne);
}

/* table des pistolets, lignes espacées */
.table-scanners thead th {
    padding: 0.8rem 0.75rem;
}

.table-scanners tbody td {
    padding: 1.3rem 0.75rem;
    font-size: 0.95rem;
}

/* historique des mouvements */
.table-mouvements tbody td {
    padding: 1rem 0.75rem;
    vertical-align: top;
}

.table-mouvements .mouvement-date {
    display: block;
    color: var(--texte-titre);
    font-weight: 600;
}

.table-mouvements .mouvement-detail {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--texte-doux);
}

.table-mouvements .mouvement-produit {
    display: block;
    color: var(--texte-titre);
}

/* type de mouvement, colonne dédiée */
.table-mouvements .mouvement-type {
    white-space: nowrap;
}

.table-mouvements .mouvement-commentaire {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--texte-doux);
    font-style: italic;
}

/* trajet d'un mouvement, départ et arrivée autour de la flèche */
.table-mouvements .mouvement-trajet {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.table-mouvements .trajet-depart {
    text-align: right;
    white-space: nowrap;
}

.table-mouvements .trajet-arrivee {
    text-align: left;
    white-space: nowrap;
}

.table-mouvements .trajet-fleche {
    color: var(--texte-doux);
}

.ligne-alerte {
    background-color: var(--alerte-fond);
}

.ligne-alerte td {
    color: var(--alerte);
}

.ligne-alerte:hover {
    background-color: var(--alerte-fond);
    filter: brightness(0.98);
}

/* ligne de produit entièrement cliquable */
tbody tr.ligne-produit {
    position: relative;
}

tbody tr.ligne-produit .lien-produit::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Étiquettes d'état */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--rayon-petit);
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-ok {
    background-color: var(--succes-fond);
    border-color: var(--succes-bordure);
    color: var(--succes);
}

.badge-alerte {
    background-color: var(--alerte-fond);
    border-color: var(--alerte-bordure);
    color: var(--alerte);
}

.badge-avertissement {
    background-color: var(--avertissement-fond);
    border-color: var(--avertissement-bordure);
    color: var(--avertissement);
}

.badge-info {
    background-color: var(--info-fond);
    border-color: var(--info-bordure);
    color: var(--info);
}

/* étiquette de type avec flèche */
.badge-type {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-type .icone svg {
    width: 12px;
    height: 12px;
}

/* grille des tâches */
.grille-taches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.4rem 2rem;
    margin-top: 0.5rem;
}

.tache {
    min-height: 11rem;
    padding: 1rem 1.1rem 1.2rem;
    border: 1px solid var(--bordure);
}

.tache-tete {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.tache-produit {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--texte-titre);
}

.tache-statut {
    flex: none;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.tache-statut-a-faire {
    color: var(--avertissement);
}

.tache-statut-en-cours {
    color: var(--info);
}

.tache-details {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--texte-doux);
}

/* une information par ligne (type, quantité, priorité) */
.tache-details span {
    display: block;
}

/* gestionnaire ou magasinier de la tâche */
.tache-personne {
    color: var(--texte);
}

.tache-role {
    display: inline-block;
    min-width: 5.6rem;
    color: var(--texte-doux);
}

.tache-priorite {
    white-space: nowrap;
}

/* statut et poubelle d'annulation, groupés à droite de l'en-tête */
.tache-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: none;
}

.tache-actions .bouton-supprimer {
    width: 1.6rem;
    height: 1.6rem;
}

.tache-actions .bouton-supprimer .icone svg {
    width: 15px;
    height: 15px;
}

/* une couleur par niveau de priorité, du plus urgent au plus faible */
.tache-priorite-1 {
    color: var(--alerte);
    font-weight: 600;
}

.tache-priorite-2 {
    color: var(--accent);
    font-weight: 600;
}

.tache-priorite-3 {
    color: var(--avertissement);
    font-weight: 600;
}

.tache-priorite-4 {
    color: var(--info);
    font-weight: 600;
}

.tache-priorite-5 {
    color: var(--succes);
    font-weight: 600;
}

/* Formulaires */
label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--texte-titre);
}

input[type="text"],
input[type="password"] {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon-petit);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--texte-titre);
    background-color: var(--fond-carte);
    width: 100%;
    max-width: 320px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--anneau-focus);
}

button {
    padding: 0.55rem 1.1rem;
    background-color: var(--accent);
    color: var(--texte-inverse);
    border: 1px solid var(--accent);
    border-radius: var(--rayon-petit);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

button:hover, button:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

button:active {
    filter: brightness(0.95);
}

/* lien présenté comme un bouton */
.bouton {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background-color: var(--accent);
    color: var(--texte-inverse);
    border: 1px solid var(--accent);
    border-radius: var(--rayon-petit);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bouton:hover,
.bouton:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--texte-inverse);
    text-decoration: none;
}

.bouton .icone svg {
    width: 16px;
    height: 16px;
}

/* action isolée sous la fiche, avant les sections de détail */
.actions-fiche {
    margin-bottom: 3rem;
}

.form-connexion {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 320px;
}

.form-connexion button {
    align-self: flex-start;
}

/* formulaire de suppression en ligne */
.form-supprimer {
    display: inline-flex;
    align-items: center;
}

/* bouton de suppression (poubelle) */
.bouton-supprimer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    vertical-align: middle;
    color: var(--texte-doux);
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--rayon-petit);
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.bouton-supprimer:hover,
.bouton-supprimer:focus {
    color: var(--alerte);
    background-color: var(--alerte-fond);
    border-color: var(--alerte-bordure);
}

.bouton-supprimer:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* bouton d'ajout */
.bouton-ajout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.1rem;
    height: 2.1rem;
    color: var(--texte-inverse);
    background-color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--rayon-petit);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bouton-ajout:hover,
.bouton-ajout:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
}

.bouton-ajout .icone svg {
    width: 16px;
    height: 16px;
}

/* colonne d'actions */
.colonne-icone {
    width: 4rem;
    text-align: center;
    white-space: nowrap;
}

/* lien vers la fiche d'un fournisseur, suivi de son icône de renvoi */
.lien-fournisseur {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.lien-fournisseur .icone svg {
    width: 13px;
    height: 13px;
}

/* barres de champs (filtres, formulaires) */
.filtres,
.form-ajout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
    background-color: var(--fond-carte);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.champ label {
    margin-bottom: 0;
}

.champ input[type="text"] {
    width: 16rem;
    max-width: 16rem;
}

/* champ qui accueille une liste longue, comme le catalogue des produits */
.champ-large select {
    width: 18rem;
}

/* case à cocher alignée sur la ligne de saisie voisine */
.champ-case {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.7rem;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* formulaire vertical d'édition d'une fiche */
.form-edition {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 32rem;
    padding: 1.25rem;
    background-color: var(--fond-carte);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
}

.form-edition .champ input[type="text"],
.form-edition select {
    width: 100%;
    max-width: 100%;
}

select {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon-petit);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--texte-titre);
    background-color: var(--fond-carte);
    min-width: 12rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--anneau-focus);
}

.filtres-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 0.1rem;
}

.lien-reinit {
    font-size: 0.88rem;
    font-weight: 600;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 1.25rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--bordure);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--texte-doux);
}

.pagination-liens {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pagination-lien {
    display: inline-block;
    min-width: 2.2rem;
    padding: 0.35rem 0.6rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--texte);
    background-color: var(--fond-carte);
    border: 1px solid var(--bordure-forte);
    border-radius: var(--rayon-petit);
}

a.pagination-lien:hover,
a.pagination-lien:focus {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

.pagination-actif {
    color: var(--texte-inverse);
    background-color: var(--accent);
    border-color: var(--accent);
}

.pagination-inactif {
    color: var(--texte-doux);
    background-color: var(--fond-page);
    border-color: var(--bordure);
}

/* Messages */
.message {
    padding: 0.8rem 1rem;
    border-radius: var(--rayon-petit);
    margin-bottom: 1rem;
    font-size: 0.92rem;
    border: 1px solid transparent;
    border-left-width: 3px;
}

.message-succes {
    background-color: var(--succes-fond);
    border-color: var(--succes-bordure);
    border-left-color: var(--succes);
    color: var(--succes);
}

.message-erreur {
    background-color: var(--alerte-fond);
    border-color: var(--alerte-bordure);
    border-left-color: var(--alerte);
    color: var(--alerte);
}

.vide {
    color: var(--info);
    background-color: var(--info-fond);
    border: 1px dashed var(--info-bordure);
    border-radius: var(--rayon-petit);
    font-style: italic;
    padding: 0.75rem 1rem;
    text-align: center;
}

/* Pied de page */
.pied-page {
    grid-column: 1 / 3;
    grid-row: 2;
    padding: 0.85rem 2rem;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--barre-texte);
}

.pied-page p {
    display: inline;
    margin: 0;
}

.pied-page p + p::before {
    content: " · ";
    color: var(--barre-bordure);
}

.pied-page a {
    color: var(--accent-hover);
}

/* petits écrans, barre au-dessus du contenu */
@media (max-width: 800px) {
    .appli {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .barre-laterale {
        grid-column: 1;
        grid-row: 1;
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }

    .contenu {
        grid-column: 1;
        grid-row: 2;
        border-radius: 0;
    }

    .pied-page {
        grid-column: 1;
        grid-row: 3;
    }

    .marque {
        padding-bottom: 0;
        border-bottom: none;
        align-self: auto;
    }

    .marque .sous-titre {
        width: auto;
        min-width: 0;
    }

    .marque h1 {
        font-size: 1rem;
    }

    .nav-laterale ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-laterale a {
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: var(--rayon-barre) var(--rayon-barre) 0 0;
        padding: 0.4rem 0.6rem;
    }

    .nav-laterale a.actif {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    /* le groupe passe à plat, ses pages à la suite du titre */
    .nav-groupe {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem;
    }

    .nav-groupe-titre {
        padding: 0.4rem 0.6rem;
    }

    .nav-laterale .nav-sous {
        margin: 0;
        padding: 0;
        border-left: none;
    }

    .nav-laterale .nav-sous a {
        padding: 0.4rem 0.6rem;
    }

    /* pied de barre non collé */
    .pied-barre {
        position: static;
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
        border-top: none;
        background-color: transparent;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .bascule-theme {
        margin-bottom: 0;
    }

    main {
        padding: 1.25rem;
    }

    /* courbe non étirée */
    .courbe {
        flex: none;
        height: auto;
    }

    /* sur petit écran les critères de filtre prennent toute la largeur */
    .champ {
        flex: 1 1 100%;
    }

    .champ input[type="text"],
    select {
        width: 100%;
        max-width: 100%;
    }

    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    table {
        font-size: 0.82rem;
    }

    thead th, tbody td {
        padding: 0.45rem 0.55rem;
    }

    /* table des pistolets, lignes encore espacées */
    .table-scanners tbody td {
        padding: 0.8rem 0.55rem;
    }

    .table-mouvements tbody td {
        padding: 0.8rem 0.55rem;
    }

    /* sur petit écran la grille des tâches passe sur une seule colonne */
    .grille-taches {
        grid-template-columns: 1fr;
    }
}
