/* Appli de stock de Hkeyet Édition. Couleurs de la maison (papier, encre, orange du logo) et, pour les quatre stocks,
   une palette vérifiée pour les daltoniens (outil de validation du skill dataviz, écarts adjacents ≥ 11,8). */
:root {
  color-scheme: light;
  --papier: #f5f0e7;
  --surface: #fffdf8;
  --encre: #15120f;
  --texte-2: #675e53;
  --ligne: #e6decf;
  --ligne-forte: #cfc3b0;
  --orange: #e8691e;
  --orange-texte: #a4420b;
  --sur-orange: #1a0d04;
  --survol: #f1eadd;

  /* Les quatre stocks : toujours dans cet ordre (maison, dépôt, vendu, offerts). */
  --c-maison: #257de0;
  --c-depot: #f47230;
  --c-vendu: #00b894;
  --c-offert: #f2a600;

  /* États (jamais utilisés pour les stocks), toujours avec une icône et un texte. */
  --critique: #dc3c3d;
  --alerte: #fbb315;

  --rayon: 12px;
  --police: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --titres: 'Newsreader', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 15px/1.5 var(--police);
}
[lang='ar'] {
  font-family: 'IBM Plex Sans Arabic', var(--police);
}
a {
  color: var(--orange-texte);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--encre);
}
h1,
h2 {
  margin: 0;
  line-height: 1.2;
}
h1 {
  font: 600 clamp(1.6rem, 3vw, 2.1rem) / 1.15 var(--titres);
}
h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
main:focus {
  outline: none;
}

/* ───────── Barre du haut et menu ───────── */
.barre {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem clamp(0.75rem, 2vw, 1.5rem);
  background: var(--encre);
  color: var(--papier);
}
.marque {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--papier);
  text-decoration: none;
}
.marque img {
  height: 36px;
  width: auto;
  display: block;
}
.marque span {
  padding-inline-start: 0.65rem;
  border-inline-start: 1px solid #4a433b;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav {
  display: flex;
  gap: 0.2rem;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  color: #d9d0c1;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover {
  color: #fff;
  background: #2a2520;
}
.nav a[aria-current='page'] {
  color: #fff;
  background: #342d27;
}
.nav svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}
.nav a.nav-saisir {
  background: var(--orange);
  color: var(--sur-orange);
  font-weight: 600;
}
.nav a.nav-saisir:hover,
.nav a.nav-saisir[aria-current='page'] {
  background: #f27d36;
  color: var(--sur-orange);
}
.compte {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.qui-suis-je {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: end;
}
.qui-suis-je b {
  font-weight: 500;
}
.qui-suis-je small {
  color: #b9ae9d;
}
.reseau {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--alerte);
  color: var(--sur-orange);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ───────── Mise en page ───────── */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(0.75rem, 2.5vw, 1.75rem) 3rem;
}
.tete {
  margin-bottom: 1.25rem;
}
.tete-ligne {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.tete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sous {
  margin: 0.35rem 0 0;
  color: var(--texte-2);
}
.retour {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  text-decoration: none;
}
.carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 1.1rem clamp(0.9rem, 2vw, 1.4rem);
  margin-bottom: 1rem;
}
.carte-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.carte-tete h2 {
  margin: 0;
}
.carte-outils {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.carte-outils .recherche {
  width: 320px;
  max-width: 100%;
}
.carte-outils .bouton {
  flex: none;
}
.nav .court {
  display: none;
}
.deux {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
}
.deux > .carte {
  margin-bottom: 1rem;
}
.discret {
  color: var(--texte-2);
  font-size: 0.9rem;
}
.infos {
  margin: -0.5rem 0 1rem;
}
.chargement {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--texte-2);
}
.vide-page {
  padding: 3rem 0;
}

/* ───────── Boutons ───────── */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--ligne-forte);
  border-radius: 8px;
  background: var(--surface);
  color: var(--encre);
  font: 500 0.95rem/1.2 var(--police);
  text-decoration: none;
  cursor: pointer;
}
.bouton:hover {
  background: var(--survol);
  color: var(--encre);
}
.bouton.principal {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--sur-orange);
  font-weight: 600;
}
.bouton.principal:hover {
  background: #f27d36;
}
.bouton.danger {
  background: var(--critique);
  border-color: var(--critique);
  color: #fff;
}
.bouton.discret-b {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
}
.bouton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.lien {
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange-texte);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.lien.clair {
  color: var(--papier);
}

/* ───────── Tuiles et barres ───────── */
.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.tuile {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 0.85rem 1rem;
}
.tuile-l {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--texte-2);
  font-weight: 500;
}
.tuile-v {
  margin-top: 0.15rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.tuile-d {
  color: var(--texte-2);
  font-size: 0.85rem;
}
.pastille {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 0.4rem;
  vertical-align: 0.05em;
  background: var(--c);
}
.tuile-l .pastille,
.legende .pastille {
  margin-inline-end: 0;
}
.c-maison {
  --c: var(--c-maison);
}
.c-depot {
  --c: var(--c-depot);
}
.c-vendu {
  --c: var(--c-vendu);
}
.c-offert {
  --c: var(--c-offert);
}

/* Barre segmentée : 8 px aux bouts arrondis dans les tableaux, 28 px avec les parts en pourcentage en tête de page. */
.seg {
  display: flex;
  gap: 2px;
  height: 8px;
  min-width: 120px;
}
.seg-p {
  flex: 1 1 0;
  min-width: 3px;
  border-radius: 999px;
  background: var(--c);
}
.seg-vide {
  background: var(--ligne);
  border-radius: 999px;
}
.seg-grand {
  height: 28px;
}
.seg-grand .seg-p {
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: visible;
}
.seg-grand .seg-p b {
  padding-inline: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--encre);
}
.seg-grand .seg-p.c-maison b {
  color: #fff;
}
.seg-grand.seg-vide {
  border-radius: 4px;
}
.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.legende li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.equation {
  margin: 0.6rem 0 0;
  color: var(--texte-2);
  font-size: 0.92rem;
}
.equation b {
  color: var(--encre);
  font-variant-numeric: tabular-nums;
}

/* ───────── Tableaux ───────── */
.defile {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--ligne);
  text-align: start;
  vertical-align: top;
}
.table thead th {
  color: var(--texte-2);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom-color: var(--ligne-forte);
}
.table tbody tr:hover {
  background: #fbf7ef;
}
.table tfoot th,
.table tfoot td {
  border-top: 2px solid var(--ligne-forte);
  border-bottom: 0;
  font-weight: 600;
}
.table .n {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table .date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.col-livre {
  min-width: 200px;
}
.col-barre {
  min-width: 140px;
  vertical-align: middle !important;
}
.table .qui {
  color: var(--texte-2);
  white-space: nowrap;
}
.actions-ligne {
  white-space: nowrap;
  text-align: end !important;
}
.actions-ligne > * + * {
  margin-inline-start: 0.75rem;
}
.note {
  color: var(--texte-2);
  font-size: 0.85rem;
}
.eteint {
  opacity: 0.55;
}
.negatif {
  color: var(--critique);
  font-weight: 600;
}
.ligne-annulee {
  color: var(--texte-2);
}
.ligne-annulee .n,
.ligne-annulee .col-livre > a,
.ligne-annulee .date {
  text-decoration: line-through;
}
.resume {
  margin: 0 0 0.6rem;
  color: var(--texte-2);
}
.droits td:not(:first-child),
.droits th:not(:first-child) {
  text-align: center;
}

/* Étiquette d'opération : la pastille prend la couleur du stock vers lequel vont les livres. */
.type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #f1ebe0;
  font-size: 0.85rem;
  white-space: nowrap;
}
.type::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, #9a8f80);
}
.t-depot {
  --c: var(--c-depot);
}
.t-vente,
.t-venteDirecte {
  --c: var(--c-vendu);
}
.t-retour,
.t-tirage {
  --c: var(--c-maison);
}
.t-sortie {
  --c: var(--c-offert);
}
.puce-attente,
.puce-annule {
  display: inline-block;
  margin-inline-start: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  white-space: nowrap;
}
.puce-attente {
  border: 1px dashed var(--orange-texte);
  color: var(--orange-texte);
}
.puce-annule {
  background: #e9e3d8;
  color: var(--texte-2);
}

/* ───────── Alertes ───────── */
.alertes ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.alertes li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0;
}
.statut-icone {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}
.statut-critique .statut-icone {
  background: var(--critique);
  color: #fff;
}
.statut-alerte .statut-icone {
  background: var(--alerte);
  color: var(--sur-orange);
}
.demarrage ol {
  margin: 0;
  padding-inline-start: 1.3rem;
}
.demarrage li + li {
  margin-top: 0.35rem;
}
.liste-simple {
  margin: 0;
  padding: 0;
  list-style: none;
}
.liste-simple li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--ligne);
}
.liste-simple b {
  font-variant-numeric: tabular-nums;
}

/* ───────── Formulaires ───────── */
.formulaire h2 {
  margin-bottom: 1rem;
}
.champs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}
.champs .large {
  grid-column: 1 / -1;
}
.champs p {
  margin: -0.4rem 0 0;
}
label > span {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}
label > small {
  display: block;
  margin-top: 0.25rem;
  color: var(--texte-2);
  font-size: 0.82rem;
}
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ligne-forte);
  border-radius: 8px;
  background: #fff;
  color: var(--encre);
  font: 400 1rem/1.3 var(--police);
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--orange);
  outline-offset: 0;
  border-color: var(--orange);
}
label.case {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 400;
}
label.case input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--orange);
}
.erreur {
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #fbe9e7;
  color: #9b1c1c;
  white-space: pre-line;
}
.boutons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.lignes {
  border-top: 1px solid var(--ligne);
  margin-bottom: 0.75rem;
}
.ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--ligne);
}
.l-livre {
  flex: 1 1 280px;
}
.l-q {
  flex: 0 0 110px;
}
.l-prix {
  flex: 0 0 140px;
}
.l-dispo {
  flex: 0 0 auto;
  min-width: 130px;
  align-self: center;
  padding-top: 1.3rem;
  color: var(--texte-2);
  font-size: 0.9rem;
}
.l-suppr {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ligne-forte);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte-2);
  font-size: 1.3rem;
  cursor: pointer;
}
.l-suppr:hover {
  background: var(--survol);
  color: var(--encre);
}
.saisie-table input {
  width: 110px;
}
.saisie-table td {
  vertical-align: middle;
}
.info-correction {
  margin: -0.25rem 0 1rem;
}
.filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.filtres label:not(.case) {
  flex: 1 1 150px;
  max-width: 260px;
}
.filtres label.case {
  min-height: 42px;
}
.filtres > .lien {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}
.recherche {
  width: min(340px, 100%);
}

/* ───────── Menu de saisie ───────── */
.menu-saisie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.choix {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.15rem 0.55rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  color: var(--encre);
  text-decoration: none;
}
.choix:hover {
  border-color: var(--orange);
  color: var(--encre);
}
.choix .pastille {
  width: 12px;
  height: 12px;
  margin: 0;
}
.choix span {
  grid-column: 2;
  color: var(--texte-2);
  font-size: 0.9rem;
}

/* ───────── Connexion ───────── */
.connexion {
  max-width: 440px;
  margin: 8vh auto 0;
  padding: 2.2rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 16px;
  text-align: center;
}
.connexion img {
  width: 200px;
  height: auto;
}
.connexion h1 {
  margin: 0.75rem 0 0.5rem;
}
.connexion p {
  color: var(--texte-2);
}
.connexion .bouton {
  margin-top: 0.5rem;
}
/* Séparateur « ou » entre Google et le lien par e-mail */
.connexion .ou {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
  font-size: 0.85rem;
}
.connexion .ou::before,
.connexion .ou::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--ligne);
}
.connexion .form-lien {
  text-align: start;
}
.connexion .form-lien .bouton {
  width: 100%;
}
.connexion .form-lien + .lien {
  margin-top: 1rem;
}
.connexion .envoye {
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--survol);
  text-align: start;
}
.connexion .envoye p {
  margin: 0.25rem 0;
  color: var(--encre);
}

/* ───────── Messages ───────── */
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 1.25rem;
  z-index: 50;
  width: max-content;
  max-width: min(92vw, 560px);
  margin: 0 auto;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  background: var(--encre);
  color: var(--papier);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.2);
}
.toast[data-genre='erreur'] {
  background: #9b1c1c;
  color: #fff;
}
.toast[data-genre='info'] {
  background: #3d3329;
}
.dialogue {
  width: min(92vw, 470px);
  padding: 1.4rem 1.5rem;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--encre);
}
.dialogue::backdrop {
  background: rgb(21 18 15 / 0.5);
}
.dialogue p {
  white-space: pre-line;
  color: var(--texte-2);
}
.champ-dialogue {
  display: block;
  margin-bottom: 1rem;
}
.dialogue .boutons {
  justify-content: flex-end;
}

/* ───────── Documents à imprimer (bons, état du dépôt) ───────── */
.barre-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto 1rem;
}
.barre-doc .retour {
  margin: 0;
}
.document {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  background: #fff;
  border: 1px solid var(--ligne);
  border-radius: 6px;
}
.doc-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid var(--encre);
}
.doc-tete img {
  width: 150px;
  height: auto;
}
.doc-tete div {
  text-align: end;
}
.doc-tete p {
  margin: 0.25rem 0 0;
  color: var(--texte-2);
}
.doc-bloc {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.doc-l {
  min-width: 80px;
  color: var(--texte-2);
}
.table.doc tbody tr:hover {
  background: none;
}
.case-vide {
  min-width: 70px;
  border: 1px solid #bbb !important;
}
.signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 3.5rem;
}
.signatures div {
  padding-top: 0.5rem;
  border-top: 1px solid var(--encre);
}
.signatures span {
  color: var(--texte-2);
  font-size: 0.85rem;
}
.doc-pied {
  margin-top: 2rem;
  color: var(--texte-2);
  font-size: 0.8rem;
}
.bandeau-annule {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: #fbe9e7;
  color: #9b1c1c;
}

@page {
  size: A4;
  margin: 14mm;
}
@media print {
  body {
    background: #fff;
    font-size: 12px;
  }
  .pas-imprime,
  .barre,
  .toast {
    display: none !important;
  }
  .page {
    padding: 0;
    max-width: none;
  }
  .document {
    border: 0;
    padding: 0;
    max-width: none;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}

/* ───────── Téléphone : menu en bas de l'écran ───────── */
@media (max-width: 860px) {
  body.connecte {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
  .nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 30;
    justify-content: space-around;
    gap: 0;
    padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom));
    background: var(--encre);
    border-top: 1px solid #2f2a25;
  }
  .nav a {
    flex: 1 1 0;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.68rem;
    min-width: 0;
  }
  .nav a span {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .nav svg {
    width: 22px;
    height: 22px;
  }
  .qui-suis-je small {
    display: none;
  }
  .deux {
    grid-template-columns: 1fr;
  }
  .champs {
    grid-template-columns: 1fr;
  }
  .table th,
  .table td {
    padding: 0.5rem 0.45rem;
  }
  .tete-actions .bouton {
    flex: 1 1 auto;
  }
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}
/* Tableaux empilés sur téléphone : une carte par livre ou par opération, sans défilement de côté. */
@media (max-width: 640px) {
  .nav .long {
    display: none;
  }
  .nav .court {
    display: inline;
  }
  .stock thead,
  .journal thead {
    display: none;
  }
  .stock tr {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.15rem 0.4rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--ligne);
  }
  .stock th,
  .stock td {
    padding: 0;
    border: 0 !important;
  }
  .stock .col-livre,
  .stock tfoot th {
    grid-column: 1 / -1;
    min-width: 0;
    margin-bottom: 0.3rem;
  }
  .stock td.n {
    text-align: start;
  }
  .stock td.n::before {
    content: attr(data-l);
    display: block;
    color: var(--texte-2);
    font-size: 0.72rem;
    font-weight: 400;
  }
  .stock .col-barre {
    grid-column: 1 / -1;
    padding-top: 0.45rem;
  }
  .stock td:empty {
    display: none;
  }
  .stock tfoot tr {
    border-top: 2px solid var(--ligne-forte);
  }
  .journal tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'date type qte'
      'livre livre livre'
      'ou ou montant'
      'qui qui actions';
    column-gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--ligne);
  }
  .journal td {
    padding: 0.1rem 0;
    border: 0;
  }
  .journal td:empty {
    display: none;
  }
  .journal .date {
    grid-area: date;
  }
  .journal .type-c {
    grid-area: type;
  }
  .journal .qte {
    grid-area: qte;
    font-weight: 600;
  }
  .journal .col-livre {
    grid-area: livre;
    min-width: 0;
  }
  .journal .ou {
    grid-area: ou;
  }
  .journal .montant {
    grid-area: montant;
  }
  .journal .qui {
    grid-area: qui;
    font-size: 0.85rem;
    white-space: normal;
  }
  .journal .actions-ligne {
    grid-area: actions;
  }
}

@media (max-width: 520px) {
  .marque span {
    display: none;
  }
  .qui-suis-je {
    display: none;
  }
  .tuiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tuile:first-child {
    grid-column: 1 / -1;
  }
}
