/* ==========================================================================
   UTILISATEURS ET RÔLES — LE CORPS DES QUINZE MODULES (.scp-*)
   Components/Shared/EcranSecuriteModule.razor. Port de « design_handoff_roles_easytime »
   (2026-10-03) : tuiles, bandeau et onglets viennent du gabarit (.mx-tuiles, .mx-signal,
   .mx-vues) ; cette feuille porte la liste des comptes — table au bureau, une carte par
   compte sous 1024 px —, la matrice rôle × geste au bureau, la vue « un rôle à la fois »
   sous 1024 px, et la fenêtre des bornes. Aucune couleur en dur.
   ========================================================================== */
.appgrid .scp-attente { padding: 18px; color: var(--et-muted); font-size: 13px; }
.appgrid .scp-note { margin: 0; font-size: 13px; color: var(--et-muted); line-height: 1.5; }
.appgrid .scp-note strong { color: var(--et-ink); font-weight: 600; }
.appgrid .scp-signal-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* --- La barre de la liste ------------------------------------------------- */
.appgrid .scp-barre-liste { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--et-hairline); }
.appgrid .scp-recherche {
    flex: 1 1 240px; max-width: 420px; display: flex; align-items: center; gap: 8px;
    height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--et-bord-champ); background: var(--et-surface);
}
.appgrid .scp-recherche .bi { color: var(--et-muted); }
.appgrid .scp-recherche input { flex: 1; align-self: stretch; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--et-ink); }
.appgrid .scp-recherche input:focus { outline: none; }
.appgrid .scp-recherche:focus-within { border-color: var(--et-form-blue); }
.appgrid .scp-filtre-role { height: 44px; width: auto; }
.appgrid .scp-lien-comptes { min-height: 44px; margin-left: auto; }

/* --- La liste des comptes -------------------------------------------------- */
.appgrid .scp-id { font-family: var(--et-font-mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.appgrid .scp-gestes { font-family: var(--et-font-mono); white-space: nowrap; }
.appgrid .scp-marque { margin-left: 6px; padding: 1px 6px; background: var(--et-surface-2); border: 1px solid var(--et-form-border); font-family: var(--et-font); font-size: 12px; font-weight: 600; color: var(--et-muted); }
.appgrid .scp-borne { font-size: 13px; color: var(--et-muted); }
.appgrid .scp-borne.est-borne { color: var(--et-ink); font-weight: 600; }
.appgrid .scp-vu { font-size: 13px; color: var(--et-muted); white-space: nowrap; }

/* --- La matrice rôle × geste (bureau) -------------------------------------- */
.appgrid .scp-matrice-cadre { overflow-x: auto; }
.appgrid .scp-matrice { width: 100%; border-collapse: collapse; font-size: 14px; }
.appgrid .scp-matrice thead th {
    position: sticky; top: 0; z-index: 2; background: var(--et-table-head); color: var(--et-sur-ardoise-plein);
    padding: var(--et-cellule-tete-y) 6px; text-align: center; font-size: 12px; font-weight: 600; vertical-align: bottom;
}
/* L'en-tête « Geste » sur l'ardoise : la règle collante du corps (.scp-geste, fond surface)
   le peignait en blanc sur blanc — 1,00:1 au banc. Elle ne vaut plus que pour les cellules. */
.appgrid .scp-matrice thead th.scp-geste { text-align: left; padding-left: 12px; }
.appgrid .scp-matrice thead th.scp-col-figee { color: var(--et-sur-ardoise); }
.appgrid .scp-role { display: block; }
.appgrid .scp-role-n { display: block; font-weight: 400; color: var(--et-sur-ardoise); }
.appgrid .scp-matrice td { padding: var(--et-cellule-y) 12px; border-bottom: 1px solid var(--et-rang); }
@media (max-width: 1024px) { .appgrid .scp-matrice td { height: 44px; } }   /* règle tactile (lot AK2) */
.appgrid .scp-matrice tbody tr:hover td { background: var(--et-survol); }
.appgrid .scp-matrice td.scp-geste { position: sticky; left: 0; z-index: 1; min-width: 280px; background: var(--et-surface); }
.appgrid .scp-matrice tbody tr:hover td.scp-geste { background: var(--et-survol); }
.appgrid .scp-code { display: block; font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted); }
.appgrid .scp-matrice .scp-case { text-align: center; width: 120px; }
.appgrid .scp-matrice .scp-case input { cursor: pointer; }
.appgrid .scp-matrice .scp-case input:disabled { cursor: not-allowed; }
.appgrid .scp-matrice tr.scp-domaine th {
    padding: 8px 12px; background: var(--et-surface-2); border-bottom: 1px solid var(--et-hairline);
    text-align: left; font-size: 13px; font-weight: 700; color: var(--et-ink);
}
.appgrid .scp-domaine .n, .appgrid .scp-un-domaine .n { font-weight: 400; color: var(--et-muted); }

/* --- Un rôle à la fois (sous 1024 px) --------------------------------------- */
.appgrid .scp-un-role { display: none; }
.appgrid .scp-choix-role { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--et-hairline); }
.appgrid .scp-choix-role .lbl { font-size: 13px; font-weight: 600; color: var(--et-ink); }
.appgrid .scp-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.appgrid .scp-puce {
    min-height: 44px; padding: 0 12px; background: var(--et-surface); border: 1px solid var(--et-form-border);
    font: inherit; font-size: 13px; font-weight: 600; color: var(--et-ink); cursor: pointer;
}
.appgrid .scp-puce.est-actif { background: var(--et-tint); border-color: var(--et-form-blue); color: var(--et-form-blue-d); }
.appgrid .scp-un-domaine { padding: 8px 16px; background: var(--et-surface-2); border-bottom: 1px solid var(--et-hairline); font-size: 13px; font-weight: 700; color: var(--et-ink); }
.appgrid .scp-un-geste { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 0; padding: 4px 16px; border-bottom: 1px solid var(--et-rang); cursor: pointer; }
.appgrid .scp-un-geste .txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; color: var(--et-ink); }
.appgrid .scp-un-geste input { width: 24px; height: 24px; flex: none; accent-color: var(--et-form-blue); }

.appgrid .scp-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--et-hairline); }
.appgrid .scp-barre .scp-note { flex: 1 1 260px; }
.appgrid .scp-barre .mx-btn { min-height: 44px; }

/* ----------------------------------------------------------------------------
   4. LA FENÊTRE DES BORNES
   -------------------------------------------------------------------------- */

.appgrid .scp-champ { margin-top: 11px; }
.appgrid .scp-champ > label { display: block; margin-bottom: 3px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--et-muted); }
.appgrid .scp-aide { margin-top: 3px; font-size: 12px; color: var(--et-faint); line-height: 1.4; }
.appgrid .scp-aide strong { color: var(--et-ink); font-weight: 600; }
.appgrid .scp-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

.appgrid .scp-jetons { display: flex; flex-wrap: wrap; gap: 6px; }
.appgrid .scp-jeton { height: 30px; padding: 0 11px; background: var(--et-surface); border: 1px solid var(--et-form-border); font-family: var(--et-font-mono); font-size: 13px; font-weight: 600; color: var(--et-ink); cursor: pointer; }
.appgrid .scp-jeton:hover { border-color: var(--et-form-blue); color: var(--et-lien); }
.appgrid .scp-jeton.est-actif { background: var(--et-form-blue); border-color: var(--et-form-blue); color: var(--et-sur-aplat); }

/* --------------------------------------------------------------------------
   PALIERS — géométrie seulement.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .appgrid .scp-jeton { min-height: 44px; padding: 0 14px; }
    .appgrid .scp-lien-comptes { margin-left: 0; }
    .appgrid .scp-barre .scp-note a { display: inline-flex; align-items: center; min-height: 44px; }

    .appgrid .scp-id { order: 1; }
    .appgrid .scp-role-c { order: 4; font-weight: 600; }
    .appgrid .scp-gestes { order: 5; }
    .appgrid .scp-gestes::after { content: " " attr(data-unite); font-family: var(--et-font); }
    .appgrid .scp-borne { order: 6; }
    .appgrid .scp-vu { order: 7; }

    /* La matrice cède la place à la vue d'un rôle. */
    .appgrid .scp-matrice-cadre { display: none; }
    .appgrid .scp-un-role { display: block; }
}
@container scp-cadre (max-width: 999px) {
    .appgrid .scp-id { order: 1; }
    .appgrid .scp-role-c { order: 4; font-weight: 600; }
    .appgrid .scp-gestes { order: 5; }
    .appgrid .scp-gestes::after { content: " " attr(data-unite); font-family: var(--et-font); }
    .appgrid .scp-borne { order: 6; }
    .appgrid .scp-vu { order: 7; }
}
@media (max-width: 720px) {
    .appgrid .scp-deux { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .appgrid .scp-barre .mx-btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------------------------------------------------------------------------
   LES RÔLES TYPES D'UN MODULE (2026-10-25) — des cartes au-dessus de la matrice : l'intitulé,
   l'état dans le dossier (absent / à jour / modifié), ce que le rôle fait, et le geste qui le
   crée ou le réaligne. Une grille qui se replie : quatre de front au bureau, une par ligne au
   téléphone.
   --------------------------------------------------------------------------- */
.appgrid .scp-types { padding: 12px 0 16px; }
.appgrid .scp-types-titre {
    margin: 0 0 8px; font-size: var(--et-fs-tete, 14px); font-weight: 600; color: var(--et-ink);
}
.appgrid .scp-types-grille {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.appgrid .scp-type {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px; background: var(--et-surface); border: 1px solid var(--et-hairline);
}
.appgrid .scp-type-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.appgrid .scp-type-nom { font-weight: 600; color: var(--et-ink); }
.appgrid .scp-type-desc { font-size: 13px; color: var(--et-muted); flex: 1; }
.appgrid .scp-type-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.appgrid .scp-type-n { font-size: 12px; color: var(--et-muted); }
.appgrid .scp-complement { white-space: nowrap; }
.appgrid .scp-complement-lbl { display: none; color: var(--et-muted); }
@media (max-width: 1024px) {
    .appgrid .mx-liste-cartes .scp-complement-lbl { display: inline; }
}
