/* ===========================
   Thème sobre & élégant (corrigé)
   =========================== */

:root {
  --ge-bg: #f6f7f9;
  --ge-surface: #ffffff;
  --ge-border: #d8dce2;
  --ge-text: #2e2e2e;
  --ge-muted: #6c757d;
  --ge-accent: #0077b6;
  --ge-accent-light: #e3f2fd;
  --ge-danger: #dc3545;
  --ge-radius: 10px;
  --ge-gap: 20px;
}

/* ====== Base ====== */
.ge-admin {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ge-text);
  background-color: var(--ge-bg);
}

/* ====== En-tête ====== */
.ge-admin-header {
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius);
  padding: 16px 20px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ge-admin-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--ge-text);
}
.ge-subtitle {
  color: var(--ge-muted);
  font-size: 14px;
  margin: 0;
}

/* ====== Navigation ====== */
.ge-admin-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 10px;
  margin: 0 0 16px 0;
  padding: 0;
}
.ge-admin-nav a {
  text-decoration: none;
  color: var(--ge-text);
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: 6px;
  padding: 8px 14px;
  transition: background 0.2s, color 0.2s;
}
.ge-admin-nav li.active a,
.ge-admin-nav a:hover {
  background: var(--ge-accent);
  color: #fff;
}

/* ====== Disposition ====== */
.ge-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ge-gap);
  align-items: flex-start;
}

/* ✅ Largeur minimale + flexible */
.ge-card {
  flex: 1 1 calc(50% - var(--ge-gap));
  min-width: 420px;
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius);
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.1s;
  box-sizing: border-box;
}

.ge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Mobile = 1 colonne */
@media (max-width: 900px) {
  .ge-card {
    flex: 1 1 100%;
    min-width: auto;
  }
}

.ge-card h2 {
  margin-top: 0;
  font-size: 18px;
  border-bottom: 1px solid var(--ge-border);
  padding-bottom: 6px;
  color: var(--ge-text);
}

/* ====== Formulaires ====== */
.ge-form {
  display: block;
  margin-top: 10px;
}
.ge-form input[type="text"],
.ge-form input[type="email"],
.ge-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ge-border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: var(--ge-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ge-form input:focus,
.ge-form select:focus {
  outline: none;
  border-color: var(--ge-accent);
  box-shadow: 0 0 0 2px var(--ge-accent-light);
}

/* ====== Tableaux ====== */
.ge-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}
.ge-table th,
.ge-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ge-border);
}
.ge-table thead th {
  background: var(--ge-accent-light);
  color: var(--ge-text);
  font-weight: 600;
}
.ge-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}
.ge-table input[type="text"] {
  width: 100%;
  border: 1px solid var(--ge-border);
  border-radius: 6px;
  padding: 6px 8px;
}

/* ====== Boutons ====== */
.ge-btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.ge-btn-primary {
  background: var(--ge-accent);
  color: #fff;
}
.ge-btn-primary:hover {
  background: #005f8a;
}
.ge-btn-danger {
  background: var(--ge-danger);
  color: #fff;
}
.ge-btn-danger:hover {
  background: #b52a37;
}

/* ====== Notices WP ====== */
.notice-success {
  background: #e9f7ef;
  border-left: 4px solid #28a745;
}
.notice-error {
  background: #f8d7da;
  border-left: 4px solid var(--ge-danger);
}

/* ====== Divers ====== */
.ge-muted { color: var(--ge-muted); }
.ge-center { text-align: center; }
.ge-right { text-align: right; }


table.widefat td, table.widefat th {
    text-align: left;
    vertical-align: middle;
}
form input[type=text], form input[type=email] {
    width: 100%;
    max-width: 300px;
}

/* === STYLE GLOBAL PLUGIN GESTION ÉLEVAGE === */


/* === MODALE === */
.ge-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}
.ge-modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 24px 28px;
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    width: auto;
    max-width: 520px;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.ge-close {
    position: absolute;
    right: 20px;
    top: 14px;
    font-size: 24px;
    color: #777;
    cursor: pointer;
}
.ge-close:hover { color: #000; }

/* === FORMULAIRE === */
.ge-form-v2 {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}
.ge-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ge-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}
.ge-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ge-row2 {
    display: flex;
    gap: 10px;
    width: 100%;
}
.ge-row2 .ge-field {
    flex: 1;
}
.ge-field input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}
.ge-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .ge-modal-content {
        width: 95%;
        max-width: none;
    }
    .ge-row2 {
        flex-direction: column;
    }
}

/* === Tableaux & conteneurs === */
.ge-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ge-container h1 {
    margin-bottom: 20px;
    font-size: 1.6em;
}

.ge-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.ge-filters, .ge-actions {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ge-filters input[type="text"], 
.ge-filters select, 
.ge-filters input[type="date"] {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* === Popup === */

.ge-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
    overflow-y: auto;
}

.ge-popup-content {
    background: #fff;
    padding: 20px 25px;
    border-radius: 10px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.ge-popup-content h2 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 15px;
}

.ge-popup-content form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
}

.ge-popup-content label {
    grid-column: span 1;
    font-weight: 500;
    align-self: center;
}

.ge-popup-content input,
.ge-popup-content select {
    width: 100%;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.ge-popup-buttons {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Version mobile */
@media (max-width: 700px) {
    .ge-popup-content form {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   HARMONISATION : Chatons / Entrée-Sortie / Naissances
   =========================== */

/* === Couleurs principales === */
:root {
  --ge-arkema-blue: #1b365d;
  --ge-arkema-blue-hover: #264a8a;
  --ge-arkema-light: #f9fbff;
}

/* === Conteneur principal === */
.ge-container, .wrap.ge-page {
  background: var(--ge-surface);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  padding: 20px 24px;
  margin-top: 10px;
  color: var(--ge-text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.ge-container h1, .ge-page h1 {
  font-size: 1.8em;
  font-weight: 600;
  color: var(--ge-arkema-blue);
  margin-top: 0;
  margin-bottom: 16px;
}

/* === Filtres communs === */
.ge-filters, .ge-filtres {
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius);
  padding: 12px 16px;
  margin: 10px 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ge-filters input, .ge-filters select,
.ge-filtres input, .ge-filtres select {
  padding: 6px 8px;
  border: 1px solid var(--ge-border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}
.ge-filters button, .ge-filtres button,
.ge-filters a.button, .ge-filtres a.button {
  height: 34px;
  font-weight: 600;
}

/* === Tableaux === */
.ge-table, table.widefat {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--ge-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}
.ge-table th, table.widefat th {
  background: var(--ge-accent-light);
  color: var(--ge-arkema-blue);
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
}
.ge-table td, table.widefat td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ge-border);
  vertical-align: middle;
}
.ge-table tr:hover, table.widefat tr:hover {
  background: var(--ge-arkema-light);
}

/* === Boutons === */
.button.button-primary, .ge-btn-primary {
  background-color: var(--ge-arkema-blue) !important;
  border-color: var(--ge-arkema-blue) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.2s, transform 0.1s;
}
.button.button-primary:hover, .ge-btn-primary:hover {
  background-color: var(--ge-arkema-blue-hover) !important;
  transform: translateY(-1px);
}
.button.closePopup, .ge-close-popup {
  background: #f1f1f1 !important;
  color: #333 !important;
  border-color: #ccc !important;
}
.button.closePopup:hover, .ge-close-popup:hover {
  background: #e0e0e0 !important;
}

/* === Popups === */
.ge-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeInBg 0.25s ease-out;
}
@keyframes fadeInBg {
  from {opacity: 0;} to {opacity: 1;}
}
.ge-popup-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 22px 24px;
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeInPopup 0.25s ease-out;
}
@keyframes fadeInPopup {
  from {opacity: 0; transform: scale(0.96);}
  to {opacity: 1; transform: scale(1);}
}
.ge-popup-content h2 {
  font-size: 1.3em;
  color: var(--ge-arkema-blue);
  border-bottom: 2px solid var(--ge-accent-light);
  padding-bottom: 6px;
  margin-bottom: 12px;
  text-align: left;
}
.ge-popup-content label {
  font-weight: 500;
  display: block;
  margin-top: 6px;
}
.ge-popup-content input,
.ge-popup-content select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--ge-border);
  box-sizing: border-box;
  font-size: 14px;
  background: #fff;
}
.ge-popup-buttons, .ge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* === Bloc "chatons" (dans Naissances) === */
.kitten-block {
  margin-top: 14px;
  border-top: 1px solid var(--ge-border);
  padding-top: 10px;
}
.kitten-line {
  display: grid;
  grid-template-columns: 40px 1fr 80px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.kitten-line span {
  color: #555;
  text-align: right;
  font-weight: 500;
}
.kitten-line input, .kitten-line select {
  padding: 6px 8px;
  border: 1px solid var(--ge-border);
  border-radius: 6px;
  background: #fff;
}

/* === Animations === */
@keyframes fadeIn {
  from {opacity: 0; transform: scale(0.97);}
  to {opacity: 1; transform: scale(1);}
}
