:root { --bleu: #1e40af; --gris: #6b7280; --fond: #f3f4f6; --rouge: #b91c1c; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px;
  padding-bottom: env(safe-area-inset-bottom);
}
.barre {
  position: sticky; top: 0; z-index: 10; background: var(--bleu); color: #fff;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
}
.barre h1 { margin: 0; font-size: 18px; }
.barre > :last-child { justify-self: end; }
.lien-discret { color: #fff; text-decoration: none; font-size: 15px; opacity: .9; }
main { max-width: 640px; margin: 0 auto; padding: 12px; }
.flash { background: #dcfce7; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.carte { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; }

label { display: block; font-size: 14px; color: var(--gris); margin-bottom: 12px; }
input[type=text], input[type=password], input[type=date], select {
  display: block; width: 100%; margin-top: 4px; padding: 11px; font-size: 16px;
  border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: #111827;
  -webkit-appearance: none; appearance: none; min-height: 46px;
}
.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-principal, .btn-danger {
  width: 100%; padding: 14px; font-size: 17px; font-weight: 600; border: 0; border-radius: 12px;
  background: var(--bleu); color: #fff; margin-top: 6px;
}
.btn-principal:disabled { opacity: .6; }
.btn-danger { background: #fff; color: var(--rouge); border: 1px solid var(--rouge); margin-top: 24px; }

.zone-photo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 140px; border: 2px dashed var(--bleu); border-radius: 12px; background: #fff;
  color: var(--bleu); font-size: 17px; font-weight: 600; padding: 12px; cursor: pointer;
}
.zone-photo img { max-width: 100%; max-height: 300px; border-radius: 8px; }

.groupe-cat { border: 0; padding: 0; margin: 0 0 10px; }
.groupe-cat legend { font-size: 13px; font-weight: 700; color: var(--gris); text-transform: uppercase; margin-bottom: 6px; }
.puce { display: inline-block; margin: 0 4px 6px 0; color: inherit; }
.puce input { position: absolute; opacity: 0; pointer-events: none; }
.puce span {
  display: inline-block; padding: 8px 12px; border-radius: 999px; background: #fff;
  border: 1px solid #d1d5db; font-size: 14px; color: #111827;
}
.puce input:checked + span { background: var(--bleu); border-color: var(--bleu); color: #fff; }

.filtres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filtres select { margin: 0; }
.totaux summary { cursor: pointer; }
.totaux table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.totaux td { padding: 6px 0; border-top: 1px solid #f0f0f0; }
.totaux .nb { color: var(--gris); text-align: center; }
.lien-export { display: block; margin-top: 10px; color: var(--bleu); }

.liste { list-style: none; padding: 0; margin: 0 0 90px; }
.separateur { font-size: 13px; font-weight: 700; color: var(--gris); margin: 14px 4px 6px; }
.recu {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px;
  padding: 8px; margin-bottom: 6px; color: inherit; text-decoration: none;
}
.recu img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: #e5e7eb; }
.recu .infos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recu small { color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.montant { font-weight: 600; white-space: nowrap; text-align: right; }
.vide { text-align: center; color: var(--gris); padding: 40px 0; }
.photo-detail { width: 100%; border-radius: 12px; margin-bottom: 12px; }

.fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 64px; height: 64px; border-radius: 50%; background: var(--bleu); color: #fff;
  font-size: 36px; line-height: 62px; text-align: center; text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
