/**
 * PROFILE.CSS
 * Единый файл стилей для личного кабинета всех ролей
 * (user, admin_tutor, admin_organization, super_admin)
 */

/* ============================================
   ОБЩИЕ СТИЛИ
   ============================================ */

* {
    box-sizing: border-box;
}

#profileApp {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   КОНТЕЙНЕР С ДАННЫМИ ПОЛЬЗОВАТЕЛЯ
   ============================================ */

.user-data-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    gap: 25px;
    position: relative;
}

.user-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    flex-shrink: 0;
    color: white;
}

.user-info-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-full-name {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.user-contact-info {
    font-size: 16px;
    color: #666;
}

.user-contact-info strong {
    color: #333;
    font-weight: 600;
}

.user-info-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 200px;
}

.admin-status-badge {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.admin-access-period {
    font-size: 15px;
    color: #666;
    text-align: right;
}

.admin-access-period strong {
    color: #333;
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-edit-profile {
    margin-top: 15px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-edit-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================
   РАЗДЕЛ ИНФОРМАЦИЯ О ПРАВАХ
   ============================================ */

.profile-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    color: white;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    opacity: 0.9;
}

.info-value {
    font-weight: 600;
}

.no-tests-message {
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    text-align: center;
    font-style: italic;
    opacity: 0.9;
}

/* ============================================
   ТАБЛИЦА ДОСТУПНЫХ КАТЕГОРИЙ ТЕСТОВ
   ============================================ */

.tests-container {
    margin-top: 20px;
}

.test-item {
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.test-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.test-name {
    font-size: 18px;
    font-weight: 600;
}

.test-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    font-size: 14px;
}

.test-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.test-detail-label {
    opacity: 0.8;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.test-detail-value {
    font-weight: 600;
    font-size: 15px;
}

.test-unlimited {
    opacity: 0.9;
}

/* ============================================
   ВКЛАДКИ (TABS) ДЛЯ АДМИНИСТРАТОРОВ
   ============================================ */

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    padding-bottom: 5px;
}

.admin-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.admin-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px 8px 0 0;
}

.admin-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ПОИСК УЧЕНИКОВ/СОТРУДНИКОВ
   ============================================ */

.search-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-section .section-title {
    color: #333;
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.search-field {
    flex: 1;
}

.search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.search-select:focus {
    outline: none;
    border-color: #667eea;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-search {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   СПИСОК УЧЕНИКОВ/СОТРУДНИКОВ
   ============================================ */

.users-list-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.users-list-section .section-title {
    color: #333;
}

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

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    gap: 15px;
    transition: all 0.3s ease;
}

.admin-list-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.admin-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-list-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.admin-list-details {
    font-size: 15px;
    color: #666;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-list-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-admin-action {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-extend {
    background: #4CAF50;
    color: white;
}

.btn-extend:hover {
    background: #388e3c;
    transform: translateY(-2px);
}

.btn-revoke {
    background: #f44336;
    color: white;
}

.btn-revoke:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.btn-view-students {
    background: #2196F3;
    color: white;
}

.btn-view-students:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

.empty-results {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */

.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.admin-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;

}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.modal-body {
    margin-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.categories-checkboxes input[type="checkbox"] {
    width: auto;
    padding: 0;
    border: none;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group-inline .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.form-group-inline .form-group label {
    margin-bottom: 0;
    white-space: nowrap;
    min-width: 150px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.btn-modal {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-modal-cancel {
    background: #f5f5f5;
    color: #333;
}

.btn-modal-cancel:hover {
    background: #e0e0e0;
}

.btn-modal-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-modal-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-modal-danger {
    background: #f44336;
    color: white;
}

.btn-modal-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* ============================================
   СООБЩЕНИЯ И АЛЕРТЫ
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-icon {
    font-size: 20px;
}

.error-message {
    color: #f44336;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    color: #4CAF50;
    font-size: 14px;
    margin-top: 8px;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 15px;
}

.loading-overlay .loading-spinner {
    width: 50px;
    height: 50px;
    border-width: 5px;
    border-top-color: #667eea;
    border-left-color: #667eea;
}

.loading-text {
    font-size: 16px;
    color: #667eea;
    font-weight: 600;
}

/* ============================================
   КНОПКИ
   ============================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    #profileApp {
        padding: 15px;
    }

    .user-data-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 25px 20px;
    }

    .user-info-left {
        align-items: center;
    }

    .user-info-right {
        align-items: center;
        min-width: auto;
        width: 100%;
    }

    .admin-access-period {
        text-align: center;
    }

    .btn-edit-profile {
        width: 100%;
    }

    .test-details {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .admin-tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-group {
        flex-direction: column;
    }

    .search-select {
        min-width: 100%;
    }

    .btn-search {
        width: 100%;
    }

    .admin-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-list-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-admin-action {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .user-avatar {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }

    .user-full-name {
        font-size: 22px;
    }

    .section-title {
        font-size: 18px;
    }

    .test-name {
        font-size: 16px;
    }

    .test-group {
    margin-top: 20px;
    margin-bottom: 30px;
}
/* ============================================
   КНОПКИ ДЕЙСТВИЙ В ГРУППАХ
   ============================================ */

.action-btn.action-btn {
    font-size: 14px !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
}

.modal-action-btn {
    font-size: 15px !important;
    padding: 10px 25px !important;
    white-space: nowrap !important;
}
}
/* ── Вертикальный сайдбар ── */
.admin-tabs.vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: none;
    overflow-x: visible;
    padding-bottom: 0;
}
.admin-tabs.vertical .admin-tab {
    width: 100%;
    text-align: left;
    padding: 11px 16px;
    border-bottom: none;
    border-left: 3px solid transparent;
    border-radius: 10px;
    font-size: 14px;
}
.admin-tabs.vertical .admin-tab:hover {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 10px;
}
.admin-tabs.vertical .admin-tab.active {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    border-left-color: #667eea;
    border-bottom-color: transparent;
}

/* ── Десктоп: сайдбар слева, контент справа ── */
.admin-layout {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
}
.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9ff;
    border-radius: 16px;
    padding: 16px 12px;
    border: 1px solid #e8ecff;
    position: sticky;
    top: 20px;
}
.admin-sidebar-content {
    flex: 1 1 0%;
    min-width: 0;
    overflow: visible;
}

/* ── Мобильный: всё в колонку ── */
@media (max-width: 767px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        position: static;
    }
    .admin-tabs.vertical {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
    }
    .admin-tabs.vertical .admin-tab {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 8px 8px 0 0;
    }
    .admin-tabs.vertical .admin-tab.active {
        border-left-color: transparent;
        border-bottom-color: #667eea;
    }
}

/* ============================================
   МОБИЛЬНАЯ ОПТИМИЗАЦИЯ ПРОФИЛЯ — финальная
   ============================================ */
@media (max-width: 767px) {

    body { padding: 0 !important; }
    #profileApp { padding: 8px 8px 20px 8px !important; }

    /* ── Блок личных данных ── */
    .user-data-container {
        flex-direction: row !important;
        align-items: center !important;
        padding: 12px 14px !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
        flex-wrap: wrap;
    }
    .user-avatar { width: 52px !important; height: 52px !important; font-size: 26px !important; flex-shrink: 0 !important; }
    .user-info-left { flex: 1 !important; gap: 3px !important; min-width: 0 !important; align-items: flex-start !important; text-align: left !important; }
    .user-full-name { font-size: 16px !important; margin-bottom: 0 !important; }
    .user-contact-info { font-size: 13px !important; }
    .user-info-right { width: 100% !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 8px !important; align-items: stretch !important; min-width: 0 !important; }
    .btn-edit-profile { flex: 1 1 auto !important; padding: 10px 12px !important; font-size: 13px !important; margin-top: 0 !important; white-space: nowrap !important; text-align: center !important; }
    .btn-become-admin { flex: 1 1 auto !important; width: auto !important; margin-top: 0 !important; white-space: nowrap !important; }

    /* ── Присоединиться к преподавателю ── */
    div:has(> #inviteCodeInput) { flex-direction: column !important; align-items: stretch !important; }
    #inviteCodeInput { width: 100% !important; font-size: 15px !important; }

    /* ── Вкладки: сетка 2 колонки ── */
    .admin-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 5px !important;
        overflow-x: visible !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        margin-bottom: 12px !important;
    }
    .admin-tab { padding: 8px 6px !important; font-size: 12px !important; border-radius: 8px !important; border: 1px solid #e5e7eb !important; border-bottom: none !important; background: #f8f9ff !important; color: #666 !important; text-align: center !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .admin-tab.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; color: white !important; border-color: transparent !important; }

    /* ── overflow:hidden убираем ── */
    div[style*="overflow: hidden"], div[style*="overflow:hidden"] { overflow: visible !important; }

    /* ── ТАБЛИЦЫ → КАРТОЧКИ ── */
    #profileApp table thead { display: none !important; }
    #profileApp table, #profileApp table tbody { display: block !important; width: 100% !important; }
    #profileApp table tbody tr { display: block !important; background: white; border-radius: 8px; border: 1px solid #e5e7eb; border-left: none !important; box-shadow: none; margin: 0 0 8px 0; padding: 10px 12px 8px 12px; overflow: visible; }
    #profileApp table tbody tr:last-child { margin-bottom: 0; }
    #profileApp table tbody td { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 5px 0 !important; border: none !important; border-bottom: 1px solid #f0f0f0 !important; font-size: 14px; text-align: left !important; gap: 8px; min-height: 28px; }
    #profileApp table tbody td:first-child { display: block !important; font-size: 15px !important; font-weight: 600 !important; padding-top: 0 !important; padding-bottom: 7px !important; border-bottom: 1px solid #e0e0e0 !important; }
    #profileApp table tbody td:last-child { border-bottom: none !important; padding-bottom: 0 !important; }
    #profileApp table tbody td:nth-child(2)::before { content: "Срок доступа:"; color: #667eea; font-weight: 600; font-size: 13px; flex-shrink: 0; }
    #profileApp table tbody td:nth-child(3)::before { content: "Подписка:";     color: #667eea; font-weight: 600; font-size: 13px; flex-shrink: 0; }
    #profileApp table tbody td:nth-child(4)::before { content: "Попытки:";      color: #667eea; font-weight: 600; font-size: 13px; flex-shrink: 0; }
    #profileApp table tbody td:nth-child(5) { flex-direction: column !important; align-items: stretch !important; gap: 6px !important; padding-top: 8px !important; border-top: 1px solid #f0f0f0 !important; border-bottom: none !important; margin-top: 2px; }
    #profileApp table tbody td:nth-child(5) button, table tbody td:nth-child(5) .btn { width: 100% !important; display: flex !important; justify-content: center !important; font-size: 14px !important; padding: 10px 12px !important; box-sizing: border-box !important; white-space: normal !important; margin-left: 0 !important; }
    #profileApp table tbody td:nth-child(5) > div { flex-direction: column !important; width: 100% !important; gap: 6px !important; margin-left: 0 !important; display: flex !important; }

    /* ── ЗАГОЛОВКИ КОЛОНОК — скрываем только их через класс ── */
    .users-list-header-cols { display: none !important; }

    /* ── МОИ УЧЕНИКИ: карточки пользователей ── */
    .user-list-item { overflow: visible !important; margin-bottom: 10px !important; }

    .user-list-header {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 12px !important;
        position: relative;
    }

    /* Чекбокс — правый верхний угол */
    .user-list-header > input[type="checkbox"] {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        width: 22px !important;
        height: 22px !important;
    }

    /* Имя, отчество, фамилия */
    .user-list-header > div:nth-child(2) { font-size: 16px !important; font-weight: 700 !important; color: #333 !important; white-space: normal !important; padding-bottom: 2px; padding-right: 30px; }
    .user-list-header > div:nth-child(3), .user-list-header > div:nth-child(4) { font-size: 15px !important; font-weight: 600 !important; color: #555 !important; white-space: normal !important; padding-bottom: 2px; }

    /* Даты */
    .user-list-header > div:nth-child(5), .user-list-header > div:nth-child(6) { font-size: 13px !important; color: #888 !important; white-space: normal !important; }

    /* Группа */
    .user-list-header > div:nth-child(7) { font-size: 13px !important; color: #667eea !important; white-space: normal !important; padding-top: 2px; }

    /* Кнопки действий */
    .user-list-header > div:last-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        margin-top: 10px !important;
        padding-top: 10px !important;
        border-top: 1px solid #f0f0f0 !important;
        width: 100% !important;
    }
    .user-list-header > div:last-child button { width: 100% !important; min-width: 0 !important; font-size: 14px !important; padding: 10px 12px !important; justify-content: center !important; }

    /* Раскрытые тесты пользователя */
    .test-row { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; padding: 10px 0 !important; }
    .test-row > div:last-child { width: 100% !important; }
    .test-row div[style*="min-width: 220px"], .test-row div[style*="min-width:220px"] { min-width: 0 !important; width: 100% !important; }
    .test-row button { width: 100% !important; min-width: 0 !important; font-size: 13px !important; padding: 9px 10px !important; }

    /* ── ПОИСК ── */
    .search-section { padding: 12px !important; margin-bottom: 10px !important; }
    .search-form { flex-direction: column !important; align-items: stretch !important; }
    .search-input-group { flex-direction: column !important; }
    .search-select { min-width: 100% !important; }
    .btn-search { width: 100% !important; }

    /* ── ГРУППЫ ── */
    #groupsContainer .user-list-item > div:first-child { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; padding: 12px !important; }
    #groupsContainer .user-list-item > div:first-child > div:first-child { width: 100% !important; flex-direction: column !important; gap: 4px !important; }
    #groupsContainer .user-list-item > div:first-child > div:last-child { display: flex !important; flex-direction: column !important; gap: 6px !important; width: 100% !important; }
    #groupsContainer .user-list-item > div:first-child > div:last-child button { width: 100% !important; font-size: 14px !important; padding: 10px 12px !important; white-space: normal !important; }

    /* ── МОДАЛЬНЫЕ ОКНА ── */
    .stats-modal-content, .modal-content { width: 96% !important; max-width: 100% !important; max-height: 90vh !important; border-radius: 16px 16px 0 0 !important; overflow-y: auto !important; }
    .stats-modal-overlay, .admin-modal { align-items: flex-end !important; }
    .modal-footer, .stats-modal-footer { flex-direction: column !important; gap: 8px !important; }
    .modal-footer button, .stats-modal-footer button, .btn-modal { width: 100% !important; }

    /* ── ПРОЧЕЕ ── */
    .profile-section { padding: 14px !important; margin-bottom: 10px !important; }
    .section-title { font-size: 16px !important; }
    .users-list-section { padding: 12px !important; margin-bottom: 10px !important; }
    .admin-list-item { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; padding: 12px !important; }
    .admin-list-actions { width: 100% !important; flex-direction: column !important; gap: 6px !important; }
    .btn-admin-action { width: 100% !important; }
    div[style*="text-align: center"][style*="margin-top: 30px"] { display: flex !important; flex-direction: column !important; gap: 8px !important; margin-top: 16px !important; }
    div[style*="text-align: center"][style*="margin-top: 30px"] .btn { width: 100% !important; margin-left: 0 !important; }
}