/* Portail fournisseur - feuille de style unique (aucune dependance externe).
   Palette Proview : corail #f65252 sur neutres froids. */

:root {
	--corail: #f65252;
	--corail-sombre: #d83f3f;
	--corail-pale: #fff1f0;
	--encre: #1c2230;
	--texte: #2e3542;
	--doux: #6b7484;
	--trait: #e4e7ee;
	--fond: #f6f7fa;
	--carte: #ffffff;
	--vert: #1f9d55;
	--vert-pale: #e8f6ee;
	--ambre: #b7791f;
	--ambre-pale: #fdf5e4;
	--rouge: #c53030;
	--rouge-pale: #fdecec;
	--bleu: #2b6cb0;
	--bleu-pale: #ebf3fb;
	--rayon: 12px;
	--ombre: 0 1px 2px rgba(19, 24, 35, .06), 0 8px 24px rgba(19, 24, 35, .06);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
}

body {
	background: var(--fond);
	color: var(--texte);
	font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--corail); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--encre); margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }

/* ----------------------------------------------------------------- entete */

.entete {
	background: var(--carte);
	border-bottom: 1px solid var(--trait);
	position: sticky;
	top: 0;
	z-index: 20;
}

.entete__inner {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 16px;
	display: flex;
	align-items: center;
	gap: 18px;
	min-height: 60px;
	flex-wrap: wrap;
}

.marque {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--encre);
	font-weight: 650;
	text-decoration: none;
	margin-right: auto;
}
.marque:hover { text-decoration: none; }
.marque span { display: flex; flex-direction: column; line-height: 1.15; }
.marque small { font-size: 11.5px; font-weight: 500; color: var(--doux); }
.marque__logo { height: 32px; width: auto; display: block; }

.nav {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.nav__lien {
	display: block;
	padding: 8px 12px;
	border-radius: 8px;
	color: var(--texte);
	font-weight: 550;
	font-size: 14px;
	white-space: nowrap;
}
.nav__lien:hover { background: var(--fond); text-decoration: none; }
.nav__lien--actif { background: var(--corail-pale); color: var(--corail-sombre); }

.nav__compte {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: 10px;
	padding-left: 12px;
	border-left: 1px solid var(--trait);
}
.nav__compte .nav__lien { display: flex; flex-direction: column; line-height: 1.2; }
.nav__compte small { font-size: 11.5px; font-weight: 400; color: var(--doux); }
.nav__lien--sortie { color: var(--doux); }

.burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 40px;
	height: 36px;
	padding: 0 8px;
	background: none;
	border: 1px solid var(--trait);
	border-radius: 8px;
	cursor: pointer;
}
.burger span { display: block; height: 2px; background: var(--encre); border-radius: 2px; }

/* ------------------------------------------------------------------ page */

.page {
	max-width: 1120px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

.pied {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 16px 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	color: var(--doux);
	font-size: 13px;
}
.pied__marque { display: flex; align-items: center; gap: 10px; }
.pied__logo { height: 26px; width: auto; display: block; }
.pied__liens { display: flex; gap: 16px; flex-wrap: wrap; }

.entete-page {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.entete-page p { margin: 0; color: var(--doux); }

/* ----------------------------------------------------------------- cartes */

.carte {
	background: var(--carte);
	border: 1px solid var(--trait);
	border-radius: var(--rayon);
	box-shadow: var(--ombre);
	padding: 18px;
	margin-bottom: 18px;
}
.carte__titre {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.carte__titre h2 { margin: 0; }

.grille-kpi {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.kpi {
	background: var(--carte);
	border: 1px solid var(--trait);
	border-radius: var(--rayon);
	box-shadow: var(--ombre);
	padding: 16px 18px;
	display: block;
	color: inherit;
}
.kpi:hover { text-decoration: none; border-color: #d3d8e3; }
.kpi__valeur { font-size: 26px; font-weight: 660; color: var(--encre); line-height: 1.1; }
.kpi__libelle { font-size: 13px; color: var(--doux); margin-top: 4px; }
.kpi--accent .kpi__valeur { color: var(--corail); }

/* --------------------------------------------------------------- tableaux */

.tableau-enveloppe { overflow-x: auto; }

table.tableau {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
table.tableau th {
	text-align: left;
	font-size: 11.5px;
	font-weight: 640;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--doux);
	padding: 0 12px 8px;
	border-bottom: 1px solid var(--trait);
	white-space: nowrap;
}
table.tableau td {
	padding: 12px;
	border-bottom: 1px solid var(--trait);
	vertical-align: top;
}
table.tableau tbody tr:last-child td { border-bottom: 0; }
table.tableau tbody tr:hover { background: #fafbfd; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.doux { color: var(--doux); }
.petit { font-size: 12.5px; }
.gras { font-weight: 620; color: var(--encre); }

.vide {
	text-align: center;
	color: var(--doux);
	padding: 32px 12px;
}

/* --------------------------------------------------------------- pastilles */

.badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}
.badge--ok { background: var(--vert-pale); color: var(--vert); }
.badge--attente { background: var(--ambre-pale); color: var(--ambre); }
.badge--rejet { background: var(--rouge-pale); color: var(--rouge); }
.badge--doublon { background: var(--bleu-pale); color: var(--bleu); }

/* --------------------------------------------------------------- alertes */

.alerte {
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 14px;
	border: 1px solid transparent;
}
.alerte--succes { background: var(--vert-pale); color: #176c3b; border-color: #bfe5cd; }
.alerte--erreur { background: var(--rouge-pale); color: #9b2323; border-color: #f3c6c6; }
.alerte--info { background: var(--bleu-pale); color: #24557f; border-color: #c8ddf1; }

/* ------------------------------------------------------------ formulaires */

.champ { margin-bottom: 14px; }
.champ label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--encre);
	margin-bottom: 5px;
}
.champ .aide { font-size: 12.5px; color: var(--doux); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d7dbe4;
	border-radius: 9px;
	background: #fff;
	color: var(--texte);
	font: inherit;
	font-size: 14.5px;
}
input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--corail);
	box-shadow: 0 0 0 3px rgba(246, 82, 82, .14);
}
textarea { resize: vertical; min-height: 78px; }

.grille-champs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 0 14px;
}

.bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1px solid var(--corail);
	border-radius: 9px;
	background: var(--corail);
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: 14.5px;
	cursor: pointer;
	text-decoration: none;
}
.bouton:hover { background: var(--corail-sombre); border-color: var(--corail-sombre); text-decoration: none; color: #fff; }
.bouton--fantome {
	background: #fff;
	color: var(--texte);
	border-color: #d7dbe4;
}
.bouton--fantome:hover { background: var(--fond); color: var(--encre); border-color: #c6ccd8; }
.bouton--bloc { width: 100%; }
.bouton--petit { padding: 7px 12px; font-size: 13.5px; }

.barre-filtres {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: flex-end;
}
.barre-filtres .champ { margin-bottom: 0; min-width: 150px; }

/* ------------------------------------------------------------ zone depot */

.depose {
	border: 2px dashed #cfd5e1;
	border-radius: var(--rayon);
	background: #fbfcfe;
	padding: 28px 18px;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.depose:hover, .depose--survol {
	border-color: var(--corail);
	background: var(--corail-pale);
}
.depose input[type=file] { display: none; }
.depose__titre { font-weight: 620; color: var(--encre); }
.depose__aide { font-size: 13px; color: var(--doux); margin-top: 4px; }
.depose__fichier {
	margin-top: 12px;
	font-size: 14px;
	color: var(--encre);
	font-weight: 600;
	word-break: break-all;
}

/* -------------------------------------------------------- pages publiques */

.body--auth {
	background: linear-gradient(160deg, #fff4f3 0%, #f6f7fa 42%, #eef1f7 100%);
	min-height: 100vh;
}

.auth {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.auth__carte {
	width: 100%;
	max-width: 420px;
	background: var(--carte);
	border: 1px solid var(--trait);
	border-radius: 16px;
	box-shadow: 0 2px 6px rgba(19, 24, 35, .05), 0 18px 48px rgba(19, 24, 35, .10);
	padding: 30px 28px;
}
.auth__entete { text-align: center; margin-bottom: 22px; }
.auth__entete h1 { font-size: 20px; margin: 10px 0 2px; }
.auth__entete p { margin: 0; color: var(--doux); font-size: 13.5px; }
/* Bornes sur les deux axes : un logo large (Counter11, ratio 2:1) reste lisible
   et un logo plutot carre (iPOS) ne devient pas geant. */
.auth__logo {
	max-width: 250px;
	max-height: 96px;
	width: auto;
	height: auto;
	display: inline-block;
}
.auth__liens {
	margin-top: 16px;
	text-align: center;
	font-size: 13.5px;
}
.auth__pied {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
	color: var(--doux);
	font-size: 12.5px;
}
.auth__pied-logo { height: 28px; width: auto; opacity: .9; }
.auth__pied-liens { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------ definitions */

.liste-def {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 10px 20px;
	font-size: 14px;
	margin: 0;
}
.liste-def dt { color: var(--doux); }
.liste-def dd { margin: 0; color: var(--encre); font-weight: 550; }

.apercu {
	border: 1px solid var(--trait);
	border-radius: var(--rayon);
	overflow: hidden;
	background: #fff;
}
.apercu iframe { display: block; width: 100%; height: 560px; border: 0; }
.apercu img { display: block; max-width: 100%; }

.colonnes {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.total-ligne {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 7px 0;
	font-size: 14px;
}
.total-ligne + .total-ligne { border-top: 1px solid var(--trait); }
.total-ligne--fort { font-weight: 680; color: var(--encre); font-size: 16px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 860px) {
	.colonnes { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.burger { display: flex; }
	.nav {
		display: none;
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
		padding: 8px 0 14px;
	}
	.nav--ouvert { display: flex; }
	.nav__compte {
		flex-direction: column;
		align-items: stretch;
		margin: 6px 0 0;
		padding: 8px 0 0;
		border-left: 0;
		border-top: 1px solid var(--trait);
	}
}

/* ----------------------------------------------------------------- sombre */

@media (prefers-color-scheme: dark) {
	:root {
		--encre: #f2f4f8;
		--texte: #d7dbe4;
		--doux: #98a1b2;
		--trait: #2a3040;
		--fond: #141822;
		--carte: #1b2130;
		--corail-pale: #3a2222;
		--vert-pale: #17301f;
		--ambre-pale: #322914;
		--rouge-pale: #351c1c;
		--bleu-pale: #1a2a3c;
		--ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
	}
	body { background: var(--fond); }
	.body--auth { background: linear-gradient(160deg, #221a1c 0%, #141822 45%, #10141d 100%); }
	input[type=text], input[type=email], input[type=password], input[type=date],
	input[type=number], input[type=search], select, textarea {
		background: #151a26;
		border-color: #2f3648;
		color: var(--texte);
	}
	.depose { background: #171d29; border-color: #333b4d; }
	.bouton--fantome { background: #1b2130; border-color: #333b4d; }
	table.tableau tbody tr:hover { background: #1f2636; }
	.burger span { background: var(--encre); }

	/* Les logos fournis ont un fond blanc opaque : on l'assume en pastille
	   claire plutot que de laisser un rectangle brut sur le fond sombre. */
	.auth__logo, .marque__logo, .pied__logo, .auth__pied-logo {
		background: #fff;
		border-radius: 8px;
		padding: 5px 8px;
	}
}
