﻿/* ---------- Tableaux « tableur » (demande Yann 11/09/2026) : lignes mieux séparées, tri, colonnes, totaux ---------- */
.table { --bs-table-striped-bg: #e8eff8; }
.table td { border-color: #c9d5e3; }
.table thead th { border-bottom: 2px solid #b6c6d9; }
.table-hover tbody tr:hover, .table-striped tbody tr:hover { background: #d8e6f5; }
.tableur-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; margin: 0 0 .4rem; font-size: .8rem; color: var(--encre-2); }
.tableur-barre .tableur-compte { margin-right: auto; font-weight: 600; }
.tableur-filtre { max-width: 13rem; }
.tableur-colonnes { position: relative; }
.tableur-colonnes summary { cursor: pointer; list-style: none; padding: .2rem .6rem; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.tableur-colonnes summary::-webkit-details-marker { display: none; }
.tableur-colonnes summary::after { content: ' ▾'; }
.tableur-colonnes-liste { position: absolute; right: 0; z-index: 30; background: #fff; border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre-haute); padding: .5rem .8rem; min-width: 12rem; display: flex; flex-direction: column; gap: .2rem; margin-top: .2rem; }
.tableur-colonnes-liste label { white-space: nowrap; cursor: pointer; }
.tableur-option { cursor: pointer; user-select: none; }
.tableur-reinit { color: var(--encre-2); text-decoration: none; }
th.tableur-triable { cursor: pointer; user-select: none; }
th.tableur-triable:hover { color: var(--camy-bleu); }
th.tableur-triable[data-tri="asc"]::after { content: ' ▲'; font-size: .6rem; color: var(--camy-bleu); }
th.tableur-triable[data-tri="desc"]::after { content: ' ▼'; font-size: .6rem; color: var(--camy-bleu); }
.table tfoot.tableur-totaux td { font-weight: 700; background: #eef3f9; border-top: 2px solid #b6c6d9; }
@media print { .tableur-barre { display: none; } }

/* ---------- Cadres réservés au Super admin : liseré or épais et étiquette (demande Yann 11/09/2026) ---------- */
.card.superadmin { position: relative; overflow: visible; box-shadow: var(--ombre), inset 0 0 0 3px var(--camy-or); }
.card.superadmin::after {
  content: 'Super admin'; position: absolute; top: -10px; right: 16px;
  background: var(--camy-or); color: #fff; font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; box-shadow: 0 1px 3px rgba(16, 42, 67, .25);
}
.card.superadmin[data-cadre]::after { content: attr(data-cadre); }
.cadre-superadmin { border-left: 3px solid var(--camy-or); background: #fdf7ec; padding: .3rem .5rem; border-radius: 0 8px 8px 0; }

/* ---------- Tag de couleur de l'apporteur d'affaires (demande Yann 11/09/2026) ---------- */
.tag-apporteur { display: inline-block; padding: .1rem .55rem; border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; line-height: 1.4; }
.tag-apporteur.vide { background: #e3e9f1; color: #5a6b7e; }

/* ---------- Couleurs des statuts de devis, partout (demande Yann 14/09/2026) ---------- */
.badge.statut-gris   { background: #e9edf2 !important; color: #5a6b7e !important; }
.badge.statut-orange { background: #fde8cc !important; color: #b45309 !important; }
.badge.statut-vert   { background: #dff3e8 !important; color: #1f845a !important; }
.badge.statut-rouge  { background: #fbe3e3 !important; color: #b3261e !important; }
.tdb-badge-orange { background: #fde8cc; color: #b45309; }

/* ---------- Cohérence des tableaux (demande Yann 25/09/2026) : on ouvre en cliquant la chose elle-même ----------
   Le numéro du devis ouvre le devis, le client ouvre le client, la serre ouvre la serre ; la colonne
   « Ouvrir » a disparu. `lien-ouvrir` marque le lien principal de la ligne : c'est lui que sert le
   double-clic sur la ligne. */
.lien-ouvrir { font-weight: 600; text-decoration: none; }
.lien-ouvrir:hover { text-decoration: underline; }
.cellule-sujet { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Bandeau de fiche CEE en tête d'un devis (demande Yann 25/09/2026) : « qu'on sache et que
   ça saute à l'œil de quoi parle le devis ». Une couleur par fiche. ---------- */
.bandeau-fiche {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem 1rem;
  border-radius: 12px; padding: .55rem 1.1rem; margin: 0 0 .6rem; color: #fff;
  background: linear-gradient(115deg, #0d3c5c 0%, #17699f 70%, #1b83c4 100%);
  box-shadow: 0 2px 6px rgba(16, 42, 67, .22);
}
.bandeau-fiche .bandeau-code { font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.bandeau-fiche .bandeau-objet { font-size: .92rem; opacity: .93; }
.bandeau-fiche .bandeau-version { margin-left: auto; font-size: .78rem; opacity: .85; white-space: nowrap; }
.bandeau-fiche.f-th117 { background: linear-gradient(115deg, #7a3d0b 0%, #b4650f 70%, #d98324 100%); }
.bandeau-fiche.f-th119 { background: linear-gradient(115deg, #0f5132 0%, #1f845a 70%, #27a06d 100%); }
.bandeau-fiche.f-eq108 { background: linear-gradient(115deg, #7b2350 0%, #b03a76 70%, #cf4f8e 100%); }
.bandeau-fiche.f-eq101 { background: linear-gradient(115deg, #3c2f7a 0%, #5b47b8 70%, #7360d8 100%); }
.bandeau-fiche.f-eq110 { background: linear-gradient(115deg, #7a5c00 0%, #a77d39 70%, #c79a4e 100%); }
.bandeau-fiche.f-th108 { background: linear-gradient(115deg, #14532d 0%, #15803d 65%, #22a35a 100%); }
.bandeau-fiche.f-se104 { background: linear-gradient(115deg, #0b4a52 0%, #0e7490 70%, #1195b5 100%); }

/* ---------- Pavés d'identité en tête d'un devis (client, signataire) ---------- */
.pave-colonne { display: flex; flex-direction: column; gap: .75rem; height: 100%; }
.pave-colonne > .pave-identite { flex: 1 1 auto; }
.pave-identite { border: 1px solid var(--bord); border-left: 4px solid var(--camy-bleu); border-radius: 10px; padding: .6rem .8rem; background: #f7fafd; }

.pave-identite .pave-titre { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-2); margin-bottom: .15rem; }
.pave-identite .pave-nom { font-size: 1.05rem; font-weight: 700; line-height: 1.25; display: block; }
.pave-identite.vide { border-left-color: #c9d5e3; background: #fbfbfb; }

/* ---------- Le FIL D'HISTORIQUE d'un dossier (demande Yann 25/09/2026) : mails et entrées saisies,
   « à savoir absolument » en rouge et toujours en tête. ---------- */
.histo-fil { max-height: 30rem; overflow: auto; }
.histo-ligne { border-top: 1px solid #e6ecf3; padding: .5rem .2rem .5rem .6rem; border-left: 3px solid transparent; }
.histo-ligne:first-child { border-top: 0; }
.histo-ligne:hover { background: #f7fafd; }
.histo-alerte { border-left-color: #b3261e; background: #fdf1f1; }
.histo-alerte:hover { background: #fbe8e8; }
.histo-apercu { max-height: 2.6em; overflow: hidden; }

/* ---------- Le pavé « Dossier » : documents et historique côte à côte (demande Yann 25/09/2026) ---------- */
.pave-dossier .dossier-titre { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-2); margin-bottom: .35rem; }
.pave-dossier .colonne-historique { border-left: 1px solid #e6ecf3; }
@media (max-width: 1199.98px) { .pave-dossier .colonne-historique { border-left: 0; border-top: 1px solid #e6ecf3; padding-top: .6rem; } }
.pave-dossier .histo-fil { max-height: 22rem; }
.pave-dossier .histo-ligne { padding: .4rem .2rem .4rem .5rem; font-size: .88rem; }
