/* ---------------------------------------------------
   maboutique.123ventes — styles de l'app mobile
   Claude - date:2026.10.19 - explication:charte 123Ventes (vert #003500), pensé pour le téléphone d'abord
   --------------------------------------------------- */
:root {
	--vert: #003500;
	--vertVif: #2e7d32;
	--vertClair: #e8f3e5;
	--fond: #f4f7f2;
	--carte: #ffffff;
	--texte: #1b241b;
	--texteDoux: #5b6b5b;
	--bord: #dde5da;
	--alerte: #c2410c;
	--erreur: #b42318;
	--ombre: 0 1px 3px rgba(0, 0, 0, .08);
	--rayon: 12px;
	--hautNav: 64px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--vertClair: #1e3a1e;
		--fond: #0f150f;
		--carte: #18211a;
		--texte: #e7efe5;
		--texteDoux: #a4b3a2;
		--bord: #2b382b;
		--vertVif: #66bb6a;
		--ombre: none;
		color-scheme: dark;
	}
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	overflow-x: hidden;
	background: var(--fond);
	color: var(--texte);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	min-height: 100vh;
	padding-bottom: calc(var(--hautNav) + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--vertVif); }
[hidden] { display: none !important; }

/* Entête */
.entete {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; gap: 8px;
	background: var(--vert); color: #fff;
	padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
	min-height: 56px;
}
.entete-titre { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete button { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.entete-retour { font-size: 2rem; line-height: 1; padding: 0 8px 4px !important; }
.entete-menu { font-size: 1.4rem; }
.entete-installer { border: 1px solid rgba(255, 255, 255, .6) !important; font-size: .9rem; }

/* Contenu */
.contenu { max-width: 720px; margin: 0 auto; padding: 16px; outline: none; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; margin-bottom: 14px; }
.carte h2 { font-size: 1rem; margin: 0 0 10px; }
.doux { color: var(--texteDoux); font-size: .9rem; }
.vide { text-align: center; color: var(--texteDoux); padding: 32px 8px; }

/* Onglets du bas */
.onglets {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
	display: flex; background: var(--carte); border-top: 1px solid var(--bord);
	padding-bottom: env(safe-area-inset-bottom);
}
.onglets a {
	flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	height: var(--hautNav); color: var(--texteDoux); text-decoration: none; font-size: .75rem;
}
.onglets a.actif { color: var(--vertVif); font-weight: 600; }
.onglet-icone { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Formulaires */
.champ { display: block; margin-bottom: 14px; }
.champ span { display: block; font-size: .9rem; margin-bottom: 4px; color: var(--texteDoux); }
.champ input, .champ select {
	width: 100%; padding: 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte);
}
.champ input:focus, .champ select:focus { outline: 2px solid var(--vertVif); outline-offset: 1px; }
.bouton {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; padding: 13px 16px; border: 0; border-radius: 10px;
	background: var(--vertVif); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none;
}
.bouton:disabled { opacity: .6; }
.bouton.secondaire { background: var(--vertClair); color: var(--texte); }
.bouton + .bouton { margin-top: 10px; }
.bascule { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bascule input { width: 48px; height: 28px; accent-color: var(--vertVif); }
.erreur { color: var(--erreur); font-size: .95rem; margin: 0 0 12px; }

/* Connexion */
.connexion { max-width: 420px; margin: 8vh auto 0; }
.connexion .logo { display: block; width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 16px; }
.connexion h2 { text-align: center; font-size: 1.3rem; margin: 0 0 4px; }
.connexion p.doux { text-align: center; margin: 0 0 20px; }

/* Tableau de bord */
.periodes { display: flex; gap: 6px; margin-bottom: 14px; }
.periodes button { flex: 1; padding: 9px; border: 1px solid var(--bord); border-radius: 999px; background: var(--carte); cursor: pointer; }
.periodes button.actif { background: var(--vert); color: #fff; border-color: var(--vert); }
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.chiffre { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; }
.chiffre b { display: block; font-size: 1.35rem; }
.chiffre span { color: var(--texteDoux); font-size: .85rem; }
.chiffre.alerte b { color: var(--alerte); }
a.chiffre { color: inherit; text-decoration: none; }
.courbe { width: 100%; height: 140px; display: block; }
.courbe rect { fill: var(--vertVif); }
.courbe text { fill: var(--texteDoux); font-size: 10px; }

/* Listes */
.recherche { display: flex; gap: 8px; margin-bottom: 12px; }
/* Claude - date:2026.10.19 - explication:min-width 0 + filtre limité : sinon la liste déroulante faisait déborder la page en largeur */
.recherche input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); }
.recherche select { flex: 0 1 auto; min-width: 0; padding: 10px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); max-width: 42%; }
.liste { list-style: none; margin: 0; padding: 0; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.liste li + li { border-top: 1px solid var(--bord); }
.liste a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; min-height: 60px; }
.liste .milieu { flex: 1; min-width: 0; }
.liste .milieu b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.liste .droite { text-align: right; white-space: nowrap; }
.vignette { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--vertClair); flex: none; }
.etat { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.masque { opacity: .55; }
.plus { margin-top: 12px; }

/* Détails */
.ligneInfo { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.ligneInfo span:first-child { color: var(--texteDoux); }
.ligneInfo span:last-child { text-align: right; }
.total { font-weight: 700; border-top: 1px solid var(--bord); margin-top: 6px; padding-top: 10px; }
.actions { display: flex; gap: 8px; }
.actions .bouton { margin: 0; }
.photo { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; background: var(--vertClair); display: block; margin-bottom: 12px; }

/* Message temporaire */
.message {
	position: fixed; left: 16px; right: 16px; bottom: calc(var(--hautNav) + 16px + env(safe-area-inset-bottom)); z-index: 10;
	max-width: 480px; margin: 0 auto; padding: 12px 16px; border-radius: 10px;
	background: var(--texte); color: var(--fond); text-align: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.message.ko { background: var(--erreur); color: #fff; }
.chargement { text-align: center; padding: 40px; color: var(--texteDoux); }
