/* EleVachE V2 — feuille principale, seule source de style (CADRAGE § 10).
   Un écran neuf n'ajoute pas de CSS ponctuel : il réutilise les composants ci-dessous,
   tous visibles sur /styleguide. Mobile d'abord, WCAG AA, cibles tactiles ≥ 44 px, grille de 8 px.

   Sommaire : 1. Police · 2. Variables · 3. Base · 4. Mise en page · 5. Composants · 6. Styleguide · 7. Accessibilité et impression */

/* ---------- 1. Police : Inter variable 5.3.0 (OFL), hébergée dans le dépôt ---------- */

@font-face {
    font-family: Inter;
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("vendor/inter-5.3.0/inter-latin-wght-normal.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: Inter;
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("vendor/inter-5.3.0/inter-latin-ext-wght-normal.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;
}

/* ---------- 2. Variables : palette validée (CADRAGE § 10), vérifiée par tests/Noyau/PaletteTest.php ---------- */

:root, .theme-clair {
    --fond: #F6F4EF;
    --surface: #FFFFFF;
    --surface-2: #EFECE5;
    --texte: #1C231E;
    --texte-2: #59625B;
    --trait: #E3DFD6;
    --principal: #2F6B3F;
    --principal-doux: #E3EFE5;
    --sur-principal: #FFFFFF;
    --ocre: #9A5B0E;
    --ocre-doux: #F7EBDA;
    --bleu: #2F5D8C;
    --bleu-doux: #E1EAF4;
    --rouge: #B3261E;
    --rouge-doux: #FBE4E1;
    --ombre: 0 1px 2px rgba(28, 35, 30, .05), 0 6px 20px rgba(28, 35, 30, .05);
    --voile: rgba(28, 35, 30, .4);
    color-scheme: light;
}

/* Sombre : les deux blocs doivent rester identiques (le test le vérifie). */
@media (prefers-color-scheme: dark) {
    :root {
        --fond: #111512;
        --surface: #1A1F1B;
        --surface-2: #262C27;
        --texte: #ECEFEA;
        --texte-2: #A7B0A9;
        --trait: #2D342E;
        --principal: #86C994;
        --principal-doux: #1E3324;
        --sur-principal: #0E1510;
        --ocre: #E3A75C;
        --ocre-doux: #3A2B17;
        --bleu: #8DB6E2;
        --bleu-doux: #1A2A3C;
        --rouge: #F0A29A;
        --rouge-doux: #3A1F1C;
        --ombre: none;
        --voile: rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}
.theme-sombre {
    --fond: #111512;
    --surface: #1A1F1B;
    --surface-2: #262C27;
    --texte: #ECEFEA;
    --texte-2: #A7B0A9;
    --trait: #2D342E;
    --principal: #86C994;
    --principal-doux: #1E3324;
    --sur-principal: #0E1510;
    --ocre: #E3A75C;
    --ocre-doux: #3A2B17;
    --bleu: #8DB6E2;
    --bleu-doux: #1A2A3C;
    --rouge: #F0A29A;
    --rouge-doux: #3A1F1C;
    --ombre: none;
    --voile: rgba(0, 0, 0, .6);
    color-scheme: dark;
}

:root {
    /* Formes */
    --rayon-carte: 20px;
    --rayon-bouton: 14px;
    --rayon-pastille: 999px;
    --rayon-petit: 10px;

    /* Espacements (grille de 8 px) */
    --e1: 8px;
    --e2: 16px;
    --e3: 24px;
    --e4: 32px;
    --gouttiere: var(--e2);
    --largeur-max: 1100px;
    --largeur-laterale: 248px;
    --largeur-laterale-reduite: 64px;
    /* Haut d'un bloc qui reste en vue au défilement : sous l'en-tête collé en haut (ordinateur). */
    --sous-entete: 84px;
    --cible: 44px;
    --hauteur-onglets: 84px;

    /* Mouvement */
    --duree: 180ms;

    --police: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- 3. Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--fond);
    color: var(--texte);
    font: 14px/1.4 var(--police);  /* tailles communes à tous les thèmes (celles du thème Geek, 18/11/2026) */
    font-feature-settings: "cv11";  /* « a » à un étage d'Inter, plus lisible */
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 var(--e2); }
h1 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 14px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 12px; }
small { font-size: 12px; color: var(--texte-2); }
a { color: var(--principal); }
code, kbd { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

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

.icone { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

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

/* Chiffres : tabulaires, montants à droite, unités plus petites et plus claires */
.nombre { font-variant-numeric: tabular-nums; }
.montant { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.unite { font-size: .8em; font-weight: 500; color: var(--texte-2); }

/* ---------- 4. Mise en page ---------- */

/* Logo : la vache (symbole « vache » de icones.svg ; icônes de l application dans assets/icones/logo*) */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.logo-picto {
    display: inline-grid; place-items: center; flex: none;
    width: 36px; height: 36px; border-radius: 11px;
    background: var(--principal); color: var(--sur-principal);
}
.logo-picto .icone { width: 20px; height: 20px; }
.logo-picto-grand { width: 56px; height: 56px; border-radius: 17px; }
.logo-picto-grand .icone { width: 30px; height: 30px; }

/* En-tête (mobile : logo, exploitation, recherche, compte) */
.entete {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: var(--e1) var(--gouttiere);
    padding-top: max(var(--e1), env(safe-area-inset-top));
    background: var(--fond);
}
.exploitation-compacte {
    flex: 1; min-width: 0; min-height: var(--cible);
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--texte); text-decoration: none; font-weight: 600; font-size: 15px;
}
.exploitation-compacte span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exploitation-compacte .icone { width: 16px; height: 16px; color: var(--texte-2); }
.sans-navigation .entete { justify-content: space-between; }
/* Carte, exploitation, compte : groupés à droite de l'en-tête */
.entete-outils { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 26rem) {
    .entete { gap: 8px; }
    .entete .bouton-rond, .entete .avatar { width: 40px; height: 40px; }
}
/* Téléphone : recherche et outils sur une deuxième ligne, sous l'en-tête fixe (elle défile avec la page) */
.entete .entete-barre { display: none; }
.entete-raccourcis { display: flex; align-items: center; gap: 8px; flex: none; }
.entete-suite { display: flex; align-items: center; gap: 8px; padding: 0 var(--gouttiere) var(--e1); }
.plein-ecran .entete-suite { display: none; }   /* carte : toute la hauteur pour elle */
.recherche-globale { flex: 1; min-width: 0; }
.recherche-globale label {
    display: flex; align-items: center; gap: 10px;
    height: var(--cible); padding: 0 14px;
    border: 1px solid var(--trait); border-radius: 12px;
    background: var(--surface); color: var(--texte-2);
}
.recherche-globale .icone { width: 18px; height: 18px; flex: none; }
.recherche-globale input[type="search"] { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.recherche-globale label:focus-within { border-color: var(--principal); outline: 2px solid var(--principal); outline-offset: -1px; }
.recherche-globale kbd { display: none; padding: 2px 7px; border: 1px solid var(--trait); border-radius: 6px; color: var(--texte-2); }
@media (max-width: 26rem) {
    .entete-suite .bouton-rond { width: 40px; height: 40px; }
    .recherche-globale label { height: 40px; padding: 0 12px; }
}

/* Barre d'onglets mobile (84 px, élément actif dans une pastille) */
.onglets {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    min-height: var(--hauteur-onglets);
    padding: var(--e1) var(--e1) max(20px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--trait);
}
.onglets a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-height: var(--cible);
    min-width: 0;
    color: var(--texte-2); text-decoration: none;
    font-size: 12px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.onglet-picto { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px; }
.onglets a[aria-current="page"] { color: var(--principal); font-weight: 600; }
.onglets a[aria-current="page"] .onglet-picto { background: var(--principal-doux); }
@media (max-width: 22.4rem) {  /* téléphones de 320 à 360 px */
    .onglets { padding-inline: 2px; }
    .onglets a { font-size: 11px; letter-spacing: -.01em; }
    .onglet-picto { width: 48px; }
}

/* Barre latérale (ordinateur seulement) */
.laterale { display: none; }

.contenu {
    max-width: var(--largeur-max);
    margin: 0 auto;
    padding: var(--e2) var(--gouttiere) var(--e4);
}
.avec-navigation .contenu { padding-bottom: calc(var(--hauteur-onglets) + var(--e4)); }

.titre-page { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--e3); }
.titre-page h1 { margin: 0; }
.titre-page p { margin: var(--e1) 0 0; }
.surtitre { font-size: 12px; font-weight: 500; color: var(--texte-2); }

@media (min-width: 64rem) {
    :root { --gouttiere: clamp(24px, 3vw, 40px); }

    .avec-navigation { display: grid; grid-template-columns: var(--largeur-laterale) minmax(0, 1fr); }
    .laterale {
        position: sticky; top: 0; height: 100dvh; overflow-y: auto;
        display: flex; flex-direction: column; gap: var(--e3);
        padding: var(--e3) var(--e2);
        background: var(--surface);
        border-right: 1px solid var(--trait);
    }
    .laterale .logo { padding: 0 var(--e1); }
    .selecteur-exploitation {
        display: flex; align-items: center; justify-content: space-between; gap: var(--e1);
        min-height: 48px; padding: var(--e1) 12px;
        border: 1px solid var(--trait); border-radius: 12px;
        background: var(--fond); color: var(--texte); text-decoration: none; font-size: 14px;
    }
    .selecteur-exploitation span { display: flex; flex-direction: column; min-width: 0; }
    .selecteur-exploitation strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .selecteur-exploitation small { font-size: 12px; }
    .selecteur-exploitation .icone { width: 16px; height: 16px; color: var(--texte-2); }
    .laterale-nav { display: flex; flex-direction: column; gap: 2px; }
    .laterale-nav a {
        display: flex; align-items: center; gap: 12px;
        min-height: var(--cible); padding: 0 12px; border-radius: var(--rayon-petit);
        color: var(--texte); text-decoration: none; font-size: 13px; font-weight: 500;
    }
    .laterale-nav a .icone { width: 20px; height: 20px; color: var(--texte-2); }
    .laterale-nav a:hover { background: var(--surface-2); }
    .laterale-nav a[aria-current="page"] { background: var(--principal-doux); color: var(--principal); font-weight: 600; }
    .laterale-nav a[aria-current="page"] .icone { color: var(--principal); }
    .laterale-bas { margin-top: auto; padding-top: var(--e2); border-top: 1px solid var(--trait); }
    .laterale-bas a { color: var(--texte-2); }

    /* Menu réductible : icônes seules, libellé au survol (title) */
    .laterale-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); }
    .laterale-reduire {
        display: inline-flex; align-items: center; justify-content: center; flex: none;
        width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--rayon-petit);
        background: none; color: var(--texte-2); cursor: pointer;
    }
    .laterale-reduire:hover { background: var(--surface-2); color: var(--texte); }
    .laterale-reduire .icone { width: 18px; height: 18px; transition: transform .15s; }
    .menu-reduit.avec-navigation { grid-template-columns: var(--largeur-laterale-reduite) minmax(0, 1fr); }
    .menu-reduit .laterale { padding-inline: 8px; align-items: stretch; }
    .menu-reduit .laterale-tete { flex-direction: column; gap: var(--e1); }
    .menu-reduit .laterale .logo { padding: 0; justify-content: center; }
    .menu-reduit .laterale-libelle, .menu-reduit .selecteur-exploitation > span { display: none; }
    .menu-reduit .laterale-reduire .icone { transform: rotate(180deg); }
    .menu-reduit .selecteur-exploitation { justify-content: center; padding: var(--e1) 0; }
    .menu-reduit .laterale-nav a { justify-content: center; padding: 0; }

    .entete { padding-top: var(--e3); padding-bottom: 0; }
    .avec-navigation .logo-compact, .entete .exploitation-compacte, .entete-suite, .entete-raccourcis { display: none; }
    .entete .entete-barre { display: contents; }
    .recherche-globale { flex: 1 1 280px; max-width: 520px; }
    .recherche-globale input[type="search"] { font-size: 15px; }
    .recherche-globale kbd { display: inline; }
    .entete .entete-outils { margin-left: auto; }

    .onglets { display: none; }
    .avec-navigation .contenu { padding: var(--e3) var(--gouttiere) 48px; margin: 0; max-width: calc(var(--largeur-max) + 2 * var(--gouttiere)); }
    /* Pages de saisie : document, formulaire et relevé côte à côte ; documents et relevé côte à côte */
    .avec-navigation .contenu:has(.saisie-colonnes), .avec-navigation .contenu:has(.saisie-avec-releve) { max-width: 1400px; }
    .avec-navigation .contenu:has(.saisie-avec-document) { max-width: 1760px; }
    h1, .titre-page h1 { font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
}

/* ---------- 5. Composants ---------- */

/* Cartes */
.carte {
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-carte);
    box-shadow: var(--ombre);
    padding: 20px;
    margin-bottom: var(--e2);
}
.carte-etroite { max-width: 26rem; margin: var(--e4) auto; }
.carte-entete { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e1); margin-bottom: 12px; }
.carte-entete h2 { margin: 0; }
.carte-entete a { font-size: 14px; font-weight: 600; text-decoration: none; }
.carte-entete > .pastille { flex: none; white-space: nowrap; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: var(--e2); }
@media (min-width: 64rem) { .grille-cartes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; } }

/* Tuile chiffrée : libellé, valeur clé écrite en clair, note */
.carte-chiffre {
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--e2); border-radius: 18px;
    background: var(--surface); border: 1px solid var(--trait); box-shadow: var(--ombre);
}
.carte-chiffre-libelle { font-size: 12px; color: var(--texte-2); }
.carte-chiffre-valeur { font-size: 18px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.carte-chiffre-note { font-size: 12px; font-weight: 600; color: var(--texte-2); }

/* Progression (jours de pâturage…) */
.progression {
    display: block; width: 100%; height: 8px; margin: var(--e1) 0;
    appearance: none; border: 0; border-radius: var(--rayon-pastille);
    background: var(--surface-2); overflow: hidden;
}
.progression::-webkit-progress-bar { background: var(--surface-2); }
.progression::-webkit-progress-value { background: var(--principal); border-radius: var(--rayon-pastille); }
.progression::-moz-progress-bar { background: var(--principal); border-radius: var(--rayon-pastille); }

/* État vide : une icône, une phrase, le bouton pour commencer */
.vide { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--e4) var(--e3); }
.vide-icone { width: 48px; height: 48px; padding: 12px; box-sizing: content-box; border-radius: var(--rayon-pastille); background: var(--principal-doux); color: var(--principal); stroke-width: 1.8; margin-bottom: var(--e2); }
.vide-texte { font-size: 17px; font-weight: 500; max-width: 32rem; }
.vide p:last-child { margin-bottom: 0; }

/* Messages en place */
.message { display: block; padding: 12px var(--e2); border-radius: var(--rayon-bouton); }
/* Icône en tête : icône et texte côte à côte. Sinon, le texte et ses liens restent dans le flux. */
.message:has(> .icone:first-child) { display: flex; align-items: flex-start; gap: 10px; }
.message .icone { width: 20px; height: 20px; margin-top: 1px; }
.message-erreur { background: var(--rouge-doux); color: var(--rouge); }
.message-succes { background: var(--principal-doux); color: var(--principal); }
.message-info { background: var(--bleu-doux); color: var(--bleu); }
.message-alerte { background: var(--ocre-doux); color: var(--ocre); }

/* Notifications brèves (après enregistrement) */
.notifications {
    position: fixed; z-index: 30; left: var(--e2); right: var(--e2);
    bottom: calc(var(--hauteur-onglets) + var(--e2));
    display: grid; gap: var(--e1); justify-items: center;
    pointer-events: none;
}
.sans-navigation .notifications { bottom: var(--e3); }
.avec-navigation:has(.barre-actions) .notifications { bottom: calc(var(--hauteur-onglets) + 84px); }
.avec-navigation:has(.bouton-flottant) .notifications { bottom: calc(var(--hauteur-onglets) + 88px); }
.notification {
    display: flex; align-items: center; gap: 10px; margin: 0;
    max-width: 28rem; padding: 12px var(--e2);
    border-radius: var(--rayon-bouton);
    background: var(--texte); color: var(--fond);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    font-weight: 500; pointer-events: auto;
    animation: apparition var(--duree) ease-out;
    transition: opacity var(--duree), transform var(--duree);
}
.notification .icone { width: 20px; height: 20px; }
.notification-succes .icone { color: var(--principal-doux); }
.notification-erreur { background: var(--rouge); color: var(--surface); }
.notification.disparait { opacity: 0; transform: translateY(8px); }
@media (min-width: 64rem) { .notifications { left: auto; right: var(--e4); bottom: var(--e4); justify-items: end; } }
@keyframes apparition { from { opacity: 0; transform: translateY(8px); } }

/* Pastilles */
.pastille {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: var(--rayon-pastille);
    font-size: 12px; font-weight: 500; line-height: 1.3;
    background: var(--surface-2); color: var(--texte);
}
.pastille-principal { background: var(--principal-doux); color: var(--principal); font-weight: 600; }
.pastille-ocre { background: var(--ocre-doux); color: var(--ocre); font-weight: 600; }
.pastille-bleu { background: var(--bleu-doux); color: var(--bleu); font-weight: 600; }
.pastille-rouge { background: var(--rouge-doux); color: var(--rouge); font-weight: 600; }
.pastille .icone { width: 14px; height: 14px; }

/* Boutons */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--e1);
    min-height: var(--cible); padding: 10px 18px;
    background: var(--surface); color: var(--texte);
    border: 1px solid var(--trait); border-radius: var(--rayon-bouton);
    font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bouton .icone { width: 18px; height: 18px; }
.bouton:hover { background: var(--surface-2); }
.bouton-principal { background: var(--principal); color: var(--sur-principal); border-color: var(--principal); }
.bouton-principal:hover { background: var(--principal); filter: brightness(1.08); }
.bouton-large { width: 100%; min-height: 48px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: var(--e2); }
.liste-puces { margin: 0 0 var(--e2); padding-left: 1.3em; list-style: disc; }
.liste-puces li { margin: 4px 0; line-height: 1.4; }
.lien-conformite { margin: 0 0 var(--e2); font-size: 14px; }
/* Bouton « Lire avec Claude » et son message d'attente */
.lire-claude { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 var(--e2); }
.lire-claude small { flex: 1 1 14rem; }
.lien-conformite a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--cible); }
.lien-conformite .icone { width: 16px; height: 16px; }
.formulaire .actions { margin-bottom: 0; }
/* Enregistrer / Annuler sous toutes les cartes du formulaire, et non dans la dernière. */
.formulaire .actions-pied { margin-bottom: var(--e4); }
/* Formulaire en lecture seule (rôle sans droit d'écriture) : le fieldset ne change pas la mise en page. */
.fieldset-nu { display: contents; border: 0; padding: 0; margin: 0; min-width: 0; }
.cases-ligne { display: flex; flex-wrap: wrap; column-gap: var(--e3); }
.liens-contact { margin: 0; }

.bouton-rond, .avatar {
    display: inline-grid; place-items: center; flex: none;
    width: var(--cible); height: var(--cible); padding: 0;
    border-radius: var(--rayon-pastille);
    text-decoration: none; cursor: pointer;
}
.bouton-rond { border: 1px solid var(--trait); background: var(--surface); color: var(--texte); }
.bouton-rond .icone { width: 20px; height: 20px; }
.avatar { border: 0; background: var(--principal-doux); color: var(--principal); font-size: 15px; font-weight: 600; }

/* Action principale : bouton flottant en bas à droite */
.bouton-flottant {
    position: fixed; z-index: 15; right: var(--e2);
    bottom: calc(var(--hauteur-onglets) + var(--e2));
    display: inline-flex; align-items: center; gap: var(--e1);
    min-height: 56px; padding: 0 22px 0 18px;
    border-radius: var(--rayon-pastille);
    background: var(--principal); color: var(--sur-principal);
    box-shadow: 0 6px 20px rgba(28, 35, 30, .22);
    font-weight: 600; text-decoration: none;
}
@media (min-width: 64rem) { .bouton-flottant { right: var(--e4); bottom: var(--e4); } }

/* Menu « ⋯ » des actions secondaires */
.menu-actions { position: relative; }
.menu-actions summary { list-style: none; }
.menu-actions summary::-webkit-details-marker { display: none; }
.menu-actions-liste {
    position: absolute; z-index: 25; right: 0; top: calc(100% + 6px);
    min-width: 200px; padding: 6px;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-bouton);
    box-shadow: 0 8px 24px rgba(28, 35, 30, .14);
}
.menu-actions-liste a, .menu-actions-liste button {
    display: flex; align-items: center; min-height: var(--cible); padding: 0 12px;
    border: 0; border-radius: var(--rayon-petit); background: none;
    color: var(--texte); text-decoration: none; text-align: left; cursor: pointer;
}
.menu-actions-liste a:hover, .menu-actions-liste button:hover { background: var(--surface-2); }
.menu-actions-liste .menu-danger { color: var(--rouge); }

/* Listes : titre, sous-titre, valeur à droite */
.liste { list-style: none; margin: 0 0 var(--e2); padding: 0; }
.carte-liste { padding: 0; overflow: hidden; }
.liste > li + li { border-top: 1px solid var(--trait); }
.ligne {
    display: flex; align-items: center; gap: 14px;
    width: 100%; min-height: 56px; padding: 12px var(--e2);
    border: 0; background: none; color: var(--texte); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
a.ligne:hover, button.ligne:hover { background: var(--surface-2); }
.ligne-picto {
    display: grid; place-items: center; flex: none;
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--principal-doux); color: var(--principal);
}
.ligne-picto .icone { width: 20px; height: 20px; }
.ligne-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ligne-titre { font-weight: 500; }
.ligne-sous-titre { font-size: 12px; color: var(--texte-2); }
.ligne-valeur { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne-fleche { width: 18px; height: 18px; color: var(--texte-2); }

/* Choix (exploitations) : une ligne en carte */
.liste-choix { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.choix {
    width: 100%;
    display: flex; align-items: center; gap: 14px;
    min-height: 72px; padding: 14px var(--e2);
    background: var(--surface); color: var(--texte);
    border: 1px solid var(--trait); border-radius: var(--rayon-carte);
    box-shadow: var(--ombre);
    font: inherit; text-align: left; cursor: pointer;
}
.choix:hover { border-color: var(--principal); }
.choix-actif { border-color: var(--principal); background: var(--principal-doux); }

/* Tableau adaptatif : liste quand la place manque (~900 px d'écran sur mobile), tableau complet au-delà.
   Toujours dans <div class="tableau-cadre"> : la bascule dépend de la largeur réellement disponible.
   Cellules : .col-titre, .col-sous-titre, .col-valeur ; .col-detail est masquée en mode liste. */
.tableau-cadre { container-type: inline-size; margin-bottom: var(--e2); }
.tableau {
    width: 100%;
    border-collapse: separate; border-spacing: 0;
    background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte);
    box-shadow: var(--ombre); overflow: hidden;
}
.tableau th { font-size: 13px; font-weight: 600; color: var(--texte-2); text-align: left; }
.tableau th, .tableau td { padding: 12px var(--e2); }
.tableau tbody tr + tr td, .tableau thead + tbody tr:first-child td { border-top: 1px solid var(--trait); }
.tableau .nombre, .tableau .montant { white-space: nowrap; }
.tableau th.montant { text-align: right; }
.tableau .seulement-liste { display: none; }
.tableau .montant small { display: block; white-space: normal; } /* visible seulement en affichage liste (ci-dessous) */
@container (max-width: 52rem) {
    .tableau, .tableau tbody { display: block; }
    .tableau thead { display: none; }
    .tableau tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "titre valeur" "sous-titre valeur";
        align-items: center; column-gap: var(--e2);
        padding: 12px var(--e2);
    }
    .tableau tbody tr + tr { border-top: 1px solid var(--trait); }
    .tableau td { display: block; padding: 0; border: 0 !important; }
    .tableau .col-titre { grid-area: titre; font-weight: 500; }
    .tableau .col-sous-titre { grid-area: sous-titre; font-size: 14px; color: var(--texte-2); white-space: normal; text-align: left; }
    .tableau .col-valeur { grid-area: valeur; font-weight: 600; }
    .tableau .col-detail { display: none; }
    .tableau .seulement-liste { display: inline; font-weight: 400; color: var(--texte-2); }
}

/* Onglets d'un même domaine (fiche animal : Résumé, Sanitaire, Pesées, Lignée) */
.onglets-domaine {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    padding: 4px; margin-bottom: var(--e3);
    border-radius: var(--rayon-bouton); background: var(--surface-2);
}
.onglets-domaine a {
    display: grid; place-items: center; min-height: 40px; padding: 0 var(--e1);
    border-radius: var(--rayon-petit);
    color: var(--texte-2); text-decoration: none; font-size: 12px; font-weight: 500;
}
.onglets-domaine a[aria-current="page"] { background: var(--surface); color: var(--texte); font-weight: 600; box-shadow: var(--ombre); }

/* Formulaires : libellés au-dessus des champs, erreurs à côté du champ */
.formulaire { display: grid; gap: var(--e2); }
.champ { display: grid; gap: 6px; }
.champ > label, .formulaire > label:not(.case) { font-size: 12px; font-weight: 600; }
.champ label small { font-weight: 400; }
.case { display: flex; align-items: center; gap: 12px; min-height: var(--cible); font-weight: 400; }

input, select, textarea, button { font: inherit; color: inherit; }
input:not([type="checkbox"], [type="radio"]), select, textarea {
    width: 100%;
    min-height: var(--cible);
    padding: 10px 14px;
    font-size: 16px;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-bouton);
}
input:focus, select:focus, textarea:focus { border-color: var(--principal); outline: 2px solid var(--principal); outline-offset: -1px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--rouge); }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--principal); }
.champ-erreur { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 500; color: var(--rouge); }
.champ-erreur .icone { width: 16px; height: 16px; }

.champ-recherche { display: flex; gap: var(--e1); margin-bottom: var(--e3); }
.champ-recherche label {
    flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-bouton); color: var(--texte-2);
}
.champ-recherche label:focus-within { border-color: var(--principal); outline: 2px solid var(--principal); outline-offset: -1px; }
.champ-recherche input[type="search"] { border: 0; outline: 0; padding: 0; background: transparent; }

/* Panneau : glisse du bas sur mobile, fenêtre centrée sur ordinateur (<dialog>) */
.panneau {
    width: 100%; max-width: 100%; max-height: 90dvh;
    margin: auto 0 0; padding: 0;
    border: 0; border-radius: var(--rayon-carte) var(--rayon-carte) 0 0;
    background: var(--surface); color: var(--texte);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .2);
}
.panneau[open] { animation: glisse-haut var(--duree) ease-out; }
.panneau::backdrop { background: var(--voile); }
.panneau-corps { display: grid; gap: var(--e2); padding: 12px 20px max(20px, env(safe-area-inset-bottom)); }
.panneau-corps::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--trait); }
.panneau-entete { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); }
.panneau-entete h2 { margin: 0; }
@keyframes glisse-haut { from { transform: translateY(100%); } }
@media (min-width: 48rem) {
    .panneau { width: min(32rem, calc(100% - 2 * var(--e4))); margin: auto; border-radius: var(--rayon-carte); box-shadow: 0 16px 48px rgba(0, 0, 0, .25); }
    .panneau[open] { animation: apparition var(--duree) ease-out; }
    .panneau-corps { padding: var(--e3); }
    .panneau-corps::before { display: none; }
}

/* Panneau latéral (notes) : glisse de la droite, sur toute la hauteur, quelle que soit la largeur */
.panneau.panneau-lateral {
    width: min(26rem, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh;
    margin: 0 0 0 auto; border-radius: 0; overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .2);
}
.panneau.panneau-lateral[open] { animation: glisse-gauche var(--duree) ease-out; }
.panneau-lateral .panneau-corps { align-content: start; padding: max(12px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.panneau-lateral .panneau-corps::before { display: none; }
.panneau-lateral .carte-entete h3 { margin: 0; }
.note-rapide { display: grid; gap: var(--e2); }
.note-rapide .actions { margin: 0; }
@keyframes glisse-gauche { from { transform: translateX(100%); } }
@media (min-width: 48rem) {
    .panneau-lateral .panneau-corps { padding: var(--e3); }
}

/* Chargement : silhouettes grisées */
.squelette {
    display: block; height: 14px; margin: 10px 0; border-radius: var(--rayon-pastille);
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--trait) 50%, var(--surface-2) 100%) 0 0 / 200% 100%;
    animation: reflet 1.4s linear infinite;
}
.squelette-titre { width: 45%; height: 20px; }
.squelette-court { width: 60%; }
@keyframes reflet { to { background-position: -200% 0; } }

/* Fiche (liste de définitions) */
.fiche { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; }
.fiche dt { color: var(--texte-2); font-size: 14px; }
.fiche dd { margin: 0 0 12px; font-weight: 600; }
@media (min-width: 48rem) {
    .fiche { grid-template-columns: max-content 1fr; column-gap: var(--e3); row-gap: 12px; }
    .fiche dd { margin: 0; }
}

.connexion-logo { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: var(--e3); }
.connexion-logo h1 { margin: 12px 0 0; }
.connexion-logo p { margin: 0; }

/* Puces de filtre (catégories, années, lots) : une rangée qui défile à l'horizontale sur mobile */
.puces {
    display: flex; gap: var(--e1); margin: 0 calc(-1 * var(--gouttiere)) var(--e2); padding: 2px var(--gouttiere);
    overflow-x: auto; scrollbar-width: none;
}
.puces::-webkit-scrollbar { display: none; }
.puces a {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 14px; border-radius: var(--rayon-pastille);
    border: 1px solid var(--trait); background: var(--surface);
    color: var(--texte); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.puces a span { color: var(--texte-2); }
.puces a[aria-current="true"] { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.puces a[aria-current="true"] span { color: inherit; opacity: .85; }
.puces-secondaires a { min-height: 32px; font-size: 13px; }
@media (min-width: 64rem) { .puces { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; } }

/* Variantes de lignes */
.ligne-picto-bleu { background: var(--bleu-doux); color: var(--bleu); }
.ligne-picto { font-size: 18px; font-weight: 600; }
.ligne-date { flex: none; width: 32px; font-size: 20px; font-weight: 700; color: var(--texte-2); text-align: center; }
.ligne-haute { align-items: flex-start; }
.ligne-compacte { min-height: 48px; padding-inline: 0; }
.titre-mois { margin: var(--e3) 0 var(--e1); font-size: 15px; color: var(--texte-2); text-transform: none; }
.pastille-petite { padding: 2px 8px; font-size: 12px; }

/* En-tête de fiche (animal) */
.barre-retour { margin: calc(-1 * var(--e1)) 0 var(--e1); }
.lien-retour { display: inline-flex; align-items: center; gap: 4px; min-height: var(--cible); padding-right: var(--e1); font-weight: 600; text-decoration: none; }
.identite { display: flex; align-items: center; gap: var(--e2); margin-bottom: var(--e2); }
.identite-photo {
    display: grid; place-items: center; flex: none;
    width: 88px; height: 88px; border-radius: 24px;
    background: var(--surface-2); color: var(--texte-2); font-size: 36px;
}
.identite-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.identite-texte h1 { margin: 0; font-size: 30px; line-height: 36px; }

/* Ligne de temps (historique) */
.chronologie { list-style: none; margin: 0 0 var(--e3); padding: 0; }
.chronologie li { position: relative; display: flex; flex-direction: column; padding: 0 0 18px 26px; }
.chronologie li::before { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--texte-2); }
.chronologie li::after { content: ""; position: absolute; left: 5px; top: 22px; bottom: 2px; width: 2px; background: var(--trait); }
.chronologie li:last-child::after { display: none; }
.chronologie-principal::before { background: var(--principal) !important; }
.chronologie-ocre::before { background: var(--ocre) !important; }
.chronologie-bleu::before { background: var(--bleu) !important; }
.chronologie-rouge::before { background: var(--rouge) !important; }
.chronologie-titre { font-weight: 500; }
.chronologie-detail { font-size: 14px; color: var(--texte-2); }

/* Graphique (SVG fait main, sans bibliothèque) */
.graphique { display: block; width: 100%; height: auto; overflow: visible; }
.graphique-axe { stroke: var(--trait); stroke-width: 1; }
.graphique-aire { fill: var(--principal-doux); stroke: none; }
.graphique-ligne { fill: none; stroke: var(--principal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.graphique-point { fill: var(--principal); stroke: var(--surface); stroke-width: 2; }
.graphique-valeur { fill: var(--texte); font: 600 12px var(--police); }
.graphique-legende { fill: var(--texte-2); font: 11px var(--police); }

/* Cartes particulières */
.carte-alerte { border-color: var(--ocre); background: var(--ocre-doux); }
.carte-alerte .ligne-titre, .carte-alerte h2 { color: var(--texte); }
.carte-depliable { padding: 0; }
.carte-depliable > summary { list-style: none; cursor: pointer; padding: var(--e2) 20px; margin: 0; align-items: center; }
.carte-depliable > summary::-webkit-details-marker { display: none; }
.carte-depliable > summary :is(h2, h3) { margin: 0; }
.carte-depliable > .liste { margin: 0; border-top: 1px solid var(--trait); }
.paturages-anciens { margin-top: var(--e2); }
.soin h2 { font-size: 16px; }
.soin-animaux { display: flex; flex-wrap: wrap; gap: 6px; }
.soin-animaux .pastille { text-decoration: none; }

/* Barre d'actions d'une fiche : fixée au-dessus des onglets sur mobile, en ligne sur ordinateur */
.barre-actions {
    position: fixed; z-index: 15; left: 0; right: 0; bottom: var(--hauteur-onglets);
    display: flex; align-items: center; gap: 12px;
    padding: 12px var(--gouttiere);
    background: var(--fond); border-top: 1px solid var(--trait);
}
.barre-actions .bouton-principal { flex: 1; }
.avec-navigation .contenu:has(.barre-actions) { padding-bottom: calc(var(--hauteur-onglets) + 96px); }
.menu-vers-le-haut { top: auto; bottom: calc(100% + 6px); }
@media (min-width: 64rem) {
    .barre-actions { position: static; padding: 0; margin-bottom: var(--e3); background: none; border: 0; }
    .barre-actions .bouton-principal { flex: none; }
    .menu-vers-le-haut { top: calc(100% + 6px); bottom: auto; left: 0; right: auto; }
}

.titre-page-actions { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }

/* Boutons de suppression discrets (historique, pesées, soins) */
.bouton-supprimer {
    display: inline-grid; place-items: center; flex: none;
    width: 36px; height: 36px; padding: 0; margin: -4px -6px -4px 0;
    border: 0; border-radius: var(--rayon-pastille); background: none;
    color: var(--texte-2); cursor: pointer;
}
.bouton-supprimer .icone { width: 16px; height: 16px; }
.bouton-supprimer:hover { background: var(--rouge-doux); color: var(--rouge); }
/* Même bouton, sans rouge (modifier) */
.bouton-discret {
    display: inline-grid; place-items: center; flex: none;
    width: 36px; height: 36px; border-radius: var(--rayon-pastille);
    padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--texte-2);
}
.bouton-discret .icone { width: 16px; height: 16px; }
.bouton-discret:hover { background: var(--surface-2); color: var(--texte); }
.chronologie li { padding-right: 40px; }
.chronologie-action { position: absolute; right: 0; top: 0; }
.tableau .col-action { width: 1%; text-align: right; }
.tableau .col-action:has(.actions-passage) { width: auto; }
.actions-passage { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
@container (max-width: 52rem) { .tableau .col-action { grid-area: action; } .tableau tr:has(.col-action) { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "titre valeur action" "sous-titre valeur action"; } }

/* Formulaires de saisie */
.carte-formulaire { max-width: 40rem; }
.grille-champs { display: grid; gap: var(--e2); align-items: start; }
@media (min-width: 30rem) { .grille-champs { grid-template-columns: 1fr 1fr; } }
fieldset.champ { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.champ legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.puces-choix { display: flex; flex-wrap: wrap; gap: var(--e1); }
.puces-choix label { position: relative; display: block; font-weight: 500; }
.puces-choix input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.puces-choix span {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
    border: 1px solid var(--trait); border-radius: var(--rayon-pastille); background: var(--surface);
}
.puces-choix input:checked + span { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.puces-choix input:focus-visible + span { outline: 3px solid var(--principal); outline-offset: 2px; }
.pastille-retirable { display: inline-flex; }
.pastille-croix { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: -2px -6px -2px 2px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.pastille-croix .icone { width: 14px; height: 14px; }
.pastille-croix:hover { background: var(--surface); }

/* Arbre de descendance : liste indentée avec traits, lisible sur téléphone */
.arbre, .arbre ul { list-style: none; margin: 0; padding: 0; }
.arbre ul { margin-left: 10px; padding-left: 14px; border-left: 2px solid var(--trait); }
.arbre li { position: relative; padding: 3px 0; }
.arbre ul > li::before { content: ""; position: absolute; left: -14px; top: 17px; width: 10px; border-top: 2px solid var(--trait); }
.arbre-noeud {
    display: inline-flex; align-items: baseline; gap: 6px; min-height: 30px; padding: 4px 10px;
    border-radius: var(--rayon-pastille); background: var(--surface-2); color: var(--texte-2);
    font-size: 14px; text-decoration: none;
}
.arbre-noeud small { font-size: 12px; color: inherit; opacity: .8; }
.arbre-present.arbre-femelle { background: var(--principal-doux); color: var(--principal); font-weight: 600; }
.arbre-present.arbre-male { background: var(--bleu-doux); color: var(--bleu); font-weight: 600; }
.arbre-boucherie { background: var(--ocre-doux); color: var(--ocre); }
.arbre-mort { background: var(--rouge-doux); color: var(--rouge); text-decoration: line-through; }
.arbre-inconnu { background: none; border: 1px dashed var(--trait); }
.arbre-courant { outline: 2px solid var(--principal); outline-offset: 1px; }
.legende-arbre .arbre-noeud { min-height: 0; padding: 1px 8px; font-size: 12px; }
.carte-depliable-corps { padding: var(--e2) 20px 20px; border-top: 1px solid var(--trait); overflow-x: auto; }
.titre-section { margin-top: var(--e4); }
.lignee { list-style: none; margin: 0 0 var(--e3); padding: 0; display: grid; gap: 6px; }
.lignee li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-left: calc(var(--rang, 0) * 12px); }
.lignee-rang { min-width: 9.5rem; font-size: 14px; color: var(--texte-2); }
.lignee a { font-weight: 500; text-decoration: none; }
.ligne-compacte-padding { min-height: 52px; }

/* Onglets de domaine nombreux : défilement horizontal plutôt que débordement */
.onglets-domaine { grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; scrollbar-width: none; }
.onglets-domaine::-webkit-scrollbar { display: none; }
.onglets-domaine a { padding: 0 12px; }

/* Carte (Leaflet) */
.carte-conteneur { position: relative; margin-bottom: var(--e2); }
.carte-leaflet {
    height: calc(100dvh - 260px - var(--hauteur-onglets)); min-height: 320px;
    border-radius: var(--rayon-carte); border: 1px solid var(--trait); overflow: hidden;
    background: var(--surface-2);
}
.carte-conteneur-petit .carte-leaflet { height: 240px; min-height: 0; }
@media (min-width: 64rem) { .carte-leaflet { height: calc(100dvh - 240px); } }
.plein-ecran .contenu { padding-bottom: calc(var(--hauteur-onglets) + var(--e2)); }
.titre-page-compact { margin-bottom: var(--e1); }
.bouton-carte { position: absolute; z-index: 500; left: 12px; bottom: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.bouton-carte-droite { left: auto; right: 12px; bottom: 24px; }
.carte-position { position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 68px; margin: 0; padding: 8px 12px; border-radius: var(--rayon-bouton); background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); font-size: 14px; }
.leaflet-container { font: 14px/1.4 var(--police); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--texte); border-radius: var(--rayon-bouton); }
.leaflet-popup-content a { color: var(--principal); font-weight: 600; }
.leaflet-control-layers, .leaflet-bar a { background: var(--surface); color: var(--texte); }
.leaflet-control-layers-expanded { padding: 10px 12px; border-radius: var(--rayon-bouton); }
.carte-etiquette-lot span {
    display: inline-block; transform: translate(-50%, calc(-50% + var(--rang, 0) * 24px)); white-space: nowrap; cursor: pointer;
    padding: 2px 8px; border-radius: var(--rayon-pastille);
    background: var(--ocre-doux); color: var(--ocre); font-size: 12px; font-weight: 700;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.carte-etiquette-choisie span { background: var(--ocre); color: var(--surface); outline: 3px solid var(--surface); }

/* Gestion (comptabilité) */
.colonnes-2 { display: grid; gap: 0 var(--e3); }
@media (min-width: 64rem) { .colonnes-2 { grid-template-columns: 1fr 1fr; } }
.carte-lien { color: inherit; text-decoration: none; }
.carte-lien:hover { border-color: var(--principal); }
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e1); margin-bottom: var(--e3); }
.filtres input[type="search"] { min-width: 12rem; }
.filtres > label:first-of-type, .filtres select { flex: 1 1 12rem; }
.titre-groupe { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--e1); }
.jauge { display: block; width: 100%; height: 6px; margin-top: 6px; border: 0; border-radius: 3px; background: var(--surface-2); appearance: none; }
.jauge::-webkit-meter-bar { height: 6px; border: 0; border-radius: 3px; background: var(--surface-2); }
.jauge::-webkit-meter-optimum-value, .jauge::-webkit-meter-suboptimum-value, .jauge::-webkit-meter-even-less-good-value { border-radius: 3px; background: var(--texte-2); }
.jauge::-moz-meter-bar { border-radius: 3px; background: var(--texte-2); }
.jauge-principal::-webkit-meter-optimum-value, .jauge-principal::-webkit-meter-suboptimum-value, .jauge-principal::-webkit-meter-even-less-good-value { background: var(--principal); }
.jauge-principal::-moz-meter-bar { background: var(--principal); }
.jauge-ocre::-webkit-meter-optimum-value, .jauge-ocre::-webkit-meter-suboptimum-value, .jauge-ocre::-webkit-meter-even-less-good-value { background: var(--ocre); }
.jauge-ocre::-moz-meter-bar { background: var(--ocre); }
.jauge-rouge::-webkit-meter-optimum-value, .jauge-rouge::-webkit-meter-suboptimum-value, .jauge-rouge::-webkit-meter-even-less-good-value { background: var(--rouge); }
.jauge-rouge::-moz-meter-bar { background: var(--rouge); }
.tableau-compact td, .tableau-compact th { padding-top: 6px; padding-bottom: 6px; }
.ligne-case { cursor: pointer; }
.ligne-case > input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0 4px 0 0; accent-color: var(--principal); }
.libelle-releve { margin-top: 0; white-space: normal; }
.mois-tresorerie > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); }
.mois-tresorerie > summary .nombre, .liste .ligne-droite .nombre { white-space: nowrap; }
.mois-tresorerie .ligne-droite form { display: inline; }
.credit-entete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--e1); }
.annuites { margin-bottom: var(--e3); }
.annuites .titre-groupe { margin-bottom: var(--e1); }
.annuites .titre-groupe h2 { margin: 0; }
.annuites .pastille { margin-left: 6px; vertical-align: 1px; }

/* Export : choix de l'exercice, pièces pour le comptable */
.choix-exercice-export { margin-bottom: var(--e2); }
.choix-exercice-export label { font-size: 14px; font-weight: 600; }
.choix-exercice-export select { width: auto; min-width: 9rem; }
.complement-envoi { margin: var(--e2) 0; }
.complement-envoi > summary { cursor: pointer; }
.complement-envoi .liste { margin-top: var(--e1); }
#pieces-comptable h3 { margin-top: var(--e3); }
#pieces-comptable .ligne-avec-action form { display: flex; align-items: center; }

/* Page Saisie : documents à saisir et relevé à pointer côte à côte */
.saisie-colonnes { display: grid; gap: var(--e3); }
@media (min-width: 64rem) {
    .saisie-colonnes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    /* Le relevé est long : les documents à saisir restent en vue pendant qu'on le parcourt. */
    .saisie-colonnes > .saisie-colonne:first-child { position: sticky; top: var(--sous-entete); max-height: calc(100dvh - var(--sous-entete) - var(--e2)); overflow-y: auto; }
}
.saisie-colonne > h2 { margin-top: 0; }
.saisie-colonne > .carte, .saisie-colonne > .propositions { margin-bottom: var(--e2); }
.saisie-colonne .icone { width: 16px; height: 16px; vertical-align: -3px; }
.saisie-liens { font-size: 14px; }
.recherche-releve { display: flex; gap: var(--e1); margin-bottom: var(--e2); }
.releve-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); margin-bottom: var(--e2); }
.releve-tete h2 { margin: 0; }
.releve-exercice label { font-size: 14px; font-weight: 600; }
.releve-exercice select { width: auto; min-width: 9rem; }
.releve-mois { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e1); margin: var(--e3) 0 var(--e1); font-size: 15px; }
.saisie-colonne .releve-mois + .liste { margin-bottom: 0; }
/* Opération déjà pointée : plus claire et en italique (les opérations à pointer restent nettes). */
.operation-pointee .ligne-texte, .operation-pointee .ligne-droite > .nombre { font-style: italic; color: var(--texte-2); }
.operation-pointee .ligne-titre { font-weight: 400; }
.recherche-releve input[type="search"] { flex: 1; min-width: 0; }
.recherche-releve .bouton { flex: none; }
.depot-factures .champ label { font-weight: 600; }
.depot-lot { display: grid; gap: var(--e1); }
.depot-lot-etat { margin: 0; font-size: 14px; color: var(--texte-2); overflow-wrap: anywhere; }
.depot-lot-problemes { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--rouge); overflow-wrap: anywhere; }
.depot-lot-problemes:empty { display: none; }
.depot-lot .bouton { justify-self: start; }

/* Saisie d'une facture à côté de son document, avec le relevé à droite (comme dans la V1) */
.saisie-document { display: grid; gap: var(--e3); }
@media (min-width: 64rem) {
    .saisie-document { align-items: start; }
    .saisie-avec-document { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .saisie-avec-releve:not(.saisie-avec-document) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
    .saisie-avec-document .releve-saisie { grid-column: 2; }
    .apercu-document { position: sticky; top: var(--sous-entete); }
}
@media (min-width: 85rem) {
    .saisie-avec-document.saisie-avec-releve { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.85fr); }
    .saisie-avec-document .releve-saisie { grid-column: auto; }
}
/* Très grands écrans : les pages de saisie prennent toute la largeur. Le formulaire garde une largeur lisible ;
   la place gagnée va au document (aperçu plus grand) et au relevé. */
@media (min-width: 100rem) {
    .avec-navigation .contenu:has(.saisie-colonnes), .avec-navigation .contenu:has(.saisie-avec-releve),
    .avec-navigation .contenu:has(.saisie-avec-document) { max-width: none; }
    .saisie-document .carte-formulaire { max-width: none; }
    .saisie-avec-releve:not(.saisie-avec-document) { grid-template-columns: minmax(0, 46rem) minmax(0, 1fr); }
    .saisie-avec-document:not(.saisie-avec-releve) { grid-template-columns: minmax(0, 1fr) minmax(0, 46rem); }
    .saisie-avec-document.saisie-avec-releve { grid-template-columns: minmax(0, 1.25fr) minmax(0, 42rem) minmax(0, 1fr); }
    .apercu-cadre { height: calc(100dvh - var(--sous-entete) - 5rem); }
    .apercu-image { max-height: calc(100dvh - var(--sous-entete) - 5rem); }
}
@media (min-width: 64rem) { .releve-saisie { position: sticky; top: var(--sous-entete); max-height: calc(100dvh - var(--sous-entete) - var(--e2)); overflow-y: auto; } }
.releve-saisie h2 { margin: 0; }
.reglement-choisi { margin-bottom: var(--e1); }
.reglement-choisi p { margin: 0 0 var(--e1); font-size: 14px; }
.reglement-retenu strong { font-weight: 600; }
.reglement-retenu small { display: block; color: var(--texte-2); font-size: 12px; }
.reglement-retenu .reglement-note { color: var(--ocre, var(--texte-2)); margin-top: 2px; }
.reglement-boutons { display: flex; flex-wrap: wrap; gap: var(--e1); }
.reglement-astuce { display: block; margin-top: var(--e1); font-size: 12px; }
.reglement-liste { margin: 2px 0 0; padding-left: 18px; }
.reglement-liste li { margin: 2px 0; }
/* Fiche « Virement à effectuer » : dans la page, ou seule dans une fenêtre au premier plan (Picture-in-Picture). */
.fiche-virement { margin: var(--e1) 0; padding: 12px; border: 1px solid var(--trait); border-radius: var(--rayon-petit); background: var(--surface-2); }
.fiche-virement-titre { margin: 0 0 8px; font-weight: 600; }
.fiche-virement dl { margin: 0; }
.fiche-virement-ligne { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--trait); }
.fiche-virement-ligne dt { color: var(--texte-2); font-size: 13px; }
.fiche-virement-ligne dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.fiche-virement-actions { display: flex; flex-wrap: wrap; gap: var(--e1); margin: 10px 0 0; }
body.fiche-virement-fenetre { margin: 0; padding: 12px; background: var(--fond); color: var(--texte); }
.releve-saisie-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); margin-bottom: var(--e1); }
/* Avec JavaScript : les opérations pointées seulement sur demande (« Tout afficher »). */
.releve-filtre:not(.releve-tout) .releve-pointee, .releve-filtre.releve-tout .releve-aucune-a-pointer { display: none; }
.releve-saisie-aide, .releve-saisie-statut { font-size: 13px; }
.releve-saisie-statut:empty { display: none; }
.releve-lignes { list-style: none; margin: 0; padding: 0; }
.releve-ligne + .releve-ligne { border-top: 1px solid var(--trait); }
.releve-ligne-corps { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; width: 100%;
    padding: 6px 4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; }
button.releve-ligne-corps { cursor: pointer; min-height: var(--cible); }
button.releve-ligne-corps:hover { background: var(--surface-2, rgba(127, 127, 127, .08)); }
.releve-ligne-corps .pastille { grid-column: 1 / -1; justify-self: start; }
.releve-libelle { overflow-wrap: anywhere; }
.releve-libelle small, .releve-montant small { display: block; color: var(--texte-2); font-size: 11px; }
.releve-montant { text-align: right; white-space: nowrap; font-weight: 600; }
.releve-pointee .releve-ligne-corps { opacity: .55; }
.releve-exacte button.releve-ligne-corps { background: color-mix(in srgb, var(--principal) 10%, transparent); }
button.releve-ligne-corps[aria-pressed="true"] { background: color-mix(in srgb, var(--principal) 22%, transparent); box-shadow: inset 3px 0 0 var(--principal); }
.apercu-cadre { display: block; width: 100%; height: 55vh; border: 1px solid var(--trait); border-radius: var(--rayon-carte); background: var(--surface); }
.apercu-image { display: block; max-width: 100%; max-height: 55vh; margin: 0 auto; border-radius: var(--rayon-carte); }
@media (min-width: 64rem) { .apercu-cadre { height: 78vh; } .apercu-image { max-height: 78vh; } }
.apercu-document .actions { margin-top: var(--e1); }
.bouton-fichier { position: relative; cursor: pointer; }
.bouton-fichier:has(input:disabled) { opacity: .5; pointer-events: none; }
.mettre-de-cote { margin-top: var(--e3); }
.mettre-de-cote > summary { cursor: pointer; color: var(--texte-2); }
.mettre-de-cote form { margin-top: var(--e1); }

/* Suivi comptable : une carte par exercice */
.grille-exercices { display: grid; gap: var(--e2); margin-bottom: var(--e2); }
@media (min-width: 48rem) { .grille-exercices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 80rem) { .grille-exercices { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.carte-exercice h3 { margin: 0; font-size: 18px; }
.comptes-ebe { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--trait); }
.ebe-smic { margin: var(--e1) 0 0; font-size: 15px; }
.ebe-smic strong { font-size: 18px; }
.carte-exercice .carte-entete { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); margin-bottom: var(--e1); }
.comptes { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--e2); margin: 0; font-size: 15px; }
.comptes dt { color: var(--texte-2); }
.comptes dt small { font-size: 12px; opacity: .8; }
.comptes dd { margin: 0; text-align: right; white-space: nowrap; }
.comptes .total { color: var(--texte); font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--trait); margin-bottom: 4px; }
.comptes dt.total:last-of-type, .comptes dd.total:last-of-type { border-bottom: 0; }
.carte-chiffre-large { grid-column: 1 / -1; }
/* Trésorerie : solde prévu en fin de mois (barres) */
.graphique-tresorerie { margin: 0 0 var(--e3); padding: var(--e2); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte); }
.graphique-tresorerie svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.graphique-tresorerie figcaption { margin-top: var(--e1); font-size: 13px; }
.graphique-grille { stroke: var(--trait); stroke-width: 1; stroke-dasharray: 2 3; }
.graphique-zero { stroke: var(--texte-2); stroke-dasharray: none; }
.graphique-texte { fill: var(--texte-2); font-size: 10.5px; }
.graphique-annee { font-weight: 600; }
.graphique-barre { fill: var(--principal); }
.graphique-negatif { fill: var(--rouge); }
.graphique-fond { fill: transparent; }
/* Mois par mois : un cadre par mois ; dedans, le prévu puis les factures du même mois l'an dernier
   (côte à côte sur grand écran). Lignes sur une seule hauteur ; + ouvre le formulaire d'ajout. */
.tresorerie-aide { margin: calc(-1 * var(--e1)) 0 var(--e2); font-size: 13px; }
.mois-tresorerie-corps { border-top: 1px solid var(--trait); }
.mois-tresorerie .liste { margin: 0; }
.mois-intertitre { display: flex; justify-content: space-between; gap: var(--e1); margin: 0; padding: 10px 20px 4px; font-size: 12px; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: .03em; }
.mois-intertitre .nombre { text-transform: none; letter-spacing: 0; white-space: nowrap; }
.mois-vide { margin: 0; padding: 10px 20px; font-size: 14px; }
.mois-an-dernier { border-top: 1px solid var(--trait); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.ligne-tresorerie { display: flex; align-items: center; gap: var(--e1); min-height: 44px; padding: 4px 14px 4px 20px; font-size: 14px; }
.ligne-tresorerie-texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-tresorerie-titre { font-weight: 500; }
.ligne-tresorerie-date { font-size: 12px; color: var(--texte-2); }
.ligne-tresorerie .nombre { flex: none; white-space: nowrap; }
.ligne-tresorerie form { display: contents; }
.ligne-tresorerie .bouton-supprimer { margin: 0; }
.bouton-place { flex: none; width: 36px; }
.bouton-plus { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--rayon-pastille); color: var(--principal); }
.bouton-plus .icone { width: 18px; height: 18px; transition: transform .15s; }
.an-dernier-ajout > summary { list-style: none; cursor: pointer; }
.an-dernier-ajout > summary::-webkit-details-marker { display: none; }
.an-dernier-ajout > summary:hover .bouton-plus { background: var(--principal-doux); }
.an-dernier-ajout[open] > summary .bouton-plus .icone { transform: rotate(45deg); }
.an-dernier-formulaire { display: grid; gap: var(--e1); padding: 4px 14px 14px 20px; }
.an-dernier-champs { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; gap: var(--e1); }
.an-dernier-champs .champ { margin: 0; }
.an-dernier-champs label { font-size: 13px; }
.an-dernier-champs input { padding-block: 8px; }
.an-dernier-bas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e1); }
.an-dernier-bas .puces-choix span { min-height: 34px; padding: 0 12px; font-size: 14px; }
.mois-tresorerie { scroll-margin-top: var(--sous-entete); }
@media (min-width: 64rem) {
    .avec-an-dernier .mois-tresorerie-corps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .avec-an-dernier .mois-an-dernier { border-top: 0; border-left: 1px solid var(--trait); }
}
.graphique-barre-an-dernier { fill: var(--principal-doux); stroke: var(--principal); stroke-width: 1; stroke-dasharray: 3 2; }
.graphique-barre-an-dernier.graphique-negatif { fill: var(--rouge-doux); stroke: var(--rouge); }
.graphique-legende-tresorerie { display: flex; flex-wrap: wrap; gap: 4px var(--e2); margin: var(--e1) 0 0; font-size: 13px; }
.graphique-legende-tresorerie > span { display: inline-flex; align-items: baseline; gap: 6px; }
.legende-pastille { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 2px; transform: translateY(1px); }
.legende-prevu { background: var(--principal); }
.legende-an-dernier { background: var(--principal-doux); border: 1px dashed var(--principal); }
.prevoir-tresorerie .carte-depliable-corps > p { margin-top: 0; }
.graphique-lien:hover .graphique-fond, .graphique-lien:focus .graphique-fond { fill: var(--surface-2); }
.graphique-lien:hover .graphique-barre, .graphique-lien:focus .graphique-barre { opacity: .8; }
.courbe { display: block; width: 100%; height: auto; margin: var(--e1) 0; }
.courbe polyline { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.courbe-ir { stroke: var(--bleu); }
.courbe-is { stroke: var(--principal); }
.courbe-isd { stroke: var(--ocre); stroke-dasharray: 5 4; }
.courbe-axe { stroke: var(--trait); stroke-width: 1; }
.courbe-repere { stroke: var(--texte-2); stroke-width: 1; stroke-dasharray: 2 3; }
.courbe-texte { fill: var(--texte-2); font-size: 10px; }
.legende-courbe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 var(--e1); font-size: 13px; color: var(--texte-2); }
.trait { display: inline-block; width: 18px; height: 0; border-top: 3px solid; vertical-align: middle; }
.trait-ir { border-color: var(--bleu); }
.trait-is { border-color: var(--principal); }
.trait-isd { border-color: var(--ocre); border-top-style: dashed; }
.liste-simple { margin: 0; padding-left: 1.2em; font-size: 14px; }
.liste-simple li + li { margin-top: 4px; }
.champ-compact { display: grid; gap: 4px; font-size: 14px; font-weight: 600; flex: 1 1 12rem; }
.champ-ligne { grid-template-columns: minmax(0, 1fr) 4.5rem auto; align-items: center; column-gap: var(--e1); }
.champ-ligne input { text-align: right; }

/* Ordonnances : une ligne par médicament */
.ligne-ordonnance { margin: 0 0 var(--e2); padding: 0 0 var(--e2); border: 0; border-bottom: 1px solid var(--trait); display: grid; gap: var(--e1); }
.grille-champs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* File des déplacements faits hors connexion (carte) */
.file-attente { margin-bottom: var(--e2); padding: 12px 14px; border-radius: var(--rayon-carte); background: var(--ocre-doux); color: var(--texte); }
.file-attente-titre { margin: 0 0 6px; font-weight: 700; }
.file-attente ul { margin: 0 0 var(--e1); padding-left: 1.2em; font-size: 14px; }
.file-attente-actions { margin: 0 0 var(--e1); }
.file-attente > :last-child { margin-bottom: 0; }
.carte-etiquette-attente span { outline: 2px dashed var(--ocre); outline-offset: 2px; }
.leaflet-tooltip.carte-nom-parcelle {
    padding: 1px 6px; border: 0; border-radius: var(--rayon-pastille); box-shadow: none;
    background: rgba(255, 255, 255, .8); color: #1d2b1f; font-size: 11px; font-weight: 600;
}
.leaflet-tooltip.carte-nom-parcelle::before { display: none; }

/* Édition du contour d'une parcelle */
.outils-contour { margin-bottom: var(--e2); }
.carte-conteneur-edition .carte-leaflet { height: 55dvh; min-height: 300px; }
.carte-conteneur-edition .carte-position { bottom: 12px; }
.carte-outil-actif.leaflet-container { cursor: crosshair; }
.resume-contour { margin: 0 0 var(--e1); font-weight: 600; }
.actions-contour { margin: 0 0 var(--e3); }
.sommet-contour, .milieu-contour { border-radius: 50%; box-sizing: border-box; }
.sommet-contour { background: var(--principal); border: 4px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.milieu-contour { background: rgba(255, 255, 255, .75); border: 3px solid var(--principal); }
.sommet-repere { background: var(--bleu); }
.bouton-danger { color: var(--rouge); border-color: var(--rouge); }
.bouton-danger:hover { background: var(--rouge-doux); }
.choix-lots { display: grid; gap: var(--e1); }
.choix-lot { position: relative; display: block; }
.choix-lot input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choix-lot span { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--trait); border-radius: var(--rayon-bouton); background: var(--surface); }
.choix-lot small { font-weight: 400; }
.choix-lot input:checked + span { border-color: var(--principal); background: var(--principal-doux); box-shadow: inset 0 0 0 1px var(--principal); }
.choix-lot input:focus-visible + span { outline: 3px solid var(--principal); outline-offset: 2px; }
.formulaire-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e1); margin-bottom: var(--e1); }
.formulaire-ligne label { font-size: 14px; font-weight: 600; }
.formulaire-ligne input[type="date"] { width: auto; flex: 1 1 10rem; }
.ligne-droite { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; text-align: right; }

/* ---------- 6. Styleguide (/styleguide) ---------- */

.sg-colonnes { display: grid; gap: var(--e3); }
@media (min-width: 90rem) { .sg-colonnes { grid-template-columns: 1fr 1fr; } }
.sg-theme { padding: var(--e3) var(--e2); border-radius: var(--rayon-carte); background: var(--fond); color: var(--texte); border: 1px solid var(--trait); }
.sg-titre-theme { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-2); }
.sg-bloc { margin-bottom: var(--e4); }
.sg-bloc > h2 { padding-bottom: var(--e1); border-bottom: 1px solid var(--trait); }
.sg-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--e1); }
.sg-teinte { display: flex; align-items: center; gap: var(--e1); font-size: 13px; }
.sg-pastille-couleur { width: 32px; height: 32px; flex: none; border-radius: var(--rayon-petit); border: 1px solid var(--trait); }
.sg-statique { position: static !important; margin-bottom: var(--e2); }
.sg-theme .onglets.sg-statique { display: grid; border: 1px solid var(--trait); border-radius: var(--rayon-carte); }
.notification.sg-statique { animation: none; }
[data-couleur="fond"] { background: var(--fond); }
[data-couleur="surface"] { background: var(--surface); }
[data-couleur="surface-2"] { background: var(--surface-2); }
[data-couleur="texte"] { background: var(--texte); }
[data-couleur="texte-2"] { background: var(--texte-2); }
[data-couleur="trait"] { background: var(--trait); }
[data-couleur="principal"] { background: var(--principal); }
[data-couleur="principal-doux"] { background: var(--principal-doux); }
[data-couleur="sur-principal"] { background: var(--sur-principal); }
[data-couleur="ocre"] { background: var(--ocre); }
[data-couleur="ocre-doux"] { background: var(--ocre-doux); }
[data-couleur="bleu"] { background: var(--bleu); }
[data-couleur="bleu-doux"] { background: var(--bleu-doux); }
[data-couleur="rouge"] { background: var(--rouge); }
[data-couleur="rouge-doux"] { background: var(--rouge-doux); }

/* ---------- Utilitaires de couleur (en dernier : ils l'emportent sur les composants) ---------- */

.texte-2 { color: var(--texte-2); }
.texte-principal { color: var(--principal); }
.texte-ocre { color: var(--ocre); }
.texte-bleu { color: var(--bleu); }
.texte-rouge { color: var(--rouge); }

/* Inventaire de clôture : valorisation (lignes du cheptel) et dossier du centre de gestion (grilles de saisie) */
.bouton-petit { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.bouton-danger { color: var(--rouge); }
.bouton-danger:hover { background: var(--rouge-doux); }
.lignes-cheptel { display: grid; gap: 14px; }
.ligne-cheptel { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; align-items: center; }
.ligne-cheptel > :first-child { grid-column: 1 / -1; }
@media (min-width: 30rem) {
    .lignes-cheptel { gap: 8px; }
    .ligne-cheptel { grid-template-columns: minmax(0, 1fr) 5rem 7rem; }
    .ligne-cheptel > :first-child { grid-column: auto; }
}
.ligne-cheptel input { padding: 8px 10px; }
.ligne-cheptel input + input { text-align: right; }
.ligne-cheptel-entete { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.ligne-cheptel-entete span + span { text-align: right; }
.ligne-cheptel-entete { margin-bottom: -6px; }
.ligne-hors-stock input { background: var(--surface-2); color: var(--texte-2); }
.section-dossier > summary { display: flex; justify-content: space-between; gap: var(--e2); }
.section-dossier > summary .icone { color: var(--texte-2); }
.grille-dossier { display: grid; gap: var(--e2); margin-bottom: var(--e2); }
@media (min-width: 64rem) { .grille-dossier { grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr)); align-items: start; } }
.element-dossier { min-width: 0; }
.element-dossier > .bouton { margin-top: 6px; }
.saisie-cadre { overflow-x: auto; }
.saisie { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.saisie.colonnes-4 { min-width: 30rem; }
.saisie.colonnes-5 { min-width: 44rem; }
.saisie th, .saisie td { border: 1px solid var(--trait); padding: 3px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.saisie th { padding: 6px 8px; font-weight: 500; }
.saisie thead th, .saisie .sous-titre th { background: var(--surface-2); font-size: 13px; font-weight: 600; }
.saisie thead th:first-child { width: 40%; }
.saisie.colonnes-4 thead th:first-child, .saisie.colonnes-5 thead th:first-child { width: 30%; }
.saisie td.texte-2 { padding: 6px 8px; }
.saisie .ligne-total th { font-weight: 700; }
.saisie input { min-height: 36px; padding: 4px 8px; border-color: transparent; border-radius: 6px; background: transparent; }
.saisie input:hover { border-color: var(--trait); }
.saisie input.proposee, .exemple-proposee { background: var(--bleu-doux); }
.exemple-proposee { padding: 0 4px; border-radius: 4px; }
.dossier-identification { margin-bottom: var(--e2); }

/* Bloc-notes : cartes de notes (liste et notes épinglées sur l'accueil) */
.grille-notes { display: grid; gap: var(--e2); margin-bottom: var(--e3); }
@media (min-width: 48rem) { .grille-notes { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); align-items: start; } }
.note { display: grid; gap: 12px; min-width: 0; }
.note-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--e1); }
.note-entete h2 { margin: 0; font-size: 17px; }
.note-boutons { display: flex; align-items: center; gap: 2px; flex: none; margin: -4px -6px -4px 0; }
.note-boutons .bouton-supprimer { margin: 0; }
.note-marques { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.note-media { display: block; width: 100%; max-height: 22rem; object-fit: cover; border-radius: var(--rayon-bouton); background: var(--surface-2); }
.note-media-apercu { max-width: 16rem; max-height: 10rem; margin-top: 6px; }
.note-texte { margin: 0; overflow-wrap: anywhere; }
.note .actions { margin: 0; }
.note .actions form { display: contents; }
.note-epinglee { border-color: var(--ocre); background: var(--ocre-doux); }
code.jeton { overflow-wrap: anywhere; user-select: all; }

/* Tâches et agenda : puces, ajout rapide, sommaire, calendrier */
.periodes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--e2); }
.periodes .bouton:last-child { margin-left: auto; }
.ajout-puce { display: grid; gap: 10px; margin-bottom: var(--e2); }
.ajout-puce-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ajout-puce-options select, .ajout-puce-options input[type="date"] { width: auto; flex: 1 1 9rem; }
.ajout-puce-options .bouton { margin-left: auto; }
.ajout-puce .case { min-height: 0; }
.puces-liste { list-style: none; margin: 0 0 var(--e2); padding: 4px 0; }
.carte.puces-liste { padding: 4px var(--e2); }
.puce { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.puces-liste .puce + .puce { border-top: 1px solid var(--trait); }
.puce > form { display: contents; }
.puce-symbole {
    flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -2px 0;
    border: 0; border-radius: var(--rayon-pastille); background: none; color: var(--texte);
    font-size: 20px; line-height: 1; font-weight: 700;
}
button.puce-symbole { cursor: pointer; }
button.puce-symbole:hover { background: var(--principal-doux); color: var(--principal); }
.puce-texte { flex: 1; min-width: 0; padding-top: 4px; overflow-wrap: anywhere; }
.puce-important { margin-right: 4px; color: var(--rouge); font-weight: 700; }
.puce .menu-actions { flex: none; margin: -4px 0; }
.puce .menu-actions .bouton-rond { width: 36px; height: 36px; }
.puce-fait .puce-symbole { color: var(--principal); }
.puce-fait .puce-texte, .puce-abandonne .puce-texte { color: var(--texte-2); text-decoration: line-through; }
.puce-reporte .puce-symbole, .puce-migre .puce-symbole { color: var(--bleu); }
.puce-reporte .puce-texte, .puce-migre .puce-texte { color: var(--texte-2); }
.menu-actions-liste form { display: contents; }
.puce .menu-actions-liste { min-width: 15rem; }
.menu-planifier { display: flex !important; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; }
.menu-planifier input { flex: 1 1 auto; width: auto; min-width: 0; min-height: 36px; padding: 4px 8px; font-size: 15px; }
.menu-planifier button { flex: none; white-space: nowrap; }
.legende-puces { margin-top: var(--e2); }
.grille-agenda { display: grid; gap: var(--e2); margin-bottom: var(--e3); }
@media (min-width: 48rem) { .grille-agenda { grid-template-columns: 1fr 1fr; align-items: start; } }
.bloc-agenda h2 { font-size: 17px; margin: 0; }
.bloc-agenda .carte-entete, .bloc-taches .carte-entete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e1); margin-bottom: 8px; }
.bloc-taches { margin-bottom: var(--e2); }
.bloc-taches h2 { margin: 0; font-size: 17px; }
.calendrier { width: 100%; padding: 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; overflow: hidden; margin-bottom: var(--e2); }
.calendrier th { padding: 8px 0; font-size: 12px; font-weight: 600; color: var(--texte-2); text-align: center; }
.calendrier td { height: 3.4rem; padding: 0; border-top: 1px solid var(--trait); vertical-align: top; }
.calendrier td + td { border-left: 1px solid var(--trait); }
.calendrier td a { display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 3.4rem; padding: 4px; color: var(--texte); text-decoration: none; overflow: hidden; }
.calendrier td a:hover { background: var(--surface-2); }
.calendrier-numero { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.calendrier .aujourdhui .calendrier-numero { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--principal); color: var(--sur-principal); }
.calendrier .occupe { background: var(--principal-doux); }
.calendrier-evenement { font-size: 12px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--principal); }
@media (max-width: 40rem) { .calendrier-texte { display: none; } .calendrier td, .calendrier td a { height: 2.9rem; min-height: 2.9rem; } }
@media (min-width: 64rem) { .calendrier td, .calendrier td a { height: 6rem; } }

/* Météo */
.choix-lieu { display: flex; gap: 8px; align-items: center; }
.choix-lieu select { width: auto; min-width: 10rem; }
.meteo-maintenant { display: grid; gap: var(--e2); margin-bottom: var(--e3); }
@media (min-width: 48rem) { .meteo-maintenant { grid-template-columns: auto 1fr; align-items: center; } }
.meteo-actuel, .carte-meteo-actuel { display: flex; align-items: center; gap: var(--e2); }
.meteo-actuel p, .carte-meteo-actuel p { margin: 0; }
.meteo-icone-grande { width: 56px; height: 56px; stroke-width: 1.5; color: var(--principal); }
.meteo-chiffre { font-size: 36px; font-weight: 700; line-height: 1.1; margin: 0; }
.meteo-details { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.meteo-details li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.meteo-details .icone { width: 18px; height: 18px; color: var(--texte-2); }
.meteo-heures { display: flex; gap: 4px; overflow-x: auto; padding: 10px; margin-bottom: var(--e3); scrollbar-width: thin; }
.meteo-heure { flex: none; display: grid; justify-items: center; gap: 4px; width: 3.4rem; font-size: 14px; }
.meteo-heure .icone { width: 22px; height: 22px; }
.meteo-pluie { color: var(--bleu); }
.meteo-jours { padding: 0 var(--e2); }
.meteo-jour { display: grid; grid-template-columns: 5.8rem 24px auto 1fr auto; align-items: center; gap: 8px; padding: 10px 0; font-size: 15px; }
.meteo-jour-temp { white-space: nowrap; }
.meteo-jour + .meteo-jour { border-top: 1px solid var(--trait); }
.meteo-jour-icone .icone { width: 22px; height: 22px; }
.meteo-jour-pluie { color: var(--bleu); text-align: right; min-width: 3.5rem; }
.meteo-jour-apport { text-align: right; min-width: 3rem; font-size: 13px; }
.meteo-cumul { margin: var(--e3) 0; }
.paliers { list-style: none; margin: var(--e2) 0 0; padding: 0; }
.palier { display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; padding: 8px 0; border-top: 1px solid var(--trait); }
.palier-repere { grid-row: span 2; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--trait); border-radius: 50%; }
.palier-repere .icone { width: 14px; height: 14px; stroke-width: 3; }
.palier-atteint .palier-repere { border-color: var(--principal); background: var(--principal); color: var(--sur-principal); }
.palier-prevu .palier-repere { border-color: var(--principal); }
.palier-nom { font-weight: 500; }
.palier-quand { font-size: 14px; }
.releves { margin-top: var(--e2); border-top: 1px solid var(--trait); }
.source-meteo { text-align: right; }
.grille-mois { display: grid; gap: var(--e2); margin-bottom: var(--e2); }
@media (min-width: 64rem) { .grille-mois { grid-template-columns: 1fr 1fr; align-items: start; } }
.grille-mois summary { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e1); }
.tableau-meteo { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau-meteo th { font-size: 12px; font-weight: 600; color: var(--texte-2); text-align: left; padding: 4px 6px; }
.tableau-meteo td { padding: 4px 6px; border-top: 1px solid var(--trait); }
.tableau-meteo td .icone { width: 18px; height: 18px; }
.tableau-meteo .releve-ferme td { background: var(--bleu-doux); color: var(--bleu); }
.lignes-paliers { display: grid; gap: 8px; }
.ligne-palier { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; gap: 8px; }
.ligne-palier-entete { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.actions-ligne { display: flex; align-items: center; gap: 6px; }
.carte-meteo { display: grid; gap: 12px; }
.carte-meteo-lien { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px var(--e2); color: var(--texte); text-decoration: none; }
.carte-meteo-lien:hover .meteo-chiffre { color: var(--principal); }
.carte-meteo-actuel > span { display: grid; }
.carte-meteo .meteo-icone-grande { width: 44px; height: 44px; }
.carte-meteo .meteo-chiffre { font-size: 30px; }
.carte-meteo-lieu { font-size: 14px; }
.carte-meteo-jours { display: grid; grid-template-columns: repeat(3, minmax(3.6rem, auto)); gap: 4px; }
.carte-meteo-jour { display: grid; justify-items: center; gap: 2px; font-size: 13px; }
.carte-meteo-jours .icone { width: 22px; height: 22px; }
.carte-meteo-cumul { margin: 0; font-size: 14px; color: var(--texte-2); }

/* Travaux : relevé des heures du salarié, repères de la carte */
.carte-depliable > summary > .icone { flex: none; color: var(--texte-2); transition: transform .15s; }
.carte-depliable[open] > summary > .icone { transform: rotate(180deg); }
.carte-depliable-corps h3 { margin: var(--e3) 0 var(--e2); }
.grille-deux { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.jours-releve { display: grid; gap: 4px; margin: var(--e2) 0; }
.jour-releve { display: grid; grid-template-columns: 3.4rem repeat(3, minmax(0, 1fr)) 2.75rem; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 8px; }
.jour-releve[hidden] { display: none; }
.jour-releve input:not([type="checkbox"]) { min-height: 38px; padding: 6px 8px; font-size: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.jour-releve-entete { font-size: 12px; font-weight: 600; color: var(--texte-2); text-align: center; line-height: 1.2; }
.jour-releve-entete span:first-child { text-align: left; }
.jour-releve-date { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.jour-releve-date small { color: var(--texte-2); font-size: 12px; }
.jour-releve-weekend { background: var(--fond); }
.jour-releve-erreur { outline: 2px solid var(--rouge); }
.jour-releve-repas { display: grid; place-items: center; min-height: 38px; cursor: pointer; }
.jour-releve-repas input { width: 22px; height: 22px; margin: 0; }
.totaux-releve { list-style: none; margin: var(--e2) 0 0; padding: var(--e2) 0 0; border-top: 1px solid var(--trait); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e1); }
.totaux-releve li { display: grid; gap: 2px; font-size: 13px; }
.totaux-releve strong { font-size: 18px; }
.repere-description { margin: 0 0 var(--e1); }
.repere-faits { list-style: none; margin: 0 0 var(--e2); padding: 0; display: grid; gap: 2px; font-size: 14px; }
.repere-journal { border-top: 1px solid var(--trait); }
.repere-liens { margin: 0 0 var(--e2); font-size: 14px; }
.categorie-retirer { margin-top: var(--e2); padding-top: var(--e2); border-top: 1px solid var(--trait); }
.repere-ajout > summary { list-style: none; display: inline-flex; gap: 6px; }
.repere-ajout > summary::-webkit-details-marker { display: none; }
.repere-ajout[open] > summary { margin-bottom: var(--e2); }
.carte-entete a .icone { width: 16px; height: 16px; vertical-align: -3px; }

/* Matériel et carnet d'entretien */
.ligne-photo { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
span.ligne-photo { display: grid; place-items: center; color: var(--texte-2); }
.materiel-entete { display: grid; gap: var(--e2); margin-bottom: var(--e2); }
@media (min-width: 40rem) { .materiel-entete { grid-template-columns: 14rem 1fr; align-items: center; } }
.materiel-entete .titre-page { margin-bottom: 0; }
.materiel-photo { display: block; width: 100%; max-height: 16rem; object-fit: cover; border-radius: var(--rayon-carte); background: var(--surface-2); }
.materiel-photo-apercu { display: block; max-width: 12rem; max-height: 8rem; border-radius: var(--rayon-bouton); object-fit: cover; }
.materiel-notes { margin: 0 0 var(--e2); color: var(--texte-2); }
.relever-compteur { display: flex; align-items: center; gap: 6px; }
.relever-compteur input { width: 7.5rem; min-height: 36px; padding: 6px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.champ-unite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.champ-unite select { width: auto; }
.entretien-details { font-size: 14px; color: var(--texte-2); margin-top: 2px; }
.ajout-facture { margin-top: 6px; }
.carte-entete + .repere-ajout, .liste + .repere-ajout { margin-top: var(--e2); }
.carte > .liste:last-child { margin-bottom: 0; }

/* Accueil : deux colonnes indépendantes sur ordinateur (à faire | informations et outils) ;
   sur téléphone une seule colonne, dans l'ordre météo, actions, informations, outils. */
.accueil { display: flex; flex-direction: column; }
.accueil-colonne { display: contents; }
/* Cartouche de l'exploitation (panneau de l'en-tête) : adresse et numéros à recopier */
.cartouche-adresse { margin: 0; color: var(--texte-2); }
.cartouche-lien { margin: 0; font-size: 14px; }
.cartouche-page { display: grid; gap: var(--e2); }
.cartouche-numeros { display: grid; gap: 2px; margin: 0; }
.cartouche-numeros > div { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); min-height: 36px; border-top: 1px solid var(--trait); }
.cartouche-numeros > div:first-child { border-top: 0; }
.cartouche-numeros dt { font-size: 14px; color: var(--texte-2); }
.cartouche-numeros dd { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.cartouche-numeros .bouton-discret { width: 32px; height: 32px; margin-right: -8px; }
.cartouche-numeros .copie-faite { color: var(--principal); }
.ordre-meteo { order: 1; }
.ordre-action { order: 2; }
.ordre-info { order: 3; }
.ordre-outil { order: 4; }
@media (min-width: 64rem) {
    .accueil { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--e2); align-items: start; }
    .accueil-colonne { display: flex; flex-direction: column; min-width: 0; }
}
.accueil .grille-notes { grid-template-columns: minmax(0, 1fr); margin-bottom: 0; }
.accueil .grille-notes .carte { margin-bottom: var(--e2); }
.pluie-rapide { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--trait); }
.pluie-rapide label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; flex: none; }
.pluie-rapide label .icone { width: 18px; height: 18px; color: var(--bleu); }
.pluie-rapide input[type="date"] { width: auto; flex: 1 1 0; min-width: 0; min-height: 36px; padding: 4px 6px; }
.pluie-rapide input[name="mm"] { flex: none; width: 3.6rem; min-height: 36px; padding: 4px 8px; text-align: right; }
.pluie-rapide .bouton { flex: none; }
@media (max-width: 26rem) { .pluie-mot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.cotation + .cotation { margin-top: var(--e2); padding-top: var(--e2); border-top: 1px solid var(--trait); }
.cotation-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.cotation-titre { font-weight: 600; }
.cotation-entete select { width: auto; max-width: 100%; min-height: 36px; padding: 4px 8px; font-size: 14px; }
.tableau-cotation td:nth-child(n+2), .tableau-cotation th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.cotation-classes { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 6px; }
.cotation-classes li { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.tendance { font-weight: 700; }
.tendance-hausse { color: var(--principal); }
.tendance-baisse { color: var(--rouge); }
.tendance-stable { color: var(--texte-2); }
.calculatrice-grille { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
.calculatrice-grille label, .calculatrice-libelle { font-size: 14px; }
.calculatrice-grille input { min-height: 38px; padding: 6px 8px; text-align: right; }
.calculatrice-grille output { text-align: right; font-weight: 600; }
.calculatrice-grille > span.texte-2 { text-align: right; font-size: 13px; font-weight: 600; }

/* Reproduction : vaches cochées par lot */
.lot-choix { border: 0; margin: 0 0 var(--e2); padding: 0; min-width: 0; }
/* Soin à plusieurs animaux : choix replié par défaut, puis numéros saisis */
.choix-animaux { border: 1px solid var(--trait); border-radius: var(--rayon-bouton); padding: 0 12px; margin-bottom: var(--e1); }
.choix-animaux > summary { min-height: var(--cible); display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.choix-animaux > summary::-webkit-details-marker { display: none; }
.choix-animaux > summary { list-style: none; }
.choix-animaux > summary .icone { width: 18px; height: 18px; transition: transform var(--duree); }
.choix-animaux[open] > summary .icone { transform: rotate(180deg); }
.choix-animaux[open] > summary { margin-bottom: var(--e1); }
.choix-animaux-soin > label { font-size: 14px; font-weight: 600; }
.lot-choix legend { padding: 0; width: 100%; border-bottom: 1px solid var(--trait); }
.vaches-choix { display: grid; gap: 0 var(--e2); }
@media (min-width: 40rem) { .vaches-choix { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .vaches-choix { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vaches-choix .case { min-height: 44px; gap: 10px; }
.vaches-choix .case span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; line-height: 1.3; }

/* Silos */
.silo-stock { margin: 0 0 4px; font-size: 18px; }
.silo-actions { display: grid; gap: 8px; margin-bottom: var(--e2); }
.silo-libelle { flex: 0 0 7.5rem; font-size: 14px; font-weight: 600; }
.silo-actions input { flex: 1 1 0; min-width: 0; width: auto !important; }
.silo-actions .bouton { flex: none; }
.silo-actions > form { min-width: 0; }
.grille-deux > .champ { min-width: 0; }
.grille-deux input[type="date"] { min-width: 0; width: 100%; }

/* Troupeau hors connexion */
.filtres-hors-connexion { display: grid; gap: 10px; margin-bottom: var(--e2); }
.filtres-hors-connexion > p { margin: 0; }
.puces-choix-compactes { gap: 6px; }
.puces-choix-compactes span { min-height: 34px; padding: 0 12px; font-size: 14px; gap: 4px; }
.puces-choix-compactes small { font-size: 12px; }
.puces-choix input:checked + span small { color: inherit; opacity: .8; }
.animaux-hors-connexion details > summary { list-style: none; cursor: pointer; }
.animaux-hors-connexion details > summary::-webkit-details-marker { display: none; }
.animaux-hors-connexion details[open] > summary { background: var(--surface-2); }
.fiche-hors-connexion { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; padding: 10px 20px 14px 68px; font-size: 14px; }
.fiche-hors-connexion dt { color: var(--texte-2); }
.fiche-hors-connexion dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 26rem) { .fiche-hors-connexion { padding-left: 20px; } }

/* Configuration */
.ligne .menu-actions-liste { min-width: 17rem; }
.mot-de-passe-provisoire code { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--surface); font-size: 22px; letter-spacing: .04em; user-select: all; }
.comptes-liste { display: grid; margin-bottom: var(--e2); }
.compte-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--trait); }
.compte-ligne > .compte-numero, .compte-ligne > .compte-libelle { flex: 1 1 100%; }
.compte-ligne label { white-space: nowrap; }
.compte-ligne input:not([type="checkbox"]) { min-height: 36px; padding: 4px 8px; }
.compte-budget { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.compte-budget input { width: 6.5rem; text-align: right; }
.compte-ligne .case { min-height: 36px; gap: 8px; font-size: 14px; }
.compte-archive { opacity: .6; }
@media (min-width: 48rem) {
    .compte-ligne { flex-wrap: nowrap; }
    .compte-ligne > .compte-numero { flex: 0 0 11rem; }
    .compte-ligne > .compte-libelle { flex: 1 1 auto; }
}

/* Aide */
.aide-corps h3 { margin: var(--e2) 0 6px; font-size: 15px; }
.aide-corps h3:first-child { margin-top: 0; }
.aide-corps ul { margin: 0 0 var(--e1); padding-left: 1.2em; display: grid; gap: 6px; }
.aide-section:target { border-color: var(--principal); }

/* Pesées par séance, composition des lots dans l'année */
.choix-annees { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--e2); }
.seance-pesee .carte-entete { flex-wrap: wrap; }
.pesees-animaux { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.pesees-animaux a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--texte); text-decoration: none; font-size: 14px; }
.pesees-animaux a:hover { outline: 1px solid var(--principal); }
.pesee-animal { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pesee-gain { grid-column: 1 / -1; font-size: 12px; }
.passages-lot { list-style: none; margin: 0; padding: 0 20px 16px; }
.passage-lot { padding: 12px 0; border-top: 1px solid var(--trait); }
.passage-entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.passage-mouvement { margin: 6px 0 0; font-size: 14px; line-height: 1.6; }
.passage-animaux { margin-top: 6px; font-size: 14px; }
.passage-animaux > summary { cursor: pointer; }
.passage-animaux p { margin: 6px 0 0; line-height: 1.6; }

/* ---------- 7. Accessibilité et impression ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Cahier de l'année : écran (choix, page de garde en carte), puis papier (une section par page) */
.cahier-choix { margin-bottom: var(--e3); }
.cahier-choix .actions { margin-top: var(--e2); }
.cahier-garde {
    margin-bottom: var(--e3); padding: var(--e3);
    background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte); box-shadow: var(--ombre);
}
.cahier-garde-surtitre { margin: 0; font-weight: 600; color: var(--texte-2); }
.cahier-garde-titre { margin: 4px 0 var(--e2); }
.cahier-garde-adresse { margin: 0 0 var(--e1); }
.cahier-garde-numeros { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 var(--e2); font-size: 14px; color: var(--texte-2); }
.cahier-garde-numeros strong { color: var(--texte); }
.cahier-sommaire { margin: 0 0 var(--e2); padding-left: 1.4em; columns: 2 12rem; }
.cahier-garde-date { margin: 0; font-size: 14px; }
.cahier-section { margin-bottom: var(--e4, 40px); }
.cahier-titre { margin-bottom: var(--e2); padding-bottom: 6px; border-bottom: 2px solid var(--trait); }
.cahier-resume { margin: 0 0 var(--e2); }
.cahier-bloc { margin-bottom: var(--e3); }
.cahier-bloc h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 8px; font-size: 17px; }
.cahier-bloc h3 small { font-size: 14px; font-weight: 400; }
.cahier-colonnes { list-style: none; margin: 0; padding: 0; columns: 3 13rem; column-gap: var(--e3); font-size: 14px; }
.cahier-colonnes li { break-inside: avoid; padding: 2px 0; border-bottom: 1px solid var(--trait); }
.tableau-defile { overflow-x: auto; margin-bottom: var(--e2); }
.tableau-cahier { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.tableau-cahier th, .tableau-cahier td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--trait); }
.tableau-cahier thead th { font-size: 12px; font-weight: 600; color: var(--texte-2); border-bottom: 1px solid var(--texte-2); }
.tableau-cahier .nombre { white-space: nowrap; }
.tableau-cahier-nombres td, .tableau-cahier-nombres thead th:not(:first-child), .tableau-cahier-comptes td, .tableau-cahier-comptes thead th:not(:first-child) { text-align: right; }
.tableau-cahier tbody th { font-weight: 400; }
.tableau-cahier-nombres td:first-child { text-align: left; }
.tableau-cahier thead th { white-space: nowrap; }
.tableau-cahier td:first-child { min-width: 7em; }
.tableau-cahier small, .cahier-colonnes small { font-size: .9em; }
.tableau-cahier .cahier-total th, .tableau-cahier .cahier-total td { font-weight: 600; border-top: 1px solid var(--texte-2); }
.cahier-sous-ligne td { padding-top: 0; color: var(--texte-2); }
.tableau-cahier tr:has(+ .cahier-sous-ligne) td { border-bottom: 0; }
.cahier-detail { display: block; color: var(--texte-2); }

/* Impression : bouton dans l'en-tête sur ordinateur (sur téléphone, Partager › Imprimer), en-tête de page papier */
.bouton-imprimer { display: none; }
@media (min-width: 64rem) { .bouton-imprimer { display: inline-grid; } }
.entete-impression, .seulement-impression { display: none; }

/* Couples mère-veau : un vrai tableau, même sur téléphone (trois colonnes courtes) */
.tableau-couples {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte); box-shadow: var(--ombre); overflow: hidden;
}
.tableau-couples th { font-size: 13px; font-weight: 600; color: var(--texte-2); text-align: left; padding: 10px 12px; }
.tableau-couples td { padding: 8px 12px; border-top: 1px solid var(--trait); vertical-align: top; overflow-wrap: break-word; }
.tableau-couples a { color: inherit; text-decoration: none; }
.tableau-couples strong { font-size: 17px; }
.couple-sexe { color: var(--texte-2); }
.couple-detail { display: block; font-size: 13px; color: var(--texte-2); }
.bilan-couples { margin: 0 0 var(--e2); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.couple-lot { font-size: 14px; color: var(--texte-2); overflow-wrap: normal; word-break: normal; hyphens: none; }

@media print {
    @page { size: A4; margin: 12mm 12mm 14mm; }
    /* Toujours noir sur blanc, même en mode sombre ou avec un autre thème. */
    :root, :root[data-theme] {
        --fond: #FFFFFF !important; --surface: #FFFFFF !important; --surface-2: #F2F2F2 !important;
        --texte: #000000 !important; --texte-2: #444444 !important; --trait: #BBBBBB !important;
        --principal: #000000 !important; --principal-doux: #EEEEEE !important; --ombre: none !important;
        color-scheme: light;
    }
    html { font-size: 11pt; }
    .entete, .entete-suite, .laterale, .onglets, .notifications, .bouton-flottant, .actions, .bouton { display: none !important; }
    .onglets-domaine, .puces, .champ-recherche { display: none !important; }
    .avec-navigation .contenu { padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .entete-impression { display: flex; justify-content: space-between; margin: 0 0 4mm; padding-bottom: 2mm; border-bottom: 1px solid #000; font-size: 9pt; color: #444; }
    .seulement-impression { display: inline; }
    .titre-page { margin-bottom: 4mm; }
    h1, .titre-page h1 { font-size: 18pt; line-height: 1.2; }
    h2 { font-size: 13pt; break-after: avoid; }
    a { color: inherit; text-decoration: none; }
    .liste .ligne { min-height: 0; padding-top: 4px; padding-bottom: 4px; }
    .liste li, tr { break-inside: avoid; }
    .tableau, .tableau-couples { border-radius: 0; }
    .tableau-couples th, .tableau-couples td { padding: 3px 8px; border-color: #999; }
    .tableau-couples strong { font-size: 12pt; }
    .couple-detail { display: inline; margin-left: 6px; font-size: 9pt; }
    .pastille { background: none !important; border: 1px solid #888; color: #000 !important; }
    /* Cahier : page de garde seule sur sa page, puis une section par page. */
    .cahier-ecran, .cahier-choix { display: none !important; }
    .cahier-garde { display: flex; flex-direction: column; justify-content: center; min-height: 240mm; margin: 0; padding: 0 10mm; border: 0; box-shadow: none; break-after: page; }
    .cahier-garde-titre { font-size: 28pt; margin: 4mm 0 8mm; }
    .cahier-garde-surtitre { font-size: 14pt; color: #000; }
    .cahier-sommaire { columns: 1; font-size: 12pt; line-height: 1.8; }
    .cahier-section { break-before: page; margin: 0; }
    .cahier-titre { font-size: 16pt; border-color: #000; }
    .tableau-defile { overflow: visible; }
    .tableau-cahier { font-size: 9pt; }
    .tableau-cahier th, .tableau-cahier td { padding: 2px 5px; border-color: #BBB; }
    .tableau-cahier thead th { border-color: #000; color: #000; }
    .cahier-bloc { break-inside: auto; margin-bottom: 5mm; }
    .cahier-bloc h3 { font-size: 11pt; break-after: avoid; }
    .cahier-colonnes { columns: 4; font-size: 9pt; }
    .cahier-sous-ligne td { font-size: 8pt; }
    .ligne-picto { background: none !important; color: #000 !important; }
    .tableau-couples tbody tr:nth-child(even) td { background: #F2F2F2; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    body { display: block !important; background: #fff; color: #000; }
    .carte, .tableau { border: 0; box-shadow: none; padding: 0; }
    .barre-retour, .message, .section-dossier > summary .icone, .visuellement-cache { display: none !important; }
    .section-dossier { break-inside: auto; }
    .section-dossier > summary h2 { font-size: 15px; }
    .carte-depliable-corps { border: 0; padding: 0; overflow: visible; }
    .saisie-cadre { overflow: visible; }
    .saisie { font-size: 10px; min-width: 0 !important; break-inside: avoid; }
    .saisie th, .saisie td { border-color: #999; padding: 1px 4px; }
    .saisie input { min-height: 0; padding: 0; border: 0; background: none !important; font-size: 10px; }
    .grille-dossier { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* Saisie depuis la boîte d'arrivée : position dans la pile, recherche du règlement dans le relevé */
.pile-documents { display: flex; align-items: center; justify-content: space-between; gap: var(--e1); margin-bottom: var(--e2); }
.pile-position { font-size: 14px; text-align: center; color: var(--texte-2); white-space: nowrap; }
.pile-documents .bouton { white-space: nowrap; }
@media (max-width: 30rem) { .pile-libelle { display: none; } }
.pile-position strong { color: var(--texte); }
.bouton[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.recherche-reglement { margin-top: var(--e1); }
.recherche-reglement > summary { list-style: none; display: inline-flex; gap: 6px; }
.recherche-reglement > summary::-webkit-details-marker { display: none; }
.recherche-reglement[open] > summary { margin-bottom: var(--e1); }
.recherche-reglement .liste { margin: 0; border-top: 1px solid var(--trait); }
.recherche-reglement .ligne { flex-wrap: wrap; padding-inline: 0; gap: 4px 12px; }
.recherche-reglement .ligne-texte { flex: 1 1 12rem; min-width: 0; }
.raccourcis { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; }
.raccourcis .bouton small { margin-left: 2px; opacity: .75; }

/* Recherche du SIREN d'après le nom (fiche tiers, saisie d'une facture) */
.recherche-siren { margin-top: 8px; }
.recherche-siren .actions { align-items: center; }
.recherche-siren [data-etat] { margin: 8px 0 0; }
.recherche-siren .liste { margin: 8px 0 0; }
.recherche-siren .ligne-sous-titre { overflow-wrap: anywhere; }

/* ---------- 8. Thème « EleVachE v1 » (choisi dans Mon compte) ----------
   L'allure de la version 1, faite avec Bootstrap 5.3 : fond blanc, bleu Bootstrap, police du système,
   coins peu arrondis, cartes bordées sans ombre, barre du haut blanche bordée, onglets en pilules.
   La disposition des écrans reste celle de la V2. Mode sombre : les couleurs du mode sombre de Bootstrap. */

[data-theme="v1"] {
    --fond: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #E9ECEF;
    --texte: #212529;
    --texte-2: #5C636A;
    --trait: #DEE2E6;
    --principal: #0A58CA;
    --principal-doux: #CFE2FF;
    --sur-principal: #FFFFFF;
    --ocre: #8A6703;
    --ocre-doux: #FFF3CD;
    --bleu: #055160;
    --bleu-doux: #CFF4FC;
    --rouge: #B02A37;
    --rouge-doux: #F8D7DA;
    --vert: #146C43;
    --vert-doux: #D1E7DD;
    --bouton-principal: #0D6EFD;
    --ombre: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --voile: rgba(0, 0, 0, .5);
    --rayon-carte: 6px;
    --rayon-bouton: 6px;
    --rayon-petit: 4px;
    --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    [data-theme="v1"] {
        --fond: #212529;
        --surface: #2B3035;
        --surface-2: #343A40;
        --texte: #DEE2E6;
        --texte-2: #ADB5BD;
        --trait: #495057;
        --principal: #6EA8FE;
        --principal-doux: #031633;
        --sur-principal: #FFFFFF;
        --ocre: #FFDA6A;
        --ocre-doux: #332701;
        --bleu: #6EDFF6;
        --bleu-doux: #032830;
        --rouge: #EA868F;
        --rouge-doux: #2C0B0E;
        --vert: #75B798;
        --vert-doux: #051B11;
        --bouton-principal: #0D6EFD;
        --ombre: none;
        --voile: rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

[data-theme="v1"] body { font: 14px/1.4 var(--police); font-feature-settings: normal; -webkit-font-smoothing: auto; }
[data-theme="v1"] h1 { font-weight: 500; letter-spacing: 0; }
[data-theme="v1"] h2, [data-theme="v1"] h3 { font-weight: 500; letter-spacing: 0; }
[data-theme="v1"] .logo { font-weight: 500; letter-spacing: 0; }
[data-theme="v1"] .logo-picto { border-radius: var(--rayon-bouton); background: var(--bouton-principal); color: #FFFFFF; }

/* Barre du haut : la « navbar » blanche, bordée, légère ombre */
[data-theme="v1"] .entete { background: var(--surface); border-bottom: 1px solid var(--trait); box-shadow: var(--ombre); margin-bottom: var(--e1); }
@media (min-width: 64rem) {
    [data-theme="v1"] .entete { padding-bottom: var(--e2); }
    [data-theme="v1"] .laterale { background: var(--surface-2); }
    [data-theme="v1"] .laterale-nav a[aria-current="page"] { background: var(--bouton-principal); color: #FFFFFF; }
    [data-theme="v1"] .laterale-nav a[aria-current="page"] .icone { color: #FFFFFF; }
}

/* Cartes : bordées, sans ombre, coins de 6 px */
[data-theme="v1"] .carte, [data-theme="v1"] .carte-chiffre { box-shadow: none; border-color: var(--trait); }

/* Boutons : « btn-primary » plein, les autres en « btn-outline-secondary » */
[data-theme="v1"] .bouton { font-weight: 400; border-color: #6C757D; color: var(--texte); }
[data-theme="v1"] .bouton:hover { background: var(--surface-2); }
[data-theme="v1"] .bouton-principal { background: var(--bouton-principal); border-color: var(--bouton-principal); color: #FFFFFF; }
[data-theme="v1"] .bouton-principal:hover { background: #0B5ED7; border-color: #0A58CA; filter: none; }

/* Onglets du domaine : « nav-pills » */
[data-theme="v1"] .onglets-domaine { background: transparent; padding: 0; }
[data-theme="v1"] .onglets-domaine a { color: var(--principal); font-weight: 400; }
[data-theme="v1"] .onglets-domaine a[aria-current="page"] { background: var(--bouton-principal); color: #FFFFFF; font-weight: 400; box-shadow: none; }
[data-theme="v1"] .onglets a[aria-current="page"] .onglet-picto { background: var(--principal-doux); }

/* Pastilles : « badge » */
[data-theme="v1"] .pastille { font-weight: 600; }

/* Messages : « alert », succès en vert comme dans Bootstrap */
[data-theme="v1"] .message { border: 1px solid transparent; }
[data-theme="v1"] .message-succes { background: var(--vert-doux); color: var(--vert); border-color: color-mix(in srgb, var(--vert) 25%, transparent); }
[data-theme="v1"] .message-erreur { border-color: color-mix(in srgb, var(--rouge) 25%, transparent); }
[data-theme="v1"] .message-info { border-color: color-mix(in srgb, var(--bleu) 25%, transparent); }
[data-theme="v1"] .message-alerte { border-color: color-mix(in srgb, var(--ocre) 25%, transparent); }
[data-theme="v1"] .notification-succes .icone { color: var(--vert-doux); }

/* Champs : « form-control », anneau bleu au focus */
[data-theme="v1"] input:not([type="checkbox"], [type="radio"]), [data-theme="v1"] select, [data-theme="v1"] textarea { padding: 8px 12px; background: var(--fond); }
[data-theme="v1"] input:focus, [data-theme="v1"] select:focus, [data-theme="v1"] textarea:focus {
    border-color: #86B7FE; outline: 0; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}
[data-theme="v1"] :focus-visible { outline-color: #86B7FE; }

/* Aperçu des thèmes dans Mon compte */
.choix-lot .apercu-theme { display: inline-flex; flex-direction: row; gap: 4px; padding: 0; border: 0; background: none; margin-bottom: 6px; }
.apercu-theme i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .15); }
.apercu-theme-actuel i:nth-child(1) { background: #F6F4EF; } .apercu-theme-actuel i:nth-child(2) { background: #2F6B3F; } .apercu-theme-actuel i:nth-child(3) { background: #9A5B0E; }
.apercu-theme-v1 i { border-radius: 3px; }
.apercu-theme-v1 i:nth-child(1) { background: #FFFFFF; } .apercu-theme-v1 i:nth-child(2) { background: #0D6EFD; } .apercu-theme-v1 i:nth-child(3) { background: #6C757D; }
.partage-fichiers .ligne { padding-inline: 0; }
.partage-vignette { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: var(--rayon-petit); border: 1px solid var(--trait); }

/* Facture de vente : lignes en cartes sur téléphone, en grille sur ordinateur */
.lignes-vente { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e2); }
.ligne-vente { position: relative; display: grid; gap: var(--e1); padding: var(--e2); border: 1px solid var(--trait); border-radius: var(--rayon-bouton); background: var(--fond); }
.ligne-vente-chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e1); }
@media (min-width: 48rem) { .ligne-vente-chiffres { grid-template-columns: 1fr 1.2fr 1.3fr 1.3fr 1.2fr 1.3fr; } }
.ligne-vente .champ > label { font-size: 13px; }
.ligne-vente-montant { align-content: end; }
.ligne-vente-montant output { min-height: var(--cible); display: flex; align-items: center; justify-content: flex-end; font-weight: 600; }
.ligne-vente-retirer { position: absolute; top: 6px; right: 6px; }
.ligne-vente-designation { padding-right: 40px; }
.ajout-lignes { align-items: end; }
.ajout-animal { flex: 1 1 16rem; min-width: 0; }
.ligne-cp-ville { grid-template-columns: minmax(6rem, 1fr) minmax(0, 2.5fr); }
.totaux-vente { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--e2); margin: 0; max-width: 22rem; margin-left: auto; }
.totaux-vente dd { margin: 0; text-align: right; }
.apercu-vente .apercu-cadre { width: 100%; height: 70dvh; border: 1px solid var(--trait); border-radius: var(--rayon-petit); }
.actions-vente .bouton { flex: 1 1 auto; }
.actions-vente .bouton-principal { flex-basis: 100%; }
@media (min-width: 48rem) { .actions-vente .bouton-principal { flex-basis: auto; flex-grow: 0; } .actions-vente .bouton { flex-grow: 0; } }

/* Relevé bancaire : « + » au bout d'une ligne à pointer, pour l'enregistrer comme achat ou recette sans facture */
.ligne-avec-action { display: flex; align-items: center; }
.ligne-avec-action > .ligne { flex: 1; min-width: 0; }
.ligne-avec-action > .bouton-ajout { width: 36px; height: 36px; margin-right: var(--e2); color: var(--principal); }
.ligne-avec-action > .bouton-ajout .icone { width: 18px; height: 18px; }
@media print { .bouton-ajout { display: none !important; } }

/* État du relevé bancaire (boîte d'arrivée, accueil de Gestion) */
p.releve-etat { margin: 0 0 var(--e2); font-size: 14px; }
p.releve-etat .icone { width: 16px; height: 16px; vertical-align: -3px; color: var(--principal); }
.message.releve-etat { margin: 0 0 var(--e2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.message.releve-etat > span { flex: 1 1 16rem; }

/* Accueil avec une seule colonne remplie (vétérinaire…) : sur ordinateur, ses cadres se répartissent sur toute la
   largeur, en deux colonnes équilibrées, au lieu de laisser une moitié d'écran vide. */
@media (min-width: 64rem) {
    .accueil.accueil-une-colonne { display: block; }
    .accueil-une-colonne > .accueil-colonne { display: block; columns: 2; column-gap: var(--e2); }
    .accueil-une-colonne > .accueil-colonne > * { break-inside: avoid; }
}

/* ---------- 9. Thème « Rose » (choisi dans Mon compte) ----------
   La disposition et les formes habituelles, palette rose poudré. Contrastes : le rose principal sur blanc,
   le texte secondaire sur le fond, et leurs équivalents sombres restent au-dessus de 4,5:1 (AA). */

[data-theme="rose"] {
    --fond: #FBF4F6;
    --surface: #FFFFFF;
    --surface-2: #F5E6EB;
    --texte: #2A1B21;
    --texte-2: #6E5A62;
    --trait: #EBD8DF;
    --principal: #B0306A;
    --principal-doux: #F9E1EC;
    --sur-principal: #FFFFFF;
    --ombre: 0 1px 2px rgba(42, 27, 33, .05), 0 6px 20px rgba(176, 48, 106, .06);
    --voile: rgba(42, 27, 33, .4);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    [data-theme="rose"] {
        --fond: #1A1216;
        --surface: #231A1F;
        --surface-2: #2F242A;
        --texte: #F3E9ED;
        --texte-2: #BCA8B0;
        --trait: #3A2D33;
        --principal: #F28DB8;
        --principal-doux: #3D1F2D;
        --sur-principal: #1A0E14;
        --ombre: none;
        --voile: rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

/* ---------- 10. Thème « Geek » (choisi dans Mon compte) ----------
   Plus serré et plus dense : espacements et cibles réduits, coins presque droits, titres, chiffres,
   onglets et pastilles en police à chasse fixe, palette d'éditeur de code (vert sarcelle ; vert terminal en sombre).
   Les champs de saisie gardent 16 px : en dessous, Safari sur iPhone zoome à chaque saisie. */

[data-theme="geek"] {
    --fond: #F6F8FA;
    --surface: #FFFFFF;
    --surface-2: #EEF1F4;
    --texte: #1F2328;
    --texte-2: #59636E;
    --trait: #D0D7DE;
    --principal: #0E7C66;
    --principal-doux: #DDF4EE;
    --sur-principal: #FFFFFF;
    --ombre: none;
    --voile: rgba(31, 35, 40, .45);
    --rayon-carte: 6px;
    --rayon-bouton: 4px;
    --rayon-petit: 3px;
    --rayon-pastille: 4px;
    --e1: 6px;
    --e2: 12px;
    --e3: 16px;
    --e4: 24px;
    --cible: 36px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    [data-theme="geek"] {
        --fond: #0D1117;
        --surface: #161B22;
        --surface-2: #21262D;
        --texte: #E6EDF3;
        --texte-2: #9198A1;
        --trait: #30363D;
        --principal: #3FB950;
        --principal-doux: #12261E;
        --sur-principal: #0D1117;
        --ocre: #D29922;
        --ocre-doux: #2B2111;
        --bleu: #58A6FF;
        --bleu-doux: #0F2238;
        --rouge: #F85149;
        --rouge-doux: #3A1715;
        --voile: rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

[data-theme="geek"] h1, [data-theme="geek"] .titre-page h1 { font: 600 20px/1.25 var(--mono); letter-spacing: -.01em; }
[data-theme="geek"] h2 { font: 600 14px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
[data-theme="geek"] .nombre, [data-theme="geek"] .carte-chiffre-valeur, [data-theme="geek"] .montant, [data-theme="geek"] code { font-family: var(--mono); font-variant-numeric: normal; }
[data-theme="geek"] .logo { font-family: var(--mono); letter-spacing: 0; }

[data-theme="geek"] .carte { padding: 12px; }
[data-theme="geek"] .carte-entete { margin-bottom: 8px; }
[data-theme="geek"] .carte-chiffre { padding: 10px 12px; border-radius: var(--rayon-carte); gap: 2px; }
[data-theme="geek"] .grille-cartes { gap: 8px; }

[data-theme="geek"] .ligne { min-height: 40px; padding: 6px 12px; gap: 10px; }
[data-theme="geek"] .ligne-picto { width: 28px; height: 28px; border-radius: var(--rayon-petit); }
[data-theme="geek"] .ligne-picto .icone { width: 16px; height: 16px; }

[data-theme="geek"] .bouton { padding: 6px 12px; font-weight: 500; }
[data-theme="geek"] .bouton .icone { width: 16px; height: 16px; }
[data-theme="geek"] .pastille { padding: 2px 6px; font: 500 12px/1.3 var(--mono); }
[data-theme="geek"] .onglets-domaine { padding: 3px; gap: 3px; }
[data-theme="geek"] .onglets-domaine a { min-height: 30px; font: 500 12px var(--mono); }
[data-theme="geek"] .champ { gap: 4px; }
[data-theme="geek"] input:not([type="checkbox"], [type="radio"]), [data-theme="geek"] select, [data-theme="geek"] textarea { padding: 6px 10px; }
[data-theme="geek"] .tableau th, [data-theme="geek"] .tableau td { padding: 6px 12px; }
[data-theme="geek"] .message { padding: 8px 12px; }
@media (min-width: 64rem) {
    [data-theme="geek"] .laterale-nav a { min-height: 34px; }
}

/* Aperçu des nouveaux thèmes dans Mon compte */
.apercu-theme-rose i:nth-child(1) { background: #FBF4F6; } .apercu-theme-rose i:nth-child(2) { background: #B0306A; } .apercu-theme-rose i:nth-child(3) { background: #F28DB8; }
.apercu-theme-geek i { border-radius: 2px; }
.apercu-theme-geek i:nth-child(1) { background: #0D1117; } .apercu-theme-geek i:nth-child(2) { background: #3FB950; } .apercu-theme-geek i:nth-child(3) { background: #0E7C66; }

/* Frise des lots (Parcelles › Registre) : une barre SVG par lot sur l'année, un segment coloré par passage.
   Une parcelle garde sa couleur d'un lot à l'autre (Frise::COULEURS = 10). Sur téléphone, le nom du lot est au-dessus. */
.frise { margin-bottom: var(--e3); }
.frise > :is(h2, h3) { scroll-margin-top: var(--sous-entete); }
.frise-mois { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: 4px; font-size: 11px; line-height: 16px; color: var(--texte-2); }
.frise-mois span { padding-left: 3px; border-left: 1px solid var(--trait); }
.frise-ligne { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 12px; margin-bottom: 12px; }
.frise-lot { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.frise-lot strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frise-lot small { flex: none; white-space: nowrap; }
.frise-barre { display: block; width: 100%; height: 30px; }
.frise-fond { fill: var(--surface-2); }
.frise-segment rect { stroke: var(--surface); stroke-width: 1px; }
.frise-segment text { fill: #FFFFFF; font-size: 11px; font-weight: 600; pointer-events: none; }
a:hover > .frise-segment rect, a:focus-visible > .frise-segment rect { filter: brightness(1.15); }
.frise-fin-ouverte { stroke: #FFFFFF; stroke-width: 4px; stroke-dasharray: 3 3; opacity: .8; }
.frise-aujourdhui { stroke: var(--texte); stroke-width: 2px; opacity: .55; pointer-events: none; }
.frise-detail summary { font-size: 13px; color: var(--texte-2); cursor: pointer; }
.frise-detail ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.frise-detail li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.frise-puce { display: inline-block; width: 12px; height: 12px; border-radius: 3px; align-self: center; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.frise-barre { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
@media (min-width: 48rem) {
    .frise-ligne { grid-template-columns: 11rem minmax(0, 1fr); }
    .frise-ligne .frise-detail { grid-column: 2; }
    .frise-mois { margin-left: calc(11rem + 12px); }
}
.frise-c0 { background-color: #2F6B3F; fill: #2F6B3F; } .frise-c1 { background-color: #2F5D8C; fill: #2F5D8C; } .frise-c2 { background-color: #9A5B0E; fill: #9A5B0E; }
.frise-c3 { background-color: #7A3E8E; fill: #7A3E8E; } .frise-c4 { background-color: #A0522D; fill: #A0522D; } .frise-c5 { background-color: #1F7A7A; fill: #1F7A7A; }
.frise-c6 { background-color: #5B6B1F; fill: #5B6B1F; } .frise-c7 { background-color: #8C2F5D; fill: #8C2F5D; } .frise-c8 { background-color: #4B5563; fill: #4B5563; }
.frise-c9 { background-color: #7C5A2E; fill: #7C5A2E; }
@media (prefers-color-scheme: dark) {
    .frise-c0 { background-color: #3F8F55; fill: #3F8F55; } .frise-c1 { background-color: #3F7BB8; fill: #3F7BB8; } .frise-c2 { background-color: #B07A1E; fill: #B07A1E; }
    .frise-c3 { background-color: #9A5CB0; fill: #9A5CB0; } .frise-c4 { background-color: #B8643A; fill: #B8643A; } .frise-c5 { background-color: #2C8F8F; fill: #2C8F8F; }
    .frise-c6 { background-color: #74872A; fill: #74872A; } .frise-c7 { background-color: #B04A7D; fill: #B04A7D; } .frise-c8 { background-color: #667085; fill: #667085; }
    .frise-c9 { background-color: #9A7442; fill: #9A7442; }
}
@media print {
    .frise-detail { display: none; }
    .frise-ligne { break-inside: avoid; }
    .frise-c0 { background-color: #2F6B3F !important; fill: #2F6B3F !important; } .frise-c1 { background-color: #2F5D8C !important; fill: #2F5D8C !important; } .frise-c2 { background-color: #9A5B0E !important; fill: #9A5B0E !important; }
    .frise-c3 { background-color: #7A3E8E !important; fill: #7A3E8E !important; } .frise-c4 { background-color: #A0522D !important; fill: #A0522D !important; } .frise-c5 { background-color: #1F7A7A !important; fill: #1F7A7A !important; }
    .frise-c6 { background-color: #5B6B1F !important; fill: #5B6B1F !important; } .frise-c7 { background-color: #8C2F5D !important; fill: #8C2F5D !important; } .frise-c8 { background-color: #4B5563 !important; fill: #4B5563 !important; }
    .frise-c9 { background-color: #7C5A2E !important; fill: #7C5A2E !important; }
}
