/* Основные стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Боковое меню */
.sidebar {
    min-height: 100vh;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 1.25rem;
    text-align: center;
}

/* Основной контент */
main {
    background-color: #fff;
    min-height: 100vh;
    border-radius: 0.5rem;
    margin: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

/* Заголовки */
h1, h2, h3 {
    color: #2c3e50;
    font-weight: 600;
}

/* Таблицы */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.table thead th {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Кнопки */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* Бейджи */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* Карточки */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Модальные окна */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
    color: #2c3e50;
    font-weight: 600;
}

/* Формы */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    transform: scale(1.02);
}

/* Алерты */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Чекбоксы для доступов */
.access-checkbox {
    margin: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.access-checkbox:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.access-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.access-checkbox label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    margin: 0;
}

/* Группировка по концепциям */
.concept-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: 0.5rem;
    border-left: 4px solid #007bff;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.concept-group h6 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-pane {
    animation: fadeIn 0.3s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        width: 100%;
        height: auto;
        min-height: auto;
    }
    
    main {
        margin: 0;
        border-radius: 0;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Темная тема (опционально) */
.dark-theme {
    background-color: #1a1a1a;
    color: #fff;
}

.dark-theme .card {
    background-color: #2d2d2d;
    color: #fff;
}

.dark-theme .table {
    background-color: #2d2d2d;
    color: #fff;
}

.dark-theme .form-control {
    background-color: #3d3d3d;
    color: #fff;
    border-color: #4d4d4d;
}

/* Кастомные скроллбары */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Улучшенные фокусы для доступности */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Анимация загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
