/* ═══════════════════════════════════════════════════════════
   DTISoft — Modèles d'autorisations (éditeur popup + liste)
   La matrice elle-même vit dans perm-matrix.css (préfixe pm-).
   ═══════════════════════════════════════════════════════════ */

.ga-overlay {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
}
.ga-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    width: 560px; max-height: 90vh;
    display: flex; flex-direction: column;
    font-size: 13px;
}

/* Header */
.ga-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: var(--gray-100); border-bottom: 1px solid var(--gray-300);
    border-radius: 6px 6px 0 0;
    font-weight: 700; font-size: 14px; color: var(--gray-700);
}
.ga-close {
    background: none; border: none; cursor: pointer;
    font-size: 16px; color: var(--gray-500); padding: 2px 6px;
}
.ga-close:hover { color: var(--gray-800); }

/* Libellé field */
.ga-field {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px 4px;
}
.ga-field label {
    font-size: 13px; color: var(--gray-600); flex: 0 0 50px;
}
.ga-field input {
    flex: 1; font-size: 13px; padding: 4px 6px; height: 26px;
    border: 1px solid var(--gray-300); border-radius: 2px;
    background: var(--white); color: var(--gray-800); font-family: inherit;
}
.ga-field input:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary);
}

/* Title */
.ga-title {
    padding: 8px 16px 4px; font-weight: 600; font-size: 12px;
    color: var(--gray-500); text-transform: uppercase; letter-spacing: .03em;
}

/* (grille matricielle : voir perm-matrix.css — classes pm-*) */

/* Footer */
.ga-footer {
    display: flex; justify-content: space-between;
    padding: 8px 16px;
    background: var(--gray-100); border-top: 1px solid var(--gray-300);
    border-radius: 0 0 6px 6px;
    font-size: 11px; color: var(--gray-500);
}

/* ── Éditeur de modèle : barre d'actions (rename/duplicate/delete/reapply) ── */
.ga-actions {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 6px 16px 2px;
}
.ga-act-btn {
    padding: 4px 10px; font-size: 12px; cursor: pointer;
    border: 1px solid var(--gray-300); border-radius: 4px;
    background: var(--white); color: var(--gray-700); font-family: inherit;
}
.ga-act-btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.ga-act-btn:disabled { opacity: .5; cursor: not-allowed; }
.ga-act-danger { border-color: #fecaca; color: #b91c1c; }
.ga-act-danger:hover { background: #fef2f2; border-color: #fca5a5; }
.ga-lock-note {
    font-size: 11px; color: #b45309; font-style: italic;
    display: inline-flex; align-items: center; gap: 4px;
}

/* Conteneur de la matrice partagée (pm-grid-wrap à l'intérieur) */
.ga-matrix {
    flex: 1; min-height: 0; display: flex;
    margin: 0 16px;
}
.ga-matrix .pm-grid-wrap { flex: 1; }

/* ── Module liste « Modèles d'autorisations » ── */
.ga-tpl-wrap {
    padding: 10px 14px; overflow: auto; height: 100%;
}
.ga-tpl-table {
    width: 100%; max-width: 560px;
    border-collapse: collapse; font-size: 13px;
    border: 1px solid var(--gray-300); border-radius: 3px;
    background: var(--white);
}
.ga-tpl-table thead th {
    background: var(--gray-100); padding: 6px 10px;
    text-align: left; font-weight: 600; color: var(--gray-600);
    border-bottom: 1px solid var(--gray-300); font-size: 12px;
}
.ga-tpl-table td {
    padding: 5px 10px; border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700); cursor: default; user-select: none;
}
.ga-tpl-table tbody tr:hover td { background: #f0f5ff; }
.ga-tpl-table tbody tr.row-selected td { background: #dbeafe; }
.ga-tpl-sys { width: 90px; text-align: center; color: var(--gray-500); }
.ga-tpl-icon { margin-right: 8px; color: var(--gray-400); }
.ga-tpl-hint {
    max-width: 560px; margin-top: 8px;
    font-size: 11px; color: var(--gray-500); font-style: italic; line-height: 1.5;
}
