/* Copyright (C) 2026 BiperGorri — GPL v3 or later
 * Styles du module BiperGorri, alignés sur la couleur du bandeau du thème (--colorbackhmenu1) :
 * barre de navigation PSF, tuiles de l'accueil, boutons d'action des écrans du module.
 */

/* ---------- Barre de navigation PSF (haut de page, à gauche) ---------- */
.bpg-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px 0;
}
.bpg-tbbutton {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 1px solid var(--colorbackhmenu1);
	border-radius: 18px;
	background: transparent;
	color: var(--colorbackhmenu1) !important;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}
.bpg-tbbutton:hover,
.bpg-tbcurrent {
	background: var(--colorbackhmenu1);
	color: var(--colortextbackhmenu, #fff) !important;
}
.bpg-tbbutton .pictofixedwidth {
	color: inherit !important;
}

/* ---------- Tuiles de l'accueil PSF ---------- */
.bpg-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 14px;
	margin: 6px 0 24px 0;
}
.bpg-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 92px;
	padding: 14px 12px;
	border-radius: 10px;
	background: var(--colorbackhmenu1);
	color: var(--colortextbackhmenu, #fff) !important;
	text-decoration: none !important;
	text-align: center;
	font-size: 1.05em;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.bpg-tile:hover {
	filter: brightness(1.08);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
	transform: translateY(-1px);
}
.bpg-tile .fa,
.bpg-tile .fas,
.bpg-tile .far {
	font-size: 1.7em;
	color: inherit !important;
}
.bpg-tile-secondary {
	background: transparent;
	color: var(--colorbackhmenu1) !important;
	border: 2px solid var(--colorbackhmenu1);
	box-shadow: none;
}
.bpg-tile-count {
	position: absolute;
	top: 8px;
	right: 10px;
	min-width: 22px;
	padding: 2px 7px;
	border-radius: 11px;
	background: #fff;
	color: var(--colorbackhmenu1);
	font-weight: bold;
	font-size: 0.85em;
}

/* ---------- Boutons d'action des écrans du module : couleur du bandeau, coins arrondis ---------- */
body.mod-bipergorri .butAction,
body.mod-bipergorri .butActionDelete {
	border-radius: 6px;
}
body.mod-bipergorri .butAction {
	background: var(--colorbackhmenu1);
	border-color: var(--colorbackhmenu1);
	color: var(--colortextbackhmenu, #fff) !important;
}
body.mod-bipergorri .butAction:hover {
	filter: brightness(1.1);
}
body.mod-bipergorri .butAction .pictofixedwidth {
	color: inherit !important;
}

/* Boutons d'action de la fiche, repris en haut (clone des boutons du bas) */
#bpg-top-actions .tabsAction {
	text-align: left;
	margin: 8px 0 12px 0;
	padding: 0;
}

/* ---------- Fiche tiers : adresses client (consultation et modification) ---------- */
/* Petits boutons rouges (couleur du bandeau) */
.bpg-adrbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 10px;
	border: 1px solid var(--colorbackhmenu1);
	border-radius: 4px;
	background: var(--colorbackhmenu1);
	color: var(--colortextbackhmenu, #fff) !important;
	text-decoration: none !important;
	font-size: 0.85em;
	line-height: 1.3;
	white-space: nowrap;
	cursor: pointer;
}
.bpg-adrbtn:hover {
	filter: brightness(1.12);
}
.bpg-adrbtn-secondary {
	background: transparent;
	color: var(--colorbackhmenu1) !important;
}
.bpg-adrbtn-off {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Titres : section et adresse */
.bpg-adr-gt {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
}
.bpg-adr-gt-btns,
.bpg-adr-rowbtns {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.bpg-adr-gt-btns {
	margin-left: auto;
}
.bpg-adr-rowbtns {
	margin-top: 6px;
}
.bpg-adr-sectiontitle,
.bpg-adr-sectiontitle .pictofixedwidth {
	color: var(--colorbackhmenu1) !important;
	font-weight: bold;
	font-size: 1.1em;
}
.bpg-adr-gt-label {
	color: var(--colorbackhmenu1);
	font-weight: bold;
}
.bpg-adr-gt-help {
	font-size: 0.9em;
}
tr.bpg-adr-section > td {
	padding-top: 18px !important;
	border-top: 2px solid var(--colorbackhmenu1) !important;
}
.bpg-adr-contact {
	margin-top: 4px;
}
.bpg-adr-infos {
	margin-top: 4px;
	font-style: italic;
}

/* Consultation : une adresse par ligne, liseré à gauche */
#bpg-adresses tr.bpg-adr-row > td:first-child {
	border-left: 3px solid var(--colorbackhmenu1);
	padding-left: 8px;
}

/* Modification : un bandeau par adresse, puis ses champs, liseré à gauche */
#bpg-adresses-edit tr.bpg-adr-grouptitle > td {
	padding-top: 14px !important;
	padding-bottom: 6px !important;
	border-left: 3px solid var(--colorbackhmenu1);
	padding-left: 8px !important;
	background: rgba(0, 0, 0, 0.035);
}
#bpg-adresses-edit tr.bpg-adr-grp > td:first-child {
	border-left: 3px solid var(--colorbackhmenu1);
	padding-left: 18px !important;
}
#bpg-adresses-edit tr.bpg-adr-grplast > td {
	padding-bottom: 10px !important;
}
.bpg-adr-contactedit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
}
.bpg-adr-check {
	white-space: nowrap;
}
.bpg-adr-coord {
	white-space: nowrap;
}
#bpg-adresses-edit tr.bpg-adr-flash > td {
	background: rgba(170, 30, 30, 0.08);
}

/* Écran de saisie séparé (societe_adresses.php) */
.bpg-adr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 16px;
	margin: 12px 0 16px 0;
}
.bpg-adr-card {
	border: 1px solid var(--colorbackhmenu1);
	border-radius: 6px;
	padding: 8px 12px 12px 12px;
	margin: 0;
}
.bpg-adr-card legend {
	padding: 0 6px;
	color: var(--colorbackhmenu1);
	font-weight: bold;
}
.bpg-adr-help {
	margin: 0 0 8px 0;
}
.bpg-adr-clear {
	display: inline-block;
	margin-top: 8px;
}

/* ---------- Livrer et facturer ---------- */
.bpg-lf-intro {
	margin: 0 0 14px 0;
}
.bpg-lf-help {
	margin: 10px 0 14px 0;
}
.bpg-lf-recap {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
	margin: 10px 0 16px 0;
}
.bpg-lf-doc {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
	padding: 12px 14px;
	border: 1px solid var(--colorbackhmenu1);
	border-left-width: 4px;
	border-radius: 6px;
}
.bpg-lf-doclabel {
	color: var(--colorbackhmenu1);
	font-weight: bold;
}

/* ---------- Liste des réceptions PSF : groupes de colonnes (comme l'onglet EntréesPSF de l'Excel) ---------- */
tr.bpg-grp-row th.bpg-grp {
	text-align: center;
	font-size: 0.85em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 4px 6px;
	border-bottom: none;
}
tr.bpg-grp-row th.bpg-grp-reception { background: rgba(120, 120, 120, 0.12); }
tr.bpg-grp-row th.bpg-grp-ctrlreception { background: rgba(33, 120, 200, 0.16); }
tr.bpg-grp-row th.bpg-grp-ctrlaop { background: rgba(46, 150, 70, 0.18); }
tr.bpg-grp-row th.bpg-grp-micro { background: rgba(225, 130, 20, 0.18); }
tr.bpg-grp-row th.bpg-grp-divers { background: rgba(140, 90, 170, 0.14); }
tr.liste_titre th.bpg-grp-reception { border-top: 3px solid rgba(120, 120, 120, 0.55); }
tr.liste_titre th.bpg-grp-ctrlreception { border-top: 3px solid rgb(33, 120, 200); }
tr.liste_titre th.bpg-grp-ctrlaop { border-top: 3px solid rgb(46, 150, 70); }
tr.liste_titre th.bpg-grp-micro { border-top: 3px solid rgb(225, 130, 20); }
tr.liste_titre th.bpg-grp-divers { border-top: 3px solid rgb(140, 90, 170); }

/* Barre de défilement horizontal au-dessus des tableaux larges (créée par bipergorri.js) */
.bpg-topscroll {
	position: sticky;
	z-index: 1004;
	overflow-x: auto;
	overflow-y: hidden;
	height: 16px;
	background: var(--colorbackbody, #fff);
}
.bpg-topscroll-inner {
	height: 1px;
}

@media only screen and (max-width: 767px) {
	.bpg-tbbutton {
		padding: 8px 10px;
		flex: 1 1 45%;
		justify-content: center;
	}
	.bpg-tiles {
		grid-template-columns: 1fr 1fr;
	}
	.bpg-adrbtn {
		white-space: normal;
	}
	.bpg-adr-gt-btns {
		margin-left: 0;
	}
}
