/* ==========================================================================
   L'écran du thème — FEN_Modification_Fond_Ecran.

   Même forme que les autres écrans d'administration : la liste des entités à
   gauche, ce qui se règle à droite, la barre d'actions en bas.
   ========================================================================== */

.ecran-theme,
.ecran-parametres-entite {
    height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 0;   /* le cadre pose déjà ses 16 px : le pied tombe à 16 px du bord comme partout */
}

.plan-theme,
.plan-parametres-entite {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 8px;
}

.volet-entites .corps-volet { overflow: auto; }
.volet-reglages { display: flex; flex-direction: column; min-height: 0; }

.corps-theme,
.corps-parametres { overflow: auto; padding: 12px; }

/* La teinte d'une entité, dans la liste. */
.teinte-entite {
    display: inline-block; width: 26px; height: 14px;
    border: 1px solid var(--bord-fort); border-radius: 2px;
}

/* ------------------------------------------------------------------ thème */

.ligne-jetons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.jeton-mode {
    padding: 5px 14px; font: inherit; cursor: pointer;
    background: var(--fond-carte); color: var(--texte);
    border: 1px solid var(--bord-fort); border-radius: var(--r);
}
.jeton-mode:hover { border-color: var(--accent); }
.jeton-mode.actif {
    background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}

.puce-couleur {
    width: 26px; height: 26px; padding: 0; cursor: pointer;
    border: 1px solid var(--bord-fort); border-radius: 50%;
}
.puce-couleur.actif { outline: 2px solid var(--texte); outline-offset: 2px; }

.choix-couleur {
    width: 38px; height: 26px; padding: 1px;
    background: var(--fond-carte);
    border: 1px solid var(--bord-fort); border-radius: var(--r); cursor: pointer;
}
.choix-couleur:disabled { cursor: default; opacity: .6; }

.grille-theme {
    display: grid; grid-template-columns: 170px minmax(0, 1fr);
    gap: 8px 12px; align-items: center;
}
.grille-theme > label { color: var(--texte-doux); font-size: 12px; }

.ligne-logos { display: flex; align-items: flex-start; gap: 14px; }
.apercu-logo {
    width: 160px; height: 70px; object-fit: contain;
    padding: 4px; background: var(--fond-gris);
    border: 1px solid var(--bord); border-radius: var(--r);
}
.apercu-logo.vide {
    display: flex; align-items: center; justify-content: center;
    color: var(--texte-faible); font-size: 12px;
}

.ligne-fond {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 0; border-bottom: 1px solid var(--bord);
}
.ligne-fond:last-child { border-bottom: none; }

.apercu-fond {
    flex: none; width: 150px; height: 84px;
    background: var(--fond-gris);
    border: 1px solid var(--bord); border-radius: var(--r); overflow: hidden;
}
.apercu-fond img { width: 100%; height: 100%; object-fit: cover; }
.apercu-fond .vide {
    height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--texte-faible); font-size: 12px;
}

.detail-fond { flex: 1; min-width: 0; }
.actions-fond { display: flex; flex-direction: column; gap: 6px; }

/* L'InputFile se cache derrière son libellé. */
.bouton-plat.fichier { position: relative; overflow: hidden; cursor: pointer; }
.bouton-plat.fichier input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* --------------------------------------------------- les réglages d'entité */

.onglets-parametres {
    display: flex; gap: 2px; padding: 6px 10px 0 10px;
    border-bottom: 1px solid var(--bord); flex-wrap: wrap;
}

.grille-parametres {
    display: grid; grid-template-columns: 200px minmax(0, 1fr);
    gap: 10px 12px; align-items: start;
}
.grille-parametres > label { color: var(--texte-doux); font-size: 12px; padding-top: 5px; }
.grille-parametres .lecture { padding-top: 5px; }
.grille-naissance { grid-template-columns: 180px minmax(0, 1fr); }

.saisie-parametre {
    width: 100%; max-width: 460px; padding: 4px 8px; font: inherit;
    background: var(--fond-carte); color: var(--texte);
    border: 1px solid var(--bord-fort); border-radius: var(--r);
}
.saisie-parametre.court { width: 120px; }
.saisie-parametre:disabled { background: var(--fond-gris); color: var(--texte-doux); }
textarea.saisie-parametre { resize: vertical; }

.liste-capacites {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 8px; margin-bottom: 14px;
}
.case-capacite {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 10px; cursor: pointer;
    border: 1px solid var(--bord); border-radius: var(--r); background: var(--fond-carte);
}
.case-capacite:hover { border-color: var(--accent); }
.case-capacite input { margin-top: 2px; }

.table-vocabulaire .saisie-parametre { max-width: 240px; }

/* Les variables : la fiche société et les options, lues sur le schéma. */
.table-variables .col-variable {
    width: 260px; font-family: Consolas, "Courier New", monospace; font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.table-variables tr.modifiee td { background: var(--accent-survol); }
.table-variables tr.modifiee .col-variable { font-weight: 600; }
.table-variables .saisie-parametre { max-width: none; }

.table-compteurs .reste-court { color: var(--rouge); font-weight: 600; }
.table-compteurs tr.alerte-ligne td { background: var(--fond-attention); }

/* Les trois modes d'affichage, dans le bandeau de l'application.
   Un seul bouton qui tourne cachait où l'on allait : les trois sont là, et
   celui qui est en vigueur se voit. */
.modes-affichage {
    flex: none; display: flex; margin-left: 12px;
    border: 1px solid rgba(255, 255, 255, .3); border-radius: 13px;
    background: rgba(255, 255, 255, .10); overflow: hidden;
}

.modes-affichage .mode {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 24px; padding: 0; cursor: pointer;
    color: rgba(255, 255, 255, .72); background: none; border: none;
    transition: background .1s ease, color .1s ease;
}
.modes-affichage .mode + .mode { border-left: 1px solid rgba(255, 255, 255, .2); }
.modes-affichage .mode:hover { color: #fff; background: rgba(255, 255, 255, .18); }

.modes-affichage .mode.actif {
    color: var(--accent); background: #fff;
}
.modes-affichage .mode .icone { color: inherit; }

/* Ce qu'une capacité ouvre : les écrans de menu qui en dépendent. */
.case-capacite.active { border-color: var(--accent); background: var(--accent-survol); }

.ecrans-capacite {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px;
}
.jeton-ecran {
    padding: 1px 6px; font-size: 10.5px; border-radius: 9px;
    background: var(--fond-gris); border: 1px solid var(--bord); color: var(--texte-doux);
}

/* L'identité : la saisie à gauche, la fiche société en face. */
.grille-identite { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); }
.grille-identite .diverge { color: var(--orange); font-weight: 600; }

/* Les colonnes que les cases écrivent : un constat, pas une saisie. */
.table-deduites { max-width: 900px; }
.table-deduites td { vertical-align: top; }
.table-deduites .col-mini { white-space: nowrap; }

/* Intégré à la fiche de l'entité (onglet Réglages) : une seule entité, pas de liste à gauche. */
.ecran-parametres-entite.integre { padding: 0; height: auto; }
.plan-parametres-entite.sans-liste { grid-template-columns: minmax(0, 1fr); }

/* L'onglet « Comportement » de la fiche de l'entité : des cases compactes rangées par domaine, des champs courts en face de leur libellé. */
.comportement-modules { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.ligne-module { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px; align-items: start; }
.nom-module { color: var(--texte-doux); font-size: 12px; padding-top: 3px; }
.cases-module { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.case-compacte {
    display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; min-height: 22px; cursor: pointer;
    border: 1px solid var(--bord); border-radius: var(--r); background: var(--fond-carte); font-size: 12px;
}
.case-compacte:hover { border-color: var(--accent); }
.case-compacte.active { border-color: var(--accent); background: var(--accent-survol); }
.case-compacte.regle { font-weight: 600; }
.case-compacte input { margin: 0; }
.champs-comportement { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 8px; align-items: center; margin-bottom: 8px; }
.champs-comportement > label { color: var(--texte-doux); font-size: 12px; }
.champs-comportement .saisie-parametre { padding: 2px 8px; min-height: 24px; }
