/* Charte reprise des bons de commande existants : même rouge, mêmes lignes de
   tableau rosées, même typographie. L'application ressemble ainsi aux
   documents qu'elle produit. */

:root {
  --rouge: #FF0000;
  --rouge-fonce: #C10000;
  --rose: #FCE8E8;
  --rose-fort: #FBDADA;
  --gris-clair: #F2F2F2;
  --gris-bloc: #EEEEEE;
  --bordure: #D8D8D8;
  --texte: #1A1A1A;
  --texte-doux: #5A5A5A;
  --vert: #15803D;
  --vert-clair: #E8F5EC;
  --ambre: #92400E;
  --ambre-clair: #FEF3E2;
  --noir: #1A1A1A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--gris-clair);
  color: var(--texte);
  font-size: 15px;
}

a { color: var(--rouge-fonce); text-decoration: none; }
a:hover { color: #8A0000; text-decoration: underline; }

/* --- Bandeau --------------------------------------------------------------- */
.bandeau {
  background: var(--rouge);
  color: #fff;
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bandeau.groupe { background: var(--noir); }
.bandeau-gauche { display: flex; align-items: center; gap: 34px; }
.bandeau-titre { font-size: 19px; font-weight: bold; letter-spacing: -0.3px; }
.bandeau-titre .portee { color: #FF9A9A; font-weight: normal; }
.bandeau.groupe .bandeau-titre .portee { color: #FF5A5A; }
.menu { display: flex; gap: 26px; font-size: 15px; }
.menu a { color: #fff; padding-bottom: 4px; opacity: .85; text-decoration: none; }
.menu a:hover { opacity: 1; text-decoration: none; color: #fff; }
.menu a.actif { font-weight: bold; opacity: 1; border-bottom: 3px solid #fff; }
.bandeau.groupe .menu a.actif { border-bottom-color: var(--rouge); }
.identite { display: flex; align-items: center; gap: 16px; }
.identite .nom { font-size: 14px; font-weight: bold; }
.identite .fonction { font-size: 12px; opacity: .9; }
.pastille {
  background: #fff; color: var(--rouge);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: bold;
}
.bandeau.groupe .pastille { background: var(--rouge); color: #fff; }

/* --- Structure ------------------------------------------------------------- */
.page { padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.titre-page { font-size: 25px; font-weight: bold; margin: 0; }
.sous-titre { font-size: 15px; color: var(--texte-doux); margin: 7px 0 0; }
.ligne-titre { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }

.carte { background: #fff; border: 1px solid var(--bordure); }
.carte-corps { padding: 20px 22px; }
.carte-entete {
  padding: 15px 20px; border-bottom: 1px solid #ECECEC;
  display: flex; align-items: center; justify-content: space-between;
}
.carte-entete h2 { font-size: 16px; font-weight: bold; margin: 0; }

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.chiffre { background: #fff; border: 1px solid var(--bordure); padding: 17px 19px; }
.chiffre.sombre { background: var(--noir); color: #fff; border-color: var(--noir); }
.chiffre .etiquette {
  font-size: 12px; color: var(--texte-doux);
  text-transform: uppercase; letter-spacing: .6px;
}
.chiffre.sombre .etiquette { color: rgba(255,255,255,.8); }
.chiffre .valeur { font-size: 29px; font-weight: bold; margin-top: 7px; }
.chiffre .valeur.alerte { color: var(--rouge-fonce); }
.chiffre .precision { font-size: 12px; color: #7A7A7A; margin-top: 3px; }
.chiffre.sombre .precision { color: rgba(255,255,255,.8); }

/* --- Tableaux -------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--rouge); color: #fff;
  font-size: 12px; font-weight: bold; text-align: left;
  padding: 12px 14px;
}
.groupe thead th { background: var(--noir); }
tbody td { padding: 12px 14px; font-size: 13px; border-top: 1px solid #ECECEC; }
tbody tr:nth-child(even) td { background: #FAFAFA; }
tbody tr.surligne td { background: var(--rose); }
td.nombre, th.nombre { text-align: right; }
td.gras { font-weight: bold; }

/* --- Étiquettes d'état ----------------------------------------------------- */
.etat { padding: 4px 9px; font-size: 12px; display: inline-block; }
.etat.ok { background: var(--vert-clair); color: var(--vert); }
.etat.attention { background: var(--ambre-clair); color: var(--ambre); }
.etat.probleme { background: var(--rose); color: var(--rouge-fonce); font-weight: bold; }
.etat.neutre { background: var(--gris-bloc); color: #3A3A3A; }

/* --- Encadrés -------------------------------------------------------------- */
.encadre { padding: 15px 18px; font-size: 14px; line-height: 1.6; }
.encadre.info { background: var(--gris-bloc); }
.encadre.alerte { background: var(--rose); border-left: 4px solid var(--rouge); }
.encadre.attention { background: var(--ambre-clair); border-left: 4px solid #D97706; }
.encadre.ok { background: var(--vert-clair); border-left: 4px solid var(--vert); }

/* --- Formulaires ---------------------------------------------------------- */
label { display: block; font-size: 14px; font-weight: bold; margin-bottom: 7px; }
input[type=text], input[type=password], input[type=search], select {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid #B9B9B9; background: #fff;
  font-family: inherit; font-size: 16px; color: var(--texte);
}
input:focus, select:focus { outline: 2px solid var(--rouge); outline-offset: -2px; }
.champ { margin-bottom: 20px; }
.aide { font-size: 13px; color: var(--texte-doux); margin-top: 6px; font-weight: normal; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 24px;
  background: var(--rouge); color: #fff; border: none;
  font-family: inherit; font-size: 15px; font-weight: bold;
  cursor: pointer; text-decoration: none;
}
.bouton:hover { background: var(--rouge-fonce); color: #fff; text-decoration: none; }
.bouton.secondaire { background: #fff; color: var(--texte); border: 1px solid #B9B9B9; }
.bouton.secondaire:hover { background: #F7F7F7; color: var(--texte); }
.bouton.pleine-largeur { width: 100%; }

/* --- Connexion ------------------------------------------------------------ */
.connexion { min-height: 100vh; display: flex; flex-direction: column; }
.connexion .filet { background: var(--rouge); height: 10px; }
.connexion .centre {
  flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
}
.connexion .colonnes { display: flex; gap: 56px; align-items: flex-start; max-width: 1000px; }
.connexion .boite { width: 430px; background: #fff; border: 1px solid var(--bordure); padding: 40px; }
.connexion .marque { font-size: 26px; font-weight: bold; color: var(--rouge); letter-spacing: -.5px; }
.connexion .marque-sous { font-size: 15px; color: var(--texte-doux); margin-top: 6px; }
.connexion .trait { height: 3px; background: var(--rouge); width: 48px; margin: 26px 0 30px; }
.connexion .explication { width: 470px; padding-top: 8px; }
.connexion .pied {
  height: 54px; background: #fff; border-top: 1px solid var(--bordure);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #7A7A7A;
}

/* --- Recherche ------------------------------------------------------------- */
.barre-recherche { display: flex; gap: 12px; }
.barre-recherche input { border: 2px solid var(--rouge); height: 50px; font-size: 17px; }
.barre-recherche .bouton { height: 50px; }
.filtres { display: flex; gap: 10px; align-items: center; font-size: 13px; margin-top: 16px; flex-wrap: wrap; }
.filtres select { width: auto; height: 38px; font-size: 13px; }

.resultat { background: #fff; border: 1px solid var(--bordure); margin-bottom: 14px; }
.resultat-entete {
  padding: 15px 20px; border-bottom: 1px solid #ECECEC;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.resultat-entete .designation { font-size: 16px; font-weight: bold; }
.resultat-entete .reference { font-size: 13px; color: #6A6A6A; margin-top: 3px; }
.resultat-entete .meilleur { text-align: right; white-space: nowrap; }
.resultat-entete .meilleur .etiquette {
  font-size: 11px; color: #2A6B3E; text-transform: uppercase; letter-spacing: .6px;
}
.resultat-entete .meilleur .prix { font-size: 21px; font-weight: bold; color: var(--vert); }
.prix-bas { color: var(--vert); font-weight: bold; }
.prix-haut { color: var(--rouge-fonce); font-weight: bold; }
.badge-catalogue {
  background: var(--gris-bloc); padding: 2px 7px; font-size: 12px; color: #3A3A3A;
}

.vide { padding: 40px; text-align: center; color: var(--texte-doux); }
.erreur { background: var(--rose); border-left: 4px solid var(--rouge); padding: 14px 18px; font-size: 14px; }
