/* =====================================================================
   IvoireSogo : habillage lumineux de l'administration et de l'espace fermier.
   Même ciel que le site public : lever du soleil et bleu clair.
   Se charge APRÈS les autres feuilles : pour revenir à l'ancien aspect,
   retirer sa ligne dans admin_header.php et fermier_header.php.
   ===================================================================== */
:root {
  --ciel-haut: #e6f6ee; --ciel-mi: #f5f8dc; --ciel-bas: #ffeaa6;
  --aube: #fff3cf; --azur: #e3f1fb;
  --encre: #0b3a27; --encre-douce: #3c5a48;
}
.admin-body, .fermier-page { background: var(--azur); }

/* ---------- Barre du haut : crème dorée vers bleu pâle ---------- */
.admin-topbar, .fermier-topbar {
  color: var(--encre);
  background-color: var(--aube);
  background-image: linear-gradient(90deg, var(--aube) 0%, var(--azur) 100%);
  background-size: 100% 100%;
  box-shadow: 0 1px 0 rgba(15, 74, 50, 0.1);
}
.admin-brand, .fermier-topbar .brand { color: var(--palm-dark); text-decoration: none; }
.admin-brand em { color: var(--encre-douce); opacity: 1; }
.admin-brand svg [fill="#f4f6f2"] { fill: var(--palm-dark); }
.admin-topbar__link, .admin-topbar__user { color: var(--encre-douce); }
.admin-topbar__link:hover { color: var(--palm-dark); }
.admin-topbar__logout { color: var(--palm-dark); background: rgba(255, 255, 255, 0.65); border-color: rgba(11, 58, 39, 0.3); }
.admin-topbar__logout:hover { background: #fff; color: var(--palm-dark); border-color: var(--palm); }
.admin-burger { color: var(--palm-dark); border-color: rgba(11, 58, 39, 0.3); }
.fermier-menu a { color: var(--palm-dark); }
.fermier-menu__logout { color: var(--palm-dark); border-color: rgba(11, 58, 39, 0.35); background: rgba(255, 255, 255, 0.65); }
.fermier-menu__logout:hover { background: #fff; }

/* ---------- Menu latéral ---------- */
.admin-nav { background: linear-gradient(180deg, #fffaf0 0%, #f0f8fd 100%); border-right-color: #dbe9f3; }
.admin-nav a:hover { background: var(--azur); }
.admin-nav a[aria-current="page"] { background: var(--aube); color: var(--palm-dark); }

/* ---------- En-tête de page : le ciel de l'accueil, titre centré ---------- */
.admin-head {
  text-align: center;
  color: var(--encre);
  background-color: var(--ciel-mi);
  background-image: linear-gradient(180deg, var(--ciel-haut) 0%, var(--ciel-mi) 50%, var(--ciel-bas) 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border-radius: 0 0 26px 26px;
}
.admin-head::after { display: none; }
.admin-head h1 { color: var(--encre); }
.admin-head__hello, .admin-back { color: var(--encre-douce); }
.admin-back:hover { color: var(--palm-dark); }

/* ---------- Cartes de statistiques : une couleur douce chacune ---------- */
.stat-card { box-shadow: 0 12px 22px -20px rgba(15, 74, 50, 0.7); }
.stat-grid > .stat-card:nth-child(4n+1) { background: #fff3cf; border-color: #f1df9c; }
.stat-grid > .stat-card:nth-child(4n+2) { background: #e3f1fb; border-color: #c4dff0; }
.stat-grid > .stat-card:nth-child(4n+3) { background: #e5f5df; border-color: #c3e4b8; }
.stat-grid > .stat-card:nth-child(4n+4) { background: #ffe9d6; border-color: #f6cfaa; }
.stat-grid > .stat-card.stat-card--accent { background: var(--kola-soft); border-color: var(--tag); box-shadow: 0 0 0 2px rgba(244, 194, 27, 0.35); }

/* ---------- Connexion admin ---------- */
.admin-body--login {
  background-color: var(--ciel-mi);
  background-image: linear-gradient(180deg, var(--ciel-haut) 0%, var(--ciel-mi) 55%, var(--ciel-bas) 100%);
  background-size: 100% 100%;
}
.login-card { text-align: center; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.55), 0 28px 50px -26px rgba(15, 74, 50, 0.45); }
.login-card form { text-align: left; }
.login-brand { justify-content: center; }

/* ---------- Espace fermier ---------- */
.fermier-card { background: #fff; border-color: #d7e8f3; box-shadow: 0 14px 28px -22px rgba(15, 74, 50, 0.5); }
.fermier-card h1, .fermier-card h2, .fermier-hello { text-align: center; }
.due-box { justify-content: center; text-align: center; }

/* ---------- Effectif : types non élevés, repliés pour gagner de la place ---------- */
.effectif-more { margin: 0.4rem 0 1.2rem; padding: 0.1rem 1rem 0.6rem; background: var(--azur); border: 1px dashed #b7d6ea; border-radius: 12px; }
.effectif-more summary { cursor: pointer; padding: 0.7rem 0; font-weight: 700; color: var(--palm-dark); }

/* ---------- Effectif : femelles et mâles des animaux à quatre pattes ---------- */
.effectif-sexe { margin: 0 0 1rem; padding: 0.4rem 1rem 1rem; background: #fffbea; border: 1px solid #f1df9c; border-radius: 12px; }
.effectif-sexe legend { padding: 0 0.4rem; font-weight: 800; color: var(--palm-dark); }
.effectif-sexe__note { margin: 0.2rem 0 0.7rem; font-size: 0.92rem; color: #7a5b00; }
.effectif-sexe__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.effectif-sexe .field { margin-bottom: 0; }

/* ---------- Réseaux de paiement : couleur et symbole de chaque réseau ----------
   Les symboles sont des pictogrammes simplifiés ; pour les logos officiels, voir la charte de chaque opérateur. */
.net-choice span {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  color: var(--net-ink, #10231a); background: var(--net-bg, #fff); border-color: var(--net-bg, #cbd6ce);
}
.net-choice span::before { content: ""; flex: none; width: 2rem; height: 1.5rem; background: var(--net-icon) center / contain no-repeat; }
.net-choice input[value="orange_ci"] + span {
  --net-bg: #ff7900; --net-ink: #111;
  --net-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Crect x='4' width='24' height='24' rx='3' fill='%23111'/%3E%3Crect x='8' y='14' width='9' height='3' fill='%23ff7900'/%3E%3C/svg%3E");
}
.net-choice input[value="mtn_ci"] + span {
  --net-bg: #ffcc00; --net-ink: #111;
  --net-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cellipse cx='16' cy='12' rx='15' ry='10' fill='%23111'/%3E%3Ctext x='16' y='16' font-family='Arial' font-weight='900' font-size='10' text-anchor='middle' fill='%23ffcc00'%3EMTN%3C/text%3E%3C/svg%3E");
}
.net-choice input[value="moov_ci"] + span {
  --net-bg: #0b5da8; --net-ink: #fff;
  --net-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Ccircle cx='16' cy='12' r='11' fill='white'/%3E%3Cpath d='M9 17V9l4 5 3-5 3 5 4-5v8' fill='none' stroke='%230b5da8' stroke-width='2.4' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.net-choice input[value="wave_ci"] + span {
  --net-bg: #1dc8ff; --net-ink: #06293a;
  --net-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath d='M2 9c3-5 6-5 9 0s6 5 9 0 6-5 10 0M2 17c3-5 6-5 9 0s6 5 9 0 6-5 10 0' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.net-choice { display: flex; }
.net-choice span { flex: 1; min-height: 4.4rem; }
.net-choice:hover span { filter: brightness(1.05); }
.net-choice input:checked + span {
  background: var(--net-bg, #fff); color: var(--net-ink, #10231a);
  border-color: #0f4a32; box-shadow: 0 0 0 3px rgba(15, 74, 50, 0.35);
}
.net-choice input:checked + span::after {
  content: "\2713"; position: absolute; top: -0.5rem; right: -0.5rem; display: grid; place-items: center;
  width: 1.5rem; height: 1.5rem; font-size: 0.95rem; color: #fff; background: #0f4a32; border-radius: 50%;
}
.net-choices:has(input:checked) .net-choice input:not(:checked) + span { opacity: 0.6; }

/* Logos officiels (Orange Money, MTN, Moov) : le nom du réseau est dans l'image, donc le texte est masqué.
   Fichiers : public_html/assets/img/reseau-orange.png, reseau-mtn.png, reseau-moov.png */
.net-choice input[value="orange_ci"] + span,
.net-choice input[value="mtn_ci"] + span,
.net-choice input[value="moov_ci"] + span { font-size: 0; }
.net-choice input[value="orange_ci"] + span::before,
.net-choice input[value="mtn_ci"] + span::before,
.net-choice input[value="moov_ci"] + span::before { width: 100%; height: 3.2rem; }
.net-choice input[value="orange_ci"] + span { --net-icon: url("../img/reseau-orange.png"); }
.net-choice input[value="orange_ci"] + span::before { box-sizing: border-box; width: 4.4rem; height: 3.7rem; padding: 0.25rem; background-color: #fff; background-origin: content-box; border-radius: 0.6rem; }
.net-choice input[value="mtn_ci"] + span { --net-icon: url("../img/reseau-mtn.png"); }
.net-choice input[value="moov_ci"] + span { --net-bg: #0167b2; --net-icon: url("../img/reseau-moov.png"); }
.net-choice input[value="moov_ci"] + span::before { height: 4rem; }
.net-choice input[value="wave_ci"] + span { --net-bg: #1dc8fe; --net-icon: url("../img/reseau-wave.png"); }
.net-choice input[value="wave_ci"] + span::before { width: 3rem; height: 3.4rem; }

/* ---------- Admin : recto et verso de la pièce d'identité côte à côte ---------- */
.piece-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 0.8rem; }
.piece-fig { margin: 0; }
.piece-fig figcaption { margin-bottom: 0.35rem; font-weight: 800; color: var(--palm-dark); }
