:root {
  --vert-fonce: #16342A;
  --vert-moyen: #1F4436;
  --or: #B08D57;
  --or-clair: #d9c3a3;
  --fond: #f4f2ec;
  --texte: #23291f;
  --gris: #6b6b63;
  --danger: #8a3324;
  --danger-fond: #f6e7e3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: var(--vert-fonce);
  margin: 0 0 .6rem;
}

header {
  background: var(--vert-fonce);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
header h1 { color: #fff; font-size: 1.3rem; margin: 0; }
header a { color: var(--or-clair); text-decoration: none; font-size: .95rem; }
header a:hover { text-decoration: underline; }

main {
  max-width: 780px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem;
}

.carte {
  background: #fff;
  border: 1px solid #e3ded2;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

button, .bouton {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: .7rem 1.2rem;
  background: var(--vert-moyen);
  color: #fff;
  transition: background .15s ease;
}
button:hover, .bouton:hover { background: var(--vert-fonce); }
button.secondaire { background: transparent; color: var(--vert-moyen); border: 1px solid var(--vert-moyen); }
button.secondaire:hover { background: #eef0ea; }
button:disabled { opacity: .55; cursor: progress; }

.bouton-geant {
  display: block;
  width: 100%;
  font-size: 1.35rem;
  padding: 1.6rem;
  background: var(--or);
  font-family: Georgia, serif;
}
.bouton-geant:hover { background: #9c7a45; }

label { display: block; font-weight: 600; margin: .9rem 0 .25rem; color: var(--vert-fonce); }

input[type="text"], input[type="password"], input[type="date"], textarea, input[type="search"] {
  width: 100%;
  font: inherit;
  padding: .55rem .65rem;
  border: 1px solid #cfc9ba;
  border-radius: 7px;
  background: #fffef9;
}
textarea { min-height: 160px; resize: vertical; white-space: pre-wrap; }

.champ-hint { font-size: .85rem; color: var(--gris); margin-top: .2rem; }

.bandeau {
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.bandeau.avert { background: var(--danger-fond); color: var(--danger); border: 1px solid #e0b8ae; }
.bandeau.ok { background: #e6efe6; color: var(--vert-fonce); border: 1px solid #b9d3b9; }

.apercu {
  max-width: 100%;
  max-height: 340px;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: block;
  margin: .5rem 0 1rem;
}

.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }

.spinner {
  display: inline-block;
  width: 1.1em; height: 1.1em;
  border: 3px solid #ffffff66;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -.2em;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ─── Historique ─── */
.filtres { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .6rem; align-items: end; }
.filtres .large { grid-column: 1 / -1; }
@media (max-width: 640px) { .filtres { grid-template-columns: 1fr 1fr; } }

.liste-colis { list-style: none; margin: 0; padding: 0; }
.item-colis {
  display: flex;
  gap: .9rem;
  padding: .8rem;
  border: 1px solid #e3ded2;
  border-radius: 9px;
  background: #fff;
  margin-bottom: .7rem;
  cursor: pointer;
  align-items: flex-start;
}
.item-colis:hover { border-color: var(--or); }
.item-colis img {
  width: 84px; height: 84px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
  flex-shrink: 0;
}
.item-colis .meta { min-width: 0; }
.item-colis .date { font-size: .85rem; color: var(--gris); }
.item-colis .noms { font-weight: 600; margin: .15rem 0; }
.item-colis .extrait {
  font-size: .88rem; color: #555;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-wrap;
}
.badge-corrige {
  display: inline-block; font-size: .72rem; color: var(--or);
  border: 1px solid var(--or); border-radius: 4px; padding: 0 .35rem; margin-left: .4rem;
}
.badge-transp {
  display: inline-block; font-size: .72rem; color: #fff; background: var(--vert-moyen);
  border-radius: 4px; padding: 0 .4rem; margin-left: .4rem; font-weight: 600;
}
select {
  width: 100%; font: inherit; padding: .55rem .65rem;
  border: 1px solid #cfc9ba; border-radius: 7px; background: #fffef9;
}

.detail-photo { width: 100%; border-radius: 8px; border: 1px solid #ddd; margin-bottom: 1rem; }

.vide { color: var(--gris); text-align: center; padding: 2rem 0; }
