/*
  Identité des marques sur le board : le seul endroit où changer couleurs et polices (voir docs/marques/README.md).

  Polices des chartes d'abord, puis leurs substituts Google Fonts (chargés par le board) :
  Europa → Questrial, Houschka Rounded → Nunito, Bahnschrift (Windows) → Barlow.
  Avec un kit Adobe Fonts, il suffit de le charger : les noms des chartes sont déjà en tête de liste.
*/
:root {
  --police-bd-titre: "Europa", "Questrial", "Barlow", system-ui, sans-serif;
  --police-bd-texte: "Bahnschrift", "Barlow", system-ui, sans-serif;
  --police-eo: "Houschka Rounded", "Nunito", system-ui, sans-serif;

  /* Couleurs des chartes */
  --bd-noir: #231F20;
  --bd-gold: #B19C7F;
  --bd-gold-actif: #92826C;
  --bd-gris-clair: #E7E7E7;
  --eo-noir: #000000;
  --eo-dore: #85714D;        /* Pantone 872 C à l'écran : textes et filets dorés lisibles sur blanc */
  --eo-dore-texture: #DEA612; /* moyenne de la texture dorée du logo : décors seulement */

  /* Valeurs par défaut (liste des chantiers, deux marques mêlées) : l'identité Bois & Design de l'outil. */
  --police-titre: var(--police-bd-titre);
  --police-texte: var(--police-bd-texte);
  --marque-encre: var(--bd-noir);
  --marque-accent: var(--bd-gold);
  --marque-accent-texte: var(--bd-gold-actif);
  --marque-fond: var(--bd-gris-clair);
}

.marque-bd {
  --police-titre: var(--police-bd-titre);
  --police-texte: var(--police-bd-texte);
  --marque-encre: var(--bd-noir);
  --marque-accent: var(--bd-gold);
  --marque-accent-texte: var(--bd-gold-actif);
  --marque-fond: var(--bd-gris-clair);
}

.marque-eo {
  --police-titre: var(--police-eo);
  --police-texte: var(--police-eo);
  --marque-encre: var(--eo-noir);
  --marque-accent: var(--eo-dore-texture);
  --marque-accent-texte: var(--eo-dore);
  --marque-fond: #F3EFE6;
}

.police-titre { font-family: var(--police-titre); }
.police-texte { font-family: var(--police-texte); }

/* Bandeau d'en-tête d'un chantier : fond de la marque, filet d'accent. */
.bandeau-marque { background: var(--marque-encre); color: #fff; border-bottom: 3px solid var(--marque-accent); }
.accent-marque { color: var(--marque-accent-texte); }
.fond-marque { background: var(--marque-fond); }
.filet-marque { border-color: var(--marque-accent); }
.pastille-marque { background: var(--marque-accent); }

/* Frise du planning : la plage annoncée en pointillés, la plage prévue en plein. */
.frise-piste { position: relative; height: 1.75rem; }
.frise-annonce, .frise-prevu { position: absolute; top: .25rem; height: 1.25rem; border-radius: .25rem; }
.frise-annonce { border: 1.5px dashed #78716C; background: transparent; }
.frise-prevu { top: .5rem; height: .75rem; opacity: .9; }
.frise-aujourdhui { position: absolute; top: 0; bottom: 0; width: 2px; background: #B42318; }

/* Dépôt de documents : la zone s'allume quand un fichier la survole. */
.zone-depot { border: 2px dashed #D6D3D1; transition: border-color .15s, background-color .15s; }
.zone-depot.survol { border-color: var(--marque-accent-texte); background: var(--marque-fond); }

/* Sommaire collant des sections du board */
.sommaire-board { position: sticky; top: .5rem; z-index: 20; }
[id].section-board { scroll-margin-top: 4rem; }

/* Planning général : colonne des noms (fixe au défilement), puis la frise. */
.planning-grille { display: grid; grid-template-columns: 11rem minmax(0, 1fr); }
@media (min-width: 640px) { .planning-grille { grid-template-columns: 16rem minmax(0, 1fr); } }
.zone-absence { background: repeating-linear-gradient(135deg, rgb(120 113 108 / .22) 0 4px, rgb(120 113 108 / .06) 4px 8px); }
/* Charge de l'atelier, par demi-journée : affectations en production face aux personnes disponibles. */
.charge-vide { background: transparent; }
.charge-normal { background: rgb(212 149 43 / .22); color: #7A5A1C; }
.charge-plein { background: rgb(212 149 43 / .55); color: #4A3610; }
.charge-sature { background: #D03B3B; color: #fff; }
/* Étape en conflit : un contour (la barre porte déjà une ombre intérieure à la couleur de son type). */
.barre-conflit { outline: 2px solid #D03B3B; outline-offset: -1px; }

/* Planning (rafraîchi le 17.11.2026) : barre unique, frise claire, barres pleines, charge de l'atelier, « À planifier ». */
.pl-barre { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.pl-segments { display: inline-flex; padding: 3px; border-radius: .6rem; background: #EFE9DF; }
.pl-segments label { cursor: pointer; }
.pl-segments span { display: block; padding: .3rem .8rem; border-radius: .45rem; font-size: 13px; font-weight: 500; color: #6B6259; }
.pl-segments input:checked + span { background: #fff; color: #231F20; box-shadow: 0 1px 2px rgb(35 31 32 / .12); }
.pl-segments input:focus-visible + span { outline: 2px solid #231F20; }
.pl-periode { display: inline-flex; align-items: center; gap: .25rem; }
.pl-icone, .pl-aujourdhui, .pl-filtres-bouton { display: inline-flex; align-items: center; gap: .4rem; height: 2.1rem; border: 1px solid #DDD3C4; border-radius: .55rem; background: #fff; color: #231F20; font-size: 13px; font-weight: 500; }
.pl-icone { width: 2.1rem; justify-content: center; }
.pl-aujourdhui, .pl-filtres-bouton { padding: 0 .75rem; }
.pl-icone:hover, .pl-aujourdhui:hover, .pl-filtres-bouton:hover { border-color: #231F20; }
.pl-dates { margin-left: .35rem; font-size: 14px; font-weight: 600; color: #231F20; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-compteur { display: inline-grid; place-items: center; min-width: 1.1rem; height: 1.1rem; padding: 0 .25rem; border-radius: 999px; background: #231F20; color: #fff; font-size: 10px; letter-spacing: -.1em; }
.pl-menu { position: absolute; z-index: 40; left: 0; margin-top: .35rem; width: 17rem; display: grid; gap: .6rem; padding: .75rem; border: 1px solid #E7E0D5; border-radius: .8rem; background: #fff; box-shadow: 0 12px 28px -10px rgb(35 31 32 / .3); }
.pl-champ { display: grid; gap: .25rem; }
.pl-champ > span { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #7A6446; }
.pl-chiffres { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .9rem; font-size: 13px; color: #6B6259; }
.pl-chiffres b { font-weight: 600; color: #231F20; font-variant-numeric: tabular-nums; }
.pl-chiffres a { border-radius: .35rem; padding: 0 .2rem; }
.pl-chiffres a:hover { background: #F3EDE4; }
.pl-chiffres .pl-alerte, .pl-chiffres .pl-alerte b { color: #B42318; }
.pl-chiffres .pl-actif { background: #231F20; color: #fff; } .pl-chiffres .pl-actif b { color: #fff; }
.pl-pastilles { margin-top: .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: 12px; }
.pl-pastille { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; background: #231F20; padding: .2rem .65rem; font-weight: 500; color: #fff; }
.pl-pastille:hover { background: #000; }
.pl-tout-effacer { border-radius: 999px; border: 1px solid #DDD3C4; padding: .15rem .6rem; color: #6B6259; }
.pl-tout-effacer:hover { border-color: #231F20; color: #231F20; }
.pl-cadre { overflow: hidden; border: 1px solid #E7E0D5; border-radius: .9rem; background: #fff; box-shadow: 0 1px 2px rgb(122 100 70 / .06); }
.pl-bande-jour { pointer-events: none; position: absolute; inset-block: 0; background: rgb(177 156 127 / .14); box-shadow: inset 1px 0 0 rgb(122 100 70 / .25), inset -1px 0 0 rgb(122 100 70 / .25); }
.pl-marque { flex-shrink: 0; border-radius: .25rem; background: #231F20; padding: 0 .3rem; font-size: 10px; font-weight: 600; color: #B19C7F; }
.pl-marque--eo { background: #000; color: #DEA612; }
.pl-resume { position: absolute; top: 50%; height: .55rem; transform: translateY(-50%); border-radius: 999px; }
.pl-barre-etape { position: absolute; top: .375rem; height: 1.5rem; display: flex; align-items: center; overflow: hidden; white-space: nowrap; border-radius: .45rem; padding: 0 .5rem; font-size: 11.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 1px rgb(0 0 0 / .18); box-shadow: 0 1px 2px rgb(35 31 32 / .18); }
.pl-barre-etape { container-type: inline-size; }
@container (max-width: 46px) { .pl-barre-etape > span { display: none; } }
.pl-barre-etape:hover { filter: brightness(1.06); box-shadow: 0 3px 8px -2px rgb(35 31 32 / .35); }
.pl-barre-etape--personne { top: auto; height: 22px; font-size: 11px; }
.pl-annonce { position: absolute; top: .2rem; height: 1.85rem; border: 1.5px dashed rgb(35 31 32 / .45); border-radius: .55rem; }
.pl-charge { position: absolute; inset-block: .4rem; display: flex; align-items: center; justify-content: center; margin: 0 1px; border-radius: .3rem; font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-charge.charge-vide { background: #F1ECE4; }
.pl-a-planifier { margin-top: 1rem; border: 1px solid #E7E0D5; border-radius: .9rem; background: #fff; }
.pl-a-planifier h2 { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid #F1ECE4; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #231F20; }
.pl-a-planifier h2 span { border-radius: 999px; background: #FEF0C7; padding: 0 .45rem; font-size: 11px; letter-spacing: 0; color: #93370D; }
.pl-a-planifier ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.pl-a-planifier li { display: flex; align-items: center; gap: .65rem; min-width: 0; padding: .55rem 1rem; border-bottom: 1px solid #F6F2EC; font-size: 13px; }

/* Planning : barres qu'on glisse (déplacer) et dont on tire le bord droit (allonger), bulle du décalage. */
[data-deplacable] { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
[data-deplacable]::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 7px; cursor: ew-resize; }
[data-deplacable]:hover::after { background: rgb(35 31 32 / .25); }
.planning-barre-deplacee { z-index: 30 !important; box-shadow: 0 8px 20px -6px rgb(0 0 0 / .35), 0 0 0 2px #231F20 !important; }
body.planning-glisse, body.planning-glisse * { cursor: grabbing !important; user-select: none; }
.planning-bulle { position: fixed; z-index: 80; pointer-events: none; border-radius: .375rem; background: #231F20; color: #fff; padding: .25rem .5rem; font-size: .75rem; font-weight: 600; white-space: nowrap; }

/* Écran de l'atelier : lu debout, au doigt. Grandes lettres, grandes cibles (au moins 56 px de haut). */
.ecran-atelier { font-size: 1.125rem; line-height: 1.6; }
.bouton-atelier { display: inline-flex; min-height: 3.5rem; align-items: center; justify-content: center; gap: .6rem; border-radius: .9rem; padding: .75rem 1.25rem; font-size: 1.125rem; font-weight: 600; text-align: center; transition: filter .15s, background-color .15s; }
.bouton-atelier:active { filter: brightness(.92); }
.bouton-atelier-principal { background: var(--marque-encre); color: #fff; }
.bouton-atelier-secondaire { background: #fff; color: #1C1917; box-shadow: inset 0 0 0 2px #D6D3D1; }
.bouton-atelier-alerte { background: #F79009; color: #fff; }
.onglet-atelier { display: inline-flex; min-height: 3rem; align-items: center; gap: .5rem; border-radius: .75rem; padding: .5rem 1rem; font-size: 1.05rem; font-weight: 600; color: #44403C; background: #F5F5F4; }
.onglet-atelier.actif { background: var(--marque-encre); color: #fff; }
.choix-atelier { display: flex; min-height: 3.75rem; align-items: center; gap: .75rem; border-radius: .9rem; border: 2px solid #E7E5E4; background: #fff; padding: .75rem 1rem; font-size: 1.125rem; font-weight: 600; cursor: pointer; }
.peer:checked + .choix-atelier, .choix-atelier.actif { border-color: var(--marque-encre); background: #F5F5F4; box-shadow: inset 0 0 0 1px var(--marque-encre); }
.peer:focus-visible + .choix-atelier { outline: 3px solid #F79009; outline-offset: 2px; }

/* Montant d'un chantier : pastille verte, « Fr. » à la place de « CHF ». */
.pastille-montant { display: inline-flex; align-items: center; border-radius: 9999px; background: #ECFDF3; color: #067647;
  box-shadow: inset 0 0 0 1px #ABEFC6; padding: .125rem .5rem; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums; }

/* Gantt du board d'un chantier : nom de l'étape | frise | personnes. */
.gantt-ligne { display: grid; grid-template-columns: 12rem minmax(0, 1fr) 16rem; align-items: center; min-height: 2.25rem; }
.gantt-piste { height: 2.25rem; border-left: 1px solid #E7E5E4; }
.gantt-piste .frise-annonce { top: .35rem; height: 1.55rem; }
.gantt-barre { position: absolute; top: .6rem; height: 1.05rem; border-radius: .3rem; box-shadow: 0 1px 2px rgb(0 0 0 / .15); min-width: 10px; }
button.gantt-barre { cursor: pointer; transition: filter .15s, transform .15s; }
button.gantt-barre:hover { filter: brightness(1.1); transform: scaleY(1.15); }

/* Sections du board : un filet de couleur en tête, repris dans la barre des sections. */
.section-board { border-top-width: 3px; }
#planning.section-board { border-top-color: #3B6FD4; }
#documents.section-board { border-top-color: #D9A13B; }
#echanges.section-board { border-top-color: #7C5CC4; }
#commandes.section-board { border-top-color: #0E8A7E; }
#intervenants.section-board { border-top-color: #3F9A5A; }
#client.section-board { border-top-color: #B19C7F; }
#signature.section-board { border-top-color: #231F20; }
.lien-section { display: inline-flex; align-items: center; gap: .35rem; border-radius: .375rem; padding: .3rem .55rem; font-weight: 500; color: #57534E; }
.lien-section:hover { background: #F5F5F4; color: #231F20; }
.lien-section::before { content: ""; width: .5rem; height: .5rem; border-radius: 9999px; background: #A8A29E; }
.lien-section--planning::before { background: #3B6FD4; } .lien-section--documents::before { background: #D9A13B; }
.lien-section--echanges::before { background: #7C5CC4; } .lien-section--commandes::before { background: #0E8A7E; }
.lien-section--intervenants::before { background: #3F9A5A; } .lien-section--signalements::before { background: #F79009; }
.lien-section--signature::before { background: #231F20; }
.lien-section-nombre { font-size: 11px; font-variant-numeric: tabular-nums; color: #A8A29E; }

/* Prochaine action : ce qui manque, en pastilles. */
.pastille-manque { display: inline-flex; max-width: 22rem; align-items: center; gap: .35rem; border-radius: 9999px; padding: .2rem .6rem;
  font-size: 12px; font-weight: 500; box-shadow: inset 0 0 0 1px currentColor; }
.pastille-manque--bloquant { color: #B42318; background: #FEF3F2; }
.pastille-manque--attention { color: #B54708; background: #FFFAEB; }
.pastille-manque--info { color: #57534E; background: #F5F5F4; box-shadow: inset 0 0 0 1px #D6D3D1; }
.pastille-manque--ok { color: #067647; background: #ECFDF3; }

/* Fiche du chantier : boutons-icônes et pastilles de couleur, partout la même grammaire. */
.icone-bouton { display: inline-grid; place-items: center; height: 1.75rem; width: 1.75rem; flex-shrink: 0; border-radius: .4rem;
  color: #78716C; transition: background-color .15s, color .15s; cursor: pointer; list-style: none; }
.icone-bouton::-webkit-details-marker { display: none; }
.icone-bouton:hover, details[open] > .icone-bouton { background: #F5F5F4; color: #231F20; }
.icone-bouton--danger:hover { background: #FEF3F2; color: #B42318; }
.icone-bouton--plein { background: #231F20; color: #fff; }
.icone-bouton--plein:hover { background: #3A3436; color: #fff; }
.badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 9999px; padding: .0625rem .5rem; font-size: 11px;
  font-weight: 500; line-height: 1.25rem; white-space: nowrap; }
.badge--gris { background: #F5F5F4; color: #57534E; }
.badge--chene { background: #F3EEE6; color: #7A6446; }
.badge--bleu { background: #EFF4FF; color: #2850A8; }
.badge--violet { background: #F4F0FF; color: #5B3FA8; }
.badge--vert { background: #ECFDF3; color: #067647; }
.badge--ambre { background: #FFFAEB; color: #B54708; }
.badge--rouge { background: #FEF3F2; color: #B42318; }
.badge--sarcelle { background: #EBF8F6; color: #0B6E65; }
.badge--encre { background: #231F20; color: #fff; }
.ligne-fiche { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; }
.ligne-fiche .actions-survol { opacity: 0; transition: opacity .15s; }
.ligne-fiche:hover .actions-survol, .ligne-fiche:focus-within .actions-survol { opacity: 1; }
@media (hover: none) { .ligne-fiche .actions-survol { opacity: 1; } }
.sous-titre-fiche { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #78716C; }
.gantt-dates { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 11px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: #57534E; pointer-events: none; }

/* Liste des clients : sélecteur de type en pastille, interrupteur « Grouper par type », lignes alternées. */
.select-badge { appearance: none; -webkit-appearance: none; border: 0; border-radius: 9999px; padding: .0625rem 1.35rem .0625rem .55rem;
  font-size: 11px; font-weight: 500; line-height: 1.25rem; cursor: pointer; field-sizing: content;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2378716C'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .35rem center; background-size: .8rem; }
.select-badge:hover { filter: brightness(.96); }
.select-badge:focus { outline: 2px solid #B19C7F; outline-offset: 1px; }
.interrupteur { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; user-select: none; }
.interrupteur-piste { position: relative; height: 1.25rem; width: 2.2rem; border-radius: 9999px; background: #D6D3D1; transition: background .2s; }
.interrupteur-piste::after { content: ""; position: absolute; top: .125rem; left: .125rem; height: 1rem; width: 1rem; border-radius: 9999px;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s; }
.peer:checked ~ .interrupteur-piste { background: #231F20; }
.peer:checked ~ .interrupteur-piste::after { transform: translateX(.95rem); }
.peer:focus-visible ~ .interrupteur-piste { outline: 2px solid #B19C7F; outline-offset: 2px; }
#resultats-clients tbody tr.ligne-client:nth-child(even) { background: #FAF8F5; }
#resultats-clients tbody.groupe tr.ligne-client { background: #fff; }
#resultats-clients tr.titre-groupe td { background: #F5F3EF; padding: .45rem 1rem; border-top: 1px solid #E7E5E4; }

/* Liste déroulante qui cherche (caractéristiques d'un article). */
.combo-liste { position: absolute; left: 0; right: 0; top: calc(100% + .25rem); z-index: 40; max-height: 16rem; overflow-y: auto;
  border: 1px solid #E7E5E4; border-radius: .625rem; background: #fff; box-shadow: 0 10px 28px rgb(35 31 32 / .14); padding: .25rem; }
.combo-option { display: flex; width: 100%; align-items: center; gap: .5rem; border-radius: .4rem; padding: .4rem .55rem; text-align: left; font-size: 13px; }
.combo-option.actif { background: #F4F0FF; }

/* Ligne « Ensuite » du board : ce qui manque, compté par gravité (la liste dans la bulle). */
.compteur-manque { display: inline-flex; align-items: center; gap: .3rem; border-radius: 9999px; padding: .15rem .55rem; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: default; }
.compteur-manque--bloquant { color: #B42318; background: #FEF3F2; box-shadow: inset 0 0 0 1px #FDA29B; }
.compteur-manque--attention { color: #B54708; background: #FFFAEB; box-shadow: inset 0 0 0 1px #FEC84B; }
.compteur-manque--info { color: #57534E; background: #F5F5F4; box-shadow: inset 0 0 0 1px #E7E5E4; }
.compteur-manque--ok { color: #067647; background: #ECFDF3; font-weight: 500; }

/* Matériel du board, onglet « Commandé » : une carte par commande, liseré de la couleur de son statut. */
.commande-materiel { border: 1px solid #EEECE9; border-left-width: 3px; border-radius: .625rem; background: #fff; transition: box-shadow .15s; }
.commande-materiel:hover { box-shadow: 0 1px 3px rgb(35 31 32 / .08); }
.commande-materiel--brouillon { border-left-color: #A8A29E; }
.commande-materiel--commandee { border-left-color: #2850A8; }
.commande-materiel--confirmee { border-left-color: #7A5AF8; }
.commande-materiel--livree_en_partie { border-left-color: #DC6803; }
.commande-materiel--livree { border-left-color: #12B76A; opacity: .72; }
.commande-materiel--livree:hover { opacity: 1; }
.commande-materiel--annulee { border-left-color: #D6D3D1; opacity: .6; }
.commande-materiel--retard { border-left-color: #D92D20; background: #FFFBFA; }

/* Explorateur de documents du chantier : arbre indenté, lignes compactes, actions au survol, cible du glisser. */
.explo, .explo-enfants { list-style: none; margin: 0; padding: 0; }
.explo-ligne { display: flex; align-items: center; gap: .5rem; min-height: 2rem; border-radius: .4rem; padding: .2rem .5rem;
  padding-left: calc(.5rem + var(--prof, 0) * 1.25rem); }
.explo-tete { cursor: pointer; user-select: none; }
.explo-tete:hover, .explo-fichier:hover { background: #F5F3EF; }
.explo-tete.survol { background: #EFF4FF; box-shadow: inset 0 0 0 1.5px #3B6FD4; }
.explo-chevron { display: grid; place-items: center; color: #A8A29E; transition: transform .15s; }
.explo-chevron.ouvert { transform: rotate(90deg); }
.explo-compte { font-size: 11px; font-variant-numeric: tabular-nums; color: #A8A29E; }
.explo-actions { margin-left: auto; display: flex; align-items: center; gap: .125rem; opacity: 0; transition: opacity .12s; }
.explo-ligne:hover > .explo-actions, .explo-ligne:focus-within > .explo-actions { opacity: 1; }
@media (hover: none) { .explo-actions { opacity: 1; } }
.explo-ext { display: grid; place-items: center; height: 1.75rem; width: 2.25rem; flex-shrink: 0; border-radius: .3rem; background: #F1EFEC;
  font-size: 9.5px; font-weight: 700; letter-spacing: .03em; color: #57534E; }
.explo-vide { font-size: 12px; color: #A8A29E; font-style: italic; }
.explo-glisse { opacity: .4; }
.explo-en-glisse .explo-tete { transition: background .1s; }

/* Nouvelle commande (Achats) : fenêtre large, PDF lu par l'IA, lignes réparties entre chantiers. */
.modale-commande { max-width: min(98vw, 118rem); }
.bloc-creation--ia { background: #F8F6FE; border-color: #E6E0FA; --bloc-fond: #EEE9FB; --bloc-texte: #6941C6; }
.bloc-creation--lignes { background: #fff; border-color: #E7E5E4; --bloc-fond: #F1EFEC; --bloc-texte: #44403C; }
.champ-petit { height: 2rem; padding-top: .25rem; padding-bottom: .25rem; font-size: 13px; }
.combo-bouton { display: flex; align-items: center; gap: .5rem; text-align: left; cursor: pointer; }
.depot-pdf { display: flex; min-height: 5rem; cursor: pointer; align-items: center; justify-content: center; border: 1.5px dashed #C4B5FD;
  border-radius: .625rem; background: #fff; padding: .75rem; transition: background .15s, border-color .15s; }
.depot-pdf:hover, .depot-pdf.survol { background: #F4F0FF; border-color: #6941C6; }
.depot-pdf.lecture { cursor: progress; background: linear-gradient(90deg, #fff, #F4F0FF, #fff); background-size: 200% 100%; animation: ia-vague 1.4s linear infinite; }
@keyframes ia-vague { from { background-position: 200% 0; } to { background-position: 0 0; } }
.ia-roue { display: inline-block; height: .9rem; width: .9rem; border-radius: 9999px; border: 2px solid #DDD6FE; border-top-color: #6941C6; animation: ia-tour .8s linear infinite; }
.ia-roue--blanc { border-color: rgb(255 255 255 / .35); border-top-color: #fff; }
@keyframes ia-tour { to { transform: rotate(360deg); } }
.ia-avis { display: inline-flex; margin-top: .25rem; border-radius: .3rem; padding: 0 .35rem; font-size: 10.5px; font-weight: 600; cursor: help; }
.ia-avis--sur { background: #ECFDF3; color: #067647; }
.ia-avis--verifier { background: #FFFAEB; color: #B54708; }
.ia-avis--nouveau { background: #EEE9FB; color: #6941C6; }

.lignes-commande-tete, .ligne-commande { display: grid; grid-template-columns: minmax(14rem, 1.3fr) minmax(10rem, 1fr) 5.5rem 6rem 6.5rem minmax(15rem, 1fr) 2rem; gap: .5rem; align-items: center; }
.lignes-commande-tete { padding: 0 .25rem .25rem; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #78716C; }
.ligne-commande { border-top: 1px solid #F5F5F4; padding: .5rem .25rem; }
.ligne-commande .champ, .ligne-commande .combo-bouton { height: 2.5rem; padding-top: 0; padding-bottom: 0; }
.ligne-commande .champ.champ-petit { height: 2rem; }
.ligne-commande--nouvelle { background: #FCFBFF; }
.repartition { display: flex; min-height: 2.5rem; width: 100%; align-items: center; border: 1px solid transparent; border-radius: .5rem;
  padding: .25rem .5rem .25rem .1rem; text-align: left; }
.repartition:hover:not(:disabled) { border-color: #E7E5E4; background: #FAFAF9; }
.repartition:disabled { cursor: default; }
.repartition--erreur { border-color: #FEC84B; background: #FFFAEB; }
.repartition-qte { border-radius: .3rem; padding: 0 .35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.repartition-reglage { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 45; width: min(26rem, calc(100vw - 4.5rem)); padding: .6rem .75rem;
  border: 1px solid #E7E5E4; border-radius: .625rem; background: #fff; box-shadow: 0 12px 30px rgb(35 31 32 / .16); }
.champ-pct { position: relative; display: block; width: 4.5rem; }
.champ-pct input { height: 2rem; width: 100%; border: 1px solid #D6D3D1; border-radius: .4rem; padding: 0 1.4rem 0 .5rem; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.champ-pct input:focus { outline: none; border-color: #231F20; }
.champ-pct--qte { width: 6.5rem; }
.champ-pct--qte input { padding-right: 2.6rem; }
.champ-pct span { pointer-events: none; position: absolute; inset: 0 .5rem 0 auto; display: flex; align-items: center; font-size: 12px; color: #A8A29E; }
@media (max-width: 1100px) {
  .lignes-commande-tete { display: none; }
  .ligne-commande { grid-template-columns: 5.5rem 6rem minmax(0, 1fr) 2rem; }
  .ligne-commande > :first-child, .ligne-commande > :nth-child(2) { grid-column: 1 / -1; }
  .ligne-commande > :nth-child(3) { grid-row: 3; grid-column: 1; }
  .ligne-commande > :nth-child(4) { grid-row: 3; grid-column: 2; }
  .ligne-commande > :nth-child(5) { grid-row: 3; grid-column: 3; }
  .ligne-commande > :nth-child(6) { grid-row: 4; grid-column: 1 / -1; }
  .ligne-commande > :nth-child(7) { grid-row: 3; grid-column: 4; }
  .repartition-reglage { left: 0; right: auto; }
}

/* Réception d'une commande : par ligne, barre (bon état / abîmé à remplacer / reste), champs avec l'unité. */
.badge--rose { background: #FDF2FA; color: #C11574; }
.modale-reception { max-width: min(96vw, 64rem); }
.ligne-reception { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.25rem; align-items: center; padding: .65rem .9rem; }
.ligne-reception--complete { background: #FAFAF9; }
.ligne-reception--complete .barre-reception-bon { background: #A6D8BF; }
.barre-reception { display: flex; height: .4rem; width: 100%; max-width: 16rem; overflow: hidden; border-radius: 9999px; background: #E7E5E4; }
.barre-reception-bon { background: #12B76A; transition: width .2s; }
.barre-reception-abime { background: #EE46BC; transition: width .2s; }
.champs-reception { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem; max-width: 26rem; }
.champ-unite { position: relative; display: flex; height: 2.5rem; align-items: center; gap: .35rem; border: 1px solid #D6D3D1; border-radius: .5rem; background: #fff; padding: 0 .4rem 0 .6rem; }
.champ-unite:focus-within { border-color: #231F20; }
.champ-unite input { width: 3.5rem; border: 0; padding: 0; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; background: transparent; }
.champ-unite input:focus { outline: none; box-shadow: none; }
.champ-unite > span:not(.etiquette-mini) { font-size: 12px; color: #A8A29E; }
.champ-unite--abime { border-color: #FCCEEE; background: #FFFAFD; }
.champ-unite--remplace { border-color: #ABEFC6; background: #F6FEF9; }
.champ-unite--erreur { border-color: #F04438 !important; background: #FEF3F2 !important; }
.etiquette-mini { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #78716C; }
.champ-unite-tout { display: grid; height: 1.5rem; width: 1.5rem; place-items: center; border-radius: .35rem; color: #067647; background: #ECFDF3; }
.champ-unite-tout:hover { background: #D1FADF; }
@media (max-width: 760px) {
  .ligne-reception { grid-template-columns: minmax(0, 1fr); }
  .champs-reception { justify-content: flex-start; max-width: none; }
}

/* Liste déroulante à soi (catégorie d'un article) : à la place du datalist du navigateur. */
.choix-pastille { position: absolute; left: .75rem; top: 50%; height: .625rem; width: .625rem; flex-shrink: 0; transform: translateY(-50%); border-radius: 999px; }
.choix-pastille.\!static { transform: none; }
.choix-liste { position: absolute; inset-inline: 0; top: calc(100% + .25rem); z-index: 40; max-height: 16rem; overflow-y: auto; border-radius: .625rem;
  border: 1px solid #E7E5E4; background: #fff; padding: .25rem; box-shadow: 0 12px 28px -10px rgb(28 25 23 / .25); }
.choix-option { display: flex; width: 100%; align-items: center; gap: .625rem; border-radius: .4375rem; padding: .4375rem .625rem; text-align: left; font-size: 13.5px; color: #44403C; }
.choix-option b { font-weight: 600; color: #1C1917; }
.choix-option--active { background: #F3EEE6; color: #1C1917; }
