/* Charte Logideo Manager — voir LISEZMOI.md, section "Charte d'interface". */

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/public-sans-latin-wght-normal-29KbApT.woff2") format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/public-sans-latin-ext-wght-normal-S6ClAuw.woff2") format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Public Sans';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/public-sans-latin-wght-italic-dDq196u.woff2") format('woff2-variations');
}

:root {
    --lg-lagune: #0F5C6E;
    --lg-lagune-fonce: #0B4655;
    --lg-lagune-clair: #E3EFF2;
    --lg-encre: #1B2430;
    --lg-encre-douce: #556171;
    --lg-papier: #F7F8FA;
    --lg-blanc: #FFFFFF;
    --lg-trait: #D5DAE1;
    --lg-or: #C08A1E;
    --lg-or-clair: #FBF3E2;
    --lg-succes: #2E7D4F;
    --lg-danger: #B3261E;

    --lg-barre-haut: 3.5rem;
    --lg-menu-gauche: 15rem;

    /* Bootstrap */
    --bs-body-font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-size: 0.9375rem;
    --bs-body-line-height: 1.5;
    --bs-body-color: var(--lg-encre);
    --bs-body-bg: var(--lg-papier);
    --bs-secondary-color: var(--lg-encre-douce);
    --bs-border-color: var(--lg-trait);
    --bs-primary: var(--lg-lagune);
    --bs-primary-rgb: 15, 92, 110;
    --bs-success: var(--lg-succes);
    --bs-success-rgb: 46, 125, 79;
    --bs-danger: var(--lg-danger);
    --bs-danger-rgb: 179, 38, 30;
    --bs-warning: var(--lg-or);
    --bs-warning-rgb: 192, 138, 30;
    --bs-link-color: var(--lg-lagune);
    --bs-link-color-rgb: 15, 92, 110;
    --bs-link-hover-color: var(--lg-lagune-fonce);
    --bs-link-hover-color-rgb: 11, 70, 85;
    --bs-border-radius: 0.375rem;
    --bs-focus-ring-color: rgba(15, 92, 110, 0.35);
}

body {
    background: var(--lg-papier);
    color: var(--lg-encre);
    font-feature-settings: 'tnum' 0;
}

h1, .h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; }
h2, .h2 { font-size: 1.125rem; font-weight: 650; }
h3, .h3 { font-size: 1rem; font-weight: 650; }

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

/* Boutons */
.btn { font-weight: 550; }
.btn-primary {
    --bs-btn-bg: var(--lg-lagune);
    --bs-btn-border-color: var(--lg-lagune);
    --bs-btn-hover-bg: var(--lg-lagune-fonce);
    --bs-btn-hover-border-color: var(--lg-lagune-fonce);
    --bs-btn-active-bg: var(--lg-lagune-fonce);
    --bs-btn-active-border-color: var(--lg-lagune-fonce);
    --bs-btn-disabled-bg: var(--lg-lagune);
    --bs-btn-disabled-border-color: var(--lg-lagune);
    --bs-btn-focus-shadow-rgb: 15, 92, 110;
}
.btn-outline-primary {
    --bs-btn-color: var(--lg-lagune);
    --bs-btn-border-color: var(--lg-lagune);
    --bs-btn-hover-bg: var(--lg-lagune);
    --bs-btn-hover-border-color: var(--lg-lagune);
    --bs-btn-active-bg: var(--lg-lagune-fonce);
    --bs-btn-active-border-color: var(--lg-lagune-fonce);
    --bs-btn-focus-shadow-rgb: 15, 92, 110;
}
.btn-danger {
    --bs-btn-bg: var(--lg-danger);
    --bs-btn-border-color: var(--lg-danger);
}

.form-control:focus, .form-select:focus {
    border-color: var(--lg-lagune);
    box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}
.form-label { font-weight: 550; margin-bottom: 0.3rem; }

/* Barre du haut : liste des modules */
.lg-barre-haut {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--lg-barre-haut);
    background: var(--lg-encre);
    color: #fff;
}
.lg-barre-haut .navbar-brand {
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.lg-barre-haut .navbar-brand span { color: #8FC3CF; font-weight: 500; }
.lg-modules .nav-link {
    color: #C9D1DB;
    padding: 0 0.85rem;
    height: var(--lg-barre-haut);
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}
.lg-modules .nav-link:hover { color: #fff; }
.lg-modules .nav-link.active {
    color: #fff;
    border-bottom-color: #5FB0C2;
    font-weight: 600;
}
.lg-barre-haut .form-select {
    background-color: transparent;
    color: #fff;
    border-color: #3A4757;
    width: auto;
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23C9D1DB' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.lg-barre-haut .form-select option { color: var(--lg-encre); }
.lg-barre-haut .dropdown-toggle { color: #C9D1DB; }
.lg-barre-haut .dropdown-toggle:hover { color: #fff; }
.lg-barre-haut .navbar-toggler { border-color: #3A4757; }
.lg-barre-haut .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 991.98px) {
    .lg-modules .nav-link {
        height: auto;
        padding: 0.6rem 0;
        border-bottom: 0;
        border-left: 3px solid transparent;
        padding-left: 0.75rem;
    }
    .lg-modules .nav-link.active { border-left-color: #5FB0C2; }
}

/* Corps : menu contextuel + contenu */
.lg-corps { display: flex; min-height: calc(100vh - var(--lg-barre-haut)); }
.lg-menu-gauche {
    flex: 0 0 var(--lg-menu-gauche);
    background: var(--lg-blanc);
    border-right: 1px solid var(--lg-trait);
    padding: 1.25rem 0;
}
.lg-menu-gauche .lg-menu-titre {
    font-size: 1rem;
    font-weight: 650;
    padding: 0 1.25rem 0.75rem;
}
.lg-menu-gauche .nav-link {
    color: var(--lg-encre-douce);
    padding: 0.45rem 1.25rem;
    border-left: 3px solid transparent;
}
.lg-menu-gauche .nav-link:hover { color: var(--lg-encre); background: var(--lg-papier); }
.lg-menu-gauche .nav-link.active {
    color: var(--lg-lagune);
    background: var(--lg-lagune-clair);
    border-left-color: var(--lg-lagune);
    font-weight: 600;
}
.lg-menu-mobile { display: none; }
@media (max-width: 991.98px) {
    .lg-corps { display: block; }
    .lg-menu-gauche { display: none; }
    .lg-menu-mobile { display: block; padding: 1rem 1rem 0; }
}

.lg-contenu {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.5rem 2rem 3rem;
}
@media (max-width: 991.98px) { .lg-contenu { padding: 1rem 1rem 2.5rem; } }

.lg-entete-page {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.25rem;
}
.lg-entete-page h1 { margin: 0; }
.lg-fil { font-size: 0.8125rem; color: var(--lg-encre-douce); margin-bottom: 0.25rem; }
.lg-fil a { color: inherit; text-decoration: none; }
.lg-fil a:hover { color: var(--lg-lagune); }

/* Surfaces */
.lg-panneau {
    background: var(--lg-blanc);
    border: 1px solid var(--lg-trait);
    border-radius: var(--bs-border-radius);
}
.lg-panneau-corps { padding: 1.25rem 1.5rem; }
.lg-formulaire { max-width: 45rem; }

/* Tableaux denses */
.lg-table {
    --bs-table-bg: var(--lg-blanc);
    --bs-table-hover-bg: #F1F5F7;
    margin: 0;
    font-size: 0.875rem;
}
.lg-table thead th {
    background: var(--lg-papier);
    color: var(--lg-encre-douce);
    font-weight: 600;
    border-bottom: 1px solid var(--lg-trait);
    white-space: nowrap;
}
.lg-table td, .lg-table th { padding: 0.55rem 0.9rem; vertical-align: middle; }
.lg-table tbody tr:last-child td { border-bottom: 0; }

/* Montants et nombres */
.lg-montant, .lg-nombre {
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Statuts : toujours un texte, la couleur ne fait que doubler l'information */
.lg-statut {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 550;
}
.lg-statut::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}
.lg-statut-ok { color: var(--lg-succes); }
.lg-statut-alerte { color: var(--lg-danger); }
.lg-statut-echeance { color: #8A6212; }
.lg-statut-neutre { color: var(--lg-encre-douce); }

/* État vide */
.lg-vide {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--lg-encre-douce);
}
.lg-vide p { margin-bottom: 1rem; }

/* Connexion */
.lg-connexion {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.lg-connexion .lg-panneau { width: 100%; max-width: 24rem; }
.lg-connexion-marque { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.25rem; }
.lg-connexion-marque span { color: var(--lg-lagune); font-weight: 500; }

/* Messages */
.alert { border-radius: var(--bs-border-radius); }
.alert-success { --bs-alert-bg: #E6F2EA; --bs-alert-color: #1F5A38; --bs-alert-border-color: #BFDCC9; }
.alert-danger { --bs-alert-bg: #F8E6E5; --bs-alert-color: #8A1D17; --bs-alert-border-color: #EBC2BF; }
.alert-warning { --bs-alert-bg: var(--lg-or-clair); --bs-alert-color: #6E4E0E; --bs-alert-border-color: #EBD6A9; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Catalogue */
.lg-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.lg-categorie-lien {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--lg-trait);
    border-radius: 999px;
    background: var(--lg-blanc);
    color: var(--lg-encre);
    font-size: 0.8125rem;
    text-decoration: none;
}
.lg-categorie-lien:hover { border-color: var(--lg-lagune); color: var(--lg-lagune); }
.lg-categorie-lien .lg-nombre { color: var(--lg-encre-douce); }

.lg-panneau-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--lg-trait);
}
.lg-sous-section + .lg-sous-section { border-top: 1px solid var(--lg-trait); }
.lg-sous-section-titre {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem 0.5rem;
}
.lg-sous-section-titre h3 { font-size: 0.9375rem; color: var(--lg-encre-douce); }
.lg-vide-ligne { padding: 0.25rem 1.5rem 1rem; margin: 0; color: var(--lg-encre-douce); font-size: 0.875rem; }

.lg-prix {
    font-size: 1.25rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.lg-intertitre { font-size: 0.875rem; font-weight: 600; color: var(--lg-encre-douce); margin-bottom: 0.6rem; }
.lg-caracteristiques {
    display: grid;
    grid-template-columns: minmax(8rem, max-content) 1fr;
    gap: 0.35rem 1rem;
}
.lg-caracteristiques dt { font-weight: 500; color: var(--lg-encre-douce); }
.lg-caracteristiques dd { margin: 0; }
.lg-table-compacte td, .lg-table-compacte th { padding: 0.4rem 0.6rem; }
.lg-ligne-courante td { background: var(--lg-lagune-clair) !important; }
.lg-inactif { opacity: 0.7; }
.lg-texte { max-width: 70ch; }

.lg-ligne-caracteristique {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
@media (max-width: 575.98px) {
    .lg-ligne-caracteristique { grid-template-columns: 1fr; }
}

/* Barre du haut : 11 modules + année + compte doivent tenir sur une ligne dès 992 px. */
@media (min-width: 992px) {
    .lg-modules .nav-link { padding: 0 0.6rem; font-size: 0.875rem; }
    .lg-barre-haut .navbar-brand { margin-right: 1rem !important; }
    .lg-barre-haut .navbar-collapse > .d-flex { flex-wrap: nowrap !important; }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
    .lg-modules .nav-link { padding: 0 0.45rem; font-size: 0.8125rem; }
    .lg-barre-haut .navbar-brand { font-size: 1.1rem; }
}

/* Tableau de bord */
.lg-filtre-periode {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}
.lg-raccourcis { display: flex; gap: 0.9rem; font-size: 0.8125rem; padding-bottom: 0.35rem; }
.lg-tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.75rem;
}
.lg-tuile {
    background: var(--lg-blanc);
    border: 1px solid var(--lg-trait);
    border-radius: var(--bs-border-radius);
    padding: 0.9rem 1.1rem;
}
.lg-tuile-libelle { font-size: 0.8125rem; color: var(--lg-encre-douce); font-weight: 550; }
.lg-tuile-valeur {
    font-size: 1.5rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    margin: 0.2rem 0;
    white-space: nowrap;
}
.lg-tuile-aide { font-size: 0.75rem; color: var(--lg-encre-douce); }
.lg-tuile-attente .lg-tuile-valeur { color: #B5BDC8; }

.lg-graphiques {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1rem;
}
@media (max-width: 991.98px) { .lg-graphiques { grid-template-columns: 1fr; } }

/* Cartes du tableau de bord principal : 2 par ligne, hauteur fixe, défilement interne */
.lg-cartes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 991.98px) { .lg-cartes { grid-template-columns: 1fr; } }
.lg-carte {
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lg-carte-corps {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.lg-carte-corps .lg-table thead th { position: sticky; top: 0; z-index: 1; }
.lg-graphique { position: relative; height: 18rem; }
.lg-graphique-attente { color: var(--lg-encre-douce); margin: 0 0 0.75rem; }
.lg-legende {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    font-size: 0.8125rem;
}
.lg-pastille { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.35rem; }

/* Pipeline de vente */
.lg-statut-pipeline { display: inline-flex; align-items: center; font-size: 0.8125rem; font-weight: 550; white-space: nowrap; }
.lg-categorie-active { border-color: var(--lg-lagune); background: var(--lg-lagune-clair); color: var(--lg-lagune); font-weight: 600; }
.lg-frise {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    gap: 0.25rem;
}
.lg-frise li {
    flex: 1 1 7rem;
    padding: 0.45rem 0.6rem;
    border-top: 4px solid var(--lg-trait);
    font-size: 0.8125rem;
    color: var(--lg-encre-douce);
}
.lg-frise li.lg-frise-faite { border-top-color: #7FB3C2; color: var(--lg-encre); }
.lg-frise li.lg-frise-courante { border-top-color: var(--lg-lagune); color: var(--lg-lagune); font-weight: 650; }
.lg-action-statut details > summary { list-style: none; }
.lg-action-statut details > summary::-webkit-details-marker { display: none; }
.lg-motif {
    margin-top: 0.5rem;
    padding: 0.75rem;
    min-width: 18rem;
    border: 1px solid var(--lg-trait);
    border-radius: var(--bs-border-radius);
    background: var(--lg-blanc);
}
.lg-journal { list-style: none; margin: 0; padding: 0; }
.lg-journal li { padding: 0.8rem 1.5rem; border-bottom: 1px solid var(--lg-trait); }
.lg-journal li:last-child { border-bottom: 0; }
details > summary { cursor: pointer; }

/* Saisie des lignes de pièces : largeur minimale, défilement horizontal sur petit écran */
.lg-lignes { min-width: 56rem; }
.lg-lignes td { vertical-align: top; }
.lg-lignes textarea { min-height: 2.1rem; }

/* Signature électronique */
.lg-signature-apercu {
    display: inline-block;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--lg-trait);
    border-radius: var(--bs-border-radius);
    background: var(--lg-blanc);
}
.lg-signature-apercu img { max-height: 6rem; max-width: 18rem; }
