:root {
  --encre: #1A1613;
  --encre-clair: #4A423A;
  --papier: #FAF8F5;
  --papier-creux: #F1EDE6;
  --filet: #D8D0C4;
  --or: #C9A227;
  --alerte: #A63228;
  --valide: #1E6B4A;
  --rayon: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--encre);
  background: var(--papier);
}

.chiffres {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- connexion */
.ecran-connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--encre);
}

.carte-connexion {
  width: 100%;
  max-width: 380px;
  background: var(--papier);
  border-radius: var(--rayon);
  padding: 40px 36px 36px;
  border-top: 4px solid var(--or);
}

.marque {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--encre-clair);
  margin: 0 0 4px;
}

.carte-connexion h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--encre);
  background: #fff;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  margin-bottom: 18px;
}

input:focus-visible,
button:focus-visible,
.bouton-fichier:focus-within {
  outline: 2px solid var(--or);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 600;
  color: var(--papier);
  background: var(--encre);
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  padding: 11px 20px;
  cursor: pointer;
}

button:hover { background: #2E2823; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.pleine-largeur { width: 100%; }

.message-erreur {
  background: #FBEDEC;
  border-left: 3px solid var(--alerte);
  color: var(--alerte);
  padding: 10px 14px;
  border-radius: var(--rayon);
  margin-bottom: 20px;
  font-size: 14px;
}

/* -------------------------------------------------------------- application */
.bandeau {
  background: var(--encre);
  color: var(--papier);
  padding: 14px 0;
  border-bottom: 3px solid var(--or);
}

.bandeau-contenu,
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

.bandeau-contenu {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bandeau strong { font-weight: 600; letter-spacing: -0.01em; }
.bandeau .marque { color: var(--or); margin: 0 0 2px; }

.bandeau form { display: inline; }

.lien-deconnexion {
  background: none;
  border: none;
  color: var(--papier);
  padding: 4px 0;
  font-size: 14px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lien-deconnexion:hover { background: none; color: var(--or); }

main { padding-top: 40px; padding-bottom: 64px; }

h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.explication {
  color: var(--encre-clair);
  margin: 0 0 24px;
  max-width: 62ch;
}

.zone-depot {
  border: 1px dashed var(--filet);
  border-radius: var(--rayon);
  background: var(--papier-creux);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.zone-depot.survol {
  border-color: var(--or);
  background: #FDF9EE;
}

.bouton-fichier {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.bouton-fichier input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.nom-fichier { color: var(--encre-clair); }

.resultat { margin-top: 36px; }

.compteur {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--encre);
}

.compteur .nombre {
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.liste-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}

.liste-codes li {
  background: #fff;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  padding: 3px 9px;
  font-size: 14px;
}

.rang {
  color: var(--encre-clair);
  margin-right: 7px;
  font-size: 12px;
}

.avis {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--or);
  background: var(--papier-creux);
  border-radius: var(--rayon);
  font-size: 15px;
}

.avis p { margin: 0 0 6px; }
.avis p:last-child { margin-bottom: 0; }
.avis strong { font-weight: 600; }

.a-suivre {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--filet);
  color: var(--encre-clair);
  font-size: 15px;
}

.invisible { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------ bilan Shopify */
.action-suivante { margin-top: 26px; }

.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0 4px;
}

.carte {
  background: #fff;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  padding: 14px 16px;
}

.carte .valeur {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: block;
}

.carte .titre { font-size: 14px; color: var(--encre-clair); }
.carte.attention { border-color: var(--alerte); background: #FBEDEC; }
.carte.attention .valeur { color: var(--alerte); }

.tableau {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 15px;
}

.tableau th {
  text-align: left;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid var(--encre);
}

.tableau td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--filet);
  vertical-align: top;
}

.tableau tr.probleme td { background: #FBEDEC; }
.tableau tr.attention td { background: #FDF6E3; }
.tableau .num { text-align: right; white-space: nowrap; }

.etiquette {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 20px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.etiquette.ok { color: var(--valide); }
.etiquette.ko { color: var(--alerte); }
.etiquette.note { color: #8A6D1F; }

.remarque { color: var(--encre-clair); font-size: 14px; }
