@charset "UTF-8";
/* ==========================================================================
   GPAO v5 — feuille de style unique.

   Palette construite autour du bleu du logo SOTICI. Les couleurs de sens
   (vert actif, ambre attention, rouille destruction) en sont distinctes :
   la marque n'est jamais confondue avec un état.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Jetons
   -------------------------------------------------------------------------- */
:root {
    /* Surfaces — papier technique, légèrement bleuté pour s'accorder au logo */
    --papier:       #edeef3;
    --blanc:        #ffffff;
    --voile:        #f6f7fa;
    --trait:        #dcdee7;
    --trait-fort:   #c2c6d6;

    /* Encres */
    --encre:        #171a2b;
    --encre-2:      #454a63;
    --ardoise:      #6c7288;

    /* Bleu SOTICI — relevé sur le logo */
    --bleu:         #293990;
    --bleu-fonce:   #1c2a72;
    --bleu-voile:   #e7e9f5;
    --bleu-clair:   #7c8ad8;

    /* Couleurs de sens, distinctes de la marque */
    --vert:         #1c7a56;
    --vert-voile:   #e2f0ea;
    --ambre:        #a4620f;
    --ambre-voile:  #faeeda;
    --rouille:      #a33726;
    --rouille-voile:#f8e6e2;
    --ciel:         #2b6382;
    --ciel-voile:   #e4eef4;

    /* Barre latérale */
    --nuit:         #151a34;
    --nuit-clair:   #232a4d;
    --nuit-encre:   #a3aac9;

    /* Typographie : pile système, aucune police à télécharger.
       L'application s'affiche donc à l'identique sur un poste sans Internet. */
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Géométrie : le rayon encode la hiérarchie, il n'est pas décoratif */
    --r-champ:   9px;
    --r-panneau: 13px;
    --r-modale:  18px;
    --r-pilule:  999px;

    /* Profondeur, teintée de bleu plutôt que de gris neutre */
    --ombre-1: 0 1px 2px rgba(21, 26, 52, .05);
    --ombre-2: 0 4px 14px rgba(21, 26, 52, .07);
    --ombre-3: 0 24px 56px rgba(21, 26, 52, .22);

    --rail: 244px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--papier);
    color: var(--encre);
    font: 400 14px/1.55 var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Les cases et boutons radio prennent la couleur de marque partout */
input[type="checkbox"], input[type="radio"] { accent-color: var(--bleu); }

h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--bleu-fonce); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--bleu); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--bleu);
    outline-offset: 2px;
    border-radius: 6px;
}

.skip {
    position: absolute; left: -9999px;
    background: var(--encre); color: #fff;
    padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--r-champ) 0;
}
.skip:focus { left: 0; top: 0; }

.ico { flex: none; }
.muted { color: var(--ardoise); }

/* Les chiffres restent alignés colonne par colonne grâce aux chiffres
   tabulaires de la police système : pas besoin d'une police à chasse fixe. */
.figure, .code, .stamp {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}
.figure { font-size: 13.5px; }
.stamp  { font-size: 12.5px; color: var(--ardoise); }

/* Un code se lit comme une référence : pastille discrète plutôt que chasse fixe */
.code {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--voile);
    border: 1px solid var(--trait);
    font-size: 12.5px;
    letter-spacing: .015em;
}
.unit   { font-size: 11.5px; color: var(--ardoise); }

/* --------------------------------------------------------------------------
   3. Gabarit
   -------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.work {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1440px;
    padding: 22px 30px 56px;
}

.foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 30px 22px;
    font-size: 12px;
    color: var(--ardoise);
    border-top: 1px solid var(--trait);
}

/* --------------------------------------------------------------------------
   4. Barre latérale
   -------------------------------------------------------------------------- */
.nav {
    flex: none;
    width: var(--rail);
    background: var(--nuit);
    color: var(--nuit-encre);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 18px 18px;
}

/* Pastille blanche portant le logo, lisible sur fond sombre */
.brandchip {
    flex: none;
    width: 32px; height: 32px;
    border-radius: 7px;
    background: #fff;
    padding: 2px;
    display: grid; place-items: center;
    overflow: hidden;
}
.brandchip img { width: 100%; height: 100%; object-fit: contain; }
.brandchip--lg { width: 40px; height: 40px; border-radius: 9px; }

/* Logo sur le panneau clair de la page de connexion */
.gate__logo { display: block; height: 58px; width: auto; margin-bottom: 24px; }

/* Section de tube : l'objet que l'usine fabrique */
.nav__mark {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--bleu);
    box-shadow: inset 0 0 0 4px var(--nuit), inset 0 0 0 6px var(--bleu-clair);
}

.nav__name {
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .02em;
    line-height: 1.2;
}
.nav__name small {
    display: block;
    font-weight: 400;
    font-size: 11.5px;
    color: var(--nuit-encre);
    letter-spacing: .06em;
}

.nav__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 10px 18px;
}

.nav__group {
    padding: 16px 8px 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
    color: #6a7296;
}

.nav__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--nuit-encre);
    text-decoration: none;
    font-size: 13.5px;
    transition: background .13s, color .13s;
}
.nav__link:hover { background: var(--nuit-clair); color: #e7eaf7; }

.nav__link.is-current {
    background: var(--nuit-clair);
    color: #fff;
    box-shadow: inset 2px 0 0 var(--bleu);
}
.nav__ico { width: 18px; height: 18px; opacity: .8; }
.nav__link.is-current .nav__ico { opacity: 1; color: var(--bleu-clair); }

.nav__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-top: 1px solid #262d52;
}

.who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }

.who__badge {
    flex: none;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #2b3462;
    color: #9aa6e6;
    font-size: 12px; font-weight: 600;
}
.who__text { min-width: 0; line-height: 1.3; }
.who__text strong {
    display: block; color: #fff; font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.who__text small { font-size: 11.5px; color: var(--nuit-encre); }

.who__out {
    flex: none;
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border: 0; border-radius: var(--r-champ);
    background: transparent; color: var(--nuit-encre);
    cursor: pointer;
}
.who__out:hover { background: var(--nuit-clair); color: #fff; }

.nav__veil { display: none; }

/* --------------------------------------------------------------------------
   5. Barre de titre
   -------------------------------------------------------------------------- */
.bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 30px 16px;
    border-bottom: 1px solid var(--trait);
    background: linear-gradient(var(--blanc), var(--voile));
}

.bar__head { flex: 1 1 auto; min-width: 0; }

.bar__title {
    font-size: 23px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.2;
}
.bar__kicker {
    margin-top: 3px;
    font-size: 13px;
    color: var(--ardoise);
    max-width: 62ch;
}

.bar__actions { display: flex; gap: 8px; flex: none; align-items: center; }

.bar__burger {
    display: none;
    flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 38px;
    border: 1px solid var(--trait); border-radius: var(--r-champ);
    background: var(--blanc); cursor: pointer;
    padding: 0 9px;
}
.bar__burger span { display: block; height: 1.6px; background: var(--encre-2); border-radius: 2px; }

/* --------------------------------------------------------------------------
   6. Messages
   -------------------------------------------------------------------------- */
.notes { display: grid; gap: 8px; margin-bottom: 18px; }

.note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--trait);
    border-left-width: 3px;
    border-radius: var(--r-champ);
    background: var(--blanc);
    font-size: 13.5px;
}
.note p { flex: 1 1 auto; }
.note__ico { width: 18px; height: 18px; margin-top: 1px; }

.note--success { border-left-color: var(--vert); background: var(--vert-voile); color: #145d41; }
.note--danger  { border-left-color: var(--rouille); background: var(--rouille-voile); color: #7d2a1d; }
.note--warning { border-left-color: var(--ambre);   background: var(--ambre-voile);   color: #7a4909; }
.note--info    { border-left-color: var(--ciel);    background: var(--ciel-voile);    color: #1f4a63; }

.note__close {
    flex: none; border: 0; background: transparent; cursor: pointer;
    color: inherit; opacity: .55; padding: 0; line-height: 0;
}
.note__close:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   7. Panneaux
   -------------------------------------------------------------------------- */
.panel {
    background: var(--blanc);
    border: 1px solid var(--trait);
    border-radius: var(--r-panneau);
    overflow: hidden;
    box-shadow: var(--ombre-1);
}

.panel__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--trait);
    background: var(--voile);
}
.panel__title { font-size: 14px; font-weight: 600; }
.panel__note  { font-size: 12.5px; color: var(--ardoise); margin-left: auto; }
.panel__body  { padding: 16px; }

.stack { display: grid; gap: 18px; }

/* --------------------------------------------------------------------------
   8. Boutons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid var(--trait-fort);
    border-radius: var(--r-champ);
    background: var(--blanc);
    color: var(--encre);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--ombre-1);
    transition: background .13s, border-color .13s, box-shadow .13s;
}
.btn:hover { background: var(--voile); border-color: var(--ardoise); color: var(--encre); }
.btn:active { box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }

.btn--main {
    background: var(--bleu);
    border-color: var(--bleu);
    color: #fff;
    box-shadow: 0 1px 2px rgba(41, 57, 144, .28);
}
.btn--main:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: #fff; }

.btn--danger { color: var(--rouille); border-color: #e2c3bc; }
.btn--danger:hover { background: var(--rouille-voile); border-color: var(--rouille); color: var(--rouille); }

.btn--quiet { border-color: transparent; background: transparent; box-shadow: none; }
.btn--quiet:hover { background: var(--voile); border-color: var(--trait); }

.btn--slim { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn--icon { padding: 7px; border-radius: 8px; }
.btn--icon .ico { width: 16px; height: 16px; }

.btn--wide { width: 100%; justify-content: center; padding: 12px 18px; font-size: 14.5px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------------------
   9. Champs de saisie
   -------------------------------------------------------------------------- */
.field {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--trait-fort);
    border-radius: var(--r-champ);
    background: var(--blanc);
    font-size: 14px;
    line-height: 1.4;
    transition: border-color .13s, box-shadow .13s;
}
.field:hover { border-color: var(--ardoise); }
.field:focus {
    outline: none;
    border-color: var(--bleu);
    box-shadow: 0 0 0 4px var(--bleu-voile);
}
.field:disabled { background: var(--voile); color: var(--ardoise); }
.field::placeholder { color: var(--ardoise); }
.field--slim { padding: 7px 11px; font-size: 13px; width: auto; }
.field--num  { font-variant-numeric: tabular-nums; text-align: right; }

select.field {
    appearance: none;
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236c7288' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m1.5 1.75 4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

textarea.field { min-height: 92px; resize: vertical; border-radius: var(--r-champ); }

/* Grille de formulaire : 12 colonnes */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px 16px;
}
.f-full  { grid-column: span 12; }
.f-half  { grid-column: span 6; }
.f-third { grid-column: span 4; }

.f-label {
    display: block;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--encre-2);
}
.f-label .req { color: var(--rouille); margin-left: 2px; }

.f-hint { margin-top: 4px; font-size: 12px; color: var(--ardoise); }

.f-suffix { position: relative; }
.f-suffix .field { padding-right: 46px; }
.f-suffix span {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 11.5px; color: var(--ardoise); pointer-events: none;
}

.f-section {
    grid-column: span 12;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--trait);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--encre-2);
}

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    width: 38px; height: 22px; flex: none;
    border-radius: 11px;
    background: var(--trait-fort);
    position: relative;
    transition: background .15s;
}
.switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--bleu); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--bleu-voile); }

/* Case à cocher habillée */
.tick { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; }
.tick input { margin: 2px 0 0; accent-color: var(--bleu); width: 16px; height: 16px; flex: none; }

/* --------------------------------------------------------------------------
   10. Barre d'outils / filtres
   -------------------------------------------------------------------------- */
.tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.tools__search { position: relative; flex: 1 1 260px; max-width: 380px; }
.tools__search .field { padding-left: 38px; border-radius: var(--r-pilule); }
.tools__search .ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--ardoise); pointer-events: none;
}

.tools__spacer { flex: 1 1 auto; }

/* Segments d'état (actifs / archivés / tous) */
.segments {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--trait);
    border-radius: var(--r-pilule);
    background: var(--voile);
    box-shadow: var(--ombre-1);
}
.segments a {
    padding: 6px 14px;
    border-radius: var(--r-pilule);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--encre-2);
    text-decoration: none;
    transition: background .13s, color .13s;
}
.segments a:hover { background: var(--blanc); color: var(--encre); }
.segments a.is-on { background: var(--bleu); color: #fff; box-shadow: 0 1px 2px rgba(41,57,144,.3); }

/* --------------------------------------------------------------------------
   9 bis. Sélecteur avec recherche
   -------------------------------------------------------------------------- */
.combo { position: relative; display: block; }

/* Dans une barre de filtres, le select n'a pas de largeur propre :
   sans minimum, le bouton s'effondrerait sur son contenu. */
.tools .combo,
.pager__density .combo,
.bar__actions .combo { min-width: 168px; }
.subnav__picker .combo { min-width: 0; }

/* Le select d'origine reste soumis avec le formulaire et reste focusable,
   pour que la validation native puisse s'y accrocher. */
.combo__native {
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0; padding: 0; margin: 0;
}

.combo__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236c7288' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m1.5 1.75 4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.combo__btn.is-empty { color: var(--ardoise); }
.combo.is-open .combo__btn {
    border-color: var(--bleu);
    box-shadow: 0 0 0 4px var(--bleu-voile);
}
.combo__native:invalid ~ .combo__btn { border-color: var(--trait-fort); }

.combo__pop {
    position: fixed;
    z-index: 200;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    background: var(--blanc);
    border: 1px solid var(--trait-fort);
    border-radius: 11px;
    box-shadow: var(--ombre-2), 0 16px 36px rgba(21, 26, 52, .16);
    overflow: hidden;
}

.combo__search { padding: 8px; border-bottom: 1px solid var(--trait); }
.combo__search .field { width: 100%; }

.combo__list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 5px;
    margin: 0;
    list-style: none;
}

.combo__group {
    padding: 9px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--ardoise);
}

.combo__opt {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13.5px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.combo__opt.is-active { background: var(--voile); }
.combo__opt.is-current { color: var(--bleu); font-weight: 500; }
.combo__opt.is-current.is-active { background: var(--bleu-voile); }
.combo__opt.is-off { color: var(--ardoise); cursor: not-allowed; }

.combo__none { padding: 16px 12px; text-align: center; font-size: 13px; color: var(--ardoise); }

/* --------------------------------------------------------------------------
   9 ter. Formulaire de saisie en deux volets
   -------------------------------------------------------------------------- */
.split-form {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
}
.split-form__main { padding: 18px; min-width: 0; }
.split-form__side {
    padding: 18px;
    border-left: 1px solid var(--trait);
    background: var(--voile);
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.split-form__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Champ non saisissable : la valeur vient d'un calcul */
.field--auto {
    background: var(--voile);
    border-style: dashed;
    color: var(--encre-2);
    font-variant-numeric: tabular-nums;
    cursor: default;
}
.field--auto:hover { border-color: var(--trait-fort); }

/* Récapitulatif compact sous le volet de droite */
.recap {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--trait);
    display: grid;
    gap: 7px;
}
.recap__line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}
.recap__line span:first-child { color: var(--ardoise); }
.recap__line b {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.recap__line--strong { font-size: 14.5px; }
.recap__line--strong b { font-size: 17px; letter-spacing: -.02em; }

@media (max-width: 1080px) {
    .split-form { grid-template-columns: 1fr; }
    .split-form__side { border-left: 0; border-top: 1px solid var(--trait); }
}

/* --------------------------------------------------------------------------
   10 bis. Onglets de module
   -------------------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--trait);
}
.tabs::-webkit-scrollbar { display: none; }

.tabs__link {
    flex: none;
    padding: 9px 15px;
    border-radius: 10px 10px 0 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ardoise);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .13s, background .13s;
}
.tabs__link:hover { background: var(--voile); color: var(--encre); }
.tabs__link.is-on { color: var(--bleu); border-bottom-color: var(--bleu); background: var(--bleu-voile); }

/* Grille de saisie multi-lignes (entrées parc, sorties, équipes) */
.rows { width: 100%; border-collapse: collapse; }
.rows th {
    padding: 0 8px 6px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--encre-2);
    white-space: nowrap;
}
.rows td { padding: 3px 4px; vertical-align: middle; }
.rows td:first-child, .rows th:first-child { padding-left: 0; }
.rows .rows__del {
    width: 1%;
    text-align: right;
}
.rows tfoot td {
    padding-top: 10px;
    font-size: 13px;
}

/* Ligne de totaux sous un tableau de données */
.grid tfoot td {
    padding: 11px 13px;
    background: var(--voile);
    border-top: 2px solid var(--trait-fort);
    font-weight: 600;
}

/* Cellule calculée, non saisissable */
.calc {
    display: block;
    padding: 10px 13px;
    border: 1px dashed var(--trait-fort);
    border-radius: var(--r-champ);
    background: var(--voile);
    color: var(--encre-2);
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 14px;
}

/* Tableau de stock : séparation visuelle entrées / sorties */
.stock-grid th.grp-in  { background: var(--bleu-voile); color: var(--bleu-fonce); }
.stock-grid th.grp-out { background: var(--ambre-voile); color: #7a4909; }
.stock-grid .grp-start { border-left: 2px solid var(--trait-fort); }
.stock-grid .grp-end   { border-right: 2px solid var(--trait-fort); }
.stock-grid tbody tr.type-head td {
    background: var(--voile);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .02em;
    color: var(--encre-2);
}

/* --------------------------------------------------------------------------
   11. Tableaux — le cœur de l'application
   -------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }

.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--voile);
    padding: 11px 13px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--encre-2);
    white-space: nowrap;
    border-bottom: 1px solid var(--trait-fort);
}

.grid tbody td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--trait);
    vertical-align: middle;
}

.grid tbody tr { box-shadow: inset 2px 0 0 transparent; }
.grid tbody tr { transition: background .1s; }
.grid tbody tr:hover { background: var(--bleu-voile); box-shadow: inset 3px 0 0 var(--bleu); }
.grid tbody tr:last-child td { border-bottom: 0; }

.grid tbody tr.is-archived td { color: var(--ardoise); }
.grid tbody tr.is-me { background: var(--bleu-voile); }

.num  { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 44px; color: var(--ardoise); font-variant-numeric: tabular-nums; font-size: 12px; }
.acts { width: 1%; white-space: nowrap; text-align: right; }
.acts form { display: inline; }
.acts .btn { margin-left: 4px; }

.cell-main { font-weight: 500; }
.cell-sub  { display: block; font-size: 12px; color: var(--ardoise); }

/* Identité dans un tableau */
.person { display: flex; align-items: center; gap: 10px; }
.person__badge {
    flex: none; width: 30px; height: 30px;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--bleu-voile); color: var(--bleu-fonce);
    font-size: 11.5px; font-weight: 600;
}

/* --------------------------------------------------------------------------
   12. Étiquettes
   -------------------------------------------------------------------------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}
.tag--on     { background: var(--vert-voile); color: #145d41; border-color: #bcded0; }
.tag--off    { background: var(--voile); color: var(--ardoise); border-color: var(--trait); }
.tag--warn   { background: var(--ambre-voile); color: #7a4909; border-color: #ecd4ac; }
.tag--stop   { background: var(--rouille-voile); color: #7d2a1d; border-color: #e8c6bf; }
.tag--info   { background: var(--ciel-voile); color: #1f4a63; border-color: #c3d9e5; }

.tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 34ch; }
.tag-list .tag { background: var(--voile); color: var(--encre-2); border-color: var(--trait); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --------------------------------------------------------------------------
   13. État vide
   -------------------------------------------------------------------------- */
.empty {
    padding: 46px 24px;
    text-align: center;
    color: var(--ardoise);
}
.empty h3 { font-size: 15px; font-weight: 600; color: var(--encre); margin-bottom: 5px; }
.empty p  { font-size: 13.5px; max-width: 46ch; margin: 0 auto 16px; }

/* --------------------------------------------------------------------------
   14. Pagination
   -------------------------------------------------------------------------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-top: 1px solid var(--trait);
    background: var(--voile);
    font-size: 12.5px;
    color: var(--ardoise);
}
.pager__range strong { color: var(--encre); font-variant-numeric: tabular-nums; font-weight: 600; }
.pager__density { display: flex; align-items: center; gap: 8px; }
.pager__pages { margin-left: auto; display: flex; align-items: center; gap: 3px; }

.pager__num, .pager__step {
    min-width: 30px; height: 30px;
    display: inline-grid; place-items: center;
    padding: 0 8px;
    border-radius: var(--r-pilule);
    color: var(--encre-2);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
}
.pager__num:hover, .pager__step:hover { background: var(--blanc); color: var(--encre); }
.pager__num.is-current { background: var(--bleu); color: #fff; }
.pager__step.is-off { opacity: .35; pointer-events: none; }
.pager__gap { padding: 0 3px; }

/* --------------------------------------------------------------------------
   15. Modale
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    padding: 24px;
    overflow-y: auto;
    background: rgba(21, 26, 52, .5);
}
.modal.is-open { display: block; }

.modal__box {
    background: var(--blanc);
    border-radius: var(--r-modale);
    max-width: 520px;
    margin: 24px auto;
    box-shadow: var(--ombre-3);
}
.modal__box--wide { max-width: 760px; }

.modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--trait);
}
.modal__title { font-size: 16px; font-weight: 600; flex: 1 1 auto; }
.modal__body  { padding: 18px; }
.modal__foot  {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 13px 18px;
    border-top: 1px solid var(--trait);
    background: var(--voile);
    border-radius: 0 0 var(--r-modale) var(--r-modale);
}

/* --------------------------------------------------------------------------
   16. Blocs de permissions (module Comptes)
   -------------------------------------------------------------------------- */
.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 10px; }

.perm {
    border: 1px solid var(--trait);
    border-radius: 11px;
    overflow: hidden;
    transition: border-color .13s;
}
.perm:hover { border-color: var(--trait-fort); }
.perm__top {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--voile);
    border-bottom: 1px solid var(--trait);
    font-size: 13px; font-weight: 500;
}
.perm__list { padding: 8px 10px; display: grid; gap: 6px; }
.perm__list:empty { display: none; }

/* --------------------------------------------------------------------------
   17. Page de connexion
   -------------------------------------------------------------------------- */
.gate {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(400px, 34vw, 560px);
    background: var(--blanc);
}

/* ---- Panneau gauche : l'identité et le dessin technique ---- */
.gate__art {
    position: relative;
    isolation: isolate;
    padding: 42px 48px 38px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    /* Une lueur bleue plutôt qu'un aplat : le panneau prend de la profondeur */
    background:
        radial-gradient(120% 90% at 12% 0%,  rgba(64, 84, 200, .38) 0%, transparent 58%),
        radial-gradient(90% 80% at 100% 100%, rgba(41, 57, 144, .55) 0%, transparent 60%),
        var(--nuit);
}

/* Grain très léger, pour casser le dégradé sur les écrans bas de gamme */
.gate__art::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: .5;
}

.gate__draw {
    position: absolute;
    right: -6%;
    bottom: -16%;
    width: min(700px, 56%);
    height: auto;
    z-index: -1;
    opacity: .55;
    /* Le dessin s'efface en approchant du texte : les deux ne se disputent
       plus le même espace. */
    -webkit-mask-image: linear-gradient(to left, #000 58%, transparent 100%);
            mask-image: linear-gradient(to left, #000 58%, transparent 100%);
}

.gate__brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
}
.gate__brand-name {
    display: block;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: .01em;
    line-height: 1.15;
}
.gate__brand-name small {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: .1em;
    color: var(--nuit-encre);
    text-transform: uppercase;
}

.gate__pitch {
    position: relative;
    margin: auto 0;
    max-width: 30ch;
}
.gate__eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    padding: 4px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--r-pilule);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #b9c3ef;
}
.gate__pitch h2 {
    font-size: clamp(22px, 2vw, 29px);
    font-weight: 650;
    line-height: 1.22;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.gate__pitch p {
    margin-top: 13px;
    max-width: 38ch;
    font-size: 14px;
    line-height: 1.62;
    color: #aab3d6;
}

/* Trois repères en bas du panneau, façon fiche technique */
.gate__facts {
    position: relative;
    z-index: 1;
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
}
.gate__fact strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.gate__fact span {
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6f7aa8;
}

/* ---- Panneau droit : le formulaire ---- */
.gate__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(28px, 5vw, 56px);
    border-left: 1px solid var(--trait);
}
.gate__inner { width: 100%; max-width: 384px; }

.gate__logo { display: block; height: 52px; width: auto; margin-bottom: 28px; }

.gate__inner h1 {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.032em;
    line-height: 1.1;
}
.gate__lead {
    margin: 9px 0 28px;
    color: var(--ardoise);
    font-size: 14px;
    line-height: 1.55;
}

.gate__fields { display: grid; gap: 16px; }
.gate__fields .btn--wide { margin-top: 4px; }

.gate__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.gate__foot {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--trait);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    font-size: 12px;
    color: var(--ardoise);
}

/* Champ mot de passe */
.pw-wrap { position: relative; }
.pw-wrap .field { padding-right: 66px; }
.pw-toggle {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    height: 32px; padding: 0 11px;
    display: grid; place-items: center;
    border: 0; border-radius: var(--r-pilule);
    background: transparent; color: var(--ardoise); cursor: pointer;
    font-size: 12px; font-weight: 500;
}
.pw-toggle:hover { background: var(--voile); color: var(--encre); }

/* Avertissement verrouillage majuscules : l'erreur de saisie la plus banale */
.caps {
    display: none;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    font-size: 12.5px;
    color: #7a4909;
}
.caps.is-on { display: flex; }
.caps svg { width: 15px; height: 15px; }

/* Jauge de robustesse du mot de passe */
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter i { flex: 1; height: 3px; border-radius: 2px; background: var(--trait); }
.pw-meter.lv1 i:nth-child(1) { background: var(--rouille); }
.pw-meter.lv2 i:nth-child(-n+2) { background: var(--ambre); }
.pw-meter.lv3 i:nth-child(-n+3) { background: #5a9e6d; }
.pw-meter.lv4 i { background: var(--vert); }
.pw-note { margin-top: 6px; font-size: 12px; color: var(--ardoise); }

/* Arrivée en douceur, désactivée si le système le demande */
@media (prefers-reduced-motion: no-preference) {
    .gate__inner > * { animation: gate-in .4s both; }
    .gate__inner > *:nth-child(2) { animation-delay: .04s; }
    .gate__inner > *:nth-child(3) { animation-delay: .08s; }
    .gate__inner > *:nth-child(4) { animation-delay: .12s; }
    @keyframes gate-in {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: none; }
    }
}

/* --------------------------------------------------------------------------
   17 bis. Colonne de sous-navigation (Référentiels)
   -------------------------------------------------------------------------- */
.split {
    display: grid;
    grid-template-columns: 222px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.subnav {
    position: sticky;
    top: 18px;
    background: var(--blanc);
    border: 1px solid var(--trait);
    border-radius: var(--r-panneau);
    padding: 9px;
    box-shadow: var(--ombre-1);
}
.subnav__group {
    padding: 12px 10px 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--ardoise);
}
.subnav__group:first-child { padding-top: 6px; }

.subnav__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--encre-2);
    text-decoration: none;
    line-height: 1.35;
}
.subnav__link:hover { background: var(--voile); color: var(--encre); }
.subnav__link.is-on {
    background: var(--bleu-voile);
    color: var(--bleu-fonce);
    font-weight: 500;
    box-shadow: inset 2px 0 0 var(--bleu);
}
.subnav__count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ardoise);
}
.subnav__link.is-on .subnav__count { color: var(--bleu); }

.subnav__picker { display: none; }

@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; gap: 14px; }
    .subnav { position: static; padding: 12px; }
    .subnav__group, .subnav__link { display: none; }
    .subnav__picker { display: block; }
}

/* --------------------------------------------------------------------------
   18. Résumés chiffrés
   -------------------------------------------------------------------------- */
.figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--trait);
    border: 1px solid var(--trait);
    border-radius: var(--r-panneau);
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: var(--ombre-1);
}
.figures > div { background: var(--blanc); padding: 15px 17px; }
.figures dt { font-size: 12px; color: var(--ardoise); }
.figures dd {
    margin: 5px 0 0;
    font-variant-numeric: tabular-nums;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.025em;
}

/* --------------------------------------------------------------------------
   18 bis. Tableau de bord
   -------------------------------------------------------------------------- */

/* Alertes : ce qui demande une décision, avant tout le reste */
.board-alerts { display: grid; gap: 8px; margin-bottom: 20px; }

.alert {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    background: var(--blanc);
    border: 1px solid var(--trait);
    border-left-width: 3px;
    border-radius: var(--r-champ);
    box-shadow: var(--ombre-1);
}
.alert__ico { width: 20px; height: 20px; flex: none; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__titre { font-size: 14px; font-weight: 600; }
.alert__detail { font-size: 13px; color: var(--ardoise); margin-top: 2px; }
.alert .btn { flex: none; }

.alert--danger  { border-left-color: var(--rouille); }
.alert--danger  .alert__ico { color: var(--rouille); }
.alert--warning { border-left-color: var(--ambre); }
.alert--warning .alert__ico { color: var(--ambre); }
.alert--info    { border-left-color: var(--ciel); }
.alert--info    .alert__ico { color: var(--ciel); }
.alert--ok      { border-left-color: var(--vert); }
.alert--ok      .alert__ico { color: var(--vert); }

/* Cartes d'indicateur */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi {
    display: flex;
    flex-direction: column;
    padding: 16px 17px;
    background: var(--blanc);
    border: 1px solid var(--trait);
    border-radius: var(--r-panneau);
    box-shadow: var(--ombre-1);
}
.kpi__titre {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ardoise);
    letter-spacing: .01em;
}
.kpi__valeur {
    margin-top: 7px;
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.03em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.kpi__unite { font-size: 14px; font-weight: 500; color: var(--ardoise); letter-spacing: 0; }

.kpi__delta {
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.kpi__delta span { font-weight: 400; color: var(--ardoise); }
.kpi__delta--bon      { color: var(--vert); }
.kpi__delta--mauvais  { color: var(--ambre); }
.kpi__delta--vide     { color: var(--ardoise); font-weight: 400; }

.kpi__aide {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ardoise);
    flex: 1 1 auto;
}
.kpi__lien {
    margin-top: 11px;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}
.kpi__lien::after { content: " →"; }

/* Deux panneaux côte à côte */
.board-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

/* Histogramme sur douze mois */
.chart { width: 100%; height: 200px; display: block; }
.chart__grid { stroke: var(--trait); stroke-width: 1; }
.chart__bar  { fill: var(--bleu); opacity: .32; transition: opacity .13s; }
.chart__bar:hover { opacity: .6; }
.chart__bar.is-now { opacity: 1; }
.chart__bar.is-neg { fill: var(--rouille); opacity: .6; }
.chart__label {
    fill: var(--ardoise);
    font-size: 11px;
    text-anchor: middle;
    font-family: var(--sans);
}

.spark { width: 120px; height: 34px; color: var(--bleu); }

/* Classement en barres horizontales */
.ranking { display: grid; gap: 9px; }
.ranking__row {
    display: grid;
    grid-template-columns: minmax(0, 10rem) 1fr auto;
    align-items: center;
    gap: 11px;
    font-size: 13px;
}
.ranking__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.ranking__track {
    height: 9px;
    border-radius: var(--r-pilule);
    background: var(--voile);
    overflow: hidden;
}
.ranking__fill {
    display: block;
    height: 100%;
    border-radius: var(--r-pilule);
    background: var(--bleu);
}
.ranking__fill.is-warn { background: var(--ambre); }
.ranking__value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 620px) {
    .alert { flex-wrap: wrap; }
    .alert .btn { margin-left: 33px; }
    .kpi__valeur { font-size: 26px; }
    .ranking__row { grid-template-columns: minmax(0, 7rem) 1fr auto; }
}

/* --------------------------------------------------------------------------
   19. Adaptation aux écrans
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
    .f-third { grid-column: span 6; }
}

@media (max-width: 980px) {
    .gate { grid-template-columns: 1fr; min-height: 0; }
    .gate__art { padding: 26px 24px 30px; }
    .gate__draw { width: 330px; right: -90px; bottom: -120px; opacity: .4; }
    .gate__pitch { margin: 26px 0 0; max-width: none; }
    .gate__pitch h2 { font-size: 21px; }
    .gate__pitch p { display: none; }
    .gate__facts { margin-top: 20px; gap: 22px; }
    .gate__form { padding: 34px 24px 54px; border-left: 0; }
    .gate__logo { height: 44px; margin-bottom: 22px; }
}

/* Sur un très grand écran, le dessin ne doit pas devenir démesuré. */
@media (min-width: 1700px) {
    .gate__draw { width: min(780px, 46%); }
    .gate__art  { padding: 52px clamp(48px, 6vw, 96px) 46px; }
}

@media (max-width: 860px) {
    .nav {
        position: fixed;
        z-index: 70;
        left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .3);
    }
    .nav.is-open { transform: none; }

    .nav__veil {
        display: block;
        position: fixed; inset: 0; z-index: 65;
        background: rgba(21, 26, 52, .45);
    }
    .nav__veil[hidden] { display: none; }

    .bar__burger { display: flex; }
    .bar  { padding: 14px 18px; }
    .page { padding: 18px 18px 44px; }
    .foot { padding: 14px 18px 20px; flex-direction: column; gap: 4px; }

    .f-half, .f-third { grid-column: span 12; }
    .tools__search { max-width: none; }
    .pager__pages { margin-left: 0; }
}

@media (max-width: 560px) {
    .bar__title { font-size: 19px; }
    .bar__actions .btn span { display: none; }
    .bar__actions .btn { padding: 8px 10px; }
    .modal { padding: 0; }
    .modal__box { margin: 0; min-height: 100vh; border-radius: 0; }
    .modal__foot { border-radius: 0; position: sticky; bottom: 0; }
}

/* --------------------------------------------------------------------------
   20. Préférences système
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    .nav, .bar__actions, .bar__burger, .tools, .pager, .acts, .foot, .note__close { display: none !important; }
    .shell { display: block; }
    .panel { border: 0; }
    body { background: #fff; }
}
