/* ============================================================
   Administration — s'appuie sur site.css et n'ajoute que
   ce qui lui est propre : barre sombre, grille d'édition, tableaux.
   ============================================================ */

body.espace-admin { background: #f3f5f4; }

.admin-entete { background: #1d2b27; color: #fff; }
.admin-rang {
    max-width: 1240px; margin: 0 auto; padding: 10px 18px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
}
.admin-marque {
    font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
    color: #fff; text-decoration: none;
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.admin-nav a {
    color: #c3d2cd; text-decoration: none; font-size: .93rem;
    padding: 6px 2px; border-bottom: 2px solid transparent;
}
.admin-nav a:hover { color: #fff; }
.admin-nav a.actif { color: #fff; border-bottom-color: var(--or); }

.admin-contenu { max-width: 1240px; margin: 0 auto; padding: 6px 18px 60px; }

.titre-rang {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 14px; margin-top: 22px;
}
.titre-rang h1 { margin: 0; }
.intro-admin { color: var(--encre-doux); max-width: 70ch; }

.bloc {
    background: #fff; border: 1px solid var(--pierre);
    border-radius: 11px; padding: 20px; margin: 18px 0;
}
.bloc h2 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 14px; }
.bloc-etroit { max-width: 620px; }

.colonnes-edition { display: grid; grid-template-columns: 1fr; gap: 0 22px; }
.colonne-cote .bloc { position: static; }

/* ---------- Champs ---------- */
.formulaire, .formulaire-article { margin: 0; }
.champ { display: block; margin-bottom: 16px; }
.champ-nom { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; }
.champ-note { font-weight: 400; color: var(--encre-doux); font-size: .85rem; display: block; margin-top: 3px; }

.formulaire label { display: block; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }

input[type=text], input[type=url], input[type=search], input[type=password],
input[type=number], input[type=datetime-local], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit; font-size: .97rem; font-weight: 400;
    border: 1px solid var(--pierre); border-radius: 8px;
    background: #fff; color: var(--encre);
}
textarea { line-height: 1.55; resize: vertical; }
#champ-texte { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vert); border-color: var(--vert); }

.case {
    display: flex; align-items: center; gap: 9px;
    font-weight: 400; font-size: .94rem; margin-bottom: 14px;
}
.case input { width: auto; }

.deux-colonnes { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
.champ-large { grid-column: 1 / -1; }

.bouton-large { width: 100%; }

/* ---------- Barre d'outils du texte ---------- */
.outils { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.outils button {
    background: #eef2f0; border: 1px solid var(--pierre);
    border-radius: 7px; padding: 6px 11px;
    font: inherit; font-size: .85rem; cursor: pointer; color: var(--encre);
}
.outils button:hover { background: var(--vert-pale); border-color: var(--vert); }

.apercu-image {
    max-width: 100%; border-radius: 9px;
    border: 1px solid var(--pierre); margin-bottom: 10px;
}

/* ---------- Filtres ---------- */
.filtres {
    display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
    margin: 18px 0 10px;
}
.filtres input[type=search] { flex: 1; min-width: 200px; }
.filtres select { width: auto; }
.lien-doux { color: var(--vert); font-size: .9rem; text-decoration: none; }
.lien-doux:hover { text-decoration: underline; }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; font-size: .94rem; background: #fff; }
.tableau th, .tableau td {
    text-align: left; padding: 11px 10px;
    border-bottom: 1px solid var(--pierre); vertical-align: top;
}
.tableau th { font-size: .82rem; color: var(--encre-doux); font-weight: 600; }
.tableau-articles { border: 1px solid var(--pierre); border-radius: 11px; overflow: hidden; }
.titre-lien { font-weight: 600; text-decoration: none; color: var(--encre); }
.titre-lien:hover { color: var(--vert); }

.rang-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.en-ligne { display: inline; margin: 0; }
.lien-bouton {
    background: none; border: 0; padding: 0;
    font: inherit; font-size: .9rem; color: var(--vert);
    cursor: pointer; text-decoration: underline;
}
.lien-bouton:hover { color: var(--vert-profond); }
.lien-danger { color: var(--rouge); }

.etat {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: .78rem; font-weight: 600; background: #eceeed; color: var(--encre-doux);
}
.etat-publie    { background: #e0f0e7; color: #14653f; }
.etat-brouillon { background: var(--or-pale); color: var(--or); }
.etat-archive   { background: #ececec; color: #666; }
.etat-epingle   { background: var(--or-pale); color: var(--or); }

/* ---------- Arbre des rubriques ---------- */
.arbre { list-style: none; margin: 0; padding: 0; }
.arbre li {
    padding: 9px 0; border-bottom: 1px solid var(--pierre);
    display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline;
}
.arbre li:last-child { border-bottom: 0; }
.arbre .arbre-titre { font-weight: 600; }
.arbre .niveau-1 { padding-left: 24px; }
.arbre .niveau-2 { padding-left: 48px; }
.arbre .niveau-3 { padding-left: 72px; }
.arbre .niveau-1 .arbre-titre,
.arbre .niveau-2 .arbre-titre,
.arbre .niveau-3 .arbre-titre { font-weight: 400; }

/* ---------- Chiffres ---------- */
.chiffres {
    display: grid; gap: 12px; margin: 20px 0;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.chiffre {
    background: #fff; border: 1px solid var(--pierre);
    border-radius: 11px; padding: 16px;
}
.chiffre-valeur {
    display: block; font-family: var(--serif);
    font-size: 1.9rem; font-weight: 700; line-height: 1.1;
}
.chiffre-libelle { display: block; font-size: .85rem; color: var(--encre-doux); margin-top: 3px; }

.actions-rapides { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }

/* ---------- Barre de progression ---------- */
.barre {
    height: 14px; background: var(--pierre);
    border-radius: 999px; overflow: hidden; margin: 8px 0;
}
.barre-remplie { height: 100%; background: var(--vert); border-radius: 999px; }

/* ---------- Grand écran ---------- */
@media (min-width: 900px) {
    .colonnes-edition { grid-template-columns: minmax(0, 1fr) 330px; }
    .deux-colonnes { grid-template-columns: 1fr 1fr; }
}

/* ---------- Téléphone : tableaux en cartes ---------- */
@media (max-width: 680px) {
    .tableau thead { display: none; }
    .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
    .tableau tr {
        border: 1px solid var(--pierre); border-radius: 10px;
        margin-bottom: 10px; padding: 6px; background: #fff;
    }
    .tableau td { border: 0; padding: 5px 6px; }
    .tableau td::before {
        content: attr(data-libelle);
        display: block; font-size: .76rem; color: var(--encre-doux); font-weight: 600;
    }
    .tableau td:empty { display: none; }
}
