/* Module Atelier - Styles specifiques
 * Volontairement minimal : on herite du theme Dolibarr actif (eldy, md...)
 * et on n'ajoute que ce qui n'existe pas dans le coeur.
 */

/* Pastille de couleur dans les listes et les fiches. */
.atelier-pastille {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.25);
	margin-right: 6px;
	vertical-align: middle;
}

/* Marges : le rouge doit sauter aux yeux, c'est le signal le plus important
   de tout le module. */
.atelier-negatif {
	color: #c62828;
	font-weight: bold;
}

.atelier-positif {
	color: #2e7d32;
}

/* Projet dont la date de fin prevue est depassee. */
.atelier-retard {
	color: #c62828;
	font-weight: bold;
}

/* Tableau de saisie rapide des consommations : lignes compactes pour saisir
   une fiche de 15 lignes sans scroller. */
.atelier-saisie td {
	padding: 3px 5px;
}

.atelier-saisie input[type="text"],
.atelier-saisie input[type="number"] {
	padding: 2px 4px;
}

/* Bloc de synthese du bilan. */
.atelier-bilan-total {
	font-size: 1.15em;
	font-weight: bold;
	border-top: 2px solid #888;
}

/* Encadre d'alerte quand les couts ne sont pas encore figes. */
.atelier-avertissement {
	background: #fff8e1;
	border-left: 4px solid #f9a825;
	padding: 8px 12px;
	margin: 8px 0;
}

/* ---------------------------------------------------------------------------
   Bouton « + » de creation rapide, a cote d'une liste deroulante.
   --------------------------------------------------------------------------- */
.atelier-btn-plus {
	display: inline-block;
	width: 22px;
	height: 22px;
	line-height: 20px;
	text-align: center;
	border: 1px solid #999;
	border-radius: 50%;
	font-weight: bold;
	font-size: 16px;
	text-decoration: none;
	vertical-align: middle;
	margin-left: 4px;
}

.atelier-btn-plus:hover {
	background: #2e7d32;
	border-color: #2e7d32;
	color: #fff;
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Fenetre modale.
   Construite a la main : jQuery UI n'est pas garanti selon le theme Dolibarr,
   alors que jQuery lui-meme l'est toujours.
   --------------------------------------------------------------------------- */
.atelier-modal-fond {
	display: none;              /* passe a "flex" par le JS a l'ouverture */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.45);
	z-index: 10000;
	align-items: center;
	justify-content: center;
}

.atelier-modal-boite {
	background: #fff;
	border-radius: 5px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
	width: 90%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
}

.atelier-modal-entete {
	padding: 10px 14px;
	border-bottom: 1px solid #ddd;
	font-weight: bold;
	font-size: 1.05em;
}

.atelier-modal-fermer {
	float: right;
	cursor: pointer;
	font-size: 1.4em;
	line-height: 0.8;
	opacity: 0.55;
}

.atelier-modal-fermer:hover {
	opacity: 1;
}

.atelier-modal-corps {
	padding: 12px 14px;
}

.atelier-modal-pied {
	padding: 10px 14px;
	border-top: 1px solid #ddd;
	text-align: right;
}

.atelier-modal-erreur {
	display: none;
	background: #ffebee;
	border-left: 4px solid #c62828;
	color: #c62828;
	padding: 7px 10px;
	margin-bottom: 10px;
}

/* Alerte bloquante : schema de base non a jour. Doit se voir immediatement,
   c'est une action requise, pas une information. */
.atelier-alerte {
	background: #ffebee;
	border: 1px solid #c62828;
	border-left: 5px solid #c62828;
	color: #7f1d1d;
	padding: 12px 14px;
	margin: 10px 0;
	line-height: 1.5;
}

.atelier-alerte code {
	background: rgba(0, 0, 0, 0.07);
	padding: 1px 4px;
	border-radius: 3px;
}

/* Confirmation apres validation d'un achat hors stock. Masquee par defaut,
   affichee puis effacee par le JavaScript. */
.atelier-succes {
	display: none;
	background: #e8f5e9;
	border-left: 4px solid #2e7d32;
	color: #2e7d32;
	padding: 7px 10px;
	margin-bottom: 10px;
}

/* Ligne de consommation achetee hors stock : doit se reperer d'un coup d'oeil
   dans la liste, car elle n'a pas mouvemente le stock. */
.atelier-achat-direct {
	background: #f3e5f5;
}

/* Avance de tresorerie non remboursee. */
.atelier-avance-due {
	color: #6a1b9a;
	font-weight: bold;
}

/* Mesure reprise de la fiche client : signale une valeur proposee, pas saisie. */
.atelier-mesure-reprise { background: #fffbe6; }

/* ---------------------------------------------------------------------------
   Point de vente : stock a gauche, panier a droite.
   Cibles larges et lisibles : la caisse se tient debout, parfois sur tablette.
   --------------------------------------------------------------------------- */
.atelier-pos {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	margin-top: 10px;
}

.atelier-pos-stock { flex: 1 1 auto; min-width: 0; }
.atelier-pos-recherche { margin-bottom: 12px; }

.atelier-pos-grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
}

.atelier-pos-article { margin: 0; }

.atelier-pos-article button {
	width: 100%;
	min-height: 84px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 3px;
	padding: 10px;
	border: 1px solid #bfc6d6;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	text-align: left;
	font: inherit;
}

.atelier-pos-article button:hover:not(:disabled) {
	border-color: #2a3f87;
	background: rgba(42, 63, 135, 0.05);
}

.atelier-pos-article button:disabled { opacity: 0.45; cursor: not-allowed; }

.atelier-pos-article .pos-nom { font-weight: 600; line-height: 1.25; }
.atelier-pos-article .pos-prix { font-size: 1.05em; }
.atelier-pos-article .pos-stock { font-size: 11.5px; opacity: 0.7; }
.atelier-pos-article .pos-stock.rupture { color: #c62828; opacity: 1; }

.atelier-pos-panier {
	flex: 0 0 320px;
	border: 1px solid #bfc6d6;
	border-radius: 5px;
	background: #fff;
	padding: 12px;
	position: sticky;
	top: 12px;
}

.atelier-pos-entete {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.atelier-pos-total {
	display: flex;
	justify-content: space-between;
	font-size: 1.35em;
	font-weight: bold;
	border-top: 2px solid #888;
	padding-top: 8px;
	margin-top: 8px;
}

.atelier-pos-encaisse { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.atelier-pos-encaisse label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; margin-top: 6px; }
.atelier-pos-valider { margin-top: 12px; padding: 10px; font-size: 1.05em; }

.atelier-pos-rendu { display: none; margin-top: 6px; font-size: 1.05em; }

@media (max-width: 860px) {
	.atelier-pos { flex-direction: column; }
	.atelier-pos-panier { flex: 1 1 auto; width: 100%; position: static; }
}

/* ---------------------------------------------------------------------------
   Cartouches de synthese
   Utilises en tete des ecrans de bilan : quatre chiffres a lire d'un coup
   d'oeil avant d'entrer dans le detail. La valeur porte la couleur, pas le
   fond : un tableau de bord tout en aplats de couleur ne se hierarchise plus.
--------------------------------------------------------------------------- */
.atelier-cartouches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 16px;
}

.atelier-cartouche {
	flex: 1 1 170px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
	padding: 12px 14px;
	background: #fff;
}

.atelier-cartouche-libelle {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.65;
}

.atelier-cartouche-valeur {
	font-size: 1.4em;
	font-weight: bold;
	font-variant-numeric: tabular-nums;
}

.atelier-cartouche-detail {
	font-size: 11px;
	opacity: 0.6;
}

/* Argent recu sur un vetement pas encore remis : ni un impaye, ni un
   benefice acquis. Sa propre couleur, pour qu'on ne le confonde ni avec
   l'un ni avec l'autre. */
.atelier-etiquette-avance {
	display: inline-block;
	font-size: 11px;
	letter-spacing: 0.04em;
	background: #fff3e0;
	color: #a85d1b;
	border: 1px solid #e8c9a0;
	border-radius: 3px;
	padding: 1px 7px;
}

/* Bouton qui doit se lire comme un lien.
   Les actions du comptoir passent en POST — Dolibarr peut refuser une action
   en GET selon son reglage anti-CSRF — mais un bouton de formulaire au milieu
   d'une phrase casserait la lecture. On lui rend l'apparence d'un lien. */
.atelier-lien-bouton {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.atelier-lien-bouton:hover { opacity: 0.75; }
.atelier-lien-bouton:focus-visible { outline: 2px solid #2F4B7C; outline-offset: 2px; }

/* Total annonce sous le prix unitaire, pendant la frappe.
   Le secretaire annonce un montant de vive voix au client : il doit le lire,
   pas le calculer de tete. */
.atelier-apercu-total {
	margin-top: 4px;
	font-size: 0.95em;
	font-weight: bold;
	color: #2F4B7C;
	min-height: 1.2em;
}
