/*
 * LNK Reassurance - back-office : ce qui n'est qu'a Reassurance. L'habillage (en-tete, rubriques,
 * cartes, champs, boutons, liste) est la feuille commune de l'usine, views/css/lib/lnk-admin.css,
 * chargee avant celle-ci ; l'apercu, views/css/lib/lnk-admin-preview.css. Aucune regle .lnkh-*
 * ici : seulement des classes rea-* et lnkrea-*, sous la racine .lnkh (controle admin-skin).
 * Couleurs : variables --lnkh-*.
 *
 * @author    LNKBOOT
 * @copyright LNKBOOT
 * @license   Proprietaire
 */

/* Back-office classique : l'en-tete de page du coeur est remplace par celui du module, mais
   #content garde la marge prevue pour lui. Limite a la page du module. */
body.adminlnkreassurance #content.bootstrap.no-header-toolbar { padding-top: 60px; }

.lnkh .rea-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Liste : bande des icones a la place de la vignette, puis le bandeau, l'etat et les actions. */
.lnkh .lnkrea-row { grid-template-columns: 122px minmax(0, 1fr) auto; }
.lnkh .lnkrea-row .lnkrea-row__side { grid-column: auto; }
.lnkh .lnkrea-row__main { min-width: 0; }
.lnkh .lnkrea-icons { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px; padding: 8px; color: var(--lnkh-ink); }
.lnkh .lnkrea-icons span { display: inline-flex; }
.lnkh .lnkrea-icons svg { width: 20px; height: 20px; }
.lnkh .lnkrea-group__name { font-weight: 600; color: var(--lnkh-ink); }
@container (max-width: 780px) {
    .lnkh .lnkrea-row { grid-template-columns: 122px minmax(0, 1fr); }
    .lnkh .lnkrea-row .lnkrea-row__side { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 767px) {
    .lnkh .lnkrea-row { grid-template-columns: minmax(0, 1fr); }
    .lnkh .lnkrea-row .lnkrea-row__side { grid-column: auto; }
}

/* Nombre avec sa plage autorisee. */
.lnkh .rea-number { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Le back-office 1.7 et 8 met les champs nombre en pleine largeur : regle plus precise, le champ
   retrecit et l'intervalle reste a cote, dans la colonne. */
.lnkh .rea-number input[type="number"] { flex: 1 1 auto; width: auto; min-width: 0; max-width: 140px; padding-left: 12px; padding-right: 8px; }
.lnkh .rea-number__range { flex: 0 0 auto; font-size: 12px; color: var(--lnkh-muted); white-space: nowrap; }

/* Couleur : pastille, saisie hexadecimale, bouton « Theme » (vide = couleur du theme). */
.lnkh .rea-color { display: flex; align-items: center; gap: 8px; }
.lnkh .rea-color__swatch { flex: 0 0 40px; width: 40px; height: 40px; padding: 3px; border: 1px solid #d9d6cf; border-radius: 8px; background: #fff; cursor: pointer; }
.lnkh .rea-color.is-theme .rea-color__swatch { background: repeating-conic-gradient(#e7e4de 0 25%, #fff 0 50%) 50% / 12px 12px; }
.lnkh .rea-color.is-theme .rea-color__swatch::-webkit-color-swatch { opacity: 0; }
.lnkh .rea-color.is-theme .rea-color__swatch::-moz-color-swatch { opacity: 0; }
.lnkh .rea-color .rea-color__text, .lnkh .rea-color input[type="text"] { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lnkh .rea-color__theme { flex: 0 0 auto; min-height: 40px; padding: 6px 10px; border: 1px solid #d9d6cf; border-radius: 8px; background: #fff; color: var(--lnkh-muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.lnkh .rea-color.is-theme .rea-color__theme { background: var(--lnkh-soft); color: var(--lnkh-ink); }
.lnkh .rea-color .colorpicker-element, .lnkh .rea-color .input-group { flex: 1 1 auto; min-width: 0; width: auto; }

/* Elements du bandeau : repliables, dans l'ordre, avec leur icone. */
.lnkh .rea-items { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.lnkh .rea-item { border: 1px solid var(--lnkh-line); border-radius: 10px; background: var(--lnkh-card); }
.lnkh .rea-item.is-open { border-color: var(--lnkh-ink); }
.lnkh .rea-item__bar { display: flex; align-items: center; gap: 8px; padding: 8px; }
.lnkh .rea-item__summary { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; padding: 2px; border: 0; background: transparent; font: inherit; text-align: start; cursor: pointer; color: var(--lnkh-ink); }
.lnkh .rea-item__icon { flex: 0 0 40px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 9px; background: var(--lnkh-soft); color: var(--lnkh-ink); }
.lnkh .rea-item__icon svg { width: 22px; height: 22px; }
.lnkh .rea-item__text { display: flex; flex-direction: column; min-width: 0; }
.lnkh .rea-item__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lnkh .rea-item__title.is-empty { color: var(--lnkh-muted); font-style: italic; font-weight: 400; }
.lnkh .rea-item__sub { font-size: 12px; color: var(--lnkh-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lnkh .rea-item__tools { display: flex; gap: 6px; flex: 0 0 auto; }
.lnkh .rea-item__body { padding: 14px 12px; border-top: 1px solid var(--lnkh-line); }

/* Grille d'icones et import d'une icone SVG. */
.lnkh .rea-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.lnkh .rea-icons__btn { display: flex; align-items: center; justify-content: center; height: 40px; padding: 0; border: 1px solid var(--lnkh-line); border-radius: 8px; background: #fff; color: var(--lnkh-ink); cursor: pointer; }
.lnkh .rea-icons__btn svg { width: 20px; height: 20px; }
.lnkh .rea-icons__btn[aria-pressed="true"] { background: var(--lnkh-ink); border-color: var(--lnkh-ink); color: #fff; }
.lnkh .rea-icons__btn--none { grid-column: span 2; font: inherit; font-size: 12px; font-weight: 600; }
.lnkh .rea-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--lnkh-line); }
.lnkh .rea-upload__btn { position: relative; cursor: pointer; }
.lnkh .rea-upload__btn:focus-within { outline: 2px solid var(--lnkh-lang); outline-offset: 2px; }
.lnkh .rea-upload__mode { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.lnkh .rea-upload__mode label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--lnkh-text); cursor: pointer; }
.lnkh .rea-upload__mode input { margin: 0; accent-color: var(--lnkh-ink); }
.lnkh .rea-upload p { flex: 1 1 100%; margin: 0; }
.lnkh .rea-upload [data-rea-upload-status]:empty { display: none; }

/* Multiboutique : boutiques du bandeau (editeur) et nom des boutiques dans la liste. */
.lnkh .rea-shops { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.lnkh .rea-shops__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lnkh .rea-shops__row .lnkrea-switch { font-size: 13px; }
.lnkh .lnkrea-shop-switches { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.lnkh .rea-shops legend { width: 100%; margin: 0 0 4px; padding: 0; border: 0; }
.lnkh .rea-shops__item { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--lnkh-text); cursor: pointer; }
.lnkh .rea-shops__item input { margin: 0; accent-color: var(--lnkh-ink); }
.lnkh .lnkrea-shop { font-weight: 600; }

/* Reglages fins d'un panneau (regle « Simplicite » de l'usine) : bloc « Avance » replie. */
.lnk-rea-app .rea-advanced { grid-column: 1 / -1; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--lnkh-line); }
.lnk-rea-app .rea-advanced > summary { display: list-item; margin-bottom: 14px; list-style: disclosure-closed inside; font-weight: 600; color: var(--lnkh-ink); cursor: pointer; }
.lnk-rea-app .rea-advanced[open] > summary { list-style-type: disclosure-open; }
.lnkh .lnkrea-move:disabled { opacity: .35; cursor: default; border-color: #d9d6cf; }
.lnkh .lnkrea-inactive .rea-color { opacity: .45; pointer-events: none; }
.lnkh .lnkrea-native-notice { margin: 0 0 16px; }
.lnkh .rea-name { padding-bottom: 0; }
.lnkh [data-rea-upload-status].is-error { color: #b42318; font-weight: 600; }
.lnkh [data-rea-upload-status].is-ok { color: #1a7f37; }
/* Bouton d'import : libelle centre verticalement, comme les autres boutons (#17). */
.lnkh .rea-upload__btn { display: inline-flex; align-items: center; justify-content: center; }
/* Liste : libelle de l'interrupteur a largeur fixe, les interrupteurs restent alignes que le
   bandeau soit actif ou non (#21). */
.lnkh .lnkrea-switch--row { min-width: 6.5em; justify-content: flex-start; }
.lnkh .lnkrea-switch--shop { min-width: 13em; justify-content: flex-start; font-size: 12px; white-space: nowrap; }
.lnkh .rea-icons__cell { position: relative; display: block; }
.lnkh .rea-icons__cell .rea-icons__btn { width: 100%; }
.lnkh .rea-icons__del { position: absolute; top: -6px; right: -6px; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 1px solid var(--lnkh-line); border-radius: 50%; background: #fff; color: #b42318; font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.lnkh .rea-icons__cell:hover .rea-icons__del, .lnkh .rea-icons__del:focus { opacity: 1; }
/* Rangee seule dans son emplacement (sans Monter / Descendre) : la place des deux boutons est gardee, les interrupteurs restent alignes d'une rangee a l'autre. */
.lnkh .lnkrea-move-spacer { display: inline-block; width: 70px; }
/* Fenetre de confirmation de suppression (#36). */
.lnkrea-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 15, 15, .45); }
.lnkrea-modal__box { width: 100%; max-width: 440px; padding: 22px 24px; border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); font-size: 14px; color: #232323; }
.lnkrea-modal__title { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.lnkrea-modal__text { margin: 0 0 20px; color: #6c6c6c; }
.lnkrea-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
.lnkrea-modal .lnkrea-modal__danger { border-color: #b42318; background: #b42318; color: #fff; }
.lnkrea-modal .lnkrea-modal__danger:hover, .lnkrea-modal .lnkrea-modal__danger:focus { border-color: #8f1c13; background: #8f1c13; color: #fff; }
/* Onglet Mobile : blocs montres ou masques selon « Masquer le bandeau sur mobile ». */
.lnkh [data-rea-mobile-on][hidden], .lnkh [data-rea-mobile-off][hidden] { display: none; }
/* Ligne a coller dans le theme, avec « Copier » (#28, #54). */
.lnkh .lnkrea-snippet__line { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 6px 6px 10px; padding-inline: 10px 6px; border: 1px solid var(--lnkh-line); border-radius: 8px; background: var(--lnkh-soft); }
.lnkh .lnkrea-snippet__line[hidden] { display: none; }
.lnkh .lnkrea-snippet code, .lnkh .lnkrea-snippet__line code { flex: 1 1 auto; min-width: 0; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: nowrap; color: var(--lnkh-ink); }
.lnkh .lnkrea-snippet--inline { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: 12px; }
/* Apercu en direct (#16, #39) : des 1200 px il reste a cote du formulaire, dans une colonne plus
   large que le formulaire ; de 1200 a 1499 px le menu ne garde que ses icones (libelle en infobulle)
   pour lui laisser la place. Le rendu ordinateur se fait a 992 px (mise en page ordinateur du theme),
   donc a plus de 50 % de sa taille, et la scene suit la hauteur du bandeau. */
.lnkh .lnkrea-preview [data-lnk-preview-stage][data-device="desktop"] { min-height: 0; }
@media (min-width: 1200px) {
    .lnkh:not(.lnk-preview--full) .lnkrea-editor { grid-template-columns: 236px minmax(0, 1fr) minmax(0, 1.35fr); }
    .lnkh:not(.lnk-preview--full) .lnkrea-editor > .lnkrea-preview { position: sticky; top: 72px; grid-column: auto; }
}
@media (min-width: 1200px) and (max-width: 1499px) {
    .lnkh:not(.lnk-preview--full) .lnkrea-editor { grid-template-columns: 66px minmax(0, 1fr) minmax(0, 1.35fr); }
    .lnkh .lnkrea-editor nav a { position: relative; grid-template-columns: 32px; justify-content: center; }
    .lnkh .lnkrea-editor nav [data-rea-dirty] { position: absolute; top: 4px; inset-inline-end: 4px; }
    .lnkh .lnkrea-editor .lnkrea-nav-group { display: none; }
    .lnkh .lnkrea-editor .lnkrea-nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
