/* ============================================================
   ADMIN.CSS — Page d'administration KYMA Club
   Dépend des variables :root définies dans espace-membre.css
============================================================ */

/* ── Barre supérieure ─────────────────────────────────────── */
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  border-bottom: 1px solid rgba(26,86,219,0.1);
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--em-muted);
  text-decoration: none;
  flex-shrink: 0;
}
.admin-topbar-back svg { width: 15px; height: 15px; }
.admin-topbar-back:hover { color: var(--em-blue); }
.admin-topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--em-text);
  margin-right: auto;
}
.admin-topbar-title img { height: 24px; }
.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--em-text);
}
.admin-topbar-logout {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(26,86,219,0.15);
  background: white;
  color: var(--em-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.admin-topbar-logout svg { width: 16px; height: 16px; }
.admin-topbar-logout:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

/* ── Onglets ──────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: white;
  border-bottom: 1px solid rgba(26,86,219,0.1);
  padding: 0 28px;
  overflow-x: auto;
}
.admin-tab {
  background: none;
  border: none;
  padding: 14px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--em-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--em-blue); }
.admin-tab.active { color: var(--em-blue); border-color: var(--em-blue); }

/* ── Contenu principal ────────────────────────────────────── */
.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.admin-stat-chip {
  background: white;
  border: 1px solid rgba(26,86,219,0.1);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: center;
}
.admin-stat-num {
  display: block;
  font-family: var(--font-title, 'Barlow Condensed', sans-serif);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--em-blue);
  line-height: 1;
  margin-bottom: 4px;
}
.admin-stat-label { font-size: 0.72rem; color: var(--em-muted); }

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-panel-head h2 { font-size: 1.3rem; margin: 0; }
.admin-panel-sub { font-size: 0.85rem; color: var(--em-muted); margin: -14px 0 20px; }

.admin-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-filter-chip {
  background: white;
  border: 1px solid rgba(26,86,219,0.15);
  color: var(--em-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.admin-filter-chip:hover { border-color: var(--em-blue); color: var(--em-blue); }
.admin-filter-chip.active { background: var(--em-blue); border-color: var(--em-blue); color: white; }

/* ── Cartes de demandes ───────────────────────────────────── */
.admin-requests-list { display: flex; flex-direction: column; gap: 12px; }
.admin-request-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: white;
  border: 1px solid rgba(26,86,219,0.1);
  border-radius: 12px;
  padding: 18px 20px;
}
.admin-request-main { flex: 1; min-width: 0; }
.admin-request-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.admin-request-member { font-size: 0.82rem; font-weight: 600; color: var(--em-text); }
.admin-request-num { font-weight: 400; color: var(--em-muted); }
.admin-request-title { font-size: 1rem; font-weight: 700; color: var(--em-blue-dark, var(--em-text)); margin-bottom: 4px; }
.admin-request-meta { font-size: 0.76rem; color: var(--em-muted); margin-bottom: 6px; }
.admin-request-desc { font-size: 0.8rem; color: var(--em-text); background: var(--em-pale); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.admin-request-points { font-size: 0.82rem; font-weight: 700; color: var(--em-blue); margin-bottom: 4px; }
.admin-request-reason { font-size: 0.78rem; color: var(--em-muted); font-style: italic; }
.admin-request-action { flex-shrink: 0; white-space: nowrap; }

/* ── Suivi par membre ─────────────────────────────────────── */
.admin-members-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
.admin-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: white;
  border: 1px solid rgba(26,86,219,0.1);
  border-radius: 12px;
  padding: 8px;
  max-height: 640px;
  overflow-y: auto;
}
.admin-member-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.admin-member-item:hover { background: var(--em-pale); }
.admin-member-item.active { background: var(--em-blue); }
.admin-member-item.active .admin-member-item-name,
.admin-member-item.active .admin-member-item-meta { color: white; }
.admin-member-item-name { font-size: 0.85rem; font-weight: 700; color: var(--em-text); margin-bottom: 2px; }
.admin-member-item-meta { font-size: 0.72rem; color: var(--em-muted); }

.admin-member-detail {
  background: white;
  border: 1px solid rgba(26,86,219,0.1);
  border-radius: 12px;
  padding: 22px;
  min-height: 300px;
}
.admin-member-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(26,86,219,0.08);
}
.admin-member-detail-head h3 { font-size: 1.1rem; margin-bottom: 4px; }
.admin-member-balance {
  font-family: var(--font-title, 'Barlow Condensed', sans-serif);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--em-blue);
  white-space: nowrap;
}
.admin-member-balance span { font-size: 0.62rem; font-weight: 600; color: var(--em-muted); display: block; text-align: right; }
.admin-detail-subhead { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--em-muted); margin: 18px 0 8px; }
.admin-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(26,86,219,0.06);
  font-size: 0.82rem;
}
.admin-mini-row:last-child { border-bottom: none; }

/* ── Initiatives ──────────────────────────────────────────── */
.admin-initiatives-list { display: flex; flex-direction: column; gap: 14px; }
.admin-initiative-card {
  background: white;
  border: 1px solid rgba(26,86,219,0.1);
  border-radius: 12px;
  padding: 20px;
}
.admin-initiative-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.admin-initiative-head h3 { font-size: 1rem; margin: 0; }
.admin-initiative-total { font-family: var(--font-title, 'Barlow Condensed', sans-serif); font-weight: 800; color: var(--em-blue); font-size: 1.1rem; white-space: nowrap; }
.admin-initiative-desc { font-size: 0.82rem; color: var(--em-muted); margin-bottom: 12px; line-height: 1.5; }
.admin-initiative-bar-track { height: 8px; background: var(--em-pale); border-radius: 100px; overflow: hidden; margin-bottom: 10px; }
.admin-initiative-bar-fill { height: 100%; background: linear-gradient(90deg, var(--em-blue), #4f7fe8); border-radius: 100px; transition: width 0.4s ease; }
.admin-initiative-foot { display: flex; align-items: center; justify-content: space-between; font-size: 0.74rem; color: var(--em-muted); }

/* ── Modales ──────────────────────────────────────────────── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,39,87,0.5);
  backdrop-filter: blur(2px);
}
.admin-modal-box {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(13,39,87,0.25);
}
.admin-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--em-muted);
  cursor: pointer;
}
.admin-modal-close:hover { color: var(--em-text); }
.admin-modal-box h3 { font-size: 1.15rem; margin-bottom: 12px; padding-right: 20px; }
.admin-modal-summary {
  font-size: 0.85rem;
  color: var(--em-muted);
  background: var(--em-pale);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.admin-modal-decision { display: flex; gap: 10px; margin-bottom: 18px; }
.admin-decision-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid rgba(26,86,219,0.15);
  background: white;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.admin-decision-approve { color: #16a34a; }
.admin-decision-approve.selected { background: #dcfce7; border-color: #16a34a; }
.admin-decision-reject { color: #dc2626; }
.admin-decision-reject.selected { background: #fee2e2; border-color: #dc2626; }
.admin-btn-danger { background: #dc2626 !important; }
.admin-btn-danger:hover { background: #b91c1c !important; }
