/* Listes communes — 14/10 (Guillaume : « il faut voir la même chose partout […] le même design ») : la liste native d'ERPNext
   (sites, clients, contrats, interventions sur alarme, changements d'horaires), avec la rangée de filtres rapides, le titre en gras
   et sa ligne secondaire, les alertes en pastilles (public/js/listes_communes.js). Jetons et composants du système graphique GIPS
   seulement (theme_gips.css : .gips-onglet .gips-compteur .gips-pastille .gips-code) — aucune couleur, aucune taille de texte ni
   aucun arrondi écrits en dur. */

/* La rangée de filtres rapides, sous la barre des filtres standard. */
.fg-puces { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 15px 10px;
	border-bottom: 1px solid var(--border-color); }
.fg-puces:empty { display: none; }

/* Les lignes : hautes de deux lignes (titre, puis ce qui dit de qui il s'agit). */
.fg-liste .list-row-container .list-row { height: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.fg-liste .list-subject .fg-sujet { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px 6px;
	min-width: 0; flex: 1 1 auto; overflow: hidden; }
/* 16/10 (audit 3.001, MEN-6) : le nom ENTIER, sur deux lignes au besoin (il était coupé « Boulangerie Ma… »). */
.fg-liste .list-subject .fg-sujet > a { font-weight: 700; color: var(--text-color); min-width: 0; max-width: 100%;
	white-space: normal; overflow: hidden; text-overflow: clip; overflow-wrap: anywhere; display: -webkit-box;
	-webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.fg-liste .list-row-col.list-subject { align-items: flex-start; }
.fg-liste .fg-alertes { display: inline-flex; gap: 4px; align-items: center; flex: none; }
.fg-liste .fg-alerte { padding: 1px 7px; border: 0; gap: 3px; }
.fg-liste .fg-alerte .icon { margin: 0 !important; stroke: currentColor; }
.fg-liste button.fg-alerte { cursor: pointer; }
.fg-liste button.fg-alerte:hover, .fg-liste button.fg-alerte:focus-visible { box-shadow: inset 0 0 0 1px currentColor; outline: none; }
/* La ligne secondaire en 13 px (11 px avant le 16/10 : l'information métier se lisait mal). */
.fg-liste .fg-l2 { flex-basis: 100%; display: flex; gap: 4px; align-items: center; min-width: 0; font-size: var(--gips-t-m);
	font-weight: 400; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.fg-liste .fg-l2-texte { overflow: hidden; text-overflow: ellipsis; }
/* Étiquettes de la ligne secondaire : les services du contrat en cours d'un site (TLS, Vidéo, Urban, GSM, Maint.). */
.fg-liste .fg-etiquette { flex: none; padding: 0 6px; border: 1px solid var(--border-color); border-radius: var(--gips-r-xs);
	background: var(--gips-fond-doux); font-size: var(--gips-t-xs); font-weight: 700; line-height: 1.6; }

/* Colonnes : codes transmetteur en pastilles, pastilles de statut sans retour à la ligne. */
.fg-liste .list-row-col .gips-code { display: inline-block; margin: 1px 4px 1px 0; white-space: nowrap; }
.fg-liste .list-row-col .gips-pastille { vertical-align: middle; }

@media (max-width: 767px) {
	/* Sur téléphone, les puces sur une ligne qui défile plutôt que trois lignes avant la première fiche. */
	.fg-puces { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.fg-puces::-webkit-scrollbar { display: none; }
	.fg-puces .gips-onglet { flex: none; }
}

/* Le champ de recherche unique (16/10, MEN-6) : à la place des champs de filtre du haut, qui passent sous « Filtre » ; un champ
   déjà rempli reste visible (.fg-rempli, posé par listes_communes.js). */
.page-form.fg-un-champ .standard-filter-section > .frappe-control:not(.fg-rempli):not(.fg-garde) { display: none; }
.page-form.fg-un-champ .filter-toggle { display: none; }
.fg-recherche { position: relative; display: flex; align-items: center; flex: 1 1 320px; max-width: 460px; min-width: 200px;
	margin: 0 8px 0 0; }
.fg-recherche .fg-recherche-loupe { position: absolute; left: 9px; display: inline-flex; color: var(--text-muted); pointer-events: none; }
.fg-recherche .fg-recherche-loupe .icon { margin: 0; }
.fg-recherche input[type="search"] { padding-left: 30px; padding-right: 28px; width: 100%; }
.fg-recherche input[type="search"]::-webkit-search-cancel-button { display: none; }
.fg-recherche .fg-recherche-effacer { position: absolute; right: 4px; display: inline-flex; padding: 2px; border: 0;
	background: transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--gips-r-xs); }
.fg-recherche .fg-recherche-effacer:hover, .fg-recherche .fg-recherche-effacer:focus-visible { color: var(--text-color);
	background: var(--control-bg); outline: none; }
.fg-recherche .fg-recherche-note { position: absolute; top: 100%; left: 0; margin-top: 2px; font-size: var(--gips-t-xs);
	color: var(--gips-orange-texte, var(--text-muted)); white-space: nowrap; }
@media (max-width: 767px) {
	.fg-recherche { flex-basis: 100%; max-width: none; margin: 0 0 6px; }
}
/* 21/10 (audit visuel) : une colonne « liste de choix » vide (Type d'un code transmetteur sans type…) dessinait une pastille grise VIDE
   (Frappe 16 : <span class="es-badge"></span>) — rien n'est dessiné quand il n'y a rien à dire. */
.list-row .es-badge:empty, .list-row .indicator-pill:empty { display: none; }

/* 22/10 (audit lisibilité, zone B) —
   B-02 : la pastille d'état de Frappe 16 (.es-badge) a la hauteur d'une ligne de minuscules : l'accent d'une majuscule (« À mettre en
   service ») était rogné et se lisait « A mettre en service ». Une ligne un peu plus haute, l'accent tient.
   B-03 : les services du site (TLS, Maint., GSM, Vidéo, Urban) se coupaient (« Ur… ») au bout de la colonne du nom : ils passent à la
   ligne, le texte de la ligne secondaire garde ses points de suspension.
   B-04 : sur téléphone, la rangée de puces qui défile le dit (fondu à droite). */
.list-row .es-badge { height: auto; min-height: 1.7em; line-height: 1.45; padding-top: 1px; padding-bottom: 1px; }
.fg-liste .fg-l2 { flex-wrap: wrap; row-gap: 2px; }
.fg-liste .fg-l2-texte { flex: 1 1 140px; min-width: 0; white-space: nowrap; }
@media (max-width: 767px) {
	.fg-puces { -webkit-mask-image: linear-gradient(to right, var(--text-color) 85%, transparent);
		mask-image: linear-gradient(to right, var(--text-color) 85%, transparent); padding-right: 32px; }
}

/* 23/10 (Guillaume : « Oui, comme la maquette » — liste des sites) : la ligne sous le nom est ENTIÈRE — les services du contrat
   (« TLS · Maint. · Vidéo », le nom complet en infobulle) puis « client · ville (département) » ; elle passe à la ligne au lieu d'être
   coupée, un service ne se coupe jamais en deux (B-03). Les alertes à côté du nom sont des mots courts (« 1 ticket », « provisoire »). */
.fg-liste .fg-l2.fg-l2-entiere { white-space: normal; flex-wrap: wrap; overflow: visible; gap: 0 6px; line-height: 1.45; }
.fg-liste .fg-l2-entiere .fg-services { font-weight: 600; color: var(--text-color); }
.fg-liste .fg-l2-entiere abbr.fg-service { text-decoration: none; border: 0; cursor: help; white-space: nowrap; }
.fg-liste .fg-l2-entiere .fg-sep { color: var(--text-muted); }
.fg-liste .fg-l2-entiere .fg-lieu { min-width: 0; overflow-wrap: anywhere; }
.fg-liste .fg-alerte span { white-space: nowrap; }
/* La colonne « Site » prend la place de deux colonnes : le nom, ses alertes, puis services et lieu sur une ligne quand l'écran le permet. */
[data-page-route="List/FG Site/List"] .list-row-col.list-subject, .frappe-list[data-doctype="FG Site"] .list-row-col.list-subject { flex: 2 1 0; }
/* 31/10 : même chose pour l'objet d'un ticket — il était coupé à 20 caractères pendant que « Prochain RDV » restait vide. */
[data-page-route="List/Issue/List"] .list-row-col.list-subject, .frappe-list[data-doctype="Issue"] .list-row-col.list-subject { flex: 1.6 1 0; }
/* 16/11 (nuit) : Contrats (« Contrat 20261106-020 » + client coupés) et Articles (nom sur trois lignes) : la colonne du nom était la plus étroite. */
.frappe-list[data-doctype="Contract"] .list-row-col.list-subject, .frappe-list[data-doctype="Item"] .list-row-col.list-subject { flex: 1.6 1 0; }

/* 23/10 (menu « par sujet ») : une entrée du menu, deux écrans — « Consignes » (Provisoires · Horaires modifiés), « Codes, lignes et SIM »
   (Codes transmetteur · Lignes et cartes SIM) : les deux onglets en tête de chaque écran (menu_gips.js, fg.onglets_jumeaux), avec le
   nombre du menu. Des onglets de PAGE (soulignés), pour ne pas les confondre avec les puces de filtre (pilules) juste dessous. */
.gips-onglets-jumeaux { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: flex-end; padding: 6px 15px 0;
	border-bottom: 1px solid var(--border-color); margin-bottom: 8px; }
.fgp-page > .gips-onglets-jumeaux { padding: 0; margin-bottom: 12px; }
.gips-onglets-jumeaux .gips-onglet { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
	padding: 6px 2px 7px; margin-bottom: -1px; font-size: var(--gips-t-m); color: var(--text-muted); }
.gips-onglets-jumeaux .gips-onglet:hover { background: transparent; color: var(--text-color); }
.gips-onglets-jumeaux .gips-onglet.actif { background: transparent; border-bottom-color: var(--primary); color: var(--text-color); }
.gips-onglets-jumeaux .gips-onglet .icon { margin: 0; }

/* 11/11 (débogage terrain, mobile) : au téléphone, la liste des tickets (comme toutes les listes communes) était PLUS LARGE que l'écran
   (594 px sur 375) — la règle « la 2e ligne passe à la ligne » de theme_gips.css perdait contre « white-space: nowrap » ci-dessus (même
   poids, chargée avant) : l'objet et surtout la PASTILLE D'ÉTAT (Nouveau, À facturer, Diagnostic à distance) étaient hors de l'écran,
   à faire défiler de côté. Ici (après), la 2e ligne passe à la ligne et la pastille d'état se place SOUS le titre. */
@media (max-width: 767px) {
	.fg-liste .fg-l2 { white-space: normal; flex-wrap: wrap; }
	.fg-liste .fg-l2-texte { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; flex-basis: auto; }
	.fg-liste .list-row-container .list-row:not(.list-row-head) { flex-wrap: wrap; }
	.fg-liste .list-row:not(.list-row-head) .level-left { flex: 1 1 100%; }
	.fg-liste .list-row:not(.list-row-head) .level-right { flex: 1 1 100%; min-width: 0; margin-left: 0; padding-left: 30px;
		justify-content: flex-start; text-align: left; }
	.fg-liste .list-row:not(.list-row-head) .level-right .list-row-col { justify-content: flex-start; }
	/* 16/11 (balayage de la nuit, liste des Sites au téléphone) : les blocs « mobile-layout » de Frappe (état daté, codes transmetteur) font
	   160 px et coupent leur contenu (« Actif depuis le 09/10/20… », « DEMO-001B » rogné) : pleine largeur, les puces passent à la ligne. */
	.fg-liste .list-row:not(.list-row-head) .mobile-layout { flex: 1 1 100%; width: auto; max-width: 100%; overflow: visible; }
	.fg-liste .list-row:not(.list-row-head) .mobile-layout .list-row-col { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
		overflow: visible; white-space: normal; padding-left: 0; }
	.fg-liste .list-row:not(.list-row-head) .mobile-layout .gips-pastille { white-space: normal; max-width: 100%; }
}

/* 12/11 (lot 4.043) : entre 768 et 1100 px (tablette, fenêtre étroite) la ligne secondaire passe à la ligne au lieu d'être coupée par « … ». */
@media (min-width: 768px) and (max-width: 1100px) {
	.fg-liste .fg-l2-texte { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; flex-basis: auto; }
}

/* 16/11 (nuit) : la liste des Contrats était un « display: table » dont la largeur suivait le contenu (1 471 px dans 1 136) : « Montant TTC »
   sortait à droite, derrière une barre de défilement. En bloc, les six colonnes se partagent la largeur disponible. */
[data-page-route="List/Contract/List"] .result.fg-liste { display: block !important; width: 100% !important; }
[data-page-route="List/Contract/List"] .result.fg-liste .list-row-container { min-width: 0 !important; width: 100% !important; }

/* 24/11 (filtres et vues) : le tableau des opportunités par étape (opportunity_kanban.js) : puces, carte compacte, total par colonne. */
.fg-kanban-puces { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
.fg-kanban-entete { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; width: 100%; text-align: left; }
.fg-kanban-entete-ligne { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.fg-kanban-etape { font-weight: 700; color: var(--gips-texte-fort); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-kanban-nb { font-size: var(--gips-t-xs); color: var(--text-muted); }
.fg-kanban-total { font-size: var(--gips-t-s); color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.fg-kanban-carte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fg-kanban-titre { font-weight: 600; color: var(--gips-texte-fort); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-kanban-client, .fg-kanban-action { font-size: var(--gips-t-s); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-kanban-action { color: var(--text-color); }
.fg-kanban-bas { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.fg-kanban-montant { font-weight: 700; }
.fg-kanban-proba { font-size: var(--gips-t-xs); color: var(--text-muted); }
.fg-kanban-alertes { display: flex; flex-wrap: wrap; gap: 4px; }
.fg-kanban-alerte { padding: 0 6px; border-radius: var(--gips-r-xs); background: var(--gips-fond-doux); font-size: var(--gips-t-xs); line-height: 1.6; }
.fg-kanban-alerte-orange { background: var(--gips-fond-orange); color: var(--gips-orange-texte); }
.fg-kanban-alerte-rouge { background: var(--gips-rouge-fond); color: var(--gips-rouge-texte); }
