:root {
  --bleu: #1f4e79;
  --bleu-clair: #e8f0f8;
  --texte: #1c2430;
  --gris: #5b6675;
  --fond: #f4f6f9;
  --carte: #ffffff;
  --vert: #1e7b46;
  --rouge: #b42318;
  --rayon: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
}

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bleu);
  color: #fff;
}

.entete { flex-wrap: wrap; gap: 8px 16px; }
.entete form { margin: 0; }
.navigation { display: flex; gap: 16px; margin-left: auto; }
.navigation a { color: #fff; text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
.navigation a[aria-current="page"] { border-bottom-color: #fff; font-weight: 700; }
.marque { color: #fff; font-weight: 700; text-decoration: none; }

.contenu { max-width: 720px; margin: 0 auto; padding: 16px; }

.carte {
  background: var(--carte);
  border-radius: var(--rayon);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.centre { text-align: center; }

h1, h2 { margin-top: 0; }
h2 { font-size: 1.15rem; }

.bouton-principal,
.bouton-secondaire {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 16px;
  border-radius: var(--rayon);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bouton-principal { background: var(--bleu); color: #fff; border: none; }
.bouton-secondaire { background: var(--bleu-clair); color: var(--bleu); border: 1px solid var(--bleu); margin-top: 12px; }
.bouton-principal:focus-within, .bouton-principal:hover { filter: brightness(1.1); }

.lien { background: none; border: none; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; }

.masque { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.depot { border: 2px dashed transparent; border-radius: var(--rayon); }
.depot.survol { border-color: var(--bleu); background: var(--bleu-clair); }

.aide { color: var(--gris); font-size: 0.95rem; }

.htmx-indicator { display: none; color: var(--gris); }
.depot.en-cours .bouton-principal { opacity: 0.6; cursor: progress; }
.htmx-request.htmx-indicator { display: block; }

.resultats { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; }
.resultats li { padding: 6px 0; }
.ok { color: var(--vert); }
.info { color: var(--gris); }
.erreur { color: var(--rouge); }

.alerte { padding: 12px; border-radius: 8px; background: #fdecea; }
.grand { font-size: 1.5rem; font-weight: 700; margin: 8px 0 16px; }

.liste-documents { list-style: none; padding: 0; margin: 0; }
.liste-documents li + li { border-top: 1px solid #e5e9ef; }
.liste-documents a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 12px 4px;
  color: inherit;
  text-decoration: none;
}
.liste-documents a:hover { background: var(--bleu-clair); }
.type {
  grid-row: span 2;
  align-self: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bleu-clair);
  color: var(--bleu);
  font-size: 0.8rem;
  font-weight: 700;
}
.nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ligne avec bouton « Retirer » / « Remettre » / « Annuler ». */
.liste-documents li.avec-action { display: flex; align-items: center; gap: 8px; }
.liste-documents li.avec-action > a { flex: 1; min-width: 0; }
.liste-documents li.retire { padding: 12px 4px; color: var(--gris); }
.liste-documents li.retire .nom { flex: 1; white-space: normal; }
.action-document { margin: 0; }
.bouton-discret {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #c9d2dd;
  border-radius: 8px;
  background: none;
  color: var(--gris);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.bouton-discret:hover, .bouton-discret:focus-visible { color: var(--bleu); border-color: var(--bleu); }
.bouton-discret:disabled { opacity: 0.5; cursor: progress; }
.liste-documents li.action-erreur { display: block; padding: 8px 4px; }
.retires { margin-top: 16px; }
.retires summary { cursor: pointer; color: var(--gris); padding: 8px 0; }
.meta { color: var(--gris); font-size: 0.85rem; }

.tableau-defilant { overflow-x: auto; }
.mouvements { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.mouvements th, .mouvements td { padding: 8px 6px; border-bottom: 1px solid #e5e9ef; vertical-align: top; text-align: left; }
.mouvements .montant { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Téléphone : menu sur sa propre ligne, colonne Solde masquée dans le détail d'un relevé. */
.mouvements .telephone { display: none; }

@media (max-width: 600px) {
  .navigation { order: 3; width: 100%; margin-left: 0; }
  .mouvements .solde, .mouvements .ordinateur { display: none; }
  .mouvements .telephone { display: table-cell; }
  .mouvements th, .mouvements td { padding: 6px 4px; }
  .mouvements td:nth-child(2) { overflow-wrap: anywhere; }
  .mouvements td:first-child { white-space: nowrap; font-size: 0.8rem; }
  .liste-documents .nom { white-space: normal; overflow-wrap: anywhere; }
}
