﻿/* Страница управления ролями */
.roles-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Таблица ролей */
.roles-list {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 20px;
}

.roles-table {
    width: 100%;
    border-collapse: collapse;
}

    .roles-table th {
        text-align: left;
        padding: 15px;
        background: #f8f9fa;
        font-weight: 600;
        color: #333;
        border-bottom: 2px solid #e0e0e0;
    }

    .roles-table td {
        padding: 15px;
        border-bottom: 1px solid #eee;
        vertical-align: middle;
    }

    .roles-table tr:last-child td {
        border-bottom: none;
    }

    .roles-table code {
        background: #f0f0f0;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 13px;
        color: #666;
    }

    .roles-table .actions {
        display: flex;
        gap: 8px;
    }

    .roles-table .action-btn {
        width: 32px;
        height: 32px;
        border: none;
        background: #f5f5f5;
        border-radius: 8px;
        cursor: pointer;
        font-size: 14px;
        transition: all 0.2s;
    }

        .roles-table .action-btn:hover {
            background: #e0e0e0;
        }

        .roles-table .action-btn.delete:hover {
            background: #ffebee;
            color: #f44336;
        }

.badge {
    background: #e0e0e0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

/* Информация о правах */
.permissions-info {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 20px;
}

    .permissions-info h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 20px;
        color: #333;
    }

.permissions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.permission-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

    .permission-item strong {
        display: block;
        font-size: 15px;
        margin-bottom: 5px;
        color: #333;
    }

    .permission-item code {
        display: inline-block;
        background: #e8e8e8;
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 11px;
        color: #666;
        margin-bottom: 8px;
    }

    .permission-item p {
        margin: 8px 0 0;
        font-size: 13px;
        color: #888;
    }

/* Сетка прав в модальном окне */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

    .permission-checkbox:hover {
        background: #e8e8e8;
    }

    .permission-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

    .permission-checkbox .perm-name {
        flex: 1;
        font-weight: 500;
        color: #333;
    }

    .permission-checkbox .perm-key {
        font-size: 11px;
        color: #999;
    }

/* Модальное окно */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

    .modal-content h2 {
        font-size: 22px;
        margin-bottom: 25px;
        color: #333;
    }

    .modal-content h3 {
        font-size: 16px;
        margin: 20px 0 15px;
        color: #555;
    }

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

    .close-modal:hover {
        color: #333;
    }

/* Адаптивность */
@media (max-width: 768px) {
    .roles-container {
        grid-template-columns: 1fr;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }

    .roles-table {
        font-size: 14px;
    }

        .roles-table th,
        .roles-table td {
            padding: 10px;
        }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 15px;
}

.loader {
    text-align: center;
    padding: 30px;
    color: #666;
}
