/*
 * bureau.css — Feuille de style de l'espace de gestion (la « surface de
 * travail » : outil professionnel, pas site vitrine).
 *
 * Règles de design (CDC V1.4.0) :
 *  - fond blanc/gris neutre (--fond-gris-clair #F7F7F5, token du site
 *    réutilisé), aucune image décorative, pas de dégradé ;
 *  - typographie de travail (Inter ou système), tailles modestes, hiérarchie
 *    par la structure ;
 *  - la couleur n'est qu'un SIGNAL : vert = collecte ouverte, gris = fermée,
 *    rouge = action destructive. Les couleurs du site public (rose, vert,
 *    violet du bento) sont bannies du bureau : elles n'apparaissent que dans
 *    l'iframe du puits de rendu.
 */

:root {
    --fond-gris-clair: #F7F7F5;
    --surface: #FFFFFF;
    --bordure: #E2E2DE;
    --texte: #2B2B2B;
    --texte-secondaire: #6B6B6B;
    --lien: #1A56DB;
    --primaire: #2B2B2B;
    --primaire-survol: #000000;
    --vert-ouvert: #1E7B34;
    --fond-vert: #E4F1E5;
    --gris-ferme: #5F6368;
    --fond-gris-badge: #ECECEA;
    --rouge: #B3261E;
    --fond-rouge: #FBEBEA;
    --alerte: #B54708;
    --fond-alerte: #FFF4E5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fond-gris-clair);
    color: var(--texte);
    font-family: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.9em;
    background: var(--fond-gris-badge);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Barre haute                                                          */
/* ------------------------------------------------------------------ */
.barre-haute {
    background: var(--surface);
    border-bottom: 1px solid var(--bordure);
}
.barre-haute-interieur {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.marque {
    font-weight: 700;
    color: var(--texte);
    text-decoration: none;
    font-size: 15px;
}
.barre-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}
.barre-nav > a { color: var(--lien); text-decoration: none; font-weight: 500; }
.barre-nav > a:hover { text-decoration: underline; }
.barre-utilisateur {
    color: var(--texte-secondaire);
    font-size: 13px;
}
.form-deconnexion { margin: 0; }

.contenu {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.page-titre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-titre h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Boutons, badges, bandeaux                                            */
/* ------------------------------------------------------------------ */
.btn {
    display: inline-block;
    border: 1px solid var(--bordure);
    background: var(--surface);
    color: var(--texte);
    border-radius: 8px;
    padding: 9px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}
.btn:hover { background: var(--fond-gris-clair); }
.btn-primaire {
    background: var(--primaire);
    border-color: var(--primaire);
    color: #FFFFFF;
}
.btn-primaire:hover { background: var(--primaire-survol); }
.btn-danger {
    background: var(--rouge);
    border-color: var(--rouge);
    color: #FFFFFF;
}
.btn-danger:hover { background: #8F1D17; }
.btn-secondaire { background: var(--surface); }
.btn-petit { padding: 5px 10px; font-size: 13px; }
.btn-plein { width: 100%; }
.btn:focus-visible { outline: 3px solid var(--lien); outline-offset: 2px; }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-ouvert { background: var(--fond-vert); color: var(--vert-ouvert); }
.badge-ferme { background: var(--fond-gris-badge); color: var(--gris-ferme); }
.badge-priorite { background: var(--fond-gris-badge); color: var(--texte); }
.badge-standard { background: transparent; color: var(--texte-secondaire); border: 1px solid var(--bordure); }

.bandeau-ok {
    background: var(--fond-vert);
    color: var(--vert-ouvert);
    border: 1px solid #BFE0C2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}
.bandeau-erreur {
    background: var(--fond-rouge);
    color: var(--rouge);
    border: 1px solid #F0C1BC;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}
.bandeau-attention {
    background: var(--fond-alerte);
    color: var(--alerte);
    border: 1px solid #F5D9B8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}
.bandeau-attention a { color: var(--alerte); font-weight: 600; }

.fiche-etroite { max-width: 640px; }

/* ---------- Point 6 : règles typographiques du slug ---------- */
.indice-slug { font-size: 12px; margin: 4px 0 0; min-height: 1em; }
.indice-slug.ok { color: var(--vert-ouvert); }
.indice-slug.ko { color: var(--rouge); font-weight: 600; }

/* ---------- Point 7 : projet type (fantôme) ---------- */
.section-fantome { background: var(--fond-gris-clair); }
.section-fantome > summary { font-weight: 600; }
dl.exemple {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 8px 16px;
    margin: 0 16px 16px;
    font-size: 13px;
}
dl.exemple dt { font-weight: 700; color: var(--texte-secondaire); }
dl.exemple dd { margin: 0; }
@media (max-width: 700px) {
    dl.exemple { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Tableau de bord                                                      */
/* ------------------------------------------------------------------ */
.tableau {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: 10px;
    overflow: hidden;
}
.tableau th, .tableau td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bordure);
    vertical-align: middle;
    font-size: 14px;
}
.tableau thead th {
    background: var(--fond-gris-clair);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texte-secondaire);
}
.tableau tbody tr:last-child td { border-bottom: none; }
.tableau tbody tr:hover { background: #FCFCFB; }
.col-actions { white-space: nowrap; text-align: right; }
.col-actions .btn { margin-left: 6px; }
.form-en-ligne { display: inline-block; margin: 0 0 0 6px; }
.vide { color: var(--texte-secondaire); }
.sous-titre-section { font-size: 16px; font-weight: 700; margin: 28px 0 12px; }

/* ------------------------------------------------------------------ */
/* Fiche d'édition : formulaire à gauche, puits de rendu à droite      */
/* ------------------------------------------------------------------ */
.edition {
    display: grid;
    grid-template-columns: minmax(440px, 1fr) minmax(440px, 1fr);
    gap: 24px;
    align-items: start;
}
@media (max-width: 1100px) {
    .edition { grid-template-columns: 1fr; }
}

.fiche {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: 10px;
    padding: 24px;
}

.section {
    border: 1px solid var(--bordure);
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--surface);
}
.section > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 16px;
    list-style: none;
}
.section > summary::before {
    content: '▸ ';
    color: var(--texte-secondaire);
}
.section[open] > summary::before { content: '▾ '; }
.section > summary:hover { background: var(--fond-gris-clair); border-radius: 8px 8px 0 0; }
.section > .champ, .section > .sous-section { margin: 0 16px 16px; }
.section > .champ:last-child, .section > .sous-section:last-child { margin-bottom: 20px; }

.sous-section {
    border: 1px dashed var(--bordure);
    border-radius: 8px;
    padding: 16px;
}
.sous-section legend {
    font-weight: 600;
    font-size: 13px;
    color: var(--texte-secondaire);
    padding: 0 6px;
}

.champ { margin-bottom: 16px; }
.champ label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}
.champ .obligatoire { color: var(--rouge); }
.champ-case label { font-weight: 400; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.champ input[type="text"],
.champ input[type="email"],
.champ input[type="password"],
.champ select,
.champ textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: var(--surface);
    color: var(--texte);
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
    outline: 2px solid var(--lien);
    outline-offset: 1px;
}
.champ input[type="file"] {
    font-size: 13px;
    color: var(--texte-secondaire);
}
.champ-en-erreur input, .champ-en-erreur select, .champ-en-erreur textarea {
    border-color: var(--rouge);
}
.erreur-champ {
    color: var(--rouge);
    font-size: 13px;
    margin: 5px 0 0;
}
.aide {
    color: var(--texte-secondaire);
    font-size: 12px;
    margin: 5px 0 0;
}
.aide-en-ligne { font-weight: 400; font-size: 12px; }
.fichier-actuel { word-break: break-all; }

.compteur {
    display: block;
    font-size: 12px;
    color: var(--texte-secondaire);
    margin-top: 4px;
}
.compteur.depassement { color: var(--alerte); font-weight: 700; }
.compteur.depassement-fort { color: var(--rouge); font-weight: 700; }

/* V1.6.0 — champs textuels bilingues FR/EN côte à côte */
.champ-bilingue {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.champ-bilingue .sous-champ label .lang-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bordure);
    color: var(--texte-secondaire);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
@media (max-width: 900px) {
    .champ-bilingue { grid-template-columns: 1fr; }
}

/* V1.6.1 — traduction automatique FR→EN (bouton + état) */
.btn-traduire {
    margin-left: 8px;
    padding: 1px 8px;
    border: 1px solid var(--bordure);
    border-radius: 6px;
    background: var(--surface);
    color: var(--lien);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.btn-traduire:hover { background: var(--bordure); }
.trad-etat { font-size: 11px; font-weight: 400; color: var(--texte-secondaire); }
.trad-etat.trad-en-cours { color: var(--lien); }
.trad-etat.trad-ok { color: var(--alerte); }
.trad-etat.trad-ko { color: var(--rouge); }

.actions-formulaire {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.form-confirmation {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ------------------------------------------------------------------ */
/* Puits de rendu (seule zone colorée de l'écran : l'iframe)            */
/* ------------------------------------------------------------------ */
.puits {
    position: sticky;
    top: 16px;
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 480px;
}
.puits-entete {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bordure);
    background: var(--fond-gris-clair);
    flex-wrap: wrap;
}
.puits-titre {
    font-size: 13px;
    font-weight: 700;
    color: var(--texte-secondaire);
    margin-right: auto;
}
.puits-vues { display: flex; gap: 6px; }
.onglet.actif {
    background: var(--primaire);
    border-color: var(--primaire);
    color: #FFFFFF;
}
.puits-iframe {
    flex: 1;
    border: none;
    width: 100%;
    background: #FFFFFF;
}

/* ------------------------------------------------------------------ */
/* Page de connexion                                                    */
/* ------------------------------------------------------------------ */
.page-connexion {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.carte-connexion {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
}
.carte-connexion h1 { font-size: 20px; margin: 0 0 6px; }
.sous-titre-connexion {
    color: var(--texte-secondaire);
    font-size: 13px;
    margin: 0 0 24px;
}
