core/panel/styles/RoleManager.module.css

369 lines
6.1 KiB
CSS
Raw Normal View History

2025-07-02 19:30:21 +00:00
/* ==============================
МЕНЕДЖЕР РОЛЕЙ - ЕДИНООБРАЗНЫЙ ДИЗАЙН
============================== */
/* Основной контейнер */
.roleManager {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
/* ==============================
СЕКЦИИ
============================== */
.section {
background: #ffffff;
border-radius: 12px;
padding: 1.5rem;
border: 1px solid #e5e7eb;
}
.sectionHeader {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.sectionTitle {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 1rem;
font-weight: 600;
color: #374151;
margin: 0;
}
.sectionDescription {
color: #6b7280;
font-size: 0.875rem;
margin: 0 0 1.25rem 0;
line-height: 1.4;
}
.icon {
font-size: 1.1rem;
}
.required {
color: #ef4444;
font-weight: 600;
}
/* ==============================
КНОПКА ДОБАВЛЕНИЯ
============================== */
.addButton {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: #3b82f6;
color: white;
border: none;
max-width: 24em;
border-radius: 8px;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.addButton:hover {
background: #2563eb;
transform: translateY(-1px);
}
/* ==============================
СЕТКА РОЛЕЙ
============================== */
.rolesGrid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
}
/* ==============================
КАРТОЧКИ РОЛЕЙ - ЕДИНООБРАЗНЫЙ ДИЗАЙН
============================== */
.roleCard {
background: #ffffff;
border: 1px solid #e5e7eb;
border-radius: 12px;
padding: 1rem;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
display: flex;
flex-direction: column;
min-height: 120px;
}
/* Состояния карточек - ОДИНАКОВЫЕ ДЛЯ ВСЕХ */
.roleCard:hover:not(.disabled) {
border-color: #3b82f6;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
transform: translateY(-2px);
}
.roleCard.selected {
border-color: #3b82f6;
background: #f0f9ff;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
/* Заблокированные роли (администратор) */
.roleCard.disabled {
opacity: 0.75;
cursor: not-allowed;
background: #f9fafb;
border-color: #d1d5db;
}
.roleCard.disabled::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: repeating-linear-gradient(
45deg,
transparent,
transparent 8px,
rgba(156, 163, 175, 0.1) 8px,
rgba(156, 163, 175, 0.1) 16px
);
border-radius: inherit;
pointer-events: none;
}
/* ==============================
СОДЕРЖИМОЕ КАРТОЧЕК
============================== */
.roleHeader {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 0.75rem;
}
.roleIcon {
font-size: 1.5rem;
opacity: 0.8;
}
.roleActions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.removeButton {
background: none;
border: none;
cursor: pointer;
font-size: 0.75rem;
opacity: 0.6;
transition: all 0.2s ease;
padding: 0.25rem;
border-radius: 4px;
color: #ef4444;
}
.removeButton:hover {
opacity: 1;
background: rgba(239, 68, 68, 0.1);
}
.roleContent {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.roleName {
font-size: 0.925rem;
font-weight: 600;
color: #374151;
margin: 0;
line-height: 1.3;
}
.roleDescription {
font-size: 0.8rem;
color: #6b7280;
margin: 0;
line-height: 1.4;
flex: 1;
}
.disabledNote {
font-size: 0.75rem;
color: #9ca3af;
font-style: italic;
margin-top: 0.25rem;
}
/* ==============================
ЧЕКБОКСЫ - ЕДИНООБРАЗНЫЕ
============================== */
.checkbox {
display: flex;
align-items: center;
margin-top: auto;
}
.checkbox input {
width: 18px;
height: 18px;
margin: 0;
cursor: pointer;
accent-color: #3b82f6;
}
.checkbox input:disabled {
cursor: not-allowed;
opacity: 0.6;
}
/* ==============================
ФОРМА ДОБАВЛЕНИЯ РОЛИ
============================== */
.addRoleForm {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 1.5rem;
margin-top: 1rem;
}
.addRoleTitle {
font-size: 1rem;
font-weight: 600;
color: #374151;
margin: 0 0 1rem 0;
}
.addRoleFields {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-bottom: 1.5rem;
}
.fieldGroup {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.fieldLabel {
font-size: 0.875rem;
font-weight: 500;
color: #374151;
}
.fieldInput {
padding: 0.75rem;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 0.875rem;
transition: border-color 0.2s ease;
}
.fieldInput:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.fieldInput.error {
border-color: #ef4444;
}
.fieldError {
font-size: 0.75rem;
color: #ef4444;
margin-top: 0.25rem;
}
.addRoleActions {
display: flex;
gap: 0.75rem;
justify-content: flex-end;
}
.cancelButton,
.primaryButton {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 8px;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.cancelButton {
background: #f3f4f6;
color: #374151;
}
.cancelButton:hover {
background: #e5e7eb;
}
.primaryButton {
background: #3b82f6;
color: white;
}
.primaryButton:hover {
background: #2563eb;
transform: translateY(-1px);
}
/* ==============================
АДАПТИВНОСТЬ
============================== */
@media (max-width: 768px) {
.sectionHeader {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
.rolesGrid {
grid-template-columns: 1fr;
}
.addRoleFields {
grid-template-columns: 1fr;
}
.section {
padding: 1rem;
}
.addRoleActions {
flex-direction: column;
}
.cancelButton,
.primaryButton {
width: 100%;
}
}