/* ЧИСТЫЕ АДАПТИВНЫЕ СТИЛИ - ТОЛЬКО ДЛЯ ТАБЛИЦ СТУДЕНТОВ */

/* УБИРАЕМ ПРОБЛЕМНЫЕ СТИЛИ - ОСТАВЛЯЕМ ТОЛЬКО СТИЛИ ТАБЛИЦ */

/* ИСПРАВЛЕНИЕ ЦВЕТОВ БЕЙДЖЕЙ ДЛЯ ВСЕХ ЭКРАНОВ */
body .badge,
body .table .badge {
    color: #ffffff !important;
    border: 1px solid transparent !important;
    font-weight: 500 !important;
}

body .badge { background-color: #ff9800 !important; }
body .badge-primary { background-color: #007bff !important; }
body .badge-secondary { background-color: #6c757d !important; }
body .badge-success { background-color: #28a745 !important; }
body .badge-danger { background-color: #dc3545 !important; }
body .badge-warning { background-color: #ffc107 !important; color: #212529 !important; }
body .badge-info { background-color: #17a2b8 !important; }
body .badge-light { background-color: #f8f9fa !important; color: #212529 !important; }
body .badge-dark { background-color: #343a40 !important; }

/* МОБИЛЬНЫЕ ЭКРАНЫ (до 576px) - УЛЬТРАКОМПАКТНО */
@media (max-width: 576px) {
    /* УБИРАЕМ ГОРИЗОНТАЛЬНУЮ ПРОКРУТКУ ТОЛЬКО ДЛЯ ТАБЛИЦ */
    .table-responsive:not(.student-profile .table-responsive) {
        overflow-x: visible !important;
        overflow-y: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Только для таблиц студентов */
    .table:not(.student-profile .table) {
        font-size: 0.15rem !important;
        table-layout: fixed !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        line-height: 0.5 !important;
        border-collapse: collapse !important;
        margin: 0 !important;
    }
    
    .table th:not(.student-profile .table th),
    .table td:not(.student-profile .table td) {
        padding: 0px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        font-size: 0.15rem !important;
        line-height: 0.5 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        border-right: 1px solid #f1f3f4 !important;
    }
    
    /* Распределение ширины колонок = 100% */
    .col-number { width: 1% !important; }
    .col-name { width: 18% !important; }
    .col-direction { width: 9% !important; }
    .col-group { width: 4% !important; }
    .col-institution { width: 7% !important; }
    .col-email { width: 13% !important; }
    .col-phone { width: 9% !important; }
    .col-avgmark { width: 3% !important; }
    .col-reports { width: 3% !important; }
    .col-status { width: 9% !important; }
    .col-start { width: 7% !important; }
    .col-end { width: 7% !important; }
    .col-actions { width: 10% !important; }
    
    /* Компактные элементы */
    .table .badge:not(.student-profile .table .badge) {
        font-size: 0.15rem !important;
        padding: 0px !important;
        line-height: 0.5 !important;
        border-radius: 0px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: unset !important;
        display: inline-block !important;
        max-width: none !important;
    }
    
    .table .btn:not(.student-profile .table .btn) {
        font-size: 0.15rem !important;
        padding: 0px !important;
        line-height: 0.5 !important;
        min-height: 6px !important;
        border-radius: 0px !important;
    }
    
    /* Убираем прокрутку */
    .table-responsive:not(.student-profile .table-responsive) {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}

/* ПЛАНШЕТЫ И НОУТБУКИ (577px - 1920px) - КОМПАКТНЫЕ СТИЛИ */
@media (min-width: 577px) and (max-width: 1920px) {
    /* УБИРАЕМ ГОРИЗОНТАЛЬНУЮ ПРОКРУТКУ ТОЛЬКО ДЛЯ ТАБЛИЦ */
    html body .table-responsive:not(.student-profile .table-responsive) {
        overflow-x: visible !important;
        overflow-y: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Только для таблиц студентов - КОМПАКТНО НО ВСЕ ДАННЫЕ ВИДНЫ */
    html body .table:not(.student-profile .table) {
        font-size: 0.65rem !important;
        table-layout: auto !important;
        width: 100% !important;
        line-height: 1.1 !important;
        border-collapse: collapse !important;
        margin: 0 !important;
        min-width: auto !important;
    }
    
    html body .table th:not(.student-profile .table th),
    html body .table td:not(.student-profile .table td) {
        padding: 3px 4px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        border-right: 1px solid #f1f3f4 !important;
        min-width: auto !important;
    }
    
    /* УБИРАЕМ ФИКСИРОВАННУЮ ШИРИНУ КОЛОНОК - ПУСТЬ БРАУЗЕР САМ РАСПРЕДЕЛЯЕТ */
    
    /* КОМПАКТНЫЕ элементы для ноутбуков - ВСЕ ДАННЫЕ ДОЛЖНЫ ПОМЕСТИТЬСЯ */
    .table .badge:not(.student-profile .table .badge) {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
        line-height: 1.1 !important;
        border-radius: 2px !important;
    }
    
    .table .btn:not(.student-profile .table .btn) {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
        line-height: 1.1 !important;
        min-height: 18px !important;
        border-radius: 2px !important;
        margin: 1px !important;
    }
    
    .table .action-links a:not(.student-profile .table .action-links a) {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
        line-height: 1.1 !important;
        border-radius: 2px !important;
        margin-right: 1px !important;
    }
    
    .table .fas:not(.student-profile .table .fas), 
    .table .fa:not(.student-profile .table .fa) {
        font-size: 0.6rem !important;
        margin-right: 2px !important;
    }
    
    /* Убираем прокрутку */
    .table-responsive:not(.student-profile .table-responsive) {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}

/* ПРОФИЛИ СТУДЕНТОВ - ЧИТАЕМЫЕ НА ВСЕХ ЭКРАНАХ */
@media (max-width: 576px) {
    .student-profile .table {
        font-size: 0.9rem !important;
        table-layout: auto !important;
        line-height: 1.4 !important;
    }
    
    .student-profile .table th,
    .student-profile .table td {
        padding: 10px 8px !important;
        white-space: normal !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
}
/
* СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ ПЕРЕНОСА ТЕКСТА В БЕЙДЖАХ СТАТУСОВ */
@media (max-width: 576px) {
    /* Разрешаем перенос текста в бейджах статусов только на мобильных */
    .table .badge:not(.student-profile .table .badge) {
        white-space: normal !important;
        word-break: keep-all !important;
        overflow-wrap: break-word !important;
        max-width: 80px !important;
        display: inline-block !important;
        text-align: center !important;
        line-height: 1.1 !important;
    }
}

@media (min-width: 577px) {
    /* Разрешаем перенос текста в бейджах статусов на всех экранах кроме мобильных */
    .table .badge:not(.student-profile .table .badge) {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none !important;
        max-width: 150px !important;
        display: inline-block !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
}