/* ===== Espace Admin AZLA ===== */

.azadmin {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  max-width: 1180px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.2rem;
  animation: azFadeIn .5s var(--ease) both;
}
@keyframes azFadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --- Barre latérale --- */
.azadmin-side {
  background: linear-gradient(160deg, var(--green-900), var(--green-800));
  border-radius: 18px;
  padding: 1.5rem 1.1rem;
  color: #fff;
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: 0 16px 40px rgba(15,61,34,.25);
}
.azadmin-user { display: flex; align-items: center; gap: .8rem; padding: 0 .4rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 1rem; }
.azadmin-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-500), #f5b95a);
  color: var(--green-900);
  font-weight: 800; font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.azadmin-user strong { display: block; font-size: .95rem; }
.azadmin-user small { color: rgba(255,255,255,.6); font-size: .75rem; }
.azadmin-side nav { display: flex; flex-direction: column; gap: .3rem; }
.azadmin-side nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem .9rem;
  border-radius: 11px;
  color: rgba(255,255,255,.85);
  font-weight: 600; font-size: .92rem;
  transition: background .25s, transform .25s;
}
.azadmin-side nav a:hover { background: rgba(255,255,255,.10); transform: translateX(4px); }
.azadmin-side nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.azadmin-side nav a.out { color: #ffb4a8; margin-top: .8rem; }
.azadmin-side .pill {
  margin-left: auto;
  background: var(--gold-500); color: var(--green-900);
  font-size: .72rem; font-weight: 800;
  padding: 2px 9px; border-radius: 999px;
}

/* --- Zone principale --- */
.azadmin-main { min-width: 0; }
.azadmin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; flex-wrap: wrap; gap: 1rem; }
.azadmin-head h2 { font-size: 1.5rem; }

.azadmin-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--primary), var(--green-800));
  color: #fff !important;
  font-weight: 700; font-size: .92rem;
  padding: .75rem 1.4rem;
  border: 0; border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15,61,34,.25);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.azadmin-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,61,34,.35); }
.azadmin-btn.big { padding: .95rem 1.8rem; font-size: 1rem; margin-top: 1.2rem; }

.azadmin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.azadmin-stats .stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(15,61,34,.06);
  transition: transform .3s var(--ease);
}
.azadmin-stats .stat:hover { transform: translateY(-4px); }
.azadmin-stats strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--primary); }
.azadmin-stats span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* --- Listes --- */
.azadmin-list { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.4rem; }
.azadmin-list .row {
  display: flex; align-items: center; gap: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: .7rem .9rem;
  transition: box-shadow .3s, transform .3s;
}
.azadmin-list .row:hover { box-shadow: 0 10px 26px rgba(15,61,34,.10); transform: translateX(3px); }
.azadmin-list .thumb { flex: 0 0 54px; height: 54px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--green-100); font-size: 1.3rem; }
.azadmin-list .thumb img { width: 54px; height: 54px; object-fit: cover; display: block; }
.azadmin-list .grow { flex: 1; min-width: 0; }
.azadmin-list .grow strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.azadmin-list .grow small { color: var(--muted); font-size: .78rem; }
.azadmin-list .act { font-size: .82rem; font-weight: 700; color: var(--primary); padding: .35rem .6rem; border-radius: 8px; transition: background .2s; }
.azadmin-list .act:hover { background: var(--green-100); }
.azadmin-list .act.danger { color: #b3261e; }
.azadmin-list .act.danger:hover { background: #fdecea; }
.azadmin-list .vide { color: var(--muted); padding: 1.5rem; text-align: center; background: var(--bg-soft); border-radius: 13px; }

/* --- Formulaires --- */
.azadmin-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 10px 30px rgba(15,61,34,.07);
  margin-bottom: 1.6rem;
}
.azadmin-form label { display: block; font-weight: 700; font-size: .86rem; margin: 1.1rem 0 .4rem; color: var(--dark); }
.azadmin-form label:first-of-type { margin-top: 0; }
.azadmin-form input[type="text"], .azadmin-form select, .azadmin-form textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit; font-size: .95rem;
  background: var(--bg-soft);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.azadmin-form input:focus, .azadmin-form select:focus, .azadmin-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(42,154,82,.12);
}
.azadmin-form input[type="file"] { padding: .6rem; font-size: .85rem; color: var(--muted); }
.azadmin-form .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

/* --- Messages --- */
.azadmin-msg { border-radius: 12px; padding: .9rem 1.2rem; font-weight: 600; margin-bottom: 1.3rem; animation: azFadeIn .4s var(--ease) both; }
.azadmin-msg.ok { background: var(--green-100); color: var(--green-800); border: 1px solid var(--primary); }
.azadmin-msg.err { background: #fdecea; color: #b3261e; border: 1px solid #b3261e; }

/* --- Connexion --- */
.azadmin-login {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.2rem;
  text-align: center;
  box-shadow: 0 18px 46px rgba(15,61,34,.12);
  animation: azFadeIn .5s var(--ease) both;
}
.azadmin-login-icon { font-size: 2.4rem; margin-bottom: .6rem; }
.azadmin-login h3 { margin-bottom: 1.2rem; }
.azadmin-login form p { margin: .8rem 0; text-align: left; }
.azadmin-login label { font-weight: 700; font-size: .86rem; display: block; margin-bottom: .35rem; }
.azadmin-login input[type="text"], .azadmin-login input[type="password"] {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--bg-soft);
}
.azadmin-login input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(42,154,82,.12); }
.azadmin-login input[type="submit"] {
  width: 100%;
  padding: .95rem;
  border: 0; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--green-800));
  color: #fff; font-weight: 700; font-size: 1rem;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 10px 24px rgba(15,61,34,.25);
}
.azadmin-login input[type="submit"]:hover { transform: translateY(-2px); }

/* --- Responsive --- */
@media (max-width: 860px) {
  .azadmin { grid-template-columns: 1fr; margin-top: 1.4rem; }
  .azadmin-side { position: static; }
  .azadmin-side nav { flex-direction: row; flex-wrap: wrap; }
  .azadmin-side nav a { flex: 1 1 auto; justify-content: center; }
  .azadmin-form .cols { grid-template-columns: 1fr; }
  .azadmin-stats { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .azadmin-stats strong { font-size: 1.4rem; }
}

/* Badge brouillon + editeur riche */
.badge-draft {
  display: inline-block;
  background: #fff3cd; color: #8a6d00;
  border: 1px solid #e0c368;
  font-size: .68rem; font-weight: 800;
  padding: 1px 8px; border-radius: 999px;
  vertical-align: middle; margin-left: .4rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.azadmin-form .wp-editor-wrap { border-radius: 10px; overflow: hidden; border: 1.5px solid var(--line); }
.azadmin-form .wp-editor-container { border: 0; }

/* ===== Espace Admin v2 ===== */
.azadmin-stats.four { grid-template-columns: repeat(4, 1fr); }
.azadmin-stats .stat em { font-style: normal; font-size: 1.4rem; display: block; margin-bottom: .2rem; }
.azadmin-stats .stat.alert { border-color: var(--gold-500); background: #fffaf0; }
.azadmin-stats .stat.alert strong { color: var(--gold-500); }

.azadmin-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 8px 24px rgba(15,61,34,.06);
}
.azadmin-panel h3 { font-size: 1.05rem; margin-bottom: 1.1rem; }

/* Graphique en barres */
.azadmin-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .8rem;
  align-items: end;
  height: 170px;
  padding-top: .6rem;
}
.bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; }
.bar-wrap .bar {
  width: 100%;
  max-width: 46px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--primary), var(--green-800));
  transition: transform .3s var(--ease), background .3s;
  transform-origin: bottom;
  animation: azBarGrow .7s var(--ease) both;
}
@keyframes azBarGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar-wrap:hover .bar { background: linear-gradient(180deg, var(--gold-500), #c97f14); }
.bar-wrap .val { font-weight: 800; font-size: .82rem; color: var(--primary); }
.bar-wrap .mois { font-size: .72rem; color: var(--muted); text-transform: capitalize; }

/* Mini messages (tableau de bord) */
.mini-msg { padding: .8rem 1rem; border-radius: 11px; border: 1px solid var(--line); margin-bottom: .6rem; }
.mini-msg.neuf { border-left: 4px solid var(--gold-500); background: #fffaf0; }
.mini-msg strong { font-size: .92rem; }
.mini-msg small { color: var(--muted); margin-left: .5rem; font-size: .76rem; }
.mini-msg p { color: var(--muted); font-size: .86rem; margin-top: .25rem; }

/* Boîte de réception */
.msg-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.msg-card summary {
  list-style: none;
  display: flex; align-items: center; gap: .8rem;
  padding: .9rem 1.1rem;
  cursor: pointer;
}
.msg-card summary::-webkit-details-marker { display: none; }
.msg-card .dot { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--line); }
.msg-card.neuf .dot { background: var(--gold-500); box-shadow: 0 0 8px rgba(232,148,34,.6); }
.msg-card.neuf summary strong { color: var(--green-900); }
.msg-card[open] { box-shadow: 0 12px 30px rgba(15,61,34,.12); }
.msg-card .msg-body { padding: 0 1.1rem 1.1rem; border-top: 1px dashed var(--line); }
.msg-card .msg-body p { padding-top: .9rem; line-height: 1.7; color: var(--dark); }
.msg-card .msg-meta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: .9rem; font-size: .86rem; color: var(--muted); }

/* Recherche */
.azadmin-search {
  width: 100%;
  padding: .85rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
  margin-bottom: .4rem;
}
.azadmin-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(42,154,82,.12); }

/* Pastille alerte */
.azadmin-side .pill.hot { background: #ff5c4d; color: #fff; animation: azPulse 1.6s ease-in-out infinite; }
@keyframes azPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* Médiathèque */
.azadmin-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.media-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.media-cell:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15,61,34,.12); }
.media-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-cell .media-actions { display: flex; justify-content: space-between; padding: .5rem .6rem; }
.media-cell .act { border: 0; background: none; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; color: var(--primary); }
.media-cell .act.danger { color: #b3261e; }

@media (max-width: 860px) {
  .azadmin-stats.four { grid-template-columns: repeat(2, 1fr); }
  .azadmin-chart { height: 130px; gap: .4rem; }
}
