/* stock.css — onglet « Stock » (tôles et barres entières, chutes, composants), feuille autonome : la même page dans Développés et dans
   Imbrications (cad/js/stock/vue.js). Ne dépend d'aucune autre feuille. */
.stock { max-width: 1280px; margin: 0 auto; color: #1c2430; font-size: 14px; }
.stock-tete h2 { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0 0 6px; font-size: 16px; text-transform: none; letter-spacing: 0; color: #1c2430; }
.stock-aide, .stock-etat { margin: 0 0 6px; font-size: 13px; color: #66758a; }
.stock-avis { margin: 6px 0; padding: 7px 10px; border-radius: 8px; font-size: 13px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.stock-avis.erreur { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.stock-bloc { margin-top: 20px; }
.stock-titre { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.stock-titre h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: #23303f; }
.stock-total { flex: 1; font-size: 13px; color: #66758a; }
.stock-ajout { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid #d5dbe3; border-radius: 8px; background: #fff; color: #1c2430; cursor: pointer; }
.stock-ajout:hover { background: #f5f7f9; }
.stock-cadre { overflow: auto; border: 1px solid #d5dbe3; border-radius: 9px; background: #fff; }
.stock-table { border-collapse: collapse; width: 100%; min-width: 860px; }
/* les titres de colonne passent sur deux lignes (« Épaisseur / (mm) ») : onze colonnes tiennent dans la page */
.stock-table th { font-size: 12px; font-weight: 500; line-height: 1.25; color: #66758a; text-align: left; vertical-align: bottom; padding: 7px 6px; background: #f5f7f9; }
.stock-table td { padding: 5px 6px; border-top: 1px solid #e4e8ee; white-space: nowrap; }
.stock-table .n { text-align: right; }
.stock-table input, .stock-table select { font: inherit; padding: 5px 7px; border: 1px solid #d5dbe3; border-radius: 7px; background: #fff; color: #1c2430; box-sizing: border-box; }
.stock-table input.num { width: 78px; text-align: right; }
.stock-table input.qte { width: 58px; }
.stock-table input.ep { width: 64px; }
.stock-table input.section { width: 160px; }
.stock-table select.matiere { width: 106px; }
.stock-table input.designation { width: 320px; }
.stock-table input.nuance { width: 142px; }
.stock-table select.format { width: 124px; }
.stock-tete h2 details.aide { font-weight: 400; }
/* bulle « ? » : mêmes règles que dans les outils, pour que la page du stock se suffise */
.stock details.aide { display: inline-block; vertical-align: middle; }
.stock details.aide > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #9aa7b6; background: #fff; color: #51607a; font-size: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.stock details.aide > summary::-webkit-details-marker { display: none; }
.stock details.aide[open] > summary, .stock details.aide > summary:hover { background: #1f2a37; border-color: #1f2a37; color: #fff; }
.stock .aide-bulle { position: fixed; z-index: 80; width: 340px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 9px; background: #1f2a37; color: #f1f5f9; font-size: 13px; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; box-shadow: 0 8px 24px rgba(15,23,42,.28); }
.stock-table input.lieu { width: 112px; }
.stock-table input.note, .stock-table input.origine { width: 132px; }
.stock-table tr.epuisee td { background: #f8fafc; }
.stock-table tr.epuisee input, .stock-table tr.epuisee select { color: #94a3b8; }
.stock-retirer { font: inherit; width: 28px; height: 28px; border: 1px solid transparent; border-radius: 7px; background: none; color: #b91c1c; cursor: pointer; }
.stock-retirer:hover { border-color: #fecaca; background: #fef2f2; }
.stock-vide { margin: 0; padding: 14px; border: 1px dashed #d5dbe3; border-radius: 9px; color: #66758a; font-size: 13px; background: #fff; }
/* onglet « Machines » (cad/js/parc/vue.js) : les mêmes tableaux que le stock, un par type de machine — ses colonnes sont
   ses capacités ; la colonne « Remarque » prend la place qui reste */
.parc-barre { margin-top: 14px; }
.parc select.parc-ajout { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid #d5dbe3; border-radius: 8px; background: #fff; color: #1c2430; max-width: 100%; cursor: pointer; }
.parc .parc-nom-famille { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid #d5dbe3; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: #23303f; }
.parc .parc-type { margin-bottom: 14px; }
.parc .parc-type h4 { margin: 0; font-size: 14px; font-weight: 600; color: #1c2430; text-transform: none; letter-spacing: 0; }
.parc .stock-table { min-width: 0; }
.parc .stock-table th.n, .parc .stock-table td.n { width: 1%; }
.parc .stock-table input.designation { width: 210px; }
.parc .stock-table input.capacite { width: 150px; }
.parc .stock-table .reste { width: 30%; }
.parc .stock-table input.note { width: 100%; min-width: 140px; }
/* onglet « Gammes » (cad/js/gammes/vue.js) : une ligne par repère — ses opérations à la suite, son temps — qui se déplie
   sur le tableau de ses opérations */
.gammes-total { margin: 4px 0 2px; font-size: 15px; color: #1c2430; }
.gammes-total b { font-size: 18px; }
.gammes-postes, .gammes-rappel { margin: 0 0 4px; font-size: 13px; color: #66758a; }
.gammes-rappel a { color: #c2410c; }
.gammes-liste { margin-top: 14px; display: grid; gap: 8px; }
.gammes details.gamme { border: 1px solid #d5dbe3; border-radius: 9px; background: #fff; }
.gammes details.gamme > summary { list-style: none; display: grid; grid-template-columns: 76px minmax(180px, 1.1fr) minmax(200px, 2fr) 92px; gap: 12px; align-items: center; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.gammes details.gamme > summary::-webkit-details-marker { display: none; }
.gammes details.gamme > summary:hover { background: #f8fafc; border-radius: 9px; }
.gammes details.gamme[open] > summary { border-bottom: 1px solid #e4e8ee; border-radius: 9px 9px 0 0; background: #f5f7f9; }
.gammes summary .rep::before { content: '▸'; display: inline-block; width: 14px; color: #94a3b8; font-weight: 400; }
.gammes details[open] > summary .rep::before { content: '▾'; }
.gammes summary .des small { display: block; font-size: 12px; color: #66758a; }
.gammes summary .suite { font-size: 13px; color: #475569; }
.gammes summary .temps { text-align: right; font-weight: 600; white-space: nowrap; }
.gammes details.gamme > .stock-cadre { border: 0; border-radius: 0; }
/* (colonnes de même largeur d'une gamme à l'autre) */
.gammes .gamme-ops { min-width: 0; table-layout: fixed; width: 100%; }
.gammes .gamme-ops th:nth-child(1) { width: 62px; }
/* une opération se déplace par sa poignée (gammes/deplacer.js) : dans la gamme, et dans le bloc « Fabrication » d'une pièce */
.poignee { border: 0; background: none; padding: 0 3px; margin: 0 4px 0 0; font-size: 15px; line-height: 1; color: #94a3b8; cursor: grab; touch-action: none; vertical-align: middle; }
.poignee:hover, .poignee:focus-visible { color: #ea580c; }
.poignee:focus-visible { outline: 2px solid #fdba74; border-radius: 4px; }
.en-deplacement { opacity: .45; }
.en-deplacement .poignee { cursor: grabbing; }
.gammes .gamme-ops tr.depot-avant td { box-shadow: inset 0 3px 0 #ea580c; }
.gammes .gamme-ops tr.depot-apres td { box-shadow: inset 0 -3px 0 #ea580c; }
.gammes .gamme-ops td.tete-op { white-space: nowrap; }
.gammes .gamme-ops th:nth-child(2) { width: 200px; }
.gammes .gamme-ops th:nth-child(3) { width: 220px; }
.gammes .gamme-ops th:nth-child(5), .gammes .gamme-ops th:nth-child(6) { width: 110px; }
.gammes .gamme-ops th:nth-child(7) { width: 116px; }
.gammes .gamme-ops td { white-space: normal; vertical-align: middle; }
.gammes .gamme-ops td.base { font-size: 13px; color: #475569; }
.gammes .gamme-ops td.total { white-space: nowrap; font-weight: 600; }
.gammes .gamme-ops tr.non td { background: #f8fafc; color: #94a3b8; }
.gammes .gamme-ops tr.non .nom-op { text-decoration: line-through; }
.gammes .gamme-ops input.nom-op, .gammes .gamme-ops input.poste { width: 100%; }
/* le poste se choisit dans une liste : les machines de l'atelier, celle de la découpe (et son gaz) */
.gammes .gamme-ops select.poste { width: 100%; min-width: 0; text-overflow: ellipsis; }
.gammes .gamme-ops select.gaz { margin-top: 4px; }
.gammes .gamme-ops .poste-fixe { color: #1c2430; white-space: nowrap; }
.gammes .gamme-ops input.num { width: 76px; }
.gammes .gamme-ops input[type="checkbox"] { width: 16px; height: 16px; padding: 0; }
.gammes .gammes-alerte { color: #b91c1c; font-size: 12.5px; }
.gammes select.gamme-ajout { margin: 8px 12px 10px; font: inherit; font-size: 13px; padding: 5px 9px; border: 1px solid #d5dbe3; border-radius: 8px; background: #fff; color: #1c2430; cursor: pointer; }
/* fenêtre « Temps de base » */
.gammes-fond { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .45); }
.gammes-fenetre { width: 620px; max-width: calc(100vw - 24px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 18px 20px; border-radius: 12px; background: #fff; color: #1c2430; font-size: 14px; box-shadow: 0 16px 48px rgba(15, 23, 42, .3); }
.gammes-fenetre h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 17px; text-transform: none; letter-spacing: 0; color: #1c2430; }
.gammes-fenetre details.aide { display: inline-block; font-weight: 400; }
.gammes-fenetre details.aide > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #9aa7b6; background: #fff; color: #51607a; font-size: 12px; font-weight: 700; cursor: pointer; }
.gammes-fenetre details.aide > summary::-webkit-details-marker { display: none; }
.gammes-fenetre .aide-bulle { position: fixed; z-index: 95; width: 340px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 9px; background: #1f2a37; color: #f1f5f9; font-size: 13px; font-weight: 400; line-height: 1.45; box-shadow: 0 8px 24px rgba(15,23,42,.28); }
.gammes-note { margin: 0 0 10px; font-size: 13px; color: #66758a; }
.gammes-note.erreur { color: #991b1b; }
.gammes-defile { overflow: auto; border: 1px solid #d5dbe3; border-radius: 9px; }
.gammes-fenetre .stock-table { min-width: 0; }
.gammes-fenetre .stock-table td { white-space: normal; }
.gammes-fenetre .stock-table input { width: 84px; text-align: right; }
.gammes-fenetre td.unite { font-size: 12.5px; color: #66758a; white-space: nowrap; }
.gammes-boutons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.gammes-boutons button { font: inherit; padding: 7px 14px; border: 1px solid #d5dbe3; border-radius: 8px; background: #fff; color: #1c2430; cursor: pointer; }
.gammes-boutons button.gammes-valider { background: #ea580c; border-color: #ea580c; color: #fff; font-weight: 600; }
/* onglet « Contrôles » (cad/js/controles/vue.js) : même présentation que les gammes — une ligne par repère, qui se déplie
   sur ses cotes (nominal, tolérance, mini, maxi, mesuré, écart, résultat) */
.controles-reglages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 6px 0 2px; font-size: 13px; color: #475569; }
.controles-reglages input, .controles-reglages select { font: inherit; padding: 4px 7px; border: 1px solid #d5dbe3; border-radius: 7px; background: #fff; color: #1c2430; }
.controles-reglages input.controles-par { width: 150px; }
.controles-reglages input.controles-instrument { width: 230px; }
.controles .controle-cotes th:nth-child(2) { width: auto; }
.controles .controle-cotes th:nth-child(3), .controles .controle-cotes th:nth-child(4), .controles .controle-cotes th:nth-child(7) { width: 112px; }
.controles .controle-cotes th:nth-child(5), .controles .controle-cotes th:nth-child(6), .controles .controle-cotes th:nth-child(8) { width: 92px; }
.controles .controle-cotes th:nth-child(9) { width: 150px; }
.controles .controle-cotes input.num { width: 86px; }
.controles .controle-cotes th:nth-child(4) { width: 132px; }
.controles .controle-cotes input.tol { width: 106px; text-align: right; }
.controles .controle-cotes input.nom-cote { width: calc(100% - 62px); }
/* un contrôle après le débit, un après la mise en forme, un en fin de projet ; le repère de chaque cote (C1-A, CF-A…) */
.controles details.gamme[data-cle="ENSEMBLE"] > summary { grid-template-columns: 124px minmax(160px, 1.1fr) minmax(200px, 2fr) 92px; }
/* le plan de l'ensemble (cotes de fin de projet) : deux vues à l'échelle, les cotes tracées par-dessus avec leur repère */
.controles .plan-ensemble { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 12px 12px; }
.controles .plan-ensemble svg { flex: 1 1 340px; min-width: 0; max-width: 620px; max-height: 460px; border: 1px solid #e4e8ee; border-radius: 8px; background: #fff; }
.controles .plan-ensemble.pose svg { cursor: crosshair; border-color: #ea580c; }
.controles .plan-ensemble .ligne-cote { fill: none; stroke: #2563eb; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.controles .plan-ensemble .repere-cote rect { fill: #fff7ed; stroke: #ea580c; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.controles .plan-ensemble .repere-cote text { fill: #c2410c; font-weight: 700; font-family: system-ui, sans-serif; }
.controles .plan-ensemble .titre { fill: #475569; font-family: system-ui, sans-serif; }
.controles .plan-ensemble .point-pose { fill: none; stroke: #ea580c; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.controles .plan-note, .controles .plan-consigne, .controles .plan-absent { margin: 8px 12px 6px; }
.controles .plan-consigne { color: #c2410c; font-weight: 600; font-size: 13.5px; }
.controles .controle-cotes button.poser-plan { margin-left: 6px; padding: 3px 8px; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; cursor: pointer; }
.controles .controle-cotes button.poser-plan.pose { border-color: #86efac; color: #166534; }
.controles .controle-cotes button.poser-plan.actif { border-color: #ea580c; color: #c2410c; background: #fff7ed; }
.controles details.gamme[data-cle="ENSEMBLE"] .controle-cotes input.nom-cote { width: calc(100% - 140px); }
.controles button.hors-tout { margin-left: 8px; }
.controles .controle-cotes tr.phase td { background: #f5f7f9; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #475569; padding: 4px 10px; }
.controles .controle-cotes .marque { display: inline-block; min-width: 50px; margin-right: 8px; font-weight: 700; font-size: 12.5px; color: #c2410c; white-space: nowrap; }
.controles .controle-cotes .marque.sans { color: #cbd5e1; font-weight: 400; }
.controles .controle-cotes td.borne { color: #66758a; }
.controles .controle-cotes td.etat { white-space: nowrap; font-weight: 600; }
.controles .controle-cotes tr.ok td.etat { color: #166534; }
.controles .controle-cotes tr.hors td { background: #fef2f2; }
.controles .controle-cotes tr.hors td.etat, .controles .controle-cotes tr.hors td.ecart { color: #b91c1c; }
.controles summary .etat-controle { font-weight: 600; color: #66758a; }
.controles summary .etat-controle.ok { color: #166534; }
.controles summary .etat-controle.hors { color: #b91c1c; }
.controles details.gamme > summary { grid-template-columns: 76px minmax(180px, 1.6fr) minmax(160px, 1fr) 170px; }
.controles button.controle-ajout { margin: 8px 12px 10px; }
/* fiche d'une machine (bouton « Fiche » de l'onglet « Machines ») : photo, panne, notice, planning de maintenance ; son état
   se lit sur sa ligne */
.parc .stock-table td.parc-etat { white-space: nowrap; width: 1%; }
.parc .etat-ligne { display: flex; align-items: center; gap: 6px; }
.parc .parc-pastille { flex: none; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.parc .parc-pastille.panne { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.parc .parc-pastille.a-faire { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.parc .parc-pastille.a-jour { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.parc button.parc-fiche { padding: 4px 10px; }
.parc-fenetre { width: 860px; overflow: auto; }
.parc-fenetre h2 small { font-weight: 400; font-size: 14px; color: #66758a; }
.parc-fenetre h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #23303f; }
.parc-fenetre section { margin-bottom: 14px; }
.parc-fiche-grille { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
/* fiche d'une machine : son taux horaire et ses temps (une ligne par valeur : libellé, case, unité) */
.fiche-cout-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 6px 22px; }
.fiche-cout-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 92px 96px; gap: 8px; align-items: center; font-size: 13.5px; }
.fiche-cout-ligne input, .gammes-taux input { width: 100%; text-align: right; font: inherit; padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.fiche-cout-ligne input:focus, .gammes-taux input:focus { outline: 2px solid #fdba74; border-color: #ea580c; }
.fiche-cout-ligne .unite { color: #66758a; font-size: 12.5px; }
/* coût d'une opération, d'une gamme (quand un taux horaire est connu) */
.gammes summary .cout { display: block; font-weight: 400; font-size: 12.5px; color: #475569; }
.gammes .gamme-ops td.total .cout-op { display: block; font-weight: 400; font-size: 12.5px; color: #475569; }
.gammes-taux { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; }
.gammes-taux input { width: 90px; }
.gammes .gamme-ops .temps-machine { font-size: 12px; color: #0f766e; }
.gammes-total .gammes-cout b { font-size: 16px; }
@media (max-width: 760px) { .parc-fiche-grille { grid-template-columns: 1fr; } }
.parc-fenetre .fiche-photo img, .parc-fenetre .sans-photo { display: block; width: 100%; height: 210px; border: 1px solid #d5dbe3; border-radius: 9px; background: #f5f7f9; object-fit: contain; }
.parc-fenetre .sans-photo { display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; }
.parc-fenetre .gammes-boutons { justify-content: flex-start; margin-top: 8px; }
.parc-fenetre > .gammes-boutons:last-child { justify-content: flex-end; }
.parc-fenetre .gammes-boutons button:disabled { opacity: .5; cursor: default; }
.parc-fenetre textarea.panne-texte { width: 100%; box-sizing: border-box; font: inherit; padding: 6px 8px; border: 1px solid #d5dbe3; border-radius: 7px; resize: vertical; }
.parc-fenetre .en-panne { margin: 0; padding: 8px 10px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; color: #7f1d1d; }
.parc-fenetre a.ouvrir-notice { color: #c2410c; font-weight: 600; }
.parc-fenetre .stock-table input.tache { width: 100%; min-width: 180px; text-align: left; }
.parc-fenetre .stock-table input.jours { width: 76px; }
.parc-fenetre .stock-table input.derniere { width: 150px; text-align: left; }
.parc-fenetre .stock-table tr.en-retard td.prochaine { color: #b91c1c; font-weight: 600; }
.parc-fenetre .stock-table td.prochaine { white-space: nowrap; }
/* machine qui a une photo : sa miniature devant la désignation (elle ouvre la fiche) */
.parc .parc-designation { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.parc .parc-miniature { flex: none; box-sizing: border-box; width: 180px; height: 135px; object-fit: cover; border: 1px solid #d5dbe3; border-radius: 8px; background: #f5f7fa; cursor: pointer; }
.parc .parc-miniature:hover { border-color: #c2410c; }
/* champ de texte lisible : il passe à la ligne et grandit avec son contenu (texte-lisible.js) */
.stock-table textarea.texte-lisible { display: block; box-sizing: border-box; font: inherit; line-height: 1.35; padding: 5px 7px; border: 1px solid #d5dbe3; border-radius: 7px; background: #fff; color: #1c2430;
  resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 31px; }
.stock-table textarea.texte-lisible:focus { outline: 2px solid #fdba74; border-color: #c2410c; }
/* une ligne peut maintenant être haute (photo, texte sur plusieurs lignes) : toutes ses cases partent du haut */
.parc .stock-table td, .stock-bloc .stock-table td { vertical-align: top; }
.stock-table textarea.designation { width: 320px; }
.stock-table textarea.note, .stock-table textarea.origine { width: 132px; }
.stock-table textarea.section { width: 160px; }
.stock-table textarea.lieu { width: 112px; }
.parc .stock-table textarea.designation { width: 210px; }
.parc .stock-table textarea.capacite { width: 150px; }
.parc .stock-table textarea.note { width: 100%; min-width: 140px; }
