.roles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.role-item {
    background: linear-gradient(180deg, #16233f, #0f172a);
    padding: 18px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.04);
}

.role-main {
    display: flex;
    justify-content: space-between;
}

.role-label {
    font-weight: 600;
}

.role-id {
    font-size: 12px;
    color: #94a3b8;
}

.role-perms span {
    margin-right: 10px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #1e293b;
    color: #64748b;
}

.role-perms span.active {
    background: #1d4ed8;
    color: white;
}

.role-perms span.admin {
    background: #7c3aed;
}

.btn-primary {
    background: #1d4ed8;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
}

.btn-danger {
    background: #dc2626;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
}

.form-group {
    margin-bottom: 15px;
}

.roles-permissions label {
    margin-right: 15px;
    font-size: 13px;
}

/* =========================
   Scrollbar clean (modal)
========================= */

#permsList {
    padding-right: 6px; /* évite que le texte colle à la scrollbar */
    scrollbar-width: thin;                 /* Firefox */
    scrollbar-color: rgba(255,255,255,.22) rgba(255,255,255,.06);
}

#permsList::-webkit-scrollbar {
    width: 10px;
}

#permsList::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

#permsList::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.22);
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.06); /* effet clean */
}

#permsList::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.32);
}

/* =========================
   Buttons
========================= */

.modal-footer .btn {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.12);
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: .15s ease;
    font-weight: 600;
}

.modal-footer .btn:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.18);
    transform: translateY(-1px);
}

.modal-footer .btn:active {
    transform: translateY(0px);
}

.modal-footer .btn-success {
    border-radius: 12px !important;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

/* =========================
   PERMISSIONS MODAL (upgrade)
========================= */

.perms-toolbar{
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:12px;
}

.perms-search{
    flex:1;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: rgba(255,255,255,.92);
    padding: 10px 12px;
    border-radius: 12px;
    outline: none;
}

.perms-search::placeholder{
    color: rgba(255,255,255,.35);
}

.perms-quick{
    display:flex;
    gap:8px;
}

.perms-quick .btn-mini{
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.9);
    padding: 8px 10px;
    border-radius: 12px;
    cursor:pointer;
    font-weight:600;
    transition:.15s ease;
    font-size:12px;
}

.perms-quick .btn-mini:hover{
    background: rgba(255,255,255,.12);
    transform: translateY(-1px);
}

.perms-section{
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 12px;
}

.perms-section + .perms-section{ margin-top:10px; }

.perms-section-header{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    margin-bottom:10px;
}

.perms-section-title{
    font-weight:800;
    letter-spacing:.2px;
}

.perms-section-sub{
    font-size:12px;
    opacity:.7;
}

.perms-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:10px;
}

@media (max-width: 720px){
    .perms-grid{ grid-template-columns: 1fr; }
}

.perm-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 12px;
    border-radius:12px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255,255,255,.06);
}

.perm-left{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.perm-label{
    font-weight:700;
    font-size:13px;
}

.perm-key{
    font-size:11px;
    opacity:.55;
}

/* Switch */
.perm-switch{
    position:relative;
    width:44px;
    height:26px;
    flex:0 0 auto;
}

.perm-switch input{
    opacity:0;
    width:0;height:0;
}

.perm-slider{
    position:absolute;
    inset:0;
    cursor:pointer;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    transition:.15s ease;
    border-radius:999px;
}

.perm-slider:before{
    content:"";
    position:absolute;
    width:20px;height:20px;
    left:3px; top:2px;
    background: rgba(255,255,255,.92);
    border-radius:999px;
    transition:.15s ease;
}

.perm-switch input:checked + .perm-slider{
    background: rgba(29, 78, 216, .85);
    border-color: rgba(29, 78, 216, .95);
}

.perm-switch input:checked + .perm-slider:before{
    transform: translateX(18px);
}

/* Role tags become nicer */
.role-perms{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.role-perms span{
    margin-right:0;
    font-size:12px;
    padding:5px 10px;
    border-radius:999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.60);
}
.role-perms span.active{
    background: rgba(29, 78, 216, .18);
    border-color: rgba(29, 78, 216, .35);
    color: rgba(255,255,255,.92);
}
.role-perms span.staff{
    background: rgba(234, 179, 8, .14);
    border-color: rgba(234, 179, 8, .30);
}