/* IvoireSogo : espace fermier (accès par lien, sans compte) */
.fermier-page { min-height: 100vh; background: var(--paper); }
.fermier-topbar {
  background-color: var(--forest);
  background-image: var(--motif);
  background-size: 44px 44px;
  padding: 1.1rem 0 1.4rem;
}
.fermier-topbar .brand { color: #fff; }
.fermier-topbar__inner { width: min(100% - 2rem, 40rem); margin-inline: auto; }
.fermier-wrap { width: min(100% - 2rem, 40rem); margin: -0.6rem auto 3rem; }

.fermier-card {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.fermier-card h1 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.fermier-card h2 { font-size: 1.05rem; margin-bottom: 0.7rem; }
.fermier-hello { color: var(--slate); margin-bottom: 0; }

.due-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.1rem;
  border-radius: 10px;
  background: var(--kola-soft);
  border: 1px solid var(--tag);
}
.due-box--clear { background: var(--ok-soft); border-color: #b9dfc3; }
.due-box__label { margin: 0 0 0.2rem; color: var(--kola-ink); font-weight: 600; }
.due-box--clear .due-box__label { color: var(--ok-ink); }
.due-box__amount { margin: 0; font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--ink); }
.due-box__count { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--slate); }

.pay-btn { width: 100%; min-height: 52px; font-size: 1.05rem; }

.history-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.history-table th, .history-table td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); }
.history-table th { color: var(--slate); font-weight: 600; }
.history-empty { color: var(--slate); font-size: 0.92rem; }

.manual-instructions {
  padding: 1rem 1.1rem;
  background: var(--palm-soft);
  border-radius: 10px;
  font-size: 0.95rem;
}

/* ---- Espace fermier : animaux et suivi ---- */
.fermier-nav { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.animal-list { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.animal-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem; border: 1px solid rgba(0,0,0,0.1); border-radius: 12px; color: inherit; text-decoration: none; }
.animal-row__thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.animal-row__main { display: grid; gap: 0.15rem; flex: 1; min-width: 0; }
.animal-row__sub { font-size: 0.9rem; opacity: 0.75; }
.tag { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.tag--wait { background: #fdecea; color: #a12a1f; }
.tag--ok { background: #e3f4e6; color: #1d6b32; }
.animal-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin: 0.6rem 0; }
.animal-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0.8rem 0 0; }
.animal-facts dt { font-weight: 600; }
.animal-facts dd { margin: 0; }
.fermier-form { display: grid; gap: 1rem; }
.fermier-form textarea { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid rgba(0,0,0,0.2); border-radius: 10px; font: inherit; }

/* ---- Comptes marchands (Orange Money, MTN Money, Wave) ---- */
.account-list { display: grid; gap: 0.8rem; margin: 1rem 0; }
.account { display: grid; gap: 0.25rem; padding: 0.9rem 1rem; border: 1px solid rgba(0,0,0,0.12); border-radius: 12px; }
.account__name { font-size: 1.1rem; }
.account__num { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.02em; }
.account__holder { opacity: 0.75; font-size: 0.92rem; }

.animal-row--order { flex-wrap: wrap; }
.order-actions { display: flex; gap: 0.5rem; }

/* ---- Menu de l'espace fermier ---- */
.fermier-topbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; }
.fermier-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; }
.fermier-menu a { color: inherit; text-decoration: none; font-weight: 600; }
.fermier-menu a:hover { text-decoration: underline; }
.fermier-menu form { margin: 0; }
.fermier-menu__logout { padding: 0.3rem 0.9rem; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }

.buyer-phone { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }

/* ---- Menu lisible sur le bandeau vert, et messages sans chevauchement ---- */
.fermier-menu a { color: #f4f6f2; }
.fermier-menu__logout { color: #f4f6f2; border-color: rgba(244, 246, 242, 0.7); }
.fermier-menu__logout:hover { background: rgba(244, 246, 242, 0.12); }
.fermier-wrap > .alert { margin-top: 1rem; }

/* ---- Boutons compacts (la classe .btn--small n'existait pas : tous les boutons faisaient 46 px) ---- */
.btn--small { min-height: 2.5rem; padding: 0.35rem 0.85rem; font-size: 0.92rem; }

/* ---- Commande en attente : titre à gauche, boutons à droite, au même niveau ---- */
.order-card { display: grid; gap: 0.4rem; padding: 0.8rem; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 12px; }
.order-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.7rem; }
.order-card__title { flex: 1; min-width: 0; padding-top: 0.45rem; font-size: 1.02rem; line-height: 1.25; overflow-wrap: break-word; }
.order-actions { display: flex; flex-direction: column; flex: none; gap: 0.35rem; width: 6.6rem; }
.order-actions form { margin: 0; }
.order-actions .btn { width: 100%; white-space: nowrap; }

/* ---- Paiement mobile money (SasPay) ---- */
.net-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0; padding: 0; border: 0; }
.net-choices legend { grid-column: 1 / -1; padding: 0; margin-bottom: 0.1rem; }
.net-choice { position: relative; cursor: pointer; }
.net-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.net-choice span { display: block; padding: 0.85rem 0.6rem; text-align: center; font-weight: 700; background: #fff; border: 2px solid #cbd6ce; border-radius: 12px; transition: border-color 0.15s, background 0.15s; }
.net-choice input:checked + span { border-color: var(--palm); background: var(--ok-soft); color: var(--ok-ink); }
.net-choice input:focus-visible + span { outline: 3px solid var(--tag); outline-offset: 2px; }

.attente { text-align: center; }
.attente__spinner { width: 3rem; height: 3rem; margin: 0.4rem auto 1rem; border: 4px solid #d9e1db; border-top-color: var(--palm); border-radius: 50%; animation: attente-spin 0.9s linear infinite; }
.attente__montant { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 700; }
@keyframes attente-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .attente__spinner { animation-duration: 3s; } }
