/* ═══════════════════════════════════════════════════════════════
   LES ORGANIGRAMMES EN COURS, REGARDES COMME DES PROSPECTS

   Ce que cette feuille NE contient PAS, et c'est voulu : `.tabs-page`,
   `.modal-overlay`, `.modal-box` et les `.pf-page-*` viennent de main.css,
   ou elles ont ete remontees le 28/09/2026 parce que neuf pages en avaient
   chacune sa copie. Les recopier ici reproduirait le probleme.

   Rappel du piege que ce depot a paye deux fois : `[hidden]` vient de la
   feuille du NAVIGATEUR et a la MEME specificite qu une classe. Des qu un
   auteur pose un `display` sur la meme classe, l attribut ne cache plus rien.
   Aucune classe `og-` ci-dessous ne porte `[hidden]` dans le balisage, donc
   la parade n est pas necessaire — mais si quelqu un en ajoute un, il devra
   ecrire la ligne `.og-X[hidden]{display:none}` qui va avec.
   ═══════════════════════════════════════════════════════════════ */

/* ── Le corps defile, le reste ne bouge pas ─────────────────────────────
   `.pf-shell` est un conteneur flex en colonne avec `overflow:hidden`. Un
   tableau pose directement dedans etait TRONQUE des qu il depassait : les
   lignes du bas devenaient invisibles, sans barre de defilement et sans erreur
   nulle part. Et sans retrait, il touchait les bords alors que le titre est en
   retrait de `--space-8`.

   `flex:1` et `min-height:0` et non `height:100%` : dans un parent en colonne,
   un pourcentage se resout contre une hauteur automatique et s effondre.

   Meme regle que `.tf-corps` sur l ecran des tarifs, pour la meme raison. */
.og-corps{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-5) var(--space-8);
    background: var(--grey-100);
}

.og-carte{ padding: 0; overflow: hidden; }

.og-outils{
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--grey-100);
}

.og-recherche{ flex: 1; max-width: 420px; }

/* La carte porte deja son fond et son ombre : le tableau qui vit dedans ne doit
   pas en remettre une couche, sinon on voit deux cartes empilees. */
.og-tableau{ box-shadow: none; border-radius: 0; }

/* La colonne du bouton, pour qu elle ne soit pas ecrasee par les autres. */
.og-colonne-action{ width: 110px; }

/* Les nombres alignes a droite, en chiffres de meme largeur : une colonne de
   prix qu on parcourt du regard doit se lire comme une colonne, pas comme une
   suite de mots. */
.og-nombre{
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.og-nom{ font-weight: 600; color: var(--grey-800); }

/* L adresse sous le nom du chantier, et le repere sous le nom de la porte :
   deux informations qui situent sans meriter leur propre colonne. */
.og-adresse{
    display: block;
    margin-top: 2px;
    font-size: .78rem;
    font-weight: 400;
    color: var(--grey-500);
}

.og-quand{
    white-space: nowrap;
    font-size: .8rem;
    color: var(--grey-600);
    font-variant-numeric: tabular-nums;
}

.og-actions{ text-align: right; white-space: nowrap; }

.og-vide{
    padding: var(--space-6);
    text-align: center;
    font-size: .875rem;
    color: var(--grey-500);
}

/* ── Les etats ──────────────────────────────────────────────────────────
   « Devis demande » est le seul qui appelle un geste : quelqu un attend une
   reponse. Il porte donc la couleur d attention, tandis que « en cours » reste
   neutre — un organigramme en cours n est pas un retard, c est un prospect. */

.og-etat-brouillon{
    background: var(--grey-100);
    color: var(--grey-600);
}

.og-etat-devis_demande{
    background: rgba(245, 158, 11, .12);
    color: #92400e;
}

.og-etat-traite{
    background: rgba(16, 185, 129, .1);
    color: var(--success);
}

/* ── Le dialogue du chiffrage ───────────────────────────────────────────
   Large, parce qu il porte un tableau de sept colonnes : a la largeur d un
   dialogue ordinaire il defilait horizontalement, et un tarif qu on fait
   defiler ne se verifie pas d un coup d oeil. */

.og-modal{
    max-width: 1040px;
    width: 100%;
    padding: var(--space-5);
    text-align: left;

    /* Cinquante portes ne tiennent pas dans un ecran : le dialogue defile
       VERTICALEMENT en gardant sa tete visible, plutot que de deborder. */
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.og-modal-tete{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--grey-200);
}

.og-modal-titre{
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--grey-800);
}

.og-modal-gamme{
    margin: 4px 0 0;
    font-size: .82rem;
    color: var(--grey-500);
}

/* `flex:1` et non `height:100%` : dans un parent en colonne, une hauteur en
   pourcentage se resout contre une hauteur automatique et s effondre. C est
   exactement ce qui avait rendu invisibles les panneaux de l ecran des tarifs. */
.og-modal-corps{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: var(--space-4);
}

/* ── Les quatre nombres qu on lit d abord ───────────────────────────────
   Trois sous-totaux et le total. Un serrurier qui trouve son total trop eleve
   veut savoir d ou il vient : des cylindres, du nombre de cles, ou des
   fonctions. */

.og-tuiles{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.og-tuile{
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    background: var(--grey-50);
}

.og-tuile span{
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--grey-500);
}

.og-tuile strong{
    display: block;
    margin-top: 4px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--grey-800);
    font-variant-numeric: tabular-nums;
}

/* Le total est le nombre qu on cherche : il porte la couleur de la maison, et
   c est la seule tuile qui en a une. Les quatre au meme poids auraient voulu
   dire qu il faut les lire toutes pour trouver celle qu on veut. */
.og-tuile-total{
    background: var(--psg-navy);
    border-color: var(--psg-navy);
}

.og-tuile-total span{ color: rgba(255, 255, 255, .7); }
.og-tuile-total strong{ color: white; font-size: 1.2rem; }

/* ── Le detail par porte ────────────────────────────────────────────────── */

.og-detail{ box-shadow: none; border: 1px solid var(--grey-200); }

.og-total-porte{ font-weight: 700; color: var(--grey-800); }

.og-options-cellule{ text-align: left; }

.og-option{
    display: inline-block;
    margin: 1px 3px 1px 0;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--grey-100);
    font-size: .72rem;
    color: var(--grey-600);
}

/* Une option que la gamme ne propose plus reste COMPTEE, et se voit. La retirer
   du total changerait un montant sans rien dire ; la laisser sans marque
   cacherait qu on chiffre quelque chose qui ne se vend plus. */
.og-option-retiree{
    background: rgba(218, 41, 28, .08);
    color: var(--psg-red);
    text-decoration: line-through;
}

.og-avertissements{
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, .08);
}

.og-avertissements p{
    margin: 0 0 4px;
    font-size: .82rem;
    color: #92400e;
}

.og-avertissements p:last-child{ margin-bottom: 0; }

.og-erreur{
    padding: var(--space-4);
    border-left: 3px solid var(--psg-red);
    border-radius: var(--radius-sm);
    background: #fef2f2;
    font-size: .85rem;
    font-weight: 600;
    color: #991b1b;
}


/* ── Le client, les compteurs d'onglet, la reponse ─────────────────────── */

.og-compte{
    display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px;
    border-radius: 9px; background: var(--grey-200); color: var(--grey-600);
    font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.og-compte-alerte{ background: #dc2626; color: #fff; }

.og-client{ line-height: 1.35; }
.og-client-nom{ font-weight: 600; color: var(--grey-800); }
.badge.og-tarif{ background: #1e40af; color: #fff; font-size: .65rem; letter-spacing: .04em; }

.og-modal-boutons{ display: flex; gap: 8px; align-items: center; }

.og-client-bloc{
    display: flex; flex-direction: column; gap: 2px;
    padding: 12px 14px; margin-bottom: 14px;
    border: 1px solid var(--grey-200); border-radius: 8px; background: var(--grey-50, #f8fafc);
}
.og-chantier-adresse{ margin: 0 0 12px; }

.og-reponses{ margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--grey-200); }
.og-reponses h4{ margin: 0 0 8px; font-size: .9rem; }
.og-reponse{ padding: 10px 0; border-bottom: 1px solid var(--grey-100, #f1f5f9); font-size: .88rem; }
.og-pieces{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.og-piece{
    padding: 3px 9px; border-radius: 6px; background: var(--grey-100, #f1f5f9);
    font-size: .8rem; text-decoration: none; color: var(--grey-800);
}
.og-echec{ color: #dc2626; }

.og-rep-modal{
    width: min(560px, 94vw);
    max-width: 560px;
    /* Le padding manquait: .modal-box n'en pose pas, chaque page apporte le sien
       (voir .og-modal, .tf-modal). Les champs touchaient les bords du dialogue. */
    padding: var(--space-5);
    text-align: left;
}
.og-rep-modal .og-modal-titre{ margin-bottom: var(--space-4); }
.og-champ{ display: block; margin-bottom: 12px; }
.og-champ > span{ display: block; font-size: .8rem; font-weight: 600; color: var(--grey-600); margin-bottom: 5px; }
.og-champ input[type="text"], .og-champ textarea{
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid var(--grey-300, #cbd5e1); border-radius: 6px; font: inherit;
}
.og-champ input[readonly]{ background: var(--grey-100, #f1f5f9); }
.og-champ input[type="file"]{ display: block; width: 100%; margin-bottom: 6px; }
.og-rep-actions{ display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }


/* ── Creer un organigramme pour un client, et l'editer ─────────────────── */

.og-duo{ display: flex; gap: 12px; }
.og-duo > .og-champ{ flex: 1; min-width: 0; }
.og-champ select, .og-champ input[type="number"]{
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid var(--grey-300, #cbd5e1); border-radius: 6px; font: inherit; background: #fff;
}
.og-resultats{ display: flex; flex-direction: column; margin-top: 4px; }
.og-resultat{
    text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--grey-100, #f1f5f9);
    background: #fff; font: inherit; cursor: pointer; line-height: 1.3;
}
.og-resultat:hover{ background: var(--grey-100, #f1f5f9); }
.og-resultat[disabled]{ opacity: .5; cursor: not-allowed; }
.og-client-choisi{ margin: 6px 0 0; font-weight: 600; color: #166534; }

.og-editeur{ width: min(1000px, 96vw); }
.og-ed-sous-titre{ margin: 18px 0 8px; font-size: .95rem; }
.og-ed-form{ display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.og-ed-options{ display: flex; flex-wrap: wrap; gap: 6px 14px; }
.og-ed-options label{ display: inline-flex; gap: 5px; align-items: center; font-size: .85rem; cursor: pointer; }
.og-ed-actions-ligne{ white-space: nowrap; text-align: right; }
