/* ══════════════════════════════
   v0.9.7 — CSS interface admin
══════════════════════════════ */

html {
    scroll-behavior: smooth;
}

/* ── Ancre avec offset pour le header + nav sticky ── */

#admin-grille,
#admin-membres,
#admin-journal {
    scroll-margin-top: 110px;
}


/* ══════════════════════════════
   v0.9.1 — Dashboard admin
══════════════════════════════ */

.admin-main {
    padding-top: 70px;
    min-height: 80vh;
}

/* ── Hero ── */

#admin-hero {
    padding: 56px 6% 32px;
    border-bottom: none;
}

/* ── Navigation entre sections ── */

.admin-sections-nav {
    position: sticky;
    top: 60px;
    z-index: 50;
    display: flex;
    gap: 0;
    padding: 0 6%;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--bord);
}

.admin-nav-lien {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--doux);
    text-decoration: none;
    padding: 11px 16px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.admin-nav-lien:hover {
    color: var(--texte);
}

.admin-nav-lien.active {
    color: var(--texte);
    border-bottom-color: var(--texte);
    font-weight: 600;
}

.admin-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--doux);
    margin-bottom: 16px;
}

.admin-titre {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    color: var(--texte);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.admin-intro {
    font-size: 0.95rem;
    color: var(--doux);
}

/* ── Accès refusé ── */

.admin-refuse {
    text-align: center;
    padding: 100px 6%;
    color: var(--doux);
    font-size: 0.95rem;
}

.admin-refuse p { margin-bottom: 16px; font-size: 1.05rem; }

/* ── Section stats : pas de border-top au-dessus de la première section ── */

.admin-section-entete--first {
    border-top: none;
    padding-top: 32px;
}

/* ── Grille de statistiques ── */

.admin-grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 6% 80px;
}

.admin-chargement {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--doux);
    font-size: 0.9rem;
}

.admin-carte {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px 22px;
    border: 1px solid var(--bord);
    border-radius: 14px;
    transition: box-shadow 0.2s, transform 0.18s;
    overflow: hidden;
}

.admin-carte:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.admin-carte-nb {
    font-size: 2rem;
    font-weight: 700;
    color: var(--texte);
    letter-spacing: -0.02em;
    line-height: 1;
}

.admin-carte-label {
    font-size: 0.82rem;
    color: var(--doux);
    font-weight: 500;
    margin-top: 2px;
}

.admin-carte-comptes { grid-column: span 1; }

.admin-carte-detail {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.74rem;
    color: var(--doux);
}

.admin-carte-detail span {
    background: var(--survol);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ── Wrapper de contenu padded (journal, etc.) ── */

.admin-section-contenu {
    padding: 0 6% 80px;
}


/* ══════════════════════════════
   v0.9.2 — Gestion des membres
══════════════════════════════ */

.admin-section-entete {
    padding: 40px 6% 20px;
    border-top: 1px solid var(--bord);
}

.admin-section-titre {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--texte);
    margin-bottom: 5px;
    letter-spacing: -0.01em;
}

.admin-section-sous {
    font-size: 0.85rem;
    color: var(--doux);
}

/* ── Table ── */

.admin-table-wrapper {
    padding: 0 6% 80px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--doux);
    padding: 0 14px 12px;
    border-bottom: 1px solid var(--bord);
    white-space: nowrap;
}

.admin-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--bord);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.membre-email {
    font-weight: 500;
    color: var(--texte);
}

.membre-date {
    color: var(--doux);
    font-size: 0.82rem;
    white-space: nowrap;
}

/* ── Contrôles inline ── */

.membre-role-select,
.membre-adherent-select {
    font-size: 0.82rem;
    font-family: var(--font);
    padding: 4px 8px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
    cursor: pointer;
    max-width: 190px;
}

.membre-role-select:hover,
.membre-adherent-select:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

/* ── Barre d'action + formulaire ajout ── */

.membres-barre {
    display: flex;
    justify-content: flex-end;
    padding: 0 6% 16px;
}

label {
  position: relative;
}

label input {
  font-size: 1em;
  color: #f9f9f9;
  background: transparent;
  padding: 1rem 1.2rem;
  width: 350px;
  border-radius: 5px;
  border: 2px solid #7a7a7a;
  transition: all 0.2s;
}

.membres-btn-ajouter {
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    padding: 7px 16px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.membres-btn-ajouter:hover {
    background: var(--blanc);
    border-color: rgba(0, 0, 0, 0.18);
}

.membres-form-wrapper {
    padding: 0 6% 28px;
}

.membres-form {
    border: 1px solid var(--bord);
    border-radius: 14px;
    padding: 24px 28px;
    background: var(--blanc);
}

.membres-form-grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin-bottom: 18px;
}

.membres-form-champ {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.membres-form-champ label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--doux);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.membres-input {
    font-size: 0.875rem;
    font-family: var(--font);
    padding: 8px 11px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
}

.membres-input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.25);
}

.membres-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.membres-btn-valider {
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: var(--texte);
    color: var(--blanc);
    cursor: pointer;
    transition: opacity 0.15s;
}

.membres-btn-valider:disabled { opacity: 0.5; cursor: not-allowed; }
.membres-btn-valider:hover:not(:disabled) { opacity: 0.8; }

.membres-btn-annuler {
    font-size: 0.82rem;
    font-family: var(--font);
    padding: 8px 14px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: transparent;
    color: var(--doux);
    cursor: pointer;
}

.membres-btn-annuler:hover { background: var(--survol); }

.membres-erreur {
    font-size: 0.82rem;
    color: #b91c1c;
    margin-left: 4px;
}

/* ── Bouton supprimer par ligne ── */

.membre-suppr-btn {
    font-size: 0.72rem;
    font-family: var(--font);
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--doux);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.membre-suppr-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* ── Bouton actif / inactif ── */

.membre-actif-btn {
    font-size: 0.76rem;
    font-weight: 600;
    font-family: var(--font);
    padding: 3px 11px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.membre-actif-btn:hover { opacity: 0.75; }

.membre-actif-1 { background: #d1fae5; color: #065f46; }
.membre-actif-0 { background: #f1f5f9; color: #475569; }


/* ══════════════════════════════
   v0.9.4 — Gestion de l'annuaire
══════════════════════════════ */

.adh-logo-mini {
    font-size: 1rem;
    margin-right: 4px;
}

.adh-badge-zone {
    font-size: 0.76rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--survol);
    color: var(--doux);
    white-space: nowrap;
}

.adh-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.adh-edit-btn {
    font-size: 0.82rem;
    font-family: var(--font);
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--doux);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.adh-edit-btn:hover {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

/* ── Modal adhérent ── */

.adm-modal-cache { display: none !important; }

.adm-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.adm-modal-carte {
    background: var(--blanc);
    border-radius: 18px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.adm-modal-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
    margin-bottom: 20px;
}

.adm-modal-entete h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--texte);
}

.adm-modal-fermer {
    font-size: 0.9rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bord);
    border-radius: 50%;
    background: transparent;
    color: var(--doux);
    cursor: pointer;
    font-family: var(--font);
    flex-shrink: 0;
}

.adm-modal-fermer:hover { background: var(--survol); }

/* ── Formulaire modal ── */

.adm-modal-form {
    padding: 0 28px 28px;
}

.adm-form-grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 20px;
}

.adm-form-champ {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.adm-col-2 { grid-column: span 2; }

.adm-form-champ label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--doux);
}

.adm-requis { color: #b91c1c; }

.adm-input {
    font-size: 0.875rem;
    font-family: var(--font);
    padding: 8px 11px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
    width: 100%;
}

.adm-input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.25);
}

.adm-textarea {
    resize: vertical;
    min-height: 72px;
}

/* ── Upload widget ── */

.adm-upload-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adm-upload-apercu {
    position: relative;
    width: 100%;
    max-height: 160px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--survol);
    display: flex;
    align-items: center;
    justify-content: center;
}

.adm-upload-apercu img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

.adm-upload-emoji {
    font-size: 2.5rem;
    line-height: 1;
    padding: 16px;
}

.adm-upload-suppr {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adm-upload-suppr:hover { background: rgba(0,0,0,0.65); }

.adm-upload-ligne {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.adm-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: var(--blanc);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--texte);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.adm-upload-btn:hover {
    background: var(--survol);
    border-color: rgba(0,0,0,0.18);
}

.adm-upload-fichier {
    display: none;
}

.adm-upload-ou {
    font-size: 0.78rem;
    color: var(--doux);
    flex-shrink: 0;
}

.adm-upload-texte {
    flex: 1;
    min-width: 100px;
}

/* ── Géolocalisation adresse ── */

.adm-geo-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adm-geo-ligne {
    display: flex;
    gap: 8px;
}

.adm-geo-input { flex: 1; }

.adm-geo-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--texte);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.adm-geo-btn:hover    { opacity: 0.82; }
.adm-geo-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.adm-geo-resultat {
    font-size: 0.79rem;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--survol);
    color: var(--doux);
}

.adm-geo-ok     { background: #dcfce7; color: #166534; }
.adm-geo-erreur { background: #fee2e2; color: #991b1b; }

/* Image dans les cartes article */
.article-image-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.adm-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}


/* ══════════════════════════════
   v0.9.3 — Gestion du contenu (vie.php)
══════════════════════════════ */

/* ── Bouton ajout flottant (au-dessus du grid ou dans l'entête événements) ── */

.vie-admin-ajout-barre {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 16px;
}

.vie-admin-btn-ajout {
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font);
    padding: 7px 16px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.vie-admin-btn-ajout:hover {
    background: var(--blanc);
    border-color: rgba(0, 0, 0, 0.18);
}

/* ── Barre d'actions admin sur les cartes ── */

.vie-admin-barre {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--blanc);
    border: 1px solid var(--bord);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.vie-admin-edit,
.vie-admin-suppr,
.vie-admin-edit-evt,
.vie-admin-suppr-evt {
    font-size: 0.76rem;
    font-family: var(--font);
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.vie-admin-edit,
.vie-admin-edit-evt {
    color: var(--doux);
}

.vie-admin-edit:hover,
.vie-admin-edit-evt:hover {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.vie-admin-suppr,
.vie-admin-suppr-evt {
    color: var(--doux);
    margin-left: auto;
}

.vie-admin-suppr:hover,
.vie-admin-suppr-evt:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* ── Badge "Non publié" ── */

.vie-badge-inactif {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    white-space: nowrap;
    letter-spacing: 0.04em;
}

/* ── Wrapper document admin (barre au-dessus du <a>) ── */

.doc-admin-wrapper {
    display: flex;
    flex-direction: column;
}

.doc-admin-wrapper .document-carte {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Carte non publiée : légère transparence */
.doc-admin-inactif .document-carte,
.evt-admin-inactif {
    opacity: 0.55;
}

/* Événements admin : wrapper + barre (même pattern que documents) */
.evt-admin-wrapper {
    display: flex;
    flex-direction: column;
}

.evt-admin-wrapper .evenement-carte {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Articles admin : wrapper + barre (même pattern que documents) */
.art-admin-wrapper {
    display: flex;
    flex-direction: column;
}

.art-admin-wrapper .article-carte {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Premier wrapper (vedette) : pleine largeur */
.art-admin-wrapper:first-child {
    grid-column: 1 / -1;
}

/* Article non publié : légère transparence */
.art-admin-inactif .article-carte {
    opacity: 0.55;
}


/* ══════════════════════════════
   Journal d'activité (v0.9.6)
══════════════════════════════ */

.journal-filtres {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.journal-filtres select {
    padding: 6px 12px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    color: var(--texte);
    cursor: pointer;
}

.journal-tableau-wrapper {
    overflow-x: auto;
    border: 1px solid var(--bord);
    border-radius: 10px;
}

.journal-tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.journal-tableau thead th {
    background: var(--blanc);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--bord);
    white-space: nowrap;
}

.journal-tableau tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.journal-tableau tbody tr:last-child {
    border-bottom: none;
}

.journal-tableau tbody tr:hover {
    background: var(--blanc);
}

.journal-tableau td {
    padding: 9px 14px;
    color: var(--texte);
    vertical-align: middle;
}

.journal-td-date {
    white-space: nowrap;
    color: #64748b;
    font-size: 0.8rem;
}

.journal-td-user {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.journal-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.journal-badge-création {
    background: #dcfce7;
    color: #166534;
}

.journal-badge-modification {
    background: #dbeafe;
    color: #1e40af;
}

.journal-badge-suppression {
    background: #fee2e2;
    color: #991b1b;
}

.journal-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 0.875rem;
    color: #64748b;
    flex-wrap: wrap;
}

.journal-pagination button {
    padding: 5px 14px;
    border: 1px solid var(--bord);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.journal-pagination button:hover:not(:disabled) {
    background: #f1f5f9;
}

.journal-pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.journal-vide {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
    font-size: 0.875rem;
}


/* ══════════════════════════════
   Responsive
══════════════════════════════ */

@media (max-width: 1024px) {
    .admin-grille { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    #admin-hero { padding: 40px 5% 24px; }
    .admin-sections-nav { padding: 0 5%; top: 54px; }
    .admin-nav-lien { padding: 9px 12px; font-size: 0.8rem; }
    .admin-grille { grid-template-columns: 1fr 1fr; padding: 16px 5% 48px; gap: 12px; }
    .admin-section-entete { padding: 32px 5% 16px; }
    .admin-section-contenu { padding: 0 5% 60px; }
    .membres-form-grille { grid-template-columns: 1fr; }
    .membres-barre { padding: 0 5% 16px; }
    .membres-form-wrapper { padding: 0 5% 24px; }
    .adm-form-grille { grid-template-columns: 1fr; }
    .adm-col-2 { grid-column: span 1; }
    .adm-modal-carte { max-height: 95vh; }
    .journal-filtres { gap: 8px; }
    #admin-grille, #admin-membres, #admin-journal { scroll-margin-top: 100px; }
}

@media (max-width: 480px) {
    .admin-grille { grid-template-columns: 1fr; }
    .admin-nav-lien { padding: 9px 10px; }
}
