/* Charte graphique Cycles Blain v1.1 — noir et blanc, un seul accent tomette. */

@font-face {
  font-family: "Inter";
  src: url("../polices/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("../polices/inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blanc: #FFFFFF;
  --fond: #FBFBFA;
  --fond-2: #F5F5F3;
  --filet: #DADAD7;
  --texte: #111111;
  --texte-2: #3A3A3A;
  --texte-3: #5C5C5C;
  --accent: #B5523B;
  --accent-survol: #9A4532;
  /* Prix d'achat : vert = facture trouvée, orange = prix provisoire (demande de Thibaut, 24/11). */
  --vert: #2F7D4F;
  --vert-fond: #EDF6F0;
  --orange: #B86B00;
  --orange-fond: #FFF4E5;

  --rayon-photo: 4px;
  --rayon-etiquette: 6px;
  --rayon: 8px;

  --largeur: 1080px;
  --marge: 16px;
  --hauteur-menu: 60px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  margin: 0;
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-weight: 500;
  color: var(--texte);
  text-wrap: balance;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--texte);
  outline-offset: 2px;
}

.icone {
  flex: none;
}

/* En-tête et menu */

.entete {
  background: var(--blanc);
  border-bottom: 1px solid var(--filet);
}

.entete-contenu {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 var(--marge);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.marque {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.marque-nom {
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.marque-appli {
  font-size: 14px;
  color: var(--texte-3);
}

/* Téléphone : menu fixé en bas de l'écran, à portée de pouce. */
.menu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--blanc);
  border-top: 1px solid var(--filet);
  padding-bottom: env(safe-area-inset-bottom);
}

.menu-lien {
  min-height: var(--hauteur-menu);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  color: var(--texte-3);
  text-decoration: none;
  white-space: nowrap;
  border-top: 2px solid transparent;
  margin-top: -1px;
}

.menu-lien[aria-current="page"] {
  color: var(--texte);
  border-top-color: var(--texte);
}

.menu-long {
  display: none;
}

/* Compte connecté et déconnexion */

.compte {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.compte-nom {
  display: none;
  font-size: 14px;
  color: var(--texte-3);
  white-space: nowrap;
}

.compte-sortie {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: var(--rayon);
  background: none;
  color: var(--texte-3);
  cursor: pointer;
}

.compte-sortie:hover {
  background: var(--fond-2);
  color: var(--texte);
}

/* Page */

.etroit {
  max-width: 420px;
}

.sans-menu .page {
  padding-bottom: 48px;
}

.etroit > .carte {
  margin-top: 24px;
}

.page {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 28px var(--marge) calc(var(--hauteur-menu) + env(safe-area-inset-bottom) + 32px);
}

.chapo {
  margin-top: 8px;
  color: var(--texte-2);
}

.note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--texte-3);
}

.bloc {
  margin-top: 40px;
}

.etat-stock {
  margin-top: 32px;
}

.bloc > h2 {
  margin-bottom: 12px;
}

h1 + .carte {
  margin-top: 20px;
}

/* Boutons */

.actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: var(--blanc);
  color: var(--texte);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.bouton:hover:not(:disabled) {
  background: var(--fond-2);
}

.bouton-principal {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--blanc);
}

.bouton-principal:hover:not(:disabled) {
  border-color: var(--accent-survol);
  background: var(--accent-survol);
}

.bouton-grand {
  min-height: 64px;
  font-size: 17px;
}

.bouton:disabled {
  cursor: default;
}

/* Cartes */

.carte {
  background: var(--blanc);
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  padding: 20px;
}

.carte-vide {
  color: var(--texte-3);
}

/* Envoi des photos */

.invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

label.bouton:focus-within {
  outline: 2px solid var(--texte);
  outline-offset: 2px;
}

.occupe {
  opacity: 0.55;
  pointer-events: none;
}

.bouton-petit {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.cle {
  color: var(--accent);
  font-weight: 400;
}

.discret {
  color: var(--texte-3);
  font-size: 14px;
}

.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.retour {
  margin-bottom: 12px;
  font-size: 14px;
}

.retour a {
  color: var(--texte-3);
  text-decoration: none;
}

.retour a:hover {
  color: var(--texte);
}

/* Listes de cartes */

.liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carte-lien {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px;
  text-decoration: none;
}

.carte-lien:hover {
  background: var(--fond-2);
}

.carte-titre {
  color: var(--texte);
}

.carte-detail {
  font-size: 14px;
  color: var(--texte-3);
}

.compteurs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--texte-2);
}

/* Une étiquette lue */

.etiquette {
  display: flex;
  gap: 14px;
  padding: 12px;
}

.etiquette-photo {
  flex: none;
}

.etiquette-photo img {
  display: block;
  width: 84px;
  height: 112px;
  object-fit: cover;
  border-radius: var(--rayon-photo);
  background: var(--fond-2);
}

.etiquette-texte {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.etiquette-titre {
  color: var(--texte);
}

.etiquette-champs {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.etiquette-champs div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}

.etiquette-champs dt {
  color: var(--texte-3);
}

.etiquette-champs dd {
  margin: 0;
  color: var(--texte);
  overflow-wrap: anywhere;
}

.etiquette-motif {
  font-size: 14px;
  color: var(--texte-2);
}

.pastille {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--filet);
  border-radius: var(--rayon-etiquette);
  background: var(--fond);
  font-size: 13px;
  color: var(--texte-2);
  white-space: nowrap;
}

.pastilles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rapprochement {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.etiquette-motif a {
  color: inherit;
}

.pastille-cle {
  border-color: var(--accent);
  background: var(--blanc);
  color: var(--accent);
}

/* Détail d'une étiquette */

.detail {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--rayon-photo);
  background: var(--fond-2);
}

.detail-lecture > h2 {
  margin-bottom: 12px;
}

.sous-titre {
  margin-top: 28px;
}

.detail-actions {
  margin-top: 24px;
}

.tableau-defilant {
  overflow-x: auto;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: var(--blanc);
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tableau th,
.tableau td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--filet);
}

.tableau thead th,
.tableau tbody th {
  font-weight: 400;
  color: var(--texte-3);
  white-space: nowrap;
}

.tableau tbody tr:last-child > * {
  border-bottom: 0;
}

.tableau tr:has(+ .ligne-motif) > * {
  border-bottom: 0;
}

.ligne-motif td {
  padding-top: 0;
  color: var(--texte-2);
}

.codes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

/* Validation et saisie dans G8 */

.suite {
  margin-bottom: 12px;
}

.onglets {
  display: flex;
  gap: 4px;
  margin: 8px 0 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--filet);
}

.onglets a {
  padding: 8px 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  color: var(--texte-3);
  text-decoration: none;
  white-space: nowrap;
}

.onglets a[aria-current="true"] {
  color: var(--texte);
  border-bottom-color: var(--texte);
}

.champ {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: var(--blanc);
  color: var(--texte);
  font: inherit;
  font-size: 15px;
}

.champ:focus {
  outline: 2px solid var(--texte);
  outline-offset: 0;
  border-color: var(--texte);
}

.tableau-velos td,
.tableau-saisie td {
  vertical-align: middle;
}

.tableau-velos .champ {
  min-width: 150px;
}

/* Le tableau de validation a besoin de toute la largeur de l'écran. */
.page:has(.tableau-velos) {
  max-width: none;
  padding-left: 16px;
  padding-right: 16px;
}

.vignette {
  display: block;
  width: 42px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--rayon-photo);
  background: var(--fond-2);
}

.nombre {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tableau th.nombre,
.tableau td.nombre {
  text-align: right;
}

.cellule-etat {
  min-width: 190px;
}

.cellule-etat .etiquette-motif {
  margin-top: 6px;
  font-size: 13px;
}

.cellule-actions {
  white-space: nowrap;
}

.cellule-actions form {
  display: inline-block;
  margin: 2px 0;
}

.ligne-retiree td {
  color: var(--texte-3);
  background: var(--fond);
}

.formulaire {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.formulaire label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--texte-3);
}

.liste-cases,
.liste-simple {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.liste-simple {
  margin-bottom: 0;
  font-size: 14px;
}

.case {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.case input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: var(--texte);
}

.case-detail {
  display: block;
  font-size: 14px;
  color: var(--texte-3);
}

.suite-validation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.cellule-prix .pastille {
  margin-left: 6px;
  text-decoration: none;
}

.ligne-batterie td {
  background: var(--fond);
  font-size: 13px;
  color: var(--texte-2);
}

.champ-fichier {
  padding: 8px 10px;
  height: auto;
}

.tableau a {
  color: inherit;
}

/* Copie d'un clic */

.copier {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--filet);
  border-radius: var(--rayon-etiquette);
  background: var(--blanc);
  color: var(--texte);
  font: inherit;
  font-size: 15px;
  cursor: copy;
}

.copier:hover {
  background: var(--fond-2);
}

.copier.copie {
  background: var(--fond-2);
  color: var(--texte-3);
}

.copier.vient-d-etre-copie {
  border-color: var(--texte);
  color: var(--texte);
}

.champ-copie {
  display: flex;
  align-items: center;
  gap: 6px;
}




.copier.vient-d-etre-copie::after {
  content: "copié";
  margin-left: 8px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--texte-3);
}

.copier.copie-impossible::after {
  content: "copie impossible";
  margin-left: 8px;
  font-size: 12px;
  color: var(--accent);
}

/* Bouton copier à icône : la coche remplace l'icône un instant après la copie. */
.copier-icone {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--rayon);
  background: none;
  color: var(--texte-3);
  cursor: copy;
  transition: background-color 120ms ease, color 120ms ease;
}

.copier-icone:hover {
  background: var(--fond-2);
  color: var(--texte);
}

.copier-icone .icone-copie,
.copier-icone.vient-d-etre-copie .icone-copier {
  display: none;
}

.copier-icone.vient-d-etre-copie .icone-copie {
  display: inline-flex;
  color: var(--vert);
}

.copier-icone.copie-impossible {
  color: var(--accent);
}

.copier-icone span {
  display: inline-flex;
}

.champ-copie-texte {
  gap: 2px;
}

.champ-copie-texte > span:first-child {
  flex: 1;
  min-width: 200px;
}

/* Prix d'achat : vert si la facture est trouvée, orange sinon. */
.prix-facture,
.prix-facture a {
  color: var(--vert);
}

.prix-provisoire {
  color: var(--orange);
}

.copier.prix-facture {
  border-color: var(--vert);
  background: var(--vert-fond);
}

.copier.prix-provisoire {
  border-color: var(--orange);
  background: var(--orange-fond);
}

.pastille-vert {
  border-color: var(--vert);
  background: var(--vert-fond);
  color: var(--vert);
  text-decoration: none;
}

.pastille-orange {
  border-color: var(--orange);
  background: var(--orange-fond);
  color: var(--orange);
}

/* Ordinateur : menu dans l'en-tête, boutons côte à côte. */
@media (min-width: 800px) {
  :root {
    --marge: 32px;
  }

  .entete-contenu {
    min-height: 64px;
  }

  .menu {
    position: static;
    display: flex;
    gap: 4px;
    border-top: 0;
    padding-bottom: 0;
    align-self: stretch;
  }

  .menu-lien {
    min-height: 0;
    flex-direction: row;
    gap: 8px;
    padding: 0 14px;
    font-size: 15px;
    border-top: 0;
    border-bottom: 2px solid transparent;
    margin-top: 0;
    margin-bottom: -1px;
  }

  .menu-lien:hover {
    color: var(--texte);
  }

  .menu-lien[aria-current="page"] {
    border-bottom-color: var(--texte);
  }

  .menu-long {
    display: inline;
  }

  .menu-court {
    display: none;
  }

  .compte-nom {
    display: inline;
  }

  .page {
    padding-top: 48px;
    padding-bottom: 64px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 22px;
  }

  .actions {
    flex-direction: row;
  }

  .bouton-grand {
    min-width: 280px;
  }

  .formulaire {
    grid-template-columns: repeat(5, 1fr) auto;
  }

  .detail {
    flex-direction: row;
    align-items: flex-start;
  }

  .detail-photo {
    flex: 0 0 38%;
  }

  .detail-lecture {
    flex: 1;
    min-width: 0;
  }

  .etiquette-photo img {
    width: 96px;
    height: 128px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bouton {
    transition: none;
  }
}

.cellule-prix .copier-icone {
  vertical-align: middle;
  margin-left: 2px;
}

/* Case déjà copiée : verte ; référence, n° de série et prix copiés : toute la ligne verte. */
td.case-copiee,
tr.ligne-copiee td {
  background: var(--vert-fond);
}

td.case-copiee .champ {
  border-color: var(--vert);
}
