/* ************************************************************************************************
   PRÉSENTATION COMMUNE AUX PAGES DE LISTE SPICA (ListeProjets.php, ListeFichesProjet.php, ListeConventions.php)
   Même charte que l'accueil et les pages de connexion (violet SPICA, cartes arrondies)
   Voir aussi ListesSPICA.php (fonctions PHP) et ListesSPICA.js (comportements)
************************************************************************************************ */

/* Conteneur de la page de liste */
.lp-page {
	--spica-violet: #3903A5;
	--spica-violet-clair: #f3f1f8;
	--spica-bordure: #e4e0ee;
	--spica-gris: #666;
	margin: 24px 16px 48px;
	color: #222;
}

.lp-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.lp-entete h1 { color: var(--spica-violet); font-size: 22px; font-weight: bold; margin: 0; letter-spacing: .5px; }
.lp-compteur { background: var(--spica-violet-clair); color: var(--spica-violet); font-weight: bold; border-radius: 20px; padding: 3px 12px; }

.lp-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-left: auto; }
/* Interrupteur (ex. "projets terminés") : même pastille que le compteur */
.lp-interrupteur {
	display: inline-flex; align-items: center; gap: 8px;
	margin: 0; padding: 3px 12px 3px 12px; min-height: 0;
	background: var(--spica-violet-clair); color: var(--spica-violet);
	font-weight: bold; border-radius: 20px; cursor: pointer;
}
.lp-interrupteur .form-check-input { float: none; margin: 0; cursor: pointer; border-color: var(--spica-violet); }
.lp-interrupteur .form-check-input:checked { background-color: var(--spica-violet); border-color: var(--spica-violet); }
.lp-interrupteur .form-check-input:focus { box-shadow: 0 0 0 3px rgba(57, 3, 165, 0.15); }
/* Bouton et menu de choix des colonnes */
.lp-bouton-colonnes {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 12px; border-radius: 8px;
	border: 1px solid var(--spica-violet); background: #fff; color: var(--spica-violet);
	font-weight: bold; font-size: 13px; cursor: pointer;
}
.lp-bouton-colonnes:hover, .lp-bouton-colonnes[aria-expanded=true] { background: var(--spica-violet-clair); }
.lp-nb-masquees { font-weight: normal; color: var(--spica-gris); }
.lp-menu-colonnes { border: 1px solid var(--spica-bordure); border-radius: 12px; box-shadow: 0 8px 24px rgba(57, 3, 165, 0.15); padding: 8px; min-width: 240px; font-size: 13px; }
.lp-menu-titre { font-weight: bold; color: var(--spica-violet); padding: 4px 8px 6px; }
.lp-choix-colonne { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; margin: 0; }
.lp-choix-colonne:hover { background: var(--spica-violet-clair); }
.lp-choix-colonne .form-check-input { margin: 0; cursor: pointer; }
.lp-choix-colonne .form-check-input:checked { background-color: var(--spica-violet); border-color: var(--spica-violet); }
.lp-menu-actions { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--spica-bordure); margin-top: 6px; padding: 8px 8px 2px; }
.lp-menu-actions a { color: var(--spica-violet); font-weight: bold; }
.lp-menu-actions a:hover { text-decoration: underline; }
.lp-tableau td.lp-num { cursor: help; }

/* Pagination sous le tableau */
.lp-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 14px; color: var(--spica-gris); }
.lp-pagination b { color: #222; }
.lp-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lp-page-bouton {
	min-width: 32px; height: 32px; padding: 0 8px;
	border: 1px solid var(--spica-bordure); border-radius: 8px;
	background: #fff; color: var(--spica-violet); font-weight: bold; cursor: pointer;
}
.lp-page-bouton:hover:not(:disabled) { background: var(--spica-violet-clair); border-color: var(--spica-violet); }
.lp-page-bouton:disabled { color: #ccc; cursor: default; }
.lp-page-bouton.lp-page-courante { background: var(--spica-violet); border-color: var(--spica-violet); color: #fff; cursor: default; }
.lp-page-ellipse { padding: 0 4px; }
.lp-par-page { display: flex; align-items: center; gap: 8px; margin: 0; }
.lp-par-page .form-select { width: auto; font-size: 12px; border-color: var(--spica-bordure); }

.lp-lien { color: var(--spica-violet); font-weight: bold; }
.lp-lien:hover { text-decoration: underline; color: var(--spica-violet); }

.lp-filtre-actif {
	display: inline-flex; align-items: center; gap: 8px;
	background: #fff4e5; color: #8a5300; border: 1px solid #f3d19c;
	border-radius: 20px; padding: 3px 6px 3px 12px; font-weight: bold;
}
.lp-filtre-actif a { color: #8a5300; padding: 0 6px; }

.lp-debug { font-size: 11px; color: var(--spica-gris); margin-bottom: 10px; }

/* Tableau dans une carte, entête et ligne de filtres toujours visibles au défilement */
.lp-carte {
	background: #fff;
	border: 1px solid var(--spica-bordure);
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(57, 3, 165, 0.06);
	overflow: auto;
	max-height: calc(100vh - 160px);
}
.lp-tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.lp-tableau thead { position: sticky; top: 0; z-index: 2; }
.lp-tableau thead th {
	background: var(--spica-violet-clair);
	color: var(--spica-violet);
	font-weight: bold;
	text-align: center;
	vertical-align: bottom;
	padding: 10px 8px 6px;
	white-space: nowrap;
}
.lp-tableau thead tr.lp-filtres td {
	background: var(--spica-violet-clair);
	padding: 0 6px 10px;
	border-bottom: 2px solid var(--spica-bordure);
}
.lp-tableau .form-control, .lp-tableau .form-select { font-size: 12px; padding: 3px 6px; min-width: 70px; border-color: var(--spica-bordure); }
/* Champs de filtrage : légère teinte bleutée pour les distinguer des titres et des données du tableau
   (un filtre actif reste en orange, voir plus bas) */
.lp-tableau .lp-filtres .form-control,
.lp-tableau .lp-filtres .form-select,
.lp-tableau .lp-filtres .lp-multi-bouton { background-color: #dceafc; border-color: #9fc0ea; color: #173a63; }
.lp-tableau .lp-filtres .form-control:not(.lp-actif):hover,
.lp-tableau .lp-filtres .form-select:not(.lp-actif):hover,
.lp-tableau .lp-filtres .lp-multi-bouton:not(.lp-actif):hover { border-color: #5b8fd1; background-color: #d0e2fa; }
.lp-tableau .lp-filtres .form-control:focus,
.lp-tableau .lp-filtres .form-select:focus { background-color: #fff; }
.lp-tableau .lp-filtres .form-control::placeholder { color: #6f8db3; }
.lp-tableau .form-control:focus, .lp-tableau .form-select:focus { border-color: var(--spica-violet); box-shadow: 0 0 0 3px rgba(57, 3, 165, 0.15); }
.lp-tableau .form-control::placeholder { color: #aaa; }

/* Filtres de date et de montant : opérateur (=, ≥, ≤, >, <) + valeur + bouton d'effacement */
.lp-combine { display: flex; align-items: center; gap: 3px; }
.lp-tableau .lp-combine .lp-op { min-width: 0; width: 46px; padding-right: 18px; background-position: right 4px center; text-align: center; font-weight: bold; }
.lp-tableau .lp-combine input[type=date] { min-width: 120px; }
.lp-tableau .lp-combine input.lp-montant { min-width: 85px; text-align: right; }
.lp-effacer { border: 0; background: none; color: #bbb; padding: 0 2px; cursor: pointer; visibility: hidden; }
.lp-effacer:hover { color: #b3261e; }
.lp-combine input.lp-actif + .lp-effacer { visibility: visible; }

/* Filtre actif : champ et titre de colonne en orange (même couleur que l'étiquette de filtre des tuiles) */
.lp-tableau .form-control.lp-actif, .lp-tableau .form-select.lp-actif {
	background-color: #fff4e5;
	border: 2px solid #e08a00;
	color: #8a5300;
	font-weight: bold;
}
.lp-tableau thead th.lp-actif { color: #c77700; }
.lp-tableau thead th.lp-actif::after { content: " \f0b0"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 10px; }

.lp-tableau tbody td { padding: 7px 8px; border-bottom: 1px solid #f1eff6; text-align: center; vertical-align: middle; }
.lp-tableau tbody tr:nth-child(even) td { background: #fbfafd; }
.lp-tableau tbody tr.lp-ligne { cursor: pointer; }
.lp-tableau tbody tr.lp-ligne:hover td { background: var(--spica-violet-clair); }
.lp-tableau td.lp-texte { text-align: left; }
.lp-tableau td.lp-nom { text-align: left; min-width: 220px; font-weight: bold; }
.lp-tableau td.lp-nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-tableau td.lp-gris { color: #999; }
/* Colonne Alertes : étiquettes affichées seulement quand une action est à mener */
/* Pastilles rondes avec icône (libellé en infobulle) pour garder une colonne étroite */
.lp-tableau td.lp-alertes { white-space: nowrap; width: 1%; }
.lp-alerte {
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; border-radius: 50%; margin: 0 1px;
	font-size: 11px; cursor: help;
}
.lp-tableau .lp-filtre-alerte { min-width: 0; width: 64px; }
.lp-alerte-action { background: #fdecea; color: #b3261e; }
.lp-alerte-planif { background: #fff4e5; color: #b36b00; }
.lp-tableau thead th.lp-aide { cursor: help; }
.lp-tableau thead th.lp-aide i { font-size: 11px; opacity: .7; }
.lp-axe { display: inline-block; background: var(--spica-violet-clair); color: var(--spica-violet); border-radius: 6px; padding: 1px 7px; font-weight: bold; white-space: nowrap; }
.lp-vide { text-align: center; color: var(--spica-gris); padding: 30px !important; }

.lp-message {
	max-width: 520px;
	margin: 60px auto;
	background: #fff;
	border: 1px solid var(--spica-bordure);
	border-radius: 12px;
	padding: 24px;
	text-align: center;
	color: var(--spica-gris);
}
.lp-message i { color: var(--spica-violet); font-size: 22px; display: block; margin-bottom: 10px; }

/* Barre d'outils (exports, tableau de bord...) : couleur bleu-vert, distincte du violet des filtres et pastilles.
   Les boutons d'un même groupe sont accolés (barre segmentée), précédés d'un titre de groupe. */
.lp-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.lp-outil-groupe {
	display: inline-flex; align-items: stretch;
	border: 1px solid #0b7a75; border-radius: 8px; overflow: hidden;
	box-shadow: 0 2px 8px rgba(11, 122, 117, 0.12);
}
.lp-outil-titre {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 12px; background: #0b7a75; color: #fff;
	font-weight: bold; font-size: 12.5px; white-space: nowrap;
}
.lp-outil {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 14px; background: #e8f5f4; color: #0b5f5b;
	font-weight: bold; font-size: 12.5px; white-space: nowrap;
	transition: background .15s, color .15s;
}
.lp-outil + .lp-outil { border-left: 1px solid #b9dedb; }
.lp-outil:hover { background: #0b7a75; color: #fff; }
.lp-outil-externe { font-size: 10px; opacity: .7; }

/* Étape d'une fiche projet : étiquette colorée selon l'avancement */
.lp-etape { display: inline-block; border-radius: 6px; padding: 1px 8px; font-weight: bold; white-space: nowrap; background: var(--spica-violet-clair); color: var(--spica-violet); }
.lp-etape-financee { background: #e8f5ec; color: #1e7b34; }
.lp-etape-deposee  { background: #e7f0fb; color: #1f5fa8; }
.lp-etape-arrete   { background: #fdecea; color: #b3261e; }
.lp-etape-redepot  { background: #fff4e5; color: #b36b00; }
.lp-etape-terminee { background: #eee; color: #555; }

/* Filtre à choix multiple : bouton à l'allure d'une liste déroulante + menu de cases à cocher */
.lp-tableau .lp-multi-bouton { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.lp-tableau .lp-multi-bouton.lp-actif { background-color: #fff4e5; }
.lp-multi-menu { min-width: 220px; }
.lp-multi-appliquer { border: 0; border-radius: 6px; background: var(--spica-violet, #3903A5); color: #fff; font-weight: bold; padding: 2px 12px; cursor: pointer; }
.lp-multi-appliquer:hover { background: #2a0279; }

/* Liste des conventions : document joint (discret) */
.lp-doc-present { color: #b5afc4; font-size: 14px; }
.lp-tableau span.lp-gris { color: #bbb; }

/* Tri par colonne : titres cliquables, flèche de tri */
.lp-tableau thead th.lp-triable { cursor: pointer; user-select: none; }
.lp-tableau thead th.lp-triable:hover { color: #2a0279; text-decoration: underline; }
.lp-tableau .lp-icone-tri { font-size: 10px; opacity: .35; margin-left: 2px; }
.lp-tableau th.lp-tri-actif .lp-icone-tri { opacity: 1; color: #c77700; font-size: 11px; }

/* Liste des budgets salaires : salaires mensuels à engager jusqu'à la fin du projet */
.lp-ratio { display: inline-block; border-radius: 6px; padding: 1px 8px; font-weight: bold; white-space: nowrap; }
.lp-ratio-ok        { background: #e8f5ec; color: #1e7b34; }
.lp-ratio-attention { background: #fff4e5; color: #b36b00; }
.lp-ratio-alerte    { background: #fdecea; color: #b3261e; }
.lp-ratio-critique  { background: #b3261e; color: #fff; }
.lp-tableau td.lp-positif { color: #1e7b34; font-weight: bold; }
.lp-tableau td.lp-negatif { color: #b3261e; font-weight: bold; }

/* Filtres resserrés (classe lp-filtres-etroits sur le tableau) : opérateur, valeur et croix d'effacement plus compacts,
   pour les tableaux qui ont beaucoup de colonnes de montants ou de dates */
.lp-tableau.lp-filtres-etroits .lp-combine { gap: 1px; }
.lp-tableau.lp-filtres-etroits .lp-combine .lp-op { width: 36px; padding-left: 3px; padding-right: 12px; background-position: right 1px center; background-size: 10px 8px; }
.lp-tableau.lp-filtres-etroits .lp-combine input.lp-montant { min-width: 0; width: 62px; padding-left: 4px; padding-right: 4px; }
.lp-tableau.lp-filtres-etroits .lp-combine input[type=date] { min-width: 0; width: 112px; padding-left: 3px; padding-right: 2px; }
.lp-tableau.lp-filtres-etroits .lp-effacer { padding: 0; width: 10px; font-size: 10px; }
.lp-tableau.lp-filtres-etroits td.lp-nombre { padding-left: 4px; padding-right: 6px; }

/* Colonne clé mise en valeur (titre et cellules) */
.lp-tableau thead th.lp-colonne-cle { background: #e6e0f5; color: #2a0279; border-left: 2px solid #c9bfe6; border-right: 2px solid #c9bfe6; }
.lp-tableau tbody td.lp-colonne-cle { background: #f7f5fc; border-left: 2px solid #e6e0f5; border-right: 2px solid #e6e0f5; }
.lp-tableau tbody tr.lp-ligne:hover td.lp-colonne-cle { background: #ece7f8; }
.lp-tableau .lp-colonne-cle .lp-ratio { font-size: 13px; padding: 2px 10px; }

/* Alertes des tuiles de l'accueil (liste des projets) : vues, boutons de classement, motifs */
.lp-vue-alertes { display: inline-flex; border: 1px solid #f3d19c; border-radius: 20px; overflow: hidden; }
.lp-vue-alertes button { border: 0; background: #fff; color: #8a5300; padding: 3px 12px; font-size: 12.5px; cursor: pointer; }
.lp-vue-alertes button + button { border-left: 1px solid #f3d19c; }
.lp-vue-alertes button.lp-vue-active { background: #fff4e5; font-weight: bold; }
.lp-vue-alertes button:hover { background: #ffecd0; }
.lp-bouton-alerte {
	margin-left: 4px; width: 24px; height: 24px; border-radius: 50%; padding: 0;
	border: 1px solid #b9dfc3; background: #e8f5ec; color: #1e7b34; font-size: 11px; cursor: pointer; vertical-align: middle;
}
.lp-bouton-alerte:hover { background: #1e7b34; color: #fff; }
.lp-bouton-alerte.lp-bouton-declasser { border-color: #f3d19c; background: #fff4e5; color: #b36b00; }
.lp-bouton-alerte.lp-bouton-declasser:hover { background: #b36b00; color: #fff; }
.lp-motif-classement { display: block; margin-top: 3px; font-weight: normal; font-size: 11.5px; color: #1e7b34; }
.lp-message-action { background: #e8f5ec; color: #1e7b34; border: 1px solid #b9dfc3; border-radius: 8px; padding: 8px 14px; margin-bottom: 12px; font-weight: bold; }
/* Fenêtre de classement */
.lp-fenetre { border-radius: 12px; border: 0; box-shadow: 0 8px 32px rgba(57, 3, 165, 0.2); font-size: 13px; }
.lp-fenetre .modal-title { color: #3903A5; font-size: 16px; font-weight: bold; }
.lp-fenetre label { display: block; font-weight: bold; margin: 12px 0 4px; }
.lp-fenetre-projet { font-weight: bold; margin-bottom: 4px; }
.lp-fenetre-aide { color: #666; font-size: 12px; }
.lp-obligatoire { color: #b3261e; }
.lp-facultatif { font-weight: normal; color: #888; }
.lp-fenetre-erreur { display: none; color: #b3261e; font-weight: bold; margin: 8px 0 0; }
.lp-bouton-annuler { border: 1px solid #e4e0ee; background: #fff; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.lp-bouton-valider { border: 0; background: #1e7b34; color: #fff; font-weight: bold; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.lp-bouton-valider:hover { background: #17612a; }
